hfs 0.47.0-alpha5 → 0.47.0-alpha6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/assets/{index-fb9e0c09.js → index-d55dfed9.js} +56 -56
- package/{frontend/assets/sha512-5c008206.js → admin/assets/sha512-9867267f.js} +1 -1
- package/admin/index.html +1 -1
- package/frontend/assets/index-3a32a9b9.css +1 -0
- package/frontend/assets/index-ad78cbad.js +116 -0
- package/{admin/assets/sha512-da763b08.js → frontend/assets/sha512-4c1cbf45.js} +1 -1
- package/frontend/fontello.css +5 -2
- package/frontend/fontello.woff2 +0 -0
- package/frontend/index.html +2 -2
- package/package.json +1 -1
- package/plugins/download-counter/plugin.js +15 -7
- package/plugins/download-counter/public/main.js +1 -1
- package/plugins/vhosting/plugin.js +5 -2
- package/src/QuickZipStream.js +3 -0
- package/src/api.auth.js +0 -3
- package/src/api.monitor.js +2 -2
- package/src/apiMiddleware.js +7 -6
- package/src/config.js +2 -2
- package/src/const.js +1 -1
- package/src/github.js +1 -1
- package/src/langs/embedded.js +3 -1
- package/src/langs/hfs-lang-es.json +118 -0
- package/src/langs/hfs-lang-it.json +5 -3
- package/src/langs/hfs-lang-nl.json +118 -0
- package/src/langs/hfs-lang-zh.json +25 -5
- package/src/log.js +3 -1
- package/src/perm.js +1 -1
- package/src/serveFile.js +1 -0
- package/src/throttler.js +1 -0
- package/src/update.js +3 -2
- package/frontend/assets/index-0e105986.js +0 -94
- package/frontend/assets/index-f2f8fd6b.css +0 -1
|
@@ -29,7 +29,7 @@ var v9=Object.defineProperty,y9=Object.defineProperties;var b9=Object.getOwnProp
|
|
|
29
29
|
`+o[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=s&&0<=a);break}}}finally{J0=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Zd(e):""}function j9(e){switch(e.tag){case 5:return Zd(e.type);case 16:return Zd("Lazy");case 13:return Zd("Suspense");case 19:return Zd("SuspenseList");case 0:case 2:case 15:return e=Z0(e.type,!1),e;case 11:return e=Z0(e.type.render,!1),e;case 1:return e=Z0(e.type,!0),e;default:return""}}function gb(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Wc:return"Fragment";case Uc:return"Portal";case pb:return"Profiler";case mC:return"StrictMode";case hb:return"Suspense";case mb:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case AM:return(e.displayName||"Context")+".Consumer";case FM:return(e._context.displayName||"Context")+".Provider";case gC:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case vC:return t=e.displayName||null,t!==null?t:gb(e.type)||"Memo";case gl:t=e._payload,e=e._init;try{return gb(e(t))}catch(n){}}return null}function H9(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return gb(t);case 8:return t===mC?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Vl(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function DM(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function V9(e){var t=DM(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n!="undefined"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Oh(e){e._valueTracker||(e._valueTracker=V9(e))}function BM(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=DM(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function jm(e){if(e=e||(typeof document!="undefined"?document:void 0),typeof e=="undefined")return null;try{return e.activeElement||e.body}catch(t){return e.body}}function vb(e,t){var n=t.checked;return jn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n!=null?n:e._wrapperState.initialChecked})}function Bk(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Vl(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function zM(e,t){t=t.checked,t!=null&&hC(e,"checked",t,!1)}function yb(e,t){zM(e,t);var n=Vl(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?bb(e,t.type,n):t.hasOwnProperty("defaultValue")&&bb(e,t.type,Vl(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function zk(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function bb(e,t,n){(t!=="number"||jm(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ef=Array.isArray;function au(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Vl(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function wb(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Te(91));return jn({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function jk(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Te(92));if(ef(n)){if(1<n.length)throw Error(Te(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Vl(n)}}function jM(e,t){var n=Vl(t.value),r=Vl(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Hk(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function HM(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Cb(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?HM(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Lh,VM=function(e){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Lh=Lh||document.createElement("div"),Lh.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Lh.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Rf(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var uf={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},U9=["Webkit","ms","Moz","O"];Object.keys(uf).forEach(function(e){U9.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),uf[t]=uf[e]})});function UM(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||uf.hasOwnProperty(e)&&uf[e]?(""+t).trim():t+"px"}function WM(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=UM(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var W9=jn({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 xb(e,t){if(t){if(W9[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Te(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Te(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Te(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Te(62))}}function Sb(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Eb=null;function yC(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Pb=null,cu=null,uu=null;function Vk(e){if(e=bp(e)){if(typeof Pb!="function")throw Error(Te(280));var t=e.stateNode;t&&(t=Kg(t),Pb(e.stateNode,e.type,t))}}function GM(e){cu?uu?uu.push(e):uu=[e]:cu=e}function KM(){if(cu){var e=cu,t=uu;if(uu=cu=null,Vk(e),t)for(e=0;e<t.length;e++)Vk(t[e])}}function qM(e,t){return e(t)}function YM(){}var e1=!1;function QM(e,t,n){if(e1)return e(t,n);e1=!0;try{return qM(e,t,n)}finally{e1=!1,(cu!==null||uu!==null)&&(YM(),KM())}}function Mf(e,t){var n=e.stateNode;if(n===null)return null;var r=Kg(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Te(231,t,typeof n));return n}var Ib=!1;if(js)try{var Md={};Object.defineProperty(Md,"passive",{get:function(){Ib=!0}}),window.addEventListener("test",Md,Md),window.removeEventListener("test",Md,Md)}catch(e){Ib=!1}function G9(e,t,n,r,o,i,s,a,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(p){this.onError(p)}}var df=!1,Hm=null,Vm=!1,kb=null,K9={onError:function(e){df=!0,Hm=e}};function q9(e,t,n,r,o,i,s,a,c){df=!1,Hm=null,G9.apply(K9,arguments)}function Y9(e,t,n,r,o,i,s,a,c){if(q9.apply(this,arguments),df){if(df){var d=Hm;df=!1,Hm=null}else throw Error(Te(198));Vm||(Vm=!0,kb=d)}}function nc(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function XM(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Uk(e){if(nc(e)!==e)throw Error(Te(188))}function Q9(e){var t=e.alternate;if(!t){if(t=nc(e),t===null)throw Error(Te(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Uk(o),e;if(i===r)return Uk(o),t;i=i.sibling}throw Error(Te(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(Te(189))}}if(n.alternate!==r)throw Error(Te(190))}if(n.tag!==3)throw Error(Te(188));return n.stateNode.current===n?e:t}function JM(e){return e=Q9(e),e!==null?ZM(e):null}function ZM(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ZM(e);if(t!==null)return t;e=e.sibling}return null}var eT=Fo.unstable_scheduleCallback,Wk=Fo.unstable_cancelCallback,X9=Fo.unstable_shouldYield,J9=Fo.unstable_requestPaint,Yn=Fo.unstable_now,Z9=Fo.unstable_getCurrentPriorityLevel,bC=Fo.unstable_ImmediatePriority,tT=Fo.unstable_UserBlockingPriority,Um=Fo.unstable_NormalPriority,eH=Fo.unstable_LowPriority,nT=Fo.unstable_IdlePriority,Vg=null,os=null;function tH(e){if(os&&typeof os.onCommitFiberRoot=="function")try{os.onCommitFiberRoot(Vg,e,void 0,(e.current.flags&128)===128)}catch(t){}}var Fi=Math.clz32?Math.clz32:oH,nH=Math.log,rH=Math.LN2;function oH(e){return e>>>=0,e===0?32:31-(nH(e)/rH|0)|0}var Fh=64,Ah=4194304;function tf(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Wm(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=tf(a):(i&=s,i!==0&&(r=tf(i)))}else s=n&~o,s!==0?r=tf(s):i!==0&&(r=tf(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Fi(t),o=1<<n,r|=e[n],t&=~o;return r}function iH(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 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+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function sH(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Fi(i),a=1<<s,c=o[s];c===-1?(!(a&n)||a&r)&&(o[s]=iH(a,t)):c<=t&&(e.expiredLanes|=a),i&=~a}}function _b(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function rT(){var e=Fh;return Fh<<=1,!(Fh&4194240)&&(Fh=64),e}function t1(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function vp(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Fi(t),e[t]=n}function lH(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Fi(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function wC(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Fi(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var sn=0;function oT(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var iT,CC,sT,lT,aT,$b=!1,Nh=[],Rl=null,Ml=null,Tl=null,Tf=new Map,Of=new Map,Cl=[],aH="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Gk(e,t){switch(e){case"focusin":case"focusout":Rl=null;break;case"dragenter":case"dragleave":Ml=null;break;case"mouseover":case"mouseout":Tl=null;break;case"pointerover":case"pointerout":Tf.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Of.delete(t.pointerId)}}function Td(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=bp(t),t!==null&&CC(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function cH(e,t,n,r,o){switch(t){case"focusin":return Rl=Td(Rl,e,t,n,r,o),!0;case"dragenter":return Ml=Td(Ml,e,t,n,r,o),!0;case"mouseover":return Tl=Td(Tl,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Tf.set(i,Td(Tf.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Of.set(i,Td(Of.get(i)||null,e,t,n,r,o)),!0}return!1}function cT(e){var t=xa(e.target);if(t!==null){var n=nc(t);if(n!==null){if(t=n.tag,t===13){if(t=XM(n),t!==null){e.blockedOn=t,aT(e.priority,function(){sT(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function mm(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Rb(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Eb=r,n.target.dispatchEvent(r),Eb=null}else return t=bp(n),t!==null&&CC(t),e.blockedOn=n,!1;t.shift()}return!0}function Kk(e,t,n){mm(e)&&n.delete(t)}function uH(){$b=!1,Rl!==null&&mm(Rl)&&(Rl=null),Ml!==null&&mm(Ml)&&(Ml=null),Tl!==null&&mm(Tl)&&(Tl=null),Tf.forEach(Kk),Of.forEach(Kk)}function Od(e,t){e.blockedOn===t&&(e.blockedOn=null,$b||($b=!0,Fo.unstable_scheduleCallback(Fo.unstable_NormalPriority,uH)))}function Lf(e){function t(o){return Od(o,e)}if(0<Nh.length){Od(Nh[0],e);for(var n=1;n<Nh.length;n++){var r=Nh[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Rl!==null&&Od(Rl,e),Ml!==null&&Od(Ml,e),Tl!==null&&Od(Tl,e),Tf.forEach(t),Of.forEach(t),n=0;n<Cl.length;n++)r=Cl[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Cl.length&&(n=Cl[0],n.blockedOn===null);)cT(n),n.blockedOn===null&&Cl.shift()}var du=Qs.ReactCurrentBatchConfig,Gm=!0;function dH(e,t,n,r){var o=sn,i=du.transition;du.transition=null;try{sn=1,xC(e,t,n,r)}finally{sn=o,du.transition=i}}function fH(e,t,n,r){var o=sn,i=du.transition;du.transition=null;try{sn=4,xC(e,t,n,r)}finally{sn=o,du.transition=i}}function xC(e,t,n,r){if(Gm){var o=Rb(e,t,n,r);if(o===null)d1(e,t,r,Km,n),Gk(e,r);else if(cH(o,e,t,n,r))r.stopPropagation();else if(Gk(e,r),t&4&&-1<aH.indexOf(e)){for(;o!==null;){var i=bp(o);if(i!==null&&iT(i),i=Rb(e,t,n,r),i===null&&d1(e,t,r,Km,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else d1(e,t,r,null,n)}}var Km=null;function Rb(e,t,n,r){if(Km=null,e=yC(r),e=xa(e),e!==null)if(t=nc(e),t===null)e=null;else if(n=t.tag,n===13){if(e=XM(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Km=e,null}function uT(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Z9()){case bC:return 1;case tT:return 4;case Um:case eH:return 16;case nT:return 536870912;default:return 16}default:return 16}}var El=null,SC=null,gm=null;function dT(){if(gm)return gm;var e,t=SC,n=t.length,r,o="value"in El?El.value:El.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return gm=o.slice(e,1<r?1-r:void 0)}function vm(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Dh(){return!0}function qk(){return!1}function jo(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Dh:qk,this.isPropagationStopped=qk,this}return jn(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Dh)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Dh)},persist:function(){},isPersistent:Dh}),t}var Ku={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},EC=jo(Ku),yp=jn({},Ku,{view:0,detail:0}),pH=jo(yp),n1,r1,Ld,Ug=jn({},yp,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:PC,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ld&&(Ld&&e.type==="mousemove"?(n1=e.screenX-Ld.screenX,r1=e.screenY-Ld.screenY):r1=n1=0,Ld=e),n1)},movementY:function(e){return"movementY"in e?e.movementY:r1}}),Yk=jo(Ug),hH=jn({},Ug,{dataTransfer:0}),mH=jo(hH),gH=jn({},yp,{relatedTarget:0}),o1=jo(gH),vH=jn({},Ku,{animationName:0,elapsedTime:0,pseudoElement:0}),yH=jo(vH),bH=jn({},Ku,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),wH=jo(bH),CH=jn({},Ku,{data:0}),Qk=jo(CH),xH={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},SH={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},EH={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function PH(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=EH[e])?!!t[e]:!1}function PC(){return PH}var IH=jn({},yp,{key:function(e){if(e.key){var t=xH[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=vm(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?SH[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:PC,charCode:function(e){return e.type==="keypress"?vm(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?vm(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),kH=jo(IH),_H=jn({},Ug,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xk=jo(_H),$H=jn({},yp,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:PC}),RH=jo($H),MH=jn({},Ku,{propertyName:0,elapsedTime:0,pseudoElement:0}),TH=jo(MH),OH=jn({},Ug,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),LH=jo(OH),FH=[9,13,27,32],IC=js&&"CompositionEvent"in window,ff=null;js&&"documentMode"in document&&(ff=document.documentMode);var AH=js&&"TextEvent"in window&&!ff,fT=js&&(!IC||ff&&8<ff&&11>=ff),Jk=String.fromCharCode(32),Zk=!1;function pT(e,t){switch(e){case"keyup":return FH.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hT(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Gc=!1;function NH(e,t){switch(e){case"compositionend":return hT(t);case"keypress":return t.which!==32?null:(Zk=!0,Jk);case"textInput":return e=t.data,e===Jk&&Zk?null:e;default:return null}}function DH(e,t){if(Gc)return e==="compositionend"||!IC&&pT(e,t)?(e=dT(),gm=SC=El=null,Gc=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return fT&&t.locale!=="ko"?null:t.data;default:return null}}var BH={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function e2(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!BH[e.type]:t==="textarea"}function mT(e,t,n,r){GM(r),t=qm(t,"onChange"),0<t.length&&(n=new EC("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var pf=null,Ff=null;function zH(e){IT(e,0)}function Wg(e){var t=Yc(e);if(BM(t))return e}function jH(e,t){if(e==="change")return t}var gT=!1;if(js){var i1;if(js){var s1="oninput"in document;if(!s1){var t2=document.createElement("div");t2.setAttribute("oninput","return;"),s1=typeof t2.oninput=="function"}i1=s1}else i1=!1;gT=i1&&(!document.documentMode||9<document.documentMode)}function n2(){pf&&(pf.detachEvent("onpropertychange",vT),Ff=pf=null)}function vT(e){if(e.propertyName==="value"&&Wg(Ff)){var t=[];mT(t,Ff,e,yC(e)),QM(zH,t)}}function HH(e,t,n){e==="focusin"?(n2(),pf=t,Ff=n,pf.attachEvent("onpropertychange",vT)):e==="focusout"&&n2()}function VH(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Wg(Ff)}function UH(e,t){if(e==="click")return Wg(t)}function WH(e,t){if(e==="input"||e==="change")return Wg(t)}function GH(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Di=typeof Object.is=="function"?Object.is:GH;function Af(e,t){if(Di(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!fb.call(t,o)||!Di(e[o],t[o]))return!1}return!0}function r2(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function o2(e,t){var n=r2(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=r2(n)}}function yT(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yT(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bT(){for(var e=window,t=jm();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch(r){n=!1}if(n)e=t.contentWindow;else break;t=jm(e.document)}return t}function kC(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function KH(e){var t=bT(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&yT(n.ownerDocument.documentElement,n)){if(r!==null&&kC(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=o2(n,i);var s=o2(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var qH=js&&"documentMode"in document&&11>=document.documentMode,Kc=null,Mb=null,hf=null,Tb=!1;function i2(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Tb||Kc==null||Kc!==jm(r)||(r=Kc,"selectionStart"in r&&kC(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}),hf&&Af(hf,r)||(hf=r,r=qm(Mb,"onSelect"),0<r.length&&(t=new EC("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Kc)))}function Bh(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var qc={animationend:Bh("Animation","AnimationEnd"),animationiteration:Bh("Animation","AnimationIteration"),animationstart:Bh("Animation","AnimationStart"),transitionend:Bh("Transition","TransitionEnd")},l1={},wT={};js&&(wT=document.createElement("div").style,"AnimationEvent"in window||(delete qc.animationend.animation,delete qc.animationiteration.animation,delete qc.animationstart.animation),"TransitionEvent"in window||delete qc.transitionend.transition);function Gg(e){if(l1[e])return l1[e];if(!qc[e])return e;var t=qc[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in wT)return l1[e]=t[n];return e}var CT=Gg("animationend"),xT=Gg("animationiteration"),ST=Gg("animationstart"),ET=Gg("transitionend"),PT=new Map,s2="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ea(e,t){PT.set(e,t),tc(t,[e])}for(var a1=0;a1<s2.length;a1++){var c1=s2[a1],YH=c1.toLowerCase(),QH=c1[0].toUpperCase()+c1.slice(1);ea(YH,"on"+QH)}ea(CT,"onAnimationEnd");ea(xT,"onAnimationIteration");ea(ST,"onAnimationStart");ea("dblclick","onDoubleClick");ea("focusin","onFocus");ea("focusout","onBlur");ea(ET,"onTransitionEnd");xu("onMouseEnter",["mouseout","mouseover"]);xu("onMouseLeave",["mouseout","mouseover"]);xu("onPointerEnter",["pointerout","pointerover"]);xu("onPointerLeave",["pointerout","pointerover"]);tc("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));tc("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));tc("onBeforeInput",["compositionend","keypress","textInput","paste"]);tc("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));tc("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));tc("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nf="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),XH=new Set("cancel close invalid load scroll toggle".split(" ").concat(nf));function l2(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Y9(r,t,void 0,e),e.currentTarget=null}function IT(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],c=a.instance,d=a.currentTarget;if(a=a.listener,c!==i&&o.isPropagationStopped())break e;l2(o,a,d),i=c}else for(s=0;s<r.length;s++){if(a=r[s],c=a.instance,d=a.currentTarget,a=a.listener,c!==i&&o.isPropagationStopped())break e;l2(o,a,d),i=c}}}if(Vm)throw e=kb,Vm=!1,kb=null,e}function Cn(e,t){var n=t[Nb];n===void 0&&(n=t[Nb]=new Set);var r=e+"__bubble";n.has(r)||(kT(t,e,2,!1),n.add(r))}function u1(e,t,n){var r=0;t&&(r|=4),kT(n,e,r,t)}var zh="_reactListening"+Math.random().toString(36).slice(2);function Nf(e){if(!e[zh]){e[zh]=!0,LM.forEach(function(n){n!=="selectionchange"&&(XH.has(n)||u1(n,!1,e),u1(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[zh]||(t[zh]=!0,u1("selectionchange",!1,t))}}function kT(e,t,n,r){switch(uT(t)){case 1:var o=dH;break;case 4:o=fH;break;default:o=xC}n=o.bind(null,t,n,e),o=void 0,!Ib||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function d1(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var c=s.tag;if((c===3||c===4)&&(c=s.stateNode.containerInfo,c===o||c.nodeType===8&&c.parentNode===o))return;s=s.return}for(;a!==null;){if(s=xa(a),s===null)return;if(c=s.tag,c===5||c===6){r=i=s;continue e}a=a.parentNode}}r=r.return}QM(function(){var d=i,p=yC(n),h=[];e:{var m=PT.get(e);if(m!==void 0){var g=EC,y=e;switch(e){case"keypress":if(vm(n)===0)break e;case"keydown":case"keyup":g=kH;break;case"focusin":y="focus",g=o1;break;case"focusout":y="blur",g=o1;break;case"beforeblur":case"afterblur":g=o1;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=Yk;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=mH;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=RH;break;case CT:case xT:case ST:g=yH;break;case ET:g=TH;break;case"scroll":g=pH;break;case"wheel":g=LH;break;case"copy":case"cut":case"paste":g=wH;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Xk}var v=(t&4)!==0,S=!v&&e==="scroll",w=v?m!==null?m+"Capture":null:m;v=[];for(var C=d,x;C!==null;){x=C;var P=x.stateNode;if(x.tag===5&&P!==null&&(x=P,w!==null&&(P=Mf(C,w),P!=null&&v.push(Df(C,P,x)))),S)break;C=C.return}0<v.length&&(m=new g(m,y,null,n,p),h.push({event:m,listeners:v}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",m&&n!==Eb&&(y=n.relatedTarget||n.fromElement)&&(xa(y)||y[Hs]))break e;if((g||m)&&(m=p.window===p?p:(m=p.ownerDocument)?m.defaultView||m.parentWindow:window,g?(y=n.relatedTarget||n.toElement,g=d,y=y?xa(y):null,y!==null&&(S=nc(y),y!==S||y.tag!==5&&y.tag!==6)&&(y=null)):(g=null,y=d),g!==y)){if(v=Yk,P="onMouseLeave",w="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(v=Xk,P="onPointerLeave",w="onPointerEnter",C="pointer"),S=g==null?m:Yc(g),x=y==null?m:Yc(y),m=new v(P,C+"leave",g,n,p),m.target=S,m.relatedTarget=x,P=null,xa(p)===d&&(v=new v(w,C+"enter",y,n,p),v.target=x,v.relatedTarget=S,P=v),S=P,g&&y)t:{for(v=g,w=y,C=0,x=v;x;x=Ec(x))C++;for(x=0,P=w;P;P=Ec(P))x++;for(;0<C-x;)v=Ec(v),C--;for(;0<x-C;)w=Ec(w),x--;for(;C--;){if(v===w||w!==null&&v===w.alternate)break t;v=Ec(v),w=Ec(w)}v=null}else v=null;g!==null&&a2(h,m,g,v,!1),y!==null&&S!==null&&a2(h,S,y,v,!0)}}e:{if(m=d?Yc(d):window,g=m.nodeName&&m.nodeName.toLowerCase(),g==="select"||g==="input"&&m.type==="file")var _=jH;else if(e2(m))if(gT)_=WH;else{_=VH;var I=HH}else(g=m.nodeName)&&g.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(_=UH);if(_&&(_=_(e,d))){mT(h,_,n,p);break e}I&&I(e,m,d),e==="focusout"&&(I=m._wrapperState)&&I.controlled&&m.type==="number"&&bb(m,"number",m.value)}switch(I=d?Yc(d):window,e){case"focusin":(e2(I)||I.contentEditable==="true")&&(Kc=I,Mb=d,hf=null);break;case"focusout":hf=Mb=Kc=null;break;case"mousedown":Tb=!0;break;case"contextmenu":case"mouseup":case"dragend":Tb=!1,i2(h,n,p);break;case"selectionchange":if(qH)break;case"keydown":case"keyup":i2(h,n,p)}var k;if(IC)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else Gc?pT(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(fT&&n.locale!=="ko"&&(Gc||M!=="onCompositionStart"?M==="onCompositionEnd"&&Gc&&(k=dT()):(El=p,SC="value"in El?El.value:El.textContent,Gc=!0)),I=qm(d,M),0<I.length&&(M=new Qk(M,e,null,n,p),h.push({event:M,listeners:I}),k?M.data=k:(k=hT(n),k!==null&&(M.data=k)))),(k=AH?NH(e,n):DH(e,n))&&(d=qm(d,"onBeforeInput"),0<d.length&&(p=new Qk("onBeforeInput","beforeinput",null,n,p),h.push({event:p,listeners:d}),p.data=k))}IT(h,t)})}function Df(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qm(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Mf(e,n),i!=null&&r.unshift(Df(e,i,o)),i=Mf(e,t),i!=null&&r.push(Df(e,i,o))),e=e.return}return r}function Ec(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function a2(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,c=a.alternate,d=a.stateNode;if(c!==null&&c===r)break;a.tag===5&&d!==null&&(a=d,o?(c=Mf(n,i),c!=null&&s.unshift(Df(n,c,a))):o||(c=Mf(n,i),c!=null&&s.push(Df(n,c,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var JH=/\r\n?/g,ZH=/\u0000|\uFFFD/g;function c2(e){return(typeof e=="string"?e:""+e).replace(JH,`
|
|
30
30
|
`).replace(ZH,"")}function jh(e,t,n){if(t=c2(t),c2(e)!==t&&n)throw Error(Te(425))}function Ym(){}var Ob=null,Lb=null;function Fb(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ab=typeof setTimeout=="function"?setTimeout:void 0,e8=typeof clearTimeout=="function"?clearTimeout:void 0,u2=typeof Promise=="function"?Promise:void 0,t8=typeof queueMicrotask=="function"?queueMicrotask:typeof u2!="undefined"?function(e){return u2.resolve(null).then(e).catch(n8)}:Ab;function n8(e){setTimeout(function(){throw e})}function f1(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Lf(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Lf(t)}function Ol(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function d2(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var qu=Math.random().toString(36).slice(2),ns="__reactFiber$"+qu,Bf="__reactProps$"+qu,Hs="__reactContainer$"+qu,Nb="__reactEvents$"+qu,r8="__reactListeners$"+qu,o8="__reactHandles$"+qu;function xa(e){var t=e[ns];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Hs]||n[ns]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=d2(e);e!==null;){if(n=e[ns])return n;e=d2(e)}return t}e=n,n=e.parentNode}return null}function bp(e){return e=e[ns]||e[Hs],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Yc(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Te(33))}function Kg(e){return e[Bf]||null}var Db=[],Qc=-1;function ta(e){return{current:e}}function En(e){0>Qc||(e.current=Db[Qc],Db[Qc]=null,Qc--)}function gn(e,t){Qc++,Db[Qc]=e.current,e.current=t}var Ul={},Fr=ta(Ul),so=ta(!1),Aa=Ul;function Su(e,t){var n=e.type.contextTypes;if(!n)return Ul;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function lo(e){return e=e.childContextTypes,e!=null}function Qm(){En(so),En(Fr)}function f2(e,t,n){if(Fr.current!==Ul)throw Error(Te(168));gn(Fr,t),gn(so,n)}function _T(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(Te(108,H9(e)||"Unknown",o));return jn({},n,r)}function Xm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ul,Aa=Fr.current,gn(Fr,e),gn(so,so.current),!0}function p2(e,t,n){var r=e.stateNode;if(!r)throw Error(Te(169));n?(e=_T(e,t,Aa),r.__reactInternalMemoizedMergedChildContext=e,En(so),En(Fr),gn(Fr,e)):En(so),gn(so,n)}var Fs=null,qg=!1,p1=!1;function $T(e){Fs===null?Fs=[e]:Fs.push(e)}function i8(e){qg=!0,$T(e)}function na(){if(!p1&&Fs!==null){p1=!0;var e=0,t=sn;try{var n=Fs;for(sn=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Fs=null,qg=!1}catch(o){throw Fs!==null&&(Fs=Fs.slice(e+1)),eT(bC,na),o}finally{sn=t,p1=!1}}return null}var Xc=[],Jc=0,Jm=null,Zm=0,li=[],ai=0,Na=null,As=1,Ns="";function ga(e,t){Xc[Jc++]=Zm,Xc[Jc++]=Jm,Jm=e,Zm=t}function RT(e,t,n){li[ai++]=As,li[ai++]=Ns,li[ai++]=Na,Na=e;var r=As;e=Ns;var o=32-Fi(r)-1;r&=~(1<<o),n+=1;var i=32-Fi(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,As=1<<32-Fi(t)+o|n<<o|r,Ns=i+e}else As=1<<i|n<<o|r,Ns=e}function _C(e){e.return!==null&&(ga(e,1),RT(e,1,0))}function $C(e){for(;e===Jm;)Jm=Xc[--Jc],Xc[Jc]=null,Zm=Xc[--Jc],Xc[Jc]=null;for(;e===Na;)Na=li[--ai],li[ai]=null,Ns=li[--ai],li[ai]=null,As=li[--ai],li[ai]=null}var To=null,Ro=null,Mn=!1,Mi=null;function MT(e,t){var n=ci(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function h2(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,To=e,Ro=Ol(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,To=e,Ro=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Na!==null?{id:As,overflow:Ns}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ci(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,To=e,Ro=null,!0):!1;default:return!1}}function Bb(e){return(e.mode&1)!==0&&(e.flags&128)===0}function zb(e){if(Mn){var t=Ro;if(t){var n=t;if(!h2(e,t)){if(Bb(e))throw Error(Te(418));t=Ol(n.nextSibling);var r=To;t&&h2(e,t)?MT(r,n):(e.flags=e.flags&-4097|2,Mn=!1,To=e)}}else{if(Bb(e))throw Error(Te(418));e.flags=e.flags&-4097|2,Mn=!1,To=e}}}function m2(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;To=e}function Hh(e){if(e!==To)return!1;if(!Mn)return m2(e),Mn=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Fb(e.type,e.memoizedProps)),t&&(t=Ro)){if(Bb(e))throw TT(),Error(Te(418));for(;t;)MT(e,t),t=Ol(t.nextSibling)}if(m2(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Te(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ro=Ol(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ro=null}}else Ro=To?Ol(e.stateNode.nextSibling):null;return!0}function TT(){for(var e=Ro;e;)e=Ol(e.nextSibling)}function Eu(){Ro=To=null,Mn=!1}function RC(e){Mi===null?Mi=[e]:Mi.push(e)}var s8=Qs.ReactCurrentBatchConfig;function _i(e,t){if(e&&e.defaultProps){t=jn({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var eg=ta(null),tg=null,Zc=null,MC=null;function TC(){MC=Zc=tg=null}function OC(e){var t=eg.current;En(eg),e._currentValue=t}function jb(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function fu(e,t){tg=e,MC=Zc=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ro=!0),e.firstContext=null)}function hi(e){var t=e._currentValue;if(MC!==e)if(e={context:e,memoizedValue:t,next:null},Zc===null){if(tg===null)throw Error(Te(308));Zc=e,tg.dependencies={lanes:0,firstContext:e}}else Zc=Zc.next=e;return t}var Sa=null;function LC(e){Sa===null?Sa=[e]:Sa.push(e)}function OT(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,LC(t)):(n.next=o.next,o.next=n),t.interleaved=n,Vs(e,r)}function Vs(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var vl=!1;function FC(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function LT(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Bs(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ll(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Gt&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Vs(e,n)}return o=r.interleaved,o===null?(t.next=t,LC(r)):(t.next=o.next,o.next=t),r.interleaved=t,Vs(e,n)}function ym(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wC(e,n)}}function g2(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ng(e,t,n,r){var o=e.updateQueue;vl=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var c=a,d=c.next;c.next=null,s===null?i=d:s.next=d,s=c;var p=e.alternate;p!==null&&(p=p.updateQueue,a=p.lastBaseUpdate,a!==s&&(a===null?p.firstBaseUpdate=d:a.next=d,p.lastBaseUpdate=c))}if(i!==null){var h=o.baseState;s=0,p=d=c=null,a=i;do{var m=a.lane,g=a.eventTime;if((r&m)===m){p!==null&&(p=p.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,v=a;switch(m=t,g=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){h=y.call(g,h,m);break e}h=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,m=typeof y=="function"?y.call(g,h,m):y,m==null)break e;h=jn({},h,m);break e;case 2:vl=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,m=o.effects,m===null?o.effects=[a]:m.push(a))}else g={eventTime:g,lane:m,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(d=p=g,c=h):p=p.next=g,s|=m;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;m=a,a=m.next,m.next=null,o.lastBaseUpdate=m,o.shared.pending=null}}while(1);if(p===null&&(c=h),o.baseState=c,o.firstBaseUpdate=d,o.lastBaseUpdate=p,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Ba|=s,e.lanes=s,e.memoizedState=h}}function v2(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(Te(191,o));o.call(r)}}}var FT=new OM.Component().refs;function Hb(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:jn({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Yg={isMounted:function(e){return(e=e._reactInternals)?nc(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ur(),o=Al(e),i=Bs(r,o);i.payload=t,n!=null&&(i.callback=n),t=Ll(e,i,o),t!==null&&(Ai(t,e,o,r),ym(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ur(),o=Al(e),i=Bs(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ll(e,i,o),t!==null&&(Ai(t,e,o,r),ym(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ur(),r=Al(e),o=Bs(n,r);o.tag=2,t!=null&&(o.callback=t),t=Ll(e,o,r),t!==null&&(Ai(t,e,r,n),ym(t,e,r))}};function y2(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Af(n,r)||!Af(o,i):!0}function AT(e,t,n){var r=!1,o=Ul,i=t.contextType;return typeof i=="object"&&i!==null?i=hi(i):(o=lo(t)?Aa:Fr.current,r=t.contextTypes,i=(r=r!=null)?Su(e,o):Ul),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Yg,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function b2(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Yg.enqueueReplaceState(t,t.state,null)}function Vb(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=FT,FC(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=hi(i):(i=lo(t)?Aa:Fr.current,o.context=Su(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Hb(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Yg.enqueueReplaceState(o,o.state,null),ng(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Fd(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Te(309));var r=n.stateNode}if(!r)throw Error(Te(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=o.refs;a===FT&&(a=o.refs={}),s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(Te(284));if(!n._owner)throw Error(Te(290,e))}return e}function Vh(e,t){throw e=Object.prototype.toString.call(t),Error(Te(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function w2(e){var t=e._init;return t(e._payload)}function NT(e){function t(w,C){if(e){var x=w.deletions;x===null?(w.deletions=[C],w.flags|=16):x.push(C)}}function n(w,C){if(!e)return null;for(;C!==null;)t(w,C),C=C.sibling;return null}function r(w,C){for(w=new Map;C!==null;)C.key!==null?w.set(C.key,C):w.set(C.index,C),C=C.sibling;return w}function o(w,C){return w=Nl(w,C),w.index=0,w.sibling=null,w}function i(w,C,x){return w.index=x,e?(x=w.alternate,x!==null?(x=x.index,x<C?(w.flags|=2,C):x):(w.flags|=2,C)):(w.flags|=1048576,C)}function s(w){return e&&w.alternate===null&&(w.flags|=2),w}function a(w,C,x,P){return C===null||C.tag!==6?(C=w1(x,w.mode,P),C.return=w,C):(C=o(C,x),C.return=w,C)}function c(w,C,x,P){var _=x.type;return _===Wc?p(w,C,x.props.children,P,x.key):C!==null&&(C.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===gl&&w2(_)===C.type)?(P=o(C,x.props),P.ref=Fd(w,C,x),P.return=w,P):(P=Em(x.type,x.key,x.props,null,w.mode,P),P.ref=Fd(w,C,x),P.return=w,P)}function d(w,C,x,P){return C===null||C.tag!==4||C.stateNode.containerInfo!==x.containerInfo||C.stateNode.implementation!==x.implementation?(C=C1(x,w.mode,P),C.return=w,C):(C=o(C,x.children||[]),C.return=w,C)}function p(w,C,x,P,_){return C===null||C.tag!==7?(C=$a(x,w.mode,P,_),C.return=w,C):(C=o(C,x),C.return=w,C)}function h(w,C,x){if(typeof C=="string"&&C!==""||typeof C=="number")return C=w1(""+C,w.mode,x),C.return=w,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case Th:return x=Em(C.type,C.key,C.props,null,w.mode,x),x.ref=Fd(w,null,C),x.return=w,x;case Uc:return C=C1(C,w.mode,x),C.return=w,C;case gl:var P=C._init;return h(w,P(C._payload),x)}if(ef(C)||Rd(C))return C=$a(C,w.mode,x,null),C.return=w,C;Vh(w,C)}return null}function m(w,C,x,P){var _=C!==null?C.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return _!==null?null:a(w,C,""+x,P);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Th:return x.key===_?c(w,C,x,P):null;case Uc:return x.key===_?d(w,C,x,P):null;case gl:return _=x._init,m(w,C,_(x._payload),P)}if(ef(x)||Rd(x))return _!==null?null:p(w,C,x,P,null);Vh(w,x)}return null}function g(w,C,x,P,_){if(typeof P=="string"&&P!==""||typeof P=="number")return w=w.get(x)||null,a(C,w,""+P,_);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case Th:return w=w.get(P.key===null?x:P.key)||null,c(C,w,P,_);case Uc:return w=w.get(P.key===null?x:P.key)||null,d(C,w,P,_);case gl:var I=P._init;return g(w,C,x,I(P._payload),_)}if(ef(P)||Rd(P))return w=w.get(x)||null,p(C,w,P,_,null);Vh(C,P)}return null}function y(w,C,x,P){for(var _=null,I=null,k=C,M=C=0,O=null;k!==null&&M<x.length;M++){k.index>M?(O=k,k=null):O=k.sibling;var F=m(w,k,x[M],P);if(F===null){k===null&&(k=O);break}e&&k&&F.alternate===null&&t(w,k),C=i(F,C,M),I===null?_=F:I.sibling=F,I=F,k=O}if(M===x.length)return n(w,k),Mn&&ga(w,M),_;if(k===null){for(;M<x.length;M++)k=h(w,x[M],P),k!==null&&(C=i(k,C,M),I===null?_=k:I.sibling=k,I=k);return Mn&&ga(w,M),_}for(k=r(w,k);M<x.length;M++)O=g(k,w,M,x[M],P),O!==null&&(e&&O.alternate!==null&&k.delete(O.key===null?M:O.key),C=i(O,C,M),I===null?_=O:I.sibling=O,I=O);return e&&k.forEach(function(L){return t(w,L)}),Mn&&ga(w,M),_}function v(w,C,x,P){var _=Rd(x);if(typeof _!="function")throw Error(Te(150));if(x=_.call(x),x==null)throw Error(Te(151));for(var I=_=null,k=C,M=C=0,O=null,F=x.next();k!==null&&!F.done;M++,F=x.next()){k.index>M?(O=k,k=null):O=k.sibling;var L=m(w,k,F.value,P);if(L===null){k===null&&(k=O);break}e&&k&&L.alternate===null&&t(w,k),C=i(L,C,M),I===null?_=L:I.sibling=L,I=L,k=O}if(F.done)return n(w,k),Mn&&ga(w,M),_;if(k===null){for(;!F.done;M++,F=x.next())F=h(w,F.value,P),F!==null&&(C=i(F,C,M),I===null?_=F:I.sibling=F,I=F);return Mn&&ga(w,M),_}for(k=r(w,k);!F.done;M++,F=x.next())F=g(k,w,M,F.value,P),F!==null&&(e&&F.alternate!==null&&k.delete(F.key===null?M:F.key),C=i(F,C,M),I===null?_=F:I.sibling=F,I=F);return e&&k.forEach(function(D){return t(w,D)}),Mn&&ga(w,M),_}function S(w,C,x,P){if(typeof x=="object"&&x!==null&&x.type===Wc&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Th:e:{for(var _=x.key,I=C;I!==null;){if(I.key===_){if(_=x.type,_===Wc){if(I.tag===7){n(w,I.sibling),C=o(I,x.props.children),C.return=w,w=C;break e}}else if(I.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===gl&&w2(_)===I.type){n(w,I.sibling),C=o(I,x.props),C.ref=Fd(w,I,x),C.return=w,w=C;break e}n(w,I);break}else t(w,I);I=I.sibling}x.type===Wc?(C=$a(x.props.children,w.mode,P,x.key),C.return=w,w=C):(P=Em(x.type,x.key,x.props,null,w.mode,P),P.ref=Fd(w,C,x),P.return=w,w=P)}return s(w);case Uc:e:{for(I=x.key;C!==null;){if(C.key===I)if(C.tag===4&&C.stateNode.containerInfo===x.containerInfo&&C.stateNode.implementation===x.implementation){n(w,C.sibling),C=o(C,x.children||[]),C.return=w,w=C;break e}else{n(w,C);break}else t(w,C);C=C.sibling}C=C1(x,w.mode,P),C.return=w,w=C}return s(w);case gl:return I=x._init,S(w,C,I(x._payload),P)}if(ef(x))return y(w,C,x,P);if(Rd(x))return v(w,C,x,P);Vh(w,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,C!==null&&C.tag===6?(n(w,C.sibling),C=o(C,x),C.return=w,w=C):(n(w,C),C=w1(x,w.mode,P),C.return=w,w=C),s(w)):n(w,C)}return S}var Pu=NT(!0),DT=NT(!1),wp={},is=ta(wp),zf=ta(wp),jf=ta(wp);function Ea(e){if(e===wp)throw Error(Te(174));return e}function AC(e,t){switch(gn(jf,t),gn(zf,e),gn(is,wp),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Cb(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Cb(t,e)}En(is),gn(is,t)}function Iu(){En(is),En(zf),En(jf)}function BT(e){Ea(jf.current);var t=Ea(is.current),n=Cb(t,e.type);t!==n&&(gn(zf,e),gn(is,n))}function NC(e){zf.current===e&&(En(is),En(zf))}var Nn=ta(0);function rg(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var h1=[];function DC(){for(var e=0;e<h1.length;e++)h1[e]._workInProgressVersionPrimary=null;h1.length=0}var bm=Qs.ReactCurrentDispatcher,m1=Qs.ReactCurrentBatchConfig,Da=0,Bn=null,rr=null,pr=null,og=!1,mf=!1,Hf=0,l8=0;function kr(){throw Error(Te(321))}function BC(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Di(e[n],t[n]))return!1;return!0}function zC(e,t,n,r,o,i){if(Da=i,Bn=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,bm.current=e===null||e.memoizedState===null?d8:f8,e=n(r,o),mf){i=0;do{if(mf=!1,Hf=0,25<=i)throw Error(Te(301));i+=1,pr=rr=null,t.updateQueue=null,bm.current=p8,e=n(r,o)}while(mf)}if(bm.current=ig,t=rr!==null&&rr.next!==null,Da=0,pr=rr=Bn=null,og=!1,t)throw Error(Te(300));return e}function jC(){var e=Hf!==0;return Hf=0,e}function Yi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pr===null?Bn.memoizedState=pr=e:pr=pr.next=e,pr}function mi(){if(rr===null){var e=Bn.alternate;e=e!==null?e.memoizedState:null}else e=rr.next;var t=pr===null?Bn.memoizedState:pr.next;if(t!==null)pr=t,rr=e;else{if(e===null)throw Error(Te(310));rr=e,e={memoizedState:rr.memoizedState,baseState:rr.baseState,baseQueue:rr.baseQueue,queue:rr.queue,next:null},pr===null?Bn.memoizedState=pr=e:pr=pr.next=e}return pr}function Vf(e,t){return typeof t=="function"?t(e):t}function g1(e){var t=mi(),n=t.queue;if(n===null)throw Error(Te(311));n.lastRenderedReducer=e;var r=rr,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,c=null,d=i;do{var p=d.lane;if((Da&p)===p)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var h={lane:p,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(a=c=h,s=r):c=c.next=h,Bn.lanes|=p,Ba|=p}d=d.next}while(d!==null&&d!==i);c===null?s=r:c.next=a,Di(r,t.memoizedState)||(ro=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,Bn.lanes|=i,Ba|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function v1(e){var t=mi(),n=t.queue;if(n===null)throw Error(Te(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);Di(i,t.memoizedState)||(ro=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function zT(){}function jT(e,t){var n=Bn,r=mi(),o=t(),i=!Di(r.memoizedState,o);if(i&&(r.memoizedState=o,ro=!0),r=r.queue,HC(UT.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||pr!==null&&pr.memoizedState.tag&1){if(n.flags|=2048,Uf(9,VT.bind(null,n,r,o,t),void 0,null),hr===null)throw Error(Te(349));Da&30||HT(n,t,o)}return o}function HT(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Bn.updateQueue,t===null?(t={lastEffect:null,stores:null},Bn.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function VT(e,t,n,r){t.value=n,t.getSnapshot=r,WT(t)&>(e)}function UT(e,t,n){return n(function(){WT(t)&>(e)})}function WT(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Di(e,n)}catch(r){return!0}}function GT(e){var t=Vs(e,1);t!==null&&Ai(t,e,1,-1)}function C2(e){var t=Yi();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vf,lastRenderedState:e},t.queue=e,e=e.dispatch=u8.bind(null,Bn,e),[t.memoizedState,e]}function Uf(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Bn.updateQueue,t===null?(t={lastEffect:null,stores:null},Bn.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function KT(){return mi().memoizedState}function wm(e,t,n,r){var o=Yi();Bn.flags|=e,o.memoizedState=Uf(1|t,n,void 0,r===void 0?null:r)}function Qg(e,t,n,r){var o=mi();r=r===void 0?null:r;var i=void 0;if(rr!==null){var s=rr.memoizedState;if(i=s.destroy,r!==null&&BC(r,s.deps)){o.memoizedState=Uf(t,n,i,r);return}}Bn.flags|=e,o.memoizedState=Uf(1|t,n,i,r)}function x2(e,t){return wm(8390656,8,e,t)}function HC(e,t){return Qg(2048,8,e,t)}function qT(e,t){return Qg(4,2,e,t)}function YT(e,t){return Qg(4,4,e,t)}function QT(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function XT(e,t,n){return n=n!=null?n.concat([e]):null,Qg(4,4,QT.bind(null,t,e),n)}function VC(){}function JT(e,t){var n=mi();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&BC(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ZT(e,t){var n=mi();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&BC(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function eO(e,t,n){return Da&21?(Di(n,t)||(n=rT(),Bn.lanes|=n,Ba|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ro=!0),e.memoizedState=n)}function a8(e,t){var n=sn;sn=n!==0&&4>n?n:4,e(!0);var r=m1.transition;m1.transition={};try{e(!1),t()}finally{sn=n,m1.transition=r}}function tO(){return mi().memoizedState}function c8(e,t,n){var r=Al(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},nO(e))rO(t,n);else if(n=OT(e,t,n,r),n!==null){var o=Ur();Ai(n,e,r,o),oO(n,t,r)}}function u8(e,t,n){var r=Al(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(nO(e))rO(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,Di(a,s)){var c=t.interleaved;c===null?(o.next=o,LC(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch(d){}finally{}n=OT(e,t,o,r),n!==null&&(o=Ur(),Ai(n,e,r,o),oO(n,t,r))}}function nO(e){var t=e.alternate;return e===Bn||t!==null&&t===Bn}function rO(e,t){mf=og=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function oO(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wC(e,n)}}var ig={readContext:hi,useCallback:kr,useContext:kr,useEffect:kr,useImperativeHandle:kr,useInsertionEffect:kr,useLayoutEffect:kr,useMemo:kr,useReducer:kr,useRef:kr,useState:kr,useDebugValue:kr,useDeferredValue:kr,useTransition:kr,useMutableSource:kr,useSyncExternalStore:kr,useId:kr,unstable_isNewReconciler:!1},d8={readContext:hi,useCallback:function(e,t){return Yi().memoizedState=[e,t===void 0?null:t],e},useContext:hi,useEffect:x2,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,wm(4194308,4,QT.bind(null,t,e),n)},useLayoutEffect:function(e,t){return wm(4194308,4,e,t)},useInsertionEffect:function(e,t){return wm(4,2,e,t)},useMemo:function(e,t){var n=Yi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Yi();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=c8.bind(null,Bn,e),[r.memoizedState,e]},useRef:function(e){var t=Yi();return e={current:e},t.memoizedState=e},useState:C2,useDebugValue:VC,useDeferredValue:function(e){return Yi().memoizedState=e},useTransition:function(){var e=C2(!1),t=e[0];return e=a8.bind(null,e[1]),Yi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Bn,o=Yi();if(Mn){if(n===void 0)throw Error(Te(407));n=n()}else{if(n=t(),hr===null)throw Error(Te(349));Da&30||HT(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,x2(UT.bind(null,r,i,e),[e]),r.flags|=2048,Uf(9,VT.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Yi(),t=hr.identifierPrefix;if(Mn){var n=Ns,r=As;n=(r&~(1<<32-Fi(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Hf++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=l8++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},f8={readContext:hi,useCallback:JT,useContext:hi,useEffect:HC,useImperativeHandle:XT,useInsertionEffect:qT,useLayoutEffect:YT,useMemo:ZT,useReducer:g1,useRef:KT,useState:function(){return g1(Vf)},useDebugValue:VC,useDeferredValue:function(e){var t=mi();return eO(t,rr.memoizedState,e)},useTransition:function(){var e=g1(Vf)[0],t=mi().memoizedState;return[e,t]},useMutableSource:zT,useSyncExternalStore:jT,useId:tO,unstable_isNewReconciler:!1},p8={readContext:hi,useCallback:JT,useContext:hi,useEffect:HC,useImperativeHandle:XT,useInsertionEffect:qT,useLayoutEffect:YT,useMemo:ZT,useReducer:v1,useRef:KT,useState:function(){return v1(Vf)},useDebugValue:VC,useDeferredValue:function(e){var t=mi();return rr===null?t.memoizedState=e:eO(t,rr.memoizedState,e)},useTransition:function(){var e=v1(Vf)[0],t=mi().memoizedState;return[e,t]},useMutableSource:zT,useSyncExternalStore:jT,useId:tO,unstable_isNewReconciler:!1};function ku(e,t){try{var n="",r=t;do n+=j9(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
31
31
|
Error generating stack: `+i.message+`
|
|
32
|
-
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function y1(e,t,n){return{value:e,source:null,stack:n!=null?n:null,digest:t!=null?t:null}}function Ub(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var h8=typeof WeakMap=="function"?WeakMap:Map;function iO(e,t,n){n=Bs(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){lg||(lg=!0,ew=r),Ub(e,t)},n}function sO(e,t,n){n=Bs(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Ub(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Ub(e,t),typeof r!="function"&&(Fl===null?Fl=new Set([this]):Fl.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function S2(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new h8;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=_8.bind(null,e,t,n),t.then(e,e))}function E2(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function P2(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Bs(-1,1),t.tag=2,Ll(n,t,1))),n.lanes|=1),e)}var m8=Qs.ReactCurrentOwner,ro=!1;function zr(e,t,n,r){t.child=e===null?DT(t,null,n,r):Pu(t,e.child,n,r)}function I2(e,t,n,r,o){n=n.render;var i=t.ref;return fu(t,o),r=zC(e,t,n,r,i,o),n=jC(),e!==null&&!ro?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Us(e,t,o)):(Mn&&n&&_C(t),t.flags|=1,zr(e,t,r,o),t.child)}function k2(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!XC(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,lO(e,t,i,r,o)):(e=Em(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Af,n(s,r)&&e.ref===t.ref)return Us(e,t,o)}return t.flags|=1,e=Nl(i,r),e.ref=t.ref,e.return=t,t.child=e}function lO(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Af(i,r)&&e.ref===t.ref)if(ro=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(ro=!0);else return t.lanes=e.lanes,Us(e,t,o)}return Wb(e,t,n,r,o)}function aO(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},gn(tu,So),So|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,gn(tu,So),So|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,gn(tu,So),So|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,gn(tu,So),So|=r;return zr(e,t,o,n),t.child}function cO(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Wb(e,t,n,r,o){var i=lo(n)?Aa:Fr.current;return i=Su(t,i),fu(t,o),n=zC(e,t,n,r,i,o),r=jC(),e!==null&&!ro?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Us(e,t,o)):(Mn&&r&&_C(t),t.flags|=1,zr(e,t,n,o),t.child)}function _2(e,t,n,r,o){if(lo(n)){var i=!0;Xm(t)}else i=!1;if(fu(t,o),t.stateNode===null)Cm(e,t),AT(t,n,r),Vb(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var c=s.context,d=n.contextType;typeof d=="object"&&d!==null?d=hi(d):(d=lo(n)?Aa:Fr.current,d=Su(t,d));var p=n.getDerivedStateFromProps,h=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function";h||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||c!==d)&&b2(t,s,r,d),vl=!1;var m=t.memoizedState;s.state=m,ng(t,r,s,o),c=t.memoizedState,a!==r||m!==c||so.current||vl?(typeof p=="function"&&(Hb(t,n,p,r),c=t.memoizedState),(a=vl||y2(t,n,a,r,m,c,d))?(h||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),s.props=r,s.state=c,s.context=d,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,LT(e,t),a=t.memoizedProps,d=t.type===t.elementType?a:_i(t.type,a),s.props=d,h=t.pendingProps,m=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=hi(c):(c=lo(n)?Aa:Fr.current,c=Su(t,c));var g=n.getDerivedStateFromProps;(p=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==h||m!==c)&&b2(t,s,r,c),vl=!1,m=t.memoizedState,s.state=m,ng(t,r,s,o);var y=t.memoizedState;a!==h||m!==y||so.current||vl?(typeof g=="function"&&(Hb(t,n,g,r),y=t.memoizedState),(d=vl||y2(t,n,d,r,m,y,c)||!1)?(p||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),s.props=r,s.state=y,s.context=c,r=d):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return Gb(e,t,n,r,i,o)}function Gb(e,t,n,r,o,i){cO(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&p2(t,n,!1),Us(e,t,i);r=t.stateNode,m8.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Pu(t,e.child,null,i),t.child=Pu(t,null,a,i)):zr(e,t,a,i),t.memoizedState=r.state,o&&p2(t,n,!0),t.child}function uO(e){var t=e.stateNode;t.pendingContext?f2(e,t.pendingContext,t.pendingContext!==t.context):t.context&&f2(e,t.context,!1),AC(e,t.containerInfo)}function $2(e,t,n,r,o){return Eu(),RC(o),t.flags|=256,zr(e,t,n,r),t.child}var Kb={dehydrated:null,treeContext:null,retryLane:0};function qb(e){return{baseLanes:e,cachePool:null,transitions:null}}function dO(e,t,n){var r=t.pendingProps,o=Nn.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),gn(Nn,o&1),e===null)return zb(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=Zg(s,r,0,null),e=$a(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=qb(n),t.memoizedState=Kb,e):UC(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return g8(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var c={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Nl(o,c),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Nl(a,i):(i=$a(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?qb(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Kb,r}return i=e.child,e=i.sibling,r=Nl(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function UC(e,t){return t=Zg({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Uh(e,t,n,r){return r!==null&&RC(r),Pu(t,e.child,null,n),e=UC(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function g8(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=y1(Error(Te(422))),Uh(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Zg({mode:"visible",children:r.children},o,0,null),i=$a(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Pu(t,e.child,null,s),t.child.memoizedState=qb(s),t.memoizedState=Kb,i);if(!(t.mode&1))return Uh(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(Te(419)),r=y1(i,r,void 0),Uh(e,t,s,r)}if(a=(s&e.childLanes)!==0,ro||a){if(r=hr,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Vs(e,o),Ai(r,e,o,-1))}return QC(),r=y1(Error(Te(421))),Uh(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=$8.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Ro=Ol(o.nextSibling),To=t,Mn=!0,Mi=null,e!==null&&(li[ai++]=As,li[ai++]=Ns,li[ai++]=Na,As=e.id,Ns=e.overflow,Na=t),t=UC(t,r.children),t.flags|=4096,t)}function R2(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),jb(e.return,t,n)}function b1(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function fO(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(zr(e,t,r.children,n),r=Nn.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&R2(e,n,t);else if(e.tag===19)R2(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(gn(Nn,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&rg(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),b1(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&rg(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}b1(t,!0,n,null,i);break;case"together":b1(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Cm(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Us(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ba|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Te(153));if(t.child!==null){for(e=t.child,n=Nl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Nl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function v8(e,t,n){switch(t.tag){case 3:uO(t),Eu();break;case 5:BT(t);break;case 1:lo(t.type)&&Xm(t);break;case 4:AC(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;gn(eg,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(gn(Nn,Nn.current&1),t.flags|=128,null):n&t.child.childLanes?dO(e,t,n):(gn(Nn,Nn.current&1),e=Us(e,t,n),e!==null?e.sibling:null);gn(Nn,Nn.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return fO(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),gn(Nn,Nn.current),r)break;return null;case 22:case 23:return t.lanes=0,aO(e,t,n)}return Us(e,t,n)}var pO,Yb,hO,mO;pO=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Yb=function(){};hO=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Ea(is.current);var i=null;switch(n){case"input":o=vb(e,o),r=vb(e,r),i=[];break;case"select":o=jn({},o,{value:void 0}),r=jn({},r,{value:void 0}),i=[];break;case"textarea":o=wb(e,o),r=wb(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ym)}xb(n,r);var s;n=null;for(d in o)if(!r.hasOwnProperty(d)&&o.hasOwnProperty(d)&&o[d]!=null)if(d==="style"){var a=o[d];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&($f.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in r){var c=r[d];if(a=o!=null?o[d]:void 0,r.hasOwnProperty(d)&&c!==a&&(c!=null||a!=null))if(d==="style")if(a){for(s in a)!a.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in c)c.hasOwnProperty(s)&&a[s]!==c[s]&&(n||(n={}),n[s]=c[s])}else n||(i||(i=[]),i.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(i=i||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&($f.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&Cn("scroll",e),i||a===c||(i=[])):(i=i||[]).push(d,c))}n&&(i=i||[]).push("style",n);var d=i;(t.updateQueue=d)&&(t.flags|=4)}};mO=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ad(e,t){if(!Mn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function _r(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function y8(e,t,n){var r=t.pendingProps;switch($C(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _r(t),null;case 1:return lo(t.type)&&Qm(),_r(t),null;case 3:return r=t.stateNode,Iu(),En(so),En(Fr),DC(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Hh(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Mi!==null&&(rw(Mi),Mi=null))),Yb(e,t),_r(t),null;case 5:NC(t);var o=Ea(jf.current);if(n=t.type,e!==null&&t.stateNode!=null)hO(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Te(166));return _r(t),null}if(e=Ea(is.current),Hh(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[ns]=t,r[Bf]=i,e=(t.mode&1)!==0,n){case"dialog":Cn("cancel",r),Cn("close",r);break;case"iframe":case"object":case"embed":Cn("load",r);break;case"video":case"audio":for(o=0;o<nf.length;o++)Cn(nf[o],r);break;case"source":Cn("error",r);break;case"img":case"image":case"link":Cn("error",r),Cn("load",r);break;case"details":Cn("toggle",r);break;case"input":Bk(r,i),Cn("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Cn("invalid",r);break;case"textarea":jk(r,i),Cn("invalid",r)}xb(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&jh(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&jh(r.textContent,a,e),o=["children",""+a]):$f.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Cn("scroll",r)}switch(n){case"input":Oh(r),zk(r,i,!0);break;case"textarea":Oh(r),Hk(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Ym)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=HM(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[ns]=t,e[Bf]=r,pO(e,t,!1,!1),t.stateNode=e;e:{switch(s=Sb(n,r),n){case"dialog":Cn("cancel",e),Cn("close",e),o=r;break;case"iframe":case"object":case"embed":Cn("load",e),o=r;break;case"video":case"audio":for(o=0;o<nf.length;o++)Cn(nf[o],e);o=r;break;case"source":Cn("error",e),o=r;break;case"img":case"image":case"link":Cn("error",e),Cn("load",e),o=r;break;case"details":Cn("toggle",e),o=r;break;case"input":Bk(e,r),o=vb(e,r),Cn("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=jn({},r,{value:void 0}),Cn("invalid",e);break;case"textarea":jk(e,r),o=wb(e,r),Cn("invalid",e);break;default:o=r}xb(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="style"?WM(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&VM(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Rf(e,c):typeof c=="number"&&Rf(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&($f.hasOwnProperty(i)?c!=null&&i==="onScroll"&&Cn("scroll",e):c!=null&&hC(e,i,c,s))}switch(n){case"input":Oh(e),zk(e,r,!1);break;case"textarea":Oh(e),Hk(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Vl(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?au(e,!!r.multiple,i,!1):r.defaultValue!=null&&au(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Ym)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return _r(t),null;case 6:if(e&&t.stateNode!=null)mO(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Te(166));if(n=Ea(jf.current),Ea(is.current),Hh(t)){if(r=t.stateNode,n=t.memoizedProps,r[ns]=t,(i=r.nodeValue!==n)&&(e=To,e!==null))switch(e.tag){case 3:jh(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&jh(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ns]=t,t.stateNode=r}return _r(t),null;case 13:if(En(Nn),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Mn&&Ro!==null&&t.mode&1&&!(t.flags&128))TT(),Eu(),t.flags|=98560,i=!1;else if(i=Hh(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(Te(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Te(317));i[ns]=t}else Eu(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_r(t),i=!1}else Mi!==null&&(rw(Mi),Mi=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Nn.current&1?or===0&&(or=3):QC())),t.updateQueue!==null&&(t.flags|=4),_r(t),null);case 4:return Iu(),Yb(e,t),e===null&&Nf(t.stateNode.containerInfo),_r(t),null;case 10:return OC(t.type._context),_r(t),null;case 17:return lo(t.type)&&Qm(),_r(t),null;case 19:if(En(Nn),i=t.memoizedState,i===null)return _r(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Ad(i,!1);else{if(or!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=rg(e),s!==null){for(t.flags|=128,Ad(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return gn(Nn,Nn.current&1|2),t.child}e=e.sibling}i.tail!==null&&Yn()>_u&&(t.flags|=128,r=!0,Ad(i,!1),t.lanes=4194304)}else{if(!r)if(e=rg(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ad(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Mn)return _r(t),null}else 2*Yn()-i.renderingStartTime>_u&&n!==1073741824&&(t.flags|=128,r=!0,Ad(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Yn(),t.sibling=null,n=Nn.current,gn(Nn,r?n&1|2:n&1),t):(_r(t),null);case 22:case 23:return YC(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?So&1073741824&&(_r(t),t.subtreeFlags&6&&(t.flags|=8192)):_r(t),null;case 24:return null;case 25:return null}throw Error(Te(156,t.tag))}function b8(e,t){switch($C(t),t.tag){case 1:return lo(t.type)&&Qm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Iu(),En(so),En(Fr),DC(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return NC(t),null;case 13:if(En(Nn),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Te(340));Eu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return En(Nn),null;case 4:return Iu(),null;case 10:return OC(t.type._context),null;case 22:case 23:return YC(),null;case 24:return null;default:return null}}var Wh=!1,Mr=!1,w8=typeof WeakSet=="function"?WeakSet:Set,Qe=null;function eu(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Gn(e,t,r)}else n.current=null}function Qb(e,t,n){try{n()}catch(r){Gn(e,t,r)}}var M2=!1;function C8(e,t){if(Ob=Gm,e=bT(),kC(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch(P){n=null;break e}var s=0,a=-1,c=-1,d=0,p=0,h=e,m=null;t:for(;;){for(var g;h!==n||o!==0&&h.nodeType!==3||(a=s+o),h!==i||r!==0&&h.nodeType!==3||(c=s+r),h.nodeType===3&&(s+=h.nodeValue.length),(g=h.firstChild)!==null;)m=h,h=g;for(;;){if(h===e)break t;if(m===n&&++d===o&&(a=s),m===i&&++p===r&&(c=s),(g=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=g}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Lb={focusedElem:e,selectionRange:n},Gm=!1,Qe=t;Qe!==null;)if(t=Qe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Qe=e;else for(;Qe!==null;){t=Qe;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,S=y.memoizedState,w=t.stateNode,C=w.getSnapshotBeforeUpdate(t.elementType===t.type?v:_i(t.type,v),S);w.__reactInternalSnapshotBeforeUpdate=C}break;case 3:var x=t.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(Te(163))}}catch(P){Gn(t,t.return,P)}if(e=t.sibling,e!==null){e.return=t.return,Qe=e;break}Qe=t.return}return y=M2,M2=!1,y}function gf(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Qb(t,n,i)}o=o.next}while(o!==r)}}function Xg(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Xb(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function gO(e){var t=e.alternate;t!==null&&(e.alternate=null,gO(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ns],delete t[Bf],delete t[Nb],delete t[r8],delete t[o8])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function vO(e){return e.tag===5||e.tag===3||e.tag===4}function T2(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vO(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ym));else if(r!==4&&(e=e.child,e!==null))for(Jb(e,t,n),e=e.sibling;e!==null;)Jb(e,t,n),e=e.sibling}function Zb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Zb(e,t,n),e=e.sibling;e!==null;)Zb(e,t,n),e=e.sibling}var wr=null,Ri=!1;function al(e,t,n){for(n=n.child;n!==null;)yO(e,t,n),n=n.sibling}function yO(e,t,n){if(os&&typeof os.onCommitFiberUnmount=="function")try{os.onCommitFiberUnmount(Vg,n)}catch(a){}switch(n.tag){case 5:Mr||eu(n,t);case 6:var r=wr,o=Ri;wr=null,al(e,t,n),wr=r,Ri=o,wr!==null&&(Ri?(e=wr,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wr.removeChild(n.stateNode));break;case 18:wr!==null&&(Ri?(e=wr,n=n.stateNode,e.nodeType===8?f1(e.parentNode,n):e.nodeType===1&&f1(e,n),Lf(e)):f1(wr,n.stateNode));break;case 4:r=wr,o=Ri,wr=n.stateNode.containerInfo,Ri=!0,al(e,t,n),wr=r,Ri=o;break;case 0:case 11:case 14:case 15:if(!Mr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Qb(n,t,s),o=o.next}while(o!==r)}al(e,t,n);break;case 1:if(!Mr&&(eu(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Gn(n,t,a)}al(e,t,n);break;case 21:al(e,t,n);break;case 22:n.mode&1?(Mr=(r=Mr)||n.memoizedState!==null,al(e,t,n),Mr=r):al(e,t,n);break;default:al(e,t,n)}}function O2(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new w8),t.forEach(function(r){var o=R8.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Ii(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:wr=a.stateNode,Ri=!1;break e;case 3:wr=a.stateNode.containerInfo,Ri=!0;break e;case 4:wr=a.stateNode.containerInfo,Ri=!0;break e}a=a.return}if(wr===null)throw Error(Te(160));yO(i,s,o),wr=null,Ri=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(d){Gn(o,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)bO(t,e),t=t.sibling}function bO(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ii(t,e),qi(e),r&4){try{gf(3,e,e.return),Xg(3,e)}catch(v){Gn(e,e.return,v)}try{gf(5,e,e.return)}catch(v){Gn(e,e.return,v)}}break;case 1:Ii(t,e),qi(e),r&512&&n!==null&&eu(n,n.return);break;case 5:if(Ii(t,e),qi(e),r&512&&n!==null&&eu(n,n.return),e.flags&32){var o=e.stateNode;try{Rf(o,"")}catch(v){Gn(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&zM(o,i),Sb(a,s);var d=Sb(a,i);for(s=0;s<c.length;s+=2){var p=c[s],h=c[s+1];p==="style"?WM(o,h):p==="dangerouslySetInnerHTML"?VM(o,h):p==="children"?Rf(o,h):hC(o,p,h,d)}switch(a){case"input":yb(o,i);break;case"textarea":jM(o,i);break;case"select":var m=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var g=i.value;g!=null?au(o,!!i.multiple,g,!1):m!==!!i.multiple&&(i.defaultValue!=null?au(o,!!i.multiple,i.defaultValue,!0):au(o,!!i.multiple,i.multiple?[]:"",!1))}o[Bf]=i}catch(v){Gn(e,e.return,v)}}break;case 6:if(Ii(t,e),qi(e),r&4){if(e.stateNode===null)throw Error(Te(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){Gn(e,e.return,v)}}break;case 3:if(Ii(t,e),qi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Lf(t.containerInfo)}catch(v){Gn(e,e.return,v)}break;case 4:Ii(t,e),qi(e);break;case 13:Ii(t,e),qi(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(KC=Yn())),r&4&&O2(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(Mr=(d=Mr)||p,Ii(t,e),Mr=d):Ii(t,e),qi(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!p&&e.mode&1)for(Qe=e,p=e.child;p!==null;){for(h=Qe=p;Qe!==null;){switch(m=Qe,g=m.child,m.tag){case 0:case 11:case 14:case 15:gf(4,m,m.return);break;case 1:eu(m,m.return);var y=m.stateNode;if(typeof y.componentWillUnmount=="function"){r=m,n=m.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){Gn(r,n,v)}}break;case 5:eu(m,m.return);break;case 22:if(m.memoizedState!==null){F2(h);continue}}g!==null?(g.return=m,Qe=g):F2(h)}p=p.sibling}e:for(p=null,h=e;;){if(h.tag===5){if(p===null){p=h;try{o=h.stateNode,d?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=h.stateNode,c=h.memoizedProps.style,s=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=UM("display",s))}catch(v){Gn(e,e.return,v)}}}else if(h.tag===6){if(p===null)try{h.stateNode.nodeValue=d?"":h.memoizedProps}catch(v){Gn(e,e.return,v)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;p===h&&(p=null),h=h.return}p===h&&(p=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Ii(t,e),qi(e),r&4&&O2(e);break;case 21:break;default:Ii(t,e),qi(e)}}function qi(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(vO(n)){var r=n;break e}n=n.return}throw Error(Te(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Rf(o,""),r.flags&=-33);var i=T2(e);Zb(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=T2(e);Jb(e,a,s);break;default:throw Error(Te(161))}}catch(c){Gn(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function x8(e,t,n){Qe=e,wO(e)}function wO(e,t,n){for(var r=(e.mode&1)!==0;Qe!==null;){var o=Qe,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Wh;if(!s){var a=o.alternate,c=a!==null&&a.memoizedState!==null||Mr;a=Wh;var d=Mr;if(Wh=s,(Mr=c)&&!d)for(Qe=o;Qe!==null;)s=Qe,c=s.child,s.tag===22&&s.memoizedState!==null?A2(o):c!==null?(c.return=s,Qe=c):A2(o);for(;i!==null;)Qe=i,wO(i),i=i.sibling;Qe=o,Wh=a,Mr=d}L2(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,Qe=i):L2(e)}}function L2(e){for(;Qe!==null;){var t=Qe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Mr||Xg(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Mr)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:_i(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&v2(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}v2(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var p=d.memoizedState;if(p!==null){var h=p.dehydrated;h!==null&&Lf(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Te(163))}Mr||t.flags&512&&Xb(t)}catch(m){Gn(t,t.return,m)}}if(t===e){Qe=null;break}if(n=t.sibling,n!==null){n.return=t.return,Qe=n;break}Qe=t.return}}function F2(e){for(;Qe!==null;){var t=Qe;if(t===e){Qe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Qe=n;break}Qe=t.return}}function A2(e){for(;Qe!==null;){var t=Qe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Xg(4,t)}catch(c){Gn(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(c){Gn(t,o,c)}}var i=t.return;try{Xb(t)}catch(c){Gn(t,i,c)}break;case 5:var s=t.return;try{Xb(t)}catch(c){Gn(t,s,c)}}}catch(c){Gn(t,t.return,c)}if(t===e){Qe=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Qe=a;break}Qe=t.return}}var S8=Math.ceil,sg=Qs.ReactCurrentDispatcher,WC=Qs.ReactCurrentOwner,ui=Qs.ReactCurrentBatchConfig,Gt=0,hr=null,er=null,Sr=0,So=0,tu=ta(0),or=0,Wf=null,Ba=0,Jg=0,GC=0,vf=null,Zr=null,KC=0,_u=1/0,Ls=null,lg=!1,ew=null,Fl=null,Gh=!1,Pl=null,ag=0,yf=0,tw=null,xm=-1,Sm=0;function Ur(){return Gt&6?Yn():xm!==-1?xm:xm=Yn()}function Al(e){return e.mode&1?Gt&2&&Sr!==0?Sr&-Sr:s8.transition!==null?(Sm===0&&(Sm=rT()),Sm):(e=sn,e!==0||(e=window.event,e=e===void 0?16:uT(e.type)),e):1}function Ai(e,t,n,r){if(50<yf)throw yf=0,tw=null,Error(Te(185));vp(e,n,r),(!(Gt&2)||e!==hr)&&(e===hr&&(!(Gt&2)&&(Jg|=n),or===4&&xl(e,Sr)),ao(e,r),n===1&&Gt===0&&!(t.mode&1)&&(_u=Yn()+500,qg&&na()))}function ao(e,t){var n=e.callbackNode;sH(e,t);var r=Wm(e,e===hr?Sr:0);if(r===0)n!==null&&Wk(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Wk(n),t===1)e.tag===0?i8(N2.bind(null,e)):$T(N2.bind(null,e)),t8(function(){!(Gt&6)&&na()}),n=null;else{switch(oT(r)){case 1:n=bC;break;case 4:n=tT;break;case 16:n=Um;break;case 536870912:n=nT;break;default:n=Um}n=_O(n,CO.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function CO(e,t){if(xm=-1,Sm=0,Gt&6)throw Error(Te(327));var n=e.callbackNode;if(pu()&&e.callbackNode!==n)return null;var r=Wm(e,e===hr?Sr:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=cg(e,r);else{t=r;var o=Gt;Gt|=2;var i=SO();(hr!==e||Sr!==t)&&(Ls=null,_u=Yn()+500,_a(e,t));do try{I8();break}catch(a){xO(e,a)}while(1);TC(),sg.current=i,Gt=o,er!==null?t=0:(hr=null,Sr=0,t=or)}if(t!==0){if(t===2&&(o=_b(e),o!==0&&(r=o,t=nw(e,o))),t===1)throw n=Wf,_a(e,0),xl(e,r),ao(e,Yn()),n;if(t===6)xl(e,r);else{if(o=e.current.alternate,!(r&30)&&!E8(o)&&(t=cg(e,r),t===2&&(i=_b(e),i!==0&&(r=i,t=nw(e,i))),t===1))throw n=Wf,_a(e,0),xl(e,r),ao(e,Yn()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(Te(345));case 2:va(e,Zr,Ls);break;case 3:if(xl(e,r),(r&130023424)===r&&(t=KC+500-Yn(),10<t)){if(Wm(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ur(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Ab(va.bind(null,e,Zr,Ls),t);break}va(e,Zr,Ls);break;case 4:if(xl(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Fi(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Yn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*S8(r/1960))-r,10<r){e.timeoutHandle=Ab(va.bind(null,e,Zr,Ls),r);break}va(e,Zr,Ls);break;case 5:va(e,Zr,Ls);break;default:throw Error(Te(329))}}}return ao(e,Yn()),e.callbackNode===n?CO.bind(null,e):null}function nw(e,t){var n=vf;return e.current.memoizedState.isDehydrated&&(_a(e,t).flags|=256),e=cg(e,t),e!==2&&(t=Zr,Zr=n,t!==null&&rw(t)),e}function rw(e){Zr===null?Zr=e:Zr.push.apply(Zr,e)}function E8(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!Di(i(),o))return!1}catch(s){return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function xl(e,t){for(t&=~GC,t&=~Jg,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Fi(t),r=1<<n;e[n]=-1,t&=~r}}function N2(e){if(Gt&6)throw Error(Te(327));pu();var t=Wm(e,0);if(!(t&1))return ao(e,Yn()),null;var n=cg(e,t);if(e.tag!==0&&n===2){var r=_b(e);r!==0&&(t=r,n=nw(e,r))}if(n===1)throw n=Wf,_a(e,0),xl(e,t),ao(e,Yn()),n;if(n===6)throw Error(Te(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,va(e,Zr,Ls),ao(e,Yn()),null}function qC(e,t){var n=Gt;Gt|=1;try{return e(t)}finally{Gt=n,Gt===0&&(_u=Yn()+500,qg&&na())}}function za(e){Pl!==null&&Pl.tag===0&&!(Gt&6)&&pu();var t=Gt;Gt|=1;var n=ui.transition,r=sn;try{if(ui.transition=null,sn=1,e)return e()}finally{sn=r,ui.transition=n,Gt=t,!(Gt&6)&&na()}}function YC(){So=tu.current,En(tu)}function _a(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,e8(n)),er!==null)for(n=er.return;n!==null;){var r=n;switch($C(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Qm();break;case 3:Iu(),En(so),En(Fr),DC();break;case 5:NC(r);break;case 4:Iu();break;case 13:En(Nn);break;case 19:En(Nn);break;case 10:OC(r.type._context);break;case 22:case 23:YC()}n=n.return}if(hr=e,er=e=Nl(e.current,null),Sr=So=t,or=0,Wf=null,GC=Jg=Ba=0,Zr=vf=null,Sa!==null){for(t=0;t<Sa.length;t++)if(n=Sa[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}Sa=null}return e}function xO(e,t){do{var n=er;try{if(TC(),bm.current=ig,og){for(var r=Bn.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}og=!1}if(Da=0,pr=rr=Bn=null,mf=!1,Hf=0,WC.current=null,n===null||n.return===null){or=1,Wf=t,er=null;break}e:{var i=e,s=n.return,a=n,c=t;if(t=Sr,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,p=a,h=p.tag;if(!(p.mode&1)&&(h===0||h===11||h===15)){var m=p.alternate;m?(p.updateQueue=m.updateQueue,p.memoizedState=m.memoizedState,p.lanes=m.lanes):(p.updateQueue=null,p.memoizedState=null)}var g=E2(s);if(g!==null){g.flags&=-257,P2(g,s,a,i,t),g.mode&1&&S2(i,d,t),t=g,c=d;var y=t.updateQueue;if(y===null){var v=new Set;v.add(c),t.updateQueue=v}else y.add(c);break e}else{if(!(t&1)){S2(i,d,t),QC();break e}c=Error(Te(426))}}else if(Mn&&a.mode&1){var S=E2(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),P2(S,s,a,i,t),RC(ku(c,a));break e}}i=c=ku(c,a),or!==4&&(or=2),vf===null?vf=[i]:vf.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var w=iO(i,c,t);g2(i,w);break e;case 1:a=c;var C=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof C.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Fl===null||!Fl.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var P=sO(i,a,t);g2(i,P);break e}}i=i.return}while(i!==null)}PO(n)}catch(_){t=_,er===n&&n!==null&&(er=n=n.return);continue}break}while(1)}function SO(){var e=sg.current;return sg.current=ig,e===null?ig:e}function QC(){(or===0||or===3||or===2)&&(or=4),hr===null||!(Ba&268435455)&&!(Jg&268435455)||xl(hr,Sr)}function cg(e,t){var n=Gt;Gt|=2;var r=SO();(hr!==e||Sr!==t)&&(Ls=null,_a(e,t));do try{P8();break}catch(o){xO(e,o)}while(1);if(TC(),Gt=n,sg.current=r,er!==null)throw Error(Te(261));return hr=null,Sr=0,or}function P8(){for(;er!==null;)EO(er)}function I8(){for(;er!==null&&!X9();)EO(er)}function EO(e){var t=kO(e.alternate,e,So);e.memoizedProps=e.pendingProps,t===null?PO(e):er=t,WC.current=null}function PO(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=b8(n,t),n!==null){n.flags&=32767,er=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{or=6,er=null;return}}else if(n=y8(n,t,So),n!==null){er=n;return}if(t=t.sibling,t!==null){er=t;return}er=t=e}while(t!==null);or===0&&(or=5)}function va(e,t,n){var r=sn,o=ui.transition;try{ui.transition=null,sn=1,k8(e,t,n,r)}finally{ui.transition=o,sn=r}return null}function k8(e,t,n,r){do pu();while(Pl!==null);if(Gt&6)throw Error(Te(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Te(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(lH(e,i),e===hr&&(er=hr=null,Sr=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Gh||(Gh=!0,_O(Um,function(){return pu(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=ui.transition,ui.transition=null;var s=sn;sn=1;var a=Gt;Gt|=4,WC.current=null,C8(e,n),bO(n,e),KH(Lb),Gm=!!Ob,Lb=Ob=null,e.current=n,x8(n),J9(),Gt=a,sn=s,ui.transition=i}else e.current=n;if(Gh&&(Gh=!1,Pl=e,ag=o),i=e.pendingLanes,i===0&&(Fl=null),tH(n.stateNode),ao(e,Yn()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(lg)throw lg=!1,e=ew,ew=null,e;return ag&1&&e.tag!==0&&pu(),i=e.pendingLanes,i&1?e===tw?yf++:(yf=0,tw=e):yf=0,na(),null}function pu(){if(Pl!==null){var e=oT(ag),t=ui.transition,n=sn;try{if(ui.transition=null,sn=16>e?16:e,Pl===null)var r=!1;else{if(e=Pl,Pl=null,ag=0,Gt&6)throw Error(Te(331));var o=Gt;for(Gt|=4,Qe=e.current;Qe!==null;){var i=Qe,s=i.child;if(Qe.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c<a.length;c++){var d=a[c];for(Qe=d;Qe!==null;){var p=Qe;switch(p.tag){case 0:case 11:case 15:gf(8,p,i)}var h=p.child;if(h!==null)h.return=p,Qe=h;else for(;Qe!==null;){p=Qe;var m=p.sibling,g=p.return;if(gO(p),p===d){Qe=null;break}if(m!==null){m.return=g,Qe=m;break}Qe=g}}}var y=i.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var S=v.sibling;v.sibling=null,v=S}while(v!==null)}}Qe=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,Qe=s;else e:for(;Qe!==null;){if(i=Qe,i.flags&2048)switch(i.tag){case 0:case 11:case 15:gf(9,i,i.return)}var w=i.sibling;if(w!==null){w.return=i.return,Qe=w;break e}Qe=i.return}}var C=e.current;for(Qe=C;Qe!==null;){s=Qe;var x=s.child;if(s.subtreeFlags&2064&&x!==null)x.return=s,Qe=x;else e:for(s=C;Qe!==null;){if(a=Qe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Xg(9,a)}}catch(_){Gn(a,a.return,_)}if(a===s){Qe=null;break e}var P=a.sibling;if(P!==null){P.return=a.return,Qe=P;break e}Qe=a.return}}if(Gt=o,na(),os&&typeof os.onPostCommitFiberRoot=="function")try{os.onPostCommitFiberRoot(Vg,e)}catch(_){}r=!0}return r}finally{sn=n,ui.transition=t}}return!1}function D2(e,t,n){t=ku(n,t),t=iO(e,t,1),e=Ll(e,t,1),t=Ur(),e!==null&&(vp(e,1,t),ao(e,t))}function Gn(e,t,n){if(e.tag===3)D2(e,e,n);else for(;t!==null;){if(t.tag===3){D2(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Fl===null||!Fl.has(r))){e=ku(n,e),e=sO(t,e,1),t=Ll(t,e,1),e=Ur(),t!==null&&(vp(t,1,e),ao(t,e));break}}t=t.return}}function _8(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ur(),e.pingedLanes|=e.suspendedLanes&n,hr===e&&(Sr&n)===n&&(or===4||or===3&&(Sr&130023424)===Sr&&500>Yn()-KC?_a(e,0):GC|=n),ao(e,t)}function IO(e,t){t===0&&(e.mode&1?(t=Ah,Ah<<=1,!(Ah&130023424)&&(Ah=4194304)):t=1);var n=Ur();e=Vs(e,t),e!==null&&(vp(e,t,n),ao(e,n))}function $8(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),IO(e,n)}function R8(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Te(314))}r!==null&&r.delete(t),IO(e,n)}var kO;kO=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||so.current)ro=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ro=!1,v8(e,t,n);ro=!!(e.flags&131072)}else ro=!1,Mn&&t.flags&1048576&&RT(t,Zm,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Cm(e,t),e=t.pendingProps;var o=Su(t,Fr.current);fu(t,n),o=zC(null,t,r,e,o,n);var i=jC();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lo(r)?(i=!0,Xm(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,FC(t),o.updater=Yg,t.stateNode=o,o._reactInternals=t,Vb(t,r,e,n),t=Gb(null,t,r,!0,i,n)):(t.tag=0,Mn&&i&&_C(t),zr(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Cm(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=T8(r),e=_i(r,e),o){case 0:t=Wb(null,t,r,e,n);break e;case 1:t=_2(null,t,r,e,n);break e;case 11:t=I2(null,t,r,e,n);break e;case 14:t=k2(null,t,r,_i(r.type,e),n);break e}throw Error(Te(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:_i(r,o),Wb(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:_i(r,o),_2(e,t,r,o,n);case 3:e:{if(uO(t),e===null)throw Error(Te(387));r=t.pendingProps,i=t.memoizedState,o=i.element,LT(e,t),ng(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=ku(Error(Te(423)),t),t=$2(e,t,r,n,o);break e}else if(r!==o){o=ku(Error(Te(424)),t),t=$2(e,t,r,n,o);break e}else for(Ro=Ol(t.stateNode.containerInfo.firstChild),To=t,Mn=!0,Mi=null,n=DT(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Eu(),r===o){t=Us(e,t,n);break e}zr(e,t,r,n)}t=t.child}return t;case 5:return BT(t),e===null&&zb(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Fb(r,o)?s=null:i!==null&&Fb(r,i)&&(t.flags|=32),cO(e,t),zr(e,t,s,n),t.child;case 6:return e===null&&zb(t),null;case 13:return dO(e,t,n);case 4:return AC(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pu(t,null,r,n):zr(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:_i(r,o),I2(e,t,r,o,n);case 7:return zr(e,t,t.pendingProps,n),t.child;case 8:return zr(e,t,t.pendingProps.children,n),t.child;case 12:return zr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,gn(eg,r._currentValue),r._currentValue=s,i!==null)if(Di(i.value,s)){if(i.children===o.children&&!so.current){t=Us(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Bs(-1,n&-n),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var p=d.pending;p===null?c.next=c:(c.next=p.next,p.next=c),d.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),jb(i.return,n,t),a.lanes|=n;break}c=c.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(Te(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),jb(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}zr(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,fu(t,n),o=hi(o),r=r(o),t.flags|=1,zr(e,t,r,n),t.child;case 14:return r=t.type,o=_i(r,t.pendingProps),o=_i(r.type,o),k2(e,t,r,o,n);case 15:return lO(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:_i(r,o),Cm(e,t),t.tag=1,lo(r)?(e=!0,Xm(t)):e=!1,fu(t,n),AT(t,r,o),Vb(t,r,o,n),Gb(null,t,r,!0,e,n);case 19:return fO(e,t,n);case 22:return aO(e,t,n)}throw Error(Te(156,t.tag))};function _O(e,t){return eT(e,t)}function M8(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ci(e,t,n,r){return new M8(e,t,n,r)}function XC(e){return e=e.prototype,!(!e||!e.isReactComponent)}function T8(e){if(typeof e=="function")return XC(e)?1:0;if(e!=null){if(e=e.$$typeof,e===gC)return 11;if(e===vC)return 14}return 2}function Nl(e,t){var n=e.alternate;return n===null?(n=ci(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Em(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")XC(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Wc:return $a(n.children,o,i,t);case mC:s=8,o|=8;break;case pb:return e=ci(12,n,t,o|2),e.elementType=pb,e.lanes=i,e;case hb:return e=ci(13,n,t,o),e.elementType=hb,e.lanes=i,e;case mb:return e=ci(19,n,t,o),e.elementType=mb,e.lanes=i,e;case NM:return Zg(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case FM:s=10;break e;case AM:s=9;break e;case gC:s=11;break e;case vC:s=14;break e;case gl:s=16,r=null;break e}throw Error(Te(130,e==null?e:typeof e,""))}return t=ci(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function $a(e,t,n,r){return e=ci(7,e,r,t),e.lanes=n,e}function Zg(e,t,n,r){return e=ci(22,e,r,t),e.elementType=NM,e.lanes=n,e.stateNode={isHidden:!1},e}function w1(e,t,n){return e=ci(6,e,null,t),e.lanes=n,e}function C1(e,t,n){return t=ci(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function O8(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=t1(0),this.expirationTimes=t1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=t1(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function JC(e,t,n,r,o,i,s,a,c){return e=new O8(e,t,n,a,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=ci(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},FC(i),e}function L8(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Uc,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function $O(e){if(!e)return Ul;e=e._reactInternals;e:{if(nc(e)!==e||e.tag!==1)throw Error(Te(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(lo(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Te(171))}if(e.tag===1){var n=e.type;if(lo(n))return _T(e,n,t)}return t}function RO(e,t,n,r,o,i,s,a,c){return e=JC(n,r,!0,e,o,i,s,a,c),e.context=$O(null),n=e.current,r=Ur(),o=Al(n),i=Bs(r,o),i.callback=t!=null?t:null,Ll(n,i,o),e.current.lanes=o,vp(e,o,r),ao(e,r),e}function ev(e,t,n,r){var o=t.current,i=Ur(),s=Al(o);return n=$O(n),t.context===null?t.context=n:t.pendingContext=n,t=Bs(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ll(o,t,s),e!==null&&(Ai(e,o,s,i),ym(e,o,s)),s}function ug(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function B2(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ZC(e,t){B2(e,t),(e=e.alternate)&&B2(e,t)}function F8(){return null}var MO=typeof reportError=="function"?reportError:function(e){console.error(e)};function ex(e){this._internalRoot=e}tv.prototype.render=ex.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Te(409));ev(e,t,null,null)};tv.prototype.unmount=ex.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;za(function(){ev(null,e,null,null)}),t[Hs]=null}};function tv(e){this._internalRoot=e}tv.prototype.unstable_scheduleHydration=function(e){if(e){var t=lT();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cl.length&&t!==0&&t<Cl[n].priority;n++);Cl.splice(n,0,e),n===0&&cT(e)}};function tx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function nv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function z2(){}function A8(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var d=ug(s);i.call(d)}}var s=RO(t,r,e,0,null,!1,!1,"",z2);return e._reactRootContainer=s,e[Hs]=s.current,Nf(e.nodeType===8?e.parentNode:e),za(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var d=ug(c);a.call(d)}}var c=JC(e,0,!1,null,null,!1,!1,"",z2);return e._reactRootContainer=c,e[Hs]=c.current,Nf(e.nodeType===8?e.parentNode:e),za(function(){ev(t,c,n,r)}),c}function rv(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var c=ug(s);a.call(c)}}ev(t,s,e,o)}else s=A8(n,t,e,o,r);return ug(s)}iT=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=tf(t.pendingLanes);n!==0&&(wC(t,n|1),ao(t,Yn()),!(Gt&6)&&(_u=Yn()+500,na()))}break;case 13:za(function(){var r=Vs(e,1);if(r!==null){var o=Ur();Ai(r,e,1,o)}}),ZC(e,1)}};CC=function(e){if(e.tag===13){var t=Vs(e,134217728);if(t!==null){var n=Ur();Ai(t,e,134217728,n)}ZC(e,134217728)}};sT=function(e){if(e.tag===13){var t=Al(e),n=Vs(e,t);if(n!==null){var r=Ur();Ai(n,e,t,r)}ZC(e,t)}};lT=function(){return sn};aT=function(e,t){var n=sn;try{return sn=e,t()}finally{sn=n}};Pb=function(e,t,n){switch(t){case"input":if(yb(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Kg(r);if(!o)throw Error(Te(90));BM(r),yb(r,o)}}}break;case"textarea":jM(e,n);break;case"select":t=n.value,t!=null&&au(e,!!n.multiple,t,!1)}};qM=qC;YM=za;var N8={usingClientEntryPoint:!1,Events:[bp,Yc,Kg,GM,KM,qC]},Nd={findFiberByHostInstance:xa,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},D8={bundleType:Nd.bundleType,version:Nd.version,rendererPackageName:Nd.rendererPackageName,rendererConfig:Nd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Qs.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=JM(e),e===null?null:e.stateNode},findFiberByHostInstance:Nd.findFiberByHostInstance||F8,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"){var Kh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kh.isDisabled&&Kh.supportsFiber)try{Vg=Kh.inject(D8),os=Kh}catch(e){}}zo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N8;zo.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!tx(t))throw Error(Te(200));return L8(e,t,null,n)};zo.createRoot=function(e,t){if(!tx(e))throw Error(Te(299));var n=!1,r="",o=MO;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=JC(e,1,!1,null,null,n,!1,r,o),e[Hs]=t.current,Nf(e.nodeType===8?e.parentNode:e),new ex(t)};zo.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Te(188)):(e=Object.keys(e).join(","),Error(Te(268,e)));return e=JM(t),e=e===null?null:e.stateNode,e};zo.flushSync=function(e){return za(e)};zo.hydrate=function(e,t,n){if(!nv(t))throw Error(Te(200));return rv(null,e,t,!0,n)};zo.hydrateRoot=function(e,t,n){if(!tx(e))throw Error(Te(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=MO;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=RO(t,null,e,1,n!=null?n:null,o,!1,i,s),e[Hs]=t.current,Nf(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new tv(t)};zo.render=function(e,t,n){if(!nv(t))throw Error(Te(200));return rv(null,e,t,!1,n)};zo.unmountComponentAtNode=function(e){if(!nv(e))throw Error(Te(40));return e._reactRootContainer?(za(function(){rv(null,null,e,!1,function(){e._reactRootContainer=null,e[Hs]=null})}),!0):!1};zo.unstable_batchedUpdates=qC;zo.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!nv(n))throw Error(Te(200));if(e==null||e._reactInternals===void 0)throw Error(Te(38));return rv(e,t,n,!1,r)};zo.version="18.2.0-next-9e3b772b8-20220608";function TO(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(TO)}catch(e){console.error(e)}}TO(),RM.exports=zo;var Yu=RM.exports;const qh=mp(Yu);var OO,j2=Yu;OO=j2.createRoot,j2.hydrateRoot;const B8="modulepreload",z8=function(e){return"/"+e},H2={},j8=function(t,n,r){if(!n||n.length===0)return t();const o=document.getElementsByTagName("link");return Promise.all(n.map(i=>{if(i=z8(i),i in H2)return;H2[i]=!0;const s=i.endsWith(".css"),a=s?'[rel="stylesheet"]':"";if(!!r)for(let p=o.length-1;p>=0;p--){const h=o[p];if(h.href===i&&(!s||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${a}`))return;const d=document.createElement("link");if(d.rel=s?"stylesheet":B8,s||(d.as="script",d.crossOrigin=""),d.href=i,document.head.appendChild(d),s)return new Promise((p,h)=>{d.addEventListener("load",p),d.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())};var wM;if(!((wM=window.crypto)!=null&&wM.subtle)){let t;console.debug("poly subtle");const e={digest(n,r){return mt(this,null,function*(){if(n!=="SHA-512")return alert(n+" required but not supported");const i=(yield j8(()=>import("./sha512-da763b08.js").then(s=>s.s),[])).default.arrayBuffer;return i(r)})}};window.crypto||(window.crypto={subtle:e}),crypto.subtle||(crypto.subtle=e)}/**
|
|
32
|
+
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function y1(e,t,n){return{value:e,source:null,stack:n!=null?n:null,digest:t!=null?t:null}}function Ub(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var h8=typeof WeakMap=="function"?WeakMap:Map;function iO(e,t,n){n=Bs(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){lg||(lg=!0,ew=r),Ub(e,t)},n}function sO(e,t,n){n=Bs(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Ub(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Ub(e,t),typeof r!="function"&&(Fl===null?Fl=new Set([this]):Fl.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function S2(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new h8;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=_8.bind(null,e,t,n),t.then(e,e))}function E2(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function P2(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Bs(-1,1),t.tag=2,Ll(n,t,1))),n.lanes|=1),e)}var m8=Qs.ReactCurrentOwner,ro=!1;function zr(e,t,n,r){t.child=e===null?DT(t,null,n,r):Pu(t,e.child,n,r)}function I2(e,t,n,r,o){n=n.render;var i=t.ref;return fu(t,o),r=zC(e,t,n,r,i,o),n=jC(),e!==null&&!ro?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Us(e,t,o)):(Mn&&n&&_C(t),t.flags|=1,zr(e,t,r,o),t.child)}function k2(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!XC(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,lO(e,t,i,r,o)):(e=Em(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Af,n(s,r)&&e.ref===t.ref)return Us(e,t,o)}return t.flags|=1,e=Nl(i,r),e.ref=t.ref,e.return=t,t.child=e}function lO(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Af(i,r)&&e.ref===t.ref)if(ro=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(ro=!0);else return t.lanes=e.lanes,Us(e,t,o)}return Wb(e,t,n,r,o)}function aO(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},gn(tu,So),So|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,gn(tu,So),So|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,gn(tu,So),So|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,gn(tu,So),So|=r;return zr(e,t,o,n),t.child}function cO(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Wb(e,t,n,r,o){var i=lo(n)?Aa:Fr.current;return i=Su(t,i),fu(t,o),n=zC(e,t,n,r,i,o),r=jC(),e!==null&&!ro?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Us(e,t,o)):(Mn&&r&&_C(t),t.flags|=1,zr(e,t,n,o),t.child)}function _2(e,t,n,r,o){if(lo(n)){var i=!0;Xm(t)}else i=!1;if(fu(t,o),t.stateNode===null)Cm(e,t),AT(t,n,r),Vb(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var c=s.context,d=n.contextType;typeof d=="object"&&d!==null?d=hi(d):(d=lo(n)?Aa:Fr.current,d=Su(t,d));var p=n.getDerivedStateFromProps,h=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function";h||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||c!==d)&&b2(t,s,r,d),vl=!1;var m=t.memoizedState;s.state=m,ng(t,r,s,o),c=t.memoizedState,a!==r||m!==c||so.current||vl?(typeof p=="function"&&(Hb(t,n,p,r),c=t.memoizedState),(a=vl||y2(t,n,a,r,m,c,d))?(h||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),s.props=r,s.state=c,s.context=d,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,LT(e,t),a=t.memoizedProps,d=t.type===t.elementType?a:_i(t.type,a),s.props=d,h=t.pendingProps,m=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=hi(c):(c=lo(n)?Aa:Fr.current,c=Su(t,c));var g=n.getDerivedStateFromProps;(p=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==h||m!==c)&&b2(t,s,r,c),vl=!1,m=t.memoizedState,s.state=m,ng(t,r,s,o);var y=t.memoizedState;a!==h||m!==y||so.current||vl?(typeof g=="function"&&(Hb(t,n,g,r),y=t.memoizedState),(d=vl||y2(t,n,d,r,m,y,c)||!1)?(p||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),s.props=r,s.state=y,s.context=c,r=d):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return Gb(e,t,n,r,i,o)}function Gb(e,t,n,r,o,i){cO(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&p2(t,n,!1),Us(e,t,i);r=t.stateNode,m8.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Pu(t,e.child,null,i),t.child=Pu(t,null,a,i)):zr(e,t,a,i),t.memoizedState=r.state,o&&p2(t,n,!0),t.child}function uO(e){var t=e.stateNode;t.pendingContext?f2(e,t.pendingContext,t.pendingContext!==t.context):t.context&&f2(e,t.context,!1),AC(e,t.containerInfo)}function $2(e,t,n,r,o){return Eu(),RC(o),t.flags|=256,zr(e,t,n,r),t.child}var Kb={dehydrated:null,treeContext:null,retryLane:0};function qb(e){return{baseLanes:e,cachePool:null,transitions:null}}function dO(e,t,n){var r=t.pendingProps,o=Nn.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),gn(Nn,o&1),e===null)return zb(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=Zg(s,r,0,null),e=$a(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=qb(n),t.memoizedState=Kb,e):UC(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return g8(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var c={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Nl(o,c),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Nl(a,i):(i=$a(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?qb(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Kb,r}return i=e.child,e=i.sibling,r=Nl(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function UC(e,t){return t=Zg({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Uh(e,t,n,r){return r!==null&&RC(r),Pu(t,e.child,null,n),e=UC(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function g8(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=y1(Error(Te(422))),Uh(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Zg({mode:"visible",children:r.children},o,0,null),i=$a(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Pu(t,e.child,null,s),t.child.memoizedState=qb(s),t.memoizedState=Kb,i);if(!(t.mode&1))return Uh(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(Te(419)),r=y1(i,r,void 0),Uh(e,t,s,r)}if(a=(s&e.childLanes)!==0,ro||a){if(r=hr,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Vs(e,o),Ai(r,e,o,-1))}return QC(),r=y1(Error(Te(421))),Uh(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=$8.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Ro=Ol(o.nextSibling),To=t,Mn=!0,Mi=null,e!==null&&(li[ai++]=As,li[ai++]=Ns,li[ai++]=Na,As=e.id,Ns=e.overflow,Na=t),t=UC(t,r.children),t.flags|=4096,t)}function R2(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),jb(e.return,t,n)}function b1(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function fO(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(zr(e,t,r.children,n),r=Nn.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&R2(e,n,t);else if(e.tag===19)R2(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(gn(Nn,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&rg(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),b1(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&rg(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}b1(t,!0,n,null,i);break;case"together":b1(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Cm(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Us(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ba|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Te(153));if(t.child!==null){for(e=t.child,n=Nl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Nl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function v8(e,t,n){switch(t.tag){case 3:uO(t),Eu();break;case 5:BT(t);break;case 1:lo(t.type)&&Xm(t);break;case 4:AC(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;gn(eg,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(gn(Nn,Nn.current&1),t.flags|=128,null):n&t.child.childLanes?dO(e,t,n):(gn(Nn,Nn.current&1),e=Us(e,t,n),e!==null?e.sibling:null);gn(Nn,Nn.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return fO(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),gn(Nn,Nn.current),r)break;return null;case 22:case 23:return t.lanes=0,aO(e,t,n)}return Us(e,t,n)}var pO,Yb,hO,mO;pO=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Yb=function(){};hO=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Ea(is.current);var i=null;switch(n){case"input":o=vb(e,o),r=vb(e,r),i=[];break;case"select":o=jn({},o,{value:void 0}),r=jn({},r,{value:void 0}),i=[];break;case"textarea":o=wb(e,o),r=wb(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ym)}xb(n,r);var s;n=null;for(d in o)if(!r.hasOwnProperty(d)&&o.hasOwnProperty(d)&&o[d]!=null)if(d==="style"){var a=o[d];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&($f.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in r){var c=r[d];if(a=o!=null?o[d]:void 0,r.hasOwnProperty(d)&&c!==a&&(c!=null||a!=null))if(d==="style")if(a){for(s in a)!a.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in c)c.hasOwnProperty(s)&&a[s]!==c[s]&&(n||(n={}),n[s]=c[s])}else n||(i||(i=[]),i.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(i=i||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&($f.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&Cn("scroll",e),i||a===c||(i=[])):(i=i||[]).push(d,c))}n&&(i=i||[]).push("style",n);var d=i;(t.updateQueue=d)&&(t.flags|=4)}};mO=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ad(e,t){if(!Mn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function _r(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function y8(e,t,n){var r=t.pendingProps;switch($C(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _r(t),null;case 1:return lo(t.type)&&Qm(),_r(t),null;case 3:return r=t.stateNode,Iu(),En(so),En(Fr),DC(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Hh(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Mi!==null&&(rw(Mi),Mi=null))),Yb(e,t),_r(t),null;case 5:NC(t);var o=Ea(jf.current);if(n=t.type,e!==null&&t.stateNode!=null)hO(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Te(166));return _r(t),null}if(e=Ea(is.current),Hh(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[ns]=t,r[Bf]=i,e=(t.mode&1)!==0,n){case"dialog":Cn("cancel",r),Cn("close",r);break;case"iframe":case"object":case"embed":Cn("load",r);break;case"video":case"audio":for(o=0;o<nf.length;o++)Cn(nf[o],r);break;case"source":Cn("error",r);break;case"img":case"image":case"link":Cn("error",r),Cn("load",r);break;case"details":Cn("toggle",r);break;case"input":Bk(r,i),Cn("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Cn("invalid",r);break;case"textarea":jk(r,i),Cn("invalid",r)}xb(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&jh(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&jh(r.textContent,a,e),o=["children",""+a]):$f.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Cn("scroll",r)}switch(n){case"input":Oh(r),zk(r,i,!0);break;case"textarea":Oh(r),Hk(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Ym)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=HM(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[ns]=t,e[Bf]=r,pO(e,t,!1,!1),t.stateNode=e;e:{switch(s=Sb(n,r),n){case"dialog":Cn("cancel",e),Cn("close",e),o=r;break;case"iframe":case"object":case"embed":Cn("load",e),o=r;break;case"video":case"audio":for(o=0;o<nf.length;o++)Cn(nf[o],e);o=r;break;case"source":Cn("error",e),o=r;break;case"img":case"image":case"link":Cn("error",e),Cn("load",e),o=r;break;case"details":Cn("toggle",e),o=r;break;case"input":Bk(e,r),o=vb(e,r),Cn("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=jn({},r,{value:void 0}),Cn("invalid",e);break;case"textarea":jk(e,r),o=wb(e,r),Cn("invalid",e);break;default:o=r}xb(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="style"?WM(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&VM(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Rf(e,c):typeof c=="number"&&Rf(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&($f.hasOwnProperty(i)?c!=null&&i==="onScroll"&&Cn("scroll",e):c!=null&&hC(e,i,c,s))}switch(n){case"input":Oh(e),zk(e,r,!1);break;case"textarea":Oh(e),Hk(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Vl(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?au(e,!!r.multiple,i,!1):r.defaultValue!=null&&au(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Ym)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return _r(t),null;case 6:if(e&&t.stateNode!=null)mO(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Te(166));if(n=Ea(jf.current),Ea(is.current),Hh(t)){if(r=t.stateNode,n=t.memoizedProps,r[ns]=t,(i=r.nodeValue!==n)&&(e=To,e!==null))switch(e.tag){case 3:jh(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&jh(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ns]=t,t.stateNode=r}return _r(t),null;case 13:if(En(Nn),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Mn&&Ro!==null&&t.mode&1&&!(t.flags&128))TT(),Eu(),t.flags|=98560,i=!1;else if(i=Hh(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(Te(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Te(317));i[ns]=t}else Eu(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_r(t),i=!1}else Mi!==null&&(rw(Mi),Mi=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Nn.current&1?or===0&&(or=3):QC())),t.updateQueue!==null&&(t.flags|=4),_r(t),null);case 4:return Iu(),Yb(e,t),e===null&&Nf(t.stateNode.containerInfo),_r(t),null;case 10:return OC(t.type._context),_r(t),null;case 17:return lo(t.type)&&Qm(),_r(t),null;case 19:if(En(Nn),i=t.memoizedState,i===null)return _r(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Ad(i,!1);else{if(or!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=rg(e),s!==null){for(t.flags|=128,Ad(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return gn(Nn,Nn.current&1|2),t.child}e=e.sibling}i.tail!==null&&Yn()>_u&&(t.flags|=128,r=!0,Ad(i,!1),t.lanes=4194304)}else{if(!r)if(e=rg(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ad(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Mn)return _r(t),null}else 2*Yn()-i.renderingStartTime>_u&&n!==1073741824&&(t.flags|=128,r=!0,Ad(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Yn(),t.sibling=null,n=Nn.current,gn(Nn,r?n&1|2:n&1),t):(_r(t),null);case 22:case 23:return YC(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?So&1073741824&&(_r(t),t.subtreeFlags&6&&(t.flags|=8192)):_r(t),null;case 24:return null;case 25:return null}throw Error(Te(156,t.tag))}function b8(e,t){switch($C(t),t.tag){case 1:return lo(t.type)&&Qm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Iu(),En(so),En(Fr),DC(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return NC(t),null;case 13:if(En(Nn),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Te(340));Eu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return En(Nn),null;case 4:return Iu(),null;case 10:return OC(t.type._context),null;case 22:case 23:return YC(),null;case 24:return null;default:return null}}var Wh=!1,Mr=!1,w8=typeof WeakSet=="function"?WeakSet:Set,Qe=null;function eu(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Gn(e,t,r)}else n.current=null}function Qb(e,t,n){try{n()}catch(r){Gn(e,t,r)}}var M2=!1;function C8(e,t){if(Ob=Gm,e=bT(),kC(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch(P){n=null;break e}var s=0,a=-1,c=-1,d=0,p=0,h=e,m=null;t:for(;;){for(var g;h!==n||o!==0&&h.nodeType!==3||(a=s+o),h!==i||r!==0&&h.nodeType!==3||(c=s+r),h.nodeType===3&&(s+=h.nodeValue.length),(g=h.firstChild)!==null;)m=h,h=g;for(;;){if(h===e)break t;if(m===n&&++d===o&&(a=s),m===i&&++p===r&&(c=s),(g=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=g}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Lb={focusedElem:e,selectionRange:n},Gm=!1,Qe=t;Qe!==null;)if(t=Qe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Qe=e;else for(;Qe!==null;){t=Qe;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,S=y.memoizedState,w=t.stateNode,C=w.getSnapshotBeforeUpdate(t.elementType===t.type?v:_i(t.type,v),S);w.__reactInternalSnapshotBeforeUpdate=C}break;case 3:var x=t.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(Te(163))}}catch(P){Gn(t,t.return,P)}if(e=t.sibling,e!==null){e.return=t.return,Qe=e;break}Qe=t.return}return y=M2,M2=!1,y}function gf(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Qb(t,n,i)}o=o.next}while(o!==r)}}function Xg(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Xb(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function gO(e){var t=e.alternate;t!==null&&(e.alternate=null,gO(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ns],delete t[Bf],delete t[Nb],delete t[r8],delete t[o8])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function vO(e){return e.tag===5||e.tag===3||e.tag===4}function T2(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vO(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ym));else if(r!==4&&(e=e.child,e!==null))for(Jb(e,t,n),e=e.sibling;e!==null;)Jb(e,t,n),e=e.sibling}function Zb(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Zb(e,t,n),e=e.sibling;e!==null;)Zb(e,t,n),e=e.sibling}var wr=null,Ri=!1;function al(e,t,n){for(n=n.child;n!==null;)yO(e,t,n),n=n.sibling}function yO(e,t,n){if(os&&typeof os.onCommitFiberUnmount=="function")try{os.onCommitFiberUnmount(Vg,n)}catch(a){}switch(n.tag){case 5:Mr||eu(n,t);case 6:var r=wr,o=Ri;wr=null,al(e,t,n),wr=r,Ri=o,wr!==null&&(Ri?(e=wr,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wr.removeChild(n.stateNode));break;case 18:wr!==null&&(Ri?(e=wr,n=n.stateNode,e.nodeType===8?f1(e.parentNode,n):e.nodeType===1&&f1(e,n),Lf(e)):f1(wr,n.stateNode));break;case 4:r=wr,o=Ri,wr=n.stateNode.containerInfo,Ri=!0,al(e,t,n),wr=r,Ri=o;break;case 0:case 11:case 14:case 15:if(!Mr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Qb(n,t,s),o=o.next}while(o!==r)}al(e,t,n);break;case 1:if(!Mr&&(eu(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Gn(n,t,a)}al(e,t,n);break;case 21:al(e,t,n);break;case 22:n.mode&1?(Mr=(r=Mr)||n.memoizedState!==null,al(e,t,n),Mr=r):al(e,t,n);break;default:al(e,t,n)}}function O2(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new w8),t.forEach(function(r){var o=R8.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Ii(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:wr=a.stateNode,Ri=!1;break e;case 3:wr=a.stateNode.containerInfo,Ri=!0;break e;case 4:wr=a.stateNode.containerInfo,Ri=!0;break e}a=a.return}if(wr===null)throw Error(Te(160));yO(i,s,o),wr=null,Ri=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(d){Gn(o,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)bO(t,e),t=t.sibling}function bO(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ii(t,e),qi(e),r&4){try{gf(3,e,e.return),Xg(3,e)}catch(v){Gn(e,e.return,v)}try{gf(5,e,e.return)}catch(v){Gn(e,e.return,v)}}break;case 1:Ii(t,e),qi(e),r&512&&n!==null&&eu(n,n.return);break;case 5:if(Ii(t,e),qi(e),r&512&&n!==null&&eu(n,n.return),e.flags&32){var o=e.stateNode;try{Rf(o,"")}catch(v){Gn(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&zM(o,i),Sb(a,s);var d=Sb(a,i);for(s=0;s<c.length;s+=2){var p=c[s],h=c[s+1];p==="style"?WM(o,h):p==="dangerouslySetInnerHTML"?VM(o,h):p==="children"?Rf(o,h):hC(o,p,h,d)}switch(a){case"input":yb(o,i);break;case"textarea":jM(o,i);break;case"select":var m=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var g=i.value;g!=null?au(o,!!i.multiple,g,!1):m!==!!i.multiple&&(i.defaultValue!=null?au(o,!!i.multiple,i.defaultValue,!0):au(o,!!i.multiple,i.multiple?[]:"",!1))}o[Bf]=i}catch(v){Gn(e,e.return,v)}}break;case 6:if(Ii(t,e),qi(e),r&4){if(e.stateNode===null)throw Error(Te(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){Gn(e,e.return,v)}}break;case 3:if(Ii(t,e),qi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Lf(t.containerInfo)}catch(v){Gn(e,e.return,v)}break;case 4:Ii(t,e),qi(e);break;case 13:Ii(t,e),qi(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(KC=Yn())),r&4&&O2(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(Mr=(d=Mr)||p,Ii(t,e),Mr=d):Ii(t,e),qi(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!p&&e.mode&1)for(Qe=e,p=e.child;p!==null;){for(h=Qe=p;Qe!==null;){switch(m=Qe,g=m.child,m.tag){case 0:case 11:case 14:case 15:gf(4,m,m.return);break;case 1:eu(m,m.return);var y=m.stateNode;if(typeof y.componentWillUnmount=="function"){r=m,n=m.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){Gn(r,n,v)}}break;case 5:eu(m,m.return);break;case 22:if(m.memoizedState!==null){F2(h);continue}}g!==null?(g.return=m,Qe=g):F2(h)}p=p.sibling}e:for(p=null,h=e;;){if(h.tag===5){if(p===null){p=h;try{o=h.stateNode,d?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=h.stateNode,c=h.memoizedProps.style,s=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=UM("display",s))}catch(v){Gn(e,e.return,v)}}}else if(h.tag===6){if(p===null)try{h.stateNode.nodeValue=d?"":h.memoizedProps}catch(v){Gn(e,e.return,v)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;p===h&&(p=null),h=h.return}p===h&&(p=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Ii(t,e),qi(e),r&4&&O2(e);break;case 21:break;default:Ii(t,e),qi(e)}}function qi(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(vO(n)){var r=n;break e}n=n.return}throw Error(Te(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Rf(o,""),r.flags&=-33);var i=T2(e);Zb(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=T2(e);Jb(e,a,s);break;default:throw Error(Te(161))}}catch(c){Gn(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function x8(e,t,n){Qe=e,wO(e)}function wO(e,t,n){for(var r=(e.mode&1)!==0;Qe!==null;){var o=Qe,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Wh;if(!s){var a=o.alternate,c=a!==null&&a.memoizedState!==null||Mr;a=Wh;var d=Mr;if(Wh=s,(Mr=c)&&!d)for(Qe=o;Qe!==null;)s=Qe,c=s.child,s.tag===22&&s.memoizedState!==null?A2(o):c!==null?(c.return=s,Qe=c):A2(o);for(;i!==null;)Qe=i,wO(i),i=i.sibling;Qe=o,Wh=a,Mr=d}L2(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,Qe=i):L2(e)}}function L2(e){for(;Qe!==null;){var t=Qe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Mr||Xg(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Mr)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:_i(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&v2(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}v2(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var p=d.memoizedState;if(p!==null){var h=p.dehydrated;h!==null&&Lf(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Te(163))}Mr||t.flags&512&&Xb(t)}catch(m){Gn(t,t.return,m)}}if(t===e){Qe=null;break}if(n=t.sibling,n!==null){n.return=t.return,Qe=n;break}Qe=t.return}}function F2(e){for(;Qe!==null;){var t=Qe;if(t===e){Qe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Qe=n;break}Qe=t.return}}function A2(e){for(;Qe!==null;){var t=Qe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Xg(4,t)}catch(c){Gn(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(c){Gn(t,o,c)}}var i=t.return;try{Xb(t)}catch(c){Gn(t,i,c)}break;case 5:var s=t.return;try{Xb(t)}catch(c){Gn(t,s,c)}}}catch(c){Gn(t,t.return,c)}if(t===e){Qe=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Qe=a;break}Qe=t.return}}var S8=Math.ceil,sg=Qs.ReactCurrentDispatcher,WC=Qs.ReactCurrentOwner,ui=Qs.ReactCurrentBatchConfig,Gt=0,hr=null,er=null,Sr=0,So=0,tu=ta(0),or=0,Wf=null,Ba=0,Jg=0,GC=0,vf=null,Zr=null,KC=0,_u=1/0,Ls=null,lg=!1,ew=null,Fl=null,Gh=!1,Pl=null,ag=0,yf=0,tw=null,xm=-1,Sm=0;function Ur(){return Gt&6?Yn():xm!==-1?xm:xm=Yn()}function Al(e){return e.mode&1?Gt&2&&Sr!==0?Sr&-Sr:s8.transition!==null?(Sm===0&&(Sm=rT()),Sm):(e=sn,e!==0||(e=window.event,e=e===void 0?16:uT(e.type)),e):1}function Ai(e,t,n,r){if(50<yf)throw yf=0,tw=null,Error(Te(185));vp(e,n,r),(!(Gt&2)||e!==hr)&&(e===hr&&(!(Gt&2)&&(Jg|=n),or===4&&xl(e,Sr)),ao(e,r),n===1&&Gt===0&&!(t.mode&1)&&(_u=Yn()+500,qg&&na()))}function ao(e,t){var n=e.callbackNode;sH(e,t);var r=Wm(e,e===hr?Sr:0);if(r===0)n!==null&&Wk(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Wk(n),t===1)e.tag===0?i8(N2.bind(null,e)):$T(N2.bind(null,e)),t8(function(){!(Gt&6)&&na()}),n=null;else{switch(oT(r)){case 1:n=bC;break;case 4:n=tT;break;case 16:n=Um;break;case 536870912:n=nT;break;default:n=Um}n=_O(n,CO.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function CO(e,t){if(xm=-1,Sm=0,Gt&6)throw Error(Te(327));var n=e.callbackNode;if(pu()&&e.callbackNode!==n)return null;var r=Wm(e,e===hr?Sr:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=cg(e,r);else{t=r;var o=Gt;Gt|=2;var i=SO();(hr!==e||Sr!==t)&&(Ls=null,_u=Yn()+500,_a(e,t));do try{I8();break}catch(a){xO(e,a)}while(1);TC(),sg.current=i,Gt=o,er!==null?t=0:(hr=null,Sr=0,t=or)}if(t!==0){if(t===2&&(o=_b(e),o!==0&&(r=o,t=nw(e,o))),t===1)throw n=Wf,_a(e,0),xl(e,r),ao(e,Yn()),n;if(t===6)xl(e,r);else{if(o=e.current.alternate,!(r&30)&&!E8(o)&&(t=cg(e,r),t===2&&(i=_b(e),i!==0&&(r=i,t=nw(e,i))),t===1))throw n=Wf,_a(e,0),xl(e,r),ao(e,Yn()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(Te(345));case 2:va(e,Zr,Ls);break;case 3:if(xl(e,r),(r&130023424)===r&&(t=KC+500-Yn(),10<t)){if(Wm(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ur(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Ab(va.bind(null,e,Zr,Ls),t);break}va(e,Zr,Ls);break;case 4:if(xl(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Fi(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Yn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*S8(r/1960))-r,10<r){e.timeoutHandle=Ab(va.bind(null,e,Zr,Ls),r);break}va(e,Zr,Ls);break;case 5:va(e,Zr,Ls);break;default:throw Error(Te(329))}}}return ao(e,Yn()),e.callbackNode===n?CO.bind(null,e):null}function nw(e,t){var n=vf;return e.current.memoizedState.isDehydrated&&(_a(e,t).flags|=256),e=cg(e,t),e!==2&&(t=Zr,Zr=n,t!==null&&rw(t)),e}function rw(e){Zr===null?Zr=e:Zr.push.apply(Zr,e)}function E8(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!Di(i(),o))return!1}catch(s){return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function xl(e,t){for(t&=~GC,t&=~Jg,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Fi(t),r=1<<n;e[n]=-1,t&=~r}}function N2(e){if(Gt&6)throw Error(Te(327));pu();var t=Wm(e,0);if(!(t&1))return ao(e,Yn()),null;var n=cg(e,t);if(e.tag!==0&&n===2){var r=_b(e);r!==0&&(t=r,n=nw(e,r))}if(n===1)throw n=Wf,_a(e,0),xl(e,t),ao(e,Yn()),n;if(n===6)throw Error(Te(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,va(e,Zr,Ls),ao(e,Yn()),null}function qC(e,t){var n=Gt;Gt|=1;try{return e(t)}finally{Gt=n,Gt===0&&(_u=Yn()+500,qg&&na())}}function za(e){Pl!==null&&Pl.tag===0&&!(Gt&6)&&pu();var t=Gt;Gt|=1;var n=ui.transition,r=sn;try{if(ui.transition=null,sn=1,e)return e()}finally{sn=r,ui.transition=n,Gt=t,!(Gt&6)&&na()}}function YC(){So=tu.current,En(tu)}function _a(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,e8(n)),er!==null)for(n=er.return;n!==null;){var r=n;switch($C(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Qm();break;case 3:Iu(),En(so),En(Fr),DC();break;case 5:NC(r);break;case 4:Iu();break;case 13:En(Nn);break;case 19:En(Nn);break;case 10:OC(r.type._context);break;case 22:case 23:YC()}n=n.return}if(hr=e,er=e=Nl(e.current,null),Sr=So=t,or=0,Wf=null,GC=Jg=Ba=0,Zr=vf=null,Sa!==null){for(t=0;t<Sa.length;t++)if(n=Sa[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}Sa=null}return e}function xO(e,t){do{var n=er;try{if(TC(),bm.current=ig,og){for(var r=Bn.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}og=!1}if(Da=0,pr=rr=Bn=null,mf=!1,Hf=0,WC.current=null,n===null||n.return===null){or=1,Wf=t,er=null;break}e:{var i=e,s=n.return,a=n,c=t;if(t=Sr,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,p=a,h=p.tag;if(!(p.mode&1)&&(h===0||h===11||h===15)){var m=p.alternate;m?(p.updateQueue=m.updateQueue,p.memoizedState=m.memoizedState,p.lanes=m.lanes):(p.updateQueue=null,p.memoizedState=null)}var g=E2(s);if(g!==null){g.flags&=-257,P2(g,s,a,i,t),g.mode&1&&S2(i,d,t),t=g,c=d;var y=t.updateQueue;if(y===null){var v=new Set;v.add(c),t.updateQueue=v}else y.add(c);break e}else{if(!(t&1)){S2(i,d,t),QC();break e}c=Error(Te(426))}}else if(Mn&&a.mode&1){var S=E2(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),P2(S,s,a,i,t),RC(ku(c,a));break e}}i=c=ku(c,a),or!==4&&(or=2),vf===null?vf=[i]:vf.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var w=iO(i,c,t);g2(i,w);break e;case 1:a=c;var C=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof C.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Fl===null||!Fl.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var P=sO(i,a,t);g2(i,P);break e}}i=i.return}while(i!==null)}PO(n)}catch(_){t=_,er===n&&n!==null&&(er=n=n.return);continue}break}while(1)}function SO(){var e=sg.current;return sg.current=ig,e===null?ig:e}function QC(){(or===0||or===3||or===2)&&(or=4),hr===null||!(Ba&268435455)&&!(Jg&268435455)||xl(hr,Sr)}function cg(e,t){var n=Gt;Gt|=2;var r=SO();(hr!==e||Sr!==t)&&(Ls=null,_a(e,t));do try{P8();break}catch(o){xO(e,o)}while(1);if(TC(),Gt=n,sg.current=r,er!==null)throw Error(Te(261));return hr=null,Sr=0,or}function P8(){for(;er!==null;)EO(er)}function I8(){for(;er!==null&&!X9();)EO(er)}function EO(e){var t=kO(e.alternate,e,So);e.memoizedProps=e.pendingProps,t===null?PO(e):er=t,WC.current=null}function PO(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=b8(n,t),n!==null){n.flags&=32767,er=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{or=6,er=null;return}}else if(n=y8(n,t,So),n!==null){er=n;return}if(t=t.sibling,t!==null){er=t;return}er=t=e}while(t!==null);or===0&&(or=5)}function va(e,t,n){var r=sn,o=ui.transition;try{ui.transition=null,sn=1,k8(e,t,n,r)}finally{ui.transition=o,sn=r}return null}function k8(e,t,n,r){do pu();while(Pl!==null);if(Gt&6)throw Error(Te(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Te(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(lH(e,i),e===hr&&(er=hr=null,Sr=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Gh||(Gh=!0,_O(Um,function(){return pu(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=ui.transition,ui.transition=null;var s=sn;sn=1;var a=Gt;Gt|=4,WC.current=null,C8(e,n),bO(n,e),KH(Lb),Gm=!!Ob,Lb=Ob=null,e.current=n,x8(n),J9(),Gt=a,sn=s,ui.transition=i}else e.current=n;if(Gh&&(Gh=!1,Pl=e,ag=o),i=e.pendingLanes,i===0&&(Fl=null),tH(n.stateNode),ao(e,Yn()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(lg)throw lg=!1,e=ew,ew=null,e;return ag&1&&e.tag!==0&&pu(),i=e.pendingLanes,i&1?e===tw?yf++:(yf=0,tw=e):yf=0,na(),null}function pu(){if(Pl!==null){var e=oT(ag),t=ui.transition,n=sn;try{if(ui.transition=null,sn=16>e?16:e,Pl===null)var r=!1;else{if(e=Pl,Pl=null,ag=0,Gt&6)throw Error(Te(331));var o=Gt;for(Gt|=4,Qe=e.current;Qe!==null;){var i=Qe,s=i.child;if(Qe.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c<a.length;c++){var d=a[c];for(Qe=d;Qe!==null;){var p=Qe;switch(p.tag){case 0:case 11:case 15:gf(8,p,i)}var h=p.child;if(h!==null)h.return=p,Qe=h;else for(;Qe!==null;){p=Qe;var m=p.sibling,g=p.return;if(gO(p),p===d){Qe=null;break}if(m!==null){m.return=g,Qe=m;break}Qe=g}}}var y=i.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var S=v.sibling;v.sibling=null,v=S}while(v!==null)}}Qe=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,Qe=s;else e:for(;Qe!==null;){if(i=Qe,i.flags&2048)switch(i.tag){case 0:case 11:case 15:gf(9,i,i.return)}var w=i.sibling;if(w!==null){w.return=i.return,Qe=w;break e}Qe=i.return}}var C=e.current;for(Qe=C;Qe!==null;){s=Qe;var x=s.child;if(s.subtreeFlags&2064&&x!==null)x.return=s,Qe=x;else e:for(s=C;Qe!==null;){if(a=Qe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Xg(9,a)}}catch(_){Gn(a,a.return,_)}if(a===s){Qe=null;break e}var P=a.sibling;if(P!==null){P.return=a.return,Qe=P;break e}Qe=a.return}}if(Gt=o,na(),os&&typeof os.onPostCommitFiberRoot=="function")try{os.onPostCommitFiberRoot(Vg,e)}catch(_){}r=!0}return r}finally{sn=n,ui.transition=t}}return!1}function D2(e,t,n){t=ku(n,t),t=iO(e,t,1),e=Ll(e,t,1),t=Ur(),e!==null&&(vp(e,1,t),ao(e,t))}function Gn(e,t,n){if(e.tag===3)D2(e,e,n);else for(;t!==null;){if(t.tag===3){D2(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Fl===null||!Fl.has(r))){e=ku(n,e),e=sO(t,e,1),t=Ll(t,e,1),e=Ur(),t!==null&&(vp(t,1,e),ao(t,e));break}}t=t.return}}function _8(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ur(),e.pingedLanes|=e.suspendedLanes&n,hr===e&&(Sr&n)===n&&(or===4||or===3&&(Sr&130023424)===Sr&&500>Yn()-KC?_a(e,0):GC|=n),ao(e,t)}function IO(e,t){t===0&&(e.mode&1?(t=Ah,Ah<<=1,!(Ah&130023424)&&(Ah=4194304)):t=1);var n=Ur();e=Vs(e,t),e!==null&&(vp(e,t,n),ao(e,n))}function $8(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),IO(e,n)}function R8(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Te(314))}r!==null&&r.delete(t),IO(e,n)}var kO;kO=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||so.current)ro=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ro=!1,v8(e,t,n);ro=!!(e.flags&131072)}else ro=!1,Mn&&t.flags&1048576&&RT(t,Zm,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Cm(e,t),e=t.pendingProps;var o=Su(t,Fr.current);fu(t,n),o=zC(null,t,r,e,o,n);var i=jC();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lo(r)?(i=!0,Xm(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,FC(t),o.updater=Yg,t.stateNode=o,o._reactInternals=t,Vb(t,r,e,n),t=Gb(null,t,r,!0,i,n)):(t.tag=0,Mn&&i&&_C(t),zr(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Cm(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=T8(r),e=_i(r,e),o){case 0:t=Wb(null,t,r,e,n);break e;case 1:t=_2(null,t,r,e,n);break e;case 11:t=I2(null,t,r,e,n);break e;case 14:t=k2(null,t,r,_i(r.type,e),n);break e}throw Error(Te(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:_i(r,o),Wb(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:_i(r,o),_2(e,t,r,o,n);case 3:e:{if(uO(t),e===null)throw Error(Te(387));r=t.pendingProps,i=t.memoizedState,o=i.element,LT(e,t),ng(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=ku(Error(Te(423)),t),t=$2(e,t,r,n,o);break e}else if(r!==o){o=ku(Error(Te(424)),t),t=$2(e,t,r,n,o);break e}else for(Ro=Ol(t.stateNode.containerInfo.firstChild),To=t,Mn=!0,Mi=null,n=DT(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Eu(),r===o){t=Us(e,t,n);break e}zr(e,t,r,n)}t=t.child}return t;case 5:return BT(t),e===null&&zb(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Fb(r,o)?s=null:i!==null&&Fb(r,i)&&(t.flags|=32),cO(e,t),zr(e,t,s,n),t.child;case 6:return e===null&&zb(t),null;case 13:return dO(e,t,n);case 4:return AC(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pu(t,null,r,n):zr(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:_i(r,o),I2(e,t,r,o,n);case 7:return zr(e,t,t.pendingProps,n),t.child;case 8:return zr(e,t,t.pendingProps.children,n),t.child;case 12:return zr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,gn(eg,r._currentValue),r._currentValue=s,i!==null)if(Di(i.value,s)){if(i.children===o.children&&!so.current){t=Us(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Bs(-1,n&-n),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var p=d.pending;p===null?c.next=c:(c.next=p.next,p.next=c),d.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),jb(i.return,n,t),a.lanes|=n;break}c=c.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(Te(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),jb(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}zr(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,fu(t,n),o=hi(o),r=r(o),t.flags|=1,zr(e,t,r,n),t.child;case 14:return r=t.type,o=_i(r,t.pendingProps),o=_i(r.type,o),k2(e,t,r,o,n);case 15:return lO(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:_i(r,o),Cm(e,t),t.tag=1,lo(r)?(e=!0,Xm(t)):e=!1,fu(t,n),AT(t,r,o),Vb(t,r,o,n),Gb(null,t,r,!0,e,n);case 19:return fO(e,t,n);case 22:return aO(e,t,n)}throw Error(Te(156,t.tag))};function _O(e,t){return eT(e,t)}function M8(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ci(e,t,n,r){return new M8(e,t,n,r)}function XC(e){return e=e.prototype,!(!e||!e.isReactComponent)}function T8(e){if(typeof e=="function")return XC(e)?1:0;if(e!=null){if(e=e.$$typeof,e===gC)return 11;if(e===vC)return 14}return 2}function Nl(e,t){var n=e.alternate;return n===null?(n=ci(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Em(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")XC(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Wc:return $a(n.children,o,i,t);case mC:s=8,o|=8;break;case pb:return e=ci(12,n,t,o|2),e.elementType=pb,e.lanes=i,e;case hb:return e=ci(13,n,t,o),e.elementType=hb,e.lanes=i,e;case mb:return e=ci(19,n,t,o),e.elementType=mb,e.lanes=i,e;case NM:return Zg(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case FM:s=10;break e;case AM:s=9;break e;case gC:s=11;break e;case vC:s=14;break e;case gl:s=16,r=null;break e}throw Error(Te(130,e==null?e:typeof e,""))}return t=ci(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function $a(e,t,n,r){return e=ci(7,e,r,t),e.lanes=n,e}function Zg(e,t,n,r){return e=ci(22,e,r,t),e.elementType=NM,e.lanes=n,e.stateNode={isHidden:!1},e}function w1(e,t,n){return e=ci(6,e,null,t),e.lanes=n,e}function C1(e,t,n){return t=ci(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function O8(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=t1(0),this.expirationTimes=t1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=t1(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function JC(e,t,n,r,o,i,s,a,c){return e=new O8(e,t,n,a,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=ci(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},FC(i),e}function L8(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Uc,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function $O(e){if(!e)return Ul;e=e._reactInternals;e:{if(nc(e)!==e||e.tag!==1)throw Error(Te(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(lo(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Te(171))}if(e.tag===1){var n=e.type;if(lo(n))return _T(e,n,t)}return t}function RO(e,t,n,r,o,i,s,a,c){return e=JC(n,r,!0,e,o,i,s,a,c),e.context=$O(null),n=e.current,r=Ur(),o=Al(n),i=Bs(r,o),i.callback=t!=null?t:null,Ll(n,i,o),e.current.lanes=o,vp(e,o,r),ao(e,r),e}function ev(e,t,n,r){var o=t.current,i=Ur(),s=Al(o);return n=$O(n),t.context===null?t.context=n:t.pendingContext=n,t=Bs(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ll(o,t,s),e!==null&&(Ai(e,o,s,i),ym(e,o,s)),s}function ug(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function B2(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ZC(e,t){B2(e,t),(e=e.alternate)&&B2(e,t)}function F8(){return null}var MO=typeof reportError=="function"?reportError:function(e){console.error(e)};function ex(e){this._internalRoot=e}tv.prototype.render=ex.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Te(409));ev(e,t,null,null)};tv.prototype.unmount=ex.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;za(function(){ev(null,e,null,null)}),t[Hs]=null}};function tv(e){this._internalRoot=e}tv.prototype.unstable_scheduleHydration=function(e){if(e){var t=lT();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cl.length&&t!==0&&t<Cl[n].priority;n++);Cl.splice(n,0,e),n===0&&cT(e)}};function tx(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function nv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function z2(){}function A8(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var d=ug(s);i.call(d)}}var s=RO(t,r,e,0,null,!1,!1,"",z2);return e._reactRootContainer=s,e[Hs]=s.current,Nf(e.nodeType===8?e.parentNode:e),za(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var d=ug(c);a.call(d)}}var c=JC(e,0,!1,null,null,!1,!1,"",z2);return e._reactRootContainer=c,e[Hs]=c.current,Nf(e.nodeType===8?e.parentNode:e),za(function(){ev(t,c,n,r)}),c}function rv(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var c=ug(s);a.call(c)}}ev(t,s,e,o)}else s=A8(n,t,e,o,r);return ug(s)}iT=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=tf(t.pendingLanes);n!==0&&(wC(t,n|1),ao(t,Yn()),!(Gt&6)&&(_u=Yn()+500,na()))}break;case 13:za(function(){var r=Vs(e,1);if(r!==null){var o=Ur();Ai(r,e,1,o)}}),ZC(e,1)}};CC=function(e){if(e.tag===13){var t=Vs(e,134217728);if(t!==null){var n=Ur();Ai(t,e,134217728,n)}ZC(e,134217728)}};sT=function(e){if(e.tag===13){var t=Al(e),n=Vs(e,t);if(n!==null){var r=Ur();Ai(n,e,t,r)}ZC(e,t)}};lT=function(){return sn};aT=function(e,t){var n=sn;try{return sn=e,t()}finally{sn=n}};Pb=function(e,t,n){switch(t){case"input":if(yb(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Kg(r);if(!o)throw Error(Te(90));BM(r),yb(r,o)}}}break;case"textarea":jM(e,n);break;case"select":t=n.value,t!=null&&au(e,!!n.multiple,t,!1)}};qM=qC;YM=za;var N8={usingClientEntryPoint:!1,Events:[bp,Yc,Kg,GM,KM,qC]},Nd={findFiberByHostInstance:xa,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},D8={bundleType:Nd.bundleType,version:Nd.version,rendererPackageName:Nd.rendererPackageName,rendererConfig:Nd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Qs.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=JM(e),e===null?null:e.stateNode},findFiberByHostInstance:Nd.findFiberByHostInstance||F8,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"){var Kh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kh.isDisabled&&Kh.supportsFiber)try{Vg=Kh.inject(D8),os=Kh}catch(e){}}zo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N8;zo.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!tx(t))throw Error(Te(200));return L8(e,t,null,n)};zo.createRoot=function(e,t){if(!tx(e))throw Error(Te(299));var n=!1,r="",o=MO;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=JC(e,1,!1,null,null,n,!1,r,o),e[Hs]=t.current,Nf(e.nodeType===8?e.parentNode:e),new ex(t)};zo.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Te(188)):(e=Object.keys(e).join(","),Error(Te(268,e)));return e=JM(t),e=e===null?null:e.stateNode,e};zo.flushSync=function(e){return za(e)};zo.hydrate=function(e,t,n){if(!nv(t))throw Error(Te(200));return rv(null,e,t,!0,n)};zo.hydrateRoot=function(e,t,n){if(!tx(e))throw Error(Te(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=MO;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=RO(t,null,e,1,n!=null?n:null,o,!1,i,s),e[Hs]=t.current,Nf(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new tv(t)};zo.render=function(e,t,n){if(!nv(t))throw Error(Te(200));return rv(null,e,t,!1,n)};zo.unmountComponentAtNode=function(e){if(!nv(e))throw Error(Te(40));return e._reactRootContainer?(za(function(){rv(null,null,e,!1,function(){e._reactRootContainer=null,e[Hs]=null})}),!0):!1};zo.unstable_batchedUpdates=qC;zo.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!nv(n))throw Error(Te(200));if(e==null||e._reactInternals===void 0)throw Error(Te(38));return rv(e,t,n,!1,r)};zo.version="18.2.0-next-9e3b772b8-20220608";function TO(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(TO)}catch(e){console.error(e)}}TO(),RM.exports=zo;var Yu=RM.exports;const qh=mp(Yu);var OO,j2=Yu;OO=j2.createRoot,j2.hydrateRoot;const B8="modulepreload",z8=function(e){return"/"+e},H2={},j8=function(t,n,r){if(!n||n.length===0)return t();const o=document.getElementsByTagName("link");return Promise.all(n.map(i=>{if(i=z8(i),i in H2)return;H2[i]=!0;const s=i.endsWith(".css"),a=s?'[rel="stylesheet"]':"";if(!!r)for(let p=o.length-1;p>=0;p--){const h=o[p];if(h.href===i&&(!s||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${a}`))return;const d=document.createElement("link");if(d.rel=s?"stylesheet":B8,s||(d.as="script",d.crossOrigin=""),d.href=i,document.head.appendChild(d),s)return new Promise((p,h)=>{d.addEventListener("load",p),d.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t())};var wM;if(!((wM=window.crypto)!=null&&wM.subtle)){let t;console.debug("poly subtle");const e={digest(n,r){return mt(this,null,function*(){if(n!=="SHA-512")return alert(n+" required but not supported");const i=(yield j8(()=>import("./sha512-9867267f.js").then(s=>s.s),[])).default.arrayBuffer;return i(r)})}};window.crypto||(window.crypto={subtle:e}),crypto.subtle||(crypto.subtle=e)}/**
|
|
33
33
|
* @remix-run/router v1.5.0
|
|
34
34
|
*
|
|
35
35
|
* Copyright (c) Remix Software Inc.
|
|
@@ -316,7 +316,7 @@ __p += '`),Ht&&($e+=`' +
|
|
|
316
316
|
function print() { __p += __j.call(arguments, '') }
|
|
317
317
|
`:`;
|
|
318
318
|
`)+$e+`return __p
|
|
319
|
-
}`;var Ot=_k(function(){return qt(G,rt+"return "+$e).apply(n,q)});if(Ot.source=$e,D0(Ot))throw Ot;return Ot}function Ej(l){return Xt(l).toLowerCase()}function Pj(l){return Xt(l).toUpperCase()}function Ij(l,f,b){if(l=Xt(l),l&&(b||f===n))return NP(l);if(!l||!(f=vo(f)))return l;var $=xi(l),j=xi(f),G=DP($,j),q=BP($,j)+1;return sl($,G,q).join("")}function kj(l,f,b){if(l=Xt(l),l&&(b||f===n))return l.slice(0,jP(l)+1);if(!l||!(f=vo(f)))return l;var $=xi(l),j=BP($,xi(f))+1;return sl($,0,j).join("")}function _j(l,f,b){if(l=Xt(l),l&&(b||f===n))return l.replace(ft,"");if(!l||!(f=vo(f)))return l;var $=xi(l),j=DP($,xi(f));return sl($,j).join("")}function $j(l,f){var b=F,$=L;if(An(f)){var j="separator"in f?f.separator:j;b="length"in f?Mt(f.length):b,$="omission"in f?vo(f.omission):$}l=Xt(l);var G=l.length;if(fc(l)){var q=xi(l);G=q.length}if(b>=G)return l;var Q=b-pc($);if(Q<1)return $;var Z=q?sl(q,0,Q).join(""):l.slice(0,Q);if(j===n)return Z+$;if(q&&(Q+=Z.length-Q),B0(j)){if(l.slice(Q).search(j)){var xe,Se=Z;for(j.global||(j=t0(j.source,Xt(We.exec(j))+"g")),j.lastIndex=0;xe=j.exec(Se);)var $e=xe.index;Z=Z.slice(0,$e===n?Q:$e)}}else if(l.indexOf(vo(j),Q)!=Q){var ze=Z.lastIndexOf(j);ze>-1&&(Z=Z.slice(0,ze))}return Z+$}function Rj(l){return l=Xt(l),l&&bn.test(l)?l.replace(ar,i5):l}var Mj=wc(function(l,f,b){return l+(b?" ":"")+f.toUpperCase()}),H0=$I("toUpperCase");function kk(l,f,b){return l=Xt(l),f=b?n:f,f===n?e5(l)?a5(l):WD(l):l.match(f)||[]}var _k=Lt(function(l,f){try{return mo(l,n,f)}catch(b){return D0(b)?b:new It(b)}}),Tj=ks(function(l,f){return qo(f,function(b){b=Wi(b),Ps(l,b,A0(l[b],l))}),l});function Oj(l){var f=l==null?0:l.length,b=gt();return l=f?$n(l,function($){if(typeof $[1]!="function")throw new Yo(s);return[b($[0]),$[1]]}):[],Lt(function($){for(var j=-1;++j<f;){var G=l[j];if(mo(G[0],this,$))return mo(G[1],this,$)}})}function Lj(l){return i3(Xo(l,h))}function V0(l){return function(){return l}}function Fj(l,f){return l==null||l!==l?f:l}var Aj=MI(),Nj=MI(!0);function Xr(l){return l}function U0(l){return lI(typeof l=="function"?l:Xo(l,h))}function Dj(l){return cI(Xo(l,h))}function Bj(l,f){return uI(l,Xo(f,h))}var zj=Lt(function(l,f){return function(b){return Sd(b,l,f)}}),jj=Lt(function(l,f){return function(b){return Sd(l,b,f)}});function W0(l,f,b){var $=dr(f),j=uh(f,$);b==null&&!(An(f)&&(j.length||!$.length))&&(b=f,f=l,l=this,j=uh(f,dr(f)));var G=!(An(b)&&"chain"in b)||!!b.chain,q=$s(l);return qo(j,function(Q){var Z=f[Q];l[Q]=Z,q&&(l.prototype[Q]=function(){var xe=this.__chain__;if(G||xe){var Se=l(this.__wrapped__),$e=Se.__actions__=qr(this.__actions__);return $e.push({func:Z,args:arguments,thisArg:l}),Se.__chain__=xe,Se}return Z.apply(l,el([this.value()],arguments))})}),l}function Hj(){return yr._===this&&(yr._=h5),this}function G0(){}function Vj(l){return l=Mt(l),Lt(function(f){return dI(f,l)})}var Uj=S0($n),Wj=S0(TP),Gj=S0(qy);function $k(l){return R0(l)?Yy(Wi(l)):x3(l)}function Kj(l){return function(f){return l==null?n:da(l,f)}}var qj=OI(),Yj=OI(!0);function K0(){return[]}function q0(){return!1}function Qj(){return{}}function Xj(){return""}function Jj(){return!0}function Zj(l,f){if(l=Mt(l),l<1||l>N)return[];var b=K,$=Pr(l,K);f=gt(f),l-=K;for(var j=Jy($,f);++b<l;)f(b);return j}function e9(l){return _t(l)?$n(l,Wi):yo(l)?[l]:qr(YI(Xt(l)))}function t9(l){var f=++f5;return Xt(l)+f}var n9=gh(function(l,f){return l+f},0),r9=E0("ceil"),o9=gh(function(l,f){return l/f},1),i9=E0("floor");function s9(l){return l&&l.length?ch(l,Xr,c0):n}function l9(l,f){return l&&l.length?ch(l,gt(f,2),c0):n}function a9(l){return FP(l,Xr)}function c9(l,f){return FP(l,gt(f,2))}function u9(l){return l&&l.length?ch(l,Xr,p0):n}function d9(l,f){return l&&l.length?ch(l,gt(f,2),p0):n}var f9=gh(function(l,f){return l*f},1),p9=E0("round"),h9=gh(function(l,f){return l-f},0);function m9(l){return l&&l.length?Xy(l,Xr):0}function g9(l,f){return l&&l.length?Xy(l,gt(f,2)):0}return U.after=Dz,U.ary=sk,U.assign=P6,U.assignIn=wk,U.assignInWith=$h,U.assignWith=I6,U.at=k6,U.before=lk,U.bind=A0,U.bindAll=Tj,U.bindKey=ak,U.castArray=Qz,U.chain=rk,U.chunk=iB,U.compact=sB,U.concat=lB,U.cond=Oj,U.conforms=Lj,U.constant=V0,U.countBy=mz,U.create=_6,U.curry=ck,U.curryRight=uk,U.debounce=dk,U.defaults=$6,U.defaultsDeep=R6,U.defer=Bz,U.delay=zz,U.difference=aB,U.differenceBy=cB,U.differenceWith=uB,U.drop=dB,U.dropRight=fB,U.dropRightWhile=pB,U.dropWhile=hB,U.fill=mB,U.filter=vz,U.flatMap=wz,U.flatMapDeep=Cz,U.flatMapDepth=xz,U.flatten=ZI,U.flattenDeep=gB,U.flattenDepth=vB,U.flip=jz,U.flow=Aj,U.flowRight=Nj,U.fromPairs=yB,U.functions=N6,U.functionsIn=D6,U.groupBy=Sz,U.initial=wB,U.intersection=CB,U.intersectionBy=xB,U.intersectionWith=SB,U.invert=z6,U.invertBy=j6,U.invokeMap=Pz,U.iteratee=U0,U.keyBy=Iz,U.keys=dr,U.keysIn=Qr,U.map=Sh,U.mapKeys=V6,U.mapValues=U6,U.matches=Dj,U.matchesProperty=Bj,U.memoize=Ph,U.merge=W6,U.mergeWith=Ck,U.method=zj,U.methodOf=jj,U.mixin=W0,U.negate=Ih,U.nthArg=Vj,U.omit=G6,U.omitBy=K6,U.once=Hz,U.orderBy=kz,U.over=Uj,U.overArgs=Vz,U.overEvery=Wj,U.overSome=Gj,U.partial=N0,U.partialRight=fk,U.partition=_z,U.pick=q6,U.pickBy=xk,U.property=$k,U.propertyOf=Kj,U.pull=kB,U.pullAll=tk,U.pullAllBy=_B,U.pullAllWith=$B,U.pullAt=RB,U.range=qj,U.rangeRight=Yj,U.rearg=Uz,U.reject=Mz,U.remove=MB,U.rest=Wz,U.reverse=L0,U.sampleSize=Oz,U.set=Q6,U.setWith=X6,U.shuffle=Lz,U.slice=TB,U.sortBy=Nz,U.sortedUniq=BB,U.sortedUniqBy=zB,U.split=wj,U.spread=Gz,U.tail=jB,U.take=HB,U.takeRight=VB,U.takeRightWhile=UB,U.takeWhile=WB,U.tap=sz,U.throttle=Kz,U.thru=xh,U.toArray=vk,U.toPairs=Sk,U.toPairsIn=Ek,U.toPath=e9,U.toPlainObject=bk,U.transform=J6,U.unary=qz,U.union=GB,U.unionBy=KB,U.unionWith=qB,U.uniq=YB,U.uniqBy=QB,U.uniqWith=XB,U.unset=Z6,U.unzip=F0,U.unzipWith=nk,U.update=ej,U.updateWith=tj,U.values=Sc,U.valuesIn=nj,U.without=JB,U.words=kk,U.wrap=Yz,U.xor=ZB,U.xorBy=ez,U.xorWith=tz,U.zip=nz,U.zipObject=rz,U.zipObjectDeep=oz,U.zipWith=iz,U.entries=Sk,U.entriesIn=Ek,U.extend=wk,U.extendWith=$h,W0(U,U),U.add=n9,U.attempt=_k,U.camelCase=sj,U.capitalize=Pk,U.ceil=r9,U.clamp=rj,U.clone=Xz,U.cloneDeep=Zz,U.cloneDeepWith=e6,U.cloneWith=Jz,U.conformsTo=t6,U.deburr=Ik,U.defaultTo=Fj,U.divide=o9,U.endsWith=lj,U.eq=Ei,U.escape=aj,U.escapeRegExp=cj,U.every=gz,U.find=yz,U.findIndex=XI,U.findKey=M6,U.findLast=bz,U.findLastIndex=JI,U.findLastKey=T6,U.floor=i9,U.forEach=ok,U.forEachRight=ik,U.forIn=O6,U.forInRight=L6,U.forOwn=F6,U.forOwnRight=A6,U.get=z0,U.gt=n6,U.gte=r6,U.has=B6,U.hasIn=j0,U.head=ek,U.identity=Xr,U.includes=Ez,U.indexOf=bB,U.inRange=oj,U.invoke=H6,U.isArguments=ha,U.isArray=_t,U.isArrayBuffer=o6,U.isArrayLike=Yr,U.isArrayLikeObject=Kn,U.isBoolean=i6,U.isBuffer=ll,U.isDate=s6,U.isElement=l6,U.isEmpty=a6,U.isEqual=c6,U.isEqualWith=u6,U.isError=D0,U.isFinite=d6,U.isFunction=$s,U.isInteger=pk,U.isLength=kh,U.isMap=hk,U.isMatch=f6,U.isMatchWith=p6,U.isNaN=h6,U.isNative=m6,U.isNil=v6,U.isNull=g6,U.isNumber=mk,U.isObject=An,U.isObjectLike=Vn,U.isPlainObject=$d,U.isRegExp=B0,U.isSafeInteger=y6,U.isSet=gk,U.isString=_h,U.isSymbol=yo,U.isTypedArray=xc,U.isUndefined=b6,U.isWeakMap=w6,U.isWeakSet=C6,U.join=EB,U.kebabCase=uj,U.last=Zo,U.lastIndexOf=PB,U.lowerCase=dj,U.lowerFirst=fj,U.lt=x6,U.lte=S6,U.max=s9,U.maxBy=l9,U.mean=a9,U.meanBy=c9,U.min=u9,U.minBy=d9,U.stubArray=K0,U.stubFalse=q0,U.stubObject=Qj,U.stubString=Xj,U.stubTrue=Jj,U.multiply=f9,U.nth=IB,U.noConflict=Hj,U.noop=G0,U.now=Eh,U.pad=pj,U.padEnd=hj,U.padStart=mj,U.parseInt=gj,U.random=ij,U.reduce=$z,U.reduceRight=Rz,U.repeat=vj,U.replace=yj,U.result=Y6,U.round=p9,U.runInContext=J,U.sample=Tz,U.size=Fz,U.snakeCase=bj,U.some=Az,U.sortedIndex=OB,U.sortedIndexBy=LB,U.sortedIndexOf=FB,U.sortedLastIndex=AB,U.sortedLastIndexBy=NB,U.sortedLastIndexOf=DB,U.startCase=Cj,U.startsWith=xj,U.subtract=h9,U.sum=m9,U.sumBy=g9,U.template=Sj,U.times=Zj,U.toFinite=Rs,U.toInteger=Mt,U.toLength=yk,U.toLower=Ej,U.toNumber=ei,U.toSafeInteger=E6,U.toString=Xt,U.toUpper=Pj,U.trim=Ij,U.trimEnd=kj,U.trimStart=_j,U.truncate=$j,U.unescape=Rj,U.uniqueId=t9,U.upperCase=Mj,U.upperFirst=H0,U.each=ok,U.eachRight=ik,U.first=ek,W0(U,function(){var l={};return Vi(U,function(f,b){nn.call(U.prototype,b)||(l[b]=f)}),l}(),{chain:!1}),U.VERSION=r,qo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(l){U[l].placeholder=U}),qo(["drop","take"],function(l,f){zt.prototype[l]=function(b){b=b===n?1:nr(Mt(b),0);var $=this.__filtered__&&!f?new zt(this):this.clone();return $.__filtered__?$.__takeCount__=Pr(b,$.__takeCount__):$.__views__.push({size:Pr(b,K),type:l+($.__dir__<0?"Right":"")}),$},zt.prototype[l+"Right"]=function(b){return this.reverse()[l](b).reverse()}}),qo(["filter","map","takeWhile"],function(l,f){var b=f+1,$=b==R||b==z;zt.prototype[l]=function(j){var G=this.clone();return G.__iteratees__.push({iteratee:gt(j,3),type:b}),G.__filtered__=G.__filtered__||$,G}}),qo(["head","last"],function(l,f){var b="take"+(f?"Right":"");zt.prototype[l]=function(){return this[b](1).value()[0]}}),qo(["initial","tail"],function(l,f){var b="drop"+(f?"":"Right");zt.prototype[l]=function(){return this.__filtered__?new zt(this):this[b](1)}}),zt.prototype.compact=function(){return this.filter(Xr)},zt.prototype.find=function(l){return this.filter(l).head()},zt.prototype.findLast=function(l){return this.reverse().find(l)},zt.prototype.invokeMap=Lt(function(l,f){return typeof l=="function"?new zt(this):this.map(function(b){return Sd(b,l,f)})}),zt.prototype.reject=function(l){return this.filter(Ih(gt(l)))},zt.prototype.slice=function(l,f){l=Mt(l);var b=this;return b.__filtered__&&(l>0||f<0)?new zt(b):(l<0?b=b.takeRight(-l):l&&(b=b.drop(l)),f!==n&&(f=Mt(f),b=f<0?b.dropRight(-f):b.take(f-l)),b)},zt.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},zt.prototype.toArray=function(){return this.take(K)},Vi(zt.prototype,function(l,f){var b=/^(?:filter|find|map|reject)|While$/.test(f),$=/^(?:head|last)$/.test(f),j=U[$?"take"+(f=="last"?"Right":""):f],G=$||/^find/.test(f);j&&(U.prototype[f]=function(){var q=this.__wrapped__,Q=$?[1]:arguments,Z=q instanceof zt,xe=Q[0],Se=Z||_t(q),$e=function(At){var Ht=j.apply(U,el([At],Q));return $&&ze?Ht[0]:Ht};Se&&b&&typeof xe=="function"&&xe.length!=1&&(Z=Se=!1);var ze=this.__chain__,rt=!!this.__actions__.length,bt=G&&!ze,Ot=Z&&!rt;if(!G&&Se){q=Ot?q:new zt(this);var wt=l.apply(q,Q);return wt.__actions__.push({func:xh,args:[$e],thisArg:n}),new Qo(wt,ze)}return bt&&Ot?l.apply(this,Q):(wt=this.thru($e),bt?$?wt.value()[0]:wt.value():wt)})}),qo(["pop","push","shift","sort","splice","unshift"],function(l){var f=qp[l],b=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",$=/^(?:pop|shift)$/.test(l);U.prototype[l]=function(){var j=arguments;if($&&!this.__chain__){var G=this.value();return f.apply(_t(G)?G:[],j)}return this[b](function(q){return f.apply(_t(q)?q:[],j)})}}),Vi(zt.prototype,function(l,f){var b=U[f];if(b){var $=b.name+"";nn.call(vc,$)||(vc[$]=[]),vc[$].push({name:f,func:b})}}),vc[mh(n,w).name]=[{name:"wrapper",func:n}],zt.prototype.clone=R5,zt.prototype.reverse=M5,zt.prototype.value=T5,U.prototype.at=lz,U.prototype.chain=az,U.prototype.commit=cz,U.prototype.next=uz,U.prototype.plant=fz,U.prototype.reverse=pz,U.prototype.toJSON=U.prototype.valueOf=U.prototype.value=hz,U.prototype.first=U.prototype.head,gd&&(U.prototype[gd]=dz),U},hc=c5();sa?((sa.exports=hc)._=hc,Uy._=hc):yr._=hc}).call(Sn)})(xg,xg.exports);var nu=xg.exports;const St=mp(nu);var oS={},zoe=ut;Object.defineProperty(oS,"__esModule",{value:!0});var ey=oS.default=void 0,joe=zoe(dt()),Hoe=at(),Voe=(0,joe.default)((0,Hoe.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),"Refresh");ey=oS.default=Voe;var iS={},Uoe=ut;Object.defineProperty(iS,"__esModule",{value:!0});var sS=iS.default=void 0,Woe=Uoe(dt()),Goe=at(),Koe=(0,Woe.default)((0,Goe.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check");sS=iS.default=Koe;var lS={},qoe=ut;Object.defineProperty(lS,"__esModule",{value:!0});var Rp=lS.default=void 0,Yoe=qoe(dt()),Qoe=at(),Xoe=(0,Yoe.default)((0,Qoe.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");Rp=lS.default=Xoe;var aS={},Joe=ut;Object.defineProperty(aS,"__esModule",{value:!0});var ty=aS.default=void 0,Zoe=Joe(dt()),eie=at(),tie=(0,Zoe.default)((0,eie.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}),"Error");ty=aS.default=tie;var cS={},nie=ut;Object.defineProperty(cS,"__esModule",{value:!0});var AF=cS.default=void 0,rie=nie(dt()),oie=at(),iie=(0,rie.default)((0,oie.jsx)("path",{d:"M12 8V4l8 8-8 8v-4H4V8z"}),"Forward");AF=cS.default=iie;var uS={},sie=ut;Object.defineProperty(uS,"__esModule",{value:!0});var tp=uS.default=void 0,lie=sie(dt()),aie=at(),cie=(0,lie.default)((0,aie.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}),"Info");tp=uS.default=cie;var dS={},uie=ut;Object.defineProperty(dS,"__esModule",{value:!0});var ny=dS.default=void 0,die=uie(dt()),fie=at(),pie=(0,die.default)((0,fie.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"Warning");ny=dS.default=pie;const Sg="/~/api/",hie={loginSrp1:90,update:600,get_status:20},NF={};function mie(e){Object.assign(NF,e)}function Et(e,t,n={}){var s,a,c;St.defaults(n,NF);const r=(s=n.modal)==null?void 0:s.call(n,e,t),o=zF();o&&(t=Ce({csrf:o},t));const i=new AbortController;return n.timeout!==!1&&setTimeout(()=>i.abort("timeout"),1e3*((c=(a=hie[e])!=null?a:n.timeout)!=null?c:10)),Object.assign(fetch(JF()+Sg+e,{method:"POST",headers:{"content-type":"application/json"},signal:i.signal,body:t&&JSON.stringify(t)}).then(d=>mt(this,null,function*(){var g;r==null||r();let p=yield d.text(),h;try{h=JSON.parse(p)}catch(y){}const m=h!=null?h:p;if(console.debug(d.ok?"API":"API FAILED",e,t,">>",m),yield(g=n.onResponse)==null?void 0:g.call(n,d,m),!d.ok)throw new DF(d.status,h===void 0?p:`Failed API ${e}: ${d.statusText}`,h);return m}),d=>{var p;throw r==null||r(),(p=d==null?void 0:d.message)!=null&&p.includes("fetch")?Error("Network error"):d}),{abort(){i.abort("cancel")}})}class DF extends Error{constructor(t,n,r){super(n,{cause:r}),this.code=t}get data(){return this.cause}}function ry(e,t){const[n,r]=eo(void 0),[o,i]=eo(void 0),[s,a]=eo(0),c=u.useRef(),d=u.useRef();u.useEffect(()=>{var y,v;if((y=c.current)==null||y.abort(),r(void 0),i(void 0),!e)return;let h=!1;const m=Et(e,t),g=m.then(S=>h||r(S),S=>h||i(S)).finally(()=>c.current=void 0);c.current=Object.assign(g,{abort(){h=!0,m.abort()}}),(v=d.current)==null||v.resolve(g)},[e,JSON.stringify(t),s]);const p=u.useCallback(()=>c.current||a(h=>h+1)||(d.current=bS()),[a]);return[n,o,p]}function BF(e,t,n){console.debug("API EVENTS",e,t);const r={};for(const s in t){const a=t[s];a!==void 0&&(r[s]=JSON.stringify(a))}const o=zF();o&&(r.csrf=JSON.stringify(o));const i=new EventSource(JF()+Sg+e+"?"+new URLSearchParams(r));return i.onopen=()=>n("connected"),i.onerror=s=>n("error",s),i.onmessage=({data:s})=>{if(!s)return n("closed"),i.close();try{s=JSON.parse(s)}catch(a){return n("string",s)}console.debug("SSE msg",s),n("msg",s)},i}function zF(){return ese("csrf")}function gie(e,t={}){const[n,r]=eo(void 0),[o,i]=eo(void 0),[s,a]=eo(!1);return u.useEffect(()=>{const c=BF(e,t,(p,h)=>{switch(p){case"error":return i("Connection error"),d();case"closed":return d();case"msg":return(c==null?void 0:c.readyState)===(c==null?void 0:c.CLOSED)?d():r(h)}});return()=>{c.close(),d()};function d(){a(!1)}},[e,JSON.stringify(t)]),{data:n,loading:s,error:o}}globalThis&&globalThis.__awaiter;function fS(e,t){const[n,r]=u.useState(e);return u.useEffect(()=>{const o=setTimeout(()=>r(e),t||500);return()=>{clearTimeout(o)}},[e,t]),n}function vie(e,t,n,r){const o=u.useRef(t);jF(()=>{o.current=t},[t]),u.useEffect(()=>{var i;const s=(i=n==null?void 0:n.current)!==null&&i!==void 0?i:window;if(!(s&&s.addEventListener))return;const a=c=>o.current(c);return s.addEventListener(e,a,r),()=>{s.removeEventListener(e,a,r)}},[e,n,r])}globalThis&&globalThis.__awaiter;function yie(){const e=u.useRef(!1);return u.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),u.useCallback(()=>e.current,[])}const jF=typeof window!="undefined"?u.useLayoutEffect:u.useEffect;function HF(){const[e,t]=u.useState({width:0,height:0}),n=()=>{t({width:window.innerWidth,height:window.innerHeight})};return vie("resize",n),jF(()=>{n()},[]),e}function eo(e){const t=yie(),[n,r]=u.useState(e),o=u.useCallback(i=>{t()&&r(i)},[t,r]);return[n,o,t]}function bie(e){return e.filter(t=>t===0||t&&(!Array.isArray(t)||t.length))}function wie(e,t){const n=[];for(const r of bie(t))n.push(r,e);return n.splice(-1,1),np(n)}function np(e){return e.map((t,n)=>!t||typeof t=="string"?t:Array.isArray(t)?np(t):u.createElement(u.Fragment,{key:n,children:t}))}const Cie=Symbol(),pS=Symbol(),qd="a",$m="w";let xie=(e,t)=>new Proxy(e,t);const Pw=Object.getPrototypeOf,Iw=new WeakMap,VF=e=>e&&(Iw.has(e)?Iw.get(e):Pw(e)===Object.prototype||Pw(e)===Array.prototype),G$=e=>typeof e=="object"&&e!==null,Sie=e=>{if(Array.isArray(e))return Array.from(e);const t=Object.getOwnPropertyDescriptors(e);return Object.values(t).forEach(n=>{n.configurable=!0}),Object.create(Pw(e),t)},UF=e=>e[pS]||e,WF=(e,t,n,r)=>{if(!VF(e))return e;let o=r&&r.get(e);if(!o){const c=UF(e);o=(d=>Object.values(Object.getOwnPropertyDescriptors(d)).some(p=>!p.configurable&&!p.writable))(c)?[c,Sie(c)]:[c],r==null||r.set(e,o)}const[i,s]=o;let a=n&&n.get(i);return a&&a[1].f===!!s||(a=((c,d)=>{const p={f:d};let h=!1;const m=(y,v)=>{if(!h){let S=p[qd].get(c);if(S||(S={},p[qd].set(c,S)),y===$m)S[$m]=!0;else{let w=S[y];w||(w=new Set,S[y]=w),w.add(v)}}},g={get:(y,v)=>v===pS?c:(m("k",v),WF(Reflect.get(y,v),p[qd],p.c,p.t)),has:(y,v)=>v===Cie?(h=!0,p[qd].delete(c),!0):(m("h",v),Reflect.has(y,v)),getOwnPropertyDescriptor:(y,v)=>(m("o",v),Reflect.getOwnPropertyDescriptor(y,v)),ownKeys:y=>(m($m),Reflect.ownKeys(y))};return d&&(g.set=g.deleteProperty=()=>!1),[g,p]})(i,!!s),a[1].p=xie(s||i,a[0]),n&&n.set(i,a)),a[1][qd]=t,a[1].c=n,a[1].t=r,a[1].p},GF=(e,t,n,r)=>{if(Object.is(e,t))return!1;if(!G$(e)||!G$(t))return!0;const o=n.get(UF(e));if(!o)return!0;if(r){const s=r.get(e);if(s&&s.n===t)return s.g;r.set(e,{n:t,g:!1})}let i=null;try{for(const s of o.h||[])if(i=Reflect.has(e,s)!==Reflect.has(t,s),i)return i;if(o[$m]===!0){if(i=((s,a)=>{const c=Reflect.ownKeys(s),d=Reflect.ownKeys(a);return c.length!==d.length||c.some((p,h)=>p!==d[h])})(e,t),i)return i}else for(const s of o.o||[])if(i=!!Reflect.getOwnPropertyDescriptor(e,s)!=!!Reflect.getOwnPropertyDescriptor(t,s),i)return i;for(const s of o.k||[])if(i=GF(e[s],t[s],n,r),i)return i;return i===null&&(i=!0),i}finally{r&&r.set(e,{n:t,g:i})}},Eie=e=>VF(e)&&e[pS]||null,K$=(e,t=!0)=>{Iw.set(e,t)};const z1=e=>typeof e=="object"&&e!==null,yl=new WeakMap,om=new WeakSet,Pie=(e=Object.is,t=(d,p)=>new Proxy(d,p),n=d=>z1(d)&&!om.has(d)&&(Array.isArray(d)||!(Symbol.iterator in d))&&!(d instanceof WeakMap)&&!(d instanceof WeakSet)&&!(d instanceof Error)&&!(d instanceof Number)&&!(d instanceof Date)&&!(d instanceof String)&&!(d instanceof RegExp)&&!(d instanceof ArrayBuffer),r=d=>{switch(d.status){case"fulfilled":return d.value;case"rejected":throw d.reason;default:throw d}},o=new WeakMap,i=(d,p,h=r)=>{const m=o.get(d);if((m==null?void 0:m[0])===p)return m[1];const g=Array.isArray(d)?[]:Object.create(Object.getPrototypeOf(d));return K$(g,!0),o.set(d,[p,g]),Reflect.ownKeys(d).forEach(y=>{if(Object.getOwnPropertyDescriptor(g,y))return;const v=Reflect.get(d,y),S={value:v,enumerable:!0,configurable:!0};if(om.has(v))K$(v,!1);else if(v instanceof Promise)delete S.value,S.get=()=>h(v);else if(yl.has(v)){const[w,C]=yl.get(v);S.value=i(w,C(),h)}Object.defineProperty(g,y,S)}),g},s=new WeakMap,a=[1,1],c=d=>{if(!z1(d))throw new Error("object required");const p=s.get(d);if(p)return p;let h=a[0];const m=new Set,g=(O,F=++a[0])=>{h!==F&&(h=F,m.forEach(L=>L(O,F)))};let y=a[1];const v=(O=++a[1])=>(y!==O&&!m.size&&(y=O,w.forEach(([F])=>{const L=F[1](O);L>h&&(h=L)})),h),S=O=>(F,L)=>{const D=[...F];D[1]=[O,...D[1]],g(D,L)},w=new Map,C=(O,F)=>{if(m.size){const L=F[3](S(O));w.set(O,[F,L])}else w.set(O,[F])},x=O=>{var F;const L=w.get(O);L&&(w.delete(O),(F=L[1])==null||F.call(L))},P=O=>(m.add(O),m.size===1&&w.forEach(([L,D],B)=>{const R=L[3](S(B));w.set(B,[L,R])}),()=>{m.delete(O),m.size===0&&w.forEach(([L,D],B)=>{D&&(D(),w.set(B,[L]))})}),_=Array.isArray(d)?[]:Object.create(Object.getPrototypeOf(d)),k=t(_,{deleteProperty(O,F){const L=Reflect.get(O,F);x(F);const D=Reflect.deleteProperty(O,F);return D&&g(["delete",[F],L]),D},set(O,F,L,D){const B=Reflect.has(O,F),R=Reflect.get(O,F,D);if(B&&(e(R,L)||s.has(L)&&e(R,s.get(L))))return!0;x(F),z1(L)&&(L=Eie(L)||L);let A=L;if(L instanceof Promise)L.then(z=>{L.status="fulfilled",L.value=z,g(["resolve",[F],z])}).catch(z=>{L.status="rejected",L.reason=z,g(["reject",[F],z])});else{!yl.has(L)&&n(L)&&(A=c(L));const z=!om.has(A)&&yl.get(A);z&&C(F,z)}return Reflect.set(O,F,A,D),g(["set",[F],L,R]),!0}});s.set(d,k);const M=[_,v,i,P];return yl.set(k,M),Reflect.ownKeys(d).forEach(O=>{const F=Object.getOwnPropertyDescriptor(d,O);"value"in F&&(k[O]=d[O],delete F.value,delete F.writable),Object.defineProperty(_,O,F)}),k})=>[c,yl,om,e,t,n,r,o,i,s,a],[Iie]=Pie();function hS(e={}){return Iie(e)}function mS(e,t,n){const r=yl.get(e);let o;const i=[],s=r[3];let a=!1;const d=s(p=>{if(i.push(p),n){t(i.splice(0));return}o||(o=Promise.resolve().then(()=>{o=void 0,a&&t(i.splice(0))}))});return a=!0,()=>{a=!1,d()}}function q$(e,t){const n=yl.get(e),[r,o,i]=n;return i(r,o(),t)}var KF={exports:{}},qF={};/**
|
|
319
|
+
}`;var Ot=_k(function(){return qt(G,rt+"return "+$e).apply(n,q)});if(Ot.source=$e,D0(Ot))throw Ot;return Ot}function Ej(l){return Xt(l).toLowerCase()}function Pj(l){return Xt(l).toUpperCase()}function Ij(l,f,b){if(l=Xt(l),l&&(b||f===n))return NP(l);if(!l||!(f=vo(f)))return l;var $=xi(l),j=xi(f),G=DP($,j),q=BP($,j)+1;return sl($,G,q).join("")}function kj(l,f,b){if(l=Xt(l),l&&(b||f===n))return l.slice(0,jP(l)+1);if(!l||!(f=vo(f)))return l;var $=xi(l),j=BP($,xi(f))+1;return sl($,0,j).join("")}function _j(l,f,b){if(l=Xt(l),l&&(b||f===n))return l.replace(ft,"");if(!l||!(f=vo(f)))return l;var $=xi(l),j=DP($,xi(f));return sl($,j).join("")}function $j(l,f){var b=F,$=L;if(An(f)){var j="separator"in f?f.separator:j;b="length"in f?Mt(f.length):b,$="omission"in f?vo(f.omission):$}l=Xt(l);var G=l.length;if(fc(l)){var q=xi(l);G=q.length}if(b>=G)return l;var Q=b-pc($);if(Q<1)return $;var Z=q?sl(q,0,Q).join(""):l.slice(0,Q);if(j===n)return Z+$;if(q&&(Q+=Z.length-Q),B0(j)){if(l.slice(Q).search(j)){var xe,Se=Z;for(j.global||(j=t0(j.source,Xt(We.exec(j))+"g")),j.lastIndex=0;xe=j.exec(Se);)var $e=xe.index;Z=Z.slice(0,$e===n?Q:$e)}}else if(l.indexOf(vo(j),Q)!=Q){var ze=Z.lastIndexOf(j);ze>-1&&(Z=Z.slice(0,ze))}return Z+$}function Rj(l){return l=Xt(l),l&&bn.test(l)?l.replace(ar,i5):l}var Mj=wc(function(l,f,b){return l+(b?" ":"")+f.toUpperCase()}),H0=$I("toUpperCase");function kk(l,f,b){return l=Xt(l),f=b?n:f,f===n?e5(l)?a5(l):WD(l):l.match(f)||[]}var _k=Lt(function(l,f){try{return mo(l,n,f)}catch(b){return D0(b)?b:new It(b)}}),Tj=ks(function(l,f){return qo(f,function(b){b=Wi(b),Ps(l,b,A0(l[b],l))}),l});function Oj(l){var f=l==null?0:l.length,b=gt();return l=f?$n(l,function($){if(typeof $[1]!="function")throw new Yo(s);return[b($[0]),$[1]]}):[],Lt(function($){for(var j=-1;++j<f;){var G=l[j];if(mo(G[0],this,$))return mo(G[1],this,$)}})}function Lj(l){return i3(Xo(l,h))}function V0(l){return function(){return l}}function Fj(l,f){return l==null||l!==l?f:l}var Aj=MI(),Nj=MI(!0);function Xr(l){return l}function U0(l){return lI(typeof l=="function"?l:Xo(l,h))}function Dj(l){return cI(Xo(l,h))}function Bj(l,f){return uI(l,Xo(f,h))}var zj=Lt(function(l,f){return function(b){return Sd(b,l,f)}}),jj=Lt(function(l,f){return function(b){return Sd(l,b,f)}});function W0(l,f,b){var $=dr(f),j=uh(f,$);b==null&&!(An(f)&&(j.length||!$.length))&&(b=f,f=l,l=this,j=uh(f,dr(f)));var G=!(An(b)&&"chain"in b)||!!b.chain,q=$s(l);return qo(j,function(Q){var Z=f[Q];l[Q]=Z,q&&(l.prototype[Q]=function(){var xe=this.__chain__;if(G||xe){var Se=l(this.__wrapped__),$e=Se.__actions__=qr(this.__actions__);return $e.push({func:Z,args:arguments,thisArg:l}),Se.__chain__=xe,Se}return Z.apply(l,el([this.value()],arguments))})}),l}function Hj(){return yr._===this&&(yr._=h5),this}function G0(){}function Vj(l){return l=Mt(l),Lt(function(f){return dI(f,l)})}var Uj=S0($n),Wj=S0(TP),Gj=S0(qy);function $k(l){return R0(l)?Yy(Wi(l)):x3(l)}function Kj(l){return function(f){return l==null?n:da(l,f)}}var qj=OI(),Yj=OI(!0);function K0(){return[]}function q0(){return!1}function Qj(){return{}}function Xj(){return""}function Jj(){return!0}function Zj(l,f){if(l=Mt(l),l<1||l>N)return[];var b=K,$=Pr(l,K);f=gt(f),l-=K;for(var j=Jy($,f);++b<l;)f(b);return j}function e9(l){return _t(l)?$n(l,Wi):yo(l)?[l]:qr(YI(Xt(l)))}function t9(l){var f=++f5;return Xt(l)+f}var n9=gh(function(l,f){return l+f},0),r9=E0("ceil"),o9=gh(function(l,f){return l/f},1),i9=E0("floor");function s9(l){return l&&l.length?ch(l,Xr,c0):n}function l9(l,f){return l&&l.length?ch(l,gt(f,2),c0):n}function a9(l){return FP(l,Xr)}function c9(l,f){return FP(l,gt(f,2))}function u9(l){return l&&l.length?ch(l,Xr,p0):n}function d9(l,f){return l&&l.length?ch(l,gt(f,2),p0):n}var f9=gh(function(l,f){return l*f},1),p9=E0("round"),h9=gh(function(l,f){return l-f},0);function m9(l){return l&&l.length?Xy(l,Xr):0}function g9(l,f){return l&&l.length?Xy(l,gt(f,2)):0}return U.after=Dz,U.ary=sk,U.assign=P6,U.assignIn=wk,U.assignInWith=$h,U.assignWith=I6,U.at=k6,U.before=lk,U.bind=A0,U.bindAll=Tj,U.bindKey=ak,U.castArray=Qz,U.chain=rk,U.chunk=iB,U.compact=sB,U.concat=lB,U.cond=Oj,U.conforms=Lj,U.constant=V0,U.countBy=mz,U.create=_6,U.curry=ck,U.curryRight=uk,U.debounce=dk,U.defaults=$6,U.defaultsDeep=R6,U.defer=Bz,U.delay=zz,U.difference=aB,U.differenceBy=cB,U.differenceWith=uB,U.drop=dB,U.dropRight=fB,U.dropRightWhile=pB,U.dropWhile=hB,U.fill=mB,U.filter=vz,U.flatMap=wz,U.flatMapDeep=Cz,U.flatMapDepth=xz,U.flatten=ZI,U.flattenDeep=gB,U.flattenDepth=vB,U.flip=jz,U.flow=Aj,U.flowRight=Nj,U.fromPairs=yB,U.functions=N6,U.functionsIn=D6,U.groupBy=Sz,U.initial=wB,U.intersection=CB,U.intersectionBy=xB,U.intersectionWith=SB,U.invert=z6,U.invertBy=j6,U.invokeMap=Pz,U.iteratee=U0,U.keyBy=Iz,U.keys=dr,U.keysIn=Qr,U.map=Sh,U.mapKeys=V6,U.mapValues=U6,U.matches=Dj,U.matchesProperty=Bj,U.memoize=Ph,U.merge=W6,U.mergeWith=Ck,U.method=zj,U.methodOf=jj,U.mixin=W0,U.negate=Ih,U.nthArg=Vj,U.omit=G6,U.omitBy=K6,U.once=Hz,U.orderBy=kz,U.over=Uj,U.overArgs=Vz,U.overEvery=Wj,U.overSome=Gj,U.partial=N0,U.partialRight=fk,U.partition=_z,U.pick=q6,U.pickBy=xk,U.property=$k,U.propertyOf=Kj,U.pull=kB,U.pullAll=tk,U.pullAllBy=_B,U.pullAllWith=$B,U.pullAt=RB,U.range=qj,U.rangeRight=Yj,U.rearg=Uz,U.reject=Mz,U.remove=MB,U.rest=Wz,U.reverse=L0,U.sampleSize=Oz,U.set=Q6,U.setWith=X6,U.shuffle=Lz,U.slice=TB,U.sortBy=Nz,U.sortedUniq=BB,U.sortedUniqBy=zB,U.split=wj,U.spread=Gz,U.tail=jB,U.take=HB,U.takeRight=VB,U.takeRightWhile=UB,U.takeWhile=WB,U.tap=sz,U.throttle=Kz,U.thru=xh,U.toArray=vk,U.toPairs=Sk,U.toPairsIn=Ek,U.toPath=e9,U.toPlainObject=bk,U.transform=J6,U.unary=qz,U.union=GB,U.unionBy=KB,U.unionWith=qB,U.uniq=YB,U.uniqBy=QB,U.uniqWith=XB,U.unset=Z6,U.unzip=F0,U.unzipWith=nk,U.update=ej,U.updateWith=tj,U.values=Sc,U.valuesIn=nj,U.without=JB,U.words=kk,U.wrap=Yz,U.xor=ZB,U.xorBy=ez,U.xorWith=tz,U.zip=nz,U.zipObject=rz,U.zipObjectDeep=oz,U.zipWith=iz,U.entries=Sk,U.entriesIn=Ek,U.extend=wk,U.extendWith=$h,W0(U,U),U.add=n9,U.attempt=_k,U.camelCase=sj,U.capitalize=Pk,U.ceil=r9,U.clamp=rj,U.clone=Xz,U.cloneDeep=Zz,U.cloneDeepWith=e6,U.cloneWith=Jz,U.conformsTo=t6,U.deburr=Ik,U.defaultTo=Fj,U.divide=o9,U.endsWith=lj,U.eq=Ei,U.escape=aj,U.escapeRegExp=cj,U.every=gz,U.find=yz,U.findIndex=XI,U.findKey=M6,U.findLast=bz,U.findLastIndex=JI,U.findLastKey=T6,U.floor=i9,U.forEach=ok,U.forEachRight=ik,U.forIn=O6,U.forInRight=L6,U.forOwn=F6,U.forOwnRight=A6,U.get=z0,U.gt=n6,U.gte=r6,U.has=B6,U.hasIn=j0,U.head=ek,U.identity=Xr,U.includes=Ez,U.indexOf=bB,U.inRange=oj,U.invoke=H6,U.isArguments=ha,U.isArray=_t,U.isArrayBuffer=o6,U.isArrayLike=Yr,U.isArrayLikeObject=Kn,U.isBoolean=i6,U.isBuffer=ll,U.isDate=s6,U.isElement=l6,U.isEmpty=a6,U.isEqual=c6,U.isEqualWith=u6,U.isError=D0,U.isFinite=d6,U.isFunction=$s,U.isInteger=pk,U.isLength=kh,U.isMap=hk,U.isMatch=f6,U.isMatchWith=p6,U.isNaN=h6,U.isNative=m6,U.isNil=v6,U.isNull=g6,U.isNumber=mk,U.isObject=An,U.isObjectLike=Vn,U.isPlainObject=$d,U.isRegExp=B0,U.isSafeInteger=y6,U.isSet=gk,U.isString=_h,U.isSymbol=yo,U.isTypedArray=xc,U.isUndefined=b6,U.isWeakMap=w6,U.isWeakSet=C6,U.join=EB,U.kebabCase=uj,U.last=Zo,U.lastIndexOf=PB,U.lowerCase=dj,U.lowerFirst=fj,U.lt=x6,U.lte=S6,U.max=s9,U.maxBy=l9,U.mean=a9,U.meanBy=c9,U.min=u9,U.minBy=d9,U.stubArray=K0,U.stubFalse=q0,U.stubObject=Qj,U.stubString=Xj,U.stubTrue=Jj,U.multiply=f9,U.nth=IB,U.noConflict=Hj,U.noop=G0,U.now=Eh,U.pad=pj,U.padEnd=hj,U.padStart=mj,U.parseInt=gj,U.random=ij,U.reduce=$z,U.reduceRight=Rz,U.repeat=vj,U.replace=yj,U.result=Y6,U.round=p9,U.runInContext=J,U.sample=Tz,U.size=Fz,U.snakeCase=bj,U.some=Az,U.sortedIndex=OB,U.sortedIndexBy=LB,U.sortedIndexOf=FB,U.sortedLastIndex=AB,U.sortedLastIndexBy=NB,U.sortedLastIndexOf=DB,U.startCase=Cj,U.startsWith=xj,U.subtract=h9,U.sum=m9,U.sumBy=g9,U.template=Sj,U.times=Zj,U.toFinite=Rs,U.toInteger=Mt,U.toLength=yk,U.toLower=Ej,U.toNumber=ei,U.toSafeInteger=E6,U.toString=Xt,U.toUpper=Pj,U.trim=Ij,U.trimEnd=kj,U.trimStart=_j,U.truncate=$j,U.unescape=Rj,U.uniqueId=t9,U.upperCase=Mj,U.upperFirst=H0,U.each=ok,U.eachRight=ik,U.first=ek,W0(U,function(){var l={};return Vi(U,function(f,b){nn.call(U.prototype,b)||(l[b]=f)}),l}(),{chain:!1}),U.VERSION=r,qo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(l){U[l].placeholder=U}),qo(["drop","take"],function(l,f){zt.prototype[l]=function(b){b=b===n?1:nr(Mt(b),0);var $=this.__filtered__&&!f?new zt(this):this.clone();return $.__filtered__?$.__takeCount__=Pr(b,$.__takeCount__):$.__views__.push({size:Pr(b,K),type:l+($.__dir__<0?"Right":"")}),$},zt.prototype[l+"Right"]=function(b){return this.reverse()[l](b).reverse()}}),qo(["filter","map","takeWhile"],function(l,f){var b=f+1,$=b==R||b==z;zt.prototype[l]=function(j){var G=this.clone();return G.__iteratees__.push({iteratee:gt(j,3),type:b}),G.__filtered__=G.__filtered__||$,G}}),qo(["head","last"],function(l,f){var b="take"+(f?"Right":"");zt.prototype[l]=function(){return this[b](1).value()[0]}}),qo(["initial","tail"],function(l,f){var b="drop"+(f?"":"Right");zt.prototype[l]=function(){return this.__filtered__?new zt(this):this[b](1)}}),zt.prototype.compact=function(){return this.filter(Xr)},zt.prototype.find=function(l){return this.filter(l).head()},zt.prototype.findLast=function(l){return this.reverse().find(l)},zt.prototype.invokeMap=Lt(function(l,f){return typeof l=="function"?new zt(this):this.map(function(b){return Sd(b,l,f)})}),zt.prototype.reject=function(l){return this.filter(Ih(gt(l)))},zt.prototype.slice=function(l,f){l=Mt(l);var b=this;return b.__filtered__&&(l>0||f<0)?new zt(b):(l<0?b=b.takeRight(-l):l&&(b=b.drop(l)),f!==n&&(f=Mt(f),b=f<0?b.dropRight(-f):b.take(f-l)),b)},zt.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},zt.prototype.toArray=function(){return this.take(K)},Vi(zt.prototype,function(l,f){var b=/^(?:filter|find|map|reject)|While$/.test(f),$=/^(?:head|last)$/.test(f),j=U[$?"take"+(f=="last"?"Right":""):f],G=$||/^find/.test(f);j&&(U.prototype[f]=function(){var q=this.__wrapped__,Q=$?[1]:arguments,Z=q instanceof zt,xe=Q[0],Se=Z||_t(q),$e=function(At){var Ht=j.apply(U,el([At],Q));return $&&ze?Ht[0]:Ht};Se&&b&&typeof xe=="function"&&xe.length!=1&&(Z=Se=!1);var ze=this.__chain__,rt=!!this.__actions__.length,bt=G&&!ze,Ot=Z&&!rt;if(!G&&Se){q=Ot?q:new zt(this);var wt=l.apply(q,Q);return wt.__actions__.push({func:xh,args:[$e],thisArg:n}),new Qo(wt,ze)}return bt&&Ot?l.apply(this,Q):(wt=this.thru($e),bt?$?wt.value()[0]:wt.value():wt)})}),qo(["pop","push","shift","sort","splice","unshift"],function(l){var f=qp[l],b=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",$=/^(?:pop|shift)$/.test(l);U.prototype[l]=function(){var j=arguments;if($&&!this.__chain__){var G=this.value();return f.apply(_t(G)?G:[],j)}return this[b](function(q){return f.apply(_t(q)?q:[],j)})}}),Vi(zt.prototype,function(l,f){var b=U[f];if(b){var $=b.name+"";nn.call(vc,$)||(vc[$]=[]),vc[$].push({name:f,func:b})}}),vc[mh(n,w).name]=[{name:"wrapper",func:n}],zt.prototype.clone=R5,zt.prototype.reverse=M5,zt.prototype.value=T5,U.prototype.at=lz,U.prototype.chain=az,U.prototype.commit=cz,U.prototype.next=uz,U.prototype.plant=fz,U.prototype.reverse=pz,U.prototype.toJSON=U.prototype.valueOf=U.prototype.value=hz,U.prototype.first=U.prototype.head,gd&&(U.prototype[gd]=dz),U},hc=c5();sa?((sa.exports=hc)._=hc,Uy._=hc):yr._=hc}).call(Sn)})(xg,xg.exports);var nu=xg.exports;const St=mp(nu);var oS={},zoe=ut;Object.defineProperty(oS,"__esModule",{value:!0});var ey=oS.default=void 0,joe=zoe(dt()),Hoe=at(),Voe=(0,joe.default)((0,Hoe.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),"Refresh");ey=oS.default=Voe;var iS={},Uoe=ut;Object.defineProperty(iS,"__esModule",{value:!0});var sS=iS.default=void 0,Woe=Uoe(dt()),Goe=at(),Koe=(0,Woe.default)((0,Goe.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check");sS=iS.default=Koe;var lS={},qoe=ut;Object.defineProperty(lS,"__esModule",{value:!0});var Rp=lS.default=void 0,Yoe=qoe(dt()),Qoe=at(),Xoe=(0,Yoe.default)((0,Qoe.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");Rp=lS.default=Xoe;var aS={},Joe=ut;Object.defineProperty(aS,"__esModule",{value:!0});var ty=aS.default=void 0,Zoe=Joe(dt()),eie=at(),tie=(0,Zoe.default)((0,eie.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}),"Error");ty=aS.default=tie;var cS={},nie=ut;Object.defineProperty(cS,"__esModule",{value:!0});var AF=cS.default=void 0,rie=nie(dt()),oie=at(),iie=(0,rie.default)((0,oie.jsx)("path",{d:"M12 8V4l8 8-8 8v-4H4V8z"}),"Forward");AF=cS.default=iie;var uS={},sie=ut;Object.defineProperty(uS,"__esModule",{value:!0});var tp=uS.default=void 0,lie=sie(dt()),aie=at(),cie=(0,lie.default)((0,aie.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}),"Info");tp=uS.default=cie;var dS={},uie=ut;Object.defineProperty(dS,"__esModule",{value:!0});var ny=dS.default=void 0,die=uie(dt()),fie=at(),pie=(0,die.default)((0,fie.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}),"Warning");ny=dS.default=pie;const Sg="/~/api/",hie={loginSrp1:90,update:600,get_status:20},NF={};function mie(e){Object.assign(NF,e)}function Et(e,t,n={}){var s,a,c;St.defaults(n,NF);const r=(s=n.modal)==null?void 0:s.call(n,e,t),o=zF();o&&(t=Ce({csrf:o},t));const i=new AbortController;return n.timeout!==!1&&setTimeout(()=>i.abort("timeout"),1e3*((c=(a=hie[e])!=null?a:n.timeout)!=null?c:10)),Object.assign(fetch(JF()+Sg+e,{method:"POST",headers:{"content-type":"application/json"},signal:i.signal,body:t&&JSON.stringify(t)}).then(d=>mt(this,null,function*(){var g;r==null||r();let p=yield d.text(),h;try{h=JSON.parse(p)}catch(y){}const m=h!=null?h:p;if(console.debug(d.ok?"API":"API FAILED",e,t,">>",m),yield(g=n.onResponse)==null?void 0:g.call(n,d,m),!d.ok)throw new DF(d.status,h===void 0?p:`Failed API ${e}: ${d.statusText}`,h);return m}),d=>{var p;throw r==null||r(),(p=d==null?void 0:d.message)!=null&&p.includes("fetch")?Error("Network error"):d}),{abort(){i.abort("cancel")}})}class DF extends Error{constructor(t,n,r){super(n,{cause:r}),this.code=t}get data(){return this.cause}}function ry(e,t){const[n,r]=eo(void 0),[o,i]=eo(void 0),[s,a]=eo(0),c=u.useRef(),d=u.useRef();u.useEffect(()=>{var y,v;if((y=c.current)==null||y.abort(),r(void 0),i(void 0),!e)return;let h=!1;const m=Et(e,t),g=m.then(S=>h||r(S),S=>h||i(S)).finally(()=>c.current=void 0);c.current=Object.assign(g,{abort(){h=!0,m.abort()}}),(v=d.current)==null||v.resolve(g)},[e,JSON.stringify(t),s]);const p=u.useCallback(()=>c.current||a(h=>h+1)||(d.current=bS()),[a]);return[n,o,p]}function BF(e,t,n){console.debug("API EVENTS",e,t);const r={};for(const s in t){const a=t[s];a!==void 0&&(r[s]=JSON.stringify(a))}const o=zF();o&&(r.csrf=JSON.stringify(o));const i=new EventSource(JF()+Sg+e+"?"+new URLSearchParams(r));return i.onopen=()=>n("connected"),i.onerror=s=>n("error",s),i.onmessage=({data:s})=>{if(!s)return n("closed"),i.close();try{s=JSON.parse(s)}catch(a){return n("string",s)}console.debug("SSE msg",s),n("msg",s)},i}function zF(){return nse("csrf")}function gie(e,t={}){const[n,r]=eo(void 0),[o,i]=eo(void 0),[s,a]=eo(!1);return u.useEffect(()=>{const c=BF(e,t,(p,h)=>{switch(p){case"error":return i("Connection error"),d();case"closed":return d();case"msg":return(c==null?void 0:c.readyState)===(c==null?void 0:c.CLOSED)?d():r(h)}});return()=>{c.close(),d()};function d(){a(!1)}},[e,JSON.stringify(t)]),{data:n,loading:s,error:o}}globalThis&&globalThis.__awaiter;function fS(e,t){const[n,r]=u.useState(e);return u.useEffect(()=>{const o=setTimeout(()=>r(e),t||500);return()=>{clearTimeout(o)}},[e,t]),n}function vie(e,t,n,r){const o=u.useRef(t);jF(()=>{o.current=t},[t]),u.useEffect(()=>{var i;const s=(i=n==null?void 0:n.current)!==null&&i!==void 0?i:window;if(!(s&&s.addEventListener))return;const a=c=>o.current(c);return s.addEventListener(e,a,r),()=>{s.removeEventListener(e,a,r)}},[e,n,r])}globalThis&&globalThis.__awaiter;function yie(){const e=u.useRef(!1);return u.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),u.useCallback(()=>e.current,[])}const jF=typeof window!="undefined"?u.useLayoutEffect:u.useEffect;function HF(){const[e,t]=u.useState({width:0,height:0}),n=()=>{t({width:window.innerWidth,height:window.innerHeight})};return vie("resize",n),jF(()=>{n()},[]),e}function eo(e){const t=yie(),[n,r]=u.useState(e),o=u.useCallback(i=>{t()&&r(i)},[t,r]);return[n,o,t]}function bie(e){return e.filter(t=>t===0||t&&(!Array.isArray(t)||t.length))}function wie(e,t){const n=[];for(const r of bie(t))n.push(r,e);return n.splice(-1,1),np(n)}function np(e){return e.map((t,n)=>!t||typeof t=="string"?t:Array.isArray(t)?np(t):u.createElement(u.Fragment,{key:n,children:t}))}const Cie=Symbol(),pS=Symbol(),qd="a",$m="w";let xie=(e,t)=>new Proxy(e,t);const Pw=Object.getPrototypeOf,Iw=new WeakMap,VF=e=>e&&(Iw.has(e)?Iw.get(e):Pw(e)===Object.prototype||Pw(e)===Array.prototype),G$=e=>typeof e=="object"&&e!==null,Sie=e=>{if(Array.isArray(e))return Array.from(e);const t=Object.getOwnPropertyDescriptors(e);return Object.values(t).forEach(n=>{n.configurable=!0}),Object.create(Pw(e),t)},UF=e=>e[pS]||e,WF=(e,t,n,r)=>{if(!VF(e))return e;let o=r&&r.get(e);if(!o){const c=UF(e);o=(d=>Object.values(Object.getOwnPropertyDescriptors(d)).some(p=>!p.configurable&&!p.writable))(c)?[c,Sie(c)]:[c],r==null||r.set(e,o)}const[i,s]=o;let a=n&&n.get(i);return a&&a[1].f===!!s||(a=((c,d)=>{const p={f:d};let h=!1;const m=(y,v)=>{if(!h){let S=p[qd].get(c);if(S||(S={},p[qd].set(c,S)),y===$m)S[$m]=!0;else{let w=S[y];w||(w=new Set,S[y]=w),w.add(v)}}},g={get:(y,v)=>v===pS?c:(m("k",v),WF(Reflect.get(y,v),p[qd],p.c,p.t)),has:(y,v)=>v===Cie?(h=!0,p[qd].delete(c),!0):(m("h",v),Reflect.has(y,v)),getOwnPropertyDescriptor:(y,v)=>(m("o",v),Reflect.getOwnPropertyDescriptor(y,v)),ownKeys:y=>(m($m),Reflect.ownKeys(y))};return d&&(g.set=g.deleteProperty=()=>!1),[g,p]})(i,!!s),a[1].p=xie(s||i,a[0]),n&&n.set(i,a)),a[1][qd]=t,a[1].c=n,a[1].t=r,a[1].p},GF=(e,t,n,r)=>{if(Object.is(e,t))return!1;if(!G$(e)||!G$(t))return!0;const o=n.get(UF(e));if(!o)return!0;if(r){const s=r.get(e);if(s&&s.n===t)return s.g;r.set(e,{n:t,g:!1})}let i=null;try{for(const s of o.h||[])if(i=Reflect.has(e,s)!==Reflect.has(t,s),i)return i;if(o[$m]===!0){if(i=((s,a)=>{const c=Reflect.ownKeys(s),d=Reflect.ownKeys(a);return c.length!==d.length||c.some((p,h)=>p!==d[h])})(e,t),i)return i}else for(const s of o.o||[])if(i=!!Reflect.getOwnPropertyDescriptor(e,s)!=!!Reflect.getOwnPropertyDescriptor(t,s),i)return i;for(const s of o.k||[])if(i=GF(e[s],t[s],n,r),i)return i;return i===null&&(i=!0),i}finally{r&&r.set(e,{n:t,g:i})}},Eie=e=>VF(e)&&e[pS]||null,K$=(e,t=!0)=>{Iw.set(e,t)};const z1=e=>typeof e=="object"&&e!==null,yl=new WeakMap,om=new WeakSet,Pie=(e=Object.is,t=(d,p)=>new Proxy(d,p),n=d=>z1(d)&&!om.has(d)&&(Array.isArray(d)||!(Symbol.iterator in d))&&!(d instanceof WeakMap)&&!(d instanceof WeakSet)&&!(d instanceof Error)&&!(d instanceof Number)&&!(d instanceof Date)&&!(d instanceof String)&&!(d instanceof RegExp)&&!(d instanceof ArrayBuffer),r=d=>{switch(d.status){case"fulfilled":return d.value;case"rejected":throw d.reason;default:throw d}},o=new WeakMap,i=(d,p,h=r)=>{const m=o.get(d);if((m==null?void 0:m[0])===p)return m[1];const g=Array.isArray(d)?[]:Object.create(Object.getPrototypeOf(d));return K$(g,!0),o.set(d,[p,g]),Reflect.ownKeys(d).forEach(y=>{if(Object.getOwnPropertyDescriptor(g,y))return;const v=Reflect.get(d,y),S={value:v,enumerable:!0,configurable:!0};if(om.has(v))K$(v,!1);else if(v instanceof Promise)delete S.value,S.get=()=>h(v);else if(yl.has(v)){const[w,C]=yl.get(v);S.value=i(w,C(),h)}Object.defineProperty(g,y,S)}),g},s=new WeakMap,a=[1,1],c=d=>{if(!z1(d))throw new Error("object required");const p=s.get(d);if(p)return p;let h=a[0];const m=new Set,g=(O,F=++a[0])=>{h!==F&&(h=F,m.forEach(L=>L(O,F)))};let y=a[1];const v=(O=++a[1])=>(y!==O&&!m.size&&(y=O,w.forEach(([F])=>{const L=F[1](O);L>h&&(h=L)})),h),S=O=>(F,L)=>{const D=[...F];D[1]=[O,...D[1]],g(D,L)},w=new Map,C=(O,F)=>{if(m.size){const L=F[3](S(O));w.set(O,[F,L])}else w.set(O,[F])},x=O=>{var F;const L=w.get(O);L&&(w.delete(O),(F=L[1])==null||F.call(L))},P=O=>(m.add(O),m.size===1&&w.forEach(([L,D],B)=>{const R=L[3](S(B));w.set(B,[L,R])}),()=>{m.delete(O),m.size===0&&w.forEach(([L,D],B)=>{D&&(D(),w.set(B,[L]))})}),_=Array.isArray(d)?[]:Object.create(Object.getPrototypeOf(d)),k=t(_,{deleteProperty(O,F){const L=Reflect.get(O,F);x(F);const D=Reflect.deleteProperty(O,F);return D&&g(["delete",[F],L]),D},set(O,F,L,D){const B=Reflect.has(O,F),R=Reflect.get(O,F,D);if(B&&(e(R,L)||s.has(L)&&e(R,s.get(L))))return!0;x(F),z1(L)&&(L=Eie(L)||L);let A=L;if(L instanceof Promise)L.then(z=>{L.status="fulfilled",L.value=z,g(["resolve",[F],z])}).catch(z=>{L.status="rejected",L.reason=z,g(["reject",[F],z])});else{!yl.has(L)&&n(L)&&(A=c(L));const z=!om.has(A)&&yl.get(A);z&&C(F,z)}return Reflect.set(O,F,A,D),g(["set",[F],L,R]),!0}});s.set(d,k);const M=[_,v,i,P];return yl.set(k,M),Reflect.ownKeys(d).forEach(O=>{const F=Object.getOwnPropertyDescriptor(d,O);"value"in F&&(k[O]=d[O],delete F.value,delete F.writable),Object.defineProperty(_,O,F)}),k})=>[c,yl,om,e,t,n,r,o,i,s,a],[Iie]=Pie();function hS(e={}){return Iie(e)}function mS(e,t,n){const r=yl.get(e);let o;const i=[],s=r[3];let a=!1;const d=s(p=>{if(i.push(p),n){t(i.splice(0));return}o||(o=Promise.resolve().then(()=>{o=void 0,a&&t(i.splice(0))}))});return a=!0,()=>{a=!1,d()}}function q$(e,t){const n=yl.get(e),[r,o,i]=n;return i(r,o(),t)}var KF={exports:{}},qF={};/**
|
|
320
320
|
* @license React
|
|
321
321
|
* use-sync-external-store-shim.production.min.js
|
|
322
322
|
*
|
|
@@ -324,26 +324,26 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
324
324
|
*
|
|
325
325
|
* This source code is licensed under the MIT license found in the
|
|
326
326
|
* LICENSE file in the root directory of this source tree.
|
|
327
|
-
*/var Fu=u;function kie(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _ie=typeof Object.is=="function"?Object.is:kie,$ie=Fu.useState,Rie=Fu.useEffect,Mie=Fu.useLayoutEffect,Tie=Fu.useDebugValue;function Oie(e,t){var n=t(),r=$ie({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return Mie(function(){o.value=n,o.getSnapshot=t,j1(o)&&i({inst:o})},[e,n,t]),Rie(function(){return j1(o)&&i({inst:o}),e(function(){j1(o)&&i({inst:o})})},[e]),Tie(n),n}function j1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_ie(e,n)}catch(r){return!0}}function Lie(e,t){return t()}var Fie=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?Lie:Oie;qF.useSyncExternalStore=Fu.useSyncExternalStore!==void 0?Fu.useSyncExternalStore:Fie;KF.exports=qF;var Aie=KF.exports;const Nie=mp(Aie),{use:Y$}=$o,{useSyncExternalStore:Die}=Nie;const Bie=new WeakMap;function gS(e,t){const n=t==null?void 0:t.sync,r=u.useRef(),o=u.useRef();let i=!0;const s=Die(u.useCallback(d=>{const p=mS(e,d,n);return d(),p},[e,n]),()=>{const d=q$(e,Y$);try{if(!i&&r.current&&o.current&&!GF(r.current,d,o.current,new WeakMap))return r.current}catch(p){}return d},()=>q$(e,Y$));i=!1;const a=new WeakMap;u.useEffect(()=>{r.current=s,o.current=a});const c=u.useMemo(()=>new WeakMap,[]);return WF(s,a,c,Bie)}const Au=hS([]),kw={closableContent:"x",padding:!0};function zie(){const e=gS(Au);return u.createElement(u.Fragment,{},e.length>0&&e.map(t=>u.createElement(jie,Ce({key:t.$id},t))))}function jie(e){var r;const t=u.useRef();if(u.useEffect(()=>{var o;(o=t.current)==null||o.focus()},[]),e=Ce(Ce({},kw),e),e.Container)return u.createElement(e.Container,e);return u.createElement("div",{ref:t,className:"dialog-backdrop "+(e.className||""),tabIndex:0,onKeyDown:Hie,onClick:o=>o.target===o.currentTarget&&Bi()},e.noFrame?u.createElement(e.Content||"div"):u.createElement("div",Ce({className:"dialog",style:Ce(Ce({},n()),(r=e.dialogProps)==null?void 0:r.style),onClick(o){o.stopPropagation()}},e.dialogProps),e.closable||e.closable===void 0&&u.createElement("button",{className:"dialog-icon dialog-closer",onClick(){Bi()}},e.closableContent),e.icon&&u.createElement("div",{className:"dialog-icon dialog-type"},_w(e.icon)),u.createElement("div",{className:"dialog-title"},_w(e.title)),u.createElement("div",{className:"dialog-content"},u.createElement(e.Content||"div"))));function n(){const{innerWidth:o,innerHeight:i}=window,s=e.position;return s&&Ce(Ce({margin:"1em",position:"absolute"},s[0]<o/2?{left:s[0]}:{right:o-s[0]}),s[1]<i/2?{top:s[1]}:{bottom:i-s[1]})}}function _w(e){return typeof e=="function"?u.createElement(e):e}function Hie(e){e.key==="Escape"&&Bi()}function Wo(e){const t=Math.random();return e.$id=t,Au.push(e),{close:n};function n(r){const o=Au.findIndex(i=>i.$id===t);if(!(o<0))return YF(o,r)}}function Bi(e){let t=Au.length;for(;t--;){const n=Au[t];if(!n.reserveClosing)return YF(t,e),n}}function YF(e,t){var r;const[n]=Au.splice(e,1);return(r=n==null?void 0:n.onClose)==null?void 0:r.call(n,t)}var Ta={},oy={},Nu={};const Vie={},Uie=Object.freeze(Object.defineProperty({__proto__:null,default:Vie},Symbol.toStringTag,{value:"Module"})),Q$=CM(Uie);Object.defineProperty(Nu,"__esModule",{value:!0});var X$=Nu.crossEnvCrypto=void 0;try{const e=typeof window!="undefined"&&window.crypto||Q$.webcrypto;if(e){if(!e.subtle)throw new Error("Crypto.Subtle is undefined. Make sure you are using HTTPS in a compatible browser.");const t=n=>r=>e.subtle.digest(n,r);X$=Nu.crossEnvCrypto={randomBytes:e.getRandomValues.bind(e),hashFunctions:{SHA1:t("SHA-1"),SHA256:t("SHA-256"),SHA384:t("SHA-384"),SHA512:t("SHA-512")}}}else{const t=Q$,n=r=>o=>t.createHash(r).update(o).digest().buffer;X$=Nu.crossEnvCrypto={randomBytes:t.randomFillSync,hashFunctions:{SHA1:n("sha1"),SHA256:n("sha256"),SHA384:n("sha384"),SHA512:n("sha512")}}}}catch(e){throw console.error(e),new Error("No suitable crypto library was found. You may need a polyfill.")}Object.defineProperty(oy,"__esModule",{value:!0});oy.SRPParameters=void 0;const im=Nu;class Du{constructor(t=Du.PrimeGroup[2048],n=Du.H.SHA512){if(this.primeGroup=t,this.H=n,this.NBits=this.primeGroup.N.toString(2).length,!n)throw new Error("Hash function required")}}oy.SRPParameters=Du;Du.PrimeGroup={256:{N:BigInt("125617018995153554710546479714086468244499594888726646874671447258204721048803"),g:BigInt(2)},512:{N:BigInt("11144252439149533417835749556168991736939157778924947037200268358613863350040339017097790259154750906072491181606044774215413467851989724116331597513345603"),g:BigInt(2)},768:{N:BigInt("1087179135105457859072065649059069760280540086975817629066444682366896187793570736574549981488868217843627094867924800342887096064844227836735667168319981288765377499806385489913341488724152562880918438701129530606139552645689583147"),g:BigInt(2)},1024:{N:BigInt("167609434410335061345139523764350090260135525329813904557420930309800865859473551531551523800013916573891864789934747039010546328480848979516637673776605610374669426214776197828492691384519453218253702788022233205683635831626913357154941914129985489522629902540768368409482248290641036967659389658897350067939"),g:BigInt(2)},1536:{N:BigInt("1486998185923128292816507353619409521152457662596380074614818966810244974827752411420380336514078832314731499938313197533147998565301020797040787428051479639316928015998415709101293902971072960487527411068082311763171549170528008620813391411445907584912865222076100726050255271567749213905330659264908657221124284665444825474741087704974475795505492821585749417639344967192301749033325359286273431675492866492416941152646940908101472416714421046022696100064262587"),g:BigInt(2)},2048:{N:BigInt("21766174458617435773191008891802753781907668374255538511144643224689886235383840957210909013086056401571399717235807266581649606472148410291413364152197364477180887395655483738115072677402235101762521901569820740293149529620419333266262073471054548368736039519702486226506248861060256971802984953561121442680157668000761429988222457090413873973970171927093992114751765168063614761119615476233422096442783117971236371647333871414335895773474667308967050807005509320424799678417036867928316761272274230314067548291133582479583061439577559347101961771406173684378522703483495337037655006751328447510550299250924469288819"),g:BigInt(2)}};Du.H={SHA1:im.crossEnvCrypto.hashFunctions.SHA1,SHA256:im.crossEnvCrypto.hashFunctions.SHA256,SHA384:im.crossEnvCrypto.hashFunctions.SHA384,SHA512:im.crossEnvCrypto.hashFunctions.SHA512};var iy={},sy={};(function(e){var t=Sn&&Sn.__awaiter||function(x,P,_,I){function k(M){return M instanceof _?M:new _(function(O){O(M)})}return new(_||(_=Promise))(function(M,O){function F(B){try{D(I.next(B))}catch(R){O(R)}}function L(B){try{D(I.throw(B))}catch(R){O(R)}}function D(B){B.done?M(B.value):k(B.value).then(F,L)}D((I=I.apply(x,P||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.modPow=e.hashBitCount=e.createVerifierAndSalt=e.createVerifier=e.generateRandomBigInt=e.generateRandomString=e.hashPadded=e.hash=e.padStartArrayBuffer=e.stringToArrayBuffer=e.arrayBufferToBigInt=e.bigIntToArrayBuffer=void 0;const n=Nu,r=BigInt(0),o=BigInt(1),i=BigInt(2),s=x=>{const P=x.toString(16),_=new ArrayBuffer(Math.ceil(P.length/2)),I=new Uint8Array(_);let k=0;P.length%2!==0&&(I[0]=parseInt(P[0],16),k=1);for(let M=0;M<_.byteLength;M++)I[M+k]=parseInt(P.slice(2*M+k,2*M+2+k),16);return _};e.bigIntToArrayBuffer=s;const a=x=>{const P=[];return new Uint8Array(x).forEach(_=>{P.push(("0"+_.toString(16)).slice(-2))}),BigInt(`0x${P.join("")}`)};e.arrayBufferToBigInt=a;function c(x){return new TextEncoder().encode(x).buffer}e.stringToArrayBuffer=c;const d=(x,P)=>{const _=new Uint8Array(x);if(_.length<P){const I=new Uint8Array(P);return I.fill(0,0,P-_.length),I.set(_,P-_.length),I}return _};e.padStartArrayBuffer=d;function p(x,...P){const _=P.reduce((k,M)=>k+M.byteLength,0),I=new Uint8Array(_);for(let k=0,M=0;M<P.length;M++)I.set(new Uint8Array(P[M]),k),k+=P[M].byteLength;return x.H(I)}e.hash=p;function h(x,P,..._){const I=_.map(k=>e.padStartArrayBuffer(k,P));return p(x,...I)}e.hashPadded=h;function m(x=10){const P=new Uint8Array(Math.ceil(Math.ceil(x/2)));return n.crossEnvCrypto.randomBytes(P),P.reduce((_,I)=>{const k=I.toString(16).toString();return k.length===1?_+"0"+k:_+k},"").slice(0,x)}e.generateRandomString=m;function g(x=16){return e.arrayBufferToBigInt(C(x))}e.generateRandomBigInt=g;function y(x,P,_,I){return t(this,void 0,void 0,function*(){if(!P||!P.trim())throw new Error("Identity (I) must not be null or empty.");if(!_)throw new Error("Salt (s) must not be null.");if(!I)throw new Error("Password (P) must not be null");const k=yield x.computeX(P,_,I);return x.computeVerifier(k)})}e.createVerifier=y;function v(x,P,_,I){return t(this,void 0,void 0,function*(){const k=yield x.generateRandomSalt(I);return{s:k,v:yield y(x,P,k,_)}})}e.createVerifierAndSalt=v;const S=x=>t(void 0,void 0,void 0,function*(){return(yield p(x,e.bigIntToArrayBuffer(BigInt(1)))).byteLength*8});e.hashBitCount=S;function w(x,P,_){let I=o;for(;P>r;)P%i==o?(I=x*I%_,P-=o):(x=x*x%_,P/=i);return I}e.modPow=w;const C=x=>{const P=new Uint8Array(x);return n.crossEnvCrypto.randomBytes(P),P.buffer}})(sy);var dl=Sn&&Sn.__awaiter||function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(p){try{d(r.next(p))}catch(h){s(h)}}function c(p){try{d(r.throw(p))}catch(h){s(h)}}function d(p){p.done?i(p.value):o(p.value).then(a,c)}d((r=r.apply(e,t||[])).next())})};Object.defineProperty(iy,"__esModule",{value:!0});iy.SRPRoutines=void 0;const cn=sy;class Wie{constructor(t){this.parameters=t}hash(...t){return cn.hash(this.parameters,...t)}hashPadded(...t){const n=Math.trunc((this.parameters.NBits+7)/8);return cn.hashPadded(this.parameters,n,...t)}computeK(){return dl(this,void 0,void 0,function*(){return cn.arrayBufferToBigInt(yield this.hashPadded(cn.bigIntToArrayBuffer(this.parameters.primeGroup.N),cn.bigIntToArrayBuffer(this.parameters.primeGroup.g)))})}generateRandomSalt(t){return dl(this,void 0,void 0,function*(){const n=yield cn.hashBitCount(this.parameters),r=t||2*n/8;return cn.generateRandomBigInt(r)})}computeX(t,n,r){return dl(this,void 0,void 0,function*(){return cn.arrayBufferToBigInt(yield this.hash(cn.bigIntToArrayBuffer(n),yield this.computeIdentityHash(t,r)))})}computeXStep2(t,n){return dl(this,void 0,void 0,function*(){return cn.arrayBufferToBigInt(yield this.hash(cn.bigIntToArrayBuffer(t),n))})}computeIdentityHash(t,n){return dl(this,void 0,void 0,function*(){return yield this.hash(cn.stringToArrayBuffer(n))})}computeVerifier(t){return cn.modPow(this.parameters.primeGroup.g,t,this.parameters.primeGroup.N)}generatePrivateValue(){const t=Math.max(256,this.parameters.NBits);let n;do n=cn.generateRandomBigInt(t/8)%this.parameters.primeGroup.N;while(n===BigInt(0));return n}computeClientPublicValue(t){return cn.modPow(this.parameters.primeGroup.g,t,this.parameters.primeGroup.N)}isValidPublicValue(t){return t%this.parameters.primeGroup.N!==BigInt(0)}computeU(t,n){return dl(this,void 0,void 0,function*(){return cn.arrayBufferToBigInt(yield this.hashPadded(cn.bigIntToArrayBuffer(t),cn.bigIntToArrayBuffer(n)))})}computeClientEvidence(t,n,r,o,i){return dl(this,void 0,void 0,function*(){return cn.arrayBufferToBigInt(yield this.hash(cn.bigIntToArrayBuffer(r),cn.bigIntToArrayBuffer(o),cn.bigIntToArrayBuffer(i)))})}computeServerEvidence(t,n,r){return dl(this,void 0,void 0,function*(){return cn.arrayBufferToBigInt(yield this.hash(cn.bigIntToArrayBuffer(t),cn.bigIntToArrayBuffer(n),cn.bigIntToArrayBuffer(r)))})}computeClientSessionKey(t,n,r,o,i){const s=this.parameters.primeGroup.N,a=r*n+o,c=cn.modPow(this.parameters.primeGroup.g,n,s)*t%s;return cn.modPow(i+s-c,a,s)}}iy.SRPRoutines=Wie;var zl={},vS=Sn&&Sn.__awaiter||function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(p){try{d(r.next(p))}catch(h){s(h)}}function c(p){try{d(r.throw(p))}catch(h){s(h)}}function d(p){p.done?i(p.value):o(p.value).then(a,c)}d((r=r.apply(e,t||[])).next())})};Object.defineProperty(zl,"__esModule",{value:!0});zl.SRPClientSessionStep2=zl.SRPClientSessionStep1=zl.SRPClientSession=void 0;class Gie{constructor(t){this.routines=t}step1(t,n){return vS(this,void 0,void 0,function*(){if(!t||!t.trim())throw new Error("User identity must not be null nor empty");if(!n)throw new Error("User password must not be null");const r=yield this.routines.computeIdentityHash(t,n);return new ly(this.routines,t,r)})}}zl.SRPClientSession=Gie;class ly{constructor(t,n,r){this.routines=t,this.I=n,this.IH=r}step2(t,n){return vS(this,void 0,void 0,function*(){if(!t)throw new Error("Salt (s) must not be null");if(!n)throw new Error("Public server value (B) must not be null");const r=yield this.routines.computeXStep2(t,this.IH),o=this.routines.generatePrivateValue(),i=this.routines.computeClientPublicValue(o),s=yield this.routines.computeK(),a=yield this.routines.computeU(i,n),c=this.routines.computeClientSessionKey(s,r,a,o,n),d=yield this.routines.computeClientEvidence(this.I,t,i,n,c);return new ay(this.routines,i,d,c)})}toJSON(){return{I:this.I,IH:Array.from(new Uint8Array(this.IH))}}static fromState(t,n){return new ly(t,n.I,new Uint8Array(n.IH).buffer)}}zl.SRPClientSessionStep1=ly;class ay{constructor(t,n,r,o){this.routines=t,this.A=n,this.M1=r,this.S=o}step3(t){return vS(this,void 0,void 0,function*(){if(!t)throw new Error("Server evidence (M2) must not be null");if((yield this.routines.computeServerEvidence(this.A,this.M1,this.S))!==t)throw new Error("Bad server credentials")})}toJSON(){return{A:this.A.toString(16),M1:this.M1.toString(16),S:this.S.toString(16)}}static fromState(t,n){return new ay(t,BigInt("0x"+n.A),BigInt("0x"+n.M1),BigInt("0x"+n.S))}}zl.SRPClientSessionStep2=ay;var Bu={},$w=Sn&&Sn.__awaiter||function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(p){try{d(r.next(p))}catch(h){s(h)}}function c(p){try{d(r.throw(p))}catch(h){s(h)}}function d(p){p.done?i(p.value):o(p.value).then(a,c)}d((r=r.apply(e,t||[])).next())})};Object.defineProperty(Bu,"__esModule",{value:!0});Bu.SRPServerSessionStep1=Bu.SRPServerSession=void 0;const Rw=sy;class Kie{constructor(t){this.routines=t}step1(t,n,r){return $w(this,void 0,void 0,function*(){const o=this.routines.generatePrivateValue(),i=yield this.routines.computeK(),s=qie(this.routines.parameters,i,r,o);return new cy(this.routines,t,n,r,o,s)})}}Bu.SRPServerSession=Kie;class cy{constructor(t,n,r,o,i,s){this.routines=t,this.identifier=n,this.salt=r,this.verifier=o,this.b=i,this.B=s}sessionKey(t){return $w(this,void 0,void 0,function*(){if(t===null)throw new Error("Client public value (A) must not be null");if(!this.routines.isValidPublicValue(t))throw new Error(`Invalid Client public value (A): ${t.toString(16)}`);const n=yield this.routines.computeU(t,this.B);return Yie(this.routines.parameters.primeGroup.N,this.verifier,n,t,this.b)})}step2(t,n){return $w(this,void 0,void 0,function*(){if(!n)throw new Error("Client evidence (M1) must not be null");const r=yield this.sessionKey(t);if((yield this.routines.computeClientEvidence(this.identifier,this.salt,t,this.B,r))!==n)throw new Error("Bad client credentials");return this.routines.computeServerEvidence(t,n,r)})}toJSON(){return{identifier:this.identifier,salt:this.salt.toString(16),verifier:this.verifier.toString(16),b:this.b.toString(16),B:this.B.toString(16)}}static fromState(t,n){return new cy(t,n.identifier,BigInt("0x"+n.salt),BigInt("0x"+n.verifier),BigInt("0x"+n.b),BigInt("0x"+n.B))}}Bu.SRPServerSessionStep1=cy;const qie=(e,t,n,r)=>(Rw.modPow(e.primeGroup.g,r,e.primeGroup.N)+n*t)%e.primeGroup.N,Yie=(e,t,n,r,o)=>Rw.modPow(Rw.modPow(t,n,e)*r,o,e);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.generateRandomBigInt=e.arrayBufferToBigInt=e.bigIntToArrayBuffer=e.createVerifierAndSalt=e.SRPServerSessionStep1=e.SRPServerSession=e.SRPClientSessionStep2=e.SRPClientSessionStep1=e.SRPClientSession=e.SRPRoutines=e.SRPParameters=void 0;var t=oy;Object.defineProperty(e,"SRPParameters",{enumerable:!0,get:function(){return t.SRPParameters}});var n=iy;Object.defineProperty(e,"SRPRoutines",{enumerable:!0,get:function(){return n.SRPRoutines}});var r=zl;Object.defineProperty(e,"SRPClientSession",{enumerable:!0,get:function(){return r.SRPClientSession}}),Object.defineProperty(e,"SRPClientSessionStep1",{enumerable:!0,get:function(){return r.SRPClientSessionStep1}}),Object.defineProperty(e,"SRPClientSessionStep2",{enumerable:!0,get:function(){return r.SRPClientSessionStep2}});var o=Bu;Object.defineProperty(e,"SRPServerSession",{enumerable:!0,get:function(){return o.SRPServerSession}}),Object.defineProperty(e,"SRPServerSessionStep1",{enumerable:!0,get:function(){return o.SRPServerSessionStep1}});var i=sy;Object.defineProperty(e,"createVerifierAndSalt",{enumerable:!0,get:function(){return i.createVerifierAndSalt}}),Object.defineProperty(e,"bigIntToArrayBuffer",{enumerable:!0,get:function(){return i.bigIntToArrayBuffer}}),Object.defineProperty(e,"arrayBufferToBigInt",{enumerable:!0,get:function(){return i.arrayBufferToBigInt}}),Object.defineProperty(e,"generateRandomBigInt",{enumerable:!0,get:function(){return i.generateRandomBigInt}})})(Ta);function Qie(e,t,n){return mt(this,null,function*(){const{pubKey:r,salt:o}=yield n("loginSrp1",{username:e});if(!o)throw Error("salt");const i=new Ta.SRPRoutines(new Ta.SRPParameters),c=yield(yield new Ta.SRPClientSession(i).step1(e,t)).step2(BigInt(o),BigInt(r)),d=yield n("loginSrp2",{pubKey:String(c.A),proof:String(c.M1)});return yield c.step3(BigInt(d.proof)).catch(()=>Promise.reject("trust")),d})}const Mw="https://github.com/rejetto/hfs/",Xie=Mw+"wiki/";window._=St;const H1=wS();Object.assign(H1,{getPluginKey:()=>J$("plugin"),getPluginPublic:()=>{var e,t;return(t=(e=J$("src"))==null?void 0:e.match(/^.*\//))==null?void 0:t[0]},getPluginConfig:()=>H1.plugins[H1.getPluginKey()]||{}});function J$(e){var t;return((t=document.currentScript)==null?void 0:t.getAttribute(e))||console.error("this function must be called at the very top of your file")}Object.fromEntries(new URLSearchParams(window.location.search).entries());const Jie=["","K","M","G","T"];function ql(e,{post:t="B",k:n=1024,digits:r=NaN}={}){if(isNaN(Number(e))||e<0)return"";const o=e&&Math.floor(Math.log2(e)/Math.log2(n));return e/=Gi(n,o),(o&&!isNaN(r)?e.toFixed(r):St.round(e,isNaN(r)?e>=100?0:1:r))+" "+(Jie[o]||"")+t}function vu(e,t,n=""){return t?e+t+n:""}function Zie(e,t){return new Promise(n=>setTimeout(n,e,t))}function ese(e){const t=e+"=";let r=decodeURIComponent(document.cookie).split(";");for(let o of r)if(o=o.trim(),o.startsWith(t))return o.substring(t.length,o.length);return""}function yS(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>[n,t(r,n)]))}function tse(e,t){return!t||t.endsWith(e)?t:t+e}function nse(e){return!!e}function rd(e){return e.filter(nse)}function rse(e,t){return Object.defineProperties(e,yS(t,n=>({enumerable:!1,writable:!0,value:n})))}function Tw(e,t){return t(e)}function QF(e,{accept:t="",multiple:n=!0,folder:r=!1}={}){const o=Object.assign(document.createElement("input"),{type:"file",name:"file",accept:t,multiple:n,webkitdirectory:r});o.addEventListener("change",()=>e(o.files)),o.click()}function XF(e){return new Promise((t,n)=>{const r=new FileReader;r.addEventListener("load",o=>{if(!o.target||e.size&&!o.target.result)return n("cannot read");const{result:i}=o.target;t(i==null?void 0:i.toString())}),r.addEventListener("error",()=>{n(r.error)}),r.readAsText(e)})}function ose(e){return(e*100).toFixed(1)+"%"}function ise(e){return e==null?[]:Array.isArray(e)?e:[e]}function bS(){let e;const t=new Promise((n,r)=>e={resolve:n,reject:r});return Object.assign(t,e)}function sse(){return window.innerWidth<800}function wS(){return window.HFS}function JF(){return wS().prefixUrl||""}function lse(e){return e.slice(e.lastIndexOf("/")+1||e.lastIndexOf("\\")+1)}function ase(e){return function t(n){if(!n)return;const{exp:r,username:o,adminUrl:i}=n;if(e.username=o,e.adminUrl=i,!o||!r)return;const s=new Date(r).getTime()-Date.now(),a=St.clamp(s-3e4,4e3,6e5);console.debug("session refresh in",Math.round(a/1e3)),setTimeout(()=>Et("refresh_session").then(t),a)}}function cse(e){try{return e&&JSON.parse(e)}catch(t){}}var CS={},use=ut;Object.defineProperty(CS,"__esModule",{value:!0});var uy=CS.default=void 0,dse=use(dt()),fse=at(),pse=(0,dse.default)((0,fse.jsx)("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z"}),"Save");uy=CS.default=pse;function hse(e){return Je("MuiLoadingButton",e)}const mse=Xe("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),Ts=mse,gse=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],vse=e=>{const{loading:t,loadingPosition:n,classes:r}=e,o={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${ue(n)}`],endIcon:[t&&`endIconLoading${ue(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${ue(n)}`]},i=Me(o,hse,r);return E({},r,i)},yse=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",bse=oe(mr,{shouldForwardProp:e=>yse(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Ts.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Ts.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>E({[`& .${Ts.startIconLoadingStart}, & .${Ts.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},e.loadingPosition==="center"&&{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${Ts.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${Ts.startIconLoadingStart}, & .${Ts.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${Ts.startIconLoadingStart}, & .${Ts.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),wse=oe("div",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${ue(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>E({position:"absolute",visibility:"visible",display:"flex"},t.loadingPosition==="start"&&(t.variant==="outlined"||t.variant==="contained")&&{left:t.size==="small"?10:14},t.loadingPosition==="start"&&t.variant==="text"&&{left:6},t.loadingPosition==="center"&&{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled},t.loadingPosition==="end"&&(t.variant==="outlined"||t.variant==="contained")&&{right:t.size==="small"?10:14},t.loadingPosition==="end"&&t.variant==="text"&&{right:6},t.loadingPosition==="start"&&t.fullWidth&&{position:"relative",left:-10},t.loadingPosition==="end"&&t.fullWidth&&{position:"relative",right:-10})),Cse=u.forwardRef(function(t,n){const r=et({props:t,name:"MuiLoadingButton"}),{children:o,disabled:i=!1,id:s,loading:a=!1,loadingIndicator:c,loadingPosition:d="center",variant:p="text"}=r,h=ne(r,gse),m=on(s),g=c!=null?c:T.jsx(Ka,{"aria-labelledby":m,color:"inherit",size:16}),y=E({},r,{disabled:i,loading:a,loadingIndicator:g,loadingPosition:d,variant:p}),v=vse(y),S=a?T.jsx(wse,{className:v.loadingIndicator,ownerState:y,children:g}):null;return T.jsxs(bse,E({disabled:i||a,id:m,ref:n},h,{variant:p,classes:v,ownerState:y,children:[y.loadingPosition==="end"?o:S,y.loadingPosition==="end"?S:o]}))}),ZF=Cse,xse=u.createContext({}),xS=xse,Sse=["element"];function Ese(e,t){for(let n=0;n<e.length;n+=1)if(t(e[n]))return n;return-1}function Pse(e,t){let n=0,r=e.length-1;for(;n<=r;){const o=Math.floor((n+r)/2);if(e[o].element===t)return o;e[o].element.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING?r=o-1:n=o+1}return n}const eA=u.createContext({});function Ise(e){const t=u.useRef(null);return u.useEffect(()=>{t.current=e},[e]),t.current}const Z$=()=>{};function kse(e){const[,t]=u.useState(),{registerDescendant:n=Z$,unregisterDescendant:r=Z$,descendants:o=[],parentId:i=null}=u.useContext(eA),s=Ese(o,d=>d.element===e.element),a=Ise(o),c=o.some((d,p)=>a&&a[p]&&a[p].element!==d.element);return ln(()=>{if(e.element)return n(E({},e,{index:s})),()=>{r(e.element)};t({})},[n,r,s,c,e]),{parentId:i,index:s}}function tA(e){const{children:t,id:n}=e,[r,o]=u.useState([]),i=u.useCallback(c=>{let{element:d}=c,p=ne(c,Sse);o(h=>{let m;if(h.length===0)return[E({},p,{element:d,index:0})];const g=Pse(h,d);if(h[g]&&h[g].element===d)m=h;else{const y=E({},p,{element:d,index:g});m=h.slice(),m.splice(g,0,y)}return m.forEach((y,v)=>{y.index=v}),m})},[]),s=u.useCallback(c=>{o(d=>d.filter(p=>c!==p.element))},[]),a=u.useMemo(()=>({descendants:r,registerDescendant:i,unregisterDescendant:s,parentId:n}),[r,i,s,n]);return T.jsx(eA.Provider,{value:a,children:t})}function _se(e){const{focus:t,isExpanded:n,isExpandable:r,isFocused:o,isDisabled:i,isSelected:s,multiSelect:a,selectNode:c,selectRange:d,toggleExpansion:p}=u.useContext(xS),h=r?r(e):!1,m=n?n(e):!1,g=o?o(e):!1,y=i?i(e):!1,v=s?s(e):!1;return{disabled:y,expanded:m,selected:v,focused:g,handleExpansion:x=>{if(!y){g||t(x,e);const P=a&&(x.shiftKey||x.ctrlKey||x.metaKey);h&&!(P&&n(e))&&p(x,e)}},handleSelection:x=>{y||(g||t(x,e),a&&(x.shiftKey||x.ctrlKey||x.metaKey)?x.shiftKey?d(x,{end:e}):c(x,e,!0):c(x,e))},preventSelection:x=>{(x.shiftKey||x.ctrlKey||x.metaKey||y)&&x.preventDefault()}}}const $se=["classes","className","displayIcon","expansionIcon","icon","label","nodeId","onClick","onMouseDown"],Rse=u.forwardRef(function(t,n){const{classes:r,className:o,displayIcon:i,expansionIcon:s,icon:a,label:c,nodeId:d,onClick:p,onMouseDown:h}=t,m=ne(t,$se),{disabled:g,expanded:y,selected:v,focused:S,handleExpansion:w,handleSelection:C,preventSelection:x}=_se(d),P=a||s||i,_=k=>{x(k),h&&h(k)},I=k=>{w(k),C(k),p&&p(k)};return T.jsxs("div",E({className:he(o,r.root,y&&r.expanded,v&&r.selected,S&&r.focused,g&&r.disabled),onClick:I,onMouseDown:_,ref:n},m,{children:[T.jsx("div",{className:r.iconContainer,children:P}),T.jsx("div",{className:r.label,children:c})]}))}),nA=Rse;function Mse(e){return Je("MuiTreeItem",e)}const Tse=Xe("MuiTreeItem",["root","group","content","expanded","selected","focused","disabled","iconContainer","label"]),fl=Tse,Ose=["children","className","collapseIcon","ContentComponent","ContentProps","endIcon","expandIcon","disabled","icon","id","label","nodeId","onClick","onMouseDown","TransitionComponent","TransitionProps"],Lse=e=>{const{classes:t}=e;return Me({root:["root"],content:["content"],expanded:["expanded"],selected:["selected"],focused:["focused"],disabled:["disabled"],iconContainer:["iconContainer"],label:["label"],group:["group"]},Mse,t)},Fse=oe("li",{name:"MuiTreeItem",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),Ase=oe(nA,{name:"MuiTreeItem",slot:"Content",overridesResolver:(e,t)=>[t.content,t.iconContainer&&{[`& .${fl.iconContainer}`]:t.iconContainer},t.label&&{[`& .${fl.label}`]:t.label}]})(({theme:e})=>({padding:"0 8px",width:"100%",display:"flex",alignItems:"center",cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${fl.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"},[`&.${fl.focused}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${fl.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:lt(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:lt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:lt(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${fl.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:lt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`& .${fl.iconContainer}`]:{marginRight:4,width:15,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}},[`& .${fl.label}`]:E({width:"100%",minWidth:0,paddingLeft:4,position:"relative"},e.typography.body1)})),Nse=oe(yg,{name:"MuiTreeItem",slot:"Group",overridesResolver:(e,t)=>t.group})({margin:0,padding:0,marginLeft:17}),Dse=u.forwardRef(function(t,n){const r=et({props:t,name:"MuiTreeItem"}),{children:o,className:i,collapseIcon:s,ContentComponent:a=nA,ContentProps:c,endIcon:d,expandIcon:p,disabled:h,icon:m,id:g,label:y,nodeId:v,onClick:S,onMouseDown:w,TransitionComponent:C=yg,TransitionProps:x}=r,P=ne(r,Ose),{icons:_={},focus:I,isExpanded:k,isFocused:M,isSelected:O,isDisabled:F,multiSelect:L,disabledItemsFocusable:D,mapFirstChar:B,unMapFirstChar:R,registerNode:A,unregisterNode:z,treeId:V}=u.useContext(xS);let N=null;g!=null?N=g:V&&v&&(N=`${V}-${v}`);const[H,W]=u.useState(null),K=u.useRef(null),Y=Vt(W,n),ie=u.useMemo(()=>({element:H,id:v}),[v,H]),{index:re,parentId:de}=kse(ie),se=!!(Array.isArray(o)?o.length:o),le=k?k(v):!1,Ee=M?M(v):!1,ye=O?O(v):!1,_e=F?F(v):!1,ee=E({},r,{expanded:le,focused:Ee,selected:ye,disabled:_e}),ke=Lse(ee);let Re,Pe;se&&(le?Pe=s||_.defaultCollapseIcon:Pe=p||_.defaultExpandIcon),se?Re=_.defaultParentIcon:Re=d||_.defaultEndIcon,u.useEffect(()=>{if(A&&z&&re!==-1)return A({id:v,idAttribute:N,index:re,parentId:de,expandable:se,disabled:h}),()=>{z(v)}},[A,z,de,re,v,se,h,N]),u.useEffect(()=>{if(B&&R&&y)return B(v,K.current.textContent.substring(0,1).toLowerCase()),()=>{R(v)}},[B,R,v,y]);let pe;L?pe=ye:ye&&(pe=!0);function be(te){if(te.target===te.currentTarget){let Ye;typeof te.target.getRootNode=="function"?Ye=te.target.getRootNode():Ye=vn(te.target),Ye.getElementById(V).focus({preventScroll:!0})}const Oe=!D&&_e;!Ee&&te.currentTarget===te.target&&!Oe&&I(te,v)}return T.jsxs(Fse,E({className:he(ke.root,i),role:"treeitem","aria-expanded":se?le:null,"aria-selected":pe,"aria-disabled":_e||null,ref:Y,id:N,tabIndex:-1},P,{ownerState:ee,onFocus:be,children:[T.jsx(Ase,E({as:a,ref:K,classes:{root:ke.content,expanded:ke.expanded,selected:ke.selected,focused:ke.focused,disabled:ke.disabled,iconContainer:ke.iconContainer,label:ke.label},label:y,nodeId:v,onClick:S,onMouseDown:w,icon:m,expansionIcon:Pe,displayIcon:Re,ownerState:ee},c)),o&&T.jsx(tA,{id:v,children:T.jsx(Nse,E({as:C,unmountOnExit:!0,className:ke.group,in:le,component:"ul",role:"group"},x,{children:o}))})]}))}),Ow=Dse;function Bse(e){return Je("MuiTreeView",e)}Xe("MuiTreeView",["root"]);const zse=["children","className","defaultCollapseIcon","defaultEndIcon","defaultExpanded","defaultExpandIcon","defaultParentIcon","defaultSelected","disabledItemsFocusable","disableSelection","expanded","id","multiSelect","onBlur","onFocus","onKeyDown","onNodeFocus","onNodeSelect","onNodeToggle","selected"],jse=e=>{const{classes:t}=e;return Me({root:["root"]},Bse,t)},Hse=oe("ul",{name:"MuiTreeView",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,margin:0,listStyle:"none",outline:0});function Vse(e){return e&&e.length===1&&e.match(/\S/)}function eR(e,t,n){for(let r=t;r<e.length;r+=1)if(n===e[r])return r;return-1}function tR(){return!1}const Use=[],Wse=[],Gse=u.forwardRef(function(t,n){const r=et({props:t,name:"MuiTreeView"}),{children:o,className:i,defaultCollapseIcon:s,defaultEndIcon:a,defaultExpanded:c=Use,defaultExpandIcon:d,defaultParentIcon:p,defaultSelected:h=Wse,disabledItemsFocusable:m=!1,disableSelection:g=!1,expanded:y,id:v,multiSelect:S=!1,onBlur:w,onFocus:C,onKeyDown:x,onNodeFocus:P,onNodeSelect:_,onNodeToggle:I,selected:k}=r,M=ne(r,zse),F=lr().direction==="rtl",L=E({},r,{defaultExpanded:c,defaultSelected:h,disabledItemsFocusable:m,disableSelection:g,multiSelect:S}),D=jse(L),B=on(v),R=u.useRef(null),A=Vt(R,n),[z,V]=u.useState(null),N=u.useRef({}),H=u.useRef({}),[W,K]=ss({controlled:y,default:c,name:"TreeView",state:"expanded"}),[Y,ie]=ss({controlled:k,default:h,name:"TreeView",state:"selected"}),re=u.useCallback(ce=>Array.isArray(W)?W.indexOf(ce)!==-1:!1,[W]),de=u.useCallback(ce=>N.current[ce]&&N.current[ce].expandable,[]),se=u.useCallback(ce=>Array.isArray(Y)?Y.indexOf(ce)!==-1:Y===ce,[Y]),le=u.useCallback(ce=>{let ge=N.current[ce];if(!ge)return!1;if(ge.disabled)return!0;for(;ge.parentId!=null;)if(ge=N.current[ge.parentId],ge.disabled)return!0;return!1},[]),Ee=ce=>z===ce,ye=ce=>Object.keys(N.current).map(ge=>N.current[ge]).filter(ge=>ge.parentId===ce).sort((ge,Ne)=>ge.index-Ne.index).map(ge=>ge.id),_e=ce=>{let ge=ye(ce);return m||(ge=ge.filter(Ne=>!le(Ne))),ge},ee=ce=>{if(re(ce)&&_e(ce).length>0)return _e(ce)[0];let ge=N.current[ce];for(;ge!=null;){const Ne=_e(ge.parentId),ft=Ne[Ne.indexOf(ge.id)+1];if(ft)return ft;ge=N.current[ge.parentId]}return null},ke=ce=>{const ge=N.current[ce],Ne=_e(ge.parentId),ft=Ne.indexOf(ce);if(ft===0)return ge.parentId;let it=Ne[ft-1];for(;re(it)&&_e(it).length>0;)it=_e(it).pop();return it},Re=()=>{let ce=_e(null).pop();for(;re(ce);)ce=_e(ce).pop();return ce},Pe=()=>_e(null)[0],pe=ce=>N.current[ce].parentId,be=(ce,ge)=>{if(ce===ge)return[ce,ge];const Ne=N.current[ce],ft=N.current[ge];if(Ne.parentId===ft.id||ft.parentId===Ne.id)return ft.parentId===Ne.id?[Ne.id,ft.id]:[ft.id,Ne.id];const it=[Ne.id],He=[ft.id];let Ct=Ne.parentId,Ut=ft.parentId,_n=He.indexOf(Ct)!==-1,ho=it.indexOf(Ut)!==-1,we=!0,me=!0;for(;!ho&&!_n;)we&&(it.push(Ct),_n=He.indexOf(Ct)!==-1,we=Ct!==null,!_n&&we&&(Ct=N.current[Ct].parentId)),me&&!_n&&(He.push(Ut),ho=it.indexOf(Ut)!==-1,me=Ut!==null,!ho&&me&&(Ut=N.current[Ut].parentId));const We=_n?Ct:Ut,pt=ye(We),Wt=it[it.indexOf(We)-1],Ln=He[He.indexOf(We)-1];return pt.indexOf(Wt)<pt.indexOf(Ln)?[ce,ge]:[ge,ce]},te=(ce,ge)=>{const[Ne,ft]=be(ce,ge),it=[Ne];let He=Ne;for(;He!==ft;)He=ee(He),it.push(He);return it},Oe=(ce,ge)=>{ge&&(V(ge),P&&P(ce,ge))},Ye=(ce,ge)=>Oe(ce,ee(ge)),Ke=(ce,ge)=>Oe(ce,ke(ge)),Ue=ce=>Oe(ce,Pe()),De=ce=>Oe(ce,Re()),ct=(ce,ge,Ne)=>{let ft,it;const He=Ne.toLowerCase(),Ct=[],Ut=[];Object.keys(H.current).forEach(_n=>{const ho=H.current[_n],we=N.current[_n],me=we.parentId?re(we.parentId):!0,We=m?!1:le(_n);me&&!We&&(Ct.push(_n),Ut.push(ho))}),ft=Ct.indexOf(ge)+1,ft>=Ct.length&&(ft=0),it=eR(Ut,ft,He),it===-1&&(it=eR(Ut,0,He)),it>-1&&Oe(ce,Ct[it])},vt=(ce,ge=z)=>{let Ne;W.indexOf(ge)!==-1?Ne=W.filter(ft=>ft!==ge):Ne=[ge].concat(W),I&&I(ce,Ne),K(Ne)},st=(ce,ge)=>{const Ne=N.current[ge],it=ye(Ne.parentId).filter(Ct=>de(Ct)&&!re(Ct)),He=W.concat(it);it.length>0&&(K(He),I&&I(ce,He))},Pt=u.useRef(null),yt=u.useRef(!1),Ae=u.useRef([]),Fe=(ce,ge)=>{let Ne=Y.slice();const{start:ft,next:it,current:He}=ge;!it||!He||(Ae.current.indexOf(He)===-1&&(Ae.current=[]),yt.current?Ae.current.indexOf(it)!==-1?(Ne=Ne.filter(Ct=>Ct===ft||Ct!==He),Ae.current=Ae.current.filter(Ct=>Ct===ft||Ct!==He)):(Ne.push(it),Ae.current.push(it)):(Ne.push(it),Ae.current.push(He,it)),_&&_(ce,Ne),ie(Ne))},Be=(ce,ge)=>{let Ne=Y.slice();const{start:ft,end:it}=ge;yt.current&&(Ne=Ne.filter(Ut=>Ae.current.indexOf(Ut)===-1));let He=te(ft,it);He=He.filter(Ut=>!le(Ut)),Ae.current=He;let Ct=Ne.concat(He);Ct=Ct.filter((Ut,_n)=>Ct.indexOf(Ut)===_n),_&&_(ce,Ct),ie(Ct)},Ze=(ce,ge)=>{let Ne;Y.indexOf(ge)!==-1?Ne=Y.filter(ft=>ft!==ge):Ne=[ge].concat(Y),_&&_(ce,Ne),ie(Ne)},Ie=(ce,ge)=>{const Ne=S?[ge]:ge;_&&_(ce,Ne),ie(Ne)},Le=(ce,ge,Ne=!1)=>ge?(Ne?Ze(ce,ge):Ie(ce,ge),Pt.current=ge,yt.current=!1,Ae.current=[],!0):!1,Ve=(ce,ge,Ne=!1)=>{const{start:ft=Pt.current,end:it,current:He}=ge;Ne?Fe(ce,{start:ft,next:it,current:He}):ft!=null&&it!=null&&Be(ce,{start:ft,end:it}),yt.current=!0},nt=(ce,ge)=>{Pt.current||(Pt.current=ge);const Ne=yt.current?Pt.current:ge;Ve(ce,{start:Ne,end:Pe()})},ht=(ce,ge)=>{Pt.current||(Pt.current=ge);const Ne=yt.current?Pt.current:ge;Ve(ce,{start:Ne,end:Re()})},en=(ce,ge)=>{le(ee(ge))||Ve(ce,{end:ee(ge),current:ge},!0)},kn=(ce,ge)=>{le(ke(ge))||Ve(ce,{end:ke(ge),current:ge},!0)},On=ce=>{Ve(ce,{start:Pe(),end:Re()})},Xn=u.useCallback(ce=>{const{id:ge,index:Ne,parentId:ft,expandable:it,idAttribute:He,disabled:Ct}=ce;N.current[ge]={id:ge,index:Ne,parentId:ft,expandable:it,idAttribute:He,disabled:Ct}},[]),ar=u.useCallback(ce=>{const ge=E({},N.current);delete ge[ce],N.current=ge,V(Ne=>Ne===ce&&R.current===vn(R.current).activeElement?ye(null)[0]:Ne)},[]),cr=u.useCallback((ce,ge)=>{H.current[ce]=ge},[]),bn=u.useCallback(ce=>{const ge=E({},H.current);delete ge[ce],H.current=ge},[]),tn=ce=>(de(z)&&(re(z)?Ye(ce,z):le(z)||vt(ce)),!0),Hn=ce=>{if(re(z)&&!le(z))return vt(ce,z),!0;const ge=pe(z);return ge?(Oe(ce,ge),!0):!1},Go=ce=>{let ge=!1;const Ne=ce.key;if(ce.altKey||ce.currentTarget!==ce.target||!z)return;const ft=ce.ctrlKey||ce.metaKey;switch(Ne){case" ":!g&&!le(z)&&(S&&ce.shiftKey?(Ve(ce,{end:z}),ge=!0):S?ge=Le(ce,z,!0):ge=Le(ce,z)),ce.stopPropagation();break;case"Enter":le(z)||(de(z)?(vt(ce),ge=!0):S?ge=Le(ce,z,!0):ge=Le(ce,z)),ce.stopPropagation();break;case"ArrowDown":S&&ce.shiftKey&&!g&&en(ce,z),Ye(ce,z),ge=!0;break;case"ArrowUp":S&&ce.shiftKey&&!g&&kn(ce,z),Ke(ce,z),ge=!0;break;case"ArrowRight":F?ge=Hn(ce):ge=tn(ce);break;case"ArrowLeft":F?ge=tn(ce):ge=Hn(ce);break;case"Home":S&&ft&&ce.shiftKey&&!g&&!le(z)&&nt(ce,z),Ue(ce),ge=!0;break;case"End":S&&ft&&ce.shiftKey&&!g&&!le(z)&&ht(ce,z),De(ce),ge=!0;break;default:Ne==="*"?(st(ce,z),ge=!0):S&&ft&&Ne.toLowerCase()==="a"&&!g?(On(ce),ge=!0):!ft&&!ce.shiftKey&&Vse(Ne)&&(ct(ce,z,Ne),ge=!0)}ge&&(ce.preventDefault(),ce.stopPropagation()),x&&x(ce)},Hi=ce=>{if(ce.target===ce.currentTarget){const ge=Array.isArray(Y)?Y[0]:Y;Oe(ce,ge||_e(null)[0])}C&&C(ce)},Cs=ce=>{V(null),w&&w(ce)},xs=N.current[z]?N.current[z].idAttribute:null;return T.jsx(xS.Provider,{value:{icons:{defaultCollapseIcon:s,defaultExpandIcon:d,defaultParentIcon:p,defaultEndIcon:a},focus:Oe,toggleExpansion:vt,isExpanded:re,isExpandable:de,isFocused:Ee,isSelected:se,isDisabled:le,selectNode:g?tR:Le,selectRange:g?tR:Ve,multiSelect:S,disabledItemsFocusable:m,mapFirstChar:cr,unMapFirstChar:bn,registerNode:Xn,unregisterNode:ar,treeId:B},children:T.jsx(tA,{children:T.jsx(Hse,E({role:"tree",id:B,"aria-activedescendant":xs,"aria-multiselectable":S,className:he(D.root,i),ref:A,tabIndex:0,onKeyDown:Go,onFocus:Hi,onBlur:Cs,ownerState:L},M,{children:o}))})})}),rA=Gse;function io(m){var g=m,{value:e,onChange:t,min:n,max:r,required:o,getApi:i,typing:s,start:a,end:c,onTyping:d,suggestions:p}=g,h=Yt(g,["value","onChange","min","max","required","getApi","typing","start","end","onTyping","suggestions"]);const y=e!=null?e:"";i==null||i({getError(){return!e&&o?"required":(e==null?void 0:e.length)<n?"too short":(e==null?void 0:e.length)>r?"too long":!1}});const[v,S]=u.useState(y);Kse(h,"inputRef",u.useCallback(P=>P&&x(null,P.value),[]));const w=u.useRef(y);u.useEffect(()=>{S(y),w.current=y},[y]);const C=P=>u.createElement($p,Ce(kt(Ce({fullWidth:!0,InputLabelProps:v||h.placeholder?{shrink:!0}:void 0},h),{sx:h.label?h.sx:Object.assign({"& .MuiInputBase-input":{pt:1.5}},h.sx),value:v,onChange(_){const I=_.target.value;(d==null?void 0:d(I))!==!1&&(S(I),(s||document.activeElement!==_.target)&&x(_,I))},onKeyDown(_){var I;(I=h.onKeyDown)==null||I.call(h,_),_.key==="Enter"&&x(_)},onBlur(_){var I;(I=h.onBlur)==null||I.call(h,_),x(_)},InputProps:Ce({startAdornment:a&&u.createElement(qa,{position:"start"},a),endAdornment:c&&u.createElement(qa,{position:"end"},c)},h.InputProps)}),P));return p?u.createElement(Dx,{freeSolo:!0,options:p,renderInput:C}):C(null);function x(P,_=v){const I=_.trim();I!==w.current&&(w.current=I,t(I,{was:e,event:P,cancel(){S(y)}}))}}function Kse(e,t,n){const r=u.useRef(),o=e[t];return e[t]=i=>{r.current=i,n==null||n(i),typeof o=="function"?o(i):o&&(o.current=i)},r}function gs(e){const a=e,{value:t,onChange:n,getApi:r,options:o,sx:i}=a,s=Yt(a,["value","onChange","getApi","options","sx"]);return u.createElement($p,kt(Ce(Ce({},oA(e)),s),{onChange(c){try{let d=c.target.value;d=JSON.parse(d),n(d,{was:t,event:c})}catch(d){}}}))}function SS(e){const a=e,{value:t,onChange:n,getApi:r,options:o,sx:i}=a,s=Yt(a,["value","onChange","getApi","options","sx"]);return u.createElement($p,kt(Ce(Ce({},oA(kt(Ce({},e),{value:void 0}))),s),{SelectProps:{multiple:!0},value:Array.isArray(t)?t.map(c=>JSON.stringify(c)):[],onChange(c){try{let d=c.target.value;d=Array.isArray(d)?d.map(p=>JSON.parse(p)):[],n(d,{was:t,event:c})}catch(d){}}}))}function oA(e){const{options:t,disabled:n,start:r,end:o}=e,i=Array.isArray(t)?t.map(c=>typeof c=="string"||typeof c=="number"?{value:c,label:String(c)}:c):Object.entries(t).map(([c,d])=>({value:d,label:c})),s=JSON.stringify(e.value),a=i.find(c=>JSON.stringify(c.value)===s);return{select:!0,fullWidth:!0,sx:e.label?e.sx:Object.assign({"& .MuiInputBase-input":{pt:1}},e.sx),value:a?s:"",disabled:!(i!=null&&i.length)||n,InputProps:Ce({startAdornment:r&&u.createElement(qa,{position:"start"},r),endAdornment:o&&u.createElement(qa,{position:"end"},o)},e.InputProps),children:i.map((c,d)=>u.createElement(fo,{key:d,value:JSON.stringify(c==null?void 0:c.value),children:c==null?void 0:c.label}))}}function Rm(r){var o=r,{value:e,empty:t="-"}=o,n=Yt(o,["value","empty"]);return!n.toField&&t!==void 0&&e!==0&&!e&&(e=t),u.createElement(io,kt(Ce({},n),{value:e,disabled:!0}))}function Zi(d){var p=d,{value:e,onChange:t,getApi:n,required:r,min:o,max:i,step:s,unit:a}=p,c=Yt(p,["value","onChange","getApi","required","min","max","step","unit"]);return n==null||n({getError(){return e==null?r?"required":!1:e<o?"too low":e>i?"too high":!1}}),u.createElement(io,Ce({type:"number",value:e==null?"":String(e),onChange(h,y){var v=y,{was:m}=v,g=Yt(v,["was"]);t(h?Number(h):null,kt(Ce({},g),{was:m?Number(m):null}))},inputProps:{min:o,max:i,step:s},InputProps:St.merge({sx:{"& input":{appearance:"textfield"}}},a&&{sx:{pr:"6px","& input":{pl:".2em",textAlign:"right"}},endAdornment:u.createElement(qa,{position:"end",sx:{mt:"1.2em",ml:"5px","& p":{fontSize:"80%"}}},a)})},c))}function Eo(c){var d=c,{label:e="",value:t,onChange:n,getApi:r,helperText:o,error:i,type:s}=d,a=Yt(d,["label","value","onChange","getApi","helperText","error","type"]);const p=()=>t!=null?t:!1,[h,m]=u.useState(p);u.useEffect(()=>m(p),[t]);const g=u.createElement(SF,kt(Ce({checked:h},a),{onChange(y){n(y.target.checked,{event:y,was:t})}}));return u.createElement(je,{ml:1,mt:1,sx:i?{color:"error.main",outlineOffset:6,outline:"1px solid"}:void 0},u.createElement(rF,Ce({label:e,control:g,labelPlacement:"end"},a.size==="small"&&{sx:{"& .MuiFormControlLabel-label":{fontSize:".9rem"}}})),o&&u.createElement(_p,{error:i},o))}var ES={},qse=ut;Object.defineProperty(ES,"__esModule",{value:!0});var dy=ES.default=void 0,Yse=qse(dt()),Qse=at(),Xse=(0,Yse.default)((0,Qse.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");dy=ES.default=Xse;var PS={},Jse=ut;Object.defineProperty(PS,"__esModule",{value:!0});var bs=PS.default=void 0,Zse=Jse(dt()),ele=at(),tle=(0,Zse.default)((0,ele.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");bs=PS.default=tle;function nle({value:e,onChange:t,keyLabel:n="key",valueLabel:r="value",keyWidth:o=5,valueWidth:i=5,actionsWidth:s=1}){const a=u.useRef(),c=u.useRef(),d={padding:".5em 1em",fontWeight:"bold"};return u.createElement(Jn,{container:!0},u.createElement(Jn,{item:!0,xs:o,sx:d},n),u.createElement(Jn,{item:!0,xs:i,sx:d},r),u.createElement(Jn,{item:!0,xs:s},u.createElement(oo,{onClick(){a.current.focus()}},u.createElement(dy))),Object.entries(e||{}).map(([p,h])=>[u.createElement(Jn,{key:"k",item:!0,xs:o},u.createElement(io,{value:p,onChange(m,v){var S=v,{was:g}=S,y=Yt(S,["was"]);const w=Ce({},e);m&&(w[m]=g!==void 0?w[g]:""),g!==void 0&&delete w[g],t(w,Ce({was:e},y))}})),u.createElement(Jn,{key:"v",item:!0,xs:i},u.createElement(io,{inputRef(m){c.current===p&&(m==null||m.focus(),c.current=null)},value:h,onChange(m,v){var S=v,{was:g}=S,y=Yt(S,["was"]);const w=Ce({},e);m?w[p]=m:delete w[p],t(w,Ce({was:e},y))}})),u.createElement(Jn,{key:"actions",item:!0,xs:s,sx:{display:"flex"}},u.createElement(oo,{onClick(m){const g=Ce({},e);delete g[p],t(g,{was:e,event:m})}},u.createElement(bs)))]),u.createElement(Jn,{item:!0,xs:o},u.createElement(io,{inputRef:a,value:"",onChange(p,h){if(p){if(h.cancel(),e&&p in e)return alert(n+" entry already present");c.current=p,t(kt(Ce({},e),{[p]:""}),kt(Ce({},h),{was:e}))}}})),u.createElement(Jn,{item:!0,xs:i},u.createElement(io,{value:"",onChange(){},disabled:!0})))}function Mp(y){var v=y,{fields:e,values:t,set:n,defaults:r,save:o,stickyBar:i,addToBar:s=[],barSx:a,formRef:c,onError:d,saveOnEnter:p,gridProps:h,formProps:m}=v,g=Yt(v,["fields","values","set","defaults","save","stickyBar","addToBar","barSx","formRef","onError","saveOnEnter","gridProps","formProps"]);const S=u.useRef(!1);u.useEffect(()=>(S.current=!0,()=>{S.current=!1}),[]);const[w,C]=u.useState({}),[x,P]=u.useState({}),_=typeof o=="function"?{onClick:o}:o,[I,k]=u.useState(0),M=u.useRef(!1),O=u.useRef("");u.useEffect(()=>void B(),[I]);const F={};return u.createElement("form",kt(Ce({ref:c&&(R=>c.current=R||void 0)},m),{onSubmit(R){R.preventDefault()},onKeyDown(R){_&&!_.disabled&&(R.ctrlKey||R.metaKey)&&R.key==="Enter"&&L()}}),u.createElement(je,Ce({display:"flex",flexDirection:"column",gap:3},g),u.createElement(Jn,Ce({container:!0,rowSpacing:3,columnSpacing:1},h),e.map((R,A)=>{if(!R)return null;if(u.isValidElement(R))return u.createElement(Jn,{key:A,item:!0,xs:12},R);const ie=R,{k:z,fromField:V=nu.identity,toField:N=nu.identity,getError:H,error:W}=ie,K=Yt(ie,["k","fromField","toField","getError","error"]);let Y=w[z]||W||x[z];if(Y===!0&&(Y="Not valid"),z){const de=R.hasOwnProperty("value")?R.value:t==null?void 0:t[z],se=Ce(Ce({},R),K);Object.assign(K,{value:N(de),error:!!(Y||W)||void 0,getApi(le){F[z]=le},onBlur(){D(z)},onKeyDown(le){p&&le.key==="Enter"&&L()},onChange(le){try{if(le=V(le),P(Ee=>kt(Ce({},Ee),{[z]:!1})),nu.isEqual(le,de))return;n(le,z),D(z)}catch(Ee){P(ye=>kt(Ce({},ye),{[z]:(Ee==null?void 0:Ee.message)||String(Ee)||!0}))}}}),Array.isArray(K.helperText)&&(K.helperText=u.createElement(u.Fragment,{},...K.helperText)),Y&&(K.helperText=K.helperText?u.createElement(u.Fragment,{},u.createElement("span",{style:{borderBottom:"1px solid"}},Y),u.createElement(je,{color:"text.primary",component:"span",display:"block"},K.helperText)):Y),K.label===void 0&&(K.label=iA(z)),nu.defaults(K,r==null?void 0:r(se))}{const re=K,{xs:de=12,sm:se,md:le,lg:Ee,xl:ye,comp:_e=io,before:ee,after:ke,fromField:Re,toField:Pe}=re,pe=Yt(re,["xs","sm","md","lg","xl","comp","before","after","fromField","toField"]);return Object.assign(pe,{name:z}),u.createElement(Jn,{key:z||A,item:!0,xs:de,sm:se,md:le,lg:Ee,xl:ye},ee,u.isValidElement(_e)?_e:u.createElement(_e,pe),ke)}})),_&&u.createElement(je,{display:"flex",alignItems:"center",sx:Object.assign({},i&&{width:"fit-content",zIndex:2,backgroundColor:"background.paper",borderRadius:1,position:"sticky",bottom:0,p:1,m:-1},a)},u.createElement(ZF,kt(Ce({variant:"contained",startIcon:u.createElement(uy),children:"Save",loading:fS(I!==0)},_),{onClick:L})),...s)));function L(){M.current=!0,D()}function D(R=""){I===0&&(O.current=R,setTimeout(()=>k(A=>A===0?1:A)))}function B(){return mt(this,null,function*(){var z,V;if(I===0)return;if(I===1)return k(2);const R="Please review errors",A={};for(const N of e){if(!N||u.isValidElement(N)||!N.k)continue;const{k:H}=N,W=t==null?void 0:t[H],K=(yield(z=F[H])==null?void 0:z.getError())||(yield(V=N.getError)==null?void 0:V.call(N,W,{values:t,fields:e}))||x[H];if(A[H]=K||!1,!M.current&&H===O.current)break;if(!S.current)return}C(A);try{if(!M.current)return;if(Object.values(A).some(Boolean))return yield d==null?void 0:d(R);const N=_&&_.onClick;N&&(yield N())}catch(N){yield d==null?void 0:d(N)}finally{M.current=!1,S.current&&k(0)}})}}function iA(e){return nu.upperFirst(e.indexOf("_")>0?e.replace(/_/g," "):e.replace(/([a-z])([A-Z])/g,(t,n,r)=>n+" "+r.toLowerCase()))}function sA(){return aF("(prefers-color-scheme: dark)")}const rle={};function ole(){const e=sA()?null:rle;return u.useMemo(()=>Ex({palette:e||{mode:"dark",text:{primary:"#bbb"},primary:{main:"#469",light:"#68c"},secondary:{main:"#969"}},typography:{fontFamily:'Roboto, "Noto sans", "Segoe UI", "San Francisco", "Helvetica Neue", Arial, sans-serif'},components:{MuiLink:{defaultProps:e||{color:"primary.light"}},MuiTextField:{defaultProps:{variant:"filled"},styleOverrides:e||{root:{"& label.Mui-focused":{color:"#ccc"}}}},MuiButton:{defaultProps:{variant:"outlined"},styleOverrides:e||{root({ownerState:t}){return t.color==="primary"&&{color:t.variant==="contained"?"#ddd":"#68c"}}}}}}),[e])}kw.Container=function(t){const n=u.useRef(),{width:r,height:o}=HF(),i=r>0&&Math.min(r,o)<500;u.useEffect(()=>{const h=setTimeout(()=>{const m=n.current;if(!m||(m.focus(),i))return;const g=m.querySelector("[autofocus]")||m.querySelector("input,textarea");g&&g instanceof HTMLElement&&g.focus()});return()=>clearTimeout(h)},[n.current]);const s=IS();t=Ce(Ce({},kw),t);const p=t.dialogProps||{},{sx:a,root:c}=p,d=Yt(p,["sx","root"]);return u.createElement(lJ,kt(Ce(Ce({open:!0,maxWidth:"lg",fullScreen:i},d),c),{onClose:()=>Bi()}),t.title&&u.createElement(CJ,{sx:Ce({position:"sticky",top:0,py:1,pr:1,zIndex:2,boxShadow:"0 0 8px #0004",display:"flex",alignItems:"center"},s)},u.createElement(je,{flex:1,minWidth:40},_w(t.title)),u.createElement(zn,{icon:Rp,title:"close",onClick:()=>Bi()})),u.createElement(gJ,{ref:n,sx:Ce({p:t.padding?1:0,pt:"16px !important",overflow:"initial",display:"flex",flexDirection:"column",justifyContent:"center"},a)},u.createElement(t.Content)))};function IS(){return sA()?{bgcolor:"#2d2d2d"}:{bgcolor:"#ccc",color:"#444"}}const lA={error:ty,warning:ny,info:tp,success:sS};function un(e,t){const n=typeof t=="string"?{type:t}:t!=null?t:{};let a=n,{type:r="info"}=a,o=Yt(a,["type"]);e instanceof Error&&(e=e.message||String(e),r="error");const i=bS(),s=Wo(kt(Ce({className:"dialog-alert-"+r,icon:"!",onClose:i.resolve},o),{Content(){var c;return u.createElement(je,{display:"flex",flexDirection:"column",alignItems:"center",gap:1},u.createElement(oo,{onClick(){s.close()},size:"small",sx:{position:"absolute",right:0,top:0,opacity:.5}},u.createElement(Rp)),(c=n.icon)!=null?c:u.createElement(lA[r],{color:r,fontSize:"large"}),u.isValidElement(e)?e:u.createElement(je,{fontSize:"large",mb:1,lineHeight:"1.8em"},String(e)))}}));return Object.assign(i,s)}function qs(e,r={}){var o=r,{href:t}=o,n=Yt(o,["href"]);const i=bS(),s=Wo(kt(Ce({className:"dialog-confirm",icon:"?",onClose:i.resolve},n),{Content:a}));return Object.assign(i,s);function a(){return u.createElement(u.Fragment,{},u.createElement(je,{mb:2},e),u.createElement(Ql,{},u.createElement("a",{href:t,onClick:()=>Bi(!0)},u.createElement(mr,{variant:"contained"},"Confirm")),u.createElement(mr,{onClick:()=>Bi(!1)},"Don't")))}}function rp(r){return mt(this,null,function*(){var o=r,{form:e,values:t}=o,n=Yt(o,["form","values"]);return new Promise(s=>Wo(kt(Ce({className:"dialog-confirm",icon:"?",onClose:s},n),{Content:i})));function i(){const[s,a]=u.useState(t||{}),h=typeof e=="function"?e(s):e,{onChange:c,before:d}=h,p=Yt(h,["onChange","before"]);return u.createElement(u.Fragment,{},d,u.createElement(Mp,kt(Ce({},p),{values:s,set(m,g){a(y=>{const v=kt(Ce({},y),{[g]:m});return c==null||c(v,{setValues:a}),v})},save:kt(Ce({},p.save),{onClick(){Bi(s)}})})))}})}function ile(n){return mt(this,arguments,function*(e,t={}){return rp(kt(Ce({},t),{form:{fields:[Ce({k:"text",label:null,autoFocus:!0,before:u.createElement(je,{mb:2},e)},t.field)],save:Ce({children:"Continue",startIcon:u.createElement(AF)},t.save),saveOnEnter:!0,barSx:{gap:2},addToBar:[u.createElement(mr,{onClick:Bi},"Cancel"),...t.addToBar||[]]}})).then(r=>r==null?void 0:r.text)})}function Wr(e,t="info"){const r=Wo({Content:i,dialogProps:{fullScreen:!1,PaperProps:{sx:{transition:"opacity 3000ms ease-in"},ref(s){s&&(s.style.opacity="0")}}}}),{close:o}=r;return setTimeout(o,3e3),r;function i(){return u.createElement(je,{display:"flex",flexDirection:"column",alignItems:"center",gap:1},u.isValidElement(t)?t:u.createElement(lA[t],{color:t}),u.isValidElement(e)?e:u.createElement("div",{},String(e)))}}function aA(){return u.createElement(Ka)}function sle(e){return e&&/^[a-zA-Z]:$/.test(e)}function kS(e,t){return e==t||e&&t&&typeof e=="object"&&typeof t=="object"&&Object.entries(e).every(([n,r])=>kS(r,t[n]))}function fy(e){return e?{outline:"2px solid"}:void 0}function zn(d){var p=d,{title:e,icon:t,onClick:n,disabled:r,progress:o,link:i,tooltipProps:s,confirm:a}=p,c=Yt(p,["title","icon","onClick","disabled","progress","link","tooltipProps","confirm"]);const[h,m]=eo(!1);typeof r=="string"&&(e=r),i&&(n=()=>window.open(i));let g=u.createElement(oo,kt(Ce({disabled:!!(h||o||r)},c),{onClick(...v){return mt(this,null,function*(){if(a&&!(yield qs(a)))return;const S=n==null?void 0:n.apply(this,v);S&&S instanceof Promise&&(m(!0),S.catch(un).finally(()=>m(!1)))})}}),u.createElement(t));return(o||h)&&o!==!1&&(g=u.createElement(je,{position:"relative",display:"inline-block"},u.createElement(Ka,kt(Ce({},typeof o=="number"?{value:o*100,variant:"determinate"}:null),{style:{position:"absolute",top:4,left:4,width:32,height:32}})),g)),e&&(g=u.createElement(nd,kt(Ce({title:e},s),{children:u.createElement("span",{},g)}))),g}function yu(d){var p=d,{icon:e,title:t,onClick:n,disabled:r,progress:o,link:i,tooltipProps:s,confirm:a}=p,c=Yt(p,["icon","title","onClick","disabled","progress","link","tooltipProps","confirm"]);const[h,m]=eo(!1);typeof r=="string"&&(t=r,r=!0),i&&(n=()=>window.open(i));let g=u.createElement(ZF,kt(Ce({variant:"contained",startIcon:u.createElement(e),loading:!!(h||o),loadingPosition:"start",loadingIndicator:typeof o!="number"?void 0:u.createElement(Ka,{size:"1rem",value:o*100,variant:"determinate"}),disabled:r},c),{onClick(...v){return mt(this,null,function*(){if(a&&!(yield qs(a)))return;const S=n==null?void 0:n.apply(this,v);S&&S instanceof Promise&&(m(!0),S.catch(un).finally(()=>m(!1)))})}}));return t&&(g=u.createElement(nd,kt(Ce({title:t},s),{children:u.createElement("span",{},g)}))),g}function xo(e,t,n){return u.createElement(nd,{title:t,children:u.createElement(e,{sx:n})})}function _S(e){return u.createElement(Mo,Ce({component:VO},e))}function py(e){return u.createElement(je,Ce({display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column"},e))}function lle(e,t){return mt(this,null,function*(){const r=(yield Et("get_config",{only:[e]}))[e],o=yield t(r);JSON.stringify(r)!==JSON.stringify(o)&&(yield Et("set_config",{values:{[e]:o}}))})}function ale(e){return Object.keys(e)}function cle(e,t){var n;return(n=t[e])!=null?n:e}function Yl(e){return aF(t=>t.breakpoints.up(e),{noSsr:!0})}function cA(e){return{ENOENT:"Not found",ENOTDIR:"Not a folder"}[e]||e}function $S(e,t){return u.createElement(zn,Ce({icon:ey,title:"Reload",onClick:e},t))}const ule=navigator.platform.match("Mac");function dle(e){return(e.ctrlKey||ule&&e.metaKey)&&e.key}function uA({icon:e,progress:t,offset:n,addTitle:r,sx:o}){return u.createElement(u.Fragment,{},u.createElement(e,{sx:{position:"absolute",ml:"4px"}}),u.createElement(Ka,{value:t*100,variant:"determinate",size:32,sx:{position:"absolute"}}),u.createElement(nd,{title:u.createElement(u.Fragment,{},ose(t),r),children:u.createElement(Ka,{color:"success",value:(n||1e-7)*100,variant:"determinate",size:32,sx:Ce({display:"flex"},o)})}))}function Ql(i){var s=i,{gap:e=".8em",vert:t=!1,children:n=null,props:r={}}=s,o=Yt(s,["gap","vert","children","props"]);return u.createElement(je,Ce({sx:Ce({display:"flex",gap:e,flexDirection:t?"column":void 0},o)},r),n)}function Ya(e,t){return Array.isArray(t)&&(t=np(t)),u.createElement(Mo,{href:Xie+e,target:"help"},t)}function dA(e,t,n,r){let o=e[t];return mS(e,()=>{const i=e[t];Object.is(o,i)||n(o=i)},r)}const fA="admin_state",pn=hS(Object.assign({title:"",config:{},selectedFiles:[],vfs:void 0,loginRequired:!1,username:"",onlinePluginsColumns:{version:!1,pushed_at:!1,license:!1}},JSON.parse(localStorage[fA]||null))),pA=["onlinePluginsColumns"],fle=St.debounce(()=>localStorage[fA]=JSON.stringify(St.pick(pn,pA)),500,{maxWait:1e3});for(const e of pA)dA(pn,e,fle);function oa(){return gS(pn)}function Oi(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(o){return"'"+o+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function zu(e){return!!e&&!!e[Do]}function Qa(e){var t;return!!e&&(function(n){if(!n||typeof n!="object")return!1;var r=Object.getPrototypeOf(n);if(r===null)return!0;var o=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return o===Object||typeof o=="function"&&Function.toString.call(o)===wle}(e)||Array.isArray(e)||!!e[cR]||!!(!((t=e.constructor)===null||t===void 0)&&t[cR])||RS(e)||MS(e))}function op(e,t,n){n===void 0&&(n=!1),od(e)===0?(n?Object.keys:AS)(e).forEach(function(r){n&&typeof r=="symbol"||t(r,e[r],e)}):e.forEach(function(r,o){return t(o,r,e)})}function od(e){var t=e[Do];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:RS(e)?2:MS(e)?3:0}function Lw(e,t){return od(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ple(e,t){return od(e)===2?e.get(t):e[t]}function hA(e,t,n){var r=od(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function hle(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function RS(e){return yle&&e instanceof Map}function MS(e){return ble&&e instanceof Set}function wa(e){return e.o||e.t}function TS(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Cle(e);delete t[Do];for(var n=AS(t),r=0;r<n.length;r++){var o=n[r],i=t[o];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function OS(e,t){return t===void 0&&(t=!1),LS(e)||zu(e)||!Qa(e)||(od(e)>1&&(e.set=e.add=e.clear=e.delete=mle),Object.freeze(e),t&&op(e,function(n,r){return OS(r,!0)},!0)),e}function mle(){Oi(2)}function LS(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function us(e){var t=xle[e];return t||Oi(18,e),t}function nR(){return ip}function V1(e,t){t&&(us("Patches"),e.u=[],e.s=[],e.v=t)}function Eg(e){Fw(e),e.p.forEach(gle),e.p=null}function Fw(e){e===ip&&(ip=e.l)}function rR(e){return ip={p:[],l:ip,h:e,m:!0,_:0}}function gle(e){var t=e[Do];t.i===0||t.i===1?t.j():t.g=!0}function U1(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||us("ES5").S(t,e,r),r?(n[Do].P&&(Eg(t),Oi(4)),Qa(e)&&(e=Pg(t,e),t.l||Ig(t,e)),t.u&&us("Patches").M(n[Do].t,e,t.u,t.s)):e=Pg(t,n,[]),Eg(t),t.u&&t.v(t.u,t.s),e!==mA?e:void 0}function Pg(e,t,n){if(LS(t))return t;var r=t[Do];if(!r)return op(t,function(a,c){return oR(e,r,t,a,c,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Ig(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=r.i===4||r.i===5?r.o=TS(r.k):r.o,i=o,s=!1;r.i===3&&(i=new Set(o),o.clear(),s=!0),op(i,function(a,c){return oR(e,r,o,a,c,n,s)}),Ig(e,o,!1),n&&e.u&&us("Patches").N(r,n,e.u,e.s)}return r.o}function oR(e,t,n,r,o,i,s){if(zu(o)){var a=Pg(e,o,i&&t&&t.i!==3&&!Lw(t.R,r)?i.concat(r):void 0);if(hA(n,r,a),!zu(a))return;e.m=!1}else s&&n.add(o);if(Qa(o)&&!LS(o)){if(!e.h.D&&e._<1)return;Pg(e,o),t&&t.A.l||Ig(e,o)}}function Ig(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&OS(t,n)}function W1(e,t){var n=e[Do];return(n?wa(n):e)[t]}function iR(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Aw(e){e.P||(e.P=!0,e.l&&Aw(e.l))}function G1(e){e.o||(e.o=TS(e.t))}function Nw(e,t,n){var r=RS(t)?us("MapSet").F(t,n):MS(t)?us("MapSet").T(t,n):e.O?function(o,i){var s=Array.isArray(o),a={i:s?1:0,A:i?i.A:nR(),P:!1,I:!1,R:{},l:i,t:o,k:null,o:null,j:null,C:!1},c=a,d=Dw;s&&(c=[a],d=lf);var p=Proxy.revocable(c,d),h=p.revoke,m=p.proxy;return a.k=m,a.j=h,m}(t,n):us("ES5").J(t,n);return(n?n.A:nR()).p.push(r),r}function vle(e){return zu(e)||Oi(22,e),function t(n){if(!Qa(n))return n;var r,o=n[Do],i=od(n);if(o){if(!o.P&&(o.i<4||!us("ES5").K(o)))return o.t;o.I=!0,r=sR(n,i),o.I=!1}else r=sR(n,i);return op(r,function(s,a){o&&ple(o.t,s)===a||hA(r,s,t(a))}),i===3?new Set(r):r}(e)}function sR(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return TS(e)}var lR,ip,FS=typeof Symbol!="undefined"&&typeof Symbol("x")=="symbol",yle=typeof Map!="undefined",ble=typeof Set!="undefined",aR=typeof Proxy!="undefined"&&Proxy.revocable!==void 0&&typeof Reflect!="undefined",mA=FS?Symbol.for("immer-nothing"):((lR={})["immer-nothing"]=!0,lR),cR=FS?Symbol.for("immer-draftable"):"__$immer_draftable",Do=FS?Symbol.for("immer-state"):"__$immer_state",wle=""+Object.prototype.constructor,AS=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Cle=Object.getOwnPropertyDescriptors||function(e){var t={};return AS(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},xle={},Dw={get:function(e,t){if(t===Do)return e;var n=wa(e);if(!Lw(n,t))return function(o,i,s){var a,c=iR(i,s);return c?"value"in c?c.value:(a=c.get)===null||a===void 0?void 0:a.call(o.k):void 0}(e,n,t);var r=n[t];return e.I||!Qa(r)?r:r===W1(e.t,t)?(G1(e),e.o[t]=Nw(e.A.h,r,e)):r},has:function(e,t){return t in wa(e)},ownKeys:function(e){return Reflect.ownKeys(wa(e))},set:function(e,t,n){var r=iR(wa(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=W1(wa(e),t),i=o==null?void 0:o[Do];if(i&&i.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(hle(n,o)&&(n!==void 0||Lw(e.t,t)))return!0;G1(e),Aw(e)}return e.o[t]===n&&(n!==void 0||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return W1(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,G1(e),Aw(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=wa(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){Oi(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Oi(12)}},lf={};op(Dw,function(e,t){lf[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),lf.deleteProperty=function(e,t){return lf.set.call(this,e,t,void 0)},lf.set=function(e,t,n){return Dw.set.call(this,e[0],t,n,e[0])};var Sle=function(){function e(n){var r=this;this.O=aR,this.D=!0,this.produce=function(o,i,s){if(typeof o=="function"&&typeof i!="function"){var a=i;i=o;var c=r;return function(v){var S=this;v===void 0&&(v=a);for(var w=arguments.length,C=Array(w>1?w-1:0),x=1;x<w;x++)C[x-1]=arguments[x];return c.produce(v,function(P){var _;return(_=i).call.apply(_,[S,P].concat(C))})}}var d;if(typeof i!="function"&&Oi(6),s!==void 0&&typeof s!="function"&&Oi(7),Qa(o)){var p=rR(r),h=Nw(r,o,void 0),m=!0;try{d=i(h),m=!1}finally{m?Eg(p):Fw(p)}return typeof Promise!="undefined"&&d instanceof Promise?d.then(function(v){return V1(p,s),U1(v,p)},function(v){throw Eg(p),v}):(V1(p,s),U1(d,p))}if(!o||typeof o!="object"){if((d=i(o))===void 0&&(d=o),d===mA&&(d=void 0),r.D&&OS(d,!0),s){var g=[],y=[];us("Patches").M(o,d,g,y),s(g,y)}return d}Oi(21,o)},this.produceWithPatches=function(o,i){if(typeof o=="function")return function(d){for(var p=arguments.length,h=Array(p>1?p-1:0),m=1;m<p;m++)h[m-1]=arguments[m];return r.produceWithPatches(d,function(g){return o.apply(void 0,[g].concat(h))})};var s,a,c=r.produce(o,i,function(d,p){s=d,a=p});return typeof Promise!="undefined"&&c instanceof Promise?c.then(function(d){return[d,s,a]}):[c,s,a]},typeof(n==null?void 0:n.useProxies)=="boolean"&&this.setUseProxies(n.useProxies),typeof(n==null?void 0:n.autoFreeze)=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var t=e.prototype;return t.createDraft=function(n){Qa(n)||Oi(8),zu(n)&&(n=vle(n));var r=rR(this),o=Nw(this,n,void 0);return o[Do].C=!0,Fw(r),o},t.finishDraft=function(n,r){var o=n&&n[Do],i=o.A;return V1(i,r),U1(void 0,i)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!aR&&Oi(20),this.O=n},t.applyPatches=function(n,r){var o;for(o=r.length-1;o>=0;o--){var i=r[o];if(i.path.length===0&&i.op==="replace"){n=i.value;break}}o>-1&&(r=r.slice(o+1));var s=us("Patches").$;return zu(n)?s(n,r):this.produce(n,function(a){return s(a,r)})},e}(),Bo=new Sle,Ele=Bo.produce;Bo.produceWithPatches.bind(Bo);Bo.setAutoFreeze.bind(Bo);Bo.setUseProxies.bind(Bo);Bo.applyPatches.bind(Bo);Bo.createDraft.bind(Bo);Bo.finishDraft.bind(Bo);const Ple=Ele;mie({onResponse(e,t){return mt(this,null,function*(){if(e.status===401)throw pn.loginRequired=(t==null?void 0:t.any)!==!1||403,new DF(e.status,"Unauthorized")})}});function Lo(...e){const[t,n,r]=ry(...e),o=e[0],i=t===void 0,s=u.useMemo(()=>o?n?u.createElement(Uo,{severity:"error"},String(n),u.createElement(zn,{icon:ey,onClick:r,sx:{m:"-8px 0 -8px 16px"}})):i?aA():null:null,[n,o,i,r]);return{data:t,error:n,reload:r,loading:i,element:s}}function sc(e,t={},{map:n=r=>r}={}){const[r,o]=eo([]),[i,s]=eo(void 0),[a,c]=eo(void 0),[d,p]=eo(!0),[h,m]=eo(!1),[g,y]=eo(!0),[v,S]=u.useState(0),w=u.useRef(0);return u.useEffect(()=>{if(!e)return;const _=[],I=St.debounce(()=>{const O=_.splice(0,1/0);O.length&&o(F=>[...F,...O])},1e3,{maxWait:1e3});c(void 0),m(!0),p(!0),y(!0),o([]);const k=BF(e,t,(O,F)=>{switch(O){case"connected":return p(!1),setTimeout(()=>I.flush());case"error":return c("Connection error"),setTimeout(C,1e3),M();case"closed":return M();case"msg":const L=[],D=[];ise(F).forEach(B=>{var z;if(!Array.isArray(B))return console.debug("illegal list packet",B);const[R,A]=B;if(R==="ready"){I.flush(),y(!1);return}if(R==="error"){A===401?pn.loginRequired=B[2].any!==!1||403:c(cA(A));return}if(R==="props")return s(A);if(R==="add"){const V=n(A);(z=V.id)!=null||(V.id=w.current=Math.max(w.current,Date.now())+.001),_.push(V),I();return}if(R==="remove"){const V=St.matches(A);St.isEmpty(St.remove(_,V))&&L.push(V);return}if(R==="update"){const V=B[2],N=St.find(_,A);if(N)return Object.assign(N,V);D.push([A,V]);return}console.debug("unknown list api",R)}),o(B=>{let R=B,A;if(L.length&&(A=B.filter(z=>!L.some(V=>V(z))),A.length<B.length&&(R=A)),D.length)for(const[z,V]of D){const N=St.findIndex(R,z);N<0||(R===B&&(R=A!=null?A:B.slice()),R[N]=Ce(Ce({},R[N]),V))}return R}),(k==null?void 0:k.readyState)===(k==null?void 0:k.CLOSED)&&M()}});return()=>k.close();function M(){y(!1),m(!1),I.flush()}},[v,e,JSON.stringify(t)]),{list:r,props:i,loading:h,error:a,initializing:g,connecting:d,setList:o,updateList:x,updateEntry:P,reload:C};function C(){S(_=>_+1)}function x(_){o(Ple(r,I=>{_(I)}))}function P(_,I){x(k=>{const M=St.find(k,_);M&&Object.assign(M,I)})}}var NS={},Ile=ut;Object.defineProperty(NS,"__esModule",{value:!0});var gA=NS.default=void 0,kle=Ile(dt()),_le=at(),$le=(0,kle.default)((0,_le.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-1 14H9V8h2v8zm4 0h-2V8h2v8z"}),"PauseCircle");gA=NS.default=$le;var DS={},Rle=ut;Object.defineProperty(DS,"__esModule",{value:!0});var hy=DS.default=void 0,Mle=Rle(dt()),Tle=at(),Ole=(0,Mle.default)((0,Tle.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM9.5 16.5v-9l7 4.5-7 4.5z"}),"PlayCircle");hy=DS.default=Ole;var BS={},Lle=ut;Object.defineProperty(BS,"__esModule",{value:!0});var vA=BS.default=void 0,Fle=Lle(dt()),Ale=at(),Nle=(0,Fle.default)((0,Ale.jsx)("path",{d:"M17 7h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.43-.98 2.63-2.31 2.98l1.46 1.46C20.88 15.61 22 13.95 22 12c0-2.76-2.24-5-5-5zm-1 4h-2.19l2 2H16zM2 4.27l3.11 3.11C3.29 8.12 2 9.91 2 12c0 2.76 2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1 0-1.59 1.21-2.9 2.76-3.07L8.73 11H8v2h2.73L13 15.27V17h1.73l4.01 4L20 19.74 3.27 3 2 4.27z"}),"LinkOff");vA=BS.default=Nle;var zS={},Dle=ut;Object.defineProperty(zS,"__esModule",{value:!0});var jS=zS.default=void 0,Ble=Dle(dt()),zle=at(),jle=(0,Ble.default)((0,zle.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"}),"Lock");jS=zS.default=jle;var HS={},Hle=ut;Object.defineProperty(HS,"__esModule",{value:!0});var yA=HS.default=void 0,Vle=Hle(dt()),Ule=at(),Wle=(0,Vle.default)((0,Ule.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12zm8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8z"}),"Block");yA=HS.default=Wle;var VS={},Gle=ut;Object.defineProperty(VS,"__esModule",{value:!0});var bA=VS.default=void 0,Kle=Gle(dt()),qle=at(),Yle=(0,Kle.default)((0,qle.jsx)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-2 6h-2v2h2v2h-2v2h-2v-2h2v-2h-2v-2h2v-2h-2V8h2v2h2v2z"}),"FolderZip");bA=VS.default=Yle;var US={},Qle=ut;Object.defineProperty(US,"__esModule",{value:!0});var Tp=US.default=void 0,Xle=Qle(dt()),Jle=at(),Zle=(0,Xle.default)((0,Jle.jsx)("path",{d:"M5 20h14v-2H5v2zm0-10h4v6h6v-6h4l-7-7-7 7z"}),"Upload");Tp=US.default=Zle;var WS={},eae=ut;Object.defineProperty(WS,"__esModule",{value:!0});var GS=WS.default=void 0,tae=eae(dt()),nae=at(),rae=(0,tae.default)((0,nae.jsx)("path",{d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"}),"Download");GS=WS.default=rae;const wA=u.createContext(void 0);function Dt(){const e=u.useContext(wA);if(e===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(`
|
|
328
|
-
`));return e}const
|
|
329
|
-
`));return e}const uR={};function
|
|
330
|
-
`):e;return()=>{n||(n=!0,t==="error"?console.error(r):console.warn(r))}},aae=Object.is;function SA(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,r=0;for(const o in e)if(n+=1,!aae(e[o],t[o])||!(o in t))return!1;for(const o in t)r+=1;return n===r}ws(["MUI: `useGridSelector` has been called before the initialization of the state.","This hook can only be used inside the context of the grid."]);function cae(e){return e.acceptsApiRef}function dR(e,t){return cae(t)?t(e):t(e.current.state)}const uae=Object.is,KS=SA,dae=()=>({state:null,equals:null,selector:null}),Ge=(e,t,n=uae)=>{const r=iae(dae),o=r.current.selector!==null,[i,s]=u.useState(o?null:dR(e,t));return r.current.state=i,r.current.equals=n,r.current.selector=t,lae(()=>e.current.store.subscribe(()=>{const a=dR(e,r.current.selector);r.current.equals(r.current.state,a)||(r.current.state=a,s(a))})),i};function Bt(e){return Je("MuiDataGrid",e)}const X=Xe("MuiDataGrid",["actionsCell","aggregationColumnHeader","aggregationColumnHeader--alignLeft","aggregationColumnHeader--alignCenter","aggregationColumnHeader--alignRight","aggregationColumnHeaderLabel","autoHeight","booleanCell","cell--editable","cell--editing","cell--textCenter","cell--textLeft","cell--textRight","cell--withRenderer","cell--rangeTop","cell--rangeBottom","cell--rangeLeft","cell--rangeRight","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","filterFormLogicOperatorInput","filterFormColumnInput","filterFormOperatorInput","filterFormValueInput","filterIcon","footerContainer","headerFilterRow","iconButtonContainer","iconSeparator","main","menu","menuIcon","menuIconButton","menuOpen","menuList","overlay","overlayWrapper","overlayWrapperInner","root","root--densityStandard","root--densityComfortable","root--densityCompact","root--disableUserSelection","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","withBorderColor","cell--withRightBorder","columnHeader--withRightBorder","treeDataGroupingCell","treeDataGroupingCellToggle","groupingCriteriaCell","groupingCriteriaCellToggle","pinnedRows","pinnedRows--top","pinnedRows--bottom","pinnedRowsRenderZone"]),fae=e=>{const{classes:t}=e;return Me({root:["main"]},Bt,t)},pae=vr("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(e,t)=>t.main})(()=>({position:"relative",flexGrow:1,display:"flex",flexDirection:"column",overflow:"hidden"})),hae=u.forwardRef((e,t)=>{const n=tt(),r=fae(n);return T.jsx(pae,{ref:t,className:r.root,ownerState:n,children:e.children})});var kg="NOT_FOUND";function mae(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:kg},put:function(r,o){t={key:r,value:o}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function gae(e,t){var n=[];function r(a){var c=n.findIndex(function(p){return t(a,p.key)});if(c>-1){var d=n[c];return c>0&&(n.splice(c,1),n.unshift(d)),d.value}return kg}function o(a,c){r(a)===kg&&(n.unshift({key:a,value:c}),n.length>e&&n.pop())}function i(){return n}function s(){n=[]}return{get:r,put:o,getEntries:i,clear:s}}var vae=function(t,n){return t===n};function yae(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var o=n.length,i=0;i<o;i++)if(!e(n[i],r[i]))return!1;return!0}}function qS(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,o=r===void 0?vae:r,i=n.maxSize,s=i===void 0?1:i,a=n.resultEqualityCheck,c=yae(o),d=s===1?mae(c):gae(s,c);function p(){var h=d.get(arguments);if(h===kg){if(h=e.apply(null,arguments),a){var m=d.getEntries(),g=m.find(function(y){return a(y.value,h)});g&&(h=g.value)}d.put(arguments,h)}return h}return p.clearCache=function(){return d.clear()},p}function bae(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(r){return typeof r=="function"})){var n=t.map(function(r){return typeof r=="function"?"function "+(r.name||"unnamed")+"()":typeof r}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function wae(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=function(){for(var s=arguments.length,a=new Array(s),c=0;c<s;c++)a[c]=arguments[c];var d=0,p,h={memoizeOptions:void 0},m=a.pop();if(typeof m=="object"&&(h=m,m=a.pop()),typeof m!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof m+"]");var g=h,y=g.memoizeOptions,v=y===void 0?n:y,S=Array.isArray(v)?v:[v],w=bae(a),C=e.apply(void 0,[function(){return d++,m.apply(null,arguments)}].concat(S)),x=e(function(){for(var _=[],I=w.length,k=0;k<I;k++)_.push(w[k].apply(null,arguments));return p=C.apply(null,_),p});return Object.assign(x,{resultFunc:m,memoizedResultFunc:C,dependencies:w,lastResult:function(){return p},recomputations:function(){return d},resetRecomputations:function(){return d=0}}),x};return o}var Cae=wae(qS);const xae={cache:new WeakMap};ws(["MUI: A selector was called without passing the instance ID, which may impact the performance of the grid.","To fix, call it with `apiRef`, e.g. `mySelector(apiRef)`, or pass the instance ID explicitly, e.g `mySelector(state, apiRef.current.instanceId)`."]);function jc(e){return"current"in e&&"instanceId"in e.current}const Hc={id:"default"},Tt=(e,t,n,r,o,i,...s)=>{if(s.length>0)throw new Error("Unsupported number of selectors");let a;if(e&&t&&n&&r&&o&&i)a=(c,d)=>{const p=jc(c),h=d!=null?d:p?c.current.instanceId:Hc,m=p?c.current.state:c,g=e(m,h),y=t(m,h),v=n(m,h),S=r(m,h),w=o(m,h);return i(g,y,v,S,w)};else if(e&&t&&n&&r&&o)a=(c,d)=>{const p=jc(c),h=d!=null?d:p?c.current.instanceId:Hc,m=p?c.current.state:c,g=e(m,h),y=t(m,h),v=n(m,h),S=r(m,h);return o(g,y,v,S)};else if(e&&t&&n&&r)a=(c,d)=>{const p=jc(c),h=d!=null?d:p?c.current.instanceId:Hc,m=p?c.current.state:c,g=e(m,h),y=t(m,h),v=n(m,h);return r(g,y,v)};else if(e&&t&&n)a=(c,d)=>{const p=jc(c),h=d!=null?d:p?c.current.instanceId:Hc,m=p?c.current.state:c,g=e(m,h),y=t(m,h);return n(g,y)};else if(e&&t)a=(c,d)=>{const p=jc(c),h=d!=null?d:p?c.current.instanceId:Hc,m=p?c.current.state:c,g=e(m,h);return t(g)};else throw new Error("Missing arguments");return a.acceptsApiRef=!0,a},In=(...e)=>{const t=(...n)=>{var r,o;const[i,s]=n,a=jc(i),c=a?i.current.instanceId:s!=null?s:Hc,d=a?i.current.state:i,{cache:p}=xae;if(p.get(c)&&(r=p.get(c))!=null&&r.get(e)){var h;return(h=p.get(c))==null?void 0:h.get(e)(d,c)}const m=Cae(...e);return p.get(c)||p.set(c,new Map),(o=p.get(c))==null||o.set(e,m),m(d,c)};return t.acceptsApiRef=!0,t},ju=e=>e.columns,zs=Tt(ju,e=>e.orderedFields),id=Tt(ju,e=>e.lookup),ds=In(zs,id,(e,t)=>e.map(n=>t[n])),Li=Tt(ju,e=>e.columnVisibilityModel),Or=In(ds,Li,(e,t)=>e.filter(n=>t[n.field]!==!1)),my=In(Or,e=>e.map(t=>t.field)),Hu=In(Or,e=>{const t=[];let n=0;for(let r=0;r<e.length;r+=1)t.push(n),n+=e[r].computedWidth;return t}),YS=Tt(Or,Hu,(e,t)=>{const n=e.length;return n===0?0:t[n-1]+e[n-1].computedWidth}),EA=In(ds,e=>e.filter(t=>t.filterable)),Sae=In(ds,e=>e.reduce((t,n)=>(n.filterable&&(t[n.field]=n),t),{})),zi=e=>e.rows,gy=Tt(zi,e=>e.totalRowCount),Eae=Tt(zi,e=>e.loading),Pae=Tt(zi,e=>e.totalTopLevelRowCount),_l=Tt(zi,e=>e.dataRowIdToModelLookup),_g=Tt(zi,e=>e.dataRowIdToIdLookup),Ti=Tt(zi,e=>e.tree),Iae=Tt(zi,e=>e.groupingName),fR=Tt(zi,e=>e.treeDepths),vy=In(zi,e=>{const t=Object.entries(e.treeDepths);return t.length===0?1:t.filter(([,n])=>n>0).map(([n])=>Number(n)).sort((n,r)=>r-n)[0]+1}),sm=Tt(zi,e=>e.dataRowIds),kae=Tt(zi,e=>e==null?void 0:e.additionalRowGroups),sd=In(kae,e=>{var t,n;const r=e==null?void 0:e.pinnedRows;return{bottom:r==null||(t=r.bottom)==null?void 0:t.map(o=>{var i;return{id:o.id,model:(i=o.model)!=null?i:{}}}),top:r==null||(n=r.top)==null?void 0:n.map(o=>{var i;return{id:o.id,model:(i=o.model)!=null?i:{}}})}}),_ae=Tt(sd,e=>{var t,n;return((e==null||(t=e.top)==null?void 0:t.length)||0)+((e==null||(n=e.bottom)==null?void 0:n.length)||0)}),PA=e=>e.sorting,QS=Tt(PA,e=>e.sortedRows),XS=In(QS,_l,(e,t)=>e.map(n=>{var r;return{id:n,model:(r=t[n])!=null?r:{}}})),ni=Tt(PA,e=>e.sortModel),$ae=In(ni,e=>e.reduce((n,r,o)=>(n[r.field]={sortDirection:r.sort,sortIndex:e.length>1?o+1:void 0},n),{})),JS=e=>e.filter,Cr=Tt(JS,e=>e.filterModel);Tt(Cr,e=>e.quickFilterValues);const Rae=e=>e.visibleRowsLookup,IA=Tt(JS,e=>e.filteredRowsLookup);Tt(JS,e=>e.filteredDescendantCountLookup);const ia=In(Rae,XS,(e,t)=>t.filter(n=>e[n.id]!==!1)),If=In(ia,e=>e.map(t=>t.id)),Mae=In(IA,XS,(e,t)=>t.filter(n=>e[n.id]!==!1)),Tae=In(Mae,e=>e.map(t=>t.id)),kA=In(ia,Ti,vy,(e,t,n)=>n<2?e:e.filter(r=>{var o;return((o=t[r.id])==null?void 0:o.depth)===0})),_A=Tt(ia,e=>e.length),yy=Tt(kA,e=>e.length),Oae=In(Cr,id,(e,t)=>{var n;return(n=e.items)==null?void 0:n.filter(r=>{var o,i;if(!r.field)return!1;const s=t[r.field];if(!(s!=null&&s.filterOperators)||(s==null||(o=s.filterOperators)==null?void 0:o.length)===0)return!1;const a=s.filterOperators.find(c=>c.value===r.operator);return a?!a.InputComponent||r.value!=null&&((i=r.value)==null?void 0:i.toString())!=="":!1})}),Lae=In(Oae,e=>e.reduce((n,r)=>(n[r.field]?n[r.field].push(r):n[r.field]=[r],n),{})),by=e=>e.focus,ii=Tt(by,e=>e.cell),Fae=Tt(by,e=>e.columnHeader);Tt(by,e=>e.columnHeaderFilter);const $g=Tt(by,e=>e.columnGroupHeader),wy=e=>e.tabIndex,Rg=Tt(wy,e=>e.cell),$A=Tt(wy,e=>e.columnHeader);Tt(wy,e=>e.columnHeaderFilter);const Aae=Tt(wy,e=>e.columnGroupHeader),ZS=e=>e.density,Nae=Tt(ZS,e=>e.value),ld=Tt(ZS,e=>e.factor),Cy=e=>e.columnGrouping,Dae=In(Cy,e=>{var t;return(t=e==null?void 0:e.unwrappedGroupingModel)!=null?t:{}}),RA=In(Cy,e=>{var t;return(t=e==null?void 0:e.lookup)!=null?t:{}}),Bae=In(Cy,e=>{var t;return(t=e==null?void 0:e.headerStructure)!=null?t:[]}),Op=Tt(Cy,e=>{var t;return(t=e==null?void 0:e.maxDepth)!=null?t:0}),Bw=e=>e.columnMenu;function zae(e){const{VirtualScrollerComponent:t,ColumnHeadersProps:n,children:r}=e,o=lc(),i=tt(),s=u.useRef(null),a=Ge(o,Or),c=Ge(o,Lae),d=Ge(o,$ae),p=Ge(o,Hu),h=Ge(o,$A),m=Ge(o,Rg),g=Ge(o,Aae),y=Ge(o,Fae),v=Ge(o,$g),S=Ge(o,ld),w=Ge(o,Op),C=Ge(o,Bw),x=Ge(o,Li),P=Ge(o,Bae),_=!(g===null&&h===null&&m===null),[I,k]=u.useState(i.disableVirtualization);ln(()=>{o.current.computeSizeAndPublishResizeEvent();const R=s.current;if(typeof ResizeObserver=="undefined")return()=>{};let A;const z=new ResizeObserver(()=>{A=window.requestAnimationFrame(()=>{o.current.computeSizeAndPublishResizeEvent()})});return R&&z.observe(R),()=>{A&&window.cancelAnimationFrame(A),R&&z.unobserve(R)}},[o]);const M=u.useCallback(()=>{k(!0)},[]),O=u.useCallback(()=>{k(!1)},[]);u.useEffect(()=>{k(i.disableVirtualization)},[i.disableVirtualization]),o.current.unstable_disableVirtualization=M,o.current.unstable_enableVirtualization=O;const F=u.useRef(null),L=u.useRef(null),D=u.useRef(null);o.current.register("private",{columnHeadersContainerElementRef:L,columnHeadersElementRef:F,virtualScrollerRef:D,mainElementRef:s});const B=!!o.current.getRootDimensions();return T.jsxs(hae,{ref:s,children:[T.jsx(i.slots.columnHeaders,E({ref:L,innerRef:F,visibleColumns:a,filterColumnLookup:c,sortColumnLookup:d,columnPositions:p,columnHeaderTabIndexState:h,columnGroupHeaderTabIndexState:g,columnHeaderFocus:y,columnGroupHeaderFocus:v,densityFactor:S,headerGroupingMaxDepth:w,columnMenuState:C,columnVisibility:x,columnGroupsHeaderStructure:P,hasOtherElementInTabSequence:_},n)),B&&T.jsx(t,{ref:D,disableVirtualization:I}),r]})}function jae(){var e;const t=tt();return t.hideFooter?null:T.jsx(t.slots.footer,E({},(e=t.slotProps)==null?void 0:e.footer))}const Vr="auto-generated-group-node-root",Mm=Symbol("mui.id_autogenerated"),Hae=()=>({type:"group",id:Vr,depth:-1,groupingField:null,groupingKey:null,isAutoGenerated:!0,children:[],childrenFromPath:{},childrenExpanded:!0,parent:null});function Vae(e,t,n="A row was provided without id in the rows prop:"){if(e==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(t)].join(`
|
|
331
|
-
`))}const Mg=(e,t,n)=>{const r=t?t(e):e.id;return Vae(r,e,n),r},Tm=({rows:e,getRowId:t,loading:n,rowCount:r})=>{const o={type:"full",rows:[]},i={},s={};for(let a=0;a<e.length;a+=1){const c=e[a],d=Mg(c,t);i[d]=c,s[d]=d,o.rows.push(d)}return{rowsBeforePartialUpdates:e,loadingPropBeforePartialUpdates:n,rowCountPropBeforePartialUpdates:r,updates:o,dataRowIdToIdLookup:s,dataRowIdToModelLookup:i}},MA=({tree:e,rowCountProp:t=0})=>{const n=e[Vr];return Math.max(t,n.children.length+(n.footerId==null?0:1))},TA=({apiRef:e,rowCountProp:t=0,loadingProp:n,previousTree:r,previousTreeDepths:o})=>{const i=e.current.caches.rows,{tree:s,treeDepths:a,dataRowIds:c,groupingName:d}=e.current.applyStrategyProcessor("rowTreeCreation",{previousTree:r,previousTreeDepths:o,updates:i.updates,dataRowIdToIdLookup:i.dataRowIdToIdLookup,dataRowIdToModelLookup:i.dataRowIdToModelLookup}),p=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:s,treeDepths:a,dataRowIdToIdLookup:i.dataRowIdToIdLookup,dataRowIds:c,dataRowIdToModelLookup:i.dataRowIdToModelLookup});return e.current.caches.rows.updates={type:"partial",actions:{insert:[],modify:[],remove:[]},idToActionLookup:{}},E({},p,{totalRowCount:Math.max(t,p.dataRowIds.length),totalTopLevelRowCount:MA({tree:p.tree,rowCountProp:t}),groupingName:d,loading:n})},sp=e=>e.type==="skeletonRow"||e.type==="footer"||e.type==="group"&&e.isAutoGenerated||e.type==="pinnedRow"&&e.isAutoGenerated,eE=(e,t,n)=>{const r=e[t];if(r.type!=="group")return[];const o=[];for(let i=0;i<r.children.length;i+=1){const s=r.children[i];(!n||!sp(e[s]))&&o.push(s),o.push(...eE(e,s,n))}return!n&&r.footerId!=null&&o.push(r.footerId),o},Uae=({previousCache:e,getRowId:t,updates:n})=>{var r,o,i;if(e.updates.type==="full")throw new Error("MUI: Unable to prepare a partial update if a full update is not applied yet");const s=new Map;n.forEach(m=>{const g=Mg(m,t,"A row was provided without id when calling updateRows():");s.has(g)?s.set(g,E({},s.get(g),m)):s.set(g,m)});const a={type:"partial",actions:{insert:[...(r=e.updates.actions.insert)!=null?r:[]],modify:[...(o=e.updates.actions.modify)!=null?o:[]],remove:[...(i=e.updates.actions.remove)!=null?i:[]]},idToActionLookup:E({},e.updates.idToActionLookup)},c=E({},e.dataRowIdToModelLookup),d=E({},e.dataRowIdToIdLookup),p={insert:{},modify:{},remove:{}};s.forEach((m,g)=>{const y=a.idToActionLookup[g];if(m._action==="delete"){if(y==="remove"||!c[g])return;y!=null&&(p[y][g]=!0),a.actions.remove.push(g),delete c[g],delete d[g];return}const v=c[g];if(v){y==="remove"?(p.remove[g]=!0,a.actions.modify.push(g)):y==null&&a.actions.modify.push(g),c[g]=E({},v,m);return}y==="remove"?(p.remove[g]=!0,a.actions.insert.push(g)):y==null&&a.actions.insert.push(g),c[g]=m,d[g]=g});const h=Object.keys(p);for(let m=0;m<h.length;m+=1){const g=h[m],y=p[g];Object.keys(y).length>0&&(a.actions[g]=a.actions[g].filter(v=>!y[v]))}return{dataRowIdToModelLookup:c,dataRowIdToIdLookup:d,updates:a,rowsBeforePartialUpdates:e.rowsBeforePartialUpdates,loadingPropBeforePartialUpdates:e.loadingPropBeforePartialUpdates,rowCountPropBeforePartialUpdates:e.rowCountPropBeforePartialUpdates}};function OA(e){var t,n;const r=sd(e),o=(r==null||(t=r.top)==null?void 0:t.reduce((s,a)=>(s+=e.current.unstable_getRowHeight(a.id),s),0))||0,i=(r==null||(n=r.bottom)==null?void 0:n.reduce((s,a)=>(s+=e.current.unstable_getRowHeight(a.id),s),0))||0;return{top:o,bottom:i}}function LA(e,t){const n=ld(e);return 2*Math.floor(t*n)}const Wae=vr("div",{name:"MuiDataGrid",slot:"OverlayWrapper",overridesResolver:(e,t)=>t.overlayWrapper})({position:"sticky",top:0,left:0,width:0,height:0,zIndex:4}),Gae=vr("div",{name:"MuiDataGrid",slot:"OverlayWrapperInner",overridesResolver:(e,t)=>t.overlayWrapperInner})({}),Kae=e=>{const{classes:t}=e;return Me({root:["overlayWrapper"],inner:["overlayWrapperInner"]},Bt,t)};function qae(e){var t,n;const r=Dt(),o=tt(),[i,s]=u.useState(()=>{var p,h;return(p=(h=r.current.getRootDimensions())==null?void 0:h.viewportInnerSize)!=null?p:null}),a=u.useCallback(()=>{var p,h;s((p=(h=r.current.getRootDimensions())==null?void 0:h.viewportInnerSize)!=null?p:null)},[r]);ln(()=>r.current.subscribeEvent("viewportInnerSizeChange",a),[r,a]);let c=(t=i==null?void 0:i.height)!=null?t:0;o.autoHeight&&c===0&&(c=LA(r,o.rowHeight));const d=Kae(E({},e,{classes:o.classes}));return i?T.jsx(Wae,{className:he(d.root),children:T.jsx(Gae,E({className:he(d.inner),style:{height:c,width:(n=i==null?void 0:i.width)!=null?n:0}},e))}):null}function Yae(){const e=Dt(),t=tt(),n=Ge(e,gy),r=Ge(e,_A),o=Ge(e,Eae),i=!o&&n===0,s=!o&&n>0&&r===0;let a=null;if(i){var c;a=T.jsx(t.slots.noRowsOverlay,E({},(c=t.slotProps)==null?void 0:c.noRowsOverlay))}if(s){var d;a=T.jsx(t.slots.noResultsOverlay,E({},(d=t.slotProps)==null?void 0:d.noResultsOverlay))}if(o){var p;a=T.jsx(t.slots.loadingOverlay,E({},(p=t.slotProps)==null?void 0:p.loadingOverlay))}return a===null?null:T.jsx(qae,{children:a})}function xy(e){return u.memo(e,SA)}let K1;function Qae(){return K1===void 0&&document.createElement("div").focus({get preventScroll(){return K1=!0,!1}}),K1}var vs=function(e){return e.Cell="cell",e.Row="row",e}(vs||{}),rn=function(e){return e.Edit="edit",e.View="view",e}(rn||{}),mn=function(e){return e.Edit="edit",e.View="view",e}(mn||{}),no=function(e){return e.And="and",e.Or="or",e}(no||{}),pl=function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e}(pl||{}),$i=function(e){return e.cellFocusOut="cellFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e}($i||{}),hl=function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e}(hl||{}),Os=function(e){return e.rowFocusOut="rowFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e}(Os||{});function FA(e){return e.field!==void 0}function Xae(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function Jae(e,t){return e.closest(`.${t}`)}function tE(e){return e.replace(/["\\]/g,"\\$&")}function Zae(e,t){return e.querySelector(`[role="columnheader"][data-field="${tE(t)}"]`)}function AA(e){return`.${X.row}[data-id="${tE(String(e))}"]`}function ece(e,t){return e.querySelector(AA(t))}function tce(e,{id:t,field:n}){const r=AA(t),o=`.${X.cell}[data-field="${tE(n)}"]`,i=`${r} ${o}`;return e.querySelector(i)}function Ft(e,t,n){const r=u.useRef(!0);u.useEffect(()=>{r.current=!1,e.current.register(n,t)},[e,n,t]),r.current&&e.current.register(n,t)}class ru extends Error{}function nce(e,t){const{getRowId:n}=t,r=u.useCallback(y=>({field:y,colDef:e.current.getColumn(y)}),[e]),o=u.useCallback(y=>{const v=e.current.getRow(y);if(!v)throw new ru(`No row with id #${y} found`);return{id:y,columns:e.current.getAllColumns(),row:v}},[e]),i=u.useCallback((y,v)=>{const S=e.current.getRow(y),w=e.current.getRowNode(y);if(!S||!w)throw new ru(`No row with id #${y} found`);const C=ii(e),x=Rg(e);return{id:y,field:v,row:S,rowNode:w,value:S[v],colDef:e.current.getColumn(v),cellMode:e.current.getCellMode(y,v),api:e.current,hasFocus:C!==null&&C.field===v&&C.id===y,tabIndex:x&&x.field===v&&x.id===y?0:-1}},[e]),s=u.useCallback((y,v)=>{const S=e.current.getColumn(v),w=e.current.getCellValue(y,v),C=e.current.getRow(y),x=e.current.getRowNode(y);if(!C||!x)throw new ru(`No row with id #${y} found`);const P=ii(e),_=Rg(e),I={id:y,field:v,row:C,rowNode:x,colDef:S,cellMode:e.current.getCellMode(y,v),hasFocus:P!==null&&P.field===v&&P.id===y,tabIndex:_&&_.field===v&&_.id===y?0:-1,value:w,formattedValue:w,isEditable:!1};return S&&S.valueFormatter&&(I.formattedValue=S.valueFormatter({id:y,field:I.field,value:I.value,api:e.current})),I.isEditable=S&&e.current.isCellEditable(I),I},[e]),a=u.useCallback((y,v)=>{const S=e.current.getColumn(v);if(!S||!S.valueGetter){const w=e.current.getRow(y);if(!w)throw new ru(`No row with id #${y} found`);return w[v]}return S.valueGetter(i(y,v))},[e,i]),c=u.useCallback((y,v)=>{var S;const w=Mm in y?y[Mm]:(S=n==null?void 0:n(y))!=null?S:y.id,C=v.field;return!v||!v.valueGetter?y[C]:v.valueGetter(i(w,C))},[i,n]),d=u.useCallback((y,v)=>{var S;const w=c(y,v);if(!v||!v.valueFormatter)return w;const C=(S=n?n(y):y.id)!=null?S:y[Mm],x=v.field;return v.valueFormatter({id:C,field:x,value:w,api:e.current})},[e,n,c]),p=u.useCallback(y=>e.current.rootElementRef.current?Zae(e.current.rootElementRef.current,y):null,[e]),h=u.useCallback(y=>e.current.rootElementRef.current?ece(e.current.rootElementRef.current,y):null,[e]),m=u.useCallback((y,v)=>e.current.rootElementRef.current?tce(e.current.rootElementRef.current,{id:y,field:v}):null,[e]);Ft(e,{getCellValue:a,getCellParams:s,getCellElement:m,getRowValue:c,getRowFormattedValue:d,getRowParams:o,getRowElement:h,getColumnHeaderParams:r,getColumnHeaderElement:p},"public")}const rce=["changeReason","unstable_updateValueOnRender"],oce=["column","rowId","editCellState","align","children","colIndex","height","width","className","showRightBorder","extendRowFullWidth","row","colSpan","disableDragEvents","onClick","onDoubleClick","onMouseDown","onMouseUp","onMouseOver","onKeyDown","onKeyUp","onDragEnter","onDragOver"],ice=["changeReason","unstable_updateValueOnRender"],Tg={id:-1,field:"__unset__",row:{},rowNode:{id:-1,depth:0,type:"leaf",parent:-1,groupingKey:null},colDef:{type:"string",field:"__unset__",computedWidth:0},cellMode:rn.View,hasFocus:!1,tabIndex:-1,value:null,formattedValue:"__unset__",isEditable:!1,api:{}},sce=e=>{const{align:t,showRightBorder:n,isEditable:r,isSelected:o,classes:i}=e,s={root:["cell",`cell--text${ue(t)}`,r&&"cell--editable",o&&"selected",n&&"cell--withRightBorder","withBorderColor"],content:["cellContent"]};return Me(s,Bt,i)},lce=u.forwardRef((e,t)=>{const{column:n,rowId:r,editCellState:o}=e,i=Dt(),s=tt(),a=n.field,c=Ge(i,()=>{try{const O=i.current.getCellParams(r,a);return O.api=i.current,O}catch(M){if(M instanceof ru)return Tg;throw M}},KS),d=Ge(i,()=>i.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:r,field:a}));if(c===Tg)return null;const{cellMode:p,hasFocus:h,isEditable:m,value:g,formattedValue:y}=c,v=n.type==="actions",S=(p==="view"||!m)&&!v?c.tabIndex:-1,{classes:w,getCellClassName:C}=s,x=i.current.unstable_applyPipeProcessors("cellClassName",[],{id:r,field:a});n.cellClassName&&x.push(typeof n.cellClassName=="function"?n.cellClassName(c):n.cellClassName),C&&x.push(C(c));let P;if(o==null&&n.renderCell&&(P=n.renderCell(c),x.push(X["cell--withRenderer"]),x.push(w==null?void 0:w["cell--withRenderer"])),o!=null&&n.renderEditCell){const M=i.current.getRowWithUpdatedValues(r,n.field),O=ne(o,rce),F=E({},c,{row:M},O);P=n.renderEditCell(F),x.push(X["cell--editing"]),x.push(w==null?void 0:w["cell--editing"])}const{slots:_}=s,I=_.cell,k=E({},e,{ref:t,field:a,formattedValue:y,hasFocus:h,isEditable:m,isSelected:d,value:g,cellMode:p,children:P,tabIndex:S,className:he(x)});return u.createElement(I,k)}),ace=xy(lce),cce=u.forwardRef((e,t)=>{const{column:n,rowId:r,editCellState:o,align:i,colIndex:s,height:a,width:c,className:d,showRightBorder:p,colSpan:h,disableDragEvents:m,onClick:g,onDoubleClick:y,onMouseDown:v,onMouseUp:S,onMouseOver:w,onKeyDown:C,onKeyUp:x,onDragEnter:P,onDragOver:_}=e,I=ne(e,oce),k=Dt(),M=tt(),O=n.field,F=Ge(k,()=>{try{const be=k.current.getCellParams(r,O);return be.api=k.current,be}catch(pe){if(pe instanceof ru)return Tg;throw pe}},KS),L=Ge(k,()=>k.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:r,field:O})),{cellMode:D,hasFocus:B,isEditable:R,value:A,formattedValue:z}=F,V=n.type==="actions",N=(D==="view"||!R)&&!V?F.tabIndex:-1,{classes:H,getCellClassName:W}=M,K=k.current.unstable_applyPipeProcessors("cellClassName",[],{id:r,field:O});n.cellClassName&&K.push(typeof n.cellClassName=="function"?n.cellClassName(F):n.cellClassName),W&&K.push(W(F));const Y=z==null?A:z,ie=u.useRef(null),re=Vt(t,ie),de=u.useRef(null),se={align:i,showRightBorder:p,isEditable:R,classes:M.classes,isSelected:L},le=sce(se),Ee=u.useCallback(pe=>be=>{const te=k.current.getCellParams(r,O||"");k.current.publishEvent(pe,te,be),S&&S(be)},[k,O,S,r]),ye=u.useCallback(pe=>be=>{const te=k.current.getCellParams(r,O||"");k.current.publishEvent(pe,te,be),v&&v(be)},[k,O,v,r]),_e=u.useCallback((pe,be)=>te=>{if(!k.current.getRow(r))return;const Oe=k.current.getCellParams(r,O||"");k.current.publishEvent(pe,Oe,te),be&&be(te)},[k,O,r]),ee={minWidth:c,maxWidth:c,minHeight:a,maxHeight:a==="auto"?"none":a};if(u.useEffect(()=>{if(!B||D===rn.Edit)return;const pe=vn(k.current.rootElementRef.current);if(ie.current&&!ie.current.contains(pe.activeElement)){const be=ie.current.querySelector('[tabindex="0"]'),te=de.current||be||ie.current;if(Qae())te.focus({preventScroll:!0});else{const Oe=k.current.getScrollPosition();te.focus(),k.current.scroll(Oe)}}},[B,D,k]),F===Tg)return null;let ke=I.onFocus,Re;if(o==null&&n.renderCell&&(Re=n.renderCell(F),K.push(X["cell--withRenderer"]),K.push(H==null?void 0:H["cell--withRenderer"])),o!=null&&n.renderEditCell){const pe=k.current.getRowWithUpdatedValues(r,n.field),be=ne(o,ice),te=E({},F,{row:pe},be);Re=n.renderEditCell(te),K.push(X["cell--editing"]),K.push(H==null?void 0:H["cell--editing"])}if(Re===void 0){const pe=Y==null?void 0:Y.toString();Re=T.jsx("div",{className:le.content,title:pe,children:pe})}u.isValidElement(Re)&&V&&(Re=u.cloneElement(Re,{focusElementRef:de}));const Pe=m?null:{onDragEnter:_e("cellDragEnter",P),onDragOver:_e("cellDragOver",_)};return T.jsx("div",E({ref:re,className:he(d,K,le.root),role:"cell","data-field":O,"data-colindex":s,"aria-colindex":s+1,"aria-colspan":h,style:ee,tabIndex:N,onClick:_e("cellClick",g),onDoubleClick:_e("cellDoubleClick",y),onMouseOver:_e("cellMouseOver",w),onMouseDown:ye("cellMouseDown"),onMouseUp:Ee("cellMouseUp"),onKeyDown:_e("cellKeyDown",C),onKeyUp:_e("cellKeyUp",x)},Pe,I,{onFocus:ke,children:Re}))}),zw=xy(cce),uce=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex"],dce=e=>{const{classes:t}=e;return Me({root:["booleanCell"]},Bt,t)};function fce(e){const{value:t}=e,n=ne(e,uce),r=Dt(),o=tt(),i={classes:o.classes},s=dce(i),a=u.useMemo(()=>t?o.slots.booleanCellTrueIcon:o.slots.booleanCellFalseIcon,[o.slots.booleanCellFalseIcon,o.slots.booleanCellTrueIcon,t]);return T.jsx(a,E({fontSize:"small",className:s.root,titleAccess:r.current.getLocaleText(t?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":!!t},n))}const pce=u.memo(fce),hce=e=>sp(e.rowNode)?"":T.jsx(pce,E({},e)),mce=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange"],gce=e=>{const{classes:t}=e;return Me({root:["editBooleanCell"]},Bt,t)};function vce(e){var t;const{id:n,value:r,field:o,className:i,hasFocus:s,onValueChange:a}=e,c=ne(e,mce),d=Dt(),p=u.useRef(null),h=on(),[m,g]=u.useState(r),y=tt(),v={classes:y.classes},S=gce(v),w=u.useCallback(C=>mt(this,null,function*(){const x=C.target.checked;a&&(yield a(C,x)),g(x),yield d.current.setEditCellValue({id:n,field:o,value:x},C)}),[d,o,n,a]);return u.useEffect(()=>{g(r)},[r]),ln(()=>{s&&p.current.focus()},[s]),T.jsx("label",E({htmlFor:h,className:he(S.root,i)},c,{children:T.jsx(y.slots.baseCheckbox,E({id:h,inputRef:p,checked:!!m,onChange:w,size:"small"},(t=y.slotProps)==null?void 0:t.baseCheckbox))}))}const yce=e=>T.jsx(vce,E({},e)),bce=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","inputProps","isValidating","isProcessingProps","onValueChange"],wce=oe(ed)({fontSize:"inherit"}),Cce=e=>{const{classes:t}=e;return Me({root:["editInputCell"]},Bt,t)};function xce(e){const{id:t,value:n,field:r,colDef:o,hasFocus:i,inputProps:s,onValueChange:a}=e,c=ne(e,bce),d=o.type==="dateTime",p=Dt(),h=u.useRef(),m=u.useMemo(()=>{let k;n==null?k=null:n instanceof Date?k=n:k=new Date((n!=null?n:"").toString());let M;return k==null||Number.isNaN(k.getTime())?M="":M=new Date(k.getTime()-k.getTimezoneOffset()*60*1e3).toISOString().substr(0,d?16:10),{parsed:k,formatted:M}},[n,d]),[g,y]=u.useState(m),S={classes:tt().classes},w=Cce(S),C=u.useRef(!1),x=u.useCallback(k=>{if(k==="")return null;const[M,O]=k.split("T"),[F,L,D]=M.split("-"),B=new Date;if(B.setFullYear(Number(F),Number(L)-1,Number(D)),B.setHours(0,0,0,0),O){const[R,A]=O.split(":");B.setHours(Number(R),Number(A),0,0)}return B},[]),P=u.useCallback(k=>mt(this,null,function*(){const M=k.target.value,O=x(M);a&&(yield a(k,O)),y({parsed:O,formatted:M}),p.current.setEditCellValue({id:t,field:r,value:O},k)}),[p,r,t,a,x]);u.useEffect(()=>{y(k=>{var M,O;return m.parsed!==k.parsed&&((M=m.parsed)==null?void 0:M.getTime())!==((O=k.parsed)==null?void 0:O.getTime())?m:k})},[m]),ln(()=>{i&&h.current.focus()},[i]);const _=p.current.unstable_getEditCellMeta(t,r),I=k=>{if(h.current=k,_!=null&&_.unstable_updateValueOnRender&&!C.current){const M=h.current.value,O=x(M);y({parsed:O,formatted:M}),p.current.setEditCellValue({id:t,field:r,value:O}),C.current=!0}};return T.jsx(wce,E({inputRef:I,fullWidth:!0,className:w.root,type:d?"datetime-local":"date",inputProps:E({max:d?"9999-12-31T23:59":"9999-12-31"},s),value:g.formatted,onChange:P},c))}const NA=e=>T.jsx(xce,E({},e)),Sce=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","isValidating","debounceMs","isProcessingProps","onValueChange"],Ece=e=>{const{classes:t}=e;return Me({root:["editInputCell"]},Bt,t)},Pce=oe(ed,{name:"MuiDataGrid",slot:"EditInputCell",overridesResolver:(e,t)=>t.editInputCell})(({theme:e})=>E({},e.typography.body2,{padding:"1px 0","& input":{padding:"0 16px",height:"100%"}})),Ice=u.forwardRef((e,t)=>{const n=tt(),{id:r,value:o,field:i,colDef:s,hasFocus:a,debounceMs:c=200,isProcessingProps:d,onValueChange:p}=e,h=ne(e,Sce),m=Dt(),g=u.useRef(),[y,v]=u.useState(o),S=Ece(n),w=u.useCallback(x=>mt(void 0,null,function*(){const P=x.target.value;p&&(yield p(x,P));const _=m.current.getColumn(i);let I=P;_.valueParser&&(I=_.valueParser(P,m.current.getCellParams(r,i))),v(I),m.current.setEditCellValue({id:r,field:i,value:I,debounceMs:c,unstable_skipValueParser:!0},x)}),[m,c,i,r,p]),C=m.current.unstable_getEditCellMeta(r,i);return u.useEffect(()=>{(C==null?void 0:C.changeReason)!=="debouncedSetEditCellValue"&&v(o)},[C,o]),ln(()=>{a&&g.current.focus()},[a]),T.jsx(Pce,E({ref:t,inputRef:g,className:S.root,ownerState:n,fullWidth:!0,type:s.type==="number"?s.type:"text",value:y!=null?y:"",onChange:w,endAdornment:d?T.jsx(n.slots.loadIcon,{fontSize:"small",color:"action"}):void 0},h))}),kce=e=>T.jsx(Ice,E({},e)),Og=e=>e==="Escape",_ce=e=>e==="Enter",DA=e=>e==="Tab",BA=e=>e===" ",$ce=e=>e.indexOf("Arrow")===0,Rce=e=>e==="Home"||e==="End",Mce=e=>e.indexOf("Page")===0;function zA(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}const Lg=e=>Rce(e)||$ce(e)||Mce(e)||BA(e),Tce=e=>!!e.key,Oce=e=>DA(e)||Og(e);function Oa(e){return(e==null?void 0:e.type)==="singleSelect"}function jw(e,t,n){if(t===void 0)return;const r=t.find(o=>{const i=n(o);return String(i)===String(e)});return n(r)}const Lce=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen","getOptionLabel","getOptionValue"],Fce=["MenuProps"];function Ace(e){return!!e.key}function Nce(e){var t,n,r;const o=tt(),{id:i,value:s,field:a,row:c,colDef:d,hasFocus:p,error:h,onValueChange:m,initialOpen:g=o.editMode===vs.Cell,getOptionLabel:y,getOptionValue:v}=e,S=ne(e,Lce),w=Dt(),C=u.useRef(),x=u.useRef(),[P,_]=u.useState(g),k=(n=(((t=o.slotProps)==null?void 0:t.baseSelect)||{}).native)!=null?n:!1,M=((r=o.slotProps)==null?void 0:r.baseSelect)||{},{MenuProps:O}=M,F=ne(M,Fce);if(ln(()=>{if(p){var V;(V=x.current)==null||V.focus()}},[p]),!Oa(d))return null;let L;if(typeof(d==null?void 0:d.valueOptions)=="function"?L=d==null?void 0:d.valueOptions({id:i,row:c,field:a}):L=d==null?void 0:d.valueOptions,!L)return null;const D=v||d.getOptionValue,B=y||d.getOptionLabel,R=V=>mt(this,null,function*(){if(!Oa(d)||!L)return;_(!1);const N=V.target,H=jw(N.value,L,D);m&&(yield m(V,H)),yield w.current.setEditCellValue({id:i,field:a,value:H},V)}),A=(V,N)=>{if(o.editMode===vs.Row){_(!1);return}if(N==="backdropClick"||Og(V.key)){const H=w.current.getCellParams(i,a);w.current.publishEvent("cellEditStop",E({},H,{reason:Og(V.key)?$i.escapeKeyDown:$i.cellFocusOut}))}},z=V=>{Ace(V)&&V.key==="Enter"||_(!0)};return!L||!d?null:T.jsx(o.slots.baseSelect,E({ref:C,inputRef:x,value:s,onChange:R,open:P,onOpen:z,MenuProps:E({onClose:A},O),error:h,native:k,fullWidth:!0},S,F,{children:L.map(V=>{var N;const H=D(V);return u.createElement(o.slots.baseSelectOption,E({},((N=o.slotProps)==null?void 0:N.baseSelectOption)||{},{native:k,key:H,value:H}),B(V))})}))}const Dce=e=>T.jsx(Nce,E({},e)),Bce=["open","target","onClickAway","children","position","className","onExited"],zce=e=>{const{classes:t}=e;return Me({root:["menu"]},Bt,t)},jce=oe(oc,{name:"MuiDataGrid",slot:"Menu",overridesResolver:(e,t)=>t.menu})(({theme:e})=>({zIndex:e.zIndex.modal,[`& .${X.menuList}`]:{outline:0}})),Hce={"bottom-start":"top left","bottom-end":"top right"};function jA(e){var t;const{open:n,target:r,onClickAway:o,children:i,position:s,className:a,onExited:c}=e,d=ne(e,Bce),p=Dt(),h=tt(),m=zce(h);u.useEffect(()=>{const y=n?"menuOpen":"menuClose";p.current.publishEvent(y,{target:r})},[p,n,r]);const g=y=>v=>{y&&y(),c&&c(v)};return T.jsx(jce,E({as:h.slots.basePopper,className:he(a,m.root),ownerState:h,open:n,anchorEl:r,transition:!0,placement:s},d,(t=h.slotProps)==null?void 0:t.basePopper,{children:({TransitionProps:y,placement:v})=>T.jsx(kL,{onClickAway:o,mouseEvent:"onMouseDown",children:T.jsx(bg,E({},y,{style:{transformOrigin:Hce[v]},onExited:g(y==null?void 0:y.onExited),children:T.jsx(Ci,{children:i})}))})}))}const Vce=["api","colDef","id","hasFocus","isEditable","field","value","formattedValue","row","rowNode","cellMode","tabIndex","position","focusElementRef"],Uce=e=>typeof e.getActions=="function";function Wce(e){var t;const{colDef:n,id:r,hasFocus:o,tabIndex:i,position:s="bottom-end",focusElementRef:a}=e,c=ne(e,Vce),[d,p]=u.useState(-1),[h,m]=u.useState(!1),g=Dt(),y=u.useRef(null),v=u.useRef(null),S=u.useRef(!1),w=u.useRef({}),C=lr(),x=on(),P=on(),_=tt();if(!Uce(n))throw new Error("MUI: Missing the `getActions` property in the `GridColDef`.");const I=n.getActions(g.current.getRowParams(r)),k=I.filter(z=>!z.props.showInMenu),M=I.filter(z=>z.props.showInMenu),O=k.length+(M.length?1:0);u.useLayoutEffect(()=>{o||Object.entries(w.current).forEach(([z,V])=>{V==null||V.stop({},()=>{delete w.current[z]})})},[o]),u.useEffect(()=>{if(d<0||!y.current||d>=y.current.children.length)return;y.current.children[d].focus({preventScroll:!0})},[d]),u.useEffect(()=>{o||(p(-1),S.current=!1)},[o]),u.useImperativeHandle(a,()=>({focus(){S.current||p(0)}}),[]),u.useEffect(()=>{d>=O&&p(O-1)},[d,O]);const F=()=>{m(!0),p(O-1),S.current=!0},L=()=>{m(!1)},D=z=>V=>{w.current[z]=V},B=(z,V)=>N=>{p(z),S.current=!0,V&&V(N)},R=z=>{if(O<=1)return;let V=d;z.key==="ArrowRight"?C.direction==="rtl"?V-=1:V+=1:z.key==="ArrowLeft"&&(C.direction==="rtl"?V+=1:V-=1),!(V<0||V>=O)&&V!==d&&(z.preventDefault(),z.stopPropagation(),p(V))},A=z=>{z.key==="Tab"&&z.preventDefault(),["Tab","Enter","Escape"].includes(z.key)&&L()};return T.jsxs("div",E({role:"menu",ref:y,tabIndex:-1,className:X.actionsCell,onKeyDown:R},c,{children:[k.map((z,V)=>u.cloneElement(z,{key:V,touchRippleRef:D(V),onClick:B(V,z.props.onClick),tabIndex:d===V?i:-1})),M.length>0&&P&&T.jsx(_.slots.baseIconButton,E({ref:v,id:P,"aria-label":g.current.getLocaleText("actionsCellMore"),"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?x:void 0,role:"menuitem",size:"small",onClick:F,touchRippleRef:D(P),tabIndex:d===k.length?i:-1},(t=_.slotProps)==null?void 0:t.baseIconButton,{children:T.jsx(_.slots.moreActionsIcon,{fontSize:"small"})})),M.length>0&&T.jsx(jA,{onClickAway:L,onClick:L,open:h,target:v.current,position:s,children:T.jsx(Zv,{id:x,className:X.menuList,onKeyDown:A,"aria-labelledby":P,variant:"menu",autoFocusItem:!0,children:M.map((z,V)=>u.cloneElement(z,{key:V}))})})]}))}const Gce=e=>T.jsx(Wce,E({},e)),Kce=["field","align","width","contentWidth"],qce=e=>{const{align:t,classes:n}=e,r={root:["cell","cellSkeleton",`cell--text${ue(t)}`,"withBorderColor"]};return Me(r,Bt,n)};function Yce(e){const{align:t,width:n,contentWidth:r}=e,o=ne(e,Kce),s={classes:tt().classes,align:t},a=qce(s);return T.jsx("div",E({className:a.root,style:{width:n}},o,{children:T.jsx(wne,{width:`${r}%`})}))}function Qce(e){return e.vars?e.vars.palette.TableCell.border:e.palette.mode==="light"?Ua(lt(e.palette.divider,1),.88):Va(lt(e.palette.divider,1),.68)}const pR={[`.${X.columnSeparator}, .${X["columnSeparator--resizing"]}`]:{visibility:"visible",width:"auto"}},hR={[`& .${X.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${X.menuIcon}`]:{width:"auto",visibility:"visible"}},Xce=oe("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(e,t)=>[{[`&.${X.autoHeight}`]:t.autoHeight},{[`&.${X.aggregationColumnHeader}`]:t.aggregationColumnHeader},{[`&.${X["aggregationColumnHeader--alignLeft"]}`]:t["aggregationColumnHeader--alignLeft"]},{[`&.${X["aggregationColumnHeader--alignCenter"]}`]:t["aggregationColumnHeader--alignCenter"]},{[`&.${X["aggregationColumnHeader--alignRight"]}`]:t["aggregationColumnHeader--alignRight"]},{[`&.${X.aggregationColumnHeaderLabel}`]:t.aggregationColumnHeaderLabel},{[`&.${X["root--disableUserSelection"]} .${X.cell}`]:t["root--disableUserSelection"]},{[`& .${X.editBooleanCell}`]:t.editBooleanCell},{[`& .${X["cell--editing"]}`]:t["cell--editing"]},{[`& .${X["cell--textCenter"]}`]:t["cell--textCenter"]},{[`& .${X["cell--textLeft"]}`]:t["cell--textLeft"]},{[`& .${X["cell--textRight"]}`]:t["cell--textRight"]},{[`& .${X["cell--withRenderer"]}`]:t["cell--withRenderer"]},{[`& .${X.cell}`]:t.cell},{[`& .${X["cell--rangeTop"]}`]:t["cell--rangeTop"]},{[`& .${X["cell--rangeBottom"]}`]:t["cell--rangeBottom"]},{[`& .${X["cell--rangeLeft"]}`]:t["cell--rangeLeft"]},{[`& .${X["cell--rangeRight"]}`]:t["cell--rangeRight"]},{[`& .${X["cell--withRightBorder"]}`]:t["cell--withRightBorder"]},{[`& .${X.cellContent}`]:t.cellContent},{[`& .${X.cellCheckbox}`]:t.cellCheckbox},{[`& .${X.cellSkeleton}`]:t.cellSkeleton},{[`& .${X.checkboxInput}`]:t.checkboxInput},{[`& .${X["columnHeader--alignCenter"]}`]:t["columnHeader--alignCenter"]},{[`& .${X["columnHeader--alignLeft"]}`]:t["columnHeader--alignLeft"]},{[`& .${X["columnHeader--alignRight"]}`]:t["columnHeader--alignRight"]},{[`& .${X["columnHeader--dragging"]}`]:t["columnHeader--dragging"]},{[`& .${X["columnHeader--moving"]}`]:t["columnHeader--moving"]},{[`& .${X["columnHeader--numeric"]}`]:t["columnHeader--numeric"]},{[`& .${X["columnHeader--sortable"]}`]:t["columnHeader--sortable"]},{[`& .${X["columnHeader--sorted"]}`]:t["columnHeader--sorted"]},{[`& .${X["columnHeader--withRightBorder"]}`]:t["columnHeader--withRightBorder"]},{[`& .${X.columnHeader}`]:t.columnHeader},{[`& .${X.headerFilterRow}`]:t.headerFilterRow},{[`& .${X.columnHeaderCheckbox}`]:t.columnHeaderCheckbox},{[`& .${X.columnHeaderDraggableContainer}`]:t.columnHeaderDraggableContainer},{[`& .${X.columnHeaderTitleContainer}`]:t.columnHeaderTitleContainer},{[`& .${X["columnSeparator--resizable"]}`]:t["columnSeparator--resizable"]},{[`& .${X["columnSeparator--resizing"]}`]:t["columnSeparator--resizing"]},{[`& .${X.columnSeparator}`]:t.columnSeparator},{[`& .${X.filterIcon}`]:t.filterIcon},{[`& .${X.iconSeparator}`]:t.iconSeparator},{[`& .${X.menuIcon}`]:t.menuIcon},{[`& .${X.menuIconButton}`]:t.menuIconButton},{[`& .${X.menuOpen}`]:t.menuOpen},{[`& .${X.menuList}`]:t.menuList},{[`& .${X["row--editable"]}`]:t["row--editable"]},{[`& .${X["row--editing"]}`]:t["row--editing"]},{[`& .${X["row--dragging"]}`]:t["row--dragging"]},{[`& .${X.row}`]:t.row},{[`& .${X.rowReorderCellPlaceholder}`]:t.rowReorderCellPlaceholder},{[`& .${X.rowReorderCell}`]:t.rowReorderCell},{[`& .${X["rowReorderCell--draggable"]}`]:t["rowReorderCell--draggable"]},{[`& .${X.sortIcon}`]:t.sortIcon},{[`& .${X.withBorderColor}`]:t.withBorderColor},{[`& .${X.treeDataGroupingCell}`]:t.treeDataGroupingCell},{[`& .${X.treeDataGroupingCellToggle}`]:t.treeDataGroupingCellToggle},{[`& .${X.detailPanelToggleCell}`]:t.detailPanelToggleCell},{[`& .${X["detailPanelToggleCell--expanded"]}`]:t["detailPanelToggleCell--expanded"]},t.root]})(({theme:e})=>{const t=Qce(e),n=e.shape.borderRadius;return E({"--unstable_DataGrid-radius":typeof n=="number"?`${n}px`:n,"--unstable_DataGrid-headWeight":e.typography.fontWeightMedium,"--unstable_DataGrid-overlayBackground":e.vars?`rgba(${e.vars.palette.background.defaultChannel} / ${e.vars.palette.action.disabledOpacity})`:lt(e.palette.background.default,e.palette.action.disabledOpacity),flex:1,boxSizing:"border-box",position:"relative",borderWidth:"1px",borderStyle:"solid",borderColor:t,borderRadius:"var(--unstable_DataGrid-radius)",color:(e.vars||e).palette.text.primary},e.typography.body2,{outline:"none",height:"100%",display:"flex",minWidth:0,minHeight:0,flexDirection:"column",overflowAnchor:"none",[`&.${X.autoHeight}`]:{height:"auto",[`& .${X["row--lastVisible"]} .${X.cell}`]:{borderBottomColor:"transparent"}},[`& .${X["virtualScrollerContent--overflowed"]} .${X["row--lastVisible"]} .${X.cell}`]:{borderBottomColor:"transparent"},[`& .${X.columnHeader}, & .${X.cell}`]:{WebkitTapHighlightColor:"transparent",lineHeight:null,padding:"0 10px",boxSizing:"border-box"},[`& .${X.columnHeader}:focus-within, & .${X.cell}:focus-within`]:{outline:`solid ${e.vars?`rgba(${e.vars.palette.primary.mainChannel} / 0.5)`:lt(e.palette.primary.main,.5)} 1px`,outlineWidth:1,outlineOffset:-1},[`& .${X.columnHeader}:focus, & .${X.cell}:focus`]:{outline:`solid ${e.palette.primary.main} 1px`},[`& .${X.columnHeaderCheckbox}, & .${X.cellCheckbox}`]:{padding:0,justifyContent:"center",alignItems:"center"},[`& .${X.columnHeader}`]:{position:"relative",display:"flex",alignItems:"center"},[`& .${X["columnHeader--sorted"]} .${X.iconButtonContainer}, & .${X["columnHeader--filtered"]} .${X.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${X.columnHeader}:not(.${X["columnHeader--sorted"]}) .${X.sortIcon}`]:{opacity:0,transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.shorter})},[`& .${X.columnHeaderTitleContainer}`]:{display:"flex",alignItems:"center",minWidth:0,flex:1,whiteSpace:"nowrap",overflow:"hidden",position:"relative"},[`& .${X.columnHeaderTitleContainerContent}`]:{overflow:"hidden",display:"flex",alignItems:"center"},[`& .${X["columnHeader--filledGroup"]} .${X.columnHeaderTitleContainer}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${X["columnHeader--filledGroup"]}.${X["columnHeader--showColumnBorder"]} .${X.columnHeaderTitleContainer}`]:{borderBottom:"none"},[`& .${X["columnHeader--filledGroup"]}.${X["columnHeader--showColumnBorder"]}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${X.headerFilterRow}`]:{borderTop:`1px solid ${t}`},[`& .${X.sortIcon}, & .${X.filterIcon}`]:{fontSize:"inherit"},[`& .${X["columnHeader--sortable"]}`]:{cursor:"pointer"},[`& .${X["columnHeader--alignCenter"]} .${X.columnHeaderTitleContainer}`]:{justifyContent:"center"},[`& .${X["columnHeader--alignRight"]} .${X.columnHeaderDraggableContainer}, & .${X["columnHeader--alignRight"]} .${X.columnHeaderTitleContainer}`]:{flexDirection:"row-reverse"},[`& .${X["columnHeader--alignCenter"]} .${X.menuIcon}, & .${X["columnHeader--alignRight"]} .${X.menuIcon}`]:{marginRight:"auto",marginLeft:-6},[`& .${X["columnHeader--alignRight"]} .${X.menuIcon}, & .${X["columnHeader--alignRight"]} .${X.menuIcon}`]:{marginRight:"auto",marginLeft:-10},[`& .${X["columnHeader--moving"]}`]:{backgroundColor:(e.vars||e).palette.action.hover},[`& .${X.columnSeparator}`]:{visibility:"hidden",position:"absolute",zIndex:100,display:"flex",flexDirection:"column",justifyContent:"center",color:t},"@media (hover: hover)":{[`& .${X.columnHeaders}:hover`]:pR,[`& .${X.columnHeader}:hover`]:hR,[`& .${X.columnHeader}:not(.${X["columnHeader--sorted"]}):hover .${X.sortIcon}`]:{opacity:.5}},"@media (hover: none)":{[`& .${X.columnHeaders}`]:pR,[`& .${X.columnHeader}`]:hR},[`& .${X["columnSeparator--sideLeft"]}`]:{left:-12},[`& .${X["columnSeparator--sideRight"]}`]:{right:-12},[`& .${X["columnSeparator--resizable"]}`]:{cursor:"col-resize",touchAction:"none","&:hover":{color:(e.vars||e).palette.text.primary,"@media (hover: none)":{color:t}},[`&.${X["columnSeparator--resizing"]}`]:{color:(e.vars||e).palette.text.primary},"& svg":{pointerEvents:"none"}},[`& .${X.iconSeparator}`]:{color:"inherit"},[`& .${X.menuIcon}`]:{width:0,visibility:"hidden",fontSize:20,marginRight:-10,display:"flex",alignItems:"center"},[`.${X.menuOpen}`]:{visibility:"visible",width:"auto"},[`& .${X.row}`]:{display:"flex",width:"fit-content",breakInside:"avoid","&:hover, &.Mui-hovered":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},"&.Mui-selected":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:lt(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover, &.Mui-hovered":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity+e.palette.action.hoverOpacity})`:lt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:lt(e.palette.primary.main,e.palette.action.selectedOpacity)}}}},[`& .${X.cell}`]:{display:"flex",alignItems:"center",borderBottom:"1px solid","&.Mui-selected":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:lt(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover, &.Mui-hovered":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity+e.palette.action.hoverOpacity})`:lt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:lt(e.palette.primary.main,e.palette.action.selectedOpacity)}}}},[`&.${X["root--disableUserSelection"]} .${X.cell}`]:{userSelect:"none"},[`& .${X.row}:not(.${X["row--dynamicHeight"]}) > .${X.cell}`]:{overflow:"hidden",whiteSpace:"nowrap"},[`& .${X.cellContent}`]:{overflow:"hidden",textOverflow:"ellipsis"},[`& .${X.cell}.${X["cell--editing"]}`]:{padding:1,display:"flex",boxShadow:e.shadows[2],backgroundColor:(e.vars||e).palette.background.paper,"&:focus-within":{outline:`solid ${(e.vars||e).palette.primary.main} 1px`,outlineOffset:"-1px"}},[`& .${X["row--editing"]}`]:{boxShadow:e.shadows[2]},[`& .${X["row--editing"]} .${X.cell}`]:{boxShadow:e.shadows[0],backgroundColor:(e.vars||e).palette.background.paper},[`& .${X.editBooleanCell}`]:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},[`& .${X.booleanCell}[data-value="true"]`]:{color:(e.vars||e).palette.text.secondary},[`& .${X.booleanCell}[data-value="false"]`]:{color:(e.vars||e).palette.text.disabled},[`& .${X.actionsCell}`]:{display:"inline-flex",alignItems:"center",gridGap:e.spacing(1)},[`& .${X.rowReorderCell}`]:{display:"inline-flex",flex:1,alignItems:"center",justifyContent:"center",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${X["rowReorderCell--draggable"]}`]:{cursor:"move",opacity:1},[`& .${X.rowReorderCellContainer}`]:{padding:0,alignItems:"stretch"},[`.${X.withBorderColor}`]:{borderColor:t},[`& .${X["cell--withRightBorder"]}`]:{borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${X["columnHeader--withRightBorder"]}`]:{borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${X["cell--textLeft"]}`]:{justifyContent:"flex-start"},[`& .${X["cell--textRight"]}`]:{justifyContent:"flex-end"},[`& .${X["cell--textCenter"]}`]:{justifyContent:"center"},[`& .${X.columnHeaderDraggableContainer}`]:{display:"flex",width:"100%",height:"100%"},[`& .${X.rowReorderCellPlaceholder}`]:{display:"none"},[`& .${X["columnHeader--dragging"]}, & .${X["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${X["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity,[`& .${X.rowReorderCellPlaceholder}`]:{display:"flex"}},[`& .${X.treeDataGroupingCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${X.treeDataGroupingCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)},[`& .${X.groupingCriteriaCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${X.groupingCriteriaCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)}})}),Jce=["children","className"],Zce=e=>{const{autoHeight:t,density:n,classes:r}=e,o={root:["root",t&&"autoHeight",`root--density${ue(n)}`,"withBorderColor"]};return Me(o,Bt,r)},eue=u.forwardRef(function(t,n){const r=tt(),{children:o,className:i}=t,s=ne(t,Jce),a=lc(),c=Ge(a,Or),d=Ge(a,gy),p=Ge(a,Nae),h=Ge(a,Op),m=u.useRef(null),g=Vt(m,n),y=Ge(a,_ae),v=E({},r,{density:p}),S=Zce(v);a.current.register("public",{rootElementRef:m});const[w,C]=u.useState(!1);return ln(()=>{C(!0)},[]),w?T.jsx(Xce,E({ref:g,className:he(i,S.root),ownerState:v,role:"grid","aria-colcount":c.length,"aria-rowcount":h+1+y+d,"aria-multiselectable":!r.disableMultipleRowSelection},s,{children:o})):null}),tue=["className"],nue=e=>{const{classes:t}=e;return Me({root:["footerContainer","withBorderColor"]},Bt,t)},rue=vr("div",{name:"MuiDataGrid",slot:"FooterContainer",overridesResolver:(e,t)=>t.footerContainer})({display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:52,borderTop:"1px solid"}),oue=u.forwardRef(function(t,n){const{className:r}=t,o=ne(t,tue),i=tt(),s=nue(i);return T.jsx(rue,E({ref:n,className:he(s.root,r),ownerState:i},o))}),iue=["className"],sue=e=>{const{classes:t}=e;return Me({root:["overlay"]},Bt,t)},lue=vr("div",{name:"MuiDataGrid",slot:"Overlay",overridesResolver:(e,t)=>t.overlay})({width:"100%",height:"100%",display:"flex",alignSelf:"center",alignItems:"center",justifyContent:"center",backgroundColor:"var(--unstable_DataGrid-overlayBackground)"}),nE=u.forwardRef(function(t,n){const{className:r}=t,o=ne(t,iue),i=tt(),s=sue(i);return T.jsx(lue,E({ref:n,className:he(s.root,r),ownerState:i},o))}),aue=["className"],cue=e=>{const{classes:t}=e;return Me({root:["iconButtonContainer"]},Bt,t)},uue=vr("div",{name:"MuiDataGrid",slot:"IconButtonContainer",overridesResolver:(e,t)=>t.iconButtonContainer})(()=>({display:"flex",visibility:"hidden",width:0})),HA=u.forwardRef(function(t,n){const{className:r}=t,o=ne(t,aue),i=tt(),s=cue(i);return T.jsx(uue,E({ref:n,className:he(s.root,r),ownerState:i},o))}),due=e=>{const{classes:t}=e;return Me({icon:["sortIcon"]},Bt,t)};function fue(e,t,n,r){let o;const i={};return t==="asc"?o=e.columnSortedAscendingIcon:t==="desc"?o=e.columnSortedDescendingIcon:(o=e.columnUnsortedIcon,i.sortingOrder=r),o?T.jsx(o,E({fontSize:"small",className:n},i)):null}function pue(e){var t;const{direction:n,index:r,sortingOrder:o}=e,i=Dt(),s=tt(),a=E({},e,{classes:s.classes}),c=due(a),d=fue(s.slots,n,c.icon,o);if(!d)return null;const p=T.jsx(s.slots.baseIconButton,E({tabIndex:-1,"aria-label":i.current.getLocaleText("columnHeaderSortIconLabel"),title:i.current.getLocaleText("columnHeaderSortIconLabel"),size:"small"},(t=s.slotProps)==null?void 0:t.baseIconButton,{children:d}));return T.jsxs(HA,{children:[r!=null&&T.jsx(KL,{badgeContent:r,color:"default",children:p}),r==null&&p]})}const hue=u.memo(pue),mue=e=>{const{classes:t,open:n}=e;return Me({root:["menuIcon",n&&"menuOpen"],button:["menuIconButton"]},Bt,t)},gue=u.memo(e=>{var t,n;const{colDef:r,open:o,columnMenuId:i,columnMenuButtonId:s,iconButtonRef:a}=e,c=Dt(),d=tt(),p=E({},e,{classes:d.classes}),h=mue(p),m=u.useCallback(g=>{g.preventDefault(),g.stopPropagation(),c.current.toggleColumnMenu(r.field)},[c,r.field]);return T.jsx("div",{className:h.root,children:T.jsx(d.slots.baseTooltip,E({title:c.current.getLocaleText("columnMenuLabel"),enterDelay:1e3},(t=d.slotProps)==null?void 0:t.baseTooltip,{children:T.jsx(d.slots.baseIconButton,E({ref:a,tabIndex:-1,className:h.button,"aria-label":c.current.getLocaleText("columnMenuLabel"),size:"small",onClick:m,"aria-haspopup":"menu","aria-expanded":o,"aria-controls":o?i:void 0,id:s},(n=d.slotProps)==null?void 0:n.baseIconButton,{children:T.jsx(d.slots.columnMenuIcon,{fontSize:"small"})}))}))})});function vue({columnMenuId:e,columnMenuButtonId:t,ContentComponent:n,contentComponentProps:r,field:o,open:i,target:s,onExited:a}){const c=Dt(),d=c.current.getColumn(o),p=u.useCallback(h=>{h.stopPropagation(),s!=null&&s.contains(h.target)||c.current.hideColumnMenu()},[c,s]);return!s||!d?null:T.jsx(jA,{placement:`bottom-${d.align==="right"?"start":"end"}`,open:i,target:s,onClickAway:p,onExited:a,children:T.jsx(n,E({colDef:d,hideMenu:p,open:i,id:e,labelledby:t},r))})}const yue=["className"],bue=e=>{const{classes:t}=e;return Me({root:["columnHeaderTitle"]},Bt,t)},wue=vr("div",{name:"MuiDataGrid",slot:"ColumnHeaderTitle",overridesResolver:(e,t)=>t.columnHeaderTitle})({textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:"var(--unstable_DataGrid-headWeight)"}),Cue=u.forwardRef(function(t,n){const{className:r}=t,o=ne(t,yue),i=tt(),s=bue(i);return T.jsx(wue,E({ref:n,className:he(s.root,r),ownerState:i},o))});function xue(e){var t;const{label:n,description:r}=e,o=tt(),i=u.useRef(null),[s,a]=u.useState(""),c=u.useCallback(()=>{if(!r&&i!=null&&i.current){const d=Xae(i.current);a(d?n:"")}},[r,n]);return T.jsx(o.slots.baseTooltip,E({title:r||s},(t=o.slotProps)==null?void 0:t.baseTooltip,{children:T.jsx(Cue,{onMouseOver:c,ref:i,children:n})}))}const Sue=["resizable","resizing","height","side"];var VA=function(e){return e.Left="left",e.Right="right",e}(VA||{});const Eue=e=>{const{resizable:t,resizing:n,classes:r,side:o}=e,i={root:["columnSeparator",t&&"columnSeparator--resizable",n&&"columnSeparator--resizing",o&&`columnSeparator--side${ue(o)}`],icon:["iconSeparator"]};return Me(i,Bt,r)};function Pue(e){const{height:t,side:n=VA.Right}=e,r=ne(e,Sue),o=tt(),i=E({},e,{side:n,classes:o.classes}),s=Eue(i),a=u.useCallback(c=>{c.preventDefault(),c.stopPropagation()},[]);return T.jsx("div",E({className:s.root,style:{minHeight:t,opacity:o.showColumnVerticalBorder?0:1}},r,{onClick:a,children:T.jsx(o.slots.columnResizeIcon,{className:s.icon})}))}const Iue=u.memo(Pue),kue=["classes","columnMenuOpen","colIndex","height","isResizing","sortDirection","hasFocus","tabIndex","separatorSide","isDraggable","headerComponent","description","elementId","width","columnMenuIconButton","columnMenu","columnTitleIconButtons","headerClassName","label","resizable","draggableContainerProps","columnHeaderSeparatorProps"],UA=u.forwardRef(function(t,n){const{classes:r,columnMenuOpen:o,colIndex:i,height:s,isResizing:a,sortDirection:c,hasFocus:d,tabIndex:p,separatorSide:h,isDraggable:m,headerComponent:g,description:y,width:v,columnMenuIconButton:S=null,columnMenu:w=null,columnTitleIconButtons:C=null,headerClassName:x,label:P,resizable:_,draggableContainerProps:I,columnHeaderSeparatorProps:k}=t,M=ne(t,kue),O=lc(),F=tt(),L=u.useRef(null),[D,B]=u.useState(o),R=Vt(L,n);let A="none";return c!=null&&(A=c==="asc"?"ascending":"descending"),u.useEffect(()=>{D||B(o)},[D,o]),u.useLayoutEffect(()=>{const z=O.current.state.columnMenu;if(d&&!z.open){const N=L.current.querySelector('[tabindex="0"]')||L.current;N==null||N.focus(),O.current.columnHeadersContainerElementRef.current.scrollLeft=0}},[O,d]),T.jsxs("div",E({ref:R,className:he(r.root,x),style:{height:s,width:v,minWidth:v,maxWidth:v},role:"columnheader",tabIndex:p,"aria-colindex":i+1,"aria-sort":A,"aria-label":g==null?P:void 0},M,{children:[T.jsxs("div",E({className:r.draggableContainer,draggable:m},I,{children:[T.jsxs("div",{className:r.titleContainer,children:[T.jsx("div",{className:r.titleContainerContent,children:g!==void 0?g:T.jsx(xue,{label:P,description:y,columnWidth:v})}),C]}),S]})),T.jsx(Iue,E({resizable:!F.disableColumnResize&&!!_,resizing:a,height:s,side:h},k)),w]}))}),_ue=e=>{const{colDef:t,classes:n,isDragging:r,sortDirection:o,showRightBorder:i,filterItemsCounter:s}=e,a=o!=null,c=s!=null&&s>0,d=t.type==="number",p={root:["columnHeader",t.headerAlign==="left"&&"columnHeader--alignLeft",t.headerAlign==="center"&&"columnHeader--alignCenter",t.headerAlign==="right"&&"columnHeader--alignRight",t.sortable&&"columnHeader--sortable",r&&"columnHeader--moving",a&&"columnHeader--sorted",c&&"columnHeader--filtered",d&&"columnHeader--numeric","withBorderColor",i&&"columnHeader--withRightBorder"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]};return Me(p,Bt,n)};function $ue(e){var t,n,r,o;const{colDef:i,columnMenuOpen:s,colIndex:a,headerHeight:c,isResizing:d,sortDirection:p,sortIndex:h,filterItemsCounter:m,hasFocus:g,tabIndex:y,disableReorder:v,separatorSide:S}=e,w=lc(),C=tt(),x=u.useRef(null),P=on(),_=on(),I=u.useRef(null),[k,M]=u.useState(s),O=u.useMemo(()=>!C.disableColumnReorder&&!v&&!i.disableReorder,[C.disableColumnReorder,v,i.disableReorder]);let F;i.renderHeader&&(F=i.renderHeader(w.current.getColumnHeaderParams(i.field)));const L=E({},e,{classes:C.classes,showRightBorder:C.showColumnVerticalBorder}),D=_ue(L),B=u.useCallback(re=>de=>{de.currentTarget.contains(de.target)&&w.current.publishEvent(re,w.current.getColumnHeaderParams(i.field),de)},[w,i.field]),R=u.useMemo(()=>({onClick:B("columnHeaderClick"),onDoubleClick:B("columnHeaderDoubleClick"),onMouseOver:B("columnHeaderOver"),onMouseOut:B("columnHeaderOut"),onMouseEnter:B("columnHeaderEnter"),onMouseLeave:B("columnHeaderLeave"),onKeyDown:B("columnHeaderKeyDown"),onFocus:B("columnHeaderFocus"),onBlur:B("columnHeaderBlur")}),[B]),A=u.useMemo(()=>O?{onDragStart:B("columnHeaderDragStart"),onDragEnter:B("columnHeaderDragEnter"),onDragOver:B("columnHeaderDragOver"),onDragEnd:B("columnHeaderDragEnd")}:{},[O,B]),z=u.useMemo(()=>({onMouseDown:B("columnSeparatorMouseDown")}),[B]);u.useEffect(()=>{k||M(s)},[k,s]);const V=u.useCallback(()=>{M(!1)},[]),N=!C.disableColumnMenu&&!i.disableColumnMenu&&T.jsx(gue,{colDef:i,columnMenuId:P,columnMenuButtonId:_,open:k,iconButtonRef:I}),H=T.jsx(vue,{columnMenuId:P,columnMenuButtonId:_,field:i.field,open:s,target:I.current,ContentComponent:C.slots.columnMenu,contentComponentProps:(t=C.slotProps)==null?void 0:t.columnMenu,onExited:V}),W=(n=i.sortingOrder)!=null?n:C.sortingOrder,K=T.jsxs(u.Fragment,{children:[!C.disableColumnFilter&&T.jsx(C.slots.columnHeaderFilterIconButton,E({field:i.field,counter:m},(r=C.slotProps)==null?void 0:r.columnHeaderFilterIconButton)),i.sortable&&!i.hideSortIcons&&T.jsx(hue,{direction:p,index:h,sortingOrder:W})]});u.useLayoutEffect(()=>{const re=w.current.state.columnMenu;if(g&&!re.open){const se=x.current.querySelector('[tabindex="0"]')||x.current;se==null||se.focus(),w.current.columnHeadersContainerElementRef.current.scrollLeft=0}},[w,g]);const Y=typeof i.headerClassName=="function"?i.headerClassName({field:i.field,colDef:i}):i.headerClassName,ie=(o=i.headerName)!=null?o:i.field;return T.jsx(UA,E({ref:x,classes:D,columnMenuOpen:s,colIndex:a,height:c,isResizing:d,sortDirection:p,hasFocus:g,tabIndex:y,separatorSide:S,isDraggable:O,headerComponent:F,description:i.description,elementId:i.field,width:i.computedWidth,columnMenuIconButton:N,columnTitleIconButtons:K,headerClassName:Y,label:ie,resizable:!C.disableColumnResize&&!!i.resizable,"data-field":i.field,columnMenu:H,draggableContainerProps:A,columnHeaderSeparatorProps:z},R))}const lp=()=>({items:[],logicOperator:no.And,quickFilterValues:[],quickFilterLogicOperator:no.And}),mR=1e3;class Rue{constructor(t=mR){this.timeouts=new Map,this.cleanupTimeout=mR,this.cleanupTimeout=t}register(t,n,r){this.timeouts||(this.timeouts=new Map);const o=setTimeout(()=>{typeof n=="function"&&n(),this.timeouts.delete(r.cleanupToken)},this.cleanupTimeout);this.timeouts.set(r.cleanupToken,o)}unregister(t){const n=this.timeouts.get(t.cleanupToken);n&&(this.timeouts.delete(t.cleanupToken),clearTimeout(n))}reset(){this.timeouts&&(this.timeouts.forEach((t,n)=>{this.unregister({cleanupToken:n})}),this.timeouts=void 0)}}class Mue{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,n,r){this.registry.register(t,n,r)}unregister(t){this.registry.unregister(t)}reset(){}}var fs=function(e){return e.DataGrid="DataGrid",e.DataGridPro="DataGridPro",e}(fs||{});class Tue{}function Oue(e){let t=0;return function(r,o,i,s){e.registry===null&&(e.registry=typeof FinalizationRegistry!="undefined"?new Mue:new Rue);const[a]=u.useState(new Tue),c=u.useRef(null),d=u.useRef();d.current=i;const p=u.useRef(null);if(!c.current&&d.current){const h=(m,g,y)=>{if(!g.defaultMuiPrevented){var v;(v=d.current)==null||v.call(d,m,g,y)}};c.current=r.current.subscribeEvent(o,h,s),t+=1,p.current={cleanupToken:t},e.registry.register(a,()=>{var m;(m=c.current)==null||m.call(c),c.current=null,p.current=null},p.current)}else!d.current&&c.current&&(c.current(),c.current=null,p.current&&(e.registry.unregister(p.current),p.current=null));u.useEffect(()=>{if(!c.current&&d.current){const h=(m,g,y)=>{if(!g.defaultMuiPrevented){var v;(v=d.current)==null||v.call(d,m,g,y)}};c.current=r.current.subscribeEvent(o,h,s)}return p.current&&e.registry&&(e.registry.unregister(p.current),p.current=null),()=>{var h;(h=c.current)==null||h.call(c),c.current=null}},[r,o,s])}}const Lue={registry:null},ot=Oue(Lue),Fue={isFirst:!0};function xn(e,t,n){ot(e,t,n,Fue)}function Ar(e,t){const n=u.useRef(null);if(n.current)return n.current;const r=e.current.getLogger(t);return n.current=r,r}function Aue(e){return typeof e=="number"}function WA(e){return typeof e=="function"}function rE(e){return typeof e=="object"&&e!==null}function Nue(){try{const e="__some_random_key_you_are_not_going_to_use__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}function Om(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}const Vu=(e,t,n)=>Math.max(t,Math.min(n,e));function La(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const o=e.length;if(o!==t.length)return!1;for(let i=0;i<o;i+=1)if(!La(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;const o=Array.from(e.entries());for(let i=0;i<o.length;i+=1)if(!t.has(o[i][0]))return!1;for(let i=0;i<o.length;i+=1){const s=o[i];if(!La(s[1],t.get(s[0])))return!1}return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;const o=Array.from(e.entries());for(let i=0;i<o.length;i+=1)if(!t.has(o[i][0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){const o=e.length;if(o!==t.length)return!1;for(let i=0;i<o;i+=1)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),r=n.length;if(r!==Object.keys(t).length)return!1;for(let o=0;o<r;o+=1)if(!Object.prototype.hasOwnProperty.call(t,n[o]))return!1;for(let o=0;o<r;o+=1){const i=n[o];if(!La(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Due(e){return()=>{let t=e+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function Bue(e,t,n){const r=Due(e);return()=>t+(n-t)*r()}function GA(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}const zue=(e,t,n,r,o)=>{const i=Ar(e,"useNativeEventListener"),[s,a]=u.useState(!1),c=u.useRef(r),d=u.useCallback(p=>c.current&&c.current(p),[]);u.useEffect(()=>{c.current=r},[r]),u.useEffect(()=>{let p;if(WA(t)?p=t():p=t&&t.current?t.current:null,p&&n&&!s){i.debug(`Binding native ${n} event`),p.addEventListener(n,d,o);const h=p;a(!0);const m=()=>{i.debug(`Clearing native ${n} event`),h.removeEventListener(n,d,o)};e.current.subscribeEvent("unmount",m)}},[t,d,n,s,i,o,e])},Lp=e=>{const t=u.useRef(!0);t.current&&(t.current=!1,e())},jue=100,Hue=e=>e?0:100,KA=(e,t)=>t>0&&e>0?Math.ceil(e/t):0;ws(["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 qA=e=>({page:0,pageSize:e?0:100}),Vue=(e,t=0)=>t===0?e:Math.max(Math.min(e,t-1),0),YA=(e,t)=>{if(t===fs.DataGrid&&e>jue)throw new Error(["MUI: `pageSize` cannot exceed 100 in the MIT version of the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(`
|
|
332
|
-
`))},QA=e=>e.pagination,si=Tt(QA,e=>e.paginationModel),Uue=Tt(si,e=>e.page),Wue=Tt(si,e=>e.pageSize);Tt(si,yy,(e,t)=>KA(t,e.pageSize));const oE=In(si,Ti,vy,ia,kA,(e,t,n,r,o)=>{const i=o.length,s=Math.min(e.pageSize*e.page,i-1),a=Math.min(s+e.pageSize-1,i-1);if(s===-1||a===-1)return null;if(n<2)return{firstRowIndex:s,lastRowIndex:a};const c=o[s],d=a-s+1,p=r.findIndex(y=>y.id===c.id);let h=p,m=0;for(;h<r.length&&m<=d;){var g;const y=r[h],v=(g=t[y.id])==null?void 0:g.depth;v===void 0?h+=1:((m<d||v>0)&&(h+=1),v===0&&(m+=1))}return{firstRowIndex:p,lastRowIndex:h-1}}),Gue=In(ia,oE,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),XA=In(If,oE,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),ap=e=>e.preferencePanel;var Xa=function(e){return e.filters="filters",e.columns="columns",e}(Xa||{});const cp=e=>e.rowsMeta,ri=e=>e.rowSelection,Kue=Tt(ri,e=>e.length),que=In(ri,_l,(e,t)=>new Map(e.map(n=>[n,t[n]]))),Fg=In(ri,e=>e.reduce((t,n)=>(t[n]=n,t),{})),Yue=ws(["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"),JA=(e,t)=>t&&e.length>1?(Yue(),[e[0]]):e,gR=(e,t)=>n=>E({},n,{sorting:E({},n.sorting,{sortModel:JA(e,t)})}),Que=e=>e==="desc",Xue=(e,t)=>{const n=t.current.getColumn(e.field);if(!n)return null;const r=Que(e.sort)?(...i)=>-1*n.sortComparator(...i):n.sortComparator;return{getSortCellParams:i=>({id:i,field:n.field,rowNode:t.current.getRowNode(i),value:t.current.getCellValue(i,n.field),api:t.current}),comparator:r}},Jue=(e,t,n)=>e.reduce((r,o,i)=>{if(r!==0)return r;const s=t.params[i],a=n.params[i];return r=o.comparator(s.value,a.value,s,a),r},0),Zue=(e,t)=>{const n=e.map(r=>Xue(r,t)).filter(r=>!!r);return n.length===0?null:r=>r.map(o=>({node:o,params:n.map(i=>i.getSortCellParams(o.id))})).sort((o,i)=>Jue(n,o,i)).map(o=>o.node.id)},vR=(e,t)=>{const n=e.indexOf(t);return!t||n===-1||n+1===e.length?e[0]:e[n+1]},iE=(e,t)=>e==null&&t!=null?-1:t==null&&e!=null?1:e==null&&t==null?0:null,ede=new Intl.Collator,tde=(e,t)=>{const n=iE(e,t);return n!==null?n:typeof e=="string"?ede.compare(e.toString(),t.toString()):e-t},ZA=(e,t)=>{const n=iE(e,t);return n!==null?n:Number(e)-Number(t)},e4=(e,t)=>{const n=iE(e,t);return n!==null?n:e>t?1:e<t?-1:0},t4=e=>e.headerFiltering,nde=Tt(t4,e=>e.editing),rde=Tt(t4,e=>e.menuOpen),ode=e=>{const{classes:t}=e;return Me({icon:["filterIcon"]},Bt,t)};function ide(e){var t,n;const{counter:r,field:o,onClick:i}=e,s=Dt(),a=tt(),c=E({},e,{classes:a.classes}),d=ode(c),p=Ge(s,ap),h=on(),m=on(),g=u.useCallback(S=>{S.preventDefault(),S.stopPropagation();const{open:w,openedPanelValue:C}=ap(s.current.state);w&&C===Xa.filters?s.current.hideFilterPanel():s.current.showFilterPanel(void 0,m,h),i&&i(s.current.getColumnHeaderParams(o),S)},[s,o,i,m,h]);if(!r)return null;const y=p.open&&p.labelId===h,v=T.jsx(a.slots.baseIconButton,E({id:h,onClick:g,color:"default","aria-label":s.current.getLocaleText("columnHeaderFiltersLabel"),size:"small",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":y,"aria-controls":y?m:void 0},(t=a.slotProps)==null?void 0:t.baseIconButton,{children:T.jsx(a.slots.columnFilteredIcon,{className:d.icon,fontSize:"small"})}));return T.jsx(a.slots.baseTooltip,E({title:s.current.getLocaleText("columnHeaderFiltersTooltipActive")(r),enterDelay:1e3},(n=a.slotProps)==null?void 0:n.baseTooltip,{children:T.jsxs(HA,{children:[r>1&&T.jsx(KL,{badgeContent:r,color:"default",children:v}),r===1&&v]})}))}const sde=["field","id","value","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","api"],lde=e=>{const{classes:t}=e;return Me({root:["checkboxInput"]},Bt,t)},ade=u.forwardRef(function(t,n){var r;const{field:o,id:i,value:s,rowNode:a,hasFocus:c,tabIndex:d}=t,p=ne(t,sde),h=Dt(),m=tt(),g={classes:m.classes},y=lde(g),v=u.useRef(null),S=u.useRef(null),w=Vt(v,n),C=h.current.getCellElement(i,o),x=k=>{const M={value:k.target.checked,id:i};h.current.publishEvent("rowSelectionCheckboxChange",M,k)};u.useLayoutEffect(()=>{d===0&&C&&(C.tabIndex=-1)},[C,d]),u.useEffect(()=>{if(c){var k;const M=(k=v.current)==null?void 0:k.querySelector("input");M==null||M.focus({preventScroll:!0})}else S.current&&S.current.stop({})},[c]);const P=u.useCallback(k=>{BA(k.key)&&k.stopPropagation()},[]);if(a.type==="footer"||a.type==="pinnedRow")return null;const _=h.current.isRowSelectable(i),I=h.current.getLocaleText(s?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return T.jsx(m.slots.baseCheckbox,E({ref:w,tabIndex:d,checked:s,onChange:x,className:y.root,inputProps:{"aria-label":I},onKeyDown:P,disabled:!_,touchRippleRef:S},(r=m.slotProps)==null?void 0:r.baseCheckbox,p))}),cde=ade,ude=["field","colDef"],dde=e=>{const{classes:t}=e;return Me({root:["checkboxInput"]},Bt,t)},fde=u.forwardRef(function(t,n){var r;const o=ne(t,ude),[,i]=u.useState(!1),s=Dt(),a=tt(),c={classes:a.classes},d=dde(c),p=Ge(s,$A),h=Ge(s,ri),m=Ge(s,If),g=Ge(s,XA),y=u.useMemo(()=>typeof a.isRowSelectable!="function"?h:h.filter(M=>s.current.getRow(M)?a.isRowSelectable(s.current.getRowParams(M)):!1),[s,a.isRowSelectable,h]),v=u.useMemo(()=>(!a.pagination||!a.checkboxSelectionVisibleOnly?m:g).reduce((O,F)=>(O[F]=!0,O),{}),[a.pagination,a.checkboxSelectionVisibleOnly,g,m]),S=u.useMemo(()=>y.filter(M=>v[M]).length,[y,v]),w=S>0&&S<Object.keys(v).length,C=S>0,x=M=>{const O={value:M.target.checked};s.current.publishEvent("headerSelectionCheckboxChange",O)},P=p!==null&&p.field===t.field?0:-1;u.useLayoutEffect(()=>{const M=s.current.getColumnHeaderElement(t.field);P===0&&M&&(M.tabIndex=-1)},[P,s,t.field]);const _=u.useCallback(M=>{M.key===" "&&s.current.publishEvent("headerSelectionCheckboxChange",{value:!C})},[s,C]),I=u.useCallback(()=>{i(M=>!M)},[]);u.useEffect(()=>s.current.subscribeEvent("rowSelectionChange",I),[s,I]);const k=s.current.getLocaleText(C?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows");return T.jsx(a.slots.baseCheckbox,E({ref:n,indeterminate:w,checked:C,onChange:x,className:d.root,inputProps:{"aria-label":k},tabIndex:P,onKeyDown:_},(r=a.slotProps)==null?void 0:r.baseCheckbox,o))}),yR=$t(T.jsx("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward"),bR=$t(T.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward"),wR=$t(T.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"KeyboardArrowRight"),CR=$t(T.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),pde=$t(T.jsx("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}),"FilterList"),xR=$t(T.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"),hde=$t(T.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");$t(T.jsx("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");$t(T.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 mde=$t(T.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"),gde=$t(T.jsx("path",{d:"M11 19V5h2v14z"}),"Separator"),vde=$t(T.jsx("path",{d:"M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z"}),"ViewHeadline"),yde=$t(T.jsx("path",{d:"M21,8H3V4h18V8z M21,10H3v4h18V10z M21,16H3v4h18V16z"}),"TableRows"),bde=$t(T.jsx("path",{d:"M4 18h17v-6H4v6zM4 5v6h17V5H4z"}),"ViewStream"),wde=$t(T.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"),q1=$t(T.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"),SR=$t(T.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add"),Cde=$t(T.jsx("path",{d:"M19 13H5v-2h14v2z"}),"Remove"),xde=$t(T.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"),ER=$t(T.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"),Sde=$t(T.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"),Ede=$t(T.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),Pde=$t(T.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"),Ide=$t(T.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"}),"VisibilityOff"),kde=$t(T.jsx("g",{children:T.jsx("path",{d:"M14.67,5v14H9.33V5H14.67z M15.67,19H21V5h-5.33V19z M8.33,19V5H3v14H8.33z"})}),"ViewColumn"),_de=$t(T.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"}),"Clear");$t(T.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");const $de=$t(T.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),"Delete"),Rde=["hideMenu","colDef","id","labelledby","className","children","open"],Mde=oe(Zv)(()=>({minWidth:248})),Tde=u.forwardRef(function(t,n){const{hideMenu:r,id:o,labelledby:i,className:s,children:a,open:c}=t,d=ne(t,Rde),p=u.useCallback(h=>{DA(h.key)&&h.preventDefault(),Oce(h.key)&&r(h)},[r]);return T.jsx(Mde,E({id:o,ref:n,className:he(X.menuList,s),"aria-labelledby":i,onKeyDown:p,autoFocus:c},d,{children:a}))}),Ode=["displayOrder"],Lde=e=>{const t=lc(),{defaultSlots:n,defaultSlotProps:r,slots:o={},slotProps:i={},hideMenu:s,colDef:a,addDividers:c=!0}=e,d=u.useMemo(()=>E({},n,o),[n,o]),p=u.useMemo(()=>{if(!i||Object.keys(i).length===0)return r;const g=E({},i);return Object.entries(r).forEach(([y,v])=>{g[y]=E({},v,i[y]||{})}),g},[r,i]),h=t.current.unstable_applyPipeProcessors("columnMenu",[],e.colDef),m=u.useMemo(()=>{const g=Object.keys(n);return Object.keys(o).filter(y=>!g.includes(y))},[o,n]);return u.useMemo(()=>{const v=Array.from(new Set([...h,...m])).filter(S=>d[S]!=null).sort((S,w)=>{const C=p[S],x=p[w],P=Number.isFinite(C==null?void 0:C.displayOrder)?C.displayOrder:100,_=Number.isFinite(x==null?void 0:x.displayOrder)?x.displayOrder:100;return P-_});return v.reduce((S,w,C)=>{let x={colDef:a,onClick:s};const P=p[w];if(P){const _=ne(P,Ode);x=E({},x,_)}return c&&C!==v.length-1?[...S,[d[w],x],[$J,{}]]:[...S,[d[w],x]]},[])},[c,a,h,s,d,p,m])};function Fde(e){const{colDef:t,onClick:n}=e,r=Dt(),o=tt(),a=Or(r).filter(d=>d.disableColumnMenu!==!0).length===1,c=u.useCallback(d=>{a||(r.current.setColumnVisibility(t.field,!1),n(d))},[r,t.field,n,a]);return o.disableColumnSelector||t.hideable===!1?null:T.jsxs(fo,{onClick:c,disabled:a,children:[T.jsx(Bl,{children:T.jsx(o.slots.columnMenuHideIcon,{fontSize:"small"})}),T.jsx(cs,{children:r.current.getLocaleText("columnMenuHideColumn")})]})}function Ade(e){const{onClick:t}=e,n=Dt(),r=tt(),o=u.useCallback(i=>{t(i),n.current.showPreferences(Xa.columns)},[n,t]);return r.disableColumnSelector?null:T.jsxs(fo,{onClick:o,children:[T.jsx(Bl,{children:T.jsx(r.slots.columnMenuManageColumnsIcon,{fontSize:"small"})}),T.jsx(cs,{children:n.current.getLocaleText("columnMenuManageColumns")})]})}function Nde(e){return T.jsxs(u.Fragment,{children:[T.jsx(Fde,E({},e)),T.jsx(Ade,E({},e))]})}function Dde(e){const{colDef:t,onClick:n}=e,r=Dt(),o=tt(),i=u.useCallback(s=>{n(s),r.current.showFilterPanel(t.field)},[r,t.field,n]);return o.disableColumnFilter||!t.filterable?null:T.jsxs(fo,{onClick:i,children:[T.jsx(Bl,{children:T.jsx(o.slots.columnMenuFilterIcon,{fontSize:"small"})}),T.jsx(cs,{children:r.current.getLocaleText("columnMenuFilter")})]})}function Bde(e){var t;const{colDef:n,onClick:r}=e,o=Dt(),i=Ge(o,ni),s=tt(),a=u.useMemo(()=>{if(!n)return null;const p=i.find(h=>h.field===n.field);return p==null?void 0:p.sort},[n,i]),c=(t=n.sortingOrder)!=null?t:s.sortingOrder,d=u.useCallback(p=>{r(p);const h=p.currentTarget.getAttribute("data-value")||null;o.current.sortColumn(n,h===a?null:h)},[o,n,r,a]);return!n||!n.sortable||!c.some(p=>!!p)?null:T.jsxs(u.Fragment,{children:[c.includes("asc")&&a!=="asc"?T.jsxs(fo,{onClick:d,"data-value":"asc",children:[T.jsx(Bl,{children:T.jsx(s.slots.columnMenuSortAscendingIcon,{fontSize:"small"})}),T.jsx(cs,{children:o.current.getLocaleText("columnMenuSortAsc")})]}):null,c.includes("desc")&&a!=="desc"?T.jsxs(fo,{onClick:d,"data-value":"desc",children:[T.jsx(Bl,{children:T.jsx(s.slots.columnMenuSortDescendingIcon,{fontSize:"small"})}),T.jsx(cs,{children:o.current.getLocaleText("columnMenuSortDesc")})]}):null,c.includes(null)&&a!=null?T.jsxs(fo,{onClick:d,children:[T.jsx(Bl,{}),T.jsx(cs,{children:o.current.getLocaleText("columnMenuUnsort")})]}):null]})}const zde=["defaultSlots","defaultSlotProps","slots","slotProps"],jde={columnMenuSortItem:Bde,columnMenuFilterItem:Dde,columnMenuColumnsItem:Nde},Hde={columnMenuSortItem:{displayOrder:10},columnMenuFilterItem:{displayOrder:20},columnMenuColumnsItem:{displayOrder:30}},Vde=u.forwardRef(function(t,n){const{defaultSlots:r,defaultSlotProps:o,slots:i,slotProps:s}=t,a=ne(t,zde),c=Lde(E({},a,{defaultSlots:r,defaultSlotProps:o,slots:i,slotProps:s}));return T.jsx(Tde,E({ref:n},a,{children:c.map(([d,p],h)=>T.jsx(d,E({},p),h))}))}),Ude=u.forwardRef(function(t,n){return T.jsx(Vde,E({},t,{ref:n,defaultSlots:jde,defaultSlotProps:Hde}))}),Wde=["className"],Gde=e=>{const{classes:t}=e;return Me({root:["panelContent"]},Bt,t)},Kde=vr("div",{name:"MuiDataGrid",slot:"PanelContent",overridesResolver:(e,t)=>t.panelContent})({display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400});function n4(e){const{className:t}=e,n=ne(e,Wde),r=tt(),o=Gde(r);return T.jsx(Kde,E({className:he(t,o.root),ownerState:r},n))}const qde=["className"],Yde=e=>{const{classes:t}=e;return Me({root:["panelFooter"]},Bt,t)},Qde=vr("div",{name:"MuiDataGrid",slot:"PanelFooter",overridesResolver:(e,t)=>t.panelFooter})(({theme:e})=>({padding:e.spacing(.5),display:"flex",justifyContent:"space-between"}));function r4(e){const{className:t}=e,n=ne(e,qde),r=tt(),o=Yde(r);return T.jsx(Qde,E({className:he(t,o.root),ownerState:r},n))}const Xde=["className"],Jde=e=>{const{classes:t}=e;return Me({root:["panelHeader"]},Bt,t)},Zde=vr("div",{name:"MuiDataGrid",slot:"PanelHeader",overridesResolver:(e,t)=>t.panelHeader})(({theme:e})=>({padding:e.spacing(1)}));function efe(e){const{className:t}=e,n=ne(e,Xde),r=tt(),o=Jde(r);return T.jsx(Zde,E({className:he(t,o.root),ownerState:r},n))}const tfe=["className","slotProps"],nfe=e=>{const{classes:t}=e;return Me({root:["panelWrapper"]},Bt,t)},rfe=oe("div",{name:"MuiDataGrid",slot:"PanelWrapper",overridesResolver:(e,t)=>t.panelWrapper})({display:"flex",flexDirection:"column",flex:1,"&:focus":{outline:0}}),ofe=()=>!0,o4=u.forwardRef(function(t,n){const{className:r,slotProps:o={}}=t,i=ne(t,tfe),s=tt(),a=nfe(s);return T.jsx(_L,E({open:!0,disableEnforceFocus:!0,isEnabled:ofe},o.TrapFocus,{children:T.jsx(rfe,E({ref:n,tabIndex:-1,className:he(r,a.root),ownerState:s},i))}))}),ife=!1,sfe=["sort","searchPredicate","autoFocusSearchField","disableHideAllButton","disableShowAllButton","getTogglableColumns"],lfe=e=>{const{classes:t}=e;return Me({root:["columnsPanel"],columnsPanelRow:["columnsPanelRow"]},Bt,t)},afe=oe("div",{name:"MuiDataGrid",slot:"ColumnsPanel",overridesResolver:(e,t)=>t.columnsPanel})({padding:"8px 0px 8px 8px"}),cfe=oe("div",{name:"MuiDataGrid",slot:"ColumnsPanelRow",overridesResolver:(e,t)=>t.columnsPanelRow})(({theme:e})=>({display:"flex",justifyContent:"space-between",padding:"1px 8px 1px 7px",[`& .${Rr.root}`]:{marginRight:e.spacing(.5)}})),ufe=oe(oo)({justifyContent:"flex-end"}),PR=new Intl.Collator,dfe=(e,t)=>(e.headerName||e.field).toLowerCase().indexOf(t)>-1;function ffe(e){var t,n,r;const o=Dt(),i=u.useRef(null),s=Ge(o,ds),a=Ge(o,Li),c=tt(),[d,p]=u.useState(""),h=lfe(c),{sort:m,searchPredicate:g=dfe,autoFocusSearchField:y=!0,disableHideAllButton:v=!1,disableShowAllButton:S=!1,getTogglableColumns:w}=e,C=ne(e,sfe),x=u.useMemo(()=>{switch(m){case"asc":return[...s].sort((L,D)=>PR.compare(L.headerName||L.field,D.headerName||D.field));case"desc":return[...s].sort((L,D)=>-PR.compare(L.headerName||L.field,D.headerName||D.field));default:return s}},[s,m]),P=L=>{const{name:D}=L.target;o.current.setColumnVisibility(D,a[D]===!1)},_=u.useCallback(L=>{const D=Li(o),B=E({},D),R=w?w(s):null;return s.forEach(A=>{A.hideable&&(R==null||R.includes(A.field))&&(L?delete B[A.field]:B[A.field]=!1)}),o.current.setColumnVisibilityModel(B)},[o,s,w]),I=u.useCallback(L=>{p(L.target.value)},[]),k=u.useMemo(()=>{const L=w?w(x):null,D=L?x.filter(({field:B})=>L.includes(B)):x;return d?D.filter(B=>g(B,d.toLowerCase())):D},[x,d,g,w]),M=u.useRef(null);u.useEffect(()=>{y?i.current.focus():M.current&&typeof M.current.focus=="function"&&M.current.focus()},[y]);let O=!1;const F=L=>O===!1&&L.hideable!==!1?(O=!0,!0):!1;return T.jsxs(o4,E({},C,{children:[T.jsx(efe,{children:T.jsx(c.slots.baseTextField,E({label:o.current.getLocaleText("columnsPanelTextFieldLabel"),placeholder:o.current.getLocaleText("columnsPanelTextFieldPlaceholder"),inputRef:i,value:d,onChange:I,variant:"standard",fullWidth:!0},(t=c.slotProps)==null?void 0:t.baseTextField))}),T.jsx(n4,{children:T.jsx(afe,{className:h.root,ownerState:c,children:k.map(L=>{var D;return T.jsxs(cfe,{className:h.columnsPanelRow,ownerState:c,children:[T.jsx(rF,{control:T.jsx(c.slots.baseSwitch,E({disabled:L.hideable===!1,checked:a[L.field]!==!1,onClick:P,name:L.field,size:"small",inputRef:F(L)?M:void 0},(D=c.slotProps)==null?void 0:D.baseSwitch)),label:L.headerName||L.field}),!c.disableColumnReorder&&ife&&T.jsx(ufe,{draggable:!0,"aria-label":o.current.getLocaleText("columnsPanelDragIconLabel"),title:o.current.getLocaleText("columnsPanelDragIconLabel"),size:"small",disabled:!0,children:T.jsx(c.slots.columnReorderIcon,{})})]},L.field)})})}),S&&v?null:T.jsxs(r4,{children:[v?T.jsx("span",{}):T.jsx(c.slots.baseButton,E({onClick:()=>_(!1)},(n=c.slotProps)==null?void 0:n.baseButton,{disabled:v,children:o.current.getLocaleText("columnsPanelHideAllButton")})),S?null:T.jsx(c.slots.baseButton,E({onClick:()=>_(!0)},(r=c.slotProps)==null?void 0:r.baseButton,{disabled:S,children:o.current.getLocaleText("columnsPanelShowAllButton")}))]})]}))}const pfe=["children","className","classes"],hfe=Xe("MuiDataGrid",["panel","paper"]),mfe=oe(oc,{name:"MuiDataGrid",slot:"Panel",overridesResolver:(e,t)=>t.panel})(({theme:e})=>({zIndex:e.zIndex.modal})),gfe=oe(Ci,{name:"MuiDataGrid",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,minWidth:300,maxHeight:450,display:"flex"})),vfe=u.forwardRef((e,t)=>{const{children:n,className:r}=e,o=ne(e,pfe),i=Dt(),s=tt(),a=hfe,[c,d]=u.useState(!1),p=u.useCallback(()=>{i.current.hidePreferences()},[i]),h=u.useCallback(v=>{Og(v.key)&&i.current.hidePreferences()},[i]),m=u.useMemo(()=>[{name:"flip",enabled:!1},{name:"isPlaced",enabled:!0,phase:"main",fn:()=>{d(!0)},effect:()=>()=>{d(!1)}}],[]),[g,y]=u.useState(null);return u.useEffect(()=>{var v,S;const w=(v=i.current.rootElementRef)==null||(S=v.current)==null?void 0:S.querySelector(`.${X.columnHeaders}`);w&&y(w)},[i]),g?T.jsx(mfe,E({ref:t,placement:"bottom-start",className:he(r,a.panel),ownerState:s,anchorEl:g,modifiers:m},o,{children:T.jsx(kL,{mouseEvent:"onMouseUp",onClickAway:p,children:T.jsx(gfe,{className:a.paper,ownerState:s,elevation:8,onKeyDown:h,children:c&&n})})})):null}),yfe=u.forwardRef(function(t,n){var r,o,i;const s=Dt(),a=Ge(s,ds),c=tt(),d=Ge(s,ap),p=s.current.unstable_applyPipeProcessors("preferencePanel",null,(r=d.openedPanelValue)!=null?r:Xa.filters);return T.jsx(c.slots.panel,E({ref:n,as:c.slots.basePopper,open:a.length>0&&d.open,id:d.panelId,"aria-labelledby":d.labelId},(o=c.slotProps)==null?void 0:o.panel,t,(i=c.slotProps)==null?void 0:i.basePopper,{children:p}))}),bfe=["item","hasMultipleFilters","deleteFilter","applyFilterChanges","multiFilterOperator","showMultiFilterOperators","disableMultiFilterOperator","applyMultiFilterOperatorChanges","focusElementRef","logicOperators","columnsSort","filterColumns","deleteIconProps","logicOperatorInputProps","operatorInputProps","columnInputProps","valueInputProps","children"],wfe=["InputComponentProps"],Cfe=e=>{const{classes:t}=e;return Me({root:["filterForm"],deleteIcon:["filterFormDeleteIcon"],logicOperatorInput:["filterFormLogicOperatorInput"],columnInput:["filterFormColumnInput"],operatorInput:["filterFormOperatorInput"],valueInput:["filterFormValueInput"]},Bt,t)},xfe=oe("div",{name:"MuiDataGrid",slot:"FilterForm",overridesResolver:(e,t)=>t.filterForm})(({theme:e})=>({display:"flex",padding:e.spacing(1)})),Sfe=oe("div",{name:"MuiDataGrid",slot:"FilterFormDeleteIcon",overridesResolver:(e,t)=>t.filterFormDeleteIcon})(({theme:e})=>({flexShrink:0,justifyContent:"flex-end",marginRight:e.spacing(.5),marginBottom:e.spacing(.2)})),Efe=oe("div",{name:"MuiDataGrid",slot:"FilterFormLogicOperatorInput",overridesResolver:(e,t)=>t.filterFormLogicOperatorInput})({minWidth:55,marginRight:5,justifyContent:"end"}),Pfe=oe("div",{name:"MuiDataGrid",slot:"FilterFormColumnInput",overridesResolver:(e,t)=>t.filterFormColumnInput})({width:150}),Ife=oe("div",{name:"MuiDataGrid",slot:"FilterFormOperatorInput",overridesResolver:(e,t)=>t.filterFormOperatorInput})({width:120}),kfe=oe("div",{name:"MuiDataGrid",slot:"FilterFormValueInput",overridesResolver:(e,t)=>t.filterFormValueInput})({width:190}),_fe=e=>{switch(e){case no.And:return"filterPanelOperatorAnd";case no.Or:return"filterPanelOperatorOr";default:throw new Error("MUI: Invalid `logicOperator` property in the `GridFilterPanel`.")}},Yd=e=>e.headerName||e.field,IR=new Intl.Collator,$fe=u.forwardRef(function(t,n){var r,o,i,s,a,c,d,p,h,m;const{item:g,hasMultipleFilters:y,deleteFilter:v,applyFilterChanges:S,multiFilterOperator:w,showMultiFilterOperators:C,disableMultiFilterOperator:x,applyMultiFilterOperatorChanges:P,focusElementRef:_,logicOperators:I=[no.And,no.Or],columnsSort:k,filterColumns:M,deleteIconProps:O={},logicOperatorInputProps:F={},operatorInputProps:L={},columnInputProps:D={},valueInputProps:B={}}=t,R=ne(t,bfe),A=Dt(),z=Ge(A,EA),V=Ge(A,Cr),N=on(),H=on(),W=on(),K=on(),Y=tt(),ie=Cfe(Y),re=u.useRef(null),de=u.useRef(null),se=y&&I.length>0,le=((r=Y.slotProps)==null?void 0:r.baseFormControl)||{},ye=(i=(((o=Y.slotProps)==null?void 0:o.baseSelect)||{}).native)!=null?i:!0,_e=((s=Y.slotProps)==null?void 0:s.baseInputLabel)||{},ee=((a=Y.slotProps)==null?void 0:a.baseSelectOption)||{},{InputComponentProps:ke}=B,Re=ne(B,wfe),Pe=u.useMemo(()=>{if(M===void 0||typeof M!="function")return z;const De=M({field:g.field,columns:z,currentFilters:(V==null?void 0:V.items)||[]});return z.filter(ct=>De.includes(ct.field))},[M,V==null?void 0:V.items,z,g.field]),pe=u.useMemo(()=>{switch(k){case"asc":return Pe.sort((De,ct)=>IR.compare(Yd(De),Yd(ct)));case"desc":return Pe.sort((De,ct)=>-IR.compare(Yd(De),Yd(ct)));default:return Pe}},[Pe,k]),be=g.field?A.current.getColumn(g.field):null,te=u.useMemo(()=>{var De;return!g.operator||!be?null:(De=be.filterOperators)==null?void 0:De.find(ct=>ct.value===g.operator)},[g,be]),Oe=u.useCallback(De=>{const ct=De.target.value,vt=A.current.getColumn(ct);if(vt.field===be.field)return;const st=vt.filterOperators.find(yt=>yt.value===g.operator)||vt.filterOperators[0],Pt=!st.InputComponent||st.InputComponent!==(te==null?void 0:te.InputComponent);S(E({},g,{field:ct,operator:st.value,value:Pt?void 0:g.value}))},[A,S,g,be,te]),Ye=u.useCallback(De=>{const ct=De.target.value,vt=be==null?void 0:be.filterOperators.find(Pt=>Pt.value===ct),st=!(vt!=null&&vt.InputComponent)||(vt==null?void 0:vt.InputComponent)!==(te==null?void 0:te.InputComponent);S(E({},g,{operator:ct,value:st?void 0:g.value}))},[S,g,be,te]),Ke=u.useCallback(De=>{const ct=De.target.value===no.And.toString()?no.And:no.Or;P(ct)},[P]),Ue=()=>{Y.disableMultipleColumnsFiltering?g.value===void 0?v(g):S(E({},g,{value:void 0})):v(g)};return u.useImperativeHandle(_,()=>({focus:()=>{if(te!=null&&te.InputComponent){var De;re==null||(De=re.current)==null||De.focus()}else de.current.focus()}}),[te]),T.jsxs(xfe,E({ref:n,className:ie.root,"data-id":g.id,ownerState:Y},R,{children:[T.jsx(Sfe,E({variant:"standard",as:Y.slots.baseFormControl},le,O,{className:he(ie.deleteIcon,le.className,O.className),ownerState:Y,children:T.jsx(Y.slots.baseIconButton,E({"aria-label":A.current.getLocaleText("filterPanelDeleteIconLabel"),title:A.current.getLocaleText("filterPanelDeleteIconLabel"),onClick:Ue,size:"small"},(c=Y.slotProps)==null?void 0:c.baseIconButton,{children:T.jsx(Y.slots.filterPanelDeleteIcon,{fontSize:"small"})}))})),T.jsx(Efe,E({variant:"standard",as:Y.slots.baseFormControl},le,F,{sx:E({display:se?"flex":"none",visibility:C?"visible":"hidden"},le.sx||{},F.sx||{}),className:he(ie.logicOperatorInput,le.className,F.className),ownerState:Y,children:T.jsx(Y.slots.baseSelect,E({inputProps:{"aria-label":A.current.getLocaleText("filterPanelLogicOperator")},value:w,onChange:Ke,disabled:!!x||I.length===1,native:ye},(d=Y.slotProps)==null?void 0:d.baseSelect,{children:I.map(De=>u.createElement(Y.slots.baseSelectOption,E({},ee,{native:ye,key:De.toString(),value:De.toString()}),A.current.getLocaleText(_fe(De))))}))})),T.jsxs(Pfe,E({variant:"standard",as:Y.slots.baseFormControl},le,D,{className:he(ie.columnInput,le.className,D.className),ownerState:Y,children:[T.jsx(Y.slots.baseInputLabel,E({},_e,{htmlFor:N,id:H,children:A.current.getLocaleText("filterPanelColumns")})),T.jsx(Y.slots.baseSelect,E({labelId:H,id:N,label:A.current.getLocaleText("filterPanelColumns"),value:g.field||"",onChange:Oe,native:ye},(p=Y.slotProps)==null?void 0:p.baseSelect,{children:pe.map(De=>u.createElement(Y.slots.baseSelectOption,E({},ee,{native:ye,key:De.field,value:De.field}),Yd(De)))}))]})),T.jsxs(Ife,E({variant:"standard",as:Y.slots.baseFormControl},le,L,{className:he(ie.operatorInput,le.className,L.className),ownerState:Y,children:[T.jsx(Y.slots.baseInputLabel,E({},_e,{htmlFor:W,id:K,children:A.current.getLocaleText("filterPanelOperator")})),T.jsx(Y.slots.baseSelect,E({labelId:K,label:A.current.getLocaleText("filterPanelOperator"),id:W,value:g.operator,onChange:Ye,native:ye,inputRef:de},(h=Y.slotProps)==null?void 0:h.baseSelect,{children:be==null||(m=be.filterOperators)==null?void 0:m.map(De=>u.createElement(Y.slots.baseSelectOption,E({},ee,{native:ye,key:De.value,value:De.value}),De.label||A.current.getLocaleText(`filterOperator${ue(De.value)}`)))}))]})),T.jsx(kfe,E({variant:"standard",as:Y.slots.baseFormControl},le,Re,{className:he(ie.valueInput,le.className,Re.className),ownerState:Y,children:te!=null&&te.InputComponent?T.jsx(te.InputComponent,E({apiRef:A,item:g,applyValue:S,focusElementRef:re},te.InputComponentProps,ke)):null}))]}))}),Rfe=["item","applyValue","type","apiRef","focusElementRef","tabIndex","disabled","isFilterActive","clearButton","InputProps"],Mfe=500;function es(e){var t,n;const{item:r,applyValue:o,type:i,apiRef:s,focusElementRef:a,tabIndex:c,disabled:d,clearButton:p,InputProps:h}=e,m=ne(e,Rfe),g=u.useRef(),[y,v]=u.useState((t=r.value)!=null?t:""),[S,w]=u.useState(!1),C=on(),x=tt(),P=u.useCallback(_=>{const{value:I}=_.target;clearTimeout(g.current),v(String(I)),w(!0),g.current=setTimeout(()=>{o(E({},r,{value:I})),w(!1)},Mfe)},[o,r]);return u.useEffect(()=>()=>{clearTimeout(g.current)},[]),u.useEffect(()=>{var _;const I=(_=r.value)!=null?_:"";v(String(I))},[r.value]),T.jsx(x.slots.baseTextField,E({id:C,label:s.current.getLocaleText("filterPanelInputLabel"),placeholder:s.current.getLocaleText("filterPanelInputPlaceholder"),value:y,onChange:P,variant:"standard",type:i||"text",InputProps:E({},S||p?{endAdornment:S?T.jsx(x.slots.loadIcon,{fontSize:"small",color:"action"}):p}:{},{disabled:d},h,{inputProps:E({tabIndex:c},h==null?void 0:h.inputProps)}),InputLabelProps:{shrink:!0},inputRef:a},m,(n=x.slotProps)==null?void 0:n.baseTextField))}const Tfe=["item","applyValue","type","apiRef","focusElementRef","InputProps","isFilterActive","clearButton","tabIndex","disabled"],Ofe=500;function Tc(e){var t,n;const{item:r,applyValue:o,type:i,apiRef:s,focusElementRef:a,InputProps:c,clearButton:d,tabIndex:p,disabled:h}=e,m=ne(e,Tfe),g=u.useRef(),[y,v]=u.useState((t=r.value)!=null?t:""),[S,w]=u.useState(!1),C=on(),x=tt(),P=u.useCallback(_=>{const I=_.target.value;clearTimeout(g.current),v(String(I)),w(!0),g.current=setTimeout(()=>{o(E({},r,{value:I})),w(!1)},Ofe)},[o,r]);return u.useEffect(()=>()=>{clearTimeout(g.current)},[]),u.useEffect(()=>{var _;const I=(_=r.value)!=null?_:"";v(String(I))},[r.value]),T.jsx(x.slots.baseTextField,E({fullWidth:!0,id:C,label:s.current.getLocaleText("filterPanelInputLabel"),placeholder:s.current.getLocaleText("filterPanelInputPlaceholder"),value:y,onChange:P,variant:"standard",type:i||"text",InputLabelProps:{shrink:!0},inputRef:a,InputProps:E({},S||d?{endAdornment:S?T.jsx(x.slots.loadIcon,{fontSize:"small",color:"action"}):d}:{},{disabled:h},c,{inputProps:E({max:i==="datetime-local"?"9999-12-31T23:59":"9999-12-31",tabIndex:p},c==null?void 0:c.inputProps)})},m,(n=x.slotProps)==null?void 0:n.baseTextField))}const Lfe=["item","applyValue","type","apiRef","focusElementRef","getOptionLabel","getOptionValue","placeholder","tabIndex","label","isFilterActive","clearButton"],Ffe=({column:{valueOptions:e,field:t},OptionComponent:n,getOptionLabel:r,getOptionValue:o,isSelectNative:i,baseSelectOptionProps:s})=>(typeof e=="function"?["",...e({field:t})]:["",...e||[]]).map(c=>{const d=o(c),p=r(c);return u.createElement(n,E({},s,{native:i,key:d,value:d}),p)}),Afe=oe("div")({display:"flex",alignItems:"flex-end",width:"100%",["& button"]:{margin:"auto 0px 5px 5px"}});function kR(e){var t,n,r,o,i,s,a,c,d;const{item:p,applyValue:h,type:m,apiRef:g,focusElementRef:y,getOptionLabel:v,getOptionValue:S,placeholder:w,tabIndex:C,label:x,clearButton:P}=e,_=ne(e,Lfe),[I,k]=u.useState((t=p.value)!=null?t:""),M=on(),O=on(),F=tt(),L=(n=(r=F.slotProps)==null||(o=r.baseSelect)==null?void 0:o.native)!=null?n:!0;let D=null;if(p.field){const N=g.current.getColumn(p.field);Oa(N)&&(D=N)}const B=S||((i=D)==null?void 0:i.getOptionValue),R=v||((s=D)==null?void 0:s.getOptionLabel),A=u.useMemo(()=>{if(D)return typeof D.valueOptions=="function"?D.valueOptions({field:D.field}):D.valueOptions},[D]),z=u.useCallback(N=>{let H=N.target.value;H=jw(H,A,B),k(String(H)),h(E({},p,{value:H}))},[A,B,h,p]);if(u.useEffect(()=>{var N;let H;if(A!==void 0){if(H=jw(p.value,A,B),H!==p.value){h(E({},p,{value:H}));return}}else H=p.value;H=(N=H)!=null?N:"",k(String(H))},[p,A,h,B]),!Oa(D)||!Oa(D))return null;const V=x!=null?x:g.current.getLocaleText("filterPanelInputLabel");return T.jsxs(Afe,{children:[T.jsxs(F.slots.baseFormControl,{children:[T.jsx(F.slots.baseInputLabel,E({},(a=F.slotProps)==null?void 0:a.baseInputLabel,{id:O,htmlFor:M,shrink:!0,variant:"standard",children:V})),T.jsx(F.slots.baseSelect,E({id:M,label:V,labelId:O,value:I,onChange:z,variant:"standard",type:m||"text",inputProps:{tabIndex:C,ref:y,placeholder:w!=null?w:g.current.getLocaleText("filterPanelInputPlaceholder")},native:L},_,(c=F.slotProps)==null?void 0:c.baseSelect,{children:Ffe({column:D,OptionComponent:F.slots.baseSelectOption,getOptionLabel:R,getOptionValue:B,isSelectNative:L,baseSelectOptionProps:(d=F.slotProps)==null?void 0:d.baseSelectOption})}))]}),P]})}const Nfe=["item","applyValue","apiRef","focusElementRef","isFilterActive","clearButton","tabIndex","label"],Dfe=oe("div")({display:"flex",alignItems:"center",width:"100%",["& button"]:{margin:"auto 0px 5px 5px"}});function Bfe(e){var t,n,r,o;const{item:i,applyValue:s,apiRef:a,focusElementRef:c,clearButton:d,tabIndex:p,label:h}=e,m=ne(e,Nfe),[g,y]=u.useState(i.value||""),v=tt(),S=on(),w=on(),C=((t=v.slotProps)==null?void 0:t.baseSelect)||{},x=(n=C.native)!=null?n:!0,P=((r=v.slotProps)==null?void 0:r.baseSelectOption)||{},_=u.useCallback(k=>{const M=k.target.value;y(M),s(E({},i,{value:M}))},[s,i]);u.useEffect(()=>{y(i.value||"")},[i.value]);const I=h!=null?h:a.current.getLocaleText("filterPanelInputLabel");return T.jsxs(Dfe,{children:[T.jsxs(v.slots.baseFormControl,{fullWidth:!0,children:[T.jsx(v.slots.baseInputLabel,E({},(o=v.slotProps)==null?void 0:o.baseInputLabel,{id:S,shrink:!0,variant:"standard",children:I})),T.jsxs(v.slots.baseSelect,E({labelId:S,id:w,label:I,value:g,onChange:_,variant:"standard",native:x,displayEmpty:!0,inputProps:{ref:c,tabIndex:p}},m,C,{children:[T.jsx(v.slots.baseSelectOption,E({},P,{native:x,value:"",children:a.current.getLocaleText("filterValueAny")})),T.jsx(v.slots.baseSelectOption,E({},P,{native:x,value:"true",children:a.current.getLocaleText("filterValueTrue")})),T.jsx(v.slots.baseSelectOption,E({},P,{native:x,value:"false",children:a.current.getLocaleText("filterValueFalse")}))]}))]}),d]})}const zfe=["logicOperators","columnsSort","filterFormProps","getColumnForNewFilter","children","disableAddFilterButton","disableRemoveAllButton"],_R=e=>({field:e.field,operator:e.filterOperators[0].value,id:Math.round(Math.random()*1e5)}),jfe=u.forwardRef(function(t,n){var r,o;const i=Dt(),s=tt(),a=Ge(i,Cr),c=Ge(i,EA),d=u.useRef(null),p=u.useRef(null),{logicOperators:h=[no.And,no.Or],columnsSort:m,filterFormProps:g,getColumnForNewFilter:y,disableAddFilterButton:v=!1,disableRemoveAllButton:S=!1}=t,w=ne(t,zfe),C=u.useCallback(L=>{i.current.upsertFilterItem(L)},[i]),x=u.useCallback(L=>{i.current.setFilterLogicOperator(L)},[i]),P=u.useCallback(()=>{let L;if(y&&typeof y=="function"){const D=y({currentFilters:(a==null?void 0:a.items)||[],columns:c});if(D===null)return null;L=c.find(({field:B})=>B===D)}else L=c.find(D=>{var B;return(B=D.filterOperators)==null?void 0:B.length});return L?_R(L):null},[a==null?void 0:a.items,c,y]),_=u.useCallback(()=>{if(y===void 0||typeof y!="function")return P();const L=a.items.length?a.items:[P()].filter(Boolean),D=y({currentFilters:L,columns:c});if(D===null)return null;const B=c.find(({field:R})=>R===D);return B?_R(B):null},[a.items,c,y,P]),I=u.useMemo(()=>a.items.length?a.items:(p.current||(p.current=P()),p.current?[p.current]:[]),[a.items,P]),k=I.length>1,M=()=>{const L=_();L&&i.current.upsertFilterItems([...I,L])},O=u.useCallback(L=>{const D=I.length===1;i.current.deleteFilterItem(L),D&&i.current.hideFilterPanel()},[i,I.length]),F=()=>{I.length===1&&I[0].value===void 0&&(i.current.deleteFilterItem(I[0]),i.current.hideFilterPanel()),i.current.setFilterModel(E({},a,{items:[]}))};return u.useEffect(()=>{h.length>0&&a.logicOperator&&!h.includes(a.logicOperator)&&x(h[0])},[h,x,a.logicOperator]),u.useEffect(()=>{I.length>0&&d.current.focus()},[I.length]),T.jsxs(o4,E({ref:n},w,{children:[T.jsx(n4,{children:I.map((L,D)=>T.jsx($fe,E({item:L,applyFilterChanges:C,deleteFilter:O,hasMultipleFilters:k,showMultiFilterOperators:D>0,multiFilterOperator:a.logicOperator,disableMultiFilterOperator:D!==1,applyMultiFilterOperatorChanges:x,focusElementRef:D===I.length-1?d:null,logicOperators:h,columnsSort:m},g),L.id==null?D:L.id))}),!s.disableMultipleColumnsFiltering&&!(v&&S)?T.jsxs(r4,{children:[v?T.jsx("span",{}):T.jsx(s.slots.baseButton,E({onClick:M,startIcon:T.jsx(s.slots.filterPanelAddIcon,{})},(r=s.slotProps)==null?void 0:r.baseButton,{children:i.current.getLocaleText("filterPanelAddFilter")})),S?null:T.jsx(s.slots.baseButton,E({onClick:F,startIcon:T.jsx(s.slots.filterPanelRemoveAllIcon,{})},(o=s.slotProps)==null?void 0:o.baseButton,{children:i.current.getLocaleText("filterPanelRemoveAll")}))]}):null]}))}),Hfe=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"];function i4(e){const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,color:s,error:a,helperText:c,size:d,variant:p}=e,h=ne(e,Hfe),m={color:s,error:a,helperText:c,size:d,variant:p},[g,y]=u.useState(t.value||[]),v=on(),S=tt();u.useEffect(()=>{var C;const x=(C=t.value)!=null?C:[];y(x.map(String))},[t.value]);const w=u.useCallback((C,x)=>{y(x.map(String)),n(E({},t,{value:[...x]}))},[n,t]);return T.jsx(Dx,E({multiple:!0,freeSolo:!0,options:[],filterOptions:(C,x)=>{const{inputValue:P}=x;return P==null||P===""?[]:[P]},id:v,value:g,onChange:w,renderTags:(C,x)=>C.map((P,_)=>T.jsx(S.slots.baseChip,E({variant:"outlined",size:"small",label:P},x({index:_})))),renderInput:C=>{var x;return T.jsx(S.slots.baseTextField,E({},C,{label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:E({},C.InputLabelProps,{shrink:!0}),inputRef:i,type:r||"text"},m,(x=S.slotProps)==null?void 0:x.baseTextField))}},h))}const Vfe=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant","getOptionLabel","getOptionValue"],Ufe=BL();function Wfe(e){var t,n;const{item:r,applyValue:o,apiRef:i,focusElementRef:s,color:a,error:c,helperText:d,size:p,variant:h="standard",getOptionLabel:m,getOptionValue:g}=e,y=ne(e,Vfe),v={color:a,error:c,helperText:d,size:p,variant:h},S=on(),w=tt();let C=null;if(r.field){const F=i.current.getColumn(r.field);Oa(F)&&(C=F)}const x=g||((t=C)==null?void 0:t.getOptionValue),P=m||((n=C)==null?void 0:n.getOptionLabel),_=u.useCallback((F,L)=>x(F)===x(L),[x]),I=u.useMemo(()=>{var F;return(F=C)!=null&&F.valueOptions?typeof C.valueOptions=="function"?C.valueOptions({field:C.field}):C.valueOptions:[]},[C]),k=u.useMemo(()=>I==null?void 0:I.map(x),[I,x]),M=u.useMemo(()=>Array.isArray(r.value)?I!==void 0?r.value.map(L=>k==null?void 0:k.findIndex(D=>D===L)).filter(L=>L>=0).map(L=>I[L]):r.value:[],[r.value,I,k]);u.useEffect(()=>{(!Array.isArray(r.value)||M.length!==r.value.length)&&o(E({},r,{value:M.map(x)}))},[r,M,o,x]);const O=u.useCallback((F,L)=>{o(E({},r,{value:L.map(x)}))},[o,r,x]);return T.jsx(Dx,E({multiple:!0,options:I,isOptionEqualToValue:_,filterOptions:Ufe,id:S,value:M,onChange:O,getOptionLabel:P,renderTags:(F,L)=>F.map((D,B)=>T.jsx(w.slots.baseChip,E({variant:"outlined",size:"small",label:P(D)},L({index:B})))),renderInput:F=>{var L;return T.jsx(w.slots.baseTextField,E({},F,{label:i.current.getLocaleText("filterPanelInputLabel"),placeholder:i.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:E({},F.InputLabelProps,{shrink:!0}),inputRef:s,type:"singleSelect"},v,(L=w.slotProps)==null?void 0:L.baseTextField))}},y))}const Gfe=["hideMenu","options"],Kfe=["hideMenu","options"];function qfe(e){const t=Dt(),{hideMenu:n,options:r}=e,o=ne(e,Gfe);return T.jsx(fo,E({onClick:()=>{t.current.exportDataAsCsv(r),n==null||n()}},o,{children:t.current.getLocaleText("toolbarExportCSV")}))}function Yfe(e){const t=Dt(),{hideMenu:n,options:r}=e,o=ne(e,Kfe);return T.jsx(fo,E({onClick:()=>{t.current.exportDataAsPrint(r),n==null||n()}},o,{children:t.current.getLocaleText("toolbarExportPrint")}))}const Qfe=["className","rowCount","visibleRowCount"],Xfe=e=>{const{classes:t}=e;return Me({root:["rowCount"]},Bt,t)},Jfe=vr("div",{name:"MuiDataGrid",slot:"RowCount",overridesResolver:(e,t)=>t.rowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2)})),Zfe=u.forwardRef(function(t,n){const{className:r,rowCount:o,visibleRowCount:i}=t,s=ne(t,Qfe),a=Dt(),c=tt(),d=Xfe(c);if(o===0)return null;const p=i<o?a.current.getLocaleText("footerTotalVisibleRows")(i,o):o.toLocaleString();return T.jsxs(Jfe,E({ref:n,className:he(d.root,r),ownerState:c},s,{children:[a.current.getLocaleText("footerTotalRows")," ",p]}))}),epe=["className","selectedRowCount"],tpe=e=>{const{classes:t}=e;return Me({root:["selectedRowCount"]},Bt,t)},npe=vr("div",{name:"MuiDataGrid",slot:"SelectedRowCount",overridesResolver:(e,t)=>t.selectedRowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2),visibility:"hidden",width:0,height:0,[e.breakpoints.up("sm")]:{visibility:"visible",width:"auto",height:"auto"}})),rpe=u.forwardRef(function(t,n){const{className:r,selectedRowCount:o}=t,i=ne(t,epe),s=Dt(),a=tt(),c=tpe(a),d=s.current.getLocaleText("footerRowSelected")(o);return T.jsx(npe,E({ref:n,className:he(c.root,r),ownerState:a},i,{children:d}))}),ope=u.forwardRef(function(t,n){var r;const o=Dt(),i=tt(),s=Ge(o,Pae),a=Ge(o,Kue),c=Ge(o,yy),d=!i.hideFooterSelectedRowCount&&a>0?T.jsx(rpe,{selectedRowCount:a}):T.jsx("div",{}),p=!i.hideFooterRowCount&&!i.pagination?T.jsx(Zfe,{rowCount:s,visibleRowCount:c}):null,h=i.pagination&&!i.hideFooterPagination&&i.slots.pagination&&T.jsx(i.slots.pagination,E({},(r=i.slotProps)==null?void 0:r.pagination));return T.jsxs(oue,E({ref:n},t,{children:[d,p,h]}))});function ipe(){var e,t;const n=tt();return T.jsxs(u.Fragment,{children:[T.jsx(n.slots.preferencesPanel,E({},(e=n.slotProps)==null?void 0:e.preferencesPanel)),n.slots.toolbar&&T.jsx(n.slots.toolbar,E({},(t=n.slotProps)==null?void 0:t.toolbar))]})}const spe=u.forwardRef(function(t,n){return T.jsx(nE,E({ref:n},t,{children:T.jsx(Ka,{})}))}),lpe=u.forwardRef(function(t,n){const o=Dt().current.getLocaleText("noRowsLabel");return T.jsx(nE,E({ref:n},t,{children:o}))}),ape=oe(Ere)(({theme:e})=>({[`& .${Ma.selectLabel}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},[`& .${Ma.input}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"inline-flex"}}})),cpe=u.forwardRef(function(t,n){const r=Dt(),o=tt(),i=Ge(r,si),s=Ge(r,yy),a=u.useMemo(()=>{var g,y;return(g=(y=o.rowCount)!=null?y:s)!=null?g:0},[o.rowCount,s]),c=u.useMemo(()=>Math.floor(a/(i.pageSize||1)),[a,i.pageSize]),d=u.useCallback(g=>{const y=Number(g.target.value);r.current.setPageSize(y)},[r]),p=u.useCallback((g,y)=>{r.current.setPage(y)},[r]),m=(g=>{for(let y=0;y<o.pageSizeOptions.length;y+=1){const v=o.pageSizeOptions[y];if(typeof v=="number"){if(v===g)return!0}else if(v.value===g)return!0}return!1})(i.pageSize)?o.pageSizeOptions:[];return T.jsx(ape,E({ref:n,component:"div",count:a,page:i.page<=c?i.page:c,rowsPerPageOptions:m,rowsPerPage:i.pageSize,onPageChange:p,onRowsPerPageChange:d},r.current.getLocaleText("MuiTablePagination"),t))}),sE=(e,t)=>{let n,r;return t.pagination&&t.paginationMode==="client"?(r=oE(e),n=Gue(e)):(n=ia(e),n.length===0?r=null:r={firstRowIndex:0,lastRowIndex:n.length-1}),{rows:n,range:r}},ac=(e,t)=>{const n=sE(e,t);return u.useMemo(()=>({rows:n.rows,range:n.range}),[n.rows,n.range])},Hw={current:null};function Fp(e){return e.isInternal=!0,e}function Ag(e){return e!==void 0&&e.isInternal===!0}function upe(e){return Fp((t,n)=>{const r=e(t,n);return r&&(o=>r(o.value,o.row,n,Hw.current))})}function Ap(e){return e.map(t=>E({},t,{getApplyFilterFn:upe(t.getApplyFilterFnV7),getApplyFilterFnV7:Fp(t.getApplyFilterFnV7)}))}function s4(e){return Fp((t,n,r)=>{const o=e(t,n,r);return o&&(i=>o(i.value,i.row,n,r))})}const $R=Fp(e=>{if(!e)return null;const t=new RegExp(Om(e),"i");return(n,r,o,i)=>{const s=i.current.getRowFormattedValue(r,o);return s!=null?t.test(s.toString()):!1}}),dpe=(e=!1)=>Ap([{value:"contains",getApplyFilterFnV7:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(Om(n),"i");return o=>o!=null?r.test(String(o)):!1},InputComponent:es},{value:"equals",getApplyFilterFnV7:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return o=>o!=null?r.compare(n,o.toString())===0:!1},InputComponent:es},{value:"startsWith",getApplyFilterFnV7:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`^${Om(n)}.*$`,"i");return o=>o!=null?r.test(o.toString()):!1},InputComponent:es},{value:"endsWith",getApplyFilterFnV7:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`.*${Om(n)}$`,"i");return o=>o!=null?r.test(o.toString()):!1},InputComponent:es},{value:"isEmpty",getApplyFilterFnV7:()=>t=>t===""||t==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFnV7:()=>t=>t!==""&&t!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFnV7:t=>{if(!Array.isArray(t.value)||t.value.length===0)return null;const n=e?t.value:t.value.map(o=>o.trim()),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return o=>o!=null?n.some(i=>r.compare(i,o.toString()||"")===0):!1},InputComponent:i4}]),Xl={width:100,minWidth:50,maxWidth:1/0,hideable:!0,sortable:!0,resizable:!0,filterable:!0,groupable:!0,pinnable:!0,aggregable:!0,editable:!1,sortComparator:tde,type:"string",align:"left",filterOperators:dpe(),renderEditCell:kce,getApplyQuickFilterFn:s4($R),getApplyQuickFilterFnV7:$R},fpe=()=>Ap([{value:"is",getApplyFilterFnV7:e=>{if(!e.value)return null;const t=e.value==="true";return n=>!!n===t},InputComponent:Bfe}]);function ppe({value:e,api:t}){return e?t.getLocaleText("booleanCellTrueLabel"):t.getLocaleText("booleanCellFalseLabel")}const hpe=e=>{switch(e.toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case"null":case"undefined":return!1;default:return}},l4=E({},Xl,{type:"boolean",align:"center",headerAlign:"center",renderCell:hce,renderEditCell:yce,sortComparator:ZA,valueFormatter:ppe,filterOperators:fpe(),getApplyQuickFilterFn:void 0,getApplyQuickFilterFnV7:void 0,aggregable:!1,pastedValueParser:e=>hpe(e)}),ml="__check__",Np=E({},l4,{field:ml,type:"checkboxSelection",width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:void 0,getApplyQuickFilterFnV7:void 0,valueGetter:e=>Fg(e.api.state,e.api.instanceId)[e.id]!==void 0,renderHeader:e=>T.jsx(fde,E({},e)),renderCell:e=>T.jsx(cde,E({},e))}),Sy="actions",mpe=E({},Xl,{sortable:!1,filterable:!1,aggregable:!1,width:100,align:"center",headerAlign:"center",headerName:"",disableColumnMenu:!0,disableExport:!0,renderCell:Gce,getApplyQuickFilterFn:void 0,getApplyQuickFilterFnV7:void 0}),lE="__detail_panel_toggle__",Hr=e=>e.editRows,gpe=["selected","rowId","row","index","style","position","rowHeight","className","visibleColumns","renderedColumns","containerWidth","firstColumnToRender","lastColumnToRender","isLastVisible","focusedCell","tabbableCell","onClick","onDoubleClick","onMouseEnter","onMouseLeave"],vpe=e=>{const{editable:t,editing:n,selected:r,isLastVisible:o,rowHeight:i,classes:s}=e;return Me({root:["row",r&&"selected",t&&"row--editable",n&&"row--editing",o&&"row--lastVisible",i==="auto"&&"row--dynamicHeight"]},Bt,s)};function ype({width:e}){if(!e)return null;const t={width:e};return T.jsx("div",{className:`${X.cell} ${X.withBorderColor}`,style:t})}const bpe=u.forwardRef(function(t,n){const{selected:r,rowId:o,row:i,index:s,style:a,position:c,rowHeight:d,className:p,renderedColumns:h,containerWidth:m,firstColumnToRender:g,isLastVisible:y=!1,onClick:v,onDoubleClick:S,onMouseEnter:w,onMouseLeave:C}=t,x=ne(t,gpe),P=Dt(),_=u.useRef(null),I=tt(),k=ac(P,I),M=Ge(P,YS),O=Ge(P,ni),F=Ge(P,vy),L=Ge(P,Op),D=Ge(P,Hr),B=Vt(_,n),R=s+L+2,A={selected:r,isLastVisible:y,classes:I.classes,editing:P.current.getRowMode(o)===mn.Edit,editable:I.editMode===vs.Row,rowHeight:d},z=vpe(A);u.useLayoutEffect(()=>{d==="auto"&&_.current&&typeof ResizeObserver=="undefined"&&P.current.unstable_storeRowHeightMeasurement(o,_.current.clientHeight,c)},[P,d,o,c]),u.useLayoutEffect(()=>{if(k.range){const Ye=P.current.getRowIndexRelativeToVisibleRows(o);Ye!=null&&P.current.unstable_setLastMeasuredRowIndex(Ye)}const be=_.current;if(!be||d!=="auto"||typeof ResizeObserver=="undefined")return;const Oe=new ResizeObserver(Ye=>{const[Ke]=Ye,Ue=Ke.borderBoxSize&&Ke.borderBoxSize.length>0?Ke.borderBoxSize[0].blockSize:Ke.contentRect.height;P.current.unstable_storeRowHeightMeasurement(o,Ue,c)});return Oe.observe(be),()=>Oe.disconnect()},[P,k.range,s,d,o,c]);const V=u.useCallback((be,te)=>Oe=>{Oe.target.nodeType===1&&!Oe.currentTarget.contains(Oe.target)||P.current.getRow(o)&&(P.current.publishEvent(be,P.current.getRowParams(o),Oe),te&&te(Oe))},[P,o]),N=u.useCallback(be=>{const te=Jae(be.target,X.cell),Oe=te==null?void 0:te.getAttribute("data-field");Oe&&(Oe===Np.field||Oe===lE||Oe==="__reorder__"||P.current.getCellMode(o,Oe)===rn.Edit||P.current.getColumn(Oe).type===Sy)||V("rowClick",v)(be)},[P,v,V,o]),{slots:H,slotProps:W,disableColumnReorder:K}=I,Y=H.cell===zw?zw:ace,ie=I.rowReordering,re=(be,te)=>{var Oe,Ye;const Ke=K&&be.disableReorder||!ie&&!!O.length&&F>1&&Object.keys(D).length>0,Ue=(Oe=(Ye=D[o])==null?void 0:Ye[be.field])!=null?Oe:null;return T.jsx(Y,E({column:be,width:te.width,rowId:o,height:d,showRightBorder:te.showRightBorder,align:be.align||"left",colIndex:te.indexRelativeToAllColumns,colSpan:te.colSpan,disableDragEvents:Ke,editCellState:Ue},W==null?void 0:W.cell),be.field)},de=Ge(P,()=>E({},P.current.unstable_getRowInternalSizes(o)),KS);let se=d;if(se==="auto"&&de){let be=0;const te=Object.entries(de).reduce((Oe,[Ye,Ke])=>/^base[A-Z]/.test(Ye)?(be+=1,Ke>Oe?Ke:Oe):Oe,0);te>0&&be>1&&(se=te)}const le=E({},a,{maxHeight:d==="auto"?"none":d,minHeight:se});if(de!=null&&de.spacingTop){const be=I.rowSpacingType==="border"?"borderTopWidth":"marginTop";le[be]=de.spacingTop}if(de!=null&&de.spacingBottom){const be=I.rowSpacingType==="border"?"borderBottomWidth":"marginBottom";let te=le[be];typeof te!="number"&&(te=parseInt(te||"0",10)),te+=de.spacingBottom,le[be]=te}const Ee=P.current.unstable_applyPipeProcessors("rowClassName",[],o);if(typeof I.getRowClassName=="function"){var ye;const be=s-(((ye=k.range)==null?void 0:ye.firstRowIndex)||0),te=E({},P.current.getRowParams(o),{isFirstVisible:be===0,isLastVisible:be===k.rows.length-1,indexRelativeToCurrentPage:be});Ee.push(I.getRowClassName(te))}const _e=Bue(1e4,20,80),ee=P.current.getRowNode(o);if(!ee)return null;const ke=ee.type,Re=[];for(let be=0;be<h.length;be+=1){const te=h[be],Oe=g+be,Ye=P.current.unstable_getCellColSpanInfo(o,Oe);if(Ye&&!Ye.spannedByColSpan)if(ke!=="skeletonRow"){const{colSpan:Ke,width:Ue}=Ye.cellProps,De={width:Ue,colSpan:Ke,showRightBorder:I.showCellVerticalBorder,indexRelativeToAllColumns:Oe};Re.push(re(te,De))}else{const{width:Ke}=Ye.cellProps,Ue=Math.round(_e());Re.push(T.jsx(H.skeletonCell,{width:Ke,contentWidth:Ue,field:te.field,align:te.align},te.field))}}const Pe=m-M,pe=i?{onClick:N,onDoubleClick:V("rowDoubleClick",S),onMouseEnter:V("rowMouseEnter",w),onMouseLeave:V("rowMouseLeave",C)}:null;return T.jsxs("div",E({ref:B,"data-id":o,"data-rowindex":s,role:"row",className:he(...Ee,z.root,p),"aria-rowindex":R,"aria-selected":r,style:le},pe,x,{children:[Re,Pe>0&&T.jsx(ype,{width:Pe})]}))}),wpe=xy(bpe);function Cpe({privateApiRef:e,props:t,children:n}){const r=u.useRef(e.current.getPublicApi());return T.jsx(CA.Provider,{value:t,children:T.jsx(xA.Provider,{value:e,children:T.jsx(wA.Provider,{value:r,children:n})})})}const xpe=Nue()&&window.localStorage.getItem("DEBUG")!=null,af=()=>{},Spe={debug:af,info:af,warn:af,error:af},RR=["debug","info","warn","error"];function MR(e,t,n=console){const r=RR.indexOf(t);if(r===-1)throw new Error(`MUI: Log level ${t} not recognized.`);return RR.reduce((i,s,a)=>(a>=r?i[s]=(...c)=>{const[d,...p]=c;n[s](`MUI: ${e} - ${d}`,...p)}:i[s]=af,i),{})}const Epe=(e,t)=>{const n=u.useCallback(r=>xpe?MR(r,"debug",t.logger):t.logLevel?MR(r,t.logLevel.toString(),t.logger):Spe,[t.logLevel,t.logger]);Ft(e,{getLogger:n},"private")};class aE{static create(t){return new aE(t)}constructor(t){this.value=void 0,this.listeners=void 0,this.subscribe=n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}),this.getSnapshot=()=>this.value,this.update=n=>{this.value=n,this.listeners.forEach(r=>r(n))},this.value=t,this.listeners=new Set}}class Ppe{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,n,r={}){let o=this.events[t];o||(o={highPriority:new Map,regular:new Map},this.events[t]=o),r.isFirst?o.highPriority.set(n,!0):o.regular.set(n,!0)}removeListener(t,n){this.events[t]&&(this.events[t].regular.delete(n),this.events[t].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(t,...n){const r=this.events[t];if(!r)return;const o=Array.from(r.highPriority.keys()),i=Array.from(r.regular.keys());for(let s=o.length-1;s>=0;s-=1){const a=o[s];r.highPriority.has(a)&&a.apply(this,n)}for(let s=0;s<i.length;s+=1){const a=i[s];r.regular.has(a)&&a.apply(this,n)}}once(t,n){const r=this;this.on(t,function o(...i){r.removeListener(t,o),n.apply(r,i)})}}const a4=Symbol("mui.api_private"),Ipe=e=>e.isPropagationStopped!==void 0;let TR=0;function kpe(e){var t;const n=(t=e.current)==null?void 0:t[a4];if(n)return n;const r={},o={state:r,store:aE.create(r),instanceId:{id:TR}};return TR+=1,o.getPublicApi=()=>e.current,o.register=(i,s)=>{Object.keys(s).forEach(a=>{const c=s[a],d=o[a];if((d==null?void 0:d.spying)===!0?d.target=c:o[a]=c,i==="public"){const p=e.current,h=p[a];(h==null?void 0:h.spying)===!0?h.target=c:p[a]=c}})},o.register("private",{caches:{},eventManager:new Ppe}),o}function _pe(e){return{get state(){return e.current.state},get store(){return e.current.store},get instanceId(){return e.current.instanceId},[a4]:e.current}}function $pe(e,t){const n=u.useRef(),r=u.useRef();r.current||(r.current=kpe(n)),n.current||(n.current=_pe(r));const o=u.useCallback((...s)=>{const[a,c,d={}]=s;if(d.defaultMuiPrevented=!1,Ipe(d)&&d.isPropagationStopped())return;const p=t.signature===fs.DataGridPro?{api:r.current.getPublicApi()}:{};r.current.eventManager.emit(a,c,d,p)},[r,t.signature]),i=u.useCallback((s,a,c)=>{r.current.eventManager.on(s,a,c);const d=r.current;return()=>{d.eventManager.removeListener(s,a)}},[r]);return Ft(r,{subscribeEvent:i,publishEvent:o},"public"),u.useImperativeHandle(e,()=>n.current,[n]),u.useEffect(()=>{const s=r.current;return()=>{s.publishEvent("unmount")}},[r]),r}const Rpe=(e,t)=>{const n=u.useCallback(r=>{if(t.localeText[r]==null)throw new Error(`Missing translation for key ${r}.`);return t.localeText[r]},[t.localeText]);e.current.register("public",{getLocaleText:n})};function up(e){return up=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},up(e)}function Mpe(e,t){if(up(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(up(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dp(e){var t=Mpe(e,"string");return up(t)==="symbol"?t:String(t)}const Tpe=e=>{const t=u.useRef({}),n=u.useRef(!1),r=u.useCallback(p=>{n.current||!p||(n.current=!0,Object.values(p.appliers).forEach(h=>{h()}),n.current=!1)},[]),o=u.useCallback((p,h,m)=>{t.current[p]||(t.current[p]={processors:new Map,appliers:{}});const g=t.current[p];return g.processors.get(h)!==m&&(g.processors.set(h,m),r(g)),()=>{t.current[p].processors.set(h,null)}},[r]),i=u.useCallback((p,h,m)=>(t.current[p]||(t.current[p]={processors:new Map,appliers:{}}),t.current[p].appliers[h]=m,()=>{const g=t.current[p].appliers,y=ne(g,[h].map(dp));t.current[p].appliers=y}),[]),s=u.useCallback(p=>{const h=t.current[p];r(h)},[r]),a=u.useCallback((...p)=>{const[h,m,g]=p;return t.current[h]?Array.from(t.current[h].processors.values()).reduce((v,S)=>S?S(v,g):v,m):m},[]),c={registerPipeProcessor:o,registerPipeApplier:i,requestPipeProcessorsApplication:s},d={unstable_applyPipeProcessors:a};Ft(e,c,"private"),Ft(e,d,"public")},ir=(e,t,n)=>{const r=u.useRef(),o=u.useRef(`mui-${Math.round(Math.random()*1e9)}`),i=u.useCallback(()=>{r.current=e.current.registerPipeProcessor(t,o.current,n)},[e,n,t]);Lp(()=>{i()});const s=u.useRef(!0);u.useEffect(()=>(s.current?s.current=!1:i(),()=>{r.current&&(r.current(),r.current=null)}),[i])},cE=(e,t,n)=>{const r=u.useRef(),o=u.useRef(`mui-${Math.round(Math.random()*1e9)}`),i=u.useCallback(()=>{r.current=e.current.registerPipeApplier(t,o.current,n)},[e,n,t]);Lp(()=>{i()});const s=u.useRef(!0);u.useEffect(()=>(s.current?s.current=!1:i(),()=>{r.current&&(r.current(),r.current=null)}),[i])},Ng=(e,t,n,r)=>{const o=u.useCallback(()=>{e.current.registerStrategyProcessor(t,n,r)},[e,r,n,t]);Lp(()=>{o()});const i=u.useRef(!0);u.useEffect(()=>{i.current?i.current=!1:o()},[o])},Ja="none",OR={rowTreeCreation:"rowTree",filtering:"rowTree",sorting:"rowTree",visibleRowsLookupCreation:"rowTree"},Ope=e=>{const t=u.useRef(new Map),n=u.useRef({}),r=u.useCallback((c,d,p)=>{const h=()=>{const y=n.current[d],v=ne(y,[c].map(dp));n.current[d]=v};n.current[d]||(n.current[d]={});const m=n.current[d],g=m[c];return m[c]=p,!g||g===p||c===e.current.getActiveStrategy(OR[d])&&e.current.publishEvent("activeStrategyProcessorChange",d),h},[e]),o=u.useCallback((c,d)=>{const p=e.current.getActiveStrategy(OR[c]);if(p==null)throw new Error("Can't apply a strategy processor before defining an active strategy");const h=n.current[c];if(!h||!h[p])throw new Error(`No processor found for processor "${c}" on strategy "${p}"`);const m=h[p];return m(d)},[e]),i=u.useCallback(c=>{var d;const h=Array.from(t.current.entries()).find(([,m])=>m.group!==c?!1:m.isAvailable());return(d=h==null?void 0:h[0])!=null?d:Ja},[]),s=u.useCallback((c,d,p)=>{t.current.set(d,{group:c,isAvailable:p}),e.current.publishEvent("strategyAvailabilityChange")},[e]);Ft(e,{registerStrategyProcessor:r,applyStrategyProcessor:o,getActiveStrategy:i,setStrategyAvailability:s},"private")},Lpe=(e,t)=>{const n=u.useRef({}),[,r]=u.useState(),o=u.useCallback(p=>{n.current[p.stateId]=p},[]),i=u.useCallback((p,h)=>{let m;if(WA(p)?m=p(e.current.state):m=p,e.current.state===m)return!1;let g=!1;const y=[];if(Object.keys(n.current).forEach(v=>{const S=n.current[v],w=S.stateSelector(e.current.state,e.current.instanceId),C=S.stateSelector(m,e.current.instanceId);C!==w&&(y.push({stateId:S.stateId,hasPropChanged:C!==S.propModel}),S.propModel!==void 0&&C!==S.propModel&&(g=!0))}),y.length>1)throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${y[0].stateId}, therefore, you're not allowed to update ${y.map(v=>v.stateId).join(", ")} in the same transaction.`);if(g||(e.current.state=m,e.current.publishEvent&&e.current.publishEvent("stateChange",m),e.current.store.update(m)),y.length===1){const{stateId:v,hasPropChanged:S}=y[0],w=n.current[v],C=w.stateSelector(m,e.current.instanceId);if(w.propOnChange&&S){const x=t.signature===fs.DataGridPro?{api:e.current,reason:h}:{reason:h};w.propOnChange(C,x)}g||e.current.publishEvent(w.changeEvent,C,{reason:h})}return!g},[e,t.signature]),s=u.useCallback((p,h,m)=>e.current.setState(g=>E({},g,{[p]:h(g[p])}),m),[e]),a=u.useCallback(()=>r(()=>e.current.state),[e]),c={setState:i,forceUpdate:a},d={updateControlState:s,registerControlState:o};Ft(e,c,"public"),Ft(e,d,"private")},Fpe=(e,t)=>{const n=$pe(e,t);return Epe(n,t),Lpe(n,t),Tpe(n),Ope(n),Rpe(n,t),n},Co=(e,t,n)=>{const r=u.useRef(!1);r.current||(t.current.state=e(t.current.state,n,t),r.current=!0)},Ape=/(\d+)-(\d+)-(\d+)/,Npe=/(\d+)-(\d+)-(\d+)T(\d+):(\d+)/;function Oc(e,t,n,r){if(!e.value)return null;const[o,i,s,a,c]=e.value.match(n?Npe:Ape).slice(1).map(Number),d=new Date(o,i-1,s,a||0,c||0).getTime();return p=>{if(!p)return!1;if(r)return t(p.getTime(),d);const m=new Date(p).setHours(n?p.getHours():0,n?p.getMinutes():0,0,0);return t(m,d)}}const c4=e=>Ap([{value:"is",getApplyFilterFnV7:t=>Oc(t,(n,r)=>n===r,e),InputComponent:Tc,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"not",getApplyFilterFnV7:t=>Oc(t,(n,r)=>n!==r,e),InputComponent:Tc,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"after",getApplyFilterFnV7:t=>Oc(t,(n,r)=>n>r,e),InputComponent:Tc,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFnV7:t=>Oc(t,(n,r)=>n>=r,e),InputComponent:Tc,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"before",getApplyFilterFnV7:t=>Oc(t,(n,r)=>n<r,e,!e),InputComponent:Tc,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrBefore",getApplyFilterFnV7:t=>Oc(t,(n,r)=>n<=r,e),InputComponent:Tc,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFnV7:()=>t=>t==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFnV7:()=>t=>t!=null,requiresFilterValue:!1}]);function u4({value:e,columnType:t,rowId:n,field:r}){if(!(e instanceof Date))throw new Error([`MUI: \`${t}\` column type only accepts \`Date\` objects as values.`,"Use `valueGetter` to transform the value into a `Date` object.",`Row ID: ${n}, field: "${r}".`].join(`
|
|
333
|
-
`))}function
|
|
334
|
-
`,"\r"].some(r=>n.includes(r))?`"${n}"`:n}return e}const f4=(e,t)=>{const{delimiterCharacter:n,ignoreValueFormatter:r}=t;let o;if(r){var i;const a=e.colDef.type;if(a==="number")o=String(e.value);else if(a==="date"||a==="dateTime"){var s;o=(s=e.value)==null?void 0:s.toISOString()}else typeof((i=e.value)==null?void 0:i.toString)=="function"?o=e.value.toString():o=e.value}else o=e.formattedValue;return Vw(o,n)};ws(["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."]);class Uw{constructor(t){this.options=void 0,this.rowString="",this.isEmpty=!0,this.options=t}addValue(t){this.isEmpty||(this.rowString+=this.options.delimiterCharacter),t==null?this.rowString+="":typeof this.options.sanitizeCellValue=="function"?this.rowString+=this.options.sanitizeCellValue(t,this.options.delimiterCharacter):this.rowString+=t,this.isEmpty=!1}getRowString(){return this.rowString}}const
|
|
327
|
+
*/var Fu=u;function kie(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _ie=typeof Object.is=="function"?Object.is:kie,$ie=Fu.useState,Rie=Fu.useEffect,Mie=Fu.useLayoutEffect,Tie=Fu.useDebugValue;function Oie(e,t){var n=t(),r=$ie({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return Mie(function(){o.value=n,o.getSnapshot=t,j1(o)&&i({inst:o})},[e,n,t]),Rie(function(){return j1(o)&&i({inst:o}),e(function(){j1(o)&&i({inst:o})})},[e]),Tie(n),n}function j1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_ie(e,n)}catch(r){return!0}}function Lie(e,t){return t()}var Fie=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?Lie:Oie;qF.useSyncExternalStore=Fu.useSyncExternalStore!==void 0?Fu.useSyncExternalStore:Fie;KF.exports=qF;var Aie=KF.exports;const Nie=mp(Aie),{use:Y$}=$o,{useSyncExternalStore:Die}=Nie;const Bie=new WeakMap;function gS(e,t){const n=t==null?void 0:t.sync,r=u.useRef(),o=u.useRef();let i=!0;const s=Die(u.useCallback(d=>{const p=mS(e,d,n);return d(),p},[e,n]),()=>{const d=q$(e,Y$);try{if(!i&&r.current&&o.current&&!GF(r.current,d,o.current,new WeakMap))return r.current}catch(p){}return d},()=>q$(e,Y$));i=!1;const a=new WeakMap;u.useEffect(()=>{r.current=s,o.current=a});const c=u.useMemo(()=>new WeakMap,[]);return WF(s,a,c,Bie)}const Au=hS([]),kw={closableContent:"x",padding:!0},zie=['input:not([type="hidden"])',"button","select","textarea","a[href]","[tabindex]"].map(e=>e+':not([disabled]):not([tabindex="-1"])').join(",");window.addEventListener("keydown",e=>{if(e.key!=="Tab")return;const t=document.querySelectorAll("[role=dialog]"),n=t[t.length-1];if(!n)return;const r=n.querySelectorAll(zie),o=r.length;if(!o)return;const[i,s]=e.shiftKey?[o-1,0]:[0,o-1];e.target!==r[s]&&jie(document.activeElement,n)||(r[i].focus(),e.preventDefault())});function jie(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function Hie(){const e=gS(Au);return u.useEffect(()=>{document.body.style.overflow=e.length?"hidden":""},[e.length]),u.createElement(u.Fragment,{},e.length>0&&e.map(t=>u.createElement(Vie,Ce({key:t.$id},t))))}function Vie(e){var r;const t=u.useRef();if(u.useEffect(()=>{var o;(o=t.current)==null||o.focus()},[]),e=Ce(Ce({},kw),e),e.Container)return u.createElement(e.Container,e);return u.createElement("div",{ref:t,className:"dialog-backdrop "+(e.className||""),tabIndex:0,onKeyDown:Uie,onClick:o=>o.target===o.currentTarget&&Bi()},e.noFrame?u.createElement(e.Content||"div"):u.createElement("div",Ce({role:"dialog","aria-modal":!0,className:"dialog",style:Ce(Ce({},n()),(r=e.dialogProps)==null?void 0:r.style),onClick(o){o.stopPropagation()}},e.dialogProps),e.closable||e.closable===void 0&&u.createElement("button",{className:"dialog-icon dialog-closer",onClick(){Bi()}},e.closableContent),e.icon&&u.createElement("div",{className:"dialog-icon dialog-type"},_w(e.icon)),u.createElement("div",{className:"dialog-title"},_w(e.title)),u.createElement("div",{className:"dialog-content"},u.createElement(e.Content||"div"))));function n(){const{innerWidth:o,innerHeight:i}=window,s=e.position;return s&&Ce(Ce({margin:"1em",position:"absolute"},s[0]<o/2?{left:s[0]}:{right:o-s[0]}),s[1]<i/2?{top:s[1]}:{bottom:i-s[1]})}}function _w(e){return typeof e=="function"?u.createElement(e):e}function Uie(e){e.key==="Escape"&&Bi()}function Wo(e){const t=Math.random();return e.$id=t,Au.push(e),{close:n};function n(r){const o=Au.findIndex(i=>i.$id===t);if(!(o<0))return YF(o,r)}}function Bi(e){let t=Au.length;for(;t--;){const n=Au[t];if(!n.reserveClosing)return YF(t,e),n}}function YF(e,t){var r;const[n]=Au.splice(e,1);return(r=n==null?void 0:n.onClose)==null?void 0:r.call(n,t)}var Ta={},oy={},Nu={};const Wie={},Gie=Object.freeze(Object.defineProperty({__proto__:null,default:Wie},Symbol.toStringTag,{value:"Module"})),Q$=CM(Gie);Object.defineProperty(Nu,"__esModule",{value:!0});var X$=Nu.crossEnvCrypto=void 0;try{const e=typeof window!="undefined"&&window.crypto||Q$.webcrypto;if(e){if(!e.subtle)throw new Error("Crypto.Subtle is undefined. Make sure you are using HTTPS in a compatible browser.");const t=n=>r=>e.subtle.digest(n,r);X$=Nu.crossEnvCrypto={randomBytes:e.getRandomValues.bind(e),hashFunctions:{SHA1:t("SHA-1"),SHA256:t("SHA-256"),SHA384:t("SHA-384"),SHA512:t("SHA-512")}}}else{const t=Q$,n=r=>o=>t.createHash(r).update(o).digest().buffer;X$=Nu.crossEnvCrypto={randomBytes:t.randomFillSync,hashFunctions:{SHA1:n("sha1"),SHA256:n("sha256"),SHA384:n("sha384"),SHA512:n("sha512")}}}}catch(e){throw console.error(e),new Error("No suitable crypto library was found. You may need a polyfill.")}Object.defineProperty(oy,"__esModule",{value:!0});oy.SRPParameters=void 0;const im=Nu;class Du{constructor(t=Du.PrimeGroup[2048],n=Du.H.SHA512){if(this.primeGroup=t,this.H=n,this.NBits=this.primeGroup.N.toString(2).length,!n)throw new Error("Hash function required")}}oy.SRPParameters=Du;Du.PrimeGroup={256:{N:BigInt("125617018995153554710546479714086468244499594888726646874671447258204721048803"),g:BigInt(2)},512:{N:BigInt("11144252439149533417835749556168991736939157778924947037200268358613863350040339017097790259154750906072491181606044774215413467851989724116331597513345603"),g:BigInt(2)},768:{N:BigInt("1087179135105457859072065649059069760280540086975817629066444682366896187793570736574549981488868217843627094867924800342887096064844227836735667168319981288765377499806385489913341488724152562880918438701129530606139552645689583147"),g:BigInt(2)},1024:{N:BigInt("167609434410335061345139523764350090260135525329813904557420930309800865859473551531551523800013916573891864789934747039010546328480848979516637673776605610374669426214776197828492691384519453218253702788022233205683635831626913357154941914129985489522629902540768368409482248290641036967659389658897350067939"),g:BigInt(2)},1536:{N:BigInt("1486998185923128292816507353619409521152457662596380074614818966810244974827752411420380336514078832314731499938313197533147998565301020797040787428051479639316928015998415709101293902971072960487527411068082311763171549170528008620813391411445907584912865222076100726050255271567749213905330659264908657221124284665444825474741087704974475795505492821585749417639344967192301749033325359286273431675492866492416941152646940908101472416714421046022696100064262587"),g:BigInt(2)},2048:{N:BigInt("21766174458617435773191008891802753781907668374255538511144643224689886235383840957210909013086056401571399717235807266581649606472148410291413364152197364477180887395655483738115072677402235101762521901569820740293149529620419333266262073471054548368736039519702486226506248861060256971802984953561121442680157668000761429988222457090413873973970171927093992114751765168063614761119615476233422096442783117971236371647333871414335895773474667308967050807005509320424799678417036867928316761272274230314067548291133582479583061439577559347101961771406173684378522703483495337037655006751328447510550299250924469288819"),g:BigInt(2)}};Du.H={SHA1:im.crossEnvCrypto.hashFunctions.SHA1,SHA256:im.crossEnvCrypto.hashFunctions.SHA256,SHA384:im.crossEnvCrypto.hashFunctions.SHA384,SHA512:im.crossEnvCrypto.hashFunctions.SHA512};var iy={},sy={};(function(e){var t=Sn&&Sn.__awaiter||function(x,P,_,I){function k(M){return M instanceof _?M:new _(function(O){O(M)})}return new(_||(_=Promise))(function(M,O){function F(B){try{D(I.next(B))}catch(R){O(R)}}function L(B){try{D(I.throw(B))}catch(R){O(R)}}function D(B){B.done?M(B.value):k(B.value).then(F,L)}D((I=I.apply(x,P||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.modPow=e.hashBitCount=e.createVerifierAndSalt=e.createVerifier=e.generateRandomBigInt=e.generateRandomString=e.hashPadded=e.hash=e.padStartArrayBuffer=e.stringToArrayBuffer=e.arrayBufferToBigInt=e.bigIntToArrayBuffer=void 0;const n=Nu,r=BigInt(0),o=BigInt(1),i=BigInt(2),s=x=>{const P=x.toString(16),_=new ArrayBuffer(Math.ceil(P.length/2)),I=new Uint8Array(_);let k=0;P.length%2!==0&&(I[0]=parseInt(P[0],16),k=1);for(let M=0;M<_.byteLength;M++)I[M+k]=parseInt(P.slice(2*M+k,2*M+2+k),16);return _};e.bigIntToArrayBuffer=s;const a=x=>{const P=[];return new Uint8Array(x).forEach(_=>{P.push(("0"+_.toString(16)).slice(-2))}),BigInt(`0x${P.join("")}`)};e.arrayBufferToBigInt=a;function c(x){return new TextEncoder().encode(x).buffer}e.stringToArrayBuffer=c;const d=(x,P)=>{const _=new Uint8Array(x);if(_.length<P){const I=new Uint8Array(P);return I.fill(0,0,P-_.length),I.set(_,P-_.length),I}return _};e.padStartArrayBuffer=d;function p(x,...P){const _=P.reduce((k,M)=>k+M.byteLength,0),I=new Uint8Array(_);for(let k=0,M=0;M<P.length;M++)I.set(new Uint8Array(P[M]),k),k+=P[M].byteLength;return x.H(I)}e.hash=p;function h(x,P,..._){const I=_.map(k=>e.padStartArrayBuffer(k,P));return p(x,...I)}e.hashPadded=h;function m(x=10){const P=new Uint8Array(Math.ceil(Math.ceil(x/2)));return n.crossEnvCrypto.randomBytes(P),P.reduce((_,I)=>{const k=I.toString(16).toString();return k.length===1?_+"0"+k:_+k},"").slice(0,x)}e.generateRandomString=m;function g(x=16){return e.arrayBufferToBigInt(C(x))}e.generateRandomBigInt=g;function y(x,P,_,I){return t(this,void 0,void 0,function*(){if(!P||!P.trim())throw new Error("Identity (I) must not be null or empty.");if(!_)throw new Error("Salt (s) must not be null.");if(!I)throw new Error("Password (P) must not be null");const k=yield x.computeX(P,_,I);return x.computeVerifier(k)})}e.createVerifier=y;function v(x,P,_,I){return t(this,void 0,void 0,function*(){const k=yield x.generateRandomSalt(I);return{s:k,v:yield y(x,P,k,_)}})}e.createVerifierAndSalt=v;const S=x=>t(void 0,void 0,void 0,function*(){return(yield p(x,e.bigIntToArrayBuffer(BigInt(1)))).byteLength*8});e.hashBitCount=S;function w(x,P,_){let I=o;for(;P>r;)P%i==o?(I=x*I%_,P-=o):(x=x*x%_,P/=i);return I}e.modPow=w;const C=x=>{const P=new Uint8Array(x);return n.crossEnvCrypto.randomBytes(P),P.buffer}})(sy);var dl=Sn&&Sn.__awaiter||function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(p){try{d(r.next(p))}catch(h){s(h)}}function c(p){try{d(r.throw(p))}catch(h){s(h)}}function d(p){p.done?i(p.value):o(p.value).then(a,c)}d((r=r.apply(e,t||[])).next())})};Object.defineProperty(iy,"__esModule",{value:!0});iy.SRPRoutines=void 0;const cn=sy;class Kie{constructor(t){this.parameters=t}hash(...t){return cn.hash(this.parameters,...t)}hashPadded(...t){const n=Math.trunc((this.parameters.NBits+7)/8);return cn.hashPadded(this.parameters,n,...t)}computeK(){return dl(this,void 0,void 0,function*(){return cn.arrayBufferToBigInt(yield this.hashPadded(cn.bigIntToArrayBuffer(this.parameters.primeGroup.N),cn.bigIntToArrayBuffer(this.parameters.primeGroup.g)))})}generateRandomSalt(t){return dl(this,void 0,void 0,function*(){const n=yield cn.hashBitCount(this.parameters),r=t||2*n/8;return cn.generateRandomBigInt(r)})}computeX(t,n,r){return dl(this,void 0,void 0,function*(){return cn.arrayBufferToBigInt(yield this.hash(cn.bigIntToArrayBuffer(n),yield this.computeIdentityHash(t,r)))})}computeXStep2(t,n){return dl(this,void 0,void 0,function*(){return cn.arrayBufferToBigInt(yield this.hash(cn.bigIntToArrayBuffer(t),n))})}computeIdentityHash(t,n){return dl(this,void 0,void 0,function*(){return yield this.hash(cn.stringToArrayBuffer(n))})}computeVerifier(t){return cn.modPow(this.parameters.primeGroup.g,t,this.parameters.primeGroup.N)}generatePrivateValue(){const t=Math.max(256,this.parameters.NBits);let n;do n=cn.generateRandomBigInt(t/8)%this.parameters.primeGroup.N;while(n===BigInt(0));return n}computeClientPublicValue(t){return cn.modPow(this.parameters.primeGroup.g,t,this.parameters.primeGroup.N)}isValidPublicValue(t){return t%this.parameters.primeGroup.N!==BigInt(0)}computeU(t,n){return dl(this,void 0,void 0,function*(){return cn.arrayBufferToBigInt(yield this.hashPadded(cn.bigIntToArrayBuffer(t),cn.bigIntToArrayBuffer(n)))})}computeClientEvidence(t,n,r,o,i){return dl(this,void 0,void 0,function*(){return cn.arrayBufferToBigInt(yield this.hash(cn.bigIntToArrayBuffer(r),cn.bigIntToArrayBuffer(o),cn.bigIntToArrayBuffer(i)))})}computeServerEvidence(t,n,r){return dl(this,void 0,void 0,function*(){return cn.arrayBufferToBigInt(yield this.hash(cn.bigIntToArrayBuffer(t),cn.bigIntToArrayBuffer(n),cn.bigIntToArrayBuffer(r)))})}computeClientSessionKey(t,n,r,o,i){const s=this.parameters.primeGroup.N,a=r*n+o,c=cn.modPow(this.parameters.primeGroup.g,n,s)*t%s;return cn.modPow(i+s-c,a,s)}}iy.SRPRoutines=Kie;var zl={},vS=Sn&&Sn.__awaiter||function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(p){try{d(r.next(p))}catch(h){s(h)}}function c(p){try{d(r.throw(p))}catch(h){s(h)}}function d(p){p.done?i(p.value):o(p.value).then(a,c)}d((r=r.apply(e,t||[])).next())})};Object.defineProperty(zl,"__esModule",{value:!0});zl.SRPClientSessionStep2=zl.SRPClientSessionStep1=zl.SRPClientSession=void 0;class qie{constructor(t){this.routines=t}step1(t,n){return vS(this,void 0,void 0,function*(){if(!t||!t.trim())throw new Error("User identity must not be null nor empty");if(!n)throw new Error("User password must not be null");const r=yield this.routines.computeIdentityHash(t,n);return new ly(this.routines,t,r)})}}zl.SRPClientSession=qie;class ly{constructor(t,n,r){this.routines=t,this.I=n,this.IH=r}step2(t,n){return vS(this,void 0,void 0,function*(){if(!t)throw new Error("Salt (s) must not be null");if(!n)throw new Error("Public server value (B) must not be null");const r=yield this.routines.computeXStep2(t,this.IH),o=this.routines.generatePrivateValue(),i=this.routines.computeClientPublicValue(o),s=yield this.routines.computeK(),a=yield this.routines.computeU(i,n),c=this.routines.computeClientSessionKey(s,r,a,o,n),d=yield this.routines.computeClientEvidence(this.I,t,i,n,c);return new ay(this.routines,i,d,c)})}toJSON(){return{I:this.I,IH:Array.from(new Uint8Array(this.IH))}}static fromState(t,n){return new ly(t,n.I,new Uint8Array(n.IH).buffer)}}zl.SRPClientSessionStep1=ly;class ay{constructor(t,n,r,o){this.routines=t,this.A=n,this.M1=r,this.S=o}step3(t){return vS(this,void 0,void 0,function*(){if(!t)throw new Error("Server evidence (M2) must not be null");if((yield this.routines.computeServerEvidence(this.A,this.M1,this.S))!==t)throw new Error("Bad server credentials")})}toJSON(){return{A:this.A.toString(16),M1:this.M1.toString(16),S:this.S.toString(16)}}static fromState(t,n){return new ay(t,BigInt("0x"+n.A),BigInt("0x"+n.M1),BigInt("0x"+n.S))}}zl.SRPClientSessionStep2=ay;var Bu={},$w=Sn&&Sn.__awaiter||function(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(p){try{d(r.next(p))}catch(h){s(h)}}function c(p){try{d(r.throw(p))}catch(h){s(h)}}function d(p){p.done?i(p.value):o(p.value).then(a,c)}d((r=r.apply(e,t||[])).next())})};Object.defineProperty(Bu,"__esModule",{value:!0});Bu.SRPServerSessionStep1=Bu.SRPServerSession=void 0;const Rw=sy;class Yie{constructor(t){this.routines=t}step1(t,n,r){return $w(this,void 0,void 0,function*(){const o=this.routines.generatePrivateValue(),i=yield this.routines.computeK(),s=Qie(this.routines.parameters,i,r,o);return new cy(this.routines,t,n,r,o,s)})}}Bu.SRPServerSession=Yie;class cy{constructor(t,n,r,o,i,s){this.routines=t,this.identifier=n,this.salt=r,this.verifier=o,this.b=i,this.B=s}sessionKey(t){return $w(this,void 0,void 0,function*(){if(t===null)throw new Error("Client public value (A) must not be null");if(!this.routines.isValidPublicValue(t))throw new Error(`Invalid Client public value (A): ${t.toString(16)}`);const n=yield this.routines.computeU(t,this.B);return Xie(this.routines.parameters.primeGroup.N,this.verifier,n,t,this.b)})}step2(t,n){return $w(this,void 0,void 0,function*(){if(!n)throw new Error("Client evidence (M1) must not be null");const r=yield this.sessionKey(t);if((yield this.routines.computeClientEvidence(this.identifier,this.salt,t,this.B,r))!==n)throw new Error("Bad client credentials");return this.routines.computeServerEvidence(t,n,r)})}toJSON(){return{identifier:this.identifier,salt:this.salt.toString(16),verifier:this.verifier.toString(16),b:this.b.toString(16),B:this.B.toString(16)}}static fromState(t,n){return new cy(t,n.identifier,BigInt("0x"+n.salt),BigInt("0x"+n.verifier),BigInt("0x"+n.b),BigInt("0x"+n.B))}}Bu.SRPServerSessionStep1=cy;const Qie=(e,t,n,r)=>(Rw.modPow(e.primeGroup.g,r,e.primeGroup.N)+n*t)%e.primeGroup.N,Xie=(e,t,n,r,o)=>Rw.modPow(Rw.modPow(t,n,e)*r,o,e);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.generateRandomBigInt=e.arrayBufferToBigInt=e.bigIntToArrayBuffer=e.createVerifierAndSalt=e.SRPServerSessionStep1=e.SRPServerSession=e.SRPClientSessionStep2=e.SRPClientSessionStep1=e.SRPClientSession=e.SRPRoutines=e.SRPParameters=void 0;var t=oy;Object.defineProperty(e,"SRPParameters",{enumerable:!0,get:function(){return t.SRPParameters}});var n=iy;Object.defineProperty(e,"SRPRoutines",{enumerable:!0,get:function(){return n.SRPRoutines}});var r=zl;Object.defineProperty(e,"SRPClientSession",{enumerable:!0,get:function(){return r.SRPClientSession}}),Object.defineProperty(e,"SRPClientSessionStep1",{enumerable:!0,get:function(){return r.SRPClientSessionStep1}}),Object.defineProperty(e,"SRPClientSessionStep2",{enumerable:!0,get:function(){return r.SRPClientSessionStep2}});var o=Bu;Object.defineProperty(e,"SRPServerSession",{enumerable:!0,get:function(){return o.SRPServerSession}}),Object.defineProperty(e,"SRPServerSessionStep1",{enumerable:!0,get:function(){return o.SRPServerSessionStep1}});var i=sy;Object.defineProperty(e,"createVerifierAndSalt",{enumerable:!0,get:function(){return i.createVerifierAndSalt}}),Object.defineProperty(e,"bigIntToArrayBuffer",{enumerable:!0,get:function(){return i.bigIntToArrayBuffer}}),Object.defineProperty(e,"arrayBufferToBigInt",{enumerable:!0,get:function(){return i.arrayBufferToBigInt}}),Object.defineProperty(e,"generateRandomBigInt",{enumerable:!0,get:function(){return i.generateRandomBigInt}})})(Ta);function Jie(e,t,n){return mt(this,null,function*(){const{pubKey:r,salt:o}=yield n("loginSrp1",{username:e});if(!o)throw Error("salt");const i=new Ta.SRPRoutines(new Ta.SRPParameters),c=yield(yield new Ta.SRPClientSession(i).step1(e,t)).step2(BigInt(o),BigInt(r)),d=yield n("loginSrp2",{pubKey:String(c.A),proof:String(c.M1)});return yield c.step3(BigInt(d.proof)).catch(()=>Promise.reject("trust")),d})}const Mw="https://github.com/rejetto/hfs/",Zie=Mw+"wiki/";window._=St;const H1=wS();Object.assign(H1,{getPluginKey:()=>J$("plugin"),getPluginPublic:()=>{var e,t;return(t=(e=J$("src"))==null?void 0:e.match(/^.*\//))==null?void 0:t[0]},getPluginConfig:()=>H1.plugins[H1.getPluginKey()]||{}});function J$(e){var t;return((t=document.currentScript)==null?void 0:t.getAttribute(e))||console.error("this function must be called at the very top of your file")}Object.fromEntries(new URLSearchParams(window.location.search).entries());const ese=["","K","M","G","T"];function ql(e,{post:t="B",k:n=1024,digits:r=NaN}={}){if(isNaN(Number(e))||e<0)return"";const o=e&&Math.floor(Math.log2(e)/Math.log2(n));return e/=Gi(n,o),(o&&!isNaN(r)?e.toFixed(r):St.round(e,isNaN(r)?e>=100?0:1:r))+" "+(ese[o]||"")+t}function vu(e,t,n=""){return t?e+t+n:""}function tse(e,t){return new Promise(n=>setTimeout(n,e,t))}function nse(e){const t=e+"=";let r=decodeURIComponent(document.cookie).split(";");for(let o of r)if(o=o.trim(),o.startsWith(t))return o.substring(t.length,o.length);return""}function yS(e,t){return Object.fromEntries(Object.entries(e).map(([n,r])=>[n,t(r,n)]))}function rse(e,t){return!t||t.endsWith(e)?t:t+e}function ose(e){return!!e}function rd(e){return e.filter(ose)}function ise(e,t){return Object.defineProperties(e,yS(t,n=>({enumerable:!1,writable:!0,value:n})))}function Tw(e,t){return t(e)}function QF(e,{accept:t="",multiple:n=!0,folder:r=!1}={}){const o=Object.assign(document.createElement("input"),{type:"file",name:"file",accept:t,multiple:n,webkitdirectory:r});o.addEventListener("change",()=>e(o.files)),o.click()}function XF(e){return new Promise((t,n)=>{const r=new FileReader;r.addEventListener("load",o=>{if(!o.target||e.size&&!o.target.result)return n("cannot read");const{result:i}=o.target;t(i==null?void 0:i.toString())}),r.addEventListener("error",()=>{n(r.error)}),r.readAsText(e)})}function sse(e){return(e*100).toFixed(1)+"%"}function lse(e){return e==null?[]:Array.isArray(e)?e:[e]}function bS(){let e;const t=new Promise((n,r)=>e={resolve:n,reject:r});return Object.assign(t,e)}function ase(){return window.innerWidth<800}function wS(){return window.HFS}function JF(){return wS().prefixUrl||""}function cse(e){return e.slice(e.lastIndexOf("/")+1||e.lastIndexOf("\\")+1)}function use(e){return function t(n){if(!n)return;const{exp:r,username:o,adminUrl:i}=n;if(e.username=o,e.adminUrl=i,!o||!r)return;const s=new Date(r).getTime()-Date.now(),a=St.clamp(s-3e4,4e3,6e5);console.debug("session refresh in",Math.round(a/1e3)),setTimeout(()=>Et("refresh_session").then(t),a)}}function dse(e){try{return e&&JSON.parse(e)}catch(t){}}var CS={},fse=ut;Object.defineProperty(CS,"__esModule",{value:!0});var uy=CS.default=void 0,pse=fse(dt()),hse=at(),mse=(0,pse.default)((0,hse.jsx)("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z"}),"Save");uy=CS.default=mse;function gse(e){return Je("MuiLoadingButton",e)}const vse=Xe("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),Ts=vse,yse=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],bse=e=>{const{loading:t,loadingPosition:n,classes:r}=e,o={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${ue(n)}`],endIcon:[t&&`endIconLoading${ue(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${ue(n)}`]},i=Me(o,gse,r);return E({},r,i)},wse=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",Cse=oe(mr,{shouldForwardProp:e=>wse(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Ts.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Ts.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>E({[`& .${Ts.startIconLoadingStart}, & .${Ts.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},e.loadingPosition==="center"&&{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${Ts.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${Ts.startIconLoadingStart}, & .${Ts.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${Ts.startIconLoadingStart}, & .${Ts.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),xse=oe("div",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${ue(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>E({position:"absolute",visibility:"visible",display:"flex"},t.loadingPosition==="start"&&(t.variant==="outlined"||t.variant==="contained")&&{left:t.size==="small"?10:14},t.loadingPosition==="start"&&t.variant==="text"&&{left:6},t.loadingPosition==="center"&&{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled},t.loadingPosition==="end"&&(t.variant==="outlined"||t.variant==="contained")&&{right:t.size==="small"?10:14},t.loadingPosition==="end"&&t.variant==="text"&&{right:6},t.loadingPosition==="start"&&t.fullWidth&&{position:"relative",left:-10},t.loadingPosition==="end"&&t.fullWidth&&{position:"relative",right:-10})),Sse=u.forwardRef(function(t,n){const r=et({props:t,name:"MuiLoadingButton"}),{children:o,disabled:i=!1,id:s,loading:a=!1,loadingIndicator:c,loadingPosition:d="center",variant:p="text"}=r,h=ne(r,yse),m=on(s),g=c!=null?c:T.jsx(Ka,{"aria-labelledby":m,color:"inherit",size:16}),y=E({},r,{disabled:i,loading:a,loadingIndicator:g,loadingPosition:d,variant:p}),v=bse(y),S=a?T.jsx(xse,{className:v.loadingIndicator,ownerState:y,children:g}):null;return T.jsxs(Cse,E({disabled:i||a,id:m,ref:n},h,{variant:p,classes:v,ownerState:y,children:[y.loadingPosition==="end"?o:S,y.loadingPosition==="end"?S:o]}))}),ZF=Sse,Ese=u.createContext({}),xS=Ese,Pse=["element"];function Ise(e,t){for(let n=0;n<e.length;n+=1)if(t(e[n]))return n;return-1}function kse(e,t){let n=0,r=e.length-1;for(;n<=r;){const o=Math.floor((n+r)/2);if(e[o].element===t)return o;e[o].element.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING?r=o-1:n=o+1}return n}const eA=u.createContext({});function _se(e){const t=u.useRef(null);return u.useEffect(()=>{t.current=e},[e]),t.current}const Z$=()=>{};function $se(e){const[,t]=u.useState(),{registerDescendant:n=Z$,unregisterDescendant:r=Z$,descendants:o=[],parentId:i=null}=u.useContext(eA),s=Ise(o,d=>d.element===e.element),a=_se(o),c=o.some((d,p)=>a&&a[p]&&a[p].element!==d.element);return ln(()=>{if(e.element)return n(E({},e,{index:s})),()=>{r(e.element)};t({})},[n,r,s,c,e]),{parentId:i,index:s}}function tA(e){const{children:t,id:n}=e,[r,o]=u.useState([]),i=u.useCallback(c=>{let{element:d}=c,p=ne(c,Pse);o(h=>{let m;if(h.length===0)return[E({},p,{element:d,index:0})];const g=kse(h,d);if(h[g]&&h[g].element===d)m=h;else{const y=E({},p,{element:d,index:g});m=h.slice(),m.splice(g,0,y)}return m.forEach((y,v)=>{y.index=v}),m})},[]),s=u.useCallback(c=>{o(d=>d.filter(p=>c!==p.element))},[]),a=u.useMemo(()=>({descendants:r,registerDescendant:i,unregisterDescendant:s,parentId:n}),[r,i,s,n]);return T.jsx(eA.Provider,{value:a,children:t})}function Rse(e){const{focus:t,isExpanded:n,isExpandable:r,isFocused:o,isDisabled:i,isSelected:s,multiSelect:a,selectNode:c,selectRange:d,toggleExpansion:p}=u.useContext(xS),h=r?r(e):!1,m=n?n(e):!1,g=o?o(e):!1,y=i?i(e):!1,v=s?s(e):!1;return{disabled:y,expanded:m,selected:v,focused:g,handleExpansion:x=>{if(!y){g||t(x,e);const P=a&&(x.shiftKey||x.ctrlKey||x.metaKey);h&&!(P&&n(e))&&p(x,e)}},handleSelection:x=>{y||(g||t(x,e),a&&(x.shiftKey||x.ctrlKey||x.metaKey)?x.shiftKey?d(x,{end:e}):c(x,e,!0):c(x,e))},preventSelection:x=>{(x.shiftKey||x.ctrlKey||x.metaKey||y)&&x.preventDefault()}}}const Mse=["classes","className","displayIcon","expansionIcon","icon","label","nodeId","onClick","onMouseDown"],Tse=u.forwardRef(function(t,n){const{classes:r,className:o,displayIcon:i,expansionIcon:s,icon:a,label:c,nodeId:d,onClick:p,onMouseDown:h}=t,m=ne(t,Mse),{disabled:g,expanded:y,selected:v,focused:S,handleExpansion:w,handleSelection:C,preventSelection:x}=Rse(d),P=a||s||i,_=k=>{x(k),h&&h(k)},I=k=>{w(k),C(k),p&&p(k)};return T.jsxs("div",E({className:he(o,r.root,y&&r.expanded,v&&r.selected,S&&r.focused,g&&r.disabled),onClick:I,onMouseDown:_,ref:n},m,{children:[T.jsx("div",{className:r.iconContainer,children:P}),T.jsx("div",{className:r.label,children:c})]}))}),nA=Tse;function Ose(e){return Je("MuiTreeItem",e)}const Lse=Xe("MuiTreeItem",["root","group","content","expanded","selected","focused","disabled","iconContainer","label"]),fl=Lse,Fse=["children","className","collapseIcon","ContentComponent","ContentProps","endIcon","expandIcon","disabled","icon","id","label","nodeId","onClick","onMouseDown","TransitionComponent","TransitionProps"],Ase=e=>{const{classes:t}=e;return Me({root:["root"],content:["content"],expanded:["expanded"],selected:["selected"],focused:["focused"],disabled:["disabled"],iconContainer:["iconContainer"],label:["label"],group:["group"]},Ose,t)},Nse=oe("li",{name:"MuiTreeItem",slot:"Root",overridesResolver:(e,t)=>t.root})({listStyle:"none",margin:0,padding:0,outline:0}),Dse=oe(nA,{name:"MuiTreeItem",slot:"Content",overridesResolver:(e,t)=>[t.content,t.iconContainer&&{[`& .${fl.iconContainer}`]:t.iconContainer},t.label&&{[`& .${fl.label}`]:t.label}]})(({theme:e})=>({padding:"0 8px",width:"100%",display:"flex",alignItems:"center",cursor:"pointer",WebkitTapHighlightColor:"transparent","&:hover":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${fl.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,backgroundColor:"transparent"},[`&.${fl.focused}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${fl.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:lt(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:lt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:lt(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${fl.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:lt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`& .${fl.iconContainer}`]:{marginRight:4,width:15,display:"flex",flexShrink:0,justifyContent:"center","& svg":{fontSize:18}},[`& .${fl.label}`]:E({width:"100%",minWidth:0,paddingLeft:4,position:"relative"},e.typography.body1)})),Bse=oe(yg,{name:"MuiTreeItem",slot:"Group",overridesResolver:(e,t)=>t.group})({margin:0,padding:0,marginLeft:17}),zse=u.forwardRef(function(t,n){const r=et({props:t,name:"MuiTreeItem"}),{children:o,className:i,collapseIcon:s,ContentComponent:a=nA,ContentProps:c,endIcon:d,expandIcon:p,disabled:h,icon:m,id:g,label:y,nodeId:v,onClick:S,onMouseDown:w,TransitionComponent:C=yg,TransitionProps:x}=r,P=ne(r,Fse),{icons:_={},focus:I,isExpanded:k,isFocused:M,isSelected:O,isDisabled:F,multiSelect:L,disabledItemsFocusable:D,mapFirstChar:B,unMapFirstChar:R,registerNode:A,unregisterNode:z,treeId:V}=u.useContext(xS);let N=null;g!=null?N=g:V&&v&&(N=`${V}-${v}`);const[H,W]=u.useState(null),K=u.useRef(null),Y=Vt(W,n),ie=u.useMemo(()=>({element:H,id:v}),[v,H]),{index:re,parentId:de}=$se(ie),se=!!(Array.isArray(o)?o.length:o),le=k?k(v):!1,Ee=M?M(v):!1,ye=O?O(v):!1,_e=F?F(v):!1,ee=E({},r,{expanded:le,focused:Ee,selected:ye,disabled:_e}),ke=Ase(ee);let Re,Pe;se&&(le?Pe=s||_.defaultCollapseIcon:Pe=p||_.defaultExpandIcon),se?Re=_.defaultParentIcon:Re=d||_.defaultEndIcon,u.useEffect(()=>{if(A&&z&&re!==-1)return A({id:v,idAttribute:N,index:re,parentId:de,expandable:se,disabled:h}),()=>{z(v)}},[A,z,de,re,v,se,h,N]),u.useEffect(()=>{if(B&&R&&y)return B(v,K.current.textContent.substring(0,1).toLowerCase()),()=>{R(v)}},[B,R,v,y]);let pe;L?pe=ye:ye&&(pe=!0);function be(te){if(te.target===te.currentTarget){let Ye;typeof te.target.getRootNode=="function"?Ye=te.target.getRootNode():Ye=vn(te.target),Ye.getElementById(V).focus({preventScroll:!0})}const Oe=!D&&_e;!Ee&&te.currentTarget===te.target&&!Oe&&I(te,v)}return T.jsxs(Nse,E({className:he(ke.root,i),role:"treeitem","aria-expanded":se?le:null,"aria-selected":pe,"aria-disabled":_e||null,ref:Y,id:N,tabIndex:-1},P,{ownerState:ee,onFocus:be,children:[T.jsx(Dse,E({as:a,ref:K,classes:{root:ke.content,expanded:ke.expanded,selected:ke.selected,focused:ke.focused,disabled:ke.disabled,iconContainer:ke.iconContainer,label:ke.label},label:y,nodeId:v,onClick:S,onMouseDown:w,icon:m,expansionIcon:Pe,displayIcon:Re,ownerState:ee},c)),o&&T.jsx(tA,{id:v,children:T.jsx(Bse,E({as:C,unmountOnExit:!0,className:ke.group,in:le,component:"ul",role:"group"},x,{children:o}))})]}))}),Ow=zse;function jse(e){return Je("MuiTreeView",e)}Xe("MuiTreeView",["root"]);const Hse=["children","className","defaultCollapseIcon","defaultEndIcon","defaultExpanded","defaultExpandIcon","defaultParentIcon","defaultSelected","disabledItemsFocusable","disableSelection","expanded","id","multiSelect","onBlur","onFocus","onKeyDown","onNodeFocus","onNodeSelect","onNodeToggle","selected"],Vse=e=>{const{classes:t}=e;return Me({root:["root"]},jse,t)},Use=oe("ul",{name:"MuiTreeView",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:0,margin:0,listStyle:"none",outline:0});function Wse(e){return e&&e.length===1&&e.match(/\S/)}function eR(e,t,n){for(let r=t;r<e.length;r+=1)if(n===e[r])return r;return-1}function tR(){return!1}const Gse=[],Kse=[],qse=u.forwardRef(function(t,n){const r=et({props:t,name:"MuiTreeView"}),{children:o,className:i,defaultCollapseIcon:s,defaultEndIcon:a,defaultExpanded:c=Gse,defaultExpandIcon:d,defaultParentIcon:p,defaultSelected:h=Kse,disabledItemsFocusable:m=!1,disableSelection:g=!1,expanded:y,id:v,multiSelect:S=!1,onBlur:w,onFocus:C,onKeyDown:x,onNodeFocus:P,onNodeSelect:_,onNodeToggle:I,selected:k}=r,M=ne(r,Hse),F=lr().direction==="rtl",L=E({},r,{defaultExpanded:c,defaultSelected:h,disabledItemsFocusable:m,disableSelection:g,multiSelect:S}),D=Vse(L),B=on(v),R=u.useRef(null),A=Vt(R,n),[z,V]=u.useState(null),N=u.useRef({}),H=u.useRef({}),[W,K]=ss({controlled:y,default:c,name:"TreeView",state:"expanded"}),[Y,ie]=ss({controlled:k,default:h,name:"TreeView",state:"selected"}),re=u.useCallback(ce=>Array.isArray(W)?W.indexOf(ce)!==-1:!1,[W]),de=u.useCallback(ce=>N.current[ce]&&N.current[ce].expandable,[]),se=u.useCallback(ce=>Array.isArray(Y)?Y.indexOf(ce)!==-1:Y===ce,[Y]),le=u.useCallback(ce=>{let ge=N.current[ce];if(!ge)return!1;if(ge.disabled)return!0;for(;ge.parentId!=null;)if(ge=N.current[ge.parentId],ge.disabled)return!0;return!1},[]),Ee=ce=>z===ce,ye=ce=>Object.keys(N.current).map(ge=>N.current[ge]).filter(ge=>ge.parentId===ce).sort((ge,Ne)=>ge.index-Ne.index).map(ge=>ge.id),_e=ce=>{let ge=ye(ce);return m||(ge=ge.filter(Ne=>!le(Ne))),ge},ee=ce=>{if(re(ce)&&_e(ce).length>0)return _e(ce)[0];let ge=N.current[ce];for(;ge!=null;){const Ne=_e(ge.parentId),ft=Ne[Ne.indexOf(ge.id)+1];if(ft)return ft;ge=N.current[ge.parentId]}return null},ke=ce=>{const ge=N.current[ce],Ne=_e(ge.parentId),ft=Ne.indexOf(ce);if(ft===0)return ge.parentId;let it=Ne[ft-1];for(;re(it)&&_e(it).length>0;)it=_e(it).pop();return it},Re=()=>{let ce=_e(null).pop();for(;re(ce);)ce=_e(ce).pop();return ce},Pe=()=>_e(null)[0],pe=ce=>N.current[ce].parentId,be=(ce,ge)=>{if(ce===ge)return[ce,ge];const Ne=N.current[ce],ft=N.current[ge];if(Ne.parentId===ft.id||ft.parentId===Ne.id)return ft.parentId===Ne.id?[Ne.id,ft.id]:[ft.id,Ne.id];const it=[Ne.id],He=[ft.id];let Ct=Ne.parentId,Ut=ft.parentId,_n=He.indexOf(Ct)!==-1,ho=it.indexOf(Ut)!==-1,we=!0,me=!0;for(;!ho&&!_n;)we&&(it.push(Ct),_n=He.indexOf(Ct)!==-1,we=Ct!==null,!_n&&we&&(Ct=N.current[Ct].parentId)),me&&!_n&&(He.push(Ut),ho=it.indexOf(Ut)!==-1,me=Ut!==null,!ho&&me&&(Ut=N.current[Ut].parentId));const We=_n?Ct:Ut,pt=ye(We),Wt=it[it.indexOf(We)-1],Ln=He[He.indexOf(We)-1];return pt.indexOf(Wt)<pt.indexOf(Ln)?[ce,ge]:[ge,ce]},te=(ce,ge)=>{const[Ne,ft]=be(ce,ge),it=[Ne];let He=Ne;for(;He!==ft;)He=ee(He),it.push(He);return it},Oe=(ce,ge)=>{ge&&(V(ge),P&&P(ce,ge))},Ye=(ce,ge)=>Oe(ce,ee(ge)),Ke=(ce,ge)=>Oe(ce,ke(ge)),Ue=ce=>Oe(ce,Pe()),De=ce=>Oe(ce,Re()),ct=(ce,ge,Ne)=>{let ft,it;const He=Ne.toLowerCase(),Ct=[],Ut=[];Object.keys(H.current).forEach(_n=>{const ho=H.current[_n],we=N.current[_n],me=we.parentId?re(we.parentId):!0,We=m?!1:le(_n);me&&!We&&(Ct.push(_n),Ut.push(ho))}),ft=Ct.indexOf(ge)+1,ft>=Ct.length&&(ft=0),it=eR(Ut,ft,He),it===-1&&(it=eR(Ut,0,He)),it>-1&&Oe(ce,Ct[it])},vt=(ce,ge=z)=>{let Ne;W.indexOf(ge)!==-1?Ne=W.filter(ft=>ft!==ge):Ne=[ge].concat(W),I&&I(ce,Ne),K(Ne)},st=(ce,ge)=>{const Ne=N.current[ge],it=ye(Ne.parentId).filter(Ct=>de(Ct)&&!re(Ct)),He=W.concat(it);it.length>0&&(K(He),I&&I(ce,He))},Pt=u.useRef(null),yt=u.useRef(!1),Ae=u.useRef([]),Fe=(ce,ge)=>{let Ne=Y.slice();const{start:ft,next:it,current:He}=ge;!it||!He||(Ae.current.indexOf(He)===-1&&(Ae.current=[]),yt.current?Ae.current.indexOf(it)!==-1?(Ne=Ne.filter(Ct=>Ct===ft||Ct!==He),Ae.current=Ae.current.filter(Ct=>Ct===ft||Ct!==He)):(Ne.push(it),Ae.current.push(it)):(Ne.push(it),Ae.current.push(He,it)),_&&_(ce,Ne),ie(Ne))},Be=(ce,ge)=>{let Ne=Y.slice();const{start:ft,end:it}=ge;yt.current&&(Ne=Ne.filter(Ut=>Ae.current.indexOf(Ut)===-1));let He=te(ft,it);He=He.filter(Ut=>!le(Ut)),Ae.current=He;let Ct=Ne.concat(He);Ct=Ct.filter((Ut,_n)=>Ct.indexOf(Ut)===_n),_&&_(ce,Ct),ie(Ct)},Ze=(ce,ge)=>{let Ne;Y.indexOf(ge)!==-1?Ne=Y.filter(ft=>ft!==ge):Ne=[ge].concat(Y),_&&_(ce,Ne),ie(Ne)},Ie=(ce,ge)=>{const Ne=S?[ge]:ge;_&&_(ce,Ne),ie(Ne)},Le=(ce,ge,Ne=!1)=>ge?(Ne?Ze(ce,ge):Ie(ce,ge),Pt.current=ge,yt.current=!1,Ae.current=[],!0):!1,Ve=(ce,ge,Ne=!1)=>{const{start:ft=Pt.current,end:it,current:He}=ge;Ne?Fe(ce,{start:ft,next:it,current:He}):ft!=null&&it!=null&&Be(ce,{start:ft,end:it}),yt.current=!0},nt=(ce,ge)=>{Pt.current||(Pt.current=ge);const Ne=yt.current?Pt.current:ge;Ve(ce,{start:Ne,end:Pe()})},ht=(ce,ge)=>{Pt.current||(Pt.current=ge);const Ne=yt.current?Pt.current:ge;Ve(ce,{start:Ne,end:Re()})},en=(ce,ge)=>{le(ee(ge))||Ve(ce,{end:ee(ge),current:ge},!0)},kn=(ce,ge)=>{le(ke(ge))||Ve(ce,{end:ke(ge),current:ge},!0)},On=ce=>{Ve(ce,{start:Pe(),end:Re()})},Xn=u.useCallback(ce=>{const{id:ge,index:Ne,parentId:ft,expandable:it,idAttribute:He,disabled:Ct}=ce;N.current[ge]={id:ge,index:Ne,parentId:ft,expandable:it,idAttribute:He,disabled:Ct}},[]),ar=u.useCallback(ce=>{const ge=E({},N.current);delete ge[ce],N.current=ge,V(Ne=>Ne===ce&&R.current===vn(R.current).activeElement?ye(null)[0]:Ne)},[]),cr=u.useCallback((ce,ge)=>{H.current[ce]=ge},[]),bn=u.useCallback(ce=>{const ge=E({},H.current);delete ge[ce],H.current=ge},[]),tn=ce=>(de(z)&&(re(z)?Ye(ce,z):le(z)||vt(ce)),!0),Hn=ce=>{if(re(z)&&!le(z))return vt(ce,z),!0;const ge=pe(z);return ge?(Oe(ce,ge),!0):!1},Go=ce=>{let ge=!1;const Ne=ce.key;if(ce.altKey||ce.currentTarget!==ce.target||!z)return;const ft=ce.ctrlKey||ce.metaKey;switch(Ne){case" ":!g&&!le(z)&&(S&&ce.shiftKey?(Ve(ce,{end:z}),ge=!0):S?ge=Le(ce,z,!0):ge=Le(ce,z)),ce.stopPropagation();break;case"Enter":le(z)||(de(z)?(vt(ce),ge=!0):S?ge=Le(ce,z,!0):ge=Le(ce,z)),ce.stopPropagation();break;case"ArrowDown":S&&ce.shiftKey&&!g&&en(ce,z),Ye(ce,z),ge=!0;break;case"ArrowUp":S&&ce.shiftKey&&!g&&kn(ce,z),Ke(ce,z),ge=!0;break;case"ArrowRight":F?ge=Hn(ce):ge=tn(ce);break;case"ArrowLeft":F?ge=tn(ce):ge=Hn(ce);break;case"Home":S&&ft&&ce.shiftKey&&!g&&!le(z)&&nt(ce,z),Ue(ce),ge=!0;break;case"End":S&&ft&&ce.shiftKey&&!g&&!le(z)&&ht(ce,z),De(ce),ge=!0;break;default:Ne==="*"?(st(ce,z),ge=!0):S&&ft&&Ne.toLowerCase()==="a"&&!g?(On(ce),ge=!0):!ft&&!ce.shiftKey&&Wse(Ne)&&(ct(ce,z,Ne),ge=!0)}ge&&(ce.preventDefault(),ce.stopPropagation()),x&&x(ce)},Hi=ce=>{if(ce.target===ce.currentTarget){const ge=Array.isArray(Y)?Y[0]:Y;Oe(ce,ge||_e(null)[0])}C&&C(ce)},Cs=ce=>{V(null),w&&w(ce)},xs=N.current[z]?N.current[z].idAttribute:null;return T.jsx(xS.Provider,{value:{icons:{defaultCollapseIcon:s,defaultExpandIcon:d,defaultParentIcon:p,defaultEndIcon:a},focus:Oe,toggleExpansion:vt,isExpanded:re,isExpandable:de,isFocused:Ee,isSelected:se,isDisabled:le,selectNode:g?tR:Le,selectRange:g?tR:Ve,multiSelect:S,disabledItemsFocusable:m,mapFirstChar:cr,unMapFirstChar:bn,registerNode:Xn,unregisterNode:ar,treeId:B},children:T.jsx(tA,{children:T.jsx(Use,E({role:"tree",id:B,"aria-activedescendant":xs,"aria-multiselectable":S,className:he(D.root,i),ref:A,tabIndex:0,onKeyDown:Go,onFocus:Hi,onBlur:Cs,ownerState:L},M,{children:o}))})})}),rA=qse;function io(m){var g=m,{value:e,onChange:t,min:n,max:r,required:o,getApi:i,typing:s,start:a,end:c,onTyping:d,suggestions:p}=g,h=Yt(g,["value","onChange","min","max","required","getApi","typing","start","end","onTyping","suggestions"]);const y=e!=null?e:"";i==null||i({getError(){return!e&&o?"required":(e==null?void 0:e.length)<n?"too short":(e==null?void 0:e.length)>r?"too long":!1}});const[v,S]=u.useState(y);Yse(h,"inputRef",u.useCallback(P=>P&&x(null,P.value),[]));const w=u.useRef(y);u.useEffect(()=>{S(y),w.current=y},[y]);const C=P=>u.createElement($p,Ce(kt(Ce({fullWidth:!0,InputLabelProps:v||h.placeholder?{shrink:!0}:void 0},h),{sx:h.label?h.sx:Object.assign({"& .MuiInputBase-input":{pt:1.5}},h.sx),value:v,onChange(_){const I=_.target.value;(d==null?void 0:d(I))!==!1&&(S(I),(s||document.activeElement!==_.target)&&x(_,I))},onKeyDown(_){var I;(I=h.onKeyDown)==null||I.call(h,_),_.key==="Enter"&&x(_)},onBlur(_){var I;(I=h.onBlur)==null||I.call(h,_),x(_)},InputProps:Ce({startAdornment:a&&u.createElement(qa,{position:"start"},a),endAdornment:c&&u.createElement(qa,{position:"end"},c)},h.InputProps)}),P));return p?u.createElement(Dx,{freeSolo:!0,options:p,renderInput:C}):C(null);function x(P,_=v){const I=_.trim();I!==w.current&&(w.current=I,t(I,{was:e,event:P,cancel(){S(y)}}))}}function Yse(e,t,n){const r=u.useRef(),o=e[t];return e[t]=i=>{r.current=i,n==null||n(i),typeof o=="function"?o(i):o&&(o.current=i)},r}function gs(e){const a=e,{value:t,onChange:n,getApi:r,options:o,sx:i}=a,s=Yt(a,["value","onChange","getApi","options","sx"]);return u.createElement($p,kt(Ce(Ce({},oA(e)),s),{onChange(c){try{let d=c.target.value;d=JSON.parse(d),n(d,{was:t,event:c})}catch(d){}}}))}function SS(e){const a=e,{value:t,onChange:n,getApi:r,options:o,sx:i}=a,s=Yt(a,["value","onChange","getApi","options","sx"]);return u.createElement($p,kt(Ce(Ce({},oA(kt(Ce({},e),{value:void 0}))),s),{SelectProps:{multiple:!0},value:Array.isArray(t)?t.map(c=>JSON.stringify(c)):[],onChange(c){try{let d=c.target.value;d=Array.isArray(d)?d.map(p=>JSON.parse(p)):[],n(d,{was:t,event:c})}catch(d){}}}))}function oA(e){const{options:t,disabled:n,start:r,end:o}=e,i=Array.isArray(t)?t.map(c=>typeof c=="string"||typeof c=="number"?{value:c,label:String(c)}:c):Object.entries(t).map(([c,d])=>({value:d,label:c})),s=JSON.stringify(e.value),a=i.find(c=>JSON.stringify(c.value)===s);return{select:!0,fullWidth:!0,sx:e.label?e.sx:Object.assign({"& .MuiInputBase-input":{pt:1}},e.sx),value:a?s:"",disabled:!(i!=null&&i.length)||n,InputProps:Ce({startAdornment:r&&u.createElement(qa,{position:"start"},r),endAdornment:o&&u.createElement(qa,{position:"end"},o)},e.InputProps),children:i.map((c,d)=>u.createElement(fo,{key:d,value:JSON.stringify(c==null?void 0:c.value),children:c==null?void 0:c.label}))}}function Rm(r){var o=r,{value:e,empty:t="-"}=o,n=Yt(o,["value","empty"]);return!n.toField&&t!==void 0&&e!==0&&!e&&(e=t),u.createElement(io,kt(Ce({},n),{value:e,disabled:!0}))}function Zi(d){var p=d,{value:e,onChange:t,getApi:n,required:r,min:o,max:i,step:s,unit:a}=p,c=Yt(p,["value","onChange","getApi","required","min","max","step","unit"]);return n==null||n({getError(){return e==null?r?"required":!1:e<o?"too low":e>i?"too high":!1}}),u.createElement(io,Ce({type:"number",value:e==null?"":String(e),onChange(h,y){var v=y,{was:m}=v,g=Yt(v,["was"]);t(h?Number(h):null,kt(Ce({},g),{was:m?Number(m):null}))},inputProps:{min:o,max:i,step:s},InputProps:St.merge({sx:{"& input":{appearance:"textfield"}}},a&&{sx:{pr:"6px","& input":{pl:".2em",textAlign:"right"}},endAdornment:u.createElement(qa,{position:"end",sx:{mt:"1.2em",ml:"5px","& p":{fontSize:"80%"}}},a)})},c))}function Eo(c){var d=c,{label:e="",value:t,onChange:n,getApi:r,helperText:o,error:i,type:s}=d,a=Yt(d,["label","value","onChange","getApi","helperText","error","type"]);const p=()=>t!=null?t:!1,[h,m]=u.useState(p);u.useEffect(()=>m(p),[t]);const g=u.createElement(SF,kt(Ce({checked:h},a),{onChange(y){n(y.target.checked,{event:y,was:t})}}));return u.createElement(je,{ml:1,mt:1,sx:i?{color:"error.main",outlineOffset:6,outline:"1px solid"}:void 0},u.createElement(rF,Ce({label:e,control:g,labelPlacement:"end"},a.size==="small"&&{sx:{"& .MuiFormControlLabel-label":{fontSize:".9rem"}}})),o&&u.createElement(_p,{error:i},o))}var ES={},Qse=ut;Object.defineProperty(ES,"__esModule",{value:!0});var dy=ES.default=void 0,Xse=Qse(dt()),Jse=at(),Zse=(0,Xse.default)((0,Jse.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");dy=ES.default=Zse;var PS={},ele=ut;Object.defineProperty(PS,"__esModule",{value:!0});var bs=PS.default=void 0,tle=ele(dt()),nle=at(),rle=(0,tle.default)((0,nle.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");bs=PS.default=rle;function ole({value:e,onChange:t,keyLabel:n="key",valueLabel:r="value",keyWidth:o=5,valueWidth:i=5,actionsWidth:s=1}){const a=u.useRef(),c=u.useRef(),d={padding:".5em 1em",fontWeight:"bold"};return u.createElement(Jn,{container:!0},u.createElement(Jn,{item:!0,xs:o,sx:d},n),u.createElement(Jn,{item:!0,xs:i,sx:d},r),u.createElement(Jn,{item:!0,xs:s},u.createElement(oo,{onClick(){a.current.focus()}},u.createElement(dy))),Object.entries(e||{}).map(([p,h])=>[u.createElement(Jn,{key:"k",item:!0,xs:o},u.createElement(io,{value:p,onChange(m,v){var S=v,{was:g}=S,y=Yt(S,["was"]);const w=Ce({},e);m&&(w[m]=g!==void 0?w[g]:""),g!==void 0&&delete w[g],t(w,Ce({was:e},y))}})),u.createElement(Jn,{key:"v",item:!0,xs:i},u.createElement(io,{inputRef(m){c.current===p&&(m==null||m.focus(),c.current=null)},value:h,onChange(m,v){var S=v,{was:g}=S,y=Yt(S,["was"]);const w=Ce({},e);m?w[p]=m:delete w[p],t(w,Ce({was:e},y))}})),u.createElement(Jn,{key:"actions",item:!0,xs:s,sx:{display:"flex"}},u.createElement(oo,{onClick(m){const g=Ce({},e);delete g[p],t(g,{was:e,event:m})}},u.createElement(bs)))]),u.createElement(Jn,{item:!0,xs:o},u.createElement(io,{inputRef:a,value:"",onChange(p,h){if(p){if(h.cancel(),e!=null&&e.hasOwnProperty(p))return alert(n+" entry already present");c.current=p,t(kt(Ce({},e),{[p]:""}),kt(Ce({},h),{was:e}))}}})),u.createElement(Jn,{item:!0,xs:i},u.createElement(io,{value:"",onChange(){},disabled:!0})))}function Mp(y){var v=y,{fields:e,values:t,set:n,defaults:r,save:o,stickyBar:i,addToBar:s=[],barSx:a,formRef:c,onError:d,saveOnEnter:p,gridProps:h,formProps:m}=v,g=Yt(v,["fields","values","set","defaults","save","stickyBar","addToBar","barSx","formRef","onError","saveOnEnter","gridProps","formProps"]);const S=u.useRef(!1);u.useEffect(()=>(S.current=!0,()=>{S.current=!1}),[]);const[w,C]=u.useState({}),[x,P]=u.useState({}),_=typeof o=="function"?{onClick:o}:o,[I,k]=u.useState(0),M=u.useRef(!1),O=u.useRef("");u.useEffect(()=>void B(),[I]);const F={};return u.createElement("form",kt(Ce({ref:c&&(R=>c.current=R||void 0)},m),{onSubmit(R){R.preventDefault()},onKeyDown(R){_&&!_.disabled&&(R.ctrlKey||R.metaKey)&&R.key==="Enter"&&L()}}),u.createElement(je,Ce({display:"flex",flexDirection:"column",gap:3},g),u.createElement(Jn,Ce({container:!0,rowSpacing:3,columnSpacing:1},h),e.map((R,A)=>{if(!R)return null;if(u.isValidElement(R))return u.createElement(Jn,{key:A,item:!0,xs:12},R);const ie=R,{k:z,fromField:V=nu.identity,toField:N=nu.identity,getError:H,error:W}=ie,K=Yt(ie,["k","fromField","toField","getError","error"]);let Y=w[z]||W||x[z];if(Y===!0&&(Y="Not valid"),z){const de=R.hasOwnProperty("value")?R.value:t==null?void 0:t[z],se=Ce(Ce({},R),K);Object.assign(K,{value:N(de),error:!!(Y||W)||void 0,getApi(le){F[z]=le},onBlur(){D(z)},onKeyDown(le){p&&le.key==="Enter"&&L()},onChange(le){try{if(le=V(le),P(Ee=>kt(Ce({},Ee),{[z]:!1})),nu.isEqual(le,de))return;n(le,z),D(z)}catch(Ee){P(ye=>kt(Ce({},ye),{[z]:(Ee==null?void 0:Ee.message)||String(Ee)||!0}))}}}),Array.isArray(K.helperText)&&(K.helperText=u.createElement(u.Fragment,{},...K.helperText)),Y&&(K.helperText=K.helperText?u.createElement(u.Fragment,{},u.createElement("span",{style:{borderBottom:"1px solid"}},Y),u.createElement(je,{color:"text.primary",component:"span",display:"block"},K.helperText)):Y),K.label===void 0&&(K.label=iA(z)),nu.defaults(K,r==null?void 0:r(se))}{const re=K,{xs:de=12,sm:se,md:le,lg:Ee,xl:ye,comp:_e=io,before:ee,after:ke,fromField:Re,toField:Pe}=re,pe=Yt(re,["xs","sm","md","lg","xl","comp","before","after","fromField","toField"]);return Object.assign(pe,{name:z}),u.createElement(Jn,{key:z||A,item:!0,xs:de,sm:se,md:le,lg:Ee,xl:ye},ee,u.isValidElement(_e)?_e:u.createElement(_e,pe),ke)}})),_&&u.createElement(je,{display:"flex",alignItems:"center",sx:Object.assign({},i&&{width:"fit-content",zIndex:2,backgroundColor:"background.paper",borderRadius:1,position:"sticky",bottom:0,p:1,m:-1},a)},u.createElement(ZF,kt(Ce({variant:"contained",startIcon:u.createElement(uy),children:"Save",loading:fS(I!==0)},_),{onClick:L})),...s)));function L(){M.current=!0,D()}function D(R=""){I===0&&(O.current=R,setTimeout(()=>k(A=>A===0?1:A)))}function B(){return mt(this,null,function*(){var z,V;if(I===0)return;if(I===1)return k(2);const R="Please review errors",A={};for(const N of e){if(!N||u.isValidElement(N)||!N.k)continue;const{k:H}=N,W=t==null?void 0:t[H],K=(yield(z=F[H])==null?void 0:z.getError())||(yield(V=N.getError)==null?void 0:V.call(N,W,{values:t,fields:e}))||x[H];if(A[H]=K||!1,!M.current&&H===O.current)break;if(!S.current)return}C(A);try{if(!M.current)return;if(Object.values(A).some(Boolean))return yield d==null?void 0:d(R);const N=_&&_.onClick;N&&(yield N())}catch(N){yield d==null?void 0:d(N)}finally{M.current=!1,S.current&&k(0)}})}}function iA(e){return nu.upperFirst(e.indexOf("_")>0?e.replace(/_/g," "):e.replace(/([a-z])([A-Z])/g,(t,n,r)=>n+" "+r.toLowerCase()))}function sA(){return aF("(prefers-color-scheme: dark)")}const ile={};function sle(){const e=sA()?null:ile;return u.useMemo(()=>Ex({palette:e||{mode:"dark",text:{primary:"#bbb"},primary:{main:"#469",light:"#68c"},secondary:{main:"#969"}},typography:{fontFamily:'Roboto, "Noto sans", "Segoe UI", "San Francisco", "Helvetica Neue", Arial, sans-serif'},components:{MuiLink:{defaultProps:e||{color:"primary.light"}},MuiTextField:{defaultProps:{variant:"filled"},styleOverrides:e||{root:{"& label.Mui-focused":{color:"#ccc"}}}},MuiButton:{defaultProps:{variant:"outlined"},styleOverrides:e||{root({ownerState:t}){return t.color==="primary"&&{color:t.variant==="contained"?"#ddd":"#68c"}}}}}}),[e])}kw.Container=function(t){const n=u.useRef(),{width:r,height:o}=HF(),i=r>0&&Math.min(r,o)<500;u.useEffect(()=>{const h=setTimeout(()=>{const m=n.current;if(!m||(m.focus(),i))return;const g=m.querySelector("[autofocus]")||m.querySelector("input,textarea");g&&g instanceof HTMLElement&&g.focus()});return()=>clearTimeout(h)},[n.current]);const s=IS();t=Ce(Ce({},kw),t);const p=t.dialogProps||{},{sx:a,root:c}=p,d=Yt(p,["sx","root"]);return u.createElement(lJ,kt(Ce(Ce({open:!0,maxWidth:"lg",fullScreen:i},d),c),{onClose:()=>Bi()}),t.title&&u.createElement(CJ,{sx:Ce({position:"sticky",top:0,py:1,pr:1,zIndex:2,boxShadow:"0 0 8px #0004",display:"flex",alignItems:"center"},s)},u.createElement(je,{flex:1,minWidth:40},_w(t.title)),u.createElement(zn,{icon:Rp,title:"close",onClick:()=>Bi()})),u.createElement(gJ,{ref:n,sx:Ce({p:t.padding?1:0,pt:"16px !important",overflow:"initial",display:"flex",flexDirection:"column",justifyContent:"center"},a)},u.createElement(t.Content)))};function IS(){return sA()?{bgcolor:"#2d2d2d"}:{bgcolor:"#ccc",color:"#444"}}const lA={error:ty,warning:ny,info:tp,success:sS};function un(e,t){const n=typeof t=="string"?{type:t}:t!=null?t:{};let a=n,{type:r="info"}=a,o=Yt(a,["type"]);e instanceof Error&&(e=e.message||String(e),r="error");const i=bS(),s=Wo(kt(Ce({className:"dialog-alert-"+r,icon:"!",onClose:i.resolve},o),{Content(){var c;return u.createElement(je,{display:"flex",flexDirection:"column",alignItems:"center",gap:1},u.createElement(oo,{onClick(){s.close()},size:"small",sx:{position:"absolute",right:0,top:0,opacity:.5}},u.createElement(Rp)),(c=n.icon)!=null?c:u.createElement(lA[r],{color:r,fontSize:"large"}),u.isValidElement(e)?e:u.createElement(je,{fontSize:"large",mb:1,lineHeight:"1.8em"},String(e)))}}));return Object.assign(i,s)}function qs(e,r={}){var o=r,{href:t}=o,n=Yt(o,["href"]);const i=bS(),s=Wo(kt(Ce({className:"dialog-confirm",icon:"?",onClose:i.resolve},n),{Content:a}));return Object.assign(i,s);function a(){return u.createElement(u.Fragment,{},u.createElement(je,{mb:2},e),u.createElement(Ql,{},u.createElement("a",{href:t,onClick:()=>Bi(!0)},u.createElement(mr,{variant:"contained"},"Confirm")),u.createElement(mr,{onClick:()=>Bi(!1)},"Don't")))}}function rp(r){return mt(this,null,function*(){var o=r,{form:e,values:t}=o,n=Yt(o,["form","values"]);return new Promise(s=>Wo(kt(Ce({className:"dialog-confirm",icon:"?",onClose:s},n),{Content:i})));function i(){const[s,a]=u.useState(t||{}),h=typeof e=="function"?e(s):e,{onChange:c,before:d}=h,p=Yt(h,["onChange","before"]);return u.createElement(u.Fragment,{},d,u.createElement(Mp,kt(Ce({},p),{values:s,set(m,g){a(y=>{const v=kt(Ce({},y),{[g]:m});return c==null||c(v,{setValues:a}),v})},save:kt(Ce({},p.save),{onClick(){Bi(s)}})})))}})}function lle(n){return mt(this,arguments,function*(e,t={}){return rp(kt(Ce({},t),{form:{fields:[Ce({k:"text",label:null,autoFocus:!0,before:u.createElement(je,{mb:2},e)},t.field)],save:Ce({children:"Continue",startIcon:u.createElement(AF)},t.save),saveOnEnter:!0,barSx:{gap:2},addToBar:[u.createElement(mr,{onClick:Bi},"Cancel"),...t.addToBar||[]]}})).then(r=>r==null?void 0:r.text)})}function Wr(e,t="info"){const r=Wo({Content:i,dialogProps:{fullScreen:!1,PaperProps:{sx:{transition:"opacity 3000ms ease-in"},ref(s){s&&(s.style.opacity="0")}}}}),{close:o}=r;return setTimeout(o,3e3),r;function i(){return u.createElement(je,{display:"flex",flexDirection:"column",alignItems:"center",gap:1},u.isValidElement(t)?t:u.createElement(lA[t],{color:t}),u.isValidElement(e)?e:u.createElement("div",{},String(e)))}}function aA(){return u.createElement(Ka)}function ale(e){return e&&/^[a-zA-Z]:$/.test(e)}function kS(e,t){return e==t||e&&t&&typeof e=="object"&&typeof t=="object"&&Object.entries(e).every(([n,r])=>kS(r,t[n]))}function fy(e){return e?{outline:"2px solid"}:void 0}function zn(d){var p=d,{title:e,icon:t,onClick:n,disabled:r,progress:o,link:i,tooltipProps:s,confirm:a}=p,c=Yt(p,["title","icon","onClick","disabled","progress","link","tooltipProps","confirm"]);const[h,m]=eo(!1);typeof r=="string"&&(e=r),i&&(n=()=>window.open(i));let g=u.createElement(oo,kt(Ce({disabled:!!(h||o||r)},c),{onClick(...v){return mt(this,null,function*(){if(a&&!(yield qs(a)))return;const S=n==null?void 0:n.apply(this,v);S&&S instanceof Promise&&(m(!0),S.catch(un).finally(()=>m(!1)))})}}),u.createElement(t));return(o||h)&&o!==!1&&(g=u.createElement(je,{position:"relative",display:"inline-block"},u.createElement(Ka,kt(Ce({},typeof o=="number"?{value:o*100,variant:"determinate"}:null),{style:{position:"absolute",top:4,left:4,width:32,height:32}})),g)),e&&(g=u.createElement(nd,kt(Ce({title:e},s),{children:u.createElement("span",{},g)}))),g}function yu(d){var p=d,{icon:e,title:t,onClick:n,disabled:r,progress:o,link:i,tooltipProps:s,confirm:a}=p,c=Yt(p,["icon","title","onClick","disabled","progress","link","tooltipProps","confirm"]);const[h,m]=eo(!1);typeof r=="string"&&(t=r,r=!0),i&&(n=()=>window.open(i));let g=u.createElement(ZF,kt(Ce({variant:"contained",startIcon:u.createElement(e),loading:!!(h||o),loadingPosition:"start",loadingIndicator:typeof o!="number"?void 0:u.createElement(Ka,{size:"1rem",value:o*100,variant:"determinate"}),disabled:r},c),{onClick(...v){return mt(this,null,function*(){if(a&&!(yield qs(a)))return;const S=n==null?void 0:n.apply(this,v);S&&S instanceof Promise&&(m(!0),S.catch(un).finally(()=>m(!1)))})}}));return t&&(g=u.createElement(nd,kt(Ce({title:t},s),{children:u.createElement("span",{},g)}))),g}function xo(e,t,n){return u.createElement(nd,{title:t,children:u.createElement(e,{sx:n})})}function _S(e){return u.createElement(Mo,Ce({component:VO},e))}function py(e){return u.createElement(je,Ce({display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column"},e))}function cle(e,t){return mt(this,null,function*(){const r=(yield Et("get_config",{only:[e]}))[e],o=yield t(r);JSON.stringify(r)!==JSON.stringify(o)&&(yield Et("set_config",{values:{[e]:o}}))})}function ule(e){return Object.keys(e)}function dle(e,t){var n;return(n=t[e])!=null?n:e}function Yl(e){return aF(t=>t.breakpoints.up(e),{noSsr:!0})}function cA(e){return{ENOENT:"Not found",ENOTDIR:"Not a folder"}[e]||e}function $S(e,t){return u.createElement(zn,Ce({icon:ey,title:"Reload",onClick:e},t))}const fle=navigator.platform.match("Mac");function ple(e){return(e.ctrlKey||fle&&e.metaKey)&&e.key}function uA({icon:e,progress:t,offset:n,addTitle:r,sx:o}){return u.createElement(u.Fragment,{},u.createElement(e,{sx:{position:"absolute",ml:"4px"}}),u.createElement(Ka,{value:t*100,variant:"determinate",size:32,sx:{position:"absolute"}}),u.createElement(nd,{title:u.createElement(u.Fragment,{},sse(t),r),children:u.createElement(Ka,{color:"success",value:(n||1e-7)*100,variant:"determinate",size:32,sx:Ce({display:"flex"},o)})}))}function Ql(i){var s=i,{gap:e=".8em",vert:t=!1,children:n=null,props:r={}}=s,o=Yt(s,["gap","vert","children","props"]);return u.createElement(je,Ce({sx:Ce({display:"flex",gap:e,flexDirection:t?"column":void 0},o)},r),n)}function Ya(e,t){return Array.isArray(t)&&(t=np(t)),u.createElement(Mo,{href:Zie+e,target:"help"},t)}function dA(e,t,n,r){let o=e[t];return mS(e,()=>{const i=e[t];Object.is(o,i)||n(o=i)},r)}const fA="admin_state",pn=hS(Object.assign({title:"",config:{},selectedFiles:[],vfs:void 0,loginRequired:!1,username:"",onlinePluginsColumns:{version:!1,pushed_at:!1,license:!1}},JSON.parse(localStorage[fA]||null))),pA=["onlinePluginsColumns"],hle=St.debounce(()=>localStorage[fA]=JSON.stringify(St.pick(pn,pA)),500,{maxWait:1e3});for(const e of pA)dA(pn,e,hle);function oa(){return gS(pn)}function Oi(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(o){return"'"+o+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function zu(e){return!!e&&!!e[Do]}function Qa(e){var t;return!!e&&(function(n){if(!n||typeof n!="object")return!1;var r=Object.getPrototypeOf(n);if(r===null)return!0;var o=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return o===Object||typeof o=="function"&&Function.toString.call(o)===xle}(e)||Array.isArray(e)||!!e[cR]||!!(!((t=e.constructor)===null||t===void 0)&&t[cR])||RS(e)||MS(e))}function op(e,t,n){n===void 0&&(n=!1),od(e)===0?(n?Object.keys:AS)(e).forEach(function(r){n&&typeof r=="symbol"||t(r,e[r],e)}):e.forEach(function(r,o){return t(o,r,e)})}function od(e){var t=e[Do];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:RS(e)?2:MS(e)?3:0}function Lw(e,t){return od(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function mle(e,t){return od(e)===2?e.get(t):e[t]}function hA(e,t,n){var r=od(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function gle(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function RS(e){return wle&&e instanceof Map}function MS(e){return Cle&&e instanceof Set}function wa(e){return e.o||e.t}function TS(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Sle(e);delete t[Do];for(var n=AS(t),r=0;r<n.length;r++){var o=n[r],i=t[o];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function OS(e,t){return t===void 0&&(t=!1),LS(e)||zu(e)||!Qa(e)||(od(e)>1&&(e.set=e.add=e.clear=e.delete=vle),Object.freeze(e),t&&op(e,function(n,r){return OS(r,!0)},!0)),e}function vle(){Oi(2)}function LS(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function us(e){var t=Ele[e];return t||Oi(18,e),t}function nR(){return ip}function V1(e,t){t&&(us("Patches"),e.u=[],e.s=[],e.v=t)}function Eg(e){Fw(e),e.p.forEach(yle),e.p=null}function Fw(e){e===ip&&(ip=e.l)}function rR(e){return ip={p:[],l:ip,h:e,m:!0,_:0}}function yle(e){var t=e[Do];t.i===0||t.i===1?t.j():t.g=!0}function U1(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||us("ES5").S(t,e,r),r?(n[Do].P&&(Eg(t),Oi(4)),Qa(e)&&(e=Pg(t,e),t.l||Ig(t,e)),t.u&&us("Patches").M(n[Do].t,e,t.u,t.s)):e=Pg(t,n,[]),Eg(t),t.u&&t.v(t.u,t.s),e!==mA?e:void 0}function Pg(e,t,n){if(LS(t))return t;var r=t[Do];if(!r)return op(t,function(a,c){return oR(e,r,t,a,c,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Ig(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=r.i===4||r.i===5?r.o=TS(r.k):r.o,i=o,s=!1;r.i===3&&(i=new Set(o),o.clear(),s=!0),op(i,function(a,c){return oR(e,r,o,a,c,n,s)}),Ig(e,o,!1),n&&e.u&&us("Patches").N(r,n,e.u,e.s)}return r.o}function oR(e,t,n,r,o,i,s){if(zu(o)){var a=Pg(e,o,i&&t&&t.i!==3&&!Lw(t.R,r)?i.concat(r):void 0);if(hA(n,r,a),!zu(a))return;e.m=!1}else s&&n.add(o);if(Qa(o)&&!LS(o)){if(!e.h.D&&e._<1)return;Pg(e,o),t&&t.A.l||Ig(e,o)}}function Ig(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&OS(t,n)}function W1(e,t){var n=e[Do];return(n?wa(n):e)[t]}function iR(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Aw(e){e.P||(e.P=!0,e.l&&Aw(e.l))}function G1(e){e.o||(e.o=TS(e.t))}function Nw(e,t,n){var r=RS(t)?us("MapSet").F(t,n):MS(t)?us("MapSet").T(t,n):e.O?function(o,i){var s=Array.isArray(o),a={i:s?1:0,A:i?i.A:nR(),P:!1,I:!1,R:{},l:i,t:o,k:null,o:null,j:null,C:!1},c=a,d=Dw;s&&(c=[a],d=lf);var p=Proxy.revocable(c,d),h=p.revoke,m=p.proxy;return a.k=m,a.j=h,m}(t,n):us("ES5").J(t,n);return(n?n.A:nR()).p.push(r),r}function ble(e){return zu(e)||Oi(22,e),function t(n){if(!Qa(n))return n;var r,o=n[Do],i=od(n);if(o){if(!o.P&&(o.i<4||!us("ES5").K(o)))return o.t;o.I=!0,r=sR(n,i),o.I=!1}else r=sR(n,i);return op(r,function(s,a){o&&mle(o.t,s)===a||hA(r,s,t(a))}),i===3?new Set(r):r}(e)}function sR(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return TS(e)}var lR,ip,FS=typeof Symbol!="undefined"&&typeof Symbol("x")=="symbol",wle=typeof Map!="undefined",Cle=typeof Set!="undefined",aR=typeof Proxy!="undefined"&&Proxy.revocable!==void 0&&typeof Reflect!="undefined",mA=FS?Symbol.for("immer-nothing"):((lR={})["immer-nothing"]=!0,lR),cR=FS?Symbol.for("immer-draftable"):"__$immer_draftable",Do=FS?Symbol.for("immer-state"):"__$immer_state",xle=""+Object.prototype.constructor,AS=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Sle=Object.getOwnPropertyDescriptors||function(e){var t={};return AS(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},Ele={},Dw={get:function(e,t){if(t===Do)return e;var n=wa(e);if(!Lw(n,t))return function(o,i,s){var a,c=iR(i,s);return c?"value"in c?c.value:(a=c.get)===null||a===void 0?void 0:a.call(o.k):void 0}(e,n,t);var r=n[t];return e.I||!Qa(r)?r:r===W1(e.t,t)?(G1(e),e.o[t]=Nw(e.A.h,r,e)):r},has:function(e,t){return t in wa(e)},ownKeys:function(e){return Reflect.ownKeys(wa(e))},set:function(e,t,n){var r=iR(wa(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=W1(wa(e),t),i=o==null?void 0:o[Do];if(i&&i.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(gle(n,o)&&(n!==void 0||Lw(e.t,t)))return!0;G1(e),Aw(e)}return e.o[t]===n&&(n!==void 0||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return W1(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,G1(e),Aw(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=wa(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){Oi(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Oi(12)}},lf={};op(Dw,function(e,t){lf[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),lf.deleteProperty=function(e,t){return lf.set.call(this,e,t,void 0)},lf.set=function(e,t,n){return Dw.set.call(this,e[0],t,n,e[0])};var Ple=function(){function e(n){var r=this;this.O=aR,this.D=!0,this.produce=function(o,i,s){if(typeof o=="function"&&typeof i!="function"){var a=i;i=o;var c=r;return function(v){var S=this;v===void 0&&(v=a);for(var w=arguments.length,C=Array(w>1?w-1:0),x=1;x<w;x++)C[x-1]=arguments[x];return c.produce(v,function(P){var _;return(_=i).call.apply(_,[S,P].concat(C))})}}var d;if(typeof i!="function"&&Oi(6),s!==void 0&&typeof s!="function"&&Oi(7),Qa(o)){var p=rR(r),h=Nw(r,o,void 0),m=!0;try{d=i(h),m=!1}finally{m?Eg(p):Fw(p)}return typeof Promise!="undefined"&&d instanceof Promise?d.then(function(v){return V1(p,s),U1(v,p)},function(v){throw Eg(p),v}):(V1(p,s),U1(d,p))}if(!o||typeof o!="object"){if((d=i(o))===void 0&&(d=o),d===mA&&(d=void 0),r.D&&OS(d,!0),s){var g=[],y=[];us("Patches").M(o,d,g,y),s(g,y)}return d}Oi(21,o)},this.produceWithPatches=function(o,i){if(typeof o=="function")return function(d){for(var p=arguments.length,h=Array(p>1?p-1:0),m=1;m<p;m++)h[m-1]=arguments[m];return r.produceWithPatches(d,function(g){return o.apply(void 0,[g].concat(h))})};var s,a,c=r.produce(o,i,function(d,p){s=d,a=p});return typeof Promise!="undefined"&&c instanceof Promise?c.then(function(d){return[d,s,a]}):[c,s,a]},typeof(n==null?void 0:n.useProxies)=="boolean"&&this.setUseProxies(n.useProxies),typeof(n==null?void 0:n.autoFreeze)=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var t=e.prototype;return t.createDraft=function(n){Qa(n)||Oi(8),zu(n)&&(n=ble(n));var r=rR(this),o=Nw(this,n,void 0);return o[Do].C=!0,Fw(r),o},t.finishDraft=function(n,r){var o=n&&n[Do],i=o.A;return V1(i,r),U1(void 0,i)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!aR&&Oi(20),this.O=n},t.applyPatches=function(n,r){var o;for(o=r.length-1;o>=0;o--){var i=r[o];if(i.path.length===0&&i.op==="replace"){n=i.value;break}}o>-1&&(r=r.slice(o+1));var s=us("Patches").$;return zu(n)?s(n,r):this.produce(n,function(a){return s(a,r)})},e}(),Bo=new Ple,Ile=Bo.produce;Bo.produceWithPatches.bind(Bo);Bo.setAutoFreeze.bind(Bo);Bo.setUseProxies.bind(Bo);Bo.applyPatches.bind(Bo);Bo.createDraft.bind(Bo);Bo.finishDraft.bind(Bo);const kle=Ile;mie({onResponse(e,t){return mt(this,null,function*(){if(e.status===401)throw pn.loginRequired=(t==null?void 0:t.any)!==!1||403,new DF(e.status,"Unauthorized")})}});function Lo(...e){const[t,n,r]=ry(...e),o=e[0],i=t===void 0,s=u.useMemo(()=>o?n?u.createElement(Uo,{severity:"error"},String(n),u.createElement(zn,{icon:ey,onClick:r,sx:{m:"-8px 0 -8px 16px"}})):i?aA():null:null,[n,o,i,r]);return{data:t,error:n,reload:r,loading:i,element:s}}function sc(e,t={},{map:n=r=>r}={}){const[r,o]=eo([]),[i,s]=eo(void 0),[a,c]=eo(void 0),[d,p]=eo(!0),[h,m]=eo(!1),[g,y]=eo(!0),[v,S]=u.useState(0),w=u.useRef(0);return u.useEffect(()=>{if(!e)return;const _=[],I=St.debounce(()=>{const O=_.splice(0,1/0);O.length&&o(F=>[...F,...O])},1e3,{maxWait:1e3});c(void 0),m(!0),p(!0),y(!0),o([]);const k=BF(e,t,(O,F)=>{switch(O){case"connected":return p(!1),setTimeout(()=>I.flush());case"error":return c("Connection error"),setTimeout(C,1e3),M();case"closed":return M();case"msg":const L=[],D=[];lse(F).forEach(B=>{var z;if(!Array.isArray(B))return console.debug("illegal list packet",B);const[R,A]=B;if(R==="ready"){I.flush(),y(!1);return}if(R==="error"){A===401?pn.loginRequired=B[2].any!==!1||403:c(cA(A));return}if(R==="props")return s(A);if(R==="add"){const V=n(A);(z=V.id)!=null||(V.id=w.current=Math.max(w.current,Date.now())+.001),_.push(V),I();return}if(R==="remove"){const V=St.matches(A);St.isEmpty(St.remove(_,V))&&L.push(V);return}if(R==="update"){const V=B[2],N=St.find(_,A);if(N)return Object.assign(N,V);D.push([A,V]);return}console.debug("unknown list api",R)}),o(B=>{let R=B,A;if(L.length&&(A=B.filter(z=>!L.some(V=>V(z))),A.length<B.length&&(R=A)),D.length)for(const[z,V]of D){const N=St.findIndex(R,z);N<0||(R===B&&(R=A!=null?A:B.slice()),R[N]=Ce(Ce({},R[N]),V))}return R}),(k==null?void 0:k.readyState)===(k==null?void 0:k.CLOSED)&&M()}});return()=>k.close();function M(){y(!1),m(!1),I.flush()}},[v,e,JSON.stringify(t)]),{list:r,props:i,loading:h,error:a,initializing:g,connecting:d,setList:o,updateList:x,updateEntry:P,reload:C};function C(){S(_=>_+1)}function x(_){o(kle(r,I=>{_(I)}))}function P(_,I){x(k=>{const M=St.find(k,_);M&&Object.assign(M,I)})}}var NS={},_le=ut;Object.defineProperty(NS,"__esModule",{value:!0});var gA=NS.default=void 0,$le=_le(dt()),Rle=at(),Mle=(0,$le.default)((0,Rle.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-1 14H9V8h2v8zm4 0h-2V8h2v8z"}),"PauseCircle");gA=NS.default=Mle;var DS={},Tle=ut;Object.defineProperty(DS,"__esModule",{value:!0});var hy=DS.default=void 0,Ole=Tle(dt()),Lle=at(),Fle=(0,Ole.default)((0,Lle.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM9.5 16.5v-9l7 4.5-7 4.5z"}),"PlayCircle");hy=DS.default=Fle;var BS={},Ale=ut;Object.defineProperty(BS,"__esModule",{value:!0});var vA=BS.default=void 0,Nle=Ale(dt()),Dle=at(),Ble=(0,Nle.default)((0,Dle.jsx)("path",{d:"M17 7h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.43-.98 2.63-2.31 2.98l1.46 1.46C20.88 15.61 22 13.95 22 12c0-2.76-2.24-5-5-5zm-1 4h-2.19l2 2H16zM2 4.27l3.11 3.11C3.29 8.12 2 9.91 2 12c0 2.76 2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1 0-1.59 1.21-2.9 2.76-3.07L8.73 11H8v2h2.73L13 15.27V17h1.73l4.01 4L20 19.74 3.27 3 2 4.27z"}),"LinkOff");vA=BS.default=Ble;var zS={},zle=ut;Object.defineProperty(zS,"__esModule",{value:!0});var jS=zS.default=void 0,jle=zle(dt()),Hle=at(),Vle=(0,jle.default)((0,Hle.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"}),"Lock");jS=zS.default=Vle;var HS={},Ule=ut;Object.defineProperty(HS,"__esModule",{value:!0});var yA=HS.default=void 0,Wle=Ule(dt()),Gle=at(),Kle=(0,Wle.default)((0,Gle.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12zm8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8z"}),"Block");yA=HS.default=Kle;var VS={},qle=ut;Object.defineProperty(VS,"__esModule",{value:!0});var bA=VS.default=void 0,Yle=qle(dt()),Qle=at(),Xle=(0,Yle.default)((0,Qle.jsx)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-2 6h-2v2h2v2h-2v2h-2v-2h2v-2h-2v-2h2v-2h-2V8h2v2h2v2z"}),"FolderZip");bA=VS.default=Xle;var US={},Jle=ut;Object.defineProperty(US,"__esModule",{value:!0});var Tp=US.default=void 0,Zle=Jle(dt()),eae=at(),tae=(0,Zle.default)((0,eae.jsx)("path",{d:"M5 20h14v-2H5v2zm0-10h4v6h6v-6h4l-7-7-7 7z"}),"Upload");Tp=US.default=tae;var WS={},nae=ut;Object.defineProperty(WS,"__esModule",{value:!0});var GS=WS.default=void 0,rae=nae(dt()),oae=at(),iae=(0,rae.default)((0,oae.jsx)("path",{d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"}),"Download");GS=WS.default=iae;const wA=u.createContext(void 0);function Dt(){const e=u.useContext(wA);if(e===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(`
|
|
328
|
+
`));return e}const sae=()=>u.useRef({}),CA=u.createContext(void 0),tt=()=>{const e=u.useContext(CA);if(!e)throw new Error("MUI: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return e},xA=u.createContext(void 0);function lc(){const e=u.useContext(xA);if(e===void 0)throw new Error(["MUI: Could not find the data grid private 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(`
|
|
329
|
+
`));return e}const uR={};function lae(e,t){const n=u.useRef(uR);return n.current===uR&&(n.current=e(t)),n}const aae=[];function cae(e){u.useEffect(e,aae)}const ws=(e,t="warning")=>{let n=!1;const r=Array.isArray(e)?e.join(`
|
|
330
|
+
`):e;return()=>{n||(n=!0,t==="error"?console.error(r):console.warn(r))}},uae=Object.is;function SA(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,r=0;for(const o in e)if(n+=1,!uae(e[o],t[o])||!(o in t))return!1;for(const o in t)r+=1;return n===r}ws(["MUI: `useGridSelector` has been called before the initialization of the state.","This hook can only be used inside the context of the grid."]);function dae(e){return e.acceptsApiRef}function dR(e,t){return dae(t)?t(e):t(e.current.state)}const fae=Object.is,KS=SA,pae=()=>({state:null,equals:null,selector:null}),Ge=(e,t,n=fae)=>{const r=lae(pae),o=r.current.selector!==null,[i,s]=u.useState(o?null:dR(e,t));return r.current.state=i,r.current.equals=n,r.current.selector=t,cae(()=>e.current.store.subscribe(()=>{const a=dR(e,r.current.selector);r.current.equals(r.current.state,a)||(r.current.state=a,s(a))})),i};function Bt(e){return Je("MuiDataGrid",e)}const X=Xe("MuiDataGrid",["actionsCell","aggregationColumnHeader","aggregationColumnHeader--alignLeft","aggregationColumnHeader--alignCenter","aggregationColumnHeader--alignRight","aggregationColumnHeaderLabel","autoHeight","booleanCell","cell--editable","cell--editing","cell--textCenter","cell--textLeft","cell--textRight","cell--withRenderer","cell--rangeTop","cell--rangeBottom","cell--rangeLeft","cell--rangeRight","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","filterFormLogicOperatorInput","filterFormColumnInput","filterFormOperatorInput","filterFormValueInput","filterIcon","footerContainer","headerFilterRow","iconButtonContainer","iconSeparator","main","menu","menuIcon","menuIconButton","menuOpen","menuList","overlay","overlayWrapper","overlayWrapperInner","root","root--densityStandard","root--densityComfortable","root--densityCompact","root--disableUserSelection","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","withBorderColor","cell--withRightBorder","columnHeader--withRightBorder","treeDataGroupingCell","treeDataGroupingCellToggle","groupingCriteriaCell","groupingCriteriaCellToggle","pinnedRows","pinnedRows--top","pinnedRows--bottom","pinnedRowsRenderZone"]),hae=e=>{const{classes:t}=e;return Me({root:["main"]},Bt,t)},mae=vr("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(e,t)=>t.main})(()=>({position:"relative",flexGrow:1,display:"flex",flexDirection:"column",overflow:"hidden"})),gae=u.forwardRef((e,t)=>{const n=tt(),r=hae(n);return T.jsx(mae,{ref:t,className:r.root,ownerState:n,children:e.children})});var kg="NOT_FOUND";function vae(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:kg},put:function(r,o){t={key:r,value:o}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function yae(e,t){var n=[];function r(a){var c=n.findIndex(function(p){return t(a,p.key)});if(c>-1){var d=n[c];return c>0&&(n.splice(c,1),n.unshift(d)),d.value}return kg}function o(a,c){r(a)===kg&&(n.unshift({key:a,value:c}),n.length>e&&n.pop())}function i(){return n}function s(){n=[]}return{get:r,put:o,getEntries:i,clear:s}}var bae=function(t,n){return t===n};function wae(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var o=n.length,i=0;i<o;i++)if(!e(n[i],r[i]))return!1;return!0}}function qS(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,o=r===void 0?bae:r,i=n.maxSize,s=i===void 0?1:i,a=n.resultEqualityCheck,c=wae(o),d=s===1?vae(c):yae(s,c);function p(){var h=d.get(arguments);if(h===kg){if(h=e.apply(null,arguments),a){var m=d.getEntries(),g=m.find(function(y){return a(y.value,h)});g&&(h=g.value)}d.put(arguments,h)}return h}return p.clearCache=function(){return d.clear()},p}function Cae(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(r){return typeof r=="function"})){var n=t.map(function(r){return typeof r=="function"?"function "+(r.name||"unnamed")+"()":typeof r}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function xae(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=function(){for(var s=arguments.length,a=new Array(s),c=0;c<s;c++)a[c]=arguments[c];var d=0,p,h={memoizeOptions:void 0},m=a.pop();if(typeof m=="object"&&(h=m,m=a.pop()),typeof m!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof m+"]");var g=h,y=g.memoizeOptions,v=y===void 0?n:y,S=Array.isArray(v)?v:[v],w=Cae(a),C=e.apply(void 0,[function(){return d++,m.apply(null,arguments)}].concat(S)),x=e(function(){for(var _=[],I=w.length,k=0;k<I;k++)_.push(w[k].apply(null,arguments));return p=C.apply(null,_),p});return Object.assign(x,{resultFunc:m,memoizedResultFunc:C,dependencies:w,lastResult:function(){return p},recomputations:function(){return d},resetRecomputations:function(){return d=0}}),x};return o}var Sae=xae(qS);const Eae={cache:new WeakMap};ws(["MUI: A selector was called without passing the instance ID, which may impact the performance of the grid.","To fix, call it with `apiRef`, e.g. `mySelector(apiRef)`, or pass the instance ID explicitly, e.g `mySelector(state, apiRef.current.instanceId)`."]);function jc(e){return"current"in e&&"instanceId"in e.current}const Hc={id:"default"},Tt=(e,t,n,r,o,i,...s)=>{if(s.length>0)throw new Error("Unsupported number of selectors");let a;if(e&&t&&n&&r&&o&&i)a=(c,d)=>{const p=jc(c),h=d!=null?d:p?c.current.instanceId:Hc,m=p?c.current.state:c,g=e(m,h),y=t(m,h),v=n(m,h),S=r(m,h),w=o(m,h);return i(g,y,v,S,w)};else if(e&&t&&n&&r&&o)a=(c,d)=>{const p=jc(c),h=d!=null?d:p?c.current.instanceId:Hc,m=p?c.current.state:c,g=e(m,h),y=t(m,h),v=n(m,h),S=r(m,h);return o(g,y,v,S)};else if(e&&t&&n&&r)a=(c,d)=>{const p=jc(c),h=d!=null?d:p?c.current.instanceId:Hc,m=p?c.current.state:c,g=e(m,h),y=t(m,h),v=n(m,h);return r(g,y,v)};else if(e&&t&&n)a=(c,d)=>{const p=jc(c),h=d!=null?d:p?c.current.instanceId:Hc,m=p?c.current.state:c,g=e(m,h),y=t(m,h);return n(g,y)};else if(e&&t)a=(c,d)=>{const p=jc(c),h=d!=null?d:p?c.current.instanceId:Hc,m=p?c.current.state:c,g=e(m,h);return t(g)};else throw new Error("Missing arguments");return a.acceptsApiRef=!0,a},In=(...e)=>{const t=(...n)=>{var r,o;const[i,s]=n,a=jc(i),c=a?i.current.instanceId:s!=null?s:Hc,d=a?i.current.state:i,{cache:p}=Eae;if(p.get(c)&&(r=p.get(c))!=null&&r.get(e)){var h;return(h=p.get(c))==null?void 0:h.get(e)(d,c)}const m=Sae(...e);return p.get(c)||p.set(c,new Map),(o=p.get(c))==null||o.set(e,m),m(d,c)};return t.acceptsApiRef=!0,t},ju=e=>e.columns,zs=Tt(ju,e=>e.orderedFields),id=Tt(ju,e=>e.lookup),ds=In(zs,id,(e,t)=>e.map(n=>t[n])),Li=Tt(ju,e=>e.columnVisibilityModel),Or=In(ds,Li,(e,t)=>e.filter(n=>t[n.field]!==!1)),my=In(Or,e=>e.map(t=>t.field)),Hu=In(Or,e=>{const t=[];let n=0;for(let r=0;r<e.length;r+=1)t.push(n),n+=e[r].computedWidth;return t}),YS=Tt(Or,Hu,(e,t)=>{const n=e.length;return n===0?0:t[n-1]+e[n-1].computedWidth}),EA=In(ds,e=>e.filter(t=>t.filterable)),Pae=In(ds,e=>e.reduce((t,n)=>(n.filterable&&(t[n.field]=n),t),{})),zi=e=>e.rows,gy=Tt(zi,e=>e.totalRowCount),Iae=Tt(zi,e=>e.loading),kae=Tt(zi,e=>e.totalTopLevelRowCount),_l=Tt(zi,e=>e.dataRowIdToModelLookup),_g=Tt(zi,e=>e.dataRowIdToIdLookup),Ti=Tt(zi,e=>e.tree),_ae=Tt(zi,e=>e.groupingName),fR=Tt(zi,e=>e.treeDepths),vy=In(zi,e=>{const t=Object.entries(e.treeDepths);return t.length===0?1:t.filter(([,n])=>n>0).map(([n])=>Number(n)).sort((n,r)=>r-n)[0]+1}),sm=Tt(zi,e=>e.dataRowIds),$ae=Tt(zi,e=>e==null?void 0:e.additionalRowGroups),sd=In($ae,e=>{var t,n;const r=e==null?void 0:e.pinnedRows;return{bottom:r==null||(t=r.bottom)==null?void 0:t.map(o=>{var i;return{id:o.id,model:(i=o.model)!=null?i:{}}}),top:r==null||(n=r.top)==null?void 0:n.map(o=>{var i;return{id:o.id,model:(i=o.model)!=null?i:{}}})}}),Rae=Tt(sd,e=>{var t,n;return((e==null||(t=e.top)==null?void 0:t.length)||0)+((e==null||(n=e.bottom)==null?void 0:n.length)||0)}),PA=e=>e.sorting,QS=Tt(PA,e=>e.sortedRows),XS=In(QS,_l,(e,t)=>e.map(n=>{var r;return{id:n,model:(r=t[n])!=null?r:{}}})),ni=Tt(PA,e=>e.sortModel),Mae=In(ni,e=>e.reduce((n,r,o)=>(n[r.field]={sortDirection:r.sort,sortIndex:e.length>1?o+1:void 0},n),{})),JS=e=>e.filter,Cr=Tt(JS,e=>e.filterModel);Tt(Cr,e=>e.quickFilterValues);const Tae=e=>e.visibleRowsLookup,IA=Tt(JS,e=>e.filteredRowsLookup);Tt(JS,e=>e.filteredDescendantCountLookup);const ia=In(Tae,XS,(e,t)=>t.filter(n=>e[n.id]!==!1)),If=In(ia,e=>e.map(t=>t.id)),Oae=In(IA,XS,(e,t)=>t.filter(n=>e[n.id]!==!1)),Lae=In(Oae,e=>e.map(t=>t.id)),kA=In(ia,Ti,vy,(e,t,n)=>n<2?e:e.filter(r=>{var o;return((o=t[r.id])==null?void 0:o.depth)===0})),_A=Tt(ia,e=>e.length),yy=Tt(kA,e=>e.length),Fae=In(Cr,id,(e,t)=>{var n;return(n=e.items)==null?void 0:n.filter(r=>{var o,i;if(!r.field)return!1;const s=t[r.field];if(!(s!=null&&s.filterOperators)||(s==null||(o=s.filterOperators)==null?void 0:o.length)===0)return!1;const a=s.filterOperators.find(c=>c.value===r.operator);return a?!a.InputComponent||r.value!=null&&((i=r.value)==null?void 0:i.toString())!=="":!1})}),Aae=In(Fae,e=>e.reduce((n,r)=>(n[r.field]?n[r.field].push(r):n[r.field]=[r],n),{})),by=e=>e.focus,ii=Tt(by,e=>e.cell),Nae=Tt(by,e=>e.columnHeader);Tt(by,e=>e.columnHeaderFilter);const $g=Tt(by,e=>e.columnGroupHeader),wy=e=>e.tabIndex,Rg=Tt(wy,e=>e.cell),$A=Tt(wy,e=>e.columnHeader);Tt(wy,e=>e.columnHeaderFilter);const Dae=Tt(wy,e=>e.columnGroupHeader),ZS=e=>e.density,Bae=Tt(ZS,e=>e.value),ld=Tt(ZS,e=>e.factor),Cy=e=>e.columnGrouping,zae=In(Cy,e=>{var t;return(t=e==null?void 0:e.unwrappedGroupingModel)!=null?t:{}}),RA=In(Cy,e=>{var t;return(t=e==null?void 0:e.lookup)!=null?t:{}}),jae=In(Cy,e=>{var t;return(t=e==null?void 0:e.headerStructure)!=null?t:[]}),Op=Tt(Cy,e=>{var t;return(t=e==null?void 0:e.maxDepth)!=null?t:0}),Bw=e=>e.columnMenu;function Hae(e){const{VirtualScrollerComponent:t,ColumnHeadersProps:n,children:r}=e,o=lc(),i=tt(),s=u.useRef(null),a=Ge(o,Or),c=Ge(o,Aae),d=Ge(o,Mae),p=Ge(o,Hu),h=Ge(o,$A),m=Ge(o,Rg),g=Ge(o,Dae),y=Ge(o,Nae),v=Ge(o,$g),S=Ge(o,ld),w=Ge(o,Op),C=Ge(o,Bw),x=Ge(o,Li),P=Ge(o,jae),_=!(g===null&&h===null&&m===null),[I,k]=u.useState(i.disableVirtualization);ln(()=>{o.current.computeSizeAndPublishResizeEvent();const R=s.current;if(typeof ResizeObserver=="undefined")return()=>{};let A;const z=new ResizeObserver(()=>{A=window.requestAnimationFrame(()=>{o.current.computeSizeAndPublishResizeEvent()})});return R&&z.observe(R),()=>{A&&window.cancelAnimationFrame(A),R&&z.unobserve(R)}},[o]);const M=u.useCallback(()=>{k(!0)},[]),O=u.useCallback(()=>{k(!1)},[]);u.useEffect(()=>{k(i.disableVirtualization)},[i.disableVirtualization]),o.current.unstable_disableVirtualization=M,o.current.unstable_enableVirtualization=O;const F=u.useRef(null),L=u.useRef(null),D=u.useRef(null);o.current.register("private",{columnHeadersContainerElementRef:L,columnHeadersElementRef:F,virtualScrollerRef:D,mainElementRef:s});const B=!!o.current.getRootDimensions();return T.jsxs(gae,{ref:s,children:[T.jsx(i.slots.columnHeaders,E({ref:L,innerRef:F,visibleColumns:a,filterColumnLookup:c,sortColumnLookup:d,columnPositions:p,columnHeaderTabIndexState:h,columnGroupHeaderTabIndexState:g,columnHeaderFocus:y,columnGroupHeaderFocus:v,densityFactor:S,headerGroupingMaxDepth:w,columnMenuState:C,columnVisibility:x,columnGroupsHeaderStructure:P,hasOtherElementInTabSequence:_},n)),B&&T.jsx(t,{ref:D,disableVirtualization:I}),r]})}function Vae(){var e;const t=tt();return t.hideFooter?null:T.jsx(t.slots.footer,E({},(e=t.slotProps)==null?void 0:e.footer))}const Vr="auto-generated-group-node-root",Mm=Symbol("mui.id_autogenerated"),Uae=()=>({type:"group",id:Vr,depth:-1,groupingField:null,groupingKey:null,isAutoGenerated:!0,children:[],childrenFromPath:{},childrenExpanded:!0,parent:null});function Wae(e,t,n="A row was provided without id in the rows prop:"){if(e==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(t)].join(`
|
|
331
|
+
`))}const Mg=(e,t,n)=>{const r=t?t(e):e.id;return Wae(r,e,n),r},Tm=({rows:e,getRowId:t,loading:n,rowCount:r})=>{const o={type:"full",rows:[]},i={},s={};for(let a=0;a<e.length;a+=1){const c=e[a],d=Mg(c,t);i[d]=c,s[d]=d,o.rows.push(d)}return{rowsBeforePartialUpdates:e,loadingPropBeforePartialUpdates:n,rowCountPropBeforePartialUpdates:r,updates:o,dataRowIdToIdLookup:s,dataRowIdToModelLookup:i}},MA=({tree:e,rowCountProp:t=0})=>{const n=e[Vr];return Math.max(t,n.children.length+(n.footerId==null?0:1))},TA=({apiRef:e,rowCountProp:t=0,loadingProp:n,previousTree:r,previousTreeDepths:o})=>{const i=e.current.caches.rows,{tree:s,treeDepths:a,dataRowIds:c,groupingName:d}=e.current.applyStrategyProcessor("rowTreeCreation",{previousTree:r,previousTreeDepths:o,updates:i.updates,dataRowIdToIdLookup:i.dataRowIdToIdLookup,dataRowIdToModelLookup:i.dataRowIdToModelLookup}),p=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:s,treeDepths:a,dataRowIdToIdLookup:i.dataRowIdToIdLookup,dataRowIds:c,dataRowIdToModelLookup:i.dataRowIdToModelLookup});return e.current.caches.rows.updates={type:"partial",actions:{insert:[],modify:[],remove:[]},idToActionLookup:{}},E({},p,{totalRowCount:Math.max(t,p.dataRowIds.length),totalTopLevelRowCount:MA({tree:p.tree,rowCountProp:t}),groupingName:d,loading:n})},sp=e=>e.type==="skeletonRow"||e.type==="footer"||e.type==="group"&&e.isAutoGenerated||e.type==="pinnedRow"&&e.isAutoGenerated,eE=(e,t,n)=>{const r=e[t];if(r.type!=="group")return[];const o=[];for(let i=0;i<r.children.length;i+=1){const s=r.children[i];(!n||!sp(e[s]))&&o.push(s),o.push(...eE(e,s,n))}return!n&&r.footerId!=null&&o.push(r.footerId),o},Gae=({previousCache:e,getRowId:t,updates:n})=>{var r,o,i;if(e.updates.type==="full")throw new Error("MUI: Unable to prepare a partial update if a full update is not applied yet");const s=new Map;n.forEach(m=>{const g=Mg(m,t,"A row was provided without id when calling updateRows():");s.has(g)?s.set(g,E({},s.get(g),m)):s.set(g,m)});const a={type:"partial",actions:{insert:[...(r=e.updates.actions.insert)!=null?r:[]],modify:[...(o=e.updates.actions.modify)!=null?o:[]],remove:[...(i=e.updates.actions.remove)!=null?i:[]]},idToActionLookup:E({},e.updates.idToActionLookup)},c=E({},e.dataRowIdToModelLookup),d=E({},e.dataRowIdToIdLookup),p={insert:{},modify:{},remove:{}};s.forEach((m,g)=>{const y=a.idToActionLookup[g];if(m._action==="delete"){if(y==="remove"||!c[g])return;y!=null&&(p[y][g]=!0),a.actions.remove.push(g),delete c[g],delete d[g];return}const v=c[g];if(v){y==="remove"?(p.remove[g]=!0,a.actions.modify.push(g)):y==null&&a.actions.modify.push(g),c[g]=E({},v,m);return}y==="remove"?(p.remove[g]=!0,a.actions.insert.push(g)):y==null&&a.actions.insert.push(g),c[g]=m,d[g]=g});const h=Object.keys(p);for(let m=0;m<h.length;m+=1){const g=h[m],y=p[g];Object.keys(y).length>0&&(a.actions[g]=a.actions[g].filter(v=>!y[v]))}return{dataRowIdToModelLookup:c,dataRowIdToIdLookup:d,updates:a,rowsBeforePartialUpdates:e.rowsBeforePartialUpdates,loadingPropBeforePartialUpdates:e.loadingPropBeforePartialUpdates,rowCountPropBeforePartialUpdates:e.rowCountPropBeforePartialUpdates}};function OA(e){var t,n;const r=sd(e),o=(r==null||(t=r.top)==null?void 0:t.reduce((s,a)=>(s+=e.current.unstable_getRowHeight(a.id),s),0))||0,i=(r==null||(n=r.bottom)==null?void 0:n.reduce((s,a)=>(s+=e.current.unstable_getRowHeight(a.id),s),0))||0;return{top:o,bottom:i}}function LA(e,t){const n=ld(e);return 2*Math.floor(t*n)}const Kae=vr("div",{name:"MuiDataGrid",slot:"OverlayWrapper",overridesResolver:(e,t)=>t.overlayWrapper})({position:"sticky",top:0,left:0,width:0,height:0,zIndex:4}),qae=vr("div",{name:"MuiDataGrid",slot:"OverlayWrapperInner",overridesResolver:(e,t)=>t.overlayWrapperInner})({}),Yae=e=>{const{classes:t}=e;return Me({root:["overlayWrapper"],inner:["overlayWrapperInner"]},Bt,t)};function Qae(e){var t,n;const r=Dt(),o=tt(),[i,s]=u.useState(()=>{var p,h;return(p=(h=r.current.getRootDimensions())==null?void 0:h.viewportInnerSize)!=null?p:null}),a=u.useCallback(()=>{var p,h;s((p=(h=r.current.getRootDimensions())==null?void 0:h.viewportInnerSize)!=null?p:null)},[r]);ln(()=>r.current.subscribeEvent("viewportInnerSizeChange",a),[r,a]);let c=(t=i==null?void 0:i.height)!=null?t:0;o.autoHeight&&c===0&&(c=LA(r,o.rowHeight));const d=Yae(E({},e,{classes:o.classes}));return i?T.jsx(Kae,{className:he(d.root),children:T.jsx(qae,E({className:he(d.inner),style:{height:c,width:(n=i==null?void 0:i.width)!=null?n:0}},e))}):null}function Xae(){const e=Dt(),t=tt(),n=Ge(e,gy),r=Ge(e,_A),o=Ge(e,Iae),i=!o&&n===0,s=!o&&n>0&&r===0;let a=null;if(i){var c;a=T.jsx(t.slots.noRowsOverlay,E({},(c=t.slotProps)==null?void 0:c.noRowsOverlay))}if(s){var d;a=T.jsx(t.slots.noResultsOverlay,E({},(d=t.slotProps)==null?void 0:d.noResultsOverlay))}if(o){var p;a=T.jsx(t.slots.loadingOverlay,E({},(p=t.slotProps)==null?void 0:p.loadingOverlay))}return a===null?null:T.jsx(Qae,{children:a})}function xy(e){return u.memo(e,SA)}let K1;function Jae(){return K1===void 0&&document.createElement("div").focus({get preventScroll(){return K1=!0,!1}}),K1}var vs=function(e){return e.Cell="cell",e.Row="row",e}(vs||{}),rn=function(e){return e.Edit="edit",e.View="view",e}(rn||{}),mn=function(e){return e.Edit="edit",e.View="view",e}(mn||{}),no=function(e){return e.And="and",e.Or="or",e}(no||{}),pl=function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e}(pl||{}),$i=function(e){return e.cellFocusOut="cellFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e}($i||{}),hl=function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e}(hl||{}),Os=function(e){return e.rowFocusOut="rowFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e}(Os||{});function FA(e){return e.field!==void 0}function Zae(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function ece(e,t){return e.closest(`.${t}`)}function tE(e){return e.replace(/["\\]/g,"\\$&")}function tce(e,t){return e.querySelector(`[role="columnheader"][data-field="${tE(t)}"]`)}function AA(e){return`.${X.row}[data-id="${tE(String(e))}"]`}function nce(e,t){return e.querySelector(AA(t))}function rce(e,{id:t,field:n}){const r=AA(t),o=`.${X.cell}[data-field="${tE(n)}"]`,i=`${r} ${o}`;return e.querySelector(i)}function Ft(e,t,n){const r=u.useRef(!0);u.useEffect(()=>{r.current=!1,e.current.register(n,t)},[e,n,t]),r.current&&e.current.register(n,t)}class ru extends Error{}function oce(e,t){const{getRowId:n}=t,r=u.useCallback(y=>({field:y,colDef:e.current.getColumn(y)}),[e]),o=u.useCallback(y=>{const v=e.current.getRow(y);if(!v)throw new ru(`No row with id #${y} found`);return{id:y,columns:e.current.getAllColumns(),row:v}},[e]),i=u.useCallback((y,v)=>{const S=e.current.getRow(y),w=e.current.getRowNode(y);if(!S||!w)throw new ru(`No row with id #${y} found`);const C=ii(e),x=Rg(e);return{id:y,field:v,row:S,rowNode:w,value:S[v],colDef:e.current.getColumn(v),cellMode:e.current.getCellMode(y,v),api:e.current,hasFocus:C!==null&&C.field===v&&C.id===y,tabIndex:x&&x.field===v&&x.id===y?0:-1}},[e]),s=u.useCallback((y,v)=>{const S=e.current.getColumn(v),w=e.current.getCellValue(y,v),C=e.current.getRow(y),x=e.current.getRowNode(y);if(!C||!x)throw new ru(`No row with id #${y} found`);const P=ii(e),_=Rg(e),I={id:y,field:v,row:C,rowNode:x,colDef:S,cellMode:e.current.getCellMode(y,v),hasFocus:P!==null&&P.field===v&&P.id===y,tabIndex:_&&_.field===v&&_.id===y?0:-1,value:w,formattedValue:w,isEditable:!1};return S&&S.valueFormatter&&(I.formattedValue=S.valueFormatter({id:y,field:I.field,value:I.value,api:e.current})),I.isEditable=S&&e.current.isCellEditable(I),I},[e]),a=u.useCallback((y,v)=>{const S=e.current.getColumn(v);if(!S||!S.valueGetter){const w=e.current.getRow(y);if(!w)throw new ru(`No row with id #${y} found`);return w[v]}return S.valueGetter(i(y,v))},[e,i]),c=u.useCallback((y,v)=>{var S;const w=Mm in y?y[Mm]:(S=n==null?void 0:n(y))!=null?S:y.id,C=v.field;return!v||!v.valueGetter?y[C]:v.valueGetter(i(w,C))},[i,n]),d=u.useCallback((y,v)=>{var S;const w=c(y,v);if(!v||!v.valueFormatter)return w;const C=(S=n?n(y):y.id)!=null?S:y[Mm],x=v.field;return v.valueFormatter({id:C,field:x,value:w,api:e.current})},[e,n,c]),p=u.useCallback(y=>e.current.rootElementRef.current?tce(e.current.rootElementRef.current,y):null,[e]),h=u.useCallback(y=>e.current.rootElementRef.current?nce(e.current.rootElementRef.current,y):null,[e]),m=u.useCallback((y,v)=>e.current.rootElementRef.current?rce(e.current.rootElementRef.current,{id:y,field:v}):null,[e]);Ft(e,{getCellValue:a,getCellParams:s,getCellElement:m,getRowValue:c,getRowFormattedValue:d,getRowParams:o,getRowElement:h,getColumnHeaderParams:r,getColumnHeaderElement:p},"public")}const ice=["changeReason","unstable_updateValueOnRender"],sce=["column","rowId","editCellState","align","children","colIndex","height","width","className","showRightBorder","extendRowFullWidth","row","colSpan","disableDragEvents","onClick","onDoubleClick","onMouseDown","onMouseUp","onMouseOver","onKeyDown","onKeyUp","onDragEnter","onDragOver"],lce=["changeReason","unstable_updateValueOnRender"],Tg={id:-1,field:"__unset__",row:{},rowNode:{id:-1,depth:0,type:"leaf",parent:-1,groupingKey:null},colDef:{type:"string",field:"__unset__",computedWidth:0},cellMode:rn.View,hasFocus:!1,tabIndex:-1,value:null,formattedValue:"__unset__",isEditable:!1,api:{}},ace=e=>{const{align:t,showRightBorder:n,isEditable:r,isSelected:o,classes:i}=e,s={root:["cell",`cell--text${ue(t)}`,r&&"cell--editable",o&&"selected",n&&"cell--withRightBorder","withBorderColor"],content:["cellContent"]};return Me(s,Bt,i)},cce=u.forwardRef((e,t)=>{const{column:n,rowId:r,editCellState:o}=e,i=Dt(),s=tt(),a=n.field,c=Ge(i,()=>{try{const O=i.current.getCellParams(r,a);return O.api=i.current,O}catch(M){if(M instanceof ru)return Tg;throw M}},KS),d=Ge(i,()=>i.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:r,field:a}));if(c===Tg)return null;const{cellMode:p,hasFocus:h,isEditable:m,value:g,formattedValue:y}=c,v=n.type==="actions",S=(p==="view"||!m)&&!v?c.tabIndex:-1,{classes:w,getCellClassName:C}=s,x=i.current.unstable_applyPipeProcessors("cellClassName",[],{id:r,field:a});n.cellClassName&&x.push(typeof n.cellClassName=="function"?n.cellClassName(c):n.cellClassName),C&&x.push(C(c));let P;if(o==null&&n.renderCell&&(P=n.renderCell(c),x.push(X["cell--withRenderer"]),x.push(w==null?void 0:w["cell--withRenderer"])),o!=null&&n.renderEditCell){const M=i.current.getRowWithUpdatedValues(r,n.field),O=ne(o,ice),F=E({},c,{row:M},O);P=n.renderEditCell(F),x.push(X["cell--editing"]),x.push(w==null?void 0:w["cell--editing"])}const{slots:_}=s,I=_.cell,k=E({},e,{ref:t,field:a,formattedValue:y,hasFocus:h,isEditable:m,isSelected:d,value:g,cellMode:p,children:P,tabIndex:S,className:he(x)});return u.createElement(I,k)}),uce=xy(cce),dce=u.forwardRef((e,t)=>{const{column:n,rowId:r,editCellState:o,align:i,colIndex:s,height:a,width:c,className:d,showRightBorder:p,colSpan:h,disableDragEvents:m,onClick:g,onDoubleClick:y,onMouseDown:v,onMouseUp:S,onMouseOver:w,onKeyDown:C,onKeyUp:x,onDragEnter:P,onDragOver:_}=e,I=ne(e,sce),k=Dt(),M=tt(),O=n.field,F=Ge(k,()=>{try{const be=k.current.getCellParams(r,O);return be.api=k.current,be}catch(pe){if(pe instanceof ru)return Tg;throw pe}},KS),L=Ge(k,()=>k.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:r,field:O})),{cellMode:D,hasFocus:B,isEditable:R,value:A,formattedValue:z}=F,V=n.type==="actions",N=(D==="view"||!R)&&!V?F.tabIndex:-1,{classes:H,getCellClassName:W}=M,K=k.current.unstable_applyPipeProcessors("cellClassName",[],{id:r,field:O});n.cellClassName&&K.push(typeof n.cellClassName=="function"?n.cellClassName(F):n.cellClassName),W&&K.push(W(F));const Y=z==null?A:z,ie=u.useRef(null),re=Vt(t,ie),de=u.useRef(null),se={align:i,showRightBorder:p,isEditable:R,classes:M.classes,isSelected:L},le=ace(se),Ee=u.useCallback(pe=>be=>{const te=k.current.getCellParams(r,O||"");k.current.publishEvent(pe,te,be),S&&S(be)},[k,O,S,r]),ye=u.useCallback(pe=>be=>{const te=k.current.getCellParams(r,O||"");k.current.publishEvent(pe,te,be),v&&v(be)},[k,O,v,r]),_e=u.useCallback((pe,be)=>te=>{if(!k.current.getRow(r))return;const Oe=k.current.getCellParams(r,O||"");k.current.publishEvent(pe,Oe,te),be&&be(te)},[k,O,r]),ee={minWidth:c,maxWidth:c,minHeight:a,maxHeight:a==="auto"?"none":a};if(u.useEffect(()=>{if(!B||D===rn.Edit)return;const pe=vn(k.current.rootElementRef.current);if(ie.current&&!ie.current.contains(pe.activeElement)){const be=ie.current.querySelector('[tabindex="0"]'),te=de.current||be||ie.current;if(Jae())te.focus({preventScroll:!0});else{const Oe=k.current.getScrollPosition();te.focus(),k.current.scroll(Oe)}}},[B,D,k]),F===Tg)return null;let ke=I.onFocus,Re;if(o==null&&n.renderCell&&(Re=n.renderCell(F),K.push(X["cell--withRenderer"]),K.push(H==null?void 0:H["cell--withRenderer"])),o!=null&&n.renderEditCell){const pe=k.current.getRowWithUpdatedValues(r,n.field),be=ne(o,lce),te=E({},F,{row:pe},be);Re=n.renderEditCell(te),K.push(X["cell--editing"]),K.push(H==null?void 0:H["cell--editing"])}if(Re===void 0){const pe=Y==null?void 0:Y.toString();Re=T.jsx("div",{className:le.content,title:pe,children:pe})}u.isValidElement(Re)&&V&&(Re=u.cloneElement(Re,{focusElementRef:de}));const Pe=m?null:{onDragEnter:_e("cellDragEnter",P),onDragOver:_e("cellDragOver",_)};return T.jsx("div",E({ref:re,className:he(d,K,le.root),role:"cell","data-field":O,"data-colindex":s,"aria-colindex":s+1,"aria-colspan":h,style:ee,tabIndex:N,onClick:_e("cellClick",g),onDoubleClick:_e("cellDoubleClick",y),onMouseOver:_e("cellMouseOver",w),onMouseDown:ye("cellMouseDown"),onMouseUp:Ee("cellMouseUp"),onKeyDown:_e("cellKeyDown",C),onKeyUp:_e("cellKeyUp",x)},Pe,I,{onFocus:ke,children:Re}))}),zw=xy(dce),fce=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex"],pce=e=>{const{classes:t}=e;return Me({root:["booleanCell"]},Bt,t)};function hce(e){const{value:t}=e,n=ne(e,fce),r=Dt(),o=tt(),i={classes:o.classes},s=pce(i),a=u.useMemo(()=>t?o.slots.booleanCellTrueIcon:o.slots.booleanCellFalseIcon,[o.slots.booleanCellFalseIcon,o.slots.booleanCellTrueIcon,t]);return T.jsx(a,E({fontSize:"small",className:s.root,titleAccess:r.current.getLocaleText(t?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":!!t},n))}const mce=u.memo(hce),gce=e=>sp(e.rowNode)?"":T.jsx(mce,E({},e)),vce=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange"],yce=e=>{const{classes:t}=e;return Me({root:["editBooleanCell"]},Bt,t)};function bce(e){var t;const{id:n,value:r,field:o,className:i,hasFocus:s,onValueChange:a}=e,c=ne(e,vce),d=Dt(),p=u.useRef(null),h=on(),[m,g]=u.useState(r),y=tt(),v={classes:y.classes},S=yce(v),w=u.useCallback(C=>mt(this,null,function*(){const x=C.target.checked;a&&(yield a(C,x)),g(x),yield d.current.setEditCellValue({id:n,field:o,value:x},C)}),[d,o,n,a]);return u.useEffect(()=>{g(r)},[r]),ln(()=>{s&&p.current.focus()},[s]),T.jsx("label",E({htmlFor:h,className:he(S.root,i)},c,{children:T.jsx(y.slots.baseCheckbox,E({id:h,inputRef:p,checked:!!m,onChange:w,size:"small"},(t=y.slotProps)==null?void 0:t.baseCheckbox))}))}const wce=e=>T.jsx(bce,E({},e)),Cce=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","inputProps","isValidating","isProcessingProps","onValueChange"],xce=oe(ed)({fontSize:"inherit"}),Sce=e=>{const{classes:t}=e;return Me({root:["editInputCell"]},Bt,t)};function Ece(e){const{id:t,value:n,field:r,colDef:o,hasFocus:i,inputProps:s,onValueChange:a}=e,c=ne(e,Cce),d=o.type==="dateTime",p=Dt(),h=u.useRef(),m=u.useMemo(()=>{let k;n==null?k=null:n instanceof Date?k=n:k=new Date((n!=null?n:"").toString());let M;return k==null||Number.isNaN(k.getTime())?M="":M=new Date(k.getTime()-k.getTimezoneOffset()*60*1e3).toISOString().substr(0,d?16:10),{parsed:k,formatted:M}},[n,d]),[g,y]=u.useState(m),S={classes:tt().classes},w=Sce(S),C=u.useRef(!1),x=u.useCallback(k=>{if(k==="")return null;const[M,O]=k.split("T"),[F,L,D]=M.split("-"),B=new Date;if(B.setFullYear(Number(F),Number(L)-1,Number(D)),B.setHours(0,0,0,0),O){const[R,A]=O.split(":");B.setHours(Number(R),Number(A),0,0)}return B},[]),P=u.useCallback(k=>mt(this,null,function*(){const M=k.target.value,O=x(M);a&&(yield a(k,O)),y({parsed:O,formatted:M}),p.current.setEditCellValue({id:t,field:r,value:O},k)}),[p,r,t,a,x]);u.useEffect(()=>{y(k=>{var M,O;return m.parsed!==k.parsed&&((M=m.parsed)==null?void 0:M.getTime())!==((O=k.parsed)==null?void 0:O.getTime())?m:k})},[m]),ln(()=>{i&&h.current.focus()},[i]);const _=p.current.unstable_getEditCellMeta(t,r),I=k=>{if(h.current=k,_!=null&&_.unstable_updateValueOnRender&&!C.current){const M=h.current.value,O=x(M);y({parsed:O,formatted:M}),p.current.setEditCellValue({id:t,field:r,value:O}),C.current=!0}};return T.jsx(xce,E({inputRef:I,fullWidth:!0,className:w.root,type:d?"datetime-local":"date",inputProps:E({max:d?"9999-12-31T23:59":"9999-12-31"},s),value:g.formatted,onChange:P},c))}const NA=e=>T.jsx(Ece,E({},e)),Pce=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","isValidating","debounceMs","isProcessingProps","onValueChange"],Ice=e=>{const{classes:t}=e;return Me({root:["editInputCell"]},Bt,t)},kce=oe(ed,{name:"MuiDataGrid",slot:"EditInputCell",overridesResolver:(e,t)=>t.editInputCell})(({theme:e})=>E({},e.typography.body2,{padding:"1px 0","& input":{padding:"0 16px",height:"100%"}})),_ce=u.forwardRef((e,t)=>{const n=tt(),{id:r,value:o,field:i,colDef:s,hasFocus:a,debounceMs:c=200,isProcessingProps:d,onValueChange:p}=e,h=ne(e,Pce),m=Dt(),g=u.useRef(),[y,v]=u.useState(o),S=Ice(n),w=u.useCallback(x=>mt(void 0,null,function*(){const P=x.target.value;p&&(yield p(x,P));const _=m.current.getColumn(i);let I=P;_.valueParser&&(I=_.valueParser(P,m.current.getCellParams(r,i))),v(I),m.current.setEditCellValue({id:r,field:i,value:I,debounceMs:c,unstable_skipValueParser:!0},x)}),[m,c,i,r,p]),C=m.current.unstable_getEditCellMeta(r,i);return u.useEffect(()=>{(C==null?void 0:C.changeReason)!=="debouncedSetEditCellValue"&&v(o)},[C,o]),ln(()=>{a&&g.current.focus()},[a]),T.jsx(kce,E({ref:t,inputRef:g,className:S.root,ownerState:n,fullWidth:!0,type:s.type==="number"?s.type:"text",value:y!=null?y:"",onChange:w,endAdornment:d?T.jsx(n.slots.loadIcon,{fontSize:"small",color:"action"}):void 0},h))}),$ce=e=>T.jsx(_ce,E({},e)),Og=e=>e==="Escape",Rce=e=>e==="Enter",DA=e=>e==="Tab",BA=e=>e===" ",Mce=e=>e.indexOf("Arrow")===0,Tce=e=>e==="Home"||e==="End",Oce=e=>e.indexOf("Page")===0;function zA(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}const Lg=e=>Tce(e)||Mce(e)||Oce(e)||BA(e),Lce=e=>!!e.key,Fce=e=>DA(e)||Og(e);function Oa(e){return(e==null?void 0:e.type)==="singleSelect"}function jw(e,t,n){if(t===void 0)return;const r=t.find(o=>{const i=n(o);return String(i)===String(e)});return n(r)}const Ace=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen","getOptionLabel","getOptionValue"],Nce=["MenuProps"];function Dce(e){return!!e.key}function Bce(e){var t,n,r;const o=tt(),{id:i,value:s,field:a,row:c,colDef:d,hasFocus:p,error:h,onValueChange:m,initialOpen:g=o.editMode===vs.Cell,getOptionLabel:y,getOptionValue:v}=e,S=ne(e,Ace),w=Dt(),C=u.useRef(),x=u.useRef(),[P,_]=u.useState(g),k=(n=(((t=o.slotProps)==null?void 0:t.baseSelect)||{}).native)!=null?n:!1,M=((r=o.slotProps)==null?void 0:r.baseSelect)||{},{MenuProps:O}=M,F=ne(M,Nce);if(ln(()=>{if(p){var V;(V=x.current)==null||V.focus()}},[p]),!Oa(d))return null;let L;if(typeof(d==null?void 0:d.valueOptions)=="function"?L=d==null?void 0:d.valueOptions({id:i,row:c,field:a}):L=d==null?void 0:d.valueOptions,!L)return null;const D=v||d.getOptionValue,B=y||d.getOptionLabel,R=V=>mt(this,null,function*(){if(!Oa(d)||!L)return;_(!1);const N=V.target,H=jw(N.value,L,D);m&&(yield m(V,H)),yield w.current.setEditCellValue({id:i,field:a,value:H},V)}),A=(V,N)=>{if(o.editMode===vs.Row){_(!1);return}if(N==="backdropClick"||Og(V.key)){const H=w.current.getCellParams(i,a);w.current.publishEvent("cellEditStop",E({},H,{reason:Og(V.key)?$i.escapeKeyDown:$i.cellFocusOut}))}},z=V=>{Dce(V)&&V.key==="Enter"||_(!0)};return!L||!d?null:T.jsx(o.slots.baseSelect,E({ref:C,inputRef:x,value:s,onChange:R,open:P,onOpen:z,MenuProps:E({onClose:A},O),error:h,native:k,fullWidth:!0},S,F,{children:L.map(V=>{var N;const H=D(V);return u.createElement(o.slots.baseSelectOption,E({},((N=o.slotProps)==null?void 0:N.baseSelectOption)||{},{native:k,key:H,value:H}),B(V))})}))}const zce=e=>T.jsx(Bce,E({},e)),jce=["open","target","onClickAway","children","position","className","onExited"],Hce=e=>{const{classes:t}=e;return Me({root:["menu"]},Bt,t)},Vce=oe(oc,{name:"MuiDataGrid",slot:"Menu",overridesResolver:(e,t)=>t.menu})(({theme:e})=>({zIndex:e.zIndex.modal,[`& .${X.menuList}`]:{outline:0}})),Uce={"bottom-start":"top left","bottom-end":"top right"};function jA(e){var t;const{open:n,target:r,onClickAway:o,children:i,position:s,className:a,onExited:c}=e,d=ne(e,jce),p=Dt(),h=tt(),m=Hce(h);u.useEffect(()=>{const y=n?"menuOpen":"menuClose";p.current.publishEvent(y,{target:r})},[p,n,r]);const g=y=>v=>{y&&y(),c&&c(v)};return T.jsx(Vce,E({as:h.slots.basePopper,className:he(a,m.root),ownerState:h,open:n,anchorEl:r,transition:!0,placement:s},d,(t=h.slotProps)==null?void 0:t.basePopper,{children:({TransitionProps:y,placement:v})=>T.jsx(kL,{onClickAway:o,mouseEvent:"onMouseDown",children:T.jsx(bg,E({},y,{style:{transformOrigin:Uce[v]},onExited:g(y==null?void 0:y.onExited),children:T.jsx(Ci,{children:i})}))})}))}const Wce=["api","colDef","id","hasFocus","isEditable","field","value","formattedValue","row","rowNode","cellMode","tabIndex","position","focusElementRef"],Gce=e=>typeof e.getActions=="function";function Kce(e){var t;const{colDef:n,id:r,hasFocus:o,tabIndex:i,position:s="bottom-end",focusElementRef:a}=e,c=ne(e,Wce),[d,p]=u.useState(-1),[h,m]=u.useState(!1),g=Dt(),y=u.useRef(null),v=u.useRef(null),S=u.useRef(!1),w=u.useRef({}),C=lr(),x=on(),P=on(),_=tt();if(!Gce(n))throw new Error("MUI: Missing the `getActions` property in the `GridColDef`.");const I=n.getActions(g.current.getRowParams(r)),k=I.filter(z=>!z.props.showInMenu),M=I.filter(z=>z.props.showInMenu),O=k.length+(M.length?1:0);u.useLayoutEffect(()=>{o||Object.entries(w.current).forEach(([z,V])=>{V==null||V.stop({},()=>{delete w.current[z]})})},[o]),u.useEffect(()=>{if(d<0||!y.current||d>=y.current.children.length)return;y.current.children[d].focus({preventScroll:!0})},[d]),u.useEffect(()=>{o||(p(-1),S.current=!1)},[o]),u.useImperativeHandle(a,()=>({focus(){S.current||p(0)}}),[]),u.useEffect(()=>{d>=O&&p(O-1)},[d,O]);const F=()=>{m(!0),p(O-1),S.current=!0},L=()=>{m(!1)},D=z=>V=>{w.current[z]=V},B=(z,V)=>N=>{p(z),S.current=!0,V&&V(N)},R=z=>{if(O<=1)return;let V=d;z.key==="ArrowRight"?C.direction==="rtl"?V-=1:V+=1:z.key==="ArrowLeft"&&(C.direction==="rtl"?V+=1:V-=1),!(V<0||V>=O)&&V!==d&&(z.preventDefault(),z.stopPropagation(),p(V))},A=z=>{z.key==="Tab"&&z.preventDefault(),["Tab","Enter","Escape"].includes(z.key)&&L()};return T.jsxs("div",E({role:"menu",ref:y,tabIndex:-1,className:X.actionsCell,onKeyDown:R},c,{children:[k.map((z,V)=>u.cloneElement(z,{key:V,touchRippleRef:D(V),onClick:B(V,z.props.onClick),tabIndex:d===V?i:-1})),M.length>0&&P&&T.jsx(_.slots.baseIconButton,E({ref:v,id:P,"aria-label":g.current.getLocaleText("actionsCellMore"),"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?x:void 0,role:"menuitem",size:"small",onClick:F,touchRippleRef:D(P),tabIndex:d===k.length?i:-1},(t=_.slotProps)==null?void 0:t.baseIconButton,{children:T.jsx(_.slots.moreActionsIcon,{fontSize:"small"})})),M.length>0&&T.jsx(jA,{onClickAway:L,onClick:L,open:h,target:v.current,position:s,children:T.jsx(Zv,{id:x,className:X.menuList,onKeyDown:A,"aria-labelledby":P,variant:"menu",autoFocusItem:!0,children:M.map((z,V)=>u.cloneElement(z,{key:V}))})})]}))}const qce=e=>T.jsx(Kce,E({},e)),Yce=["field","align","width","contentWidth"],Qce=e=>{const{align:t,classes:n}=e,r={root:["cell","cellSkeleton",`cell--text${ue(t)}`,"withBorderColor"]};return Me(r,Bt,n)};function Xce(e){const{align:t,width:n,contentWidth:r}=e,o=ne(e,Yce),s={classes:tt().classes,align:t},a=Qce(s);return T.jsx("div",E({className:a.root,style:{width:n}},o,{children:T.jsx(wne,{width:`${r}%`})}))}function Jce(e){return e.vars?e.vars.palette.TableCell.border:e.palette.mode==="light"?Ua(lt(e.palette.divider,1),.88):Va(lt(e.palette.divider,1),.68)}const pR={[`.${X.columnSeparator}, .${X["columnSeparator--resizing"]}`]:{visibility:"visible",width:"auto"}},hR={[`& .${X.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${X.menuIcon}`]:{width:"auto",visibility:"visible"}},Zce=oe("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(e,t)=>[{[`&.${X.autoHeight}`]:t.autoHeight},{[`&.${X.aggregationColumnHeader}`]:t.aggregationColumnHeader},{[`&.${X["aggregationColumnHeader--alignLeft"]}`]:t["aggregationColumnHeader--alignLeft"]},{[`&.${X["aggregationColumnHeader--alignCenter"]}`]:t["aggregationColumnHeader--alignCenter"]},{[`&.${X["aggregationColumnHeader--alignRight"]}`]:t["aggregationColumnHeader--alignRight"]},{[`&.${X.aggregationColumnHeaderLabel}`]:t.aggregationColumnHeaderLabel},{[`&.${X["root--disableUserSelection"]} .${X.cell}`]:t["root--disableUserSelection"]},{[`& .${X.editBooleanCell}`]:t.editBooleanCell},{[`& .${X["cell--editing"]}`]:t["cell--editing"]},{[`& .${X["cell--textCenter"]}`]:t["cell--textCenter"]},{[`& .${X["cell--textLeft"]}`]:t["cell--textLeft"]},{[`& .${X["cell--textRight"]}`]:t["cell--textRight"]},{[`& .${X["cell--withRenderer"]}`]:t["cell--withRenderer"]},{[`& .${X.cell}`]:t.cell},{[`& .${X["cell--rangeTop"]}`]:t["cell--rangeTop"]},{[`& .${X["cell--rangeBottom"]}`]:t["cell--rangeBottom"]},{[`& .${X["cell--rangeLeft"]}`]:t["cell--rangeLeft"]},{[`& .${X["cell--rangeRight"]}`]:t["cell--rangeRight"]},{[`& .${X["cell--withRightBorder"]}`]:t["cell--withRightBorder"]},{[`& .${X.cellContent}`]:t.cellContent},{[`& .${X.cellCheckbox}`]:t.cellCheckbox},{[`& .${X.cellSkeleton}`]:t.cellSkeleton},{[`& .${X.checkboxInput}`]:t.checkboxInput},{[`& .${X["columnHeader--alignCenter"]}`]:t["columnHeader--alignCenter"]},{[`& .${X["columnHeader--alignLeft"]}`]:t["columnHeader--alignLeft"]},{[`& .${X["columnHeader--alignRight"]}`]:t["columnHeader--alignRight"]},{[`& .${X["columnHeader--dragging"]}`]:t["columnHeader--dragging"]},{[`& .${X["columnHeader--moving"]}`]:t["columnHeader--moving"]},{[`& .${X["columnHeader--numeric"]}`]:t["columnHeader--numeric"]},{[`& .${X["columnHeader--sortable"]}`]:t["columnHeader--sortable"]},{[`& .${X["columnHeader--sorted"]}`]:t["columnHeader--sorted"]},{[`& .${X["columnHeader--withRightBorder"]}`]:t["columnHeader--withRightBorder"]},{[`& .${X.columnHeader}`]:t.columnHeader},{[`& .${X.headerFilterRow}`]:t.headerFilterRow},{[`& .${X.columnHeaderCheckbox}`]:t.columnHeaderCheckbox},{[`& .${X.columnHeaderDraggableContainer}`]:t.columnHeaderDraggableContainer},{[`& .${X.columnHeaderTitleContainer}`]:t.columnHeaderTitleContainer},{[`& .${X["columnSeparator--resizable"]}`]:t["columnSeparator--resizable"]},{[`& .${X["columnSeparator--resizing"]}`]:t["columnSeparator--resizing"]},{[`& .${X.columnSeparator}`]:t.columnSeparator},{[`& .${X.filterIcon}`]:t.filterIcon},{[`& .${X.iconSeparator}`]:t.iconSeparator},{[`& .${X.menuIcon}`]:t.menuIcon},{[`& .${X.menuIconButton}`]:t.menuIconButton},{[`& .${X.menuOpen}`]:t.menuOpen},{[`& .${X.menuList}`]:t.menuList},{[`& .${X["row--editable"]}`]:t["row--editable"]},{[`& .${X["row--editing"]}`]:t["row--editing"]},{[`& .${X["row--dragging"]}`]:t["row--dragging"]},{[`& .${X.row}`]:t.row},{[`& .${X.rowReorderCellPlaceholder}`]:t.rowReorderCellPlaceholder},{[`& .${X.rowReorderCell}`]:t.rowReorderCell},{[`& .${X["rowReorderCell--draggable"]}`]:t["rowReorderCell--draggable"]},{[`& .${X.sortIcon}`]:t.sortIcon},{[`& .${X.withBorderColor}`]:t.withBorderColor},{[`& .${X.treeDataGroupingCell}`]:t.treeDataGroupingCell},{[`& .${X.treeDataGroupingCellToggle}`]:t.treeDataGroupingCellToggle},{[`& .${X.detailPanelToggleCell}`]:t.detailPanelToggleCell},{[`& .${X["detailPanelToggleCell--expanded"]}`]:t["detailPanelToggleCell--expanded"]},t.root]})(({theme:e})=>{const t=Jce(e),n=e.shape.borderRadius;return E({"--unstable_DataGrid-radius":typeof n=="number"?`${n}px`:n,"--unstable_DataGrid-headWeight":e.typography.fontWeightMedium,"--unstable_DataGrid-overlayBackground":e.vars?`rgba(${e.vars.palette.background.defaultChannel} / ${e.vars.palette.action.disabledOpacity})`:lt(e.palette.background.default,e.palette.action.disabledOpacity),flex:1,boxSizing:"border-box",position:"relative",borderWidth:"1px",borderStyle:"solid",borderColor:t,borderRadius:"var(--unstable_DataGrid-radius)",color:(e.vars||e).palette.text.primary},e.typography.body2,{outline:"none",height:"100%",display:"flex",minWidth:0,minHeight:0,flexDirection:"column",overflowAnchor:"none",[`&.${X.autoHeight}`]:{height:"auto",[`& .${X["row--lastVisible"]} .${X.cell}`]:{borderBottomColor:"transparent"}},[`& .${X["virtualScrollerContent--overflowed"]} .${X["row--lastVisible"]} .${X.cell}`]:{borderBottomColor:"transparent"},[`& .${X.columnHeader}, & .${X.cell}`]:{WebkitTapHighlightColor:"transparent",lineHeight:null,padding:"0 10px",boxSizing:"border-box"},[`& .${X.columnHeader}:focus-within, & .${X.cell}:focus-within`]:{outline:`solid ${e.vars?`rgba(${e.vars.palette.primary.mainChannel} / 0.5)`:lt(e.palette.primary.main,.5)} 1px`,outlineWidth:1,outlineOffset:-1},[`& .${X.columnHeader}:focus, & .${X.cell}:focus`]:{outline:`solid ${e.palette.primary.main} 1px`},[`& .${X.columnHeaderCheckbox}, & .${X.cellCheckbox}`]:{padding:0,justifyContent:"center",alignItems:"center"},[`& .${X.columnHeader}`]:{position:"relative",display:"flex",alignItems:"center"},[`& .${X["columnHeader--sorted"]} .${X.iconButtonContainer}, & .${X["columnHeader--filtered"]} .${X.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${X.columnHeader}:not(.${X["columnHeader--sorted"]}) .${X.sortIcon}`]:{opacity:0,transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.shorter})},[`& .${X.columnHeaderTitleContainer}`]:{display:"flex",alignItems:"center",minWidth:0,flex:1,whiteSpace:"nowrap",overflow:"hidden",position:"relative"},[`& .${X.columnHeaderTitleContainerContent}`]:{overflow:"hidden",display:"flex",alignItems:"center"},[`& .${X["columnHeader--filledGroup"]} .${X.columnHeaderTitleContainer}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${X["columnHeader--filledGroup"]}.${X["columnHeader--showColumnBorder"]} .${X.columnHeaderTitleContainer}`]:{borderBottom:"none"},[`& .${X["columnHeader--filledGroup"]}.${X["columnHeader--showColumnBorder"]}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${X.headerFilterRow}`]:{borderTop:`1px solid ${t}`},[`& .${X.sortIcon}, & .${X.filterIcon}`]:{fontSize:"inherit"},[`& .${X["columnHeader--sortable"]}`]:{cursor:"pointer"},[`& .${X["columnHeader--alignCenter"]} .${X.columnHeaderTitleContainer}`]:{justifyContent:"center"},[`& .${X["columnHeader--alignRight"]} .${X.columnHeaderDraggableContainer}, & .${X["columnHeader--alignRight"]} .${X.columnHeaderTitleContainer}`]:{flexDirection:"row-reverse"},[`& .${X["columnHeader--alignCenter"]} .${X.menuIcon}, & .${X["columnHeader--alignRight"]} .${X.menuIcon}`]:{marginRight:"auto",marginLeft:-6},[`& .${X["columnHeader--alignRight"]} .${X.menuIcon}, & .${X["columnHeader--alignRight"]} .${X.menuIcon}`]:{marginRight:"auto",marginLeft:-10},[`& .${X["columnHeader--moving"]}`]:{backgroundColor:(e.vars||e).palette.action.hover},[`& .${X.columnSeparator}`]:{visibility:"hidden",position:"absolute",zIndex:100,display:"flex",flexDirection:"column",justifyContent:"center",color:t},"@media (hover: hover)":{[`& .${X.columnHeaders}:hover`]:pR,[`& .${X.columnHeader}:hover`]:hR,[`& .${X.columnHeader}:not(.${X["columnHeader--sorted"]}):hover .${X.sortIcon}`]:{opacity:.5}},"@media (hover: none)":{[`& .${X.columnHeaders}`]:pR,[`& .${X.columnHeader}`]:hR},[`& .${X["columnSeparator--sideLeft"]}`]:{left:-12},[`& .${X["columnSeparator--sideRight"]}`]:{right:-12},[`& .${X["columnSeparator--resizable"]}`]:{cursor:"col-resize",touchAction:"none","&:hover":{color:(e.vars||e).palette.text.primary,"@media (hover: none)":{color:t}},[`&.${X["columnSeparator--resizing"]}`]:{color:(e.vars||e).palette.text.primary},"& svg":{pointerEvents:"none"}},[`& .${X.iconSeparator}`]:{color:"inherit"},[`& .${X.menuIcon}`]:{width:0,visibility:"hidden",fontSize:20,marginRight:-10,display:"flex",alignItems:"center"},[`.${X.menuOpen}`]:{visibility:"visible",width:"auto"},[`& .${X.row}`]:{display:"flex",width:"fit-content",breakInside:"avoid","&:hover, &.Mui-hovered":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},"&.Mui-selected":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:lt(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover, &.Mui-hovered":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity+e.palette.action.hoverOpacity})`:lt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:lt(e.palette.primary.main,e.palette.action.selectedOpacity)}}}},[`& .${X.cell}`]:{display:"flex",alignItems:"center",borderBottom:"1px solid","&.Mui-selected":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:lt(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover, &.Mui-hovered":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity+e.palette.action.hoverOpacity})`:lt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:lt(e.palette.primary.main,e.palette.action.selectedOpacity)}}}},[`&.${X["root--disableUserSelection"]} .${X.cell}`]:{userSelect:"none"},[`& .${X.row}:not(.${X["row--dynamicHeight"]}) > .${X.cell}`]:{overflow:"hidden",whiteSpace:"nowrap"},[`& .${X.cellContent}`]:{overflow:"hidden",textOverflow:"ellipsis"},[`& .${X.cell}.${X["cell--editing"]}`]:{padding:1,display:"flex",boxShadow:e.shadows[2],backgroundColor:(e.vars||e).palette.background.paper,"&:focus-within":{outline:`solid ${(e.vars||e).palette.primary.main} 1px`,outlineOffset:"-1px"}},[`& .${X["row--editing"]}`]:{boxShadow:e.shadows[2]},[`& .${X["row--editing"]} .${X.cell}`]:{boxShadow:e.shadows[0],backgroundColor:(e.vars||e).palette.background.paper},[`& .${X.editBooleanCell}`]:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},[`& .${X.booleanCell}[data-value="true"]`]:{color:(e.vars||e).palette.text.secondary},[`& .${X.booleanCell}[data-value="false"]`]:{color:(e.vars||e).palette.text.disabled},[`& .${X.actionsCell}`]:{display:"inline-flex",alignItems:"center",gridGap:e.spacing(1)},[`& .${X.rowReorderCell}`]:{display:"inline-flex",flex:1,alignItems:"center",justifyContent:"center",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${X["rowReorderCell--draggable"]}`]:{cursor:"move",opacity:1},[`& .${X.rowReorderCellContainer}`]:{padding:0,alignItems:"stretch"},[`.${X.withBorderColor}`]:{borderColor:t},[`& .${X["cell--withRightBorder"]}`]:{borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${X["columnHeader--withRightBorder"]}`]:{borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${X["cell--textLeft"]}`]:{justifyContent:"flex-start"},[`& .${X["cell--textRight"]}`]:{justifyContent:"flex-end"},[`& .${X["cell--textCenter"]}`]:{justifyContent:"center"},[`& .${X.columnHeaderDraggableContainer}`]:{display:"flex",width:"100%",height:"100%"},[`& .${X.rowReorderCellPlaceholder}`]:{display:"none"},[`& .${X["columnHeader--dragging"]}, & .${X["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${X["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity,[`& .${X.rowReorderCellPlaceholder}`]:{display:"flex"}},[`& .${X.treeDataGroupingCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${X.treeDataGroupingCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)},[`& .${X.groupingCriteriaCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${X.groupingCriteriaCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)}})}),eue=["children","className"],tue=e=>{const{autoHeight:t,density:n,classes:r}=e,o={root:["root",t&&"autoHeight",`root--density${ue(n)}`,"withBorderColor"]};return Me(o,Bt,r)},nue=u.forwardRef(function(t,n){const r=tt(),{children:o,className:i}=t,s=ne(t,eue),a=lc(),c=Ge(a,Or),d=Ge(a,gy),p=Ge(a,Bae),h=Ge(a,Op),m=u.useRef(null),g=Vt(m,n),y=Ge(a,Rae),v=E({},r,{density:p}),S=tue(v);a.current.register("public",{rootElementRef:m});const[w,C]=u.useState(!1);return ln(()=>{C(!0)},[]),w?T.jsx(Zce,E({ref:g,className:he(i,S.root),ownerState:v,role:"grid","aria-colcount":c.length,"aria-rowcount":h+1+y+d,"aria-multiselectable":!r.disableMultipleRowSelection},s,{children:o})):null}),rue=["className"],oue=e=>{const{classes:t}=e;return Me({root:["footerContainer","withBorderColor"]},Bt,t)},iue=vr("div",{name:"MuiDataGrid",slot:"FooterContainer",overridesResolver:(e,t)=>t.footerContainer})({display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:52,borderTop:"1px solid"}),sue=u.forwardRef(function(t,n){const{className:r}=t,o=ne(t,rue),i=tt(),s=oue(i);return T.jsx(iue,E({ref:n,className:he(s.root,r),ownerState:i},o))}),lue=["className"],aue=e=>{const{classes:t}=e;return Me({root:["overlay"]},Bt,t)},cue=vr("div",{name:"MuiDataGrid",slot:"Overlay",overridesResolver:(e,t)=>t.overlay})({width:"100%",height:"100%",display:"flex",alignSelf:"center",alignItems:"center",justifyContent:"center",backgroundColor:"var(--unstable_DataGrid-overlayBackground)"}),nE=u.forwardRef(function(t,n){const{className:r}=t,o=ne(t,lue),i=tt(),s=aue(i);return T.jsx(cue,E({ref:n,className:he(s.root,r),ownerState:i},o))}),uue=["className"],due=e=>{const{classes:t}=e;return Me({root:["iconButtonContainer"]},Bt,t)},fue=vr("div",{name:"MuiDataGrid",slot:"IconButtonContainer",overridesResolver:(e,t)=>t.iconButtonContainer})(()=>({display:"flex",visibility:"hidden",width:0})),HA=u.forwardRef(function(t,n){const{className:r}=t,o=ne(t,uue),i=tt(),s=due(i);return T.jsx(fue,E({ref:n,className:he(s.root,r),ownerState:i},o))}),pue=e=>{const{classes:t}=e;return Me({icon:["sortIcon"]},Bt,t)};function hue(e,t,n,r){let o;const i={};return t==="asc"?o=e.columnSortedAscendingIcon:t==="desc"?o=e.columnSortedDescendingIcon:(o=e.columnUnsortedIcon,i.sortingOrder=r),o?T.jsx(o,E({fontSize:"small",className:n},i)):null}function mue(e){var t;const{direction:n,index:r,sortingOrder:o}=e,i=Dt(),s=tt(),a=E({},e,{classes:s.classes}),c=pue(a),d=hue(s.slots,n,c.icon,o);if(!d)return null;const p=T.jsx(s.slots.baseIconButton,E({tabIndex:-1,"aria-label":i.current.getLocaleText("columnHeaderSortIconLabel"),title:i.current.getLocaleText("columnHeaderSortIconLabel"),size:"small"},(t=s.slotProps)==null?void 0:t.baseIconButton,{children:d}));return T.jsxs(HA,{children:[r!=null&&T.jsx(KL,{badgeContent:r,color:"default",children:p}),r==null&&p]})}const gue=u.memo(mue),vue=e=>{const{classes:t,open:n}=e;return Me({root:["menuIcon",n&&"menuOpen"],button:["menuIconButton"]},Bt,t)},yue=u.memo(e=>{var t,n;const{colDef:r,open:o,columnMenuId:i,columnMenuButtonId:s,iconButtonRef:a}=e,c=Dt(),d=tt(),p=E({},e,{classes:d.classes}),h=vue(p),m=u.useCallback(g=>{g.preventDefault(),g.stopPropagation(),c.current.toggleColumnMenu(r.field)},[c,r.field]);return T.jsx("div",{className:h.root,children:T.jsx(d.slots.baseTooltip,E({title:c.current.getLocaleText("columnMenuLabel"),enterDelay:1e3},(t=d.slotProps)==null?void 0:t.baseTooltip,{children:T.jsx(d.slots.baseIconButton,E({ref:a,tabIndex:-1,className:h.button,"aria-label":c.current.getLocaleText("columnMenuLabel"),size:"small",onClick:m,"aria-haspopup":"menu","aria-expanded":o,"aria-controls":o?i:void 0,id:s},(n=d.slotProps)==null?void 0:n.baseIconButton,{children:T.jsx(d.slots.columnMenuIcon,{fontSize:"small"})}))}))})});function bue({columnMenuId:e,columnMenuButtonId:t,ContentComponent:n,contentComponentProps:r,field:o,open:i,target:s,onExited:a}){const c=Dt(),d=c.current.getColumn(o),p=u.useCallback(h=>{h.stopPropagation(),s!=null&&s.contains(h.target)||c.current.hideColumnMenu()},[c,s]);return!s||!d?null:T.jsx(jA,{placement:`bottom-${d.align==="right"?"start":"end"}`,open:i,target:s,onClickAway:p,onExited:a,children:T.jsx(n,E({colDef:d,hideMenu:p,open:i,id:e,labelledby:t},r))})}const wue=["className"],Cue=e=>{const{classes:t}=e;return Me({root:["columnHeaderTitle"]},Bt,t)},xue=vr("div",{name:"MuiDataGrid",slot:"ColumnHeaderTitle",overridesResolver:(e,t)=>t.columnHeaderTitle})({textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:"var(--unstable_DataGrid-headWeight)"}),Sue=u.forwardRef(function(t,n){const{className:r}=t,o=ne(t,wue),i=tt(),s=Cue(i);return T.jsx(xue,E({ref:n,className:he(s.root,r),ownerState:i},o))});function Eue(e){var t;const{label:n,description:r}=e,o=tt(),i=u.useRef(null),[s,a]=u.useState(""),c=u.useCallback(()=>{if(!r&&i!=null&&i.current){const d=Zae(i.current);a(d?n:"")}},[r,n]);return T.jsx(o.slots.baseTooltip,E({title:r||s},(t=o.slotProps)==null?void 0:t.baseTooltip,{children:T.jsx(Sue,{onMouseOver:c,ref:i,children:n})}))}const Pue=["resizable","resizing","height","side"];var VA=function(e){return e.Left="left",e.Right="right",e}(VA||{});const Iue=e=>{const{resizable:t,resizing:n,classes:r,side:o}=e,i={root:["columnSeparator",t&&"columnSeparator--resizable",n&&"columnSeparator--resizing",o&&`columnSeparator--side${ue(o)}`],icon:["iconSeparator"]};return Me(i,Bt,r)};function kue(e){const{height:t,side:n=VA.Right}=e,r=ne(e,Pue),o=tt(),i=E({},e,{side:n,classes:o.classes}),s=Iue(i),a=u.useCallback(c=>{c.preventDefault(),c.stopPropagation()},[]);return T.jsx("div",E({className:s.root,style:{minHeight:t,opacity:o.showColumnVerticalBorder?0:1}},r,{onClick:a,children:T.jsx(o.slots.columnResizeIcon,{className:s.icon})}))}const _ue=u.memo(kue),$ue=["classes","columnMenuOpen","colIndex","height","isResizing","sortDirection","hasFocus","tabIndex","separatorSide","isDraggable","headerComponent","description","elementId","width","columnMenuIconButton","columnMenu","columnTitleIconButtons","headerClassName","label","resizable","draggableContainerProps","columnHeaderSeparatorProps"],UA=u.forwardRef(function(t,n){const{classes:r,columnMenuOpen:o,colIndex:i,height:s,isResizing:a,sortDirection:c,hasFocus:d,tabIndex:p,separatorSide:h,isDraggable:m,headerComponent:g,description:y,width:v,columnMenuIconButton:S=null,columnMenu:w=null,columnTitleIconButtons:C=null,headerClassName:x,label:P,resizable:_,draggableContainerProps:I,columnHeaderSeparatorProps:k}=t,M=ne(t,$ue),O=lc(),F=tt(),L=u.useRef(null),[D,B]=u.useState(o),R=Vt(L,n);let A="none";return c!=null&&(A=c==="asc"?"ascending":"descending"),u.useEffect(()=>{D||B(o)},[D,o]),u.useLayoutEffect(()=>{const z=O.current.state.columnMenu;if(d&&!z.open){const N=L.current.querySelector('[tabindex="0"]')||L.current;N==null||N.focus(),O.current.columnHeadersContainerElementRef.current.scrollLeft=0}},[O,d]),T.jsxs("div",E({ref:R,className:he(r.root,x),style:{height:s,width:v,minWidth:v,maxWidth:v},role:"columnheader",tabIndex:p,"aria-colindex":i+1,"aria-sort":A,"aria-label":g==null?P:void 0},M,{children:[T.jsxs("div",E({className:r.draggableContainer,draggable:m},I,{children:[T.jsxs("div",{className:r.titleContainer,children:[T.jsx("div",{className:r.titleContainerContent,children:g!==void 0?g:T.jsx(Eue,{label:P,description:y,columnWidth:v})}),C]}),S]})),T.jsx(_ue,E({resizable:!F.disableColumnResize&&!!_,resizing:a,height:s,side:h},k)),w]}))}),Rue=e=>{const{colDef:t,classes:n,isDragging:r,sortDirection:o,showRightBorder:i,filterItemsCounter:s}=e,a=o!=null,c=s!=null&&s>0,d=t.type==="number",p={root:["columnHeader",t.headerAlign==="left"&&"columnHeader--alignLeft",t.headerAlign==="center"&&"columnHeader--alignCenter",t.headerAlign==="right"&&"columnHeader--alignRight",t.sortable&&"columnHeader--sortable",r&&"columnHeader--moving",a&&"columnHeader--sorted",c&&"columnHeader--filtered",d&&"columnHeader--numeric","withBorderColor",i&&"columnHeader--withRightBorder"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]};return Me(p,Bt,n)};function Mue(e){var t,n,r,o;const{colDef:i,columnMenuOpen:s,colIndex:a,headerHeight:c,isResizing:d,sortDirection:p,sortIndex:h,filterItemsCounter:m,hasFocus:g,tabIndex:y,disableReorder:v,separatorSide:S}=e,w=lc(),C=tt(),x=u.useRef(null),P=on(),_=on(),I=u.useRef(null),[k,M]=u.useState(s),O=u.useMemo(()=>!C.disableColumnReorder&&!v&&!i.disableReorder,[C.disableColumnReorder,v,i.disableReorder]);let F;i.renderHeader&&(F=i.renderHeader(w.current.getColumnHeaderParams(i.field)));const L=E({},e,{classes:C.classes,showRightBorder:C.showColumnVerticalBorder}),D=Rue(L),B=u.useCallback(re=>de=>{de.currentTarget.contains(de.target)&&w.current.publishEvent(re,w.current.getColumnHeaderParams(i.field),de)},[w,i.field]),R=u.useMemo(()=>({onClick:B("columnHeaderClick"),onDoubleClick:B("columnHeaderDoubleClick"),onMouseOver:B("columnHeaderOver"),onMouseOut:B("columnHeaderOut"),onMouseEnter:B("columnHeaderEnter"),onMouseLeave:B("columnHeaderLeave"),onKeyDown:B("columnHeaderKeyDown"),onFocus:B("columnHeaderFocus"),onBlur:B("columnHeaderBlur")}),[B]),A=u.useMemo(()=>O?{onDragStart:B("columnHeaderDragStart"),onDragEnter:B("columnHeaderDragEnter"),onDragOver:B("columnHeaderDragOver"),onDragEnd:B("columnHeaderDragEnd")}:{},[O,B]),z=u.useMemo(()=>({onMouseDown:B("columnSeparatorMouseDown")}),[B]);u.useEffect(()=>{k||M(s)},[k,s]);const V=u.useCallback(()=>{M(!1)},[]),N=!C.disableColumnMenu&&!i.disableColumnMenu&&T.jsx(yue,{colDef:i,columnMenuId:P,columnMenuButtonId:_,open:k,iconButtonRef:I}),H=T.jsx(bue,{columnMenuId:P,columnMenuButtonId:_,field:i.field,open:s,target:I.current,ContentComponent:C.slots.columnMenu,contentComponentProps:(t=C.slotProps)==null?void 0:t.columnMenu,onExited:V}),W=(n=i.sortingOrder)!=null?n:C.sortingOrder,K=T.jsxs(u.Fragment,{children:[!C.disableColumnFilter&&T.jsx(C.slots.columnHeaderFilterIconButton,E({field:i.field,counter:m},(r=C.slotProps)==null?void 0:r.columnHeaderFilterIconButton)),i.sortable&&!i.hideSortIcons&&T.jsx(gue,{direction:p,index:h,sortingOrder:W})]});u.useLayoutEffect(()=>{const re=w.current.state.columnMenu;if(g&&!re.open){const se=x.current.querySelector('[tabindex="0"]')||x.current;se==null||se.focus(),w.current.columnHeadersContainerElementRef.current.scrollLeft=0}},[w,g]);const Y=typeof i.headerClassName=="function"?i.headerClassName({field:i.field,colDef:i}):i.headerClassName,ie=(o=i.headerName)!=null?o:i.field;return T.jsx(UA,E({ref:x,classes:D,columnMenuOpen:s,colIndex:a,height:c,isResizing:d,sortDirection:p,hasFocus:g,tabIndex:y,separatorSide:S,isDraggable:O,headerComponent:F,description:i.description,elementId:i.field,width:i.computedWidth,columnMenuIconButton:N,columnTitleIconButtons:K,headerClassName:Y,label:ie,resizable:!C.disableColumnResize&&!!i.resizable,"data-field":i.field,columnMenu:H,draggableContainerProps:A,columnHeaderSeparatorProps:z},R))}const lp=()=>({items:[],logicOperator:no.And,quickFilterValues:[],quickFilterLogicOperator:no.And}),mR=1e3;class Tue{constructor(t=mR){this.timeouts=new Map,this.cleanupTimeout=mR,this.cleanupTimeout=t}register(t,n,r){this.timeouts||(this.timeouts=new Map);const o=setTimeout(()=>{typeof n=="function"&&n(),this.timeouts.delete(r.cleanupToken)},this.cleanupTimeout);this.timeouts.set(r.cleanupToken,o)}unregister(t){const n=this.timeouts.get(t.cleanupToken);n&&(this.timeouts.delete(t.cleanupToken),clearTimeout(n))}reset(){this.timeouts&&(this.timeouts.forEach((t,n)=>{this.unregister({cleanupToken:n})}),this.timeouts=void 0)}}class Oue{constructor(){this.registry=new FinalizationRegistry(t=>{typeof t=="function"&&t()})}register(t,n,r){this.registry.register(t,n,r)}unregister(t){this.registry.unregister(t)}reset(){}}var fs=function(e){return e.DataGrid="DataGrid",e.DataGridPro="DataGridPro",e}(fs||{});class Lue{}function Fue(e){let t=0;return function(r,o,i,s){e.registry===null&&(e.registry=typeof FinalizationRegistry!="undefined"?new Oue:new Tue);const[a]=u.useState(new Lue),c=u.useRef(null),d=u.useRef();d.current=i;const p=u.useRef(null);if(!c.current&&d.current){const h=(m,g,y)=>{if(!g.defaultMuiPrevented){var v;(v=d.current)==null||v.call(d,m,g,y)}};c.current=r.current.subscribeEvent(o,h,s),t+=1,p.current={cleanupToken:t},e.registry.register(a,()=>{var m;(m=c.current)==null||m.call(c),c.current=null,p.current=null},p.current)}else!d.current&&c.current&&(c.current(),c.current=null,p.current&&(e.registry.unregister(p.current),p.current=null));u.useEffect(()=>{if(!c.current&&d.current){const h=(m,g,y)=>{if(!g.defaultMuiPrevented){var v;(v=d.current)==null||v.call(d,m,g,y)}};c.current=r.current.subscribeEvent(o,h,s)}return p.current&&e.registry&&(e.registry.unregister(p.current),p.current=null),()=>{var h;(h=c.current)==null||h.call(c),c.current=null}},[r,o,s])}}const Aue={registry:null},ot=Fue(Aue),Nue={isFirst:!0};function xn(e,t,n){ot(e,t,n,Nue)}function Ar(e,t){const n=u.useRef(null);if(n.current)return n.current;const r=e.current.getLogger(t);return n.current=r,r}function Due(e){return typeof e=="number"}function WA(e){return typeof e=="function"}function rE(e){return typeof e=="object"&&e!==null}function Bue(){try{const e="__some_random_key_you_are_not_going_to_use__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}function Om(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}const Vu=(e,t,n)=>Math.max(t,Math.min(n,e));function La(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const o=e.length;if(o!==t.length)return!1;for(let i=0;i<o;i+=1)if(!La(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;const o=Array.from(e.entries());for(let i=0;i<o.length;i+=1)if(!t.has(o[i][0]))return!1;for(let i=0;i<o.length;i+=1){const s=o[i];if(!La(s[1],t.get(s[0])))return!1}return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;const o=Array.from(e.entries());for(let i=0;i<o.length;i+=1)if(!t.has(o[i][0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){const o=e.length;if(o!==t.length)return!1;for(let i=0;i<o;i+=1)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),r=n.length;if(r!==Object.keys(t).length)return!1;for(let o=0;o<r;o+=1)if(!Object.prototype.hasOwnProperty.call(t,n[o]))return!1;for(let o=0;o<r;o+=1){const i=n[o];if(!La(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function zue(e){return()=>{let t=e+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function jue(e,t,n){const r=zue(e);return()=>t+(n-t)*r()}function GA(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}const Hue=(e,t,n,r,o)=>{const i=Ar(e,"useNativeEventListener"),[s,a]=u.useState(!1),c=u.useRef(r),d=u.useCallback(p=>c.current&&c.current(p),[]);u.useEffect(()=>{c.current=r},[r]),u.useEffect(()=>{let p;if(WA(t)?p=t():p=t&&t.current?t.current:null,p&&n&&!s){i.debug(`Binding native ${n} event`),p.addEventListener(n,d,o);const h=p;a(!0);const m=()=>{i.debug(`Clearing native ${n} event`),h.removeEventListener(n,d,o)};e.current.subscribeEvent("unmount",m)}},[t,d,n,s,i,o,e])},Lp=e=>{const t=u.useRef(!0);t.current&&(t.current=!1,e())},Vue=100,Uue=e=>e?0:100,KA=(e,t)=>t>0&&e>0?Math.ceil(e/t):0;ws(["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 qA=e=>({page:0,pageSize:e?0:100}),Wue=(e,t=0)=>t===0?e:Math.max(Math.min(e,t-1),0),YA=(e,t)=>{if(t===fs.DataGrid&&e>Vue)throw new Error(["MUI: `pageSize` cannot exceed 100 in the MIT version of the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(`
|
|
332
|
+
`))},QA=e=>e.pagination,si=Tt(QA,e=>e.paginationModel),Gue=Tt(si,e=>e.page),Kue=Tt(si,e=>e.pageSize);Tt(si,yy,(e,t)=>KA(t,e.pageSize));const oE=In(si,Ti,vy,ia,kA,(e,t,n,r,o)=>{const i=o.length,s=Math.min(e.pageSize*e.page,i-1),a=Math.min(s+e.pageSize-1,i-1);if(s===-1||a===-1)return null;if(n<2)return{firstRowIndex:s,lastRowIndex:a};const c=o[s],d=a-s+1,p=r.findIndex(y=>y.id===c.id);let h=p,m=0;for(;h<r.length&&m<=d;){var g;const y=r[h],v=(g=t[y.id])==null?void 0:g.depth;v===void 0?h+=1:((m<d||v>0)&&(h+=1),v===0&&(m+=1))}return{firstRowIndex:p,lastRowIndex:h-1}}),que=In(ia,oE,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),XA=In(If,oE,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),ap=e=>e.preferencePanel;var Xa=function(e){return e.filters="filters",e.columns="columns",e}(Xa||{});const cp=e=>e.rowsMeta,ri=e=>e.rowSelection,Yue=Tt(ri,e=>e.length),Que=In(ri,_l,(e,t)=>new Map(e.map(n=>[n,t[n]]))),Fg=In(ri,e=>e.reduce((t,n)=>(t[n]=n,t),{})),Xue=ws(["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"),JA=(e,t)=>t&&e.length>1?(Xue(),[e[0]]):e,gR=(e,t)=>n=>E({},n,{sorting:E({},n.sorting,{sortModel:JA(e,t)})}),Jue=e=>e==="desc",Zue=(e,t)=>{const n=t.current.getColumn(e.field);if(!n)return null;const r=Jue(e.sort)?(...i)=>-1*n.sortComparator(...i):n.sortComparator;return{getSortCellParams:i=>({id:i,field:n.field,rowNode:t.current.getRowNode(i),value:t.current.getCellValue(i,n.field),api:t.current}),comparator:r}},ede=(e,t,n)=>e.reduce((r,o,i)=>{if(r!==0)return r;const s=t.params[i],a=n.params[i];return r=o.comparator(s.value,a.value,s,a),r},0),tde=(e,t)=>{const n=e.map(r=>Zue(r,t)).filter(r=>!!r);return n.length===0?null:r=>r.map(o=>({node:o,params:n.map(i=>i.getSortCellParams(o.id))})).sort((o,i)=>ede(n,o,i)).map(o=>o.node.id)},vR=(e,t)=>{const n=e.indexOf(t);return!t||n===-1||n+1===e.length?e[0]:e[n+1]},iE=(e,t)=>e==null&&t!=null?-1:t==null&&e!=null?1:e==null&&t==null?0:null,nde=new Intl.Collator,rde=(e,t)=>{const n=iE(e,t);return n!==null?n:typeof e=="string"?nde.compare(e.toString(),t.toString()):e-t},ZA=(e,t)=>{const n=iE(e,t);return n!==null?n:Number(e)-Number(t)},e4=(e,t)=>{const n=iE(e,t);return n!==null?n:e>t?1:e<t?-1:0},t4=e=>e.headerFiltering,ode=Tt(t4,e=>e.editing),ide=Tt(t4,e=>e.menuOpen),sde=e=>{const{classes:t}=e;return Me({icon:["filterIcon"]},Bt,t)};function lde(e){var t,n;const{counter:r,field:o,onClick:i}=e,s=Dt(),a=tt(),c=E({},e,{classes:a.classes}),d=sde(c),p=Ge(s,ap),h=on(),m=on(),g=u.useCallback(S=>{S.preventDefault(),S.stopPropagation();const{open:w,openedPanelValue:C}=ap(s.current.state);w&&C===Xa.filters?s.current.hideFilterPanel():s.current.showFilterPanel(void 0,m,h),i&&i(s.current.getColumnHeaderParams(o),S)},[s,o,i,m,h]);if(!r)return null;const y=p.open&&p.labelId===h,v=T.jsx(a.slots.baseIconButton,E({id:h,onClick:g,color:"default","aria-label":s.current.getLocaleText("columnHeaderFiltersLabel"),size:"small",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":y,"aria-controls":y?m:void 0},(t=a.slotProps)==null?void 0:t.baseIconButton,{children:T.jsx(a.slots.columnFilteredIcon,{className:d.icon,fontSize:"small"})}));return T.jsx(a.slots.baseTooltip,E({title:s.current.getLocaleText("columnHeaderFiltersTooltipActive")(r),enterDelay:1e3},(n=a.slotProps)==null?void 0:n.baseTooltip,{children:T.jsxs(HA,{children:[r>1&&T.jsx(KL,{badgeContent:r,color:"default",children:v}),r===1&&v]})}))}const ade=["field","id","value","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","api"],cde=e=>{const{classes:t}=e;return Me({root:["checkboxInput"]},Bt,t)},ude=u.forwardRef(function(t,n){var r;const{field:o,id:i,value:s,rowNode:a,hasFocus:c,tabIndex:d}=t,p=ne(t,ade),h=Dt(),m=tt(),g={classes:m.classes},y=cde(g),v=u.useRef(null),S=u.useRef(null),w=Vt(v,n),C=h.current.getCellElement(i,o),x=k=>{const M={value:k.target.checked,id:i};h.current.publishEvent("rowSelectionCheckboxChange",M,k)};u.useLayoutEffect(()=>{d===0&&C&&(C.tabIndex=-1)},[C,d]),u.useEffect(()=>{if(c){var k;const M=(k=v.current)==null?void 0:k.querySelector("input");M==null||M.focus({preventScroll:!0})}else S.current&&S.current.stop({})},[c]);const P=u.useCallback(k=>{BA(k.key)&&k.stopPropagation()},[]);if(a.type==="footer"||a.type==="pinnedRow")return null;const _=h.current.isRowSelectable(i),I=h.current.getLocaleText(s?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return T.jsx(m.slots.baseCheckbox,E({ref:w,tabIndex:d,checked:s,onChange:x,className:y.root,inputProps:{"aria-label":I},onKeyDown:P,disabled:!_,touchRippleRef:S},(r=m.slotProps)==null?void 0:r.baseCheckbox,p))}),dde=ude,fde=["field","colDef"],pde=e=>{const{classes:t}=e;return Me({root:["checkboxInput"]},Bt,t)},hde=u.forwardRef(function(t,n){var r;const o=ne(t,fde),[,i]=u.useState(!1),s=Dt(),a=tt(),c={classes:a.classes},d=pde(c),p=Ge(s,$A),h=Ge(s,ri),m=Ge(s,If),g=Ge(s,XA),y=u.useMemo(()=>typeof a.isRowSelectable!="function"?h:h.filter(M=>s.current.getRow(M)?a.isRowSelectable(s.current.getRowParams(M)):!1),[s,a.isRowSelectable,h]),v=u.useMemo(()=>(!a.pagination||!a.checkboxSelectionVisibleOnly?m:g).reduce((O,F)=>(O[F]=!0,O),{}),[a.pagination,a.checkboxSelectionVisibleOnly,g,m]),S=u.useMemo(()=>y.filter(M=>v[M]).length,[y,v]),w=S>0&&S<Object.keys(v).length,C=S>0,x=M=>{const O={value:M.target.checked};s.current.publishEvent("headerSelectionCheckboxChange",O)},P=p!==null&&p.field===t.field?0:-1;u.useLayoutEffect(()=>{const M=s.current.getColumnHeaderElement(t.field);P===0&&M&&(M.tabIndex=-1)},[P,s,t.field]);const _=u.useCallback(M=>{M.key===" "&&s.current.publishEvent("headerSelectionCheckboxChange",{value:!C})},[s,C]),I=u.useCallback(()=>{i(M=>!M)},[]);u.useEffect(()=>s.current.subscribeEvent("rowSelectionChange",I),[s,I]);const k=s.current.getLocaleText(C?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows");return T.jsx(a.slots.baseCheckbox,E({ref:n,indeterminate:w,checked:C,onChange:x,className:d.root,inputProps:{"aria-label":k},tabIndex:P,onKeyDown:_},(r=a.slotProps)==null?void 0:r.baseCheckbox,o))}),yR=$t(T.jsx("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward"),bR=$t(T.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward"),wR=$t(T.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"KeyboardArrowRight"),CR=$t(T.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),mde=$t(T.jsx("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}),"FilterList"),xR=$t(T.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"),gde=$t(T.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");$t(T.jsx("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");$t(T.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 vde=$t(T.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"),yde=$t(T.jsx("path",{d:"M11 19V5h2v14z"}),"Separator"),bde=$t(T.jsx("path",{d:"M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z"}),"ViewHeadline"),wde=$t(T.jsx("path",{d:"M21,8H3V4h18V8z M21,10H3v4h18V10z M21,16H3v4h18V16z"}),"TableRows"),Cde=$t(T.jsx("path",{d:"M4 18h17v-6H4v6zM4 5v6h17V5H4z"}),"ViewStream"),xde=$t(T.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"),q1=$t(T.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"),SR=$t(T.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add"),Sde=$t(T.jsx("path",{d:"M19 13H5v-2h14v2z"}),"Remove"),Ede=$t(T.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"),ER=$t(T.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"),Pde=$t(T.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"),Ide=$t(T.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),kde=$t(T.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"),_de=$t(T.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"}),"VisibilityOff"),$de=$t(T.jsx("g",{children:T.jsx("path",{d:"M14.67,5v14H9.33V5H14.67z M15.67,19H21V5h-5.33V19z M8.33,19V5H3v14H8.33z"})}),"ViewColumn"),Rde=$t(T.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"}),"Clear");$t(T.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");const Mde=$t(T.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),"Delete"),Tde=["hideMenu","colDef","id","labelledby","className","children","open"],Ode=oe(Zv)(()=>({minWidth:248})),Lde=u.forwardRef(function(t,n){const{hideMenu:r,id:o,labelledby:i,className:s,children:a,open:c}=t,d=ne(t,Tde),p=u.useCallback(h=>{DA(h.key)&&h.preventDefault(),Fce(h.key)&&r(h)},[r]);return T.jsx(Ode,E({id:o,ref:n,className:he(X.menuList,s),"aria-labelledby":i,onKeyDown:p,autoFocus:c},d,{children:a}))}),Fde=["displayOrder"],Ade=e=>{const t=lc(),{defaultSlots:n,defaultSlotProps:r,slots:o={},slotProps:i={},hideMenu:s,colDef:a,addDividers:c=!0}=e,d=u.useMemo(()=>E({},n,o),[n,o]),p=u.useMemo(()=>{if(!i||Object.keys(i).length===0)return r;const g=E({},i);return Object.entries(r).forEach(([y,v])=>{g[y]=E({},v,i[y]||{})}),g},[r,i]),h=t.current.unstable_applyPipeProcessors("columnMenu",[],e.colDef),m=u.useMemo(()=>{const g=Object.keys(n);return Object.keys(o).filter(y=>!g.includes(y))},[o,n]);return u.useMemo(()=>{const v=Array.from(new Set([...h,...m])).filter(S=>d[S]!=null).sort((S,w)=>{const C=p[S],x=p[w],P=Number.isFinite(C==null?void 0:C.displayOrder)?C.displayOrder:100,_=Number.isFinite(x==null?void 0:x.displayOrder)?x.displayOrder:100;return P-_});return v.reduce((S,w,C)=>{let x={colDef:a,onClick:s};const P=p[w];if(P){const _=ne(P,Fde);x=E({},x,_)}return c&&C!==v.length-1?[...S,[d[w],x],[$J,{}]]:[...S,[d[w],x]]},[])},[c,a,h,s,d,p,m])};function Nde(e){const{colDef:t,onClick:n}=e,r=Dt(),o=tt(),a=Or(r).filter(d=>d.disableColumnMenu!==!0).length===1,c=u.useCallback(d=>{a||(r.current.setColumnVisibility(t.field,!1),n(d))},[r,t.field,n,a]);return o.disableColumnSelector||t.hideable===!1?null:T.jsxs(fo,{onClick:c,disabled:a,children:[T.jsx(Bl,{children:T.jsx(o.slots.columnMenuHideIcon,{fontSize:"small"})}),T.jsx(cs,{children:r.current.getLocaleText("columnMenuHideColumn")})]})}function Dde(e){const{onClick:t}=e,n=Dt(),r=tt(),o=u.useCallback(i=>{t(i),n.current.showPreferences(Xa.columns)},[n,t]);return r.disableColumnSelector?null:T.jsxs(fo,{onClick:o,children:[T.jsx(Bl,{children:T.jsx(r.slots.columnMenuManageColumnsIcon,{fontSize:"small"})}),T.jsx(cs,{children:n.current.getLocaleText("columnMenuManageColumns")})]})}function Bde(e){return T.jsxs(u.Fragment,{children:[T.jsx(Nde,E({},e)),T.jsx(Dde,E({},e))]})}function zde(e){const{colDef:t,onClick:n}=e,r=Dt(),o=tt(),i=u.useCallback(s=>{n(s),r.current.showFilterPanel(t.field)},[r,t.field,n]);return o.disableColumnFilter||!t.filterable?null:T.jsxs(fo,{onClick:i,children:[T.jsx(Bl,{children:T.jsx(o.slots.columnMenuFilterIcon,{fontSize:"small"})}),T.jsx(cs,{children:r.current.getLocaleText("columnMenuFilter")})]})}function jde(e){var t;const{colDef:n,onClick:r}=e,o=Dt(),i=Ge(o,ni),s=tt(),a=u.useMemo(()=>{if(!n)return null;const p=i.find(h=>h.field===n.field);return p==null?void 0:p.sort},[n,i]),c=(t=n.sortingOrder)!=null?t:s.sortingOrder,d=u.useCallback(p=>{r(p);const h=p.currentTarget.getAttribute("data-value")||null;o.current.sortColumn(n,h===a?null:h)},[o,n,r,a]);return!n||!n.sortable||!c.some(p=>!!p)?null:T.jsxs(u.Fragment,{children:[c.includes("asc")&&a!=="asc"?T.jsxs(fo,{onClick:d,"data-value":"asc",children:[T.jsx(Bl,{children:T.jsx(s.slots.columnMenuSortAscendingIcon,{fontSize:"small"})}),T.jsx(cs,{children:o.current.getLocaleText("columnMenuSortAsc")})]}):null,c.includes("desc")&&a!=="desc"?T.jsxs(fo,{onClick:d,"data-value":"desc",children:[T.jsx(Bl,{children:T.jsx(s.slots.columnMenuSortDescendingIcon,{fontSize:"small"})}),T.jsx(cs,{children:o.current.getLocaleText("columnMenuSortDesc")})]}):null,c.includes(null)&&a!=null?T.jsxs(fo,{onClick:d,children:[T.jsx(Bl,{}),T.jsx(cs,{children:o.current.getLocaleText("columnMenuUnsort")})]}):null]})}const Hde=["defaultSlots","defaultSlotProps","slots","slotProps"],Vde={columnMenuSortItem:jde,columnMenuFilterItem:zde,columnMenuColumnsItem:Bde},Ude={columnMenuSortItem:{displayOrder:10},columnMenuFilterItem:{displayOrder:20},columnMenuColumnsItem:{displayOrder:30}},Wde=u.forwardRef(function(t,n){const{defaultSlots:r,defaultSlotProps:o,slots:i,slotProps:s}=t,a=ne(t,Hde),c=Ade(E({},a,{defaultSlots:r,defaultSlotProps:o,slots:i,slotProps:s}));return T.jsx(Lde,E({ref:n},a,{children:c.map(([d,p],h)=>T.jsx(d,E({},p),h))}))}),Gde=u.forwardRef(function(t,n){return T.jsx(Wde,E({},t,{ref:n,defaultSlots:Vde,defaultSlotProps:Ude}))}),Kde=["className"],qde=e=>{const{classes:t}=e;return Me({root:["panelContent"]},Bt,t)},Yde=vr("div",{name:"MuiDataGrid",slot:"PanelContent",overridesResolver:(e,t)=>t.panelContent})({display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400});function n4(e){const{className:t}=e,n=ne(e,Kde),r=tt(),o=qde(r);return T.jsx(Yde,E({className:he(t,o.root),ownerState:r},n))}const Qde=["className"],Xde=e=>{const{classes:t}=e;return Me({root:["panelFooter"]},Bt,t)},Jde=vr("div",{name:"MuiDataGrid",slot:"PanelFooter",overridesResolver:(e,t)=>t.panelFooter})(({theme:e})=>({padding:e.spacing(.5),display:"flex",justifyContent:"space-between"}));function r4(e){const{className:t}=e,n=ne(e,Qde),r=tt(),o=Xde(r);return T.jsx(Jde,E({className:he(t,o.root),ownerState:r},n))}const Zde=["className"],efe=e=>{const{classes:t}=e;return Me({root:["panelHeader"]},Bt,t)},tfe=vr("div",{name:"MuiDataGrid",slot:"PanelHeader",overridesResolver:(e,t)=>t.panelHeader})(({theme:e})=>({padding:e.spacing(1)}));function nfe(e){const{className:t}=e,n=ne(e,Zde),r=tt(),o=efe(r);return T.jsx(tfe,E({className:he(t,o.root),ownerState:r},n))}const rfe=["className","slotProps"],ofe=e=>{const{classes:t}=e;return Me({root:["panelWrapper"]},Bt,t)},ife=oe("div",{name:"MuiDataGrid",slot:"PanelWrapper",overridesResolver:(e,t)=>t.panelWrapper})({display:"flex",flexDirection:"column",flex:1,"&:focus":{outline:0}}),sfe=()=>!0,o4=u.forwardRef(function(t,n){const{className:r,slotProps:o={}}=t,i=ne(t,rfe),s=tt(),a=ofe(s);return T.jsx(_L,E({open:!0,disableEnforceFocus:!0,isEnabled:sfe},o.TrapFocus,{children:T.jsx(ife,E({ref:n,tabIndex:-1,className:he(r,a.root),ownerState:s},i))}))}),lfe=!1,afe=["sort","searchPredicate","autoFocusSearchField","disableHideAllButton","disableShowAllButton","getTogglableColumns"],cfe=e=>{const{classes:t}=e;return Me({root:["columnsPanel"],columnsPanelRow:["columnsPanelRow"]},Bt,t)},ufe=oe("div",{name:"MuiDataGrid",slot:"ColumnsPanel",overridesResolver:(e,t)=>t.columnsPanel})({padding:"8px 0px 8px 8px"}),dfe=oe("div",{name:"MuiDataGrid",slot:"ColumnsPanelRow",overridesResolver:(e,t)=>t.columnsPanelRow})(({theme:e})=>({display:"flex",justifyContent:"space-between",padding:"1px 8px 1px 7px",[`& .${Rr.root}`]:{marginRight:e.spacing(.5)}})),ffe=oe(oo)({justifyContent:"flex-end"}),PR=new Intl.Collator,pfe=(e,t)=>(e.headerName||e.field).toLowerCase().indexOf(t)>-1;function hfe(e){var t,n,r;const o=Dt(),i=u.useRef(null),s=Ge(o,ds),a=Ge(o,Li),c=tt(),[d,p]=u.useState(""),h=cfe(c),{sort:m,searchPredicate:g=pfe,autoFocusSearchField:y=!0,disableHideAllButton:v=!1,disableShowAllButton:S=!1,getTogglableColumns:w}=e,C=ne(e,afe),x=u.useMemo(()=>{switch(m){case"asc":return[...s].sort((L,D)=>PR.compare(L.headerName||L.field,D.headerName||D.field));case"desc":return[...s].sort((L,D)=>-PR.compare(L.headerName||L.field,D.headerName||D.field));default:return s}},[s,m]),P=L=>{const{name:D}=L.target;o.current.setColumnVisibility(D,a[D]===!1)},_=u.useCallback(L=>{const D=Li(o),B=E({},D),R=w?w(s):null;return s.forEach(A=>{A.hideable&&(R==null||R.includes(A.field))&&(L?delete B[A.field]:B[A.field]=!1)}),o.current.setColumnVisibilityModel(B)},[o,s,w]),I=u.useCallback(L=>{p(L.target.value)},[]),k=u.useMemo(()=>{const L=w?w(x):null,D=L?x.filter(({field:B})=>L.includes(B)):x;return d?D.filter(B=>g(B,d.toLowerCase())):D},[x,d,g,w]),M=u.useRef(null);u.useEffect(()=>{y?i.current.focus():M.current&&typeof M.current.focus=="function"&&M.current.focus()},[y]);let O=!1;const F=L=>O===!1&&L.hideable!==!1?(O=!0,!0):!1;return T.jsxs(o4,E({},C,{children:[T.jsx(nfe,{children:T.jsx(c.slots.baseTextField,E({label:o.current.getLocaleText("columnsPanelTextFieldLabel"),placeholder:o.current.getLocaleText("columnsPanelTextFieldPlaceholder"),inputRef:i,value:d,onChange:I,variant:"standard",fullWidth:!0},(t=c.slotProps)==null?void 0:t.baseTextField))}),T.jsx(n4,{children:T.jsx(ufe,{className:h.root,ownerState:c,children:k.map(L=>{var D;return T.jsxs(dfe,{className:h.columnsPanelRow,ownerState:c,children:[T.jsx(rF,{control:T.jsx(c.slots.baseSwitch,E({disabled:L.hideable===!1,checked:a[L.field]!==!1,onClick:P,name:L.field,size:"small",inputRef:F(L)?M:void 0},(D=c.slotProps)==null?void 0:D.baseSwitch)),label:L.headerName||L.field}),!c.disableColumnReorder&&lfe&&T.jsx(ffe,{draggable:!0,"aria-label":o.current.getLocaleText("columnsPanelDragIconLabel"),title:o.current.getLocaleText("columnsPanelDragIconLabel"),size:"small",disabled:!0,children:T.jsx(c.slots.columnReorderIcon,{})})]},L.field)})})}),S&&v?null:T.jsxs(r4,{children:[v?T.jsx("span",{}):T.jsx(c.slots.baseButton,E({onClick:()=>_(!1)},(n=c.slotProps)==null?void 0:n.baseButton,{disabled:v,children:o.current.getLocaleText("columnsPanelHideAllButton")})),S?null:T.jsx(c.slots.baseButton,E({onClick:()=>_(!0)},(r=c.slotProps)==null?void 0:r.baseButton,{disabled:S,children:o.current.getLocaleText("columnsPanelShowAllButton")}))]})]}))}const mfe=["children","className","classes"],gfe=Xe("MuiDataGrid",["panel","paper"]),vfe=oe(oc,{name:"MuiDataGrid",slot:"Panel",overridesResolver:(e,t)=>t.panel})(({theme:e})=>({zIndex:e.zIndex.modal})),yfe=oe(Ci,{name:"MuiDataGrid",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,minWidth:300,maxHeight:450,display:"flex"})),bfe=u.forwardRef((e,t)=>{const{children:n,className:r}=e,o=ne(e,mfe),i=Dt(),s=tt(),a=gfe,[c,d]=u.useState(!1),p=u.useCallback(()=>{i.current.hidePreferences()},[i]),h=u.useCallback(v=>{Og(v.key)&&i.current.hidePreferences()},[i]),m=u.useMemo(()=>[{name:"flip",enabled:!1},{name:"isPlaced",enabled:!0,phase:"main",fn:()=>{d(!0)},effect:()=>()=>{d(!1)}}],[]),[g,y]=u.useState(null);return u.useEffect(()=>{var v,S;const w=(v=i.current.rootElementRef)==null||(S=v.current)==null?void 0:S.querySelector(`.${X.columnHeaders}`);w&&y(w)},[i]),g?T.jsx(vfe,E({ref:t,placement:"bottom-start",className:he(r,a.panel),ownerState:s,anchorEl:g,modifiers:m},o,{children:T.jsx(kL,{mouseEvent:"onMouseUp",onClickAway:p,children:T.jsx(yfe,{className:a.paper,ownerState:s,elevation:8,onKeyDown:h,children:c&&n})})})):null}),wfe=u.forwardRef(function(t,n){var r,o,i;const s=Dt(),a=Ge(s,ds),c=tt(),d=Ge(s,ap),p=s.current.unstable_applyPipeProcessors("preferencePanel",null,(r=d.openedPanelValue)!=null?r:Xa.filters);return T.jsx(c.slots.panel,E({ref:n,as:c.slots.basePopper,open:a.length>0&&d.open,id:d.panelId,"aria-labelledby":d.labelId},(o=c.slotProps)==null?void 0:o.panel,t,(i=c.slotProps)==null?void 0:i.basePopper,{children:p}))}),Cfe=["item","hasMultipleFilters","deleteFilter","applyFilterChanges","multiFilterOperator","showMultiFilterOperators","disableMultiFilterOperator","applyMultiFilterOperatorChanges","focusElementRef","logicOperators","columnsSort","filterColumns","deleteIconProps","logicOperatorInputProps","operatorInputProps","columnInputProps","valueInputProps","children"],xfe=["InputComponentProps"],Sfe=e=>{const{classes:t}=e;return Me({root:["filterForm"],deleteIcon:["filterFormDeleteIcon"],logicOperatorInput:["filterFormLogicOperatorInput"],columnInput:["filterFormColumnInput"],operatorInput:["filterFormOperatorInput"],valueInput:["filterFormValueInput"]},Bt,t)},Efe=oe("div",{name:"MuiDataGrid",slot:"FilterForm",overridesResolver:(e,t)=>t.filterForm})(({theme:e})=>({display:"flex",padding:e.spacing(1)})),Pfe=oe("div",{name:"MuiDataGrid",slot:"FilterFormDeleteIcon",overridesResolver:(e,t)=>t.filterFormDeleteIcon})(({theme:e})=>({flexShrink:0,justifyContent:"flex-end",marginRight:e.spacing(.5),marginBottom:e.spacing(.2)})),Ife=oe("div",{name:"MuiDataGrid",slot:"FilterFormLogicOperatorInput",overridesResolver:(e,t)=>t.filterFormLogicOperatorInput})({minWidth:55,marginRight:5,justifyContent:"end"}),kfe=oe("div",{name:"MuiDataGrid",slot:"FilterFormColumnInput",overridesResolver:(e,t)=>t.filterFormColumnInput})({width:150}),_fe=oe("div",{name:"MuiDataGrid",slot:"FilterFormOperatorInput",overridesResolver:(e,t)=>t.filterFormOperatorInput})({width:120}),$fe=oe("div",{name:"MuiDataGrid",slot:"FilterFormValueInput",overridesResolver:(e,t)=>t.filterFormValueInput})({width:190}),Rfe=e=>{switch(e){case no.And:return"filterPanelOperatorAnd";case no.Or:return"filterPanelOperatorOr";default:throw new Error("MUI: Invalid `logicOperator` property in the `GridFilterPanel`.")}},Yd=e=>e.headerName||e.field,IR=new Intl.Collator,Mfe=u.forwardRef(function(t,n){var r,o,i,s,a,c,d,p,h,m;const{item:g,hasMultipleFilters:y,deleteFilter:v,applyFilterChanges:S,multiFilterOperator:w,showMultiFilterOperators:C,disableMultiFilterOperator:x,applyMultiFilterOperatorChanges:P,focusElementRef:_,logicOperators:I=[no.And,no.Or],columnsSort:k,filterColumns:M,deleteIconProps:O={},logicOperatorInputProps:F={},operatorInputProps:L={},columnInputProps:D={},valueInputProps:B={}}=t,R=ne(t,Cfe),A=Dt(),z=Ge(A,EA),V=Ge(A,Cr),N=on(),H=on(),W=on(),K=on(),Y=tt(),ie=Sfe(Y),re=u.useRef(null),de=u.useRef(null),se=y&&I.length>0,le=((r=Y.slotProps)==null?void 0:r.baseFormControl)||{},ye=(i=(((o=Y.slotProps)==null?void 0:o.baseSelect)||{}).native)!=null?i:!0,_e=((s=Y.slotProps)==null?void 0:s.baseInputLabel)||{},ee=((a=Y.slotProps)==null?void 0:a.baseSelectOption)||{},{InputComponentProps:ke}=B,Re=ne(B,xfe),Pe=u.useMemo(()=>{if(M===void 0||typeof M!="function")return z;const De=M({field:g.field,columns:z,currentFilters:(V==null?void 0:V.items)||[]});return z.filter(ct=>De.includes(ct.field))},[M,V==null?void 0:V.items,z,g.field]),pe=u.useMemo(()=>{switch(k){case"asc":return Pe.sort((De,ct)=>IR.compare(Yd(De),Yd(ct)));case"desc":return Pe.sort((De,ct)=>-IR.compare(Yd(De),Yd(ct)));default:return Pe}},[Pe,k]),be=g.field?A.current.getColumn(g.field):null,te=u.useMemo(()=>{var De;return!g.operator||!be?null:(De=be.filterOperators)==null?void 0:De.find(ct=>ct.value===g.operator)},[g,be]),Oe=u.useCallback(De=>{const ct=De.target.value,vt=A.current.getColumn(ct);if(vt.field===be.field)return;const st=vt.filterOperators.find(yt=>yt.value===g.operator)||vt.filterOperators[0],Pt=!st.InputComponent||st.InputComponent!==(te==null?void 0:te.InputComponent);S(E({},g,{field:ct,operator:st.value,value:Pt?void 0:g.value}))},[A,S,g,be,te]),Ye=u.useCallback(De=>{const ct=De.target.value,vt=be==null?void 0:be.filterOperators.find(Pt=>Pt.value===ct),st=!(vt!=null&&vt.InputComponent)||(vt==null?void 0:vt.InputComponent)!==(te==null?void 0:te.InputComponent);S(E({},g,{operator:ct,value:st?void 0:g.value}))},[S,g,be,te]),Ke=u.useCallback(De=>{const ct=De.target.value===no.And.toString()?no.And:no.Or;P(ct)},[P]),Ue=()=>{Y.disableMultipleColumnsFiltering?g.value===void 0?v(g):S(E({},g,{value:void 0})):v(g)};return u.useImperativeHandle(_,()=>({focus:()=>{if(te!=null&&te.InputComponent){var De;re==null||(De=re.current)==null||De.focus()}else de.current.focus()}}),[te]),T.jsxs(Efe,E({ref:n,className:ie.root,"data-id":g.id,ownerState:Y},R,{children:[T.jsx(Pfe,E({variant:"standard",as:Y.slots.baseFormControl},le,O,{className:he(ie.deleteIcon,le.className,O.className),ownerState:Y,children:T.jsx(Y.slots.baseIconButton,E({"aria-label":A.current.getLocaleText("filterPanelDeleteIconLabel"),title:A.current.getLocaleText("filterPanelDeleteIconLabel"),onClick:Ue,size:"small"},(c=Y.slotProps)==null?void 0:c.baseIconButton,{children:T.jsx(Y.slots.filterPanelDeleteIcon,{fontSize:"small"})}))})),T.jsx(Ife,E({variant:"standard",as:Y.slots.baseFormControl},le,F,{sx:E({display:se?"flex":"none",visibility:C?"visible":"hidden"},le.sx||{},F.sx||{}),className:he(ie.logicOperatorInput,le.className,F.className),ownerState:Y,children:T.jsx(Y.slots.baseSelect,E({inputProps:{"aria-label":A.current.getLocaleText("filterPanelLogicOperator")},value:w,onChange:Ke,disabled:!!x||I.length===1,native:ye},(d=Y.slotProps)==null?void 0:d.baseSelect,{children:I.map(De=>u.createElement(Y.slots.baseSelectOption,E({},ee,{native:ye,key:De.toString(),value:De.toString()}),A.current.getLocaleText(Rfe(De))))}))})),T.jsxs(kfe,E({variant:"standard",as:Y.slots.baseFormControl},le,D,{className:he(ie.columnInput,le.className,D.className),ownerState:Y,children:[T.jsx(Y.slots.baseInputLabel,E({},_e,{htmlFor:N,id:H,children:A.current.getLocaleText("filterPanelColumns")})),T.jsx(Y.slots.baseSelect,E({labelId:H,id:N,label:A.current.getLocaleText("filterPanelColumns"),value:g.field||"",onChange:Oe,native:ye},(p=Y.slotProps)==null?void 0:p.baseSelect,{children:pe.map(De=>u.createElement(Y.slots.baseSelectOption,E({},ee,{native:ye,key:De.field,value:De.field}),Yd(De)))}))]})),T.jsxs(_fe,E({variant:"standard",as:Y.slots.baseFormControl},le,L,{className:he(ie.operatorInput,le.className,L.className),ownerState:Y,children:[T.jsx(Y.slots.baseInputLabel,E({},_e,{htmlFor:W,id:K,children:A.current.getLocaleText("filterPanelOperator")})),T.jsx(Y.slots.baseSelect,E({labelId:K,label:A.current.getLocaleText("filterPanelOperator"),id:W,value:g.operator,onChange:Ye,native:ye,inputRef:de},(h=Y.slotProps)==null?void 0:h.baseSelect,{children:be==null||(m=be.filterOperators)==null?void 0:m.map(De=>u.createElement(Y.slots.baseSelectOption,E({},ee,{native:ye,key:De.value,value:De.value}),De.label||A.current.getLocaleText(`filterOperator${ue(De.value)}`)))}))]})),T.jsx($fe,E({variant:"standard",as:Y.slots.baseFormControl},le,Re,{className:he(ie.valueInput,le.className,Re.className),ownerState:Y,children:te!=null&&te.InputComponent?T.jsx(te.InputComponent,E({apiRef:A,item:g,applyValue:S,focusElementRef:re},te.InputComponentProps,ke)):null}))]}))}),Tfe=["item","applyValue","type","apiRef","focusElementRef","tabIndex","disabled","isFilterActive","clearButton","InputProps"],Ofe=500;function es(e){var t,n;const{item:r,applyValue:o,type:i,apiRef:s,focusElementRef:a,tabIndex:c,disabled:d,clearButton:p,InputProps:h}=e,m=ne(e,Tfe),g=u.useRef(),[y,v]=u.useState((t=r.value)!=null?t:""),[S,w]=u.useState(!1),C=on(),x=tt(),P=u.useCallback(_=>{const{value:I}=_.target;clearTimeout(g.current),v(String(I)),w(!0),g.current=setTimeout(()=>{o(E({},r,{value:I})),w(!1)},Ofe)},[o,r]);return u.useEffect(()=>()=>{clearTimeout(g.current)},[]),u.useEffect(()=>{var _;const I=(_=r.value)!=null?_:"";v(String(I))},[r.value]),T.jsx(x.slots.baseTextField,E({id:C,label:s.current.getLocaleText("filterPanelInputLabel"),placeholder:s.current.getLocaleText("filterPanelInputPlaceholder"),value:y,onChange:P,variant:"standard",type:i||"text",InputProps:E({},S||p?{endAdornment:S?T.jsx(x.slots.loadIcon,{fontSize:"small",color:"action"}):p}:{},{disabled:d},h,{inputProps:E({tabIndex:c},h==null?void 0:h.inputProps)}),InputLabelProps:{shrink:!0},inputRef:a},m,(n=x.slotProps)==null?void 0:n.baseTextField))}const Lfe=["item","applyValue","type","apiRef","focusElementRef","InputProps","isFilterActive","clearButton","tabIndex","disabled"],Ffe=500;function Tc(e){var t,n;const{item:r,applyValue:o,type:i,apiRef:s,focusElementRef:a,InputProps:c,clearButton:d,tabIndex:p,disabled:h}=e,m=ne(e,Lfe),g=u.useRef(),[y,v]=u.useState((t=r.value)!=null?t:""),[S,w]=u.useState(!1),C=on(),x=tt(),P=u.useCallback(_=>{const I=_.target.value;clearTimeout(g.current),v(String(I)),w(!0),g.current=setTimeout(()=>{o(E({},r,{value:I})),w(!1)},Ffe)},[o,r]);return u.useEffect(()=>()=>{clearTimeout(g.current)},[]),u.useEffect(()=>{var _;const I=(_=r.value)!=null?_:"";v(String(I))},[r.value]),T.jsx(x.slots.baseTextField,E({fullWidth:!0,id:C,label:s.current.getLocaleText("filterPanelInputLabel"),placeholder:s.current.getLocaleText("filterPanelInputPlaceholder"),value:y,onChange:P,variant:"standard",type:i||"text",InputLabelProps:{shrink:!0},inputRef:a,InputProps:E({},S||d?{endAdornment:S?T.jsx(x.slots.loadIcon,{fontSize:"small",color:"action"}):d}:{},{disabled:h},c,{inputProps:E({max:i==="datetime-local"?"9999-12-31T23:59":"9999-12-31",tabIndex:p},c==null?void 0:c.inputProps)})},m,(n=x.slotProps)==null?void 0:n.baseTextField))}const Afe=["item","applyValue","type","apiRef","focusElementRef","getOptionLabel","getOptionValue","placeholder","tabIndex","label","isFilterActive","clearButton"],Nfe=({column:{valueOptions:e,field:t},OptionComponent:n,getOptionLabel:r,getOptionValue:o,isSelectNative:i,baseSelectOptionProps:s})=>(typeof e=="function"?["",...e({field:t})]:["",...e||[]]).map(c=>{const d=o(c),p=r(c);return u.createElement(n,E({},s,{native:i,key:d,value:d}),p)}),Dfe=oe("div")({display:"flex",alignItems:"flex-end",width:"100%",["& button"]:{margin:"auto 0px 5px 5px"}});function kR(e){var t,n,r,o,i,s,a,c,d;const{item:p,applyValue:h,type:m,apiRef:g,focusElementRef:y,getOptionLabel:v,getOptionValue:S,placeholder:w,tabIndex:C,label:x,clearButton:P}=e,_=ne(e,Afe),[I,k]=u.useState((t=p.value)!=null?t:""),M=on(),O=on(),F=tt(),L=(n=(r=F.slotProps)==null||(o=r.baseSelect)==null?void 0:o.native)!=null?n:!0;let D=null;if(p.field){const N=g.current.getColumn(p.field);Oa(N)&&(D=N)}const B=S||((i=D)==null?void 0:i.getOptionValue),R=v||((s=D)==null?void 0:s.getOptionLabel),A=u.useMemo(()=>{if(D)return typeof D.valueOptions=="function"?D.valueOptions({field:D.field}):D.valueOptions},[D]),z=u.useCallback(N=>{let H=N.target.value;H=jw(H,A,B),k(String(H)),h(E({},p,{value:H}))},[A,B,h,p]);if(u.useEffect(()=>{var N;let H;if(A!==void 0){if(H=jw(p.value,A,B),H!==p.value){h(E({},p,{value:H}));return}}else H=p.value;H=(N=H)!=null?N:"",k(String(H))},[p,A,h,B]),!Oa(D)||!Oa(D))return null;const V=x!=null?x:g.current.getLocaleText("filterPanelInputLabel");return T.jsxs(Dfe,{children:[T.jsxs(F.slots.baseFormControl,{children:[T.jsx(F.slots.baseInputLabel,E({},(a=F.slotProps)==null?void 0:a.baseInputLabel,{id:O,htmlFor:M,shrink:!0,variant:"standard",children:V})),T.jsx(F.slots.baseSelect,E({id:M,label:V,labelId:O,value:I,onChange:z,variant:"standard",type:m||"text",inputProps:{tabIndex:C,ref:y,placeholder:w!=null?w:g.current.getLocaleText("filterPanelInputPlaceholder")},native:L},_,(c=F.slotProps)==null?void 0:c.baseSelect,{children:Nfe({column:D,OptionComponent:F.slots.baseSelectOption,getOptionLabel:R,getOptionValue:B,isSelectNative:L,baseSelectOptionProps:(d=F.slotProps)==null?void 0:d.baseSelectOption})}))]}),P]})}const Bfe=["item","applyValue","apiRef","focusElementRef","isFilterActive","clearButton","tabIndex","label"],zfe=oe("div")({display:"flex",alignItems:"center",width:"100%",["& button"]:{margin:"auto 0px 5px 5px"}});function jfe(e){var t,n,r,o;const{item:i,applyValue:s,apiRef:a,focusElementRef:c,clearButton:d,tabIndex:p,label:h}=e,m=ne(e,Bfe),[g,y]=u.useState(i.value||""),v=tt(),S=on(),w=on(),C=((t=v.slotProps)==null?void 0:t.baseSelect)||{},x=(n=C.native)!=null?n:!0,P=((r=v.slotProps)==null?void 0:r.baseSelectOption)||{},_=u.useCallback(k=>{const M=k.target.value;y(M),s(E({},i,{value:M}))},[s,i]);u.useEffect(()=>{y(i.value||"")},[i.value]);const I=h!=null?h:a.current.getLocaleText("filterPanelInputLabel");return T.jsxs(zfe,{children:[T.jsxs(v.slots.baseFormControl,{fullWidth:!0,children:[T.jsx(v.slots.baseInputLabel,E({},(o=v.slotProps)==null?void 0:o.baseInputLabel,{id:S,shrink:!0,variant:"standard",children:I})),T.jsxs(v.slots.baseSelect,E({labelId:S,id:w,label:I,value:g,onChange:_,variant:"standard",native:x,displayEmpty:!0,inputProps:{ref:c,tabIndex:p}},m,C,{children:[T.jsx(v.slots.baseSelectOption,E({},P,{native:x,value:"",children:a.current.getLocaleText("filterValueAny")})),T.jsx(v.slots.baseSelectOption,E({},P,{native:x,value:"true",children:a.current.getLocaleText("filterValueTrue")})),T.jsx(v.slots.baseSelectOption,E({},P,{native:x,value:"false",children:a.current.getLocaleText("filterValueFalse")}))]}))]}),d]})}const Hfe=["logicOperators","columnsSort","filterFormProps","getColumnForNewFilter","children","disableAddFilterButton","disableRemoveAllButton"],_R=e=>({field:e.field,operator:e.filterOperators[0].value,id:Math.round(Math.random()*1e5)}),Vfe=u.forwardRef(function(t,n){var r,o;const i=Dt(),s=tt(),a=Ge(i,Cr),c=Ge(i,EA),d=u.useRef(null),p=u.useRef(null),{logicOperators:h=[no.And,no.Or],columnsSort:m,filterFormProps:g,getColumnForNewFilter:y,disableAddFilterButton:v=!1,disableRemoveAllButton:S=!1}=t,w=ne(t,Hfe),C=u.useCallback(L=>{i.current.upsertFilterItem(L)},[i]),x=u.useCallback(L=>{i.current.setFilterLogicOperator(L)},[i]),P=u.useCallback(()=>{let L;if(y&&typeof y=="function"){const D=y({currentFilters:(a==null?void 0:a.items)||[],columns:c});if(D===null)return null;L=c.find(({field:B})=>B===D)}else L=c.find(D=>{var B;return(B=D.filterOperators)==null?void 0:B.length});return L?_R(L):null},[a==null?void 0:a.items,c,y]),_=u.useCallback(()=>{if(y===void 0||typeof y!="function")return P();const L=a.items.length?a.items:[P()].filter(Boolean),D=y({currentFilters:L,columns:c});if(D===null)return null;const B=c.find(({field:R})=>R===D);return B?_R(B):null},[a.items,c,y,P]),I=u.useMemo(()=>a.items.length?a.items:(p.current||(p.current=P()),p.current?[p.current]:[]),[a.items,P]),k=I.length>1,M=()=>{const L=_();L&&i.current.upsertFilterItems([...I,L])},O=u.useCallback(L=>{const D=I.length===1;i.current.deleteFilterItem(L),D&&i.current.hideFilterPanel()},[i,I.length]),F=()=>{I.length===1&&I[0].value===void 0&&(i.current.deleteFilterItem(I[0]),i.current.hideFilterPanel()),i.current.setFilterModel(E({},a,{items:[]}))};return u.useEffect(()=>{h.length>0&&a.logicOperator&&!h.includes(a.logicOperator)&&x(h[0])},[h,x,a.logicOperator]),u.useEffect(()=>{I.length>0&&d.current.focus()},[I.length]),T.jsxs(o4,E({ref:n},w,{children:[T.jsx(n4,{children:I.map((L,D)=>T.jsx(Mfe,E({item:L,applyFilterChanges:C,deleteFilter:O,hasMultipleFilters:k,showMultiFilterOperators:D>0,multiFilterOperator:a.logicOperator,disableMultiFilterOperator:D!==1,applyMultiFilterOperatorChanges:x,focusElementRef:D===I.length-1?d:null,logicOperators:h,columnsSort:m},g),L.id==null?D:L.id))}),!s.disableMultipleColumnsFiltering&&!(v&&S)?T.jsxs(r4,{children:[v?T.jsx("span",{}):T.jsx(s.slots.baseButton,E({onClick:M,startIcon:T.jsx(s.slots.filterPanelAddIcon,{})},(r=s.slotProps)==null?void 0:r.baseButton,{children:i.current.getLocaleText("filterPanelAddFilter")})),S?null:T.jsx(s.slots.baseButton,E({onClick:F,startIcon:T.jsx(s.slots.filterPanelRemoveAllIcon,{})},(o=s.slotProps)==null?void 0:o.baseButton,{children:i.current.getLocaleText("filterPanelRemoveAll")}))]}):null]}))}),Ufe=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"];function i4(e){const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,color:s,error:a,helperText:c,size:d,variant:p}=e,h=ne(e,Ufe),m={color:s,error:a,helperText:c,size:d,variant:p},[g,y]=u.useState(t.value||[]),v=on(),S=tt();u.useEffect(()=>{var C;const x=(C=t.value)!=null?C:[];y(x.map(String))},[t.value]);const w=u.useCallback((C,x)=>{y(x.map(String)),n(E({},t,{value:[...x]}))},[n,t]);return T.jsx(Dx,E({multiple:!0,freeSolo:!0,options:[],filterOptions:(C,x)=>{const{inputValue:P}=x;return P==null||P===""?[]:[P]},id:v,value:g,onChange:w,renderTags:(C,x)=>C.map((P,_)=>T.jsx(S.slots.baseChip,E({variant:"outlined",size:"small",label:P},x({index:_})))),renderInput:C=>{var x;return T.jsx(S.slots.baseTextField,E({},C,{label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:E({},C.InputLabelProps,{shrink:!0}),inputRef:i,type:r||"text"},m,(x=S.slotProps)==null?void 0:x.baseTextField))}},h))}const Wfe=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant","getOptionLabel","getOptionValue"],Gfe=BL();function Kfe(e){var t,n;const{item:r,applyValue:o,apiRef:i,focusElementRef:s,color:a,error:c,helperText:d,size:p,variant:h="standard",getOptionLabel:m,getOptionValue:g}=e,y=ne(e,Wfe),v={color:a,error:c,helperText:d,size:p,variant:h},S=on(),w=tt();let C=null;if(r.field){const F=i.current.getColumn(r.field);Oa(F)&&(C=F)}const x=g||((t=C)==null?void 0:t.getOptionValue),P=m||((n=C)==null?void 0:n.getOptionLabel),_=u.useCallback((F,L)=>x(F)===x(L),[x]),I=u.useMemo(()=>{var F;return(F=C)!=null&&F.valueOptions?typeof C.valueOptions=="function"?C.valueOptions({field:C.field}):C.valueOptions:[]},[C]),k=u.useMemo(()=>I==null?void 0:I.map(x),[I,x]),M=u.useMemo(()=>Array.isArray(r.value)?I!==void 0?r.value.map(L=>k==null?void 0:k.findIndex(D=>D===L)).filter(L=>L>=0).map(L=>I[L]):r.value:[],[r.value,I,k]);u.useEffect(()=>{(!Array.isArray(r.value)||M.length!==r.value.length)&&o(E({},r,{value:M.map(x)}))},[r,M,o,x]);const O=u.useCallback((F,L)=>{o(E({},r,{value:L.map(x)}))},[o,r,x]);return T.jsx(Dx,E({multiple:!0,options:I,isOptionEqualToValue:_,filterOptions:Gfe,id:S,value:M,onChange:O,getOptionLabel:P,renderTags:(F,L)=>F.map((D,B)=>T.jsx(w.slots.baseChip,E({variant:"outlined",size:"small",label:P(D)},L({index:B})))),renderInput:F=>{var L;return T.jsx(w.slots.baseTextField,E({},F,{label:i.current.getLocaleText("filterPanelInputLabel"),placeholder:i.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:E({},F.InputLabelProps,{shrink:!0}),inputRef:s,type:"singleSelect"},v,(L=w.slotProps)==null?void 0:L.baseTextField))}},y))}const qfe=["hideMenu","options"],Yfe=["hideMenu","options"];function Qfe(e){const t=Dt(),{hideMenu:n,options:r}=e,o=ne(e,qfe);return T.jsx(fo,E({onClick:()=>{t.current.exportDataAsCsv(r),n==null||n()}},o,{children:t.current.getLocaleText("toolbarExportCSV")}))}function Xfe(e){const t=Dt(),{hideMenu:n,options:r}=e,o=ne(e,Yfe);return T.jsx(fo,E({onClick:()=>{t.current.exportDataAsPrint(r),n==null||n()}},o,{children:t.current.getLocaleText("toolbarExportPrint")}))}const Jfe=["className","rowCount","visibleRowCount"],Zfe=e=>{const{classes:t}=e;return Me({root:["rowCount"]},Bt,t)},epe=vr("div",{name:"MuiDataGrid",slot:"RowCount",overridesResolver:(e,t)=>t.rowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2)})),tpe=u.forwardRef(function(t,n){const{className:r,rowCount:o,visibleRowCount:i}=t,s=ne(t,Jfe),a=Dt(),c=tt(),d=Zfe(c);if(o===0)return null;const p=i<o?a.current.getLocaleText("footerTotalVisibleRows")(i,o):o.toLocaleString();return T.jsxs(epe,E({ref:n,className:he(d.root,r),ownerState:c},s,{children:[a.current.getLocaleText("footerTotalRows")," ",p]}))}),npe=["className","selectedRowCount"],rpe=e=>{const{classes:t}=e;return Me({root:["selectedRowCount"]},Bt,t)},ope=vr("div",{name:"MuiDataGrid",slot:"SelectedRowCount",overridesResolver:(e,t)=>t.selectedRowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2),visibility:"hidden",width:0,height:0,[e.breakpoints.up("sm")]:{visibility:"visible",width:"auto",height:"auto"}})),ipe=u.forwardRef(function(t,n){const{className:r,selectedRowCount:o}=t,i=ne(t,npe),s=Dt(),a=tt(),c=rpe(a),d=s.current.getLocaleText("footerRowSelected")(o);return T.jsx(ope,E({ref:n,className:he(c.root,r),ownerState:a},i,{children:d}))}),spe=u.forwardRef(function(t,n){var r;const o=Dt(),i=tt(),s=Ge(o,kae),a=Ge(o,Yue),c=Ge(o,yy),d=!i.hideFooterSelectedRowCount&&a>0?T.jsx(ipe,{selectedRowCount:a}):T.jsx("div",{}),p=!i.hideFooterRowCount&&!i.pagination?T.jsx(tpe,{rowCount:s,visibleRowCount:c}):null,h=i.pagination&&!i.hideFooterPagination&&i.slots.pagination&&T.jsx(i.slots.pagination,E({},(r=i.slotProps)==null?void 0:r.pagination));return T.jsxs(sue,E({ref:n},t,{children:[d,p,h]}))});function lpe(){var e,t;const n=tt();return T.jsxs(u.Fragment,{children:[T.jsx(n.slots.preferencesPanel,E({},(e=n.slotProps)==null?void 0:e.preferencesPanel)),n.slots.toolbar&&T.jsx(n.slots.toolbar,E({},(t=n.slotProps)==null?void 0:t.toolbar))]})}const ape=u.forwardRef(function(t,n){return T.jsx(nE,E({ref:n},t,{children:T.jsx(Ka,{})}))}),cpe=u.forwardRef(function(t,n){const o=Dt().current.getLocaleText("noRowsLabel");return T.jsx(nE,E({ref:n},t,{children:o}))}),upe=oe(Ere)(({theme:e})=>({[`& .${Ma.selectLabel}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},[`& .${Ma.input}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"inline-flex"}}})),dpe=u.forwardRef(function(t,n){const r=Dt(),o=tt(),i=Ge(r,si),s=Ge(r,yy),a=u.useMemo(()=>{var g,y;return(g=(y=o.rowCount)!=null?y:s)!=null?g:0},[o.rowCount,s]),c=u.useMemo(()=>Math.floor(a/(i.pageSize||1)),[a,i.pageSize]),d=u.useCallback(g=>{const y=Number(g.target.value);r.current.setPageSize(y)},[r]),p=u.useCallback((g,y)=>{r.current.setPage(y)},[r]),m=(g=>{for(let y=0;y<o.pageSizeOptions.length;y+=1){const v=o.pageSizeOptions[y];if(typeof v=="number"){if(v===g)return!0}else if(v.value===g)return!0}return!1})(i.pageSize)?o.pageSizeOptions:[];return T.jsx(upe,E({ref:n,component:"div",count:a,page:i.page<=c?i.page:c,rowsPerPageOptions:m,rowsPerPage:i.pageSize,onPageChange:p,onRowsPerPageChange:d},r.current.getLocaleText("MuiTablePagination"),t))}),sE=(e,t)=>{let n,r;return t.pagination&&t.paginationMode==="client"?(r=oE(e),n=que(e)):(n=ia(e),n.length===0?r=null:r={firstRowIndex:0,lastRowIndex:n.length-1}),{rows:n,range:r}},ac=(e,t)=>{const n=sE(e,t);return u.useMemo(()=>({rows:n.rows,range:n.range}),[n.rows,n.range])},Hw={current:null};function Fp(e){return e.isInternal=!0,e}function Ag(e){return e!==void 0&&e.isInternal===!0}function fpe(e){return Fp((t,n)=>{const r=e(t,n);return r&&(o=>r(o.value,o.row,n,Hw.current))})}function Ap(e){return e.map(t=>E({},t,{getApplyFilterFn:fpe(t.getApplyFilterFnV7),getApplyFilterFnV7:Fp(t.getApplyFilterFnV7)}))}function s4(e){return Fp((t,n,r)=>{const o=e(t,n,r);return o&&(i=>o(i.value,i.row,n,r))})}const $R=Fp(e=>{if(!e)return null;const t=new RegExp(Om(e),"i");return(n,r,o,i)=>{const s=i.current.getRowFormattedValue(r,o);return s!=null?t.test(s.toString()):!1}}),ppe=(e=!1)=>Ap([{value:"contains",getApplyFilterFnV7:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(Om(n),"i");return o=>o!=null?r.test(String(o)):!1},InputComponent:es},{value:"equals",getApplyFilterFnV7:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return o=>o!=null?r.compare(n,o.toString())===0:!1},InputComponent:es},{value:"startsWith",getApplyFilterFnV7:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`^${Om(n)}.*$`,"i");return o=>o!=null?r.test(o.toString()):!1},InputComponent:es},{value:"endsWith",getApplyFilterFnV7:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`.*${Om(n)}$`,"i");return o=>o!=null?r.test(o.toString()):!1},InputComponent:es},{value:"isEmpty",getApplyFilterFnV7:()=>t=>t===""||t==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFnV7:()=>t=>t!==""&&t!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFnV7:t=>{if(!Array.isArray(t.value)||t.value.length===0)return null;const n=e?t.value:t.value.map(o=>o.trim()),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return o=>o!=null?n.some(i=>r.compare(i,o.toString()||"")===0):!1},InputComponent:i4}]),Xl={width:100,minWidth:50,maxWidth:1/0,hideable:!0,sortable:!0,resizable:!0,filterable:!0,groupable:!0,pinnable:!0,aggregable:!0,editable:!1,sortComparator:rde,type:"string",align:"left",filterOperators:ppe(),renderEditCell:$ce,getApplyQuickFilterFn:s4($R),getApplyQuickFilterFnV7:$R},hpe=()=>Ap([{value:"is",getApplyFilterFnV7:e=>{if(!e.value)return null;const t=e.value==="true";return n=>!!n===t},InputComponent:jfe}]);function mpe({value:e,api:t}){return e?t.getLocaleText("booleanCellTrueLabel"):t.getLocaleText("booleanCellFalseLabel")}const gpe=e=>{switch(e.toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case"null":case"undefined":return!1;default:return}},l4=E({},Xl,{type:"boolean",align:"center",headerAlign:"center",renderCell:gce,renderEditCell:wce,sortComparator:ZA,valueFormatter:mpe,filterOperators:hpe(),getApplyQuickFilterFn:void 0,getApplyQuickFilterFnV7:void 0,aggregable:!1,pastedValueParser:e=>gpe(e)}),ml="__check__",Np=E({},l4,{field:ml,type:"checkboxSelection",width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:void 0,getApplyQuickFilterFnV7:void 0,valueGetter:e=>Fg(e.api.state,e.api.instanceId)[e.id]!==void 0,renderHeader:e=>T.jsx(hde,E({},e)),renderCell:e=>T.jsx(dde,E({},e))}),Sy="actions",vpe=E({},Xl,{sortable:!1,filterable:!1,aggregable:!1,width:100,align:"center",headerAlign:"center",headerName:"",disableColumnMenu:!0,disableExport:!0,renderCell:qce,getApplyQuickFilterFn:void 0,getApplyQuickFilterFnV7:void 0}),lE="__detail_panel_toggle__",Hr=e=>e.editRows,ype=["selected","rowId","row","index","style","position","rowHeight","className","visibleColumns","renderedColumns","containerWidth","firstColumnToRender","lastColumnToRender","isLastVisible","focusedCell","tabbableCell","onClick","onDoubleClick","onMouseEnter","onMouseLeave"],bpe=e=>{const{editable:t,editing:n,selected:r,isLastVisible:o,rowHeight:i,classes:s}=e;return Me({root:["row",r&&"selected",t&&"row--editable",n&&"row--editing",o&&"row--lastVisible",i==="auto"&&"row--dynamicHeight"]},Bt,s)};function wpe({width:e}){if(!e)return null;const t={width:e};return T.jsx("div",{className:`${X.cell} ${X.withBorderColor}`,style:t})}const Cpe=u.forwardRef(function(t,n){const{selected:r,rowId:o,row:i,index:s,style:a,position:c,rowHeight:d,className:p,renderedColumns:h,containerWidth:m,firstColumnToRender:g,isLastVisible:y=!1,onClick:v,onDoubleClick:S,onMouseEnter:w,onMouseLeave:C}=t,x=ne(t,ype),P=Dt(),_=u.useRef(null),I=tt(),k=ac(P,I),M=Ge(P,YS),O=Ge(P,ni),F=Ge(P,vy),L=Ge(P,Op),D=Ge(P,Hr),B=Vt(_,n),R=s+L+2,A={selected:r,isLastVisible:y,classes:I.classes,editing:P.current.getRowMode(o)===mn.Edit,editable:I.editMode===vs.Row,rowHeight:d},z=bpe(A);u.useLayoutEffect(()=>{d==="auto"&&_.current&&typeof ResizeObserver=="undefined"&&P.current.unstable_storeRowHeightMeasurement(o,_.current.clientHeight,c)},[P,d,o,c]),u.useLayoutEffect(()=>{if(k.range){const Ye=P.current.getRowIndexRelativeToVisibleRows(o);Ye!=null&&P.current.unstable_setLastMeasuredRowIndex(Ye)}const be=_.current;if(!be||d!=="auto"||typeof ResizeObserver=="undefined")return;const Oe=new ResizeObserver(Ye=>{const[Ke]=Ye,Ue=Ke.borderBoxSize&&Ke.borderBoxSize.length>0?Ke.borderBoxSize[0].blockSize:Ke.contentRect.height;P.current.unstable_storeRowHeightMeasurement(o,Ue,c)});return Oe.observe(be),()=>Oe.disconnect()},[P,k.range,s,d,o,c]);const V=u.useCallback((be,te)=>Oe=>{Oe.target.nodeType===1&&!Oe.currentTarget.contains(Oe.target)||P.current.getRow(o)&&(P.current.publishEvent(be,P.current.getRowParams(o),Oe),te&&te(Oe))},[P,o]),N=u.useCallback(be=>{const te=ece(be.target,X.cell),Oe=te==null?void 0:te.getAttribute("data-field");Oe&&(Oe===Np.field||Oe===lE||Oe==="__reorder__"||P.current.getCellMode(o,Oe)===rn.Edit||P.current.getColumn(Oe).type===Sy)||V("rowClick",v)(be)},[P,v,V,o]),{slots:H,slotProps:W,disableColumnReorder:K}=I,Y=H.cell===zw?zw:uce,ie=I.rowReordering,re=(be,te)=>{var Oe,Ye;const Ke=K&&be.disableReorder||!ie&&!!O.length&&F>1&&Object.keys(D).length>0,Ue=(Oe=(Ye=D[o])==null?void 0:Ye[be.field])!=null?Oe:null;return T.jsx(Y,E({column:be,width:te.width,rowId:o,height:d,showRightBorder:te.showRightBorder,align:be.align||"left",colIndex:te.indexRelativeToAllColumns,colSpan:te.colSpan,disableDragEvents:Ke,editCellState:Ue},W==null?void 0:W.cell),be.field)},de=Ge(P,()=>E({},P.current.unstable_getRowInternalSizes(o)),KS);let se=d;if(se==="auto"&&de){let be=0;const te=Object.entries(de).reduce((Oe,[Ye,Ke])=>/^base[A-Z]/.test(Ye)?(be+=1,Ke>Oe?Ke:Oe):Oe,0);te>0&&be>1&&(se=te)}const le=E({},a,{maxHeight:d==="auto"?"none":d,minHeight:se});if(de!=null&&de.spacingTop){const be=I.rowSpacingType==="border"?"borderTopWidth":"marginTop";le[be]=de.spacingTop}if(de!=null&&de.spacingBottom){const be=I.rowSpacingType==="border"?"borderBottomWidth":"marginBottom";let te=le[be];typeof te!="number"&&(te=parseInt(te||"0",10)),te+=de.spacingBottom,le[be]=te}const Ee=P.current.unstable_applyPipeProcessors("rowClassName",[],o);if(typeof I.getRowClassName=="function"){var ye;const be=s-(((ye=k.range)==null?void 0:ye.firstRowIndex)||0),te=E({},P.current.getRowParams(o),{isFirstVisible:be===0,isLastVisible:be===k.rows.length-1,indexRelativeToCurrentPage:be});Ee.push(I.getRowClassName(te))}const _e=jue(1e4,20,80),ee=P.current.getRowNode(o);if(!ee)return null;const ke=ee.type,Re=[];for(let be=0;be<h.length;be+=1){const te=h[be],Oe=g+be,Ye=P.current.unstable_getCellColSpanInfo(o,Oe);if(Ye&&!Ye.spannedByColSpan)if(ke!=="skeletonRow"){const{colSpan:Ke,width:Ue}=Ye.cellProps,De={width:Ue,colSpan:Ke,showRightBorder:I.showCellVerticalBorder,indexRelativeToAllColumns:Oe};Re.push(re(te,De))}else{const{width:Ke}=Ye.cellProps,Ue=Math.round(_e());Re.push(T.jsx(H.skeletonCell,{width:Ke,contentWidth:Ue,field:te.field,align:te.align},te.field))}}const Pe=m-M,pe=i?{onClick:N,onDoubleClick:V("rowDoubleClick",S),onMouseEnter:V("rowMouseEnter",w),onMouseLeave:V("rowMouseLeave",C)}:null;return T.jsxs("div",E({ref:B,"data-id":o,"data-rowindex":s,role:"row",className:he(...Ee,z.root,p),"aria-rowindex":R,"aria-selected":r,style:le},pe,x,{children:[Re,Pe>0&&T.jsx(wpe,{width:Pe})]}))}),xpe=xy(Cpe);function Spe({privateApiRef:e,props:t,children:n}){const r=u.useRef(e.current.getPublicApi());return T.jsx(CA.Provider,{value:t,children:T.jsx(xA.Provider,{value:e,children:T.jsx(wA.Provider,{value:r,children:n})})})}const Epe=Bue()&&window.localStorage.getItem("DEBUG")!=null,af=()=>{},Ppe={debug:af,info:af,warn:af,error:af},RR=["debug","info","warn","error"];function MR(e,t,n=console){const r=RR.indexOf(t);if(r===-1)throw new Error(`MUI: Log level ${t} not recognized.`);return RR.reduce((i,s,a)=>(a>=r?i[s]=(...c)=>{const[d,...p]=c;n[s](`MUI: ${e} - ${d}`,...p)}:i[s]=af,i),{})}const Ipe=(e,t)=>{const n=u.useCallback(r=>Epe?MR(r,"debug",t.logger):t.logLevel?MR(r,t.logLevel.toString(),t.logger):Ppe,[t.logLevel,t.logger]);Ft(e,{getLogger:n},"private")};class aE{static create(t){return new aE(t)}constructor(t){this.value=void 0,this.listeners=void 0,this.subscribe=n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}),this.getSnapshot=()=>this.value,this.update=n=>{this.value=n,this.listeners.forEach(r=>r(n))},this.value=t,this.listeners=new Set}}class kpe{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(t,n,r={}){let o=this.events[t];o||(o={highPriority:new Map,regular:new Map},this.events[t]=o),r.isFirst?o.highPriority.set(n,!0):o.regular.set(n,!0)}removeListener(t,n){this.events[t]&&(this.events[t].regular.delete(n),this.events[t].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(t,...n){const r=this.events[t];if(!r)return;const o=Array.from(r.highPriority.keys()),i=Array.from(r.regular.keys());for(let s=o.length-1;s>=0;s-=1){const a=o[s];r.highPriority.has(a)&&a.apply(this,n)}for(let s=0;s<i.length;s+=1){const a=i[s];r.regular.has(a)&&a.apply(this,n)}}once(t,n){const r=this;this.on(t,function o(...i){r.removeListener(t,o),n.apply(r,i)})}}const a4=Symbol("mui.api_private"),_pe=e=>e.isPropagationStopped!==void 0;let TR=0;function $pe(e){var t;const n=(t=e.current)==null?void 0:t[a4];if(n)return n;const r={},o={state:r,store:aE.create(r),instanceId:{id:TR}};return TR+=1,o.getPublicApi=()=>e.current,o.register=(i,s)=>{Object.keys(s).forEach(a=>{const c=s[a],d=o[a];if((d==null?void 0:d.spying)===!0?d.target=c:o[a]=c,i==="public"){const p=e.current,h=p[a];(h==null?void 0:h.spying)===!0?h.target=c:p[a]=c}})},o.register("private",{caches:{},eventManager:new kpe}),o}function Rpe(e){return{get state(){return e.current.state},get store(){return e.current.store},get instanceId(){return e.current.instanceId},[a4]:e.current}}function Mpe(e,t){const n=u.useRef(),r=u.useRef();r.current||(r.current=$pe(n)),n.current||(n.current=Rpe(r));const o=u.useCallback((...s)=>{const[a,c,d={}]=s;if(d.defaultMuiPrevented=!1,_pe(d)&&d.isPropagationStopped())return;const p=t.signature===fs.DataGridPro?{api:r.current.getPublicApi()}:{};r.current.eventManager.emit(a,c,d,p)},[r,t.signature]),i=u.useCallback((s,a,c)=>{r.current.eventManager.on(s,a,c);const d=r.current;return()=>{d.eventManager.removeListener(s,a)}},[r]);return Ft(r,{subscribeEvent:i,publishEvent:o},"public"),u.useImperativeHandle(e,()=>n.current,[n]),u.useEffect(()=>{const s=r.current;return()=>{s.publishEvent("unmount")}},[r]),r}const Tpe=(e,t)=>{const n=u.useCallback(r=>{if(t.localeText[r]==null)throw new Error(`Missing translation for key ${r}.`);return t.localeText[r]},[t.localeText]);e.current.register("public",{getLocaleText:n})};function up(e){return up=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},up(e)}function Ope(e,t){if(up(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(up(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dp(e){var t=Ope(e,"string");return up(t)==="symbol"?t:String(t)}const Lpe=e=>{const t=u.useRef({}),n=u.useRef(!1),r=u.useCallback(p=>{n.current||!p||(n.current=!0,Object.values(p.appliers).forEach(h=>{h()}),n.current=!1)},[]),o=u.useCallback((p,h,m)=>{t.current[p]||(t.current[p]={processors:new Map,appliers:{}});const g=t.current[p];return g.processors.get(h)!==m&&(g.processors.set(h,m),r(g)),()=>{t.current[p].processors.set(h,null)}},[r]),i=u.useCallback((p,h,m)=>(t.current[p]||(t.current[p]={processors:new Map,appliers:{}}),t.current[p].appliers[h]=m,()=>{const g=t.current[p].appliers,y=ne(g,[h].map(dp));t.current[p].appliers=y}),[]),s=u.useCallback(p=>{const h=t.current[p];r(h)},[r]),a=u.useCallback((...p)=>{const[h,m,g]=p;return t.current[h]?Array.from(t.current[h].processors.values()).reduce((v,S)=>S?S(v,g):v,m):m},[]),c={registerPipeProcessor:o,registerPipeApplier:i,requestPipeProcessorsApplication:s},d={unstable_applyPipeProcessors:a};Ft(e,c,"private"),Ft(e,d,"public")},ir=(e,t,n)=>{const r=u.useRef(),o=u.useRef(`mui-${Math.round(Math.random()*1e9)}`),i=u.useCallback(()=>{r.current=e.current.registerPipeProcessor(t,o.current,n)},[e,n,t]);Lp(()=>{i()});const s=u.useRef(!0);u.useEffect(()=>(s.current?s.current=!1:i(),()=>{r.current&&(r.current(),r.current=null)}),[i])},cE=(e,t,n)=>{const r=u.useRef(),o=u.useRef(`mui-${Math.round(Math.random()*1e9)}`),i=u.useCallback(()=>{r.current=e.current.registerPipeApplier(t,o.current,n)},[e,n,t]);Lp(()=>{i()});const s=u.useRef(!0);u.useEffect(()=>(s.current?s.current=!1:i(),()=>{r.current&&(r.current(),r.current=null)}),[i])},Ng=(e,t,n,r)=>{const o=u.useCallback(()=>{e.current.registerStrategyProcessor(t,n,r)},[e,r,n,t]);Lp(()=>{o()});const i=u.useRef(!0);u.useEffect(()=>{i.current?i.current=!1:o()},[o])},Ja="none",OR={rowTreeCreation:"rowTree",filtering:"rowTree",sorting:"rowTree",visibleRowsLookupCreation:"rowTree"},Fpe=e=>{const t=u.useRef(new Map),n=u.useRef({}),r=u.useCallback((c,d,p)=>{const h=()=>{const y=n.current[d],v=ne(y,[c].map(dp));n.current[d]=v};n.current[d]||(n.current[d]={});const m=n.current[d],g=m[c];return m[c]=p,!g||g===p||c===e.current.getActiveStrategy(OR[d])&&e.current.publishEvent("activeStrategyProcessorChange",d),h},[e]),o=u.useCallback((c,d)=>{const p=e.current.getActiveStrategy(OR[c]);if(p==null)throw new Error("Can't apply a strategy processor before defining an active strategy");const h=n.current[c];if(!h||!h[p])throw new Error(`No processor found for processor "${c}" on strategy "${p}"`);const m=h[p];return m(d)},[e]),i=u.useCallback(c=>{var d;const h=Array.from(t.current.entries()).find(([,m])=>m.group!==c?!1:m.isAvailable());return(d=h==null?void 0:h[0])!=null?d:Ja},[]),s=u.useCallback((c,d,p)=>{t.current.set(d,{group:c,isAvailable:p}),e.current.publishEvent("strategyAvailabilityChange")},[e]);Ft(e,{registerStrategyProcessor:r,applyStrategyProcessor:o,getActiveStrategy:i,setStrategyAvailability:s},"private")},Ape=(e,t)=>{const n=u.useRef({}),[,r]=u.useState(),o=u.useCallback(p=>{n.current[p.stateId]=p},[]),i=u.useCallback((p,h)=>{let m;if(WA(p)?m=p(e.current.state):m=p,e.current.state===m)return!1;let g=!1;const y=[];if(Object.keys(n.current).forEach(v=>{const S=n.current[v],w=S.stateSelector(e.current.state,e.current.instanceId),C=S.stateSelector(m,e.current.instanceId);C!==w&&(y.push({stateId:S.stateId,hasPropChanged:C!==S.propModel}),S.propModel!==void 0&&C!==S.propModel&&(g=!0))}),y.length>1)throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${y[0].stateId}, therefore, you're not allowed to update ${y.map(v=>v.stateId).join(", ")} in the same transaction.`);if(g||(e.current.state=m,e.current.publishEvent&&e.current.publishEvent("stateChange",m),e.current.store.update(m)),y.length===1){const{stateId:v,hasPropChanged:S}=y[0],w=n.current[v],C=w.stateSelector(m,e.current.instanceId);if(w.propOnChange&&S){const x=t.signature===fs.DataGridPro?{api:e.current,reason:h}:{reason:h};w.propOnChange(C,x)}g||e.current.publishEvent(w.changeEvent,C,{reason:h})}return!g},[e,t.signature]),s=u.useCallback((p,h,m)=>e.current.setState(g=>E({},g,{[p]:h(g[p])}),m),[e]),a=u.useCallback(()=>r(()=>e.current.state),[e]),c={setState:i,forceUpdate:a},d={updateControlState:s,registerControlState:o};Ft(e,c,"public"),Ft(e,d,"private")},Npe=(e,t)=>{const n=Mpe(e,t);return Ipe(n,t),Ape(n,t),Lpe(n),Fpe(n),Tpe(n,t),n},Co=(e,t,n)=>{const r=u.useRef(!1);r.current||(t.current.state=e(t.current.state,n,t),r.current=!0)},Dpe=/(\d+)-(\d+)-(\d+)/,Bpe=/(\d+)-(\d+)-(\d+)T(\d+):(\d+)/;function Oc(e,t,n,r){if(!e.value)return null;const[o,i,s,a,c]=e.value.match(n?Bpe:Dpe).slice(1).map(Number),d=new Date(o,i-1,s,a||0,c||0).getTime();return p=>{if(!p)return!1;if(r)return t(p.getTime(),d);const m=new Date(p).setHours(n?p.getHours():0,n?p.getMinutes():0,0,0);return t(m,d)}}const c4=e=>Ap([{value:"is",getApplyFilterFnV7:t=>Oc(t,(n,r)=>n===r,e),InputComponent:Tc,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"not",getApplyFilterFnV7:t=>Oc(t,(n,r)=>n!==r,e),InputComponent:Tc,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"after",getApplyFilterFnV7:t=>Oc(t,(n,r)=>n>r,e),InputComponent:Tc,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFnV7:t=>Oc(t,(n,r)=>n>=r,e),InputComponent:Tc,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"before",getApplyFilterFnV7:t=>Oc(t,(n,r)=>n<r,e,!e),InputComponent:Tc,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrBefore",getApplyFilterFnV7:t=>Oc(t,(n,r)=>n<=r,e),InputComponent:Tc,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFnV7:()=>t=>t==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFnV7:()=>t=>t!=null,requiresFilterValue:!1}]);function u4({value:e,columnType:t,rowId:n,field:r}){if(!(e instanceof Date))throw new Error([`MUI: \`${t}\` column type only accepts \`Date\` objects as values.`,"Use `valueGetter` to transform the value into a `Date` object.",`Row ID: ${n}, field: "${r}".`].join(`
|
|
333
|
+
`))}function zpe({value:e,field:t,id:n}){return e?(u4({value:e,columnType:"date",rowId:n,field:t}),e.toLocaleDateString()):""}function jpe({value:e,field:t,id:n}){return e?(u4({value:e,columnType:"dateTime",rowId:n,field:t}),e.toLocaleString()):""}const Hpe=E({},Xl,{type:"date",sortComparator:e4,valueFormatter:zpe,filterOperators:c4(),renderEditCell:NA,getApplyQuickFilterFn:void 0,getApplyQuickFilterFnV7:void 0,pastedValueParser:e=>new Date(e)}),Vpe=E({},Xl,{type:"dateTime",sortComparator:e4,valueFormatter:jpe,filterOperators:c4(!0),renderEditCell:NA,getApplyQuickFilterFn:void 0,getApplyQuickFilterFnV7:void 0,pastedValueParser:e=>new Date(e)}),bl=e=>e==null?null:Number(e),LR=Fp(e=>e==null||Number.isNaN(e)||e===""?null:t=>bl(t)===bl(e)),Upe=()=>Ap([{value:"=",getApplyFilterFnV7:e=>e.value==null||Number.isNaN(e.value)?null:t=>bl(t)===e.value,InputComponent:es,InputComponentProps:{type:"number"}},{value:"!=",getApplyFilterFnV7:e=>e.value==null||Number.isNaN(e.value)?null:t=>bl(t)!==e.value,InputComponent:es,InputComponentProps:{type:"number"}},{value:">",getApplyFilterFnV7:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:bl(t)>e.value,InputComponent:es,InputComponentProps:{type:"number"}},{value:">=",getApplyFilterFnV7:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:bl(t)>=e.value,InputComponent:es,InputComponentProps:{type:"number"}},{value:"<",getApplyFilterFnV7:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:bl(t)<e.value,InputComponent:es,InputComponentProps:{type:"number"}},{value:"<=",getApplyFilterFnV7:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:bl(t)<=e.value,InputComponent:es,InputComponentProps:{type:"number"}},{value:"isEmpty",getApplyFilterFnV7:()=>e=>e==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFnV7:()=>e=>e!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFnV7:e=>!Array.isArray(e.value)||e.value.length===0?null:t=>t!=null&&e.value.includes(Number(t)),InputComponent:i4,InputComponentProps:{type:"number"}}]),Wpe=E({},Xl,{type:"number",align:"right",headerAlign:"right",sortComparator:ZA,valueParser:e=>e===""?null:Number(e),valueFormatter:({value:e})=>Due(e)?e.toLocaleString():e||"",filterOperators:Upe(),getApplyQuickFilterFn:s4(LR),getApplyQuickFilterFnV7:LR}),Lc=e=>e==null||!rE(e)?e:e.value,Gpe=()=>Ap([{value:"is",getApplyFilterFnV7:e=>e.value==null||e.value===""?null:t=>Lc(t)===Lc(e.value),InputComponent:kR},{value:"not",getApplyFilterFnV7:e=>e.value==null||e.value===""?null:t=>Lc(t)!==Lc(e.value),InputComponent:kR},{value:"isAnyOf",getApplyFilterFnV7:e=>{if(!Array.isArray(e.value)||e.value.length===0)return null;const t=e.value.map(Lc);return n=>t.includes(Lc(n))},InputComponent:Kfe}]),Kpe=e=>typeof e[0]=="object",qpe=e=>rE(e)?e.value:e,Ype=e=>rE(e)?e.label:String(e),Qpe=E({},Xl,{type:"singleSelect",getOptionLabel:Ype,getOptionValue:qpe,valueFormatter(e){const{id:t,field:n,value:r,api:o}=e,i=e.api.getColumn(n);if(!Oa(i))return"";let s;if(typeof i.valueOptions=="function"?s=i.valueOptions({id:t,row:t?o.getRow(t):null,field:n}):s=i.valueOptions,r==null)return"";if(!s)return r;if(!Kpe(s))return i.getOptionLabel(r);const a=s.find(c=>i.getOptionValue(c)===r);return a?i.getOptionLabel(a):""},renderEditCell:zce,filterOperators:Gpe(),pastedValueParser:(e,t)=>{const n=t.colDef,r=n.valueOptions,o=typeof r=="function"?r({field:n.field}):r||[],i=n.getOptionValue;if(o.find(a=>i(a)===e))return e}}),d4="__default__",Xpe=()=>({string:Xl,number:Wpe,date:Hpe,dateTime:Vpe,boolean:l4,singleSelect:Qpe,[Sy]:vpe,[d4]:Xl});function Vw(e,t){if(typeof e=="string"){const n=e.replace(/"/g,'""');return[t,`
|
|
334
|
+
`,"\r"].some(r=>n.includes(r))?`"${n}"`:n}return e}const f4=(e,t)=>{const{delimiterCharacter:n,ignoreValueFormatter:r}=t;let o;if(r){var i;const a=e.colDef.type;if(a==="number")o=String(e.value);else if(a==="date"||a==="dateTime"){var s;o=(s=e.value)==null?void 0:s.toISOString()}else typeof((i=e.value)==null?void 0:i.toString)=="function"?o=e.value.toString():o=e.value}else o=e.formattedValue;return Vw(o,n)};ws(["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."]);class Uw{constructor(t){this.options=void 0,this.rowString="",this.isEmpty=!0,this.options=t}addValue(t){this.isEmpty||(this.rowString+=this.options.delimiterCharacter),t==null?this.rowString+="":typeof this.options.sanitizeCellValue=="function"?this.rowString+=this.options.sanitizeCellValue(t,this.options.delimiterCharacter):this.rowString+=t,this.isEmpty=!1}getRowString(){return this.rowString}}const Jpe=({id:e,columns:t,getCellParams:n,delimiterCharacter:r,ignoreValueFormatter:o})=>{const i=new Uw({delimiterCharacter:r});return t.forEach(s=>{const a=n(e,s.field);i.addValue(f4(a,{delimiterCharacter:r,ignoreValueFormatter:o}))}),i.getRowString()};function Zpe(e){const{columns:t,rowIds:n,delimiterCharacter:r,includeHeaders:o,includeColumnGroupsHeaders:i,ignoreValueFormatter:s,apiRef:a}=e,c=n.reduce((g,y)=>`${g}${Jpe({id:y,columns:t,getCellParams:a.current.getCellParams,delimiterCharacter:r,ignoreValueFormatter:s})}\r
|
|
335
335
|
`,"").trim();if(!o)return c;const d=t.filter(g=>g.field!==Np.field),p=[];if(i){const g=a.current.unstable_getAllGroupDetails();let y=0;const v=d.reduce((S,w)=>{const C=a.current.unstable_getColumnGroupPath(w.field);return S[w.field]=C,y=Math.max(y,C.length),S},{});for(let S=0;S<y;S+=1){const w=new Uw({delimiterCharacter:r,sanitizeCellValue:Vw});p.push(w),d.forEach(C=>{const x=(v[C.field]||[])[S],P=g[x];w.addValue(P?P.headerName||P.groupId:"")})}}const h=new Uw({delimiterCharacter:r,sanitizeCellValue:Vw});return d.forEach(g=>{h.addValue(g.headerName||g.field)}),p.push(h),`${`${p.map(g=>g.getRowString()).join(`\r
|
|
336
336
|
`)}\r
|
|
337
|
-
`}${c}`.trim()}function FR(e){const t=document.createElement("span");t.style.whiteSpace="pre",t.style.userSelect="all",t.style.opacity="0px",t.textContent=e,document.body.appendChild(t);const n=document.createRange();n.selectNode(t);const r=window.getSelection();r.removeAllRanges(),r.addRange(n);try{document.execCommand("copy")}finally{document.body.removeChild(t)}}function Jpe(e){navigator.clipboard?navigator.clipboard.writeText(e).catch(()=>{FR(e)}):FR(e)}function Zpe(e){var t;return!!((t=window.getSelection())!=null&&t.toString()||e&&(e.selectionEnd||0)-(e.selectionStart||0)>0)}const ehe=(e,t)=>{const n=t.unstable_ignoreValueFormatterDuringExport,r=(typeof n=="object"?n==null?void 0:n.clipboardExport:n)||!1,o=t.clipboardCopyCellDelimiter,i=u.useCallback(s=>{if(!((s.ctrlKey||s.metaKey)&&s.key==="c")||Zpe(s.target))return;let a="";if(e.current.getSelectedRows().size>0)a=e.current.getDataAsCsv({includeHeaders:!1,delimiter:o});else{const d=ii(e);if(d){const p=e.current.getCellParams(d.id,d.field);a=f4(p,{delimiterCharacter:o,ignoreValueFormatter:r})}}a=e.current.unstable_applyPipeProcessors("clipboardCopy",a),a&&(Jpe(a),e.current.publishEvent("clipboardCopy",a))},[e,r,o]);zue(e,e.current.rootElementRef,"keydown",i),xn(e,"clipboardCopy",t.onClipboardCopy)},the=e=>E({},e,{columnMenu:{open:!1}}),nhe=e=>{const t=Ar(e,"useGridColumnMenu"),n=u.useCallback(s=>{e.current.setState(c=>c.columnMenu.open&&c.columnMenu.field===s?c:(t.debug("Opening Column Menu"),E({},c,{columnMenu:{open:!0,field:s}})))&&(e.current.hidePreferences(),e.current.forceUpdate())},[e,t]),r=u.useCallback(()=>{const s=Bw(e.current.state);if(s.field){const c=id(e),d=Li(e),p=zs(e);let h=s.field;if(c[h]||(h=p[0]),d[h]===!1){const m=p.filter(y=>y===h?!0:d[y]!==!1),g=m.indexOf(h);h=m[g+1]||m[g-1]}e.current.setColumnHeaderFocus(h)}e.current.setState(c=>!c.columnMenu.open&&c.columnMenu.field===void 0?c:(t.debug("Hiding Column Menu"),E({},c,{columnMenu:E({},c.columnMenu,{open:!1,field:void 0})})))&&e.current.forceUpdate()},[e,t]),o=u.useCallback(s=>{t.debug("Toggle Column Menu");const a=Bw(e.current.state);!a.open||a.field!==s?n(s):r()},[e,t,n,r]);Ft(e,{showColumnMenu:n,hideColumnMenu:r,toggleColumnMenu:o},"public"),ot(e,"columnResizeStart",r),ot(e,"virtualScrollerWheel",e.current.hideColumnMenu),ot(e,"virtualScrollerTouchMove",e.current.hideColumnMenu)},p4=["maxWidth","minWidth","width","flex"];function rhe({initialFreeSpace:e,totalFlexUnits:t,flexColumns:n}){const r=new Set(n.map(s=>s.field)),o={all:{},frozenFields:[],freeze:s=>{const a=o.all[s];a&&a.frozen!==!0&&(o.all[s].frozen=!0,o.frozenFields.push(s))}};function i(){if(o.frozenFields.length===r.size)return;const s={min:{},max:{}};let a=e,c=t,d=0;o.frozenFields.forEach(p=>{a-=o.all[p].computedWidth,c-=o.all[p].flex});for(let p=0;p<n.length;p+=1){const h=n[p];if(o.all[h.field]&&o.all[h.field].frozen===!0)continue;let g=a/c*h.flex;g<h.minWidth?(d+=h.minWidth-g,g=h.minWidth,s.min[h.field]=!0):g>h.maxWidth&&(d+=h.maxWidth-g,g=h.maxWidth,s.max[h.field]=!0),o.all[h.field]={frozen:!1,computedWidth:g,flex:h.flex}}d<0?Object.keys(s.max).forEach(p=>{o.freeze(p)}):d>0?Object.keys(s.min).forEach(p=>{o.freeze(p)}):n.forEach(({field:p})=>{o.freeze(p)}),i()}return i(),o.all}const h4=(e,t)=>{const n={};let r=0,o=0;const i=[];e.orderedFields.forEach(a=>{const c=E({},e.lookup[a]);if(e.columnVisibilityModel[a]===!1)c.computedWidth=0;else{let d;c.flex&&c.flex>0?(r+=c.flex,d=0,i.push(c)):d=Vu(c.width,c.minWidth,c.maxWidth),o+=d,c.computedWidth=d}n[a]=c});const s=Math.max(t-o,0);if(r>0&&t>0){const a=rhe({initialFreeSpace:s,totalFlexUnits:r,flexColumns:i});Object.keys(a).forEach(c=>{n[c].computedWidth=a[c].computedWidth})}return E({},e,{lookup:n})},ohe=(e,t)=>{if(!t)return e;const{orderedFields:n=[],dimensions:r={}}=t,o=Object.keys(r);if(o.length===0&&n.length===0)return e;const i={},s=[];for(let p=0;p<n.length;p+=1){const h=n[p];e.lookup[h]&&(i[h]=!0,s.push(h))}const a=s.length===0?e.orderedFields:[...s,...e.orderedFields.filter(p=>!i[p])],c=E({},e.lookup);for(let p=0;p<o.length;p+=1){const h=o[p],m=E({},c[h],{hasBeenResized:!0});Object.entries(r[h]).forEach(([g,y])=>{m[g]=y===-1?1/0:y}),c[h]=m}return E({},e,{orderedFields:a,lookup:c})},Vc=({apiRef:e,columnsToUpsert:t,initialState:n,columnTypes:r,columnVisibilityModel:o=Li(e),keepOnlyColumnsToUpsert:i=!1})=>{var s,a,c,d;const p=!e.current.state.columns;let h;if(p)h={orderedFields:[],lookup:{},columnVisibilityModel:o};else{const v=ju(e.current.state);h={orderedFields:i?[]:[...v.orderedFields],lookup:E({},v.lookup),columnVisibilityModel:o}}let m={};i&&!p&&(m=Object.keys(h.lookup).reduce((v,S)=>E({},v,{[S]:!1}),{})),t.forEach(v=>{const{field:S}=v;m[S]=!0;let w=h.lookup[S];if(w==null){let x=r[d4];v.type&&r[v.type]&&(x=r[v.type]),w=E({},x,{field:S,hasBeenResized:!1}),h.orderedFields.push(S)}else i&&h.orderedFields.push(S);let C=w.hasBeenResized;p4.forEach(x=>{v[x]!==void 0&&(C=!0,v[x]===-1&&(v[x]=1/0))}),h.lookup[S]=E({},w,v,{hasBeenResized:C})}),i&&!p&&Object.keys(h.lookup).forEach(v=>{m[v]||delete h.lookup[v]});const g=e.current.unstable_applyPipeProcessors("hydrateColumns",h),y=ohe(g,n);return h4(y,(s=(a=(c=e.current).getRootDimensions)==null||(d=a.call(c))==null?void 0:d.viewportInnerSize.width)!=null?s:0)},AR=e=>t=>E({},t,{columns:e});function Ww({firstColumnToRender:e,apiRef:t,firstRowToRender:n,lastRowToRender:r,visibleRows:o}){let i=e;for(let s=n;s<r;s+=1)if(o[s]){const c=o[s].id,d=t.current.unstable_getCellColSpanInfo(c,e);d&&d.spannedByColSpan&&(i=d.leftVisibleCellIndex)}return i}function ihe({firstColumnIndex:e,minColumnIndex:t,columnBuffer:n,firstRowToRender:r,lastRowToRender:o,apiRef:i,visibleRows:s}){const a=Math.max(e-n,t);return Ww({firstColumnToRender:a,apiRef:i,firstRowToRender:r,lastRowToRender:o,visibleRows:s})}function uE(e,t){const n=ld(e),r=Op(e);return Math.floor(t*n)*((r!=null?r:0)+1)}const m4=Ype(),she=(e,t,n)=>{var r,o,i,s,a;const c=Vc({apiRef:n,columnTypes:m4,columnsToUpsert:t.columns,initialState:(r=t.initialState)==null?void 0:r.columns,columnVisibilityModel:(o=(i=t.columnVisibilityModel)!=null?i:(s=t.initialState)==null||(a=s.columns)==null?void 0:a.columnVisibilityModel)!=null?o:{},keepOnlyColumnsToUpsert:!0});return E({},e,{columns:c})};function lhe(e,t){var n,r;const o=Ar(e,"useGridColumns"),i=m4,s=u.useRef(t.columns),a=u.useRef(i);e.current.registerControlState({stateId:"visibleColumns",propModel:t.columnVisibilityModel,propOnChange:t.onColumnVisibilityModelChange,stateSelector:Li,changeEvent:"columnVisibilityModelChange"});const c=u.useCallback(R=>{o.debug("Updating columns state."),e.current.setState(AR(R)),e.current.forceUpdate(),e.current.publishEvent("columnsChange",R.orderedFields)},[o,e]),d=u.useCallback(R=>id(e)[R],[e]),p=u.useCallback(()=>ds(e),[e]),h=u.useCallback(()=>Or(e),[e]),m=u.useCallback((R,A=!0)=>(A?Or(e):ds(e)).findIndex(V=>V.field===R),[e]),g=u.useCallback(R=>{const A=m(R);return Hu(e)[A]},[e,m]),y=u.useCallback(R=>{Li(e)!==R&&(e.current.setState(z=>E({},z,{columns:Vc({apiRef:e,columnTypes:i,columnsToUpsert:[],initialState:void 0,columnVisibilityModel:R,keepOnlyColumnsToUpsert:!1})})),e.current.forceUpdate())},[e,i]),v=u.useCallback(R=>{const A=Vc({apiRef:e,columnTypes:i,columnsToUpsert:R,initialState:void 0,keepOnlyColumnsToUpsert:!1});c(A)},[e,c,i]),S=u.useCallback((R,A)=>{var z;const V=Li(e),N=(z=V[R])!=null?z:!0;if(A!==N){const H=E({},V,{[R]:A});e.current.setColumnVisibilityModel(H)}},[e]),w=u.useCallback(R=>zs(e).findIndex(z=>z===R),[e]),C=u.useCallback((R,A)=>{const z=zs(e),V=w(R);if(V===A)return;o.debug(`Moving column ${R} to index ${A}`);const N=[...z],H=N.splice(V,1)[0];N.splice(A,0,H),c(E({},ju(e.current.state),{orderedFields:N}));const W={column:e.current.getColumn(R),targetIndex:e.current.getColumnIndexRelativeToVisibleColumns(R),oldIndex:V};e.current.publishEvent("columnIndexChange",W)},[e,o,c,w]),x=u.useCallback((R,A)=>{o.debug(`Updating column ${R} width to ${A}`);const z=e.current.getColumn(R),V=E({},z,{width:A});e.current.updateColumns([V]),e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(R),colDef:V,width:A})},[e,o]),P={getColumn:d,getAllColumns:p,getColumnIndex:m,getColumnPosition:g,getVisibleColumns:h,getColumnIndexRelativeToVisibleColumns:w,updateColumns:v,setColumnVisibilityModel:y,setColumnVisibility:S,setColumnWidth:x},_={setColumnIndex:C};Ft(e,P,"public"),Ft(e,_,t.signature===fs.DataGrid?"private":"public");const I=u.useCallback((R,A)=>{var z,V,N;const H={},W=Li(e);(!A.exportOnlyDirtyModels||t.columnVisibilityModel!=null||Object.keys((z=(V=t.initialState)==null||(N=V.columns)==null?void 0:N.columnVisibilityModel)!=null?z:{}).length>0||Object.keys(W).length>0)&&(H.columnVisibilityModel=W),H.orderedFields=zs(e);const Y=ds(e),ie={};return Y.forEach(re=>{if(re.hasBeenResized){const de={};p4.forEach(se=>{let le=re[se];le===1/0&&(le=-1),de[se]=le}),ie[re.field]=de}}),Object.keys(ie).length>0&&(H.dimensions=ie),E({},R,{columns:H})},[e,t.columnVisibilityModel,(n=t.initialState)==null?void 0:n.columns]),k=u.useCallback((R,A)=>{var z;const V=(z=A.stateToRestore.columns)==null?void 0:z.columnVisibilityModel,N=A.stateToRestore.columns;if(V==null&&N==null)return R;const H=Vc({apiRef:e,columnTypes:i,columnsToUpsert:[],initialState:N,columnVisibilityModel:V,keepOnlyColumnsToUpsert:!1});return e.current.setState(AR(H)),N!=null&&e.current.publishEvent("columnsChange",H.orderedFields),R},[e,i]),M=u.useCallback((R,A)=>{if(A===Xa.columns){var z;const V=t.slots.columnsPanel;return T.jsx(V,E({},(z=t.slotProps)==null?void 0:z.columnsPanel))}return R},[t.slots.columnsPanel,(r=t.slotProps)==null?void 0:r.columnsPanel]),O=u.useCallback(R=>t.disableColumnSelector?R:[...R,"columnMenuColumnsItem"],[t.disableColumnSelector]);ir(e,"columnMenu",O),ir(e,"exportState",I),ir(e,"restoreState",k),ir(e,"preferencePanel",M);const F=u.useRef(null);ot(e,"viewportInnerSizeChange",R=>{F.current!==R.width&&(F.current=R.width,c(h4(ju(e.current.state),R.width)))});const D=u.useCallback(()=>{o.info("Columns pipe processing have changed, regenerating the columns");const R=Vc({apiRef:e,columnTypes:i,columnsToUpsert:[],initialState:void 0,keepOnlyColumnsToUpsert:!1});c(R)},[e,o,c,i]);cE(e,"hydrateColumns",D);const B=u.useRef(!0);u.useEffect(()=>{if(B.current){B.current=!1;return}if(o.info(`GridColumns have changed, new length ${t.columns.length}`),s.current===t.columns&&a.current===i)return;const R=Vc({apiRef:e,columnTypes:i,initialState:void 0,columnsToUpsert:t.columns,keepOnlyColumnsToUpsert:!0});s.current=t.columns,a.current=i,c(R)},[o,e,c,t.columns,i]),u.useEffect(()=>{t.columnVisibilityModel!==void 0&&e.current.setColumnVisibilityModel(t.columnVisibilityModel)},[e,o,t.columnVisibilityModel])}const ahe=.7,che=1.3,g4={compact:ahe,comfortable:che,standard:1},uhe=(e,t)=>E({},e,{density:{value:t.density,factor:g4[t.density]}}),dhe=(e,t)=>{const n=Ar(e,"useDensity"),r=u.useCallback(i=>{n.debug(`Set grid density to ${i}`),e.current.setState(s=>{const a=ZS(s),c={value:i,factor:g4[i]};return La(a,c)?s:E({},s,{density:c})}),e.current.forceUpdate()},[n,e]);u.useEffect(()=>{e.current.setDensity(t.density)},[e,t.density]),Ft(e,{setDensity:r},"public")};function fhe(e,t="csv",n=document.title||"untitled"){const r=`${n}.${t}`;if("download"in HTMLAnchorElement.prototype){const o=URL.createObjectURL(e),i=document.createElement("a");i.href=o,i.download=r,i.click(),setTimeout(()=>{URL.revokeObjectURL(o)});return}throw new Error("MUI: exportAs not supported")}const v4=({apiRef:e,options:t})=>{const n=ds(e);return t.fields?t.fields.map(o=>n.find(i=>i.field===o)).filter(o=>!!o):(t.allColumns?n:Or(e)).filter(o=>!o.disableExport)},phe=({apiRef:e})=>{var t,n;const r=Tae(e),o=Ti(e),i=e.current.getSelectedRows(),s=r.filter(p=>o[p].type!=="footer"),a=sd(e),c=(a==null||(t=a.top)==null?void 0:t.map(p=>p.id))||[],d=(a==null||(n=a.bottom)==null?void 0:n.map(p=>p.id))||[];return s.unshift(...c),s.push(...d),i.size>0?s.filter(p=>i.has(p)):s},hhe=(e,t)=>{const n=Ar(e,"useGridCsvExport"),r=t.unstable_ignoreValueFormatterDuringExport,o=(typeof r=="object"?r==null?void 0:r.csvExport:r)||!1,i=u.useCallback((d={})=>{var p,h,m;n.debug("Get data as CSV");const g=v4({apiRef:e,options:d}),v=((p=d.getRowsToExport)!=null?p:phe)({apiRef:e});return Xpe({columns:g,rowIds:v,delimiterCharacter:d.delimiter||",",includeHeaders:(h=d.includeHeaders)!=null?h:!0,includeColumnGroupsHeaders:(m=d.includeColumnGroupsHeaders)!=null?m:!0,ignoreValueFormatter:o,apiRef:e})},[n,e,o]),s=u.useCallback(d=>{n.debug("Export data as CSV");const p=i(d),h=new Blob([d!=null&&d.utf8WithBom?new Uint8Array([239,187,191]):"",p],{type:"text/csv"});fhe(h,"csv",d==null?void 0:d.fileName)},[n,i]);Ft(e,{getDataAsCsv:i,exportDataAsCsv:s},"public");const c=u.useCallback((d,p)=>{var h;return(h=p.csvOptions)!=null&&h.disableToolbarButton?d:[...d,{component:T.jsx(qfe,{options:p.csvOptions}),componentName:"csvExport"}]},[]);ir(e,"exportMenu",c)};function mhe(){return new Promise(e=>{requestAnimationFrame(()=>{e()})})}function ghe(e){const t=document.createElement("iframe");return t.style.position="absolute",t.style.width="0px",t.style.height="0px",t.title=e||document.title,t}const vhe=(e,t)=>{const n=Ar(e,"useGridPrintExport"),r=u.useRef(null),o=u.useRef(null),i=u.useRef({});u.useEffect(()=>{r.current=vn(e.current.rootElementRef.current)},[e]);const s=u.useCallback((m,g)=>new Promise(y=>{if(!m&&!g){y();return}const v=v4({apiRef:e,options:{fields:m,allColumns:g}}).map(C=>C.field),S=ds(e),w={};S.forEach(C=>{w[C.field]=v.includes(C.field)}),e.current.setColumnVisibilityModel(w),y()}),[e]),a=u.useCallback((m,g)=>{var y,v;const S=E({copyStyles:!0,hideToolbar:!1,hideFooter:!1},g),w=m.contentDocument;if(!w)return;const C=cp(e.current.state),x=e.current.rootElementRef.current,P=x.cloneNode(!0),_=P.querySelector(`.${X.main}`);_.style.overflow="visible",P.style.contain="size";const k=P.querySelector(`.${X.columnHeaders}`).querySelector(`.${X.columnHeadersInner}`);k.style.width="100%";let M=((y=x.querySelector(`.${X.toolbarContainer}`))==null?void 0:y.offsetHeight)||0,O=((v=x.querySelector(`.${X.footerContainer}`))==null?void 0:v.offsetHeight)||0;if(S.hideToolbar){var F;(F=P.querySelector(`.${X.toolbarContainer}`))==null||F.remove(),M=0}if(S.hideFooter){var L;(L=P.querySelector(`.${X.footerContainer}`))==null||L.remove(),O=0}P.style.height=`${C.currentPageTotalHeight+uE(e,t.columnHeaderHeight)+M+O}px`,P.style.boxSizing="content-box";const D=document.createElement("div");D.appendChild(P),w.body.innerHTML=D.innerHTML;const B=typeof S.pageStyle=="function"?S.pageStyle():S.pageStyle;if(typeof B=="string"){const R=w.createElement("style");R.appendChild(w.createTextNode(B)),w.head.appendChild(R)}if(S.bodyClassName&&w.body.classList.add(...S.bodyClassName.split(" ")),S.copyStyles){const R=x.getRootNode(),z=(R.constructor.name==="ShadowRoot"?R:r.current).querySelectorAll("style, link[rel='stylesheet']");for(let V=0;V<z.length;V+=1){const N=z[V];if(N.tagName==="STYLE"){const H=w.createElement(N.tagName),W=N.sheet;if(W){let K="";for(let Y=0;Y<W.cssRules.length;Y+=1)typeof W.cssRules[Y].cssText=="string"&&(K+=`${W.cssRules[Y].cssText}\r
|
|
338
|
-
`);H.appendChild(w.createTextNode(K)),w.head.appendChild(H)}}else if(N.getAttribute("href")){const H=w.createElement(N.tagName);for(let W=0;W<N.attributes.length;W+=1){const K=N.attributes[W];K&&H.setAttribute(K.nodeName,K.nodeValue||"")}w.head.appendChild(H)}}}m.contentWindow.print()},[e,r,t.columnHeaderHeight]),c=u.useCallback(m=>{var g,y;r.current.body.removeChild(m),e.current.restoreState(o.current||{}),(g=o.current)!=null&&(y=g.columns)!=null&&y.columnVisibilityModel||e.current.setColumnVisibilityModel(i.current),e.current.unstable_enableVirtualization(),o.current=null,i.current={}},[e]),p={exportDataAsPrint:u.useCallback(m=>mt(void 0,null,function*(){if(n.debug("Export data as Print"),!e.current.rootElementRef.current)throw new Error("MUI: No grid root element available.");if(o.current=e.current.exportState(),i.current=Li(e),t.pagination){const y=_A(e);e.current.setPageSize(y)}yield s(m==null?void 0:m.fields,m==null?void 0:m.allColumns),e.current.unstable_disableVirtualization(),yield mhe();const g=ghe(m==null?void 0:m.fileName);g.onload=()=>{a(g,m),g.contentWindow.matchMedia("print").addEventListener("change",v=>{v.matches===!1&&c(g)})},r.current.body.appendChild(g)}),[t,n,e,a,c,s])};Ft(e,p,"public");const h=u.useCallback((m,g)=>{var y;return(y=g.printOptions)!=null&&y.disableToolbarButton?m:[...m,{component:T.jsx(Yfe,{options:g.printOptions}),componentName:"printExport"}]},[]);ir(e,"exportMenu",h)},Gw=(e,t)=>{const n=E({},e);if(n.id==null&&(n.id=Math.round(Math.random()*1e5)),n.operator==null){const r=id(t)[n.field];n.operator=r&&r.filterOperators[0].value}return n},yhe=ws(["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"),bhe=ws("MUI: The `id` field is required on `filterModel.items` when you use multiple filters.","error"),whe=ws("MUI: The `operator` field is required on `filterModel.items`, one or more of your filtering item has no `operator` provided.","error"),y4=(e,t,n)=>{const r=e.items.length>1;let o;r&&t?(yhe(),o=[e.items[0]]):o=e.items;const i=r&&o.some(a=>a.id==null),s=o.some(a=>a.operator==null);return i&&bhe(),s&&whe(),s||i?E({},e,{items:o.map(a=>Gw(a,n))}):e.items!==o?E({},e,{items:o}):e},NR=(e,t,n)=>r=>E({},r,{filterModel:y4(e,t,n)}),b4=(e,t)=>{if(!e.field||!e.operator)return null;const n=t.current.getColumn(e.field);if(!n)return null;let r;if(n.valueParser){var o;const h=n.valueParser;r=Array.isArray(e.value)?(o=e.value)==null?void 0:o.map(m=>h(m)):h(e.value)}else r=e.value;const i=E({},e,{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(h=>h.value===i.operator);if(!a)throw new Error(`MUI: No filter operator found for column '${n.field}' and operator value '${i.operator}'.`);const c=!Ag(a.getApplyFilterFn),d=!Ag(a.getApplyFilterFnV7);if(a.getApplyFilterFnV7&&!(c&&!d)){const h=a.getApplyFilterFnV7(i,n);return typeof h!="function"?null:{v7:!0,item:i,fn:m=>{const g=t.current.getRowValue(m,n);return h(g,m,n,t)}}}const p=a.getApplyFilterFn(i,n);return typeof p!="function"?null:{v7:!1,item:i,fn:h=>{const m=t.current.getCellParams(h,i.field);Hw.current=t;const g=p(m);return Hw.current=null,g}}},Che=(e,t,n)=>{const{items:r}=t,o=r.map(i=>b4(i,n)).filter(i=>!!i);return o.length===0?null:(i,s)=>{const a={};for(let c=0;c<o.length;c+=1){const d=o[c];(!s||s(d.item.field))&&(a[d.item.id]=d.v7?d.fn(i):d.fn(e?e(i):i.id))}return a}},xhe=(e,t,n)=>{var r,o,i;const s=(r=(o=t.quickFilterValues)==null?void 0:o.filter(Boolean))!=null?r:[];if(s.length===0)return null;const c=((i=t.quickFilterExcludeHiddenColumns)!=null?i:!1)?my(n):zs(n),d=[];return c.forEach(p=>{const h=n.current.getColumn(p),m=h==null?void 0:h.getApplyQuickFilterFn,g=h==null?void 0:h.getApplyQuickFilterFnV7,y=!Ag(m),v=!Ag(g);g&&!(y&&!v)?d.push({column:h,appliers:s.map(S=>({v7:!0,fn:g(S,h,n)}))}):m&&d.push({column:h,appliers:s.map(S=>({v7:!1,fn:m(S,h,n)}))})}),function(h,m){const g={},y={};e:for(let S=0;S<s.length;S+=1){const w=s[S];for(let C=0;C<d.length;C+=1){const{column:x,appliers:P}=d[C],{field:_}=x;if(m&&!m(_))continue;const I=P[S],k=n.current.getRowValue(h,x);if(I.fn!==null)if(I.v7){if(I.fn(k,h,x,n)){g[w]=!0;continue e}}else{var v;const M=(v=y[_])!=null?v:n.current.getCellParams(e?e(h):h.id,_);if(y[_]=M,I.fn(M)){g[w]=!0;continue e}}}g[w]=!1}return g}},She=(e,t,n)=>{const r=Che(e,t,n),o=xhe(e,t,n);return function(s,a,c){var d,p;c.passingFilterItems=(d=r==null?void 0:r(s,a))!=null?d:null,c.passingQuickFilterValues=(p=o==null?void 0:o(s,a))!=null?p:null}},DR=e=>e!=null,Ehe=(e,t,n)=>(e.cleanedFilterItems||(e.cleanedFilterItems=n.filter(r=>b4(r,t)!==null)),e.cleanedFilterItems),Phe=(e,t,n,r,o)=>{const i=Ehe(o,r,n.items),s=e.filter(DR),a=t.filter(DR);if(s.length>0){var c;const p=m=>s.some(g=>g[m.id]);if(((c=n.logicOperator)!=null?c:lp().logicOperator)===no.And){if(!i.every(p))return!1}else if(!i.some(p))return!1}if(a.length>0&&n.quickFilterValues!=null){var d;const p=m=>a.some(g=>g[m]);if(((d=n.quickFilterLogicOperator)!=null?d:lp().quickFilterLogicOperator)===no.And){if(!n.quickFilterValues.every(p))return!1}else if(!n.quickFilterValues.some(p))return!1}return!0},Ihe=(e,t,n)=>{var r,o,i,s;const a=(r=(o=t.filterModel)!=null?o:(i=t.initialState)==null||(s=i.filter)==null?void 0:s.filterModel)!=null?r:lp();return E({},e,{filter:{filterModel:y4(a,t.disableMultipleColumnsFiltering,n),filteredRowsLookup:{},filteredDescendantCountLookup:{}},visibleRowsLookup:{}})},khe=e=>e.filteredRowsLookup;function BR(e,t){return e.current.applyStrategyProcessor("visibleRowsLookupCreation",{tree:t.rows.tree,filteredRowsLookup:t.filter.filteredRowsLookup})}const _he=(e,t)=>{var n,r,o;const i=Ar(e,"useGridFilter");e.current.registerControlState({stateId:"filter",propModel:t.filterModel,propOnChange:t.onFilterModelChange,stateSelector:Cr,changeEvent:"filterModelChange"});const s=u.useCallback(()=>{e.current.setState(D=>{const B=Cr(D,e.current.instanceId),R=t.filterMode==="client"?She(t.getRowId,B,e):null,A=e.current.applyStrategyProcessor("filtering",{isRowMatchingFilters:R,filterModel:B!=null?B:lp()}),z=E({},D,{filter:E({},D.filter,A)}),V=BR(e,z);return E({},z,{visibleRowsLookup:V})}),e.current.publishEvent("filteredRowsSet")},[e,t.filterMode,t.getRowId]),a=u.useCallback((D,B)=>B==null||B.filterable===!1||t.disableColumnFilter?D:[...D,"columnMenuFilterItem"],[t.disableColumnFilter]),c=u.useCallback(()=>{s(),e.current.forceUpdate()},[e,s]),d=u.useCallback(D=>{const B=Cr(e),R=[...B.items],A=R.findIndex(z=>z.id===D.id);A===-1?R.push(D):R[A]=D,e.current.setFilterModel(E({},B,{items:R}),"upsertFilterItem")},[e]),p=u.useCallback(D=>{const B=Cr(e),R=[...B.items];D.forEach(A=>{const z=D.findIndex(V=>V.id===A.id);z===-1?R.push(A):R[z]=A}),e.current.setFilterModel(E({},B,{items:D}),"upsertFilterItems")},[e]),h=u.useCallback(D=>{const B=Cr(e),R=B.items.filter(A=>A.id!==D.id);R.length!==B.items.length&&e.current.setFilterModel(E({},B,{items:R}),"deleteFilterItem")},[e]),m=u.useCallback((D,B,R)=>{if(i.debug("Displaying filter panel"),D){const A=Cr(e),z=A.items.filter(W=>{var K;if(W.value!==void 0)return!(Array.isArray(W.value)&&W.value.length===0);const ie=(K=e.current.getColumn(W.field).filterOperators)==null?void 0:K.find(de=>de.value===W.operator);return!(typeof(ie==null?void 0:ie.requiresFilterValue)=="undefined"?!0:ie==null?void 0:ie.requiresFilterValue)});let V;const N=z.find(W=>W.field===D),H=e.current.getColumn(D);N?V=z:t.disableMultipleColumnsFiltering?V=[Gw({field:D,operator:H.filterOperators[0].value},e)]:V=[...z,Gw({field:D,operator:H.filterOperators[0].value},e)],e.current.setFilterModel(E({},A,{items:V}))}e.current.showPreferences(Xa.filters,B,R)},[e,i,t.disableMultipleColumnsFiltering]),g=u.useCallback(()=>{i.debug("Hiding filter panel"),e.current.hidePreferences()},[e,i]),y=u.useCallback(D=>{const B=Cr(e);B.logicOperator!==D&&e.current.setFilterModel(E({},B,{logicOperator:D}),"changeLogicOperator")},[e]),v=u.useCallback(D=>{const B=Cr(e);La(B.quickFilterValues,D)||e.current.setFilterModel(E({},B,{quickFilterValues:[...D]}))},[e]),S=u.useCallback((D,B)=>{Cr(e)!==D&&(i.debug("Setting filter model"),e.current.updateControlState("filter",NR(D,t.disableMultipleColumnsFiltering,e),B),e.current.unstable_applyFilters())},[e,i,t.disableMultipleColumnsFiltering]);Ft(e,{setFilterLogicOperator:y,unstable_applyFilters:c,deleteFilterItem:h,upsertFilterItem:d,upsertFilterItems:p,setFilterModel:S,showFilterPanel:m,hideFilterPanel:g,setQuickFilterValues:v},"public");const C=u.useCallback((D,B)=>{var R,A;const z=Cr(e);return!B.exportOnlyDirtyModels||t.filterModel!=null||((R=t.initialState)==null||(A=R.filter)==null?void 0:A.filterModel)!=null||!La(z,lp())?E({},D,{filter:{filterModel:z}}):D},[e,t.filterModel,(n=t.initialState)==null||(r=n.filter)==null?void 0:r.filterModel]),x=u.useCallback((D,B)=>{var R;const A=(R=B.stateToRestore.filter)==null?void 0:R.filterModel;return A==null?D:(e.current.updateControlState("filter",NR(A,t.disableMultipleColumnsFiltering,e),"restoreState"),E({},D,{callbacks:[...D.callbacks,e.current.unstable_applyFilters]}))},[e,t.disableMultipleColumnsFiltering]),P=u.useCallback((D,B)=>{if(B===Xa.filters){var R;const A=t.slots.filterPanel;return T.jsx(A,E({},(R=t.slotProps)==null?void 0:R.filterPanel))}return D},[t.slots.filterPanel,(o=t.slotProps)==null?void 0:o.filterPanel]),_=e.current.state.rows.dataRowIdToModelLookup,I=u.useMemo(()=>Object.values(_),[_]),{getRowId:k}=t,M=u.useCallback(D=>{if(t.filterMode!=="client"||!D.isRowMatchingFilters)return{filteredRowsLookup:{},filteredDescendantCountLookup:{}};const B=_l(e),R={},{isRowMatchingFilters:A}=D,z={},V={passingFilterItems:null,passingQuickFilterValues:null};for(let W=0;W<I.length;W+=1){const K=I[W],Y=k?k(K):K.id;A(K,void 0,V);const ie=Phe([V.passingFilterItems],[V.passingQuickFilterValues],D.filterModel,e,z);R[Y]=ie}const N="auto-generated-group-footer-root";return B[N]&&(R[N]=!0),{filteredRowsLookup:R,filteredDescendantCountLookup:{}}},[e,I,t.filterMode,k]);ir(e,"columnMenu",a),ir(e,"exportState",C),ir(e,"restoreState",x),ir(e,"preferencePanel",P),Ng(e,Ja,"filtering",M),Ng(e,Ja,"visibleRowsLookupCreation",khe);const O=u.useCallback(()=>{i.debug("onColUpdated - GridColumns changed, applying filters");const D=Cr(e),B=Sae(e),R=D.items.filter(A=>A.field&&B[A.field]);R.length<D.items.length&&e.current.setFilterModel(E({},D,{items:R}))},[e,i]),F=u.useCallback(D=>{D==="filtering"&&e.current.unstable_applyFilters()},[e]),L=u.useCallback(()=>{e.current.setState(D=>E({},D,{visibleRowsLookup:BR(e,D)})),e.current.forceUpdate()},[e]);ot(e,"rowsSet",s),ot(e,"columnsChange",O),ot(e,"activeStrategyProcessorChange",F),ot(e,"rowExpansionChange",L),ot(e,"columnVisibilityModelChange",()=>{const D=Cr(e);D.quickFilterValues&&D.quickFilterExcludeHiddenColumns&&e.current.unstable_applyFilters()}),Lp(()=>{e.current.unstable_applyFilters()}),ln(()=>{t.filterModel!==void 0&&e.current.setFilterModel(t.filterModel)},[e,i,t.filterModel])},$he=e=>E({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},tabIndex:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}),Rhe=(e,t)=>{const n=Ar(e,"useGridFocus"),r=u.useRef(null),o=u.useCallback((I,k)=>{I&&e.current.getRow(I.id)&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(I.id,I.field),k)},[e]),i=u.useCallback((I,k)=>{const M=ii(e);(M==null?void 0:M.id)===I&&(M==null?void 0:M.field)===k||(e.current.setState(O=>(n.debug(`Focusing on cell with id=${I} and field=${k}`),E({},O,{tabIndex:{cell:{id:I,field:k},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},focus:{cell:{id:I,field:k},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))),e.current.forceUpdate(),e.current.getRow(I)&&(M&&o(M,{}),e.current.publishEvent("cellFocusIn",e.current.getCellParams(I,k))))},[e,n,o]),s=u.useCallback((I,k={})=>{const M=ii(e);o(M,k),e.current.setState(O=>(n.debug(`Focusing on column header with colIndex=${I}`),E({},O,{tabIndex:{columnHeader:{field:I},columnHeaderFilter:null,cell:null,columnGroupHeader:null},focus:{columnHeader:{field:I},columnHeaderFilter:null,cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,o]),a=u.useCallback((I,k={})=>{const M=ii(e);o(M,k),e.current.setState(O=>(n.debug(`Focusing on column header filter with colIndex=${I}`),E({},O,{tabIndex:{columnHeader:null,columnHeaderFilter:{field:I},cell:null,columnGroupHeader:null},focus:{columnHeader:null,columnHeaderFilter:{field:I},cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,o]),c=u.useCallback((I,k,M={})=>{const O=ii(e);O&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(O.id,O.field),M),e.current.setState(F=>E({},F,{tabIndex:{columnGroupHeader:{field:I,depth:k},columnHeader:null,columnHeaderFilter:null,cell:null},focus:{columnGroupHeader:{field:I,depth:k},columnHeader:null,columnHeaderFilter:null,cell:null}})),e.current.forceUpdate()},[e]),d=u.useCallback(()=>$g(e),[e]),p=u.useCallback((I,k,M)=>{let O=e.current.getColumnIndex(k);const F=Or(e),L=sE(e,{pagination:t.pagination,paginationMode:t.paginationMode}),D=sd(e),B=[].concat(D.top||[],L.rows,D.bottom||[]);let R=B.findIndex(N=>N.id===I);M==="right"?O+=1:M==="left"?O-=1:R+=1,O>=F.length?(R+=1,R<B.length&&(O=0)):O<0&&(R-=1,R>=0&&(O=F.length-1)),R=Vu(R,0,B.length-1);const A=B[R];if(!A)return;const z=e.current.unstable_getCellColSpanInfo(A.id,O);z&&z.spannedByColSpan&&(M==="left"||M==="below"?O=z.leftVisibleCellIndex:M==="right"&&(O=z.rightVisibleCellIndex)),O=Vu(O,0,F.length-1);const V=F[O];e.current.setCellFocus(A.id,V.field)},[e,t.pagination,t.paginationMode]),h=u.useCallback(({id:I,field:k})=>{e.current.setCellFocus(I,k)},[e]),m=u.useCallback((I,k)=>{k.key==="Enter"||k.key==="Tab"||k.key==="Shift"||Lg(k.key)||e.current.setCellFocus(I.id,I.field)},[e]),g=u.useCallback(({field:I},k)=>{k.target===k.currentTarget&&e.current.setColumnHeaderFocus(I,k)},[e]),y=u.useCallback(({fields:I,depth:k},M)=>{if(M.target!==M.currentTarget)return;const O=$g(e);O!==null&&O.depth===k&&I.includes(O.field)||e.current.setColumnGroupHeaderFocus(I[0],k,M)},[e]),v=u.useCallback((I,k)=>{var M;(M=k.relatedTarget)!=null&&M.className.includes(X.columnHeader)||(n.debug("Clearing focus"),e.current.setState(O=>E({},O,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})))},[n,e]),S=u.useCallback(I=>{r.current=I},[]),w=u.useCallback(I=>{const k=r.current;r.current=null;const M=ii(e);if(!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:I,cell:k}))return;if(!M){k&&e.current.setCellFocus(k.id,k.field);return}if((k==null?void 0:k.id)===M.id&&(k==null?void 0:k.field)===M.field)return;const F=e.current.getCellElement(M.id,M.field);F!=null&&F.contains(I.target)||(k?e.current.setCellFocus(k.id,k.field):(e.current.setState(L=>E({},L,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})),e.current.forceUpdate(),o(M,I)))},[e,o]),C=u.useCallback(I=>{if(I.cellMode==="view")return;const k=ii(e);((k==null?void 0:k.id)!==I.id||(k==null?void 0:k.field)!==I.field)&&e.current.setCellFocus(I.id,I.field)},[e]),x=u.useCallback(()=>{const I=ii(e);I&&!e.current.getRow(I.id)&&e.current.setState(k=>E({},k,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))},[e]),P={setCellFocus:i,setColumnHeaderFocus:s,setColumnHeaderFilterFocus:a},_={moveFocusToRelativeCell:p,setColumnGroupHeaderFocus:c,getColumnGroupHeaderFocus:d};Ft(e,P,"public"),Ft(e,_,"private"),u.useEffect(()=>{const I=vn(e.current.rootElementRef.current);return I.addEventListener("mouseup",w),()=>{I.removeEventListener("mouseup",w)}},[e,w]),ot(e,"columnHeaderBlur",v),ot(e,"headerFilterBlur",v),ot(e,"cellDoubleClick",h),ot(e,"cellMouseDown",S),ot(e,"cellKeyDown",m),ot(e,"cellModeChange",C),ot(e,"columnHeaderFocus",g),ot(e,"columnGroupHeaderFocus",y),ot(e,"rowsSet",x)};function Mhe(e,t){const n=sd(e)||{};return[...n.top||[],...t,...n.bottom||[]]}const Y1=({currentColIndex:e,firstColIndex:t,lastColIndex:n,direction:r})=>{if(r==="rtl"){if(e<n)return e+1}else if(r==="ltr"&&e>t)return e-1;return null},Q1=({currentColIndex:e,firstColIndex:t,lastColIndex:n,direction:r})=>{if(r==="rtl"){if(e>t)return e-1}else if(r==="ltr"&&e<n)return e+1;return null},The=(e,t)=>{const n=Ar(e,"useGridKeyboardNavigation"),r=ac(e,t).rows,o=lr(),i=u.useMemo(()=>Mhe(e,r),[e,r]),s=t.signature!=="DataGrid"&&t.unstable_headerFilters,a=u.useCallback((w,C,x="left")=>{const P=ia(e),_=e.current.unstable_getCellColSpanInfo(C,w);_&&_.spannedByColSpan&&(x==="left"?w=_.leftVisibleCellIndex:x==="right"&&(w=_.rightVisibleCellIndex));const I=P.findIndex(M=>M.id===C);n.debug(`Navigating to cell row ${I}, col ${w}`),e.current.scrollToIndexes({colIndex:w,rowIndex:I});const k=e.current.getVisibleColumns()[w].field;e.current.setCellFocus(C,k)},[e,n]),c=u.useCallback((w,C)=>{n.debug(`Navigating to header col ${w}`),e.current.scrollToIndexes({colIndex:w});const x=e.current.getVisibleColumns()[w].field;e.current.setColumnHeaderFocus(x,C)},[e,n]),d=u.useCallback((w,C)=>{n.debug(`Navigating to header filter col ${w}`),e.current.scrollToIndexes({colIndex:w});const x=e.current.getVisibleColumns()[w].field;e.current.setColumnHeaderFilterFocus(x,C)},[e,n]),p=u.useCallback((w,C,x)=>{n.debug(`Navigating to header col ${w}`),e.current.scrollToIndexes({colIndex:w});const{field:P}=e.current.getVisibleColumns()[w];e.current.setColumnGroupHeaderFocus(P,C,x)},[e,n]),h=u.useCallback(w=>i==null?void 0:i[w].id,[i]),m=u.useCallback((w,C)=>{const x=C.currentTarget.querySelector(`.${X.columnHeaderTitleContainerContent}`);if(!!x&&x.contains(C.target)&&w.field!==Np.field||!e.current.getRootDimensions())return;const I=e.current.getViewportPageSize(),k=w.field?e.current.getColumnIndex(w.field):0,M=0,O=i.length-1,F=0,L=Or(e).length-1,D=Op(e);let B=!0;switch(C.key){case"ArrowDown":{s?d(k,C):a(k,h(M));break}case"ArrowRight":{const R=Q1({currentColIndex:k,firstColIndex:F,lastColIndex:L,direction:o.direction});R!==null&&c(R,C);break}case"ArrowLeft":{const R=Y1({currentColIndex:k,firstColIndex:F,lastColIndex:L,direction:o.direction});R!==null&&c(R,C);break}case"ArrowUp":{D>0&&p(k,D-1,C);break}case"PageDown":{O!==null&&a(k,h(Math.min(M+I,O)));break}case"Home":{c(F,C);break}case"End":{c(L,C);break}case"Enter":{(C.ctrlKey||C.metaKey)&&e.current.toggleColumnMenu(w.field);break}case" ":break;default:B=!1}B&&C.preventDefault()},[e,i.length,s,d,a,h,o.direction,c,p]),g=u.useCallback((w,C)=>{if(!e.current.getRootDimensions())return;const P=nde(e)===w.field,_=rde(e)===w.field;if(P||_||!Lg(C.key))return;const I=e.current.getViewportPageSize(),k=w.field?e.current.getColumnIndex(w.field):0,M=0,O=i.length-1,F=0,L=Or(e).length-1;let D=!0;switch(C.key){case"ArrowDown":{const B=h(M);B!=null&&a(k,B);break}case"ArrowRight":{const B=Q1({currentColIndex:k,firstColIndex:F,lastColIndex:L,direction:o.direction});B!==null&&d(B,C);break}case"ArrowLeft":{const B=Y1({currentColIndex:k,firstColIndex:F,lastColIndex:L,direction:o.direction});B!==null?d(B,C):e.current.setColumnHeaderFilterFocus(w.field,C);break}case"ArrowUp":{c(k,C);break}case"PageDown":{O!==null&&a(k,h(Math.min(M+I,O)));break}case"Home":{d(F,C);break}case"End":{d(L,C);break}case" ":break;default:D=!1}D&&C.preventDefault()},[e,i.length,d,o.direction,c,a,h]),y=u.useCallback((w,C)=>{if(!e.current.getRootDimensions())return;const P=$g(e);if(P===null)return;const{field:_,depth:I}=P,{fields:k,depth:M,maxDepth:O}=w,F=e.current.getViewportPageSize(),L=e.current.getColumnIndex(_),D=_?e.current.getColumnIndex(_):0,B=0,R=i.length-1,A=0,z=Or(e).length-1;let V=!0;switch(C.key){case"ArrowDown":{M===O-1?c(L,C):p(L,I+1,C);break}case"ArrowUp":{M>0&&p(L,I-1,C);break}case"ArrowRight":{const N=k.length-k.indexOf(_)-1;L+N+1<=z&&p(L+N+1,I,C);break}case"ArrowLeft":{const N=k.indexOf(_);L-N-1>=A&&p(L-N-1,I,C);break}case"PageDown":{R!==null&&a(D,h(Math.min(B+F,R)));break}case"Home":{p(A,I,C);break}case"End":{p(z,I,C);break}case" ":break;default:V=!1}V&&C.preventDefault()},[e,i.length,c,p,a,h]),v=u.useCallback((w,C)=>{if(!C.currentTarget.contains(C.target))return;const x=e.current.getCellParams(w.id,w.field);if(x.cellMode===rn.Edit||!Lg(C.key)||!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:C,cell:x}))return;const _=e.current.getRootDimensions();if(i.length===0||!_)return;const I=o.direction,k=e.current.getViewportPageSize(),M=w.field?e.current.getColumnIndex(w.field):0,O=i.findIndex(A=>A.id===w.id),F=0,L=i.length-1,D=0,B=Or(e).length-1;let R=!0;switch(C.key){case"ArrowDown":{O<L&&a(M,h(O+1));break}case"ArrowUp":{O>F?a(M,h(O-1)):s?d(M,C):c(M,C);break}case"ArrowRight":{const A=Q1({currentColIndex:M,firstColIndex:D,lastColIndex:B,direction:I});A!==null&&a(A,h(O),I==="rtl"?"left":"right");break}case"ArrowLeft":{const A=Y1({currentColIndex:M,firstColIndex:D,lastColIndex:B,direction:I});A!==null&&a(A,h(O),I==="rtl"?"right":"left");break}case"Tab":{C.shiftKey&&M>D?a(M-1,h(O),"left"):!C.shiftKey&&M<B&&a(M+1,h(O),"right");break}case" ":{if(w.field===lE)break;const z=w.colDef;if(z&&z.type==="treeDataGroup")break;!C.shiftKey&&O<L&&a(M,h(Math.min(O+k,L)));break}case"PageDown":{O<L&&a(M,h(Math.min(O+k,L)));break}case"PageUp":{const A=Math.max(O-k,F);A!==O&&A>=F?a(M,h(A)):c(M,C);break}case"Home":{C.ctrlKey||C.metaKey||C.shiftKey?a(D,h(F)):a(D,h(O));break}case"End":{C.ctrlKey||C.metaKey||C.shiftKey?a(B,h(L)):a(B,h(O));break}default:R=!1}R&&C.preventDefault()},[e,i,o.direction,a,h,s,d,c]),S=u.useCallback((w,{event:C})=>C.key===" "?!1:w,[]);ir(e,"canStartEditing",S),ot(e,"columnHeaderKeyDown",m),ot(e,"headerFilterKeyDown",g),ot(e,"columnGroupHeaderKeyDown",y),ot(e,"cellKeyDown",v)},Ohe=(e,t)=>{var n,r,o;const i=E({},qA(t.autoPageSize),(n=t.paginationModel)!=null?n:(r=t.initialState)==null||(o=r.pagination)==null?void 0:o.paginationModel);return YA(i.pageSize,t.signature),E({},e,{pagination:{paginationModel:i}})},X1=(e,t,n)=>r=>{var o;let i=r.paginationModel;const s=(o=n==null?void 0:n.pageSize)!=null?o:i.pageSize,a=KA(e,s);n&&((n==null?void 0:n.page)!==i.page||(n==null?void 0:n.pageSize)!==i.pageSize)&&(i=n);const c=Vue(i.page,a);return c!==i.page&&(i=E({},i,{page:c})),YA(i.pageSize,t),{paginationModel:i}},Lhe=(e,t)=>{var n,r;const o=Ar(e,"useGridPagination"),i=Ge(e,yy),s=Ge(e,ld),a=Math.floor(t.rowHeight*s);e.current.registerControlState({stateId:"pagination",propModel:t.paginationModel,propOnChange:t.onPaginationModelChange,stateSelector:si,changeEvent:"paginationModelChange"});const c=u.useCallback(S=>{const w=si(e);S!==w.page&&(o.debug(`Setting page to ${S}`),e.current.setPaginationModel({page:S,pageSize:w.pageSize}))},[e,o]),d=u.useCallback(S=>{const w=si(e);S!==w.pageSize&&(o.debug(`Setting page size to ${S}`),e.current.setPaginationModel({pageSize:S,page:w.page}))},[e,o]),p=u.useCallback(S=>{var w;const C=si(e);S!==C&&(o.debug("Setting 'paginationModel' to",S),e.current.updateControlState("pagination",X1((w=t.rowCount)!=null?w:i,t.signature,S),"setPaginationModel"),e.current.forceUpdate())},[e,o,t.rowCount,t.signature,i]);Ft(e,{setPage:c,setPageSize:d,setPaginationModel:p},"public");const m=u.useCallback((S,w)=>{var C,x;const P=si(e);return!w.exportOnlyDirtyModels||t.paginationModel!=null||((C=t.initialState)==null||(x=C.pagination)==null?void 0:x.paginationModel)!=null||P.page!==0&&P.pageSize!==Hue(t.autoPageSize)?E({},S,{pagination:E({},S.pagination,{paginationModel:P})}):S},[e,t.paginationModel,(n=t.initialState)==null||(r=n.pagination)==null?void 0:r.paginationModel,t.autoPageSize]),g=u.useCallback((S,w)=>{var C,x,P;const _=(C=w.stateToRestore.pagination)!=null&&C.paginationModel?E({},qA(t.autoPageSize),(x=w.stateToRestore.pagination)==null?void 0:x.paginationModel):si(e);return e.current.updateControlState("pagination",X1((P=t.rowCount)!=null?P:i,t.signature,_),"stateRestorePreProcessing"),S},[e,t.autoPageSize,t.rowCount,t.signature,i]);ir(e,"exportState",m),ir(e,"restoreState",g);const y=()=>{var S;const w=si(e);(S=e.current.virtualScrollerRef)!=null&&S.current&&e.current.scrollToIndexes({rowIndex:w.page*w.pageSize}),e.current.forceUpdate()},v=u.useCallback(()=>{const S=e.current.getRootDimensions();if(!t.autoPageSize||!S)return;const w=OA(e),C=Math.floor((S.viewportInnerSize.height-w.top-w.bottom)/a);e.current.setPageSize(C)},[e,t.autoPageSize,a]);ot(e,"viewportInnerSizeChange",v),ot(e,"paginationModelChange",y),u.useEffect(()=>{},[t.rowCount,t.paginationMode]),u.useEffect(()=>{var S;e.current.updateControlState("pagination",X1((S=t.rowCount)!=null?S:i,t.signature,t.paginationModel))},[e,t.paginationModel,t.rowCount,t.paginationMode,i,t.signature]),u.useEffect(()=>{v()},[v])},Fhe=(e,t)=>{var n,r;return E({},e,{preferencePanel:(n=(r=t.initialState)==null?void 0:r.preferencePanel)!=null?n:{open:!1}})},Ahe=(e,t)=>{var n;const r=Ar(e,"useGridPreferencesPanel"),o=u.useRef(),i=u.useRef(),s=u.useCallback(()=>{r.debug("Hiding Preferences Panel");const m=ap(e.current.state);m.openedPanelValue&&e.current.publishEvent("preferencePanelClose",{openedPanelValue:m.openedPanelValue}),e.current.setState(g=>E({},g,{preferencePanel:{open:!1}})),e.current.forceUpdate()},[e,r]),a=u.useCallback(()=>{i.current=setTimeout(()=>clearTimeout(o.current),0)},[]),c=u.useCallback(()=>{o.current=setTimeout(s,100)},[s]),d=u.useCallback((m,g,y)=>{r.debug("Opening Preferences Panel"),a(),e.current.setState(v=>E({},v,{preferencePanel:E({},v.preferencePanel,{open:!0,openedPanelValue:m,panelId:g,labelId:y})})),e.current.publishEvent("preferencePanelOpen",{openedPanelValue:m}),e.current.forceUpdate()},[r,a,e]);Ft(e,{showPreferences:d,hidePreferences:c},"public");const p=u.useCallback((m,g)=>{var y;const v=ap(e.current.state);return!g.exportOnlyDirtyModels||((y=t.initialState)==null?void 0:y.preferencePanel)!=null||v.open?E({},m,{preferencePanel:v}):m},[e,(n=t.initialState)==null?void 0:n.preferencePanel]),h=u.useCallback((m,g)=>{const y=g.stateToRestore.preferencePanel;return y!=null&&e.current.setState(v=>E({},v,{preferencePanel:y})),m},[e]);ir(e,"exportState",p),ir(e,"restoreState",h),u.useEffect(()=>()=>{clearTimeout(o.current),clearTimeout(i.current)},[])},Nhe=["id","field"],Dhe=["id","field"],Bhe=ws(["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. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.","For more detail, see http://mui.com/components/data-grid/editing/#server-side-persistence."],"error"),zhe=(e,t)=>{const[n,r]=u.useState({}),o=u.useRef(n),i=u.useRef({}),{processRowUpdate:s,onProcessRowUpdateError:a,cellModesModel:c,onCellModesModelChange:d}=t,p=R=>(...A)=>{t.editMode===vs.Cell&&R(...A)},h=u.useCallback((R,A)=>{const z=e.current.getCellParams(R,A);if(!e.current.isCellEditable(z))throw new Error(`MUI: The cell with id=${R} and field=${A} is not editable.`)},[e]),m=u.useCallback((R,A,z)=>{if(e.current.getCellMode(R,A)!==z)throw new Error(`MUI: The cell with id=${R} and field=${A} is not in ${z} mode.`)},[e]),g=u.useCallback((R,A)=>{if(!R.isEditable||R.cellMode===rn.Edit)return;const z=E({},R,{reason:pl.cellDoubleClick});e.current.publishEvent("cellEditStart",z,A)},[e]),y=u.useCallback((R,A)=>{if(R.cellMode===rn.View||e.current.getCellMode(R.id,R.field)===rn.View)return;const z=E({},R,{reason:$i.cellFocusOut});e.current.publishEvent("cellEditStop",z,A)},[e]),v=u.useCallback((R,A)=>{if(R.cellMode===rn.Edit){if(A.which===229)return;let z;if(A.key==="Escape"?z=$i.escapeKeyDown:A.key==="Enter"?z=$i.enterKeyDown:A.key==="Tab"&&(z=A.shiftKey?$i.shiftTabKeyDown:$i.tabKeyDown,A.preventDefault()),z){const V=E({},R,{reason:z});e.current.publishEvent("cellEditStop",V,A)}}else if(R.isEditable){let z;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:A,cellParams:R,editMode:"cell"}))return;if(zA(A)||(A.ctrlKey||A.metaKey)&&A.key==="v"?z=pl.printableKeyDown:A.key==="Enter"?z=pl.enterKeyDown:(A.key==="Delete"||A.key==="Backspace")&&(z=pl.deleteKeyDown),z){const N=E({},R,{reason:z,key:A.key});e.current.publishEvent("cellEditStart",N,A)}}},[e]),S=u.useCallback(R=>{const{id:A,field:z,reason:V,key:N,colDef:H}=R,W={id:A,field:z};if(V===pl.printableKeyDown)if(u.version.startsWith("17"))W.deleteValue=!0;else{const K=H.valueParser?H.valueParser(N):N;W.initialValue=K}else V===pl.deleteKeyDown&&(W.deleteValue=!0);e.current.startCellEditMode(W)},[e]),w=u.useCallback(R=>{const{id:A,field:z,reason:V}=R;e.current.runPendingEditCellValueMutation(A,z);let N;V===$i.enterKeyDown?N="below":V===$i.tabKeyDown?N="right":V===$i.shiftTabKeyDown&&(N="left");const H=V==="escapeKeyDown";e.current.stopCellEditMode({id:A,field:z,ignoreModifications:H,cellToFocusAfter:N})},[e]);ot(e,"cellDoubleClick",p(g)),ot(e,"cellFocusOut",p(y)),ot(e,"cellKeyDown",p(v)),ot(e,"cellEditStart",p(S)),ot(e,"cellEditStop",p(w)),xn(e,"cellEditStart",t.onCellEditStart),xn(e,"cellEditStop",t.onCellEditStop);const C=u.useCallback((R,A)=>{const z=Hr(e.current.state);return z[R]&&z[R][A]?rn.Edit:rn.View},[e]),x=Pn(R=>{const A=R!==t.cellModesModel;d&&A&&d(R,{}),!(t.cellModesModel&&A)&&(r(R),o.current=R,e.current.publishEvent("cellModesModelChange",R))}),P=u.useCallback((R,A,z)=>{const V=E({},o.current);if(z!==null)V[R]=E({},V[R],{[A]:E({},z)});else{const N=V[R],H=ne(N,[A].map(dp));V[R]=H,Object.keys(V[R]).length===0&&delete V[R]}x(V)},[x]),_=u.useCallback((R,A,z)=>{e.current.setState(V=>{const N=E({},V.editRows);return z!==null?N[R]=E({},N[R],{[A]:E({},z)}):(delete N[R][A],Object.keys(N[R]).length===0&&delete N[R]),E({},V,{editRows:N})}),e.current.forceUpdate()},[e]),I=u.useCallback(R=>{const{id:A,field:z}=R,V=ne(R,Nhe);h(A,z),m(A,z,rn.View),P(A,z,E({mode:rn.Edit},V))},[h,m,P]),k=Pn(R=>{const{id:A,field:z,deleteValue:V,initialValue:N}=R;let H=e.current.getCellValue(A,z),W=!1;(V||N)&&(H=V?"":N,W=!0),_(A,z,{value:H,error:!1,isProcessingProps:!1,unstable_updateValueOnRender:W}),e.current.setCellFocus(A,z)}),M=u.useCallback(R=>{const{id:A,field:z}=R,V=ne(R,Dhe);m(A,z,rn.Edit),P(A,z,E({mode:rn.View},V))},[m,P]),O=Pn(R=>mt(void 0,null,function*(){const{id:A,field:z,ignoreModifications:V,cellToFocusAfter:N="none"}=R;m(A,z,rn.Edit),e.current.runPendingEditCellValueMutation(A,z);const H=()=>{_(A,z,null),P(A,z,null),N!=="none"&&e.current.moveFocusToRelativeCell(A,z,N)};if(V){H();return}const W=Hr(e.current.state),{error:K,isProcessingProps:Y}=W[A][z];if(K||Y){i.current[A][z].mode=rn.Edit,P(A,z,{mode:rn.Edit});return}const ie=e.current.getRowWithUpdatedValuesFromCellEditing(A,z);if(s){const re=de=>{i.current[A][z].mode=rn.Edit,P(A,z,{mode:rn.Edit}),a?a(de):Bhe()};try{const de=e.current.getRow(A);Promise.resolve(s(ie,de)).then(se=>{e.current.updateRows([se]),H()}).catch(re)}catch(de){re(de)}}else e.current.updateRows([ie]),H()})),F=u.useCallback(R=>mt(void 0,null,function*(){var A,z;const{id:V,field:N,value:H,debounceMs:W,unstable_skipValueParser:K}=R;h(V,N),m(V,N,rn.Edit);const Y=e.current.getColumn(N),ie=e.current.getRow(V);let re=H;Y.valueParser&&!K&&(re=Y.valueParser(H,e.current.getCellParams(V,N)));let de=Hr(e.current.state),se=E({},de[V][N],{value:re,changeReason:W?"debouncedSetEditCellValue":"setEditCellValue"});if(Y.preProcessEditCellProps){const le=H!==de[V][N].value;se=E({},se,{isProcessingProps:!0}),_(V,N,se),se=yield Promise.resolve(Y.preProcessEditCellProps({id:V,row:ie,props:se,hasChanged:le}))}return e.current.getCellMode(V,N)===rn.View?!1:(de=Hr(e.current.state),se=E({},se,{isProcessingProps:!1}),se.value=Y.preProcessEditCellProps?de[V][N].value:re,_(V,N,se),de=Hr(e.current.state),!((A=de[V])!=null&&(z=A[N])!=null&&z.error))}),[e,h,m,_]),L=u.useCallback((R,A)=>{const z=e.current.getColumn(A),V=Hr(e.current.state),N=e.current.getRow(R);if(!V[R]||!V[R][A])return e.current.getRow(R);const{value:H}=V[R][A];return z.valueSetter?z.valueSetter({value:H,row:N}):E({},N,{[A]:H})},[e]),D={getCellMode:C,startCellEditMode:I,stopCellEditMode:M},B={setCellEditingEditCellValue:F,getRowWithUpdatedValuesFromCellEditing:L};Ft(e,D,"public"),Ft(e,B,"private"),u.useEffect(()=>{c&&x(c)},[c,x]),u.useEffect(()=>{const R=_g(e),A=i.current;i.current=GA(n),Object.entries(n).forEach(([z,V])=>{Object.entries(V).forEach(([N,H])=>{var W,K,Y;const ie=((W=A[z])==null||(K=W[N])==null?void 0:K.mode)||rn.View,re=(Y=R[z])!=null?Y:z;H.mode===rn.Edit&&ie===rn.View?k(E({id:re,field:N},H)):H.mode===rn.View&&ie===rn.Edit&&O(E({id:re,field:N},H))})})},[e,n,k,O])},jhe=["id"],Hhe=["id"],Vhe=ws(["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. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.","For more detail, see http://mui.com/components/data-grid/editing/#server-side-persistence."],"error"),Uhe=(e,t)=>{const[n,r]=u.useState({}),o=u.useRef(n),i=u.useRef({}),s=u.useRef(null),a=u.useRef(null),{processRowUpdate:c,onProcessRowUpdateError:d,rowModesModel:p,onRowModesModelChange:h}=t,m=N=>(...H)=>{t.editMode===vs.Row&&N(...H)},g=u.useCallback((N,H)=>{const W=e.current.getCellParams(N,H);if(!e.current.isCellEditable(W))throw new Error(`MUI: The cell with id=${N} and field=${H} is not editable.`)},[e]),y=u.useCallback((N,H)=>{if(e.current.getRowMode(N)!==H)throw new Error(`MUI: The row with id=${N} is not in ${H} mode.`)},[e]),v=u.useCallback((N,H)=>{if(!N.isEditable||e.current.getRowMode(N.id)===mn.Edit)return;const W=e.current.getRowParams(N.id),K=E({},W,{field:N.field,reason:hl.cellDoubleClick});e.current.publishEvent("rowEditStart",K,H)},[e]),S=u.useCallback(N=>{a.current=N},[]),w=u.useCallback((N,H)=>{N.isEditable&&e.current.getRowMode(N.id)!==mn.View&&(a.current=null,s.current=setTimeout(()=>{var W;if(s.current=null,((W=a.current)==null?void 0:W.id)!==N.id){if(!e.current.getRow(N.id)||e.current.getRowMode(N.id)===mn.View)return;const K=e.current.getRowParams(N.id),Y=E({},K,{field:N.field,reason:Os.rowFocusOut});e.current.publishEvent("rowEditStop",Y,H)}}))},[e]);u.useEffect(()=>()=>{clearTimeout(s.current)},[]);const C=u.useCallback((N,H)=>{if(N.cellMode===mn.Edit){if(H.which===229)return;let W;if(H.key==="Escape")W=Os.escapeKeyDown;else if(H.key==="Enter")W=Os.enterKeyDown;else if(H.key==="Tab"){const K=my(e).filter(Y=>e.current.getColumn(Y).type===Sy?!0:e.current.isCellEditable(e.current.getCellParams(N.id,Y)));if(H.shiftKey?N.field===K[0]&&(W=Os.shiftTabKeyDown):N.field===K[K.length-1]&&(W=Os.tabKeyDown),H.preventDefault(),!W){const Y=K.findIndex(re=>re===N.field),ie=K[H.shiftKey?Y-1:Y+1];e.current.setCellFocus(N.id,ie)}}if(W){const K=E({},e.current.getRowParams(N.id),{reason:W,field:N.field});e.current.publishEvent("rowEditStop",K,H)}}else if(N.isEditable){let W;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:H,cellParams:N,editMode:"row"}))return;if(zA(H)||(H.ctrlKey||H.metaKey)&&H.key==="v"?W=hl.printableKeyDown:H.key==="Enter"?W=hl.enterKeyDown:(H.key==="Delete"||H.key==="Backspace")&&(W=hl.deleteKeyDown),W){const Y=e.current.getRowParams(N.id),ie=E({},Y,{field:N.field,key:H.key,reason:W});e.current.publishEvent("rowEditStart",ie,H)}}},[e]),x=u.useCallback(N=>{const{id:H,field:W,reason:K,key:Y,columns:ie}=N,re={id:H,fieldToFocus:W};if(K===hl.printableKeyDown)if(u.version.startsWith("17"))re.deleteValue=!!W;else{const de=ie.find(se=>se.field===W);re.initialValue=de.valueParser?de.valueParser(Y):Y}else K===hl.deleteKeyDown&&(re.deleteValue=!!W);e.current.startRowEditMode(re)},[e]),P=u.useCallback(N=>{const{id:H,reason:W,field:K}=N;e.current.runPendingEditCellValueMutation(H);let Y;W===Os.enterKeyDown?Y="below":W===Os.tabKeyDown?Y="right":W===Os.shiftTabKeyDown&&(Y="left");const ie=W==="escapeKeyDown";e.current.stopRowEditMode({id:H,ignoreModifications:ie,field:K,cellToFocusAfter:Y})},[e]);ot(e,"cellDoubleClick",m(v)),ot(e,"cellFocusIn",m(S)),ot(e,"cellFocusOut",m(w)),ot(e,"cellKeyDown",m(C)),ot(e,"rowEditStart",m(x)),ot(e,"rowEditStop",m(P)),xn(e,"rowEditStart",t.onRowEditStart),xn(e,"rowEditStop",t.onRowEditStop);const _=u.useCallback(N=>{if(t.editMode===vs.Cell)return mn.View;const H=Hr(e.current.state);return H[N]&&Object.keys(H[N]).length>0?mn.Edit:mn.View},[e,t.editMode]),I=Pn(N=>{const H=N!==t.rowModesModel;h&&H&&h(N,{}),!(t.rowModesModel&&H)&&(r(N),o.current=N,e.current.publishEvent("rowModesModelChange",N))}),k=u.useCallback((N,H)=>{const W=E({},o.current);H!==null?W[N]=E({},H):delete W[N],I(W)},[I]),M=u.useCallback((N,H)=>{e.current.setState(W=>{const K=E({},W.editRows);return H!==null?K[N]=H:delete K[N],E({},W,{editRows:K})}),e.current.forceUpdate()},[e]),O=u.useCallback((N,H,W)=>{e.current.setState(K=>{const Y=E({},K.editRows);return W!==null?Y[N]=E({},Y[N],{[H]:E({},W)}):(delete Y[N][H],Object.keys(Y[N]).length===0&&delete Y[N]),E({},K,{editRows:Y})}),e.current.forceUpdate()},[e]),F=u.useCallback(N=>{const{id:H}=N,W=ne(N,jhe);y(H,mn.View),k(H,E({mode:mn.Edit},W))},[y,k]),L=Pn(N=>{const{id:H,fieldToFocus:W,deleteValue:K,initialValue:Y}=N,re=zs(e).reduce((de,se)=>{if(!e.current.getCellParams(H,se).isEditable)return de;let Ee=e.current.getCellValue(H,se),ye=!1;return W===se&&(K||Y)&&(Ee=K?"":Y,ye=!0),de[se]={value:Ee,error:!1,isProcessingProps:!1,unstable_updateValueOnRender:ye},de},{});M(H,re),W&&e.current.setCellFocus(H,W)}),D=u.useCallback(N=>{const{id:H}=N,W=ne(N,Hhe);y(H,mn.Edit),k(H,E({mode:mn.View},W))},[y,k]),B=Pn(N=>{const{id:H,ignoreModifications:W,field:K,cellToFocusAfter:Y="none"}=N;e.current.runPendingEditCellValueMutation(H);const ie=()=>{Y!=="none"&&K&&e.current.moveFocusToRelativeCell(H,K,Y),M(H,null),k(H,null)};if(W){ie();return}const re=Hr(e.current.state),de=e.current.getRow(H);if(Object.values(re[H]).some(ye=>ye.isProcessingProps)){i.current[H].mode=mn.Edit;return}if(Object.values(re[H]).some(ye=>ye.error)){i.current[H].mode=mn.Edit,k(H,{mode:mn.Edit});return}const Ee=e.current.getRowWithUpdatedValuesFromRowEditing(H);if(c){const ye=_e=>{i.current[H].mode=mn.Edit,k(H,{mode:mn.Edit}),d?d(_e):Vhe()};try{Promise.resolve(c(Ee,de)).then(_e=>{e.current.updateRows([_e]),ie()}).catch(ye)}catch(_e){ye(_e)}}else e.current.updateRows([Ee]),ie()}),R=u.useCallback(N=>{const{id:H,field:W,value:K,debounceMs:Y,unstable_skipValueParser:ie}=N;g(H,W);const re=e.current.getColumn(W),de=e.current.getRow(H);let se=K;re.valueParser&&!ie&&(se=re.valueParser(K,e.current.getCellParams(H,W)));let le=Hr(e.current.state),Ee=E({},le[H][W],{value:se,changeReason:Y?"debouncedSetEditCellValue":"setEditCellValue"});return re.preProcessEditCellProps||O(H,W,Ee),new Promise(ye=>{const _e=[];if(re.preProcessEditCellProps){const ee=Ee.value!==le[H][W].value;Ee=E({},Ee,{isProcessingProps:!0}),O(H,W,Ee);const ke=le[H],Re=ne(ke,[W].map(dp)),Pe=Promise.resolve(re.preProcessEditCellProps({id:H,row:de,props:Ee,hasChanged:ee,otherFieldsProps:Re})).then(pe=>{if(e.current.getRowMode(H)===mn.View){ye(!1);return}le=Hr(e.current.state),pe=E({},pe,{isProcessingProps:!1}),pe.value=re.preProcessEditCellProps?le[H][W].value:se,O(H,W,pe)});_e.push(Pe)}Object.entries(le[H]).forEach(([ee,ke])=>{if(ee===W)return;const Re=e.current.getColumn(ee);if(!Re.preProcessEditCellProps)return;ke=E({},ke,{isProcessingProps:!0}),O(H,ee,ke),le=Hr(e.current.state);const Pe=le[H],pe=ne(Pe,[ee].map(dp)),be=Promise.resolve(Re.preProcessEditCellProps({id:H,row:de,props:ke,hasChanged:!1,otherFieldsProps:pe})).then(te=>{if(e.current.getRowMode(H)===mn.View){ye(!1);return}te=E({},te,{isProcessingProps:!1}),O(H,ee,te)});_e.push(be)}),Promise.all(_e).then(()=>{e.current.getRowMode(H)===mn.Edit?(le=Hr(e.current.state),ye(!le[H][W].error)):ye(!1)})})},[e,g,O]),A=u.useCallback(N=>{const H=Hr(e.current.state),W=e.current.getRow(N);if(!H[N])return e.current.getRow(N);let K=E({},W);return Object.entries(H[N]).forEach(([Y,ie])=>{const re=e.current.getColumn(Y);re.valueSetter?K=re.valueSetter({value:ie.value,row:K}):K[Y]=ie.value}),K},[e]),z={getRowMode:_,startRowEditMode:F,stopRowEditMode:D},V={setRowEditingEditCellValue:R,getRowWithUpdatedValuesFromRowEditing:A};Ft(e,z,"public"),Ft(e,V,"private"),u.useEffect(()=>{p&&I(p)},[p,I]),u.useEffect(()=>{const N=_g(e),H=i.current;i.current=GA(n),Object.entries(n).forEach(([W,K])=>{var Y,ie;const re=((Y=H[W])==null?void 0:Y.mode)||mn.View,de=(ie=N[W])!=null?ie:W;K.mode===mn.Edit&&re===mn.View?L(E({id:de},K)):K.mode===mn.View&&re===mn.Edit&&B(E({id:de},K))})},[e,n,L,B])},Whe=e=>E({},e,{editRows:{}}),Ghe=(e,t)=>{zhe(e,t),Uhe(e,t);const n=u.useRef({}),{isCellEditable:r}=t,o=u.useCallback(m=>sp(m.rowNode)||!m.colDef.editable||!m.colDef.renderEditCell?!1:r?r(m):!0,[r]),i=(m,g,y,v)=>{if(!y){v();return}if(n.current[m]||(n.current[m]={}),n.current[m][g]){const[C]=n.current[m][g];clearTimeout(C)}const S=()=>{const[C]=n.current[m][g];clearTimeout(C),v(),delete n.current[m][g]},w=setTimeout(()=>{v(),delete n.current[m][g]},y);n.current[m][g]=[w,S]};u.useEffect(()=>{const m=n.current;return()=>{Object.entries(m).forEach(([g,y])=>{Object.keys(y).forEach(v=>{const[S]=m[g][v];clearTimeout(S),delete m[g][v]})})}},[]);const s=u.useCallback((m,g)=>{if(n.current[m]){if(!g)Object.keys(n.current[m]).forEach(y=>{const[,v]=n.current[m][y];v()});else if(n.current[m][g]){const[,y]=n.current[m][g];y()}}},[]),a=u.useCallback(m=>{const{id:g,field:y,debounceMs:v}=m;return new Promise(S=>{i(g,y,v,()=>mt(void 0,null,function*(){const w=t.editMode===vs.Row?e.current.setRowEditingEditCellValue:e.current.setCellEditingEditCellValue;if(e.current.getCellMode(g,y)===rn.Edit){const C=yield w(m);S(C)}}))})},[e,t.editMode]),c=u.useCallback((m,g)=>t.editMode===vs.Cell?e.current.getRowWithUpdatedValuesFromCellEditing(m,g):e.current.getRowWithUpdatedValuesFromRowEditing(m),[e,t.editMode]),d=u.useCallback((m,g)=>{var y,v;return(y=(v=Hr(e.current.state)[m])==null?void 0:v[g])!=null?y:null},[e]),p={isCellEditable:o,setEditCellValue:a,getRowWithUpdatedValues:c,unstable_getEditCellMeta:d},h={runPendingEditCellValueMutation:s};Ft(e,p,"public"),Ft(e,h,"private")},Khe=(e,t,n)=>(n.current.caches.rows=Tm({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),E({},e,{rows:TA({apiRef:n,rowCountProp:t.rowCount,loadingProp:t.loading,previousTree:null,previousTreeDepths:null})})),qhe=(e,t)=>{const n=Ar(e,"useGridRows"),r=ac(e,t),o=u.useRef(Date.now()),i=u.useRef(null),s=u.useCallback(L=>{const D=_l(e)[L];if(D)return D;const B=e.current.getRowNode(L);return B&&sp(B)?{[Mm]:L}:null},[e]),a=u.useMemo(()=>r.rows.reduce((L,{id:D},B)=>(L[D]=B,L),{}),[r.rows]),c=u.useCallback(({cache:L,throttle:D})=>{const B=()=>{i.current=null,o.current=Date.now(),e.current.setState(A=>E({},A,{rows:TA({apiRef:e,rowCountProp:t.rowCount,loadingProp:t.loading,previousTree:Ti(e),previousTreeDepths:fR(e)})})),e.current.publishEvent("rowsSet"),e.current.forceUpdate()};if(i.current&&(clearTimeout(i.current),i.current=null),e.current.caches.rows=L,!D){B();return}const R=t.throttleRowsMs-(Date.now()-o.current);if(R>0){i.current=setTimeout(B,R);return}B()},[t.throttleRowsMs,t.rowCount,t.loading,e]),d=u.useCallback(L=>{n.debug(`Updating all rows, new length ${L.length}`);const D=Tm({rows:L,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),B=e.current.caches.rows;D.rowsBeforePartialUpdates=B.rowsBeforePartialUpdates,c({cache:D,throttle:!0})},[n,t.getRowId,t.loading,t.rowCount,c,e]),p=u.useCallback(L=>{if(t.signature===fs.DataGrid&&L.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(`
|
|
339
|
-
`));const D=[];L.forEach(R=>{const A=Mg(R,t.getRowId,"A row was provided without id when calling updateRows():"),z=e.current.getRowNode(A);if((z==null?void 0:z.type)==="pinnedRow"){const V=e.current.caches.pinnedRows,N=V.idLookup[A];N&&(V.idLookup[A]=E({},N,R))}else D.push(R)});const B=
|
|
340
|
-
`));if(D.length===0)return;if(vy(e)>1)throw new Error("`apiRef.current.unstable_replaceRows` is not compatible with tree data and row grouping");const R=E({},Ti(e)),A=E({},_l(e)),z=E({},_g(e)),V=R[Vr],N=[...V.children];for(let W=0;W<D.length;W+=1){const K=D[W],Y=Mg(K,t.getRowId,"A row was provided without id when calling replaceRows()."),[ie]=N.splice(L+W,1,Y);delete A[ie],delete z[ie],delete R[ie];const re={id:Y,depth:0,parent:Vr,type:"leaf",groupingKey:null};A[Y]=K,z[Y]=Y,R[Y]=re}R[Vr]=E({},V,{children:N});const H=N.filter(W=>R[W].type==="leaf");e.current.caches.rows.dataRowIdToModelLookup=A,e.current.caches.rows.dataRowIdToIdLookup=z,e.current.setState(W=>E({},W,{rows:E({},W.rows,{dataRowIdToModelLookup:A,dataRowIdToIdLookup:z,dataRowIds:H,tree:R})})),e.current.publishEvent("rowsSet")},[e,t.signature,t.getRowId]),P={getRow:s,getRowModels:h,getRowsCount:m,getAllRowIds:g,setRows:d,updateRows:p,getRowNode:S,getRowIndexRelativeToVisibleRows:y,unstable_replaceRows:x},_={setRowIndex:C,setRowChildrenExpansion:v,getRowGroupChildren:w},I=u.useCallback(()=>{n.info("Row grouping pre-processing have changed, regenerating the row tree");let L;e.current.caches.rows.rowsBeforePartialUpdates===t.rows?L=E({},e.current.caches.rows,{updates:{type:"full",rows:sm(e)}}):L=Tm({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),c({cache:L,throttle:!1})},[n,e,t.rows,t.getRowId,t.loading,t.rowCount,c]),k=u.useCallback(L=>{L==="rowTreeCreation"&&I()},[I]),M=u.useCallback(()=>{e.current.getActiveStrategy("rowTree")!==
|
|
341
|
-
`));ri(e.current.state)!==R&&(n.debug("Setting selection model"),e.current.setState(z=>E({},z,{rowSelection:t.rowSelection?R:[]})),e.current.forceUpdate())},[e,n,t.rowSelection,t.signature,t.checkboxSelection]),y=u.useCallback(R=>ri(e.current.state).includes(R),[e]),v=u.useCallback(R=>{if(d&&!d(e.current.getRowParams(R)))return!1;const A=e.current.getRowNode(R);return!((A==null?void 0:A.type)==="footer"||(A==null?void 0:A.type)==="pinnedRow")},[e,d]),S=u.useCallback(()=>que(e),[e]),w=u.useCallback((R,A=!0,z=!1)=>{if(e.current.isRowSelectable(R))if(i.current=R,z)n.debug(`Setting selection for row ${R}`),e.current.setRowSelectionModel(A?[R]:[]);else{n.debug(`Toggling selection for row ${R}`);const N=ri(e.current.state).filter(W=>W!==R);A&&N.push(R),(N.length<2||p)&&e.current.setRowSelectionModel(N)}},[e,n,p]),C=u.useCallback((R,A=!0,z=!1)=>{n.debug("Setting selection for several rows");const V=R.filter(W=>e.current.isRowSelectable(W));let N;if(z)N=A?V:[];else{const W=E({},Fg(e));V.forEach(K=>{A?W[K]=K:delete W[K]}),N=Object.values(W)}(N.length<2||p)&&e.current.setRowSelectionModel(N)},[e,n,p]),x=u.useCallback(({startId:R,endId:A},z=!0,V=!1)=>{if(!e.current.getRow(R)||!e.current.getRow(A))return;n.debug(`Expanding selection from row ${R} to row ${A}`);const N=If(e),H=N.indexOf(R),W=N.indexOf(A),[K,Y]=H>W?[W,H]:[H,W],ie=N.slice(K,Y+1);e.current.selectRows(ie,z,V)},[e,n]),P={selectRow:w,setRowSelectionModel:g,getSelectedRows:S,isRowSelected:y,isRowSelectable:v},_={selectRows:C,selectRowRange:x};Ft(e,P,"public"),Ft(e,_,t.signature===fs.DataGrid?"private":"public");const I=u.useCallback(()=>{if(t.keepNonExistentRowsSelected)return;const R=ri(e.current.state),A=_l(e),z=E({},Fg(e));let V=!1;R.forEach(N=>{A[N]||(delete z[N],V=!0)}),V&&e.current.setRowSelectionModel(Object.values(z))},[e,t.keepNonExistentRowsSelected]),k=u.useCallback((R,A)=>{const z=A.metaKey||A.ctrlKey,V=!s&&!z&&!Tce(A),N=!p||V,H=e.current.isRowSelected(R);N?e.current.selectRow(R,V?!0:!H,!0):e.current.selectRow(R,!H,!1)},[e,p,s]),M=u.useCallback((R,A)=>{var z;if(c)return;const V=(z=A.target.closest(`.${X.cell}`))==null?void 0:z.getAttribute("data-field");V===Np.field||V===lE||V&&e.current.getColumn(V).type===Sy||e.current.getRowNode(R.id).type==="pinnedRow"||(A.shiftKey&&(p||s)?m(R.id):k(R.id,A))},[c,p,s,e,m,k]),O=u.useCallback((R,A)=>{if(p&&A.shiftKey){var z;(z=window.getSelection())==null||z.removeAllRanges()}},[p]),F=u.useCallback((R,A)=>{A.nativeEvent.shiftKey?m(R.id):e.current.selectRow(R.id,R.value)},[e,m]),L=u.useCallback(R=>{const z=t.checkboxSelectionVisibleOnly&&t.pagination?XA(e):If(e);e.current.selectRows(z,R.value)},[e,t.checkboxSelectionVisibleOnly,t.pagination]),D=u.useCallback((R,A)=>{if(e.current.getCellMode(R.id,R.field)!==rn.Edit&&A.currentTarget.contains(A.target)){if(Lg(A.key)&&A.shiftKey){const z=ii(e);if(z&&z.id!==R.id){A.preventDefault();const V=e.current.isRowSelected(z.id);if(!p){e.current.selectRow(z.id,!V,!0);return}const N=e.current.getRowIndexRelativeToVisibleRows(z.id),H=e.current.getRowIndexRelativeToVisibleRows(R.id);let W,K;N>H?V?(W=H,K=N-1):(W=H,K=N):V?(W=N+1,K=H):(W=N,K=H);const Y=h.rows.slice(W,K+1).map(ie=>ie.id);e.current.selectRows(Y,!V);return}}if(A.key===" "&&A.shiftKey){A.preventDefault(),k(R.id,A);return}A.key==="a"&&(A.ctrlKey||A.metaKey)&&(A.preventDefault(),C(e.current.getAllRowIds(),!0))}},[e,k,C,h.rows,p]);ot(e,"sortedRowsSet",r(I)),ot(e,"rowClick",r(M)),ot(e,"rowSelectionCheckboxChange",r(F)),ot(e,"headerSelectionCheckboxChange",L),ot(e,"cellMouseDown",r(O)),ot(e,"cellKeyDown",r(D)),u.useEffect(()=>{o!==void 0&&e.current.setRowSelectionModel(o)},[e,o,t.rowSelection]),u.useEffect(()=>{t.rowSelection||e.current.setRowSelectionModel([])},[e,t.rowSelection]);const B=o!=null;u.useEffect(()=>{if(B||!t.rowSelection)return;const R=ri(e.current.state);if(v){const A=R.filter(z=>v(z));A.length<R.length&&e.current.setRowSelectionModel(A)}},[e,v,B,t.rowSelection]),u.useEffect(()=>{if(!t.rowSelection||B)return;const R=ri(e.current.state);!p&&R.length>1&&e.current.setRowSelectionModel([])},[e,p,s,B,t.rowSelection])},tme={noRowsLabel:"No rows",noResultsOverlayLabel:"No results found.",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:e=>e!==1?`${e} active filters`:`${e} 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",filterPanelRemoveAll:"Remove all",filterPanelDeleteIconLabel:"Delete",filterPanelLogicOperator:"Logic operator",filterPanelOperator:"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","filterOperator=":"=","filterOperator!=":"!=","filterOperator>":">","filterOperator>=":">=","filterOperator<":"<","filterOperator<=":"<=",headerFilterOperatorContains:"Contains",headerFilterOperatorEquals:"Equals",headerFilterOperatorStartsWith:"Starts with",headerFilterOperatorEndsWith:"Ends with",headerFilterOperatorIs:"Is",headerFilterOperatorNot:"Is not",headerFilterOperatorAfter:"Is after",headerFilterOperatorOnOrAfter:"Is on or after",headerFilterOperatorBefore:"Is before",headerFilterOperatorOnOrBefore:"Is on or before",headerFilterOperatorIsEmpty:"Is empty",headerFilterOperatorIsNotEmpty:"Is not empty",headerFilterOperatorIsAnyOf:"Is any of","headerFilterOperator=":"Equals","headerFilterOperator!=":"Not equals","headerFilterOperator>":"Greater than","headerFilterOperator>=":"Greater than or equal to","headerFilterOperator<":"Less than","headerFilterOperator<=":"Less than or equal to",filterValueAny:"any",filterValueTrue:"true",filterValueFalse:"false",columnMenuLabel:"Menu",columnMenuShowColumns:"Show columns",columnMenuManageColumns:"Manage columns",columnMenuFilter:"Filter",columnMenuHideColumn:"Hide column",columnMenuUnsort:"Unsort",columnMenuSortAsc:"Sort by ASC",columnMenuSortDesc:"Sort by DESC",columnHeaderFiltersTooltipActive:e=>e!==1?`${e} active filters`:`${e} active filter`,columnHeaderFiltersLabel:"Show filters",columnHeaderSortIconLabel:"Sort",footerRowSelected:e=>e!==1?`${e.toLocaleString()} rows selected`:`${e.toLocaleString()} row selected`,footerTotalRows:"Total Rows:",footerTotalVisibleRows:(e,t)=>`${e.toLocaleString()} of ${t.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:e=>`Group by ${e}`,unGroupColumn:e=>`Stop grouping by ${e}`,detailPanelToggle:"Detail panel toggle",expandDetailPanel:"Expand",collapseDetailPanel:"Collapse",MuiTablePagination:{},rowReorderingHeaderName:"Row reordering",aggregationMenuItemHeader:"Aggregation",aggregationFunctionLabelSum:"sum",aggregationFunctionLabelAvg:"avg",aggregationFunctionLabelMin:"min",aggregationFunctionLabelMax:"max",aggregationFunctionLabelSize:"size"},nme=e=>{const{classes:t}=e;return u.useMemo(()=>Me({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},Bt,t),[t])},rme=(e,t)=>{const n={classes:t.classes},r=nme(n),o=u.useCallback(i=>{const s=E({},Np,{cellClassName:r.cellCheckbox,headerClassName:r.columnHeaderCheckbox,headerName:e.current.getLocaleText("checkboxSelectionHeaderName")}),a=t.checkboxSelection,c=i.lookup[ml]!=null;return a&&!c?(i.lookup[ml]=s,i.orderedFields=[ml,...i.orderedFields]):!a&&c?(delete i.lookup[ml],i.orderedFields=i.orderedFields.filter(d=>d!==ml)):a&&c&&(i.lookup[ml]=E({},s,i.lookup[ml])),i},[e,r,t.checkboxSelection]);ir(e,"hydrateColumns",o)},ome=(e,t)=>{var n,r,o,i;const s=(n=(r=t.sortModel)!=null?r:(o=t.initialState)==null||(i=o.sorting)==null?void 0:i.sortModel)!=null?n:[];return E({},e,{sorting:{sortModel:JA(s,t.disableMultipleColumnsSorting),sortedRows:[]}})},ime=(e,t)=>{var n,r;const o=Ar(e,"useGridSorting");e.current.registerControlState({stateId:"sortModel",propModel:t.sortModel,propOnChange:t.onSortModelChange,stateSelector:ni,changeEvent:"sortModelChange"});const i=u.useCallback((k,M)=>{const O=ni(e),F=O.findIndex(D=>D.field===k);let L=[...O];return F>-1?M?L.splice(F,1,M):L.splice(F,1):L=[...O,M],L},[e]),s=u.useCallback((k,M)=>{var O;const L=ni(e).find(B=>B.field===k.field);if(L){var D;const B=M===void 0?vR((D=k.sortingOrder)!=null?D:t.sortingOrder,L.sort):M;return B==null?void 0:E({},L,{sort:B})}return{field:k.field,sort:M===void 0?vR((O=k.sortingOrder)!=null?O:t.sortingOrder):M}},[e,t.sortingOrder]),a=u.useCallback((k,M)=>M==null||M.sortable===!1?k:(M.sortingOrder||t.sortingOrder).some(F=>!!F)?[...k,"columnMenuSortItem"]:k,[t.sortingOrder]),c=u.useCallback(()=>{e.current.setState(k=>{if(t.sortingMode==="server")return o.debug("Skipping sorting rows as sortingMode = server"),E({},k,{sorting:E({},k.sorting,{sortedRows:eE(Ti(e),Vr,!1)})});const M=ni(k,e.current.instanceId),O=Zue(M,e),F=e.current.applyStrategyProcessor("sorting",{sortRowList:O});return E({},k,{sorting:E({},k.sorting,{sortedRows:F})})}),e.current.publishEvent("sortedRowsSet"),e.current.forceUpdate()},[e,o,t.sortingMode]),d=u.useCallback(k=>{ni(e)!==k&&(o.debug("Setting sort model"),e.current.setState(gR(k,t.disableMultipleColumnsSorting)),e.current.forceUpdate(),e.current.applySorting())},[e,o,t.disableMultipleColumnsSorting]),p=u.useCallback((k,M,O)=>{if(!k.sortable)return;const F=s(k,M);let L;!O||t.disableMultipleColumnsSorting?L=F?[F]:[]:L=i(k.field,F),e.current.setSortModel(L)},[e,i,s,t.disableMultipleColumnsSorting]),h=u.useCallback(()=>ni(e),[e]),m=u.useCallback(()=>XS(e).map(M=>M.model),[e]),g=u.useCallback(()=>QS(e),[e]),y=u.useCallback(k=>e.current.getSortedRowIds()[k],[e]);Ft(e,{getSortModel:h,getSortedRows:m,getSortedRowIds:g,getRowIdFromRowIndex:y,setSortModel:d,sortColumn:p,applySorting:c},"public");const S=u.useCallback((k,M)=>{var O,F;const L=ni(e);return!M.exportOnlyDirtyModels||t.sortModel!=null||((O=t.initialState)==null||(F=O.sorting)==null?void 0:F.sortModel)!=null||L.length>0?E({},k,{sorting:{sortModel:L}}):k},[e,t.sortModel,(n=t.initialState)==null||(r=n.sorting)==null?void 0:r.sortModel]),w=u.useCallback((k,M)=>{var O;const F=(O=M.stateToRestore.sorting)==null?void 0:O.sortModel;return F==null?k:(e.current.setState(gR(F,t.disableMultipleColumnsSorting)),E({},k,{callbacks:[...k.callbacks,e.current.applySorting]}))},[e,t.disableMultipleColumnsSorting]),C=u.useCallback(k=>{const M=Ti(e),O=M[Vr],F=k.sortRowList?k.sortRowList(O.children.map(L=>M[L])):[...O.children];return O.footerId!=null&&F.push(O.footerId),F},[e]);ir(e,"exportState",S),ir(e,"restoreState",w),Ng(e,Ja,"sorting",C);const x=u.useCallback(({colDef:k},M)=>{const O=M.shiftKey||M.metaKey||M.ctrlKey;p(k,void 0,O)},[p]),P=u.useCallback(({colDef:k},M)=>{_ce(M.key)&&!M.ctrlKey&&!M.metaKey&&p(k,void 0,M.shiftKey)},[p]),_=u.useCallback(()=>{const k=ni(e),M=id(e);if(k.length>0){const O=k.filter(F=>M[F.field]);O.length<k.length&&e.current.setSortModel(O)}},[e]),I=u.useCallback(k=>{k==="sorting"&&e.current.applySorting()},[e]);ir(e,"columnMenu",a),ot(e,"columnHeaderClick",x),ot(e,"columnHeaderKeyDown",P),ot(e,"rowsSet",e.current.applySorting),ot(e,"columnsChange",_),ot(e,"activeStrategyProcessorChange",I),Lp(()=>{e.current.applySorting()}),ln(()=>{t.sortModel!==void 0&&e.current.setSortModel(t.sortModel)},[e,t.sortModel])};function zR(e){const{clientHeight:t,scrollTop:n,offsetHeight:r,offsetTop:o}=e,i=o+r;if(r>t)return o;if(i-t>n)return i-t;if(o<n)return o}const sme=(e,t)=>{const n=lr(),r=Ar(e,"useGridScroll"),o=e.current.columnHeadersElementRef,i=e.current.virtualScrollerRef,s=Ge(e,ia),a=u.useCallback(h=>{const m=gy(e),g=Or(e);if(!(h.rowIndex==null)&&m===0||g.length===0)return!1;r.debug(`Scrolling to cell at row ${h.rowIndex}, col: ${h.colIndex} `);let v={};if(h.colIndex!=null){const x=Hu(e);let P;if(typeof h.rowIndex!="undefined"){var S;const _=(S=s[h.rowIndex])==null?void 0:S.id,I=e.current.unstable_getCellColSpanInfo(_,h.colIndex);I&&!I.spannedByColSpan&&(P=I.cellProps.width)}typeof P=="undefined"&&(P=g[h.colIndex].computedWidth),v.left=zR({clientHeight:i.current.clientWidth,scrollTop:Math.abs(i.current.scrollLeft),offsetHeight:P,offsetTop:x[h.colIndex]})}if(h.rowIndex!=null){var w,C;const x=cp(e.current.state),P=Uue(e),_=Wue(e),I=t.pagination?h.rowIndex-P*_:h.rowIndex,k=x.positions[I+1]?x.positions[I+1]-x.positions[I]:x.currentPageTotalHeight-x.positions[I],M=((w=i.current.querySelector(`.${X["pinnedRows--top"]}`))==null?void 0:w.clientHeight)||0,O=((C=i.current.querySelector(`.${X["pinnedRows--bottom"]}`))==null?void 0:C.clientHeight)||0;v.top=zR({clientHeight:i.current.clientHeight-M-O,scrollTop:i.current.scrollTop,offsetHeight:k,offsetTop:x.positions[I]})}return v=e.current.unstable_applyPipeProcessors("scrollToIndexes",v,h),typeof v.left!==void 0||typeof v.top!==void 0?(e.current.scroll(v),!0):!1},[r,e,i,t.pagination,s]),c=u.useCallback(h=>{if(i.current&&h.left!=null&&o.current){const m=n.direction==="rtl"?-1:1;o.current.scrollLeft=h.left,i.current.scrollLeft=m*h.left,r.debug(`Scrolling left: ${h.left}`)}i.current&&h.top!=null&&(i.current.scrollTop=h.top,r.debug(`Scrolling top: ${h.top}`)),r.debug("Scrolling, updating container, and viewport")},[i,n.direction,o,r]),d=u.useCallback(()=>i!=null&&i.current?{top:i.current.scrollTop,left:i.current.scrollLeft}:{top:0,left:0},[i]);Ft(e,{scroll:c,scrollToIndexes:a,getScrollPosition:d},"public")};function lme(e,t){xn(e,"columnHeaderClick",t.onColumnHeaderClick),xn(e,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),xn(e,"columnHeaderOver",t.onColumnHeaderOver),xn(e,"columnHeaderOut",t.onColumnHeaderOut),xn(e,"columnHeaderEnter",t.onColumnHeaderEnter),xn(e,"columnHeaderLeave",t.onColumnHeaderLeave),xn(e,"cellClick",t.onCellClick),xn(e,"cellDoubleClick",t.onCellDoubleClick),xn(e,"cellKeyDown",t.onCellKeyDown),xn(e,"preferencePanelClose",t.onPreferencePanelClose),xn(e,"preferencePanelOpen",t.onPreferencePanelOpen),xn(e,"menuOpen",t.onMenuOpen),xn(e,"menuClose",t.onMenuClose),xn(e,"rowDoubleClick",t.onRowDoubleClick),xn(e,"rowClick",t.onRowClick),xn(e,"stateChange",t.onStateChange)}const ame=({content:e,container:t,scrollBarSize:n})=>{const r=e.width>t.width,o=e.height>t.height;let i=!1,s=!1;return(r||o)&&(i=r,s=e.height+(i?n:0)>t.height,s&&(i=e.width+n>t.width)),{hasScrollX:i,hasScrollY:s}};function cme(e,t){const n=Ar(e,"useResizeContainer"),r=u.useRef(!1),o=u.useRef(null),i=u.useRef(null),s=Ge(e,cp),a=Ge(e,ld),c=Math.floor(t.rowHeight*a),d=uE(e,t.columnHeaderHeight),p=u.useCallback(()=>{var k;const M=(k=e.current.rootElementRef)==null?void 0:k.current,O=YS(e),F=OA(e);if(!o.current)return;let L;if(t.scrollbarSize!=null)L=t.scrollbarSize;else if(!O||!M)L=0;else{const H=vn(M).createElement("div");H.style.width="99px",H.style.height="99px",H.style.position="absolute",H.style.overflow="scroll",H.className="scrollDiv",M.appendChild(H),L=H.offsetWidth-H.clientWidth,M.removeChild(H)}let D,B,R;if(t.autoHeight)R=!1,B=Math.round(O)>Math.round(o.current.width),D={width:o.current.width,height:s.currentPageTotalHeight+(B?L:0)};else{D={width:o.current.width,height:o.current.height-d};const N=ame({content:{width:Math.round(O),height:s.currentPageTotalHeight},container:{width:Math.round(D.width),height:D.height-F.top-F.bottom},scrollBarSize:L});R=N.hasScrollY,B=N.hasScrollX}const A={width:D.width-(R?L:0),height:D.height-(B?L:0)},z={viewportOuterSize:D,viewportInnerSize:A,hasScrollX:B,hasScrollY:R,scrollBarSize:L},V=i.current;i.current=z,(z.viewportInnerSize.width!==(V==null?void 0:V.viewportInnerSize.width)||z.viewportInnerSize.height!==(V==null?void 0:V.viewportInnerSize.height))&&e.current.publishEvent("viewportInnerSizeChange",z.viewportInnerSize)},[e,t.scrollbarSize,t.autoHeight,s.currentPageTotalHeight,d]),[h,m]=u.useState(),g=u.useMemo(()=>Ws(m,60),[]),y=u.useRef();ln(()=>{h&&(p(),e.current.publishEvent("debouncedResize",o.current))},[e,h,p]);const v=u.useCallback(()=>{e.current.computeSizeAndPublishResizeEvent()},[e]),S=u.useCallback(()=>i.current,[]),w=u.useCallback(()=>{const k=e.current.getRootDimensions();if(!k)return 0;const M=sE(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(t.getRowHeight){const F=e.current.getRenderContext(),L=F.lastRowIndex-F.firstRowIndex;return Math.min(L-1,M.rows.length)}const O=Math.floor(k.viewportInnerSize.height/c);return Math.min(O,M.rows.length)},[e,t.pagination,t.paginationMode,t.getRowHeight,c]),C=u.useCallback(()=>{var k,M,O;const F=(k=e.current.mainElementRef)==null?void 0:k.current;if(!F)return;const D=Ao(F).getComputedStyle(F),B=parseFloat(D.height)||0,R=parseFloat(D.width)||0,A=B!==((M=y.current)==null?void 0:M.height),z=R!==((O=y.current)==null?void 0:O.width);if(!y.current||A||z){const V={width:R,height:B};e.current.publishEvent("resize",V),y.current=V}},[e]),x={resize:v,getRootDimensions:S},P={getViewportPageSize:w,updateGridDimensionsRef:p,computeSizeAndPublishResizeEvent:C};Ft(e,x,"public"),Ft(e,P,"private");const _=u.useRef(!0),I=u.useCallback(k=>{o.current=k;const M=/jsdom/.test(window.navigator.userAgent);if(k.height===0&&!r.current&&!t.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(`
|
|
337
|
+
`}${c}`.trim()}function FR(e){const t=document.createElement("span");t.style.whiteSpace="pre",t.style.userSelect="all",t.style.opacity="0px",t.textContent=e,document.body.appendChild(t);const n=document.createRange();n.selectNode(t);const r=window.getSelection();r.removeAllRanges(),r.addRange(n);try{document.execCommand("copy")}finally{document.body.removeChild(t)}}function ehe(e){navigator.clipboard?navigator.clipboard.writeText(e).catch(()=>{FR(e)}):FR(e)}function the(e){var t;return!!((t=window.getSelection())!=null&&t.toString()||e&&(e.selectionEnd||0)-(e.selectionStart||0)>0)}const nhe=(e,t)=>{const n=t.unstable_ignoreValueFormatterDuringExport,r=(typeof n=="object"?n==null?void 0:n.clipboardExport:n)||!1,o=t.clipboardCopyCellDelimiter,i=u.useCallback(s=>{if(!((s.ctrlKey||s.metaKey)&&s.key==="c")||the(s.target))return;let a="";if(e.current.getSelectedRows().size>0)a=e.current.getDataAsCsv({includeHeaders:!1,delimiter:o});else{const d=ii(e);if(d){const p=e.current.getCellParams(d.id,d.field);a=f4(p,{delimiterCharacter:o,ignoreValueFormatter:r})}}a=e.current.unstable_applyPipeProcessors("clipboardCopy",a),a&&(ehe(a),e.current.publishEvent("clipboardCopy",a))},[e,r,o]);Hue(e,e.current.rootElementRef,"keydown",i),xn(e,"clipboardCopy",t.onClipboardCopy)},rhe=e=>E({},e,{columnMenu:{open:!1}}),ohe=e=>{const t=Ar(e,"useGridColumnMenu"),n=u.useCallback(s=>{e.current.setState(c=>c.columnMenu.open&&c.columnMenu.field===s?c:(t.debug("Opening Column Menu"),E({},c,{columnMenu:{open:!0,field:s}})))&&(e.current.hidePreferences(),e.current.forceUpdate())},[e,t]),r=u.useCallback(()=>{const s=Bw(e.current.state);if(s.field){const c=id(e),d=Li(e),p=zs(e);let h=s.field;if(c[h]||(h=p[0]),d[h]===!1){const m=p.filter(y=>y===h?!0:d[y]!==!1),g=m.indexOf(h);h=m[g+1]||m[g-1]}e.current.setColumnHeaderFocus(h)}e.current.setState(c=>!c.columnMenu.open&&c.columnMenu.field===void 0?c:(t.debug("Hiding Column Menu"),E({},c,{columnMenu:E({},c.columnMenu,{open:!1,field:void 0})})))&&e.current.forceUpdate()},[e,t]),o=u.useCallback(s=>{t.debug("Toggle Column Menu");const a=Bw(e.current.state);!a.open||a.field!==s?n(s):r()},[e,t,n,r]);Ft(e,{showColumnMenu:n,hideColumnMenu:r,toggleColumnMenu:o},"public"),ot(e,"columnResizeStart",r),ot(e,"virtualScrollerWheel",e.current.hideColumnMenu),ot(e,"virtualScrollerTouchMove",e.current.hideColumnMenu)},p4=["maxWidth","minWidth","width","flex"];function ihe({initialFreeSpace:e,totalFlexUnits:t,flexColumns:n}){const r=new Set(n.map(s=>s.field)),o={all:{},frozenFields:[],freeze:s=>{const a=o.all[s];a&&a.frozen!==!0&&(o.all[s].frozen=!0,o.frozenFields.push(s))}};function i(){if(o.frozenFields.length===r.size)return;const s={min:{},max:{}};let a=e,c=t,d=0;o.frozenFields.forEach(p=>{a-=o.all[p].computedWidth,c-=o.all[p].flex});for(let p=0;p<n.length;p+=1){const h=n[p];if(o.all[h.field]&&o.all[h.field].frozen===!0)continue;let g=a/c*h.flex;g<h.minWidth?(d+=h.minWidth-g,g=h.minWidth,s.min[h.field]=!0):g>h.maxWidth&&(d+=h.maxWidth-g,g=h.maxWidth,s.max[h.field]=!0),o.all[h.field]={frozen:!1,computedWidth:g,flex:h.flex}}d<0?Object.keys(s.max).forEach(p=>{o.freeze(p)}):d>0?Object.keys(s.min).forEach(p=>{o.freeze(p)}):n.forEach(({field:p})=>{o.freeze(p)}),i()}return i(),o.all}const h4=(e,t)=>{const n={};let r=0,o=0;const i=[];e.orderedFields.forEach(a=>{const c=E({},e.lookup[a]);if(e.columnVisibilityModel[a]===!1)c.computedWidth=0;else{let d;c.flex&&c.flex>0?(r+=c.flex,d=0,i.push(c)):d=Vu(c.width,c.minWidth,c.maxWidth),o+=d,c.computedWidth=d}n[a]=c});const s=Math.max(t-o,0);if(r>0&&t>0){const a=ihe({initialFreeSpace:s,totalFlexUnits:r,flexColumns:i});Object.keys(a).forEach(c=>{n[c].computedWidth=a[c].computedWidth})}return E({},e,{lookup:n})},she=(e,t)=>{if(!t)return e;const{orderedFields:n=[],dimensions:r={}}=t,o=Object.keys(r);if(o.length===0&&n.length===0)return e;const i={},s=[];for(let p=0;p<n.length;p+=1){const h=n[p];e.lookup[h]&&(i[h]=!0,s.push(h))}const a=s.length===0?e.orderedFields:[...s,...e.orderedFields.filter(p=>!i[p])],c=E({},e.lookup);for(let p=0;p<o.length;p+=1){const h=o[p],m=E({},c[h],{hasBeenResized:!0});Object.entries(r[h]).forEach(([g,y])=>{m[g]=y===-1?1/0:y}),c[h]=m}return E({},e,{orderedFields:a,lookup:c})},Vc=({apiRef:e,columnsToUpsert:t,initialState:n,columnTypes:r,columnVisibilityModel:o=Li(e),keepOnlyColumnsToUpsert:i=!1})=>{var s,a,c,d;const p=!e.current.state.columns;let h;if(p)h={orderedFields:[],lookup:{},columnVisibilityModel:o};else{const v=ju(e.current.state);h={orderedFields:i?[]:[...v.orderedFields],lookup:E({},v.lookup),columnVisibilityModel:o}}let m={};i&&!p&&(m=Object.keys(h.lookup).reduce((v,S)=>E({},v,{[S]:!1}),{})),t.forEach(v=>{const{field:S}=v;m[S]=!0;let w=h.lookup[S];if(w==null){let x=r[d4];v.type&&r[v.type]&&(x=r[v.type]),w=E({},x,{field:S,hasBeenResized:!1}),h.orderedFields.push(S)}else i&&h.orderedFields.push(S);let C=w.hasBeenResized;p4.forEach(x=>{v[x]!==void 0&&(C=!0,v[x]===-1&&(v[x]=1/0))}),h.lookup[S]=E({},w,v,{hasBeenResized:C})}),i&&!p&&Object.keys(h.lookup).forEach(v=>{m[v]||delete h.lookup[v]});const g=e.current.unstable_applyPipeProcessors("hydrateColumns",h),y=she(g,n);return h4(y,(s=(a=(c=e.current).getRootDimensions)==null||(d=a.call(c))==null?void 0:d.viewportInnerSize.width)!=null?s:0)},AR=e=>t=>E({},t,{columns:e});function Ww({firstColumnToRender:e,apiRef:t,firstRowToRender:n,lastRowToRender:r,visibleRows:o}){let i=e;for(let s=n;s<r;s+=1)if(o[s]){const c=o[s].id,d=t.current.unstable_getCellColSpanInfo(c,e);d&&d.spannedByColSpan&&(i=d.leftVisibleCellIndex)}return i}function lhe({firstColumnIndex:e,minColumnIndex:t,columnBuffer:n,firstRowToRender:r,lastRowToRender:o,apiRef:i,visibleRows:s}){const a=Math.max(e-n,t);return Ww({firstColumnToRender:a,apiRef:i,firstRowToRender:r,lastRowToRender:o,visibleRows:s})}function uE(e,t){const n=ld(e),r=Op(e);return Math.floor(t*n)*((r!=null?r:0)+1)}const m4=Xpe(),ahe=(e,t,n)=>{var r,o,i,s,a;const c=Vc({apiRef:n,columnTypes:m4,columnsToUpsert:t.columns,initialState:(r=t.initialState)==null?void 0:r.columns,columnVisibilityModel:(o=(i=t.columnVisibilityModel)!=null?i:(s=t.initialState)==null||(a=s.columns)==null?void 0:a.columnVisibilityModel)!=null?o:{},keepOnlyColumnsToUpsert:!0});return E({},e,{columns:c})};function che(e,t){var n,r;const o=Ar(e,"useGridColumns"),i=m4,s=u.useRef(t.columns),a=u.useRef(i);e.current.registerControlState({stateId:"visibleColumns",propModel:t.columnVisibilityModel,propOnChange:t.onColumnVisibilityModelChange,stateSelector:Li,changeEvent:"columnVisibilityModelChange"});const c=u.useCallback(R=>{o.debug("Updating columns state."),e.current.setState(AR(R)),e.current.forceUpdate(),e.current.publishEvent("columnsChange",R.orderedFields)},[o,e]),d=u.useCallback(R=>id(e)[R],[e]),p=u.useCallback(()=>ds(e),[e]),h=u.useCallback(()=>Or(e),[e]),m=u.useCallback((R,A=!0)=>(A?Or(e):ds(e)).findIndex(V=>V.field===R),[e]),g=u.useCallback(R=>{const A=m(R);return Hu(e)[A]},[e,m]),y=u.useCallback(R=>{Li(e)!==R&&(e.current.setState(z=>E({},z,{columns:Vc({apiRef:e,columnTypes:i,columnsToUpsert:[],initialState:void 0,columnVisibilityModel:R,keepOnlyColumnsToUpsert:!1})})),e.current.forceUpdate())},[e,i]),v=u.useCallback(R=>{const A=Vc({apiRef:e,columnTypes:i,columnsToUpsert:R,initialState:void 0,keepOnlyColumnsToUpsert:!1});c(A)},[e,c,i]),S=u.useCallback((R,A)=>{var z;const V=Li(e),N=(z=V[R])!=null?z:!0;if(A!==N){const H=E({},V,{[R]:A});e.current.setColumnVisibilityModel(H)}},[e]),w=u.useCallback(R=>zs(e).findIndex(z=>z===R),[e]),C=u.useCallback((R,A)=>{const z=zs(e),V=w(R);if(V===A)return;o.debug(`Moving column ${R} to index ${A}`);const N=[...z],H=N.splice(V,1)[0];N.splice(A,0,H),c(E({},ju(e.current.state),{orderedFields:N}));const W={column:e.current.getColumn(R),targetIndex:e.current.getColumnIndexRelativeToVisibleColumns(R),oldIndex:V};e.current.publishEvent("columnIndexChange",W)},[e,o,c,w]),x=u.useCallback((R,A)=>{o.debug(`Updating column ${R} width to ${A}`);const z=e.current.getColumn(R),V=E({},z,{width:A});e.current.updateColumns([V]),e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(R),colDef:V,width:A})},[e,o]),P={getColumn:d,getAllColumns:p,getColumnIndex:m,getColumnPosition:g,getVisibleColumns:h,getColumnIndexRelativeToVisibleColumns:w,updateColumns:v,setColumnVisibilityModel:y,setColumnVisibility:S,setColumnWidth:x},_={setColumnIndex:C};Ft(e,P,"public"),Ft(e,_,t.signature===fs.DataGrid?"private":"public");const I=u.useCallback((R,A)=>{var z,V,N;const H={},W=Li(e);(!A.exportOnlyDirtyModels||t.columnVisibilityModel!=null||Object.keys((z=(V=t.initialState)==null||(N=V.columns)==null?void 0:N.columnVisibilityModel)!=null?z:{}).length>0||Object.keys(W).length>0)&&(H.columnVisibilityModel=W),H.orderedFields=zs(e);const Y=ds(e),ie={};return Y.forEach(re=>{if(re.hasBeenResized){const de={};p4.forEach(se=>{let le=re[se];le===1/0&&(le=-1),de[se]=le}),ie[re.field]=de}}),Object.keys(ie).length>0&&(H.dimensions=ie),E({},R,{columns:H})},[e,t.columnVisibilityModel,(n=t.initialState)==null?void 0:n.columns]),k=u.useCallback((R,A)=>{var z;const V=(z=A.stateToRestore.columns)==null?void 0:z.columnVisibilityModel,N=A.stateToRestore.columns;if(V==null&&N==null)return R;const H=Vc({apiRef:e,columnTypes:i,columnsToUpsert:[],initialState:N,columnVisibilityModel:V,keepOnlyColumnsToUpsert:!1});return e.current.setState(AR(H)),N!=null&&e.current.publishEvent("columnsChange",H.orderedFields),R},[e,i]),M=u.useCallback((R,A)=>{if(A===Xa.columns){var z;const V=t.slots.columnsPanel;return T.jsx(V,E({},(z=t.slotProps)==null?void 0:z.columnsPanel))}return R},[t.slots.columnsPanel,(r=t.slotProps)==null?void 0:r.columnsPanel]),O=u.useCallback(R=>t.disableColumnSelector?R:[...R,"columnMenuColumnsItem"],[t.disableColumnSelector]);ir(e,"columnMenu",O),ir(e,"exportState",I),ir(e,"restoreState",k),ir(e,"preferencePanel",M);const F=u.useRef(null);ot(e,"viewportInnerSizeChange",R=>{F.current!==R.width&&(F.current=R.width,c(h4(ju(e.current.state),R.width)))});const D=u.useCallback(()=>{o.info("Columns pipe processing have changed, regenerating the columns");const R=Vc({apiRef:e,columnTypes:i,columnsToUpsert:[],initialState:void 0,keepOnlyColumnsToUpsert:!1});c(R)},[e,o,c,i]);cE(e,"hydrateColumns",D);const B=u.useRef(!0);u.useEffect(()=>{if(B.current){B.current=!1;return}if(o.info(`GridColumns have changed, new length ${t.columns.length}`),s.current===t.columns&&a.current===i)return;const R=Vc({apiRef:e,columnTypes:i,initialState:void 0,columnsToUpsert:t.columns,keepOnlyColumnsToUpsert:!0});s.current=t.columns,a.current=i,c(R)},[o,e,c,t.columns,i]),u.useEffect(()=>{t.columnVisibilityModel!==void 0&&e.current.setColumnVisibilityModel(t.columnVisibilityModel)},[e,o,t.columnVisibilityModel])}const uhe=.7,dhe=1.3,g4={compact:uhe,comfortable:dhe,standard:1},fhe=(e,t)=>E({},e,{density:{value:t.density,factor:g4[t.density]}}),phe=(e,t)=>{const n=Ar(e,"useDensity"),r=u.useCallback(i=>{n.debug(`Set grid density to ${i}`),e.current.setState(s=>{const a=ZS(s),c={value:i,factor:g4[i]};return La(a,c)?s:E({},s,{density:c})}),e.current.forceUpdate()},[n,e]);u.useEffect(()=>{e.current.setDensity(t.density)},[e,t.density]),Ft(e,{setDensity:r},"public")};function hhe(e,t="csv",n=document.title||"untitled"){const r=`${n}.${t}`;if("download"in HTMLAnchorElement.prototype){const o=URL.createObjectURL(e),i=document.createElement("a");i.href=o,i.download=r,i.click(),setTimeout(()=>{URL.revokeObjectURL(o)});return}throw new Error("MUI: exportAs not supported")}const v4=({apiRef:e,options:t})=>{const n=ds(e);return t.fields?t.fields.map(o=>n.find(i=>i.field===o)).filter(o=>!!o):(t.allColumns?n:Or(e)).filter(o=>!o.disableExport)},mhe=({apiRef:e})=>{var t,n;const r=Lae(e),o=Ti(e),i=e.current.getSelectedRows(),s=r.filter(p=>o[p].type!=="footer"),a=sd(e),c=(a==null||(t=a.top)==null?void 0:t.map(p=>p.id))||[],d=(a==null||(n=a.bottom)==null?void 0:n.map(p=>p.id))||[];return s.unshift(...c),s.push(...d),i.size>0?s.filter(p=>i.has(p)):s},ghe=(e,t)=>{const n=Ar(e,"useGridCsvExport"),r=t.unstable_ignoreValueFormatterDuringExport,o=(typeof r=="object"?r==null?void 0:r.csvExport:r)||!1,i=u.useCallback((d={})=>{var p,h,m;n.debug("Get data as CSV");const g=v4({apiRef:e,options:d}),v=((p=d.getRowsToExport)!=null?p:mhe)({apiRef:e});return Zpe({columns:g,rowIds:v,delimiterCharacter:d.delimiter||",",includeHeaders:(h=d.includeHeaders)!=null?h:!0,includeColumnGroupsHeaders:(m=d.includeColumnGroupsHeaders)!=null?m:!0,ignoreValueFormatter:o,apiRef:e})},[n,e,o]),s=u.useCallback(d=>{n.debug("Export data as CSV");const p=i(d),h=new Blob([d!=null&&d.utf8WithBom?new Uint8Array([239,187,191]):"",p],{type:"text/csv"});hhe(h,"csv",d==null?void 0:d.fileName)},[n,i]);Ft(e,{getDataAsCsv:i,exportDataAsCsv:s},"public");const c=u.useCallback((d,p)=>{var h;return(h=p.csvOptions)!=null&&h.disableToolbarButton?d:[...d,{component:T.jsx(Qfe,{options:p.csvOptions}),componentName:"csvExport"}]},[]);ir(e,"exportMenu",c)};function vhe(){return new Promise(e=>{requestAnimationFrame(()=>{e()})})}function yhe(e){const t=document.createElement("iframe");return t.style.position="absolute",t.style.width="0px",t.style.height="0px",t.title=e||document.title,t}const bhe=(e,t)=>{const n=Ar(e,"useGridPrintExport"),r=u.useRef(null),o=u.useRef(null),i=u.useRef({});u.useEffect(()=>{r.current=vn(e.current.rootElementRef.current)},[e]);const s=u.useCallback((m,g)=>new Promise(y=>{if(!m&&!g){y();return}const v=v4({apiRef:e,options:{fields:m,allColumns:g}}).map(C=>C.field),S=ds(e),w={};S.forEach(C=>{w[C.field]=v.includes(C.field)}),e.current.setColumnVisibilityModel(w),y()}),[e]),a=u.useCallback((m,g)=>{var y,v;const S=E({copyStyles:!0,hideToolbar:!1,hideFooter:!1},g),w=m.contentDocument;if(!w)return;const C=cp(e.current.state),x=e.current.rootElementRef.current,P=x.cloneNode(!0),_=P.querySelector(`.${X.main}`);_.style.overflow="visible",P.style.contain="size";const k=P.querySelector(`.${X.columnHeaders}`).querySelector(`.${X.columnHeadersInner}`);k.style.width="100%";let M=((y=x.querySelector(`.${X.toolbarContainer}`))==null?void 0:y.offsetHeight)||0,O=((v=x.querySelector(`.${X.footerContainer}`))==null?void 0:v.offsetHeight)||0;if(S.hideToolbar){var F;(F=P.querySelector(`.${X.toolbarContainer}`))==null||F.remove(),M=0}if(S.hideFooter){var L;(L=P.querySelector(`.${X.footerContainer}`))==null||L.remove(),O=0}P.style.height=`${C.currentPageTotalHeight+uE(e,t.columnHeaderHeight)+M+O}px`,P.style.boxSizing="content-box";const D=document.createElement("div");D.appendChild(P),w.body.innerHTML=D.innerHTML;const B=typeof S.pageStyle=="function"?S.pageStyle():S.pageStyle;if(typeof B=="string"){const R=w.createElement("style");R.appendChild(w.createTextNode(B)),w.head.appendChild(R)}if(S.bodyClassName&&w.body.classList.add(...S.bodyClassName.split(" ")),S.copyStyles){const R=x.getRootNode(),z=(R.constructor.name==="ShadowRoot"?R:r.current).querySelectorAll("style, link[rel='stylesheet']");for(let V=0;V<z.length;V+=1){const N=z[V];if(N.tagName==="STYLE"){const H=w.createElement(N.tagName),W=N.sheet;if(W){let K="";for(let Y=0;Y<W.cssRules.length;Y+=1)typeof W.cssRules[Y].cssText=="string"&&(K+=`${W.cssRules[Y].cssText}\r
|
|
338
|
+
`);H.appendChild(w.createTextNode(K)),w.head.appendChild(H)}}else if(N.getAttribute("href")){const H=w.createElement(N.tagName);for(let W=0;W<N.attributes.length;W+=1){const K=N.attributes[W];K&&H.setAttribute(K.nodeName,K.nodeValue||"")}w.head.appendChild(H)}}}m.contentWindow.print()},[e,r,t.columnHeaderHeight]),c=u.useCallback(m=>{var g,y;r.current.body.removeChild(m),e.current.restoreState(o.current||{}),(g=o.current)!=null&&(y=g.columns)!=null&&y.columnVisibilityModel||e.current.setColumnVisibilityModel(i.current),e.current.unstable_enableVirtualization(),o.current=null,i.current={}},[e]),p={exportDataAsPrint:u.useCallback(m=>mt(void 0,null,function*(){if(n.debug("Export data as Print"),!e.current.rootElementRef.current)throw new Error("MUI: No grid root element available.");if(o.current=e.current.exportState(),i.current=Li(e),t.pagination){const y=_A(e);e.current.setPageSize(y)}yield s(m==null?void 0:m.fields,m==null?void 0:m.allColumns),e.current.unstable_disableVirtualization(),yield vhe();const g=yhe(m==null?void 0:m.fileName);g.onload=()=>{a(g,m),g.contentWindow.matchMedia("print").addEventListener("change",v=>{v.matches===!1&&c(g)})},r.current.body.appendChild(g)}),[t,n,e,a,c,s])};Ft(e,p,"public");const h=u.useCallback((m,g)=>{var y;return(y=g.printOptions)!=null&&y.disableToolbarButton?m:[...m,{component:T.jsx(Xfe,{options:g.printOptions}),componentName:"printExport"}]},[]);ir(e,"exportMenu",h)},Gw=(e,t)=>{const n=E({},e);if(n.id==null&&(n.id=Math.round(Math.random()*1e5)),n.operator==null){const r=id(t)[n.field];n.operator=r&&r.filterOperators[0].value}return n},whe=ws(["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"),Che=ws("MUI: The `id` field is required on `filterModel.items` when you use multiple filters.","error"),xhe=ws("MUI: The `operator` field is required on `filterModel.items`, one or more of your filtering item has no `operator` provided.","error"),y4=(e,t,n)=>{const r=e.items.length>1;let o;r&&t?(whe(),o=[e.items[0]]):o=e.items;const i=r&&o.some(a=>a.id==null),s=o.some(a=>a.operator==null);return i&&Che(),s&&xhe(),s||i?E({},e,{items:o.map(a=>Gw(a,n))}):e.items!==o?E({},e,{items:o}):e},NR=(e,t,n)=>r=>E({},r,{filterModel:y4(e,t,n)}),b4=(e,t)=>{if(!e.field||!e.operator)return null;const n=t.current.getColumn(e.field);if(!n)return null;let r;if(n.valueParser){var o;const h=n.valueParser;r=Array.isArray(e.value)?(o=e.value)==null?void 0:o.map(m=>h(m)):h(e.value)}else r=e.value;const i=E({},e,{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(h=>h.value===i.operator);if(!a)throw new Error(`MUI: No filter operator found for column '${n.field}' and operator value '${i.operator}'.`);const c=!Ag(a.getApplyFilterFn),d=!Ag(a.getApplyFilterFnV7);if(a.getApplyFilterFnV7&&!(c&&!d)){const h=a.getApplyFilterFnV7(i,n);return typeof h!="function"?null:{v7:!0,item:i,fn:m=>{const g=t.current.getRowValue(m,n);return h(g,m,n,t)}}}const p=a.getApplyFilterFn(i,n);return typeof p!="function"?null:{v7:!1,item:i,fn:h=>{const m=t.current.getCellParams(h,i.field);Hw.current=t;const g=p(m);return Hw.current=null,g}}},She=(e,t,n)=>{const{items:r}=t,o=r.map(i=>b4(i,n)).filter(i=>!!i);return o.length===0?null:(i,s)=>{const a={};for(let c=0;c<o.length;c+=1){const d=o[c];(!s||s(d.item.field))&&(a[d.item.id]=d.v7?d.fn(i):d.fn(e?e(i):i.id))}return a}},Ehe=(e,t,n)=>{var r,o,i;const s=(r=(o=t.quickFilterValues)==null?void 0:o.filter(Boolean))!=null?r:[];if(s.length===0)return null;const c=((i=t.quickFilterExcludeHiddenColumns)!=null?i:!1)?my(n):zs(n),d=[];return c.forEach(p=>{const h=n.current.getColumn(p),m=h==null?void 0:h.getApplyQuickFilterFn,g=h==null?void 0:h.getApplyQuickFilterFnV7,y=!Ag(m),v=!Ag(g);g&&!(y&&!v)?d.push({column:h,appliers:s.map(S=>({v7:!0,fn:g(S,h,n)}))}):m&&d.push({column:h,appliers:s.map(S=>({v7:!1,fn:m(S,h,n)}))})}),function(h,m){const g={},y={};e:for(let S=0;S<s.length;S+=1){const w=s[S];for(let C=0;C<d.length;C+=1){const{column:x,appliers:P}=d[C],{field:_}=x;if(m&&!m(_))continue;const I=P[S],k=n.current.getRowValue(h,x);if(I.fn!==null)if(I.v7){if(I.fn(k,h,x,n)){g[w]=!0;continue e}}else{var v;const M=(v=y[_])!=null?v:n.current.getCellParams(e?e(h):h.id,_);if(y[_]=M,I.fn(M)){g[w]=!0;continue e}}}g[w]=!1}return g}},Phe=(e,t,n)=>{const r=She(e,t,n),o=Ehe(e,t,n);return function(s,a,c){var d,p;c.passingFilterItems=(d=r==null?void 0:r(s,a))!=null?d:null,c.passingQuickFilterValues=(p=o==null?void 0:o(s,a))!=null?p:null}},DR=e=>e!=null,Ihe=(e,t,n)=>(e.cleanedFilterItems||(e.cleanedFilterItems=n.filter(r=>b4(r,t)!==null)),e.cleanedFilterItems),khe=(e,t,n,r,o)=>{const i=Ihe(o,r,n.items),s=e.filter(DR),a=t.filter(DR);if(s.length>0){var c;const p=m=>s.some(g=>g[m.id]);if(((c=n.logicOperator)!=null?c:lp().logicOperator)===no.And){if(!i.every(p))return!1}else if(!i.some(p))return!1}if(a.length>0&&n.quickFilterValues!=null){var d;const p=m=>a.some(g=>g[m]);if(((d=n.quickFilterLogicOperator)!=null?d:lp().quickFilterLogicOperator)===no.And){if(!n.quickFilterValues.every(p))return!1}else if(!n.quickFilterValues.some(p))return!1}return!0},_he=(e,t,n)=>{var r,o,i,s;const a=(r=(o=t.filterModel)!=null?o:(i=t.initialState)==null||(s=i.filter)==null?void 0:s.filterModel)!=null?r:lp();return E({},e,{filter:{filterModel:y4(a,t.disableMultipleColumnsFiltering,n),filteredRowsLookup:{},filteredDescendantCountLookup:{}},visibleRowsLookup:{}})},$he=e=>e.filteredRowsLookup;function BR(e,t){return e.current.applyStrategyProcessor("visibleRowsLookupCreation",{tree:t.rows.tree,filteredRowsLookup:t.filter.filteredRowsLookup})}const Rhe=(e,t)=>{var n,r,o;const i=Ar(e,"useGridFilter");e.current.registerControlState({stateId:"filter",propModel:t.filterModel,propOnChange:t.onFilterModelChange,stateSelector:Cr,changeEvent:"filterModelChange"});const s=u.useCallback(()=>{e.current.setState(D=>{const B=Cr(D,e.current.instanceId),R=t.filterMode==="client"?Phe(t.getRowId,B,e):null,A=e.current.applyStrategyProcessor("filtering",{isRowMatchingFilters:R,filterModel:B!=null?B:lp()}),z=E({},D,{filter:E({},D.filter,A)}),V=BR(e,z);return E({},z,{visibleRowsLookup:V})}),e.current.publishEvent("filteredRowsSet")},[e,t.filterMode,t.getRowId]),a=u.useCallback((D,B)=>B==null||B.filterable===!1||t.disableColumnFilter?D:[...D,"columnMenuFilterItem"],[t.disableColumnFilter]),c=u.useCallback(()=>{s(),e.current.forceUpdate()},[e,s]),d=u.useCallback(D=>{const B=Cr(e),R=[...B.items],A=R.findIndex(z=>z.id===D.id);A===-1?R.push(D):R[A]=D,e.current.setFilterModel(E({},B,{items:R}),"upsertFilterItem")},[e]),p=u.useCallback(D=>{const B=Cr(e),R=[...B.items];D.forEach(A=>{const z=D.findIndex(V=>V.id===A.id);z===-1?R.push(A):R[z]=A}),e.current.setFilterModel(E({},B,{items:D}),"upsertFilterItems")},[e]),h=u.useCallback(D=>{const B=Cr(e),R=B.items.filter(A=>A.id!==D.id);R.length!==B.items.length&&e.current.setFilterModel(E({},B,{items:R}),"deleteFilterItem")},[e]),m=u.useCallback((D,B,R)=>{if(i.debug("Displaying filter panel"),D){const A=Cr(e),z=A.items.filter(W=>{var K;if(W.value!==void 0)return!(Array.isArray(W.value)&&W.value.length===0);const ie=(K=e.current.getColumn(W.field).filterOperators)==null?void 0:K.find(de=>de.value===W.operator);return!(typeof(ie==null?void 0:ie.requiresFilterValue)=="undefined"?!0:ie==null?void 0:ie.requiresFilterValue)});let V;const N=z.find(W=>W.field===D),H=e.current.getColumn(D);N?V=z:t.disableMultipleColumnsFiltering?V=[Gw({field:D,operator:H.filterOperators[0].value},e)]:V=[...z,Gw({field:D,operator:H.filterOperators[0].value},e)],e.current.setFilterModel(E({},A,{items:V}))}e.current.showPreferences(Xa.filters,B,R)},[e,i,t.disableMultipleColumnsFiltering]),g=u.useCallback(()=>{i.debug("Hiding filter panel"),e.current.hidePreferences()},[e,i]),y=u.useCallback(D=>{const B=Cr(e);B.logicOperator!==D&&e.current.setFilterModel(E({},B,{logicOperator:D}),"changeLogicOperator")},[e]),v=u.useCallback(D=>{const B=Cr(e);La(B.quickFilterValues,D)||e.current.setFilterModel(E({},B,{quickFilterValues:[...D]}))},[e]),S=u.useCallback((D,B)=>{Cr(e)!==D&&(i.debug("Setting filter model"),e.current.updateControlState("filter",NR(D,t.disableMultipleColumnsFiltering,e),B),e.current.unstable_applyFilters())},[e,i,t.disableMultipleColumnsFiltering]);Ft(e,{setFilterLogicOperator:y,unstable_applyFilters:c,deleteFilterItem:h,upsertFilterItem:d,upsertFilterItems:p,setFilterModel:S,showFilterPanel:m,hideFilterPanel:g,setQuickFilterValues:v},"public");const C=u.useCallback((D,B)=>{var R,A;const z=Cr(e);return!B.exportOnlyDirtyModels||t.filterModel!=null||((R=t.initialState)==null||(A=R.filter)==null?void 0:A.filterModel)!=null||!La(z,lp())?E({},D,{filter:{filterModel:z}}):D},[e,t.filterModel,(n=t.initialState)==null||(r=n.filter)==null?void 0:r.filterModel]),x=u.useCallback((D,B)=>{var R;const A=(R=B.stateToRestore.filter)==null?void 0:R.filterModel;return A==null?D:(e.current.updateControlState("filter",NR(A,t.disableMultipleColumnsFiltering,e),"restoreState"),E({},D,{callbacks:[...D.callbacks,e.current.unstable_applyFilters]}))},[e,t.disableMultipleColumnsFiltering]),P=u.useCallback((D,B)=>{if(B===Xa.filters){var R;const A=t.slots.filterPanel;return T.jsx(A,E({},(R=t.slotProps)==null?void 0:R.filterPanel))}return D},[t.slots.filterPanel,(o=t.slotProps)==null?void 0:o.filterPanel]),_=e.current.state.rows.dataRowIdToModelLookup,I=u.useMemo(()=>Object.values(_),[_]),{getRowId:k}=t,M=u.useCallback(D=>{if(t.filterMode!=="client"||!D.isRowMatchingFilters)return{filteredRowsLookup:{},filteredDescendantCountLookup:{}};const B=_l(e),R={},{isRowMatchingFilters:A}=D,z={},V={passingFilterItems:null,passingQuickFilterValues:null};for(let W=0;W<I.length;W+=1){const K=I[W],Y=k?k(K):K.id;A(K,void 0,V);const ie=khe([V.passingFilterItems],[V.passingQuickFilterValues],D.filterModel,e,z);R[Y]=ie}const N="auto-generated-group-footer-root";return B[N]&&(R[N]=!0),{filteredRowsLookup:R,filteredDescendantCountLookup:{}}},[e,I,t.filterMode,k]);ir(e,"columnMenu",a),ir(e,"exportState",C),ir(e,"restoreState",x),ir(e,"preferencePanel",P),Ng(e,Ja,"filtering",M),Ng(e,Ja,"visibleRowsLookupCreation",$he);const O=u.useCallback(()=>{i.debug("onColUpdated - GridColumns changed, applying filters");const D=Cr(e),B=Pae(e),R=D.items.filter(A=>A.field&&B[A.field]);R.length<D.items.length&&e.current.setFilterModel(E({},D,{items:R}))},[e,i]),F=u.useCallback(D=>{D==="filtering"&&e.current.unstable_applyFilters()},[e]),L=u.useCallback(()=>{e.current.setState(D=>E({},D,{visibleRowsLookup:BR(e,D)})),e.current.forceUpdate()},[e]);ot(e,"rowsSet",s),ot(e,"columnsChange",O),ot(e,"activeStrategyProcessorChange",F),ot(e,"rowExpansionChange",L),ot(e,"columnVisibilityModelChange",()=>{const D=Cr(e);D.quickFilterValues&&D.quickFilterExcludeHiddenColumns&&e.current.unstable_applyFilters()}),Lp(()=>{e.current.unstable_applyFilters()}),ln(()=>{t.filterModel!==void 0&&e.current.setFilterModel(t.filterModel)},[e,i,t.filterModel])},Mhe=e=>E({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},tabIndex:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}),The=(e,t)=>{const n=Ar(e,"useGridFocus"),r=u.useRef(null),o=u.useCallback((I,k)=>{I&&e.current.getRow(I.id)&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(I.id,I.field),k)},[e]),i=u.useCallback((I,k)=>{const M=ii(e);(M==null?void 0:M.id)===I&&(M==null?void 0:M.field)===k||(e.current.setState(O=>(n.debug(`Focusing on cell with id=${I} and field=${k}`),E({},O,{tabIndex:{cell:{id:I,field:k},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},focus:{cell:{id:I,field:k},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))),e.current.forceUpdate(),e.current.getRow(I)&&(M&&o(M,{}),e.current.publishEvent("cellFocusIn",e.current.getCellParams(I,k))))},[e,n,o]),s=u.useCallback((I,k={})=>{const M=ii(e);o(M,k),e.current.setState(O=>(n.debug(`Focusing on column header with colIndex=${I}`),E({},O,{tabIndex:{columnHeader:{field:I},columnHeaderFilter:null,cell:null,columnGroupHeader:null},focus:{columnHeader:{field:I},columnHeaderFilter:null,cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,o]),a=u.useCallback((I,k={})=>{const M=ii(e);o(M,k),e.current.setState(O=>(n.debug(`Focusing on column header filter with colIndex=${I}`),E({},O,{tabIndex:{columnHeader:null,columnHeaderFilter:{field:I},cell:null,columnGroupHeader:null},focus:{columnHeader:null,columnHeaderFilter:{field:I},cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,o]),c=u.useCallback((I,k,M={})=>{const O=ii(e);O&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(O.id,O.field),M),e.current.setState(F=>E({},F,{tabIndex:{columnGroupHeader:{field:I,depth:k},columnHeader:null,columnHeaderFilter:null,cell:null},focus:{columnGroupHeader:{field:I,depth:k},columnHeader:null,columnHeaderFilter:null,cell:null}})),e.current.forceUpdate()},[e]),d=u.useCallback(()=>$g(e),[e]),p=u.useCallback((I,k,M)=>{let O=e.current.getColumnIndex(k);const F=Or(e),L=sE(e,{pagination:t.pagination,paginationMode:t.paginationMode}),D=sd(e),B=[].concat(D.top||[],L.rows,D.bottom||[]);let R=B.findIndex(N=>N.id===I);M==="right"?O+=1:M==="left"?O-=1:R+=1,O>=F.length?(R+=1,R<B.length&&(O=0)):O<0&&(R-=1,R>=0&&(O=F.length-1)),R=Vu(R,0,B.length-1);const A=B[R];if(!A)return;const z=e.current.unstable_getCellColSpanInfo(A.id,O);z&&z.spannedByColSpan&&(M==="left"||M==="below"?O=z.leftVisibleCellIndex:M==="right"&&(O=z.rightVisibleCellIndex)),O=Vu(O,0,F.length-1);const V=F[O];e.current.setCellFocus(A.id,V.field)},[e,t.pagination,t.paginationMode]),h=u.useCallback(({id:I,field:k})=>{e.current.setCellFocus(I,k)},[e]),m=u.useCallback((I,k)=>{k.key==="Enter"||k.key==="Tab"||k.key==="Shift"||Lg(k.key)||e.current.setCellFocus(I.id,I.field)},[e]),g=u.useCallback(({field:I},k)=>{k.target===k.currentTarget&&e.current.setColumnHeaderFocus(I,k)},[e]),y=u.useCallback(({fields:I,depth:k},M)=>{if(M.target!==M.currentTarget)return;const O=$g(e);O!==null&&O.depth===k&&I.includes(O.field)||e.current.setColumnGroupHeaderFocus(I[0],k,M)},[e]),v=u.useCallback((I,k)=>{var M;(M=k.relatedTarget)!=null&&M.className.includes(X.columnHeader)||(n.debug("Clearing focus"),e.current.setState(O=>E({},O,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})))},[n,e]),S=u.useCallback(I=>{r.current=I},[]),w=u.useCallback(I=>{const k=r.current;r.current=null;const M=ii(e);if(!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:I,cell:k}))return;if(!M){k&&e.current.setCellFocus(k.id,k.field);return}if((k==null?void 0:k.id)===M.id&&(k==null?void 0:k.field)===M.field)return;const F=e.current.getCellElement(M.id,M.field);F!=null&&F.contains(I.target)||(k?e.current.setCellFocus(k.id,k.field):(e.current.setState(L=>E({},L,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})),e.current.forceUpdate(),o(M,I)))},[e,o]),C=u.useCallback(I=>{if(I.cellMode==="view")return;const k=ii(e);((k==null?void 0:k.id)!==I.id||(k==null?void 0:k.field)!==I.field)&&e.current.setCellFocus(I.id,I.field)},[e]),x=u.useCallback(()=>{const I=ii(e);I&&!e.current.getRow(I.id)&&e.current.setState(k=>E({},k,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))},[e]),P={setCellFocus:i,setColumnHeaderFocus:s,setColumnHeaderFilterFocus:a},_={moveFocusToRelativeCell:p,setColumnGroupHeaderFocus:c,getColumnGroupHeaderFocus:d};Ft(e,P,"public"),Ft(e,_,"private"),u.useEffect(()=>{const I=vn(e.current.rootElementRef.current);return I.addEventListener("mouseup",w),()=>{I.removeEventListener("mouseup",w)}},[e,w]),ot(e,"columnHeaderBlur",v),ot(e,"headerFilterBlur",v),ot(e,"cellDoubleClick",h),ot(e,"cellMouseDown",S),ot(e,"cellKeyDown",m),ot(e,"cellModeChange",C),ot(e,"columnHeaderFocus",g),ot(e,"columnGroupHeaderFocus",y),ot(e,"rowsSet",x)};function Ohe(e,t){const n=sd(e)||{};return[...n.top||[],...t,...n.bottom||[]]}const Y1=({currentColIndex:e,firstColIndex:t,lastColIndex:n,direction:r})=>{if(r==="rtl"){if(e<n)return e+1}else if(r==="ltr"&&e>t)return e-1;return null},Q1=({currentColIndex:e,firstColIndex:t,lastColIndex:n,direction:r})=>{if(r==="rtl"){if(e>t)return e-1}else if(r==="ltr"&&e<n)return e+1;return null},Lhe=(e,t)=>{const n=Ar(e,"useGridKeyboardNavigation"),r=ac(e,t).rows,o=lr(),i=u.useMemo(()=>Ohe(e,r),[e,r]),s=t.signature!=="DataGrid"&&t.unstable_headerFilters,a=u.useCallback((w,C,x="left")=>{const P=ia(e),_=e.current.unstable_getCellColSpanInfo(C,w);_&&_.spannedByColSpan&&(x==="left"?w=_.leftVisibleCellIndex:x==="right"&&(w=_.rightVisibleCellIndex));const I=P.findIndex(M=>M.id===C);n.debug(`Navigating to cell row ${I}, col ${w}`),e.current.scrollToIndexes({colIndex:w,rowIndex:I});const k=e.current.getVisibleColumns()[w].field;e.current.setCellFocus(C,k)},[e,n]),c=u.useCallback((w,C)=>{n.debug(`Navigating to header col ${w}`),e.current.scrollToIndexes({colIndex:w});const x=e.current.getVisibleColumns()[w].field;e.current.setColumnHeaderFocus(x,C)},[e,n]),d=u.useCallback((w,C)=>{n.debug(`Navigating to header filter col ${w}`),e.current.scrollToIndexes({colIndex:w});const x=e.current.getVisibleColumns()[w].field;e.current.setColumnHeaderFilterFocus(x,C)},[e,n]),p=u.useCallback((w,C,x)=>{n.debug(`Navigating to header col ${w}`),e.current.scrollToIndexes({colIndex:w});const{field:P}=e.current.getVisibleColumns()[w];e.current.setColumnGroupHeaderFocus(P,C,x)},[e,n]),h=u.useCallback(w=>i==null?void 0:i[w].id,[i]),m=u.useCallback((w,C)=>{const x=C.currentTarget.querySelector(`.${X.columnHeaderTitleContainerContent}`);if(!!x&&x.contains(C.target)&&w.field!==Np.field||!e.current.getRootDimensions())return;const I=e.current.getViewportPageSize(),k=w.field?e.current.getColumnIndex(w.field):0,M=0,O=i.length-1,F=0,L=Or(e).length-1,D=Op(e);let B=!0;switch(C.key){case"ArrowDown":{s?d(k,C):a(k,h(M));break}case"ArrowRight":{const R=Q1({currentColIndex:k,firstColIndex:F,lastColIndex:L,direction:o.direction});R!==null&&c(R,C);break}case"ArrowLeft":{const R=Y1({currentColIndex:k,firstColIndex:F,lastColIndex:L,direction:o.direction});R!==null&&c(R,C);break}case"ArrowUp":{D>0&&p(k,D-1,C);break}case"PageDown":{O!==null&&a(k,h(Math.min(M+I,O)));break}case"Home":{c(F,C);break}case"End":{c(L,C);break}case"Enter":{(C.ctrlKey||C.metaKey)&&e.current.toggleColumnMenu(w.field);break}case" ":break;default:B=!1}B&&C.preventDefault()},[e,i.length,s,d,a,h,o.direction,c,p]),g=u.useCallback((w,C)=>{if(!e.current.getRootDimensions())return;const P=ode(e)===w.field,_=ide(e)===w.field;if(P||_||!Lg(C.key))return;const I=e.current.getViewportPageSize(),k=w.field?e.current.getColumnIndex(w.field):0,M=0,O=i.length-1,F=0,L=Or(e).length-1;let D=!0;switch(C.key){case"ArrowDown":{const B=h(M);B!=null&&a(k,B);break}case"ArrowRight":{const B=Q1({currentColIndex:k,firstColIndex:F,lastColIndex:L,direction:o.direction});B!==null&&d(B,C);break}case"ArrowLeft":{const B=Y1({currentColIndex:k,firstColIndex:F,lastColIndex:L,direction:o.direction});B!==null?d(B,C):e.current.setColumnHeaderFilterFocus(w.field,C);break}case"ArrowUp":{c(k,C);break}case"PageDown":{O!==null&&a(k,h(Math.min(M+I,O)));break}case"Home":{d(F,C);break}case"End":{d(L,C);break}case" ":break;default:D=!1}D&&C.preventDefault()},[e,i.length,d,o.direction,c,a,h]),y=u.useCallback((w,C)=>{if(!e.current.getRootDimensions())return;const P=$g(e);if(P===null)return;const{field:_,depth:I}=P,{fields:k,depth:M,maxDepth:O}=w,F=e.current.getViewportPageSize(),L=e.current.getColumnIndex(_),D=_?e.current.getColumnIndex(_):0,B=0,R=i.length-1,A=0,z=Or(e).length-1;let V=!0;switch(C.key){case"ArrowDown":{M===O-1?c(L,C):p(L,I+1,C);break}case"ArrowUp":{M>0&&p(L,I-1,C);break}case"ArrowRight":{const N=k.length-k.indexOf(_)-1;L+N+1<=z&&p(L+N+1,I,C);break}case"ArrowLeft":{const N=k.indexOf(_);L-N-1>=A&&p(L-N-1,I,C);break}case"PageDown":{R!==null&&a(D,h(Math.min(B+F,R)));break}case"Home":{p(A,I,C);break}case"End":{p(z,I,C);break}case" ":break;default:V=!1}V&&C.preventDefault()},[e,i.length,c,p,a,h]),v=u.useCallback((w,C)=>{if(!C.currentTarget.contains(C.target))return;const x=e.current.getCellParams(w.id,w.field);if(x.cellMode===rn.Edit||!Lg(C.key)||!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:C,cell:x}))return;const _=e.current.getRootDimensions();if(i.length===0||!_)return;const I=o.direction,k=e.current.getViewportPageSize(),M=w.field?e.current.getColumnIndex(w.field):0,O=i.findIndex(A=>A.id===w.id),F=0,L=i.length-1,D=0,B=Or(e).length-1;let R=!0;switch(C.key){case"ArrowDown":{O<L&&a(M,h(O+1));break}case"ArrowUp":{O>F?a(M,h(O-1)):s?d(M,C):c(M,C);break}case"ArrowRight":{const A=Q1({currentColIndex:M,firstColIndex:D,lastColIndex:B,direction:I});A!==null&&a(A,h(O),I==="rtl"?"left":"right");break}case"ArrowLeft":{const A=Y1({currentColIndex:M,firstColIndex:D,lastColIndex:B,direction:I});A!==null&&a(A,h(O),I==="rtl"?"right":"left");break}case"Tab":{C.shiftKey&&M>D?a(M-1,h(O),"left"):!C.shiftKey&&M<B&&a(M+1,h(O),"right");break}case" ":{if(w.field===lE)break;const z=w.colDef;if(z&&z.type==="treeDataGroup")break;!C.shiftKey&&O<L&&a(M,h(Math.min(O+k,L)));break}case"PageDown":{O<L&&a(M,h(Math.min(O+k,L)));break}case"PageUp":{const A=Math.max(O-k,F);A!==O&&A>=F?a(M,h(A)):c(M,C);break}case"Home":{C.ctrlKey||C.metaKey||C.shiftKey?a(D,h(F)):a(D,h(O));break}case"End":{C.ctrlKey||C.metaKey||C.shiftKey?a(B,h(L)):a(B,h(O));break}default:R=!1}R&&C.preventDefault()},[e,i,o.direction,a,h,s,d,c]),S=u.useCallback((w,{event:C})=>C.key===" "?!1:w,[]);ir(e,"canStartEditing",S),ot(e,"columnHeaderKeyDown",m),ot(e,"headerFilterKeyDown",g),ot(e,"columnGroupHeaderKeyDown",y),ot(e,"cellKeyDown",v)},Fhe=(e,t)=>{var n,r,o;const i=E({},qA(t.autoPageSize),(n=t.paginationModel)!=null?n:(r=t.initialState)==null||(o=r.pagination)==null?void 0:o.paginationModel);return YA(i.pageSize,t.signature),E({},e,{pagination:{paginationModel:i}})},X1=(e,t,n)=>r=>{var o;let i=r.paginationModel;const s=(o=n==null?void 0:n.pageSize)!=null?o:i.pageSize,a=KA(e,s);n&&((n==null?void 0:n.page)!==i.page||(n==null?void 0:n.pageSize)!==i.pageSize)&&(i=n);const c=Wue(i.page,a);return c!==i.page&&(i=E({},i,{page:c})),YA(i.pageSize,t),{paginationModel:i}},Ahe=(e,t)=>{var n,r;const o=Ar(e,"useGridPagination"),i=Ge(e,yy),s=Ge(e,ld),a=Math.floor(t.rowHeight*s);e.current.registerControlState({stateId:"pagination",propModel:t.paginationModel,propOnChange:t.onPaginationModelChange,stateSelector:si,changeEvent:"paginationModelChange"});const c=u.useCallback(S=>{const w=si(e);S!==w.page&&(o.debug(`Setting page to ${S}`),e.current.setPaginationModel({page:S,pageSize:w.pageSize}))},[e,o]),d=u.useCallback(S=>{const w=si(e);S!==w.pageSize&&(o.debug(`Setting page size to ${S}`),e.current.setPaginationModel({pageSize:S,page:w.page}))},[e,o]),p=u.useCallback(S=>{var w;const C=si(e);S!==C&&(o.debug("Setting 'paginationModel' to",S),e.current.updateControlState("pagination",X1((w=t.rowCount)!=null?w:i,t.signature,S),"setPaginationModel"),e.current.forceUpdate())},[e,o,t.rowCount,t.signature,i]);Ft(e,{setPage:c,setPageSize:d,setPaginationModel:p},"public");const m=u.useCallback((S,w)=>{var C,x;const P=si(e);return!w.exportOnlyDirtyModels||t.paginationModel!=null||((C=t.initialState)==null||(x=C.pagination)==null?void 0:x.paginationModel)!=null||P.page!==0&&P.pageSize!==Uue(t.autoPageSize)?E({},S,{pagination:E({},S.pagination,{paginationModel:P})}):S},[e,t.paginationModel,(n=t.initialState)==null||(r=n.pagination)==null?void 0:r.paginationModel,t.autoPageSize]),g=u.useCallback((S,w)=>{var C,x,P;const _=(C=w.stateToRestore.pagination)!=null&&C.paginationModel?E({},qA(t.autoPageSize),(x=w.stateToRestore.pagination)==null?void 0:x.paginationModel):si(e);return e.current.updateControlState("pagination",X1((P=t.rowCount)!=null?P:i,t.signature,_),"stateRestorePreProcessing"),S},[e,t.autoPageSize,t.rowCount,t.signature,i]);ir(e,"exportState",m),ir(e,"restoreState",g);const y=()=>{var S;const w=si(e);(S=e.current.virtualScrollerRef)!=null&&S.current&&e.current.scrollToIndexes({rowIndex:w.page*w.pageSize}),e.current.forceUpdate()},v=u.useCallback(()=>{const S=e.current.getRootDimensions();if(!t.autoPageSize||!S)return;const w=OA(e),C=Math.floor((S.viewportInnerSize.height-w.top-w.bottom)/a);e.current.setPageSize(C)},[e,t.autoPageSize,a]);ot(e,"viewportInnerSizeChange",v),ot(e,"paginationModelChange",y),u.useEffect(()=>{},[t.rowCount,t.paginationMode]),u.useEffect(()=>{var S;e.current.updateControlState("pagination",X1((S=t.rowCount)!=null?S:i,t.signature,t.paginationModel))},[e,t.paginationModel,t.rowCount,t.paginationMode,i,t.signature]),u.useEffect(()=>{v()},[v])},Nhe=(e,t)=>{var n,r;return E({},e,{preferencePanel:(n=(r=t.initialState)==null?void 0:r.preferencePanel)!=null?n:{open:!1}})},Dhe=(e,t)=>{var n;const r=Ar(e,"useGridPreferencesPanel"),o=u.useRef(),i=u.useRef(),s=u.useCallback(()=>{r.debug("Hiding Preferences Panel");const m=ap(e.current.state);m.openedPanelValue&&e.current.publishEvent("preferencePanelClose",{openedPanelValue:m.openedPanelValue}),e.current.setState(g=>E({},g,{preferencePanel:{open:!1}})),e.current.forceUpdate()},[e,r]),a=u.useCallback(()=>{i.current=setTimeout(()=>clearTimeout(o.current),0)},[]),c=u.useCallback(()=>{o.current=setTimeout(s,100)},[s]),d=u.useCallback((m,g,y)=>{r.debug("Opening Preferences Panel"),a(),e.current.setState(v=>E({},v,{preferencePanel:E({},v.preferencePanel,{open:!0,openedPanelValue:m,panelId:g,labelId:y})})),e.current.publishEvent("preferencePanelOpen",{openedPanelValue:m}),e.current.forceUpdate()},[r,a,e]);Ft(e,{showPreferences:d,hidePreferences:c},"public");const p=u.useCallback((m,g)=>{var y;const v=ap(e.current.state);return!g.exportOnlyDirtyModels||((y=t.initialState)==null?void 0:y.preferencePanel)!=null||v.open?E({},m,{preferencePanel:v}):m},[e,(n=t.initialState)==null?void 0:n.preferencePanel]),h=u.useCallback((m,g)=>{const y=g.stateToRestore.preferencePanel;return y!=null&&e.current.setState(v=>E({},v,{preferencePanel:y})),m},[e]);ir(e,"exportState",p),ir(e,"restoreState",h),u.useEffect(()=>()=>{clearTimeout(o.current),clearTimeout(i.current)},[])},Bhe=["id","field"],zhe=["id","field"],jhe=ws(["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. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.","For more detail, see http://mui.com/components/data-grid/editing/#server-side-persistence."],"error"),Hhe=(e,t)=>{const[n,r]=u.useState({}),o=u.useRef(n),i=u.useRef({}),{processRowUpdate:s,onProcessRowUpdateError:a,cellModesModel:c,onCellModesModelChange:d}=t,p=R=>(...A)=>{t.editMode===vs.Cell&&R(...A)},h=u.useCallback((R,A)=>{const z=e.current.getCellParams(R,A);if(!e.current.isCellEditable(z))throw new Error(`MUI: The cell with id=${R} and field=${A} is not editable.`)},[e]),m=u.useCallback((R,A,z)=>{if(e.current.getCellMode(R,A)!==z)throw new Error(`MUI: The cell with id=${R} and field=${A} is not in ${z} mode.`)},[e]),g=u.useCallback((R,A)=>{if(!R.isEditable||R.cellMode===rn.Edit)return;const z=E({},R,{reason:pl.cellDoubleClick});e.current.publishEvent("cellEditStart",z,A)},[e]),y=u.useCallback((R,A)=>{if(R.cellMode===rn.View||e.current.getCellMode(R.id,R.field)===rn.View)return;const z=E({},R,{reason:$i.cellFocusOut});e.current.publishEvent("cellEditStop",z,A)},[e]),v=u.useCallback((R,A)=>{if(R.cellMode===rn.Edit){if(A.which===229)return;let z;if(A.key==="Escape"?z=$i.escapeKeyDown:A.key==="Enter"?z=$i.enterKeyDown:A.key==="Tab"&&(z=A.shiftKey?$i.shiftTabKeyDown:$i.tabKeyDown,A.preventDefault()),z){const V=E({},R,{reason:z});e.current.publishEvent("cellEditStop",V,A)}}else if(R.isEditable){let z;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:A,cellParams:R,editMode:"cell"}))return;if(zA(A)||(A.ctrlKey||A.metaKey)&&A.key==="v"?z=pl.printableKeyDown:A.key==="Enter"?z=pl.enterKeyDown:(A.key==="Delete"||A.key==="Backspace")&&(z=pl.deleteKeyDown),z){const N=E({},R,{reason:z,key:A.key});e.current.publishEvent("cellEditStart",N,A)}}},[e]),S=u.useCallback(R=>{const{id:A,field:z,reason:V,key:N,colDef:H}=R,W={id:A,field:z};if(V===pl.printableKeyDown)if(u.version.startsWith("17"))W.deleteValue=!0;else{const K=H.valueParser?H.valueParser(N):N;W.initialValue=K}else V===pl.deleteKeyDown&&(W.deleteValue=!0);e.current.startCellEditMode(W)},[e]),w=u.useCallback(R=>{const{id:A,field:z,reason:V}=R;e.current.runPendingEditCellValueMutation(A,z);let N;V===$i.enterKeyDown?N="below":V===$i.tabKeyDown?N="right":V===$i.shiftTabKeyDown&&(N="left");const H=V==="escapeKeyDown";e.current.stopCellEditMode({id:A,field:z,ignoreModifications:H,cellToFocusAfter:N})},[e]);ot(e,"cellDoubleClick",p(g)),ot(e,"cellFocusOut",p(y)),ot(e,"cellKeyDown",p(v)),ot(e,"cellEditStart",p(S)),ot(e,"cellEditStop",p(w)),xn(e,"cellEditStart",t.onCellEditStart),xn(e,"cellEditStop",t.onCellEditStop);const C=u.useCallback((R,A)=>{const z=Hr(e.current.state);return z[R]&&z[R][A]?rn.Edit:rn.View},[e]),x=Pn(R=>{const A=R!==t.cellModesModel;d&&A&&d(R,{}),!(t.cellModesModel&&A)&&(r(R),o.current=R,e.current.publishEvent("cellModesModelChange",R))}),P=u.useCallback((R,A,z)=>{const V=E({},o.current);if(z!==null)V[R]=E({},V[R],{[A]:E({},z)});else{const N=V[R],H=ne(N,[A].map(dp));V[R]=H,Object.keys(V[R]).length===0&&delete V[R]}x(V)},[x]),_=u.useCallback((R,A,z)=>{e.current.setState(V=>{const N=E({},V.editRows);return z!==null?N[R]=E({},N[R],{[A]:E({},z)}):(delete N[R][A],Object.keys(N[R]).length===0&&delete N[R]),E({},V,{editRows:N})}),e.current.forceUpdate()},[e]),I=u.useCallback(R=>{const{id:A,field:z}=R,V=ne(R,Bhe);h(A,z),m(A,z,rn.View),P(A,z,E({mode:rn.Edit},V))},[h,m,P]),k=Pn(R=>{const{id:A,field:z,deleteValue:V,initialValue:N}=R;let H=e.current.getCellValue(A,z),W=!1;(V||N)&&(H=V?"":N,W=!0),_(A,z,{value:H,error:!1,isProcessingProps:!1,unstable_updateValueOnRender:W}),e.current.setCellFocus(A,z)}),M=u.useCallback(R=>{const{id:A,field:z}=R,V=ne(R,zhe);m(A,z,rn.Edit),P(A,z,E({mode:rn.View},V))},[m,P]),O=Pn(R=>mt(void 0,null,function*(){const{id:A,field:z,ignoreModifications:V,cellToFocusAfter:N="none"}=R;m(A,z,rn.Edit),e.current.runPendingEditCellValueMutation(A,z);const H=()=>{_(A,z,null),P(A,z,null),N!=="none"&&e.current.moveFocusToRelativeCell(A,z,N)};if(V){H();return}const W=Hr(e.current.state),{error:K,isProcessingProps:Y}=W[A][z];if(K||Y){i.current[A][z].mode=rn.Edit,P(A,z,{mode:rn.Edit});return}const ie=e.current.getRowWithUpdatedValuesFromCellEditing(A,z);if(s){const re=de=>{i.current[A][z].mode=rn.Edit,P(A,z,{mode:rn.Edit}),a?a(de):jhe()};try{const de=e.current.getRow(A);Promise.resolve(s(ie,de)).then(se=>{e.current.updateRows([se]),H()}).catch(re)}catch(de){re(de)}}else e.current.updateRows([ie]),H()})),F=u.useCallback(R=>mt(void 0,null,function*(){var A,z;const{id:V,field:N,value:H,debounceMs:W,unstable_skipValueParser:K}=R;h(V,N),m(V,N,rn.Edit);const Y=e.current.getColumn(N),ie=e.current.getRow(V);let re=H;Y.valueParser&&!K&&(re=Y.valueParser(H,e.current.getCellParams(V,N)));let de=Hr(e.current.state),se=E({},de[V][N],{value:re,changeReason:W?"debouncedSetEditCellValue":"setEditCellValue"});if(Y.preProcessEditCellProps){const le=H!==de[V][N].value;se=E({},se,{isProcessingProps:!0}),_(V,N,se),se=yield Promise.resolve(Y.preProcessEditCellProps({id:V,row:ie,props:se,hasChanged:le}))}return e.current.getCellMode(V,N)===rn.View?!1:(de=Hr(e.current.state),se=E({},se,{isProcessingProps:!1}),se.value=Y.preProcessEditCellProps?de[V][N].value:re,_(V,N,se),de=Hr(e.current.state),!((A=de[V])!=null&&(z=A[N])!=null&&z.error))}),[e,h,m,_]),L=u.useCallback((R,A)=>{const z=e.current.getColumn(A),V=Hr(e.current.state),N=e.current.getRow(R);if(!V[R]||!V[R][A])return e.current.getRow(R);const{value:H}=V[R][A];return z.valueSetter?z.valueSetter({value:H,row:N}):E({},N,{[A]:H})},[e]),D={getCellMode:C,startCellEditMode:I,stopCellEditMode:M},B={setCellEditingEditCellValue:F,getRowWithUpdatedValuesFromCellEditing:L};Ft(e,D,"public"),Ft(e,B,"private"),u.useEffect(()=>{c&&x(c)},[c,x]),u.useEffect(()=>{const R=_g(e),A=i.current;i.current=GA(n),Object.entries(n).forEach(([z,V])=>{Object.entries(V).forEach(([N,H])=>{var W,K,Y;const ie=((W=A[z])==null||(K=W[N])==null?void 0:K.mode)||rn.View,re=(Y=R[z])!=null?Y:z;H.mode===rn.Edit&&ie===rn.View?k(E({id:re,field:N},H)):H.mode===rn.View&&ie===rn.Edit&&O(E({id:re,field:N},H))})})},[e,n,k,O])},Vhe=["id"],Uhe=["id"],Whe=ws(["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. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.","For more detail, see http://mui.com/components/data-grid/editing/#server-side-persistence."],"error"),Ghe=(e,t)=>{const[n,r]=u.useState({}),o=u.useRef(n),i=u.useRef({}),s=u.useRef(null),a=u.useRef(null),{processRowUpdate:c,onProcessRowUpdateError:d,rowModesModel:p,onRowModesModelChange:h}=t,m=N=>(...H)=>{t.editMode===vs.Row&&N(...H)},g=u.useCallback((N,H)=>{const W=e.current.getCellParams(N,H);if(!e.current.isCellEditable(W))throw new Error(`MUI: The cell with id=${N} and field=${H} is not editable.`)},[e]),y=u.useCallback((N,H)=>{if(e.current.getRowMode(N)!==H)throw new Error(`MUI: The row with id=${N} is not in ${H} mode.`)},[e]),v=u.useCallback((N,H)=>{if(!N.isEditable||e.current.getRowMode(N.id)===mn.Edit)return;const W=e.current.getRowParams(N.id),K=E({},W,{field:N.field,reason:hl.cellDoubleClick});e.current.publishEvent("rowEditStart",K,H)},[e]),S=u.useCallback(N=>{a.current=N},[]),w=u.useCallback((N,H)=>{N.isEditable&&e.current.getRowMode(N.id)!==mn.View&&(a.current=null,s.current=setTimeout(()=>{var W;if(s.current=null,((W=a.current)==null?void 0:W.id)!==N.id){if(!e.current.getRow(N.id)||e.current.getRowMode(N.id)===mn.View)return;const K=e.current.getRowParams(N.id),Y=E({},K,{field:N.field,reason:Os.rowFocusOut});e.current.publishEvent("rowEditStop",Y,H)}}))},[e]);u.useEffect(()=>()=>{clearTimeout(s.current)},[]);const C=u.useCallback((N,H)=>{if(N.cellMode===mn.Edit){if(H.which===229)return;let W;if(H.key==="Escape")W=Os.escapeKeyDown;else if(H.key==="Enter")W=Os.enterKeyDown;else if(H.key==="Tab"){const K=my(e).filter(Y=>e.current.getColumn(Y).type===Sy?!0:e.current.isCellEditable(e.current.getCellParams(N.id,Y)));if(H.shiftKey?N.field===K[0]&&(W=Os.shiftTabKeyDown):N.field===K[K.length-1]&&(W=Os.tabKeyDown),H.preventDefault(),!W){const Y=K.findIndex(re=>re===N.field),ie=K[H.shiftKey?Y-1:Y+1];e.current.setCellFocus(N.id,ie)}}if(W){const K=E({},e.current.getRowParams(N.id),{reason:W,field:N.field});e.current.publishEvent("rowEditStop",K,H)}}else if(N.isEditable){let W;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:H,cellParams:N,editMode:"row"}))return;if(zA(H)||(H.ctrlKey||H.metaKey)&&H.key==="v"?W=hl.printableKeyDown:H.key==="Enter"?W=hl.enterKeyDown:(H.key==="Delete"||H.key==="Backspace")&&(W=hl.deleteKeyDown),W){const Y=e.current.getRowParams(N.id),ie=E({},Y,{field:N.field,key:H.key,reason:W});e.current.publishEvent("rowEditStart",ie,H)}}},[e]),x=u.useCallback(N=>{const{id:H,field:W,reason:K,key:Y,columns:ie}=N,re={id:H,fieldToFocus:W};if(K===hl.printableKeyDown)if(u.version.startsWith("17"))re.deleteValue=!!W;else{const de=ie.find(se=>se.field===W);re.initialValue=de.valueParser?de.valueParser(Y):Y}else K===hl.deleteKeyDown&&(re.deleteValue=!!W);e.current.startRowEditMode(re)},[e]),P=u.useCallback(N=>{const{id:H,reason:W,field:K}=N;e.current.runPendingEditCellValueMutation(H);let Y;W===Os.enterKeyDown?Y="below":W===Os.tabKeyDown?Y="right":W===Os.shiftTabKeyDown&&(Y="left");const ie=W==="escapeKeyDown";e.current.stopRowEditMode({id:H,ignoreModifications:ie,field:K,cellToFocusAfter:Y})},[e]);ot(e,"cellDoubleClick",m(v)),ot(e,"cellFocusIn",m(S)),ot(e,"cellFocusOut",m(w)),ot(e,"cellKeyDown",m(C)),ot(e,"rowEditStart",m(x)),ot(e,"rowEditStop",m(P)),xn(e,"rowEditStart",t.onRowEditStart),xn(e,"rowEditStop",t.onRowEditStop);const _=u.useCallback(N=>{if(t.editMode===vs.Cell)return mn.View;const H=Hr(e.current.state);return H[N]&&Object.keys(H[N]).length>0?mn.Edit:mn.View},[e,t.editMode]),I=Pn(N=>{const H=N!==t.rowModesModel;h&&H&&h(N,{}),!(t.rowModesModel&&H)&&(r(N),o.current=N,e.current.publishEvent("rowModesModelChange",N))}),k=u.useCallback((N,H)=>{const W=E({},o.current);H!==null?W[N]=E({},H):delete W[N],I(W)},[I]),M=u.useCallback((N,H)=>{e.current.setState(W=>{const K=E({},W.editRows);return H!==null?K[N]=H:delete K[N],E({},W,{editRows:K})}),e.current.forceUpdate()},[e]),O=u.useCallback((N,H,W)=>{e.current.setState(K=>{const Y=E({},K.editRows);return W!==null?Y[N]=E({},Y[N],{[H]:E({},W)}):(delete Y[N][H],Object.keys(Y[N]).length===0&&delete Y[N]),E({},K,{editRows:Y})}),e.current.forceUpdate()},[e]),F=u.useCallback(N=>{const{id:H}=N,W=ne(N,Vhe);y(H,mn.View),k(H,E({mode:mn.Edit},W))},[y,k]),L=Pn(N=>{const{id:H,fieldToFocus:W,deleteValue:K,initialValue:Y}=N,re=zs(e).reduce((de,se)=>{if(!e.current.getCellParams(H,se).isEditable)return de;let Ee=e.current.getCellValue(H,se),ye=!1;return W===se&&(K||Y)&&(Ee=K?"":Y,ye=!0),de[se]={value:Ee,error:!1,isProcessingProps:!1,unstable_updateValueOnRender:ye},de},{});M(H,re),W&&e.current.setCellFocus(H,W)}),D=u.useCallback(N=>{const{id:H}=N,W=ne(N,Uhe);y(H,mn.Edit),k(H,E({mode:mn.View},W))},[y,k]),B=Pn(N=>{const{id:H,ignoreModifications:W,field:K,cellToFocusAfter:Y="none"}=N;e.current.runPendingEditCellValueMutation(H);const ie=()=>{Y!=="none"&&K&&e.current.moveFocusToRelativeCell(H,K,Y),M(H,null),k(H,null)};if(W){ie();return}const re=Hr(e.current.state),de=e.current.getRow(H);if(Object.values(re[H]).some(ye=>ye.isProcessingProps)){i.current[H].mode=mn.Edit;return}if(Object.values(re[H]).some(ye=>ye.error)){i.current[H].mode=mn.Edit,k(H,{mode:mn.Edit});return}const Ee=e.current.getRowWithUpdatedValuesFromRowEditing(H);if(c){const ye=_e=>{i.current[H].mode=mn.Edit,k(H,{mode:mn.Edit}),d?d(_e):Whe()};try{Promise.resolve(c(Ee,de)).then(_e=>{e.current.updateRows([_e]),ie()}).catch(ye)}catch(_e){ye(_e)}}else e.current.updateRows([Ee]),ie()}),R=u.useCallback(N=>{const{id:H,field:W,value:K,debounceMs:Y,unstable_skipValueParser:ie}=N;g(H,W);const re=e.current.getColumn(W),de=e.current.getRow(H);let se=K;re.valueParser&&!ie&&(se=re.valueParser(K,e.current.getCellParams(H,W)));let le=Hr(e.current.state),Ee=E({},le[H][W],{value:se,changeReason:Y?"debouncedSetEditCellValue":"setEditCellValue"});return re.preProcessEditCellProps||O(H,W,Ee),new Promise(ye=>{const _e=[];if(re.preProcessEditCellProps){const ee=Ee.value!==le[H][W].value;Ee=E({},Ee,{isProcessingProps:!0}),O(H,W,Ee);const ke=le[H],Re=ne(ke,[W].map(dp)),Pe=Promise.resolve(re.preProcessEditCellProps({id:H,row:de,props:Ee,hasChanged:ee,otherFieldsProps:Re})).then(pe=>{if(e.current.getRowMode(H)===mn.View){ye(!1);return}le=Hr(e.current.state),pe=E({},pe,{isProcessingProps:!1}),pe.value=re.preProcessEditCellProps?le[H][W].value:se,O(H,W,pe)});_e.push(Pe)}Object.entries(le[H]).forEach(([ee,ke])=>{if(ee===W)return;const Re=e.current.getColumn(ee);if(!Re.preProcessEditCellProps)return;ke=E({},ke,{isProcessingProps:!0}),O(H,ee,ke),le=Hr(e.current.state);const Pe=le[H],pe=ne(Pe,[ee].map(dp)),be=Promise.resolve(Re.preProcessEditCellProps({id:H,row:de,props:ke,hasChanged:!1,otherFieldsProps:pe})).then(te=>{if(e.current.getRowMode(H)===mn.View){ye(!1);return}te=E({},te,{isProcessingProps:!1}),O(H,ee,te)});_e.push(be)}),Promise.all(_e).then(()=>{e.current.getRowMode(H)===mn.Edit?(le=Hr(e.current.state),ye(!le[H][W].error)):ye(!1)})})},[e,g,O]),A=u.useCallback(N=>{const H=Hr(e.current.state),W=e.current.getRow(N);if(!H[N])return e.current.getRow(N);let K=E({},W);return Object.entries(H[N]).forEach(([Y,ie])=>{const re=e.current.getColumn(Y);re.valueSetter?K=re.valueSetter({value:ie.value,row:K}):K[Y]=ie.value}),K},[e]),z={getRowMode:_,startRowEditMode:F,stopRowEditMode:D},V={setRowEditingEditCellValue:R,getRowWithUpdatedValuesFromRowEditing:A};Ft(e,z,"public"),Ft(e,V,"private"),u.useEffect(()=>{p&&I(p)},[p,I]),u.useEffect(()=>{const N=_g(e),H=i.current;i.current=GA(n),Object.entries(n).forEach(([W,K])=>{var Y,ie;const re=((Y=H[W])==null?void 0:Y.mode)||mn.View,de=(ie=N[W])!=null?ie:W;K.mode===mn.Edit&&re===mn.View?L(E({id:de},K)):K.mode===mn.View&&re===mn.Edit&&B(E({id:de},K))})},[e,n,L,B])},Khe=e=>E({},e,{editRows:{}}),qhe=(e,t)=>{Hhe(e,t),Ghe(e,t);const n=u.useRef({}),{isCellEditable:r}=t,o=u.useCallback(m=>sp(m.rowNode)||!m.colDef.editable||!m.colDef.renderEditCell?!1:r?r(m):!0,[r]),i=(m,g,y,v)=>{if(!y){v();return}if(n.current[m]||(n.current[m]={}),n.current[m][g]){const[C]=n.current[m][g];clearTimeout(C)}const S=()=>{const[C]=n.current[m][g];clearTimeout(C),v(),delete n.current[m][g]},w=setTimeout(()=>{v(),delete n.current[m][g]},y);n.current[m][g]=[w,S]};u.useEffect(()=>{const m=n.current;return()=>{Object.entries(m).forEach(([g,y])=>{Object.keys(y).forEach(v=>{const[S]=m[g][v];clearTimeout(S),delete m[g][v]})})}},[]);const s=u.useCallback((m,g)=>{if(n.current[m]){if(!g)Object.keys(n.current[m]).forEach(y=>{const[,v]=n.current[m][y];v()});else if(n.current[m][g]){const[,y]=n.current[m][g];y()}}},[]),a=u.useCallback(m=>{const{id:g,field:y,debounceMs:v}=m;return new Promise(S=>{i(g,y,v,()=>mt(void 0,null,function*(){const w=t.editMode===vs.Row?e.current.setRowEditingEditCellValue:e.current.setCellEditingEditCellValue;if(e.current.getCellMode(g,y)===rn.Edit){const C=yield w(m);S(C)}}))})},[e,t.editMode]),c=u.useCallback((m,g)=>t.editMode===vs.Cell?e.current.getRowWithUpdatedValuesFromCellEditing(m,g):e.current.getRowWithUpdatedValuesFromRowEditing(m),[e,t.editMode]),d=u.useCallback((m,g)=>{var y,v;return(y=(v=Hr(e.current.state)[m])==null?void 0:v[g])!=null?y:null},[e]),p={isCellEditable:o,setEditCellValue:a,getRowWithUpdatedValues:c,unstable_getEditCellMeta:d},h={runPendingEditCellValueMutation:s};Ft(e,p,"public"),Ft(e,h,"private")},Yhe=(e,t,n)=>(n.current.caches.rows=Tm({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),E({},e,{rows:TA({apiRef:n,rowCountProp:t.rowCount,loadingProp:t.loading,previousTree:null,previousTreeDepths:null})})),Qhe=(e,t)=>{const n=Ar(e,"useGridRows"),r=ac(e,t),o=u.useRef(Date.now()),i=u.useRef(null),s=u.useCallback(L=>{const D=_l(e)[L];if(D)return D;const B=e.current.getRowNode(L);return B&&sp(B)?{[Mm]:L}:null},[e]),a=u.useMemo(()=>r.rows.reduce((L,{id:D},B)=>(L[D]=B,L),{}),[r.rows]),c=u.useCallback(({cache:L,throttle:D})=>{const B=()=>{i.current=null,o.current=Date.now(),e.current.setState(A=>E({},A,{rows:TA({apiRef:e,rowCountProp:t.rowCount,loadingProp:t.loading,previousTree:Ti(e),previousTreeDepths:fR(e)})})),e.current.publishEvent("rowsSet"),e.current.forceUpdate()};if(i.current&&(clearTimeout(i.current),i.current=null),e.current.caches.rows=L,!D){B();return}const R=t.throttleRowsMs-(Date.now()-o.current);if(R>0){i.current=setTimeout(B,R);return}B()},[t.throttleRowsMs,t.rowCount,t.loading,e]),d=u.useCallback(L=>{n.debug(`Updating all rows, new length ${L.length}`);const D=Tm({rows:L,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),B=e.current.caches.rows;D.rowsBeforePartialUpdates=B.rowsBeforePartialUpdates,c({cache:D,throttle:!0})},[n,t.getRowId,t.loading,t.rowCount,c,e]),p=u.useCallback(L=>{if(t.signature===fs.DataGrid&&L.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(`
|
|
339
|
+
`));const D=[];L.forEach(R=>{const A=Mg(R,t.getRowId,"A row was provided without id when calling updateRows():"),z=e.current.getRowNode(A);if((z==null?void 0:z.type)==="pinnedRow"){const V=e.current.caches.pinnedRows,N=V.idLookup[A];N&&(V.idLookup[A]=E({},N,R))}else D.push(R)});const B=Gae({updates:D,getRowId:t.getRowId,previousCache:e.current.caches.rows});c({cache:B,throttle:!0})},[t.signature,t.getRowId,c,e]),h=u.useCallback(()=>{const L=sm(e),D=_l(e);return new Map(L.map(B=>{var R;return[B,(R=D[B])!=null?R:{}]}))},[e]),m=u.useCallback(()=>gy(e),[e]),g=u.useCallback(()=>sm(e),[e]),y=u.useCallback(L=>a[L],[a]),v=u.useCallback((L,D)=>{const B=e.current.getRowNode(L);if(!B)throw new Error(`MUI: No row with id #${L} found`);if(B.type!=="group")throw new Error("MUI: Only group nodes can be expanded or collapsed");const R=E({},B,{childrenExpanded:D});e.current.setState(A=>E({},A,{rows:E({},A.rows,{tree:E({},A.rows.tree,{[L]:R})})})),e.current.forceUpdate(),e.current.publishEvent("rowExpansionChange",R)},[e]),S=u.useCallback(L=>{var D;return(D=Ti(e)[L])!=null?D:null},[e]),w=u.useCallback(({skipAutoGeneratedRows:L=!0,groupId:D,applySorting:B,applyFiltering:R})=>{const A=Ti(e);let z;if(B){const V=A[D];if(!V)return[];const N=QS(e);z=[];const H=N.findIndex(W=>W===D)+1;for(let W=H;W<N.length&&A[N[W]].depth>V.depth;W+=1){const K=N[W];(!L||!sp(A[K]))&&z.push(K)}}else z=eE(A,D,L);if(R){const V=IA(e);z=z.filter(N=>V[N]!==!1)}return z},[e]),C=u.useCallback((L,D)=>{const B=e.current.getRowNode(L);if(!B)throw new Error(`MUI: No row with id #${L} found`);if(B.parent!==Vr)throw new Error("MUI: The row reordering do not support reordering of grouped rows yet");if(B.type!=="leaf")throw new Error("MUI: The row reordering do not support reordering of footer or grouping rows");e.current.setState(R=>{const A=Ti(R,e.current.instanceId)[Vr],z=A.children,V=z.findIndex(H=>H===L);if(V===-1||V===D)return R;n.debug(`Moving row ${L} to index ${D}`);const N=[...z];return N.splice(D,0,N.splice(V,1)[0]),E({},R,{rows:E({},R.rows,{tree:E({},R.rows.tree,{[Vr]:E({},A,{children:N})})})})}),e.current.publishEvent("rowsSet")},[e,n]),x=u.useCallback((L,D)=>{if(t.signature===fs.DataGrid&&D.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(`
|
|
340
|
+
`));if(D.length===0)return;if(vy(e)>1)throw new Error("`apiRef.current.unstable_replaceRows` is not compatible with tree data and row grouping");const R=E({},Ti(e)),A=E({},_l(e)),z=E({},_g(e)),V=R[Vr],N=[...V.children];for(let W=0;W<D.length;W+=1){const K=D[W],Y=Mg(K,t.getRowId,"A row was provided without id when calling replaceRows()."),[ie]=N.splice(L+W,1,Y);delete A[ie],delete z[ie],delete R[ie];const re={id:Y,depth:0,parent:Vr,type:"leaf",groupingKey:null};A[Y]=K,z[Y]=Y,R[Y]=re}R[Vr]=E({},V,{children:N});const H=N.filter(W=>R[W].type==="leaf");e.current.caches.rows.dataRowIdToModelLookup=A,e.current.caches.rows.dataRowIdToIdLookup=z,e.current.setState(W=>E({},W,{rows:E({},W.rows,{dataRowIdToModelLookup:A,dataRowIdToIdLookup:z,dataRowIds:H,tree:R})})),e.current.publishEvent("rowsSet")},[e,t.signature,t.getRowId]),P={getRow:s,getRowModels:h,getRowsCount:m,getAllRowIds:g,setRows:d,updateRows:p,getRowNode:S,getRowIndexRelativeToVisibleRows:y,unstable_replaceRows:x},_={setRowIndex:C,setRowChildrenExpansion:v,getRowGroupChildren:w},I=u.useCallback(()=>{n.info("Row grouping pre-processing have changed, regenerating the row tree");let L;e.current.caches.rows.rowsBeforePartialUpdates===t.rows?L=E({},e.current.caches.rows,{updates:{type:"full",rows:sm(e)}}):L=Tm({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),c({cache:L,throttle:!1})},[n,e,t.rows,t.getRowId,t.loading,t.rowCount,c]),k=u.useCallback(L=>{L==="rowTreeCreation"&&I()},[I]),M=u.useCallback(()=>{e.current.getActiveStrategy("rowTree")!==_ae(e)&&I()},[e,I]);ot(e,"activeStrategyProcessorChange",k),ot(e,"strategyAvailabilityChange",M);const O=u.useCallback(()=>{e.current.setState(L=>{const D=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:Ti(L,e.current.instanceId),treeDepths:fR(L,e.current.instanceId),dataRowIds:sm(L,e.current.instanceId),dataRowIdToModelLookup:_l(L,e.current.instanceId),dataRowIdToIdLookup:_g(L,e.current.instanceId)});return E({},L,{rows:E({},L.rows,D,{totalTopLevelRowCount:MA({tree:D.tree,rowCountProp:t.rowCount})})})}),e.current.publishEvent("rowsSet"),e.current.forceUpdate()},[e,t.rowCount]);cE(e,"hydrateRows",O),Ft(e,P,"public"),Ft(e,_,t.signature===fs.DataGrid?"private":"public"),u.useEffect(()=>()=>{i.current!==null&&clearTimeout(i.current)},[]);const F=u.useRef(!0);u.useEffect(()=>{if(F.current){F.current=!1;return}const L=e.current.caches.rows.rowsBeforePartialUpdates===t.rows,D=e.current.caches.rows.loadingPropBeforePartialUpdates===t.loading,B=e.current.caches.rows.rowCountPropBeforePartialUpdates===t.rowCount;if(L){D||(e.current.setState(R=>E({},R,{rows:E({},R.rows,{loading:t.loading})})),e.current.caches.rows.loadingPropBeforePartialUpdates=t.loading,e.current.forceUpdate()),B||(e.current.setState(R=>E({},R,{rows:E({},R.rows,{totalRowCount:Math.max(t.rowCount||0,R.rows.totalRowCount),totalTopLevelRowCount:Math.max(t.rowCount||0,R.rows.totalTopLevelRowCount)})})),e.current.caches.rows.rowCountPropBeforePartialUpdates=t.rowCount,e.current.forceUpdate());return}n.debug(`Updating all rows, new length ${t.rows.length}`),c({cache:Tm({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),throttle:!1})},[t.rows,t.rowCount,t.getRowId,t.loading,n,c,e])},Xhe=e=>{const t={[Vr]:E({},Uae(),{children:e})};for(let n=0;n<e.length;n+=1){const r=e[n];t[r]={id:r,depth:0,parent:Vr,type:"leaf",groupingKey:null}}return{groupingName:Ja,tree:t,treeDepths:{0:e.length},dataRowIds:e}},Jhe=({previousTree:e,actions:t})=>{const n=E({},e),r={};for(let s=0;s<t.remove.length;s+=1){const a=t.remove[s];r[a]=!0,delete n[a]}for(let s=0;s<t.insert.length;s+=1){const a=t.insert[s];n[a]={id:a,depth:0,parent:Vr,type:"leaf",groupingKey:null}}const o=n[Vr];let i=[...o.children,...t.insert];return Object.values(r).length&&(i=i.filter(s=>!r[s])),n[Vr]=E({},o,{children:i}),{groupingName:Ja,tree:n,treeDepths:{0:i.length},dataRowIds:i}},Zhe=e=>e.updates.type==="full"?Xhe(e.updates.rows):Jhe({previousTree:e.previousTree,actions:e.updates.actions}),eme=e=>{Ng(e,Ja,"rowTreeCreation",Zhe)},w4=(e,t)=>e==null||Array.isArray(e)?e:t&&t[0]===e?t:[e],tme=(e,t)=>{var n;return E({},e,{rowSelection:t.rowSelection?(n=w4(t.rowSelectionModel))!=null?n:[]:[]})},nme=(e,t)=>{const n=Ar(e,"useGridSelection"),r=R=>(...A)=>{t.rowSelection&&R(...A)},o=u.useMemo(()=>w4(t.rowSelectionModel,ri(e.current.state)),[e,t.rowSelectionModel]),i=u.useRef(null);e.current.registerControlState({stateId:"rowSelection",propModel:o,propOnChange:t.onRowSelectionModelChange,stateSelector:ri,changeEvent:"rowSelectionChange"});const{checkboxSelection:s,disableMultipleRowSelection:a,disableRowSelectionOnClick:c,isRowSelectable:d}=t,p=!a||s,h=ac(e,t),m=u.useCallback(R=>{var A;let z=R;const V=(A=i.current)!=null?A:R,N=e.current.isRowSelected(R);if(N){const H=If(e),W=H.findIndex(Y=>Y===V),K=H.findIndex(Y=>Y===z);if(W===K)return;W>K?z=H[K+1]:z=H[K-1]}i.current=R,e.current.selectRowRange({startId:V,endId:z},!N)},[e]),g=u.useCallback(R=>{if(t.signature===fs.DataGrid&&!t.checkboxSelection&&Array.isArray(R)&&R.length>1)throw new Error(["MUI: `rowSelectionModel` can only contain 1 item in DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock multiple selection."].join(`
|
|
341
|
+
`));ri(e.current.state)!==R&&(n.debug("Setting selection model"),e.current.setState(z=>E({},z,{rowSelection:t.rowSelection?R:[]})),e.current.forceUpdate())},[e,n,t.rowSelection,t.signature,t.checkboxSelection]),y=u.useCallback(R=>ri(e.current.state).includes(R),[e]),v=u.useCallback(R=>{if(d&&!d(e.current.getRowParams(R)))return!1;const A=e.current.getRowNode(R);return!((A==null?void 0:A.type)==="footer"||(A==null?void 0:A.type)==="pinnedRow")},[e,d]),S=u.useCallback(()=>Que(e),[e]),w=u.useCallback((R,A=!0,z=!1)=>{if(e.current.isRowSelectable(R))if(i.current=R,z)n.debug(`Setting selection for row ${R}`),e.current.setRowSelectionModel(A?[R]:[]);else{n.debug(`Toggling selection for row ${R}`);const N=ri(e.current.state).filter(W=>W!==R);A&&N.push(R),(N.length<2||p)&&e.current.setRowSelectionModel(N)}},[e,n,p]),C=u.useCallback((R,A=!0,z=!1)=>{n.debug("Setting selection for several rows");const V=R.filter(W=>e.current.isRowSelectable(W));let N;if(z)N=A?V:[];else{const W=E({},Fg(e));V.forEach(K=>{A?W[K]=K:delete W[K]}),N=Object.values(W)}(N.length<2||p)&&e.current.setRowSelectionModel(N)},[e,n,p]),x=u.useCallback(({startId:R,endId:A},z=!0,V=!1)=>{if(!e.current.getRow(R)||!e.current.getRow(A))return;n.debug(`Expanding selection from row ${R} to row ${A}`);const N=If(e),H=N.indexOf(R),W=N.indexOf(A),[K,Y]=H>W?[W,H]:[H,W],ie=N.slice(K,Y+1);e.current.selectRows(ie,z,V)},[e,n]),P={selectRow:w,setRowSelectionModel:g,getSelectedRows:S,isRowSelected:y,isRowSelectable:v},_={selectRows:C,selectRowRange:x};Ft(e,P,"public"),Ft(e,_,t.signature===fs.DataGrid?"private":"public");const I=u.useCallback(()=>{if(t.keepNonExistentRowsSelected)return;const R=ri(e.current.state),A=_l(e),z=E({},Fg(e));let V=!1;R.forEach(N=>{A[N]||(delete z[N],V=!0)}),V&&e.current.setRowSelectionModel(Object.values(z))},[e,t.keepNonExistentRowsSelected]),k=u.useCallback((R,A)=>{const z=A.metaKey||A.ctrlKey,V=!s&&!z&&!Lce(A),N=!p||V,H=e.current.isRowSelected(R);N?e.current.selectRow(R,V?!0:!H,!0):e.current.selectRow(R,!H,!1)},[e,p,s]),M=u.useCallback((R,A)=>{var z;if(c)return;const V=(z=A.target.closest(`.${X.cell}`))==null?void 0:z.getAttribute("data-field");V===Np.field||V===lE||V&&e.current.getColumn(V).type===Sy||e.current.getRowNode(R.id).type==="pinnedRow"||(A.shiftKey&&(p||s)?m(R.id):k(R.id,A))},[c,p,s,e,m,k]),O=u.useCallback((R,A)=>{if(p&&A.shiftKey){var z;(z=window.getSelection())==null||z.removeAllRanges()}},[p]),F=u.useCallback((R,A)=>{A.nativeEvent.shiftKey?m(R.id):e.current.selectRow(R.id,R.value)},[e,m]),L=u.useCallback(R=>{const z=t.checkboxSelectionVisibleOnly&&t.pagination?XA(e):If(e);e.current.selectRows(z,R.value)},[e,t.checkboxSelectionVisibleOnly,t.pagination]),D=u.useCallback((R,A)=>{if(e.current.getCellMode(R.id,R.field)!==rn.Edit&&A.currentTarget.contains(A.target)){if(Lg(A.key)&&A.shiftKey){const z=ii(e);if(z&&z.id!==R.id){A.preventDefault();const V=e.current.isRowSelected(z.id);if(!p){e.current.selectRow(z.id,!V,!0);return}const N=e.current.getRowIndexRelativeToVisibleRows(z.id),H=e.current.getRowIndexRelativeToVisibleRows(R.id);let W,K;N>H?V?(W=H,K=N-1):(W=H,K=N):V?(W=N+1,K=H):(W=N,K=H);const Y=h.rows.slice(W,K+1).map(ie=>ie.id);e.current.selectRows(Y,!V);return}}if(A.key===" "&&A.shiftKey){A.preventDefault(),k(R.id,A);return}A.key==="a"&&(A.ctrlKey||A.metaKey)&&(A.preventDefault(),C(e.current.getAllRowIds(),!0))}},[e,k,C,h.rows,p]);ot(e,"sortedRowsSet",r(I)),ot(e,"rowClick",r(M)),ot(e,"rowSelectionCheckboxChange",r(F)),ot(e,"headerSelectionCheckboxChange",L),ot(e,"cellMouseDown",r(O)),ot(e,"cellKeyDown",r(D)),u.useEffect(()=>{o!==void 0&&e.current.setRowSelectionModel(o)},[e,o,t.rowSelection]),u.useEffect(()=>{t.rowSelection||e.current.setRowSelectionModel([])},[e,t.rowSelection]);const B=o!=null;u.useEffect(()=>{if(B||!t.rowSelection)return;const R=ri(e.current.state);if(v){const A=R.filter(z=>v(z));A.length<R.length&&e.current.setRowSelectionModel(A)}},[e,v,B,t.rowSelection]),u.useEffect(()=>{if(!t.rowSelection||B)return;const R=ri(e.current.state);!p&&R.length>1&&e.current.setRowSelectionModel([])},[e,p,s,B,t.rowSelection])},rme={noRowsLabel:"No rows",noResultsOverlayLabel:"No results found.",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:e=>e!==1?`${e} active filters`:`${e} 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",filterPanelRemoveAll:"Remove all",filterPanelDeleteIconLabel:"Delete",filterPanelLogicOperator:"Logic operator",filterPanelOperator:"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","filterOperator=":"=","filterOperator!=":"!=","filterOperator>":">","filterOperator>=":">=","filterOperator<":"<","filterOperator<=":"<=",headerFilterOperatorContains:"Contains",headerFilterOperatorEquals:"Equals",headerFilterOperatorStartsWith:"Starts with",headerFilterOperatorEndsWith:"Ends with",headerFilterOperatorIs:"Is",headerFilterOperatorNot:"Is not",headerFilterOperatorAfter:"Is after",headerFilterOperatorOnOrAfter:"Is on or after",headerFilterOperatorBefore:"Is before",headerFilterOperatorOnOrBefore:"Is on or before",headerFilterOperatorIsEmpty:"Is empty",headerFilterOperatorIsNotEmpty:"Is not empty",headerFilterOperatorIsAnyOf:"Is any of","headerFilterOperator=":"Equals","headerFilterOperator!=":"Not equals","headerFilterOperator>":"Greater than","headerFilterOperator>=":"Greater than or equal to","headerFilterOperator<":"Less than","headerFilterOperator<=":"Less than or equal to",filterValueAny:"any",filterValueTrue:"true",filterValueFalse:"false",columnMenuLabel:"Menu",columnMenuShowColumns:"Show columns",columnMenuManageColumns:"Manage columns",columnMenuFilter:"Filter",columnMenuHideColumn:"Hide column",columnMenuUnsort:"Unsort",columnMenuSortAsc:"Sort by ASC",columnMenuSortDesc:"Sort by DESC",columnHeaderFiltersTooltipActive:e=>e!==1?`${e} active filters`:`${e} active filter`,columnHeaderFiltersLabel:"Show filters",columnHeaderSortIconLabel:"Sort",footerRowSelected:e=>e!==1?`${e.toLocaleString()} rows selected`:`${e.toLocaleString()} row selected`,footerTotalRows:"Total Rows:",footerTotalVisibleRows:(e,t)=>`${e.toLocaleString()} of ${t.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:e=>`Group by ${e}`,unGroupColumn:e=>`Stop grouping by ${e}`,detailPanelToggle:"Detail panel toggle",expandDetailPanel:"Expand",collapseDetailPanel:"Collapse",MuiTablePagination:{},rowReorderingHeaderName:"Row reordering",aggregationMenuItemHeader:"Aggregation",aggregationFunctionLabelSum:"sum",aggregationFunctionLabelAvg:"avg",aggregationFunctionLabelMin:"min",aggregationFunctionLabelMax:"max",aggregationFunctionLabelSize:"size"},ome=e=>{const{classes:t}=e;return u.useMemo(()=>Me({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},Bt,t),[t])},ime=(e,t)=>{const n={classes:t.classes},r=ome(n),o=u.useCallback(i=>{const s=E({},Np,{cellClassName:r.cellCheckbox,headerClassName:r.columnHeaderCheckbox,headerName:e.current.getLocaleText("checkboxSelectionHeaderName")}),a=t.checkboxSelection,c=i.lookup[ml]!=null;return a&&!c?(i.lookup[ml]=s,i.orderedFields=[ml,...i.orderedFields]):!a&&c?(delete i.lookup[ml],i.orderedFields=i.orderedFields.filter(d=>d!==ml)):a&&c&&(i.lookup[ml]=E({},s,i.lookup[ml])),i},[e,r,t.checkboxSelection]);ir(e,"hydrateColumns",o)},sme=(e,t)=>{var n,r,o,i;const s=(n=(r=t.sortModel)!=null?r:(o=t.initialState)==null||(i=o.sorting)==null?void 0:i.sortModel)!=null?n:[];return E({},e,{sorting:{sortModel:JA(s,t.disableMultipleColumnsSorting),sortedRows:[]}})},lme=(e,t)=>{var n,r;const o=Ar(e,"useGridSorting");e.current.registerControlState({stateId:"sortModel",propModel:t.sortModel,propOnChange:t.onSortModelChange,stateSelector:ni,changeEvent:"sortModelChange"});const i=u.useCallback((k,M)=>{const O=ni(e),F=O.findIndex(D=>D.field===k);let L=[...O];return F>-1?M?L.splice(F,1,M):L.splice(F,1):L=[...O,M],L},[e]),s=u.useCallback((k,M)=>{var O;const L=ni(e).find(B=>B.field===k.field);if(L){var D;const B=M===void 0?vR((D=k.sortingOrder)!=null?D:t.sortingOrder,L.sort):M;return B==null?void 0:E({},L,{sort:B})}return{field:k.field,sort:M===void 0?vR((O=k.sortingOrder)!=null?O:t.sortingOrder):M}},[e,t.sortingOrder]),a=u.useCallback((k,M)=>M==null||M.sortable===!1?k:(M.sortingOrder||t.sortingOrder).some(F=>!!F)?[...k,"columnMenuSortItem"]:k,[t.sortingOrder]),c=u.useCallback(()=>{e.current.setState(k=>{if(t.sortingMode==="server")return o.debug("Skipping sorting rows as sortingMode = server"),E({},k,{sorting:E({},k.sorting,{sortedRows:eE(Ti(e),Vr,!1)})});const M=ni(k,e.current.instanceId),O=tde(M,e),F=e.current.applyStrategyProcessor("sorting",{sortRowList:O});return E({},k,{sorting:E({},k.sorting,{sortedRows:F})})}),e.current.publishEvent("sortedRowsSet"),e.current.forceUpdate()},[e,o,t.sortingMode]),d=u.useCallback(k=>{ni(e)!==k&&(o.debug("Setting sort model"),e.current.setState(gR(k,t.disableMultipleColumnsSorting)),e.current.forceUpdate(),e.current.applySorting())},[e,o,t.disableMultipleColumnsSorting]),p=u.useCallback((k,M,O)=>{if(!k.sortable)return;const F=s(k,M);let L;!O||t.disableMultipleColumnsSorting?L=F?[F]:[]:L=i(k.field,F),e.current.setSortModel(L)},[e,i,s,t.disableMultipleColumnsSorting]),h=u.useCallback(()=>ni(e),[e]),m=u.useCallback(()=>XS(e).map(M=>M.model),[e]),g=u.useCallback(()=>QS(e),[e]),y=u.useCallback(k=>e.current.getSortedRowIds()[k],[e]);Ft(e,{getSortModel:h,getSortedRows:m,getSortedRowIds:g,getRowIdFromRowIndex:y,setSortModel:d,sortColumn:p,applySorting:c},"public");const S=u.useCallback((k,M)=>{var O,F;const L=ni(e);return!M.exportOnlyDirtyModels||t.sortModel!=null||((O=t.initialState)==null||(F=O.sorting)==null?void 0:F.sortModel)!=null||L.length>0?E({},k,{sorting:{sortModel:L}}):k},[e,t.sortModel,(n=t.initialState)==null||(r=n.sorting)==null?void 0:r.sortModel]),w=u.useCallback((k,M)=>{var O;const F=(O=M.stateToRestore.sorting)==null?void 0:O.sortModel;return F==null?k:(e.current.setState(gR(F,t.disableMultipleColumnsSorting)),E({},k,{callbacks:[...k.callbacks,e.current.applySorting]}))},[e,t.disableMultipleColumnsSorting]),C=u.useCallback(k=>{const M=Ti(e),O=M[Vr],F=k.sortRowList?k.sortRowList(O.children.map(L=>M[L])):[...O.children];return O.footerId!=null&&F.push(O.footerId),F},[e]);ir(e,"exportState",S),ir(e,"restoreState",w),Ng(e,Ja,"sorting",C);const x=u.useCallback(({colDef:k},M)=>{const O=M.shiftKey||M.metaKey||M.ctrlKey;p(k,void 0,O)},[p]),P=u.useCallback(({colDef:k},M)=>{Rce(M.key)&&!M.ctrlKey&&!M.metaKey&&p(k,void 0,M.shiftKey)},[p]),_=u.useCallback(()=>{const k=ni(e),M=id(e);if(k.length>0){const O=k.filter(F=>M[F.field]);O.length<k.length&&e.current.setSortModel(O)}},[e]),I=u.useCallback(k=>{k==="sorting"&&e.current.applySorting()},[e]);ir(e,"columnMenu",a),ot(e,"columnHeaderClick",x),ot(e,"columnHeaderKeyDown",P),ot(e,"rowsSet",e.current.applySorting),ot(e,"columnsChange",_),ot(e,"activeStrategyProcessorChange",I),Lp(()=>{e.current.applySorting()}),ln(()=>{t.sortModel!==void 0&&e.current.setSortModel(t.sortModel)},[e,t.sortModel])};function zR(e){const{clientHeight:t,scrollTop:n,offsetHeight:r,offsetTop:o}=e,i=o+r;if(r>t)return o;if(i-t>n)return i-t;if(o<n)return o}const ame=(e,t)=>{const n=lr(),r=Ar(e,"useGridScroll"),o=e.current.columnHeadersElementRef,i=e.current.virtualScrollerRef,s=Ge(e,ia),a=u.useCallback(h=>{const m=gy(e),g=Or(e);if(!(h.rowIndex==null)&&m===0||g.length===0)return!1;r.debug(`Scrolling to cell at row ${h.rowIndex}, col: ${h.colIndex} `);let v={};if(h.colIndex!=null){const x=Hu(e);let P;if(typeof h.rowIndex!="undefined"){var S;const _=(S=s[h.rowIndex])==null?void 0:S.id,I=e.current.unstable_getCellColSpanInfo(_,h.colIndex);I&&!I.spannedByColSpan&&(P=I.cellProps.width)}typeof P=="undefined"&&(P=g[h.colIndex].computedWidth),v.left=zR({clientHeight:i.current.clientWidth,scrollTop:Math.abs(i.current.scrollLeft),offsetHeight:P,offsetTop:x[h.colIndex]})}if(h.rowIndex!=null){var w,C;const x=cp(e.current.state),P=Gue(e),_=Kue(e),I=t.pagination?h.rowIndex-P*_:h.rowIndex,k=x.positions[I+1]?x.positions[I+1]-x.positions[I]:x.currentPageTotalHeight-x.positions[I],M=((w=i.current.querySelector(`.${X["pinnedRows--top"]}`))==null?void 0:w.clientHeight)||0,O=((C=i.current.querySelector(`.${X["pinnedRows--bottom"]}`))==null?void 0:C.clientHeight)||0;v.top=zR({clientHeight:i.current.clientHeight-M-O,scrollTop:i.current.scrollTop,offsetHeight:k,offsetTop:x.positions[I]})}return v=e.current.unstable_applyPipeProcessors("scrollToIndexes",v,h),typeof v.left!==void 0||typeof v.top!==void 0?(e.current.scroll(v),!0):!1},[r,e,i,t.pagination,s]),c=u.useCallback(h=>{if(i.current&&h.left!=null&&o.current){const m=n.direction==="rtl"?-1:1;o.current.scrollLeft=h.left,i.current.scrollLeft=m*h.left,r.debug(`Scrolling left: ${h.left}`)}i.current&&h.top!=null&&(i.current.scrollTop=h.top,r.debug(`Scrolling top: ${h.top}`)),r.debug("Scrolling, updating container, and viewport")},[i,n.direction,o,r]),d=u.useCallback(()=>i!=null&&i.current?{top:i.current.scrollTop,left:i.current.scrollLeft}:{top:0,left:0},[i]);Ft(e,{scroll:c,scrollToIndexes:a,getScrollPosition:d},"public")};function cme(e,t){xn(e,"columnHeaderClick",t.onColumnHeaderClick),xn(e,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),xn(e,"columnHeaderOver",t.onColumnHeaderOver),xn(e,"columnHeaderOut",t.onColumnHeaderOut),xn(e,"columnHeaderEnter",t.onColumnHeaderEnter),xn(e,"columnHeaderLeave",t.onColumnHeaderLeave),xn(e,"cellClick",t.onCellClick),xn(e,"cellDoubleClick",t.onCellDoubleClick),xn(e,"cellKeyDown",t.onCellKeyDown),xn(e,"preferencePanelClose",t.onPreferencePanelClose),xn(e,"preferencePanelOpen",t.onPreferencePanelOpen),xn(e,"menuOpen",t.onMenuOpen),xn(e,"menuClose",t.onMenuClose),xn(e,"rowDoubleClick",t.onRowDoubleClick),xn(e,"rowClick",t.onRowClick),xn(e,"stateChange",t.onStateChange)}const ume=({content:e,container:t,scrollBarSize:n})=>{const r=e.width>t.width,o=e.height>t.height;let i=!1,s=!1;return(r||o)&&(i=r,s=e.height+(i?n:0)>t.height,s&&(i=e.width+n>t.width)),{hasScrollX:i,hasScrollY:s}};function dme(e,t){const n=Ar(e,"useResizeContainer"),r=u.useRef(!1),o=u.useRef(null),i=u.useRef(null),s=Ge(e,cp),a=Ge(e,ld),c=Math.floor(t.rowHeight*a),d=uE(e,t.columnHeaderHeight),p=u.useCallback(()=>{var k;const M=(k=e.current.rootElementRef)==null?void 0:k.current,O=YS(e),F=OA(e);if(!o.current)return;let L;if(t.scrollbarSize!=null)L=t.scrollbarSize;else if(!O||!M)L=0;else{const H=vn(M).createElement("div");H.style.width="99px",H.style.height="99px",H.style.position="absolute",H.style.overflow="scroll",H.className="scrollDiv",M.appendChild(H),L=H.offsetWidth-H.clientWidth,M.removeChild(H)}let D,B,R;if(t.autoHeight)R=!1,B=Math.round(O)>Math.round(o.current.width),D={width:o.current.width,height:s.currentPageTotalHeight+(B?L:0)};else{D={width:o.current.width,height:o.current.height-d};const N=ume({content:{width:Math.round(O),height:s.currentPageTotalHeight},container:{width:Math.round(D.width),height:D.height-F.top-F.bottom},scrollBarSize:L});R=N.hasScrollY,B=N.hasScrollX}const A={width:D.width-(R?L:0),height:D.height-(B?L:0)},z={viewportOuterSize:D,viewportInnerSize:A,hasScrollX:B,hasScrollY:R,scrollBarSize:L},V=i.current;i.current=z,(z.viewportInnerSize.width!==(V==null?void 0:V.viewportInnerSize.width)||z.viewportInnerSize.height!==(V==null?void 0:V.viewportInnerSize.height))&&e.current.publishEvent("viewportInnerSizeChange",z.viewportInnerSize)},[e,t.scrollbarSize,t.autoHeight,s.currentPageTotalHeight,d]),[h,m]=u.useState(),g=u.useMemo(()=>Ws(m,60),[]),y=u.useRef();ln(()=>{h&&(p(),e.current.publishEvent("debouncedResize",o.current))},[e,h,p]);const v=u.useCallback(()=>{e.current.computeSizeAndPublishResizeEvent()},[e]),S=u.useCallback(()=>i.current,[]),w=u.useCallback(()=>{const k=e.current.getRootDimensions();if(!k)return 0;const M=sE(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(t.getRowHeight){const F=e.current.getRenderContext(),L=F.lastRowIndex-F.firstRowIndex;return Math.min(L-1,M.rows.length)}const O=Math.floor(k.viewportInnerSize.height/c);return Math.min(O,M.rows.length)},[e,t.pagination,t.paginationMode,t.getRowHeight,c]),C=u.useCallback(()=>{var k,M,O;const F=(k=e.current.mainElementRef)==null?void 0:k.current;if(!F)return;const D=Ao(F).getComputedStyle(F),B=parseFloat(D.height)||0,R=parseFloat(D.width)||0,A=B!==((M=y.current)==null?void 0:M.height),z=R!==((O=y.current)==null?void 0:O.width);if(!y.current||A||z){const V={width:R,height:B};e.current.publishEvent("resize",V),y.current=V}},[e]),x={resize:v,getRootDimensions:S},P={getViewportPageSize:w,updateGridDimensionsRef:p,computeSizeAndPublishResizeEvent:C};Ft(e,x,"public"),Ft(e,P,"private");const _=u.useRef(!0),I=u.useCallback(k=>{o.current=k;const M=/jsdom/.test(window.navigator.userAgent);if(k.height===0&&!r.current&&!t.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(`
|
|
342
342
|
`)),r.current=!0),k.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(`
|
|
343
|
-
`)),r.current=!0),_.current){m(k),_.current=!1;return}g(k)},[t.autoHeight,g,n]);ln(()=>p(),[p]),xn(e,"sortedRowsSet",p),xn(e,"paginationModelChange",p),xn(e,"columnsChange",p),ot(e,"resize",I),xn(e,"debouncedResize",t.onResize)}const ume=["style"],dme=["style"];function bu(e,t,n=0,r=t.length){if(t.length<=0)return-1;if(n>=r)return n;const o=n+Math.floor((r-n)/2),i=t[o];return e<=i?bu(e,t,n,o):bu(e,t,o+1,r)}function fme(e,t,n){let r=1;for(;n<t.length&&Math.abs(t[n])<e;)n+=r,r*=2;return bu(e,t,Math.floor(n/2),Math.min(n,t.length))}const wl=({firstIndex:e,lastIndex:t,buffer:n,minFirstIndex:r,maxLastIndex:o})=>[Vu(e-n,r,o),Vu(t+n,r,o)],C4=(e,t)=>e===t?!0:e.firstRowIndex===t.firstRowIndex&&e.lastRowIndex===t.lastRowIndex&&e.firstColumnIndex===t.firstColumnIndex&&e.lastColumnIndex===t.lastColumnIndex,pme={maxSize:3},hme=e=>{var t,n;const r=lc(),o=tt(),i=Ge(r,Or),{ref:s,disableVirtualization:a,onRenderZonePositioning:c,renderZoneMinColumnIndex:d=0,renderZoneMaxColumnIndex:p=i.length,getRowProps:h}=e,m=lr(),g=Ge(r,Hu),y=Ge(r,YS),v=Ge(r,ii),S=Ge(r,Rg),w=Ge(r,cp),C=Ge(r,Fg),x=ac(r,o),P=u.useRef(null),_=u.useRef(null),I=Vt(s,_),[k,M]=u.useState(null),O=u.useRef(k),F=u.useRef({top:0,left:0}),[L,D]=u.useState({width:null,height:null}),B=u.useRef(y),R=u.useRef(Object.create(null)),A=u.useRef(),z=u.useRef(),V=u.useRef(qS((ee,ke,Re)=>ee.slice(ke,Re),pme)),N=u.useCallback(ee=>{var ke,Re;const Pe=r.current.getLastMeasuredRowIndex();let pe=Pe===1/0;(ke=x.range)!=null&&ke.lastRowIndex&&!pe&&(pe=Pe>=x.range.lastRowIndex);const be=Vu(Pe-(((Re=x.range)==null?void 0:Re.firstRowIndex)||0),0,w.positions.length);return pe||w.positions[be]>=ee?bu(ee,w.positions):fme(ee,w.positions,be)},[r,(t=x.range)==null?void 0:t.firstRowIndex,(n=x.range)==null?void 0:n.lastRowIndex,w.positions]),H=u.useCallback(()=>{if(a)return{firstRowIndex:0,lastRowIndex:x.rows.length,firstColumnIndex:0,lastColumnIndex:i.length};const{top:ee,left:ke}=F.current,Re=Math.min(N(ee),w.positions.length-1),Pe=o.autoHeight?Re+x.rows.length:N(ee+L.height);let pe=!1,be=0,te=g.length;const[Oe,Ye]=wl({firstIndex:Re,lastIndex:Pe,minFirstIndex:0,maxLastIndex:x.rows.length,buffer:o.rowBuffer});for(let Ke=Oe;Ke<Ye&&!pe;Ke+=1){const Ue=x.rows[Ke];pe=r.current.rowHasAutoHeight(Ue.id)}return pe||(be=bu(Math.abs(ke),g),te=bu(Math.abs(ke)+L.width,g)),{firstRowIndex:Re,lastRowIndex:Pe,firstColumnIndex:be,lastColumnIndex:te}},[a,N,w.positions.length,o.autoHeight,o.rowBuffer,x.rows,g,i.length,r,L]);ln(()=>{a?P.current.style.transform="translate3d(0px, 0px, 0px)":(_.current.scrollLeft=0,_.current.scrollTop=0)},[a]),ln(()=>{D({width:_.current.clientWidth,height:_.current.clientHeight})},[w.currentPageTotalHeight]);const W=u.useCallback(()=>{_.current&&D({width:_.current.clientWidth,height:_.current.clientHeight})},[]);ot(r,"debouncedResize",W);const K=u.useCallback(ee=>{const[ke,Re]=wl({firstIndex:ee.firstRowIndex,lastIndex:ee.lastRowIndex,minFirstIndex:0,maxLastIndex:x.rows.length,buffer:o.rowBuffer}),[Pe]=wl({firstIndex:ee.firstColumnIndex,lastIndex:ee.lastColumnIndex,minFirstIndex:d,maxLastIndex:p,buffer:o.columnBuffer}),pe=Ww({firstColumnToRender:Pe,apiRef:r,firstRowToRender:ke,lastRowToRender:Re,visibleRows:x.rows}),be=m.direction==="ltr"?1:-1,te=cp(r.current.state).positions[ke],Oe=be*Hu(r)[pe];P.current.style.transform=`translate3d(${Oe}px, ${te}px, 0px)`,typeof c=="function"&&c({top:te,left:Oe})},[r,x.rows,c,d,p,o.columnBuffer,o.rowBuffer,m.direction]),Y=u.useCallback(ee=>{if(O.current&&C4(ee,O.current)){K(ee);return}M(ee),K(ee);const[ke,Re]=wl({firstIndex:ee.firstRowIndex,lastIndex:ee.lastRowIndex,minFirstIndex:0,maxLastIndex:x.rows.length,buffer:o.rowBuffer});r.current.publishEvent("renderedRowsIntervalChange",{firstRowToRender:ke,lastRowToRender:Re}),O.current=ee},[r,M,O,x.rows.length,o.rowBuffer,K]);ln(()=>{if(L.width==null)return;const ee=H();Y(ee);const{top:ke,left:Re}=F.current,Pe={top:ke,left:Re,renderContext:ee};r.current.publishEvent("scrollPositionChange",Pe)},[r,H,L.width,Y]);const ie=Pn(ee=>{const{scrollTop:ke,scrollLeft:Re}=ee.currentTarget;if(F.current.top=ke,F.current.left=Re,!O.current||ke<0||m.direction==="ltr"&&Re<0||m.direction==="rtl"&&Re>0)return;const Pe=a?O.current:H(),pe=Math.abs(Pe.firstRowIndex-O.current.firstRowIndex),be=Math.abs(Pe.lastRowIndex-O.current.lastRowIndex),te=Math.abs(Pe.firstColumnIndex-O.current.firstColumnIndex),Oe=Math.abs(Pe.lastColumnIndex-O.current.lastColumnIndex),Ye=pe>=o.rowThreshold||be>=o.rowThreshold||te>=o.columnThreshold||Oe>=o.columnThreshold||B.current!==y;r.current.publishEvent("scrollPositionChange",{top:ke,left:Re,renderContext:Ye?Pe:O.current},ee),Ye&&(Yu.flushSync(()=>{Y(Pe)}),B.current=y)}),re=Pn(ee=>{r.current.publishEvent("virtualScrollerWheel",{},ee)}),de=Pn(ee=>{r.current.publishEvent("virtualScrollerTouchMove",{},ee)}),se=(ee={renderContext:k})=>{var ke;const{onRowRender:Re,renderContext:Pe,minFirstColumn:pe=d,maxLastColumn:be=p,availableSpace:te=L.width,rowIndexOffset:Oe=0,position:Ye="center"}=ee;if(!Pe||te==null)return null;const Ke=a?0:o.rowBuffer,Ue=a?0:o.columnBuffer,[De,ct]=wl({firstIndex:Pe.firstRowIndex,lastIndex:Pe.lastRowIndex,minFirstIndex:0,maxLastIndex:x.rows.length,buffer:Ke}),vt=[];if(ee.rows)ee.rows.forEach(nt=>{vt.push(nt),r.current.calculateColSpan({rowId:nt.id,minFirstColumn:pe,maxLastColumn:be,columns:i})});else{if(!x.range)return null;for(let nt=De;nt<ct;nt+=1){const ht=x.rows[nt];vt.push(ht),r.current.calculateColSpan({rowId:ht.id,minFirstColumn:pe,maxLastColumn:be,columns:i})}}const[st,Pt]=wl({firstIndex:Pe.firstColumnIndex,lastIndex:Pe.lastColumnIndex,minFirstIndex:pe,maxLastIndex:be,buffer:Ue}),yt=Ww({firstColumnToRender:st,apiRef:r,firstRowToRender:De,lastRowToRender:ct,visibleRows:x.rows}),Ae=V.current(i,yt,Pt),Fe=((ke=o.slotProps)==null?void 0:ke.row)||{},{style:Be}=Fe,Ze=ne(Fe,ume);(A.current!==h||z.current!==Be)&&(R.current=Object.create(null));const Le=[];for(let nt=0;nt<vt.length;nt+=1){var Ve;const{id:ht,model:en}=vt[nt],kn=De+nt===x.rows.length-1,On=r.current.rowHasAutoHeight(ht)?"auto":r.current.unstable_getRowHeight(ht);let Xn;C[ht]==null?Xn=!1:Xn=r.current.isRowSelectable(ht),Re&&Re(ht);const ar=v!==null&&v.id===ht?v.field:null;let cr=null;S!==null&&S.id===ht&&(cr=r.current.getCellParams(ht,S.field).cellMode==="view"?S.field:null);const bn=typeof h=="function"&&h(ht,en)||{},{style:tn}=bn,Hn=ne(bn,dme);if(!R.current[ht]){const Go=E({},tn,Be);R.current[ht]=Go}Le.push(T.jsx(o.slots.row,E({row:en,rowId:ht,rowHeight:On,focusedCell:ar,tabbableCell:cr,renderedColumns:Ae,visibleColumns:i,firstColumnToRender:yt,lastColumnToRender:Pt,selected:Xn,index:Oe+((x==null||(Ve=x.range)==null?void 0:Ve.firstRowIndex)||0)+De+nt,containerWidth:te,isLastVisible:kn,position:Ye},Hn,Ze,{style:R.current[ht]}),ht))}return A.current=h,z.current=Be,Le},le=L.width&&y>=L.width,Ee=u.useMemo(()=>{const ee=Math.max(w.currentPageTotalHeight,1);let ke=!1;_!=null&&_.current&&ee<=(_==null?void 0:_.current.clientHeight)&&(ke=!0);const Re={width:le?y:"auto",height:ee,minHeight:ke?"100%":"auto"};return o.autoHeight&&x.rows.length===0&&(Re.height=LA(r,o.rowHeight)),Re},[r,_,y,w.currentPageTotalHeight,le,o.autoHeight,o.rowHeight,x.rows.length]);u.useEffect(()=>{r.current.publishEvent("virtualScrollerContentSizeChange")},[r,Ee]);const ye=u.useMemo(()=>{const ee={};return le||(ee.overflowX="hidden"),o.autoHeight&&(ee.overflowY="hidden"),ee},[le,o.autoHeight]),_e=u.useCallback(()=>O.current,[]);return r.current.register("private",{getRenderContext:_e}),{renderContext:k,updateRenderZonePosition:K,getRows:se,getRootProps:(ee={})=>E({ref:I,onScroll:ie,onWheel:re,onTouchMove:de},ee,{style:ee.style?E({},ee.style,ye):ye}),getContentProps:({style:ee}={})=>({style:ee?E({},ee,Ee):Ee}),getRenderZoneProps:()=>({ref:P})}},mme=e=>{const{classes:t,headerAlign:n,isDragging:r,showColumnBorder:o,groupId:i}=e;return Me({root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",r&&"columnHeader--moving",o&&"columnHeader--showColumnBorder",o&&"columnHeader--withRightBorder","withBorderColor",i===null?"columnHeader--emptyGroup":"columnHeader--filledGroup"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]},Bt,t)};function gme(e){var t;const{groupId:n,width:r,depth:o,maxDepth:i,fields:s,height:a,colIndex:c,hasFocus:d,tabIndex:p,isLastColumn:h}=e,m=tt(),g=u.useRef(null),y=Dt(),v=Ge(y,RA),S=n?v[n]:{},{headerName:w=n!=null?n:"",description:C="",headerAlign:x=void 0}=S;let P;const _=n&&((t=v[n])==null?void 0:t.renderHeaderGroup),I=u.useMemo(()=>({groupId:n,headerName:w,description:C,depth:o,maxDepth:i,fields:s,colIndex:c,isLastColumn:h}),[n,w,C,o,i,s,c,h]);n&&_&&(P=_(I));const k=m.showColumnVerticalBorder,M=E({},e,{classes:m.classes,showColumnBorder:k,headerAlign:x,depth:o,isDragging:!1}),O=w!=null?w:n,F=on(),L=n===null?`empty-group-cell-${F}`:n,D=mme(M);u.useLayoutEffect(()=>{if(d){const V=g.current.querySelector('[tabindex="0"]')||g.current;V==null||V.focus()}},[y,d]);const B=u.useCallback(z=>V=>{V.currentTarget.contains(V.target)&&y.current.publishEvent(z,I,V)},[y,I]),R=u.useMemo(()=>({onKeyDown:B("columnGroupHeaderKeyDown"),onFocus:B("columnGroupHeaderFocus"),onBlur:B("columnGroupHeaderBlur")}),[B]),A=typeof S.headerClassName=="function"?S.headerClassName(I):S.headerClassName;return T.jsx(UA,E({ref:g,classes:D,columnMenuOpen:!1,colIndex:c,height:a,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:p,isDraggable:!1,headerComponent:P,headerClassName:A,description:C,elementId:L,width:r,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:O,"aria-colspan":s.length,"data-fields":`|-${s.join("-|-")}-|`},R))}const jR=vr("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow",overridesResolver:(e,t)=>t.columnHeaderRow})(()=>({display:"flex"}));function vme(e){return!!e.target}const yme=e=>{const{innerRef:t,minColumnIndex:n=0,visibleColumns:r,sortColumnLookup:o,filterColumnLookup:i,columnPositions:s,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:c,columnHeaderFocus:d,columnGroupHeaderFocus:p,densityFactor:h,headerGroupingMaxDepth:m,columnMenuState:g,columnVisibility:y,columnGroupsHeaderStructure:v,hasOtherElementInTabSequence:S}=e,w=Pp(),[C,x]=u.useState(""),[P,_]=u.useState(""),I=lc(),k=tt(),M=u.useRef(null),O=Vt(t,M),[F,L]=u.useState(null),D=u.useRef(F),B=u.useRef(0),R=ac(I,k),A=uE(I,k.columnHeaderHeight),z=Math.floor(k.columnHeaderHeight*h),V=u.useCallback(ye=>{F&&ye&&C4(F,ye)||L(ye)},[F]);u.useEffect(()=>{I.current.columnHeadersContainerElementRef.current.scrollLeft=0},[I]);const N=u.useRef(qS(ihe,{equalityCheck:(ye,_e)=>["firstColumnIndex","minColumnIndex","columnBuffer"].every(ee=>ye[ee]===_e[ee])})),H=u.useCallback(ye=>{const[_e,ee]=wl({firstIndex:ye.firstRowIndex,lastIndex:ye.lastRowIndex,minFirstIndex:0,maxLastIndex:R.rows.length,buffer:k.rowBuffer}),ke=N.current({firstColumnIndex:ye.firstColumnIndex,minColumnIndex:n,columnBuffer:k.columnBuffer,firstRowToRender:_e,lastRowToRender:ee,apiRef:I,visibleRows:R.rows}),Re=w.direction==="ltr"?1:-1,Pe=ke>0?B.current-Re*s[ke]:B.current;M.current.style.transform=`translate3d(${-Pe}px, 0px, 0px)`},[s,n,k.columnBuffer,I,R.rows,k.rowBuffer,w.direction]);u.useLayoutEffect(()=>{F&&H(F)},[F,H]);const W=u.useCallback(({left:ye,renderContext:_e=null},ee)=>{var ke,Re;if(!M.current||B.current===ye&&((ke=D.current)==null?void 0:ke.firstColumnIndex)===(_e==null?void 0:_e.firstColumnIndex)&&((Re=D.current)==null?void 0:Re.lastColumnIndex)===(_e==null?void 0:_e.lastColumnIndex))return;B.current=ye;let Pe=!1;_e!==D.current||!D.current?(vme(ee)?(Yu.flushSync(()=>{V(_e)}),Pe=!0):V(_e),D.current=_e):Pe=!0,_e&&Pe&&H(_e)},[H,V]),K=u.useCallback(ye=>_(ye.field),[]),Y=u.useCallback(()=>_(""),[]),ie=u.useCallback(ye=>x(ye.field),[]),re=u.useCallback(()=>x(""),[]);ot(I,"columnResizeStart",K),ot(I,"columnResizeStop",Y),ot(I,"columnHeaderDragStart",ie),ot(I,"columnHeaderDragEnd",re),ot(I,"scrollPositionChange",W);const de=ye=>{const{renderContext:_e=F,minFirstColumn:ee=n,maxLastColumn:ke=r.length}=ye||{};if(!_e)return null;const[Re,Pe]=wl({firstIndex:_e.firstRowIndex,lastIndex:_e.lastRowIndex,minFirstIndex:0,maxLastIndex:R.rows.length,buffer:k.rowBuffer}),pe=N.current({firstColumnIndex:_e.firstColumnIndex,minColumnIndex:ee,columnBuffer:k.columnBuffer,apiRef:I,firstRowToRender:Re,lastRowToRender:Pe,visibleRows:R.rows}),be=Math.min(_e.lastColumnIndex+k.columnBuffer,ke);return{renderedColumns:r.slice(pe,be),firstColumnToRender:pe,lastColumnToRender:be,minFirstColumn:ee,maxLastColumn:ke}},se=(ye,_e={})=>{const ee=de(ye);if(ee==null)return null;const{renderedColumns:ke,firstColumnToRender:Re}=ee,Pe=[];for(let pe=0;pe<ke.length;pe+=1){const be=ke[pe],te=Re+pe,Oe=te===0,Ye=a!==null&&a.field===be.field||Oe&&!S?0:-1,Ke=d!==null&&d.field===be.field,Ue=g.open&&g.field===be.field;Pe.push(T.jsx($ue,E({},o[be.field],{columnMenuOpen:Ue,filterItemsCounter:i[be.field]&&i[be.field].length,headerHeight:z,isDragging:be.field===C,colDef:be,colIndex:te,isResizing:P===be.field,hasFocus:Ke,tabIndex:Ye},_e),be.field))}return T.jsx(jR,{role:"row","aria-rowindex":m+1,ownerState:k,children:Pe})},le=ye=>{if(m===0)return null;const _e=de(ye);if(_e==null||_e.renderedColumns.length===0)return null;const{firstColumnToRender:ee,lastColumnToRender:ke}=_e,Re=[],Pe=[];for(let te=0;te<m;te+=1){var pe,be;const Oe=v[te],Ye=r[ee].field,Ke=(pe=I.current.unstable_getColumnGroupPath(Ye)[te])!=null?pe:null,Ue=Oe.findIndex(({groupId:Ze,columnFields:Ie})=>Ze===Ke&&Ie.includes(Ye)),De=r[ke-1].field,ct=(be=I.current.unstable_getColumnGroupPath(De)[te])!=null?be:null,vt=Oe.findIndex(({groupId:Ze,columnFields:Ie})=>Ze===ct&&Ie.includes(De)),st=Oe.slice(Ue,vt+1).map(Ze=>E({},Ze,{columnFields:Ze.columnFields.filter(Ie=>y[Ie]!==!1)})).filter(Ze=>Ze.columnFields.length>0),Pt=st[0].columnFields.indexOf(Ye),Ae=st[0].columnFields.slice(0,Pt).reduce((Ze,Ie)=>{var Le;const Ve=I.current.getColumn(Ie);return Ze+((Le=Ve.computedWidth)!=null?Le:0)},0);let Fe=ee;const Be=st.map(({groupId:Ze,columnFields:Ie})=>{const Le=p!==null&&p.depth===te&&Ie.includes(p.field),Ve=c!==null&&c.depth===te&&Ie.includes(c.field)?0:-1,nt={groupId:Ze,width:Ie.reduce((ht,en)=>ht+I.current.getColumn(en).computedWidth,0),fields:Ie,colIndex:Fe,hasFocus:Le,tabIndex:Ve};return Fe+=Ie.length,nt});Pe.push({leftOverflow:Ae,elements:Be})}return Pe.forEach((te,Oe)=>{Re.push(T.jsx(jR,{style:{height:`${z}px`,transform:`translateX(-${te.leftOverflow}px)`},role:"row","aria-rowindex":Oe+1,ownerState:k,children:te.elements.map(({groupId:Ye,width:Ke,fields:Ue,colIndex:De,hasFocus:ct,tabIndex:vt},st)=>T.jsx(gme,{groupId:Ye,width:Ke,fields:Ue,colIndex:De,depth:Oe,isLastColumn:De===r.length-Ue.length,maxDepth:Pe.length,height:z,hasFocus:ct,tabIndex:vt},st))},Oe))}),Re},Ee={minHeight:A,maxHeight:A,lineHeight:`${z}px`};return{renderContext:F,getColumnHeaders:se,getColumnsToRender:de,getColumnGroupHeaders:le,isDragging:!!C,getRootProps:(ye={})=>E({style:Ee},ye),getInnerProps:()=>({ref:O,role:"rowgroup"}),headerHeight:z}},bme=["className"],wme=e=>{const{classes:t}=e;return Me({root:["columnHeaders","withBorderColor"]},Bt,t)},Cme=vr("div",{name:"MuiDataGrid",slot:"ColumnHeaders",overridesResolver:(e,t)=>t.columnHeaders})({position:"relative",overflow:"hidden",display:"flex",alignItems:"center",boxSizing:"border-box",borderBottom:"1px solid",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),xme=u.forwardRef(function(t,n){const{className:r}=t,o=ne(t,bme),i=tt(),s=wme(i);return T.jsx(Cme,E({ref:n,className:he(r,s.root),ownerState:i},o))}),Sme=["isDragging","className"],Eme=e=>{const{isDragging:t,hasScrollX:n,classes:r}=e;return Me({root:["columnHeadersInner",t&&"columnHeaderDropZone",n&&"columnHeadersInner--scrollable"]},Bt,r)},Pme=vr("div",{name:"MuiDataGrid",slot:"columnHeadersInner",overridesResolver:(e,t)=>[{[`&.${X.columnHeaderDropZone}`]:t.columnHeaderDropZone},t.columnHeadersInner]})(()=>({display:"flex",alignItems:"flex-start",flexDirection:"column",[`&.${X.columnHeaderDropZone} .${X.columnHeaderDraggableContainer}`]:{cursor:"move"},[`&.${X["columnHeadersInner--scrollable"]} .${X.columnHeader}:last-child`]:{borderRight:"none"}})),Ime=u.forwardRef(function(t,n){var r,o;const{isDragging:i,className:s}=t,a=ne(t,Sme),c=Dt(),d=tt(),p=E({},d,{isDragging:i,hasScrollX:(r=(o=c.current.getRootDimensions())==null?void 0:o.hasScrollX)!=null?r:!1}),h=Eme(p);return T.jsx(Pme,E({ref:n,className:he(s,h.root),ownerState:p},a))}),kme=["innerRef","className","visibleColumns","sortColumnLookup","filterColumnLookup","columnPositions","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","densityFactor","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],_me=u.forwardRef(function(t,n){const{innerRef:r,visibleColumns:o,sortColumnLookup:i,filterColumnLookup:s,columnPositions:a,columnHeaderTabIndexState:c,columnGroupHeaderTabIndexState:d,columnHeaderFocus:p,columnGroupHeaderFocus:h,densityFactor:m,headerGroupingMaxDepth:g,columnMenuState:y,columnVisibility:v,columnGroupsHeaderStructure:S,hasOtherElementInTabSequence:w}=t,C=ne(t,kme),{isDragging:x,getRootProps:P,getInnerProps:_,getColumnHeaders:I,getColumnGroupHeaders:k}=yme({innerRef:r,visibleColumns:o,sortColumnLookup:i,filterColumnLookup:s,columnPositions:a,columnHeaderTabIndexState:c,columnGroupHeaderTabIndexState:d,columnHeaderFocus:p,columnGroupHeaderFocus:h,densityFactor:m,headerGroupingMaxDepth:g,columnMenuState:y,columnVisibility:v,columnGroupsHeaderStructure:S,hasOtherElementInTabSequence:w});return T.jsx(xme,E({ref:n},P(C),{children:T.jsxs(Ime,E({isDragging:x},_(),{children:[k(),I()]}))}))}),$me=xy(_me),Rme=u.forwardRef(function(t,n){const o=Dt().current.getLocaleText("noResultsOverlayLabel");return T.jsx(nE,E({ref:n},t,{children:o}))}),Mme=["sortingOrder"],Tme=u.memo(function(t){const{sortingOrder:n}=t,r=ne(t,Mme),o=tt(),[i]=n,s=i==="asc"?o.slots.columnSortedAscendingIcon:o.slots.columnSortedDescendingIcon;return s?T.jsx(s,E({},r)):null}),Ome=["native"];function Lme(e){let{native:t}=e,n=ne(e,Ome);return t?T.jsx("option",E({},n)):T.jsx(fo,E({},n))}const Fme={BooleanCellTrueIcon:Ede,BooleanCellFalseIcon:q1,ColumnMenuIcon:wde,OpenFilterButtonIcon:pde,FilterPanelDeleteIcon:q1,ColumnFilteredIcon:xR,ColumnSelectorIcon:mde,ColumnUnsortedIcon:Tme,ColumnSortedAscendingIcon:yR,ColumnSortedDescendingIcon:bR,ColumnResizeIcon:gde,DensityCompactIcon:vde,DensityStandardIcon:yde,DensityComfortableIcon:bde,ExportIcon:Sde,MoreActionsIcon:Pde,TreeDataCollapseIcon:CR,TreeDataExpandIcon:wR,GroupingCriteriaCollapseIcon:CR,GroupingCriteriaExpandIcon:wR,DetailPanelExpandIcon:SR,DetailPanelCollapseIcon:Cde,RowReorderIcon:ER,QuickFilterIcon:hde,QuickFilterClearIcon:q1,ColumnMenuHideIcon:Ide,ColumnMenuSortAscendingIcon:yR,ColumnMenuSortDescendingIcon:bR,ColumnMenuFilterIcon:xR,ColumnMenuManageColumnsIcon:kde,ColumnMenuClearIcon:_de,LoadIcon:xde,FilterPanelAddIcon:SR,FilterPanelRemoveAllIcon:$de,ColumnReorderIcon:ER},Ame=E({},Fme,{BaseCheckbox:QL,BaseTextField:$p,BaseFormControl:nF,BaseSelect:Wx,BaseSwitch:SF,BaseButton:mr,BaseIconButton:oo,BaseInputAdornment:qa,BaseTooltip:nd,BasePopper:oc,BaseInputLabel:dF,BaseSelectOption:Lme,BaseChip:Ax}),Nme=Ame,Dme=E({},Nme,{Cell:zw,SkeletonCell:Yce,ColumnHeaderFilterIconButton:ide,ColumnMenu:Ude,ColumnHeaders:$me,Footer:ope,Toolbar:null,PreferencesPanel:yfe,LoadingOverlay:spe,NoResultsOverlay:Rme,NoRowsOverlay:lpe,Pagination:cpe,FilterPanel:jfe,ColumnsPanel:ffe,Panel:vfe,Row:wpe}),x4=e=>{if(e!==void 0)return Object.keys(e).reduce((t,n)=>E({},t,{[`${n.charAt(0).toLowerCase()}${n.slice(1)}`]:e[n]}),{})};function Bme({defaultSlots:e,slots:t,components:n}){const r=t!=null?t:n?x4(n):null;return!r||Object.keys(r).length===0?e:E({},e,r)}const zme=["components","componentsProps"];function jme(e){var t;const n=Object.keys(e);if(!n.some(i=>i.startsWith("aria-")||i.startsWith("data-")))return e;const r={},o=(t=e.forwardedProps)!=null?t:{};for(let i=0;i<n.length;i+=1){const s=n[i];s.startsWith("aria-")||s.startsWith("data-")?o[s]=e[s]:r[s]=e[s]}return r.forwardedProps=o,r}function Hme(e){return u.useMemo(()=>{const{components:t,componentsProps:n}=e,r=ne(e,zme);return[t,n,jme(r)]},[e])}const Vme={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,disableMultipleRowSelection:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,disableColumnResize:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid"},S4={autoHeight:!1,autoPageSize:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,columnBuffer:3,rowBuffer:3,columnThreshold:3,rowThreshold:3,rowSelection:!0,density:"standard",disableColumnFilter:!1,disableColumnMenu:!1,disableColumnSelector:!1,disableDensitySelector:!1,disableMultipleColumnsFiltering:!1,disableMultipleRowSelection:!1,disableMultipleColumnsSorting:!1,disableRowSelectionOnClick:!1,disableVirtualization:!1,editMode:vs.Cell,filterMode:"client",columnHeaderHeight:56,hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,logger:console,logLevel:"error",pagination:!1,paginationMode:"client",rowHeight:52,pageSizeOptions:[25,50,100],rowSpacingType:"margin",showCellVerticalBorder:!1,showColumnVerticalBorder:!1,sortingOrder:["asc","desc",null],sortingMode:"client",throttleRowsMs:0,disableColumnReorder:!1,disableColumnResize:!1,keepNonExistentRowsSelected:!1,keepColumnPositionIfDraggedOutside:!1,unstable_ignoreValueFormatterDuringExport:!1,clipboardCopyCellDelimiter:" "},Ume=x4(Dme),Wme=e=>{const[t,n,r]=Hme(et({props:e,name:"MuiDataGrid"})),o=u.useMemo(()=>E({},tme,r.localeText),[r.localeText]),i=u.useMemo(()=>Bme({defaultSlots:Ume,slots:r.slots,components:t}),[t,r.slots]);return u.useMemo(()=>{var s;return E({},S4,r,{localeText:o,slots:i,slotProps:(s=r.slotProps)!=null?s:n},Vme)},[r,o,i,n])},Gme=e=>E({},e,{rowsMeta:{currentPageTotalHeight:0,positions:[]}}),HR=(e,t,n)=>typeof e=="number"&&e>0?e:t,Kme=(e,t)=>{const{getRowHeight:n,getRowSpacing:r,getEstimatedRowHeight:o}=t,i=u.useRef(Object.create(null)),s=u.useRef(-1),a=u.useRef(!1),c=Ge(e,ld),d=Ge(e,Cr),p=Ge(e,QA),h=Ge(e,ni),m=ac(e,t),g=Ge(e,sd),y=HR(t.rowHeight,S4.rowHeight),v=Math.floor(y*c),S=u.useCallback(()=>{var D,B;a.current=!1;const R=V=>{i.current[V.id]||(i.current[V.id]={sizes:{baseCenter:v},isResized:!1,autoHeight:!1,needsFirstMeasurement:!0});const{isResized:N,needsFirstMeasurement:H,sizes:W}=i.current[V.id];let K=typeof v=="number"&&v>0?v:52;const Y=W.baseCenter;if(N)K=Y;else if(n){const le=n(E({},V,{densityFactor:c}));if(le==="auto"){if(H){const Ee=o?o(E({},V,{densityFactor:c})):v;K=Ee!=null?Ee:v}else K=Y;a.current=!0,i.current[V.id].autoHeight=!0}else K=HR(le,v),i.current[V.id].needsFirstMeasurement=!1,i.current[V.id].autoHeight=!1}else i.current[V.id].needsFirstMeasurement=!1;const ie={};for(const le in W)/^base[A-Z]/.test(le)&&(ie[le]=W[le]);if(ie.baseCenter=K,r){var re,de;const le=e.current.getRowIndexRelativeToVisibleRows(V.id),Ee=r(E({},V,{isFirstVisible:le===0,isLastVisible:le===m.rows.length-1,indexRelativeToCurrentPage:le}));ie.spacingTop=(re=Ee.top)!=null?re:0,ie.spacingBottom=(de=Ee.bottom)!=null?de:0}const se=e.current.unstable_applyPipeProcessors("rowHeight",ie,V);return i.current[V.id].sizes=se,se},A=[],z=m.rows.reduce((V,N)=>{A.push(V);let H=0,W=0;const K=R(N);for(const Y in K){const ie=K[Y];/^base[A-Z]/.test(Y)?H=ie>H?ie:H:W+=ie}return V+H+W},0);g==null||(D=g.top)==null||D.forEach(V=>{R(V)}),g==null||(B=g.bottom)==null||B.forEach(V=>{R(V)}),e.current.setState(V=>E({},V,{rowsMeta:{currentPageTotalHeight:z,positions:A}})),a.current||(s.current=1/0),e.current.forceUpdate()},[e,m.rows,v,n,r,o,g,c]),w=u.useCallback(D=>{const B=i.current[D];return B?B.sizes.baseCenter:v},[v]),C=D=>{var B;return(B=i.current[D])==null?void 0:B.sizes},x=u.useCallback((D,B)=>{i.current[D].sizes.baseCenter=B,i.current[D].isResized=!0,i.current[D].needsFirstMeasurement=!1,S()},[S]),P=u.useMemo(()=>Ws(S),[S]),_=u.useCallback((D,B,R)=>{if(!i.current[D]||!i.current[D].autoHeight)return;const A=i.current[D].sizes[`base${ue(R)}`]!==B;i.current[D].needsFirstMeasurement=!1,i.current[D].sizes[`base${ue(R)}`]=B,A&&P()},[P]),I=u.useCallback(D=>{var B;return((B=i.current[D])==null?void 0:B.autoHeight)||!1},[]),k=u.useCallback(()=>s.current,[]),M=u.useCallback(D=>{a.current&&D>s.current&&(s.current=D)},[]),O=u.useCallback(()=>{i.current={},S()},[S]);u.useEffect(()=>{S()},[v,d,p,h,S]),cE(e,"rowHeight",S);const F={unstable_setLastMeasuredRowIndex:M,unstable_getRowHeight:w,unstable_getRowInternalSizes:C,unstable_setRowHeight:x,unstable_storeRowHeightMeasurement:_,resetRowHeights:O},L={getLastMeasuredRowIndex:k,rowHasAutoHeight:I};Ft(e,F,"public"),Ft(e,L,"private")},qme=e=>{const t=u.useCallback((o={})=>e.current.unstable_applyPipeProcessors("exportState",{},o),[e]),n=u.useCallback(o=>{e.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:o}).callbacks.forEach(s=>{s()}),e.current.forceUpdate()},[e]);Ft(e,{exportState:t,restoreState:n},"public")},Yme=e=>{const t=u.useRef({}),n=u.useCallback((d,p,h)=>{const m=t.current;m[d]||(m[d]={}),m[d][p]=h},[]),r=u.useCallback((d,p)=>{var h;return(h=t.current[d])==null?void 0:h[p]},[]),o=u.useCallback(d=>{const{columnIndex:p,rowId:h,minFirstColumnIndex:m,maxLastColumnIndex:g,columns:y}=d,v=y.length,S=y[p],w=typeof S.colSpan=="function"?S.colSpan(e.current.getCellParams(h,S.field)):S.colSpan;if(!w||w===1)return n(h,p,{spannedByColSpan:!1,cellProps:{colSpan:1,width:S.computedWidth}}),{colSpan:1};let C=S.computedWidth;for(let x=1;x<w;x+=1){const P=p+x;if(P>=m&&P<g){const _=y[P];C+=_.computedWidth,n(h,p+x,{spannedByColSpan:!0,rightVisibleCellIndex:Math.min(p+w,v-1),leftVisibleCellIndex:p})}n(h,p,{spannedByColSpan:!1,cellProps:{colSpan:w,width:C}})}return{colSpan:w}},[e,n]),i=u.useCallback(({rowId:d,minFirstColumn:p,maxLastColumn:h,columns:m})=>{for(let g=p;g<h;g+=1){const y=o({columnIndex:g,rowId:d,minFirstColumnIndex:p,maxLastColumnIndex:h,columns:m});y.colSpan>1&&(g+=y.colSpan-1)}},[o]),s={unstable_getCellColSpanInfo:r},a={calculateColSpan:i};Ft(e,s,"public"),Ft(e,a,"private");const c=u.useCallback(()=>{t.current={}},[]);ot(e,"columnOrderChange",c)},E4=(e,t,n)=>{if(FA(e)){if(n[e.field]!==void 0)throw new Error(["MUI: columnGroupingModel contains duplicated field",`column field ${e.field} occurs two times in the grouping model:`,`- ${n[e.field].join(" > ")}`,`- ${t.join(" > ")}`].join(`
|
|
344
|
-
`));n[e.field]=t;return}const{groupId:r,children:o}=e;o.forEach(i=>{E4(i,[...t,r],n)})},Kw=e=>{if(!e)return{};const t={};return e.forEach(n=>{E4(n,[],t)}),t},qw=(e,t)=>{const n=s=>{var a;return(a=t[s])!=null?a:[]},r=[],o=Math.max(...e.map(s=>n(s).length)),i=(s,a,c)=>La(n(s).slice(0,c+1),n(a).slice(0,c+1));for(let s=0;s<o;s+=1){const a=e.reduce((c,d)=>{var p;const h=(p=n(d)[s])!=null?p:null;if(c.length===0)return[{columnFields:[d],groupId:h}];const m=c[c.length-1],g=m.columnFields[m.columnFields.length-1];return m.groupId!==h||!i(g,d,s)?[...c,{columnFields:[d],groupId:h}]:[...c.slice(0,c.length-1),{columnFields:[...m.columnFields,d],groupId:h}]},[]);r.push(a)}return r},
|
|
345
|
-
`)):null,paginationMode:ae.oneOf(["client","server"]),paginationModel:ae.shape({page:ae.number.isRequired,pageSize:ae.number.isRequired}),processRowUpdate:ae.func,rowBuffer:ae.number,rowCount:ae.number,rowHeight:ae.number,rowModesModel:ae.object,rows:ae.arrayOf(ae.object).isRequired,rowSelection:ae.bool,rowSelectionModel:ae.oneOfType([ae.arrayOf(ae.oneOfType([ae.number,ae.string]).isRequired),ae.number,ae.string]),rowSpacingType:ae.oneOf(["border","margin"]),rowThreshold:ae.number,scrollbarSize:ae.number,showCellVerticalBorder:ae.bool,showColumnVerticalBorder:ae.bool,slotProps:ae.object,slots:ae.object,sortingMode:ae.oneOf(["client","server"]),sortingOrder:ae.arrayOf(ae.oneOf(["asc","desc"])),sortModel:ae.arrayOf(ae.shape({field:ae.string.isRequired,sort:ae.oneOf(["asc","desc"])})),sx:ae.oneOfType([ae.arrayOf(ae.oneOfType([ae.func,ae.object,ae.bool])),ae.func,ae.object]),unstable_ignoreValueFormatterDuringExport:ae.oneOfType([ae.shape({clipboardExport:ae.bool,csvExport:ae.bool}),ae.bool])};const J1="Actions";function Dp(a){var c=a,{columns:e,initialState:t={},actions:n,actionsProps:r,initializing:o,noRows:i}=c,s=Yt(c,["columns","initialState","actions","actionsProps","initializing","noRows"]);const{width:d}=HF(),p=lr(),h=oae(),[m,g]=u.useState(0),y=u.useMemo(()=>{const P=e.map(_=>{const{mergeRender:I}=_;if(!I)return _;const F=I,{other:k,override:M}=F,O=Yt(F,["other","override"]);return kt(Ce({},_),{originalRenderCell:_.renderCell||!0,renderCell(L){const{columns:D}=L.api.store.getSnapshot(),B=D.columnVisibilityModel[k]===!1;return u.createElement(je,{},_.renderCell?_.renderCell(L):L.formattedValue,B&&u.createElement(je,O,x(Ce(Ce({},D.lookup[k]),M),L.row)))}})});return n&&P.push(Ce({field:J1,width:40*m,headerName:"",align:"center",headerAlign:"center",hideSortIcons:!0,disableColumnMenu:!0,renderCell(_){const I=n(Ce(Ce({},_.row),_));return setTimeout(()=>g(I.length)),u.createElement(je,{whiteSpace:"nowrap"},...I)}},r)),P},[e,n,m]),v=u.useMemo(()=>{if(!d)return;const P=rd(y.map(({field:I,hideUnder:k})=>k&&d<(typeof k=="number"?k:p.breakpoints.values[k])&&I)),_=Object.fromEntries(P.map(I=>[I,!1]));return St.merge(t,{columns:{columnVisibilityModel:_}}),P},[y]),[S,w]=u.useState({}),C=u.useRef({});if(u.useEffect(()=>{const{current:{id:P,setCurRow:_}}=C;_==null||_(St.find(s.rows,{id:P}))}),!v)return null;return u.createElement(u.Fragment,{},o&&u.createElement(je,{position:"relative"},u.createElement(fF,{sx:{position:"absolute",width:"calc(100% - 2px)",borderRadius:1,m:"1px 1px"}})),u.createElement(I4,kt(Ce({initialState:t,columns:y,apiRef:h,slots:Ce({},(i||o)&&{noRowsOverlay:()=>o?null:u.createElement(py,{},i)}),onCellClick({field:P,row:_}){if(P===J1)return;const I=h.current.getVisibleColumns().length,k=y.filter(M=>M.renderCell||M.field===J1||_[M.field]!==void 0);k.length<=I||Wo({title:"Details",onClose(){C.current={}},Content(){const[M,O]=u.useState(_),F=u.useRef(_);M&&(F.current=M);const L=F.current;return C.current={id:L.id,setCurRow:O},u.createElement(je,{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(8em,1fr))",gap:"1em",gridAutoFlow:"dense",minWidth:"max(16em, 40vw)",sx:{opacity:M?void 0:.5}},k.map(D=>u.createElement(je,{key:D.field,gridColumn:D.flex&&"1/-1"},u.createElement(je,{bgcolor:"#0003",p:1},D.headerName||D.field),u.createElement(Ql,{minHeight:"2.5em",px:1,alignItems:"center",wordBreak:"break-word"},x(D,L)))))}})}},s),{onColumnVisibilityModelChange:P=>w(P),columnVisibilityModel:Ce(Ce(Ce({},Object.fromEntries(v.map(P=>[P,!1]))),s.columnVisibilityModel),S)})));function x(P,_){const I=h.current;let k=_[P.field];P.valueGetter&&(k=P.valueGetter({value:k,api:I,row:_,field:P.field,id:_.id}));const M=P.originalRenderCell||P.renderCell;return M&&M!==!0?M(Ce({value:k,row:_,api:I},_)):P.valueFormatter?P.valueFormatter(Ce({value:k},_)):k}}function fge(){return u.createElement(u.Fragment,{},u.createElement(hge),u.createElement(mge))}const pge=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;function hge(){const{data:e,element:t}=Lo("get_status"),{data:n}=gie("get_connection_stats");e&&n&&Object.assign(e,n);const r=Yl("md"),o=Yl("sm");return t||u.createElement(je,{display:"flex",flexWrap:"wrap",gap:"1em",mb:2},r&&i("started"),r&&i("http",{label:"HTTP",render:s}),r&&i("https",{label:"HTTPS",render:s}),o&&i("connections"),i("sent",{render:ql,minWidth:"4em"}),o&&i("got",{render:ql,minWidth:"4em"}),i("outSpeed",{label:"Output speed",render:k4}));function i(a,{label:c,minWidth:d,render:p}={}){let h=St.get(e,a);if(h===void 0)return null;typeof h=="string"&&pge.test(h)&&(h=new Date(h).toLocaleString());let m;return p&&(h=p(h),Array.isArray(h)&&([h,m]=h)),c||(c=St.capitalize(a.replaceAll("_"," "))),u.createElement(Ax,{variant:"filled",color:m,label:u.createElement(u.Fragment,{},u.createElement("b",{},c),": ",u.createElement("span",{style:{display:"inline-block",minWidth:d}},h))})}function s(a){return a.listening?["port "+a.port,"success"]:a.error?[a.error,"error"]:"off"}}function mge(){const{list:e,error:t,props:n}=sc("get_connections"),[r,o]=u.useState(!0),[i,s]=u.useState(!1),a=u.useMemo(()=>e==null?void 0:e.filter(c=>!r||c.path).map((c,d)=>Ce({id:d},c)),[!i&&e,r]);return u.createElement(u.Fragment,{},u.createElement(je,{display:"flex",alignItems:"center"},u.createElement(gs,{fullWidth:!1,value:r,onChange:o,options:{"Show only files":!0,"Show all connections":!1}}),u.createElement(je,{flex:1}),u.createElement(zn,{title:i?"Resume":"Pause",icon:i?hy:gA,sx:{mr:1},onClick(){s(!i)}})),t?u.createElement(Uo,{severity:"error"},t):u.createElement(Dp,{rows:a,noRows:r&&"No downloads at the moment",columns:[{field:"ip",headerName:"Address",flex:1,maxWidth:400,renderCell:({row:c,value:d})=>(d.includes(":")?`[${d}]`:d)+" :"+c.port,mergeRender:{other:"user",fontSize:"small"}},{field:"user",headerName:"User",hideUnder:"md"},{field:"started",headerName:"Started",type:"dateTime",width:100,hideUnder:"lg",valueFormatter:({value:c})=>new Date(c).toLocaleTimeString()},{field:"path",headerName:"File",flex:1.5,renderCell({value:c,row:d}){var h;if(!c)return;if(d.archive)return u.createElement(u.Fragment,{},u.createElement(bA,{sx:{mr:1}}),d.archive,u.createElement(je,{ml:2,color:"text.secondary"},c));const p=c==null?void 0:c.lastIndexOf("/");return u.createElement(u.Fragment,{},d.op&&u.createElement(uA,{icon:d.op==="upload"?Tp:GS,progress:(h=d.opProgress)!=null?h:d.opOffset,offset:d.opOffset,addTitle:d.opTotal&&u.createElement("div",{},"Total: "+ql(d.opTotal)),sx:{mr:1}}),u.createElement(je,{},c.slice(p+1),p>0&&u.createElement(je,{ml:2,fontSize:"x-small",color:"text.secondary"},c.slice(0,p))))}},{field:"outSpeed",headerName:"Speed",width:110,hideUnder:"sm",type:"number",renderCell:({value:c,row:d})=>k4(Math.max(c||0,d.inSpeed||0)),mergeRender:{other:"sent",fontSize:"small",textAlign:"right"}},{field:"sent",headerName:"Sent",type:"number",hideUnder:"md",renderCell:({value:c,row:d})=>ql(Math.max(c||0,d.got||0))},{field:"v",headerName:"Protocol",align:"center",hideUnder:1/0,renderCell:({value:c,row:d})=>u.createElement(u.Fragment,{},"IPv"+c,d.secure&&xo(jS,"HTTPS",{opacity:.5}))},{field:"agent",headerName:"Agent",hideUnder:"lg"}],actionsProps:{hideUnder:"sm"},actions:({row:c})=>[u.createElement(zn,{icon:vA,title:"Disconnect",onClick:()=>Et("disconnect",St.pick(c,["ip","port"])).then(()=>Wr("Disconnection requested"))}),u.createElement(zn,{icon:yA,title:"Block IP",disabled:c.ip===(n==null?void 0:n.you),onClick:()=>gge(c.ip)})]}))}function gge(e){return lle("block",t=>[...t,{ip:e}])}function k4(e){return e?ql(e*1e3,{post:"B/s",k:1e3,digits:1}):""}var fE={},vge=ut;Object.defineProperty(fE,"__esModule",{value:!0});var _4=fE.default=void 0,yge=vge(dt()),bge=at(),wge=(0,yge.default)((0,bge.jsx)("path",{d:"M5 17h14v2H5zm7-12L5.33 15h13.34z"}),"Eject");_4=fE.default=wge;var pE={},Cge=ut;Object.defineProperty(pE,"__esModule",{value:!0});var $4=pE.default=void 0,xge=Cge(dt()),Sge=at(),Ege=(0,xge.default)((0,Sge.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward");$4=pE.default=Ege;var hE={},Pge=ut;Object.defineProperty(hE,"__esModule",{value:!0});var R4=hE.default=void 0,Ige=Pge(dt()),kge=at(),_ge=(0,Ige.default)((0,kge.jsx)("path",{d:"M8 11h3v10h2V11h3l-4-4-4 4zM4 3v2h16V3H4z"}),"VerticalAlignTop");R4=hE.default=_ge;var mE={},$ge=ut;Object.defineProperty(mE,"__esModule",{value:!0});var M4=mE.default=void 0,Rge=$ge(dt()),Mge=at(),Tge=(0,Rge.default)((0,Mge.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");M4=mE.default=Tge;var gE={},Oge=ut;Object.defineProperty(gE,"__esModule",{value:!0});var T4=gE.default=void 0,Lge=Oge(dt()),Fge=at(),Age=(0,Lge.default)((0,Fge.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");T4=gE.default=Age;var vE={},Nge=ut;Object.defineProperty(vE,"__esModule",{value:!0});var O4=vE.default=void 0,Dge=Nge(dt()),VR=at(),Bge=(0,Dge.default)([(0,VR.jsx)("path",{d:"M2 16.5C2 19.54 4.46 22 7.5 22s5.5-2.46 5.5-5.5V10H2v6.5zm5.5 2C6.12 18.5 5 17.83 5 17h5c0 .83-1.12 1.5-2.5 1.5zM10 13c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm-5 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z"},"0"),(0,VR.jsx)("path",{d:"M11 3v6h3v2.5c0-.83 1.12-1.5 2.5-1.5s2.5.67 2.5 1.5h-5v2.89c.75.38 1.6.61 2.5.61 3.04 0 5.5-2.46 5.5-5.5V3H11zm3 5.08c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1c0 .56-.45 1-1 1zm5 0c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1c0 .56-.45 1-1 1z"},"1")],"TheaterComedy");O4=vE.default=Bge;var yE={},zge=ut;Object.defineProperty(yE,"__esModule",{value:!0});var L4=yE.default=void 0,jge=zge(dt()),Hge=at(),Vge=(0,jge.default)((0,Hge.jsx)("path",{d:"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"}),"Folder");L4=yE.default=Vge;var bE={},Uge=ut;Object.defineProperty(bE,"__esModule",{value:!0});var F4=bE.default=void 0,Wge=Uge(dt()),Gge=at(),Kge=(0,Wge.default)((0,Gge.jsx)("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"}),"Home");F4=bE.default=Kge;var wE={},qge=ut;Object.defineProperty(wE,"__esModule",{value:!0});var A4=wE.default=void 0,Yge=qge(dt()),Qge=at(),Xge=(0,Yge.default)((0,Qge.jsx)("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}),"InsertDriveFileOutlined");A4=wE.default=Xge;var CE={},Jge=ut;Object.defineProperty(CE,"__esModule",{value:!0});var N4=CE.default=void 0,Zge=Jge(dt()),eve=at(),tve=(0,Zge.default)((0,eve.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"}),"RemoveRedEye");N4=CE.default=tve;var xE={},nve=ut;Object.defineProperty(xE,"__esModule",{value:!0});var D4=xE.default=void 0,rve=nve(dt()),ove=at(),ive=(0,rve.default)((0,ove.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-5 14H4v-4h11v4zm0-5H4V9h11v4zm5 5h-4V9h4v9z"}),"Web");D4=xE.default=ive;var SE={},sve=ut;Object.defineProperty(SE,"__esModule",{value:!0});var B4=SE.default=void 0,lve=sve(dt()),ave=at(),cve=(0,lve.default)((0,ave.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"}),"Cloud");B4=SE.default=cve;var EE={},uve=ut;Object.defineProperty(EE,"__esModule",{value:!0});var z4=EE.default=void 0,dve=uve(dt()),fve=at(),pve=(0,dve.default)((0,fve.jsx)("path",{d:"M14.59 8 12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41 14.59 8zM12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"HighlightOff");z4=EE.default=pve;function hve(){const{close:e}=Wo({title:"Add files or folders",dialogProps:{sx:{minWidth:"min(90vw, 40em)",minHeight:"calc(100vh - 9em)"}},Content(){const t=j4();return u.createElement(u.Fragment,{},u.createElement(je,{sx:{typography:"body1",px:1,py:2}},"Selected elements will be added under ",t.isRoot?u.createElement("i",{},"Home"):t.id),u.createElement(BN,{from:t.source,onSelect(r){return mt(this,null,function*(){const o=rd(yield Promise.all(r.map(i=>Et("add_vfs",{parent:t.id,source:i}).then(()=>null,s=>[i,s.message]))));o.length&&(yield un(u.createElement(je,{},"Some elements have been rejected",u.createElement("ul",{},o.map(([i,s])=>u.createElement("li",{key:i},i,": ",s)))),"error")),ec(),e()})}}))}})}function mve(){return mt(this,null,function*(){try{const e=yield ile("Enter folder name");if(!e)return;const{id:t}=j4();yield Et("add_vfs",{parent:t,name:e}),ec([t+e]),yield un(`Folder "${e}" created`,"success")}catch(e){yield un(e)}})}function j4(){const e=pn.selectedFiles[0]||pn.vfs;return e.type==="folder"?e:e.parent}function H4(n){var r=n,{items:e}=r,t=Yt(r,["items"]);const[o,i]=$o.useState(),s=!!o,a=u.useCallback(()=>i(void 0),[]);return u.createElement($o.Fragment,{},u.createElement(mr,Ce({"aria-controls":s?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":s?"true":void 0,onClick:c=>{i(c.currentTarget)}},t)),u.createElement(vF,{anchorEl:o,open:s,onClose:a,MenuListProps:{"aria-labelledby":"basic-button"},children:e.map((c,d)=>u.createElement(fo,kt(Ce({key:d},c),{onClick(){var p;a(),(p=c.onClick)==null||p.apply(this,arguments)}})))}))}function gve(){return u.createElement(je,{display:"flex",gap:2,mb:2,sx:{position:"sticky",top:0,zIndex:2,backgroundColor:"background.paper",width:"fit-content"}},u.createElement(H4,{variant:"contained",startIcon:u.createElement(dy),items:[{children:"from disk",onClick:hve},{children:"virtual folder",onClick:mve}]},"Add"),$S(()=>ec()))}const vve={"`":"code","*":"b","/":"i",_:"u"};function ts(e,{linkTarget:t="",onText:n=r=>r}={}){return typeof e!="string"&&(e=e[0]),V4(e,/([`*/_])(.+)\1|(\n)|\[(.+)\]\((.+)\)/g,r=>r[4]?u.createElement(Mo,{href:r[5],target:t},n(r[4])):r[3]?u.createElement("br"):u.createElement(vve[r[1]],{},n(r[2])),n)}function V4(e,t,n,r=o=>o){const o=[];let i=0,s;for(;s=t.exec(e);)o.push(r(e.slice(i,s.index))),o.push(n(s)),i=s.index+s[0].length;return u.createElement(u.Fragment,{},...o,r(e.slice(i,1/0)))}const PE=Symbol.for("yaml.alias"),Yw=Symbol.for("yaml.document"),jl=Symbol.for("yaml.map"),U4=Symbol.for("yaml.pair"),Ys=Symbol.for("yaml.scalar"),ad=Symbol.for("yaml.seq"),bi=Symbol.for("yaml.node.type"),cc=e=>!!e&&typeof e=="object"&&e[bi]===PE,cd=e=>!!e&&typeof e=="object"&&e[bi]===Yw,ud=e=>!!e&&typeof e=="object"&&e[bi]===jl,Tn=e=>!!e&&typeof e=="object"&&e[bi]===U4,yn=e=>!!e&&typeof e=="object"&&e[bi]===Ys,dd=e=>!!e&&typeof e=="object"&&e[bi]===ad;function Dn(e){if(e&&typeof e=="object")switch(e[bi]){case jl:case ad:return!0}return!1}function Qn(e){if(e&&typeof e=="object")switch(e[bi]){case PE:case jl:case Ys:case ad:return!0}return!1}const yve=e=>(yn(e)||Dn(e))&&!!e.anchor,to=Symbol("break visit"),W4=Symbol("skip children"),ps=Symbol("remove node");function Jl(e,t){const n=G4(t);cd(e)?ou(null,e.contents,n,Object.freeze([e]))===ps&&(e.contents=null):ou(null,e,n,Object.freeze([]))}Jl.BREAK=to;Jl.SKIP=W4;Jl.REMOVE=ps;function ou(e,t,n,r){const o=K4(e,t,n,r);if(Qn(o)||Tn(o))return q4(e,r,o),ou(e,o,n,r);if(typeof o!="symbol"){if(Dn(t)){r=Object.freeze(r.concat(t));for(let i=0;i<t.items.length;++i){const s=ou(i,t.items[i],n,r);if(typeof s=="number")i=s-1;else{if(s===to)return to;s===ps&&(t.items.splice(i,1),i-=1)}}}else if(Tn(t)){r=Object.freeze(r.concat(t));const i=ou("key",t.key,n,r);if(i===to)return to;i===ps&&(t.key=null);const s=ou("value",t.value,n,r);if(s===to)return to;s===ps&&(t.value=null)}}return o}function Ey(e,t){return mt(this,null,function*(){const n=G4(t);cd(e)?(yield iu(null,e.contents,n,Object.freeze([e])))===ps&&(e.contents=null):yield iu(null,e,n,Object.freeze([]))})}Ey.BREAK=to;Ey.SKIP=W4;Ey.REMOVE=ps;function iu(e,t,n,r){return mt(this,null,function*(){const o=yield K4(e,t,n,r);if(Qn(o)||Tn(o))return q4(e,r,o),iu(e,o,n,r);if(typeof o!="symbol"){if(Dn(t)){r=Object.freeze(r.concat(t));for(let i=0;i<t.items.length;++i){const s=yield iu(i,t.items[i],n,r);if(typeof s=="number")i=s-1;else{if(s===to)return to;s===ps&&(t.items.splice(i,1),i-=1)}}}else if(Tn(t)){r=Object.freeze(r.concat(t));const i=yield iu("key",t.key,n,r);if(i===to)return to;i===ps&&(t.key=null);const s=yield iu("value",t.value,n,r);if(s===to)return to;s===ps&&(t.value=null)}}return o})}function G4(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function K4(e,t,n,r){var o,i,s,a,c;if(typeof n=="function")return n(e,t,r);if(ud(t))return(o=n.Map)==null?void 0:o.call(n,e,t,r);if(dd(t))return(i=n.Seq)==null?void 0:i.call(n,e,t,r);if(Tn(t))return(s=n.Pair)==null?void 0:s.call(n,e,t,r);if(yn(t))return(a=n.Scalar)==null?void 0:a.call(n,e,t,r);if(cc(t))return(c=n.Alias)==null?void 0:c.call(n,e,t,r)}function q4(e,t,n){const r=t[t.length-1];if(Dn(r))r.items[e]=n;else if(Tn(r))e==="key"?r.key=n:r.value=n;else if(cd(r))r.contents=n;else{const o=cc(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${o} parent`)}}const bve={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},wve=e=>e.replace(/[!,[\]{}]/g,t=>bve[t]);class jr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},jr.defaultYaml,t),this.tags=Object.assign({},jr.defaultTags,n)}clone(){const t=new jr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new jr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:jr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},jr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:jr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},jr.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),o=r.shift();switch(o){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[i,s]=r;return this.tags[i]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const s=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,s),!1}}default:return n(0,`Unknown directive ${o}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const s=t.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}const[,r,o]=t.match(/^(.*!)([^!]*)$/);o||n(`The ${t} tag has no suffix`);const i=this.tags[r];return i?i+decodeURIComponent(o):r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+wve(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let o;if(t&&r.length>0&&Qn(t.contents)){const i={};Jl(t.contents,(s,a)=>{Qn(a)&&a.tag&&(i[a.tag]=!0)}),o=Object.keys(i)}else o=[];for(const[i,s]of r)i==="!!"&&s==="tag:yaml.org,2002:"||(!t||o.some(a=>a.startsWith(s)))&&n.push(`%TAG ${i} ${s}`);return n.join(`
|
|
346
|
-
`)}}jr.defaultYaml={explicit:!1,version:"1.2"};jr.defaultTags={"!!":"tag:yaml.org,2002:"};function Y4(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function Q4(e){const t=new Set;return Jl(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function X4(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function
|
|
343
|
+
`)),r.current=!0),_.current){m(k),_.current=!1;return}g(k)},[t.autoHeight,g,n]);ln(()=>p(),[p]),xn(e,"sortedRowsSet",p),xn(e,"paginationModelChange",p),xn(e,"columnsChange",p),ot(e,"resize",I),xn(e,"debouncedResize",t.onResize)}const fme=["style"],pme=["style"];function bu(e,t,n=0,r=t.length){if(t.length<=0)return-1;if(n>=r)return n;const o=n+Math.floor((r-n)/2),i=t[o];return e<=i?bu(e,t,n,o):bu(e,t,o+1,r)}function hme(e,t,n){let r=1;for(;n<t.length&&Math.abs(t[n])<e;)n+=r,r*=2;return bu(e,t,Math.floor(n/2),Math.min(n,t.length))}const wl=({firstIndex:e,lastIndex:t,buffer:n,minFirstIndex:r,maxLastIndex:o})=>[Vu(e-n,r,o),Vu(t+n,r,o)],C4=(e,t)=>e===t?!0:e.firstRowIndex===t.firstRowIndex&&e.lastRowIndex===t.lastRowIndex&&e.firstColumnIndex===t.firstColumnIndex&&e.lastColumnIndex===t.lastColumnIndex,mme={maxSize:3},gme=e=>{var t,n;const r=lc(),o=tt(),i=Ge(r,Or),{ref:s,disableVirtualization:a,onRenderZonePositioning:c,renderZoneMinColumnIndex:d=0,renderZoneMaxColumnIndex:p=i.length,getRowProps:h}=e,m=lr(),g=Ge(r,Hu),y=Ge(r,YS),v=Ge(r,ii),S=Ge(r,Rg),w=Ge(r,cp),C=Ge(r,Fg),x=ac(r,o),P=u.useRef(null),_=u.useRef(null),I=Vt(s,_),[k,M]=u.useState(null),O=u.useRef(k),F=u.useRef({top:0,left:0}),[L,D]=u.useState({width:null,height:null}),B=u.useRef(y),R=u.useRef(Object.create(null)),A=u.useRef(),z=u.useRef(),V=u.useRef(qS((ee,ke,Re)=>ee.slice(ke,Re),mme)),N=u.useCallback(ee=>{var ke,Re;const Pe=r.current.getLastMeasuredRowIndex();let pe=Pe===1/0;(ke=x.range)!=null&&ke.lastRowIndex&&!pe&&(pe=Pe>=x.range.lastRowIndex);const be=Vu(Pe-(((Re=x.range)==null?void 0:Re.firstRowIndex)||0),0,w.positions.length);return pe||w.positions[be]>=ee?bu(ee,w.positions):hme(ee,w.positions,be)},[r,(t=x.range)==null?void 0:t.firstRowIndex,(n=x.range)==null?void 0:n.lastRowIndex,w.positions]),H=u.useCallback(()=>{if(a)return{firstRowIndex:0,lastRowIndex:x.rows.length,firstColumnIndex:0,lastColumnIndex:i.length};const{top:ee,left:ke}=F.current,Re=Math.min(N(ee),w.positions.length-1),Pe=o.autoHeight?Re+x.rows.length:N(ee+L.height);let pe=!1,be=0,te=g.length;const[Oe,Ye]=wl({firstIndex:Re,lastIndex:Pe,minFirstIndex:0,maxLastIndex:x.rows.length,buffer:o.rowBuffer});for(let Ke=Oe;Ke<Ye&&!pe;Ke+=1){const Ue=x.rows[Ke];pe=r.current.rowHasAutoHeight(Ue.id)}return pe||(be=bu(Math.abs(ke),g),te=bu(Math.abs(ke)+L.width,g)),{firstRowIndex:Re,lastRowIndex:Pe,firstColumnIndex:be,lastColumnIndex:te}},[a,N,w.positions.length,o.autoHeight,o.rowBuffer,x.rows,g,i.length,r,L]);ln(()=>{a?P.current.style.transform="translate3d(0px, 0px, 0px)":(_.current.scrollLeft=0,_.current.scrollTop=0)},[a]),ln(()=>{D({width:_.current.clientWidth,height:_.current.clientHeight})},[w.currentPageTotalHeight]);const W=u.useCallback(()=>{_.current&&D({width:_.current.clientWidth,height:_.current.clientHeight})},[]);ot(r,"debouncedResize",W);const K=u.useCallback(ee=>{const[ke,Re]=wl({firstIndex:ee.firstRowIndex,lastIndex:ee.lastRowIndex,minFirstIndex:0,maxLastIndex:x.rows.length,buffer:o.rowBuffer}),[Pe]=wl({firstIndex:ee.firstColumnIndex,lastIndex:ee.lastColumnIndex,minFirstIndex:d,maxLastIndex:p,buffer:o.columnBuffer}),pe=Ww({firstColumnToRender:Pe,apiRef:r,firstRowToRender:ke,lastRowToRender:Re,visibleRows:x.rows}),be=m.direction==="ltr"?1:-1,te=cp(r.current.state).positions[ke],Oe=be*Hu(r)[pe];P.current.style.transform=`translate3d(${Oe}px, ${te}px, 0px)`,typeof c=="function"&&c({top:te,left:Oe})},[r,x.rows,c,d,p,o.columnBuffer,o.rowBuffer,m.direction]),Y=u.useCallback(ee=>{if(O.current&&C4(ee,O.current)){K(ee);return}M(ee),K(ee);const[ke,Re]=wl({firstIndex:ee.firstRowIndex,lastIndex:ee.lastRowIndex,minFirstIndex:0,maxLastIndex:x.rows.length,buffer:o.rowBuffer});r.current.publishEvent("renderedRowsIntervalChange",{firstRowToRender:ke,lastRowToRender:Re}),O.current=ee},[r,M,O,x.rows.length,o.rowBuffer,K]);ln(()=>{if(L.width==null)return;const ee=H();Y(ee);const{top:ke,left:Re}=F.current,Pe={top:ke,left:Re,renderContext:ee};r.current.publishEvent("scrollPositionChange",Pe)},[r,H,L.width,Y]);const ie=Pn(ee=>{const{scrollTop:ke,scrollLeft:Re}=ee.currentTarget;if(F.current.top=ke,F.current.left=Re,!O.current||ke<0||m.direction==="ltr"&&Re<0||m.direction==="rtl"&&Re>0)return;const Pe=a?O.current:H(),pe=Math.abs(Pe.firstRowIndex-O.current.firstRowIndex),be=Math.abs(Pe.lastRowIndex-O.current.lastRowIndex),te=Math.abs(Pe.firstColumnIndex-O.current.firstColumnIndex),Oe=Math.abs(Pe.lastColumnIndex-O.current.lastColumnIndex),Ye=pe>=o.rowThreshold||be>=o.rowThreshold||te>=o.columnThreshold||Oe>=o.columnThreshold||B.current!==y;r.current.publishEvent("scrollPositionChange",{top:ke,left:Re,renderContext:Ye?Pe:O.current},ee),Ye&&(Yu.flushSync(()=>{Y(Pe)}),B.current=y)}),re=Pn(ee=>{r.current.publishEvent("virtualScrollerWheel",{},ee)}),de=Pn(ee=>{r.current.publishEvent("virtualScrollerTouchMove",{},ee)}),se=(ee={renderContext:k})=>{var ke;const{onRowRender:Re,renderContext:Pe,minFirstColumn:pe=d,maxLastColumn:be=p,availableSpace:te=L.width,rowIndexOffset:Oe=0,position:Ye="center"}=ee;if(!Pe||te==null)return null;const Ke=a?0:o.rowBuffer,Ue=a?0:o.columnBuffer,[De,ct]=wl({firstIndex:Pe.firstRowIndex,lastIndex:Pe.lastRowIndex,minFirstIndex:0,maxLastIndex:x.rows.length,buffer:Ke}),vt=[];if(ee.rows)ee.rows.forEach(nt=>{vt.push(nt),r.current.calculateColSpan({rowId:nt.id,minFirstColumn:pe,maxLastColumn:be,columns:i})});else{if(!x.range)return null;for(let nt=De;nt<ct;nt+=1){const ht=x.rows[nt];vt.push(ht),r.current.calculateColSpan({rowId:ht.id,minFirstColumn:pe,maxLastColumn:be,columns:i})}}const[st,Pt]=wl({firstIndex:Pe.firstColumnIndex,lastIndex:Pe.lastColumnIndex,minFirstIndex:pe,maxLastIndex:be,buffer:Ue}),yt=Ww({firstColumnToRender:st,apiRef:r,firstRowToRender:De,lastRowToRender:ct,visibleRows:x.rows}),Ae=V.current(i,yt,Pt),Fe=((ke=o.slotProps)==null?void 0:ke.row)||{},{style:Be}=Fe,Ze=ne(Fe,fme);(A.current!==h||z.current!==Be)&&(R.current=Object.create(null));const Le=[];for(let nt=0;nt<vt.length;nt+=1){var Ve;const{id:ht,model:en}=vt[nt],kn=De+nt===x.rows.length-1,On=r.current.rowHasAutoHeight(ht)?"auto":r.current.unstable_getRowHeight(ht);let Xn;C[ht]==null?Xn=!1:Xn=r.current.isRowSelectable(ht),Re&&Re(ht);const ar=v!==null&&v.id===ht?v.field:null;let cr=null;S!==null&&S.id===ht&&(cr=r.current.getCellParams(ht,S.field).cellMode==="view"?S.field:null);const bn=typeof h=="function"&&h(ht,en)||{},{style:tn}=bn,Hn=ne(bn,pme);if(!R.current[ht]){const Go=E({},tn,Be);R.current[ht]=Go}Le.push(T.jsx(o.slots.row,E({row:en,rowId:ht,rowHeight:On,focusedCell:ar,tabbableCell:cr,renderedColumns:Ae,visibleColumns:i,firstColumnToRender:yt,lastColumnToRender:Pt,selected:Xn,index:Oe+((x==null||(Ve=x.range)==null?void 0:Ve.firstRowIndex)||0)+De+nt,containerWidth:te,isLastVisible:kn,position:Ye},Hn,Ze,{style:R.current[ht]}),ht))}return A.current=h,z.current=Be,Le},le=L.width&&y>=L.width,Ee=u.useMemo(()=>{const ee=Math.max(w.currentPageTotalHeight,1);let ke=!1;_!=null&&_.current&&ee<=(_==null?void 0:_.current.clientHeight)&&(ke=!0);const Re={width:le?y:"auto",height:ee,minHeight:ke?"100%":"auto"};return o.autoHeight&&x.rows.length===0&&(Re.height=LA(r,o.rowHeight)),Re},[r,_,y,w.currentPageTotalHeight,le,o.autoHeight,o.rowHeight,x.rows.length]);u.useEffect(()=>{r.current.publishEvent("virtualScrollerContentSizeChange")},[r,Ee]);const ye=u.useMemo(()=>{const ee={};return le||(ee.overflowX="hidden"),o.autoHeight&&(ee.overflowY="hidden"),ee},[le,o.autoHeight]),_e=u.useCallback(()=>O.current,[]);return r.current.register("private",{getRenderContext:_e}),{renderContext:k,updateRenderZonePosition:K,getRows:se,getRootProps:(ee={})=>E({ref:I,onScroll:ie,onWheel:re,onTouchMove:de},ee,{style:ee.style?E({},ee.style,ye):ye}),getContentProps:({style:ee}={})=>({style:ee?E({},ee,Ee):Ee}),getRenderZoneProps:()=>({ref:P})}},vme=e=>{const{classes:t,headerAlign:n,isDragging:r,showColumnBorder:o,groupId:i}=e;return Me({root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",r&&"columnHeader--moving",o&&"columnHeader--showColumnBorder",o&&"columnHeader--withRightBorder","withBorderColor",i===null?"columnHeader--emptyGroup":"columnHeader--filledGroup"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]},Bt,t)};function yme(e){var t;const{groupId:n,width:r,depth:o,maxDepth:i,fields:s,height:a,colIndex:c,hasFocus:d,tabIndex:p,isLastColumn:h}=e,m=tt(),g=u.useRef(null),y=Dt(),v=Ge(y,RA),S=n?v[n]:{},{headerName:w=n!=null?n:"",description:C="",headerAlign:x=void 0}=S;let P;const _=n&&((t=v[n])==null?void 0:t.renderHeaderGroup),I=u.useMemo(()=>({groupId:n,headerName:w,description:C,depth:o,maxDepth:i,fields:s,colIndex:c,isLastColumn:h}),[n,w,C,o,i,s,c,h]);n&&_&&(P=_(I));const k=m.showColumnVerticalBorder,M=E({},e,{classes:m.classes,showColumnBorder:k,headerAlign:x,depth:o,isDragging:!1}),O=w!=null?w:n,F=on(),L=n===null?`empty-group-cell-${F}`:n,D=vme(M);u.useLayoutEffect(()=>{if(d){const V=g.current.querySelector('[tabindex="0"]')||g.current;V==null||V.focus()}},[y,d]);const B=u.useCallback(z=>V=>{V.currentTarget.contains(V.target)&&y.current.publishEvent(z,I,V)},[y,I]),R=u.useMemo(()=>({onKeyDown:B("columnGroupHeaderKeyDown"),onFocus:B("columnGroupHeaderFocus"),onBlur:B("columnGroupHeaderBlur")}),[B]),A=typeof S.headerClassName=="function"?S.headerClassName(I):S.headerClassName;return T.jsx(UA,E({ref:g,classes:D,columnMenuOpen:!1,colIndex:c,height:a,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:p,isDraggable:!1,headerComponent:P,headerClassName:A,description:C,elementId:L,width:r,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:O,"aria-colspan":s.length,"data-fields":`|-${s.join("-|-")}-|`},R))}const jR=vr("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow",overridesResolver:(e,t)=>t.columnHeaderRow})(()=>({display:"flex"}));function bme(e){return!!e.target}const wme=e=>{const{innerRef:t,minColumnIndex:n=0,visibleColumns:r,sortColumnLookup:o,filterColumnLookup:i,columnPositions:s,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:c,columnHeaderFocus:d,columnGroupHeaderFocus:p,densityFactor:h,headerGroupingMaxDepth:m,columnMenuState:g,columnVisibility:y,columnGroupsHeaderStructure:v,hasOtherElementInTabSequence:S}=e,w=Pp(),[C,x]=u.useState(""),[P,_]=u.useState(""),I=lc(),k=tt(),M=u.useRef(null),O=Vt(t,M),[F,L]=u.useState(null),D=u.useRef(F),B=u.useRef(0),R=ac(I,k),A=uE(I,k.columnHeaderHeight),z=Math.floor(k.columnHeaderHeight*h),V=u.useCallback(ye=>{F&&ye&&C4(F,ye)||L(ye)},[F]);u.useEffect(()=>{I.current.columnHeadersContainerElementRef.current.scrollLeft=0},[I]);const N=u.useRef(qS(lhe,{equalityCheck:(ye,_e)=>["firstColumnIndex","minColumnIndex","columnBuffer"].every(ee=>ye[ee]===_e[ee])})),H=u.useCallback(ye=>{const[_e,ee]=wl({firstIndex:ye.firstRowIndex,lastIndex:ye.lastRowIndex,minFirstIndex:0,maxLastIndex:R.rows.length,buffer:k.rowBuffer}),ke=N.current({firstColumnIndex:ye.firstColumnIndex,minColumnIndex:n,columnBuffer:k.columnBuffer,firstRowToRender:_e,lastRowToRender:ee,apiRef:I,visibleRows:R.rows}),Re=w.direction==="ltr"?1:-1,Pe=ke>0?B.current-Re*s[ke]:B.current;M.current.style.transform=`translate3d(${-Pe}px, 0px, 0px)`},[s,n,k.columnBuffer,I,R.rows,k.rowBuffer,w.direction]);u.useLayoutEffect(()=>{F&&H(F)},[F,H]);const W=u.useCallback(({left:ye,renderContext:_e=null},ee)=>{var ke,Re;if(!M.current||B.current===ye&&((ke=D.current)==null?void 0:ke.firstColumnIndex)===(_e==null?void 0:_e.firstColumnIndex)&&((Re=D.current)==null?void 0:Re.lastColumnIndex)===(_e==null?void 0:_e.lastColumnIndex))return;B.current=ye;let Pe=!1;_e!==D.current||!D.current?(bme(ee)?(Yu.flushSync(()=>{V(_e)}),Pe=!0):V(_e),D.current=_e):Pe=!0,_e&&Pe&&H(_e)},[H,V]),K=u.useCallback(ye=>_(ye.field),[]),Y=u.useCallback(()=>_(""),[]),ie=u.useCallback(ye=>x(ye.field),[]),re=u.useCallback(()=>x(""),[]);ot(I,"columnResizeStart",K),ot(I,"columnResizeStop",Y),ot(I,"columnHeaderDragStart",ie),ot(I,"columnHeaderDragEnd",re),ot(I,"scrollPositionChange",W);const de=ye=>{const{renderContext:_e=F,minFirstColumn:ee=n,maxLastColumn:ke=r.length}=ye||{};if(!_e)return null;const[Re,Pe]=wl({firstIndex:_e.firstRowIndex,lastIndex:_e.lastRowIndex,minFirstIndex:0,maxLastIndex:R.rows.length,buffer:k.rowBuffer}),pe=N.current({firstColumnIndex:_e.firstColumnIndex,minColumnIndex:ee,columnBuffer:k.columnBuffer,apiRef:I,firstRowToRender:Re,lastRowToRender:Pe,visibleRows:R.rows}),be=Math.min(_e.lastColumnIndex+k.columnBuffer,ke);return{renderedColumns:r.slice(pe,be),firstColumnToRender:pe,lastColumnToRender:be,minFirstColumn:ee,maxLastColumn:ke}},se=(ye,_e={})=>{const ee=de(ye);if(ee==null)return null;const{renderedColumns:ke,firstColumnToRender:Re}=ee,Pe=[];for(let pe=0;pe<ke.length;pe+=1){const be=ke[pe],te=Re+pe,Oe=te===0,Ye=a!==null&&a.field===be.field||Oe&&!S?0:-1,Ke=d!==null&&d.field===be.field,Ue=g.open&&g.field===be.field;Pe.push(T.jsx(Mue,E({},o[be.field],{columnMenuOpen:Ue,filterItemsCounter:i[be.field]&&i[be.field].length,headerHeight:z,isDragging:be.field===C,colDef:be,colIndex:te,isResizing:P===be.field,hasFocus:Ke,tabIndex:Ye},_e),be.field))}return T.jsx(jR,{role:"row","aria-rowindex":m+1,ownerState:k,children:Pe})},le=ye=>{if(m===0)return null;const _e=de(ye);if(_e==null||_e.renderedColumns.length===0)return null;const{firstColumnToRender:ee,lastColumnToRender:ke}=_e,Re=[],Pe=[];for(let te=0;te<m;te+=1){var pe,be;const Oe=v[te],Ye=r[ee].field,Ke=(pe=I.current.unstable_getColumnGroupPath(Ye)[te])!=null?pe:null,Ue=Oe.findIndex(({groupId:Ze,columnFields:Ie})=>Ze===Ke&&Ie.includes(Ye)),De=r[ke-1].field,ct=(be=I.current.unstable_getColumnGroupPath(De)[te])!=null?be:null,vt=Oe.findIndex(({groupId:Ze,columnFields:Ie})=>Ze===ct&&Ie.includes(De)),st=Oe.slice(Ue,vt+1).map(Ze=>E({},Ze,{columnFields:Ze.columnFields.filter(Ie=>y[Ie]!==!1)})).filter(Ze=>Ze.columnFields.length>0),Pt=st[0].columnFields.indexOf(Ye),Ae=st[0].columnFields.slice(0,Pt).reduce((Ze,Ie)=>{var Le;const Ve=I.current.getColumn(Ie);return Ze+((Le=Ve.computedWidth)!=null?Le:0)},0);let Fe=ee;const Be=st.map(({groupId:Ze,columnFields:Ie})=>{const Le=p!==null&&p.depth===te&&Ie.includes(p.field),Ve=c!==null&&c.depth===te&&Ie.includes(c.field)?0:-1,nt={groupId:Ze,width:Ie.reduce((ht,en)=>ht+I.current.getColumn(en).computedWidth,0),fields:Ie,colIndex:Fe,hasFocus:Le,tabIndex:Ve};return Fe+=Ie.length,nt});Pe.push({leftOverflow:Ae,elements:Be})}return Pe.forEach((te,Oe)=>{Re.push(T.jsx(jR,{style:{height:`${z}px`,transform:`translateX(-${te.leftOverflow}px)`},role:"row","aria-rowindex":Oe+1,ownerState:k,children:te.elements.map(({groupId:Ye,width:Ke,fields:Ue,colIndex:De,hasFocus:ct,tabIndex:vt},st)=>T.jsx(yme,{groupId:Ye,width:Ke,fields:Ue,colIndex:De,depth:Oe,isLastColumn:De===r.length-Ue.length,maxDepth:Pe.length,height:z,hasFocus:ct,tabIndex:vt},st))},Oe))}),Re},Ee={minHeight:A,maxHeight:A,lineHeight:`${z}px`};return{renderContext:F,getColumnHeaders:se,getColumnsToRender:de,getColumnGroupHeaders:le,isDragging:!!C,getRootProps:(ye={})=>E({style:Ee},ye),getInnerProps:()=>({ref:O,role:"rowgroup"}),headerHeight:z}},Cme=["className"],xme=e=>{const{classes:t}=e;return Me({root:["columnHeaders","withBorderColor"]},Bt,t)},Sme=vr("div",{name:"MuiDataGrid",slot:"ColumnHeaders",overridesResolver:(e,t)=>t.columnHeaders})({position:"relative",overflow:"hidden",display:"flex",alignItems:"center",boxSizing:"border-box",borderBottom:"1px solid",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),Eme=u.forwardRef(function(t,n){const{className:r}=t,o=ne(t,Cme),i=tt(),s=xme(i);return T.jsx(Sme,E({ref:n,className:he(r,s.root),ownerState:i},o))}),Pme=["isDragging","className"],Ime=e=>{const{isDragging:t,hasScrollX:n,classes:r}=e;return Me({root:["columnHeadersInner",t&&"columnHeaderDropZone",n&&"columnHeadersInner--scrollable"]},Bt,r)},kme=vr("div",{name:"MuiDataGrid",slot:"columnHeadersInner",overridesResolver:(e,t)=>[{[`&.${X.columnHeaderDropZone}`]:t.columnHeaderDropZone},t.columnHeadersInner]})(()=>({display:"flex",alignItems:"flex-start",flexDirection:"column",[`&.${X.columnHeaderDropZone} .${X.columnHeaderDraggableContainer}`]:{cursor:"move"},[`&.${X["columnHeadersInner--scrollable"]} .${X.columnHeader}:last-child`]:{borderRight:"none"}})),_me=u.forwardRef(function(t,n){var r,o;const{isDragging:i,className:s}=t,a=ne(t,Pme),c=Dt(),d=tt(),p=E({},d,{isDragging:i,hasScrollX:(r=(o=c.current.getRootDimensions())==null?void 0:o.hasScrollX)!=null?r:!1}),h=Ime(p);return T.jsx(kme,E({ref:n,className:he(s,h.root),ownerState:p},a))}),$me=["innerRef","className","visibleColumns","sortColumnLookup","filterColumnLookup","columnPositions","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","densityFactor","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],Rme=u.forwardRef(function(t,n){const{innerRef:r,visibleColumns:o,sortColumnLookup:i,filterColumnLookup:s,columnPositions:a,columnHeaderTabIndexState:c,columnGroupHeaderTabIndexState:d,columnHeaderFocus:p,columnGroupHeaderFocus:h,densityFactor:m,headerGroupingMaxDepth:g,columnMenuState:y,columnVisibility:v,columnGroupsHeaderStructure:S,hasOtherElementInTabSequence:w}=t,C=ne(t,$me),{isDragging:x,getRootProps:P,getInnerProps:_,getColumnHeaders:I,getColumnGroupHeaders:k}=wme({innerRef:r,visibleColumns:o,sortColumnLookup:i,filterColumnLookup:s,columnPositions:a,columnHeaderTabIndexState:c,columnGroupHeaderTabIndexState:d,columnHeaderFocus:p,columnGroupHeaderFocus:h,densityFactor:m,headerGroupingMaxDepth:g,columnMenuState:y,columnVisibility:v,columnGroupsHeaderStructure:S,hasOtherElementInTabSequence:w});return T.jsx(Eme,E({ref:n},P(C),{children:T.jsxs(_me,E({isDragging:x},_(),{children:[k(),I()]}))}))}),Mme=xy(Rme),Tme=u.forwardRef(function(t,n){const o=Dt().current.getLocaleText("noResultsOverlayLabel");return T.jsx(nE,E({ref:n},t,{children:o}))}),Ome=["sortingOrder"],Lme=u.memo(function(t){const{sortingOrder:n}=t,r=ne(t,Ome),o=tt(),[i]=n,s=i==="asc"?o.slots.columnSortedAscendingIcon:o.slots.columnSortedDescendingIcon;return s?T.jsx(s,E({},r)):null}),Fme=["native"];function Ame(e){let{native:t}=e,n=ne(e,Fme);return t?T.jsx("option",E({},n)):T.jsx(fo,E({},n))}const Nme={BooleanCellTrueIcon:Ide,BooleanCellFalseIcon:q1,ColumnMenuIcon:xde,OpenFilterButtonIcon:mde,FilterPanelDeleteIcon:q1,ColumnFilteredIcon:xR,ColumnSelectorIcon:vde,ColumnUnsortedIcon:Lme,ColumnSortedAscendingIcon:yR,ColumnSortedDescendingIcon:bR,ColumnResizeIcon:yde,DensityCompactIcon:bde,DensityStandardIcon:wde,DensityComfortableIcon:Cde,ExportIcon:Pde,MoreActionsIcon:kde,TreeDataCollapseIcon:CR,TreeDataExpandIcon:wR,GroupingCriteriaCollapseIcon:CR,GroupingCriteriaExpandIcon:wR,DetailPanelExpandIcon:SR,DetailPanelCollapseIcon:Sde,RowReorderIcon:ER,QuickFilterIcon:gde,QuickFilterClearIcon:q1,ColumnMenuHideIcon:_de,ColumnMenuSortAscendingIcon:yR,ColumnMenuSortDescendingIcon:bR,ColumnMenuFilterIcon:xR,ColumnMenuManageColumnsIcon:$de,ColumnMenuClearIcon:Rde,LoadIcon:Ede,FilterPanelAddIcon:SR,FilterPanelRemoveAllIcon:Mde,ColumnReorderIcon:ER},Dme=E({},Nme,{BaseCheckbox:QL,BaseTextField:$p,BaseFormControl:nF,BaseSelect:Wx,BaseSwitch:SF,BaseButton:mr,BaseIconButton:oo,BaseInputAdornment:qa,BaseTooltip:nd,BasePopper:oc,BaseInputLabel:dF,BaseSelectOption:Ame,BaseChip:Ax}),Bme=Dme,zme=E({},Bme,{Cell:zw,SkeletonCell:Xce,ColumnHeaderFilterIconButton:lde,ColumnMenu:Gde,ColumnHeaders:Mme,Footer:spe,Toolbar:null,PreferencesPanel:wfe,LoadingOverlay:ape,NoResultsOverlay:Tme,NoRowsOverlay:cpe,Pagination:dpe,FilterPanel:Vfe,ColumnsPanel:hfe,Panel:bfe,Row:xpe}),x4=e=>{if(e!==void 0)return Object.keys(e).reduce((t,n)=>E({},t,{[`${n.charAt(0).toLowerCase()}${n.slice(1)}`]:e[n]}),{})};function jme({defaultSlots:e,slots:t,components:n}){const r=t!=null?t:n?x4(n):null;return!r||Object.keys(r).length===0?e:E({},e,r)}const Hme=["components","componentsProps"];function Vme(e){var t;const n=Object.keys(e);if(!n.some(i=>i.startsWith("aria-")||i.startsWith("data-")))return e;const r={},o=(t=e.forwardedProps)!=null?t:{};for(let i=0;i<n.length;i+=1){const s=n[i];s.startsWith("aria-")||s.startsWith("data-")?o[s]=e[s]:r[s]=e[s]}return r.forwardedProps=o,r}function Ume(e){return u.useMemo(()=>{const{components:t,componentsProps:n}=e,r=ne(e,Hme);return[t,n,Vme(r)]},[e])}const Wme={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,disableMultipleRowSelection:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,disableColumnResize:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid"},S4={autoHeight:!1,autoPageSize:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,columnBuffer:3,rowBuffer:3,columnThreshold:3,rowThreshold:3,rowSelection:!0,density:"standard",disableColumnFilter:!1,disableColumnMenu:!1,disableColumnSelector:!1,disableDensitySelector:!1,disableMultipleColumnsFiltering:!1,disableMultipleRowSelection:!1,disableMultipleColumnsSorting:!1,disableRowSelectionOnClick:!1,disableVirtualization:!1,editMode:vs.Cell,filterMode:"client",columnHeaderHeight:56,hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,logger:console,logLevel:"error",pagination:!1,paginationMode:"client",rowHeight:52,pageSizeOptions:[25,50,100],rowSpacingType:"margin",showCellVerticalBorder:!1,showColumnVerticalBorder:!1,sortingOrder:["asc","desc",null],sortingMode:"client",throttleRowsMs:0,disableColumnReorder:!1,disableColumnResize:!1,keepNonExistentRowsSelected:!1,keepColumnPositionIfDraggedOutside:!1,unstable_ignoreValueFormatterDuringExport:!1,clipboardCopyCellDelimiter:" "},Gme=x4(zme),Kme=e=>{const[t,n,r]=Ume(et({props:e,name:"MuiDataGrid"})),o=u.useMemo(()=>E({},rme,r.localeText),[r.localeText]),i=u.useMemo(()=>jme({defaultSlots:Gme,slots:r.slots,components:t}),[t,r.slots]);return u.useMemo(()=>{var s;return E({},S4,r,{localeText:o,slots:i,slotProps:(s=r.slotProps)!=null?s:n},Wme)},[r,o,i,n])},qme=e=>E({},e,{rowsMeta:{currentPageTotalHeight:0,positions:[]}}),HR=(e,t,n)=>typeof e=="number"&&e>0?e:t,Yme=(e,t)=>{const{getRowHeight:n,getRowSpacing:r,getEstimatedRowHeight:o}=t,i=u.useRef(Object.create(null)),s=u.useRef(-1),a=u.useRef(!1),c=Ge(e,ld),d=Ge(e,Cr),p=Ge(e,QA),h=Ge(e,ni),m=ac(e,t),g=Ge(e,sd),y=HR(t.rowHeight,S4.rowHeight),v=Math.floor(y*c),S=u.useCallback(()=>{var D,B;a.current=!1;const R=V=>{i.current[V.id]||(i.current[V.id]={sizes:{baseCenter:v},isResized:!1,autoHeight:!1,needsFirstMeasurement:!0});const{isResized:N,needsFirstMeasurement:H,sizes:W}=i.current[V.id];let K=typeof v=="number"&&v>0?v:52;const Y=W.baseCenter;if(N)K=Y;else if(n){const le=n(E({},V,{densityFactor:c}));if(le==="auto"){if(H){const Ee=o?o(E({},V,{densityFactor:c})):v;K=Ee!=null?Ee:v}else K=Y;a.current=!0,i.current[V.id].autoHeight=!0}else K=HR(le,v),i.current[V.id].needsFirstMeasurement=!1,i.current[V.id].autoHeight=!1}else i.current[V.id].needsFirstMeasurement=!1;const ie={};for(const le in W)/^base[A-Z]/.test(le)&&(ie[le]=W[le]);if(ie.baseCenter=K,r){var re,de;const le=e.current.getRowIndexRelativeToVisibleRows(V.id),Ee=r(E({},V,{isFirstVisible:le===0,isLastVisible:le===m.rows.length-1,indexRelativeToCurrentPage:le}));ie.spacingTop=(re=Ee.top)!=null?re:0,ie.spacingBottom=(de=Ee.bottom)!=null?de:0}const se=e.current.unstable_applyPipeProcessors("rowHeight",ie,V);return i.current[V.id].sizes=se,se},A=[],z=m.rows.reduce((V,N)=>{A.push(V);let H=0,W=0;const K=R(N);for(const Y in K){const ie=K[Y];/^base[A-Z]/.test(Y)?H=ie>H?ie:H:W+=ie}return V+H+W},0);g==null||(D=g.top)==null||D.forEach(V=>{R(V)}),g==null||(B=g.bottom)==null||B.forEach(V=>{R(V)}),e.current.setState(V=>E({},V,{rowsMeta:{currentPageTotalHeight:z,positions:A}})),a.current||(s.current=1/0),e.current.forceUpdate()},[e,m.rows,v,n,r,o,g,c]),w=u.useCallback(D=>{const B=i.current[D];return B?B.sizes.baseCenter:v},[v]),C=D=>{var B;return(B=i.current[D])==null?void 0:B.sizes},x=u.useCallback((D,B)=>{i.current[D].sizes.baseCenter=B,i.current[D].isResized=!0,i.current[D].needsFirstMeasurement=!1,S()},[S]),P=u.useMemo(()=>Ws(S),[S]),_=u.useCallback((D,B,R)=>{if(!i.current[D]||!i.current[D].autoHeight)return;const A=i.current[D].sizes[`base${ue(R)}`]!==B;i.current[D].needsFirstMeasurement=!1,i.current[D].sizes[`base${ue(R)}`]=B,A&&P()},[P]),I=u.useCallback(D=>{var B;return((B=i.current[D])==null?void 0:B.autoHeight)||!1},[]),k=u.useCallback(()=>s.current,[]),M=u.useCallback(D=>{a.current&&D>s.current&&(s.current=D)},[]),O=u.useCallback(()=>{i.current={},S()},[S]);u.useEffect(()=>{S()},[v,d,p,h,S]),cE(e,"rowHeight",S);const F={unstable_setLastMeasuredRowIndex:M,unstable_getRowHeight:w,unstable_getRowInternalSizes:C,unstable_setRowHeight:x,unstable_storeRowHeightMeasurement:_,resetRowHeights:O},L={getLastMeasuredRowIndex:k,rowHasAutoHeight:I};Ft(e,F,"public"),Ft(e,L,"private")},Qme=e=>{const t=u.useCallback((o={})=>e.current.unstable_applyPipeProcessors("exportState",{},o),[e]),n=u.useCallback(o=>{e.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:o}).callbacks.forEach(s=>{s()}),e.current.forceUpdate()},[e]);Ft(e,{exportState:t,restoreState:n},"public")},Xme=e=>{const t=u.useRef({}),n=u.useCallback((d,p,h)=>{const m=t.current;m[d]||(m[d]={}),m[d][p]=h},[]),r=u.useCallback((d,p)=>{var h;return(h=t.current[d])==null?void 0:h[p]},[]),o=u.useCallback(d=>{const{columnIndex:p,rowId:h,minFirstColumnIndex:m,maxLastColumnIndex:g,columns:y}=d,v=y.length,S=y[p],w=typeof S.colSpan=="function"?S.colSpan(e.current.getCellParams(h,S.field)):S.colSpan;if(!w||w===1)return n(h,p,{spannedByColSpan:!1,cellProps:{colSpan:1,width:S.computedWidth}}),{colSpan:1};let C=S.computedWidth;for(let x=1;x<w;x+=1){const P=p+x;if(P>=m&&P<g){const _=y[P];C+=_.computedWidth,n(h,p+x,{spannedByColSpan:!0,rightVisibleCellIndex:Math.min(p+w,v-1),leftVisibleCellIndex:p})}n(h,p,{spannedByColSpan:!1,cellProps:{colSpan:w,width:C}})}return{colSpan:w}},[e,n]),i=u.useCallback(({rowId:d,minFirstColumn:p,maxLastColumn:h,columns:m})=>{for(let g=p;g<h;g+=1){const y=o({columnIndex:g,rowId:d,minFirstColumnIndex:p,maxLastColumnIndex:h,columns:m});y.colSpan>1&&(g+=y.colSpan-1)}},[o]),s={unstable_getCellColSpanInfo:r},a={calculateColSpan:i};Ft(e,s,"public"),Ft(e,a,"private");const c=u.useCallback(()=>{t.current={}},[]);ot(e,"columnOrderChange",c)},E4=(e,t,n)=>{if(FA(e)){if(n[e.field]!==void 0)throw new Error(["MUI: columnGroupingModel contains duplicated field",`column field ${e.field} occurs two times in the grouping model:`,`- ${n[e.field].join(" > ")}`,`- ${t.join(" > ")}`].join(`
|
|
344
|
+
`));n[e.field]=t;return}const{groupId:r,children:o}=e;o.forEach(i=>{E4(i,[...t,r],n)})},Kw=e=>{if(!e)return{};const t={};return e.forEach(n=>{E4(n,[],t)}),t},qw=(e,t)=>{const n=s=>{var a;return(a=t[s])!=null?a:[]},r=[],o=Math.max(...e.map(s=>n(s).length)),i=(s,a,c)=>La(n(s).slice(0,c+1),n(a).slice(0,c+1));for(let s=0;s<o;s+=1){const a=e.reduce((c,d)=>{var p;const h=(p=n(d)[s])!=null?p:null;if(c.length===0)return[{columnFields:[d],groupId:h}];const m=c[c.length-1],g=m.columnFields[m.columnFields.length-1];return m.groupId!==h||!i(g,d,s)?[...c,{columnFields:[d],groupId:h}]:[...c.slice(0,c.length-1),{columnFields:[...m.columnFields,d],groupId:h}]},[]);r.push(a)}return r},Jme=["groupId","children"],dE=e=>{let t={};return e.forEach(n=>{if(FA(n))return;const{groupId:r,children:o}=n,i=ne(n,Jme);if(!r)throw new Error("MUI: An element of the columnGroupingModel does not have either `field` or `groupId`.");o||console.warn(`MUI: group groupId=${r} has no children.`);const s=E({},i,{groupId:r}),a=dE(o);if(a[r]!==void 0||t[r]!==void 0)throw new Error(`MUI: The groupId ${r} is used multiple times in the columnGroupingModel.`);t=E({},t,a,{[r]:s})}),E({},t)},Zme=(e,t,n)=>{var r,o,i;if(!((r=t.experimentalFeatures)!=null&&r.columnGrouping))return e;const s=zs(n),a=my(n),c=dE((o=t.columnGroupingModel)!=null?o:[]),d=Kw((i=t.columnGroupingModel)!=null?i:[]),p=qw(s,d),h=a.length===0?0:Math.max(...a.map(m=>{var g,y;return(g=(y=d[m])==null?void 0:y.length)!=null?g:0}));return E({},e,{columnGrouping:{lookup:c,unwrappedGroupingModel:d,headerStructure:p,maxDepth:h}})},ege=(e,t)=>{var n;const r=u.useCallback(c=>{var d;return(d=zae(e)[c])!=null?d:[]},[e]),o=u.useCallback(()=>RA(e),[e]);Ft(e,{unstable_getColumnGroupPath:r,unstable_getAllGroupDetails:o},"public");const s=u.useCallback(()=>{var c;const d=Kw((c=t.columnGroupingModel)!=null?c:[]);e.current.setState(p=>{var h,m;const g=(h=(m=p.columns)==null?void 0:m.orderedFields)!=null?h:[],y=qw(g,d);return E({},p,{columnGrouping:E({},p.columnGrouping,{headerStructure:y})})})},[e,t.columnGroupingModel]),a=u.useCallback(c=>{var d;if(!((d=t.experimentalFeatures)!=null&&d.columnGrouping))return;const p=zs(e),h=my(e),m=dE(c!=null?c:[]),g=Kw(c!=null?c:[]),y=qw(p,g),v=h.length===0?0:Math.max(...h.map(S=>{var w,C;return(w=(C=g[S])==null?void 0:C.length)!=null?w:0}));e.current.setState(S=>E({},S,{columnGrouping:{lookup:m,unwrappedGroupingModel:g,headerStructure:y,maxDepth:v}}))},[e,(n=t.experimentalFeatures)==null?void 0:n.columnGrouping]);ot(e,"columnIndexChange",s),ot(e,"columnsChange",()=>{a(t.columnGroupingModel)}),ot(e,"columnVisibilityModelChange",()=>{a(t.columnGroupingModel)}),u.useEffect(()=>{a(t.columnGroupingModel)},[a,t.columnGroupingModel])},tge=(e,t)=>{const n=Npe(e,t);return ime(n,t),eme(n),Co(tme,n,t),Co(ahe,n,t),Co(Yhe,n,t),Co(Khe,n,t),Co(Mhe,n,t),Co(sme,n,t),Co(Nhe,n,t),Co(_he,n,t),Co(fhe,n,t),Co(Fhe,n,t),Co(qme,n,t),Co(rhe,n,t),Co(Zme,n,t),Lhe(n,t),nme(n,t),che(n,t),Qhe(n,t),oce(n,t),Xme(n),ege(n,t),qhe(n,t),The(n,t),Dhe(n,t),Rhe(n,t),lme(n,t),phe(n,t),Ahe(n,t),Yme(n,t),ame(n,t),ohe(n),ghe(n,t),bhe(n,t),nhe(n,t),dme(n,t),cme(n,t),Qme(n),n},nge=e=>{const{classes:t}=e;return Me({root:["virtualScroller"]},Bt,t)},rge=vr("div",{name:"MuiDataGrid",slot:"VirtualScroller",overridesResolver:(e,t)=>t.virtualScroller})({overflow:"auto",height:"100%",position:"relative","@media print":{overflow:"hidden"}}),oge=u.forwardRef(function(t,n){const r=tt(),o=nge(r);return T.jsx(rge,E({ref:n},t,{className:he(o.root,t.className),ownerState:r}))}),ige=(e,t)=>{const{classes:n}=e;return Me({root:["virtualScrollerContent",t&&"virtualScrollerContent--overflowed"]},Bt,n)},sge=vr("div",{name:"MuiDataGrid",slot:"VirtualScrollerContent",overridesResolver:(e,t)=>t.virtualScrollerContent})({}),lge=u.forwardRef(function(t,n){var r;const o=tt(),i=!o.autoHeight&&((r=t.style)==null?void 0:r.minHeight)==="auto",s=ige(o,i);return T.jsx(sge,E({ref:n},t,{ownerState:o,className:he(s.root,t.className)}))}),age=["className"],cge=e=>{const{classes:t}=e;return Me({root:["virtualScrollerRenderZone"]},Bt,t)},uge=vr("div",{name:"MuiDataGrid",slot:"VirtualScrollerRenderZone",overridesResolver:(e,t)=>t.virtualScrollerRenderZone})({position:"absolute",display:"flex",flexDirection:"column"}),dge=u.forwardRef(function(t,n){const{className:r}=t,o=ne(t,age),i=tt(),s=cge(i);return T.jsx(uge,E({ref:n,className:he(s.root,r),ownerState:i},o))}),fge=["className","disableVirtualization"],pge=u.forwardRef(function(t,n){const{className:r,disableVirtualization:o}=t,i=ne(t,fge),{getRootProps:s,getContentProps:a,getRenderZoneProps:c,getRows:d}=gme({ref:n,disableVirtualization:o});return T.jsxs(oge,E({className:r},s(i),{children:[T.jsx(Xae,{}),T.jsx(lge,E({},a(),{children:T.jsx(dge,E({},c(),{children:d()}))}))]}))}),P4=u.forwardRef(function(t,n){const r=Kme(t),o=tge(r.apiRef,r);return T.jsx(Spe,{privateApiRef:o,props:r,children:T.jsxs(nue,E({className:r.className,style:r.style,sx:r.sx,ref:n},r.forwardedProps,{children:[T.jsx(lpe,{}),T.jsx(Hae,{VirtualScrollerComponent:pge}),T.jsx(Vae,{})]}))})}),I4=u.memo(P4);P4.propTypes={apiRef:ae.shape({current:ae.object.isRequired}),"aria-label":ae.string,"aria-labelledby":ae.string,autoHeight:ae.bool,autoPageSize:ae.bool,cellModesModel:ae.object,checkboxSelection:ae.bool,classes:ae.object,clipboardCopyCellDelimiter:ae.string,columnBuffer:ae.number,columnGroupingModel:ae.arrayOf(ae.object),columnHeaderHeight:ae.number,columns:t7(ae.array.isRequired),columnThreshold:ae.number,columnVisibilityModel:ae.object,components:ae.object,componentsProps:ae.object,density:ae.oneOf(["comfortable","compact","standard"]),disableColumnFilter:ae.bool,disableColumnMenu:ae.bool,disableColumnSelector:ae.bool,disableDensitySelector:ae.bool,disableRowSelectionOnClick:ae.bool,disableVirtualization:ae.bool,editMode:ae.oneOf(["cell","row"]),experimentalFeatures:ae.shape({columnGrouping:ae.bool,warnIfFocusStateIsNotSynced:ae.bool}),filterMode:ae.oneOf(["client","server"]),filterModel:ae.shape({items:ae.arrayOf(ae.shape({field:ae.string.isRequired,id:ae.oneOfType([ae.number,ae.string]),operator:ae.string.isRequired,value:ae.any})).isRequired,logicOperator:ae.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:ae.bool,quickFilterLogicOperator:ae.oneOf(["and","or"]),quickFilterValues:ae.array}),forwardedProps:ae.object,getCellClassName:ae.func,getDetailPanelContent:ae.func,getEstimatedRowHeight:ae.func,getRowClassName:ae.func,getRowHeight:ae.func,getRowId:ae.func,getRowSpacing:ae.func,hideFooter:ae.bool,hideFooterPagination:ae.bool,hideFooterSelectedRowCount:ae.bool,initialState:ae.object,isCellEditable:ae.func,isRowSelectable:ae.func,keepNonExistentRowsSelected:ae.bool,loading:ae.bool,localeText:ae.object,logger:ae.shape({debug:ae.func.isRequired,error:ae.func.isRequired,info:ae.func.isRequired,warn:ae.func.isRequired}),logLevel:ae.oneOf(["debug","error","info","warn",!1]),nonce:ae.string,onCellClick:ae.func,onCellDoubleClick:ae.func,onCellEditStart:ae.func,onCellEditStop:ae.func,onCellKeyDown:ae.func,onCellModesModelChange:ae.func,onClipboardCopy:ae.func,onColumnHeaderClick:ae.func,onColumnHeaderDoubleClick:ae.func,onColumnHeaderEnter:ae.func,onColumnHeaderLeave:ae.func,onColumnHeaderOut:ae.func,onColumnHeaderOver:ae.func,onColumnOrderChange:ae.func,onColumnVisibilityModelChange:ae.func,onFilterModelChange:ae.func,onMenuClose:ae.func,onMenuOpen:ae.func,onPaginationModelChange:ae.func,onPreferencePanelClose:ae.func,onPreferencePanelOpen:ae.func,onProcessRowUpdateError:ae.func,onResize:ae.func,onRowClick:ae.func,onRowDoubleClick:ae.func,onRowEditCommit:ae.func,onRowEditStart:ae.func,onRowEditStop:ae.func,onRowModesModelChange:ae.func,onRowSelectionModelChange:ae.func,onSortModelChange:ae.func,onStateChange:ae.func,pageSizeOptions:ae.arrayOf(ae.oneOfType([ae.number,ae.shape({label:ae.string.isRequired,value:ae.number.isRequired})]).isRequired),pagination:e=>e.pagination===!1?new Error(["MUI: `<DataGrid pagination={false} />` 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(`
|
|
345
|
+
`)):null,paginationMode:ae.oneOf(["client","server"]),paginationModel:ae.shape({page:ae.number.isRequired,pageSize:ae.number.isRequired}),processRowUpdate:ae.func,rowBuffer:ae.number,rowCount:ae.number,rowHeight:ae.number,rowModesModel:ae.object,rows:ae.arrayOf(ae.object).isRequired,rowSelection:ae.bool,rowSelectionModel:ae.oneOfType([ae.arrayOf(ae.oneOfType([ae.number,ae.string]).isRequired),ae.number,ae.string]),rowSpacingType:ae.oneOf(["border","margin"]),rowThreshold:ae.number,scrollbarSize:ae.number,showCellVerticalBorder:ae.bool,showColumnVerticalBorder:ae.bool,slotProps:ae.object,slots:ae.object,sortingMode:ae.oneOf(["client","server"]),sortingOrder:ae.arrayOf(ae.oneOf(["asc","desc"])),sortModel:ae.arrayOf(ae.shape({field:ae.string.isRequired,sort:ae.oneOf(["asc","desc"])})),sx:ae.oneOfType([ae.arrayOf(ae.oneOfType([ae.func,ae.object,ae.bool])),ae.func,ae.object]),unstable_ignoreValueFormatterDuringExport:ae.oneOfType([ae.shape({clipboardExport:ae.bool,csvExport:ae.bool}),ae.bool])};const J1="Actions";function Dp(a){var c=a,{columns:e,initialState:t={},actions:n,actionsProps:r,initializing:o,noRows:i}=c,s=Yt(c,["columns","initialState","actions","actionsProps","initializing","noRows"]);const{width:d}=HF(),p=lr(),h=sae(),[m,g]=u.useState(0),y=u.useMemo(()=>{const P=e.map(_=>{const{mergeRender:I}=_;if(!I)return _;const F=I,{other:k,override:M}=F,O=Yt(F,["other","override"]);return kt(Ce({},_),{originalRenderCell:_.renderCell||!0,renderCell(L){const{columns:D}=L.api.store.getSnapshot(),B=D.columnVisibilityModel[k]===!1;return u.createElement(je,{},_.renderCell?_.renderCell(L):L.formattedValue,B&&u.createElement(je,O,x(Ce(Ce({},D.lookup[k]),M),L.row)))}})});return n&&P.push(Ce({field:J1,width:40*m,headerName:"",align:"center",headerAlign:"center",hideSortIcons:!0,disableColumnMenu:!0,renderCell(_){const I=n(Ce(Ce({},_.row),_));return setTimeout(()=>g(I.length)),u.createElement(je,{whiteSpace:"nowrap"},...I)}},r)),P},[e,n,m]),v=u.useMemo(()=>{if(!d)return;const P=rd(y.map(({field:I,hideUnder:k})=>k&&d<(typeof k=="number"?k:p.breakpoints.values[k])&&I)),_=Object.fromEntries(P.map(I=>[I,!1]));return St.merge(t,{columns:{columnVisibilityModel:_}}),P},[y]),[S,w]=u.useState({}),C=u.useRef({});if(u.useEffect(()=>{const{current:{id:P,setCurRow:_}}=C;_==null||_(St.find(s.rows,{id:P}))}),!v)return null;return u.createElement(u.Fragment,{},o&&u.createElement(je,{position:"relative"},u.createElement(fF,{sx:{position:"absolute",width:"calc(100% - 2px)",borderRadius:1,m:"1px 1px"}})),u.createElement(I4,kt(Ce({initialState:t,columns:y,apiRef:h,slots:Ce({},(i||o)&&{noRowsOverlay:()=>o?null:u.createElement(py,{},i)}),onCellClick({field:P,row:_}){if(P===J1)return;const I=h.current.getVisibleColumns().length,k=y.filter(M=>M.renderCell||M.field===J1||_[M.field]!==void 0);k.length<=I||Wo({title:"Details",onClose(){C.current={}},Content(){const[M,O]=u.useState(_),F=u.useRef(_);M&&(F.current=M);const L=F.current;return C.current={id:L.id,setCurRow:O},u.createElement(je,{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(8em,1fr))",gap:"1em",gridAutoFlow:"dense",minWidth:"max(16em, 40vw)",sx:{opacity:M?void 0:.5}},k.map(D=>u.createElement(je,{key:D.field,gridColumn:D.flex&&"1/-1"},u.createElement(je,{bgcolor:"#0003",p:1},D.headerName||D.field),u.createElement(Ql,{minHeight:"2.5em",px:1,alignItems:"center",wordBreak:"break-word"},x(D,L)))))}})}},s),{onColumnVisibilityModelChange:P=>w(P),columnVisibilityModel:Ce(Ce(Ce({},Object.fromEntries(v.map(P=>[P,!1]))),s.columnVisibilityModel),S)})));function x(P,_){const I=h.current;let k=_[P.field];P.valueGetter&&(k=P.valueGetter({value:k,api:I,row:_,field:P.field,id:_.id}));const M=P.originalRenderCell||P.renderCell;return M&&M!==!0?M(Ce({value:k,row:_,api:I},_)):P.valueFormatter?P.valueFormatter(Ce({value:k},_)):k}}function hge(){return u.createElement(u.Fragment,{},u.createElement(gge),u.createElement(vge))}const mge=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;function gge(){const{data:e,element:t}=Lo("get_status"),{data:n}=gie("get_connection_stats");e&&n&&Object.assign(e,n);const r=Yl("md"),o=Yl("sm");return t||u.createElement(je,{display:"flex",flexWrap:"wrap",gap:"1em",mb:2},r&&i("started"),r&&i("http",{label:"HTTP",render:s}),r&&i("https",{label:"HTTPS",render:s}),o&&i("connections"),i("sent",{render:ql,minWidth:"4em"}),o&&i("got",{render:ql,minWidth:"4em"}),i("outSpeed",{label:"Output speed",render:k4}));function i(a,{label:c,minWidth:d,render:p}={}){let h=St.get(e,a);if(h===void 0)return null;typeof h=="string"&&mge.test(h)&&(h=new Date(h).toLocaleString());let m;return p&&(h=p(h),Array.isArray(h)&&([h,m]=h)),c||(c=St.capitalize(a.replaceAll("_"," "))),u.createElement(Ax,{variant:"filled",color:m,label:u.createElement(u.Fragment,{},u.createElement("b",{},c),": ",u.createElement("span",{style:{display:"inline-block",minWidth:d}},h))})}function s(a){return a.listening?["port "+a.port,"success"]:a.error?[a.error,"error"]:"off"}}function vge(){const{list:e,error:t,props:n}=sc("get_connections"),[r,o]=u.useState(!0),[i,s]=u.useState(!1),a=u.useMemo(()=>e==null?void 0:e.filter(c=>!r||c.path).map((c,d)=>Ce({id:d},c)),[!i&&e,r]);return u.createElement(u.Fragment,{},u.createElement(je,{display:"flex",alignItems:"center"},u.createElement(gs,{fullWidth:!1,value:r,onChange:o,options:{"Show only files":!0,"Show all connections":!1}}),u.createElement(je,{flex:1}),u.createElement(zn,{title:i?"Resume":"Pause",icon:i?hy:gA,sx:{mr:1},onClick(){s(!i)}})),t?u.createElement(Uo,{severity:"error"},t):u.createElement(Dp,{rows:a,noRows:r&&"No downloads at the moment",columns:[{field:"ip",headerName:"Address",flex:1,maxWidth:400,renderCell:({row:c,value:d})=>(d.includes(":")?`[${d}]`:d)+" :"+c.port,mergeRender:{other:"user",fontSize:"small"}},{field:"user",headerName:"User",hideUnder:"md"},{field:"started",headerName:"Started",type:"dateTime",width:100,hideUnder:"lg",valueFormatter:({value:c})=>new Date(c).toLocaleTimeString()},{field:"path",headerName:"File",flex:1.5,renderCell({value:c,row:d}){var h;if(!c)return;if(d.archive)return u.createElement(u.Fragment,{},u.createElement(bA,{sx:{mr:1}}),d.archive,u.createElement(je,{ml:2,color:"text.secondary"},c));const p=c==null?void 0:c.lastIndexOf("/");return u.createElement(u.Fragment,{},d.op&&u.createElement(uA,{icon:d.op==="upload"?Tp:GS,progress:(h=d.opProgress)!=null?h:d.opOffset,offset:d.opOffset,addTitle:d.opTotal&&u.createElement("div",{},"Total: "+ql(d.opTotal)),sx:{mr:1}}),u.createElement(je,{},c.slice(p+1),p>0&&u.createElement(je,{ml:2,fontSize:"x-small",color:"text.secondary"},c.slice(0,p))))}},{field:"outSpeed",headerName:"Speed",width:110,hideUnder:"sm",type:"number",renderCell:({value:c,row:d})=>k4(Math.max(c||0,d.inSpeed||0)),mergeRender:{other:"sent",fontSize:"small",textAlign:"right"}},{field:"sent",headerName:"Sent",type:"number",hideUnder:"md",renderCell:({value:c,row:d})=>ql(Math.max(c||0,d.got||0))},{field:"v",headerName:"Protocol",align:"center",hideUnder:1/0,renderCell:({value:c,row:d})=>u.createElement(u.Fragment,{},"IPv"+c,d.secure&&xo(jS,"HTTPS",{opacity:.5}))},{field:"agent",headerName:"Agent",hideUnder:"lg"}],actionsProps:{hideUnder:"sm"},actions:({row:c})=>[u.createElement(zn,{icon:vA,title:"Disconnect",onClick:()=>Et("disconnect",St.pick(c,["ip","port"])).then(()=>Wr("Disconnection requested"))}),u.createElement(zn,{icon:yA,title:"Block IP",disabled:c.ip===(n==null?void 0:n.you),onClick:()=>yge(c.ip)})]}))}function yge(e){return cle("block",t=>[...t,{ip:e}])}function k4(e){return e?ql(e*1e3,{post:"B/s",k:1e3,digits:1}):""}var fE={},bge=ut;Object.defineProperty(fE,"__esModule",{value:!0});var _4=fE.default=void 0,wge=bge(dt()),Cge=at(),xge=(0,wge.default)((0,Cge.jsx)("path",{d:"M5 17h14v2H5zm7-12L5.33 15h13.34z"}),"Eject");_4=fE.default=xge;var pE={},Sge=ut;Object.defineProperty(pE,"__esModule",{value:!0});var $4=pE.default=void 0,Ege=Sge(dt()),Pge=at(),Ige=(0,Ege.default)((0,Pge.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward");$4=pE.default=Ige;var hE={},kge=ut;Object.defineProperty(hE,"__esModule",{value:!0});var R4=hE.default=void 0,_ge=kge(dt()),$ge=at(),Rge=(0,_ge.default)((0,$ge.jsx)("path",{d:"M8 11h3v10h2V11h3l-4-4-4 4zM4 3v2h16V3H4z"}),"VerticalAlignTop");R4=hE.default=Rge;var mE={},Mge=ut;Object.defineProperty(mE,"__esModule",{value:!0});var M4=mE.default=void 0,Tge=Mge(dt()),Oge=at(),Lge=(0,Tge.default)((0,Oge.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");M4=mE.default=Lge;var gE={},Fge=ut;Object.defineProperty(gE,"__esModule",{value:!0});var T4=gE.default=void 0,Age=Fge(dt()),Nge=at(),Dge=(0,Age.default)((0,Nge.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");T4=gE.default=Dge;var vE={},Bge=ut;Object.defineProperty(vE,"__esModule",{value:!0});var O4=vE.default=void 0,zge=Bge(dt()),VR=at(),jge=(0,zge.default)([(0,VR.jsx)("path",{d:"M2 16.5C2 19.54 4.46 22 7.5 22s5.5-2.46 5.5-5.5V10H2v6.5zm5.5 2C6.12 18.5 5 17.83 5 17h5c0 .83-1.12 1.5-2.5 1.5zM10 13c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm-5 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z"},"0"),(0,VR.jsx)("path",{d:"M11 3v6h3v2.5c0-.83 1.12-1.5 2.5-1.5s2.5.67 2.5 1.5h-5v2.89c.75.38 1.6.61 2.5.61 3.04 0 5.5-2.46 5.5-5.5V3H11zm3 5.08c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1c0 .56-.45 1-1 1zm5 0c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1c0 .56-.45 1-1 1z"},"1")],"TheaterComedy");O4=vE.default=jge;var yE={},Hge=ut;Object.defineProperty(yE,"__esModule",{value:!0});var L4=yE.default=void 0,Vge=Hge(dt()),Uge=at(),Wge=(0,Vge.default)((0,Uge.jsx)("path",{d:"M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"}),"Folder");L4=yE.default=Wge;var bE={},Gge=ut;Object.defineProperty(bE,"__esModule",{value:!0});var F4=bE.default=void 0,Kge=Gge(dt()),qge=at(),Yge=(0,Kge.default)((0,qge.jsx)("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"}),"Home");F4=bE.default=Yge;var wE={},Qge=ut;Object.defineProperty(wE,"__esModule",{value:!0});var A4=wE.default=void 0,Xge=Qge(dt()),Jge=at(),Zge=(0,Xge.default)((0,Jge.jsx)("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}),"InsertDriveFileOutlined");A4=wE.default=Zge;var CE={},eve=ut;Object.defineProperty(CE,"__esModule",{value:!0});var N4=CE.default=void 0,tve=eve(dt()),nve=at(),rve=(0,tve.default)((0,nve.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"}),"RemoveRedEye");N4=CE.default=rve;var xE={},ove=ut;Object.defineProperty(xE,"__esModule",{value:!0});var D4=xE.default=void 0,ive=ove(dt()),sve=at(),lve=(0,ive.default)((0,sve.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-5 14H4v-4h11v4zm0-5H4V9h11v4zm5 5h-4V9h4v9z"}),"Web");D4=xE.default=lve;var SE={},ave=ut;Object.defineProperty(SE,"__esModule",{value:!0});var B4=SE.default=void 0,cve=ave(dt()),uve=at(),dve=(0,cve.default)((0,uve.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"}),"Cloud");B4=SE.default=dve;var EE={},fve=ut;Object.defineProperty(EE,"__esModule",{value:!0});var z4=EE.default=void 0,pve=fve(dt()),hve=at(),mve=(0,pve.default)((0,hve.jsx)("path",{d:"M14.59 8 12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41 14.59 8zM12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"HighlightOff");z4=EE.default=mve;function gve(){const{close:e}=Wo({title:"Add files or folders",dialogProps:{sx:{minWidth:"min(90vw, 40em)",minHeight:"calc(100vh - 9em)"}},Content(){const t=j4();return u.createElement(u.Fragment,{},u.createElement(je,{sx:{typography:"body1",px:1,py:2}},"Selected elements will be added under ",t.isRoot?u.createElement("i",{},"Home"):t.id),u.createElement(BN,{from:t.source,onSelect(r){return mt(this,null,function*(){const o=rd(yield Promise.all(r.map(i=>Et("add_vfs",{parent:t.id,source:i}).then(()=>null,s=>[i,s.message]))));o.length&&(yield un(u.createElement(je,{},"Some elements have been rejected",u.createElement("ul",{},o.map(([i,s])=>u.createElement("li",{key:i},i,": ",s)))),"error")),ec(),e()})}}))}})}function vve(){return mt(this,null,function*(){try{const e=yield lle("Enter folder name");if(!e)return;const{id:t}=j4();yield Et("add_vfs",{parent:t,name:e}),ec([t+e]),yield un(`Folder "${e}" created`,"success")}catch(e){yield un(e)}})}function j4(){const e=pn.selectedFiles[0]||pn.vfs;return e.type==="folder"?e:e.parent}function H4(n){var r=n,{items:e}=r,t=Yt(r,["items"]);const[o,i]=$o.useState(),s=!!o,a=u.useCallback(()=>i(void 0),[]);return u.createElement($o.Fragment,{},u.createElement(mr,Ce({"aria-controls":s?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":s?"true":void 0,onClick:c=>{i(c.currentTarget)}},t)),u.createElement(vF,{anchorEl:o,open:s,onClose:a,MenuListProps:{"aria-labelledby":"basic-button"},children:e.map((c,d)=>u.createElement(fo,kt(Ce({key:d},c),{onClick(){var p;a(),(p=c.onClick)==null||p.apply(this,arguments)}})))}))}function yve(){return u.createElement(je,{display:"flex",gap:2,mb:2,sx:{position:"sticky",top:0,zIndex:2,backgroundColor:"background.paper",width:"fit-content"}},u.createElement(H4,{variant:"contained",startIcon:u.createElement(dy),items:[{children:"from disk",onClick:gve},{children:"virtual folder",onClick:vve}]},"Add"),$S(()=>ec()))}const bve={"`":"code","*":"b","/":"i",_:"u"};function ts(e,{linkTarget:t="",onText:n=r=>r}={}){return typeof e!="string"&&(e=e[0]),V4(e,/([`*/_])(.+)\1|(\n)|\[(.+)\]\((.+)\)/g,r=>r[4]?u.createElement(Mo,{href:r[5],target:t},n(r[4])):r[3]?u.createElement("br"):u.createElement(bve[r[1]],{},n(r[2])),n)}function V4(e,t,n,r=o=>o){const o=[];let i=0,s;for(;s=t.exec(e);)o.push(r(e.slice(i,s.index))),o.push(n(s)),i=s.index+s[0].length;return u.createElement(u.Fragment,{},...o,r(e.slice(i,1/0)))}const PE=Symbol.for("yaml.alias"),Yw=Symbol.for("yaml.document"),jl=Symbol.for("yaml.map"),U4=Symbol.for("yaml.pair"),Ys=Symbol.for("yaml.scalar"),ad=Symbol.for("yaml.seq"),bi=Symbol.for("yaml.node.type"),cc=e=>!!e&&typeof e=="object"&&e[bi]===PE,cd=e=>!!e&&typeof e=="object"&&e[bi]===Yw,ud=e=>!!e&&typeof e=="object"&&e[bi]===jl,Tn=e=>!!e&&typeof e=="object"&&e[bi]===U4,yn=e=>!!e&&typeof e=="object"&&e[bi]===Ys,dd=e=>!!e&&typeof e=="object"&&e[bi]===ad;function Dn(e){if(e&&typeof e=="object")switch(e[bi]){case jl:case ad:return!0}return!1}function Qn(e){if(e&&typeof e=="object")switch(e[bi]){case PE:case jl:case Ys:case ad:return!0}return!1}const wve=e=>(yn(e)||Dn(e))&&!!e.anchor,to=Symbol("break visit"),W4=Symbol("skip children"),ps=Symbol("remove node");function Jl(e,t){const n=G4(t);cd(e)?ou(null,e.contents,n,Object.freeze([e]))===ps&&(e.contents=null):ou(null,e,n,Object.freeze([]))}Jl.BREAK=to;Jl.SKIP=W4;Jl.REMOVE=ps;function ou(e,t,n,r){const o=K4(e,t,n,r);if(Qn(o)||Tn(o))return q4(e,r,o),ou(e,o,n,r);if(typeof o!="symbol"){if(Dn(t)){r=Object.freeze(r.concat(t));for(let i=0;i<t.items.length;++i){const s=ou(i,t.items[i],n,r);if(typeof s=="number")i=s-1;else{if(s===to)return to;s===ps&&(t.items.splice(i,1),i-=1)}}}else if(Tn(t)){r=Object.freeze(r.concat(t));const i=ou("key",t.key,n,r);if(i===to)return to;i===ps&&(t.key=null);const s=ou("value",t.value,n,r);if(s===to)return to;s===ps&&(t.value=null)}}return o}function Ey(e,t){return mt(this,null,function*(){const n=G4(t);cd(e)?(yield iu(null,e.contents,n,Object.freeze([e])))===ps&&(e.contents=null):yield iu(null,e,n,Object.freeze([]))})}Ey.BREAK=to;Ey.SKIP=W4;Ey.REMOVE=ps;function iu(e,t,n,r){return mt(this,null,function*(){const o=yield K4(e,t,n,r);if(Qn(o)||Tn(o))return q4(e,r,o),iu(e,o,n,r);if(typeof o!="symbol"){if(Dn(t)){r=Object.freeze(r.concat(t));for(let i=0;i<t.items.length;++i){const s=yield iu(i,t.items[i],n,r);if(typeof s=="number")i=s-1;else{if(s===to)return to;s===ps&&(t.items.splice(i,1),i-=1)}}}else if(Tn(t)){r=Object.freeze(r.concat(t));const i=yield iu("key",t.key,n,r);if(i===to)return to;i===ps&&(t.key=null);const s=yield iu("value",t.value,n,r);if(s===to)return to;s===ps&&(t.value=null)}}return o})}function G4(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function K4(e,t,n,r){var o,i,s,a,c;if(typeof n=="function")return n(e,t,r);if(ud(t))return(o=n.Map)==null?void 0:o.call(n,e,t,r);if(dd(t))return(i=n.Seq)==null?void 0:i.call(n,e,t,r);if(Tn(t))return(s=n.Pair)==null?void 0:s.call(n,e,t,r);if(yn(t))return(a=n.Scalar)==null?void 0:a.call(n,e,t,r);if(cc(t))return(c=n.Alias)==null?void 0:c.call(n,e,t,r)}function q4(e,t,n){const r=t[t.length-1];if(Dn(r))r.items[e]=n;else if(Tn(r))e==="key"?r.key=n:r.value=n;else if(cd(r))r.contents=n;else{const o=cc(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${o} parent`)}}const Cve={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},xve=e=>e.replace(/[!,[\]{}]/g,t=>Cve[t]);class jr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},jr.defaultYaml,t),this.tags=Object.assign({},jr.defaultTags,n)}clone(){const t=new jr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new jr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:jr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},jr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:jr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},jr.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),o=r.shift();switch(o){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[i,s]=r;return this.tags[i]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const s=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,s),!1}}default:return n(0,`Unknown directive ${o}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const s=t.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}const[,r,o]=t.match(/^(.*!)([^!]*)$/);o||n(`The ${t} tag has no suffix`);const i=this.tags[r];return i?i+decodeURIComponent(o):r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+xve(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let o;if(t&&r.length>0&&Qn(t.contents)){const i={};Jl(t.contents,(s,a)=>{Qn(a)&&a.tag&&(i[a.tag]=!0)}),o=Object.keys(i)}else o=[];for(const[i,s]of r)i==="!!"&&s==="tag:yaml.org,2002:"||(!t||o.some(a=>a.startsWith(s)))&&n.push(`%TAG ${i} ${s}`);return n.join(`
|
|
346
|
+
`)}}jr.defaultYaml={explicit:!1,version:"1.2"};jr.defaultTags={"!!":"tag:yaml.org,2002:"};function Y4(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function Q4(e){const t=new Set;return Jl(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function X4(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Sve(e,t){const n=[],r=new Map;let o=null;return{onAnchor:i=>{n.push(i),o||(o=Q4(e));const s=X4(t,o);return o.add(s),s},setAnchors:()=>{for(const i of n){const s=r.get(i);if(typeof s=="object"&&s.anchor&&(yn(s.node)||Dn(s.node)))s.node.anchor=s.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:r}}function su(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let o=0,i=r.length;o<i;++o){const s=r[o],a=su(e,r,String(o),s);a===void 0?delete r[o]:a!==s&&(r[o]=a)}else if(r instanceof Map)for(const o of Array.from(r.keys())){const i=r.get(o),s=su(e,r,o,i);s===void 0?r.delete(o):s!==i&&r.set(o,s)}else if(r instanceof Set)for(const o of Array.from(r)){const i=su(e,r,o,o);i===void 0?r.delete(o):i!==o&&(r.delete(o),r.add(i))}else for(const[o,i]of Object.entries(r)){const s=su(e,r,o,i);s===void 0?delete r[o]:s!==i&&(r[o]=s)}return e.call(t,n,r)}function pi(e,t,n){if(Array.isArray(e))return e.map((r,o)=>pi(r,String(o),n));if(e&&typeof e.toJSON=="function"){if(!n||!wve(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=i=>{r.res=i,delete n.onCreate};const o=e.toJSON(t,n);return n.onCreate&&n.onCreate(o),o}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class IE{constructor(t){Object.defineProperty(this,bi,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:o,reviver:i}={}){if(!cd(t))throw new TypeError("A document argument is required");const s={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=pi(this,"",s);if(typeof o=="function")for(const{count:c,res:d}of s.anchors.values())o(d,c);return typeof i=="function"?su(i,{"":a},"",a):a}}class Py extends IE{constructor(t){super(PE),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let n;return Jl(t,{Node:(r,o)=>{if(o===this)return Jl.BREAK;o.anchor===this.source&&(n=o)}}),n}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:o,maxAliasCount:i}=n,s=this.resolve(o);if(!s){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=r.get(s);if(a||(pi(s,null,n),a=r.get(s)),!a||a.res===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Lm(o,s,r)),a.count*a.aliasCount>i)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(t,n,r){const o=`*${this.source}`;if(t){if(Y4(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(t.implicitKey)return`${o} `}return o}}function Lm(e,t,n){if(cc(t)){const r=t.resolve(e),o=n&&r&&n.get(r);return o?o.count*o.aliasCount:0}else if(Dn(t)){let r=0;for(const o of t.items){const i=Lm(e,o,n);i>r&&(r=i)}return r}else if(Tn(t)){const r=Lm(e,t.key,n),o=Lm(e,t.value,n);return Math.max(r,o)}return 1}const J4=e=>!e||typeof e!="function"&&typeof e!="object";class Rt extends IE{constructor(t){super(Ys),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:pi(this.value,t,n)}toString(){return String(this.value)}}Rt.BLOCK_FOLDED="BLOCK_FOLDED";Rt.BLOCK_LITERAL="BLOCK_LITERAL";Rt.PLAIN="PLAIN";Rt.QUOTE_DOUBLE="QUOTE_DOUBLE";Rt.QUOTE_SINGLE="QUOTE_SINGLE";const Eve="tag:yaml.org,2002:";function Pve(e,t,n){var r;if(t){const o=n.filter(s=>s.tag===t),i=(r=o.find(s=>!s.format))!=null?r:o[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(o=>{var i;return((i=o.identify)==null?void 0:i.call(o,e))&&!o.format})}function fp(e,t,n){var h,m,g;if(cd(e)&&(e=e.contents),Qn(e))return e;if(Tn(e)){const y=(m=(h=n.schema[jl]).createNode)==null?void 0:m.call(h,n.schema,null,n);return y.items.push(e),y}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt!="undefined"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:o,onTagObj:i,schema:s,sourceObjects:a}=n;let c;if(r&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor||(c.anchor=o(e)),new Py(c.anchor);c={anchor:null,node:null},a.set(e,c)}t!=null&&t.startsWith("!!")&&(t=Eve+t.slice(2));let d=Pve(e,t,s.tags);if(!d){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const y=new Rt(e);return c&&(c.node=y),y}d=e instanceof Map?s[jl]:Symbol.iterator in Object(e)?s[ad]:s[jl]}i&&(i(d),delete n.onTagObj);const p=d!=null&&d.createNode?d.createNode(n.schema,e,n):typeof((g=d==null?void 0:d.nodeClass)==null?void 0:g.from)=="function"?d.nodeClass.from(n.schema,e,n):new Rt(e);return t?p.tag=t:d.default||(p.tag=d.tag),c&&(c.node=p),p}function Dg(e,t,n){let r=n;for(let o=t.length-1;o>=0;--o){const i=t[o];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const s=[];s[i]=r,r=s}else r=new Map([[i,r]])}return fp(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const cf=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class Iy extends IE{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>Qn(r)||Tn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(cf(t))this.add(n);else{const[r,...o]=t,i=this.get(r,!0);if(Dn(i))i.addIn(o,n);else if(i===void 0&&this.schema)this.set(r,Dg(this.schema,o,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${o}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const o=this.get(n,!0);if(Dn(o))return o.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...o]=t,i=this.get(r,!0);return o.length===0?!n&&yn(i)?i.value:i:Dn(i)?i.getIn(o,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Tn(n))return!1;const r=n.value;return r==null||t&&yn(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const o=this.get(n,!0);return Dn(o)?o.hasIn(r):!1}setIn(t,n){const[r,...o]=t;if(o.length===0)this.set(r,n);else{const i=this.get(r,!0);if(Dn(i))i.setIn(o,n);else if(i===void 0&&this.schema)this.set(r,Dg(this.schema,o,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${o}`)}}}Iy.maxFlowStringSingleLineLength=60;const Ive=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ds(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const $l=(e,t,n)=>e.endsWith(`
|
|
347
347
|
`)?Ds(n,t):n.includes(`
|
|
348
348
|
`)?`
|
|
349
349
|
`+Ds(n,t):(e.endsWith(" ")?"":" ")+n,Z4="flow",Qw="block",Fm="quoted";function ky(e,t,n="flow",{indentAtStart:r,lineWidth:o=80,minContentWidth:i=20,onFold:s,onOverflow:a}={}){if(!o||o<0)return e;const c=Math.max(1+i,1+o-t.length);if(e.length<=c)return e;const d=[],p={};let h=o-t.length;typeof r=="number"&&(r>o-Math.max(2,i)?d.push(0):h=o-r);let m,g,y=!1,v=-1,S=-1,w=-1;n===Qw&&(v=UR(e,v),v!==-1&&(h=v+c));for(let x;x=e[v+=1];){if(n===Fm&&x==="\\"){switch(S=v,e[v+1]){case"x":v+=3;break;case"u":v+=5;break;case"U":v+=9;break;default:v+=1}w=v}if(x===`
|
|
@@ -352,7 +352,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
352
352
|
`&&P!==" "&&(m=v)}if(v>=h)if(m)d.push(m),h=m+c,m=void 0;else if(n===Fm){for(;g===" "||g===" ";)g=x,x=e[v+=1],y=!0;const P=v>w+1?v-2:S-1;if(p[P])return e;d.push(P),p[P]=!0,h=P+c,m=void 0}else y=!0}g=x}if(y&&a&&a(),d.length===0)return e;s&&s();let C=e.slice(0,d[0]);for(let x=0;x<d.length;++x){const P=d[x],_=d[x+1]||e.length;P===0?C=`
|
|
353
353
|
${t}${e.slice(0,_)}`:(n===Fm&&p[P]&&(C+=`${e[P]}\\`),C+=`
|
|
354
354
|
${t}${e.slice(P+1,_)}`)}return C}function UR(e,t){let n=e[t+1];for(;n===" "||n===" ";){do n=e[t+=1];while(n&&n!==`
|
|
355
|
-
`);n=e[t+1]}return t}const _y=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),$y=e=>/^(%|---|\.\.\.)/m.test(e);function
|
|
355
|
+
`);n=e[t+1]}return t}const _y=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),$y=e=>/^(%|---|\.\.\.)/m.test(e);function kve(e,t,n){if(!t||t<0)return!1;const r=t-n,o=e.length;if(o<=r)return!1;for(let i=0,s=0;i<o;++i)if(e[i]===`
|
|
356
356
|
`){if(i-s>r)return!0;if(s=i+1,o-s<=r)return!1}return!0}function kf(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,o=t.options.doubleQuotedMinMultiLineLength,i=t.indent||($y(e)?" ":"");let s="",a=0;for(let c=0,d=n[c];d;d=n[++c])if(d===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(s+=n.slice(a,c)+"\\ ",c+=1,a=c,d="\\"),d==="\\")switch(n[c+1]){case"u":{s+=n.slice(a,c);const p=n.substr(c+2,4);switch(p){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:p.substr(0,2)==="00"?s+="\\x"+p.substr(2):s+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||n[c+2]==='"'||n.length<o)c+=1;else{for(s+=n.slice(a,c)+`
|
|
357
357
|
|
|
358
358
|
`;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)s+=`
|
|
@@ -361,7 +361,7 @@ ${t}${e.slice(P+1,_)}`)}return C}function UR(e,t){let n=e[t+1];for(;n===" "||n==
|
|
|
361
361
|
${n}`)+"'";return t.implicitKey?r:ky(r,n,Z4,_y(t,!1))}function lu(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=kf;else{const o=e.includes('"'),i=e.includes("'");o&&!i?r=Xw:i&&!o?r=kf:r=n?Xw:kf}return r(e,t)}let Jw;try{Jw=new RegExp(`(^|(?<!
|
|
362
362
|
))
|
|
363
363
|
+(?!
|
|
364
|
-
|$)`,"g")}catch(e){Jw=/\n+(?!\n|$)/g}function Am({comment:e,type:t,value:n},r,o,i){const{blockQuote:s,commentString:a,lineWidth:c}=r.options;if(!s||/\n[\t ]+$/.test(n)||/^\s*$/.test(n))return lu(n,r);const d=r.indent||(r.forceBlockIndent||$y(n)?" ":""),p=s==="literal"?!0:s==="folded"||t===Rt.BLOCK_FOLDED?!1:t===Rt.BLOCK_LITERAL?!0:!
|
|
364
|
+
|$)`,"g")}catch(e){Jw=/\n+(?!\n|$)/g}function Am({comment:e,type:t,value:n},r,o,i){const{blockQuote:s,commentString:a,lineWidth:c}=r.options;if(!s||/\n[\t ]+$/.test(n)||/^\s*$/.test(n))return lu(n,r);const d=r.indent||(r.forceBlockIndent||$y(n)?" ":""),p=s==="literal"?!0:s==="folded"||t===Rt.BLOCK_FOLDED?!1:t===Rt.BLOCK_LITERAL?!0:!kve(n,c,d.length);if(!n)return p?`|
|
|
365
365
|
`:`>
|
|
366
366
|
`;let h,m;for(m=n.length;m>0;--m){const I=n[m-1];if(I!==`
|
|
367
367
|
`&&I!==" "&&I!==" ")break}let g=n.substring(m);const y=g.indexOf(`
|
|
@@ -370,11 +370,11 @@ ${n}`)+"'";return t.implicitKey?r:ky(r,n,Z4,_y(t,!1))}function lu(e,t){const{sin
|
|
|
370
370
|
`)w=S;else break}let C=n.substring(0,w<S?w+1:S);C&&(n=n.substring(C.length),C=C.replace(/\n+/g,`$&${d}`));let P=(p?"|":">")+(v?d?"2":"1":"")+h;if(e&&(P+=" "+a(e.replace(/ ?[\r\n]+/g," ")),o&&o()),p)return n=n.replace(/\n+/g,`$&${d}`),`${P}
|
|
371
371
|
${d}${C}${n}${g}`;n=n.replace(/\n+/g,`
|
|
372
372
|
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`);const _=ky(`${C}${n}${g}`,d,Qw,_y(r,!0));return`${P}
|
|
373
|
-
${d}${_}`}function
|
|
373
|
+
${d}${_}`}function _ve(e,t,n,r){const{type:o,value:i}=e,{actualString:s,implicitKey:a,indent:c,indentStep:d,inFlow:p}=t;if(a&&/[\n[\]{},]/.test(i)||p&&/[[\]{},]/.test(i))return lu(i,t);if(!i||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||p||!i.includes(`
|
|
374
374
|
`)?lu(i,t):Am(e,t,n,r);if(!a&&!p&&o!==Rt.PLAIN&&i.includes(`
|
|
375
375
|
`))return Am(e,t,n,r);if($y(i)){if(c==="")return t.forceBlockIndent=!0,Am(e,t,n,r);if(a&&c===d)return lu(i,t)}const h=i.replace(/\n+/g,`$&
|
|
376
|
-
${c}`);if(s){const m=v=>{var S;return v.default&&v.tag!=="tag:yaml.org,2002:str"&&((S=v.test)==null?void 0:S.test(h))},{compat:g,tags:y}=t.doc.schema;if(y.some(m)||g!=null&&g.some(m))return lu(i,t)}return a?h:ky(h,c,Z4,_y(t,!1))}function Bp(e,t,n,r){const{implicitKey:o,inFlow:i}=t,s=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==Rt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Rt.QUOTE_DOUBLE);const c=p=>{switch(p){case Rt.BLOCK_FOLDED:case Rt.BLOCK_LITERAL:return o||i?lu(s.value,t):Am(s,t,n,r);case Rt.QUOTE_DOUBLE:return kf(s.value,t);case Rt.QUOTE_SINGLE:return Xw(s.value,t);case Rt.PLAIN:return
|
|
377
|
-
${t.indent}${a}`:a}function
|
|
376
|
+
${c}`);if(s){const m=v=>{var S;return v.default&&v.tag!=="tag:yaml.org,2002:str"&&((S=v.test)==null?void 0:S.test(h))},{compat:g,tags:y}=t.doc.schema;if(y.some(m)||g!=null&&g.some(m))return lu(i,t)}return a?h:ky(h,c,Z4,_y(t,!1))}function Bp(e,t,n,r){const{implicitKey:o,inFlow:i}=t,s=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==Rt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Rt.QUOTE_DOUBLE);const c=p=>{switch(p){case Rt.BLOCK_FOLDED:case Rt.BLOCK_LITERAL:return o||i?lu(s.value,t):Am(s,t,n,r);case Rt.QUOTE_DOUBLE:return kf(s.value,t);case Rt.QUOTE_SINGLE:return Xw(s.value,t);case Rt.PLAIN:return _ve(s,t,n,r);default:return null}};let d=c(a);if(d===null){const{defaultKeyType:p,defaultStringType:h}=t.options,m=o&&p||h;if(d=c(m),d===null)throw new Error(`Unsupported default string type ${m}`)}return d}function eN(e,t){const n=Object.assign({blockQuote:!0,commentString:Ive,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function $ve(e,t){var o,i,s,a;if(t.tag){const c=e.filter(d=>d.tag===t.tag);if(c.length>0)return(o=c.find(d=>d.format===t.format))!=null?o:c[0]}let n,r;if(yn(t)){r=t.value;const c=e.filter(d=>{var p;return(p=d.identify)==null?void 0:p.call(d,r)});n=(i=c.find(d=>d.format===t.format))!=null?i:c.find(d=>!d.format)}else r=t,n=e.find(c=>c.nodeClass&&r instanceof c.nodeClass);if(!n){const c=(a=(s=r==null?void 0:r.constructor)==null?void 0:s.name)!=null?a:typeof r;throw new Error(`Tag not resolved for ${c} value`)}return n}function Rve(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const o=[],i=(yn(e)||Dn(e))&&e.anchor;i&&Y4(i)&&(n.add(i),o.push(`&${i}`));const s=e.tag?e.tag:t.default?null:t.tag;return s&&o.push(r.directives.tagString(s)),o.join(" ")}function Uu(e,t,n,r){var c,d;if(Tn(e))return e.toString(t,n,r);if(cc(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let o;const i=Qn(e)?e:t.doc.createNode(e,{onTagObj:p=>o=p});o||(o=$ve(t.doc.schema.tags,i));const s=Rve(i,o,t);s.length>0&&(t.indentAtStart=((d=t.indentAtStart)!=null?d:0)+s.length+1);const a=typeof o.stringify=="function"?o.stringify(i,t,n,r):yn(i)?Bp(i,t,n,r):i.toString(t,n,r);return s?yn(i)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
|
|
377
|
+
${t.indent}${a}`:a}function Mve({key:e,value:t},n,r,o){var k,M;const{allNullValues:i,doc:s,indent:a,indentStep:c,options:{commentString:d,indentSeq:p,simpleKeys:h}}=n;let m=Qn(e)&&e.comment||null;if(h){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(Dn(e)){const O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let g=!h&&(!e||m&&t==null&&!n.inFlow||Dn(e)||(yn(e)?e.type===Rt.BLOCK_FOLDED||e.type===Rt.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!g&&(h||!i),indent:a+c});let y=!1,v=!1,S=Uu(e,n,()=>y=!0,()=>v=!0);if(!g&&!n.inFlow&&S.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(n.inFlow){if(i||t==null)return y&&r&&r(),S===""?"?":g?`? ${S}`:S}else if(i&&!h||t==null&&g)return S=`? ${S}`,m&&!y?S+=$l(S,n.indent,d(m)):v&&o&&o(),S;y&&(m=null),g?(m&&(S+=$l(S,n.indent,d(m))),S=`? ${S}
|
|
378
378
|
${a}:`):(S=`${S}:`,m&&(S+=$l(S,n.indent,d(m))));let w,C,x;Qn(t)?(w=!!t.spaceBefore,C=t.commentBefore,x=t.comment):(w=!1,C=null,x=null,t&&typeof t=="object"&&(t=s.createNode(t))),n.implicitKey=!1,!g&&!m&&yn(t)&&(n.indentAtStart=S.length+1),v=!1,!p&&c.length>=2&&!n.inFlow&&!g&&dd(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let P=!1;const _=Uu(t,n,()=>P=!0,()=>v=!0);let I=" ";if(m||w||C){if(I=w?`
|
|
379
379
|
`:"",C){const O=d(C);I+=`
|
|
380
380
|
${Ds(O,n.indent)}`}_===""&&!n.inFlow?I===`
|
|
@@ -384,32 +384,32 @@ ${Ds(O,n.indent)}`}_===""&&!n.inFlow?I===`
|
|
|
384
384
|
${n.indent}`}else if(!g&&Dn(t)){const O=_[0],F=_.indexOf(`
|
|
385
385
|
`),L=F!==-1,D=(M=(k=n.inFlow)!=null?k:t.flow)!=null?M:t.items.length===0;if(L||!D){let B=!1;if(L&&(O==="&"||O==="!")){let R=_.indexOf(" ");O==="&"&&R!==-1&&R<F&&_[R+1]==="!"&&(R=_.indexOf(" ",R+1)),(R===-1||F<R)&&(B=!0)}B||(I=`
|
|
386
386
|
${n.indent}`)}}else(_===""||_[0]===`
|
|
387
|
-
`)&&(I="");return S+=I+_,n.inFlow?P&&r&&r():x&&!P?S+=$l(S,n.indent,d(x)):v&&o&&o(),S}function tN(e,t){(e==="debug"||e==="warn")&&(typeof process!="undefined"&&process.emitWarning?process.emitWarning(t):console.warn(t))}const WR="<<";function nN(e,t,{key:n,value:r}){if(e!=null&&e.doc.schema.merge&&
|
|
387
|
+
`)&&(I="");return S+=I+_,n.inFlow?P&&r&&r():x&&!P?S+=$l(S,n.indent,d(x)):v&&o&&o(),S}function tN(e,t){(e==="debug"||e==="warn")&&(typeof process!="undefined"&&process.emitWarning?process.emitWarning(t):console.warn(t))}const WR="<<";function nN(e,t,{key:n,value:r}){if(e!=null&&e.doc.schema.merge&&Tve(n))if(r=cc(r)?r.resolve(e.doc):r,dd(r))for(const o of r.items)Z1(e,t,o);else if(Array.isArray(r))for(const o of r)Z1(e,t,o);else Z1(e,t,r);else{const o=pi(n,"",e);if(t instanceof Map)t.set(o,pi(r,o,e));else if(t instanceof Set)t.add(o);else{const i=Ove(n,o,e),s=pi(r,i,e);i in t?Object.defineProperty(t,i,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[i]=s}}return t}const Tve=e=>e===WR||yn(e)&&e.value===WR&&(!e.type||e.type===Rt.PLAIN);function Z1(e,t,n){const r=e&&cc(n)?n.resolve(e.doc):n;if(!ud(r))throw new Error("Merge sources must be maps or map aliases");const o=r.toJSON(null,e,Map);for(const[i,s]of o)t instanceof Map?t.has(i)||t.set(i,s):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function Ove(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Qn(e)&&n&&n.doc){const r=eN(n.doc,{});r.anchors=new Set;for(const i of n.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;const o=e.toString(r);if(!n.mapKeyWarned){let i=JSON.stringify(o);i.length>40&&(i=i.substring(0,36)+'..."'),tN(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return o}return JSON.stringify(t)}function kE(e,t,n){const r=fp(e,void 0,n),o=fp(t,void 0,n);return new Lr(r,o)}class Lr{constructor(t,n=null){Object.defineProperty(this,bi,{value:U4}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return Qn(n)&&(n=n.clone(t)),Qn(r)&&(r=r.clone(t)),new Lr(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return nN(n,r,this)}toString(t,n,r){return t!=null&&t.doc?Mve(this,t,n,r):JSON.stringify(this)}}function rN(e,t,n){var i;return(((i=t.inFlow)!=null?i:e.flow)?Fve:Lve)(e,t,n)}function Lve({comment:e,items:t},n,{blockItemPrefix:r,flowChars:o,itemIndent:i,onChompKeep:s,onComment:a}){const{indent:c,options:{commentString:d}}=n,p=Object.assign({},n,{indent:i,type:null});let h=!1;const m=[];for(let y=0;y<t.length;++y){const v=t[y];let S=null;if(Qn(v))!h&&v.spaceBefore&&m.push(""),Bg(n,m,v.commentBefore,h),v.comment&&(S=v.comment);else if(Tn(v)){const C=Qn(v.key)?v.key:null;C&&(!h&&C.spaceBefore&&m.push(""),Bg(n,m,C.commentBefore,h))}h=!1;let w=Uu(v,p,()=>S=null,()=>h=!0);S&&(w+=$l(w,i,d(S))),h&&S&&(h=!1),m.push(r+w)}let g;if(m.length===0)g=o.start+o.end;else{g=m[0];for(let y=1;y<m.length;++y){const v=m[y];g+=v?`
|
|
388
388
|
${c}${v}`:`
|
|
389
389
|
`}}return e?(g+=`
|
|
390
|
-
`+Ds(d(e),c),a&&a()):h&&s&&s(),g}function
|
|
390
|
+
`+Ds(d(e),c),a&&a()):h&&s&&s(),g}function Fve({comment:e,items:t},n,{flowChars:r,itemIndent:o,onComment:i}){const{indent:s,indentStep:a,flowCollectionPadding:c,options:{commentString:d}}=n;o+=a;const p=Object.assign({},n,{indent:o,inFlow:!0,type:null});let h=!1,m=0;const g=[];for(let w=0;w<t.length;++w){const C=t[w];let x=null;if(Qn(C))C.spaceBefore&&g.push(""),Bg(n,g,C.commentBefore,!1),C.comment&&(x=C.comment);else if(Tn(C)){const _=Qn(C.key)?C.key:null;_&&(_.spaceBefore&&g.push(""),Bg(n,g,_.commentBefore,!1),_.comment&&(h=!0));const I=Qn(C.value)?C.value:null;I?(I.comment&&(x=I.comment),I.commentBefore&&(h=!0)):C.value==null&&_&&_.comment&&(x=_.comment)}x&&(h=!0);let P=Uu(C,p,()=>x=null);w<t.length-1&&(P+=","),x&&(P+=$l(P,o,d(x))),!h&&(g.length>m||P.includes(`
|
|
391
391
|
`))&&(h=!0),g.push(P),m=g.length}let y;const{start:v,end:S}=r;if(g.length===0)y=v+S;else if(h||(h=g.reduce((C,x)=>C+x.length+2,2)>Iy.maxFlowStringSingleLineLength),h){y=v;for(const w of g)y+=w?`
|
|
392
392
|
${a}${s}${w}`:`
|
|
393
393
|
`;y+=`
|
|
394
|
-
${s}${S}`}else y=`${v}${c}${g.join(" ")}${c}${S}`;return e&&(y+=$l(y,s,d(e)),i&&i()),y}function Bg({indent:e,options:{commentString:t}},n,r,o){if(r&&o&&(r=r.replace(/^\n+/,"")),r){const i=Ds(t(r),e);n.push(i.trimStart())}}function Ia(e,t){const n=yn(t)?t.value:t;for(const r of e)if(Tn(r)&&(r.key===t||r.key===n||yn(r.key)&&r.key.value===n))return r}class _o extends Iy{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(jl,t),this.items=[]}static from(t,n,r){const{keepUndefined:o,replacer:i}=r,s=new this(t),a=(c,d)=>{if(typeof i=="function")d=i.call(n,c,d);else if(Array.isArray(i)&&!i.includes(c))return;(d!==void 0||o)&&s.items.push(kE(c,d,r))};if(n instanceof Map)for(const[c,d]of n)a(c,d);else if(n&&typeof n=="object")for(const c of Object.keys(n))a(c,n[c]);return typeof t.sortMapEntries=="function"&&s.items.sort(t.sortMapEntries),s}add(t,n){var s;let r;Tn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Lr(t,t==null?void 0:t.value):r=new Lr(t.key,t.value);const o=Ia(this.items,r.key),i=(s=this.schema)==null?void 0:s.sortMapEntries;if(o){if(!n)throw new Error(`Key ${r.key} already set`);yn(o.value)&&J4(r.value)?o.value.value=r.value:o.value=r.value}else if(i){const a=this.items.findIndex(c=>i(r,c)<0);a===-1?this.items.push(r):this.items.splice(a,0,r)}else this.items.push(r)}delete(t){const n=Ia(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){var i;const r=Ia(this.items,t),o=r==null?void 0:r.value;return(i=!n&&yn(o)?o.value:o)!=null?i:void 0}has(t){return!!Ia(this.items,t)}set(t,n){this.add(new Lr(t,n),!0)}toJSON(t,n,r){const o=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(o);for(const i of this.items)nN(n,o,i);return o}toString(t,n,r){if(!t)return JSON.stringify(this);for(const o of this.items)if(!Tn(o))throw new Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),rN(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const fd={collection:"map",default:!0,nodeClass:_o,tag:"tag:yaml.org,2002:map",resolve(e,t){return ud(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>_o.from(e,t,n)};class Zl extends Iy{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(ad,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=lm(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=lm(t);if(typeof r!="number")return;const o=this.items[r];return!n&&yn(o)?o.value:o}has(t){const n=lm(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=lm(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const o=this.items[r];yn(o)&&J4(n)?o.value=n:this.items[r]=n}toJSON(t,n){const r=[];n!=null&&n.onCreate&&n.onCreate(r);let o=0;for(const i of this.items)r.push(pi(i,String(o++),n));return r}toString(t,n,r){return t?rN(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:o}=r,i=new this(t);if(n&&Symbol.iterator in Object(n)){let s=0;for(let a of n){if(typeof o=="function"){const c=n instanceof Set?a:String(s++);a=o.call(n,c,a)}i.items.push(fp(a,void 0,r))}}return i}}function lm(e){let t=yn(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const pd={collection:"seq",default:!0,nodeClass:Zl,tag:"tag:yaml.org,2002:seq",resolve(e,t){return dd(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Zl.from(e,t,n)},Ry={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),Bp(e,t,n,r)}},My={identify:e=>e==null,createNode:()=>new Rt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Rt(null),stringify:({source:e},t)=>typeof e=="string"&&My.test.test(e)?e:t.options.nullStr},_E={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Rt(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&_E.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function ji({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const o=typeof r=="number"?r:Number(r);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let i=JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let s=i.indexOf(".");s<0&&(s=i.length,i+=".");let a=t-(i.length-s-1);for(;a-- >0;)i+="0"}return i}const oN={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN))$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ji},iN={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ji(e)}},sN={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Rt(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ji},Ty=e=>typeof e=="bigint"||Number.isInteger(e),$E=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function lN(e,t,n){const{value:r}=e;return Ty(r)&&r>=0?n+r.toString(t):ji(e)}const aN={identify:e=>Ty(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>$E(e,2,8,n),stringify:e=>lN(e,8,"0o")},cN={identify:Ty,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>$E(e,0,10,n),stringify:ji},uN={identify:e=>Ty(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>$E(e,2,16,n),stringify:e=>lN(e,16,"0x")},
|
|
394
|
+
${s}${S}`}else y=`${v}${c}${g.join(" ")}${c}${S}`;return e&&(y+=$l(y,s,d(e)),i&&i()),y}function Bg({indent:e,options:{commentString:t}},n,r,o){if(r&&o&&(r=r.replace(/^\n+/,"")),r){const i=Ds(t(r),e);n.push(i.trimStart())}}function Ia(e,t){const n=yn(t)?t.value:t;for(const r of e)if(Tn(r)&&(r.key===t||r.key===n||yn(r.key)&&r.key.value===n))return r}class _o extends Iy{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(jl,t),this.items=[]}static from(t,n,r){const{keepUndefined:o,replacer:i}=r,s=new this(t),a=(c,d)=>{if(typeof i=="function")d=i.call(n,c,d);else if(Array.isArray(i)&&!i.includes(c))return;(d!==void 0||o)&&s.items.push(kE(c,d,r))};if(n instanceof Map)for(const[c,d]of n)a(c,d);else if(n&&typeof n=="object")for(const c of Object.keys(n))a(c,n[c]);return typeof t.sortMapEntries=="function"&&s.items.sort(t.sortMapEntries),s}add(t,n){var s;let r;Tn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Lr(t,t==null?void 0:t.value):r=new Lr(t.key,t.value);const o=Ia(this.items,r.key),i=(s=this.schema)==null?void 0:s.sortMapEntries;if(o){if(!n)throw new Error(`Key ${r.key} already set`);yn(o.value)&&J4(r.value)?o.value.value=r.value:o.value=r.value}else if(i){const a=this.items.findIndex(c=>i(r,c)<0);a===-1?this.items.push(r):this.items.splice(a,0,r)}else this.items.push(r)}delete(t){const n=Ia(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){var i;const r=Ia(this.items,t),o=r==null?void 0:r.value;return(i=!n&&yn(o)?o.value:o)!=null?i:void 0}has(t){return!!Ia(this.items,t)}set(t,n){this.add(new Lr(t,n),!0)}toJSON(t,n,r){const o=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(o);for(const i of this.items)nN(n,o,i);return o}toString(t,n,r){if(!t)return JSON.stringify(this);for(const o of this.items)if(!Tn(o))throw new Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),rN(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const fd={collection:"map",default:!0,nodeClass:_o,tag:"tag:yaml.org,2002:map",resolve(e,t){return ud(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>_o.from(e,t,n)};class Zl extends Iy{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(ad,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=lm(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=lm(t);if(typeof r!="number")return;const o=this.items[r];return!n&&yn(o)?o.value:o}has(t){const n=lm(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=lm(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const o=this.items[r];yn(o)&&J4(n)?o.value=n:this.items[r]=n}toJSON(t,n){const r=[];n!=null&&n.onCreate&&n.onCreate(r);let o=0;for(const i of this.items)r.push(pi(i,String(o++),n));return r}toString(t,n,r){return t?rN(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:o}=r,i=new this(t);if(n&&Symbol.iterator in Object(n)){let s=0;for(let a of n){if(typeof o=="function"){const c=n instanceof Set?a:String(s++);a=o.call(n,c,a)}i.items.push(fp(a,void 0,r))}}return i}}function lm(e){let t=yn(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const pd={collection:"seq",default:!0,nodeClass:Zl,tag:"tag:yaml.org,2002:seq",resolve(e,t){return dd(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Zl.from(e,t,n)},Ry={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),Bp(e,t,n,r)}},My={identify:e=>e==null,createNode:()=>new Rt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Rt(null),stringify:({source:e},t)=>typeof e=="string"&&My.test.test(e)?e:t.options.nullStr},_E={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Rt(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&_E.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function ji({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const o=typeof r=="number"?r:Number(r);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let i=JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let s=i.indexOf(".");s<0&&(s=i.length,i+=".");let a=t-(i.length-s-1);for(;a-- >0;)i+="0"}return i}const oN={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN))$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ji},iN={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ji(e)}},sN={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Rt(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ji},Ty=e=>typeof e=="bigint"||Number.isInteger(e),$E=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function lN(e,t,n){const{value:r}=e;return Ty(r)&&r>=0?n+r.toString(t):ji(e)}const aN={identify:e=>Ty(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>$E(e,2,8,n),stringify:e=>lN(e,8,"0o")},cN={identify:Ty,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>$E(e,0,10,n),stringify:ji},uN={identify:e=>Ty(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>$E(e,2,16,n),stringify:e=>lN(e,16,"0x")},Ave=[fd,pd,Ry,My,_E,aN,cN,uN,oN,iN,sN];function GR(e){return typeof e=="bigint"||Number.isInteger(e)}const am=({value:e})=>JSON.stringify(e),Nve=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:am},{identify:e=>e==null,createNode:()=>new Rt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:am},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:e=>e==="true",stringify:am},{identify:GR,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>GR(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:am}],Dve={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Bve=[fd,pd].concat(Nve,Dve),RE={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof Buffer=="function")return Buffer.from(e,"base64");if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let o=0;o<n.length;++o)r[o]=n.charCodeAt(o);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,o,i){const s=n;let a;if(typeof Buffer=="function")a=s instanceof Buffer?s.toString("base64"):Buffer.from(s.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let d=0;d<s.length;++d)c+=String.fromCharCode(s[d]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t||(t=Rt.BLOCK_LITERAL),t!==Rt.QUOTE_DOUBLE){const c=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),d=Math.ceil(a.length/c),p=new Array(d);for(let h=0,m=0;h<d;++h,m+=c)p[h]=a.substr(m,c);a=p.join(t===Rt.BLOCK_LITERAL?`
|
|
395
395
|
`:" ")}return Bp({comment:e,type:t,value:a},r,o,i)}};function dN(e,t){var n;if(dd(e))for(let r=0;r<e.items.length;++r){let o=e.items[r];if(!Tn(o)){if(ud(o)){o.items.length>1&&t("Each pair must have its own sequence indicator");const i=o.items[0]||new Lr(new Rt(null));if(o.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${o.commentBefore}
|
|
396
396
|
${i.key.commentBefore}`:o.commentBefore),o.comment){const s=(n=i.value)!=null?n:i.key;s.comment=s.comment?`${o.comment}
|
|
397
|
-
${s.comment}`:o.comment}o=i}e.items[r]=Tn(o)?o:new Lr(o)}}else t("Expected a sequence for this tag");return e}function fN(e,t,n){const{replacer:r}=n,o=new Zl(e);o.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let s of t){typeof r=="function"&&(s=r.call(t,String(i++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){const d=Object.keys(s);if(d.length===1)a=d[0],c=s[a];else throw new TypeError(`Expected { key: value } tuple: ${s}`)}else a=s;o.items.push(kE(a,c,n))}return o}const ME={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:dN,createNode:fN};class wu extends Zl{constructor(){super(),this.add=_o.prototype.add.bind(this),this.delete=_o.prototype.delete.bind(this),this.get=_o.prototype.get.bind(this),this.has=_o.prototype.has.bind(this),this.set=_o.prototype.set.bind(this),this.tag=wu.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const o of this.items){let i,s;if(Tn(o)?(i=pi(o.key,"",n),s=pi(o.value,i,n)):i=pi(o,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,s)}return r}static from(t,n,r){const o=fN(t,n,r),i=new this;return i.items=o.items,i}}wu.tag="tag:yaml.org,2002:omap";const TE={collection:"seq",identify:e=>e instanceof Map,nodeClass:wu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=dN(e,t),r=[];for(const{key:o}of n.items)yn(o)&&(r.includes(o.value)?t(`Ordered maps must not include duplicate keys: ${o.value}`):r.push(o.value));return Object.assign(new wu,n)},createNode:(e,t,n)=>wu.from(e,t,n)};function pN({value:e,source:t},n){return t&&(e?hN:mN).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const hN={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Rt(!0),stringify:pN},mN={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>new Rt(!1),stringify:pN},
|
|
397
|
+
${s.comment}`:o.comment}o=i}e.items[r]=Tn(o)?o:new Lr(o)}}else t("Expected a sequence for this tag");return e}function fN(e,t,n){const{replacer:r}=n,o=new Zl(e);o.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let s of t){typeof r=="function"&&(s=r.call(t,String(i++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){const d=Object.keys(s);if(d.length===1)a=d[0],c=s[a];else throw new TypeError(`Expected { key: value } tuple: ${s}`)}else a=s;o.items.push(kE(a,c,n))}return o}const ME={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:dN,createNode:fN};class wu extends Zl{constructor(){super(),this.add=_o.prototype.add.bind(this),this.delete=_o.prototype.delete.bind(this),this.get=_o.prototype.get.bind(this),this.has=_o.prototype.has.bind(this),this.set=_o.prototype.set.bind(this),this.tag=wu.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const o of this.items){let i,s;if(Tn(o)?(i=pi(o.key,"",n),s=pi(o.value,i,n)):i=pi(o,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,s)}return r}static from(t,n,r){const o=fN(t,n,r),i=new this;return i.items=o.items,i}}wu.tag="tag:yaml.org,2002:omap";const TE={collection:"seq",identify:e=>e instanceof Map,nodeClass:wu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=dN(e,t),r=[];for(const{key:o}of n.items)yn(o)&&(r.includes(o.value)?t(`Ordered maps must not include duplicate keys: ${o.value}`):r.push(o.value));return Object.assign(new wu,n)},createNode:(e,t,n)=>wu.from(e,t,n)};function pN({value:e,source:t},n){return t&&(e?hN:mN).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const hN={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Rt(!0),stringify:pN},mN={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>new Rt(!1),stringify:pN},zve={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ji},jve={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ji(e)}},Hve={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Rt(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:ji},zp=e=>typeof e=="bigint"||Number.isInteger(e);function Oy(e,t,n,{intAsBigInt:r}){const o=e[0];if((o==="-"||o==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const s=BigInt(e);return o==="-"?BigInt(-1)*s:s}const i=parseInt(e,n);return o==="-"?-1*i:i}function OE(e,t,n){const{value:r}=e;if(zp(r)){const o=r.toString(t);return r<0?"-"+n+o.substr(1):n+o}return ji(e)}const Vve={identify:zp,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Oy(e,2,2,n),stringify:e=>OE(e,2,"0b")},Uve={identify:zp,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Oy(e,1,8,n),stringify:e=>OE(e,8,"0")},Wve={identify:zp,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Oy(e,0,10,n),stringify:ji},Gve={identify:zp,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Oy(e,2,16,n),stringify:e=>OE(e,16,"0x")};class Cu extends _o{constructor(t){super(t),this.tag=Cu.tag}add(t){let n;Tn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Lr(t.key,null):n=new Lr(t,null),Ia(this.items,n.key)||this.items.push(n)}get(t,n){const r=Ia(this.items,t);return!n&&Tn(r)?yn(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=Ia(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Lr(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:o}=r,i=new this(t);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof o=="function"&&(s=o.call(n,s,s)),i.items.push(kE(s,null,r));return i}}Cu.tag="tag:yaml.org,2002:set";const LE={collection:"map",identify:e=>e instanceof Set,nodeClass:Cu,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Cu.from(e,t,n),resolve(e,t){if(ud(e)){if(e.hasAllNullValues(!0))return Object.assign(new Cu,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function FE(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,o=s=>t?BigInt(s):Number(s),i=r.replace(/_/g,"").split(":").reduce((s,a)=>s*o(60)+o(a),o(0));return n==="-"?o(-1)*i:i}function gN(e){let{value:t}=e,n=s=>s;if(typeof t=="bigint")n=s=>BigInt(s);else if(isNaN(t)||!isFinite(t))return ji(e);let r="";t<0&&(r="-",t*=n(-1));const o=n(60),i=[t%o];return t<60?i.unshift(0):(t=(t-i[0])/o,i.unshift(t%o),t>=60&&(t=(t-i[0])/o,i.unshift(t))),r+i.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const vN={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>FE(e,n),stringify:gN},yN={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>FE(e,!1),stringify:gN},Ly={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Ly.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,o,i,s,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let d=Date.UTC(n,r-1,o,i||0,s||0,a||0,c);const p=t[8];if(p&&p!=="Z"){let h=FE(p,!1);Math.abs(h)<30&&(h*=60),d-=6e4*h}return new Date(d)},stringify:({value:e})=>e.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},KR=[fd,pd,Ry,My,hN,mN,Vve,Uve,Wve,Gve,zve,jve,Hve,RE,TE,ME,LE,vN,yN,Ly],qR=new Map([["core",Ave],["failsafe",[fd,pd,Ry]],["json",Bve],["yaml11",KR],["yaml-1.1",KR]]),YR={binary:RE,bool:_E,float:sN,floatExp:iN,floatNaN:oN,floatTime:yN,int:cN,intHex:uN,intOct:aN,intTime:vN,map:fd,null:My,omap:TE,pairs:ME,seq:pd,set:LE,timestamp:Ly},Kve={"tag:yaml.org,2002:binary":RE,"tag:yaml.org,2002:omap":TE,"tag:yaml.org,2002:pairs":ME,"tag:yaml.org,2002:set":LE,"tag:yaml.org,2002:timestamp":Ly};function eb(e,t){let n=qR.get(t);if(!n)if(Array.isArray(e))n=[];else{const r=Array.from(qR.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${r} or define customTags array`)}if(Array.isArray(e))for(const r of e)n=n.concat(r);else typeof e=="function"&&(n=e(n.slice()));return n.map(r=>{if(typeof r!="string")return r;const o=YR[r];if(o)return o;const i=Object.keys(YR).map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown custom tag "${r}"; use one of ${i}`)})}const qve=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Fy{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:o,schema:i,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(t)?eb(t,"compat"):t?eb(null,t):null,this.merge=!!r,this.name=typeof i=="string"&&i||"core",this.knownTags=o?Kve:{},this.tags=eb(n,this.name),this.toStringOptions=a!=null?a:null,Object.defineProperty(this,jl,{value:fd}),Object.defineProperty(this,Ys,{value:Ry}),Object.defineProperty(this,ad,{value:pd}),this.sortMapEntries=typeof s=="function"?s:s===!0?qve:null}clone(){const t=Object.create(Fy.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Yve(e,t){var c;const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const d=e.directives.toString(e);d?(n.push(d),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const o=eN(e,t),{commentString:i}=o.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=i(e.commentBefore);n.unshift(Ds(d,""))}let s=!1,a=null;if(e.contents){if(Qn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const h=i(e.contents.commentBefore);n.push(Ds(h,""))}o.forceBlockIndent=!!e.comment,a=e.contents.comment}const d=a?void 0:()=>s=!0;let p=Uu(e.contents,o,()=>a=null,d);a&&(p+=$l(p,"",i(a))),(p[0]==="|"||p[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${p}`:n.push(p)}else n.push(Uu(e.contents,o));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const d=i(e.comment);d.includes(`
|
|
398
398
|
`)?(n.push("..."),n.push(Ds(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=e.comment;d&&s&&(d=d.replace(/^\n+/,"")),d&&((!s||a)&&n[n.length-1]!==""&&n.push(""),n.push(Ds(i(d),"")))}return n.join(`
|
|
399
399
|
`)+`
|
|
400
|
-
`}class hd{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,bi,{value:Yw});let o=null;typeof n=="function"||Array.isArray(n)?o=n:r===void 0&&n&&(r=n,n=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:s}=i;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new jr({version:s}),this.setSchema(s,r),this.contents=t===void 0?null:this.createNode(t,o,r)}clone(){const t=Object.create(hd.prototype,{[bi]:{value:Yw}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Qn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Fc(this.contents)&&this.contents.add(t)}addIn(t,n){Fc(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=Q4(this);t.anchor=!n||r.has(n)?X4(n||"a",r):n}return new Py(t.anchor)}createNode(t,n,r){let o;if(typeof n=="function")t=n.call({"":t},"",t),o=n;else if(Array.isArray(n)){const S=C=>typeof C=="number"||C instanceof String||C instanceof Number,w=n.filter(S).map(String);w.length>0&&(n=n.concat(w)),o=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:d,tag:p}=r!=null?r:{},{onAnchor:h,setAnchors:m,sourceObjects:g}=
|
|
400
|
+
`}class hd{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,bi,{value:Yw});let o=null;typeof n=="function"||Array.isArray(n)?o=n:r===void 0&&n&&(r=n,n=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:s}=i;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new jr({version:s}),this.setSchema(s,r),this.contents=t===void 0?null:this.createNode(t,o,r)}clone(){const t=Object.create(hd.prototype,{[bi]:{value:Yw}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Qn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Fc(this.contents)&&this.contents.add(t)}addIn(t,n){Fc(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=Q4(this);t.anchor=!n||r.has(n)?X4(n||"a",r):n}return new Py(t.anchor)}createNode(t,n,r){let o;if(typeof n=="function")t=n.call({"":t},"",t),o=n;else if(Array.isArray(n)){const S=C=>typeof C=="number"||C instanceof String||C instanceof Number,w=n.filter(S).map(String);w.length>0&&(n=n.concat(w)),o=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:d,tag:p}=r!=null?r:{},{onAnchor:h,setAnchors:m,sourceObjects:g}=Sve(this,s||"a"),y={aliasDuplicateObjects:i!=null?i:!0,keepUndefined:c!=null?c:!1,onAnchor:h,onTagObj:d,replacer:o,schema:this.schema,sourceObjects:g},v=fp(t,p,y);return a&&Dn(v)&&(v.flow=!0),m(),v}createPair(t,n,r={}){const o=this.createNode(t,null,r),i=this.createNode(n,null,r);return new Lr(o,i)}delete(t){return Fc(this.contents)?this.contents.delete(t):!1}deleteIn(t){return cf(t)?this.contents==null?!1:(this.contents=null,!0):Fc(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Dn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return cf(t)?!n&&yn(this.contents)?this.contents.value:this.contents:Dn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Dn(this.contents)?this.contents.has(t):!1}hasIn(t){return cf(t)?this.contents!==void 0:Dn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Dg(this.schema,[t],n):Fc(this.contents)&&this.contents.set(t,n)}setIn(t,n){cf(t)?this.contents=n:this.contents==null?this.contents=Dg(this.schema,Array.from(t),n):Fc(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new jr({version:"1.1"}),r={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new jr({version:t}),r={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const o=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${o}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new Fy(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:o,onAnchor:i,reviver:s}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},c=pi(this.contents,n!=null?n:"",a);if(typeof i=="function")for(const{count:d,res:p}of a.anchors.values())i(p,d);return typeof s=="function"?su(s,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Yve(this,t)}}function Fc(e){if(Dn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class AE extends Error{constructor(t,n,r,o){super(),this.name=t,this.code=r,this.message=o,this.pos=n}}class ka extends AE{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class bN extends AE{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const zg=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));const{line:r,col:o}=n.linePos[0];n.message+=` at line ${r}, column ${o}`;let i=o-1,s=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&s.length>80){const a=Math.min(i-39,s.length-79);s="…"+s.substring(a),i-=a-1}if(s.length>80&&(s=s.substring(0,79)+"…"),r>1&&/^ *$/.test(s.substring(0,i))){let a=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`…
|
|
401
401
|
`),s=a+s}if(/[^ ]/.test(s)){let a=1;const c=n.linePos[1];c&&c.line===r&&c.col>o&&(a=Math.max(1,Math.min(c.col-o,80-i)));const d=" ".repeat(i)+"^".repeat(a);n.message+=`:
|
|
402
402
|
|
|
403
403
|
${s}
|
|
404
404
|
${d}
|
|
405
405
|
`}};function Wu(e,{flow:t,indicator:n,next:r,offset:o,onError:i,startOnNewline:s}){let a=!1,c=s,d=s,p="",h="",m=!1,g=!1,y=!1,v=null,S=null,w=null,C=null,x=null;for(const I of e)switch(y&&(I.type!=="space"&&I.type!=="newline"&&I.type!=="comma"&&i(I.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),I.type){case"space":!t&&c&&n!=="doc-start"&&I.source[0]===" "&&i(I,"TAB_AS_INDENT","Tabs are not allowed as indentation"),d=!0;break;case"comment":{d||i(I,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const k=I.source.substring(1)||" ";p?p+=h+k:p=k,h="",c=!1;break}case"newline":c?p?p+=I.source:a=!0:h+=I.source,c=!0,m=!0,(v||S)&&(g=!0),d=!0;break;case"anchor":v&&i(I,"MULTIPLE_ANCHORS","A node can have at most one anchor"),I.source.endsWith(":")&&i(I.offset+I.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=I,x===null&&(x=I.offset),c=!1,d=!1,y=!0;break;case"tag":{S&&i(I,"MULTIPLE_TAGS","A node can have at most one tag"),S=I,x===null&&(x=I.offset),c=!1,d=!1,y=!0;break}case n:(v||S)&&i(I,"BAD_PROP_ORDER",`Anchors and tags must be after the ${I.source} indicator`),C&&i(I,"UNEXPECTED_TOKEN",`Unexpected ${I.source} in ${t!=null?t:"collection"}`),C=I,c=!1,d=!1;break;case"comma":if(t){w&&i(I,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),w=I,c=!1,d=!1;break}default:i(I,"UNEXPECTED_TOKEN",`Unexpected ${I.type} token`),c=!1,d=!1}const P=e[e.length-1],_=P?P.offset+P.source.length:o;return y&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),{comma:w,found:C,spaceBefore:a,comment:p,hasNewline:m,hasNewlineAfterProp:g,anchor:v,tag:S,end:_,start:x!=null?x:_}}function pp(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
406
|
-
`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(pp(t.key)||pp(t.value))return!0}return!1;default:return!0}}function Zw(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&pp(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function wN(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const o=typeof r=="function"?r:(i,s)=>i===s||yn(i)&&yn(s)&&i.value===s.value&&!(i.value==="<<"&&e.schema.merge);return t.some(i=>o(i.key,n))}const QR="All mapping items must start at the same column";function
|
|
406
|
+
`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(pp(t.key)||pp(t.value))return!0}return!1;default:return!0}}function Zw(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&pp(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function wN(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const o=typeof r=="function"?r:(i,s)=>i===s||yn(i)&&yn(s)&&i.value===s.value&&!(i.value==="<<"&&e.schema.merge);return t.some(i=>o(i.key,n))}const QR="All mapping items must start at the same column";function Qve({composeNode:e,composeEmptyNode:t},n,r,o,i){var p,h;const s=(p=i==null?void 0:i.nodeClass)!=null?p:_o,a=new s(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,d=null;for(const m of r.items){const{start:g,key:y,sep:v,value:S}=m,w=Wu(g,{indicator:"explicit-key-ind",next:y!=null?y:v==null?void 0:v[0],offset:c,onError:o,startOnNewline:!0}),C=!w.found;if(C){if(y&&(y.type==="block-seq"?o(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==r.indent&&o(c,"BAD_INDENT",QR)),!w.anchor&&!w.tag&&!v){d=w.end,w.comment&&(a.comment?a.comment+=`
|
|
407
407
|
`+w.comment:a.comment=w.comment);continue}(w.hasNewlineAfterProp||pp(y))&&o(y!=null?y:g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((h=w.found)==null?void 0:h.indent)!==r.indent&&o(c,"BAD_INDENT",QR);const x=w.end,P=y?e(n,y,w,o):t(n,x,g,null,w,o);n.schema.compat&&Zw(r.indent,y,o),wN(n,a.items,P)&&o(x,"DUPLICATE_KEY","Map keys must be unique");const _=Wu(v!=null?v:[],{indicator:"map-value-ind",next:S,offset:P.range[2],onError:o,startOnNewline:!y||y.type==="block-scalar"});if(c=_.end,_.found){C&&((S==null?void 0:S.type)==="block-map"&&!_.hasNewline&&o(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<_.found.offset-1024&&o(P.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const I=S?e(n,S,_,o):t(n,c,v,null,_,o);n.schema.compat&&Zw(r.indent,S,o),c=I.range[2];const k=new Lr(P,I);n.options.keepSourceTokens&&(k.srcToken=m),a.items.push(k)}else{C&&o(P.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(P.comment?P.comment+=`
|
|
408
|
-
`+_.comment:P.comment=_.comment);const I=new Lr(P);n.options.keepSourceTokens&&(I.srcToken=m),a.items.push(I)}}return d&&d<c&&o(d,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,d!=null?d:c],a}function
|
|
408
|
+
`+_.comment:P.comment=_.comment);const I=new Lr(P);n.options.keepSourceTokens&&(I.srcToken=m),a.items.push(I)}}return d&&d<c&&o(d,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,d!=null?d:c],a}function Xve({composeNode:e,composeEmptyNode:t},n,r,o,i){var p;const s=(p=i==null?void 0:i.nodeClass)!=null?p:Zl,a=new s(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,d=null;for(const{start:h,value:m}of r.items){const g=Wu(h,{indicator:"seq-item-ind",next:m,offset:c,onError:o,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||m)m&&m.type==="block-seq"?o(g.end,"BAD_INDENT","All sequence items must start at the same column"):o(c,"MISSING_CHAR","Sequence item without - indicator");else{d=g.end,g.comment&&(a.comment=g.comment);continue}const y=m?e(n,m,g,o):t(n,g.end,h,null,g,o);n.schema.compat&&Zw(r.indent,m,o),c=y.range[2],a.items.push(y)}return a.range=[r.offset,c,d!=null?d:c],a}function jp(e,t,n,r){let o="";if(e){let i=!1,s="";for(const a of e){const{source:c,type:d}=a;switch(d){case"space":i=!0;break;case"comment":{n&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=c.substring(1)||" ";o?o+=s+p:o=p,s="";break}case"newline":o&&(s+=c),i=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}t+=c.length}}return{comment:o,offset:t}}const tb="Block collections are not allowed within flow collections",nb=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Jve({composeNode:e,composeEmptyNode:t},n,r,o,i){var S,w;const s=r.start.source==="{",a=s?"flow map":"flow sequence",c=(S=i==null?void 0:i.nodeClass)!=null?S:s?_o:Zl,d=new c(n.schema);d.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1);let h=r.offset+r.start.source.length;for(let C=0;C<r.items.length;++C){const x=r.items[C],{start:P,key:_,sep:I,value:k}=x,M=Wu(P,{flow:a,indicator:"explicit-key-ind",next:_!=null?_:I==null?void 0:I[0],offset:h,onError:o,startOnNewline:!1});if(!M.found){if(!M.anchor&&!M.tag&&!I&&!k){C===0&&M.comma?o(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):C<r.items.length-1&&o(M.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),M.comment&&(d.comment?d.comment+=`
|
|
409
409
|
`+M.comment:d.comment=M.comment),h=M.end;continue}!s&&n.options.strict&&pp(_)&&o(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(C===0)M.comma&&o(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(M.comma||o(M.start,"MISSING_CHAR",`Missing , between ${a} items`),M.comment){let O="";e:for(const F of P)switch(F.type){case"comma":case"space":break;case"comment":O=F.source.substring(1);break e;default:break e}if(O){let F=d.items[d.items.length-1];Tn(F)&&(F=(w=F.value)!=null?w:F.key),F.comment?F.comment+=`
|
|
410
410
|
`+O:F.comment=O,M.comment=M.comment.substring(O.length+1)}}if(!s&&!I&&!M.found){const O=k?e(n,k,M,o):t(n,M.end,I,null,M,o);d.items.push(O),h=O.range[2],nb(k)&&o(O.range,"BLOCK_IN_FLOW",tb)}else{const O=M.end,F=_?e(n,_,M,o):t(n,O,P,null,M,o);nb(_)&&o(F.range,"BLOCK_IN_FLOW",tb);const L=Wu(I!=null?I:[],{flow:a,indicator:"map-value-ind",next:k,offset:F.range[2],onError:o,startOnNewline:!1});if(L.found){if(!s&&!M.found&&n.options.strict){if(I)for(const R of I){if(R===L.found)break;if(R.type==="newline"){o(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}M.start<L.found.offset-1024&&o(L.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else k&&("source"in k&&k.source&&k.source[0]===":"?o(k,"MISSING_CHAR",`Missing space after : in ${a}`):o(L.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const D=k?e(n,k,L,o):L.found?t(n,L.end,I,null,L,o):null;D?nb(k)&&o(D.range,"BLOCK_IN_FLOW",tb):L.comment&&(F.comment?F.comment+=`
|
|
411
411
|
`+L.comment:F.comment=L.comment);const B=new Lr(F,D);if(n.options.keepSourceTokens&&(B.srcToken=x),s){const R=d;wN(n,R.items,F)&&o(O,"DUPLICATE_KEY","Map keys must be unique"),R.items.push(B)}else{const R=new _o(n.schema);R.flow=!0,R.items.push(B),d.items.push(R)}h=D?D.range[2]:L.end}}const m=s?"}":"]",[g,...y]=r.end;let v=h;if(g&&g.source===m)v=g.offset+g.source.length;else{const C=a[0].toUpperCase()+a.substring(1),x=p?`${C} must end with a ${m}`:`${C} in block collection must be sufficiently indented and end with a ${m}`;o(h,p?"MISSING_CHAR":"BAD_INDENT",x),g&&g.source.length!==1&&y.unshift(g)}if(y.length>0){const C=jp(y,v,n.options.strict,o);C.comment&&(d.comment?d.comment+=`
|
|
412
|
-
`+C.comment:d.comment=C.comment),d.range=[r.offset,v,C.offset]}else d.range=[r.offset,v,v];return d}function rb(e,t,n,r,o,i){const s=n.type==="block-map"?
|
|
412
|
+
`+C.comment:d.comment=C.comment),d.range=[r.offset,v,C.offset]}else d.range=[r.offset,v,v];return d}function rb(e,t,n,r,o,i){const s=n.type==="block-map"?Qve(e,t,n,r,i):n.type==="block-seq"?Xve(e,t,n,r,i):Jve(e,t,n,r,i),a=s.constructor;return o==="!"||o===a.tagName?(s.tag=a.tagName,s):(o&&(s.tag=o),s)}function Zve(e,t,n,r,o){var h,m;const i=r?t.directives.tagName(r.source,g=>o(r,"TAG_RESOLVE_FAILED",g)):null,s=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!r||!i||i==="!"||i===_o.tagName&&s==="map"||i===Zl.tagName&&s==="seq"||!s)return rb(e,t,n,o,i);let a=t.schema.tags.find(g=>g.tag===i&&g.collection===s);if(!a){const g=t.schema.knownTags[i];if(g&&g.collection===s)t.schema.tags.push(Object.assign({},g,{default:!1})),a=g;else return g!=null&&g.collection?o(r,"BAD_COLLECTION_TYPE",`${g.tag} used for ${s} collection, but expects ${g.collection}`,!0):o(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${i}`,!0),rb(e,t,n,o,i)}const c=rb(e,t,n,o,i,a),d=(m=(h=a.resolve)==null?void 0:h.call(a,c,g=>o(r,"TAG_RESOLVE_FAILED",g),t.options))!=null?m:c,p=Qn(d)?d:new Rt(d);return p.range=c.range,p.tag=i,a!=null&&a.format&&(p.format=a.format),p}function CN(e,t,n){const r=e.offset,o=eye(e,t,n);if(!o)return{value:"",type:null,comment:"",range:[r,r,r]};const i=o.mode===">"?Rt.BLOCK_FOLDED:Rt.BLOCK_LITERAL,s=e.source?tye(e.source):[];let a=s.length;for(let v=s.length-1;v>=0;--v){const S=s[v][1];if(S===""||S==="\r")a=v;else break}if(a===0){const v=o.chomp==="+"&&s.length>0?`
|
|
413
413
|
`.repeat(Math.max(1,s.length-1)):"";let S=r+o.length;return e.source&&(S+=e.source.length),{value:v,type:i,comment:o.comment,range:[r,S,S]}}let c=e.indent+o.indent,d=e.offset+o.length,p=0;for(let v=0;v<a;++v){const[S,w]=s[v];if(w===""||w==="\r")o.indent===0&&S.length>c&&(c=S.length);else{if(S.length<c){const C="Block scalars with more-indented leading empty lines must use an explicit indentation indicator";n(d+S.length,"MISSING_CHAR",C)}o.indent===0&&(c=S.length),p=v;break}d+=S.length+w.length+1}for(let v=s.length-1;v>=a;--v)s[v][0].length>c&&(a=v+1);let h="",m="",g=!1;for(let v=0;v<p;++v)h+=s[v][0].slice(c)+`
|
|
414
414
|
`;for(let v=p;v<a;++v){let[S,w]=s[v];d+=S.length+w.length+1;const C=w[w.length-1]==="\r";if(C&&(w=w.slice(0,-1)),w&&S.length<c){const P=`Block scalar lines must not be less indented than their ${o.indent?"explicit indentation indicator":"first line"}`;n(d-w.length-(C?2:1),"BAD_INDENT",P),S=""}i===Rt.BLOCK_LITERAL?(h+=m+S.slice(c)+w,m=`
|
|
415
415
|
`):S.length>c||w[0]===" "?(m===" "?m=`
|
|
@@ -424,41 +424,41 @@ ${d}
|
|
|
424
424
|
`+s[v][0].slice(c);h[h.length-1]!==`
|
|
425
425
|
`&&(h+=`
|
|
426
426
|
`);break;default:h+=`
|
|
427
|
-
`}const y=r+o.length+e.source.length;return{value:h,type:i,comment:o.comment,range:[r,y,y]}}function
|
|
427
|
+
`}const y=r+o.length+e.source.length;return{value:h,type:i,comment:o.comment,range:[r,y,y]}}function eye({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:o}=t[0],i=o[0];let s=0,a="",c=-1;for(let m=1;m<o.length;++m){const g=o[m];if(!a&&(g==="-"||g==="+"))a=g;else{const y=Number(g);!s&&y?s=y:c===-1&&(c=e+m)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${o}`);let d=!1,p="",h=o.length;for(let m=1;m<t.length;++m){const g=t[m];switch(g.type){case"space":d=!0;case"newline":h+=g.source.length;break;case"comment":n&&!d&&r(g,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),h+=g.source.length,p=g.source.substring(1);break;case"error":r(g,"UNEXPECTED_TOKEN",g.message),h+=g.source.length;break;default:{const y=`Unexpected token in block scalar header: ${g.type}`;r(g,"UNEXPECTED_TOKEN",y);const v=g.source;v&&typeof v=="string"&&(h+=v.length)}}}return{mode:i,indent:s,chomp:a,comment:p,length:h}}function tye(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r!=null&&r[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let s=1;s<t.length;s+=2)i.push([t[s],t[s+1]]);return i}function xN(e,t,n){const{offset:r,type:o,source:i,end:s}=e;let a,c;const d=(m,g,y)=>n(r+m,g,y);switch(o){case"scalar":a=Rt.PLAIN,c=nye(i,d);break;case"single-quoted-scalar":a=Rt.QUOTE_SINGLE,c=rye(i,d);break;case"double-quoted-scalar":a=Rt.QUOTE_DOUBLE,c=oye(i,d);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}const p=r+i.length,h=jp(s,p,t,n);return{value:c,type:a,comment:h.comment,range:[r,p,h.offset]}}function nye(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),SN(e)}function rye(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),SN(e.slice(1,-1)).replace(/''/g,"'")}function SN(e){var c;let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
428
428
|
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
429
429
|
`,"sy")}catch(d){t=new RegExp("(.*?)[ \\t]*\\r?\\n","sy"),n=new RegExp("[ \\t]*(.*?)[ \\t]*\\r?\\n","sy")}let r=t.exec(e);if(!r)return e;let o=r[1],i=" ",s=t.lastIndex;for(n.lastIndex=s;r=n.exec(e);)r[1]===""?i===`
|
|
430
430
|
`?o+=i:i=`
|
|
431
|
-
`:(o+=i+r[1],i=" "),s=n.lastIndex;const a=new RegExp("[ \\t]*(.*)","sy");return a.lastIndex=s,r=a.exec(e),o+i+((c=r==null?void 0:r[1])!=null?c:"")}function
|
|
431
|
+
`:(o+=i+r[1],i=" "),s=n.lastIndex;const a=new RegExp("[ \\t]*(.*)","sy");return a.lastIndex=s,r=a.exec(e),o+i+((c=r==null?void 0:r[1])!=null?c:"")}function oye(e,t){let n="";for(let r=1;r<e.length-1;++r){const o=e[r];if(!(o==="\r"&&e[r+1]===`
|
|
432
432
|
`))if(o===`
|
|
433
|
-
`){const{fold:i,offset:s}=
|
|
433
|
+
`){const{fold:i,offset:s}=iye(e,r);n+=i,r=s}else if(o==="\\"){let i=e[++r];const s=sye[i];if(s)n+=s;else if(i===`
|
|
434
434
|
`)for(i=e[r+1];i===" "||i===" ";)i=e[++r+1];else if(i==="\r"&&e[r+1]===`
|
|
435
|
-
`)for(i=e[++r+1];i===" "||i===" ";)i=e[++r+1];else if(i==="x"||i==="u"||i==="U"){const a={x:2,u:4,U:8}[i];n+=
|
|
435
|
+
`)for(i=e[++r+1];i===" "||i===" ";)i=e[++r+1];else if(i==="x"||i==="u"||i==="U"){const a={x:2,u:4,U:8}[i];n+=lye(e,r+1,a,t),r+=a}else{const a=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(o===" "||o===" "){const i=r;let s=e[r+1];for(;s===" "||s===" ";)s=e[++r+1];s!==`
|
|
436
436
|
`&&!(s==="\r"&&e[r+2]===`
|
|
437
|
-
`)&&(n+=r>i?e.slice(i,r+1):o)}else n+=o}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function
|
|
437
|
+
`)&&(n+=r>i?e.slice(i,r+1):o)}else n+=o}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function iye(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
|
|
438
438
|
`||r==="\r")&&!(r==="\r"&&e[t+2]!==`
|
|
439
439
|
`);)r===`
|
|
440
440
|
`&&(n+=`
|
|
441
|
-
`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const
|
|
442
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
441
|
+
`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const sye={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
442
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function lye(e,t,n,r){const o=e.substr(t,n),s=o.length===n&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,16):NaN;if(isNaN(s)){const a=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(s)}function EN(e,t,n,r){const{value:o,type:i,comment:s,range:a}=t.type==="block-scalar"?CN(t,e.options.strict,r):xN(t,e.options.strict,r),c=n?e.directives.tagName(n.source,h=>r(n,"TAG_RESOLVE_FAILED",h)):null,d=n&&c?aye(e.schema,o,c,n,r):t.type==="scalar"?cye(e,o,t,r):e.schema[Ys];let p;try{const h=d.resolve(o,m=>r(n!=null?n:t,"TAG_RESOLVE_FAILED",m),e.options);p=yn(h)?h:new Rt(h)}catch(h){const m=h instanceof Error?h.message:String(h);r(n!=null?n:t,"TAG_RESOLVE_FAILED",m),p=new Rt(o)}return p.range=a,p.source=o,i&&(p.type=i),c&&(p.tag=c),d.format&&(p.format=d.format),s&&(p.comment=s),p}function aye(e,t,n,r,o){var a;if(n==="!")return e[Ys];const i=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)i.push(c);else return c;for(const c of i)if((a=c.test)!=null&&a.test(t))return c;const s=e.knownTags[n];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(o(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Ys])}function cye({directives:e,schema:t},n,r,o){var s;const i=t.tags.find(a=>{var c;return a.default&&((c=a.test)==null?void 0:c.test(n))})||t[Ys];if(t.compat){const a=(s=t.compat.find(c=>{var d;return c.default&&((d=c.test)==null?void 0:d.test(n))}))!=null?s:t[Ys];if(i.tag!==a.tag){const c=e.tagString(i.tag),d=e.tagString(a.tag),p=`Value may be parsed as either ${c} or ${d}`;o(r,"TAG_RESOLVE_FAILED",p,!0)}}return i}function uye(e,t,n){if(t){n===null&&(n=t.length);for(let r=n-1;r>=0;--r){let o=t[r];switch(o.type){case"space":case"comment":case"newline":e-=o.source.length;continue}for(o=t[++r];(o==null?void 0:o.type)==="space";)e+=o.source.length,o=t[++r];break}}return e}const dye={composeNode:PN,composeEmptyNode:NE};function PN(e,t,n,r){const{spaceBefore:o,comment:i,anchor:s,tag:a}=n;let c,d=!0;switch(t.type){case"alias":c=fye(e,t,r),(s||a)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=EN(e,t,a,r),s&&(c.anchor=s.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=Zve(dye,e,t,a,r),s&&(c.anchor=s.source.substring(1));break;default:{const p=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",p),c=NE(e,t.offset,void 0,null,n,r),d=!1}}return s&&c.anchor===""&&r(s,"BAD_ALIAS","Anchor cannot be an empty string"),o&&(c.spaceBefore=!0),i&&(t.type==="scalar"&&t.source===""?c.comment=i:c.commentBefore=i),e.options.keepSourceTokens&&d&&(c.srcToken=t),c}function NE(e,t,n,r,{spaceBefore:o,comment:i,anchor:s,tag:a,end:c},d){const p={type:"scalar",offset:uye(t,n,r),indent:-1,source:""},h=EN(e,p,a,d);return s&&(h.anchor=s.source.substring(1),h.anchor===""&&d(s,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(h.spaceBefore=!0),i&&(h.comment=i,h.range[2]=c),h}function fye({options:e},{offset:t,source:n,end:r},o){const i=new Py(n.substring(1));i.source===""&&o(t,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&o(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const s=t+n.length,a=jp(r,s,e.strict,o);return i.range=[t,s,a.offset],a.comment&&(i.comment=a.comment),i}function pye(e,t,{offset:n,start:r,value:o,end:i},s){const a=Object.assign({_directives:t},e),c=new hd(void 0,a),d={atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},p=Wu(r,{indicator:"doc-start",next:o!=null?o:i==null?void 0:i[0],offset:n,onError:s,startOnNewline:!0});p.found&&(c.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!p.hasNewline&&s(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=o?PN(d,o,p,s):NE(d,p.end,r,null,p,s);const h=c.contents.range[2],m=jp(i,h,!1,s);return m.comment&&(c.comment=m.comment),c.range=[n,h,m.offset],c}function Qd(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function XR(e){var o;let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){const s=e[i];switch(s[0]){case"#":t+=(t===""?"":r?`
|
|
443
443
|
|
|
444
444
|
`:`
|
|
445
445
|
`)+(s.substring(1)||" "),n=!0,r=!1;break;case"%":((o=e[i+1])==null?void 0:o[0])!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class DE{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,o,i)=>{const s=Qd(n);i?this.warnings.push(new bN(s,r,o)):this.errors.push(new ka(s,r,o))},this.directives=new jr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:o}=XR(this.prelude);if(r){const i=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
446
446
|
${r}`:r;else if(o||t.directives.docStart||!i)t.commentBefore=r;else if(Dn(i)&&!i.flow&&i.items.length>0){let s=i.items[0];Tn(s)&&(s=s.key);const a=s.commentBefore;s.commentBefore=a?`${r}
|
|
447
447
|
${a}`:r}else{const s=i.commentBefore;i.commentBefore=s?`${r}
|
|
448
|
-
${s}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:XR(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const o of t)yield*this.next(o);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,o)=>{const i=Qd(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,o)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=
|
|
449
|
-
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new ka(Qd(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),o=new hd(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),o.range=[0,n,n],this.decorate(o,!1),yield o}}}function
|
|
448
|
+
${s}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:XR(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const o of t)yield*this.next(o);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,o)=>{const i=Qd(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,o)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=pye(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new ka(Qd(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new ka(Qd(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=jp(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
|
|
449
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new ka(Qd(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),o=new hd(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),o.range=[0,n,n],this.decorate(o,!1),yield o}}}function hye(e,t=!0,n){if(e){const r=(o,i,s)=>{const a=typeof o=="number"?o:Array.isArray(o)?o[0]:o.offset;if(n)n(a,i,s);else throw new ka([a,a+1],i,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return xN(e,t,r);case"block-scalar":return CN(e,t,r)}}return null}function mye(e,t){var d;const{implicitKey:n=!1,indent:r,inFlow:o=!1,offset:i=-1,type:s="PLAIN"}=t,a=Bp({type:s,value:e},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}}),c=(d=t.end)!=null?d:[{type:"newline",offset:-1,indent:r,source:`
|
|
450
450
|
`}];switch(a[0]){case"|":case">":{const p=a.indexOf(`
|
|
451
451
|
`),h=a.substring(0,p),m=a.substring(p+1)+`
|
|
452
452
|
`,g=[{type:"block-scalar-header",offset:i,indent:r,source:h}];return IN(g,c)||g.push({type:"newline",offset:-1,indent:r,source:`
|
|
453
|
-
`}),{type:"block-scalar",offset:i,indent:r,props:g,source:m}}case'"':return{type:"double-quoted-scalar",offset:i,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:i,indent:r,source:a,end:c};default:return{type:"scalar",offset:i,indent:r,source:a,end:c}}}function
|
|
453
|
+
`}),{type:"block-scalar",offset:i,indent:r,props:g,source:m}}case'"':return{type:"double-quoted-scalar",offset:i,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:i,indent:r,source:a,end:c};default:return{type:"scalar",offset:i,indent:r,source:a,end:c}}}function gye(e,t,n={}){let{afterKey:r=!1,implicitKey:o=!1,inFlow:i=!1,type:s}=n,a="indent"in e?e.indent:null;if(r&&typeof a=="number"&&(a+=2),!s)switch(e.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{const d=e.props[0];if(d.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=d.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}const c=Bp({type:s,value:t},{implicitKey:o||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":vye(e,c);break;case'"':ob(e,c,"double-quoted-scalar");break;case"'":ob(e,c,"single-quoted-scalar");break;default:ob(e,c,"scalar")}}function vye(e,t){const n=t.indexOf(`
|
|
454
454
|
`),r=t.substring(0,n),o=t.substring(n+1)+`
|
|
455
455
|
`;if(e.type==="block-scalar"){const i=e.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=r,e.source=o}else{const{offset:i}=e,s="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:s,source:r}];IN(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:`
|
|
456
456
|
`});for(const c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:"block-scalar",indent:s,props:a,source:o})}}function IN(e,t){if(t)for(const n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function ob(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{const r=e.props.slice(1);let o=t.length;e.props[0].type==="block-scalar-header"&&(o-=e.props[0].source.length);for(const i of r)i.offset+=o;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case"block-map":case"block-seq":{const o={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
|
|
457
|
-
`};delete e.items,Object.assign(e,{type:n,source:t,end:[o]});break}default:{const r="indent"in e?e.indent:-1,o="end"in e&&Array.isArray(e.end)?e.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(const i of Object.keys(e))i!=="type"&&i!=="offset"&&delete e[i];Object.assign(e,{type:n,indent:r,source:t,end:o})}}}const
|
|
457
|
+
`};delete e.items,Object.assign(e,{type:n,source:t,end:[o]});break}default:{const r="indent"in e?e.indent:-1,o="end"in e&&Array.isArray(e.end)?e.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(const i of Object.keys(e))i!=="type"&&i!=="offset"&&delete e[i];Object.assign(e,{type:n,indent:r,source:t,end:o})}}}const yye=e=>"type"in e?jg(e):Nm(e);function jg(e){switch(e.type){case"block-scalar":{let t="";for(const n of e.props)t+=jg(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(const n of e.items)t+=Nm(n);return t}case"flow-collection":{let t=e.start.source;for(const n of e.items)t+=Nm(n);for(const n of e.end)t+=n.source;return t}case"document":{let t=Nm(e);if(e.end)for(const n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const n of e.end)t+=n.source;return t}}}function Nm({start:e,key:t,sep:n,value:r}){let o="";for(const i of e)o+=i.source;if(t&&(o+=jg(t)),n)for(const i of n)o+=i.source;return r&&(o+=jg(r)),o}const eC=Symbol("break visit"),bye=Symbol("skip children"),kN=Symbol("remove item");function Za(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),_N(Object.freeze([]),e,t)}Za.BREAK=eC;Za.SKIP=bye;Za.REMOVE=kN;Za.itemAtPath=(e,t)=>{let n=e;for(const[r,o]of t){const i=n==null?void 0:n[r];if(i&&"items"in i)n=i.items[o];else return}return n};Za.parentCollection=(e,t)=>{const n=Za.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],o=n==null?void 0:n[r];if(o&&"items"in o)return o;throw new Error("Parent collection not found")};function _N(e,t,n){let r=n(t,e);if(typeof r=="symbol")return r;for(const o of["key","value"]){const i=t[o];if(i&&"items"in i){for(let s=0;s<i.items.length;++s){const a=_N(Object.freeze(e.concat([[o,s]])),i.items[s],n);if(typeof a=="number")s=a-1;else{if(a===eC)return eC;a===kN&&(i.items.splice(s,1),s-=1)}}typeof r=="function"&&o==="key"&&(r=r(t,e))}}return typeof r=="function"?r(t,e):r}const Ay="\uFEFF",Ny="",Dy="",hp="",wye=e=>!!e&&"items"in e,Cye=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function xye(e){switch(e){case Ay:return"<BOM>";case Ny:return"<DOC>";case Dy:return"<FLOW_END>";case hp:return"<SCALAR>";default:return JSON.stringify(e)}}function $N(e){switch(e){case Ay:return"byte-order-mark";case Ny:return"doc-mode";case Dy:return"flow-error-end";case hp:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
458
458
|
`:case`\r
|
|
459
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const
|
|
460
|
-
`:case"\r":case" ":return!0;default:return!1}}const JR="0123456789ABCDEFabcdef".split(""),
|
|
461
|
-
\r `.split(""),sb=e=>!e||
|
|
459
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const Sye=Object.freeze(Object.defineProperty({__proto__:null,BOM:Ay,DOCUMENT:Ny,FLOW_END:Dy,SCALAR:hp,createScalarToken:mye,isCollection:wye,isScalar:Cye,prettyToken:xye,resolveAsScalar:hye,setScalarValue:gye,stringify:yye,tokenType:$N,visit:Za},Symbol.toStringTag,{value:"Module"}));function ti(e){switch(e){case void 0:case" ":case`
|
|
460
|
+
`:case"\r":case" ":return!0;default:return!1}}const JR="0123456789ABCDEFabcdef".split(""),Eye="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()".split(""),ib=",[]{}".split(""),Pye=` ,[]{}
|
|
461
|
+
\r `.split(""),sb=e=>!e||Pye.includes(e);class RN{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){var o;t&&(this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null),this.atEnd=!n;let r=(o=this.next)!=null?o:"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
|
|
462
462
|
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
463
463
|
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const o=this.buffer[r+t+1];if(o===`
|
|
464
464
|
`||!o&&!this.atEnd)return t+r+1}return n===`
|
|
@@ -472,17 +472,17 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
|
|
|
472
472
|
`&&o>=this.pos&&o+1+n>s)t=o;else break}while(!0);return yield hp,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,o;for(;o=this.buffer[++r];)if(o===":"){const i=this.buffer[r+1];if(ti(i)||t&&i===",")break;n=r}else if(ti(o)){let i=this.buffer[r+1];if(o==="\r"&&(i===`
|
|
473
473
|
`?(r+=1,o=`
|
|
474
474
|
`,i=this.buffer[r+1]):n=r),i==="#"||t&&ib.includes(i))break;if(o===`
|
|
475
|
-
`){const s=this.continueScalar(r+1);if(s===-1)break;r=Math.max(r,s-2)}}else{if(t&&ib.includes(o))break;n=r}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield hp,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(sb))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(ti(n)||t&&ib.includes(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!ti(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(
|
|
475
|
+
`){const s=this.continueScalar(r+1);if(s===-1)break;r=Math.max(r,s-2)}}else{if(t&&ib.includes(o))break;n=r}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield hp,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(sb))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(ti(n)||t&&ib.includes(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!ti(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(Eye.includes(n))n=this.buffer[++t];else if(n==="%"&&JR.includes(this.buffer[t+1])&&JR.includes(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
|
|
476
476
|
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
477
477
|
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const o=n-this.pos;return o>0&&(yield this.buffer.substr(this.pos,o),this.pos=n),o}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class MN{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const i=n+r>>1;this.lineStarts[i]<t?n=i+1:r=i}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const o=this.lineStarts[n-1];return{line:n,col:t-o+1}}}}function ki(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function ZR(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function TN(e){switch(e==null?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function cm(e){var t;switch(e.type){case"document":return e.start;case"block-map":{const n=e.items[e.items.length-1];return(t=n.sep)!=null?t:n.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Ac(e){var n;if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function eM(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!ki(t.start,"explicit-key-ind")&&!ki(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,TN(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}let BE=class{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new RN,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(t,n))yield*this.next(r);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=$N(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const r=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(!t||t.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t!=null?t:this.stack.pop();if(n)if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&eM(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const o=r.items[r.items.length-1];if(o.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(o.sep)o.value=n;else{Object.assign(o,{key:n,sep:[]}),this.onKeyLine=!ki(o.start,"explicit-key-ind");return}break}case"block-seq":{const o=r.items[r.items.length-1];o.value?r.items.push({start:[],value:n}):o.value=n;break}case"flow-collection":{const o=r.items[r.items.length-1];!o||o.value?r.items.push({start:[],key:n,sep:[]}):o.sep?o.value=n:Object.assign(o,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const o=n.items[n.items.length-1];o&&!o.sep&&!o.value&&o.start.length>0&&ZR(o.start)===-1&&(n.indent===0||o.start.every(i=>i.type!=="comment"||i.indent<n.indent))&&(r.type==="document"?r.end=o.start:r.items.push({start:o.start}),n.items.splice(-1,1))}}else{const r="Tried to pop an empty stack";yield{type:"error",offset:this.offset,source:"",message:r}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{ZR(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=cm(this.peek(2)),r=Ac(n);let o;t.end?(o=t.end,o.push(this.sourceToken),delete t.end):o=[this.sourceToken];const i={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
478
478
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
479
479
|
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const o="end"in n.value?n.value.end:void 0,i=Array.isArray(o)?o[o.length-1]:void 0;(i==null?void 0:i.type)==="comment"?o==null||o.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const o=t.items[t.items.length-2],i=(r=o==null?void 0:o.value)==null?void 0:r.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const o=!this.onKeyLine&&this.indent===t.indent&&n.sep;let i=[];if(o&&n.sep&&!n.value){const s=[];for(let a=0;a<n.sep.length;++a){const c=n.sep[a];switch(c.type){case"newline":s.push(a);break;case"space":break;case"comment":c.indent>t.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(i=n.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":o||n.value?(i.push(this.sourceToken),t.items.push({start:i}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!ki(n.start,"explicit-key-ind")?n.start.push(this.sourceToken):o||n.value?(i.push(this.sourceToken),t.items.push({start:i})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]}),this.onKeyLine=!0;return;case"map-value-ind":if(ki(n.start,"explicit-key-ind"))if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ki(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(TN(n.key)&&!ki(n.sep,"newline")){const s=Ac(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else i.length>0?n.sep=n.sep.concat(i,this.sourceToken):n.sep.push(this.sourceToken);else if(ki(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const s=Ac(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||o?t.items.push({start:i,key:null,sep:[this.sourceToken]}):ki(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);o||n.value?(t.items.push({start:i,key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{const s=this.startBlockValue(t);if(s){o&&s.type!=="block-seq"&&ki(n.start,"explicit-key-ind")&&t.items.push({start:i}),this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const o="end"in n.value?n.value.end:void 0,i=Array.isArray(o)?o[o.length-1]:void 0;(i==null?void 0:i.type)==="comment"?o==null||o.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const o=t.items[t.items.length-2],i=(r=o==null?void 0:o.value)==null?void 0:r.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||ki(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const o=this.startBlockValue(t);if(o){this.stack.push(o);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r&&r.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:o,sep:[]}):n.sep?this.stack.push(o):Object.assign(n,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const o=cm(r),i=Ac(o);eM(t);const s=t.end.splice(1,t.end.length);s.push(this.sourceToken);const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
480
480
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
481
|
-
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=cm(t),r=Ac(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r}]}}case"map-value-ind":{this.onKeyLine=!0;const n=cm(t),r=Ac(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function ON(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new MN||null,prettyErrors:t}}function Eye(e,t={}){const{lineCounter:n,prettyErrors:r}=ON(t),o=new BE(n==null?void 0:n.addNewLine),i=new DE(t),s=Array.from(i.compose(o.parse(e)));if(r&&n)for(const a of s)a.errors.forEach(zg(e,n)),a.warnings.forEach(zg(e,n));return s.length>0?s:Object.assign([],{empty:!0},i.streamInfo())}function LN(e,t={}){const{lineCounter:n,prettyErrors:r}=ON(t),o=new BE(n==null?void 0:n.addNewLine),i=new DE(t);let s=null;for(const a of i.compose(o.parse(e),!0,e.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new ka(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(s.errors.forEach(zg(e,n)),s.warnings.forEach(zg(e,n))),s}function Pye(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);const o=LN(e,n);if(!o)return null;if(o.warnings.forEach(i=>tN(o.options.logLevel,i)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:r},n))}function Iye(e,t,n){var o;let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){const{keepUndefined:i}=(o=n!=null?n:t)!=null?o:{};if(!i)return}return new hd(e,r,n).toString(n)}const tM=Object.freeze(Object.defineProperty({__proto__:null,Alias:Py,CST:Cye,Composer:DE,Document:hd,Lexer:RN,LineCounter:MN,Pair:Lr,Parser:BE,Scalar:Rt,Schema:Fy,YAMLError:AE,YAMLMap:_o,YAMLParseError:ka,YAMLSeq:Zl,YAMLWarning:bN,isAlias:cc,isCollection:Dn,isDocument:cd,isMap:ud,isNode:Qn,isPair:Tn,isScalar:yn,isSeq:dd,parse:Pye,parseAllDocuments:Eye,parseDocument:LN,stringify:Iye,visit:Jl,visitAsync:Ey},Symbol.toStringTag,{value:"Module"}));var zE={},kye=ut;Object.defineProperty(zE,"__esModule",{value:!0});var FN=zE.default=void 0,_ye=kye(dt()),$ye=at(),Rye=(0,_ye.default)((0,$ye.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}),"ContentCopy");FN=zE.default=Rye;var jE={},Mye=ut;Object.defineProperty(jE,"__esModule",{value:!0});var HE=jE.default=void 0,Tye=Mye(dt()),Oye=at(),Lye=(0,Tye.default)((0,Oye.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Edit");HE=jE.default=Lye;const Fye="https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept";function Aye({file:e,anyMask:t,defaultPerms:n,addToBar:r,statusApi:o}){var L;const F=e,{parent:i,children:s,isRoot:a,byMasks:c}=F,d=Yt(F,["parent","children","isRoot","byMasks"]),[p,h]=u.useState(d);u.useEffect(()=>{h(Object.assign(yS(n,()=>null),d))},[e]);const{source:m}=e,g=e.type==="folder",y=m!==void 0,v=y&&g,S=u.useMemo(()=>{const B={};let R=i;for(;R;)St.defaults(B,R,R.byMasks),R=R.parent;return St.defaults(B,n)},[i]),w=y&&!!p.ctime,C=y&&!v,x=e.accept>""||g&&((L=e.can_upload)!=null?L:S.can_upload),P=IS(),{data:_,element:I}=Lo("get_accounts");if(I||!_)return I;const k=_.list,M=!y&&"Works only on folders with source! ";return u.createElement(Mp,{values:p,set(B,R){R!=="link"&&h(A=>{var N;const V=R==="source"&&((N=A.source)==null?void 0:N.endsWith(A.name))?lse(B):A.name;return kt(Ce({},A),{name:V,[R]:B})})},barSx:Ce({gap:2,width:"100%"},P),stickyBar:!0,addToBar:[!a&&u.createElement(zn,{icon:bs,title:"Delete",confirm:"Delete?",onClick:()=>Et("del_vfs",{uris:[e.id]}).then(()=>ec())}),r],onError:un,save:{sx:fy(!kS(p,d)),onClick(){return mt(this,null,function*(){const B=St.omit(p,["ctime","mtime","size","id"]);B.masks||(B.masks=null),yield Et("set_vfs",{uri:p.id,props:B}),B.name!==e.name&&(pn.selectedFiles[0].id=e.parent.id+B.name+(g?"/":"")),ec()})}},fields:[a?u.createElement(Uo,{severity:"info"},"This is Home, the root of your shared files. Options set here will be applied to all files."):{k:"name",required:!0,helperText:y&&"You can decide a name that's different from the one on your disk"},{k:"id",comp:Nye,statusApi:o},{k:"source",label:"Source on disk",comp:_f,files:!g,folders:g,multiline:!0,placeholder:"Not on disk, this is a virtual folder"},O("can_read","Who can see but not download will be asked to login"),O("can_see","If you can't see, you may still download with a direct link"),g&&O("can_list","Permission to see content of folders",{contentText:"subfolders"}),g&&O("can_delete",[M,"Those who can delete can also rename"]),g&&O("can_upload",M,{lg:x?6:12,contentText:"subfolders"}),x&&{k:"accept",label:"Accept on upload",placeholder:"anything",lg:6,helperText:u.createElement(Mo,{href:Fye,target:"_blank"},"Example: .zip")},C&&{k:"size",comp:Rm,lg:4,toField:ql},w&&{k:"ctime",comp:Rm,md:6,lg:C&&4,label:"Created",toField:nM},w&&{k:"mtime",comp:Rm,md:6,lg:C&&4,label:"Modified",toField:nM},e.website&&{k:"default",comp:Eo,label:"Serve index.html",toField:Boolean,fromField:B=>B?"index.html":null,helperText:ts("This folder may be a website because contains `index.html`. Enabling this will show the website instead of the list of files.")},g&&{k:"masks",multiline:!0,lg:!0,toField:tM.stringify,fromField:B=>B?tM.parse(B):void 0,sx:{"& textarea":{fontFamily:"monospace"}},helperText:["Special field, leave empty unless you know what you are doing. YAML syntax. ",Ya("Permissions","(examples)")]}]});function O(B,R,A={}){return Ce({showInherited:t,otherPerms:St.without(Object.keys(n),B).map(z=>({value:z,label:"As "+tC(z)})),k:B,lg:6,comp:AN,parent:i,accounts:k,helperText:R,label:"Who can "+tC(B),inherit:S[B],byMasks:c==null?void 0:c[B],isDir:g},A)}}function tC(e){const t=e.split("_")[1];return t==="read"?"download":t}function nM(e){return e?new Date(e).toLocaleString():"-"}function AN(g){var y=g,{value:e,onChange:t,parent:n,inherit:r,accounts:o,helperText:i,showInherited:s,otherPerms:a,byMasks:c,isChildren:d,isDir:p,contentText:h="folder content"}=y,m=Yt(y,["value","onChange","parent","inherit","accounts","helperText","showInherited","otherPerms","byMasks","isChildren","isDir","contentText"]);const v=(c!==void 0?"As per mask: ":n!==void 0?"As parent: ":"Default: ")+rM(c!=null?c:r),S=e!=null&&typeof e=="object"&&!Array.isArray(e),w=S&&e.children,C=S?e.this:e,x=u.useMemo(()=>rd([{value:null,label:v},{value:!0},{value:!1},{value:"*"},...a,{value:[],label:"Select accounts"}].map(I=>(I.value===C||s||I.value!==r)&&Ce({label:St.capitalize(rM(I.value))},I))),[r,n,C]),P=500,_=Array.isArray(C);return u.createElement(je,{sx:{borderRight:S?"8px solid #8884":void 0,transition:`all ${P}ms`}},u.createElement(gs,kt(Ce({},m),{value:_?[]:C,onChange(I,{event:k}){t(S?{this:I,children:w}:I,{was:e,event:k})},options:x})),u.createElement(yg,{in:_,timeout:P},_&&u.createElement(SS,{label:o!=null&&o.length?"Choose accounts for "+m.label:"You didn't create any account yet",value:C,onChange:t,options:(o==null?void 0:o.map(I=>({value:I.username,label:I.username})))||[]})),u.createElement(_p,{},i,!d&&p&&u.createElement(Mo,{sx:{display:"block",cursor:"pointer",mt:-.5},onClick(I){C!==void 0&&t(S?C:{this:e},{was:e,event:I})}},S?"Different permission for ":"Same permission for ",h)),!d&&u.createElement(yg,{in:S,timeout:P},u.createElement(AN,{label:"Permission for "+h,parent:n,inherit:r,accounts:o,showInherited:s,otherPerms:a,isDir:p,isChildren:!0,value:w!=null?w:null,onChange(I,{event:k}){t({this:C,children:I},{was:e,event:k})}})))}function rM(e){return e===!1?"no one":e===!0?"anyone":e==="*"?"any account (login required)":Array.isArray(e)?e.join(", "):typeof e=="string"?"as "+tC(e):"*UNKNOWN*"+JSON.stringify(e)}function Nye({value:e,statusApi:t}){const{data:n,reload:r,error:o}=t,i=n==null?void 0:n.suggestedUrls,s=n==null?void 0:n.baseUrl,a=(s||(i==null?void 0:i[0])||"")+e;return u.createElement(je,{display:"flex"},i?u.createElement(Rm,{label:"Link",value:a,error:o,end:u.createElement(je,{},u.createElement(zn,{icon:FN,title:"Copy",onClick:()=>navigator.clipboard.writeText(a)}),u.createElement(zn,{icon:HE,title:"Change",onClick:c}))}):"error");function c(){const{close:d}=Wo({title:"Change link",Content(){const[p,h]=u.useState(s||""),m=new URL(p||i[0]).protocol+"//",g=i.includes(p)?"":p.slice(m.length);return u.createElement(je,{display:"flex",flexDirection:"column"},u.createElement(je,{mb:2},"You can choose a different base address for your links"),u.createElement(Zv,{},i.map(S=>u.createElement(fo,{key:S,selected:S===p,onClick:()=>y(S)},S,S===p&&u.createElement(sS,{sx:{ml:2}})))),u.createElement(io,{label:"Custom IP or domain",helperText:ts(`You can type any address but *you* are responsible to make the address work.
|
|
482
|
-
This functionality is just to help you copy the link in case you have a domain or a complex network configuration.`),value:g,onChange:S=>y(vu(m,S)),start:u.createElement(gs,{value:m,onChange:S=>g?y(S+g):Wr("Enter domain first"),options:["http://","https://"],size:"small",variant:"standard",sx:{"& .MuiSelect-select":{pt:"1px",pb:0}}}),sx:{mt:2}}),u.createElement(je,{mt:2,textAlign:"right"},u.createElement(yu,{icon:uy,children:"Save",onClick(){return mt(this,null,function*(){p!==s&&(yield Et("set_config",{values:{base_url:p}}),yield r()),d()})}})));function y(S){S.endsWith("/")&&(S=S.slice(0,-1)),h(S)}}})}}let nC;function Dye(){var S,w,C;const[e]=u.useState(()=>new Map),{vfs:t,selectedFiles:n}=oa(),{data:r,reload:o,element:i}=Lo("get_vfs");u.useMemo(()=>t||o(),[t,o]);const s=u.useMemo(()=>function x(P){var _;return!St.isEmpty(P==null?void 0:P.masks)||((_=P==null?void 0:P.children)==null?void 0:_.some(x))}(t),[t]),a="md",c=Yl(a),d=Lo("get_status"),{data:p}=d,h=u.useMemo(()=>{const x=p==null?void 0:p.baseUrl,P=St.sortBy((p==null?void 0:p.urls.https)||(p==null?void 0:p.urls.http),_=>_.includes("[")&&_!==x);return p&&(p.suggestedUrls=P),x&&!P.includes(x)?[x,...P]:P},[p]);function m(){pn.selectedFiles=[]}const g=n.length?n.length===1?u.createElement(Aye,{addToBar:c&&u.createElement(zn,{icon:Rp,title:"Close",onClick:m}),defaultPerms:r==null?void 0:r.defaultPerms,anyMask:s,statusApi:d,file:n[0]}):u.createElement(u.Fragment,{},u.createElement(Ql,{alignItems:"center"},u.createElement(Tr,{variant:"h6"},n.length+" selected"),u.createElement(mr,{onClick:Bye,startIcon:u.createElement(bs)},"Remove")),u.createElement(Jv,{dense:!0,disablePadding:!0},n.map(x=>u.createElement(mF,{key:x.id},u.createElement(cs,{primary:x.name,secondary:x.source}))))):null;if(u.useEffect(()=>{if(c||!g)return;const{close:x}=Wo({title:n.length>1?"Multiple selection":n[0].name,Content:()=>g,onClose:m});return x},[c,n]),u.useEffect(()=>{if(pn.vfs=void 0,!r)return;e.clear();const{root:x}=r;if(!x)return;x.isRoot=!0,_(x),pn.vfs=x;const P=nC||pn.selectedFiles.map(I=>I.id);nC=void 0,pn.selectedFiles=rd(P.map(I=>e.get(I)));function _(I,k="/",M=void 0){if(I.parent=M,I.id=I.isRoot?"/":vu(k,encodeURIComponent(I.name),I.type==="folder"?"/":""),e.set(I.id,I),!!I.children)for(const O of I.children)_(O,I.id,I)}},[r,e]),i)return e.clear(),i;const v=!((w=(S=r==null?void 0:r.root)==null?void 0:S.children)!=null&&w.length)&&!((C=r==null?void 0:r.root)!=null&&C.source)?{severity:"warning",children:"Add something to your shared files — click Add"}:h&&{severity:"info",children:["Your shared files can be browsed from ",wie(" or ",h.slice(0,3).map(x=>u.createElement(Mo,{href:x},x)))]};return u.createElement(Jn,{container:!0,rowSpacing:1,maxWidth:"80em",columnSpacing:2},v&&u.createElement(Jn,{item:!0,mb:2,xs:12},u.createElement(Uo,v)),u.createElement(Jn,{item:!0,[a]:6,lg:5},u.createElement(Tr,{variant:"h6",mb:1},"Virtual File System"),u.createElement(gve),t&&u.createElement(zye,{id2node:e})),c&&g&&u.createElement(Jn,{item:!0,[a]:6,lg:7,maxWidth:"100%"},u.createElement(Bx,{},u.createElement(zx,{},g))))}function ec(e){nC=e,pn.vfs=void 0}function Bye(){return mt(this,null,function*(){const e=pn.selectedFiles;if(e.length&&(yield qs(`Delete ${e.length} item(s)?`)))try{const t=e.map(o=>o.id);St.pull(t,"/");const{errors:n}=yield Et("del_vfs",{uris:t}),r=t.filter((o,i)=>n[i]);if(r.length)return un("Following elements couldn't be deleted: "+r.join(", "),"error");ec()}catch(t){yield un(t)}})}const NN=L4,DN=A4;function zye({id2node:e}){const{vfs:t,selectedFiles:n}=oa(),[r,o]=u.useState(n.map(m=>m.id)),[i,s]=u.useState(Array.from(e.keys())),a=u.useRef(),c=u.useRef();if(!t)return null;const d="vfs";return u.createElement(rA,{ref:c,expanded:i,selected:r,multiSelect:!0,id:d,sx:{overflowX:"auto",maxWidth:c.current&&`calc(100vw - ${16+c.current.offsetLeft}px)`,"& ul":{borderLeft:"1px dashed #444",marginLeft:"15px"}},onNodeSelect(m,g){o(g),pn.selectedFiles=rd(g.map(y=>e.get(y)))}},h(t));function p(m){return m!==void 0&&m!==!0}function h(m){var C,x;let{id:g,name:y,isRoot:v}=m;if(!g)debugger;const S=m.type==="folder";return u.createElement(Ow,{ref(P){P==null||P.addEventListener("focusin",_=>_.stopImmediatePropagation())},label:u.createElement(je,{draggable:!v,onDragStart(){a.current=g},onDragOver(P){if(!S)return;const _=a.current;_!=null&&_.startsWith(g)&&!_.slice(g.length+1).includes("/")||P.preventDefault()},onDrop(){return mt(this,null,function*(){const P=a.current;P&&(yield qs(`Moving ${P} under ${g}`))&&Et("move_vfs",{from:P,parent:g}).then(()=>{ec([g+P.slice(1+P.lastIndexOf("/",P.length-2))])},un)})},sx:{display:"flex",gap:".5em",lineHeight:"2em",alignItems:"center"}},u.createElement(je,{display:"flex",flex:0},v?xo(F4,"home, or root if you like"):S?xo(NN,"Folder"):xo(DN,"File"),u.createElement(je,{sx:{flex:0,ml:"2px",my:"2px","&>*":{fontSize:"87%",opacity:.6,mt:"-2px"},display:"grid",gridAutoFlow:"column",gridTemplateRows:"auto auto"}},m.can_delete!==void 0&&xo(bs,"Delete permission"),m.can_upload!==void 0&&xo(Tp,"Upload permission"),!v&&!m.source&&xo(B4,"Virtual (no source)"),p(m.can_see)&&xo(N4,"Restrictions on who can see"),p(m.can_read)&&xo(jS,"Restrictions on who can download"),m.default&&xo(D4,"Act as website"),m.masks&&xo(O4,"Masks"),m.size===-1&&xo(z4,"Source not found"))),v?"Home":(()=>{var k;const P=(k=m.parent)==null?void 0:k.source,{source:_}=m,I=P&&(_!=null&&_.startsWith(P))?"."+_.slice(P.length):_;return!I||!(_!=null&&_.endsWith(y))||I.length>45?u.createElement(je,{lineHeight:"1.2em"},y):u.createElement("span",{},u.createElement("span",{style:{opacity:.4}},I.slice(0,-y.length)),I.slice(-y.length))})()),key:y,collapseIcon:u.createElement(T4,{onClick(P){s(i.filter(_=>_!==g)),P.preventDefault(),P.stopPropagation()}}),expandIcon:u.createElement(M4,{onClick(P){s([...i,g]),P.preventDefault(),P.stopPropagation()}}),nodeId:g},v&&!((C=m.children)!=null&&C.length)?u.createElement(Ow,{nodeId:"?",label:u.createElement("i",{},"nothing here")}):(x=m.children)==null?void 0:x.map(h))}}var oM=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function jye(e,t){return!!(e===t||oM(e)&&oM(t))}function Hye(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!jye(e[n],t[n]))return!1;return!0}function lb(e,t){t===void 0&&(t=Hye);var n,r=[],o,i=!1;function s(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return i&&n===this&&t(a,r)||(o=e.apply(this,a),i=!0,n=this,r=a),o}return s}var Vye=typeof performance=="object"&&typeof performance.now=="function",iM=Vye?function(){return performance.now()}:function(){return Date.now()};function sM(e){cancelAnimationFrame(e.id)}function Uye(e,t){var n=iM();function r(){iM()-n>=t?e.call(null):o.id=requestAnimationFrame(r)}var o={id:requestAnimationFrame(r)};return o}var ab=-1;function lM(e){if(e===void 0&&(e=!1),ab===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),ab=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return ab}var Nc=null;function aM(e){if(e===void 0&&(e=!1),Nc===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?Nc="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Nc="negative":Nc="positive-ascending"),document.body.removeChild(t),Nc}return Nc}var Wye=150,Gye=function(t,n){return t};function Kye(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,o=e.getItemSize,i=e.getOffsetForIndexAndAlignment,s=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,c=e.initInstanceProps,d=e.shouldResetStyleCacheOnItemSizeChange,p=e.validateProps;return t=function(h){Tx(m,h);function m(y){var v;return v=h.call(this,y)||this,v._instanceProps=c(v.props,yw(v)),v._outerRef=void 0,v._resetIsScrollingTimeoutId=null,v.state={instance:yw(v),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof v.props.initialScrollOffset=="number"?v.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},v._callOnItemsRendered=void 0,v._callOnItemsRendered=lb(function(S,w,C,x){return v.props.onItemsRendered({overscanStartIndex:S,overscanStopIndex:w,visibleStartIndex:C,visibleStopIndex:x})}),v._callOnScroll=void 0,v._callOnScroll=lb(function(S,w,C){return v.props.onScroll({scrollDirection:S,scrollOffset:w,scrollUpdateWasRequested:C})}),v._getItemStyle=void 0,v._getItemStyle=function(S){var w=v.props,C=w.direction,x=w.itemSize,P=w.layout,_=v._getItemStyleCache(d&&x,d&&P,d&&C),I;if(_.hasOwnProperty(S))I=_[S];else{var k=n(v.props,S,v._instanceProps),M=o(v.props,S,v._instanceProps),O=C==="horizontal"||P==="horizontal",F=C==="rtl",L=O?k:0;_[S]=I={position:"absolute",left:F?void 0:L,right:F?L:void 0,top:O?0:k,height:O?"100%":M,width:O?M:"100%"}}return I},v._getItemStyleCache=void 0,v._getItemStyleCache=lb(function(S,w,C){return{}}),v._onScrollHorizontal=function(S){var w=S.currentTarget,C=w.clientWidth,x=w.scrollLeft,P=w.scrollWidth;v.setState(function(_){if(_.scrollOffset===x)return null;var I=v.props.direction,k=x;if(I==="rtl")switch(aM()){case"negative":k=-x;break;case"positive-descending":k=P-C-x;break}return k=Math.max(0,Math.min(k,P-C)),{isScrolling:!0,scrollDirection:_.scrollOffset<x?"forward":"backward",scrollOffset:k,scrollUpdateWasRequested:!1}},v._resetIsScrollingDebounced)},v._onScrollVertical=function(S){var w=S.currentTarget,C=w.clientHeight,x=w.scrollHeight,P=w.scrollTop;v.setState(function(_){if(_.scrollOffset===P)return null;var I=Math.max(0,Math.min(P,x-C));return{isScrolling:!0,scrollDirection:_.scrollOffset<I?"forward":"backward",scrollOffset:I,scrollUpdateWasRequested:!1}},v._resetIsScrollingDebounced)},v._outerRefSetter=function(S){var w=v.props.outerRef;v._outerRef=S,typeof w=="function"?w(S):w!=null&&typeof w=="object"&&w.hasOwnProperty("current")&&(w.current=S)},v._resetIsScrollingDebounced=function(){v._resetIsScrollingTimeoutId!==null&&sM(v._resetIsScrollingTimeoutId),v._resetIsScrollingTimeoutId=Uye(v._resetIsScrolling,Wye)},v._resetIsScrolling=function(){v._resetIsScrollingTimeoutId=null,v.setState({isScrolling:!1},function(){v._getItemStyleCache(-1,null)})},v}m.getDerivedStateFromProps=function(v,S){return qye(v,S),p(v),null};var g=m.prototype;return g.scrollTo=function(v){v=Math.max(0,v),this.setState(function(S){return S.scrollOffset===v?null:{scrollDirection:S.scrollOffset<v?"forward":"backward",scrollOffset:v,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(v,S){S===void 0&&(S="auto");var w=this.props,C=w.itemCount,x=w.layout,P=this.state.scrollOffset;v=Math.max(0,Math.min(v,C-1));var _=0;if(this._outerRef){var I=this._outerRef;x==="vertical"?_=I.scrollWidth>I.clientWidth?lM():0:_=I.scrollHeight>I.clientHeight?lM():0}this.scrollTo(i(this.props,v,S,P,this._instanceProps,_))},g.componentDidMount=function(){var v=this.props,S=v.direction,w=v.initialScrollOffset,C=v.layout;if(typeof w=="number"&&this._outerRef!=null){var x=this._outerRef;S==="horizontal"||C==="horizontal"?x.scrollLeft=w:x.scrollTop=w}this._callPropsCallbacks()},g.componentDidUpdate=function(){var v=this.props,S=v.direction,w=v.layout,C=this.state,x=C.scrollOffset,P=C.scrollUpdateWasRequested;if(P&&this._outerRef!=null){var _=this._outerRef;if(S==="horizontal"||w==="horizontal")if(S==="rtl")switch(aM()){case"negative":_.scrollLeft=-x;break;case"positive-ascending":_.scrollLeft=x;break;default:var I=_.clientWidth,k=_.scrollWidth;_.scrollLeft=k-I-x;break}else _.scrollLeft=x;else _.scrollTop=x}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&sM(this._resetIsScrollingTimeoutId)},g.render=function(){var v=this.props,S=v.children,w=v.className,C=v.direction,x=v.height,P=v.innerRef,_=v.innerElementType,I=v.innerTagName,k=v.itemCount,M=v.itemData,O=v.itemKey,F=O===void 0?Gye:O,L=v.layout,D=v.outerElementType,B=v.outerTagName,R=v.style,A=v.useIsScrolling,z=v.width,V=this.state.isScrolling,N=C==="horizontal"||L==="horizontal",H=N?this._onScrollHorizontal:this._onScrollVertical,W=this._getRangeToRender(),K=W[0],Y=W[1],ie=[];if(k>0)for(var re=K;re<=Y;re++)ie.push(u.createElement(S,{data:M,key:F(re,M),index:re,isScrolling:A?V:void 0,style:this._getItemStyle(re)}));var de=r(this.props,this._instanceProps);return u.createElement(D||B||"div",{className:w,onScroll:H,ref:this._outerRefSetter,style:E({position:"relative",height:x,width:z,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:C},R)},u.createElement(_||I||"div",{children:ie,ref:P,style:{height:N?"100%":de,pointerEvents:V?"none":void 0,width:N?de:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var v=this.props.itemCount;if(v>0){var S=this._getRangeToRender(),w=S[0],C=S[1],x=S[2],P=S[3];this._callOnItemsRendered(w,C,x,P)}}if(typeof this.props.onScroll=="function"){var _=this.state,I=_.scrollDirection,k=_.scrollOffset,M=_.scrollUpdateWasRequested;this._callOnScroll(I,k,M)}},g._getRangeToRender=function(){var v=this.props,S=v.itemCount,w=v.overscanCount,C=this.state,x=C.isScrolling,P=C.scrollDirection,_=C.scrollOffset;if(S===0)return[0,0,0,0];var I=s(this.props,_,this._instanceProps),k=a(this.props,I,_,this._instanceProps),M=!x||P==="backward"?Math.max(1,w):1,O=!x||P==="forward"?Math.max(1,w):1;return[Math.max(0,I-M),Math.max(0,Math.min(S-1,k+O)),I,k]},m}(u.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var qye=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},Yye=Kye({getItemOffset:function(t,n){var r=t.itemSize;return n*r},getItemSize:function(t,n){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var n=t.itemCount,r=t.itemSize;return r*n},getOffsetForIndexAndAlignment:function(t,n,r,o,i,s){var a=t.direction,c=t.height,d=t.itemCount,p=t.itemSize,h=t.layout,m=t.width,g=a==="horizontal"||h==="horizontal",y=g?m:c,v=Math.max(0,d*p-y),S=Math.min(v,n*p),w=Math.max(0,n*p-y+p+s);switch(r==="smart"&&(o>=w-y&&o<=S+y?r="auto":r="center"),r){case"start":return S;case"end":return w;case"center":{var C=Math.round(w+(S-w)/2);return C<Math.ceil(y/2)?0:C>v+Math.floor(y/2)?v:C}case"auto":default:return o>=w&&o<=S?o:o<w?w:S}},getStartIndexForOffset:function(t,n){var r=t.itemCount,o=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(n/o)))},getStopIndexForStartIndex:function(t,n,r){var o=t.direction,i=t.height,s=t.itemCount,a=t.itemSize,c=t.layout,d=t.width,p=o==="horizontal"||c==="horizontal",h=n*a,m=p?d:i,g=Math.ceil((m+r-h)/a);return Math.max(0,Math.min(s-1,n+g-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function BN({onSelect:e,multiple:t=!0,files:n=!0,folders:r=!0,fileMask:o,from:i=""}){const[s,a]=u.useState(i),[c,d]=u.useState(!1),p=u.useRef(!1);u.useEffect(()=>{Et("resolve_path",{path:i,closestFolder:!0}).then(D=>{typeof D.path=="string"&&(a(D.path),p.current=D.path[1]===":")}).finally(()=>d(!0))},[i]);const{list:h,error:m,connecting:g}=sc(c&&"ls",{path:s,files:n,fileMask:o});u.useEffect(()=>{v([]),w("")},[s]);const[y,v]=u.useState([]),[S,w]=u.useState(""),C=u.useMemo(()=>St.debounce(D=>w(D)),[]),x=u.useMemo(()=>{const D=new RegExp(St.escapeRegExp(S),"i");return B=>D.test(B)},[S]),[P,_]=u.useState(0),I=u.useMemo(()=>h.filter(D=>x(D.n)),[h,x]),k=p.current?"":"/",M=p.current?"\\":"/",O=tse(M,s),F=s.length<2;return u.createElement(u.Fragment,{},u.createElement(je,{display:"flex",gap:1},u.createElement(mr,{title:"root",disabled:F,onClick(){a(k)}},u.createElement(R4)),u.createElement(mr,{disabled:F,title:"parent folder",onClick(){const D=/[\\/]$/.test(s)?s.slice(0,-1):s,B=sle(D)?k:D.slice(0,D.lastIndexOf(M)||1);a(B)}},u.createElement($4)),u.createElement(io,{label:"Current path",value:s,InputLabelProps:{shrink:!0},onChange(D){return mt(this,null,function*(){if(!D)return a(k);const B=yield Et("resolve_path",{path:D});a(B.path)})}})),m?u.createElement(Uo,{severity:"error"},cA(m)):u.createElement(u.Fragment,{},u.createElement(je,{ref(D){if(!D)return;const B=(D==null?void 0:D.clientHeight)-1;B-P>1&&_(B)},sx:{flex:1,display:"flex",flexDirection:"column"}},h.length?u.createElement(Yye,{width:"100%",height:P,itemSize:46,itemCount:I.length,overscanCount:5,children({index:D,style:B}){const R=I[D],A=R.k==="d";return u.createElement(fo,{style:kt(Ce({},B),{padding:0}),key:R.n,onClick(){A?a(O+R.n):e([O+R.n])}},t&&u.createElement(QL,{checked:y.includes(R.n),disabled:!r&&A,onClick(z){const V=R.n,N=y.filter(H=>H!==V);v(N.length<y.length?N:[...y,V]),z.stopPropagation()}}),u.createElement(Bl,{},u.createElement(R.k?NN:DN)),u.createElement(cs,{sx:{whiteSpace:"pre-wrap",wordBreak:"break-all"}},R.n),!A&&R.s!==void 0&&u.createElement(Tr,{variant:"body2",color:"text.secondary",ml:4,mr:1},ql(R.s)))}}):u.createElement(py,{flex:1,mt:"4em"},g?aA():"No elements in this folder")),u.createElement(je,{display:"flex",gap:1},(t||r||!n)&&u.createElement(mr,{variant:"contained",disabled:!s||!r&&!y.length&&n,sx:{minWidth:"max-content"},onClick(){e(y.length?y.map(D=>O+D):[s])}},n&&(y.length||!r)?`Select (${y.length})`:"Select this folder"),u.createElement($p,{value:S,label:`Filter results (${I.length}${I.length<h.length?"/"+h.length:""})`,onChange(D){C(D.target.value)},sx:{flex:1}}))))}function _f(c){var d=c,{value:e,onChange:t,files:n=!0,folders:r=!1,fileMask:o,defaultPath:i,title:s}=d,a=Yt(d,["value","onChange","files","folders","fileMask","defaultPath","title"]);const p=Yl("md");return u.createElement(io,kt(Ce({},a),{value:e,onChange:t,InputProps:{endAdornment:u.createElement(qa,{position:"end"},u.createElement(zn,{icon:_4,title:"Browse files...",edge:"end",onClick(){const{close:h}=Wo({title:s!=null?s:n?"Pick a file":"Pick a folder",dialogProps:{fullScreen:!p,sx:{minWidth:"min(90vw, 40em)",minHeight:"calc(100vh - 9em)"}},Content(){return u.createElement(BN,{multiple:!1,folders:r,files:n,fileMask:o,from:e||i,onSelect(g){return mt(this,null,function*(){var S;let y=g==null?void 0:g[0];if(!y)return;const v=(S=yield Et("get_cwd"))==null?void 0:S.path;y.startsWith(v)&&(y=y.slice(v.length+1)||"."),t(y,{was:e,event:"picker"}),h()})}})}})}}))}}))}var VE={},Qye=ut;Object.defineProperty(VE,"__esModule",{value:!0});var Dm=VE.default=void 0,Xye=Qye(dt()),Jye=at(),Zye=(0,Xye.default)((0,Jye.jsx)("path",{d:"M22 13v3c0 1.1-.9 2-2 2h-3l1 1v2H6v-2l1-1H4c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h8v2H4v11h16v-3h2zm-7 2-5-5h4V3h2v7h4l-5 5z"}),"BrowserUpdated");Dm=VE.default=Zye;var UE={},e0e=ut;Object.defineProperty(UE,"__esModule",{value:!0});var zN=UE.default=void 0,t0e=e0e(dt()),n0e=at(),r0e=(0,t0e.default)((0,n0e.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 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");zN=UE.default=r0e;var WE={},o0e=ut;Object.defineProperty(WE,"__esModule",{value:!0});var jN=WE.default=void 0,i0e=o0e(dt()),s0e=at(),l0e=(0,i0e.default)((0,s0e.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"Launch");jN=WE.default=l0e;var GE={},a0e=ut;Object.defineProperty(GE,"__esModule",{value:!0});var HN=GE.default=void 0,c0e=a0e(dt()),u0e=at(),d0e=(0,c0e.default)((0,u0e.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"OpenInNew");HN=GE.default=d0e;function f0e(){var _,I,k;const e=" — ",{username:t}=oa(),{data:n,reload:r,element:o}=Lo("get_status"),{data:i}=Lo("get_vfs"),[s]=ry(t&&"get_account"),{data:a,reload:c}=Lo("get_config",{only:["https_port","cert","private_key","proxies","update_to_beta"]}),{list:d}=sc("get_plugins"),[p,h]=u.useState();if(o||!n)return o;const{http:m,https:g}=n,y=!(m!=null&&m.listening)&&(g!=null&&g.listening)?"s":"",v=y?g:(m==null?void 0:m.listening)&&m,S=v&&`http${y}://`+window.location.hostname+(v.port===(y?443:80)?"":":"+v.port),w=St.pick(n,["http","https"]),C=yS(w,O=>O.busy?[`port ${O.port} already used by ${O.busy}${e}choose a `,um("different port"),` or stop ${O.busy}`]:O.error),x=C&&rd(Object.entries(C).map(([O,F])=>F&&[ts(`Protocol _${O}_ cannot work: `),F,(KE(F)||qE(F))&&[e,u.createElement(Mo,{sx:{cursor:"pointer"},onClick(){YE().then(c).then(r)}},"make one")," or ",e,um("provide adequate files")]]));return u.createElement(je,{display:"flex",gap:2,flexDirection:"column",alignItems:"flex-start",height:"100%"},t&&Jr("","Welcome "+t),x.length?np(x.map(O=>Jr("error",np(O)))):Jr("success","Server is working"),i?!((I=(_=i.root)==null?void 0:_.children)!=null&&I.length)&&!((k=i.root)!=null&&k.source)?Jr("warning","You have no files shared",e,p0e("add some")):Jr("",ts("This is Admin-panel, where you manage your server. Access your files on "),u.createElement(Mo,{target:"frontend",href:"../.."},"Front-end",u.createElement(jN,{sx:{verticalAlign:"sub",ml:".2em"}}))):u.createElement(fF),!S&&Jr("warning","Frontend unreachable: ",St.map(C,(O,F)=>F+" "+(O?"is in error":"is off")).join(", "),!x.length&&[e,um("switch http or https on")]),d.find(O=>O.badApi)&&Jr("warning","Some plugins may be incompatible"),!(s!=null&&s.adminActualAccess)&&Jr("",ts("On _localhost_ you don't need to login"),e,u.createElement(_S,{to:"accounts"},ts("to access from another computer create an account with /admin/ permission"))),rC(a,n)&&Jr("warning",rC(a,n),e,um("set the number of proxies"),e,"unless you are sure and you can ",u.createElement(mr,{size:"small",onClick(){return mt(this,null,function*(){(yield qs("Go on only if you know what you are doing"))&&(yield Et("set_config",{values:{ignore_proxies:!0}}))&&c()})}},"ignore this warning"),e,Ya("Proxy-warning","Explanation")),((a==null?void 0:a.proxies)>0||(n==null?void 0:n.proxyDetected))&&Jr("",Ya("Reverse-proxy","Read our guide on proxies")),n.frpDetected&&Jr("warning",'FRP is detected. It should not be used with "type = tcp" with HFS. Possible solutions are',u.createElement("ol",{},u.createElement("li",{},"configure FRP with type=http (best solution)"),u.createElement("li",{},ts("configure FRP to connect to HFS _not_ with 127.0.0.1 (safe, but you won't see users' IPs)")),u.createElement("li",{},`disable "admin access for localhost" in HFS (safe, but you won't see users' IPs)`))),Jr("",u.createElement(Mo,{target:"support",href:Mw+"discussions"},"Get support")),n.updatePossible==="local"?u.createElement(yu,{icon:Dm,onClick:()=>cM()},"Update from local file"):p?Tw(St.find(p,"isNewer"),O=>!p.length||!n.updatePossible&&!O?Jr("","No update available"):O&&!n.updatePossible?Jr("",`Version ${O.name} available`):u.createElement(Ql,{vert:!0},p.map(F=>u.createElement(Ql,{key:F.name,alignItems:"flex-start",flexWrap:"wrap"},u.createElement(Bx,{},u.createElement(zx,{},u.createElement(yu,kt(Ce({icon:Dm},!F.isNewer&&{color:"warning",variant:"outlined"}),{onClick:()=>cM(F.tag_name)}),vu("Install ",F.name,F.isNewer?"":" (older)")),u.createElement(je,{mt:1},ts(F.body,{onText:P,linkTarget:"_blank"})))))))):u.createElement(yu,{variant:"outlined",icon:Dm,onClick:()=>Et("check_update").then(O=>h(O.options),un)},"Check for updates"));function P(O){return V4(O,new RegExp("(?<=^|\\W)#(\\d+)\\b","g"),F=>u.createElement(Mo,{href:Mw+"issues/"+F[1],target:"_blank"},u.createElement(HN,{sx:{verticalAlign:"bottom"}})))}}function cM(e){return mt(this,null,function*(){if(!(yield qs("Update may take less than a minute, depending on the speed of your server")))return;Wr("Downloading"),yield Et("update",{tag:e}),Wr("Restarting");const t=Date.now();let n;for(;yield Et("NONE").then(()=>0,r=>!r.code);)!n&&Date.now()-t>1e4&&(n=un("This is taking too long, please check your server","warning")),yield Zie(500);n==null||n.close(),dA(pn,"loginRequired",()=>pn.loginRequired=!1),yield un("Procedure complete","success"),window.location.reload()})}function Jr(e,...t){return u.createElement(je,{fontSize:"x-large",color:n=>{var r;return e&&((r=n.palette[e])==null?void 0:r.main)}},u.createElement({success:zN,info:tp,"":tp,warning:ny,error:ty}[e],{sx:{mb:"-3px",mr:1,color:e?void 0:"primary.main"}}),...t)}function p0e(e="File System page"){return u.createElement(_S,{to:"fs"},e)}function um(e="Options page"){return u.createElement(_S,{to:"options"},e)}function rC(e,t){return e&&!e.proxies&&(t==null?void 0:t.proxyDetected)&&"A proxy was detected but none is configured"}let Hl,oC;const VN=hS({changes:{}});mS(pn,e=>{e.some(t=>t[1][0]==="config")&&UN()});const Hg={log:"Access",error_log:"Access error",console:"Console"},uM=io;function h0e(){var g;const{data:e,reload:t,element:n}=Lo("get_config",{omit:["vfs"]}),r=oa(),{changes:o}=gS(VN),i=Lo(e&&"get_status"),s=i.data,a=oC=i.reload;u.useEffect(()=>void a(),[e]),u.useEffect(()=>()=>oC=void 0,[]);const c=(g=ry("get_admins")[0])==null?void 0:g.list;if(n)return n;if(i.error)return i.element;const d=Hl!==e?pn.config=Hl=e:r.config,p={comp:Zi,min:1,placeholder:"no limit",md:3},h=d.https_port>=0;return u.createElement(Mp,{sx:{maxWidth:"60em"},values:d,set(y,v){pn.config[v]=y},stickyBar:!0,onError:un,save:{onClick:m,sx:fy(Object.keys(o).length>0)},barSx:{gap:2},addToBar:[u.createElement(mr,{onClick(){t(),a()},startIcon:u.createElement(ey)},"Reload")],defaults(){return{sm:6}},fields:[{k:"port",comp:dM,md:3,label:"HTTP port",status:(s==null?void 0:s.http)||!0,suggestedPort:80},{k:"https_port",comp:dM,md:3,label:"HTTPS port",status:(s==null?void 0:s.https)||!0,suggestedPort:443,onChange(y){return y>=0&&!h&&!d.cert&&g0e(),y}},kt(Ce({k:"max_kbps"},p),{label:"Limit output KB/s",helperText:"Doesn't apply to localhost"}),kt(Ce({k:"max_kbps_per_ip"},p),{label:"Limit output KB/s per-ip"}),h&&d.port>=0&&{k:"force_https",comp:Eo,sm:12,md:4,label:"Force HTTPS",helperText:"Not applied to localhost"},h&&{k:"cert",comp:_f,md:4,label:"HTTPS certificate file",helperText:Ya("HTTPS#certificate","What is this?"),error:Tw(s==null?void 0:s.https.error,y=>KE(y)&&[y," - ",u.createElement(Mo,{key:"fix",sx:{cursor:"pointer"},onClick:YE},"make one")])},h&&Ce({k:"private_key",comp:_f,md:4,label:"HTTPS private key file"},Tw(s==null?void 0:s.https.error,y=>qE(y)?{error:!0,helperText:y}:null)),{k:"open_browser_at_start",comp:Eo,label:"Open Admin-panel at start",md:4,helperText:"Browser is automatically launched with HFS"},{k:"localhost_admin",comp:Eo,label:"Unprotected admin on localhost",md:4,getError:y=>!y&&(c==null?void 0:c.length)===0&&"First create at least one admin account",helperText:"Access Admin-panel without entering credentials"},{k:"file_menu_on_link",comp:gs,label:"Access file menu",sm:12,md:4,options:{"by clicking on file name":!0,"by dedicated button":!1}},{k:"title",helperText:"You can see this in the tab of your browser"},{k:"favicon",comp:_f,placeholder:"None",fileMask:"*.png|*.ico|*.jpg|*.jpeg|*.gif|*.svg",helperText:"The icon associated to your website"},{k:"log",label:Hg.log,md:3,helperText:"Requests are logged here"},{k:"error_log",label:Hg.error_log,md:3,placeholder:"errors go to main log",helperText:"If you want errors in a different log"},{k:"log_rotation",comp:gs,md:3,options:[{value:"",label:"disabled"},"daily","weekly","monthly"],helperText:"To keep log-files smaller"},{k:"dont_log_net",comp:uM,label:"Don't log address",md:3,placeholder:"no exception",helperText:u.createElement(Bm)},{k:"log_gui",comp:Eo,label:"Log interface loading"},{k:"log_api",comp:Eo,label:"Log API requests"},{k:"proxies",comp:Zi,min:0,max:9,sm:6,label:"How many HTTP proxies between this server and users?",error:rC(d,s),helperText:"Wrong number will prevent detection of users' IP address"},{k:"allowed_referer",placeholder:"any",label:"Links from other websites",comp:m0e},{k:"dont_overwrite_uploading",comp:Eo,label:"Don't overwrite uploading",helperText:"Files will be numbered to avoid overwriting"},{k:"delete_unfinished_uploads_after",comp:Zi,md:3,min:0,unit:"seconds",placeholder:"Never",helperText:"Leave empty to never delete"},{k:"min_available_mb",comp:Zi,md:3,min:0,unit:"MBytes",placeholder:"None",label:"Min. available disk space",helperText:"Reject uploads that don't comply"},{k:"keep_session_alive",comp:Eo,helperText:"Keeps you logged in while the page is left open and the computer is on"},{k:"session_duration",comp:Zi,sm:3,min:5,unit:"seconds",required:!0},{k:"zip_calculate_size_for_seconds",comp:Zi,sm:3,label:"Calculate ZIP size for",unit:"seconds",helperText:"If time is not enough, the browser will not show download percentage"},{k:"update_to_beta",comp:Eo,helperText:"Include betas in automatic updates"},{k:"admin_net",comp:uM,label:"Admin-panel accessible from",placeholder:"any address",helperText:u.createElement(u.Fragment,{},"IP address of browser machine. ",u.createElement(Bm))},{k:"mime",comp:nle,keyLabel:"Files",keyWidth:7,valueLabel:"Mime type",valueWidth:4},{k:"block",label:"Blocked IPs",multiline:!0,minRows:3,helperText:u.createElement(u.Fragment,{},"Enter an IP address for each line. ",u.createElement(Bm)),fromField:y=>y.split(`
|
|
481
|
+
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=cm(t),r=Ac(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r}]}}case"map-value-ind":{this.onKeyLine=!0;const n=cm(t),r=Ac(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function ON(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new MN||null,prettyErrors:t}}function Iye(e,t={}){const{lineCounter:n,prettyErrors:r}=ON(t),o=new BE(n==null?void 0:n.addNewLine),i=new DE(t),s=Array.from(i.compose(o.parse(e)));if(r&&n)for(const a of s)a.errors.forEach(zg(e,n)),a.warnings.forEach(zg(e,n));return s.length>0?s:Object.assign([],{empty:!0},i.streamInfo())}function LN(e,t={}){const{lineCounter:n,prettyErrors:r}=ON(t),o=new BE(n==null?void 0:n.addNewLine),i=new DE(t);let s=null;for(const a of i.compose(o.parse(e),!0,e.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new ka(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(s.errors.forEach(zg(e,n)),s.warnings.forEach(zg(e,n))),s}function kye(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);const o=LN(e,n);if(!o)return null;if(o.warnings.forEach(i=>tN(o.options.logLevel,i)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:r},n))}function _ye(e,t,n){var o;let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(e===void 0){const{keepUndefined:i}=(o=n!=null?n:t)!=null?o:{};if(!i)return}return new hd(e,r,n).toString(n)}const tM=Object.freeze(Object.defineProperty({__proto__:null,Alias:Py,CST:Sye,Composer:DE,Document:hd,Lexer:RN,LineCounter:MN,Pair:Lr,Parser:BE,Scalar:Rt,Schema:Fy,YAMLError:AE,YAMLMap:_o,YAMLParseError:ka,YAMLSeq:Zl,YAMLWarning:bN,isAlias:cc,isCollection:Dn,isDocument:cd,isMap:ud,isNode:Qn,isPair:Tn,isScalar:yn,isSeq:dd,parse:kye,parseAllDocuments:Iye,parseDocument:LN,stringify:_ye,visit:Jl,visitAsync:Ey},Symbol.toStringTag,{value:"Module"}));var zE={},$ye=ut;Object.defineProperty(zE,"__esModule",{value:!0});var FN=zE.default=void 0,Rye=$ye(dt()),Mye=at(),Tye=(0,Rye.default)((0,Mye.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}),"ContentCopy");FN=zE.default=Tye;var jE={},Oye=ut;Object.defineProperty(jE,"__esModule",{value:!0});var HE=jE.default=void 0,Lye=Oye(dt()),Fye=at(),Aye=(0,Lye.default)((0,Fye.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Edit");HE=jE.default=Aye;const Nye="https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept";function Dye({file:e,anyMask:t,defaultPerms:n,addToBar:r,statusApi:o}){var L;const F=e,{parent:i,children:s,isRoot:a,byMasks:c}=F,d=Yt(F,["parent","children","isRoot","byMasks"]),[p,h]=u.useState(d);u.useEffect(()=>{h(Object.assign(yS(n,()=>null),d))},[e]);const{source:m}=e,g=e.type==="folder",y=m!==void 0,v=y&&g,S=u.useMemo(()=>{const B={};let R=i;for(;R;)St.defaults(B,R,R.byMasks),R=R.parent;return St.defaults(B,n)},[i]),w=y&&!!p.ctime,C=y&&!v,x=e.accept>""||g&&((L=e.can_upload)!=null?L:S.can_upload),P=IS(),{data:_,element:I}=Lo("get_accounts");if(I||!_)return I;const k=_.list,M=!y&&"Works only on folders with source! ";return u.createElement(Mp,{values:p,set(B,R){R!=="link"&&h(A=>{var N;const V=R==="source"&&((N=A.source)==null?void 0:N.endsWith(A.name))?cse(B):A.name;return kt(Ce({},A),{name:V,[R]:B})})},barSx:Ce({gap:2,width:"100%"},P),stickyBar:!0,addToBar:[!a&&u.createElement(zn,{icon:bs,title:"Delete",confirm:"Delete?",onClick:()=>Et("del_vfs",{uris:[e.id]}).then(()=>ec())}),r],onError:un,save:{sx:fy(!kS(p,d)),onClick(){return mt(this,null,function*(){const B=St.omit(p,["ctime","mtime","size","id"]);B.masks||(B.masks=null),yield Et("set_vfs",{uri:p.id,props:B}),B.name!==e.name&&(pn.selectedFiles[0].id=e.parent.id+B.name+(g?"/":"")),ec()})}},fields:[a?u.createElement(Uo,{severity:"info"},"This is Home, the root of your shared files. Options set here will be applied to all files."):{k:"name",required:!0,helperText:y&&"You can decide a name that's different from the one on your disk"},{k:"id",comp:Bye,statusApi:o},{k:"source",label:"Source on disk",comp:_f,files:!g,folders:g,multiline:!0,placeholder:"Not on disk, this is a virtual folder"},O("can_read","Who can see but not download will be asked to login"),O("can_see","If you can't see, you may still download with a direct link"),g&&O("can_list","Permission to see content of folders",{contentText:"subfolders"}),g&&O("can_delete",[M,"Those who can delete can also rename"]),g&&O("can_upload",M,{lg:x?6:12,contentText:"subfolders"}),x&&{k:"accept",label:"Accept on upload",placeholder:"anything",lg:6,helperText:u.createElement(Mo,{href:Nye,target:"_blank"},"Example: .zip")},C&&{k:"size",comp:Rm,lg:4,toField:ql},w&&{k:"ctime",comp:Rm,md:6,lg:C&&4,label:"Created",toField:nM},w&&{k:"mtime",comp:Rm,md:6,lg:C&&4,label:"Modified",toField:nM},e.website&&{k:"default",comp:Eo,label:"Serve index.html",toField:Boolean,fromField:B=>B?"index.html":null,helperText:ts("This folder may be a website because contains `index.html`. Enabling this will show the website instead of the list of files.")},g&&{k:"masks",multiline:!0,lg:!0,toField:tM.stringify,fromField:B=>B?tM.parse(B):void 0,sx:{"& textarea":{fontFamily:"monospace"}},helperText:["Special field, leave empty unless you know what you are doing. YAML syntax. ",Ya("Permissions","(examples)")]}]});function O(B,R,A={}){return Ce({showInherited:t,otherPerms:St.without(Object.keys(n),B).map(z=>({value:z,label:"As "+tC(z)})),k:B,lg:6,comp:AN,parent:i,accounts:k,helperText:R,label:"Who can "+tC(B),inherit:S[B],byMasks:c==null?void 0:c[B],isDir:g},A)}}function tC(e){const t=e.split("_")[1];return t==="read"?"download":t}function nM(e){return e?new Date(e).toLocaleString():"-"}function AN(g){var y=g,{value:e,onChange:t,parent:n,inherit:r,accounts:o,helperText:i,showInherited:s,otherPerms:a,byMasks:c,isChildren:d,isDir:p,contentText:h="folder content"}=y,m=Yt(y,["value","onChange","parent","inherit","accounts","helperText","showInherited","otherPerms","byMasks","isChildren","isDir","contentText"]);const v=(c!==void 0?"As per mask: ":n!==void 0?"As parent: ":"Default: ")+rM(c!=null?c:r),S=e!=null&&typeof e=="object"&&!Array.isArray(e),w=S&&e.children,C=S?e.this:e,x=u.useMemo(()=>rd([{value:null,label:v},{value:!0},{value:!1},{value:"*"},...a,{value:[],label:"Select accounts"}].map(I=>(I.value===C||s||I.value!==r)&&Ce({label:St.capitalize(rM(I.value))},I))),[r,n,C]),P=500,_=Array.isArray(C);return u.createElement(je,{sx:{borderRight:S?"8px solid #8884":void 0,transition:`all ${P}ms`}},u.createElement(gs,kt(Ce({},m),{value:_?[]:C,onChange(I,{event:k}){t(S?{this:I,children:w}:I,{was:e,event:k})},options:x})),u.createElement(yg,{in:_,timeout:P},_&&u.createElement(SS,{label:o!=null&&o.length?"Choose accounts for "+m.label:"You didn't create any account yet",value:C,onChange:t,options:(o==null?void 0:o.map(I=>({value:I.username,label:I.username})))||[]})),u.createElement(_p,{},i,!d&&p&&u.createElement(Mo,{sx:{display:"block",cursor:"pointer",mt:-.5},onClick(I){C!==void 0&&t(S?C:{this:e},{was:e,event:I})}},S?"Different permission for ":"Same permission for ",h)),!d&&u.createElement(yg,{in:S,timeout:P},u.createElement(AN,{label:"Permission for "+h,parent:n,inherit:r,accounts:o,showInherited:s,otherPerms:a,isDir:p,isChildren:!0,value:w!=null?w:null,onChange(I,{event:k}){t({this:C,children:I},{was:e,event:k})}})))}function rM(e){return e===!1?"no one":e===!0?"anyone":e==="*"?"any account (login required)":Array.isArray(e)?e.join(", "):typeof e=="string"?"as "+tC(e):"*UNKNOWN*"+JSON.stringify(e)}function Bye({value:e,statusApi:t}){const{data:n,reload:r,error:o}=t,i=n==null?void 0:n.suggestedUrls,s=n==null?void 0:n.baseUrl,a=(s||(i==null?void 0:i[0])||"")+e;return u.createElement(je,{display:"flex"},i?u.createElement(Rm,{label:"Link",value:a,error:o,end:u.createElement(je,{},u.createElement(zn,{icon:FN,title:"Copy",onClick:()=>navigator.clipboard.writeText(a)}),u.createElement(zn,{icon:HE,title:"Change",onClick:c}))}):"error");function c(){const{close:d}=Wo({title:"Change link",Content(){const[p,h]=u.useState(s||""),m=new URL(p||i[0]).protocol+"//",g=i.includes(p)?"":p.slice(m.length);return u.createElement(je,{display:"flex",flexDirection:"column"},u.createElement(je,{mb:2},"You can choose a different base address for your links"),u.createElement(Zv,{},i.map(S=>u.createElement(fo,{key:S,selected:S===p,onClick:()=>y(S)},S,S===p&&u.createElement(sS,{sx:{ml:2}})))),u.createElement(io,{label:"Custom IP or domain",helperText:ts(`You can type any address but *you* are responsible to make the address work.
|
|
482
|
+
This functionality is just to help you copy the link in case you have a domain or a complex network configuration.`),value:g,onChange:S=>y(vu(m,S)),start:u.createElement(gs,{value:m,onChange:S=>g?y(S+g):Wr("Enter domain first"),options:["http://","https://"],size:"small",variant:"standard",sx:{"& .MuiSelect-select":{pt:"1px",pb:0}}}),sx:{mt:2}}),u.createElement(je,{mt:2,textAlign:"right"},u.createElement(yu,{icon:uy,children:"Save",onClick(){return mt(this,null,function*(){p!==s&&(yield Et("set_config",{values:{base_url:p}}),yield r()),d()})}})));function y(S){S.endsWith("/")&&(S=S.slice(0,-1)),h(S)}}})}}let nC;function zye(){var S,w,C;const[e]=u.useState(()=>new Map),{vfs:t,selectedFiles:n}=oa(),{data:r,reload:o,element:i}=Lo("get_vfs");u.useMemo(()=>t||o(),[t,o]);const s=u.useMemo(()=>function x(P){var _;return!St.isEmpty(P==null?void 0:P.masks)||((_=P==null?void 0:P.children)==null?void 0:_.some(x))}(t),[t]),a="md",c=Yl(a),d=Lo("get_status"),{data:p}=d,h=u.useMemo(()=>{const x=p==null?void 0:p.baseUrl,P=St.sortBy((p==null?void 0:p.urls.https)||(p==null?void 0:p.urls.http),_=>_.includes("[")&&_!==x);return p&&(p.suggestedUrls=P),x&&!P.includes(x)?[x,...P]:P},[p]);function m(){pn.selectedFiles=[]}const g=n.length?n.length===1?u.createElement(Dye,{addToBar:c&&u.createElement(zn,{icon:Rp,title:"Close",onClick:m}),defaultPerms:r==null?void 0:r.defaultPerms,anyMask:s,statusApi:d,file:n[0]}):u.createElement(u.Fragment,{},u.createElement(Ql,{alignItems:"center"},u.createElement(Tr,{variant:"h6"},n.length+" selected"),u.createElement(mr,{onClick:jye,startIcon:u.createElement(bs)},"Remove")),u.createElement(Jv,{dense:!0,disablePadding:!0},n.map(x=>u.createElement(mF,{key:x.id},u.createElement(cs,{primary:x.name,secondary:x.source}))))):null;if(u.useEffect(()=>{if(c||!g)return;const{close:x}=Wo({title:n.length>1?"Multiple selection":n[0].name,Content:()=>g,onClose:m});return x},[c,n]),u.useEffect(()=>{if(pn.vfs=void 0,!r)return;e.clear();const{root:x}=r;if(!x)return;x.isRoot=!0,_(x),pn.vfs=x;const P=nC||pn.selectedFiles.map(I=>I.id);nC=void 0,pn.selectedFiles=rd(P.map(I=>e.get(I)));function _(I,k="/",M=void 0){if(I.parent=M,I.id=I.isRoot?"/":vu(k,encodeURIComponent(I.name),I.type==="folder"?"/":""),e.set(I.id,I),!!I.children)for(const O of I.children)_(O,I.id,I)}},[r,e]),i)return e.clear(),i;const v=!((w=(S=r==null?void 0:r.root)==null?void 0:S.children)!=null&&w.length)&&!((C=r==null?void 0:r.root)!=null&&C.source)?{severity:"warning",children:"Add something to your shared files — click Add"}:h&&{severity:"info",children:["Your shared files can be browsed from ",wie(" or ",h.slice(0,3).map(x=>u.createElement(Mo,{href:x},x)))]};return u.createElement(Jn,{container:!0,rowSpacing:1,maxWidth:"80em",columnSpacing:2},v&&u.createElement(Jn,{item:!0,mb:2,xs:12},u.createElement(Uo,v)),u.createElement(Jn,{item:!0,[a]:6,lg:5},u.createElement(Tr,{variant:"h6",mb:1},"Virtual File System"),u.createElement(yve),t&&u.createElement(Hye,{id2node:e})),c&&g&&u.createElement(Jn,{item:!0,[a]:6,lg:7,maxWidth:"100%"},u.createElement(Bx,{},u.createElement(zx,{},g))))}function ec(e){nC=e,pn.vfs=void 0}function jye(){return mt(this,null,function*(){const e=pn.selectedFiles;if(e.length&&(yield qs(`Delete ${e.length} item(s)?`)))try{const t=e.map(o=>o.id);St.pull(t,"/");const{errors:n}=yield Et("del_vfs",{uris:t}),r=t.filter((o,i)=>n[i]);if(r.length)return un("Following elements couldn't be deleted: "+r.join(", "),"error");ec()}catch(t){yield un(t)}})}const NN=L4,DN=A4;function Hye({id2node:e}){const{vfs:t,selectedFiles:n}=oa(),[r,o]=u.useState(n.map(m=>m.id)),[i,s]=u.useState(Array.from(e.keys())),a=u.useRef(),c=u.useRef();if(!t)return null;const d="vfs";return u.createElement(rA,{ref:c,expanded:i,selected:r,multiSelect:!0,id:d,sx:{overflowX:"auto",maxWidth:c.current&&`calc(100vw - ${16+c.current.offsetLeft}px)`,"& ul":{borderLeft:"1px dashed #444",marginLeft:"15px"}},onNodeSelect(m,g){o(g),pn.selectedFiles=rd(g.map(y=>e.get(y)))}},h(t));function p(m){return m!==void 0&&m!==!0}function h(m){var C,x;let{id:g,name:y,isRoot:v}=m;if(!g)debugger;const S=m.type==="folder";return u.createElement(Ow,{ref(P){P==null||P.addEventListener("focusin",_=>_.stopImmediatePropagation())},label:u.createElement(je,{draggable:!v,onDragStart(){a.current=g},onDragOver(P){if(!S)return;const _=a.current;_!=null&&_.startsWith(g)&&!_.slice(g.length+1).includes("/")||P.preventDefault()},onDrop(){return mt(this,null,function*(){const P=a.current;P&&(yield qs(`Moving ${P} under ${g}`))&&Et("move_vfs",{from:P,parent:g}).then(()=>{ec([g+P.slice(1+P.lastIndexOf("/",P.length-2))])},un)})},sx:{display:"flex",gap:".5em",lineHeight:"2em",alignItems:"center"}},u.createElement(je,{display:"flex",flex:0},v?xo(F4,"home, or root if you like"):S?xo(NN,"Folder"):xo(DN,"File"),u.createElement(je,{sx:{flex:0,ml:"2px",my:"2px","&>*":{fontSize:"87%",opacity:.6,mt:"-2px"},display:"grid",gridAutoFlow:"column",gridTemplateRows:"auto auto"}},m.can_delete!==void 0&&xo(bs,"Delete permission"),m.can_upload!==void 0&&xo(Tp,"Upload permission"),!v&&!m.source&&xo(B4,"Virtual (no source)"),p(m.can_see)&&xo(N4,"Restrictions on who can see"),p(m.can_read)&&xo(jS,"Restrictions on who can download"),m.default&&xo(D4,"Act as website"),m.masks&&xo(O4,"Masks"),m.size===-1&&xo(z4,"Source not found"))),v?"Home":(()=>{var k;const P=(k=m.parent)==null?void 0:k.source,{source:_}=m,I=P&&(_!=null&&_.startsWith(P))?"."+_.slice(P.length):_;return!I||!(_!=null&&_.endsWith(y))||I.length>45?u.createElement(je,{lineHeight:"1.2em"},y):u.createElement("span",{},u.createElement("span",{style:{opacity:.4}},I.slice(0,-y.length)),I.slice(-y.length))})()),key:y,collapseIcon:u.createElement(T4,{onClick(P){s(i.filter(_=>_!==g)),P.preventDefault(),P.stopPropagation()}}),expandIcon:u.createElement(M4,{onClick(P){s([...i,g]),P.preventDefault(),P.stopPropagation()}}),nodeId:g},v&&!((C=m.children)!=null&&C.length)?u.createElement(Ow,{nodeId:"?",label:u.createElement("i",{},"nothing here")}):(x=m.children)==null?void 0:x.map(h))}}var oM=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Vye(e,t){return!!(e===t||oM(e)&&oM(t))}function Uye(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Vye(e[n],t[n]))return!1;return!0}function lb(e,t){t===void 0&&(t=Uye);var n,r=[],o,i=!1;function s(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return i&&n===this&&t(a,r)||(o=e.apply(this,a),i=!0,n=this,r=a),o}return s}var Wye=typeof performance=="object"&&typeof performance.now=="function",iM=Wye?function(){return performance.now()}:function(){return Date.now()};function sM(e){cancelAnimationFrame(e.id)}function Gye(e,t){var n=iM();function r(){iM()-n>=t?e.call(null):o.id=requestAnimationFrame(r)}var o={id:requestAnimationFrame(r)};return o}var ab=-1;function lM(e){if(e===void 0&&(e=!1),ab===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),ab=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return ab}var Nc=null;function aM(e){if(e===void 0&&(e=!1),Nc===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?Nc="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Nc="negative":Nc="positive-ascending"),document.body.removeChild(t),Nc}return Nc}var Kye=150,qye=function(t,n){return t};function Yye(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,o=e.getItemSize,i=e.getOffsetForIndexAndAlignment,s=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,c=e.initInstanceProps,d=e.shouldResetStyleCacheOnItemSizeChange,p=e.validateProps;return t=function(h){Tx(m,h);function m(y){var v;return v=h.call(this,y)||this,v._instanceProps=c(v.props,yw(v)),v._outerRef=void 0,v._resetIsScrollingTimeoutId=null,v.state={instance:yw(v),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof v.props.initialScrollOffset=="number"?v.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},v._callOnItemsRendered=void 0,v._callOnItemsRendered=lb(function(S,w,C,x){return v.props.onItemsRendered({overscanStartIndex:S,overscanStopIndex:w,visibleStartIndex:C,visibleStopIndex:x})}),v._callOnScroll=void 0,v._callOnScroll=lb(function(S,w,C){return v.props.onScroll({scrollDirection:S,scrollOffset:w,scrollUpdateWasRequested:C})}),v._getItemStyle=void 0,v._getItemStyle=function(S){var w=v.props,C=w.direction,x=w.itemSize,P=w.layout,_=v._getItemStyleCache(d&&x,d&&P,d&&C),I;if(_.hasOwnProperty(S))I=_[S];else{var k=n(v.props,S,v._instanceProps),M=o(v.props,S,v._instanceProps),O=C==="horizontal"||P==="horizontal",F=C==="rtl",L=O?k:0;_[S]=I={position:"absolute",left:F?void 0:L,right:F?L:void 0,top:O?0:k,height:O?"100%":M,width:O?M:"100%"}}return I},v._getItemStyleCache=void 0,v._getItemStyleCache=lb(function(S,w,C){return{}}),v._onScrollHorizontal=function(S){var w=S.currentTarget,C=w.clientWidth,x=w.scrollLeft,P=w.scrollWidth;v.setState(function(_){if(_.scrollOffset===x)return null;var I=v.props.direction,k=x;if(I==="rtl")switch(aM()){case"negative":k=-x;break;case"positive-descending":k=P-C-x;break}return k=Math.max(0,Math.min(k,P-C)),{isScrolling:!0,scrollDirection:_.scrollOffset<x?"forward":"backward",scrollOffset:k,scrollUpdateWasRequested:!1}},v._resetIsScrollingDebounced)},v._onScrollVertical=function(S){var w=S.currentTarget,C=w.clientHeight,x=w.scrollHeight,P=w.scrollTop;v.setState(function(_){if(_.scrollOffset===P)return null;var I=Math.max(0,Math.min(P,x-C));return{isScrolling:!0,scrollDirection:_.scrollOffset<I?"forward":"backward",scrollOffset:I,scrollUpdateWasRequested:!1}},v._resetIsScrollingDebounced)},v._outerRefSetter=function(S){var w=v.props.outerRef;v._outerRef=S,typeof w=="function"?w(S):w!=null&&typeof w=="object"&&w.hasOwnProperty("current")&&(w.current=S)},v._resetIsScrollingDebounced=function(){v._resetIsScrollingTimeoutId!==null&&sM(v._resetIsScrollingTimeoutId),v._resetIsScrollingTimeoutId=Gye(v._resetIsScrolling,Kye)},v._resetIsScrolling=function(){v._resetIsScrollingTimeoutId=null,v.setState({isScrolling:!1},function(){v._getItemStyleCache(-1,null)})},v}m.getDerivedStateFromProps=function(v,S){return Qye(v,S),p(v),null};var g=m.prototype;return g.scrollTo=function(v){v=Math.max(0,v),this.setState(function(S){return S.scrollOffset===v?null:{scrollDirection:S.scrollOffset<v?"forward":"backward",scrollOffset:v,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(v,S){S===void 0&&(S="auto");var w=this.props,C=w.itemCount,x=w.layout,P=this.state.scrollOffset;v=Math.max(0,Math.min(v,C-1));var _=0;if(this._outerRef){var I=this._outerRef;x==="vertical"?_=I.scrollWidth>I.clientWidth?lM():0:_=I.scrollHeight>I.clientHeight?lM():0}this.scrollTo(i(this.props,v,S,P,this._instanceProps,_))},g.componentDidMount=function(){var v=this.props,S=v.direction,w=v.initialScrollOffset,C=v.layout;if(typeof w=="number"&&this._outerRef!=null){var x=this._outerRef;S==="horizontal"||C==="horizontal"?x.scrollLeft=w:x.scrollTop=w}this._callPropsCallbacks()},g.componentDidUpdate=function(){var v=this.props,S=v.direction,w=v.layout,C=this.state,x=C.scrollOffset,P=C.scrollUpdateWasRequested;if(P&&this._outerRef!=null){var _=this._outerRef;if(S==="horizontal"||w==="horizontal")if(S==="rtl")switch(aM()){case"negative":_.scrollLeft=-x;break;case"positive-ascending":_.scrollLeft=x;break;default:var I=_.clientWidth,k=_.scrollWidth;_.scrollLeft=k-I-x;break}else _.scrollLeft=x;else _.scrollTop=x}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&sM(this._resetIsScrollingTimeoutId)},g.render=function(){var v=this.props,S=v.children,w=v.className,C=v.direction,x=v.height,P=v.innerRef,_=v.innerElementType,I=v.innerTagName,k=v.itemCount,M=v.itemData,O=v.itemKey,F=O===void 0?qye:O,L=v.layout,D=v.outerElementType,B=v.outerTagName,R=v.style,A=v.useIsScrolling,z=v.width,V=this.state.isScrolling,N=C==="horizontal"||L==="horizontal",H=N?this._onScrollHorizontal:this._onScrollVertical,W=this._getRangeToRender(),K=W[0],Y=W[1],ie=[];if(k>0)for(var re=K;re<=Y;re++)ie.push(u.createElement(S,{data:M,key:F(re,M),index:re,isScrolling:A?V:void 0,style:this._getItemStyle(re)}));var de=r(this.props,this._instanceProps);return u.createElement(D||B||"div",{className:w,onScroll:H,ref:this._outerRefSetter,style:E({position:"relative",height:x,width:z,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:C},R)},u.createElement(_||I||"div",{children:ie,ref:P,style:{height:N?"100%":de,pointerEvents:V?"none":void 0,width:N?de:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var v=this.props.itemCount;if(v>0){var S=this._getRangeToRender(),w=S[0],C=S[1],x=S[2],P=S[3];this._callOnItemsRendered(w,C,x,P)}}if(typeof this.props.onScroll=="function"){var _=this.state,I=_.scrollDirection,k=_.scrollOffset,M=_.scrollUpdateWasRequested;this._callOnScroll(I,k,M)}},g._getRangeToRender=function(){var v=this.props,S=v.itemCount,w=v.overscanCount,C=this.state,x=C.isScrolling,P=C.scrollDirection,_=C.scrollOffset;if(S===0)return[0,0,0,0];var I=s(this.props,_,this._instanceProps),k=a(this.props,I,_,this._instanceProps),M=!x||P==="backward"?Math.max(1,w):1,O=!x||P==="forward"?Math.max(1,w):1;return[Math.max(0,I-M),Math.max(0,Math.min(S-1,k+O)),I,k]},m}(u.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Qye=function(t,n){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,n.instance},Xye=Yye({getItemOffset:function(t,n){var r=t.itemSize;return n*r},getItemSize:function(t,n){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var n=t.itemCount,r=t.itemSize;return r*n},getOffsetForIndexAndAlignment:function(t,n,r,o,i,s){var a=t.direction,c=t.height,d=t.itemCount,p=t.itemSize,h=t.layout,m=t.width,g=a==="horizontal"||h==="horizontal",y=g?m:c,v=Math.max(0,d*p-y),S=Math.min(v,n*p),w=Math.max(0,n*p-y+p+s);switch(r==="smart"&&(o>=w-y&&o<=S+y?r="auto":r="center"),r){case"start":return S;case"end":return w;case"center":{var C=Math.round(w+(S-w)/2);return C<Math.ceil(y/2)?0:C>v+Math.floor(y/2)?v:C}case"auto":default:return o>=w&&o<=S?o:o<w?w:S}},getStartIndexForOffset:function(t,n){var r=t.itemCount,o=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(n/o)))},getStopIndexForStartIndex:function(t,n,r){var o=t.direction,i=t.height,s=t.itemCount,a=t.itemSize,c=t.layout,d=t.width,p=o==="horizontal"||c==="horizontal",h=n*a,m=p?d:i,g=Math.ceil((m+r-h)/a);return Math.max(0,Math.min(s-1,n+g-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function BN({onSelect:e,multiple:t=!0,files:n=!0,folders:r=!0,fileMask:o,from:i=""}){const[s,a]=u.useState(i),[c,d]=u.useState(!1),p=u.useRef(!1);u.useEffect(()=>{Et("resolve_path",{path:i,closestFolder:!0}).then(D=>{typeof D.path=="string"&&(a(D.path),p.current=D.path[1]===":")}).finally(()=>d(!0))},[i]);const{list:h,error:m,connecting:g}=sc(c&&"ls",{path:s,files:n,fileMask:o});u.useEffect(()=>{v([]),w("")},[s]);const[y,v]=u.useState([]),[S,w]=u.useState(""),C=u.useMemo(()=>St.debounce(D=>w(D)),[]),x=u.useMemo(()=>{const D=new RegExp(St.escapeRegExp(S),"i");return B=>D.test(B)},[S]),[P,_]=u.useState(0),I=u.useMemo(()=>h.filter(D=>x(D.n)),[h,x]),k=p.current?"":"/",M=p.current?"\\":"/",O=rse(M,s),F=s.length<2;return u.createElement(u.Fragment,{},u.createElement(je,{display:"flex",gap:1},u.createElement(mr,{title:"root",disabled:F,onClick(){a(k)}},u.createElement(R4)),u.createElement(mr,{disabled:F,title:"parent folder",onClick(){const D=/[\\/]$/.test(s)?s.slice(0,-1):s,B=ale(D)?k:D.slice(0,D.lastIndexOf(M)||1);a(B)}},u.createElement($4)),u.createElement(io,{label:"Current path",value:s,InputLabelProps:{shrink:!0},onChange(D){return mt(this,null,function*(){if(!D)return a(k);const B=yield Et("resolve_path",{path:D});a(B.path)})}})),m?u.createElement(Uo,{severity:"error"},cA(m)):u.createElement(u.Fragment,{},u.createElement(je,{ref(D){if(!D)return;const B=(D==null?void 0:D.clientHeight)-1;B-P>1&&_(B)},sx:{flex:1,display:"flex",flexDirection:"column"}},h.length?u.createElement(Xye,{width:"100%",height:P,itemSize:46,itemCount:I.length,overscanCount:5,children({index:D,style:B}){const R=I[D],A=R.k==="d";return u.createElement(fo,{style:kt(Ce({},B),{padding:0}),key:R.n,onClick(){A?a(O+R.n):e([O+R.n])}},t&&u.createElement(QL,{checked:y.includes(R.n),disabled:!r&&A,onClick(z){const V=R.n,N=y.filter(H=>H!==V);v(N.length<y.length?N:[...y,V]),z.stopPropagation()}}),u.createElement(Bl,{},u.createElement(R.k?NN:DN)),u.createElement(cs,{sx:{whiteSpace:"pre-wrap",wordBreak:"break-all"}},R.n),!A&&R.s!==void 0&&u.createElement(Tr,{variant:"body2",color:"text.secondary",ml:4,mr:1},ql(R.s)))}}):u.createElement(py,{flex:1,mt:"4em"},g?aA():"No elements in this folder")),u.createElement(je,{display:"flex",gap:1},(t||r||!n)&&u.createElement(mr,{variant:"contained",disabled:!s||!r&&!y.length&&n,sx:{minWidth:"max-content"},onClick(){e(y.length?y.map(D=>O+D):[s])}},n&&(y.length||!r)?`Select (${y.length})`:"Select this folder"),u.createElement($p,{value:S,label:`Filter results (${I.length}${I.length<h.length?"/"+h.length:""})`,onChange(D){C(D.target.value)},sx:{flex:1}}))))}function _f(c){var d=c,{value:e,onChange:t,files:n=!0,folders:r=!1,fileMask:o,defaultPath:i,title:s}=d,a=Yt(d,["value","onChange","files","folders","fileMask","defaultPath","title"]);const p=Yl("md");return u.createElement(io,kt(Ce({},a),{value:e,onChange:t,InputProps:{endAdornment:u.createElement(qa,{position:"end"},u.createElement(zn,{icon:_4,title:"Browse files...",edge:"end",onClick(){const{close:h}=Wo({title:s!=null?s:n?"Pick a file":"Pick a folder",dialogProps:{fullScreen:!p,sx:{minWidth:"min(90vw, 40em)",minHeight:"calc(100vh - 9em)"}},Content(){return u.createElement(BN,{multiple:!1,folders:r,files:n,fileMask:o,from:e||i,onSelect(g){return mt(this,null,function*(){var S;let y=g==null?void 0:g[0];if(!y)return;const v=(S=yield Et("get_cwd"))==null?void 0:S.path;y.startsWith(v)&&(y=y.slice(v.length+1)||"."),t(y,{was:e,event:"picker"}),h()})}})}})}}))}}))}var VE={},Jye=ut;Object.defineProperty(VE,"__esModule",{value:!0});var Dm=VE.default=void 0,Zye=Jye(dt()),e0e=at(),t0e=(0,Zye.default)((0,e0e.jsx)("path",{d:"M22 13v3c0 1.1-.9 2-2 2h-3l1 1v2H6v-2l1-1H4c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h8v2H4v11h16v-3h2zm-7 2-5-5h4V3h2v7h4l-5 5z"}),"BrowserUpdated");Dm=VE.default=t0e;var UE={},n0e=ut;Object.defineProperty(UE,"__esModule",{value:!0});var zN=UE.default=void 0,r0e=n0e(dt()),o0e=at(),i0e=(0,r0e.default)((0,o0e.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 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");zN=UE.default=i0e;var WE={},s0e=ut;Object.defineProperty(WE,"__esModule",{value:!0});var jN=WE.default=void 0,l0e=s0e(dt()),a0e=at(),c0e=(0,l0e.default)((0,a0e.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"Launch");jN=WE.default=c0e;var GE={},u0e=ut;Object.defineProperty(GE,"__esModule",{value:!0});var HN=GE.default=void 0,d0e=u0e(dt()),f0e=at(),p0e=(0,d0e.default)((0,f0e.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"OpenInNew");HN=GE.default=p0e;function h0e(){var _,I,k;const e=" — ",{username:t}=oa(),{data:n,reload:r,element:o}=Lo("get_status"),{data:i}=Lo("get_vfs"),[s]=ry(t&&"get_account"),{data:a,reload:c}=Lo("get_config",{only:["https_port","cert","private_key","proxies","update_to_beta"]}),{list:d}=sc("get_plugins"),[p,h]=u.useState();if(o||!n)return o;const{http:m,https:g}=n,y=!(m!=null&&m.listening)&&(g!=null&&g.listening)?"s":"",v=y?g:(m==null?void 0:m.listening)&&m,S=v&&`http${y}://`+window.location.hostname+(v.port===(y?443:80)?"":":"+v.port),w=St.pick(n,["http","https"]),C=yS(w,O=>O.busy?[`port ${O.port} already used by ${O.busy}${e}choose a `,um("different port"),` or stop ${O.busy}`]:O.error),x=C&&rd(Object.entries(C).map(([O,F])=>F&&[ts(`Protocol _${O}_ cannot work: `),F,(KE(F)||qE(F))&&[e,u.createElement(Mo,{sx:{cursor:"pointer"},onClick(){YE().then(c).then(r)}},"make one")," or ",e,um("provide adequate files")]]));return u.createElement(je,{display:"flex",gap:2,flexDirection:"column",alignItems:"flex-start",height:"100%"},t&&Jr("","Welcome "+t),x.length?np(x.map(O=>Jr("error",np(O)))):Jr("success","Server is working"),i?!((I=(_=i.root)==null?void 0:_.children)!=null&&I.length)&&!((k=i.root)!=null&&k.source)?Jr("warning","You have no files shared",e,m0e("add some")):Jr("",ts("This is Admin-panel, where you manage your server. Access your files on "),u.createElement(Mo,{target:"frontend",href:"../.."},"Front-end",u.createElement(jN,{sx:{verticalAlign:"sub",ml:".2em"}}))):u.createElement(fF),!S&&Jr("warning","Frontend unreachable: ",St.map(C,(O,F)=>F+" "+(O?"is in error":"is off")).join(", "),!x.length&&[e,um("switch http or https on")]),d.find(O=>O.badApi)&&Jr("warning","Some plugins may be incompatible"),!(s!=null&&s.adminActualAccess)&&Jr("",ts("On _localhost_ you don't need to login"),e,u.createElement(_S,{to:"accounts"},ts("to access from another computer create an account with /admin/ permission"))),rC(a,n)&&Jr("warning",rC(a,n),e,um("set the number of proxies"),e,"unless you are sure and you can ",u.createElement(mr,{size:"small",onClick(){return mt(this,null,function*(){(yield qs("Go on only if you know what you are doing"))&&(yield Et("set_config",{values:{ignore_proxies:!0}}))&&c()})}},"ignore this warning"),e,Ya("Proxy-warning","Explanation")),((a==null?void 0:a.proxies)>0||(n==null?void 0:n.proxyDetected))&&Jr("",Ya("Reverse-proxy","Read our guide on proxies")),n.frpDetected&&Jr("warning",'FRP is detected. It should not be used with "type = tcp" with HFS. Possible solutions are',u.createElement("ol",{},u.createElement("li",{},"configure FRP with type=http (best solution)"),u.createElement("li",{},ts("configure FRP to connect to HFS _not_ with 127.0.0.1 (safe, but you won't see users' IPs)")),u.createElement("li",{},`disable "admin access for localhost" in HFS (safe, but you won't see users' IPs)`))),Jr("",u.createElement(Mo,{target:"support",href:Mw+"discussions"},"Get support")),n.updatePossible==="local"?u.createElement(yu,{icon:Dm,onClick:()=>cM()},"Update from local file"):p?Tw(St.find(p,"isNewer"),O=>!p.length||!n.updatePossible&&!O?Jr("","No update available"):O&&!n.updatePossible?Jr("",`Version ${O.name} available`):u.createElement(Ql,{vert:!0},p.map(F=>u.createElement(Ql,{key:F.name,alignItems:"flex-start",flexWrap:"wrap"},u.createElement(Bx,{},u.createElement(zx,{},u.createElement(yu,kt(Ce({icon:Dm},!F.isNewer&&{color:"warning",variant:"outlined"}),{onClick:()=>cM(F.tag_name)}),vu("Install ",F.name,F.isNewer?"":" (older)")),u.createElement(je,{mt:1},ts(F.body,{onText:P,linkTarget:"_blank"})))))))):u.createElement(yu,{variant:"outlined",icon:Dm,onClick:()=>Et("check_update").then(O=>h(O.options),un)},"Check for updates"));function P(O){return V4(O,new RegExp("(?<=^|\\W)#(\\d+)\\b","g"),F=>u.createElement(Mo,{href:Mw+"issues/"+F[1],target:"_blank"},u.createElement(HN,{sx:{verticalAlign:"bottom"}})))}}function cM(e){return mt(this,null,function*(){if(!(yield qs("Update may take less than a minute, depending on the speed of your server")))return;Wr("Downloading"),yield Et("update",{tag:e}),Wr("Restarting");const t=Date.now();let n;for(;yield Et("NONE").then(()=>0,r=>!r.code);)!n&&Date.now()-t>1e4&&(n=un("This is taking too long, please check your server","warning")),yield tse(500);n==null||n.close(),dA(pn,"loginRequired",()=>pn.loginRequired=!1),yield un("Procedure complete","success"),window.location.reload()})}function Jr(e,...t){return u.createElement(je,{fontSize:"x-large",color:n=>{var r;return e&&((r=n.palette[e])==null?void 0:r.main)}},u.createElement({success:zN,info:tp,"":tp,warning:ny,error:ty}[e],{sx:{mb:"-3px",mr:1,color:e?void 0:"primary.main"}}),...t)}function m0e(e="File System page"){return u.createElement(_S,{to:"fs"},e)}function um(e="Options page"){return u.createElement(_S,{to:"options"},e)}function rC(e,t){return e&&!e.proxies&&(t==null?void 0:t.proxyDetected)&&"A proxy was detected but none is configured"}let Hl,oC;const VN=hS({changes:{}});mS(pn,e=>{e.some(t=>t[1][0]==="config")&&UN()});const Hg={log:"Access",error_log:"Access error",console:"Console"},uM=io;function g0e(){var g;const{data:e,reload:t,element:n}=Lo("get_config",{omit:["vfs"]}),r=oa(),{changes:o}=gS(VN),i=Lo(e&&"get_status"),s=i.data,a=oC=i.reload;u.useEffect(()=>void a(),[e]),u.useEffect(()=>()=>oC=void 0,[]);const c=(g=ry("get_admins")[0])==null?void 0:g.list;if(n)return n;if(i.error)return i.element;const d=Hl!==e?pn.config=Hl=e:r.config,p={comp:Zi,min:1,placeholder:"no limit",md:3},h=d.https_port>=0;return u.createElement(Mp,{sx:{maxWidth:"60em"},values:d,set(y,v){pn.config[v]=y},stickyBar:!0,onError:un,save:{onClick:m,sx:fy(Object.keys(o).length>0)},barSx:{gap:2},addToBar:[u.createElement(mr,{onClick(){t(),a()},startIcon:u.createElement(ey)},"Reload")],defaults(){return{sm:6}},fields:[{k:"port",comp:dM,md:3,label:"HTTP port",status:(s==null?void 0:s.http)||!0,suggestedPort:80},{k:"https_port",comp:dM,md:3,label:"HTTPS port",status:(s==null?void 0:s.https)||!0,suggestedPort:443,onChange(y){return y>=0&&!h&&!d.cert&&y0e(),y}},kt(Ce({k:"max_kbps"},p),{label:"Limit output KB/s",helperText:"Doesn't apply to localhost"}),kt(Ce({k:"max_kbps_per_ip"},p),{label:"Limit output KB/s per-ip"}),h&&d.port>=0&&{k:"force_https",comp:Eo,sm:12,md:4,label:"Force HTTPS",helperText:"Not applied to localhost"},h&&{k:"cert",comp:_f,md:4,label:"HTTPS certificate file",helperText:Ya("HTTPS#certificate","What is this?"),error:Tw(s==null?void 0:s.https.error,y=>KE(y)&&[y," - ",u.createElement(Mo,{key:"fix",sx:{cursor:"pointer"},onClick:YE},"make one")])},h&&Ce({k:"private_key",comp:_f,md:4,label:"HTTPS private key file"},Tw(s==null?void 0:s.https.error,y=>qE(y)?{error:!0,helperText:y}:null)),{k:"open_browser_at_start",comp:Eo,label:"Open Admin-panel at start",md:4,helperText:"Browser is automatically launched with HFS"},{k:"localhost_admin",comp:Eo,label:"Unprotected admin on localhost",md:4,getError:y=>!y&&(c==null?void 0:c.length)===0&&"First create at least one admin account",helperText:"Access Admin-panel without entering credentials"},{k:"file_menu_on_link",comp:gs,label:"Access file menu",sm:12,md:4,options:{"by clicking on file name":!0,"by dedicated button":!1}},{k:"title",helperText:"You can see this in the tab of your browser"},{k:"favicon",comp:_f,placeholder:"None",fileMask:"*.png|*.ico|*.jpg|*.jpeg|*.gif|*.svg",helperText:"The icon associated to your website"},{k:"log",label:Hg.log,md:3,helperText:"Requests are logged here"},{k:"error_log",label:Hg.error_log,md:3,placeholder:"errors go to main log",helperText:"If you want errors in a different log"},{k:"log_rotation",comp:gs,md:3,options:[{value:"",label:"disabled"},"daily","weekly","monthly"],helperText:"To keep log-files smaller"},{k:"dont_log_net",comp:uM,label:"Don't log address",md:3,placeholder:"no exception",helperText:u.createElement(Bm)},{k:"log_gui",comp:Eo,label:"Log interface loading"},{k:"log_api",comp:Eo,label:"Log API requests"},{k:"proxies",comp:Zi,min:0,max:9,sm:6,label:"How many HTTP proxies between this server and users?",error:rC(d,s),helperText:"Wrong number will prevent detection of users' IP address"},{k:"allowed_referer",placeholder:"any",label:"Links from other websites",comp:v0e},{k:"dont_overwrite_uploading",comp:Eo,label:"Don't overwrite uploading",helperText:"Files will be numbered to avoid overwriting"},{k:"delete_unfinished_uploads_after",comp:Zi,md:3,min:0,unit:"seconds",placeholder:"Never",helperText:"Leave empty to never delete"},{k:"min_available_mb",comp:Zi,md:3,min:0,unit:"MBytes",placeholder:"None",label:"Min. available disk space",helperText:"Reject uploads that don't comply"},{k:"keep_session_alive",comp:Eo,helperText:"Keeps you logged in while the page is left open and the computer is on"},{k:"session_duration",comp:Zi,sm:3,min:5,unit:"seconds",required:!0},{k:"zip_calculate_size_for_seconds",comp:Zi,sm:3,label:"Calculate ZIP size for",unit:"seconds",helperText:"If time is not enough, the browser will not show download percentage"},{k:"update_to_beta",comp:Eo,helperText:"Include betas in automatic updates"},{k:"admin_net",comp:uM,label:"Admin-panel accessible from",placeholder:"any address",helperText:u.createElement(u.Fragment,{},"IP address of browser machine. ",u.createElement(Bm))},{k:"mime",comp:ole,keyLabel:"Files",keyWidth:7,valueLabel:"Mime type",valueWidth:4},{k:"block",label:"Blocked IPs",multiline:!0,minRows:3,helperText:u.createElement(u.Fragment,{},"Enter an IP address for each line. ",u.createElement(Bm)),fromField:y=>y.split(`
|
|
483
483
|
`).map(v=>v.trim()).filter(Boolean).map(v=>({ip:v})),toField:y=>Array.isArray(y)?y.map(v=>v==null?void 0:v.ip).filter(Boolean).join(`
|
|
484
|
-
`):""}]});function m(){return mt(this,null,function*(){var M,O;if(St.isEmpty(o))return Wr("Nothing to save");const y=window.location,v=["port","https_port"];if(v.every(F=>o[F]!==void 0))return un("You cannot change both http and https port at once. Please, do one, save, and then do the other.","warning");const S=[(M=s==null?void 0:s.http)==null?void 0:M.listening,(O=s==null?void 0:s.https)==null?void 0:O.listening],w=location.protocol==="https:";w&&(v.reverse(),S.reverse());const C=o[v[0]],x=d[v[1]],P=x>0&&S[1],_=w?"http":"https";if(C<0&&!P)return un("You cannot switch off this port unless you have a working fixed port for "+_,"warning");if(C===0&&!P)return un("You cannot randomize this port unless you have a working fixed port for "+_,"warning");if(C>0&&!(yield qs("You are changing the port and you may be disconnected")))return;const I="cert"in o||"private_key"in o;if(w&&I&&!(yield qs("You may disrupt https service, kicking you out")))return;if(yield Et("set_config",{values:o}),C!==void 0)return yield un("You are being redirected but in some cases this may fail. Hold on tight!","warning"),window.location.href=C<=0?(w?"http:":"https:")+"//"+y.hostname+":"+x+y.pathname:y.protocol+"//"+y.hostname+":"+C+y.pathname;const k="port"in o||"https_port"in o;setTimeout(a,k||I?1e3:0),Object.assign(Hl,o),UN(),Wr("Changes applied","success")})}}function UN(){const e={};if(pn.config)for(const[t,n]of Object.entries(pn.config))JSON.stringify(n)!==JSON.stringify(Hl==null?void 0:Hl[t])&&(e[t]=n);VN.changes=e}function KE(e){return/certificate/.test(e)}function qE(e){return/private key/.test(e)}function dM({label:e,value:t,onChange:n,getApi:r,status:o,suggestedPort:i=1,error:s,helperText:a}){const c=u.useRef(i);t>0&&(c.current=t);const d=Number(t>0?c.current:t)||0;let p=o==null?void 0:o.error;return p&&(KE(p)||qE(p)?p=void 0:s=!0),u.createElement(je,{},u.createElement(je,{display:"flex"},u.createElement(gs,{sx:{flexGrow:1},label:e,error:s,value:d,options:[{label:"off",value:-1},{label:"random",value:0},{label:"choose",value:c.current}],onChange:n}),t>0&&u.createElement(Zi,{label:"Number",fullWidth:!1,value:t,onChange:n,getApi:r,error:s,min:1,max:65535,helperText:a,sx:{minWidth:"5.5em"}})),o&&u.createElement(_p,{error:s},o===!0?"...":p!=null?p:(o==null?void 0:o.listening)&&"Correctly working on port "+o.port))}function
|
|
485
|
-
`,quote:'"'},dm={field:0,fieldOffset:0,line:0,lineOffset:0,quoted:!1,appendCell:!1,appendField:!1,appendRow:!1};class fM extends Error{constructor(t,n){super(`Invalid CSV at ${t}:${n}`)}}class F0e{constructor(t=cb){Ki(this,"_rows",[]);Ki(this,"_row",[]);Ki(this,"_cell","");Ki(this,"_options",cb);Ki(this,"_state",Ce({},dm));Ki(this,"_index",0);Ki(this,"_current","");Ki(this,"_previous","");Ki(this,"_quoteState",Ce({},dm));this._options=Object.assign({},cb,t)}parse(t){for(this.reset(),this._index=0;this._index<t.length;this._index++)this._state.appendCell=!0,this._previous=this._current,this._current=t[this._index],this.handleNext();if(this._row.length>0&&(this.addField(this.fieldValue(this._cell),this._row,this._state),this.addRow(this._row,this._rows,this._state)),this._state.quoted)throw new fM(this._quoteState.line,this._quoteState.lineOffset);return this.makeImmutable(),this._rows}get rows(){return this._rows}get json(){if(this.rows.length>0){const t=this.rows[0].filter(n=>typeof n=="string");return Object.freeze(this.rows.filter((n,r)=>n&&r>0).map(n=>{const r={};return t.forEach((o,i)=>{r[o]=n[i]}),Object.freeze(r)}))}return Object.freeze([])}handleNext(){this.handleQuote()||this.handleFieldSeparator()||this.handleLineSeparator(),this.processState()}handleQuote(){return this._current===this._options.quote?(this._quoteState=Ce({},this._state),this._previous==="\\"?this.handleQuoteEscaped():this.handleQuoteNotEscaped(),!0):!1}handleQuoteEscaped(){this._cell=this._cell.slice(0,Math.max(0,this._cell.length-1))}handleQuoteNotEscaped(){if(this._cell.length===0||this._state.quoted)this._state.quoted=!this._state.quoted;else throw new fM(this._state.line,this._state.lineOffset);this._state.appendCell=!1}handleFieldSeparator(){return this._current===this._options.fieldSeparator?(this._state.quoted||(this._state.appendCell=!1,this._state.appendField=!0),!0):!1}handleLineSeparator(){return this._current===this._options.lineSeparator?(this._state.quoted||(this._state.appendCell=!1,this._state.appendField=!0,this._state.appendRow=!0),!0):!1}processState(){this._state.appendCell&&(this._cell+=this._current),this._state.appendField&&(this.addField(this.fieldValue(this._cell),this._row,this._state),this._cell=""),this._state.appendRow&&(this.addRow(this._row,this._rows,this._state),this._row=[]),this._state.lineOffset++,this._state.fieldOffset++}fieldValue(t){return t}addField(t,n,r){n.push(t),r.field++,r.fieldOffset=-1,r.appendField=!1}addRow(t,n,r){n.push(t),r.field=0,r.line++,r.lineOffset=-1,r.appendRow=!1}makeImmutable(){this.rows.forEach(t=>{t.forEach(n=>Object.freeze(n)),Object.freeze(t)}),Object.freeze(this._rows)}reset(){this._rows=[],this._row=[],this._cell="",this._state=Ce({},dm),this._index=0,this._current="",this._previous="",this._quoteState=Ce({},dm)}}function A0e(e){return mt(this,null,function*(){QF(t=>mt(this,null,function*(){const n=t==null?void 0:t[0];if(!n)return;const r=yield XF(n);if(!r)return;const i=new F0e().parse(r.trim()),s={comp:Zi,min:1,max:9,xs:6,typing:!0},a={skipFirstLines:0,usernameColumn:1,passwordColumn:2,groupColumn:3,redirectColumn:4,overwriteExistingAccounts:!1},c=yield rp({title:"Import accounts from CSV",dialogProps:{maxWidth:"sm"},values:a,form:h=>{const m=i[h.skipFirstLines||0],g=p(m,Ce(Ce({},a),h));return{save:{startIcon:u.createElement(Tp),children:"Go"},fields:[u.createElement(je,{p:1},"Total lines:",i.length),{k:"skipFirstLines",comp:Zi,min:0,max:i.length-1,typing:!0,md:6,helperText:u.createElement(u.Fragment,{},"First line: ",u.createElement("code",{},m.join(", ")))},{k:"overwriteExistingAccounts",comp:Eo,md:6},kt(Ce({k:"usernameColumn"},s),{helperText:u.createElement(u.Fragment,{},"First username: ",g.u)}),kt(Ce({k:"passwordColumn"},s),{helperText:u.createElement(u.Fragment,{},"First password: ",g.p)}),kt(Ce({k:"groupColumn"},s),{helperText:u.createElement(u.Fragment,{},"First group: ",g.g)}),kt(Ce({k:"redirectColumn"},s),{helperText:u.createElement(u.Fragment,{},"First redirect: ",g.r)})]}}});if(!c)return;const{close:d}=Wo({title:"Importing...",Content(){const[h,m]=u.useState(0),[g,y]=u.useState();return u.useEffect(()=>{let v=!1;return setTimeout(()=>mt(this,null,function*(){var P;if(v)return;let S=0,w=0,C=c.skipFirstLines;const x=i.length-C;try{let _=0;for(const I of i){if(v)return;if(C){C--;continue}const k=p(I,c);y(k),m(_++/x),yield Et("add_account",{username:k.u,belongs:(P=k.g)==null?void 0:P.split(","),redirect:k.r,overwrite:c.overwriteExistingAccounts}).then(()=>{if(k.p)return iC(k.u,k.p)},M=>{if(M.code===409)return w++;S++})}}finally{d();const _=x-S-w,I="Results: "+[vu("",S," failed"),vu("",_," succeeded"),vu("",w," skipped because already present")].filter(Boolean).join(", ");un(I,!_&&S?"error":S||w?"warning":"success"),e==null||e()}})),()=>{v=!0}},[]),u.createElement(je,{display:"flex",gap:2,alignItems:"center"},u.createElement(uA,{icon:XE,progress:h}),g==null?void 0:g.u)}});function p(h,m){return{u:h[m.usernameColumn-1],p:h[m.passwordColumn-1],g:h[m.groupColumn-1],r:h[m.redirectColumn-1]}}}),{multiple:!1,accept:".csv"})})}function N0e(){const{username:e}=oa(),{data:t,reload:n,element:r}=Lo("get_accounts"),[o,i]=u.useState([]),s=Array.isArray(o);u.useEffect(()=>{Array.isArray(t==null?void 0:t.list)&&s&&i(o.filter(y=>t.list.find(v=>(v==null?void 0:v.username)===y)))},[t]);const a=t==null?void 0:t.list,c=s&&St.find(a,{username:o[0]}),p=Yl("md"),h=!(o.length>0)||!a?null:s&&o.length>1?u.createElement(u.Fragment,{},u.createElement(Ql,{alignItems:"center"},u.createElement(Tr,{variant:"h6"},o.length+" selected"),u.createElement(mr,{onClick:g,startIcon:u.createElement(bs)},"Remove")),u.createElement(Jv,{},o.map(y=>u.createElement(mF,{key:y},u.createElement(cs,{},y))))):u.createElement(L0e,{account:c||{username:"",hasPassword:o==="new-user"},groups:a.filter(y=>!y.hasPassword).map(y=>y.username),addToBar:p&&u.createElement(zn,{icon:Rp,title:"Close",onClick:m}),reload:n,done(y){i([y]),n()}});return u.useEffect(()=>{if(p||!h||!o.length)return;const{close:y}=Wo({title:St.isString(o)?St.startCase(o):o.length>1?"Multiple selection":c?(c.hasPassword?"User: ":"Group: ")+c.username:"?",Content:()=>h,onClose:m});return y},[p,o,c]),r||u.createElement(Jn,{container:!0,maxWidth:"80em"},u.createElement(Jn,{item:!0,xs:12},u.createElement(je,{display:"flex",flexWrap:"wrap",gap:2,mb:2,sx:{position:"sticky",top:0,zIndex:2,backgroundColor:"background.paper",width:"fit-content"}},u.createElement(H4,{variant:"contained",startIcon:u.createElement(KN),items:[{children:"user",onClick:()=>i("new-user")},{children:"group",onClick:()=>i("new-group")},{children:"from CSV",onClick:()=>A0e(n)}]},"Add"),$S(n),(a==null?void 0:a.length)>0&&u.createElement(Tr,{p:1},`${a.length} account(s)`))),u.createElement(Jn,{item:!0,md:5},!(a!=null&&a.length)&&u.createElement(Uo,{severity:"info"},ts`To access administration _remotely_ you will need to create a user account with admin permission`),u.createElement(rA,{multiSelect:!0,sx:{pr:4,pb:2,minWidth:"15em"},selected:s?o:[],onNodeSelect(y,v){i(v)}},a==null?void 0:a.map(y=>{var v,S;return u.createElement(Ow,{key:y.username,nodeId:y.username,label:u.createElement(je,{sx:{display:"flex",flexWrap:"wrap",padding:".2em 0",gap:".5em",alignItems:"center"}},qN(y),y.adminActualAccess&&xo(WN,"Can login into Admin"),y.username,!!((v=y.belongs)!=null&&v.length)&&u.createElement(je,{sx:{color:"text.secondary",fontSize:"small"}},"(",(S=y.belongs)==null?void 0:S.join(", "),")"))})}))),p&&h&&u.createElement(Jn,{item:!0,md:7},u.createElement(Bx,{},u.createElement(zx,{},h))));function m(){i([])}function g(){return mt(this,null,function*(){if(o.length>St.pull(o,e).length&&(yield un("Won't delete current account","warning")),!!o.length&&(yield qs(`Delete ${o.length} item(s)?`)))try{const y=[];for(const v of o)(yield Et("del_account",{username:v}).then(()=>1,()=>0))||y.push(v);if(n(),y.length)return un("Following elements couldn't be deleted: "+y.join(", "),"error")}catch(y){yield un(y)}})}}function qN(e,t={}){return u.createElement(e.hasPassword?GN:XE,t)}var tP={},D0e=ut;Object.defineProperty(tP,"__esModule",{value:!0});var YN=tP.default=void 0,B0e=D0e(dt()),z0e=at(),j0e=(0,B0e.default)((0,z0e.jsx)("path",{d:"M13 3h-2v10h2V3zm4.83 2.17-1.42 1.42C17.99 7.86 19 9.81 19 12c0 3.87-3.13 7-7 7s-7-3.13-7-7c0-2.19 1.01-4.14 2.58-5.42L6.17 5.17C4.23 6.82 3 9.26 3 12c0 4.97 4.03 9 9 9s9-4.03 9-9c0-2.74-1.23-5.18-3.17-6.83z"}),"PowerSettingsNew");YN=tP.default=j0e;function H0e(){const{element:e}=Lo("get_config",{only:[]}),{username:t}=oa();return e||u.createElement(je,{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:2},t?u.createElement(u.Fragment,{},"You are logged in as: "+t,u.createElement(yu,{icon:Qx,size:"large",variant:"contained",onClick:()=>Et("logout").catch(r=>r.code!==401&&un(r))},"I want to logout")):u.createElement(Uo,{severity:"info"},"You are not logged in, because authentication is not required on localhost"),u.createElement(yu,{icon:YN,size:"large",variant:"contained",color:"warning",confirm:"Stopping the server, this interface won't respond anymore",onClick(){return mt(this,null,function*(){yield Et("quit"),yield un("Good-bye","success"),location.reload()})}},"Quit HFS"))}function V0e(){const{list:e,error:t,connecting:n,reload:r}=sc("list_langs"),o=u.useMemo(()=>["en",...St.uniq(e.map(a=>a.code))],[e]),i=Yl("md");return t||u.createElement(u.Fragment,{},i&&u.createElement(Uo,{severity:"info"},"Translation is limited to Front-end, it doesn't apply to Admin-panel"),u.createElement(je,{mt:1,maxWidth:"40em",flex:1,display:"flex",flexDirection:"column"},u.createElement(je,{mb:1,display:"flex"},u.createElement(mr,{variant:"contained",startIcon:u.createElement(Tp),onClick:s},"Add"),u.createElement(je,{flex:1}),u.createElement(U0e,{langs:o})),u.createElement(Dp,{loading:n,rows:e,hideFooter:!0,sx:{flex:1},columns:[{field:"code",width:110,valueFormatter:({value:a})=>a==null?void 0:a.toUpperCase()},{field:"version",width:120,hideUnder:"sm"},{field:"hfs_version",headerName:"HFS version",width:110},{field:"author",flex:1,hideUnder:"sm"}],actions:({row:a})=>[u.createElement(zn,{icon:bs,title:a.embedded?"Cannot delete (embedded)":"Delete",confirm:"Delete?",disabled:a.embedded,onClick(){return mt(this,null,function*(){yield Et("del_lang",St.pick(a,"code")),r(),Wr("Deleted")})}})]})));function s(){QF(a=>mt(this,null,function*(){if(!a)return;const c={};for(const d of a)c[d.name]=yield XF(d);try{yield Et("add_langs",{langs:c}),r(),Wr("Loaded")}catch(d){yield un(d)}}),{accept:".json"})}}function U0e({langs:e}){const t="force_lang",{data:n,reload:r,loading:o}=Lo("get_config",{only:[t]}),[i,s]=u.useState();u.useEffect(()=>s(o?i:n[t]),[o]);const[a,c]=u.useState();return u.createElement(gs,{fullWidth:!1,disabled:o||typeof a=="string",value:a!=null?a:i,onChange(p){return mt(this,null,function*(){c(p);try{yield Et("set_config",{values:{[t]:p}}),yield r()}finally{c(void 0)}})},options:[{label:"Respect browser language",value:""},...e.map(p=>({value:p,label:"Force language: "+p}))]})}function W0e(){const[e,t]=u.useState(0),n=ale(Hg);return u.createElement(u.Fragment,{},u.createElement(IF,{value:e,onChange(r,o){t(o)}},n.map(r=>u.createElement(EF,{label:Hg[r],key:r}))),u.createElement(G0e,{key:e,file:n[e]}))}function G0e({file:e}){const{list:t,error:n,connecting:r}=sc("get_log",{file:e});return n||u.createElement(Dp,{loading:r,rows:t,componentsProps:{pagination:{showFirstButton:!0,showLastButton:!0}},columns:e==="console"?[{field:"ts",headerName:"Timestamp",type:"dateTime",width:90,valueGetter:({value:o})=>new Date(o),renderCell:({value:o})=>u.createElement(je,{},o.toLocaleDateString(),u.createElement("br"),o.toLocaleTimeString())},{field:"k",headerName:"Level",hideUnder:"sm"},{field:"msg",headerName:"Message",flex:1,mergeRender:{other:"k",override:{valueFormatter:({value:o})=>o!=="log"&&o}}}]:[{field:"ip",headerName:"Address",flex:.6,minWidth:100,maxWidth:230,mergeRender:{other:"user"}},{field:"user",headerName:"Username",flex:.4,maxWidth:200,hideUnder:"lg"},{field:"ts",headerName:"Timestamp",type:"dateTime",width:90,valueGetter:({value:o})=>new Date(o),renderCell:({value:o})=>u.createElement(je,{},o.toLocaleDateString(),u.createElement("br"),o.toLocaleTimeString())},{field:"method",headerName:"Method",width:80,hideUnder:"lg"},{field:"status",headerName:"Code",type:"number",width:70,hideUnder:"lg"},{field:"length",headerName:"Size",type:"number",hideUnder:"md",valueFormatter:({value:o})=>ql(o)},{field:"uri",headerName:"URI",flex:2,minWidth:100,mergeRender:{other:"method",fontSize:"small"},valueFormatter:({value:o})=>{if(!o.startsWith(Sg))return o;const i=Sg.length,s=o.indexOf("?",i),a=o.slice(i,s>0?s:1/0),c=s<0?"":Array.from(new URLSearchParams(o.slice(s))).map(d=>{var p;return`${d[0]}=${(p=cse(d[1]))!=null?p:d[1]}`}).join(" ; ");return`API ${a} ${c}`}}]})}var nP={},K0e=ut;Object.defineProperty(nP,"__esModule",{value:!0});var sC=nP.default=void 0,q0e=K0e(dt()),Y0e=at(),Q0e=(0,q0e.default)((0,Y0e.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4 14H8V8h8v8z"}),"StopCircle");sC=nP.default=Q0e;var rP={},X0e=ut;Object.defineProperty(rP,"__esModule",{value:!0});var QN=rP.default=void 0,J0e=X0e(dt()),Z0e=at(),e1e=(0,J0e.default)((0,Z0e.jsx)("path",{d:"M16 18v2H8v-2h8zM11 7.99V16h2V7.99h3L12 4 8 7.99h3z"}),"Upgrade");QN=rP.default=e1e;function XN(c){var d=c,{label:e,helperText:t,fields:n,value:r,onChange:o,onError:i,getApi:s}=d,a=Yt(d,["label","helperText","fields","value","onChange","onError","getApi"]);const p=u.useMemo(()=>(r||[]).map((g,y)=>rse(Ce({},g),"id"in g?{$idx:y}:{id:y})),[JSON.stringify(r)]),h={fields:n.map(S=>{var w=S,{$width:g,$column:y}=w,v=Yt(w,["$width","$column"]);return v})},m=u.useMemo(()=>[...n.map(g=>{var y;return Ce(Ce({field:g.k,headerName:(y=g.headerName)!=null?y:typeof g.label=="string"?g.label:iA(g.k),disableColumnMenu:!0},g.$width>=8?{width:g.$width}:{flex:g.$width||1}),g.$column)}),{field:"",width:80,disableColumnMenu:!0,sortable:!1,align:"center",headerAlign:"center",renderHeader(){const g="Add";return u.createElement(zn,{icon:dy,title:g,onClick:y=>rp({form:h,title:g}).then(v=>v&&o([...r||[],v],{was:r,event:y}))})},renderCell({row:g}){const{$idx:y=g.id}=g,v="Modify";return u.createElement("div",{},u.createElement(zn,{icon:HE,title:v,onClick:S=>rp({values:g,form:h,title:v}).then(w=>{if(!w)return;const C=r.map((x,P)=>P===y?w:x);o(C,{was:r,event:S})})}),u.createElement(zn,{icon:bs,title:"Delete",confirm:"Delete?",onClick(S){const w=r.filter((C,x)=>x!==y);o(w,{was:r,event:S})}}))}}],[n,r,o]);return u.createElement(u.Fragment,{},e&&u.createElement(oF,{sx:{ml:1}},e),t&&u.createElement(_p,{},t),u.createElement(je,Ce({height:"20em"},a),u.createElement(I4,{columns:m,rows:p,hideFooterSelectedRowCount:!0,hideFooter:!0,componentsProps:{pagination:{showFirstButton:!0,showLastButton:!0}}})))}function pM({updates:e}){const{list:t,updateEntry:n,error:r,initializing:o}=sc(e?"get_plugin_updates":"get_plugins");return r?eD(r):u.createElement(Dp,{rows:t.length?t:[],initializing:o,disableColumnSelector:!0,disableColumnMenu:!0,hideFooter:!0,noRows:e&&'No updates available. Only plugins available on "search online" are checked.',columns:[{field:"id",headerName:"name",flex:.3,minWidth:150,renderCell:JN,mergeRender:{other:"description",fontSize:"x-small"}},{field:"version",width:70,hideUnder:"sm"},{field:"description",flex:1,hideUnder:"sm"}],actions:({row:i,id:s})=>e?[u.createElement(tD,{id:s,updated:i.updated,then:()=>n({id:s},{updated:!0})})]:[u.createElement(zn,i.started?{icon:sC,title:u.createElement(je,{},`Stop ${s}`,u.createElement("br"),"Started "+new Date(i.started).toLocaleString()),size:"small",color:"success",onClick(){return mt(this,null,function*(){yield Et("stop_plugin",{id:s}),Wr("Plugin stopped",u.createElement(sC,{color:"warning"}))})}}:{icon:hy,title:`Start ${s}`,size:"small",onClick:()=>nD(s)}),u.createElement(zn,{icon:tS,title:"Options",size:"small",disabled:!i.started&&"Start plugin to access options"||!i.config&&"No options available for this plugin",progress:!1,onClick(){return mt(this,null,function*(){const p=yield Et("get_plugin",{id:s}),h=yield rp({title:`${s} options`,form:{before:u.createElement(je,{mx:2,mb:3},i.description),fields:ZN(i.config)},values:p.config,dialogProps:St.merge({sx:{m:"auto"}},i.configDialog)});!h||St.isEqual(p.config,h)||(yield Et("set_plugin",{id:s,config:h}),Wr("Configuration saved"))})}}),u.createElement(zn,{icon:bs,title:"Uninstall",size:"small",confirm:"Remove?",onClick(){return mt(this,null,function*(){yield Et("uninstall_plugin",{id:s}),Wr("Plugin uninstalled")})}})]})}function JN({row:e,value:t}){const{repo:n}=e,r=n==null?void 0:n.split("/");return u.createElement(u.Fragment,{},o(e.badApi,!0),o(e.error),...n?[u.createElement(Mo,{href:"https://github.com/"+n,target:"plugin"},r[1])," by ",r[0]]:[t]);function o(i,s=!1){return i&&u.createElement(nd,{title:i,children:u.createElement(ty,{fontSize:"small",color:s?"warning":"error",sx:{ml:-.5,mr:.5}})})}}function ZN(e){return Object.entries(e).map(([t,n])=>{if(!St.isPlainObject(n))return n;let d=n,{type:r,defaultValue:o,fields:i,frontend:s}=d,a=Yt(d,["type","defaultValue","fields","frontend"]);const c=t1e[r];return c===XN&&(i=ZN(i)),o!==void 0&&r==="boolean"&&(a.placeholder=`Default value is ${JSON.stringify(o)}`),Ce({k:t,comp:c,fields:i},a)})}const t1e={string:io,number:Zi,boolean:Eo,select:gs,multiselect:SS,array:XN,real_path:_f};function eD(e){return u.createElement(Uo,{severity:"error"},cle(e,{github_quota:"Request denied. You may have reached the limit, retry later.",ENOTFOUND:"Couldn't reach github.com"}))}function tD({id:e,updated:t,then:n}){return u.createElement(zn,{icon:QN,title:t?"Already updated":"Update",disabled:t,onClick(){return mt(this,null,function*(){yield Et("update_plugin",{id:e},{timeout:!1}),n==null||n(e),Wr("Plugin updated")})}})}function nD(e){return mt(this,null,function*(){yield Et("start_plugin",{id:e}),Wr("Plugin started",u.createElement(hy,{color:"success"}))})}var oP={},n1e=ut;Object.defineProperty(oP,"__esModule",{value:!0});var rD=oP.default=void 0,r1e=n1e(dt()),o1e=at(),i1e=(0,r1e.default)((0,o1e.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");rD=oP.default=i1e;function s1e(){const[e,t]=u.useState(""),n=fS(e,1e3),{list:r,error:o,initializing:i,updateList:s}=sc("search_online_plugins",{text:n}),a=oa();return o?eD(o):u.createElement(u.Fragment,{},u.createElement(io,{value:e,onChange:t,start:u.createElement(rD),typing:!0,label:"Search text"}),u.createElement(Dp,{rows:r.length?r:[],noRows:"No compatible plugins have been found",initializing:i,columnVisibilityModel:a.onlinePluginsColumns,onColumnVisibilityModelChange:c=>Object.assign(pn.onlinePluginsColumns,c),columns:[{field:"id",headerName:"name",flex:1,renderCell:JN,mergeRender:{other:"description",fontSize:"x-small"}},{field:"version",width:70},{field:"pushed_at",headerName:"last update",valueGetter:({value:c})=>new Date(c).toLocaleDateString()},{field:"license",width:80},{field:"description",flex:3,hideUnder:"sm"},{field:"stargazers_count",width:50,headerName:"stars",align:"center",hideUnder:"sm"}],actions:({row:c,id:d})=>[c.update?u.createElement(tD,{id:d,then(){s(h=>St.find(h,{id:d}).update=!1)}}):u.createElement(zn,{icon:GS,title:"Install",progress:c.downloading,disabled:c.installed&&"Already installed",tooltipProps:{placement:"bottom-end"},confirm:"WARNING - Proceed only if you trust this author and this plugin",onClick(){return mt(this,null,function*(){const h=c.branch||c.default_branch;try{const m=yield Et("download_plugin",{id:d,branch:h},{timeout:!1});yield nD(m.id)}catch(m){if(m.code!==424)throw m;const g=u.createElement(u.Fragment,{},"This plugin has some dependencies unmet:",m.data.map(y=>u.createElement("li",{},y.repo+": "+y.error)));return un(g,"error")}})}})]}))}const oD={Installed:pM,"Search online|Search":s1e,"Check updates|Updates":()=>u.createElement(pM,{updates:!0})},l1e=Object.keys(oD),a1e=Object.values(oD);function c1e(){const[e,t]=u.useState(0),n=!Yl("sm");return u.createElement(u.Fragment,{},u.createElement(IF,{value:e,onChange(r,o){t(o)}},l1e.map(r=>u.createElement(EF,{key:r,label:r.split("|").slice(n?-1:0)[0]}))),u.createElement(a1e[e]))}var iD={},u1e=Sn&&Sn.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),fr=Sn&&Sn.__assign||function(){return fr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},fr.apply(this,arguments)},d1e=Sn&&Sn.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),f1e=Sn&&Sn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),p1e=Sn&&Sn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&d1e(t,e,n);return f1e(t,e),t},h1e=Sn&&Sn.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};Object.defineProperty(iD,"__esModule",{value:!0});var Xd=p1e(u),m1e=13,g1e=9,v1e=8,y1e=89,fm=90,b1e=77,hM=57,mM=219,gM=222,vM=192,w1e=27,yM=100,C1e=3e3,x1e=typeof window!="undefined"&&"navigator"in window&&/Win/i.test(navigator.platform),ub=typeof window!="undefined"&&"navigator"in window&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),zm="npm__react-simple-code-editor__textarea",S1e=`
|
|
484
|
+
`):""}]});function m(){return mt(this,null,function*(){var M,O;if(St.isEmpty(o))return Wr("Nothing to save");const y=window.location,v=["port","https_port"];if(v.every(F=>o[F]!==void 0))return un("You cannot change both http and https port at once. Please, do one, save, and then do the other.","warning");const S=[(M=s==null?void 0:s.http)==null?void 0:M.listening,(O=s==null?void 0:s.https)==null?void 0:O.listening],w=location.protocol==="https:";w&&(v.reverse(),S.reverse());const C=o[v[0]],x=d[v[1]],P=x>0&&S[1],_=w?"http":"https";if(C<0&&!P)return un("You cannot switch off this port unless you have a working fixed port for "+_,"warning");if(C===0&&!P)return un("You cannot randomize this port unless you have a working fixed port for "+_,"warning");if(C>0&&!(yield qs("You are changing the port and you may be disconnected")))return;const I="cert"in o||"private_key"in o;if(w&&I&&!(yield qs("You may disrupt https service, kicking you out")))return;if(yield Et("set_config",{values:o}),C!==void 0)return yield un("You are being redirected but in some cases this may fail. Hold on tight!","warning"),window.location.href=C<=0?(w?"http:":"https:")+"//"+y.hostname+":"+x+y.pathname:y.protocol+"//"+y.hostname+":"+C+y.pathname;const k="port"in o||"https_port"in o;setTimeout(a,k||I?1e3:0),Object.assign(Hl,o),UN(),Wr("Changes applied","success")})}}function UN(){const e={};if(pn.config)for(const[t,n]of Object.entries(pn.config))JSON.stringify(n)!==JSON.stringify(Hl==null?void 0:Hl[t])&&(e[t]=n);VN.changes=e}function KE(e){return/certificate/.test(e)}function qE(e){return/private key/.test(e)}function dM({label:e,value:t,onChange:n,getApi:r,status:o,suggestedPort:i=1,error:s,helperText:a}){const c=u.useRef(i);t>0&&(c.current=t);const d=Number(t>0?c.current:t)||0;let p=o==null?void 0:o.error;return p&&(KE(p)||qE(p)?p=void 0:s=!0),u.createElement(je,{},u.createElement(je,{display:"flex"},u.createElement(gs,{sx:{flexGrow:1},label:e,error:s,value:d,options:[{label:"off",value:-1},{label:"random",value:0},{label:"choose",value:c.current}],onChange:n}),t>0&&u.createElement(Zi,{label:"Number",fullWidth:!1,value:t,onChange:n,getApi:r,error:s,min:1,max:65535,helperText:a,sx:{minWidth:"5.5em"}})),o&&u.createElement(_p,{error:s},o===!0?"...":p!=null?p:(o==null?void 0:o.listening)&&"Correctly working on port "+o.port))}function v0e({label:e,value:t,onChange:n,error:r}){const o=!t||t==="-",i="example.com";return u.createElement(je,{display:"flex"},u.createElement(gs,{label:e,value:o?t:i,options:{"allow all":"","forbid all":"-","allow some":i},onChange:n,error:r,sx:o?void 0:{maxWidth:"11em"}}),!o&&u.createElement(io,{label:"Domain to allow",value:t,placeholder:"example.com",onChange:n,error:r,helperText:u.createElement(Bm)}))}function Bm(){return Ya("Wildcards","Wildcards supported")}function y0e(){Wo({Content:()=>u.createElement(je,{},u.createElement(je,{display:"flex",gap:1},u.createElement(tp),"You are enabling HTTPs. It needs a valid certificate + private key to work."),u.createElement(je,{mt:4,display:"flex",gap:1,justifyContent:"space-around"},u.createElement(mr,{variant:"contained",onClick(){Bi(),YE().then()}},"Help me!"),u.createElement(mr,{onClick:Bi},"I will handle the matter myself")))})}function YE(){return mt(this,null,function*(){if(!window.crypto.subtle)return un("Retry this procedure on localhost","warning");const{close:e}=Wo({title:"Get a certificate",Content:()=>u.createElement(Ql,{flexDirection:"column"},u.createElement("p",{},"HTTPS needs a certificate to work."),"We suggest you to ",u.createElement(Mo,{target:"cert",href:"https://letsencrypt.org/",onClick:e},u.createElement(mr,{size:"small",color:"success"},"get a free but proper certificate")),"or, if you are in a hurry",u.createElement(mr,{size:"small",color:"warning",onClick(){return mt(this,null,function*(){try{const n=yield Et("save_pem",yield b0e({}));yield Et("set_config",{values:n}),Hl&&Object.assign(Hl,n),setTimeout(oC,1e3),Object.assign(pn.config,n),yield un("Certificate saved","success")}finally{e()}})}},"make a basic certificate"),Ya("HTTPS#certificate",u.createElement(Ql,{},u.createElement(ny,{color:"warning"}),"but BEWARE it won't be perfect")))})})}function b0e(e){return mt(this,null,function*(){const{pki:t}=window.forge,n=t.rsa.generateKeyPair(2048),r=t.createCertificate();r.publicKey=n.publicKey,r.serialNumber="01",r.validity.notBefore=new Date,r.validity.notAfter=new Date,r.validity.notAfter.setFullYear(r.validity.notBefore.getFullYear()+1);const o=Object.entries(e).map(i=>({name:i[0],value:i[1]}));return r.setSubject(o),r.setIssuer(o),r.sign(n.privateKey),{cert:t.certificateToPem(r),private_key:t.privateKeyToPem(n.privateKey)}})}var QE={},w0e=ut;Object.defineProperty(QE,"__esModule",{value:!0});var XE=QE.default=void 0,C0e=w0e(dt()),x0e=at(),S0e=(0,C0e.default)((0,x0e.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"}),"Group");XE=QE.default=S0e;var JE={},E0e=ut;Object.defineProperty(JE,"__esModule",{value:!0});var WN=JE.default=void 0,P0e=E0e(dt()),I0e=at(),k0e=(0,P0e.default)((0,I0e.jsx)("path",{d:"M17 10.43V2H7v8.43c0 .35.18.68.49.86l4.18 2.51-.99 2.34-3.41.29 2.59 2.24L9.07 22 12 20.23 14.93 22l-.78-3.33 2.59-2.24-3.41-.29-.99-2.34 4.18-2.51c.3-.18.48-.5.48-.86zm-4 1.8-1 .6-1-.6V3h2v9.23z"}),"MilitaryTech");WN=JE.default=k0e;var ZE={},_0e=ut;Object.defineProperty(ZE,"__esModule",{value:!0});var GN=ZE.default=void 0,$0e=_0e(dt()),R0e=at(),M0e=(0,$0e.default)((0,R0e.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");GN=ZE.default=M0e;var eP={},T0e=ut;Object.defineProperty(eP,"__esModule",{value:!0});var KN=eP.default=void 0,O0e=T0e(dt()),L0e=at(),F0e=(0,O0e.default)((0,L0e.jsx)("path",{d:"M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm-9-2V7H4v3H1v2h3v3h2v-3h3v-2H6zm9 4c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"PersonAdd");KN=eP.default=F0e;function A0e({account:e,done:t,groups:n,addToBar:r,reload:o}){const[i,s]=u.useState(e),[a,c]=u.useState([]);u.useEffect(()=>{var g,y;s(e),c(n.filter(v=>v!==e.username)),ase()||(y=(g=h.current)==null?void 0:g.querySelector("input"))==null||y.focus()},[JSON.stringify(e)]);const d=!e.username,p=!i.hasPassword,h=u.useRef();return u.createElement(Mp,{formRef:h,values:i,set(g,y){s(v=>kt(Ce({},v),{[y]:g}))},barSx:Ce({gap:2,width:"100%"},IS()),stickyBar:!0,addToBar:[!d&&u.createElement(zn,{icon:bs,title:"Delete",confirm:"Delete?",onClick:()=>Et("del_account",{username:e.username}).then(()=>o())}),r,u.createElement(je,{flex:1}),qN(i,{fontSize:"large",sx:{p:1}})],fields:[{k:"username",label:p?"Group name":void 0,autoComplete:"off",required:!0,xl:p?12:4,getError:g=>g!==e.username&&Et("get_account",{username:g}).then(y=>(y==null?void 0:y.username)===e.username?"usernames are case-insensitive":"already used",()=>!1)},!p&&{k:"password",md:6,xl:4,type:"password",autoComplete:"new-password",required:d,label:d?"Password":"Change password"},!p&&{k:"password2",md:6,xl:4,type:"password",autoComplete:"new-password",label:"Repeat password",getError:(g,{values:y})=>(g||"")!==(y.password||"")&&"Enter same password"},{k:"ignore_limits",comp:Eo,xl:6,helperText:i.ignore_limits?"Speed limits don't apply to this account":"Speed limits apply to this account"},Ce({k:"admin",comp:Eo,xl:6,fromField:g=>g||null,label:"Permission to access Admin-panel",helperText:"To access THIS interface you are using right now"},!e.admin&&e.adminActualAccess&&{value:!0,helperText:"This permission is inherited"}),p&&u.createElement(Uo,{severity:"info"},'To add users to this group, select the user and then click "Inherit"'),{k:"belongs",comp:SS,label:"Inherit from groups",options:a,helperText:"Specify groups to inherit permissions from"+(p?". A group can inherit from another group":"")+(a.length?"":". Now disabled because there are no groups to select, create one first.")},{k:"redirect",helperText:"If you want this account to be redirected to a specific folder/address at login time"}],onError:un,save:{sx:fy(!kS(i,e)),onClick(){return mt(this,null,function*(){const P=i,{password:g="",password2:y,adminActualAccess:v,hasPassword:S}=P,w=Yt(P,["password","password2","adminActualAccess","hasPassword"]),{username:C}=i;if(d){const _=yield Et("add_account",w);if(g)try{yield iC(C,g)}catch(I){throw Et("del_account",{username:C}).then(),I}t(_==null?void 0:_.username),Wr("Account created","success");return}const x=yield Et("set_account",{username:e.username,changes:w});g&&(yield iC(C,g)),setTimeout(()=>Wr("Account modified","success"),1),t(x==null?void 0:x.username)})}}})}function iC(e,t){return mt(this,null,function*(){const n=new Ta.SRPRoutines(new Ta.SRPParameters),r=yield Ta.createVerifierAndSalt(n,e,t);return Et("change_srp_others",{username:e,salt:String(r.s),verifier:String(r.v)}).catch(o=>{if(o.code!==406)throw o;return Et("change_password_others",{username:e,newPassword:t})})})}const cb={fieldSeparator:",",lineSeparator:`
|
|
485
|
+
`,quote:'"'},dm={field:0,fieldOffset:0,line:0,lineOffset:0,quoted:!1,appendCell:!1,appendField:!1,appendRow:!1};class fM extends Error{constructor(t,n){super(`Invalid CSV at ${t}:${n}`)}}class N0e{constructor(t=cb){Ki(this,"_rows",[]);Ki(this,"_row",[]);Ki(this,"_cell","");Ki(this,"_options",cb);Ki(this,"_state",Ce({},dm));Ki(this,"_index",0);Ki(this,"_current","");Ki(this,"_previous","");Ki(this,"_quoteState",Ce({},dm));this._options=Object.assign({},cb,t)}parse(t){for(this.reset(),this._index=0;this._index<t.length;this._index++)this._state.appendCell=!0,this._previous=this._current,this._current=t[this._index],this.handleNext();if(this._row.length>0&&(this.addField(this.fieldValue(this._cell),this._row,this._state),this.addRow(this._row,this._rows,this._state)),this._state.quoted)throw new fM(this._quoteState.line,this._quoteState.lineOffset);return this.makeImmutable(),this._rows}get rows(){return this._rows}get json(){if(this.rows.length>0){const t=this.rows[0].filter(n=>typeof n=="string");return Object.freeze(this.rows.filter((n,r)=>n&&r>0).map(n=>{const r={};return t.forEach((o,i)=>{r[o]=n[i]}),Object.freeze(r)}))}return Object.freeze([])}handleNext(){this.handleQuote()||this.handleFieldSeparator()||this.handleLineSeparator(),this.processState()}handleQuote(){return this._current===this._options.quote?(this._quoteState=Ce({},this._state),this._previous==="\\"?this.handleQuoteEscaped():this.handleQuoteNotEscaped(),!0):!1}handleQuoteEscaped(){this._cell=this._cell.slice(0,Math.max(0,this._cell.length-1))}handleQuoteNotEscaped(){if(this._cell.length===0||this._state.quoted)this._state.quoted=!this._state.quoted;else throw new fM(this._state.line,this._state.lineOffset);this._state.appendCell=!1}handleFieldSeparator(){return this._current===this._options.fieldSeparator?(this._state.quoted||(this._state.appendCell=!1,this._state.appendField=!0),!0):!1}handleLineSeparator(){return this._current===this._options.lineSeparator?(this._state.quoted||(this._state.appendCell=!1,this._state.appendField=!0,this._state.appendRow=!0),!0):!1}processState(){this._state.appendCell&&(this._cell+=this._current),this._state.appendField&&(this.addField(this.fieldValue(this._cell),this._row,this._state),this._cell=""),this._state.appendRow&&(this.addRow(this._row,this._rows,this._state),this._row=[]),this._state.lineOffset++,this._state.fieldOffset++}fieldValue(t){return t}addField(t,n,r){n.push(t),r.field++,r.fieldOffset=-1,r.appendField=!1}addRow(t,n,r){n.push(t),r.field=0,r.line++,r.lineOffset=-1,r.appendRow=!1}makeImmutable(){this.rows.forEach(t=>{t.forEach(n=>Object.freeze(n)),Object.freeze(t)}),Object.freeze(this._rows)}reset(){this._rows=[],this._row=[],this._cell="",this._state=Ce({},dm),this._index=0,this._current="",this._previous="",this._quoteState=Ce({},dm)}}function D0e(e){return mt(this,null,function*(){QF(t=>mt(this,null,function*(){const n=t==null?void 0:t[0];if(!n)return;const r=yield XF(n);if(!r)return;const i=new N0e().parse(r.trim()),s={comp:Zi,min:1,max:9,xs:6,typing:!0},a={skipFirstLines:0,usernameColumn:1,passwordColumn:2,groupColumn:3,redirectColumn:4,overwriteExistingAccounts:!1},c=yield rp({title:"Import accounts from CSV",dialogProps:{maxWidth:"sm"},values:a,form:h=>{const m=i[h.skipFirstLines||0],g=p(m,Ce(Ce({},a),h));return{save:{startIcon:u.createElement(Tp),children:"Go"},fields:[u.createElement(je,{p:1},"Total lines:",i.length),{k:"skipFirstLines",comp:Zi,min:0,max:i.length-1,typing:!0,md:6,helperText:u.createElement(u.Fragment,{},"First line: ",u.createElement("code",{},m.join(", ")))},{k:"overwriteExistingAccounts",comp:Eo,md:6},kt(Ce({k:"usernameColumn"},s),{helperText:u.createElement(u.Fragment,{},"First username: ",g.u)}),kt(Ce({k:"passwordColumn"},s),{helperText:u.createElement(u.Fragment,{},"First password: ",g.p)}),kt(Ce({k:"groupColumn"},s),{helperText:u.createElement(u.Fragment,{},"First group: ",g.g)}),kt(Ce({k:"redirectColumn"},s),{helperText:u.createElement(u.Fragment,{},"First redirect: ",g.r)})]}}});if(!c)return;const{close:d}=Wo({title:"Importing...",Content(){const[h,m]=u.useState(0),[g,y]=u.useState();return u.useEffect(()=>{let v=!1;return setTimeout(()=>mt(this,null,function*(){var P;if(v)return;let S=0,w=0,C=c.skipFirstLines;const x=i.length-C;try{let _=0;for(const I of i){if(v)return;if(C){C--;continue}const k=p(I,c);y(k),m(_++/x),yield Et("add_account",{username:k.u,belongs:(P=k.g)==null?void 0:P.split(","),redirect:k.r,overwrite:c.overwriteExistingAccounts}).then(()=>{if(k.p)return iC(k.u,k.p)},M=>{if(M.code===409)return w++;S++})}}finally{d();const _=x-S-w,I="Results: "+[vu("",S," failed"),vu("",_," succeeded"),vu("",w," skipped because already present")].filter(Boolean).join(", ");un(I,!_&&S?"error":S||w?"warning":"success"),e==null||e()}})),()=>{v=!0}},[]),u.createElement(je,{display:"flex",gap:2,alignItems:"center"},u.createElement(uA,{icon:XE,progress:h}),g==null?void 0:g.u)}});function p(h,m){return{u:h[m.usernameColumn-1],p:h[m.passwordColumn-1],g:h[m.groupColumn-1],r:h[m.redirectColumn-1]}}}),{multiple:!1,accept:".csv"})})}function B0e(){const{username:e}=oa(),{data:t,reload:n,element:r}=Lo("get_accounts"),[o,i]=u.useState([]),s=Array.isArray(o);u.useEffect(()=>{Array.isArray(t==null?void 0:t.list)&&s&&i(o.filter(y=>t.list.find(v=>(v==null?void 0:v.username)===y)))},[t]);const a=t==null?void 0:t.list,c=s&&St.find(a,{username:o[0]}),p=Yl("md"),h=!(o.length>0)||!a?null:s&&o.length>1?u.createElement(u.Fragment,{},u.createElement(Ql,{alignItems:"center"},u.createElement(Tr,{variant:"h6"},o.length+" selected"),u.createElement(mr,{onClick:g,startIcon:u.createElement(bs)},"Remove")),u.createElement(Jv,{},o.map(y=>u.createElement(mF,{key:y},u.createElement(cs,{},y))))):u.createElement(A0e,{account:c||{username:"",hasPassword:o==="new-user"},groups:a.filter(y=>!y.hasPassword).map(y=>y.username),addToBar:p&&u.createElement(zn,{icon:Rp,title:"Close",onClick:m}),reload:n,done(y){i([y]),n()}});return u.useEffect(()=>{if(p||!h||!o.length)return;const{close:y}=Wo({title:St.isString(o)?St.startCase(o):o.length>1?"Multiple selection":c?(c.hasPassword?"User: ":"Group: ")+c.username:"?",Content:()=>h,onClose:m});return y},[p,o,c]),r||u.createElement(Jn,{container:!0,maxWidth:"80em"},u.createElement(Jn,{item:!0,xs:12},u.createElement(je,{display:"flex",flexWrap:"wrap",gap:2,mb:2,sx:{position:"sticky",top:0,zIndex:2,backgroundColor:"background.paper",width:"fit-content"}},u.createElement(H4,{variant:"contained",startIcon:u.createElement(KN),items:[{children:"user",onClick:()=>i("new-user")},{children:"group",onClick:()=>i("new-group")},{children:"from CSV",onClick:()=>D0e(n)}]},"Add"),$S(n),(a==null?void 0:a.length)>0&&u.createElement(Tr,{p:1},`${a.length} account(s)`))),u.createElement(Jn,{item:!0,md:5},!(a!=null&&a.length)&&u.createElement(Uo,{severity:"info"},ts`To access administration _remotely_ you will need to create a user account with admin permission`),u.createElement(rA,{multiSelect:!0,sx:{pr:4,pb:2,minWidth:"15em"},selected:s?o:[],onNodeSelect(y,v){i(v)}},a==null?void 0:a.map(y=>{var v,S;return u.createElement(Ow,{key:y.username,nodeId:y.username,label:u.createElement(je,{sx:{display:"flex",flexWrap:"wrap",padding:".2em 0",gap:".5em",alignItems:"center"}},qN(y),y.adminActualAccess&&xo(WN,"Can login into Admin"),y.username,!!((v=y.belongs)!=null&&v.length)&&u.createElement(je,{sx:{color:"text.secondary",fontSize:"small"}},"(",(S=y.belongs)==null?void 0:S.join(", "),")"))})}))),p&&h&&u.createElement(Jn,{item:!0,md:7},u.createElement(Bx,{},u.createElement(zx,{},h))));function m(){i([])}function g(){return mt(this,null,function*(){if(o.length>St.pull(o,e).length&&(yield un("Won't delete current account","warning")),!!o.length&&(yield qs(`Delete ${o.length} item(s)?`)))try{const y=[];for(const v of o)(yield Et("del_account",{username:v}).then(()=>1,()=>0))||y.push(v);if(n(),y.length)return un("Following elements couldn't be deleted: "+y.join(", "),"error")}catch(y){yield un(y)}})}}function qN(e,t={}){return u.createElement(e.hasPassword?GN:XE,t)}var tP={},z0e=ut;Object.defineProperty(tP,"__esModule",{value:!0});var YN=tP.default=void 0,j0e=z0e(dt()),H0e=at(),V0e=(0,j0e.default)((0,H0e.jsx)("path",{d:"M13 3h-2v10h2V3zm4.83 2.17-1.42 1.42C17.99 7.86 19 9.81 19 12c0 3.87-3.13 7-7 7s-7-3.13-7-7c0-2.19 1.01-4.14 2.58-5.42L6.17 5.17C4.23 6.82 3 9.26 3 12c0 4.97 4.03 9 9 9s9-4.03 9-9c0-2.74-1.23-5.18-3.17-6.83z"}),"PowerSettingsNew");YN=tP.default=V0e;function U0e(){const{element:e}=Lo("get_config",{only:[]}),{username:t}=oa();return e||u.createElement(je,{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:2},t?u.createElement(u.Fragment,{},"You are logged in as: "+t,u.createElement(yu,{icon:Qx,size:"large",variant:"contained",onClick:()=>Et("logout").catch(r=>r.code!==401&&un(r))},"I want to logout")):u.createElement(Uo,{severity:"info"},"You are not logged in, because authentication is not required on localhost"),u.createElement(yu,{icon:YN,size:"large",variant:"contained",color:"warning",confirm:"Stopping the server, this interface won't respond anymore",onClick(){return mt(this,null,function*(){yield Et("quit"),yield un("Good-bye","success"),location.reload()})}},"Quit HFS"))}function W0e(){const{list:e,error:t,connecting:n,reload:r}=sc("list_langs"),o=u.useMemo(()=>["en",...St.uniq(e.map(a=>a.code))],[e]),i=Yl("md");return t||u.createElement(u.Fragment,{},i&&u.createElement(Uo,{severity:"info"},"Translation is limited to Front-end, it doesn't apply to Admin-panel"),u.createElement(je,{mt:1,maxWidth:"40em",flex:1,display:"flex",flexDirection:"column"},u.createElement(je,{mb:1,display:"flex"},u.createElement(mr,{variant:"contained",startIcon:u.createElement(Tp),onClick:s},"Add"),u.createElement(je,{flex:1}),u.createElement(G0e,{langs:o})),u.createElement(Dp,{loading:n,rows:e,hideFooter:!0,sx:{flex:1},columns:[{field:"code",width:110,valueFormatter:({value:a})=>a==null?void 0:a.toUpperCase()},{field:"version",width:120,hideUnder:"sm"},{field:"hfs_version",headerName:"HFS version",width:110},{field:"author",flex:1,hideUnder:"sm"}],actions:({row:a})=>[u.createElement(zn,{icon:bs,title:a.embedded?"Cannot delete (embedded)":"Delete",confirm:"Delete?",disabled:a.embedded,onClick(){return mt(this,null,function*(){yield Et("del_lang",St.pick(a,"code")),r(),Wr("Deleted")})}})]})));function s(){QF(a=>mt(this,null,function*(){if(!a)return;const c={};for(const d of a)c[d.name]=yield XF(d);try{yield Et("add_langs",{langs:c}),r(),Wr("Loaded")}catch(d){yield un(d)}}),{accept:".json"})}}function G0e({langs:e}){const t="force_lang",{data:n,reload:r,loading:o}=Lo("get_config",{only:[t]}),[i,s]=u.useState();u.useEffect(()=>s(o?i:n[t]),[o]);const[a,c]=u.useState();return u.createElement(gs,{fullWidth:!1,disabled:o||typeof a=="string",value:a!=null?a:i,onChange(p){return mt(this,null,function*(){c(p);try{yield Et("set_config",{values:{[t]:p}}),yield r()}finally{c(void 0)}})},options:[{label:"Respect browser language",value:""},...e.map(p=>({value:p,label:"Force language: "+p}))]})}function K0e(){const[e,t]=u.useState(0),n=ule(Hg);return u.createElement(u.Fragment,{},u.createElement(IF,{value:e,onChange(r,o){t(o)}},n.map(r=>u.createElement(EF,{label:Hg[r],key:r}))),u.createElement(q0e,{key:e,file:n[e]}))}function q0e({file:e}){const{list:t,error:n,connecting:r}=sc("get_log",{file:e});return n||u.createElement(Dp,{loading:r,rows:t,componentsProps:{pagination:{showFirstButton:!0,showLastButton:!0}},columns:e==="console"?[{field:"ts",headerName:"Timestamp",type:"dateTime",width:90,valueGetter:({value:o})=>new Date(o),renderCell:({value:o})=>u.createElement(je,{},o.toLocaleDateString(),u.createElement("br"),o.toLocaleTimeString())},{field:"k",headerName:"Level",hideUnder:"sm"},{field:"msg",headerName:"Message",flex:1,mergeRender:{other:"k",override:{valueFormatter:({value:o})=>o!=="log"&&o}}}]:[{field:"ip",headerName:"Address",flex:.6,minWidth:100,maxWidth:230,mergeRender:{other:"user"}},{field:"user",headerName:"Username",flex:.4,maxWidth:200,hideUnder:"lg"},{field:"ts",headerName:"Timestamp",type:"dateTime",width:90,valueGetter:({value:o})=>new Date(o),renderCell:({value:o})=>u.createElement(je,{},o.toLocaleDateString(),u.createElement("br"),o.toLocaleTimeString())},{field:"method",headerName:"Method",width:80,hideUnder:"lg"},{field:"status",headerName:"Code",type:"number",width:70,hideUnder:"lg"},{field:"length",headerName:"Size",type:"number",hideUnder:"md",valueFormatter:({value:o})=>ql(o)},{field:"uri",headerName:"URI",flex:2,minWidth:100,mergeRender:{other:"method",fontSize:"small"},valueFormatter:({value:o})=>{if(o=decodeURIComponent(o),!o.startsWith(Sg))return o;const i=Sg.length,s=o.indexOf("?",i),a=o.slice(i,s>0?s:1/0),c=s<0?"":Array.from(new URLSearchParams(o.slice(s))).map(d=>{var p;return`${d[0]}=${(p=dse(d[1]))!=null?p:d[1]}`}).join(" ; ");return`API ${a} ${c}`}}]})}var nP={},Y0e=ut;Object.defineProperty(nP,"__esModule",{value:!0});var sC=nP.default=void 0,Q0e=Y0e(dt()),X0e=at(),J0e=(0,Q0e.default)((0,X0e.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4 14H8V8h8v8z"}),"StopCircle");sC=nP.default=J0e;var rP={},Z0e=ut;Object.defineProperty(rP,"__esModule",{value:!0});var QN=rP.default=void 0,e1e=Z0e(dt()),t1e=at(),n1e=(0,e1e.default)((0,t1e.jsx)("path",{d:"M16 18v2H8v-2h8zM11 7.99V16h2V7.99h3L12 4 8 7.99h3z"}),"Upgrade");QN=rP.default=n1e;function XN(c){var d=c,{label:e,helperText:t,fields:n,value:r,onChange:o,onError:i,getApi:s}=d,a=Yt(d,["label","helperText","fields","value","onChange","onError","getApi"]);const p=u.useMemo(()=>(r||[]).map((g,y)=>ise(Ce({},g),g.hasOwnProperty("id")?{$idx:y}:{id:y})),[JSON.stringify(r)]),h={fields:n.map(S=>{var w=S,{$width:g,$column:y}=w,v=Yt(w,["$width","$column"]);return v})},m=u.useMemo(()=>[...n.map(g=>{var y;return Ce(Ce({field:g.k,headerName:(y=g.headerName)!=null?y:typeof g.label=="string"?g.label:iA(g.k),disableColumnMenu:!0},g.$width>=8?{width:g.$width}:{flex:g.$width||1}),g.$column)}),{field:"",width:80,disableColumnMenu:!0,sortable:!1,align:"center",headerAlign:"center",renderHeader(){const g="Add";return u.createElement(zn,{icon:dy,title:g,onClick:y=>rp({form:h,title:g}).then(v=>v&&o([...r||[],v],{was:r,event:y}))})},renderCell({row:g}){const{$idx:y=g.id}=g,v="Modify";return u.createElement("div",{},u.createElement(zn,{icon:HE,title:v,onClick:S=>rp({values:g,form:h,title:v}).then(w=>{if(!w)return;const C=r.map((x,P)=>P===y?w:x);o(C,{was:r,event:S})})}),u.createElement(zn,{icon:bs,title:"Delete",confirm:"Delete?",onClick(S){const w=r.filter((C,x)=>x!==y);o(w,{was:r,event:S})}}))}}],[n,r,o]);return u.createElement(u.Fragment,{},e&&u.createElement(oF,{sx:{ml:1}},e),t&&u.createElement(_p,{},t),u.createElement(je,Ce({height:"20em"},a),u.createElement(I4,{columns:m,rows:p,hideFooterSelectedRowCount:!0,hideFooter:!0,componentsProps:{pagination:{showFirstButton:!0,showLastButton:!0}}})))}function pM({updates:e}){const{list:t,updateEntry:n,error:r,initializing:o}=sc(e?"get_plugin_updates":"get_plugins");return r?eD(r):u.createElement(Dp,{rows:t.length?t:[],initializing:o,disableColumnSelector:!0,disableColumnMenu:!0,hideFooter:!0,noRows:e&&'No updates available. Only plugins available on "search online" are checked.',columns:[{field:"id",headerName:"name",flex:.3,minWidth:150,renderCell:JN,mergeRender:{other:"description",fontSize:"x-small"}},{field:"version",width:70,hideUnder:"sm"},{field:"description",flex:1,hideUnder:"sm"}],actions:({row:i,id:s})=>e?[u.createElement(tD,{id:s,updated:i.updated,then:()=>n({id:s},{updated:!0})})]:[u.createElement(zn,i.started?{icon:sC,title:u.createElement(je,{},`Stop ${s}`,u.createElement("br"),"Started "+new Date(i.started).toLocaleString()),size:"small",color:"success",onClick(){return mt(this,null,function*(){yield Et("stop_plugin",{id:s}),Wr("Plugin stopped",u.createElement(sC,{color:"warning"}))})}}:{icon:hy,title:`Start ${s}`,size:"small",onClick:()=>nD(s)}),u.createElement(zn,{icon:tS,title:"Options",size:"small",disabled:!i.started&&"Start plugin to access options"||!i.config&&"No options available for this plugin",progress:!1,onClick(){return mt(this,null,function*(){const p=yield Et("get_plugin",{id:s}),h=yield rp({title:`${s} options`,form:{before:u.createElement(je,{mx:2,mb:3},i.description),fields:ZN(i.config)},values:p.config,dialogProps:St.merge({sx:{m:"auto"}},i.configDialog)});!h||St.isEqual(p.config,h)||(yield Et("set_plugin",{id:s,config:h}),Wr("Configuration saved"))})}}),u.createElement(zn,{icon:bs,title:"Uninstall",size:"small",confirm:"Remove?",onClick(){return mt(this,null,function*(){yield Et("uninstall_plugin",{id:s}),Wr("Plugin uninstalled")})}})]})}function JN({row:e,value:t}){const{repo:n}=e,r=n==null?void 0:n.split("/");return u.createElement(u.Fragment,{},o(e.badApi,!0),o(e.error),...n?[u.createElement(Mo,{href:"https://github.com/"+n,target:"plugin"},r[1])," by ",r[0]]:[t]);function o(i,s=!1){return i&&u.createElement(nd,{title:i,children:u.createElement(ty,{fontSize:"small",color:s?"warning":"error",sx:{ml:-.5,mr:.5}})})}}function ZN(e){return Object.entries(e).map(([t,n])=>{if(!St.isPlainObject(n))return n;let d=n,{type:r,defaultValue:o,fields:i,frontend:s}=d,a=Yt(d,["type","defaultValue","fields","frontend"]);const c=r1e[r];return c===XN&&(i=ZN(i)),o!==void 0&&r==="boolean"&&(a.placeholder=`Default value is ${JSON.stringify(o)}`),Ce({k:t,comp:c,fields:i},a)})}const r1e={string:io,number:Zi,boolean:Eo,select:gs,multiselect:SS,array:XN,real_path:_f};function eD(e){return u.createElement(Uo,{severity:"error"},dle(e,{github_quota:"Request denied. You may have reached the limit, retry later.",ENOTFOUND:"Couldn't reach github.com"}))}function tD({id:e,updated:t,then:n}){return u.createElement(zn,{icon:QN,title:t?"Already updated":"Update",disabled:t,onClick(){return mt(this,null,function*(){yield Et("update_plugin",{id:e},{timeout:!1}),n==null||n(e),Wr("Plugin updated")})}})}function nD(e){return mt(this,null,function*(){yield Et("start_plugin",{id:e}),Wr("Plugin started",u.createElement(hy,{color:"success"}))})}var oP={},o1e=ut;Object.defineProperty(oP,"__esModule",{value:!0});var rD=oP.default=void 0,i1e=o1e(dt()),s1e=at(),l1e=(0,i1e.default)((0,s1e.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");rD=oP.default=l1e;function a1e(){const[e,t]=u.useState(""),n=fS(e,1e3),{list:r,error:o,initializing:i,updateList:s}=sc("search_online_plugins",{text:n}),a=oa();return o?eD(o):u.createElement(u.Fragment,{},u.createElement(io,{value:e,onChange:t,start:u.createElement(rD),typing:!0,label:"Search text"}),u.createElement(Dp,{rows:r.length?r:[],noRows:"No compatible plugins have been found",initializing:i,columnVisibilityModel:a.onlinePluginsColumns,onColumnVisibilityModelChange:c=>Object.assign(pn.onlinePluginsColumns,c),columns:[{field:"id",headerName:"name",flex:1,renderCell:JN,mergeRender:{other:"description",fontSize:"x-small"}},{field:"version",width:70},{field:"pushed_at",headerName:"last update",valueGetter:({value:c})=>new Date(c).toLocaleDateString()},{field:"license",width:80},{field:"description",flex:3,hideUnder:"sm"},{field:"stargazers_count",width:50,headerName:"stars",align:"center",hideUnder:"sm"}],actions:({row:c,id:d})=>[c.update?u.createElement(tD,{id:d,then(){s(h=>St.find(h,{id:d}).update=!1)}}):u.createElement(zn,{icon:GS,title:"Install",progress:c.downloading,disabled:c.installed&&"Already installed",tooltipProps:{placement:"bottom-end"},confirm:"WARNING - Proceed only if you trust this author and this plugin",onClick(){return mt(this,null,function*(){const h=c.branch||c.default_branch;try{const m=yield Et("download_plugin",{id:d,branch:h},{timeout:!1});yield nD(m.id)}catch(m){if(m.code!==424)throw m;const g=u.createElement(u.Fragment,{},"This plugin has some dependencies unmet:",m.data.map(y=>u.createElement("li",{},y.repo+": "+y.error)));return un(g,"error")}})}})]}))}const oD={Installed:pM,"Search online|Search":a1e,"Check updates|Updates":()=>u.createElement(pM,{updates:!0})},c1e=Object.keys(oD),u1e=Object.values(oD);function d1e(){const[e,t]=u.useState(0),n=!Yl("sm");return u.createElement(u.Fragment,{},u.createElement(IF,{value:e,onChange(r,o){t(o)}},c1e.map(r=>u.createElement(EF,{key:r,label:r.split("|").slice(n?-1:0)[0]}))),u.createElement(u1e[e]))}var iD={},f1e=Sn&&Sn.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),fr=Sn&&Sn.__assign||function(){return fr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},fr.apply(this,arguments)},p1e=Sn&&Sn.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),h1e=Sn&&Sn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),m1e=Sn&&Sn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&p1e(t,e,n);return h1e(t,e),t},g1e=Sn&&Sn.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};Object.defineProperty(iD,"__esModule",{value:!0});var Xd=m1e(u),v1e=13,y1e=9,b1e=8,w1e=89,fm=90,C1e=77,hM=57,mM=219,gM=222,vM=192,x1e=27,yM=100,S1e=3e3,E1e=typeof window!="undefined"&&"navigator"in window&&/Win/i.test(navigator.platform),ub=typeof window!="undefined"&&"navigator"in window&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),zm="npm__react-simple-code-editor__textarea",P1e=`
|
|
486
486
|
/**
|
|
487
487
|
* Reset the text fill color so that placeholder is visible
|
|
488
488
|
*/
|
|
@@ -508,11 +508,11 @@ This functionality is just to help you copy the link in case you have a domain o
|
|
|
508
508
|
color: transparent !important;
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
|
-
`),
|
|
512
|
-
`)},n._recordChange=function(r,o){var i,s,a;o===void 0&&(o=!1);var c=n._history,d=c.stack,p=c.offset;if(d.length&&p>-1){n._history.stack=d.slice(0,p+1);var h=n._history.stack.length;if(h>yM){var m=h-yM;n._history.stack=d.slice(m,h),n._history.offset=Math.max(n._history.offset-m,0)}}var g=Date.now();if(o){var y=n._history.stack[n._history.offset];if(y&&g-y.timestamp<
|
|
511
|
+
`),I1e=function(e){f1e(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state={capture:!0},n._recordCurrentState=function(){var r=n._input;if(r){var o=r.value,i=r.selectionStart,s=r.selectionEnd;n._recordChange({value:o,selectionStart:i,selectionEnd:s})}},n._getLines=function(r,o){return r.substring(0,o).split(`
|
|
512
|
+
`)},n._recordChange=function(r,o){var i,s,a;o===void 0&&(o=!1);var c=n._history,d=c.stack,p=c.offset;if(d.length&&p>-1){n._history.stack=d.slice(0,p+1);var h=n._history.stack.length;if(h>yM){var m=h-yM;n._history.stack=d.slice(m,h),n._history.offset=Math.max(n._history.offset-m,0)}}var g=Date.now();if(o){var y=n._history.stack[n._history.offset];if(y&&g-y.timestamp<S1e){var v=/[^a-z0-9]([a-z0-9]+)$/i,S=(i=n._getLines(y.value,y.selectionStart).pop())===null||i===void 0?void 0:i.match(v),w=(s=n._getLines(r.value,r.selectionStart).pop())===null||s===void 0?void 0:s.match(v);if(S!=null&&S[1]&&(!((a=w==null?void 0:w[1])===null||a===void 0)&&a.startsWith(S[1]))){n._history.stack[n._history.offset]=fr(fr({},r),{timestamp:g});return}}}n._history.stack.push(fr(fr({},r),{timestamp:g})),n._history.offset++},n._updateInput=function(r){var o=n._input;o&&(o.value=r.value,o.selectionStart=r.selectionStart,o.selectionEnd=r.selectionEnd,n.props.onValueChange(r.value))},n._applyEdits=function(r){var o=n._input,i=n._history.stack[n._history.offset];i&&o&&(n._history.stack[n._history.offset]=fr(fr({},i),{selectionStart:o.selectionStart,selectionEnd:o.selectionEnd})),n._recordChange(r),n._updateInput(r)},n._undoEdit=function(){var r=n._history,o=r.stack,i=r.offset,s=o[i-1];s&&(n._updateInput(s),n._history.offset=Math.max(i-1,0))},n._redoEdit=function(){var r=n._history,o=r.stack,i=r.offset,s=o[i+1];s&&(n._updateInput(s),n._history.offset=Math.min(i+1,o.length-1))},n._handleKeyDown=function(r){var o=n.props,i=o.tabSize,s=o.insertSpaces,a=o.ignoreTabKey,c=o.onKeyDown;if(!(c&&(c(r),r.defaultPrevented))){r.keyCode===x1e&&r.currentTarget.blur();var d=r.currentTarget,p=d.value,h=d.selectionStart,m=d.selectionEnd,g=(s?" ":" ").repeat(i);if(r.keyCode===y1e&&!a&&n.state.capture)if(r.preventDefault(),r.shiftKey){var y=n._getLines(p,h),v=y.length-1,S=n._getLines(p,m).length-1,w=p.split(`
|
|
513
513
|
`).map(function(D,B){return B>=v&&B<=S&&D.startsWith(g)?D.substring(g.length):D}).join(`
|
|
514
514
|
`);if(p!==w){var C=y[v];n._applyEdits({value:w,selectionStart:C!=null&&C.startsWith(g)?h-g.length:h,selectionEnd:m-(p.length-w.length)})}}else if(h!==m){var y=n._getLines(p,h),x=y.length-1,P=n._getLines(p,m).length-1,C=y[x];n._applyEdits({value:p.split(`
|
|
515
515
|
`).map(function(R,A){return A>=x&&A<=P?g+R:R}).join(`
|
|
516
|
-
`),selectionStart:C&&/\S/.test(C)?h+g.length:h,selectionEnd:m+g.length*(P-x+1)})}else{var _=h+g.length;n._applyEdits({value:p.substring(0,h)+g+p.substring(m),selectionStart:_,selectionEnd:_})}else if(r.keyCode===
|
|
517
|
-
`+O[0],_=h+F.length;n._applyEdits({value:p.substring(0,h)+F+p.substring(m),selectionStart:_,selectionEnd:_})}}}else if(r.keyCode===hM||r.keyCode===mM||r.keyCode===gM||r.keyCode===vM){var L=void 0;r.keyCode===hM&&r.shiftKey?L=["(",")"]:r.keyCode===mM?r.shiftKey?L=["{","}"]:L=["[","]"]:r.keyCode===gM?r.shiftKey?L=['"','"']:L=["'","'"]:r.keyCode===vM&&!r.shiftKey&&(L=["`","`"]),h!==m&&L&&(r.preventDefault(),n._applyEdits({value:p.substring(0,h)+L[0]+p.substring(h,m)+L[1]+p.substring(m),selectionStart:h,selectionEnd:m+2}))}else(ub?r.metaKey&&r.keyCode===fm:r.ctrlKey&&r.keyCode===fm)&&!r.shiftKey&&!r.altKey?(r.preventDefault(),n._undoEdit()):(ub?r.metaKey&&r.keyCode===fm&&r.shiftKey:
|
|
518
|
-
(ctrl+s)`,sx:fy(d),onClick:p})),u.createElement(
|
|
516
|
+
`),selectionStart:C&&/\S/.test(C)?h+g.length:h,selectionEnd:m+g.length*(P-x+1)})}else{var _=h+g.length;n._applyEdits({value:p.substring(0,h)+g+p.substring(m),selectionStart:_,selectionEnd:_})}else if(r.keyCode===b1e){var I=h!==m,k=p.substring(0,h);if(k.endsWith(g)&&!I){r.preventDefault();var _=h-g.length;n._applyEdits({value:p.substring(0,h-g.length)+p.substring(m),selectionStart:_,selectionEnd:_})}}else if(r.keyCode===v1e){if(h===m){var M=n._getLines(p,h).pop(),O=M==null?void 0:M.match(/^\s+/);if(O!=null&&O[0]){r.preventDefault();var F=`
|
|
517
|
+
`+O[0],_=h+F.length;n._applyEdits({value:p.substring(0,h)+F+p.substring(m),selectionStart:_,selectionEnd:_})}}}else if(r.keyCode===hM||r.keyCode===mM||r.keyCode===gM||r.keyCode===vM){var L=void 0;r.keyCode===hM&&r.shiftKey?L=["(",")"]:r.keyCode===mM?r.shiftKey?L=["{","}"]:L=["[","]"]:r.keyCode===gM?r.shiftKey?L=['"','"']:L=["'","'"]:r.keyCode===vM&&!r.shiftKey&&(L=["`","`"]),h!==m&&L&&(r.preventDefault(),n._applyEdits({value:p.substring(0,h)+L[0]+p.substring(h,m)+L[1]+p.substring(m),selectionStart:h,selectionEnd:m+2}))}else(ub?r.metaKey&&r.keyCode===fm:r.ctrlKey&&r.keyCode===fm)&&!r.shiftKey&&!r.altKey?(r.preventDefault(),n._undoEdit()):(ub?r.metaKey&&r.keyCode===fm&&r.shiftKey:E1e?r.ctrlKey&&r.keyCode===w1e:r.ctrlKey&&r.keyCode===fm&&r.shiftKey)&&!r.altKey?(r.preventDefault(),n._redoEdit()):r.keyCode===C1e&&r.ctrlKey&&(!ub||r.shiftKey)&&(r.preventDefault(),n.setState(function(D){return{capture:!D.capture}}))}},n._handleChange=function(r){var o=r.currentTarget,i=o.value,s=o.selectionStart,a=o.selectionEnd;n._recordChange({value:i,selectionStart:s,selectionEnd:a},!0),n.props.onValueChange(i)},n._history={stack:[],offset:-1},n._input=null,n}return t.prototype.componentDidMount=function(){this._recordCurrentState()},Object.defineProperty(t.prototype,"session",{get:function(){return{history:this._history}},set:function(n){this._history=n.history},enumerable:!1,configurable:!0}),t.prototype.render=function(){var n=this,r=this.props,o=r.value,i=r.style,s=r.padding,a=r.highlight,c=r.textareaId,d=r.textareaClassName,p=r.autoFocus,h=r.disabled,m=r.form,g=r.maxLength,y=r.minLength,v=r.name,S=r.placeholder,w=r.readOnly,C=r.required,x=r.onClick,P=r.onFocus,_=r.onBlur,I=r.onKeyUp;r.onKeyDown,r.onValueChange,r.tabSize,r.insertSpaces,r.ignoreTabKey;var k=r.preClassName,M=g1e(r,["value","style","padding","highlight","textareaId","textareaClassName","autoFocus","disabled","form","maxLength","minLength","name","placeholder","readOnly","required","onClick","onFocus","onBlur","onKeyUp","onKeyDown","onValueChange","tabSize","insertSpaces","ignoreTabKey","preClassName"]),O={paddingTop:typeof s=="object"?s.top:s,paddingRight:typeof s=="object"?s.right:s,paddingBottom:typeof s=="object"?s.bottom:s,paddingLeft:typeof s=="object"?s.left:s},F=a(o);return Xd.createElement("div",fr({},M,{style:fr(fr({},Jd.container),i)}),Xd.createElement("pre",fr({className:k,"aria-hidden":"true",style:fr(fr(fr({},Jd.editor),Jd.highlight),O)},typeof F=="string"?{dangerouslySetInnerHTML:{__html:F+"<br />"}}:{children:F})),Xd.createElement("textarea",{ref:function(L){return n._input=L},style:fr(fr(fr({},Jd.editor),Jd.textarea),O),className:zm+(d?" ".concat(d):""),id:c,value:o,onChange:this._handleChange,onKeyDown:this._handleKeyDown,onClick:x,onKeyUp:I,onFocus:P,onBlur:_,disabled:h,form:m,maxLength:g,minLength:y,name:v,placeholder:S,readOnly:w,required:C,autoFocus:p,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),Xd.createElement("style",{dangerouslySetInnerHTML:{__html:P1e}}))},t.defaultProps={tabSize:2,insertSpaces:!0,ignoreTabKey:!1,padding:0},t}(Xd.Component),k1e=iD.default=I1e,Jd={container:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden"},textarea:{position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",WebkitTextFillColor:"transparent"},highlight:{position:"relative",pointerEvents:"none"},editor:{margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"}};function _1e(){const{data:e,reload:t}=Lo("get_custom_html"),[n,r]=u.useState(""),[o,i]=u.useState({}),[s,a]=u.useState({});u.useEffect(()=>e&&a(e==null?void 0:e.sections),[e]),u.useEffect(()=>i(s),[s]);const c=u.useMemo(()=>{const h=Object.keys(o);return h.includes(n)||r((h==null?void 0:h[0])||""),h.map(m=>{var g;return{value:m,label:St.startCase(m)+((g=o[m])!=null&&g.trim()?" *":"")}})},[fS(o,500)]),d=u.useMemo(()=>!St.isEqualWith(s,o,(h,m)=>!h&&!m||void 0),[s,o]);return u.createElement(u.Fragment,{},u.createElement(Uo,{severity:"info"},ts("Add HTML code to some parts of the Front-end. It's saved to file `custom.html`, that you can edit directly with your editor of choice. "),Ya("customization","More help")),u.createElement(je,{display:"flex",alignItems:"center",gap:1,mb:1},u.createElement(gs,{label:"Section",value:n,options:c,onChange:r}),$S(t),u.createElement(zn,{icon:uy,title:`Save
|
|
518
|
+
(ctrl+s)`,sx:fy(d),onClick:p})),u.createElement(k1e,{value:(o==null?void 0:o[n])||"",onValueChange:h=>i(m=>kt(Ce({},m),{[n]:h})),highlight:$1e,onKeyDown:h=>{ple(h)==="s"&&(p().then(),h.preventDefault())},padding:10,tabSize:4,insertSpaces:!0,ignoreTabKey:!1,style:{fontFamily:"ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace",fontSize:"1em",flex:1,background:"#8881"}}));function p(){return Et("set_custom_html",{sections:o}).then(()=>a(o))}}function $1e(e){return e.replace(/[\u0000-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u00FF]/g,t=>"&#"+("000"+t.charCodeAt(0)).slice(-4)+";")}const lC=[{path:"",icon:OF,label:"Home",title:"Admin panel",comp:h0e},{path:"fs",icon:_F,label:"Shared files",comp:zye},{path:"accounts",icon:MF,comp:B0e},{path:"options",icon:tS,comp:g0e},{path:"monitoring",icon:TF,comp:hge},{path:"logs",icon:RF,comp:K0e},{path:"language",icon:LF,comp:W0e},{path:"plugins",icon:$F,comp:d1e},{path:"html",icon:FF,label:"Custom HTML",comp:_1e},{path:"logout",icon:Qx,comp:U0e}];let db;function bM({onSelect:e}){var n;const[t]=ry(!db&&"get_status");return db||(db=(n=t==null?void 0:t.version)==null?void 0:n.replace("-"," ")),u.createElement(je,{display:"flex",flexDirection:"column",bgcolor:"primary.main",minHeight:"100%"},u.createElement(Jv,{sx:{pr:1,color:"primary.contrastText",height:"100vh",boxSizing:"border-box",overflowY:"auto",position:"sticky",top:0,display:"flex",flexDirection:"column","&>a":{flex:"0"}}},u.createElement(je,{display:"flex",px:2,py:1,gap:2,alignItems:"flex-end"},u.createElement(Tr,{variant:"h3"},"HFS"),u.createElement(je,{pb:1,fontSize:"small"},db)),lC.map(r=>u.createElement(Nee,{key:r.path,to:r.path,component:UV,onClick:e,style:({isActive:o})=>o?{textDecoration:"underline"}:{},children:void 0},r.icon&&u.createElement(Bl,{sx:{color:"primary.contrastText",minWidth:48}},u.createElement(r.icon)),u.createElement(cs,{sx:{whiteSpace:"nowrap"},primary:sD(r)}))),u.createElement(je,{sx:{flex:1,opacity:.7,background:"url(hfs-logo.svg) no-repeat bottom",backgroundSize:"contain",margin:2}})))}function sD(e){var t;return e&&((t=e.label)!=null?t:St.capitalize(e.path))}function R1e({children:e}){const{loginRequired:t}=oa();return t===403?u.createElement(py,{},u.createElement(Uo,{severity:"error"},"Admin-panel only for localhost"),u.createElement(je,{mt:2,fontSize:"small"},"because no admin account was configured")):t?u.createElement(M1e):u.createElement(u.Fragment,{},e)}function M1e(){var s;const[e,t]=u.useState({username:"",password:""}),[n,r]=u.useState(""),o=u.useRef(),i=(s=o.current)==null?void 0:s.querySelector('input[value=""]');return u.useEffect(()=>{var c;return(c=i==null?void 0:i.focus)==null?void 0:c.call(i)},[i]),u.createElement(py,{},u.createElement(Mp,{formRef:o,values:e,set(c,d){t(p=>kt(Ce({},p),{[d]:c}))},fields:[{k:"username",autoComplete:"username",autoFocus:!0,required:!0},{k:"password",type:"password",autoComplete:"current-password",required:!0}],addToBar:[n&&u.createElement(Uo,{severity:"error",sx:{flex:1}},n)],saveOnEnter:!0,save:{children:"Enter",startIcon:null,onClick(){return mt(this,null,function*(){try{r(""),yield T1e(e.username,e.password)}catch(c){r(String(c))}})}}}))}function T1e(e,t){return mt(this,null,function*(){const n=yield Jie(e,t,Et).catch(r=>{throw(r==null?void 0:r.code)===401?"Wrong username or password":r==="trust"?"Login aborted: server identity cannot be trusted":(r==null?void 0:r.name)==="AbortError"?"Server didn't respond":(r==null?void 0:r.message)||"Unknown error"});if(!n.adminUrl)throw"This account has no Admin access";pn.loginRequired=!1,lD(n)})}const lD=use(pn);lD(wS().session);var iP={},O1e=ut;Object.defineProperty(iP,"__esModule",{value:!0});var aD=iP.default=void 0,L1e=O1e(dt()),F1e=at(),A1e=(0,L1e.default)((0,F1e.jsx)("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");aD=iP.default=A1e;function N1e(){return u.createElement(PG,{theme:sle()},u.createElement(D1e,{},u.createElement(R1e,{},u.createElement(jV,{},u.createElement(B1e)))))}function D1e(e){return u.createElement(je,Ce({sx:{bgcolor:"background.default",color:"text.primary",display:"flex",flexDirection:"column",minHeight:"100%",flex:1}},e))}function B1e(){const e=Ju().pathname.slice(1),t=lC.find(s=>s.path===e),n=t&&(t.title||sD(t)),[r,o]=u.useState(!1),i=Yl("lg");return u.createElement(u.Fragment,{},!i&&u.createElement(z1e,{title:n,openMenu:()=>o(!0)}),!i&&u.createElement(UJ,{anchor:"left",open:r,onClose(){o(!1)}},u.createElement(bM,{onSelect:()=>o(!1)})),u.createElement(je,{display:"flex",flex:1},i&&u.createElement(bM),u.createElement(je,{component:"main",sx:{background:"url(cup.svg) no-repeat right fixed",backgroundSize:"contain",px:{xs:1,sm:2,md:3},pb:"1em",position:"relative",display:"flex",flexDirection:"column",width:"100%"}},n&&i&&u.createElement(Tr,{variant:"h2",mb:2},n),u.createElement(AV,{},lC.map((s,a)=>u.createElement(jO,{key:a,path:s.path,element:u.createElement(s.comp)})))),u.createElement(Hie)))}function z1e({title:e,openMenu:t}){return u.createElement(VY,{position:"sticky",sx:{mb:2}},u.createElement(PF,{},u.createElement(oo,{size:"large",edge:"start",color:"inherit",sx:{mr:2},"aria-label":"menu",onClick:t},u.createElement(aD)),e))}OO(document.getElementById("root")).render(u.createElement(u.StrictMode,{},u.createElement(N1e)));export{Sn as c,mp as g};
|