groove-dev 0.17.4 → 0.17.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,8 +45,8 @@
45
45
  `);for(y=p=0;p<Y.length&&!Y[p].includes("DetermineComponentFrameRoot");)p++;for(;y<te.length&&!te[y].includes("DetermineComponentFrameRoot");)y++;if(p===Y.length||y===te.length)for(p=Y.length-1,y=te.length-1;1<=p&&0<=y&&Y[p]!==te[y];)y--;for(;1<=p&&0<=y;p--,y--)if(Y[p]!==te[y]){if(p!==1||y!==1)do if(p--,y--,0>y||Y[p]!==te[y]){var se=`
46
46
  `+Y[p].replace(" at new "," at ");return o.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",o.displayName)),se}while(1<=p&&0<=y);break}}}finally{lt=!1,Error.prepareStackTrace=u}return(u=o?o.displayName||o.name:"")?Be(u):""}function Ft(o,l){switch(o.tag){case 26:case 27:case 5:return Be(o.type);case 16:return Be("Lazy");case 13:return o.child!==l&&l!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return He(o.type,!1);case 11:return He(o.type.render,!1);case 1:return He(o.type,!0);case 31:return Be("Activity");default:return""}}function rn(o){try{var l="",u=null;do l+=Ft(o,u),u=o,o=o.return;while(o);return l}catch(p){return`
47
47
  Error generating stack: `+p.message+`
48
- `+p.stack}}var qi=Object.prototype.hasOwnProperty,_n=t.unstable_scheduleCallback,ar=t.unstable_cancelCallback,oe=t.unstable_shouldYield,We=t.unstable_requestPaint,Le=t.unstable_now,sn=t.unstable_getCurrentPriorityLevel,on=t.unstable_ImmediatePriority,Vi=t.unstable_UserBlockingPriority,Go=t.unstable_NormalPriority,Rm=t.unstable_LowPriority,tl=t.unstable_IdlePriority,Am=t.log,Mm=t.unstable_setDisableYieldValue,Fo=null,Ii=null;function wr(o){if(typeof Am=="function"&&Mm(o),Ii&&typeof Ii.setStrictMode=="function")try{Ii.setStrictMode(Fo,o)}catch{}}var Yi=Math.clz32?Math.clz32:Dm,zm=Math.log,jm=Math.LN2;function Dm(o){return o>>>=0,o===0?32:31-(zm(o)/jm|0)|0}var il=256,nl=262144,rl=4194304;function Kr(o){var l=o&42;if(l!==0)return l;switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function sl(o,l,u){var p=o.pendingLanes;if(p===0)return 0;var y=0,b=o.suspendedLanes,C=o.pingedLanes;o=o.warmLanes;var A=p&134217727;return A!==0?(p=A&~b,p!==0?y=Kr(p):(C&=A,C!==0?y=Kr(C):u||(u=A&~o,u!==0&&(y=Kr(u))))):(A=p&~b,A!==0?y=Kr(A):C!==0?y=Kr(C):u||(u=p&~o,u!==0&&(y=Kr(u)))),y===0?0:l!==0&&l!==y&&(l&b)===0&&(b=y&-y,u=l&-l,b>=u||b===32&&(u&4194048)!==0)?l:y}function Ko(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function Bm(o,l){switch(o){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Od(){var o=rl;return rl<<=1,(rl&62914560)===0&&(rl=4194304),o}function Lc(o){for(var l=[],u=0;31>u;u++)l.push(o);return l}function Jo(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Lm(o,l,u,p,y,b){var C=o.pendingLanes;o.pendingLanes=u,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=u,o.entangledLanes&=u,o.errorRecoveryDisabledLanes&=u,o.shellSuspendCounter=0;var A=o.entanglements,Y=o.expirationTimes,te=o.hiddenUpdates;for(u=C&~u;0<u;){var se=31-Yi(u),he=1<<se;A[se]=0,Y[se]=-1;var ne=te[se];if(ne!==null)for(te[se]=null,se=0;se<ne.length;se++){var re=ne[se];re!==null&&(re.lane&=-536870913)}u&=~he}p!==0&&vd(o,p,0),b!==0&&y===0&&o.tag!==0&&(o.suspendedLanes|=b&~(C&~l))}function vd(o,l,u){o.pendingLanes|=l,o.suspendedLanes&=~l;var p=31-Yi(l);o.entangledLanes|=l,o.entanglements[p]=o.entanglements[p]|1073741824|u&261930}function yd(o,l){var u=o.entangledLanes|=l;for(o=o.entanglements;u;){var p=31-Yi(u),y=1<<p;y&l|o[p]&l&&(o[p]|=l),u&=~y}}function Sd(o,l){var u=l&-l;return u=(u&42)!==0?1:Xc(u),(u&(o.suspendedLanes|l))!==0?0:u}function Xc(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function Nc(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function bd(){var o=Z.p;return o!==0?o:(o=window.event,o===void 0?32:zk(o.type))}function _d(o,l){var u=Z.p;try{return Z.p=o,l()}finally{Z.p=u}}var kr=Math.random().toString(36).slice(2),li="__reactFiber$"+kr,Di="__reactProps$"+kr,Jr="__reactContainer$"+kr,ol="__reactEvents$"+kr,xd="__reactListeners$"+kr,Xm="__reactHandles$"+kr,wd="__reactResources$"+kr,ea="__reactMarker$"+kr;function Zc(o){delete o[li],delete o[Di],delete o[ol],delete o[xd],delete o[Xm]}function Zs(o){var l=o[li];if(l)return l;for(var u=o.parentNode;u;){if(l=u[Jr]||u[li]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(o=yk(o);o!==null;){if(u=o[li])return u;o=yk(o)}return l}o=u,u=o.parentNode}return null}function Ws(o){if(o=o[li]||o[Jr]){var l=o.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return o}return null}function qs(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(n(33))}function Vs(o){var l=o[wd];return l||(l=o[wd]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Kt(o){o[ea]=!0}var kd=new Set,Cd={};function es(o,l){Is(o,l),Is(o+"Capture",l)}function Is(o,l){for(Cd[o]=l,o=0;o<l.length;o++)kd.add(l[o])}var Nm=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Wc={},Td={};function Zm(o){return qi.call(Td,o)?!0:qi.call(Wc,o)?!1:Nm.test(o)?Td[o]=!0:(Wc[o]=!0,!1)}function al(o,l,u){if(Zm(l))if(u===null)o.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":o.removeAttribute(l);return;case"boolean":var p=l.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){o.removeAttribute(l);return}}o.setAttribute(l,""+u)}}function ll(o,l,u){if(u===null)o.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(l);return}o.setAttribute(l,""+u)}}function lr(o,l,u,p){if(p===null)o.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(u);return}o.setAttributeNS(l,u,""+p)}}function an(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Qd(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Wm(o,l,u){var p=Object.getOwnPropertyDescriptor(o.constructor.prototype,l);if(!o.hasOwnProperty(l)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var y=p.get,b=p.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return y.call(this)},set:function(C){u=""+C,b.call(this,C)}}),Object.defineProperty(o,l,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(C){u=""+C},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function Ys(o){if(!o._valueTracker){var l=Qd(o)?"checked":"value";o._valueTracker=Wm(o,l,""+o[l])}}function $d(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var u=l.getValue(),p="";return o&&(p=Qd(o)?o.checked?"true":"false":o.value),o=p,o!==u?(l.setValue(o),!0):!1}function ta(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var qm=/[\n"\\]/g;function ln(o){return o.replace(qm,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function ia(o,l,u,p,y,b,C,A){o.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?o.type=C:o.removeAttribute("type"),l!=null?C==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+an(l)):o.value!==""+an(l)&&(o.value=""+an(l)):C!=="submit"&&C!=="reset"||o.removeAttribute("value"),l!=null?qc(o,C,an(l)):u!=null?qc(o,C,an(u)):p!=null&&o.removeAttribute("value"),y==null&&b!=null&&(o.defaultChecked=!!b),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?o.name=""+an(A):o.removeAttribute("name")}function Pd(o,l,u,p,y,b,C,A){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(o.type=b),l!=null||u!=null){if(!(b!=="submit"&&b!=="reset"||l!=null)){Ys(o);return}u=u!=null?""+an(u):"",l=l!=null?""+an(l):u,A||l===o.value||(o.value=l),o.defaultValue=l}p=p??y,p=typeof p!="function"&&typeof p!="symbol"&&!!p,o.checked=A?o.checked:!!p,o.defaultChecked=!!p,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(o.name=C),Ys(o)}function qc(o,l,u){l==="number"&&ta(o.ownerDocument)===o||o.defaultValue===""+u||(o.defaultValue=""+u)}function ts(o,l,u,p){if(o=o.options,l){l={};for(var y=0;y<u.length;y++)l["$"+u[y]]=!0;for(u=0;u<o.length;u++)y=l.hasOwnProperty("$"+o[u].value),o[u].selected!==y&&(o[u].selected=y),y&&p&&(o[u].defaultSelected=!0)}else{for(u=""+an(u),l=null,y=0;y<o.length;y++){if(o[y].value===u){o[y].selected=!0,p&&(o[y].defaultSelected=!0);return}l!==null||o[y].disabled||(l=o[y])}l!==null&&(l.selected=!0)}}function o_(o,l,u){if(l!=null&&(l=""+an(l),l!==o.value&&(o.value=l),u==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=u!=null?""+an(u):""}function a_(o,l,u,p){if(l==null){if(p!=null){if(u!=null)throw Error(n(92));if(X(p)){if(1<p.length)throw Error(n(93));p=p[0]}u=p}u==null&&(u=""),l=u}u=an(l),o.defaultValue=u,p=o.textContent,p===u&&p!==""&&p!==null&&(o.value=p),Ys(o)}function cl(o,l){if(l){var u=o.firstChild;if(u&&u===o.lastChild&&u.nodeType===3){u.nodeValue=l;return}}o.textContent=l}var jz=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function l_(o,l,u){var p=l.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?o.setProperty(l,""):l==="float"?o.cssFloat="":o[l]="":p?o.setProperty(l,u):typeof u!="number"||u===0||jz.has(l)?l==="float"?o.cssFloat=u:o[l]=(""+u).trim():o[l]=u+"px"}function c_(o,l,u){if(l!=null&&typeof l!="object")throw Error(n(62));if(o=o.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||l!=null&&l.hasOwnProperty(p)||(p.indexOf("--")===0?o.setProperty(p,""):p==="float"?o.cssFloat="":o[p]="");for(var y in l)p=l[y],l.hasOwnProperty(y)&&u[y]!==p&&l_(o,y,p)}else for(var b in l)l.hasOwnProperty(b)&&l_(o,b,l[b])}function Vm(o){if(o.indexOf("-")===-1)return!1;switch(o){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 Dz=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Bz=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ed(o){return Bz.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function is(){}var Im=null;function Ym(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var hl=null,ul=null;function h_(o){var l=Ws(o);if(l&&(o=l.stateNode)){var u=o[Di]||null;e:switch(o=l.stateNode,l.type){case"input":if(ia(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),l=u.name,u.type==="radio"&&l!=null){for(u=o;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+ln(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var p=u[l];if(p!==o&&p.form===o.form){var y=p[Di]||null;if(!y)throw Error(n(90));ia(p,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(l=0;l<u.length;l++)p=u[l],p.form===o.form&&$d(p)}break e;case"textarea":o_(o,u.value,u.defaultValue);break e;case"select":l=u.value,l!=null&&ts(o,!!u.multiple,l,!1)}}}var Hm=!1;function u_(o,l,u){if(Hm)return o(l,u);Hm=!0;try{var p=o(l);return p}finally{if(Hm=!1,(hl!==null||ul!==null)&&(yf(),hl&&(l=hl,o=ul,ul=hl=null,h_(l),o)))for(l=0;l<o.length;l++)h_(o[l])}}function Vc(o,l){var u=o.stateNode;if(u===null)return null;var p=u[Di]||null;if(p===null)return null;u=p[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(o=o.type,p=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!p;break e;default:o=!1}if(o)return null;if(u&&typeof u!="function")throw Error(n(231,l,typeof u));return u}var ns=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Um=!1;if(ns)try{var Ic={};Object.defineProperty(Ic,"passive",{get:function(){Um=!0}}),window.addEventListener("test",Ic,Ic),window.removeEventListener("test",Ic,Ic)}catch{Um=!1}var Hs=null,Gm=null,Rd=null;function d_(){if(Rd)return Rd;var o,l=Gm,u=l.length,p,y="value"in Hs?Hs.value:Hs.textContent,b=y.length;for(o=0;o<u&&l[o]===y[o];o++);var C=u-o;for(p=1;p<=C&&l[u-p]===y[b-p];p++);return Rd=y.slice(o,1<p?1-p:void 0)}function Ad(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function Md(){return!0}function f_(){return!1}function cn(o){function l(u,p,y,b,C){this._reactName=u,this._targetInst=y,this.type=p,this.nativeEvent=b,this.target=C,this.currentTarget=null;for(var A in o)o.hasOwnProperty(A)&&(u=o[A],this[A]=u?u(b):b[A]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Md:f_,this.isPropagationStopped=f_,this}return g(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Md)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Md)},persist:function(){},isPersistent:Md}),l}var na={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zd=cn(na),Yc=g({},na,{view:0,detail:0}),Lz=cn(Yc),Fm,Km,Hc,jd=g({},Yc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:eO,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Hc&&(Hc&&o.type==="mousemove"?(Fm=o.screenX-Hc.screenX,Km=o.screenY-Hc.screenY):Km=Fm=0,Hc=o),Fm)},movementY:function(o){return"movementY"in o?o.movementY:Km}}),p_=cn(jd),Xz=g({},jd,{dataTransfer:0}),Nz=cn(Xz),Zz=g({},Yc,{relatedTarget:0}),Jm=cn(Zz),Wz=g({},na,{animationName:0,elapsedTime:0,pseudoElement:0}),qz=cn(Wz),Vz=g({},na,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),Iz=cn(Vz),Yz=g({},na,{data:0}),g_=cn(Yz),Hz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Uz={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"},Gz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fz(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=Gz[o])?!!l[o]:!1}function eO(){return Fz}var Kz=g({},Yc,{key:function(o){if(o.key){var l=Hz[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=Ad(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?Uz[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:eO,charCode:function(o){return o.type==="keypress"?Ad(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Ad(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),Jz=cn(Kz),ej=g({},jd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),m_=cn(ej),tj=g({},Yc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:eO}),ij=cn(tj),nj=g({},na,{propertyName:0,elapsedTime:0,pseudoElement:0}),rj=cn(nj),sj=g({},jd,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),oj=cn(sj),aj=g({},na,{newState:0,oldState:0}),lj=cn(aj),cj=[9,13,27,32],tO=ns&&"CompositionEvent"in window,Uc=null;ns&&"documentMode"in document&&(Uc=document.documentMode);var hj=ns&&"TextEvent"in window&&!Uc,O_=ns&&(!tO||Uc&&8<Uc&&11>=Uc),v_=" ",y_=!1;function S_(o,l){switch(o){case"keyup":return cj.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function b_(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var dl=!1;function uj(o,l){switch(o){case"compositionend":return b_(l);case"keypress":return l.which!==32?null:(y_=!0,v_);case"textInput":return o=l.data,o===v_&&y_?null:o;default:return null}}function dj(o,l){if(dl)return o==="compositionend"||!tO&&S_(o,l)?(o=d_(),Rd=Gm=Hs=null,dl=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return O_&&l.locale!=="ko"?null:l.data;default:return null}}var fj={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 __(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!fj[o.type]:l==="textarea"}function x_(o,l,u,p){hl?ul?ul.push(p):ul=[p]:hl=p,l=Cf(l,"onChange"),0<l.length&&(u=new zd("onChange","change",null,u,p),o.push({event:u,listeners:l}))}var Gc=null,Fc=null;function pj(o){sk(o,0)}function Dd(o){var l=qs(o);if($d(l))return o}function w_(o,l){if(o==="change")return l}var k_=!1;if(ns){var iO;if(ns){var nO="oninput"in document;if(!nO){var C_=document.createElement("div");C_.setAttribute("oninput","return;"),nO=typeof C_.oninput=="function"}iO=nO}else iO=!1;k_=iO&&(!document.documentMode||9<document.documentMode)}function T_(){Gc&&(Gc.detachEvent("onpropertychange",Q_),Fc=Gc=null)}function Q_(o){if(o.propertyName==="value"&&Dd(Fc)){var l=[];x_(l,Fc,o,Ym(o)),u_(pj,l)}}function gj(o,l,u){o==="focusin"?(T_(),Gc=l,Fc=u,Gc.attachEvent("onpropertychange",Q_)):o==="focusout"&&T_()}function mj(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Dd(Fc)}function Oj(o,l){if(o==="click")return Dd(l)}function vj(o,l){if(o==="input"||o==="change")return Dd(l)}function yj(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var xn=typeof Object.is=="function"?Object.is:yj;function Kc(o,l){if(xn(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var u=Object.keys(o),p=Object.keys(l);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var y=u[p];if(!qi.call(l,y)||!xn(o[y],l[y]))return!1}return!0}function $_(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function P_(o,l){var u=$_(o);o=0;for(var p;u;){if(u.nodeType===3){if(p=o+u.textContent.length,o<=l&&p>=l)return{node:u,offset:l-o};o=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=$_(u)}}function E_(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?E_(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function R_(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=ta(o.document);l instanceof o.HTMLIFrameElement;){try{var u=typeof l.contentWindow.location.href=="string"}catch{u=!1}if(u)o=l.contentWindow;else break;l=ta(o.document)}return l}function rO(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}var Sj=ns&&"documentMode"in document&&11>=document.documentMode,fl=null,sO=null,Jc=null,oO=!1;function A_(o,l,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;oO||fl==null||fl!==ta(p)||(p=fl,"selectionStart"in p&&rO(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Jc&&Kc(Jc,p)||(Jc=p,p=Cf(sO,"onSelect"),0<p.length&&(l=new zd("onSelect","select",null,l,u),o.push({event:l,listeners:p}),l.target=fl)))}function ra(o,l){var u={};return u[o.toLowerCase()]=l.toLowerCase(),u["Webkit"+o]="webkit"+l,u["Moz"+o]="moz"+l,u}var pl={animationend:ra("Animation","AnimationEnd"),animationiteration:ra("Animation","AnimationIteration"),animationstart:ra("Animation","AnimationStart"),transitionrun:ra("Transition","TransitionRun"),transitionstart:ra("Transition","TransitionStart"),transitioncancel:ra("Transition","TransitionCancel"),transitionend:ra("Transition","TransitionEnd")},aO={},M_={};ns&&(M_=document.createElement("div").style,"AnimationEvent"in window||(delete pl.animationend.animation,delete pl.animationiteration.animation,delete pl.animationstart.animation),"TransitionEvent"in window||delete pl.transitionend.transition);function sa(o){if(aO[o])return aO[o];if(!pl[o])return o;var l=pl[o],u;for(u in l)if(l.hasOwnProperty(u)&&u in M_)return aO[o]=l[u];return o}var z_=sa("animationend"),j_=sa("animationiteration"),D_=sa("animationstart"),bj=sa("transitionrun"),_j=sa("transitionstart"),xj=sa("transitioncancel"),B_=sa("transitionend"),L_=new Map,lO="abort auxClick beforeToggle 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(" ");lO.push("scrollEnd");function cr(o,l){L_.set(o,l),es(l,[o])}var Bd=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},Zn=[],gl=0,cO=0;function Ld(){for(var o=gl,l=cO=gl=0;l<o;){var u=Zn[l];Zn[l++]=null;var p=Zn[l];Zn[l++]=null;var y=Zn[l];Zn[l++]=null;var b=Zn[l];if(Zn[l++]=null,p!==null&&y!==null){var C=p.pending;C===null?y.next=y:(y.next=C.next,C.next=y),p.pending=y}b!==0&&X_(u,y,b)}}function Xd(o,l,u,p){Zn[gl++]=o,Zn[gl++]=l,Zn[gl++]=u,Zn[gl++]=p,cO|=p,o.lanes|=p,o=o.alternate,o!==null&&(o.lanes|=p)}function hO(o,l,u,p){return Xd(o,l,u,p),Nd(o)}function oa(o,l){return Xd(o,null,null,l),Nd(o)}function X_(o,l,u){o.lanes|=u;var p=o.alternate;p!==null&&(p.lanes|=u);for(var y=!1,b=o.return;b!==null;)b.childLanes|=u,p=b.alternate,p!==null&&(p.childLanes|=u),b.tag===22&&(o=b.stateNode,o===null||o._visibility&1||(y=!0)),o=b,b=b.return;return o.tag===3?(b=o.stateNode,y&&l!==null&&(y=31-Yi(u),o=b.hiddenUpdates,p=o[y],p===null?o[y]=[l]:p.push(l),l.lane=u|536870912),b):null}function Nd(o){if(50<bh)throw bh=0,y0=null,Error(n(185));for(var l=o.return;l!==null;)o=l,l=o.return;return o.tag===3?o.stateNode:null}var ml={};function wj(o,l,u,p){this.tag=o,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wn(o,l,u,p){return new wj(o,l,u,p)}function uO(o){return o=o.prototype,!(!o||!o.isReactComponent)}function rs(o,l){var u=o.alternate;return u===null?(u=wn(o.tag,l,o.key,o.mode),u.elementType=o.elementType,u.type=o.type,u.stateNode=o.stateNode,u.alternate=o,o.alternate=u):(u.pendingProps=l,u.type=o.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=o.flags&65011712,u.childLanes=o.childLanes,u.lanes=o.lanes,u.child=o.child,u.memoizedProps=o.memoizedProps,u.memoizedState=o.memoizedState,u.updateQueue=o.updateQueue,l=o.dependencies,u.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},u.sibling=o.sibling,u.index=o.index,u.ref=o.ref,u.refCleanup=o.refCleanup,u}function N_(o,l){o.flags&=65011714;var u=o.alternate;return u===null?(o.childLanes=0,o.lanes=l,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=u.childLanes,o.lanes=u.lanes,o.child=u.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=u.memoizedProps,o.memoizedState=u.memoizedState,o.updateQueue=u.updateQueue,o.type=u.type,l=u.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),o}function Zd(o,l,u,p,y,b){var C=0;if(p=o,typeof o=="function")uO(o)&&(C=1);else if(typeof o=="string")C=$3(o,u,ie.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case H:return o=wn(31,u,l,y),o.elementType=H,o.lanes=b,o;case _:return aa(u.children,y,b,l);case w:C=8,y|=24;break;case x:return o=wn(12,u,l,y|2),o.elementType=x,o.lanes=b,o;case M:return o=wn(13,u,l,y),o.elementType=M,o.lanes=b,o;case $:return o=wn(19,u,l,y),o.elementType=$,o.lanes=b,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case k:C=10;break e;case Q:C=9;break e;case T:C=11;break e;case R:C=14;break e;case V:C=16,p=null;break e}C=29,u=Error(n(130,o===null?"null":typeof o,"")),p=null}return l=wn(C,u,l,y),l.elementType=o,l.type=p,l.lanes=b,l}function aa(o,l,u,p){return o=wn(7,o,p,l),o.lanes=u,o}function dO(o,l,u){return o=wn(6,o,null,l),o.lanes=u,o}function Z_(o){var l=wn(18,null,null,0);return l.stateNode=o,l}function fO(o,l,u){return l=wn(4,o.children!==null?o.children:[],o.key,l),l.lanes=u,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var W_=new WeakMap;function Wn(o,l){if(typeof o=="object"&&o!==null){var u=W_.get(o);return u!==void 0?u:(l={value:o,source:l,stack:rn(l)},W_.set(o,l),l)}return{value:o,source:l,stack:rn(l)}}var Ol=[],vl=0,Wd=null,eh=0,qn=[],Vn=0,Us=null,Cr=1,Tr="";function ss(o,l){Ol[vl++]=eh,Ol[vl++]=Wd,Wd=o,eh=l}function q_(o,l,u){qn[Vn++]=Cr,qn[Vn++]=Tr,qn[Vn++]=Us,Us=o;var p=Cr;o=Tr;var y=32-Yi(p)-1;p&=~(1<<y),u+=1;var b=32-Yi(l)+y;if(30<b){var C=y-y%5;b=(p&(1<<C)-1).toString(32),p>>=C,y-=C,Cr=1<<32-Yi(l)+y|u<<y|p,Tr=b+o}else Cr=1<<b|u<<y|p,Tr=o}function pO(o){o.return!==null&&(ss(o,1),q_(o,1,0))}function gO(o){for(;o===Wd;)Wd=Ol[--vl],Ol[vl]=null,eh=Ol[--vl],Ol[vl]=null;for(;o===Us;)Us=qn[--Vn],qn[Vn]=null,Tr=qn[--Vn],qn[Vn]=null,Cr=qn[--Vn],qn[Vn]=null}function V_(o,l){qn[Vn++]=Cr,qn[Vn++]=Tr,qn[Vn++]=Us,Cr=l.id,Tr=l.overflow,Us=o}var ki=null,$t=null,st=!1,Gs=null,In=!1,mO=Error(n(519));function Fs(o){var l=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw th(Wn(l,o)),mO}function I_(o){var l=o.stateNode,u=o.type,p=o.memoizedProps;switch(l[li]=o,l[Di]=p,u){case"dialog":Je("cancel",l),Je("close",l);break;case"iframe":case"object":case"embed":Je("load",l);break;case"video":case"audio":for(u=0;u<xh.length;u++)Je(xh[u],l);break;case"source":Je("error",l);break;case"img":case"image":case"link":Je("error",l),Je("load",l);break;case"details":Je("toggle",l);break;case"input":Je("invalid",l),Pd(l,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Je("invalid",l);break;case"textarea":Je("invalid",l),a_(l,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||l.textContent===""+u||p.suppressHydrationWarning===!0||ck(l.textContent,u)?(p.popover!=null&&(Je("beforetoggle",l),Je("toggle",l)),p.onScroll!=null&&Je("scroll",l),p.onScrollEnd!=null&&Je("scrollend",l),p.onClick!=null&&(l.onclick=is),l=!0):l=!1,l||Fs(o,!0)}function Y_(o){for(ki=o.return;ki;)switch(ki.tag){case 5:case 31:case 13:In=!1;return;case 27:case 3:In=!0;return;default:ki=ki.return}}function yl(o){if(o!==ki)return!1;if(!st)return Y_(o),st=!0,!1;var l=o.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=o.type,u=!(u!=="form"&&u!=="button")||M0(o.type,o.memoizedProps)),u=!u),u&&$t&&Fs(o),Y_(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));$t=vk(o)}else if(l===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));$t=vk(o)}else l===27?(l=$t,uo(o.type)?(o=L0,L0=null,$t=o):$t=l):$t=ki?Hn(o.stateNode.nextSibling):null;return!0}function la(){$t=ki=null,st=!1}function OO(){var o=Gs;return o!==null&&(fn===null?fn=o:fn.push.apply(fn,o),Gs=null),o}function th(o){Gs===null?Gs=[o]:Gs.push(o)}var vO=z(null),ca=null,os=null;function Ks(o,l,u){K(vO,l._currentValue),l._currentValue=u}function as(o){o._currentValue=vO.current,q(vO)}function yO(o,l,u){for(;o!==null;){var p=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,p!==null&&(p.childLanes|=l)):p!==null&&(p.childLanes&l)!==l&&(p.childLanes|=l),o===u)break;o=o.return}}function SO(o,l,u,p){var y=o.child;for(y!==null&&(y.return=o);y!==null;){var b=y.dependencies;if(b!==null){var C=y.child;b=b.firstContext;e:for(;b!==null;){var A=b;b=y;for(var Y=0;Y<l.length;Y++)if(A.context===l[Y]){b.lanes|=u,A=b.alternate,A!==null&&(A.lanes|=u),yO(b.return,u,o),p||(C=null);break e}b=A.next}}else if(y.tag===18){if(C=y.return,C===null)throw Error(n(341));C.lanes|=u,b=C.alternate,b!==null&&(b.lanes|=u),yO(C,u,o),C=null}else C=y.child;if(C!==null)C.return=y;else for(C=y;C!==null;){if(C===o){C=null;break}if(y=C.sibling,y!==null){y.return=C.return,C=y;break}C=C.return}y=C}}function Sl(o,l,u,p){o=null;for(var y=l,b=!1;y!==null;){if(!b){if((y.flags&524288)!==0)b=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var C=y.alternate;if(C===null)throw Error(n(387));if(C=C.memoizedProps,C!==null){var A=y.type;xn(y.pendingProps.value,C.value)||(o!==null?o.push(A):o=[A])}}else if(y===pe.current){if(C=y.alternate,C===null)throw Error(n(387));C.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(o!==null?o.push(Qh):o=[Qh])}y=y.return}o!==null&&SO(l,o,u,p),l.flags|=262144}function qd(o){for(o=o.firstContext;o!==null;){if(!xn(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function ha(o){ca=o,os=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Ci(o){return H_(ca,o)}function Vd(o,l){return ca===null&&ha(o),H_(o,l)}function H_(o,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},os===null){if(o===null)throw Error(n(308));os=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else os=os.next=l;return u}var kj=typeof AbortController<"u"?AbortController:function(){var o=[],l=this.signal={aborted:!1,addEventListener:function(u,p){o.push(p)}};this.abort=function(){l.aborted=!0,o.forEach(function(u){return u()})}},Cj=t.unstable_scheduleCallback,Tj=t.unstable_NormalPriority,Jt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function bO(){return{controller:new kj,data:new Map,refCount:0}}function ih(o){o.refCount--,o.refCount===0&&Cj(Tj,function(){o.controller.abort()})}var nh=null,_O=0,bl=0,_l=null;function Qj(o,l){if(nh===null){var u=nh=[];_O=0,bl=k0(),_l={status:"pending",value:void 0,then:function(p){u.push(p)}}}return _O++,l.then(U_,U_),l}function U_(){if(--_O===0&&nh!==null){_l!==null&&(_l.status="fulfilled");var o=nh;nh=null,bl=0,_l=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function $j(o,l){var u=[],p={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return o.then(function(){p.status="fulfilled",p.value=l;for(var y=0;y<u.length;y++)(0,u[y])(l)},function(y){for(p.status="rejected",p.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),p}var G_=P.S;P.S=function(o,l){Aw=Le(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&Qj(o,l),G_!==null&&G_(o,l)};var ua=z(null);function xO(){var o=ua.current;return o!==null?o:wt.pooledCache}function Id(o,l){l===null?K(ua,ua.current):K(ua,l.pool)}function F_(){var o=xO();return o===null?null:{parent:Jt._currentValue,pool:o}}var xl=Error(n(460)),wO=Error(n(474)),Yd=Error(n(542)),Hd={then:function(){}};function K_(o){return o=o.status,o==="fulfilled"||o==="rejected"}function J_(o,l,u){switch(u=o[u],u===void 0?o.push(l):u!==l&&(l.then(is,is),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,tx(o),o;default:if(typeof l.status=="string")l.then(is,is);else{if(o=wt,o!==null&&100<o.shellSuspendCounter)throw Error(n(482));o=l,o.status="pending",o.then(function(p){if(l.status==="pending"){var y=l;y.status="fulfilled",y.value=p}},function(p){if(l.status==="pending"){var y=l;y.status="rejected",y.reason=p}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,tx(o),o}throw fa=l,xl}}function da(o){try{var l=o._init;return l(o._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(fa=u,xl):u}}var fa=null;function ex(){if(fa===null)throw Error(n(459));var o=fa;return fa=null,o}function tx(o){if(o===xl||o===Yd)throw Error(n(483))}var wl=null,rh=0;function Ud(o){var l=rh;return rh+=1,wl===null&&(wl=[]),J_(wl,o,l)}function sh(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function Gd(o,l){throw l.$$typeof===m?Error(n(525)):(o=Object.prototype.toString.call(l),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o)))}function ix(o){function l(F,U){if(o){var J=F.deletions;J===null?(F.deletions=[U],F.flags|=16):J.push(U)}}function u(F,U){if(!o)return null;for(;U!==null;)l(F,U),U=U.sibling;return null}function p(F){for(var U=new Map;F!==null;)F.key!==null?U.set(F.key,F):U.set(F.index,F),F=F.sibling;return U}function y(F,U){return F=rs(F,U),F.index=0,F.sibling=null,F}function b(F,U,J){return F.index=J,o?(J=F.alternate,J!==null?(J=J.index,J<U?(F.flags|=67108866,U):J):(F.flags|=67108866,U)):(F.flags|=1048576,U)}function C(F){return o&&F.alternate===null&&(F.flags|=67108866),F}function A(F,U,J,ae){return U===null||U.tag!==6?(U=dO(J,F.mode,ae),U.return=F,U):(U=y(U,J),U.return=F,U)}function Y(F,U,J,ae){var Ae=J.type;return Ae===_?se(F,U,J.props.children,ae,J.key):U!==null&&(U.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===V&&da(Ae)===U.type)?(U=y(U,J.props),sh(U,J),U.return=F,U):(U=Zd(J.type,J.key,J.props,null,F.mode,ae),sh(U,J),U.return=F,U)}function te(F,U,J,ae){return U===null||U.tag!==4||U.stateNode.containerInfo!==J.containerInfo||U.stateNode.implementation!==J.implementation?(U=fO(J,F.mode,ae),U.return=F,U):(U=y(U,J.children||[]),U.return=F,U)}function se(F,U,J,ae,Ae){return U===null||U.tag!==7?(U=aa(J,F.mode,ae,Ae),U.return=F,U):(U=y(U,J),U.return=F,U)}function he(F,U,J){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=dO(""+U,F.mode,J),U.return=F,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case O:return J=Zd(U.type,U.key,U.props,null,F.mode,J),sh(J,U),J.return=F,J;case S:return U=fO(U,F.mode,J),U.return=F,U;case V:return U=da(U),he(F,U,J)}if(X(U)||j(U))return U=aa(U,F.mode,J,null),U.return=F,U;if(typeof U.then=="function")return he(F,Ud(U),J);if(U.$$typeof===k)return he(F,Vd(F,U),J);Gd(F,U)}return null}function ne(F,U,J,ae){var Ae=U!==null?U.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Ae!==null?null:A(F,U,""+J,ae);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case O:return J.key===Ae?Y(F,U,J,ae):null;case S:return J.key===Ae?te(F,U,J,ae):null;case V:return J=da(J),ne(F,U,J,ae)}if(X(J)||j(J))return Ae!==null?null:se(F,U,J,ae,null);if(typeof J.then=="function")return ne(F,U,Ud(J),ae);if(J.$$typeof===k)return ne(F,U,Vd(F,J),ae);Gd(F,J)}return null}function re(F,U,J,ae,Ae){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return F=F.get(J)||null,A(U,F,""+ae,Ae);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case O:return F=F.get(ae.key===null?J:ae.key)||null,Y(U,F,ae,Ae);case S:return F=F.get(ae.key===null?J:ae.key)||null,te(U,F,ae,Ae);case V:return ae=da(ae),re(F,U,J,ae,Ae)}if(X(ae)||j(ae))return F=F.get(J)||null,se(U,F,ae,Ae,null);if(typeof ae.then=="function")return re(F,U,J,Ud(ae),Ae);if(ae.$$typeof===k)return re(F,U,J,Vd(U,ae),Ae);Gd(U,ae)}return null}function we(F,U,J,ae){for(var Ae=null,ht=null,Te=U,Ye=U=0,it=null;Te!==null&&Ye<J.length;Ye++){Te.index>Ye?(it=Te,Te=null):it=Te.sibling;var ut=ne(F,Te,J[Ye],ae);if(ut===null){Te===null&&(Te=it);break}o&&Te&&ut.alternate===null&&l(F,Te),U=b(ut,U,Ye),ht===null?Ae=ut:ht.sibling=ut,ht=ut,Te=it}if(Ye===J.length)return u(F,Te),st&&ss(F,Ye),Ae;if(Te===null){for(;Ye<J.length;Ye++)Te=he(F,J[Ye],ae),Te!==null&&(U=b(Te,U,Ye),ht===null?Ae=Te:ht.sibling=Te,ht=Te);return st&&ss(F,Ye),Ae}for(Te=p(Te);Ye<J.length;Ye++)it=re(Te,F,Ye,J[Ye],ae),it!==null&&(o&&it.alternate!==null&&Te.delete(it.key===null?Ye:it.key),U=b(it,U,Ye),ht===null?Ae=it:ht.sibling=it,ht=it);return o&&Te.forEach(function(Oo){return l(F,Oo)}),st&&ss(F,Ye),Ae}function ze(F,U,J,ae){if(J==null)throw Error(n(151));for(var Ae=null,ht=null,Te=U,Ye=U=0,it=null,ut=J.next();Te!==null&&!ut.done;Ye++,ut=J.next()){Te.index>Ye?(it=Te,Te=null):it=Te.sibling;var Oo=ne(F,Te,ut.value,ae);if(Oo===null){Te===null&&(Te=it);break}o&&Te&&Oo.alternate===null&&l(F,Te),U=b(Oo,U,Ye),ht===null?Ae=Oo:ht.sibling=Oo,ht=Oo,Te=it}if(ut.done)return u(F,Te),st&&ss(F,Ye),Ae;if(Te===null){for(;!ut.done;Ye++,ut=J.next())ut=he(F,ut.value,ae),ut!==null&&(U=b(ut,U,Ye),ht===null?Ae=ut:ht.sibling=ut,ht=ut);return st&&ss(F,Ye),Ae}for(Te=p(Te);!ut.done;Ye++,ut=J.next())ut=re(Te,F,Ye,ut.value,ae),ut!==null&&(o&&ut.alternate!==null&&Te.delete(ut.key===null?Ye:ut.key),U=b(ut,U,Ye),ht===null?Ae=ut:ht.sibling=ut,ht=ut);return o&&Te.forEach(function(X3){return l(F,X3)}),st&&ss(F,Ye),Ae}function _t(F,U,J,ae){if(typeof J=="object"&&J!==null&&J.type===_&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case O:e:{for(var Ae=J.key;U!==null;){if(U.key===Ae){if(Ae=J.type,Ae===_){if(U.tag===7){u(F,U.sibling),ae=y(U,J.props.children),ae.return=F,F=ae;break e}}else if(U.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===V&&da(Ae)===U.type){u(F,U.sibling),ae=y(U,J.props),sh(ae,J),ae.return=F,F=ae;break e}u(F,U);break}else l(F,U);U=U.sibling}J.type===_?(ae=aa(J.props.children,F.mode,ae,J.key),ae.return=F,F=ae):(ae=Zd(J.type,J.key,J.props,null,F.mode,ae),sh(ae,J),ae.return=F,F=ae)}return C(F);case S:e:{for(Ae=J.key;U!==null;){if(U.key===Ae)if(U.tag===4&&U.stateNode.containerInfo===J.containerInfo&&U.stateNode.implementation===J.implementation){u(F,U.sibling),ae=y(U,J.children||[]),ae.return=F,F=ae;break e}else{u(F,U);break}else l(F,U);U=U.sibling}ae=fO(J,F.mode,ae),ae.return=F,F=ae}return C(F);case V:return J=da(J),_t(F,U,J,ae)}if(X(J))return we(F,U,J,ae);if(j(J)){if(Ae=j(J),typeof Ae!="function")throw Error(n(150));return J=Ae.call(J),ze(F,U,J,ae)}if(typeof J.then=="function")return _t(F,U,Ud(J),ae);if(J.$$typeof===k)return _t(F,U,Vd(F,J),ae);Gd(F,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,U!==null&&U.tag===6?(u(F,U.sibling),ae=y(U,J),ae.return=F,F=ae):(u(F,U),ae=dO(J,F.mode,ae),ae.return=F,F=ae),C(F)):u(F,U)}return function(F,U,J,ae){try{rh=0;var Ae=_t(F,U,J,ae);return wl=null,Ae}catch(Te){if(Te===xl||Te===Yd)throw Te;var ht=wn(29,Te,null,F.mode);return ht.lanes=ae,ht.return=F,ht}finally{}}}var pa=ix(!0),nx=ix(!1),Js=!1;function kO(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function CO(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function eo(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function to(o,l,u){var p=o.updateQueue;if(p===null)return null;if(p=p.shared,(ft&2)!==0){var y=p.pending;return y===null?l.next=l:(l.next=y.next,y.next=l),p.pending=l,l=Nd(o),X_(o,null,u),l}return Xd(o,p,l,u),Nd(o)}function oh(o,l,u){if(l=l.updateQueue,l!==null&&(l=l.shared,(u&4194048)!==0)){var p=l.lanes;p&=o.pendingLanes,u|=p,l.lanes=u,yd(o,u)}}function TO(o,l){var u=o.updateQueue,p=o.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var y=null,b=null;if(u=u.firstBaseUpdate,u!==null){do{var C={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};b===null?y=b=C:b=b.next=C,u=u.next}while(u!==null);b===null?y=b=l:b=b.next=l}else y=b=l;u={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:b,shared:p.shared,callbacks:p.callbacks},o.updateQueue=u;return}o=u.lastBaseUpdate,o===null?u.firstBaseUpdate=l:o.next=l,u.lastBaseUpdate=l}var QO=!1;function ah(){if(QO){var o=_l;if(o!==null)throw o}}function lh(o,l,u,p){QO=!1;var y=o.updateQueue;Js=!1;var b=y.firstBaseUpdate,C=y.lastBaseUpdate,A=y.shared.pending;if(A!==null){y.shared.pending=null;var Y=A,te=Y.next;Y.next=null,C===null?b=te:C.next=te,C=Y;var se=o.alternate;se!==null&&(se=se.updateQueue,A=se.lastBaseUpdate,A!==C&&(A===null?se.firstBaseUpdate=te:A.next=te,se.lastBaseUpdate=Y))}if(b!==null){var he=y.baseState;C=0,se=te=Y=null,A=b;do{var ne=A.lane&-536870913,re=ne!==A.lane;if(re?(tt&ne)===ne:(p&ne)===ne){ne!==0&&ne===bl&&(QO=!0),se!==null&&(se=se.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var we=o,ze=A;ne=l;var _t=u;switch(ze.tag){case 1:if(we=ze.payload,typeof we=="function"){he=we.call(_t,he,ne);break e}he=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=ze.payload,ne=typeof we=="function"?we.call(_t,he,ne):we,ne==null)break e;he=g({},he,ne);break e;case 2:Js=!0}}ne=A.callback,ne!==null&&(o.flags|=64,re&&(o.flags|=8192),re=y.callbacks,re===null?y.callbacks=[ne]:re.push(ne))}else re={lane:ne,tag:A.tag,payload:A.payload,callback:A.callback,next:null},se===null?(te=se=re,Y=he):se=se.next=re,C|=ne;if(A=A.next,A===null){if(A=y.shared.pending,A===null)break;re=A,A=re.next,re.next=null,y.lastBaseUpdate=re,y.shared.pending=null}}while(!0);se===null&&(Y=he),y.baseState=Y,y.firstBaseUpdate=te,y.lastBaseUpdate=se,b===null&&(y.shared.lanes=0),oo|=C,o.lanes=C,o.memoizedState=he}}function rx(o,l){if(typeof o!="function")throw Error(n(191,o));o.call(l)}function sx(o,l){var u=o.callbacks;if(u!==null)for(o.callbacks=null,o=0;o<u.length;o++)rx(u[o],l)}var kl=z(null),Fd=z(0);function ox(o,l){o=ms,K(Fd,o),K(kl,l),ms=o|l.baseLanes}function $O(){K(Fd,ms),K(kl,kl.current)}function PO(){ms=Fd.current,q(kl),q(Fd)}var kn=z(null),Yn=null;function io(o){var l=o.alternate;K(Vt,Vt.current&1),K(kn,o),Yn===null&&(l===null||kl.current!==null||l.memoizedState!==null)&&(Yn=o)}function EO(o){K(Vt,Vt.current),K(kn,o),Yn===null&&(Yn=o)}function ax(o){o.tag===22?(K(Vt,Vt.current),K(kn,o),Yn===null&&(Yn=o)):no()}function no(){K(Vt,Vt.current),K(kn,kn.current)}function Cn(o){q(kn),Yn===o&&(Yn=null),q(Vt)}var Vt=z(0);function Kd(o){for(var l=o;l!==null;){if(l.tag===13){var u=l.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||D0(u)||B0(u)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var ls=0,Ie=null,St=null,ei=null,Jd=!1,Cl=!1,ga=!1,ef=0,ch=0,Tl=null,Pj=0;function Xt(){throw Error(n(321))}function RO(o,l){if(l===null)return!1;for(var u=0;u<l.length&&u<o.length;u++)if(!xn(o[u],l[u]))return!1;return!0}function AO(o,l,u,p,y,b){return ls=b,Ie=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,P.H=o===null||o.memoizedState===null?qx:HO,ga=!1,b=u(p,y),ga=!1,Cl&&(b=cx(l,u,p,y)),lx(o),b}function lx(o){P.H=dh;var l=St!==null&&St.next!==null;if(ls=0,ei=St=Ie=null,Jd=!1,ch=0,Tl=null,l)throw Error(n(300));o===null||ti||(o=o.dependencies,o!==null&&qd(o)&&(ti=!0))}function cx(o,l,u,p){Ie=o;var y=0;do{if(Cl&&(Tl=null),ch=0,Cl=!1,25<=y)throw Error(n(301));if(y+=1,ei=St=null,o.updateQueue!=null){var b=o.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}P.H=Vx,b=l(u,p)}while(Cl);return b}function Ej(){var o=P.H,l=o.useState()[0];return l=typeof l.then=="function"?hh(l):l,o=o.useState()[0],(St!==null?St.memoizedState:null)!==o&&(Ie.flags|=1024),l}function MO(){var o=ef!==0;return ef=0,o}function zO(o,l,u){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~u}function jO(o){if(Jd){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}Jd=!1}ls=0,ei=St=Ie=null,Cl=!1,ch=ef=0,Tl=null}function Hi(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ei===null?Ie.memoizedState=ei=o:ei=ei.next=o,ei}function It(){if(St===null){var o=Ie.alternate;o=o!==null?o.memoizedState:null}else o=St.next;var l=ei===null?Ie.memoizedState:ei.next;if(l!==null)ei=l,St=o;else{if(o===null)throw Ie.alternate===null?Error(n(467)):Error(n(310));St=o,o={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},ei===null?Ie.memoizedState=ei=o:ei=ei.next=o}return ei}function tf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hh(o){var l=ch;return ch+=1,Tl===null&&(Tl=[]),o=J_(Tl,o,l),l=Ie,(ei===null?l.memoizedState:ei.next)===null&&(l=l.alternate,P.H=l===null||l.memoizedState===null?qx:HO),o}function nf(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return hh(o);if(o.$$typeof===k)return Ci(o)}throw Error(n(438,String(o)))}function DO(o){var l=null,u=Ie.updateQueue;if(u!==null&&(l=u.memoCache),l==null){var p=Ie.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(l={data:p.data.map(function(y){return y.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),u===null&&(u=tf(),Ie.updateQueue=u),u.memoCache=l,u=l.data[l.index],u===void 0)for(u=l.data[l.index]=Array(o),p=0;p<o;p++)u[p]=ee;return l.index++,u}function cs(o,l){return typeof l=="function"?l(o):l}function rf(o){var l=It();return BO(l,St,o)}function BO(o,l,u){var p=o.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=u;var y=o.baseQueue,b=p.pending;if(b!==null){if(y!==null){var C=y.next;y.next=b.next,b.next=C}l.baseQueue=y=b,p.pending=null}if(b=o.baseState,y===null)o.memoizedState=b;else{l=y.next;var A=C=null,Y=null,te=l,se=!1;do{var he=te.lane&-536870913;if(he!==te.lane?(tt&he)===he:(ls&he)===he){var ne=te.revertLane;if(ne===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),he===bl&&(se=!0);else if((ls&ne)===ne){te=te.next,ne===bl&&(se=!0);continue}else he={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},Y===null?(A=Y=he,C=b):Y=Y.next=he,Ie.lanes|=ne,oo|=ne;he=te.action,ga&&u(b,he),b=te.hasEagerState?te.eagerState:u(b,he)}else ne={lane:he,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},Y===null?(A=Y=ne,C=b):Y=Y.next=ne,Ie.lanes|=he,oo|=he;te=te.next}while(te!==null&&te!==l);if(Y===null?C=b:Y.next=A,!xn(b,o.memoizedState)&&(ti=!0,se&&(u=_l,u!==null)))throw u;o.memoizedState=b,o.baseState=C,o.baseQueue=Y,p.lastRenderedState=b}return y===null&&(p.lanes=0),[o.memoizedState,p.dispatch]}function LO(o){var l=It(),u=l.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=o;var p=u.dispatch,y=u.pending,b=l.memoizedState;if(y!==null){u.pending=null;var C=y=y.next;do b=o(b,C.action),C=C.next;while(C!==y);xn(b,l.memoizedState)||(ti=!0),l.memoizedState=b,l.baseQueue===null&&(l.baseState=b),u.lastRenderedState=b}return[b,p]}function hx(o,l,u){var p=Ie,y=It(),b=st;if(b){if(u===void 0)throw Error(n(407));u=u()}else u=l();var C=!xn((St||y).memoizedState,u);if(C&&(y.memoizedState=u,ti=!0),y=y.queue,ZO(fx.bind(null,p,y,o),[o]),y.getSnapshot!==l||C||ei!==null&&ei.memoizedState.tag&1){if(p.flags|=2048,Ql(9,{destroy:void 0},dx.bind(null,p,y,u,l),null),wt===null)throw Error(n(349));b||(ls&127)!==0||ux(p,l,u)}return u}function ux(o,l,u){o.flags|=16384,o={getSnapshot:l,value:u},l=Ie.updateQueue,l===null?(l=tf(),Ie.updateQueue=l,l.stores=[o]):(u=l.stores,u===null?l.stores=[o]:u.push(o))}function dx(o,l,u,p){l.value=u,l.getSnapshot=p,px(l)&&gx(o)}function fx(o,l,u){return u(function(){px(l)&&gx(o)})}function px(o){var l=o.getSnapshot;o=o.value;try{var u=l();return!xn(o,u)}catch{return!0}}function gx(o){var l=oa(o,2);l!==null&&pn(l,o,2)}function XO(o){var l=Hi();if(typeof o=="function"){var u=o;if(o=u(),ga){wr(!0);try{u()}finally{wr(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:o},l}function mx(o,l,u,p){return o.baseState=u,BO(o,St,typeof p=="function"?p:cs)}function Rj(o,l,u,p,y){if(af(o))throw Error(n(485));if(o=l.action,o!==null){var b={payload:y,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){b.listeners.push(C)}};P.T!==null?u(!0):b.isTransition=!1,p(b),u=l.pending,u===null?(b.next=l.pending=b,Ox(l,b)):(b.next=u.next,l.pending=u.next=b)}}function Ox(o,l){var u=l.action,p=l.payload,y=o.state;if(l.isTransition){var b=P.T,C={};P.T=C;try{var A=u(y,p),Y=P.S;Y!==null&&Y(C,A),vx(o,l,A)}catch(te){NO(o,l,te)}finally{b!==null&&C.types!==null&&(b.types=C.types),P.T=b}}else try{b=u(y,p),vx(o,l,b)}catch(te){NO(o,l,te)}}function vx(o,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){yx(o,l,p)},function(p){return NO(o,l,p)}):yx(o,l,u)}function yx(o,l,u){l.status="fulfilled",l.value=u,Sx(l),o.state=u,l=o.pending,l!==null&&(u=l.next,u===l?o.pending=null:(u=u.next,l.next=u,Ox(o,u)))}function NO(o,l,u){var p=o.pending;if(o.pending=null,p!==null){p=p.next;do l.status="rejected",l.reason=u,Sx(l),l=l.next;while(l!==p)}o.action=null}function Sx(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function bx(o,l){return l}function _x(o,l){if(st){var u=wt.formState;if(u!==null){e:{var p=Ie;if(st){if($t){t:{for(var y=$t,b=In;y.nodeType!==8;){if(!b){y=null;break t}if(y=Hn(y.nextSibling),y===null){y=null;break t}}b=y.data,y=b==="F!"||b==="F"?y:null}if(y){$t=Hn(y.nextSibling),p=y.data==="F!";break e}}Fs(p)}p=!1}p&&(l=u[0])}}return u=Hi(),u.memoizedState=u.baseState=l,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bx,lastRenderedState:l},u.queue=p,u=Nx.bind(null,Ie,p),p.dispatch=u,p=XO(!1),b=YO.bind(null,Ie,!1,p.queue),p=Hi(),y={state:l,dispatch:null,action:o,pending:null},p.queue=y,u=Rj.bind(null,Ie,y,b,u),y.dispatch=u,p.memoizedState=o,[l,u,!1]}function xx(o){var l=It();return wx(l,St,o)}function wx(o,l,u){if(l=BO(o,l,bx)[0],o=rf(cs)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var p=hh(l)}catch(C){throw C===xl?Yd:C}else p=l;l=It();var y=l.queue,b=y.dispatch;return u!==l.memoizedState&&(Ie.flags|=2048,Ql(9,{destroy:void 0},Aj.bind(null,y,u),null)),[p,b,o]}function Aj(o,l){o.action=l}function kx(o){var l=It(),u=St;if(u!==null)return wx(l,u,o);It(),l=l.memoizedState,u=It();var p=u.queue.dispatch;return u.memoizedState=o,[l,p,!1]}function Ql(o,l,u,p){return o={tag:o,create:u,deps:p,inst:l,next:null},l=Ie.updateQueue,l===null&&(l=tf(),Ie.updateQueue=l),u=l.lastEffect,u===null?l.lastEffect=o.next=o:(p=u.next,u.next=o,o.next=p,l.lastEffect=o),o}function Cx(){return It().memoizedState}function sf(o,l,u,p){var y=Hi();Ie.flags|=o,y.memoizedState=Ql(1|l,{destroy:void 0},u,p===void 0?null:p)}function of(o,l,u,p){var y=It();p=p===void 0?null:p;var b=y.memoizedState.inst;St!==null&&p!==null&&RO(p,St.memoizedState.deps)?y.memoizedState=Ql(l,b,u,p):(Ie.flags|=o,y.memoizedState=Ql(1|l,b,u,p))}function Tx(o,l){sf(8390656,8,o,l)}function ZO(o,l){of(2048,8,o,l)}function Mj(o){Ie.flags|=4;var l=Ie.updateQueue;if(l===null)l=tf(),Ie.updateQueue=l,l.events=[o];else{var u=l.events;u===null?l.events=[o]:u.push(o)}}function Qx(o){var l=It().memoizedState;return Mj({ref:l,nextImpl:o}),function(){if((ft&2)!==0)throw Error(n(440));return l.impl.apply(void 0,arguments)}}function $x(o,l){return of(4,2,o,l)}function Px(o,l){return of(4,4,o,l)}function Ex(o,l){if(typeof l=="function"){o=o();var u=l(o);return function(){typeof u=="function"?u():l(null)}}if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function Rx(o,l,u){u=u!=null?u.concat([o]):null,of(4,4,Ex.bind(null,l,o),u)}function WO(){}function Ax(o,l){var u=It();l=l===void 0?null:l;var p=u.memoizedState;return l!==null&&RO(l,p[1])?p[0]:(u.memoizedState=[o,l],o)}function Mx(o,l){var u=It();l=l===void 0?null:l;var p=u.memoizedState;if(l!==null&&RO(l,p[1]))return p[0];if(p=o(),ga){wr(!0);try{o()}finally{wr(!1)}}return u.memoizedState=[p,l],p}function qO(o,l,u){return u===void 0||(ls&1073741824)!==0&&(tt&261930)===0?o.memoizedState=l:(o.memoizedState=u,o=zw(),Ie.lanes|=o,oo|=o,u)}function zx(o,l,u,p){return xn(u,l)?u:kl.current!==null?(o=qO(o,u,p),xn(o,l)||(ti=!0),o):(ls&42)===0||(ls&1073741824)!==0&&(tt&261930)===0?(ti=!0,o.memoizedState=u):(o=zw(),Ie.lanes|=o,oo|=o,l)}function jx(o,l,u,p,y){var b=Z.p;Z.p=b!==0&&8>b?b:8;var C=P.T,A={};P.T=A,YO(o,!1,l,u);try{var Y=y(),te=P.S;if(te!==null&&te(A,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var se=$j(Y,p);uh(o,l,se,$n(o))}else uh(o,l,p,$n(o))}catch(he){uh(o,l,{then:function(){},status:"rejected",reason:he},$n())}finally{Z.p=b,C!==null&&A.types!==null&&(C.types=A.types),P.T=C}}function zj(){}function VO(o,l,u,p){if(o.tag!==5)throw Error(n(476));var y=Dx(o).queue;jx(o,y,l,L,u===null?zj:function(){return Bx(o),u(p)})}function Dx(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:L},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:u},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function Bx(o){var l=Dx(o);l.next===null&&(l=o.alternate.memoizedState),uh(o,l.next.queue,{},$n())}function IO(){return Ci(Qh)}function Lx(){return It().memoizedState}function Xx(){return It().memoizedState}function jj(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var u=$n();o=eo(u);var p=to(l,o,u);p!==null&&(pn(p,l,u),oh(p,l,u)),l={cache:bO()},o.payload=l;return}l=l.return}}function Dj(o,l,u){var p=$n();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},af(o)?Zx(l,u):(u=hO(o,l,u,p),u!==null&&(pn(u,o,p),Wx(u,l,p)))}function Nx(o,l,u){var p=$n();uh(o,l,u,p)}function uh(o,l,u,p){var y={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(af(o))Zx(l,y);else{var b=o.alternate;if(o.lanes===0&&(b===null||b.lanes===0)&&(b=l.lastRenderedReducer,b!==null))try{var C=l.lastRenderedState,A=b(C,u);if(y.hasEagerState=!0,y.eagerState=A,xn(A,C))return Xd(o,l,y,0),wt===null&&Ld(),!1}catch{}finally{}if(u=hO(o,l,y,p),u!==null)return pn(u,o,p),Wx(u,l,p),!0}return!1}function YO(o,l,u,p){if(p={lane:2,revertLane:k0(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},af(o)){if(l)throw Error(n(479))}else l=hO(o,u,p,2),l!==null&&pn(l,o,2)}function af(o){var l=o.alternate;return o===Ie||l!==null&&l===Ie}function Zx(o,l){Cl=Jd=!0;var u=o.pending;u===null?l.next=l:(l.next=u.next,u.next=l),o.pending=l}function Wx(o,l,u){if((u&4194048)!==0){var p=l.lanes;p&=o.pendingLanes,u|=p,l.lanes=u,yd(o,u)}}var dh={readContext:Ci,use:nf,useCallback:Xt,useContext:Xt,useEffect:Xt,useImperativeHandle:Xt,useLayoutEffect:Xt,useInsertionEffect:Xt,useMemo:Xt,useReducer:Xt,useRef:Xt,useState:Xt,useDebugValue:Xt,useDeferredValue:Xt,useTransition:Xt,useSyncExternalStore:Xt,useId:Xt,useHostTransitionStatus:Xt,useFormState:Xt,useActionState:Xt,useOptimistic:Xt,useMemoCache:Xt,useCacheRefresh:Xt};dh.useEffectEvent=Xt;var qx={readContext:Ci,use:nf,useCallback:function(o,l){return Hi().memoizedState=[o,l===void 0?null:l],o},useContext:Ci,useEffect:Tx,useImperativeHandle:function(o,l,u){u=u!=null?u.concat([o]):null,sf(4194308,4,Ex.bind(null,l,o),u)},useLayoutEffect:function(o,l){return sf(4194308,4,o,l)},useInsertionEffect:function(o,l){sf(4,2,o,l)},useMemo:function(o,l){var u=Hi();l=l===void 0?null:l;var p=o();if(ga){wr(!0);try{o()}finally{wr(!1)}}return u.memoizedState=[p,l],p},useReducer:function(o,l,u){var p=Hi();if(u!==void 0){var y=u(l);if(ga){wr(!0);try{u(l)}finally{wr(!1)}}}else y=l;return p.memoizedState=p.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},p.queue=o,o=o.dispatch=Dj.bind(null,Ie,o),[p.memoizedState,o]},useRef:function(o){var l=Hi();return o={current:o},l.memoizedState=o},useState:function(o){o=XO(o);var l=o.queue,u=Nx.bind(null,Ie,l);return l.dispatch=u,[o.memoizedState,u]},useDebugValue:WO,useDeferredValue:function(o,l){var u=Hi();return qO(u,o,l)},useTransition:function(){var o=XO(!1);return o=jx.bind(null,Ie,o.queue,!0,!1),Hi().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,u){var p=Ie,y=Hi();if(st){if(u===void 0)throw Error(n(407));u=u()}else{if(u=l(),wt===null)throw Error(n(349));(tt&127)!==0||ux(p,l,u)}y.memoizedState=u;var b={value:u,getSnapshot:l};return y.queue=b,Tx(fx.bind(null,p,b,o),[o]),p.flags|=2048,Ql(9,{destroy:void 0},dx.bind(null,p,b,u,l),null),u},useId:function(){var o=Hi(),l=wt.identifierPrefix;if(st){var u=Tr,p=Cr;u=(p&~(1<<32-Yi(p)-1)).toString(32)+u,l="_"+l+"R_"+u,u=ef++,0<u&&(l+="H"+u.toString(32)),l+="_"}else u=Pj++,l="_"+l+"r_"+u.toString(32)+"_";return o.memoizedState=l},useHostTransitionStatus:IO,useFormState:_x,useActionState:_x,useOptimistic:function(o){var l=Hi();l.memoizedState=l.baseState=o;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=u,l=YO.bind(null,Ie,!0,u),u.dispatch=l,[o,l]},useMemoCache:DO,useCacheRefresh:function(){return Hi().memoizedState=jj.bind(null,Ie)},useEffectEvent:function(o){var l=Hi(),u={impl:o};return l.memoizedState=u,function(){if((ft&2)!==0)throw Error(n(440));return u.impl.apply(void 0,arguments)}}},HO={readContext:Ci,use:nf,useCallback:Ax,useContext:Ci,useEffect:ZO,useImperativeHandle:Rx,useInsertionEffect:$x,useLayoutEffect:Px,useMemo:Mx,useReducer:rf,useRef:Cx,useState:function(){return rf(cs)},useDebugValue:WO,useDeferredValue:function(o,l){var u=It();return zx(u,St.memoizedState,o,l)},useTransition:function(){var o=rf(cs)[0],l=It().memoizedState;return[typeof o=="boolean"?o:hh(o),l]},useSyncExternalStore:hx,useId:Lx,useHostTransitionStatus:IO,useFormState:xx,useActionState:xx,useOptimistic:function(o,l){var u=It();return mx(u,St,o,l)},useMemoCache:DO,useCacheRefresh:Xx};HO.useEffectEvent=Qx;var Vx={readContext:Ci,use:nf,useCallback:Ax,useContext:Ci,useEffect:ZO,useImperativeHandle:Rx,useInsertionEffect:$x,useLayoutEffect:Px,useMemo:Mx,useReducer:LO,useRef:Cx,useState:function(){return LO(cs)},useDebugValue:WO,useDeferredValue:function(o,l){var u=It();return St===null?qO(u,o,l):zx(u,St.memoizedState,o,l)},useTransition:function(){var o=LO(cs)[0],l=It().memoizedState;return[typeof o=="boolean"?o:hh(o),l]},useSyncExternalStore:hx,useId:Lx,useHostTransitionStatus:IO,useFormState:kx,useActionState:kx,useOptimistic:function(o,l){var u=It();return St!==null?mx(u,St,o,l):(u.baseState=o,[o,u.queue.dispatch])},useMemoCache:DO,useCacheRefresh:Xx};Vx.useEffectEvent=Qx;function UO(o,l,u,p){l=o.memoizedState,u=u(p,l),u=u==null?l:g({},l,u),o.memoizedState=u,o.lanes===0&&(o.updateQueue.baseState=u)}var GO={enqueueSetState:function(o,l,u){o=o._reactInternals;var p=$n(),y=eo(p);y.payload=l,u!=null&&(y.callback=u),l=to(o,y,p),l!==null&&(pn(l,o,p),oh(l,o,p))},enqueueReplaceState:function(o,l,u){o=o._reactInternals;var p=$n(),y=eo(p);y.tag=1,y.payload=l,u!=null&&(y.callback=u),l=to(o,y,p),l!==null&&(pn(l,o,p),oh(l,o,p))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var u=$n(),p=eo(u);p.tag=2,l!=null&&(p.callback=l),l=to(o,p,u),l!==null&&(pn(l,o,u),oh(l,o,u))}};function Ix(o,l,u,p,y,b,C){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(p,b,C):l.prototype&&l.prototype.isPureReactComponent?!Kc(u,p)||!Kc(y,b):!0}function Yx(o,l,u,p){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(u,p),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(u,p),l.state!==o&&GO.enqueueReplaceState(l,l.state,null)}function ma(o,l){var u=l;if("ref"in l){u={};for(var p in l)p!=="ref"&&(u[p]=l[p])}if(o=o.defaultProps){u===l&&(u=g({},u));for(var y in o)u[y]===void 0&&(u[y]=o[y])}return u}function Hx(o){Bd(o)}function Ux(o){console.error(o)}function Gx(o){Bd(o)}function lf(o,l){try{var u=o.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(p){setTimeout(function(){throw p})}}function Fx(o,l,u){try{var p=o.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function FO(o,l,u){return u=eo(u),u.tag=3,u.payload={element:null},u.callback=function(){lf(o,l)},u}function Kx(o){return o=eo(o),o.tag=3,o}function Jx(o,l,u,p){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var b=p.value;o.payload=function(){return y(b)},o.callback=function(){Fx(l,u,p)}}var C=u.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(o.callback=function(){Fx(l,u,p),typeof y!="function"&&(ao===null?ao=new Set([this]):ao.add(this));var A=p.stack;this.componentDidCatch(p.value,{componentStack:A!==null?A:""})})}function Bj(o,l,u,p,y){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(l=u.alternate,l!==null&&Sl(l,u,y,!0),u=kn.current,u!==null){switch(u.tag){case 31:case 13:return Yn===null?Sf():u.alternate===null&&Nt===0&&(Nt=3),u.flags&=-257,u.flags|=65536,u.lanes=y,p===Hd?u.flags|=16384:(l=u.updateQueue,l===null?u.updateQueue=new Set([p]):l.add(p),_0(o,p,y)),!1;case 22:return u.flags|=65536,p===Hd?u.flags|=16384:(l=u.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=l):(u=l.retryQueue,u===null?l.retryQueue=new Set([p]):u.add(p)),_0(o,p,y)),!1}throw Error(n(435,u.tag))}return _0(o,p,y),Sf(),!1}if(st)return l=kn.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=y,p!==mO&&(o=Error(n(422),{cause:p}),th(Wn(o,u)))):(p!==mO&&(l=Error(n(423),{cause:p}),th(Wn(l,u))),o=o.current.alternate,o.flags|=65536,y&=-y,o.lanes|=y,p=Wn(p,u),y=FO(o.stateNode,p,y),TO(o,y),Nt!==4&&(Nt=2)),!1;var b=Error(n(520),{cause:p});if(b=Wn(b,u),Sh===null?Sh=[b]:Sh.push(b),Nt!==4&&(Nt=2),l===null)return!0;p=Wn(p,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,o=y&-y,u.lanes|=o,o=FO(u.stateNode,p,o),TO(u,o),!1;case 1:if(l=u.type,b=u.stateNode,(u.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(ao===null||!ao.has(b))))return u.flags|=65536,y&=-y,u.lanes|=y,y=Kx(y),Jx(y,o,u,p),TO(u,y),!1}u=u.return}while(u!==null);return!1}var KO=Error(n(461)),ti=!1;function Ti(o,l,u,p){l.child=o===null?nx(l,null,u,p):pa(l,o.child,u,p)}function ew(o,l,u,p,y){u=u.render;var b=l.ref;if("ref"in p){var C={};for(var A in p)A!=="ref"&&(C[A]=p[A])}else C=p;return ha(l),p=AO(o,l,u,C,b,y),A=MO(),o!==null&&!ti?(zO(o,l,y),hs(o,l,y)):(st&&A&&pO(l),l.flags|=1,Ti(o,l,p,y),l.child)}function tw(o,l,u,p,y){if(o===null){var b=u.type;return typeof b=="function"&&!uO(b)&&b.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=b,iw(o,l,b,p,y)):(o=Zd(u.type,null,p,l,l.mode,y),o.ref=l.ref,o.return=l,l.child=o)}if(b=o.child,!o0(o,y)){var C=b.memoizedProps;if(u=u.compare,u=u!==null?u:Kc,u(C,p)&&o.ref===l.ref)return hs(o,l,y)}return l.flags|=1,o=rs(b,p),o.ref=l.ref,o.return=l,l.child=o}function iw(o,l,u,p,y){if(o!==null){var b=o.memoizedProps;if(Kc(b,p)&&o.ref===l.ref)if(ti=!1,l.pendingProps=p=b,o0(o,y))(o.flags&131072)!==0&&(ti=!0);else return l.lanes=o.lanes,hs(o,l,y)}return JO(o,l,u,p,y)}function nw(o,l,u,p){var y=p.children,b=o!==null?o.memoizedState:null;if(o===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((l.flags&128)!==0){if(b=b!==null?b.baseLanes|u:u,o!==null){for(p=l.child=o.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;p=y&~b}else p=0,l.child=null;return rw(o,l,b,u,p)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&Id(l,b!==null?b.cachePool:null),b!==null?ox(l,b):$O(),ax(l);else return p=l.lanes=536870912,rw(o,l,b!==null?b.baseLanes|u:u,u,p)}else b!==null?(Id(l,b.cachePool),ox(l,b),no(),l.memoizedState=null):(o!==null&&Id(l,null),$O(),no());return Ti(o,l,y,u),l.child}function fh(o,l){return o!==null&&o.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function rw(o,l,u,p,y){var b=xO();return b=b===null?null:{parent:Jt._currentValue,pool:b},l.memoizedState={baseLanes:u,cachePool:b},o!==null&&Id(l,null),$O(),ax(l),o!==null&&Sl(o,l,p,!0),l.childLanes=y,null}function cf(o,l){return l=uf({mode:l.mode,children:l.children},o.mode),l.ref=o.ref,o.child=l,l.return=o,l}function sw(o,l,u){return pa(l,o.child,null,u),o=cf(l,l.pendingProps),o.flags|=2,Cn(l),l.memoizedState=null,o}function Lj(o,l,u){var p=l.pendingProps,y=(l.flags&128)!==0;if(l.flags&=-129,o===null){if(st){if(p.mode==="hidden")return o=cf(l,p),l.lanes=536870912,fh(null,o);if(EO(l),(o=$t)?(o=Ok(o,In),o=o!==null&&o.data==="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:Us!==null?{id:Cr,overflow:Tr}:null,retryLane:536870912,hydrationErrors:null},u=Z_(o),u.return=l,l.child=u,ki=l,$t=null)):o=null,o===null)throw Fs(l);return l.lanes=536870912,null}return cf(l,p)}var b=o.memoizedState;if(b!==null){var C=b.dehydrated;if(EO(l),y)if(l.flags&256)l.flags&=-257,l=sw(o,l,u);else if(l.memoizedState!==null)l.child=o.child,l.flags|=128,l=null;else throw Error(n(558));else if(ti||Sl(o,l,u,!1),y=(u&o.childLanes)!==0,ti||y){if(p=wt,p!==null&&(C=Sd(p,u),C!==0&&C!==b.retryLane))throw b.retryLane=C,oa(o,C),pn(p,o,C),KO;Sf(),l=sw(o,l,u)}else o=b.treeContext,$t=Hn(C.nextSibling),ki=l,st=!0,Gs=null,In=!1,o!==null&&V_(l,o),l=cf(l,p),l.flags|=4096;return l}return o=rs(o.child,{mode:p.mode,children:p.children}),o.ref=l.ref,l.child=o,o.return=l,o}function hf(o,l){var u=l.ref;if(u===null)o!==null&&o.ref!==null&&(l.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(n(284));(o===null||o.ref!==u)&&(l.flags|=4194816)}}function JO(o,l,u,p,y){return ha(l),u=AO(o,l,u,p,void 0,y),p=MO(),o!==null&&!ti?(zO(o,l,y),hs(o,l,y)):(st&&p&&pO(l),l.flags|=1,Ti(o,l,u,y),l.child)}function ow(o,l,u,p,y,b){return ha(l),l.updateQueue=null,u=cx(l,p,u,y),lx(o),p=MO(),o!==null&&!ti?(zO(o,l,b),hs(o,l,b)):(st&&p&&pO(l),l.flags|=1,Ti(o,l,u,b),l.child)}function aw(o,l,u,p,y){if(ha(l),l.stateNode===null){var b=ml,C=u.contextType;typeof C=="object"&&C!==null&&(b=Ci(C)),b=new u(p,b),l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=GO,l.stateNode=b,b._reactInternals=l,b=l.stateNode,b.props=p,b.state=l.memoizedState,b.refs={},kO(l),C=u.contextType,b.context=typeof C=="object"&&C!==null?Ci(C):ml,b.state=l.memoizedState,C=u.getDerivedStateFromProps,typeof C=="function"&&(UO(l,u,C,p),b.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(C=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),C!==b.state&&GO.enqueueReplaceState(b,b.state,null),lh(l,p,b,y),ah(),b.state=l.memoizedState),typeof b.componentDidMount=="function"&&(l.flags|=4194308),p=!0}else if(o===null){b=l.stateNode;var A=l.memoizedProps,Y=ma(u,A);b.props=Y;var te=b.context,se=u.contextType;C=ml,typeof se=="object"&&se!==null&&(C=Ci(se));var he=u.getDerivedStateFromProps;se=typeof he=="function"||typeof b.getSnapshotBeforeUpdate=="function",A=l.pendingProps!==A,se||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(A||te!==C)&&Yx(l,b,p,C),Js=!1;var ne=l.memoizedState;b.state=ne,lh(l,p,b,y),ah(),te=l.memoizedState,A||ne!==te||Js?(typeof he=="function"&&(UO(l,u,he,p),te=l.memoizedState),(Y=Js||Ix(l,u,Y,p,ne,te,C))?(se||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(l.flags|=4194308)):(typeof b.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=p,l.memoizedState=te),b.props=p,b.state=te,b.context=C,p=Y):(typeof b.componentDidMount=="function"&&(l.flags|=4194308),p=!1)}else{b=l.stateNode,CO(o,l),C=l.memoizedProps,se=ma(u,C),b.props=se,he=l.pendingProps,ne=b.context,te=u.contextType,Y=ml,typeof te=="object"&&te!==null&&(Y=Ci(te)),A=u.getDerivedStateFromProps,(te=typeof A=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(C!==he||ne!==Y)&&Yx(l,b,p,Y),Js=!1,ne=l.memoizedState,b.state=ne,lh(l,p,b,y),ah();var re=l.memoizedState;C!==he||ne!==re||Js||o!==null&&o.dependencies!==null&&qd(o.dependencies)?(typeof A=="function"&&(UO(l,u,A,p),re=l.memoizedState),(se=Js||Ix(l,u,se,p,ne,re,Y)||o!==null&&o.dependencies!==null&&qd(o.dependencies))?(te||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(p,re,Y),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(p,re,Y)),typeof b.componentDidUpdate=="function"&&(l.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof b.componentDidUpdate!="function"||C===o.memoizedProps&&ne===o.memoizedState||(l.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||C===o.memoizedProps&&ne===o.memoizedState||(l.flags|=1024),l.memoizedProps=p,l.memoizedState=re),b.props=p,b.state=re,b.context=Y,p=se):(typeof b.componentDidUpdate!="function"||C===o.memoizedProps&&ne===o.memoizedState||(l.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||C===o.memoizedProps&&ne===o.memoizedState||(l.flags|=1024),p=!1)}return b=p,hf(o,l),p=(l.flags&128)!==0,b||p?(b=l.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:b.render(),l.flags|=1,o!==null&&p?(l.child=pa(l,o.child,null,y),l.child=pa(l,null,u,y)):Ti(o,l,u,y),l.memoizedState=b.state,o=l.child):o=hs(o,l,y),o}function lw(o,l,u,p){return la(),l.flags|=256,Ti(o,l,u,p),l.child}var e0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function t0(o){return{baseLanes:o,cachePool:F_()}}function i0(o,l,u){return o=o!==null?o.childLanes&~u:0,l&&(o|=Qn),o}function cw(o,l,u){var p=l.pendingProps,y=!1,b=(l.flags&128)!==0,C;if((C=b)||(C=o!==null&&o.memoizedState===null?!1:(Vt.current&2)!==0),C&&(y=!0,l.flags&=-129),C=(l.flags&32)!==0,l.flags&=-33,o===null){if(st){if(y?io(l):no(),(o=$t)?(o=Ok(o,In),o=o!==null&&o.data!=="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:Us!==null?{id:Cr,overflow:Tr}:null,retryLane:536870912,hydrationErrors:null},u=Z_(o),u.return=l,l.child=u,ki=l,$t=null)):o=null,o===null)throw Fs(l);return B0(o)?l.lanes=32:l.lanes=536870912,null}var A=p.children;return p=p.fallback,y?(no(),y=l.mode,A=uf({mode:"hidden",children:A},y),p=aa(p,y,u,null),A.return=l,p.return=l,A.sibling=p,l.child=A,p=l.child,p.memoizedState=t0(u),p.childLanes=i0(o,C,u),l.memoizedState=e0,fh(null,p)):(io(l),n0(l,A))}var Y=o.memoizedState;if(Y!==null&&(A=Y.dehydrated,A!==null)){if(b)l.flags&256?(io(l),l.flags&=-257,l=r0(o,l,u)):l.memoizedState!==null?(no(),l.child=o.child,l.flags|=128,l=null):(no(),A=p.fallback,y=l.mode,p=uf({mode:"visible",children:p.children},y),A=aa(A,y,u,null),A.flags|=2,p.return=l,A.return=l,p.sibling=A,l.child=p,pa(l,o.child,null,u),p=l.child,p.memoizedState=t0(u),p.childLanes=i0(o,C,u),l.memoizedState=e0,l=fh(null,p));else if(io(l),B0(A)){if(C=A.nextSibling&&A.nextSibling.dataset,C)var te=C.dgst;C=te,p=Error(n(419)),p.stack="",p.digest=C,th({value:p,source:null,stack:null}),l=r0(o,l,u)}else if(ti||Sl(o,l,u,!1),C=(u&o.childLanes)!==0,ti||C){if(C=wt,C!==null&&(p=Sd(C,u),p!==0&&p!==Y.retryLane))throw Y.retryLane=p,oa(o,p),pn(C,o,p),KO;D0(A)||Sf(),l=r0(o,l,u)}else D0(A)?(l.flags|=192,l.child=o.child,l=null):(o=Y.treeContext,$t=Hn(A.nextSibling),ki=l,st=!0,Gs=null,In=!1,o!==null&&V_(l,o),l=n0(l,p.children),l.flags|=4096);return l}return y?(no(),A=p.fallback,y=l.mode,Y=o.child,te=Y.sibling,p=rs(Y,{mode:"hidden",children:p.children}),p.subtreeFlags=Y.subtreeFlags&65011712,te!==null?A=rs(te,A):(A=aa(A,y,u,null),A.flags|=2),A.return=l,p.return=l,p.sibling=A,l.child=p,fh(null,p),p=l.child,A=o.child.memoizedState,A===null?A=t0(u):(y=A.cachePool,y!==null?(Y=Jt._currentValue,y=y.parent!==Y?{parent:Y,pool:Y}:y):y=F_(),A={baseLanes:A.baseLanes|u,cachePool:y}),p.memoizedState=A,p.childLanes=i0(o,C,u),l.memoizedState=e0,fh(o.child,p)):(io(l),u=o.child,o=u.sibling,u=rs(u,{mode:"visible",children:p.children}),u.return=l,u.sibling=null,o!==null&&(C=l.deletions,C===null?(l.deletions=[o],l.flags|=16):C.push(o)),l.child=u,l.memoizedState=null,u)}function n0(o,l){return l=uf({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function uf(o,l){return o=wn(22,o,null,l),o.lanes=0,o}function r0(o,l,u){return pa(l,o.child,null,u),o=n0(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function hw(o,l,u){o.lanes|=l;var p=o.alternate;p!==null&&(p.lanes|=l),yO(o.return,l,u)}function s0(o,l,u,p,y,b){var C=o.memoizedState;C===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:y,treeForkCount:b}:(C.isBackwards=l,C.rendering=null,C.renderingStartTime=0,C.last=p,C.tail=u,C.tailMode=y,C.treeForkCount=b)}function uw(o,l,u){var p=l.pendingProps,y=p.revealOrder,b=p.tail;p=p.children;var C=Vt.current,A=(C&2)!==0;if(A?(C=C&1|2,l.flags|=128):C&=1,K(Vt,C),Ti(o,l,p,u),p=st?eh:0,!A&&o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&hw(o,u,l);else if(o.tag===19)hw(o,u,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(y){case"forwards":for(u=l.child,y=null;u!==null;)o=u.alternate,o!==null&&Kd(o)===null&&(y=u),u=u.sibling;u=y,u===null?(y=l.child,l.child=null):(y=u.sibling,u.sibling=null),s0(l,!1,y,u,b,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=l.child,l.child=null;y!==null;){if(o=y.alternate,o!==null&&Kd(o)===null){l.child=y;break}o=y.sibling,y.sibling=u,u=y,y=o}s0(l,!0,u,null,b,p);break;case"together":s0(l,!1,null,null,void 0,p);break;default:l.memoizedState=null}return l.child}function hs(o,l,u){if(o!==null&&(l.dependencies=o.dependencies),oo|=l.lanes,(u&l.childLanes)===0)if(o!==null){if(Sl(o,l,u,!1),(u&l.childLanes)===0)return null}else return null;if(o!==null&&l.child!==o.child)throw Error(n(153));if(l.child!==null){for(o=l.child,u=rs(o,o.pendingProps),l.child=u,u.return=l;o.sibling!==null;)o=o.sibling,u=u.sibling=rs(o,o.pendingProps),u.return=l;u.sibling=null}return l.child}function o0(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&qd(o)))}function Xj(o,l,u){switch(l.tag){case 3:fe(l,l.stateNode.containerInfo),Ks(l,Jt,o.memoizedState.cache),la();break;case 27:case 5:De(l);break;case 4:fe(l,l.stateNode.containerInfo);break;case 10:Ks(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,EO(l),null;break;case 13:var p=l.memoizedState;if(p!==null)return p.dehydrated!==null?(io(l),l.flags|=128,null):(u&l.child.childLanes)!==0?cw(o,l,u):(io(l),o=hs(o,l,u),o!==null?o.sibling:null);io(l);break;case 19:var y=(o.flags&128)!==0;if(p=(u&l.childLanes)!==0,p||(Sl(o,l,u,!1),p=(u&l.childLanes)!==0),y){if(p)return uw(o,l,u);l.flags|=128}if(y=l.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),K(Vt,Vt.current),p)break;return null;case 22:return l.lanes=0,nw(o,l,u,l.pendingProps);case 24:Ks(l,Jt,o.memoizedState.cache)}return hs(o,l,u)}function dw(o,l,u){if(o!==null)if(o.memoizedProps!==l.pendingProps)ti=!0;else{if(!o0(o,u)&&(l.flags&128)===0)return ti=!1,Xj(o,l,u);ti=(o.flags&131072)!==0}else ti=!1,st&&(l.flags&1048576)!==0&&q_(l,eh,l.index);switch(l.lanes=0,l.tag){case 16:e:{var p=l.pendingProps;if(o=da(l.elementType),l.type=o,typeof o=="function")uO(o)?(p=ma(o,p),l.tag=1,l=aw(null,l,o,p,u)):(l.tag=0,l=JO(null,l,o,p,u));else{if(o!=null){var y=o.$$typeof;if(y===T){l.tag=11,l=ew(null,l,o,p,u);break e}else if(y===R){l.tag=14,l=tw(null,l,o,p,u);break e}}throw l=E(o)||o,Error(n(306,l,""))}}return l;case 0:return JO(o,l,l.type,l.pendingProps,u);case 1:return p=l.type,y=ma(p,l.pendingProps),aw(o,l,p,y,u);case 3:e:{if(fe(l,l.stateNode.containerInfo),o===null)throw Error(n(387));p=l.pendingProps;var b=l.memoizedState;y=b.element,CO(o,l),lh(l,p,null,u);var C=l.memoizedState;if(p=C.cache,Ks(l,Jt,p),p!==b.cache&&SO(l,[Jt],u,!0),ah(),p=C.element,b.isDehydrated)if(b={element:p,isDehydrated:!1,cache:C.cache},l.updateQueue.baseState=b,l.memoizedState=b,l.flags&256){l=lw(o,l,p,u);break e}else if(p!==y){y=Wn(Error(n(424)),l),th(y),l=lw(o,l,p,u);break e}else{switch(o=l.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for($t=Hn(o.firstChild),ki=l,st=!0,Gs=null,In=!0,u=nx(l,null,p,u),l.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(la(),p===y){l=hs(o,l,u);break e}Ti(o,l,p,u)}l=l.child}return l;case 26:return hf(o,l),o===null?(u=xk(l.type,null,l.pendingProps,null))?l.memoizedState=u:st||(u=l.type,o=l.pendingProps,p=Tf(de.current).createElement(u),p[li]=l,p[Di]=o,Qi(p,u,o),Kt(p),l.stateNode=p):l.memoizedState=xk(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return De(l),o===null&&st&&(p=l.stateNode=Sk(l.type,l.pendingProps,de.current),ki=l,In=!0,y=$t,uo(l.type)?(L0=y,$t=Hn(p.firstChild)):$t=y),Ti(o,l,l.pendingProps.children,u),hf(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&st&&((y=p=$t)&&(p=m3(p,l.type,l.pendingProps,In),p!==null?(l.stateNode=p,ki=l,$t=Hn(p.firstChild),In=!1,y=!0):y=!1),y||Fs(l)),De(l),y=l.type,b=l.pendingProps,C=o!==null?o.memoizedProps:null,p=b.children,M0(y,b)?p=null:C!==null&&M0(y,C)&&(l.flags|=32),l.memoizedState!==null&&(y=AO(o,l,Ej,null,null,u),Qh._currentValue=y),hf(o,l),Ti(o,l,p,u),l.child;case 6:return o===null&&st&&((o=u=$t)&&(u=O3(u,l.pendingProps,In),u!==null?(l.stateNode=u,ki=l,$t=null,o=!0):o=!1),o||Fs(l)),null;case 13:return cw(o,l,u);case 4:return fe(l,l.stateNode.containerInfo),p=l.pendingProps,o===null?l.child=pa(l,null,p,u):Ti(o,l,p,u),l.child;case 11:return ew(o,l,l.type,l.pendingProps,u);case 7:return Ti(o,l,l.pendingProps,u),l.child;case 8:return Ti(o,l,l.pendingProps.children,u),l.child;case 12:return Ti(o,l,l.pendingProps.children,u),l.child;case 10:return p=l.pendingProps,Ks(l,l.type,p.value),Ti(o,l,p.children,u),l.child;case 9:return y=l.type._context,p=l.pendingProps.children,ha(l),y=Ci(y),p=p(y),l.flags|=1,Ti(o,l,p,u),l.child;case 14:return tw(o,l,l.type,l.pendingProps,u);case 15:return iw(o,l,l.type,l.pendingProps,u);case 19:return uw(o,l,u);case 31:return Lj(o,l,u);case 22:return nw(o,l,u,l.pendingProps);case 24:return ha(l),p=Ci(Jt),o===null?(y=xO(),y===null&&(y=wt,b=bO(),y.pooledCache=b,b.refCount++,b!==null&&(y.pooledCacheLanes|=u),y=b),l.memoizedState={parent:p,cache:y},kO(l),Ks(l,Jt,y)):((o.lanes&u)!==0&&(CO(o,l),lh(l,null,null,u),ah()),y=o.memoizedState,b=l.memoizedState,y.parent!==p?(y={parent:p,cache:p},l.memoizedState=y,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=y),Ks(l,Jt,p)):(p=b.cache,Ks(l,Jt,p),p!==y.cache&&SO(l,[Jt],u,!0))),Ti(o,l,l.pendingProps.children,u),l.child;case 29:throw l.pendingProps}throw Error(n(156,l.tag))}function us(o){o.flags|=4}function a0(o,l,u,p,y){if((l=(o.mode&32)!==0)&&(l=!1),l){if(o.flags|=16777216,(y&335544128)===y)if(o.stateNode.complete)o.flags|=8192;else if(Lw())o.flags|=8192;else throw fa=Hd,wO}else o.flags&=-16777217}function fw(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!Qk(l))if(Lw())o.flags|=8192;else throw fa=Hd,wO}function df(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?Od():536870912,o.lanes|=l,Rl|=l)}function ph(o,l){if(!st)switch(o.tailMode){case"hidden":l=o.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?o.tail=null:u.sibling=null;break;case"collapsed":u=o.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:p.sibling=null}}function Pt(o){var l=o.alternate!==null&&o.alternate.child===o.child,u=0,p=0;if(l)for(var y=o.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags&65011712,p|=y.flags&65011712,y.return=o,y=y.sibling;else for(y=o.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags,p|=y.flags,y.return=o,y=y.sibling;return o.subtreeFlags|=p,o.childLanes=u,l}function Nj(o,l,u){var p=l.pendingProps;switch(gO(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(l),null;case 1:return Pt(l),null;case 3:return u=l.stateNode,p=null,o!==null&&(p=o.memoizedState.cache),l.memoizedState.cache!==p&&(l.flags|=2048),as(Jt),ve(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(o===null||o.child===null)&&(yl(l)?us(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,OO())),Pt(l),null;case 26:var y=l.type,b=l.memoizedState;return o===null?(us(l),b!==null?(Pt(l),fw(l,b)):(Pt(l),a0(l,y,null,p,u))):b?b!==o.memoizedState?(us(l),Pt(l),fw(l,b)):(Pt(l),l.flags&=-16777217):(o=o.memoizedProps,o!==p&&us(l),Pt(l),a0(l,y,o,p,u)),null;case 27:if(Ee(l),u=de.current,y=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&us(l);else{if(!p){if(l.stateNode===null)throw Error(n(166));return Pt(l),null}o=ie.current,yl(l)?I_(l):(o=Sk(y,p,u),l.stateNode=o,us(l))}return Pt(l),null;case 5:if(Ee(l),y=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&us(l);else{if(!p){if(l.stateNode===null)throw Error(n(166));return Pt(l),null}if(b=ie.current,yl(l))I_(l);else{var C=Tf(de.current);switch(b){case 1:b=C.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:b=C.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":b=C.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":b=C.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":b=C.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof p.is=="string"?C.createElement("select",{is:p.is}):C.createElement("select"),p.multiple?b.multiple=!0:p.size&&(b.size=p.size);break;default:b=typeof p.is=="string"?C.createElement(y,{is:p.is}):C.createElement(y)}}b[li]=l,b[Di]=p;e:for(C=l.child;C!==null;){if(C.tag===5||C.tag===6)b.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===l)break e;for(;C.sibling===null;){if(C.return===null||C.return===l)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}l.stateNode=b;e:switch(Qi(b,y,p),y){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&us(l)}}return Pt(l),a0(l,l.type,o===null?null:o.memoizedProps,l.pendingProps,u),null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==p&&us(l);else{if(typeof p!="string"&&l.stateNode===null)throw Error(n(166));if(o=de.current,yl(l)){if(o=l.stateNode,u=l.memoizedProps,p=null,y=ki,y!==null)switch(y.tag){case 27:case 5:p=y.memoizedProps}o[li]=l,o=!!(o.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||ck(o.nodeValue,u)),o||Fs(l,!0)}else o=Tf(o).createTextNode(p),o[li]=l,l.stateNode=o}return Pt(l),null;case 31:if(u=l.memoizedState,o===null||o.memoizedState!==null){if(p=yl(l),u!==null){if(o===null){if(!p)throw Error(n(318));if(o=l.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(557));o[li]=l}else la(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Pt(l),o=!1}else u=OO(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=u),o=!0;if(!o)return l.flags&256?(Cn(l),l):(Cn(l),null);if((l.flags&128)!==0)throw Error(n(558))}return Pt(l),null;case 13:if(p=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=yl(l),p!==null&&p.dehydrated!==null){if(o===null){if(!y)throw Error(n(318));if(y=l.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(n(317));y[li]=l}else la(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Pt(l),y=!1}else y=OO(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=y),y=!0;if(!y)return l.flags&256?(Cn(l),l):(Cn(l),null)}return Cn(l),(l.flags&128)!==0?(l.lanes=u,l):(u=p!==null,o=o!==null&&o.memoizedState!==null,u&&(p=l.child,y=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(y=p.alternate.memoizedState.cachePool.pool),b=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(b=p.memoizedState.cachePool.pool),b!==y&&(p.flags|=2048)),u!==o&&u&&(l.child.flags|=8192),df(l,l.updateQueue),Pt(l),null);case 4:return ve(),o===null&&$0(l.stateNode.containerInfo),Pt(l),null;case 10:return as(l.type),Pt(l),null;case 19:if(q(Vt),p=l.memoizedState,p===null)return Pt(l),null;if(y=(l.flags&128)!==0,b=p.rendering,b===null)if(y)ph(p,!1);else{if(Nt!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(b=Kd(o),b!==null){for(l.flags|=128,ph(p,!1),o=b.updateQueue,l.updateQueue=o,df(l,o),l.subtreeFlags=0,o=u,u=l.child;u!==null;)N_(u,o),u=u.sibling;return K(Vt,Vt.current&1|2),st&&ss(l,p.treeForkCount),l.child}o=o.sibling}p.tail!==null&&Le()>Of&&(l.flags|=128,y=!0,ph(p,!1),l.lanes=4194304)}else{if(!y)if(o=Kd(b),o!==null){if(l.flags|=128,y=!0,o=o.updateQueue,l.updateQueue=o,df(l,o),ph(p,!0),p.tail===null&&p.tailMode==="hidden"&&!b.alternate&&!st)return Pt(l),null}else 2*Le()-p.renderingStartTime>Of&&u!==536870912&&(l.flags|=128,y=!0,ph(p,!1),l.lanes=4194304);p.isBackwards?(b.sibling=l.child,l.child=b):(o=p.last,o!==null?o.sibling=b:l.child=b,p.last=b)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=Le(),o.sibling=null,u=Vt.current,K(Vt,y?u&1|2:u&1),st&&ss(l,p.treeForkCount),o):(Pt(l),null);case 22:case 23:return Cn(l),PO(),p=l.memoizedState!==null,o!==null?o.memoizedState!==null!==p&&(l.flags|=8192):p&&(l.flags|=8192),p?(u&536870912)!==0&&(l.flags&128)===0&&(Pt(l),l.subtreeFlags&6&&(l.flags|=8192)):Pt(l),u=l.updateQueue,u!==null&&df(l,u.retryQueue),u=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==u&&(l.flags|=2048),o!==null&&q(ua),null;case 24:return u=null,o!==null&&(u=o.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),as(Jt),Pt(l),null;case 25:return null;case 30:return null}throw Error(n(156,l.tag))}function Zj(o,l){switch(gO(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return as(Jt),ve(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 26:case 27:case 5:return Ee(l),null;case 31:if(l.memoizedState!==null){if(Cn(l),l.alternate===null)throw Error(n(340));la()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 13:if(Cn(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));la()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return q(Vt),null;case 4:return ve(),null;case 10:return as(l.type),null;case 22:case 23:return Cn(l),PO(),o!==null&&q(ua),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return as(Jt),null;case 25:return null;default:return null}}function pw(o,l){switch(gO(l),l.tag){case 3:as(Jt),ve();break;case 26:case 27:case 5:Ee(l);break;case 4:ve();break;case 31:l.memoizedState!==null&&Cn(l);break;case 13:Cn(l);break;case 19:q(Vt);break;case 10:as(l.type);break;case 22:case 23:Cn(l),PO(),o!==null&&q(ua);break;case 24:as(Jt)}}function gh(o,l){try{var u=l.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var y=p.next;u=y;do{if((u.tag&o)===o){p=void 0;var b=u.create,C=u.inst;p=b(),C.destroy=p}u=u.next}while(u!==y)}}catch(A){yt(l,l.return,A)}}function ro(o,l,u){try{var p=l.updateQueue,y=p!==null?p.lastEffect:null;if(y!==null){var b=y.next;p=b;do{if((p.tag&o)===o){var C=p.inst,A=C.destroy;if(A!==void 0){C.destroy=void 0,y=l;var Y=u,te=A;try{te()}catch(se){yt(y,Y,se)}}}p=p.next}while(p!==b)}}catch(se){yt(l,l.return,se)}}function gw(o){var l=o.updateQueue;if(l!==null){var u=o.stateNode;try{sx(l,u)}catch(p){yt(o,o.return,p)}}}function mw(o,l,u){u.props=ma(o.type,o.memoizedProps),u.state=o.memoizedState;try{u.componentWillUnmount()}catch(p){yt(o,l,p)}}function mh(o,l){try{var u=o.ref;if(u!==null){switch(o.tag){case 26:case 27:case 5:var p=o.stateNode;break;case 30:p=o.stateNode;break;default:p=o.stateNode}typeof u=="function"?o.refCleanup=u(p):u.current=p}}catch(y){yt(o,l,y)}}function Qr(o,l){var u=o.ref,p=o.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(y){yt(o,l,y)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){yt(o,l,y)}else u.current=null}function Ow(o){var l=o.type,u=o.memoizedProps,p=o.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(y){yt(o,o.return,y)}}function l0(o,l,u){try{var p=o.stateNode;h3(p,o.type,u,l),p[Di]=l}catch(y){yt(o,o.return,y)}}function vw(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&uo(o.type)||o.tag===4}function c0(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||vw(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&uo(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function h0(o,l,u){var p=o.tag;if(p===5||p===6)o=o.stateNode,l?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(o,l):(l=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,l.appendChild(o),u=u._reactRootContainer,u!=null||l.onclick!==null||(l.onclick=is));else if(p!==4&&(p===27&&uo(o.type)&&(u=o.stateNode,l=null),o=o.child,o!==null))for(h0(o,l,u),o=o.sibling;o!==null;)h0(o,l,u),o=o.sibling}function ff(o,l,u){var p=o.tag;if(p===5||p===6)o=o.stateNode,l?u.insertBefore(o,l):u.appendChild(o);else if(p!==4&&(p===27&&uo(o.type)&&(u=o.stateNode),o=o.child,o!==null))for(ff(o,l,u),o=o.sibling;o!==null;)ff(o,l,u),o=o.sibling}function yw(o){var l=o.stateNode,u=o.memoizedProps;try{for(var p=o.type,y=l.attributes;y.length;)l.removeAttributeNode(y[0]);Qi(l,p,u),l[li]=o,l[Di]=u}catch(b){yt(o,o.return,b)}}var ds=!1,ii=!1,u0=!1,Sw=typeof WeakSet=="function"?WeakSet:Set,mi=null;function Wj(o,l){if(o=o.containerInfo,R0=Mf,o=R_(o),rO(o)){if("selectionStart"in o)var u={start:o.selectionStart,end:o.selectionEnd};else e:{u=(u=o.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var y=p.anchorOffset,b=p.focusNode;p=p.focusOffset;try{u.nodeType,b.nodeType}catch{u=null;break e}var C=0,A=-1,Y=-1,te=0,se=0,he=o,ne=null;t:for(;;){for(var re;he!==u||y!==0&&he.nodeType!==3||(A=C+y),he!==b||p!==0&&he.nodeType!==3||(Y=C+p),he.nodeType===3&&(C+=he.nodeValue.length),(re=he.firstChild)!==null;)ne=he,he=re;for(;;){if(he===o)break t;if(ne===u&&++te===y&&(A=C),ne===b&&++se===p&&(Y=C),(re=he.nextSibling)!==null)break;he=ne,ne=he.parentNode}he=re}u=A===-1||Y===-1?null:{start:A,end:Y}}else u=null}u=u||{start:0,end:0}}else u=null;for(A0={focusedElem:o,selectionRange:u},Mf=!1,mi=l;mi!==null;)if(l=mi,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,mi=o;else for(;mi!==null;){switch(l=mi,b=l.alternate,o=l.flags,l.tag){case 0:if((o&4)!==0&&(o=l.updateQueue,o=o!==null?o.events:null,o!==null))for(u=0;u<o.length;u++)y=o[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&b!==null){o=void 0,u=l,y=b.memoizedProps,b=b.memoizedState,p=u.stateNode;try{var we=ma(u.type,y);o=p.getSnapshotBeforeUpdate(we,b),p.__reactInternalSnapshotBeforeUpdate=o}catch(ze){yt(u,u.return,ze)}}break;case 3:if((o&1024)!==0){if(o=l.stateNode.containerInfo,u=o.nodeType,u===9)j0(o);else if(u===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":j0(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(n(163))}if(o=l.sibling,o!==null){o.return=l.return,mi=o;break}mi=l.return}}function bw(o,l,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:ps(o,u),p&4&&gh(5,u);break;case 1:if(ps(o,u),p&4)if(o=u.stateNode,l===null)try{o.componentDidMount()}catch(C){yt(u,u.return,C)}else{var y=ma(u.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(y,l,o.__reactInternalSnapshotBeforeUpdate)}catch(C){yt(u,u.return,C)}}p&64&&gw(u),p&512&&mh(u,u.return);break;case 3:if(ps(o,u),p&64&&(o=u.updateQueue,o!==null)){if(l=null,u.child!==null)switch(u.child.tag){case 27:case 5:l=u.child.stateNode;break;case 1:l=u.child.stateNode}try{sx(o,l)}catch(C){yt(u,u.return,C)}}break;case 27:l===null&&p&4&&yw(u);case 26:case 5:ps(o,u),l===null&&p&4&&Ow(u),p&512&&mh(u,u.return);break;case 12:ps(o,u);break;case 31:ps(o,u),p&4&&ww(o,u);break;case 13:ps(o,u),p&4&&kw(o,u),p&64&&(o=u.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(u=Kj.bind(null,u),v3(o,u))));break;case 22:if(p=u.memoizedState!==null||ds,!p){l=l!==null&&l.memoizedState!==null||ii,y=ds;var b=ii;ds=p,(ii=l)&&!b?gs(o,u,(u.subtreeFlags&8772)!==0):ps(o,u),ds=y,ii=b}break;case 30:break;default:ps(o,u)}}function _w(o){var l=o.alternate;l!==null&&(o.alternate=null,_w(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&Zc(l)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var Rt=null,hn=!1;function fs(o,l,u){for(u=u.child;u!==null;)xw(o,l,u),u=u.sibling}function xw(o,l,u){if(Ii&&typeof Ii.onCommitFiberUnmount=="function")try{Ii.onCommitFiberUnmount(Fo,u)}catch{}switch(u.tag){case 26:ii||Qr(u,l),fs(o,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:ii||Qr(u,l);var p=Rt,y=hn;uo(u.type)&&(Rt=u.stateNode,hn=!1),fs(o,l,u),kh(u.stateNode),Rt=p,hn=y;break;case 5:ii||Qr(u,l);case 6:if(p=Rt,y=hn,Rt=null,fs(o,l,u),Rt=p,hn=y,Rt!==null)if(hn)try{(Rt.nodeType===9?Rt.body:Rt.nodeName==="HTML"?Rt.ownerDocument.body:Rt).removeChild(u.stateNode)}catch(b){yt(u,l,b)}else try{Rt.removeChild(u.stateNode)}catch(b){yt(u,l,b)}break;case 18:Rt!==null&&(hn?(o=Rt,gk(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,u.stateNode),Xl(o)):gk(Rt,u.stateNode));break;case 4:p=Rt,y=hn,Rt=u.stateNode.containerInfo,hn=!0,fs(o,l,u),Rt=p,hn=y;break;case 0:case 11:case 14:case 15:ro(2,u,l),ii||ro(4,u,l),fs(o,l,u);break;case 1:ii||(Qr(u,l),p=u.stateNode,typeof p.componentWillUnmount=="function"&&mw(u,l,p)),fs(o,l,u);break;case 21:fs(o,l,u);break;case 22:ii=(p=ii)||u.memoizedState!==null,fs(o,l,u),ii=p;break;default:fs(o,l,u)}}function ww(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{Xl(o)}catch(u){yt(l,l.return,u)}}}function kw(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{Xl(o)}catch(u){yt(l,l.return,u)}}function qj(o){switch(o.tag){case 31:case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new Sw),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new Sw),l;default:throw Error(n(435,o.tag))}}function pf(o,l){var u=qj(o);l.forEach(function(p){if(!u.has(p)){u.add(p);var y=Jj.bind(null,o,p);p.then(y,y)}})}function un(o,l){var u=l.deletions;if(u!==null)for(var p=0;p<u.length;p++){var y=u[p],b=o,C=l,A=C;e:for(;A!==null;){switch(A.tag){case 27:if(uo(A.type)){Rt=A.stateNode,hn=!1;break e}break;case 5:Rt=A.stateNode,hn=!1;break e;case 3:case 4:Rt=A.stateNode.containerInfo,hn=!0;break e}A=A.return}if(Rt===null)throw Error(n(160));xw(b,C,y),Rt=null,hn=!1,b=y.alternate,b!==null&&(b.return=null),y.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)Cw(l,o),l=l.sibling}var hr=null;function Cw(o,l){var u=o.alternate,p=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:un(l,o),dn(o),p&4&&(ro(3,o,o.return),gh(3,o),ro(5,o,o.return));break;case 1:un(l,o),dn(o),p&512&&(ii||u===null||Qr(u,u.return)),p&64&&ds&&(o=o.updateQueue,o!==null&&(p=o.callbacks,p!==null&&(u=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var y=hr;if(un(l,o),dn(o),p&512&&(ii||u===null||Qr(u,u.return)),p&4){var b=u!==null?u.memoizedState:null;if(p=o.memoizedState,u===null)if(p===null)if(o.stateNode===null){e:{p=o.type,u=o.memoizedProps,y=y.ownerDocument||y;t:switch(p){case"title":b=y.getElementsByTagName("title")[0],(!b||b[ea]||b[li]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=y.createElement(p),y.head.insertBefore(b,y.querySelector("head > title"))),Qi(b,p,u),b[li]=o,Kt(b),p=b;break e;case"link":var C=Ck("link","href",y).get(p+(u.href||""));if(C){for(var A=0;A<C.length;A++)if(b=C[A],b.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&b.getAttribute("rel")===(u.rel==null?null:u.rel)&&b.getAttribute("title")===(u.title==null?null:u.title)&&b.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){C.splice(A,1);break t}}b=y.createElement(p),Qi(b,p,u),y.head.appendChild(b);break;case"meta":if(C=Ck("meta","content",y).get(p+(u.content||""))){for(A=0;A<C.length;A++)if(b=C[A],b.getAttribute("content")===(u.content==null?null:""+u.content)&&b.getAttribute("name")===(u.name==null?null:u.name)&&b.getAttribute("property")===(u.property==null?null:u.property)&&b.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&b.getAttribute("charset")===(u.charSet==null?null:u.charSet)){C.splice(A,1);break t}}b=y.createElement(p),Qi(b,p,u),y.head.appendChild(b);break;default:throw Error(n(468,p))}b[li]=o,Kt(b),p=b}o.stateNode=p}else Tk(y,o.type,o.stateNode);else o.stateNode=kk(y,p,o.memoizedProps);else b!==p?(b===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):b.count--,p===null?Tk(y,o.type,o.stateNode):kk(y,p,o.memoizedProps)):p===null&&o.stateNode!==null&&l0(o,o.memoizedProps,u.memoizedProps)}break;case 27:un(l,o),dn(o),p&512&&(ii||u===null||Qr(u,u.return)),u!==null&&p&4&&l0(o,o.memoizedProps,u.memoizedProps);break;case 5:if(un(l,o),dn(o),p&512&&(ii||u===null||Qr(u,u.return)),o.flags&32){y=o.stateNode;try{cl(y,"")}catch(we){yt(o,o.return,we)}}p&4&&o.stateNode!=null&&(y=o.memoizedProps,l0(o,y,u!==null?u.memoizedProps:y)),p&1024&&(u0=!0);break;case 6:if(un(l,o),dn(o),p&4){if(o.stateNode===null)throw Error(n(162));p=o.memoizedProps,u=o.stateNode;try{u.nodeValue=p}catch(we){yt(o,o.return,we)}}break;case 3:if(Pf=null,y=hr,hr=Qf(l.containerInfo),un(l,o),hr=y,dn(o),p&4&&u!==null&&u.memoizedState.isDehydrated)try{Xl(l.containerInfo)}catch(we){yt(o,o.return,we)}u0&&(u0=!1,Tw(o));break;case 4:p=hr,hr=Qf(o.stateNode.containerInfo),un(l,o),dn(o),hr=p;break;case 12:un(l,o),dn(o);break;case 31:un(l,o),dn(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,pf(o,p)));break;case 13:un(l,o),dn(o),o.child.flags&8192&&o.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(mf=Le()),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,pf(o,p)));break;case 22:y=o.memoizedState!==null;var Y=u!==null&&u.memoizedState!==null,te=ds,se=ii;if(ds=te||y,ii=se||Y,un(l,o),ii=se,ds=te,dn(o),p&8192)e:for(l=o.stateNode,l._visibility=y?l._visibility&-2:l._visibility|1,y&&(u===null||Y||ds||ii||Oa(o)),u=null,l=o;;){if(l.tag===5||l.tag===26){if(u===null){Y=u=l;try{if(b=Y.stateNode,y)C=b.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{A=Y.stateNode;var he=Y.memoizedProps.style,ne=he!=null&&he.hasOwnProperty("display")?he.display:null;A.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(we){yt(Y,Y.return,we)}}}else if(l.tag===6){if(u===null){Y=l;try{Y.stateNode.nodeValue=y?"":Y.memoizedProps}catch(we){yt(Y,Y.return,we)}}}else if(l.tag===18){if(u===null){Y=l;try{var re=Y.stateNode;y?mk(re,!0):mk(Y.stateNode,!1)}catch(we){yt(Y,Y.return,we)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===o)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break e;for(;l.sibling===null;){if(l.return===null||l.return===o)break e;u===l&&(u=null),l=l.return}u===l&&(u=null),l.sibling.return=l.return,l=l.sibling}p&4&&(p=o.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,pf(o,u))));break;case 19:un(l,o),dn(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,pf(o,p)));break;case 30:break;case 21:break;default:un(l,o),dn(o)}}function dn(o){var l=o.flags;if(l&2){try{for(var u,p=o.return;p!==null;){if(vw(p)){u=p;break}p=p.return}if(u==null)throw Error(n(160));switch(u.tag){case 27:var y=u.stateNode,b=c0(o);ff(o,b,y);break;case 5:var C=u.stateNode;u.flags&32&&(cl(C,""),u.flags&=-33);var A=c0(o);ff(o,A,C);break;case 3:case 4:var Y=u.stateNode.containerInfo,te=c0(o);h0(o,te,Y);break;default:throw Error(n(161))}}catch(se){yt(o,o.return,se)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function Tw(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;Tw(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function ps(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)bw(o,l.alternate,l),l=l.sibling}function Oa(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:ro(4,l,l.return),Oa(l);break;case 1:Qr(l,l.return);var u=l.stateNode;typeof u.componentWillUnmount=="function"&&mw(l,l.return,u),Oa(l);break;case 27:kh(l.stateNode);case 26:case 5:Qr(l,l.return),Oa(l);break;case 22:l.memoizedState===null&&Oa(l);break;case 30:Oa(l);break;default:Oa(l)}o=o.sibling}}function gs(o,l,u){for(u=u&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var p=l.alternate,y=o,b=l,C=b.flags;switch(b.tag){case 0:case 11:case 15:gs(y,b,u),gh(4,b);break;case 1:if(gs(y,b,u),p=b,y=p.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(te){yt(p,p.return,te)}if(p=b,y=p.updateQueue,y!==null){var A=p.stateNode;try{var Y=y.shared.hiddenCallbacks;if(Y!==null)for(y.shared.hiddenCallbacks=null,y=0;y<Y.length;y++)rx(Y[y],A)}catch(te){yt(p,p.return,te)}}u&&C&64&&gw(b),mh(b,b.return);break;case 27:yw(b);case 26:case 5:gs(y,b,u),u&&p===null&&C&4&&Ow(b),mh(b,b.return);break;case 12:gs(y,b,u);break;case 31:gs(y,b,u),u&&C&4&&ww(y,b);break;case 13:gs(y,b,u),u&&C&4&&kw(y,b);break;case 22:b.memoizedState===null&&gs(y,b,u),mh(b,b.return);break;case 30:break;default:gs(y,b,u)}l=l.sibling}}function d0(o,l){var u=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==u&&(o!=null&&o.refCount++,u!=null&&ih(u))}function f0(o,l){o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&ih(o))}function ur(o,l,u,p){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Qw(o,l,u,p),l=l.sibling}function Qw(o,l,u,p){var y=l.flags;switch(l.tag){case 0:case 11:case 15:ur(o,l,u,p),y&2048&&gh(9,l);break;case 1:ur(o,l,u,p);break;case 3:ur(o,l,u,p),y&2048&&(o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&ih(o)));break;case 12:if(y&2048){ur(o,l,u,p),o=l.stateNode;try{var b=l.memoizedProps,C=b.id,A=b.onPostCommit;typeof A=="function"&&A(C,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(Y){yt(l,l.return,Y)}}else ur(o,l,u,p);break;case 31:ur(o,l,u,p);break;case 13:ur(o,l,u,p);break;case 23:break;case 22:b=l.stateNode,C=l.alternate,l.memoizedState!==null?b._visibility&2?ur(o,l,u,p):Oh(o,l):b._visibility&2?ur(o,l,u,p):(b._visibility|=2,$l(o,l,u,p,(l.subtreeFlags&10256)!==0||!1)),y&2048&&d0(C,l);break;case 24:ur(o,l,u,p),y&2048&&f0(l.alternate,l);break;default:ur(o,l,u,p)}}function $l(o,l,u,p,y){for(y=y&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var b=o,C=l,A=u,Y=p,te=C.flags;switch(C.tag){case 0:case 11:case 15:$l(b,C,A,Y,y),gh(8,C);break;case 23:break;case 22:var se=C.stateNode;C.memoizedState!==null?se._visibility&2?$l(b,C,A,Y,y):Oh(b,C):(se._visibility|=2,$l(b,C,A,Y,y)),y&&te&2048&&d0(C.alternate,C);break;case 24:$l(b,C,A,Y,y),y&&te&2048&&f0(C.alternate,C);break;default:$l(b,C,A,Y,y)}l=l.sibling}}function Oh(o,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=o,p=l,y=p.flags;switch(p.tag){case 22:Oh(u,p),y&2048&&d0(p.alternate,p);break;case 24:Oh(u,p),y&2048&&f0(p.alternate,p);break;default:Oh(u,p)}l=l.sibling}}var vh=8192;function Pl(o,l,u){if(o.subtreeFlags&vh)for(o=o.child;o!==null;)$w(o,l,u),o=o.sibling}function $w(o,l,u){switch(o.tag){case 26:Pl(o,l,u),o.flags&vh&&o.memoizedState!==null&&P3(u,hr,o.memoizedState,o.memoizedProps);break;case 5:Pl(o,l,u);break;case 3:case 4:var p=hr;hr=Qf(o.stateNode.containerInfo),Pl(o,l,u),hr=p;break;case 22:o.memoizedState===null&&(p=o.alternate,p!==null&&p.memoizedState!==null?(p=vh,vh=16777216,Pl(o,l,u),vh=p):Pl(o,l,u));break;default:Pl(o,l,u)}}function Pw(o){var l=o.alternate;if(l!==null&&(o=l.child,o!==null)){l.child=null;do l=o.sibling,o.sibling=null,o=l;while(o!==null)}}function yh(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var p=l[u];mi=p,Rw(p,o)}Pw(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Ew(o),o=o.sibling}function Ew(o){switch(o.tag){case 0:case 11:case 15:yh(o),o.flags&2048&&ro(9,o,o.return);break;case 3:yh(o);break;case 12:yh(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,gf(o)):yh(o);break;default:yh(o)}}function gf(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var p=l[u];mi=p,Rw(p,o)}Pw(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:ro(8,l,l.return),gf(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,gf(l));break;default:gf(l)}o=o.sibling}}function Rw(o,l){for(;mi!==null;){var u=mi;switch(u.tag){case 0:case 11:case 15:ro(8,u,l);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:ih(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,mi=p;else e:for(u=o;mi!==null;){p=mi;var y=p.sibling,b=p.return;if(_w(p),p===u){mi=null;break e}if(y!==null){y.return=b,mi=y;break e}mi=b}}}var Vj={getCacheForType:function(o){var l=Ci(Jt),u=l.data.get(o);return u===void 0&&(u=o(),l.data.set(o,u)),u},cacheSignal:function(){return Ci(Jt).controller.signal}},Ij=typeof WeakMap=="function"?WeakMap:Map,ft=0,wt=null,Ke=null,tt=0,vt=0,Tn=null,so=!1,El=!1,p0=!1,ms=0,Nt=0,oo=0,va=0,g0=0,Qn=0,Rl=0,Sh=null,fn=null,m0=!1,mf=0,Aw=0,Of=1/0,vf=null,ao=null,ci=0,lo=null,Al=null,Os=0,O0=0,v0=null,Mw=null,bh=0,y0=null;function $n(){return(ft&2)!==0&&tt!==0?tt&-tt:P.T!==null?k0():bd()}function zw(){if(Qn===0)if((tt&536870912)===0||st){var o=nl;nl<<=1,(nl&3932160)===0&&(nl=262144),Qn=o}else Qn=536870912;return o=kn.current,o!==null&&(o.flags|=32),Qn}function pn(o,l,u){(o===wt&&(vt===2||vt===9)||o.cancelPendingCommit!==null)&&(Ml(o,0),co(o,tt,Qn,!1)),Jo(o,u),((ft&2)===0||o!==wt)&&(o===wt&&((ft&2)===0&&(va|=u),Nt===4&&co(o,tt,Qn,!1)),$r(o))}function jw(o,l,u){if((ft&6)!==0)throw Error(n(327));var p=!u&&(l&127)===0&&(l&o.expiredLanes)===0||Ko(o,l),y=p?Uj(o,l):b0(o,l,!0),b=p;do{if(y===0){El&&!p&&co(o,l,0,!1);break}else{if(u=o.current.alternate,b&&!Yj(u)){y=b0(o,l,!1),b=!1;continue}if(y===2){if(b=l,o.errorRecoveryDisabledLanes&b)var C=0;else C=o.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){l=C;e:{var A=o;y=Sh;var Y=A.current.memoizedState.isDehydrated;if(Y&&(Ml(A,C).flags|=256),C=b0(A,C,!1),C!==2){if(p0&&!Y){A.errorRecoveryDisabledLanes|=b,va|=b,y=4;break e}b=fn,fn=y,b!==null&&(fn===null?fn=b:fn.push.apply(fn,b))}y=C}if(b=!1,y!==2)continue}}if(y===1){Ml(o,0),co(o,l,0,!0);break}e:{switch(p=o,b=y,b){case 0:case 1:throw Error(n(345));case 4:if((l&4194048)!==l)break;case 6:co(p,l,Qn,!so);break e;case 2:fn=null;break;case 3:case 5:break;default:throw Error(n(329))}if((l&62914560)===l&&(y=mf+300-Le(),10<y)){if(co(p,l,Qn,!so),sl(p,0,!0)!==0)break e;Os=l,p.timeoutHandle=fk(Dw.bind(null,p,u,fn,vf,m0,l,Qn,va,Rl,so,b,"Throttled",-0,0),y);break e}Dw(p,u,fn,vf,m0,l,Qn,va,Rl,so,b,null,-0,0)}}break}while(!0);$r(o)}function Dw(o,l,u,p,y,b,C,A,Y,te,se,he,ne,re){if(o.timeoutHandle=-1,he=l.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:is},$w(l,b,he);var we=(b&62914560)===b?mf-Le():(b&4194048)===b?Aw-Le():0;if(we=E3(he,we),we!==null){Os=b,o.cancelPendingCommit=we(Vw.bind(null,o,l,b,u,p,y,C,A,Y,se,he,null,ne,re)),co(o,b,C,!te);return}}Vw(o,l,b,u,p,y,C,A,Y)}function Yj(o){for(var l=o;;){var u=l.tag;if((u===0||u===11||u===15)&&l.flags&16384&&(u=l.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var p=0;p<u.length;p++){var y=u[p],b=y.getSnapshot;y=y.value;try{if(!xn(b(),y))return!1}catch{return!1}}if(u=l.child,l.subtreeFlags&16384&&u!==null)u.return=l,l=u;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function co(o,l,u,p){l&=~g0,l&=~va,o.suspendedLanes|=l,o.pingedLanes&=~l,p&&(o.warmLanes|=l),p=o.expirationTimes;for(var y=l;0<y;){var b=31-Yi(y),C=1<<b;p[b]=-1,y&=~C}u!==0&&vd(o,u,l)}function yf(){return(ft&6)===0?(_h(0),!1):!0}function S0(){if(Ke!==null){if(vt===0)var o=Ke.return;else o=Ke,os=ca=null,jO(o),wl=null,rh=0,o=Ke;for(;o!==null;)pw(o.alternate,o),o=o.return;Ke=null}}function Ml(o,l){var u=o.timeoutHandle;u!==-1&&(o.timeoutHandle=-1,f3(u)),u=o.cancelPendingCommit,u!==null&&(o.cancelPendingCommit=null,u()),Os=0,S0(),wt=o,Ke=u=rs(o.current,null),tt=l,vt=0,Tn=null,so=!1,El=Ko(o,l),p0=!1,Rl=Qn=g0=va=oo=Nt=0,fn=Sh=null,m0=!1,(l&8)!==0&&(l|=l&32);var p=o.entangledLanes;if(p!==0)for(o=o.entanglements,p&=l;0<p;){var y=31-Yi(p),b=1<<y;l|=o[y],p&=~b}return ms=l,Ld(),u}function Bw(o,l){Ie=null,P.H=dh,l===xl||l===Yd?(l=ex(),vt=3):l===wO?(l=ex(),vt=4):vt=l===KO?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Tn=l,Ke===null&&(Nt=1,lf(o,Wn(l,o.current)))}function Lw(){var o=kn.current;return o===null?!0:(tt&4194048)===tt?Yn===null:(tt&62914560)===tt||(tt&536870912)!==0?o===Yn:!1}function Xw(){var o=P.H;return P.H=dh,o===null?dh:o}function Nw(){var o=P.A;return P.A=Vj,o}function Sf(){Nt=4,so||(tt&4194048)!==tt&&kn.current!==null||(El=!0),(oo&134217727)===0&&(va&134217727)===0||wt===null||co(wt,tt,Qn,!1)}function b0(o,l,u){var p=ft;ft|=2;var y=Xw(),b=Nw();(wt!==o||tt!==l)&&(vf=null,Ml(o,l)),l=!1;var C=Nt;e:do try{if(vt!==0&&Ke!==null){var A=Ke,Y=Tn;switch(vt){case 8:S0(),C=6;break e;case 3:case 2:case 9:case 6:kn.current===null&&(l=!0);var te=vt;if(vt=0,Tn=null,zl(o,A,Y,te),u&&El){C=0;break e}break;default:te=vt,vt=0,Tn=null,zl(o,A,Y,te)}}Hj(),C=Nt;break}catch(se){Bw(o,se)}while(!0);return l&&o.shellSuspendCounter++,os=ca=null,ft=p,P.H=y,P.A=b,Ke===null&&(wt=null,tt=0,Ld()),C}function Hj(){for(;Ke!==null;)Zw(Ke)}function Uj(o,l){var u=ft;ft|=2;var p=Xw(),y=Nw();wt!==o||tt!==l?(vf=null,Of=Le()+500,Ml(o,l)):El=Ko(o,l);e:do try{if(vt!==0&&Ke!==null){l=Ke;var b=Tn;t:switch(vt){case 1:vt=0,Tn=null,zl(o,l,b,1);break;case 2:case 9:if(K_(b)){vt=0,Tn=null,Ww(l);break}l=function(){vt!==2&&vt!==9||wt!==o||(vt=7),$r(o)},b.then(l,l);break e;case 3:vt=7;break e;case 4:vt=5;break e;case 7:K_(b)?(vt=0,Tn=null,Ww(l)):(vt=0,Tn=null,zl(o,l,b,7));break;case 5:var C=null;switch(Ke.tag){case 26:C=Ke.memoizedState;case 5:case 27:var A=Ke;if(C?Qk(C):A.stateNode.complete){vt=0,Tn=null;var Y=A.sibling;if(Y!==null)Ke=Y;else{var te=A.return;te!==null?(Ke=te,bf(te)):Ke=null}break t}}vt=0,Tn=null,zl(o,l,b,5);break;case 6:vt=0,Tn=null,zl(o,l,b,6);break;case 8:S0(),Nt=6;break e;default:throw Error(n(462))}}Gj();break}catch(se){Bw(o,se)}while(!0);return os=ca=null,P.H=p,P.A=y,ft=u,Ke!==null?0:(wt=null,tt=0,Ld(),Nt)}function Gj(){for(;Ke!==null&&!oe();)Zw(Ke)}function Zw(o){var l=dw(o.alternate,o,ms);o.memoizedProps=o.pendingProps,l===null?bf(o):Ke=l}function Ww(o){var l=o,u=l.alternate;switch(l.tag){case 15:case 0:l=ow(u,l,l.pendingProps,l.type,void 0,tt);break;case 11:l=ow(u,l,l.pendingProps,l.type.render,l.ref,tt);break;case 5:jO(l);default:pw(u,l),l=Ke=N_(l,ms),l=dw(u,l,ms)}o.memoizedProps=o.pendingProps,l===null?bf(o):Ke=l}function zl(o,l,u,p){os=ca=null,jO(l),wl=null,rh=0;var y=l.return;try{if(Bj(o,y,l,u,tt)){Nt=1,lf(o,Wn(u,o.current)),Ke=null;return}}catch(b){if(y!==null)throw Ke=y,b;Nt=1,lf(o,Wn(u,o.current)),Ke=null;return}l.flags&32768?(st||p===1?o=!0:El||(tt&536870912)!==0?o=!1:(so=o=!0,(p===2||p===9||p===3||p===6)&&(p=kn.current,p!==null&&p.tag===13&&(p.flags|=16384))),qw(l,o)):bf(l)}function bf(o){var l=o;do{if((l.flags&32768)!==0){qw(l,so);return}o=l.return;var u=Nj(l.alternate,l,ms);if(u!==null){Ke=u;return}if(l=l.sibling,l!==null){Ke=l;return}Ke=l=o}while(l!==null);Nt===0&&(Nt=5)}function qw(o,l){do{var u=Zj(o.alternate,o);if(u!==null){u.flags&=32767,Ke=u;return}if(u=o.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(o=o.sibling,o!==null)){Ke=o;return}Ke=o=u}while(o!==null);Nt=6,Ke=null}function Vw(o,l,u,p,y,b,C,A,Y){o.cancelPendingCommit=null;do _f();while(ci!==0);if((ft&6)!==0)throw Error(n(327));if(l!==null){if(l===o.current)throw Error(n(177));if(b=l.lanes|l.childLanes,b|=cO,Lm(o,u,b,C,A,Y),o===wt&&(Ke=wt=null,tt=0),Al=l,lo=o,Os=u,O0=b,v0=y,Mw=p,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,e3(Go,function(){return Gw(),null})):(o.callbackNode=null,o.callbackPriority=0),p=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||p){p=P.T,P.T=null,y=Z.p,Z.p=2,C=ft,ft|=4;try{Wj(o,l,u)}finally{ft=C,Z.p=y,P.T=p}}ci=1,Iw(),Yw(),Hw()}}function Iw(){if(ci===1){ci=0;var o=lo,l=Al,u=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||u){u=P.T,P.T=null;var p=Z.p;Z.p=2;var y=ft;ft|=4;try{Cw(l,o);var b=A0,C=R_(o.containerInfo),A=b.focusedElem,Y=b.selectionRange;if(C!==A&&A&&A.ownerDocument&&E_(A.ownerDocument.documentElement,A)){if(Y!==null&&rO(A)){var te=Y.start,se=Y.end;if(se===void 0&&(se=te),"selectionStart"in A)A.selectionStart=te,A.selectionEnd=Math.min(se,A.value.length);else{var he=A.ownerDocument||document,ne=he&&he.defaultView||window;if(ne.getSelection){var re=ne.getSelection(),we=A.textContent.length,ze=Math.min(Y.start,we),_t=Y.end===void 0?ze:Math.min(Y.end,we);!re.extend&&ze>_t&&(C=_t,_t=ze,ze=C);var F=P_(A,ze),U=P_(A,_t);if(F&&U&&(re.rangeCount!==1||re.anchorNode!==F.node||re.anchorOffset!==F.offset||re.focusNode!==U.node||re.focusOffset!==U.offset)){var J=he.createRange();J.setStart(F.node,F.offset),re.removeAllRanges(),ze>_t?(re.addRange(J),re.extend(U.node,U.offset)):(J.setEnd(U.node,U.offset),re.addRange(J))}}}}for(he=[],re=A;re=re.parentNode;)re.nodeType===1&&he.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<he.length;A++){var ae=he[A];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}Mf=!!R0,A0=R0=null}finally{ft=y,Z.p=p,P.T=u}}o.current=l,ci=2}}function Yw(){if(ci===2){ci=0;var o=lo,l=Al,u=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||u){u=P.T,P.T=null;var p=Z.p;Z.p=2;var y=ft;ft|=4;try{bw(o,l.alternate,l)}finally{ft=y,Z.p=p,P.T=u}}ci=3}}function Hw(){if(ci===4||ci===3){ci=0,We();var o=lo,l=Al,u=Os,p=Mw;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?ci=5:(ci=0,Al=lo=null,Uw(o,o.pendingLanes));var y=o.pendingLanes;if(y===0&&(ao=null),Nc(u),l=l.stateNode,Ii&&typeof Ii.onCommitFiberRoot=="function")try{Ii.onCommitFiberRoot(Fo,l,void 0,(l.current.flags&128)===128)}catch{}if(p!==null){l=P.T,y=Z.p,Z.p=2,P.T=null;try{for(var b=o.onRecoverableError,C=0;C<p.length;C++){var A=p[C];b(A.value,{componentStack:A.stack})}}finally{P.T=l,Z.p=y}}(Os&3)!==0&&_f(),$r(o),y=o.pendingLanes,(u&261930)!==0&&(y&42)!==0?o===y0?bh++:(bh=0,y0=o):bh=0,_h(0)}}function Uw(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,ih(l)))}function _f(){return Iw(),Yw(),Hw(),Gw()}function Gw(){if(ci!==5)return!1;var o=lo,l=O0;O0=0;var u=Nc(Os),p=P.T,y=Z.p;try{Z.p=32>u?32:u,P.T=null,u=v0,v0=null;var b=lo,C=Os;if(ci=0,Al=lo=null,Os=0,(ft&6)!==0)throw Error(n(331));var A=ft;if(ft|=4,Ew(b.current),Qw(b,b.current,C,u),ft=A,_h(0,!1),Ii&&typeof Ii.onPostCommitFiberRoot=="function")try{Ii.onPostCommitFiberRoot(Fo,b)}catch{}return!0}finally{Z.p=y,P.T=p,Uw(o,l)}}function Fw(o,l,u){l=Wn(u,l),l=FO(o.stateNode,l,2),o=to(o,l,2),o!==null&&(Jo(o,2),$r(o))}function yt(o,l,u){if(o.tag===3)Fw(o,o,u);else for(;l!==null;){if(l.tag===3){Fw(l,o,u);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(ao===null||!ao.has(p))){o=Wn(u,o),u=Kx(2),p=to(l,u,2),p!==null&&(Jx(u,p,l,o),Jo(p,2),$r(p));break}}l=l.return}}function _0(o,l,u){var p=o.pingCache;if(p===null){p=o.pingCache=new Ij;var y=new Set;p.set(l,y)}else y=p.get(l),y===void 0&&(y=new Set,p.set(l,y));y.has(u)||(p0=!0,y.add(u),o=Fj.bind(null,o,l,u),l.then(o,o))}function Fj(o,l,u){var p=o.pingCache;p!==null&&p.delete(l),o.pingedLanes|=o.suspendedLanes&u,o.warmLanes&=~u,wt===o&&(tt&u)===u&&(Nt===4||Nt===3&&(tt&62914560)===tt&&300>Le()-mf?(ft&2)===0&&Ml(o,0):g0|=u,Rl===tt&&(Rl=0)),$r(o)}function Kw(o,l){l===0&&(l=Od()),o=oa(o,l),o!==null&&(Jo(o,l),$r(o))}function Kj(o){var l=o.memoizedState,u=0;l!==null&&(u=l.retryLane),Kw(o,u)}function Jj(o,l){var u=0;switch(o.tag){case 31:case 13:var p=o.stateNode,y=o.memoizedState;y!==null&&(u=y.retryLane);break;case 19:p=o.stateNode;break;case 22:p=o.stateNode._retryCache;break;default:throw Error(n(314))}p!==null&&p.delete(l),Kw(o,u)}function e3(o,l){return _n(o,l)}var xf=null,jl=null,x0=!1,wf=!1,w0=!1,ho=0;function $r(o){o!==jl&&o.next===null&&(jl===null?xf=jl=o:jl=jl.next=o),wf=!0,x0||(x0=!0,i3())}function _h(o,l){if(!w0&&wf){w0=!0;do for(var u=!1,p=xf;p!==null;){if(o!==0){var y=p.pendingLanes;if(y===0)var b=0;else{var C=p.suspendedLanes,A=p.pingedLanes;b=(1<<31-Yi(42|o)+1)-1,b&=y&~(C&~A),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(u=!0,ik(p,b))}else b=tt,b=sl(p,p===wt?b:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(b&3)===0||Ko(p,b)||(u=!0,ik(p,b));p=p.next}while(u);w0=!1}}function t3(){Jw()}function Jw(){wf=x0=!1;var o=0;ho!==0&&d3()&&(o=ho);for(var l=Le(),u=null,p=xf;p!==null;){var y=p.next,b=ek(p,l);b===0?(p.next=null,u===null?xf=y:u.next=y,y===null&&(jl=u)):(u=p,(o!==0||(b&3)!==0)&&(wf=!0)),p=y}ci!==0&&ci!==5||_h(o),ho!==0&&(ho=0)}function ek(o,l){for(var u=o.suspendedLanes,p=o.pingedLanes,y=o.expirationTimes,b=o.pendingLanes&-62914561;0<b;){var C=31-Yi(b),A=1<<C,Y=y[C];Y===-1?((A&u)===0||(A&p)!==0)&&(y[C]=Bm(A,l)):Y<=l&&(o.expiredLanes|=A),b&=~A}if(l=wt,u=tt,u=sl(o,o===l?u:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p=o.callbackNode,u===0||o===l&&(vt===2||vt===9)||o.cancelPendingCommit!==null)return p!==null&&p!==null&&ar(p),o.callbackNode=null,o.callbackPriority=0;if((u&3)===0||Ko(o,u)){if(l=u&-u,l===o.callbackPriority)return l;switch(p!==null&&ar(p),Nc(u)){case 2:case 8:u=Vi;break;case 32:u=Go;break;case 268435456:u=tl;break;default:u=Go}return p=tk.bind(null,o),u=_n(u,p),o.callbackPriority=l,o.callbackNode=u,l}return p!==null&&p!==null&&ar(p),o.callbackPriority=2,o.callbackNode=null,2}function tk(o,l){if(ci!==0&&ci!==5)return o.callbackNode=null,o.callbackPriority=0,null;var u=o.callbackNode;if(_f()&&o.callbackNode!==u)return null;var p=tt;return p=sl(o,o===wt?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p===0?null:(jw(o,p,l),ek(o,Le()),o.callbackNode!=null&&o.callbackNode===u?tk.bind(null,o):null)}function ik(o,l){if(_f())return null;jw(o,l,!0)}function i3(){p3(function(){(ft&6)!==0?_n(on,t3):Jw()})}function k0(){if(ho===0){var o=bl;o===0&&(o=il,il<<=1,(il&261888)===0&&(il=256)),ho=o}return ho}function nk(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Ed(""+o)}function rk(o,l){var u=l.ownerDocument.createElement("input");return u.name=l.name,u.value=l.value,o.id&&u.setAttribute("form",o.id),l.parentNode.insertBefore(u,l),o=new FormData(o),u.parentNode.removeChild(u),o}function n3(o,l,u,p,y){if(l==="submit"&&u&&u.stateNode===y){var b=nk((y[Di]||null).action),C=p.submitter;C&&(l=(l=C[Di]||null)?nk(l.formAction):C.getAttribute("formAction"),l!==null&&(b=l,C=null));var A=new zd("action","action",null,p,y);o.push({event:A,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(ho!==0){var Y=C?rk(y,C):new FormData(y);VO(u,{pending:!0,data:Y,method:y.method,action:b},null,Y)}}else typeof b=="function"&&(A.preventDefault(),Y=C?rk(y,C):new FormData(y),VO(u,{pending:!0,data:Y,method:y.method,action:b},b,Y))},currentTarget:y}]})}}for(var C0=0;C0<lO.length;C0++){var T0=lO[C0],r3=T0.toLowerCase(),s3=T0[0].toUpperCase()+T0.slice(1);cr(r3,"on"+s3)}cr(z_,"onAnimationEnd"),cr(j_,"onAnimationIteration"),cr(D_,"onAnimationStart"),cr("dblclick","onDoubleClick"),cr("focusin","onFocus"),cr("focusout","onBlur"),cr(bj,"onTransitionRun"),cr(_j,"onTransitionStart"),cr(xj,"onTransitionCancel"),cr(B_,"onTransitionEnd"),Is("onMouseEnter",["mouseout","mouseover"]),Is("onMouseLeave",["mouseout","mouseover"]),Is("onPointerEnter",["pointerout","pointerover"]),Is("onPointerLeave",["pointerout","pointerover"]),es("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),es("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),es("onBeforeInput",["compositionend","keypress","textInput","paste"]),es("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xh="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(" "),o3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xh));function sk(o,l){l=(l&4)!==0;for(var u=0;u<o.length;u++){var p=o[u],y=p.event;p=p.listeners;e:{var b=void 0;if(l)for(var C=p.length-1;0<=C;C--){var A=p[C],Y=A.instance,te=A.currentTarget;if(A=A.listener,Y!==b&&y.isPropagationStopped())break e;b=A,y.currentTarget=te;try{b(y)}catch(se){Bd(se)}y.currentTarget=null,b=Y}else for(C=0;C<p.length;C++){if(A=p[C],Y=A.instance,te=A.currentTarget,A=A.listener,Y!==b&&y.isPropagationStopped())break e;b=A,y.currentTarget=te;try{b(y)}catch(se){Bd(se)}y.currentTarget=null,b=Y}}}}function Je(o,l){var u=l[ol];u===void 0&&(u=l[ol]=new Set);var p=o+"__bubble";u.has(p)||(ok(l,o,2,!1),u.add(p))}function Q0(o,l,u){var p=0;l&&(p|=4),ok(u,o,p,l)}var kf="_reactListening"+Math.random().toString(36).slice(2);function $0(o){if(!o[kf]){o[kf]=!0,kd.forEach(function(u){u!=="selectionchange"&&(o3.has(u)||Q0(u,!1,o),Q0(u,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[kf]||(l[kf]=!0,Q0("selectionchange",!1,l))}}function ok(o,l,u,p){switch(zk(l)){case 2:var y=M3;break;case 8:y=z3;break;default:y=q0}u=y.bind(null,l,u,o),y=void 0,!Um||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(y=!0),p?y!==void 0?o.addEventListener(l,u,{capture:!0,passive:y}):o.addEventListener(l,u,!0):y!==void 0?o.addEventListener(l,u,{passive:y}):o.addEventListener(l,u,!1)}function P0(o,l,u,p,y){var b=p;if((l&1)===0&&(l&2)===0&&p!==null)e:for(;;){if(p===null)return;var C=p.tag;if(C===3||C===4){var A=p.stateNode.containerInfo;if(A===y)break;if(C===4)for(C=p.return;C!==null;){var Y=C.tag;if((Y===3||Y===4)&&C.stateNode.containerInfo===y)return;C=C.return}for(;A!==null;){if(C=Zs(A),C===null)return;if(Y=C.tag,Y===5||Y===6||Y===26||Y===27){p=b=C;continue e}A=A.parentNode}}p=p.return}u_(function(){var te=b,se=Ym(u),he=[];e:{var ne=L_.get(o);if(ne!==void 0){var re=zd,we=o;switch(o){case"keypress":if(Ad(u)===0)break e;case"keydown":case"keyup":re=Jz;break;case"focusin":we="focus",re=Jm;break;case"focusout":we="blur",re=Jm;break;case"beforeblur":case"afterblur":re=Jm;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=p_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=Nz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=ij;break;case z_:case j_:case D_:re=qz;break;case B_:re=rj;break;case"scroll":case"scrollend":re=Lz;break;case"wheel":re=oj;break;case"copy":case"cut":case"paste":re=Iz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=m_;break;case"toggle":case"beforetoggle":re=lj}var ze=(l&4)!==0,_t=!ze&&(o==="scroll"||o==="scrollend"),F=ze?ne!==null?ne+"Capture":null:ne;ze=[];for(var U=te,J;U!==null;){var ae=U;if(J=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||J===null||F===null||(ae=Vc(U,F),ae!=null&&ze.push(wh(U,ae,J))),_t)break;U=U.return}0<ze.length&&(ne=new re(ne,we,null,u,se),he.push({event:ne,listeners:ze}))}}if((l&7)===0){e:{if(ne=o==="mouseover"||o==="pointerover",re=o==="mouseout"||o==="pointerout",ne&&u!==Im&&(we=u.relatedTarget||u.fromElement)&&(Zs(we)||we[Jr]))break e;if((re||ne)&&(ne=se.window===se?se:(ne=se.ownerDocument)?ne.defaultView||ne.parentWindow:window,re?(we=u.relatedTarget||u.toElement,re=te,we=we?Zs(we):null,we!==null&&(_t=s(we),ze=we.tag,we!==_t||ze!==5&&ze!==27&&ze!==6)&&(we=null)):(re=null,we=te),re!==we)){if(ze=p_,ae="onMouseLeave",F="onMouseEnter",U="mouse",(o==="pointerout"||o==="pointerover")&&(ze=m_,ae="onPointerLeave",F="onPointerEnter",U="pointer"),_t=re==null?ne:qs(re),J=we==null?ne:qs(we),ne=new ze(ae,U+"leave",re,u,se),ne.target=_t,ne.relatedTarget=J,ae=null,Zs(se)===te&&(ze=new ze(F,U+"enter",we,u,se),ze.target=J,ze.relatedTarget=_t,ae=ze),_t=ae,re&&we)t:{for(ze=a3,F=re,U=we,J=0,ae=F;ae;ae=ze(ae))J++;ae=0;for(var Ae=U;Ae;Ae=ze(Ae))ae++;for(;0<J-ae;)F=ze(F),J--;for(;0<ae-J;)U=ze(U),ae--;for(;J--;){if(F===U||U!==null&&F===U.alternate){ze=F;break t}F=ze(F),U=ze(U)}ze=null}else ze=null;re!==null&&ak(he,ne,re,ze,!1),we!==null&&_t!==null&&ak(he,_t,we,ze,!0)}}e:{if(ne=te?qs(te):window,re=ne.nodeName&&ne.nodeName.toLowerCase(),re==="select"||re==="input"&&ne.type==="file")var ht=w_;else if(__(ne))if(k_)ht=vj;else{ht=mj;var Te=gj}else re=ne.nodeName,!re||re.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?te&&Vm(te.elementType)&&(ht=w_):ht=Oj;if(ht&&(ht=ht(o,te))){x_(he,ht,u,se);break e}Te&&Te(o,ne,te),o==="focusout"&&te&&ne.type==="number"&&te.memoizedProps.value!=null&&qc(ne,"number",ne.value)}switch(Te=te?qs(te):window,o){case"focusin":(__(Te)||Te.contentEditable==="true")&&(fl=Te,sO=te,Jc=null);break;case"focusout":Jc=sO=fl=null;break;case"mousedown":oO=!0;break;case"contextmenu":case"mouseup":case"dragend":oO=!1,A_(he,u,se);break;case"selectionchange":if(Sj)break;case"keydown":case"keyup":A_(he,u,se)}var Ye;if(tO)e:{switch(o){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else dl?S_(o,u)&&(it="onCompositionEnd"):o==="keydown"&&u.keyCode===229&&(it="onCompositionStart");it&&(O_&&u.locale!=="ko"&&(dl||it!=="onCompositionStart"?it==="onCompositionEnd"&&dl&&(Ye=d_()):(Hs=se,Gm="value"in Hs?Hs.value:Hs.textContent,dl=!0)),Te=Cf(te,it),0<Te.length&&(it=new g_(it,o,null,u,se),he.push({event:it,listeners:Te}),Ye?it.data=Ye:(Ye=b_(u),Ye!==null&&(it.data=Ye)))),(Ye=hj?uj(o,u):dj(o,u))&&(it=Cf(te,"onBeforeInput"),0<it.length&&(Te=new g_("onBeforeInput","beforeinput",null,u,se),he.push({event:Te,listeners:it}),Te.data=Ye)),n3(he,o,te,u,se)}sk(he,l)})}function wh(o,l,u){return{instance:o,listener:l,currentTarget:u}}function Cf(o,l){for(var u=l+"Capture",p=[];o!==null;){var y=o,b=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||b===null||(y=Vc(o,u),y!=null&&p.unshift(wh(o,y,b)),y=Vc(o,l),y!=null&&p.push(wh(o,y,b))),o.tag===3)return p;o=o.return}return[]}function a3(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function ak(o,l,u,p,y){for(var b=l._reactName,C=[];u!==null&&u!==p;){var A=u,Y=A.alternate,te=A.stateNode;if(A=A.tag,Y!==null&&Y===p)break;A!==5&&A!==26&&A!==27||te===null||(Y=te,y?(te=Vc(u,b),te!=null&&C.unshift(wh(u,te,Y))):y||(te=Vc(u,b),te!=null&&C.push(wh(u,te,Y)))),u=u.return}C.length!==0&&o.push({event:l,listeners:C})}var l3=/\r\n?/g,c3=/\u0000|\uFFFD/g;function lk(o){return(typeof o=="string"?o:""+o).replace(l3,`
49
- `).replace(c3,"")}function ck(o,l){return l=lk(l),lk(o)===l}function bt(o,l,u,p,y,b){switch(u){case"children":typeof p=="string"?l==="body"||l==="textarea"&&p===""||cl(o,p):(typeof p=="number"||typeof p=="bigint")&&l!=="body"&&cl(o,""+p);break;case"className":ll(o,"class",p);break;case"tabIndex":ll(o,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":ll(o,u,p);break;case"style":c_(o,p,b);break;case"data":if(l!=="object"){ll(o,"data",p);break}case"src":case"href":if(p===""&&(l!=="a"||u!=="href")){o.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(u);break}p=Ed(""+p),o.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="function"){o.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof b=="function"&&(u==="formAction"?(l!=="input"&&bt(o,l,"name",y.name,y,null),bt(o,l,"formEncType",y.formEncType,y,null),bt(o,l,"formMethod",y.formMethod,y,null),bt(o,l,"formTarget",y.formTarget,y,null)):(bt(o,l,"encType",y.encType,y,null),bt(o,l,"method",y.method,y,null),bt(o,l,"target",y.target,y,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(u);break}p=Ed(""+p),o.setAttribute(u,p);break;case"onClick":p!=null&&(o.onclick=is);break;case"onScroll":p!=null&&Je("scroll",o);break;case"onScrollEnd":p!=null&&Je("scrollend",o);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(n(61));if(u=p.__html,u!=null){if(y.children!=null)throw Error(n(60));o.innerHTML=u}}break;case"multiple":o.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":o.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){o.removeAttribute("xlink:href");break}u=Ed(""+p),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(u,""+p):o.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(u,""):o.removeAttribute(u);break;case"capture":case"download":p===!0?o.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(u,p):o.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?o.setAttribute(u,p):o.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?o.removeAttribute(u):o.setAttribute(u,p);break;case"popover":Je("beforetoggle",o),Je("toggle",o),al(o,"popover",p);break;case"xlinkActuate":lr(o,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":lr(o,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":lr(o,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":lr(o,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":lr(o,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":lr(o,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":lr(o,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":lr(o,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":lr(o,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":al(o,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=Dz.get(u)||u,al(o,u,p))}}function E0(o,l,u,p,y,b){switch(u){case"style":c_(o,p,b);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(n(61));if(u=p.__html,u!=null){if(y.children!=null)throw Error(n(60));o.innerHTML=u}}break;case"children":typeof p=="string"?cl(o,p):(typeof p=="number"||typeof p=="bigint")&&cl(o,""+p);break;case"onScroll":p!=null&&Je("scroll",o);break;case"onScrollEnd":p!=null&&Je("scrollend",o);break;case"onClick":p!=null&&(o.onclick=is);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Cd.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),l=u.slice(2,y?u.length-7:void 0),b=o[Di]||null,b=b!=null?b[u]:null,typeof b=="function"&&o.removeEventListener(l,b,y),typeof p=="function")){typeof b!="function"&&b!==null&&(u in o?o[u]=null:o.hasAttribute(u)&&o.removeAttribute(u)),o.addEventListener(l,p,y);break e}u in o?o[u]=p:p===!0?o.setAttribute(u,""):al(o,u,p)}}}function Qi(o,l,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Je("error",o),Je("load",o);var p=!1,y=!1,b;for(b in u)if(u.hasOwnProperty(b)){var C=u[b];if(C!=null)switch(b){case"src":p=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,l));default:bt(o,l,b,C,u,null)}}y&&bt(o,l,"srcSet",u.srcSet,u,null),p&&bt(o,l,"src",u.src,u,null);return;case"input":Je("invalid",o);var A=b=C=y=null,Y=null,te=null;for(p in u)if(u.hasOwnProperty(p)){var se=u[p];if(se!=null)switch(p){case"name":y=se;break;case"type":C=se;break;case"checked":Y=se;break;case"defaultChecked":te=se;break;case"value":b=se;break;case"defaultValue":A=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(n(137,l));break;default:bt(o,l,p,se,u,null)}}Pd(o,b,A,Y,te,C,y,!1);return;case"select":Je("invalid",o),p=C=b=null;for(y in u)if(u.hasOwnProperty(y)&&(A=u[y],A!=null))switch(y){case"value":b=A;break;case"defaultValue":C=A;break;case"multiple":p=A;default:bt(o,l,y,A,u,null)}l=b,u=C,o.multiple=!!p,l!=null?ts(o,!!p,l,!1):u!=null&&ts(o,!!p,u,!0);return;case"textarea":Je("invalid",o),b=y=p=null;for(C in u)if(u.hasOwnProperty(C)&&(A=u[C],A!=null))switch(C){case"value":p=A;break;case"defaultValue":y=A;break;case"children":b=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(n(91));break;default:bt(o,l,C,A,u,null)}a_(o,p,y,b);return;case"option":for(Y in u)if(u.hasOwnProperty(Y)&&(p=u[Y],p!=null))switch(Y){case"selected":o.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:bt(o,l,Y,p,u,null)}return;case"dialog":Je("beforetoggle",o),Je("toggle",o),Je("cancel",o),Je("close",o);break;case"iframe":case"object":Je("load",o);break;case"video":case"audio":for(p=0;p<xh.length;p++)Je(xh[p],o);break;case"image":Je("error",o),Je("load",o);break;case"details":Je("toggle",o);break;case"embed":case"source":case"link":Je("error",o),Je("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in u)if(u.hasOwnProperty(te)&&(p=u[te],p!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,l));default:bt(o,l,te,p,u,null)}return;default:if(Vm(l)){for(se in u)u.hasOwnProperty(se)&&(p=u[se],p!==void 0&&E0(o,l,se,p,u,void 0));return}}for(A in u)u.hasOwnProperty(A)&&(p=u[A],p!=null&&bt(o,l,A,p,u,null))}function h3(o,l,u,p){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,b=null,C=null,A=null,Y=null,te=null,se=null;for(re in u){var he=u[re];if(u.hasOwnProperty(re)&&he!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":Y=he;default:p.hasOwnProperty(re)||bt(o,l,re,null,p,he)}}for(var ne in p){var re=p[ne];if(he=u[ne],p.hasOwnProperty(ne)&&(re!=null||he!=null))switch(ne){case"type":b=re;break;case"name":y=re;break;case"checked":te=re;break;case"defaultChecked":se=re;break;case"value":C=re;break;case"defaultValue":A=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(n(137,l));break;default:re!==he&&bt(o,l,ne,re,p,he)}}ia(o,C,A,Y,te,se,b,y);return;case"select":re=C=A=ne=null;for(b in u)if(Y=u[b],u.hasOwnProperty(b)&&Y!=null)switch(b){case"value":break;case"multiple":re=Y;default:p.hasOwnProperty(b)||bt(o,l,b,null,p,Y)}for(y in p)if(b=p[y],Y=u[y],p.hasOwnProperty(y)&&(b!=null||Y!=null))switch(y){case"value":ne=b;break;case"defaultValue":A=b;break;case"multiple":C=b;default:b!==Y&&bt(o,l,y,b,p,Y)}l=A,u=C,p=re,ne!=null?ts(o,!!u,ne,!1):!!p!=!!u&&(l!=null?ts(o,!!u,l,!0):ts(o,!!u,u?[]:"",!1));return;case"textarea":re=ne=null;for(A in u)if(y=u[A],u.hasOwnProperty(A)&&y!=null&&!p.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:bt(o,l,A,null,p,y)}for(C in p)if(y=p[C],b=u[C],p.hasOwnProperty(C)&&(y!=null||b!=null))switch(C){case"value":ne=y;break;case"defaultValue":re=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(n(91));break;default:y!==b&&bt(o,l,C,y,p,b)}o_(o,ne,re);return;case"option":for(var we in u)if(ne=u[we],u.hasOwnProperty(we)&&ne!=null&&!p.hasOwnProperty(we))switch(we){case"selected":o.selected=!1;break;default:bt(o,l,we,null,p,ne)}for(Y in p)if(ne=p[Y],re=u[Y],p.hasOwnProperty(Y)&&ne!==re&&(ne!=null||re!=null))switch(Y){case"selected":o.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:bt(o,l,Y,ne,p,re)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ze in u)ne=u[ze],u.hasOwnProperty(ze)&&ne!=null&&!p.hasOwnProperty(ze)&&bt(o,l,ze,null,p,ne);for(te in p)if(ne=p[te],re=u[te],p.hasOwnProperty(te)&&ne!==re&&(ne!=null||re!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(n(137,l));break;default:bt(o,l,te,ne,p,re)}return;default:if(Vm(l)){for(var _t in u)ne=u[_t],u.hasOwnProperty(_t)&&ne!==void 0&&!p.hasOwnProperty(_t)&&E0(o,l,_t,void 0,p,ne);for(se in p)ne=p[se],re=u[se],!p.hasOwnProperty(se)||ne===re||ne===void 0&&re===void 0||E0(o,l,se,ne,p,re);return}}for(var F in u)ne=u[F],u.hasOwnProperty(F)&&ne!=null&&!p.hasOwnProperty(F)&&bt(o,l,F,null,p,ne);for(he in p)ne=p[he],re=u[he],!p.hasOwnProperty(he)||ne===re||ne==null&&re==null||bt(o,l,he,ne,p,re)}function hk(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function u3(){if(typeof performance.getEntriesByType=="function"){for(var o=0,l=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var y=u[p],b=y.transferSize,C=y.initiatorType,A=y.duration;if(b&&A&&hk(C)){for(C=0,A=y.responseEnd,p+=1;p<u.length;p++){var Y=u[p],te=Y.startTime;if(te>A)break;var se=Y.transferSize,he=Y.initiatorType;se&&hk(he)&&(Y=Y.responseEnd,C+=se*(Y<A?1:(A-te)/(Y-te)))}if(--p,l+=8*(b+C)/(y.duration/1e3),o++,10<o)break}}if(0<o)return l/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var R0=null,A0=null;function Tf(o){return o.nodeType===9?o:o.ownerDocument}function uk(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function dk(o,l){if(o===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&l==="foreignObject"?0:o}function M0(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var z0=null;function d3(){var o=window.event;return o&&o.type==="popstate"?o===z0?!1:(z0=o,!0):(z0=null,!1)}var fk=typeof setTimeout=="function"?setTimeout:void 0,f3=typeof clearTimeout=="function"?clearTimeout:void 0,pk=typeof Promise=="function"?Promise:void 0,p3=typeof queueMicrotask=="function"?queueMicrotask:typeof pk<"u"?function(o){return pk.resolve(null).then(o).catch(g3)}:fk;function g3(o){setTimeout(function(){throw o})}function uo(o){return o==="head"}function gk(o,l){var u=l,p=0;do{var y=u.nextSibling;if(o.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(p===0){o.removeChild(y),Xl(l);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")kh(o.ownerDocument.documentElement);else if(u==="head"){u=o.ownerDocument.head,kh(u);for(var b=u.firstChild;b;){var C=b.nextSibling,A=b.nodeName;b[ea]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&b.rel.toLowerCase()==="stylesheet"||u.removeChild(b),b=C}}else u==="body"&&kh(o.ownerDocument.body);u=y}while(u);Xl(l)}function mk(o,l){var u=o;o=0;do{var p=u.nextSibling;if(u.nodeType===1?l?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(l?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(o===0)break;o--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||o++;u=p}while(u)}function j0(o){var l=o.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var u=l;switch(l=l.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":j0(u),Zc(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}o.removeChild(u)}}function m3(o,l,u,p){for(;o.nodeType===1;){var y=u;if(o.nodeName.toLowerCase()!==l.toLowerCase()){if(!p&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(p){if(!o[ea])switch(l){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(b=o.getAttribute("rel"),b==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(b!==y.rel||o.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||o.getAttribute("title")!==(y.title==null?null:y.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(b=o.getAttribute("src"),(b!==(y.src==null?null:y.src)||o.getAttribute("type")!==(y.type==null?null:y.type)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&b&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(l==="input"&&o.type==="hidden"){var b=y.name==null?null:""+y.name;if(y.type==="hidden"&&o.getAttribute("name")===b)return o}else return o;if(o=Hn(o.nextSibling),o===null)break}return null}function O3(o,l,u){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!u||(o=Hn(o.nextSibling),o===null))return null;return o}function Ok(o,l){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=Hn(o.nextSibling),o===null))return null;return o}function D0(o){return o.data==="$?"||o.data==="$~"}function B0(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function v3(o,l){var u=o.ownerDocument;if(o.data==="$~")o._reactRetry=l;else if(o.data!=="$?"||u.readyState!=="loading")l();else{var p=function(){l(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),o._reactRetry=p}}function Hn(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return o}var L0=null;function vk(o){o=o.nextSibling;for(var l=0;o;){if(o.nodeType===8){var u=o.data;if(u==="/$"||u==="/&"){if(l===0)return Hn(o.nextSibling);l--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||l++}o=o.nextSibling}return null}function yk(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var u=o.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(l===0)return o;l--}else u!=="/$"&&u!=="/&"||l++}o=o.previousSibling}return null}function Sk(o,l,u){switch(l=Tf(u),o){case"html":if(o=l.documentElement,!o)throw Error(n(452));return o;case"head":if(o=l.head,!o)throw Error(n(453));return o;case"body":if(o=l.body,!o)throw Error(n(454));return o;default:throw Error(n(451))}}function kh(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);Zc(o)}var Un=new Map,bk=new Set;function Qf(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var vs=Z.d;Z.d={f:y3,r:S3,D:b3,C:_3,L:x3,m:w3,X:C3,S:k3,M:T3};function y3(){var o=vs.f(),l=yf();return o||l}function S3(o){var l=Ws(o);l!==null&&l.tag===5&&l.type==="form"?Bx(l):vs.r(o)}var Dl=typeof document>"u"?null:document;function _k(o,l,u){var p=Dl;if(p&&typeof l=="string"&&l){var y=ln(l);y='link[rel="'+o+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),bk.has(y)||(bk.add(y),o={rel:o,crossOrigin:u,href:l},p.querySelector(y)===null&&(l=p.createElement("link"),Qi(l,"link",o),Kt(l),p.head.appendChild(l)))}}function b3(o){vs.D(o),_k("dns-prefetch",o,null)}function _3(o,l){vs.C(o,l),_k("preconnect",o,l)}function x3(o,l,u){vs.L(o,l,u);var p=Dl;if(p&&o&&l){var y='link[rel="preload"][as="'+ln(l)+'"]';l==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+ln(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+ln(u.imageSizes)+'"]')):y+='[href="'+ln(o)+'"]';var b=y;switch(l){case"style":b=Bl(o);break;case"script":b=Ll(o)}Un.has(b)||(o=g({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:o,as:l},u),Un.set(b,o),p.querySelector(y)!==null||l==="style"&&p.querySelector(Ch(b))||l==="script"&&p.querySelector(Th(b))||(l=p.createElement("link"),Qi(l,"link",o),Kt(l),p.head.appendChild(l)))}}function w3(o,l){vs.m(o,l);var u=Dl;if(u&&o){var p=l&&typeof l.as=="string"?l.as:"script",y='link[rel="modulepreload"][as="'+ln(p)+'"][href="'+ln(o)+'"]',b=y;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Ll(o)}if(!Un.has(b)&&(o=g({rel:"modulepreload",href:o},l),Un.set(b,o),u.querySelector(y)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Th(b)))return}p=u.createElement("link"),Qi(p,"link",o),Kt(p),u.head.appendChild(p)}}}function k3(o,l,u){vs.S(o,l,u);var p=Dl;if(p&&o){var y=Vs(p).hoistableStyles,b=Bl(o);l=l||"default";var C=y.get(b);if(!C){var A={loading:0,preload:null};if(C=p.querySelector(Ch(b)))A.loading=5;else{o=g({rel:"stylesheet",href:o,"data-precedence":l},u),(u=Un.get(b))&&X0(o,u);var Y=C=p.createElement("link");Kt(Y),Qi(Y,"link",o),Y._p=new Promise(function(te,se){Y.onload=te,Y.onerror=se}),Y.addEventListener("load",function(){A.loading|=1}),Y.addEventListener("error",function(){A.loading|=2}),A.loading|=4,$f(C,l,p)}C={type:"stylesheet",instance:C,count:1,state:A},y.set(b,C)}}}function C3(o,l){vs.X(o,l);var u=Dl;if(u&&o){var p=Vs(u).hoistableScripts,y=Ll(o),b=p.get(y);b||(b=u.querySelector(Th(y)),b||(o=g({src:o,async:!0},l),(l=Un.get(y))&&N0(o,l),b=u.createElement("script"),Kt(b),Qi(b,"link",o),u.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},p.set(y,b))}}function T3(o,l){vs.M(o,l);var u=Dl;if(u&&o){var p=Vs(u).hoistableScripts,y=Ll(o),b=p.get(y);b||(b=u.querySelector(Th(y)),b||(o=g({src:o,async:!0,type:"module"},l),(l=Un.get(y))&&N0(o,l),b=u.createElement("script"),Kt(b),Qi(b,"link",o),u.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},p.set(y,b))}}function xk(o,l,u,p){var y=(y=de.current)?Qf(y):null;if(!y)throw Error(n(446));switch(o){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(l=Bl(u.href),u=Vs(y).hoistableStyles,p=u.get(l),p||(p={type:"style",instance:null,count:0,state:null},u.set(l,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){o=Bl(u.href);var b=Vs(y).hoistableStyles,C=b.get(o);if(C||(y=y.ownerDocument||y,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(o,C),(b=y.querySelector(Ch(o)))&&!b._p&&(C.instance=b,C.state.loading=5),Un.has(o)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Un.set(o,u),b||Q3(y,o,u,C.state))),l&&p===null)throw Error(n(528,""));return C}if(l&&p!==null)throw Error(n(529,""));return null;case"script":return l=u.async,u=u.src,typeof u=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Ll(u),u=Vs(y).hoistableScripts,p=u.get(l),p||(p={type:"script",instance:null,count:0,state:null},u.set(l,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,o))}}function Bl(o){return'href="'+ln(o)+'"'}function Ch(o){return'link[rel="stylesheet"]['+o+"]"}function wk(o){return g({},o,{"data-precedence":o.precedence,precedence:null})}function Q3(o,l,u,p){o.querySelector('link[rel="preload"][as="style"]['+l+"]")?p.loading=1:(l=o.createElement("link"),p.preload=l,l.addEventListener("load",function(){return p.loading|=1}),l.addEventListener("error",function(){return p.loading|=2}),Qi(l,"link",u),Kt(l),o.head.appendChild(l))}function Ll(o){return'[src="'+ln(o)+'"]'}function Th(o){return"script[async]"+o}function kk(o,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var p=o.querySelector('style[data-href~="'+ln(u.href)+'"]');if(p)return l.instance=p,Kt(p),p;var y=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(o.ownerDocument||o).createElement("style"),Kt(p),Qi(p,"style",y),$f(p,u.precedence,o),l.instance=p;case"stylesheet":y=Bl(u.href);var b=o.querySelector(Ch(y));if(b)return l.state.loading|=4,l.instance=b,Kt(b),b;p=wk(u),(y=Un.get(y))&&X0(p,y),b=(o.ownerDocument||o).createElement("link"),Kt(b);var C=b;return C._p=new Promise(function(A,Y){C.onload=A,C.onerror=Y}),Qi(b,"link",p),l.state.loading|=4,$f(b,u.precedence,o),l.instance=b;case"script":return b=Ll(u.src),(y=o.querySelector(Th(b)))?(l.instance=y,Kt(y),y):(p=u,(y=Un.get(b))&&(p=g({},u),N0(p,y)),o=o.ownerDocument||o,y=o.createElement("script"),Kt(y),Qi(y,"link",p),o.head.appendChild(y),l.instance=y);case"void":return null;default:throw Error(n(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(p=l.instance,l.state.loading|=4,$f(p,u.precedence,o));return l.instance}function $f(o,l,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=p.length?p[p.length-1]:null,b=y,C=0;C<p.length;C++){var A=p[C];if(A.dataset.precedence===l)b=A;else if(b!==y)break}b?b.parentNode.insertBefore(o,b.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(o,l.firstChild))}function X0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function N0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var Pf=null;function Ck(o,l,u){if(Pf===null){var p=new Map,y=Pf=new Map;y.set(u,p)}else y=Pf,p=y.get(u),p||(p=new Map,y.set(u,p));if(p.has(o))return p;for(p.set(o,null),u=u.getElementsByTagName(o),y=0;y<u.length;y++){var b=u[y];if(!(b[ea]||b[li]||o==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var C=b.getAttribute(l)||"";C=o+C;var A=p.get(C);A?A.push(b):p.set(C,[b])}}return p}function Tk(o,l,u){o=o.ownerDocument||o,o.head.insertBefore(u,l==="title"?o.querySelector("head > title"):null)}function $3(o,l,u){if(u===1||l.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return o=l.disabled,typeof l.precedence=="string"&&o==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Qk(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function P3(o,l,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=Bl(p.href),b=l.querySelector(Ch(y));if(b){l=b._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(o.count++,o=Ef.bind(o),l.then(o,o)),u.state.loading|=4,u.instance=b,Kt(b);return}b=l.ownerDocument||l,p=wk(p),(y=Un.get(y))&&X0(p,y),b=b.createElement("link"),Kt(b);var C=b;C._p=new Promise(function(A,Y){C.onload=A,C.onerror=Y}),Qi(b,"link",p),u.instance=b}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(u,l),(l=u.state.preload)&&(u.state.loading&3)===0&&(o.count++,u=Ef.bind(o),l.addEventListener("load",u),l.addEventListener("error",u))}}var Z0=0;function E3(o,l){return o.stylesheets&&o.count===0&&Af(o,o.stylesheets),0<o.count||0<o.imgCount?function(u){var p=setTimeout(function(){if(o.stylesheets&&Af(o,o.stylesheets),o.unsuspend){var b=o.unsuspend;o.unsuspend=null,b()}},6e4+l);0<o.imgBytes&&Z0===0&&(Z0=62500*u3());var y=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Af(o,o.stylesheets),o.unsuspend)){var b=o.unsuspend;o.unsuspend=null,b()}},(o.imgBytes>Z0?50:800)+l);return o.unsuspend=u,function(){o.unsuspend=null,clearTimeout(p),clearTimeout(y)}}:null}function Ef(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Af(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Rf=null;function Af(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Rf=new Map,l.forEach(R3,o),Rf=null,Ef.call(o))}function R3(o,l){if(!(l.state.loading&4)){var u=Rf.get(o);if(u)var p=u.get(null);else{u=new Map,Rf.set(o,u);for(var y=o.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<y.length;b++){var C=y[b];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(u.set(C.dataset.precedence,C),p=C)}p&&u.set(null,p)}y=l.instance,C=y.getAttribute("data-precedence"),b=u.get(C)||p,b===p&&u.set(null,y),u.set(C,y),this.count++,p=Ef.bind(this),y.addEventListener("load",p),y.addEventListener("error",p),b?b.parentNode.insertBefore(y,b.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(y,o.firstChild)),l.state.loading|=4}}var Qh={$$typeof:k,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function A3(o,l,u,p,y,b,C,A,Y){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Lc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lc(0),this.hiddenUpdates=Lc(null),this.identifierPrefix=p,this.onUncaughtError=y,this.onCaughtError=b,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function $k(o,l,u,p,y,b,C,A,Y,te,se,he){return o=new A3(o,l,u,C,Y,te,se,he,A),l=1,b===!0&&(l|=24),b=wn(3,null,null,l),o.current=b,b.stateNode=o,l=bO(),l.refCount++,o.pooledCache=l,l.refCount++,b.memoizedState={element:p,isDehydrated:u,cache:l},kO(b),o}function Pk(o){return o?(o=ml,o):ml}function Ek(o,l,u,p,y,b){y=Pk(y),p.context===null?p.context=y:p.pendingContext=y,p=eo(l),p.payload={element:u},b=b===void 0?null:b,b!==null&&(p.callback=b),u=to(o,p,l),u!==null&&(pn(u,o,l),oh(u,o,l))}function Rk(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var u=o.retryLane;o.retryLane=u!==0&&u<l?u:l}}function W0(o,l){Rk(o,l),(o=o.alternate)&&Rk(o,l)}function Ak(o){if(o.tag===13||o.tag===31){var l=oa(o,67108864);l!==null&&pn(l,o,67108864),W0(o,67108864)}}function Mk(o){if(o.tag===13||o.tag===31){var l=$n();l=Xc(l);var u=oa(o,l);u!==null&&pn(u,o,l),W0(o,l)}}var Mf=!0;function M3(o,l,u,p){var y=P.T;P.T=null;var b=Z.p;try{Z.p=2,q0(o,l,u,p)}finally{Z.p=b,P.T=y}}function z3(o,l,u,p){var y=P.T;P.T=null;var b=Z.p;try{Z.p=8,q0(o,l,u,p)}finally{Z.p=b,P.T=y}}function q0(o,l,u,p){if(Mf){var y=V0(p);if(y===null)P0(o,l,p,zf,u),jk(o,p);else if(D3(y,o,l,u,p))p.stopPropagation();else if(jk(o,p),l&4&&-1<j3.indexOf(o)){for(;y!==null;){var b=Ws(y);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var C=Kr(b.pendingLanes);if(C!==0){var A=b;for(A.pendingLanes|=2,A.entangledLanes|=2;C;){var Y=1<<31-Yi(C);A.entanglements[1]|=Y,C&=~Y}$r(b),(ft&6)===0&&(Of=Le()+500,_h(0))}}break;case 31:case 13:A=oa(b,2),A!==null&&pn(A,b,2),yf(),W0(b,2)}if(b=V0(p),b===null&&P0(o,l,p,zf,u),b===y)break;y=b}y!==null&&p.stopPropagation()}else P0(o,l,p,null,u)}}function V0(o){return o=Ym(o),I0(o)}var zf=null;function I0(o){if(zf=null,o=Zs(o),o!==null){var l=s(o);if(l===null)o=null;else{var u=l.tag;if(u===13){if(o=a(l),o!==null)return o;o=null}else if(u===31){if(o=c(l),o!==null)return o;o=null}else if(u===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null)}}return zf=o,null}function zk(o){switch(o){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(sn()){case on:return 2;case Vi:return 8;case Go:case Rm:return 32;case tl:return 268435456;default:return 32}default:return 32}}var Y0=!1,fo=null,po=null,go=null,$h=new Map,Ph=new Map,mo=[],j3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function jk(o,l){switch(o){case"focusin":case"focusout":fo=null;break;case"dragenter":case"dragleave":po=null;break;case"mouseover":case"mouseout":go=null;break;case"pointerover":case"pointerout":$h.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ph.delete(l.pointerId)}}function Eh(o,l,u,p,y,b){return o===null||o.nativeEvent!==b?(o={blockedOn:l,domEventName:u,eventSystemFlags:p,nativeEvent:b,targetContainers:[y]},l!==null&&(l=Ws(l),l!==null&&Ak(l)),o):(o.eventSystemFlags|=p,l=o.targetContainers,y!==null&&l.indexOf(y)===-1&&l.push(y),o)}function D3(o,l,u,p,y){switch(l){case"focusin":return fo=Eh(fo,o,l,u,p,y),!0;case"dragenter":return po=Eh(po,o,l,u,p,y),!0;case"mouseover":return go=Eh(go,o,l,u,p,y),!0;case"pointerover":var b=y.pointerId;return $h.set(b,Eh($h.get(b)||null,o,l,u,p,y)),!0;case"gotpointercapture":return b=y.pointerId,Ph.set(b,Eh(Ph.get(b)||null,o,l,u,p,y)),!0}return!1}function Dk(o){var l=Zs(o.target);if(l!==null){var u=s(l);if(u!==null){if(l=u.tag,l===13){if(l=a(u),l!==null){o.blockedOn=l,_d(o.priority,function(){Mk(u)});return}}else if(l===31){if(l=c(u),l!==null){o.blockedOn=l,_d(o.priority,function(){Mk(u)});return}}else if(l===3&&u.stateNode.current.memoizedState.isDehydrated){o.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}o.blockedOn=null}function jf(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var u=V0(o.nativeEvent);if(u===null){u=o.nativeEvent;var p=new u.constructor(u.type,u);Im=p,u.target.dispatchEvent(p),Im=null}else return l=Ws(u),l!==null&&Ak(l),o.blockedOn=u,!1;l.shift()}return!0}function Bk(o,l,u){jf(o)&&u.delete(l)}function B3(){Y0=!1,fo!==null&&jf(fo)&&(fo=null),po!==null&&jf(po)&&(po=null),go!==null&&jf(go)&&(go=null),$h.forEach(Bk),Ph.forEach(Bk)}function Df(o,l){o.blockedOn===l&&(o.blockedOn=null,Y0||(Y0=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,B3)))}var Bf=null;function Lk(o){Bf!==o&&(Bf=o,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bf===o&&(Bf=null);for(var l=0;l<o.length;l+=3){var u=o[l],p=o[l+1],y=o[l+2];if(typeof p!="function"){if(I0(p||u)===null)continue;break}var b=Ws(u);b!==null&&(o.splice(l,3),l-=3,VO(b,{pending:!0,data:y,method:u.method,action:p},p,y))}}))}function Xl(o){function l(Y){return Df(Y,o)}fo!==null&&Df(fo,o),po!==null&&Df(po,o),go!==null&&Df(go,o),$h.forEach(l),Ph.forEach(l);for(var u=0;u<mo.length;u++){var p=mo[u];p.blockedOn===o&&(p.blockedOn=null)}for(;0<mo.length&&(u=mo[0],u.blockedOn===null);)Dk(u),u.blockedOn===null&&mo.shift();if(u=(o.ownerDocument||o).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var y=u[p],b=u[p+1],C=y[Di]||null;if(typeof b=="function")C||Lk(u);else if(C){var A=null;if(b&&b.hasAttribute("formAction")){if(y=b,C=b[Di]||null)A=C.formAction;else if(I0(y)!==null)continue}else A=C.action;typeof A=="function"?u[p+1]=A:(u.splice(p,3),p-=3),Lk(u)}}}function Xk(){function o(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(C){return y=C})},focusReset:"manual",scroll:"manual"})}function l(){y!==null&&(y(),y=null),p||setTimeout(u,20)}function u(){if(!p&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,y=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),y!==null&&(y(),y=null)}}}function H0(o){this._internalRoot=o}Lf.prototype.render=H0.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(n(409));var u=l.current,p=$n();Ek(u,p,o,l,null,null)},Lf.prototype.unmount=H0.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;Ek(o.current,2,null,o,null,null),yf(),l[Jr]=null}};function Lf(o){this._internalRoot=o}Lf.prototype.unstable_scheduleHydration=function(o){if(o){var l=bd();o={blockedOn:null,target:o,priority:l};for(var u=0;u<mo.length&&l!==0&&l<mo[u].priority;u++);mo.splice(u,0,o),u===0&&Dk(o)}};var Nk=e.version;if(Nk!=="19.2.4")throw Error(n(527,Nk,"19.2.4"));Z.findDOMNode=function(o){var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=d(l),o=o!==null?f(o):null,o=o===null?null:o.stateNode,o};var L3={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xf.isDisabled&&Xf.supportsFiber)try{Fo=Xf.inject(L3),Ii=Xf}catch{}}return Ah.createRoot=function(o,l){if(!r(o))throw Error(n(299));var u=!1,p="",y=Hx,b=Ux,C=Gx;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(C=l.onRecoverableError)),l=$k(o,1,!1,null,null,u,p,null,y,b,C,Xk),o[Jr]=l.current,$0(o),new H0(l)},Ah.hydrateRoot=function(o,l,u){if(!r(o))throw Error(n(299));var p=!1,y="",b=Hx,C=Ux,A=Gx,Y=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(b=u.onUncaughtError),u.onCaughtError!==void 0&&(C=u.onCaughtError),u.onRecoverableError!==void 0&&(A=u.onRecoverableError),u.formState!==void 0&&(Y=u.formState)),l=$k(o,1,!0,l,u??null,p,y,Y,b,C,A,Xk),l.context=Pk(null),u=l.current,p=$n(),p=Xc(p),y=eo(p),y.callback=null,to(u,y,p),u=p,l.current.lanes=u,Jo(l,u),$r(l),o[Jr]=l.current,$0(o),new Lf(l)},Ah.version="19.2.4",Ah}var Fk;function H3(){if(Fk)return F0.exports;Fk=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),F0.exports=Y3(),F0.exports}var U3=H3();const Kk=t=>{let e;const i=new Set,n=(d,f)=>{const g=typeof d=="function"?d(e):d;if(!Object.is(g,e)){const m=e;e=f??(typeof g!="object"||g===null)?g:Object.assign({},e,g),i.forEach(O=>O(e,m))}},r=()=>e,c={setState:n,getState:r,getInitialState:()=>h,subscribe:d=>(i.add(d),()=>i.delete(d))},h=e=t(n,r,c);return c},G3=(t=>t?Kk(t):Kk),F3=t=>t;function K3(t,e=F3){const i=Ul.useSyncExternalStore(t.subscribe,Ul.useCallback(()=>e(t.getState()),[t,e]),Ul.useCallback(()=>e(t.getInitialState()),[t,e]));return Ul.useDebugValue(i),i}const Jk=t=>{const e=G3(t),i=n=>K3(e,n);return Object.assign(i,e),i},J3=(t=>t?Jk(t):Jk),eD=`ws://${window.location.hostname}:${window.location.port||31415}`,Ui="",Ce=J3((t,e)=>({agents:[],connected:!1,ws:null,daemonHost:null,tunneled:!1,activeTab:"agents",detailPanel:null,activityLog:{},statusMessage:null,commandHistory:[],chatHistory:{},tokenTimeline:{},dashTelemetry:{},editorFiles:{},editorActiveFile:null,editorOpenTabs:[],editorTreeCache:{},editorChangedFiles:{},editorRecentSaves:{},connect(){if(e().ws)return;const i=new WebSocket(eD);i.onopen=()=>{t({connected:!0,ws:i}),fetch(`${Ui}/api/status`).then(n=>n.json()).then(n=>{const r={};n.host&&n.host!=="127.0.0.1"&&(r.daemonHost=n.host);const s=window.location.port||"80";String(n.port)!==s&&(r.tunneled=!0),Object.keys(r).length>0&&t(r)}).catch(()=>{})},i.onmessage=n=>{const r=JSON.parse(n.data);switch(r.type){case"state":{const s={...e().tokenTimeline},a=Date.now();for(const c of r.data){s[c.id]||(s[c.id]=[]);const h=s[c.id],d=h[h.length-1];(!d||c.tokensUsed!==d.v||a-d.t>5e3)&&(h.push({t:a,v:c.tokensUsed||0}),h.length>200&&(s[c.id]=h.slice(-200)))}t({agents:r.data,tokenTimeline:s});break}case"agent:output":{const{agentId:s,data:a}=r,c={...e().activityLog};c[s]||(c[s]=[]),c[s]=[...c[s].slice(-200),{timestamp:Date.now(),text:typeof a.data=="string"?a.data:JSON.stringify(a.data),type:a.type}],t({activityLog:c});break}case"agent:exit":{const s=e().agents.find(h=>h.id===r.agentId),a=(s==null?void 0:s.name)||r.agentId,c=r.status==="completed"?`${a} completed`:r.status==="killed"?`${a} killed`:`${a} crashed (exit ${r.code})`;e().showStatus(c);break}case"rotation:start":e().showStatus(`rotating ${r.agentName}...`);break;case"rotation:complete":{e().showStatus(`rotated ${r.agentName} (saved ${r.tokensSaved} tokens)`);const s=e().detailPanel;(s==null?void 0:s.type)==="agent"&&s.agentId===r.oldAgentId&&r.newAgentId&&t(a=>{const c={...a.chatHistory},h={...a.tokenTimeline},d=c[r.oldAgentId]||[],f=h[r.oldAgentId]||[];return d.length>0&&(c[r.newAgentId]=[...d]),f.length>0&&(h[r.newAgentId]=[...f]),{chatHistory:c,tokenTimeline:h,detailPanel:{type:"agent",agentId:r.newAgentId}}});break}case"rotation:failed":e().showStatus(`rotation failed: ${r.error}`);break;case"file:changed":{const s=e().editorRecentSaves[r.path];if(s&&Date.now()-s<2e3)break;t(a=>({editorChangedFiles:{...a.editorChangedFiles,[r.path]:r.timestamp}}));break}}},i.onclose=()=>{t({connected:!1,ws:null,daemonHost:null,tunneled:!1}),setTimeout(()=>e().connect(),2e3)},i.onerror=()=>i.close()},async spawnAgent(i){const n=await fetch(`${Ui}/api/agents`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!n.ok){const s=await n.json().catch(()=>({}));throw new Error(s.error||"Spawn failed")}const r=await n.json();return e().showStatus(`spawned ${r.name}`),r},async killAgent(i,n=!1){await fetch(`${Ui}/api/agents/${i}?purge=${n}`,{method:"DELETE"})},async rotateAgent(i){const n=await fetch(`${Ui}/api/agents/${i}/rotate`,{method:"POST"});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||"Rotation failed")}return n.json()},async fetchProviders(){return(await fetch(`${Ui}/api/providers`)).json()},setActiveTab(i){t({activeTab:i})},openDetail(i){t({detailPanel:i})},closeDetail(){t({detailPanel:null})},selectAgent(i){t({detailPanel:{type:"agent",agentId:i}})},clearSelection(){t({detailPanel:null})},showStatus(i){t({statusMessage:i}),setTimeout(()=>{e().statusMessage===i&&t({statusMessage:null})},4e3)},addChatMessage(i,n,r,s=!1){t(a=>{const c={...a.chatHistory};return c[i]||(c[i]=[]),c[i]=[...c[i].slice(-100),{from:n,text:r,timestamp:Date.now(),isQuery:s}],{chatHistory:c}})},async instructAgent(i,n){const r=e().agents.find(f=>f.id===i),s=r&&(r.status==="running"||r.status==="starting");e().addChatMessage(i,"user",n,!1),e().addChatMessage(i,"system",s?"sending instruction...":"continuing conversation...");const a=await fetch(`${Ui}/api/agents/${i}/instruct`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:n})});if(!a.ok){const f=await a.json().catch(()=>({}));throw e().addChatMessage(i,"system",`failed: ${f.error||"unknown error"}`),new Error(f.error||"Instruction failed")}const c=await a.json(),h=e().chatHistory[i]||[];h.length>0&&t(f=>{const g={...f.chatHistory};return g[c.id]=[...h],{chatHistory:g}});const d=e().tokenTimeline[i]||[];return d.length>0&&t(f=>{const g={...f.tokenTimeline};return g[c.id]=[...d],{tokenTimeline:g}}),e().selectAgent(c.id),e().addChatMessage(c.id,"system","agent resumed with context"),c},async queryAgent(i,n){e().addChatMessage(i,"user",n,!0);const r=await fetch(`${Ui}/api/agents/${i}/query`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:n})});if(!r.ok){const a=await r.json().catch(()=>({}));throw e().addChatMessage(i,"system",`query failed: ${a.error||"unknown error"}`),new Error(a.error||"Query failed")}const s=await r.json();return e().addChatMessage(i,"agent",s.response),s},async openFile(i){var s;if(e().editorFiles[i]||e().editorOpenTabs.includes(i)){t(a=>({editorActiveFile:i,editorOpenTabs:a.editorOpenTabs.includes(i)?a.editorOpenTabs:[...a.editorOpenTabs,i]}));return}const n=(s=i.split(".").pop())==null?void 0:s.toLowerCase();if(["png","jpg","jpeg","gif","svg","webp","ico","bmp","avif","mp4","webm","mov","avi","mkv","ogv"].includes(n)){t(a=>({editorActiveFile:i,editorOpenTabs:[...a.editorOpenTabs,i]}));return}try{const a=await fetch(`${Ui}/api/files/read?path=${encodeURIComponent(i)}`);if(!a.ok){const d=await a.json().catch(()=>({}));e().showStatus(d.error||"Failed to read file");return}const c=await a.json();if(c.binary){e().showStatus("Binary file — cannot open");return}t(d=>({editorFiles:{...d.editorFiles,[i]:{content:c.content,originalContent:c.content,language:c.language,loadedAt:Date.now()}},editorActiveFile:i,editorOpenTabs:d.editorOpenTabs.includes(i)?d.editorOpenTabs:[...d.editorOpenTabs,i]}));const h=e().ws;(h==null?void 0:h.readyState)===1&&h.send(JSON.stringify({type:"editor:watch",path:i}))}catch{e().showStatus("Failed to open file")}},closeFile(i){t(r=>{const s=r.editorOpenTabs.filter(d=>d!==i),a={...r.editorFiles};delete a[i];const c={...r.editorChangedFiles};delete c[i];let h=r.editorActiveFile;if(h===i){const d=r.editorOpenTabs.indexOf(i);h=s[Math.min(d,s.length-1)]||null}return{editorOpenTabs:s,editorFiles:a,editorChangedFiles:c,editorActiveFile:h}});const n=e().ws;(n==null?void 0:n.readyState)===1&&n.send(JSON.stringify({type:"editor:unwatch",path:i}))},setActiveFile(i){t({editorActiveFile:i})},updateFileContent(i,n){t(r=>({editorFiles:{...r.editorFiles,[i]:{...r.editorFiles[i],content:n}}}))},async saveFile(i){const n=e().editorFiles[i];if(n)try{const r=await fetch(`${Ui}/api/files/write`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:i,content:n.content})});if(!r.ok){const s=await r.json().catch(()=>({}));e().showStatus(s.error||"Save failed");return}t(s=>({editorFiles:{...s.editorFiles,[i]:{...s.editorFiles[i],originalContent:n.content}},editorChangedFiles:(()=>{const a={...s.editorChangedFiles};return delete a[i],a})(),editorRecentSaves:{...s.editorRecentSaves,[i]:Date.now()}})),e().showStatus("Saved")}catch{e().showStatus("Save failed")}},async reloadFile(i){try{const n=await fetch(`${Ui}/api/files/read?path=${encodeURIComponent(i)}`);if(!n.ok)return;const r=await n.json();if(r.binary)return;t(s=>({editorFiles:{...s.editorFiles,[i]:{content:r.content,originalContent:r.content,language:r.language,loadedAt:Date.now()}},editorChangedFiles:(()=>{const a={...s.editorChangedFiles};return delete a[i],a})()}))}catch{}},dismissFileChange(i){t(n=>{const r={...n.editorChangedFiles};return delete r[i],{editorChangedFiles:r}})},async fetchTreeDir(i){try{const n=await fetch(`${Ui}/api/files/tree?path=${encodeURIComponent(i)}`);if(!n.ok)return;const r=await n.json();t(s=>({editorTreeCache:{...s.editorTreeCache,[i]:r.entries}}))}catch{}},async createFile(i){try{const n=await fetch(`${Ui}/api/files/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:i})});if(!n.ok){const s=await n.json().catch(()=>({}));return e().showStatus(s.error||"Create failed"),!1}const r=i.includes("/")?i.split("/").slice(0,-1).join("/"):"";return await e().fetchTreeDir(r),e().showStatus("File created"),!0}catch{return e().showStatus("Create failed"),!1}},async createDir(i){try{const n=await fetch(`${Ui}/api/files/mkdir`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:i})});if(!n.ok){const s=await n.json().catch(()=>({}));return e().showStatus(s.error||"Create failed"),!1}const r=i.includes("/")?i.split("/").slice(0,-1).join("/"):"";return await e().fetchTreeDir(r),e().showStatus("Folder created"),!0}catch{return e().showStatus("Create failed"),!1}},async deleteFile(i){try{const n=await fetch(`${Ui}/api/files/delete?path=${encodeURIComponent(i)}`,{method:"DELETE"});if(!n.ok){const s=await n.json().catch(()=>({}));return e().showStatus(s.error||"Delete failed"),!1}e().editorOpenTabs.includes(i)&&e().closeFile(i);const r=i.includes("/")?i.split("/").slice(0,-1).join("/"):"";return await e().fetchTreeDir(r),t(s=>{const a={...s.editorTreeCache};return delete a[i],{editorTreeCache:a}}),e().showStatus("Deleted"),!0}catch{return e().showStatus("Delete failed"),!1}},async renameFile(i,n){try{const r=await fetch(`${Ui}/api/files/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldPath:i,newPath:n})});if(!r.ok){const c=await r.json().catch(()=>({}));return e().showStatus(c.error||"Rename failed"),!1}t(c=>{const h=c.editorOpenTabs.map(g=>g===i?n:g),d={...c.editorFiles};d[i]&&(d[n]=d[i],delete d[i]);const f=c.editorActiveFile===i?n:c.editorActiveFile;return{editorOpenTabs:h,editorFiles:d,editorActiveFile:f}});const s=i.includes("/")?i.split("/").slice(0,-1).join("/"):"",a=n.includes("/")?n.split("/").slice(0,-1).join("/"):"";return await e().fetchTreeDir(s),a!==s&&await e().fetchTreeDir(a),e().showStatus("Renamed"),!0}catch{return e().showStatus("Rename failed"),!1}},addCommand(i){t(n=>({commandHistory:[...n.commandHistory.slice(-49),i]}))}}));function ai(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let i=0,n;i<t.length;i++)(n=ai(t[i]))!==""&&(e+=(e&&" ")+n);else for(let i in t)t[i]&&(e+=(e&&" ")+i);return e}var tD={value:()=>{}};function em(){for(var t=0,e=arguments.length,i={},n;t<e;++t){if(!(n=arguments[t]+"")||n in i||/[\s.]/.test(n))throw new Error("illegal type: "+n);i[n]=[]}return new Ep(i)}function Ep(t){this._=t}function iD(t,e){return t.trim().split(/^|\s+/).map(function(i){var n="",r=i.indexOf(".");if(r>=0&&(n=i.slice(r+1),i=i.slice(0,r)),i&&!e.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:n}})}Ep.prototype=em.prototype={constructor:Ep,on:function(t,e){var i=this._,n=iD(t+"",i),r,s=-1,a=n.length;if(arguments.length<2){for(;++s<a;)if((r=(t=n[s]).type)&&(r=nD(i[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<a;)if(r=(t=n[s]).type)i[r]=eC(i[r],t.name,e);else if(e==null)for(r in i)i[r]=eC(i[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var i in e)t[i]=e[i].slice();return new Ep(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var i=new Array(r),n=0,r,s;n<r;++n)i[n]=arguments[n+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],n=0,r=s.length;n<r;++n)s[n].value.apply(e,i)},apply:function(t,e,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],r=0,s=n.length;r<s;++r)n[r].value.apply(e,i)}};function nD(t,e){for(var i=0,n=t.length,r;i<n;++i)if((r=t[i]).name===e)return r.value}function eC(t,e,i){for(var n=0,r=t.length;n<r;++n)if(t[n].name===e){t[n]=tD,t=t.slice(0,n).concat(t.slice(n+1));break}return i!=null&&t.push({name:e,value:i}),t}var _y="http://www.w3.org/1999/xhtml";const tC={svg:"http://www.w3.org/2000/svg",xhtml:_y,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function tm(t){var e=t+="",i=e.indexOf(":");return i>=0&&(e=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),tC.hasOwnProperty(e)?{space:tC[e],local:t}:t}function rD(t){return function(){var e=this.ownerDocument,i=this.namespaceURI;return i===_y&&e.documentElement.namespaceURI===_y?e.createElement(t):e.createElementNS(i,t)}}function sD(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function q$(t){var e=tm(t);return(e.local?sD:rD)(e)}function oD(){}function _1(t){return t==null?oD:function(){return this.querySelector(t)}}function aD(t){typeof t!="function"&&(t=_1(t));for(var e=this._groups,i=e.length,n=new Array(i),r=0;r<i;++r)for(var s=e[r],a=s.length,c=n[r]=new Array(a),h,d,f=0;f<a;++f)(h=s[f])&&(d=t.call(h,h.__data__,f,s))&&("__data__"in h&&(d.__data__=h.__data__),c[f]=d);return new Xn(n,this._parents)}function lD(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function cD(){return[]}function V$(t){return t==null?cD:function(){return this.querySelectorAll(t)}}function hD(t){return function(){return lD(t.apply(this,arguments))}}function uD(t){typeof t=="function"?t=hD(t):t=V$(t);for(var e=this._groups,i=e.length,n=[],r=[],s=0;s<i;++s)for(var a=e[s],c=a.length,h,d=0;d<c;++d)(h=a[d])&&(n.push(t.call(h,h.__data__,d,a)),r.push(h));return new Xn(n,r)}function I$(t){return function(){return this.matches(t)}}function Y$(t){return function(e){return e.matches(t)}}var dD=Array.prototype.find;function fD(t){return function(){return dD.call(this.children,t)}}function pD(){return this.firstElementChild}function gD(t){return this.select(t==null?pD:fD(typeof t=="function"?t:Y$(t)))}var mD=Array.prototype.filter;function OD(){return Array.from(this.children)}function vD(t){return function(){return mD.call(this.children,t)}}function yD(t){return this.selectAll(t==null?OD:vD(typeof t=="function"?t:Y$(t)))}function SD(t){typeof t!="function"&&(t=I$(t));for(var e=this._groups,i=e.length,n=new Array(i),r=0;r<i;++r)for(var s=e[r],a=s.length,c=n[r]=[],h,d=0;d<a;++d)(h=s[d])&&t.call(h,h.__data__,d,s)&&c.push(h);return new Xn(n,this._parents)}function H$(t){return new Array(t.length)}function bD(){return new Xn(this._enter||this._groups.map(H$),this._parents)}function ng(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}ng.prototype={constructor:ng,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function _D(t){return function(){return t}}function xD(t,e,i,n,r,s){for(var a=0,c,h=e.length,d=s.length;a<d;++a)(c=e[a])?(c.__data__=s[a],n[a]=c):i[a]=new ng(t,s[a]);for(;a<h;++a)(c=e[a])&&(r[a]=c)}function wD(t,e,i,n,r,s,a){var c,h,d=new Map,f=e.length,g=s.length,m=new Array(f),O;for(c=0;c<f;++c)(h=e[c])&&(m[c]=O=a.call(h,h.__data__,c,e)+"",d.has(O)?r[c]=h:d.set(O,h));for(c=0;c<g;++c)O=a.call(t,s[c],c,s)+"",(h=d.get(O))?(n[c]=h,h.__data__=s[c],d.delete(O)):i[c]=new ng(t,s[c]);for(c=0;c<f;++c)(h=e[c])&&d.get(m[c])===h&&(r[c]=h)}function kD(t){return t.__data__}function CD(t,e){if(!arguments.length)return Array.from(this,kD);var i=e?wD:xD,n=this._parents,r=this._groups;typeof t!="function"&&(t=_D(t));for(var s=r.length,a=new Array(s),c=new Array(s),h=new Array(s),d=0;d<s;++d){var f=n[d],g=r[d],m=g.length,O=TD(t.call(f,f&&f.__data__,d,n)),S=O.length,_=c[d]=new Array(S),w=a[d]=new Array(S),x=h[d]=new Array(m);i(f,g,_,w,x,O,e);for(var Q=0,k=0,T,M;Q<S;++Q)if(T=_[Q]){for(Q>=k&&(k=Q+1);!(M=w[k])&&++k<S;);T._next=M||null}}return a=new Xn(a,n),a._enter=c,a._exit=h,a}function TD(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function QD(){return new Xn(this._exit||this._groups.map(H$),this._parents)}function $D(t,e,i){var n=this.enter(),r=this,s=this.exit();return typeof t=="function"?(n=t(n),n&&(n=n.selection())):n=n.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),i==null?s.remove():i(s),n&&r?n.merge(r).order():r}function PD(t){for(var e=t.selection?t.selection():t,i=this._groups,n=e._groups,r=i.length,s=n.length,a=Math.min(r,s),c=new Array(r),h=0;h<a;++h)for(var d=i[h],f=n[h],g=d.length,m=c[h]=new Array(g),O,S=0;S<g;++S)(O=d[S]||f[S])&&(m[S]=O);for(;h<r;++h)c[h]=i[h];return new Xn(c,this._parents)}function ED(){for(var t=this._groups,e=-1,i=t.length;++e<i;)for(var n=t[e],r=n.length-1,s=n[r],a;--r>=0;)(a=n[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function RD(t){t||(t=AD);function e(g,m){return g&&m?t(g.__data__,m.__data__):!g-!m}for(var i=this._groups,n=i.length,r=new Array(n),s=0;s<n;++s){for(var a=i[s],c=a.length,h=r[s]=new Array(c),d,f=0;f<c;++f)(d=a[f])&&(h[f]=d);h.sort(e)}return new Xn(r,this._parents).order()}function AD(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function MD(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function zD(){return Array.from(this)}function jD(){for(var t=this._groups,e=0,i=t.length;e<i;++e)for(var n=t[e],r=0,s=n.length;r<s;++r){var a=n[r];if(a)return a}return null}function DD(){let t=0;for(const e of this)++t;return t}function BD(){return!this.node()}function LD(t){for(var e=this._groups,i=0,n=e.length;i<n;++i)for(var r=e[i],s=0,a=r.length,c;s<a;++s)(c=r[s])&&t.call(c,c.__data__,s,r);return this}function XD(t){return function(){this.removeAttribute(t)}}function ND(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ZD(t,e){return function(){this.setAttribute(t,e)}}function WD(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function qD(t,e){return function(){var i=e.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function VD(t,e){return function(){var i=e.apply(this,arguments);i==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function ID(t,e){var i=tm(t);if(arguments.length<2){var n=this.node();return i.local?n.getAttributeNS(i.space,i.local):n.getAttribute(i)}return this.each((e==null?i.local?ND:XD:typeof e=="function"?i.local?VD:qD:i.local?WD:ZD)(i,e))}function U$(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function YD(t){return function(){this.style.removeProperty(t)}}function HD(t,e,i){return function(){this.style.setProperty(t,e,i)}}function UD(t,e,i){return function(){var n=e.apply(this,arguments);n==null?this.style.removeProperty(t):this.style.setProperty(t,n,i)}}function GD(t,e,i){return arguments.length>1?this.each((e==null?YD:typeof e=="function"?UD:HD)(t,e,i??"")):pc(this.node(),t)}function pc(t,e){return t.style.getPropertyValue(e)||U$(t).getComputedStyle(t,null).getPropertyValue(e)}function FD(t){return function(){delete this[t]}}function KD(t,e){return function(){this[t]=e}}function JD(t,e){return function(){var i=e.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function eB(t,e){return arguments.length>1?this.each((e==null?FD:typeof e=="function"?JD:KD)(t,e)):this.node()[t]}function G$(t){return t.trim().split(/^|\s+/)}function x1(t){return t.classList||new F$(t)}function F$(t){this._node=t,this._names=G$(t.getAttribute("class")||"")}F$.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function K$(t,e){for(var i=x1(t),n=-1,r=e.length;++n<r;)i.add(e[n])}function J$(t,e){for(var i=x1(t),n=-1,r=e.length;++n<r;)i.remove(e[n])}function tB(t){return function(){K$(this,t)}}function iB(t){return function(){J$(this,t)}}function nB(t,e){return function(){(e.apply(this,arguments)?K$:J$)(this,t)}}function rB(t,e){var i=G$(t+"");if(arguments.length<2){for(var n=x1(this.node()),r=-1,s=i.length;++r<s;)if(!n.contains(i[r]))return!1;return!0}return this.each((typeof e=="function"?nB:e?tB:iB)(i,e))}function sB(){this.textContent=""}function oB(t){return function(){this.textContent=t}}function aB(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function lB(t){return arguments.length?this.each(t==null?sB:(typeof t=="function"?aB:oB)(t)):this.node().textContent}function cB(){this.innerHTML=""}function hB(t){return function(){this.innerHTML=t}}function uB(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function dB(t){return arguments.length?this.each(t==null?cB:(typeof t=="function"?uB:hB)(t)):this.node().innerHTML}function fB(){this.nextSibling&&this.parentNode.appendChild(this)}function pB(){return this.each(fB)}function gB(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mB(){return this.each(gB)}function OB(t){var e=typeof t=="function"?t:q$(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function vB(){return null}function yB(t,e){var i=typeof t=="function"?t:q$(t),n=e==null?vB:typeof e=="function"?e:_1(e);return this.select(function(){return this.insertBefore(i.apply(this,arguments),n.apply(this,arguments)||null)})}function SB(){var t=this.parentNode;t&&t.removeChild(this)}function bB(){return this.each(SB)}function _B(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function xB(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function wB(t){return this.select(t?xB:_B)}function kB(t){return arguments.length?this.property("__data__",t):this.node().__data__}function CB(t){return function(e){t.call(this,e,this.__data__)}}function TB(t){return t.trim().split(/^|\s+/).map(function(e){var i="",n=e.indexOf(".");return n>=0&&(i=e.slice(n+1),e=e.slice(0,n)),{type:e,name:i}})}function QB(t){return function(){var e=this.__on;if(e){for(var i=0,n=-1,r=e.length,s;i<r;++i)s=e[i],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++n]=s;++n?e.length=n:delete this.__on}}}function $B(t,e,i){return function(){var n=this.__on,r,s=CB(e);if(n){for(var a=0,c=n.length;a<c;++a)if((r=n[a]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=i),r.value=e;return}}this.addEventListener(t.type,s,i),r={type:t.type,name:t.name,value:e,listener:s,options:i},n?n.push(r):this.__on=[r]}}function PB(t,e,i){var n=TB(t+""),r,s=n.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var h=0,d=c.length,f;h<d;++h)for(r=0,f=c[h];r<s;++r)if((a=n[r]).type===f.type&&a.name===f.name)return f.value}return}for(c=e?$B:QB,r=0;r<s;++r)this.each(c(n[r],e,i));return this}function eP(t,e,i){var n=U$(t),r=n.CustomEvent;typeof r=="function"?r=new r(e,i):(r=n.document.createEvent("Event"),i?(r.initEvent(e,i.bubbles,i.cancelable),r.detail=i.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function EB(t,e){return function(){return eP(this,t,e)}}function RB(t,e){return function(){return eP(this,t,e.apply(this,arguments))}}function AB(t,e){return this.each((typeof e=="function"?RB:EB)(t,e))}function*MB(){for(var t=this._groups,e=0,i=t.length;e<i;++e)for(var n=t[e],r=0,s=n.length,a;r<s;++r)(a=n[r])&&(yield a)}var tP=[null];function Xn(t,e){this._groups=t,this._parents=e}function Fu(){return new Xn([[document.documentElement]],tP)}function zB(){return this}Xn.prototype=Fu.prototype={constructor:Xn,select:aD,selectAll:uD,selectChild:gD,selectChildren:yD,filter:SD,data:CD,enter:bD,exit:QD,join:$D,merge:PD,selection:zB,order:ED,sort:RD,call:MD,nodes:zD,node:jD,size:DD,empty:BD,each:LD,attr:ID,style:GD,property:eB,classed:rB,text:lB,html:dB,raise:pB,lower:mB,append:OB,insert:yB,remove:bB,clone:wB,datum:kB,on:PB,dispatch:AB,[Symbol.iterator]:MB};function Bn(t){return typeof t=="string"?new Xn([[document.querySelector(t)]],[document.documentElement]):new Xn([[t]],tP)}function jB(t){let e;for(;e=t.sourceEvent;)t=e;return t}function pr(t,e){if(t=jB(t),e===void 0&&(e=t.currentTarget),e){var i=e.ownerSVGElement||e;if(i.createSVGPoint){var n=i.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n=n.matrixTransform(e.getScreenCTM().inverse()),[n.x,n.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}const DB={passive:!1},Su={capture:!0,passive:!1};function tv(t){t.stopImmediatePropagation()}function nc(t){t.preventDefault(),t.stopImmediatePropagation()}function iP(t){var e=t.document.documentElement,i=Bn(t).on("dragstart.drag",nc,Su);"onselectstart"in e?i.on("selectstart.drag",nc,Su):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function nP(t,e){var i=t.document.documentElement,n=Bn(t).on("dragstart.drag",null);e&&(n.on("click.drag",nc,Su),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in i?n.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Nf=t=>()=>t;function xy(t,{sourceEvent:e,subject:i,target:n,identifier:r,active:s,x:a,y:c,dx:h,dy:d,dispatch:f}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:f}})}xy.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function BB(t){return!t.ctrlKey&&!t.button}function LB(){return this.parentNode}function XB(t,e){return e??{x:t.x,y:t.y}}function NB(){return navigator.maxTouchPoints||"ontouchstart"in this}function rP(){var t=BB,e=LB,i=XB,n=NB,r={},s=em("start","drag","end"),a=0,c,h,d,f,g=0;function m(T){T.on("mousedown.drag",O).filter(n).on("touchstart.drag",w).on("touchmove.drag",x,DB).on("touchend.drag touchcancel.drag",Q).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function O(T,M){if(!(f||!t.call(this,T,M))){var $=k(this,e.call(this,T,M),T,M,"mouse");$&&(Bn(T.view).on("mousemove.drag",S,Su).on("mouseup.drag",_,Su),iP(T.view),tv(T),d=!1,c=T.clientX,h=T.clientY,$("start",T))}}function S(T){if(nc(T),!d){var M=T.clientX-c,$=T.clientY-h;d=M*M+$*$>g}r.mouse("drag",T)}function _(T){Bn(T.view).on("mousemove.drag mouseup.drag",null),nP(T.view,d),nc(T),r.mouse("end",T)}function w(T,M){if(t.call(this,T,M)){var $=T.changedTouches,R=e.call(this,T,M),V=$.length,H,ee;for(H=0;H<V;++H)(ee=k(this,R,T,M,$[H].identifier,$[H]))&&(tv(T),ee("start",T,$[H]))}}function x(T){var M=T.changedTouches,$=M.length,R,V;for(R=0;R<$;++R)(V=r[M[R].identifier])&&(nc(T),V("drag",T,M[R]))}function Q(T){var M=T.changedTouches,$=M.length,R,V;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),R=0;R<$;++R)(V=r[M[R].identifier])&&(tv(T),V("end",T,M[R]))}function k(T,M,$,R,V,H){var ee=s.copy(),I=pr(H||$,M),j,D,E;if((E=i.call(T,new xy("beforestart",{sourceEvent:$,target:m,identifier:V,active:a,x:I[0],y:I[1],dx:0,dy:0,dispatch:ee}),R))!=null)return j=E.x-I[0]||0,D=E.y-I[1]||0,function X(P,Z,L){var B=I,G;switch(P){case"start":r[V]=X,G=a++;break;case"end":delete r[V],--a;case"drag":I=pr(L||Z,M),G=a;break}ee.call(P,T,new xy(P,{sourceEvent:Z,subject:E,target:m,identifier:V,active:G,x:I[0]+j,y:I[1]+D,dx:I[0]-B[0],dy:I[1]-B[1],dispatch:ee}),R)}}return m.filter=function(T){return arguments.length?(t=typeof T=="function"?T:Nf(!!T),m):t},m.container=function(T){return arguments.length?(e=typeof T=="function"?T:Nf(T),m):e},m.subject=function(T){return arguments.length?(i=typeof T=="function"?T:Nf(T),m):i},m.touchable=function(T){return arguments.length?(n=typeof T=="function"?T:Nf(!!T),m):n},m.on=function(){var T=s.on.apply(s,arguments);return T===s?m:T},m.clickDistance=function(T){return arguments.length?(g=(T=+T)*T,m):Math.sqrt(g)},m}function w1(t,e,i){t.prototype=e.prototype=i,i.constructor=t}function sP(t,e){var i=Object.create(t.prototype);for(var n in e)i[n]=e[n];return i}function Ku(){}var bu=.7,rg=1/bu,rc="\\s*([+-]?\\d+)\\s*",_u="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Vr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ZB=/^#([0-9a-f]{3,8})$/,WB=new RegExp(`^rgb\\(${rc},${rc},${rc}\\)$`),qB=new RegExp(`^rgb\\(${Vr},${Vr},${Vr}\\)$`),VB=new RegExp(`^rgba\\(${rc},${rc},${rc},${_u}\\)$`),IB=new RegExp(`^rgba\\(${Vr},${Vr},${Vr},${_u}\\)$`),YB=new RegExp(`^hsl\\(${_u},${Vr},${Vr}\\)$`),HB=new RegExp(`^hsla\\(${_u},${Vr},${Vr},${_u}\\)$`),iC={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};w1(Ku,La,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:nC,formatHex:nC,formatHex8:UB,formatHsl:GB,formatRgb:rC,toString:rC});function nC(){return this.rgb().formatHex()}function UB(){return this.rgb().formatHex8()}function GB(){return oP(this).formatHsl()}function rC(){return this.rgb().formatRgb()}function La(t){var e,i;return t=(t+"").trim().toLowerCase(),(e=ZB.exec(t))?(i=e[1].length,e=parseInt(e[1],16),i===6?sC(e):i===3?new yn(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):i===8?Zf(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):i===4?Zf(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=WB.exec(t))?new yn(e[1],e[2],e[3],1):(e=qB.exec(t))?new yn(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=VB.exec(t))?Zf(e[1],e[2],e[3],e[4]):(e=IB.exec(t))?Zf(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=YB.exec(t))?lC(e[1],e[2]/100,e[3]/100,1):(e=HB.exec(t))?lC(e[1],e[2]/100,e[3]/100,e[4]):iC.hasOwnProperty(t)?sC(iC[t]):t==="transparent"?new yn(NaN,NaN,NaN,0):null}function sC(t){return new yn(t>>16&255,t>>8&255,t&255,1)}function Zf(t,e,i,n){return n<=0&&(t=e=i=NaN),new yn(t,e,i,n)}function FB(t){return t instanceof Ku||(t=La(t)),t?(t=t.rgb(),new yn(t.r,t.g,t.b,t.opacity)):new yn}function wy(t,e,i,n){return arguments.length===1?FB(t):new yn(t,e,i,n??1)}function yn(t,e,i,n){this.r=+t,this.g=+e,this.b=+i,this.opacity=+n}w1(yn,wy,sP(Ku,{brighter(t){return t=t==null?rg:Math.pow(rg,t),new yn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?bu:Math.pow(bu,t),new yn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new yn(Ma(this.r),Ma(this.g),Ma(this.b),sg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:oC,formatHex:oC,formatHex8:KB,formatRgb:aC,toString:aC}));function oC(){return`#${$a(this.r)}${$a(this.g)}${$a(this.b)}`}function KB(){return`#${$a(this.r)}${$a(this.g)}${$a(this.b)}${$a((isNaN(this.opacity)?1:this.opacity)*255)}`}function aC(){const t=sg(this.opacity);return`${t===1?"rgb(":"rgba("}${Ma(this.r)}, ${Ma(this.g)}, ${Ma(this.b)}${t===1?")":`, ${t})`}`}function sg(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ma(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function $a(t){return t=Ma(t),(t<16?"0":"")+t.toString(16)}function lC(t,e,i,n){return n<=0?t=e=i=NaN:i<=0||i>=1?t=e=NaN:e<=0&&(t=NaN),new gr(t,e,i,n)}function oP(t){if(t instanceof gr)return new gr(t.h,t.s,t.l,t.opacity);if(t instanceof Ku||(t=La(t)),!t)return new gr;if(t instanceof gr)return t;t=t.rgb();var e=t.r/255,i=t.g/255,n=t.b/255,r=Math.min(e,i,n),s=Math.max(e,i,n),a=NaN,c=s-r,h=(s+r)/2;return c?(e===s?a=(i-n)/c+(i<n)*6:i===s?a=(n-e)/c+2:a=(e-i)/c+4,c/=h<.5?s+r:2-s-r,a*=60):c=h>0&&h<1?0:a,new gr(a,c,h,t.opacity)}function JB(t,e,i,n){return arguments.length===1?oP(t):new gr(t,e,i,n??1)}function gr(t,e,i,n){this.h=+t,this.s=+e,this.l=+i,this.opacity=+n}w1(gr,JB,sP(Ku,{brighter(t){return t=t==null?rg:Math.pow(rg,t),new gr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?bu:Math.pow(bu,t),new gr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,n=i+(i<.5?i:1-i)*e,r=2*i-n;return new yn(iv(t>=240?t-240:t+120,r,n),iv(t,r,n),iv(t<120?t+240:t-120,r,n),this.opacity)},clamp(){return new gr(cC(this.h),Wf(this.s),Wf(this.l),sg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=sg(this.opacity);return`${t===1?"hsl(":"hsla("}${cC(this.h)}, ${Wf(this.s)*100}%, ${Wf(this.l)*100}%${t===1?")":`, ${t})`}`}}));function cC(t){return t=(t||0)%360,t<0?t+360:t}function Wf(t){return Math.max(0,Math.min(1,t||0))}function iv(t,e,i){return(t<60?e+(i-e)*t/60:t<180?i:t<240?e+(i-e)*(240-t)/60:e)*255}const k1=t=>()=>t;function e4(t,e){return function(i){return t+i*e}}function t4(t,e,i){return t=Math.pow(t,i),e=Math.pow(e,i)-t,i=1/i,function(n){return Math.pow(t+n*e,i)}}function i4(t){return(t=+t)==1?aP:function(e,i){return i-e?t4(e,i,t):k1(isNaN(e)?i:e)}}function aP(t,e){var i=e-t;return i?e4(t,i):k1(isNaN(t)?e:t)}const og=(function t(e){var i=i4(e);function n(r,s){var a=i((r=wy(r)).r,(s=wy(s)).r),c=i(r.g,s.g),h=i(r.b,s.b),d=aP(r.opacity,s.opacity);return function(f){return r.r=a(f),r.g=c(f),r.b=h(f),r.opacity=d(f),r+""}}return n.gamma=t,n})(1);function n4(t,e){e||(e=[]);var i=t?Math.min(e.length,t.length):0,n=e.slice(),r;return function(s){for(r=0;r<i;++r)n[r]=t[r]*(1-s)+e[r]*s;return n}}function r4(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function s4(t,e){var i=e?e.length:0,n=t?Math.min(i,t.length):0,r=new Array(n),s=new Array(i),a;for(a=0;a<n;++a)r[a]=cu(t[a],e[a]);for(;a<i;++a)s[a]=e[a];return function(c){for(a=0;a<n;++a)s[a]=r[a](c);return s}}function o4(t,e){var i=new Date;return t=+t,e=+e,function(n){return i.setTime(t*(1-n)+e*n),i}}function Dr(t,e){return t=+t,e=+e,function(i){return t*(1-i)+e*i}}function a4(t,e){var i={},n={},r;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in t?i[r]=cu(t[r],e[r]):n[r]=e[r];return function(s){for(r in i)n[r]=i[r](s);return n}}var ky=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,nv=new RegExp(ky.source,"g");function l4(t){return function(){return t}}function c4(t){return function(e){return t(e)+""}}function lP(t,e){var i=ky.lastIndex=nv.lastIndex=0,n,r,s,a=-1,c=[],h=[];for(t=t+"",e=e+"";(n=ky.exec(t))&&(r=nv.exec(e));)(s=r.index)>i&&(s=e.slice(i,s),c[a]?c[a]+=s:c[++a]=s),(n=n[0])===(r=r[0])?c[a]?c[a]+=r:c[++a]=r:(c[++a]=null,h.push({i:a,x:Dr(n,r)})),i=nv.lastIndex;return i<e.length&&(s=e.slice(i),c[a]?c[a]+=s:c[++a]=s),c.length<2?h[0]?c4(h[0].x):l4(e):(e=h.length,function(d){for(var f=0,g;f<e;++f)c[(g=h[f]).i]=g.x(d);return c.join("")})}function cu(t,e){var i=typeof e,n;return e==null||i==="boolean"?k1(e):(i==="number"?Dr:i==="string"?(n=La(e))?(e=n,og):lP:e instanceof La?og:e instanceof Date?o4:r4(e)?n4:Array.isArray(e)?s4:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?a4:Dr)(t,e)}var hC=180/Math.PI,Cy={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function cP(t,e,i,n,r,s){var a,c,h;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(h=t*i+e*n)&&(i-=t*h,n-=e*h),(c=Math.sqrt(i*i+n*n))&&(i/=c,n/=c,h/=c),t*n<e*i&&(t=-t,e=-e,h=-h,a=-a),{translateX:r,translateY:s,rotate:Math.atan2(e,t)*hC,skewX:Math.atan(h)*hC,scaleX:a,scaleY:c}}var qf;function h4(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Cy:cP(e.a,e.b,e.c,e.d,e.e,e.f)}function u4(t){return t==null||(qf||(qf=document.createElementNS("http://www.w3.org/2000/svg","g")),qf.setAttribute("transform",t),!(t=qf.transform.baseVal.consolidate()))?Cy:(t=t.matrix,cP(t.a,t.b,t.c,t.d,t.e,t.f))}function hP(t,e,i,n){function r(d){return d.length?d.pop()+" ":""}function s(d,f,g,m,O,S){if(d!==g||f!==m){var _=O.push("translate(",null,e,null,i);S.push({i:_-4,x:Dr(d,g)},{i:_-2,x:Dr(f,m)})}else(g||m)&&O.push("translate("+g+e+m+i)}function a(d,f,g,m){d!==f?(d-f>180?f+=360:f-d>180&&(d+=360),m.push({i:g.push(r(g)+"rotate(",null,n)-2,x:Dr(d,f)})):f&&g.push(r(g)+"rotate("+f+n)}function c(d,f,g,m){d!==f?m.push({i:g.push(r(g)+"skewX(",null,n)-2,x:Dr(d,f)}):f&&g.push(r(g)+"skewX("+f+n)}function h(d,f,g,m,O,S){if(d!==g||f!==m){var _=O.push(r(O)+"scale(",null,",",null,")");S.push({i:_-4,x:Dr(d,g)},{i:_-2,x:Dr(f,m)})}else(g!==1||m!==1)&&O.push(r(O)+"scale("+g+","+m+")")}return function(d,f){var g=[],m=[];return d=t(d),f=t(f),s(d.translateX,d.translateY,f.translateX,f.translateY,g,m),a(d.rotate,f.rotate,g,m),c(d.skewX,f.skewX,g,m),h(d.scaleX,d.scaleY,f.scaleX,f.scaleY,g,m),d=f=null,function(O){for(var S=-1,_=m.length,w;++S<_;)g[(w=m[S]).i]=w.x(O);return g.join("")}}}var d4=hP(h4,"px, ","px)","deg)"),f4=hP(u4,", ",")",")"),p4=1e-12;function uC(t){return((t=Math.exp(t))+1/t)/2}function g4(t){return((t=Math.exp(t))-1/t)/2}function m4(t){return((t=Math.exp(2*t))-1)/(t+1)}const Rp=(function t(e,i,n){function r(s,a){var c=s[0],h=s[1],d=s[2],f=a[0],g=a[1],m=a[2],O=f-c,S=g-h,_=O*O+S*S,w,x;if(_<p4)x=Math.log(m/d)/e,w=function(R){return[c+R*O,h+R*S,d*Math.exp(e*R*x)]};else{var Q=Math.sqrt(_),k=(m*m-d*d+n*_)/(2*d*i*Q),T=(m*m-d*d-n*_)/(2*m*i*Q),M=Math.log(Math.sqrt(k*k+1)-k),$=Math.log(Math.sqrt(T*T+1)-T);x=($-M)/e,w=function(R){var V=R*x,H=uC(M),ee=d/(i*Q)*(H*m4(e*V+M)-g4(M));return[c+ee*O,h+ee*S,d*H/uC(e*V+M)]}}return w.duration=x*1e3*e/Math.SQRT2,w}return r.rho=function(s){var a=Math.max(.001,+s),c=a*a,h=c*c;return t(a,c,h)},r})(Math.SQRT2,2,4);var gc=0,Jh=0,Mh=0,uP=1e3,ag,eu,lg=0,Xa=0,im=0,xu=typeof performance=="object"&&performance.now?performance:Date,dP=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function C1(){return Xa||(dP(O4),Xa=xu.now()+im)}function O4(){Xa=0}function cg(){this._call=this._time=this._next=null}cg.prototype=fP.prototype={constructor:cg,restart:function(t,e,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?C1():+i)+(e==null?0:+e),!this._next&&eu!==this&&(eu?eu._next=this:ag=this,eu=this),this._call=t,this._time=i,Ty()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ty())}};function fP(t,e,i){var n=new cg;return n.restart(t,e,i),n}function v4(){C1(),++gc;for(var t=ag,e;t;)(e=Xa-t._time)>=0&&t._call.call(void 0,e),t=t._next;--gc}function dC(){Xa=(lg=xu.now())+im,gc=Jh=0;try{v4()}finally{gc=0,S4(),Xa=0}}function y4(){var t=xu.now(),e=t-lg;e>uP&&(im-=e,lg=t)}function S4(){for(var t,e=ag,i,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(i=e._next,e._next=null,e=t?t._next=i:ag=i);eu=t,Ty(n)}function Ty(t){if(!gc){Jh&&(Jh=clearTimeout(Jh));var e=t-Xa;e>24?(t<1/0&&(Jh=setTimeout(dC,t-xu.now()-im)),Mh&&(Mh=clearInterval(Mh))):(Mh||(lg=xu.now(),Mh=setInterval(y4,uP)),gc=1,dP(dC))}}function fC(t,e,i){var n=new cg;return e=e==null?0:+e,n.restart(r=>{n.stop(),t(r+e)},e,i),n}var b4=em("start","end","cancel","interrupt"),_4=[],pP=0,pC=1,Qy=2,Ap=3,gC=4,$y=5,Mp=6;function nm(t,e,i,n,r,s){var a=t.__transition;if(!a)t.__transition={};else if(i in a)return;x4(t,i,{name:e,index:n,group:r,on:b4,tween:_4,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:pP})}function T1(t,e){var i=br(t,e);if(i.state>pP)throw new Error("too late; already scheduled");return i}function Fr(t,e){var i=br(t,e);if(i.state>Ap)throw new Error("too late; already running");return i}function br(t,e){var i=t.__transition;if(!i||!(i=i[e]))throw new Error("transition not found");return i}function x4(t,e,i){var n=t.__transition,r;n[e]=i,i.timer=fP(s,0,i.time);function s(d){i.state=pC,i.timer.restart(a,i.delay,i.time),i.delay<=d&&a(d-i.delay)}function a(d){var f,g,m,O;if(i.state!==pC)return h();for(f in n)if(O=n[f],O.name===i.name){if(O.state===Ap)return fC(a);O.state===gC?(O.state=Mp,O.timer.stop(),O.on.call("interrupt",t,t.__data__,O.index,O.group),delete n[f]):+f<e&&(O.state=Mp,O.timer.stop(),O.on.call("cancel",t,t.__data__,O.index,O.group),delete n[f])}if(fC(function(){i.state===Ap&&(i.state=gC,i.timer.restart(c,i.delay,i.time),c(d))}),i.state=Qy,i.on.call("start",t,t.__data__,i.index,i.group),i.state===Qy){for(i.state=Ap,r=new Array(m=i.tween.length),f=0,g=-1;f<m;++f)(O=i.tween[f].value.call(t,t.__data__,i.index,i.group))&&(r[++g]=O);r.length=g+1}}function c(d){for(var f=d<i.duration?i.ease.call(null,d/i.duration):(i.timer.restart(h),i.state=$y,1),g=-1,m=r.length;++g<m;)r[g].call(t,f);i.state===$y&&(i.on.call("end",t,t.__data__,i.index,i.group),h())}function h(){i.state=Mp,i.timer.stop(),delete n[e];for(var d in n)return;delete t.__transition}}function zp(t,e){var i=t.__transition,n,r,s=!0,a;if(i){e=e==null?null:e+"";for(a in i){if((n=i[a]).name!==e){s=!1;continue}r=n.state>Qy&&n.state<$y,n.state=Mp,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete i[a]}s&&delete t.__transition}}function w4(t){return this.each(function(){zp(this,t)})}function k4(t,e){var i,n;return function(){var r=Fr(this,t),s=r.tween;if(s!==i){n=i=s;for(var a=0,c=n.length;a<c;++a)if(n[a].name===e){n=n.slice(),n.splice(a,1);break}}r.tween=n}}function C4(t,e,i){var n,r;if(typeof i!="function")throw new Error;return function(){var s=Fr(this,t),a=s.tween;if(a!==n){r=(n=a).slice();for(var c={name:e,value:i},h=0,d=r.length;h<d;++h)if(r[h].name===e){r[h]=c;break}h===d&&r.push(c)}s.tween=r}}function T4(t,e){var i=this._id;if(t+="",arguments.length<2){for(var n=br(this.node(),i).tween,r=0,s=n.length,a;r<s;++r)if((a=n[r]).name===t)return a.value;return null}return this.each((e==null?k4:C4)(i,t,e))}function Q1(t,e,i){var n=t._id;return t.each(function(){var r=Fr(this,n);(r.value||(r.value={}))[e]=i.apply(this,arguments)}),function(r){return br(r,n).value[e]}}function gP(t,e){var i;return(typeof e=="number"?Dr:e instanceof La?og:(i=La(e))?(e=i,og):lP)(t,e)}function Q4(t){return function(){this.removeAttribute(t)}}function $4(t){return function(){this.removeAttributeNS(t.space,t.local)}}function P4(t,e,i){var n,r=i+"",s;return function(){var a=this.getAttribute(t);return a===r?null:a===n?s:s=e(n=a,i)}}function E4(t,e,i){var n,r=i+"",s;return function(){var a=this.getAttributeNS(t.space,t.local);return a===r?null:a===n?s:s=e(n=a,i)}}function R4(t,e,i){var n,r,s;return function(){var a,c=i(this),h;return c==null?void this.removeAttribute(t):(a=this.getAttribute(t),h=c+"",a===h?null:a===n&&h===r?s:(r=h,s=e(n=a,c)))}}function A4(t,e,i){var n,r,s;return function(){var a,c=i(this),h;return c==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),h=c+"",a===h?null:a===n&&h===r?s:(r=h,s=e(n=a,c)))}}function M4(t,e){var i=tm(t),n=i==="transform"?f4:gP;return this.attrTween(t,typeof e=="function"?(i.local?A4:R4)(i,n,Q1(this,"attr."+t,e)):e==null?(i.local?$4:Q4)(i):(i.local?E4:P4)(i,n,e))}function z4(t,e){return function(i){this.setAttribute(t,e.call(this,i))}}function j4(t,e){return function(i){this.setAttributeNS(t.space,t.local,e.call(this,i))}}function D4(t,e){var i,n;function r(){var s=e.apply(this,arguments);return s!==n&&(i=(n=s)&&j4(t,s)),i}return r._value=e,r}function B4(t,e){var i,n;function r(){var s=e.apply(this,arguments);return s!==n&&(i=(n=s)&&z4(t,s)),i}return r._value=e,r}function L4(t,e){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(e==null)return this.tween(i,null);if(typeof e!="function")throw new Error;var n=tm(t);return this.tween(i,(n.local?D4:B4)(n,e))}function X4(t,e){return function(){T1(this,t).delay=+e.apply(this,arguments)}}function N4(t,e){return e=+e,function(){T1(this,t).delay=e}}function Z4(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?X4:N4)(e,t)):br(this.node(),e).delay}function W4(t,e){return function(){Fr(this,t).duration=+e.apply(this,arguments)}}function q4(t,e){return e=+e,function(){Fr(this,t).duration=e}}function V4(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?W4:q4)(e,t)):br(this.node(),e).duration}function I4(t,e){if(typeof e!="function")throw new Error;return function(){Fr(this,t).ease=e}}function Y4(t){var e=this._id;return arguments.length?this.each(I4(e,t)):br(this.node(),e).ease}function H4(t,e){return function(){var i=e.apply(this,arguments);if(typeof i!="function")throw new Error;Fr(this,t).ease=i}}function U4(t){if(typeof t!="function")throw new Error;return this.each(H4(this._id,t))}function G4(t){typeof t!="function"&&(t=I$(t));for(var e=this._groups,i=e.length,n=new Array(i),r=0;r<i;++r)for(var s=e[r],a=s.length,c=n[r]=[],h,d=0;d<a;++d)(h=s[d])&&t.call(h,h.__data__,d,s)&&c.push(h);return new As(n,this._parents,this._name,this._id)}function F4(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,i=t._groups,n=e.length,r=i.length,s=Math.min(n,r),a=new Array(n),c=0;c<s;++c)for(var h=e[c],d=i[c],f=h.length,g=a[c]=new Array(f),m,O=0;O<f;++O)(m=h[O]||d[O])&&(g[O]=m);for(;c<n;++c)a[c]=e[c];return new As(a,this._parents,this._name,this._id)}function K4(t){return(t+"").trim().split(/^|\s+/).every(function(e){var i=e.indexOf(".");return i>=0&&(e=e.slice(0,i)),!e||e==="start"})}function J4(t,e,i){var n,r,s=K4(e)?T1:Fr;return function(){var a=s(this,t),c=a.on;c!==n&&(r=(n=c).copy()).on(e,i),a.on=r}}function eL(t,e){var i=this._id;return arguments.length<2?br(this.node(),i).on.on(t):this.each(J4(i,t,e))}function tL(t){return function(){var e=this.parentNode;for(var i in this.__transition)if(+i!==t)return;e&&e.removeChild(this)}}function iL(){return this.on("end.remove",tL(this._id))}function nL(t){var e=this._name,i=this._id;typeof t!="function"&&(t=_1(t));for(var n=this._groups,r=n.length,s=new Array(r),a=0;a<r;++a)for(var c=n[a],h=c.length,d=s[a]=new Array(h),f,g,m=0;m<h;++m)(f=c[m])&&(g=t.call(f,f.__data__,m,c))&&("__data__"in f&&(g.__data__=f.__data__),d[m]=g,nm(d[m],e,i,m,d,br(f,i)));return new As(s,this._parents,e,i)}function rL(t){var e=this._name,i=this._id;typeof t!="function"&&(t=V$(t));for(var n=this._groups,r=n.length,s=[],a=[],c=0;c<r;++c)for(var h=n[c],d=h.length,f,g=0;g<d;++g)if(f=h[g]){for(var m=t.call(f,f.__data__,g,h),O,S=br(f,i),_=0,w=m.length;_<w;++_)(O=m[_])&&nm(O,e,i,_,m,S);s.push(m),a.push(f)}return new As(s,a,e,i)}var sL=Fu.prototype.constructor;function oL(){return new sL(this._groups,this._parents)}function aL(t,e){var i,n,r;return function(){var s=pc(this,t),a=(this.style.removeProperty(t),pc(this,t));return s===a?null:s===i&&a===n?r:r=e(i=s,n=a)}}function mP(t){return function(){this.style.removeProperty(t)}}function lL(t,e,i){var n,r=i+"",s;return function(){var a=pc(this,t);return a===r?null:a===n?s:s=e(n=a,i)}}function cL(t,e,i){var n,r,s;return function(){var a=pc(this,t),c=i(this),h=c+"";return c==null&&(h=c=(this.style.removeProperty(t),pc(this,t))),a===h?null:a===n&&h===r?s:(r=h,s=e(n=a,c))}}function hL(t,e){var i,n,r,s="style."+e,a="end."+s,c;return function(){var h=Fr(this,t),d=h.on,f=h.value[s]==null?c||(c=mP(e)):void 0;(d!==i||r!==f)&&(n=(i=d).copy()).on(a,r=f),h.on=n}}function uL(t,e,i){var n=(t+="")=="transform"?d4:gP;return e==null?this.styleTween(t,aL(t,n)).on("end.style."+t,mP(t)):typeof e=="function"?this.styleTween(t,cL(t,n,Q1(this,"style."+t,e))).each(hL(this._id,t)):this.styleTween(t,lL(t,n,e),i).on("end.style."+t,null)}function dL(t,e,i){return function(n){this.style.setProperty(t,e.call(this,n),i)}}function fL(t,e,i){var n,r;function s(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&dL(t,a,i)),n}return s._value=e,s}function pL(t,e,i){var n="style."+(t+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,fL(t,e,i??""))}function gL(t){return function(){this.textContent=t}}function mL(t){return function(){var e=t(this);this.textContent=e??""}}function OL(t){return this.tween("text",typeof t=="function"?mL(Q1(this,"text",t)):gL(t==null?"":t+""))}function vL(t){return function(e){this.textContent=t.call(this,e)}}function yL(t){var e,i;function n(){var r=t.apply(this,arguments);return r!==i&&(e=(i=r)&&vL(r)),e}return n._value=t,n}function SL(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,yL(t))}function bL(){for(var t=this._name,e=this._id,i=OP(),n=this._groups,r=n.length,s=0;s<r;++s)for(var a=n[s],c=a.length,h,d=0;d<c;++d)if(h=a[d]){var f=br(h,e);nm(h,t,i,d,a,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new As(n,this._parents,t,i)}function _L(){var t,e,i=this,n=i._id,r=i.size();return new Promise(function(s,a){var c={value:a},h={value:function(){--r===0&&s()}};i.each(function(){var d=Fr(this,n),f=d.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(c),e._.interrupt.push(c),e._.end.push(h)),d.on=e}),r===0&&s()})}var xL=0;function As(t,e,i,n){this._groups=t,this._parents=e,this._name=i,this._id=n}function OP(){return++xL}var ys=Fu.prototype;As.prototype={constructor:As,select:nL,selectAll:rL,selectChild:ys.selectChild,selectChildren:ys.selectChildren,filter:G4,merge:F4,selection:oL,transition:bL,call:ys.call,nodes:ys.nodes,node:ys.node,size:ys.size,empty:ys.empty,each:ys.each,on:eL,attr:M4,attrTween:L4,style:uL,styleTween:pL,text:OL,textTween:SL,remove:iL,tween:T4,delay:Z4,duration:V4,ease:Y4,easeVarying:U4,end:_L,[Symbol.iterator]:ys[Symbol.iterator]};function wL(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var kL={time:null,delay:0,duration:250,ease:wL};function CL(t,e){for(var i;!(i=t.__transition)||!(i=i[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return i}function TL(t){var e,i;t instanceof As?(e=t._id,t=t._name):(e=OP(),(i=kL).time=C1(),t=t==null?null:t+"");for(var n=this._groups,r=n.length,s=0;s<r;++s)for(var a=n[s],c=a.length,h,d=0;d<c;++d)(h=a[d])&&nm(h,t,e,d,a,i||CL(h,e));return new As(n,this._parents,t,e)}Fu.prototype.interrupt=w4;Fu.prototype.transition=TL;const Vf=t=>()=>t;function QL(t,{sourceEvent:e,target:i,transform:n,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:r}})}function $s(t,e,i){this.k=t,this.x=e,this.y=i}$s.prototype={constructor:$s,scale:function(t){return t===1?this:new $s(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new $s(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var rm=new $s(1,0,0);vP.prototype=$s.prototype;function vP(t){for(;!t.__zoom;)if(!(t=t.parentNode))return rm;return t.__zoom}function rv(t){t.stopImmediatePropagation()}function zh(t){t.preventDefault(),t.stopImmediatePropagation()}function $L(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function PL(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function mC(){return this.__zoom||rm}function EL(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function RL(){return navigator.maxTouchPoints||"ontouchstart"in this}function AL(t,e,i){var n=t.invertX(e[0][0])-i[0][0],r=t.invertX(e[1][0])-i[1][0],s=t.invertY(e[0][1])-i[0][1],a=t.invertY(e[1][1])-i[1][1];return t.translate(r>n?(n+r)/2:Math.min(0,n)||Math.max(0,r),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function yP(){var t=$L,e=PL,i=AL,n=EL,r=RL,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,h=Rp,d=em("start","zoom","end"),f,g,m,O=500,S=150,_=0,w=10;function x(E){E.property("__zoom",mC).on("wheel.zoom",V,{passive:!1}).on("mousedown.zoom",H).on("dblclick.zoom",ee).filter(r).on("touchstart.zoom",I).on("touchmove.zoom",j).on("touchend.zoom touchcancel.zoom",D).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(E,X,P,Z){var L=E.selection?E.selection():E;L.property("__zoom",mC),E!==L?M(E,X,P,Z):L.interrupt().each(function(){$(this,arguments).event(Z).start().zoom(null,typeof X=="function"?X.apply(this,arguments):X).end()})},x.scaleBy=function(E,X,P,Z){x.scaleTo(E,function(){var L=this.__zoom.k,B=typeof X=="function"?X.apply(this,arguments):X;return L*B},P,Z)},x.scaleTo=function(E,X,P,Z){x.transform(E,function(){var L=e.apply(this,arguments),B=this.__zoom,G=P==null?T(L):typeof P=="function"?P.apply(this,arguments):P,z=B.invert(G),q=typeof X=="function"?X.apply(this,arguments):X;return i(k(Q(B,q),G,z),L,a)},P,Z)},x.translateBy=function(E,X,P,Z){x.transform(E,function(){return i(this.__zoom.translate(typeof X=="function"?X.apply(this,arguments):X,typeof P=="function"?P.apply(this,arguments):P),e.apply(this,arguments),a)},null,Z)},x.translateTo=function(E,X,P,Z,L){x.transform(E,function(){var B=e.apply(this,arguments),G=this.__zoom,z=Z==null?T(B):typeof Z=="function"?Z.apply(this,arguments):Z;return i(rm.translate(z[0],z[1]).scale(G.k).translate(typeof X=="function"?-X.apply(this,arguments):-X,typeof P=="function"?-P.apply(this,arguments):-P),B,a)},Z,L)};function Q(E,X){return X=Math.max(s[0],Math.min(s[1],X)),X===E.k?E:new $s(X,E.x,E.y)}function k(E,X,P){var Z=X[0]-P[0]*E.k,L=X[1]-P[1]*E.k;return Z===E.x&&L===E.y?E:new $s(E.k,Z,L)}function T(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function M(E,X,P,Z){E.on("start.zoom",function(){$(this,arguments).event(Z).start()}).on("interrupt.zoom end.zoom",function(){$(this,arguments).event(Z).end()}).tween("zoom",function(){var L=this,B=arguments,G=$(L,B).event(Z),z=e.apply(L,B),q=P==null?T(z):typeof P=="function"?P.apply(L,B):P,K=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),ie=L.__zoom,ce=typeof X=="function"?X.apply(L,B):X,de=h(ie.invert(q).concat(K/ie.k),ce.invert(q).concat(K/ce.k));return function(pe){if(pe===1)pe=ce;else{var fe=de(pe),ve=K/fe[2];pe=new $s(ve,q[0]-fe[0]*ve,q[1]-fe[1]*ve)}G.zoom(null,pe)}})}function $(E,X,P){return!P&&E.__zooming||new R(E,X)}function R(E,X){this.that=E,this.args=X,this.active=0,this.sourceEvent=null,this.extent=e.apply(E,X),this.taps=0}R.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,X){return this.mouse&&E!=="mouse"&&(this.mouse[1]=X.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=X.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=X.invert(this.touch1[0])),this.that.__zoom=X,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var X=Bn(this.that).datum();d.call(E,this.that,new QL(E,{sourceEvent:this.sourceEvent,target:x,transform:this.that.__zoom,dispatch:d}),X)}};function V(E,...X){if(!t.apply(this,arguments))return;var P=$(this,X).event(E),Z=this.__zoom,L=Math.max(s[0],Math.min(s[1],Z.k*Math.pow(2,n.apply(this,arguments)))),B=pr(E);if(P.wheel)(P.mouse[0][0]!==B[0]||P.mouse[0][1]!==B[1])&&(P.mouse[1]=Z.invert(P.mouse[0]=B)),clearTimeout(P.wheel);else{if(Z.k===L)return;P.mouse=[B,Z.invert(B)],zp(this),P.start()}zh(E),P.wheel=setTimeout(G,S),P.zoom("mouse",i(k(Q(Z,L),P.mouse[0],P.mouse[1]),P.extent,a));function G(){P.wheel=null,P.end()}}function H(E,...X){if(m||!t.apply(this,arguments))return;var P=E.currentTarget,Z=$(this,X,!0).event(E),L=Bn(E.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",K,!0),B=pr(E,P),G=E.clientX,z=E.clientY;iP(E.view),rv(E),Z.mouse=[B,this.__zoom.invert(B)],zp(this),Z.start();function q(ie){if(zh(ie),!Z.moved){var ce=ie.clientX-G,de=ie.clientY-z;Z.moved=ce*ce+de*de>_}Z.event(ie).zoom("mouse",i(k(Z.that.__zoom,Z.mouse[0]=pr(ie,P),Z.mouse[1]),Z.extent,a))}function K(ie){L.on("mousemove.zoom mouseup.zoom",null),nP(ie.view,Z.moved),zh(ie),Z.event(ie).end()}}function ee(E,...X){if(t.apply(this,arguments)){var P=this.__zoom,Z=pr(E.changedTouches?E.changedTouches[0]:E,this),L=P.invert(Z),B=P.k*(E.shiftKey?.5:2),G=i(k(Q(P,B),Z,L),e.apply(this,X),a);zh(E),c>0?Bn(this).transition().duration(c).call(M,G,Z,E):Bn(this).call(x.transform,G,Z,E)}}function I(E,...X){if(t.apply(this,arguments)){var P=E.touches,Z=P.length,L=$(this,X,E.changedTouches.length===Z).event(E),B,G,z,q;for(rv(E),G=0;G<Z;++G)z=P[G],q=pr(z,this),q=[q,this.__zoom.invert(q),z.identifier],L.touch0?!L.touch1&&L.touch0[2]!==q[2]&&(L.touch1=q,L.taps=0):(L.touch0=q,B=!0,L.taps=1+!!f);f&&(f=clearTimeout(f)),B&&(L.taps<2&&(g=q[0],f=setTimeout(function(){f=null},O)),zp(this),L.start())}}function j(E,...X){if(this.__zooming){var P=$(this,X).event(E),Z=E.changedTouches,L=Z.length,B,G,z,q;for(zh(E),B=0;B<L;++B)G=Z[B],z=pr(G,this),P.touch0&&P.touch0[2]===G.identifier?P.touch0[0]=z:P.touch1&&P.touch1[2]===G.identifier&&(P.touch1[0]=z);if(G=P.that.__zoom,P.touch1){var K=P.touch0[0],ie=P.touch0[1],ce=P.touch1[0],de=P.touch1[1],pe=(pe=ce[0]-K[0])*pe+(pe=ce[1]-K[1])*pe,fe=(fe=de[0]-ie[0])*fe+(fe=de[1]-ie[1])*fe;G=Q(G,Math.sqrt(pe/fe)),z=[(K[0]+ce[0])/2,(K[1]+ce[1])/2],q=[(ie[0]+de[0])/2,(ie[1]+de[1])/2]}else if(P.touch0)z=P.touch0[0],q=P.touch0[1];else return;P.zoom("touch",i(k(G,z,q),P.extent,a))}}function D(E,...X){if(this.__zooming){var P=$(this,X).event(E),Z=E.changedTouches,L=Z.length,B,G;for(rv(E),m&&clearTimeout(m),m=setTimeout(function(){m=null},O),B=0;B<L;++B)G=Z[B],P.touch0&&P.touch0[2]===G.identifier?delete P.touch0:P.touch1&&P.touch1[2]===G.identifier&&delete P.touch1;if(P.touch1&&!P.touch0&&(P.touch0=P.touch1,delete P.touch1),P.touch0)P.touch0[1]=this.__zoom.invert(P.touch0[0]);else if(P.end(),P.taps===2&&(G=pr(G,this),Math.hypot(g[0]-G[0],g[1]-G[1])<w)){var z=Bn(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return x.wheelDelta=function(E){return arguments.length?(n=typeof E=="function"?E:Vf(+E),x):n},x.filter=function(E){return arguments.length?(t=typeof E=="function"?E:Vf(!!E),x):t},x.touchable=function(E){return arguments.length?(r=typeof E=="function"?E:Vf(!!E),x):r},x.extent=function(E){return arguments.length?(e=typeof E=="function"?E:Vf([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),x):e},x.scaleExtent=function(E){return arguments.length?(s[0]=+E[0],s[1]=+E[1],x):[s[0],s[1]]},x.translateExtent=function(E){return arguments.length?(a[0][0]=+E[0][0],a[1][0]=+E[1][0],a[0][1]=+E[0][1],a[1][1]=+E[1][1],x):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},x.constrain=function(E){return arguments.length?(i=E,x):i},x.duration=function(E){return arguments.length?(c=+E,x):c},x.interpolate=function(E){return arguments.length?(h=E,x):h},x.on=function(){var E=d.on.apply(d,arguments);return E===d?x:E},x.clickDistance=function(E){return arguments.length?(_=(E=+E)*E,x):Math.sqrt(_)},x.tapDistance=function(E){return arguments.length?(w=+E,x):w},x}const Ur={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:i,targetHandle:n})=>`Couldn't create edge for ${t} handle id: "${t==="source"?i:n}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},wu=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],SP=["Enter"," ","Escape"],bP={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:i})=>`Moved selected node ${t}. New position, x: ${e}, y: ${i}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var mc;(function(t){t.Strict="strict",t.Loose="loose"})(mc||(mc={}));var za;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(za||(za={}));var ku;(function(t){t.Partial="partial",t.Full="full"})(ku||(ku={}));const _P={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Eo;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Eo||(Eo={}));var hg;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(hg||(hg={}));var Re;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Re||(Re={}));const OC={[Re.Left]:Re.Right,[Re.Right]:Re.Left,[Re.Top]:Re.Bottom,[Re.Bottom]:Re.Top};function xP(t){return t===null?null:t?"valid":"invalid"}const wP=t=>"id"in t&&"source"in t&&"target"in t,ML=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),$1=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Ju=(t,e=[0,0])=>{const{width:i,height:n}=Ds(t),r=t.origin??e,s=i*r[0],a=n*r[1];return{x:t.position.x-s,y:t.position.y-a}},zL=(t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const i=t.reduce((n,r)=>{const s=typeof r=="string";let a=!e.nodeLookup&&!s?r:void 0;e.nodeLookup&&(a=s?e.nodeLookup.get(r):$1(r)?r:e.nodeLookup.get(r.id));const c=a?ug(a,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return sm(n,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return om(i)},ed=(t,e={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},n=!1;return t.forEach(r=>{(e.filter===void 0||e.filter(r))&&(i=sm(i,ug(r)),n=!0)}),n?om(i):{x:0,y:0,width:0,height:0}},P1=(t,e,[i,n,r]=[0,0,1],s=!1,a=!1)=>{const c={...id(e,[i,n,r]),width:e.width/r,height:e.height/r},h=[];for(const d of t.values()){const{measured:f,selectable:g=!0,hidden:m=!1}=d;if(a&&!g||m)continue;const O=f.width??d.width??d.initialWidth??null,S=f.height??d.height??d.initialHeight??null,_=Cu(c,vc(d)),w=(O??0)*(S??0),x=s&&_>0;(!d.internals.handleBounds||x||_>=w||d.dragging)&&h.push(d)}return h},jL=(t,e)=>{const i=new Set;return t.forEach(n=>{i.add(n.id)}),e.filter(n=>i.has(n.source)||i.has(n.target))};function DL(t,e){const i=new Map,n=e!=null&&e.nodes?new Set(e.nodes.map(r=>r.id)):null;return t.forEach(r=>{r.measured.width&&r.measured.height&&((e==null?void 0:e.includeHiddenNodes)||!r.hidden)&&(!n||n.has(r.id))&&i.set(r.id,r)}),i}async function BL({nodes:t,width:e,height:i,panZoom:n,minZoom:r,maxZoom:s},a){if(t.size===0)return Promise.resolve(!0);const c=DL(t,a),h=ed(c),d=E1(h,e,i,(a==null?void 0:a.minZoom)??r,(a==null?void 0:a.maxZoom)??s,(a==null?void 0:a.padding)??.1);return await n.setViewport(d,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),Promise.resolve(!0)}function kP({nodeId:t,nextPosition:e,nodeLookup:i,nodeOrigin:n=[0,0],nodeExtent:r,onError:s}){const a=i.get(t),c=a.parentId?i.get(a.parentId):void 0,{x:h,y:d}=c?c.internals.positionAbsolute:{x:0,y:0},f=a.origin??n;let g=a.extent||r;if(a.extent==="parent"&&!a.expandParent)if(!c)s==null||s("005",Ur.error005());else{const O=c.measured.width,S=c.measured.height;O&&S&&(g=[[h,d],[h+O,d+S]])}else c&&yc(a.extent)&&(g=[[a.extent[0][0]+h,a.extent[0][1]+d],[a.extent[1][0]+h,a.extent[1][1]+d]]);const m=yc(g)?Na(e,g,a.measured):e;return(a.measured.width===void 0||a.measured.height===void 0)&&(s==null||s("015",Ur.error015())),{position:{x:m.x-h+(a.measured.width??0)*f[0],y:m.y-d+(a.measured.height??0)*f[1]},positionAbsolute:m}}async function LL({nodesToRemove:t=[],edgesToRemove:e=[],nodes:i,edges:n,onBeforeDelete:r}){const s=new Set(t.map(m=>m.id)),a=[];for(const m of i){if(m.deletable===!1)continue;const O=s.has(m.id),S=!O&&m.parentId&&a.find(_=>_.id===m.parentId);(O||S)&&a.push(m)}const c=new Set(e.map(m=>m.id)),h=n.filter(m=>m.deletable!==!1),f=jL(a,h);for(const m of h)c.has(m.id)&&!f.find(S=>S.id===m.id)&&f.push(m);if(!r)return{edges:f,nodes:a};const g=await r({nodes:a,edges:f});return typeof g=="boolean"?g?{edges:f,nodes:a}:{edges:[],nodes:[]}:g}const Oc=(t,e=0,i=1)=>Math.min(Math.max(t,e),i),Na=(t={x:0,y:0},e,i)=>({x:Oc(t.x,e[0][0],e[1][0]-((i==null?void 0:i.width)??0)),y:Oc(t.y,e[0][1],e[1][1]-((i==null?void 0:i.height)??0))});function CP(t,e,i){const{width:n,height:r}=Ds(i),{x:s,y:a}=i.internals.positionAbsolute;return Na(t,[[s,a],[s+n,a+r]],e)}const vC=(t,e,i)=>t<e?Oc(Math.abs(t-e),1,e)/e:t>i?-Oc(Math.abs(t-i),1,e)/e:0,TP=(t,e,i=15,n=40)=>{const r=vC(t.x,n,e.width-n)*i,s=vC(t.y,n,e.height-n)*i;return[r,s]},sm=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),Py=({x:t,y:e,width:i,height:n})=>({x:t,y:e,x2:t+i,y2:e+n}),om=({x:t,y:e,x2:i,y2:n})=>({x:t,y:e,width:i-t,height:n-e}),vc=(t,e=[0,0])=>{var r,s;const{x:i,y:n}=$1(t)?t.internals.positionAbsolute:Ju(t,e);return{x:i,y:n,width:((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0,height:((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0}},ug=(t,e=[0,0])=>{var r,s;const{x:i,y:n}=$1(t)?t.internals.positionAbsolute:Ju(t,e);return{x:i,y:n,x2:i+(((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0),y2:n+(((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0)}},QP=(t,e)=>om(sm(Py(t),Py(e))),Cu=(t,e)=>{const i=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),n=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(i*n)},yC=t=>Or(t.width)&&Or(t.height)&&Or(t.x)&&Or(t.y),Or=t=>!isNaN(t)&&isFinite(t),XL=(t,e)=>{},td=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),id=({x:t,y:e},[i,n,r],s=!1,a=[1,1])=>{const c={x:(t-i)/r,y:(e-n)/r};return s?td(c,a):c},dg=({x:t,y:e},[i,n,r])=>({x:t*r+i,y:e*r+n});function Nl(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(i)}if(typeof t=="string"&&t.endsWith("%")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(e*i*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function NL(t,e,i){if(typeof t=="string"||typeof t=="number"){const n=Nl(t,i),r=Nl(t,e);return{top:n,right:r,bottom:n,left:r,x:r*2,y:n*2}}if(typeof t=="object"){const n=Nl(t.top??t.y??0,i),r=Nl(t.bottom??t.y??0,i),s=Nl(t.left??t.x??0,e),a=Nl(t.right??t.x??0,e);return{top:n,right:a,bottom:r,left:s,x:s+a,y:n+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function ZL(t,e,i,n,r,s){const{x:a,y:c}=dg(t,[e,i,n]),{x:h,y:d}=dg({x:t.x+t.width,y:t.y+t.height},[e,i,n]),f=r-h,g=s-d;return{left:Math.floor(a),top:Math.floor(c),right:Math.floor(f),bottom:Math.floor(g)}}const E1=(t,e,i,n,r,s)=>{const a=NL(s,e,i),c=(e-a.x)/t.width,h=(i-a.y)/t.height,d=Math.min(c,h),f=Oc(d,n,r),g=t.x+t.width/2,m=t.y+t.height/2,O=e/2-g*f,S=i/2-m*f,_=ZL(t,O,S,f,e,i),w={left:Math.min(_.left-a.left,0),top:Math.min(_.top-a.top,0),right:Math.min(_.right-a.right,0),bottom:Math.min(_.bottom-a.bottom,0)};return{x:O-w.left+w.right,y:S-w.top+w.bottom,zoom:f}},Tu=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function yc(t){return t!=null&&t!=="parent"}function Ds(t){var e,i;return{width:((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth??0,height:((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight??0}}function $P(t){var e,i;return(((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth)!==void 0&&(((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight)!==void 0}function PP(t,e={width:0,height:0},i,n,r){const s={...t},a=n.get(i);if(a){const c=a.origin||r;s.x+=a.internals.positionAbsolute.x-(e.width??0)*c[0],s.y+=a.internals.positionAbsolute.y-(e.height??0)*c[1]}return s}function SC(t,e){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function WL(){let t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}}function qL(t){return{...bP,...t||{}}}function hu(t,{snapGrid:e=[0,0],snapToGrid:i=!1,transform:n,containerBounds:r}){const{x:s,y:a}=vr(t),c=id({x:s-((r==null?void 0:r.left)??0),y:a-((r==null?void 0:r.top)??0)},n),{x:h,y:d}=i?td(c,e):c;return{xSnapped:h,ySnapped:d,...c}}const R1=t=>({width:t.offsetWidth,height:t.offsetHeight}),EP=t=>{var e;return((e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},VL=["INPUT","SELECT","TEXTAREA"];function RP(t){var n,r;const e=((r=(n=t.composedPath)==null?void 0:n.call(t))==null?void 0:r[0])||t.target;return(e==null?void 0:e.nodeType)!==1?!1:VL.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const AP=t=>"clientX"in t,vr=(t,e)=>{var s,a;const i=AP(t),n=i?t.clientX:(s=t.touches)==null?void 0:s[0].clientX,r=i?t.clientY:(a=t.touches)==null?void 0:a[0].clientY;return{x:n-((e==null?void 0:e.left)??0),y:r-((e==null?void 0:e.top)??0)}},bC=(t,e,i,n,r)=>{const s=e.querySelectorAll(`.${t}`);return!s||!s.length?null:Array.from(s).map(a=>{const c=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:t,nodeId:r,position:a.getAttribute("data-handlepos"),x:(c.left-i.left)/n,y:(c.top-i.top)/n,...R1(a)}})};function MP({sourceX:t,sourceY:e,targetX:i,targetY:n,sourceControlX:r,sourceControlY:s,targetControlX:a,targetControlY:c}){const h=t*.125+r*.375+a*.375+i*.125,d=e*.125+s*.375+c*.375+n*.125,f=Math.abs(h-t),g=Math.abs(d-e);return[h,d,f,g]}function If(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function _C({pos:t,x1:e,y1:i,x2:n,y2:r,c:s}){switch(t){case Re.Left:return[e-If(e-n,s),i];case Re.Right:return[e+If(n-e,s),i];case Re.Top:return[e,i-If(i-r,s)];case Re.Bottom:return[e,i+If(r-i,s)]}}function zP({sourceX:t,sourceY:e,sourcePosition:i=Re.Bottom,targetX:n,targetY:r,targetPosition:s=Re.Top,curvature:a=.25}){const[c,h]=_C({pos:i,x1:t,y1:e,x2:n,y2:r,c:a}),[d,f]=_C({pos:s,x1:n,y1:r,x2:t,y2:e,c:a}),[g,m,O,S]=MP({sourceX:t,sourceY:e,targetX:n,targetY:r,sourceControlX:c,sourceControlY:h,targetControlX:d,targetControlY:f});return[`M${t},${e} C${c},${h} ${d},${f} ${n},${r}`,g,m,O,S]}function jP({sourceX:t,sourceY:e,targetX:i,targetY:n}){const r=Math.abs(i-t)/2,s=i<t?i+r:i-r,a=Math.abs(n-e)/2,c=n<e?n+a:n-a;return[s,c,r,a]}function IL({sourceNode:t,targetNode:e,selected:i=!1,zIndex:n=0,elevateOnSelect:r=!1,zIndexMode:s="basic"}){if(s==="manual")return n;const a=r&&i?n+1e3:n,c=Math.max(t.parentId||r&&t.selected?t.internals.z:0,e.parentId||r&&e.selected?e.internals.z:0);return a+c}function YL({sourceNode:t,targetNode:e,width:i,height:n,transform:r}){const s=sm(ug(t),ug(e));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const a={x:-r[0]/r[2],y:-r[1]/r[2],width:i/r[2],height:n/r[2]};return Cu(a,om(s))>0}const HL=({source:t,sourceHandle:e,target:i,targetHandle:n})=>`xy-edge__${t}${e||""}-${i}${n||""}`,UL=(t,e)=>e.some(i=>i.source===t.source&&i.target===t.target&&(i.sourceHandle===t.sourceHandle||!i.sourceHandle&&!t.sourceHandle)&&(i.targetHandle===t.targetHandle||!i.targetHandle&&!t.targetHandle)),GL=(t,e,i={})=>{if(!t.source||!t.target)return e;const n=i.getEdgeId||HL;let r;return wP(t)?r={...t}:r={...t,id:n(t)},UL(r,e)?e:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,e.concat(r))};function DP({sourceX:t,sourceY:e,targetX:i,targetY:n}){const[r,s,a,c]=jP({sourceX:t,sourceY:e,targetX:i,targetY:n});return[`M ${t},${e}L ${i},${n}`,r,s,a,c]}const xC={[Re.Left]:{x:-1,y:0},[Re.Right]:{x:1,y:0},[Re.Top]:{x:0,y:-1},[Re.Bottom]:{x:0,y:1}},FL=({source:t,sourcePosition:e=Re.Bottom,target:i})=>e===Re.Left||e===Re.Right?t.x<i.x?{x:1,y:0}:{x:-1,y:0}:t.y<i.y?{x:0,y:1}:{x:0,y:-1},wC=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function KL({source:t,sourcePosition:e=Re.Bottom,target:i,targetPosition:n=Re.Top,center:r,offset:s,stepPosition:a}){const c=xC[e],h=xC[n],d={x:t.x+c.x*s,y:t.y+c.y*s},f={x:i.x+h.x*s,y:i.y+h.y*s},g=FL({source:d,sourcePosition:e,target:f}),m=g.x!==0?"x":"y",O=g[m];let S=[],_,w;const x={x:0,y:0},Q={x:0,y:0},[,,k,T]=jP({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(c[m]*h[m]===-1){m==="x"?(_=r.x??d.x+(f.x-d.x)*a,w=r.y??(d.y+f.y)/2):(_=r.x??(d.x+f.x)/2,w=r.y??d.y+(f.y-d.y)*a);const V=[{x:_,y:d.y},{x:_,y:f.y}],H=[{x:d.x,y:w},{x:f.x,y:w}];c[m]===O?S=m==="x"?V:H:S=m==="x"?H:V}else{const V=[{x:d.x,y:f.y}],H=[{x:f.x,y:d.y}];if(m==="x"?S=c.x===O?H:V:S=c.y===O?V:H,e===n){const E=Math.abs(t[m]-i[m]);if(E<=s){const X=Math.min(s-1,s-E);c[m]===O?x[m]=(d[m]>t[m]?-1:1)*X:Q[m]=(f[m]>i[m]?-1:1)*X}}if(e!==n){const E=m==="x"?"y":"x",X=c[m]===h[E],P=d[E]>f[E],Z=d[E]<f[E];(c[m]===1&&(!X&&P||X&&Z)||c[m]!==1&&(!X&&Z||X&&P))&&(S=m==="x"?V:H)}const ee={x:d.x+x.x,y:d.y+x.y},I={x:f.x+Q.x,y:f.y+Q.y},j=Math.max(Math.abs(ee.x-S[0].x),Math.abs(I.x-S[0].x)),D=Math.max(Math.abs(ee.y-S[0].y),Math.abs(I.y-S[0].y));j>=D?(_=(ee.x+I.x)/2,w=S[0].y):(_=S[0].x,w=(ee.y+I.y)/2)}const M={x:d.x+x.x,y:d.y+x.y},$={x:f.x+Q.x,y:f.y+Q.y};return[[t,...M.x!==S[0].x||M.y!==S[0].y?[M]:[],...S,...$.x!==S[S.length-1].x||$.y!==S[S.length-1].y?[$]:[],i],_,w,k,T]}function JL(t,e,i,n){const r=Math.min(wC(t,e)/2,wC(e,i)/2,n),{x:s,y:a}=e;if(t.x===s&&s===i.x||t.y===a&&a===i.y)return`L${s} ${a}`;if(t.y===a){const d=t.x<i.x?-1:1,f=t.y<i.y?1:-1;return`L ${s+r*d},${a}Q ${s},${a} ${s},${a+r*f}`}const c=t.x<i.x?1:-1,h=t.y<i.y?-1:1;return`L ${s},${a+r*h}Q ${s},${a} ${s+r*c},${a}`}function Ey({sourceX:t,sourceY:e,sourcePosition:i=Re.Bottom,targetX:n,targetY:r,targetPosition:s=Re.Top,borderRadius:a=5,centerX:c,centerY:h,offset:d=20,stepPosition:f=.5}){const[g,m,O,S,_]=KL({source:{x:t,y:e},sourcePosition:i,target:{x:n,y:r},targetPosition:s,center:{x:c,y:h},offset:d,stepPosition:f});let w=`M${g[0].x} ${g[0].y}`;for(let x=1;x<g.length-1;x++)w+=JL(g[x-1],g[x],g[x+1],a);return w+=`L${g[g.length-1].x} ${g[g.length-1].y}`,[w,m,O,S,_]}function kC(t){var e;return t&&!!(t.internals.handleBounds||(e=t.handles)!=null&&e.length)&&!!(t.measured.width||t.width||t.initialWidth)}function e6(t){var g;const{sourceNode:e,targetNode:i}=t;if(!kC(e)||!kC(i))return null;const n=e.internals.handleBounds||CC(e.handles),r=i.internals.handleBounds||CC(i.handles),s=TC((n==null?void 0:n.source)??[],t.sourceHandle),a=TC(t.connectionMode===mc.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),t.targetHandle);if(!s||!a)return(g=t.onError)==null||g.call(t,"008",Ur.error008(s?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const c=(s==null?void 0:s.position)||Re.Bottom,h=(a==null?void 0:a.position)||Re.Top,d=Za(e,s,c),f=Za(i,a,h);return{sourceX:d.x,sourceY:d.y,targetX:f.x,targetY:f.y,sourcePosition:c,targetPosition:h}}function CC(t){if(!t)return null;const e=[],i=[];for(const n of t)n.width=n.width??1,n.height=n.height??1,n.type==="source"?e.push(n):n.type==="target"&&i.push(n);return{source:e,target:i}}function Za(t,e,i=Re.Left,n=!1){const r=((e==null?void 0:e.x)??0)+t.internals.positionAbsolute.x,s=((e==null?void 0:e.y)??0)+t.internals.positionAbsolute.y,{width:a,height:c}=e??Ds(t);if(n)return{x:r+a/2,y:s+c/2};switch((e==null?void 0:e.position)??i){case Re.Top:return{x:r+a/2,y:s};case Re.Right:return{x:r+a,y:s+c/2};case Re.Bottom:return{x:r+a/2,y:s+c};case Re.Left:return{x:r,y:s+c/2}}}function TC(t,e){return t&&(e?t.find(i=>i.id===e):t[0])||null}function Ry(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(n=>`${n}=${t[n]}`).join("&")}`:""}function t6(t,{id:e,defaultColor:i,defaultMarkerStart:n,defaultMarkerEnd:r}){const s=new Set;return t.reduce((a,c)=>([c.markerStart||n,c.markerEnd||r].forEach(h=>{if(h&&typeof h=="object"){const d=Ry(h,e);s.has(d)||(a.push({id:d,color:h.color||i,...h}),s.add(d))}}),a),[]).sort((a,c)=>a.id.localeCompare(c.id))}const BP=1e3,i6=10,A1={nodeOrigin:[0,0],nodeExtent:wu,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},n6={...A1,checkEquality:!0};function M1(t,e){const i={...t};for(const n in e)e[n]!==void 0&&(i[n]=e[n]);return i}function r6(t,e,i){const n=M1(A1,i);for(const r of t.values())if(r.parentId)j1(r,t,e,n);else{const s=Ju(r,n.nodeOrigin),a=yc(r.extent)?r.extent:n.nodeExtent,c=Na(s,a,Ds(r));r.internals.positionAbsolute=c}}function s6(t,e){if(!t.handles)return t.measured?e==null?void 0:e.internals.handleBounds:void 0;const i=[],n=[];for(const r of t.handles){const s={id:r.id,width:r.width??1,height:r.height??1,nodeId:t.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?i.push(s):r.type==="target"&&n.push(s)}return{source:i,target:n}}function z1(t){return t==="manual"}function Ay(t,e,i,n={}){var f,g;const r=M1(n6,n),s={i:0},a=new Map(e),c=r!=null&&r.elevateNodesOnSelect&&!z1(r.zIndexMode)?BP:0;let h=t.length>0,d=!1;e.clear(),i.clear();for(const m of t){let O=a.get(m.id);if(r.checkEquality&&m===(O==null?void 0:O.internals.userNode))e.set(m.id,O);else{const S=Ju(m,r.nodeOrigin),_=yc(m.extent)?m.extent:r.nodeExtent,w=Na(S,_,Ds(m));O={...r.defaults,...m,measured:{width:(f=m.measured)==null?void 0:f.width,height:(g=m.measured)==null?void 0:g.height},internals:{positionAbsolute:w,handleBounds:s6(m,O),z:LP(m,c,r.zIndexMode),userNode:m}},e.set(m.id,O)}(O.measured===void 0||O.measured.width===void 0||O.measured.height===void 0)&&!O.hidden&&(h=!1),m.parentId&&j1(O,e,i,n,s),d||(d=m.selected??!1)}return{nodesInitialized:h,hasSelectedNodes:d}}function o6(t,e){if(!t.parentId)return;const i=e.get(t.parentId);i?i.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function j1(t,e,i,n,r){const{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:c,zIndexMode:h}=M1(A1,n),d=t.parentId,f=e.get(d);if(!f){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}o6(t,i),r&&!f.parentId&&f.internals.rootParentIndex===void 0&&h==="auto"&&(f.internals.rootParentIndex=++r.i,f.internals.z=f.internals.z+r.i*i6),r&&f.internals.rootParentIndex!==void 0&&(r.i=f.internals.rootParentIndex);const g=s&&!z1(h)?BP:0,{x:m,y:O,z:S}=a6(t,f,a,c,g,h),{positionAbsolute:_}=t.internals,w=m!==_.x||O!==_.y;(w||S!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:w?{x:m,y:O}:_,z:S}})}function LP(t,e,i){const n=Or(t.zIndex)?t.zIndex:0;return z1(i)?n:n+(t.selected?e:0)}function a6(t,e,i,n,r,s){const{x:a,y:c}=e.internals.positionAbsolute,h=Ds(t),d=Ju(t,i),f=yc(t.extent)?Na(d,t.extent,h):d;let g=Na({x:a+f.x,y:c+f.y},n,h);t.extent==="parent"&&(g=CP(g,h,e));const m=LP(t,r,s),O=e.internals.z??0;return{x:g.x,y:g.y,z:O>=m?O+1:m}}function D1(t,e,i,n=[0,0]){var a;const r=[],s=new Map;for(const c of t){const h=e.get(c.parentId);if(!h)continue;const d=((a=s.get(c.parentId))==null?void 0:a.expandedRect)??vc(h),f=QP(d,c.rect);s.set(c.parentId,{expandedRect:f,parent:h})}return s.size>0&&s.forEach(({expandedRect:c,parent:h},d)=>{var k;const f=h.internals.positionAbsolute,g=Ds(h),m=h.origin??n,O=c.x<f.x?Math.round(Math.abs(f.x-c.x)):0,S=c.y<f.y?Math.round(Math.abs(f.y-c.y)):0,_=Math.max(g.width,Math.round(c.width)),w=Math.max(g.height,Math.round(c.height)),x=(_-g.width)*m[0],Q=(w-g.height)*m[1];(O>0||S>0||x||Q)&&(r.push({id:d,type:"position",position:{x:h.position.x-O+x,y:h.position.y-S+Q}}),(k=i.get(d))==null||k.forEach(T=>{t.some(M=>M.id===T.id)||r.push({id:T.id,type:"position",position:{x:T.position.x+O,y:T.position.y+S}})})),(g.width<c.width||g.height<c.height||O||S)&&r.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:_+(O?m[0]*O-x:0),height:w+(S?m[1]*S-Q:0)}})}),r}function l6(t,e,i,n,r,s,a){const c=n==null?void 0:n.querySelector(".xyflow__viewport");let h=!1;if(!c)return{changes:[],updatedInternals:h};const d=[],f=window.getComputedStyle(c),{m22:g}=new window.DOMMatrixReadOnly(f.transform),m=[];for(const O of t.values()){const S=e.get(O.id);if(!S)continue;if(S.hidden){e.set(S.id,{...S,internals:{...S.internals,handleBounds:void 0}}),h=!0;continue}const _=R1(O.nodeElement),w=S.measured.width!==_.width||S.measured.height!==_.height;if(!!(_.width&&_.height&&(w||!S.internals.handleBounds||O.force))){const Q=O.nodeElement.getBoundingClientRect(),k=yc(S.extent)?S.extent:s;let{positionAbsolute:T}=S.internals;S.parentId&&S.extent==="parent"?T=CP(T,_,e.get(S.parentId)):k&&(T=Na(T,k,_));const M={...S,measured:_,internals:{...S.internals,positionAbsolute:T,handleBounds:{source:bC("source",O.nodeElement,Q,g,S.id),target:bC("target",O.nodeElement,Q,g,S.id)}}};e.set(S.id,M),S.parentId&&j1(M,e,i,{nodeOrigin:r,zIndexMode:a}),h=!0,w&&(d.push({id:S.id,type:"dimensions",dimensions:_}),S.expandParent&&S.parentId&&m.push({id:S.id,parentId:S.parentId,rect:vc(M,r)}))}}if(m.length>0){const O=D1(m,e,i,r);d.push(...O)}return{changes:d,updatedInternals:h}}async function c6({delta:t,panZoom:e,transform:i,translateExtent:n,width:r,height:s}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const a=await e.setViewportConstrained({x:i[0]+t.x,y:i[1]+t.y,zoom:i[2]},[[0,0],[r,s]],n),c=!!a&&(a.x!==i[0]||a.y!==i[1]||a.k!==i[2]);return Promise.resolve(c)}function QC(t,e,i,n,r,s){let a=r;const c=n.get(a)||new Map;n.set(a,c.set(i,e)),a=`${r}-${t}`;const h=n.get(a)||new Map;if(n.set(a,h.set(i,e)),s){a=`${r}-${t}-${s}`;const d=n.get(a)||new Map;n.set(a,d.set(i,e))}}function XP(t,e,i){t.clear(),e.clear();for(const n of i){const{source:r,target:s,sourceHandle:a=null,targetHandle:c=null}=n,h={edgeId:n.id,source:r,target:s,sourceHandle:a,targetHandle:c},d=`${r}-${a}--${s}-${c}`,f=`${s}-${c}--${r}-${a}`;QC("source",h,f,t,r,a),QC("target",h,d,t,s,c),e.set(n.id,n)}}function NP(t,e){if(!t.parentId)return!1;const i=e.get(t.parentId);return i?i.selected?!0:NP(i,e):!1}function $C(t,e,i){var r;let n=t;do{if((r=n==null?void 0:n.matches)!=null&&r.call(n,e))return!0;if(n===i)return!1;n=n==null?void 0:n.parentElement}while(n);return!1}function h6(t,e,i,n){const r=new Map;for(const[s,a]of t)if((a.selected||a.id===n)&&(!a.parentId||!NP(a,t))&&(a.draggable||e&&typeof a.draggable>"u")){const c=t.get(s);c&&r.set(s,{id:s,position:c.position||{x:0,y:0},distance:{x:i.x-c.internals.positionAbsolute.x,y:i.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return r}function sv({nodeId:t,dragItems:e,nodeLookup:i,dragging:n=!0}){var a,c,h;const r=[];for(const[d,f]of e){const g=(a=i.get(d))==null?void 0:a.internals.userNode;g&&r.push({...g,position:f.position,dragging:n})}if(!t)return[r[0],r];const s=(c=i.get(t))==null?void 0:c.internals.userNode;return[s?{...s,position:((h=e.get(t))==null?void 0:h.position)||s.position,dragging:n}:r[0],r]}function u6({dragItems:t,snapGrid:e,x:i,y:n}){const r=t.values().next().value;if(!r)return null;const s={x:i-r.distance.x,y:n-r.distance.y},a=td(s,e);return{x:a.x-s.x,y:a.y-s.y}}function d6({onNodeMouseDown:t,getStoreItems:e,onDragStart:i,onDrag:n,onDragStop:r}){let s={x:null,y:null},a=0,c=new Map,h=!1,d={x:0,y:0},f=null,g=!1,m=null,O=!1,S=!1,_=null;function w({noDragClassName:Q,handleSelector:k,domNode:T,isSelectable:M,nodeId:$,nodeClickDistance:R=0}){m=Bn(T);function V({x:j,y:D}){const{nodeLookup:E,nodeExtent:X,snapGrid:P,snapToGrid:Z,nodeOrigin:L,onNodeDrag:B,onSelectionDrag:G,onError:z,updateNodePositions:q}=e();s={x:j,y:D};let K=!1;const ie=c.size>1,ce=ie&&X?Py(ed(c)):null,de=ie&&Z?u6({dragItems:c,snapGrid:P,x:j,y:D}):null;for(const[pe,fe]of c){if(!E.has(pe))continue;let ve={x:j-fe.distance.x,y:D-fe.distance.y};Z&&(ve=de?{x:Math.round(ve.x+de.x),y:Math.round(ve.y+de.y)}:td(ve,P));let De=null;if(ie&&X&&!fe.extent&&ce){const{positionAbsolute:me}=fe.internals,Be=me.x-ce.x+X[0][0],lt=me.x+fe.measured.width-ce.x2+X[1][0],He=me.y-ce.y+X[0][1],Ft=me.y+fe.measured.height-ce.y2+X[1][1];De=[[Be,He],[lt,Ft]]}const{position:Ee,positionAbsolute:ke}=kP({nodeId:pe,nextPosition:ve,nodeLookup:E,nodeExtent:De||X,nodeOrigin:L,onError:z});K=K||fe.position.x!==Ee.x||fe.position.y!==Ee.y,fe.position=Ee,fe.internals.positionAbsolute=ke}if(S=S||K,!!K&&(q(c,!0),_&&(n||B||!$&&G))){const[pe,fe]=sv({nodeId:$,dragItems:c,nodeLookup:E});n==null||n(_,c,pe,fe),B==null||B(_,pe,fe),$||G==null||G(_,fe)}}async function H(){if(!f)return;const{transform:j,panBy:D,autoPanSpeed:E,autoPanOnNodeDrag:X}=e();if(!X){h=!1,cancelAnimationFrame(a);return}const[P,Z]=TP(d,f,E);(P!==0||Z!==0)&&(s.x=(s.x??0)-P/j[2],s.y=(s.y??0)-Z/j[2],await D({x:P,y:Z})&&V(s)),a=requestAnimationFrame(H)}function ee(j){var ie;const{nodeLookup:D,multiSelectionActive:E,nodesDraggable:X,transform:P,snapGrid:Z,snapToGrid:L,selectNodesOnDrag:B,onNodeDragStart:G,onSelectionDragStart:z,unselectNodesAndEdges:q}=e();g=!0,(!B||!M)&&!E&&$&&((ie=D.get($))!=null&&ie.selected||q()),M&&B&&$&&(t==null||t($));const K=hu(j.sourceEvent,{transform:P,snapGrid:Z,snapToGrid:L,containerBounds:f});if(s=K,c=h6(D,X,K,$),c.size>0&&(i||G||!$&&z)){const[ce,de]=sv({nodeId:$,dragItems:c,nodeLookup:D});i==null||i(j.sourceEvent,c,ce,de),G==null||G(j.sourceEvent,ce,de),$||z==null||z(j.sourceEvent,de)}}const I=rP().clickDistance(R).on("start",j=>{const{domNode:D,nodeDragThreshold:E,transform:X,snapGrid:P,snapToGrid:Z}=e();f=(D==null?void 0:D.getBoundingClientRect())||null,O=!1,S=!1,_=j.sourceEvent,E===0&&ee(j),s=hu(j.sourceEvent,{transform:X,snapGrid:P,snapToGrid:Z,containerBounds:f}),d=vr(j.sourceEvent,f)}).on("drag",j=>{const{autoPanOnNodeDrag:D,transform:E,snapGrid:X,snapToGrid:P,nodeDragThreshold:Z,nodeLookup:L}=e(),B=hu(j.sourceEvent,{transform:E,snapGrid:X,snapToGrid:P,containerBounds:f});if(_=j.sourceEvent,(j.sourceEvent.type==="touchmove"&&j.sourceEvent.touches.length>1||$&&!L.has($))&&(O=!0),!O){if(!h&&D&&g&&(h=!0,H()),!g){const G=vr(j.sourceEvent,f),z=G.x-d.x,q=G.y-d.y;Math.sqrt(z*z+q*q)>Z&&ee(j)}(s.x!==B.xSnapped||s.y!==B.ySnapped)&&c&&g&&(d=vr(j.sourceEvent,f),V(B))}}).on("end",j=>{if(!(!g||O)&&(h=!1,g=!1,cancelAnimationFrame(a),c.size>0)){const{nodeLookup:D,updateNodePositions:E,onNodeDragStop:X,onSelectionDragStop:P}=e();if(S&&(E(c,!1),S=!1),r||X||!$&&P){const[Z,L]=sv({nodeId:$,dragItems:c,nodeLookup:D,dragging:!1});r==null||r(j.sourceEvent,c,Z,L),X==null||X(j.sourceEvent,Z,L),$||P==null||P(j.sourceEvent,L)}}}).filter(j=>{const D=j.target;return!j.button&&(!Q||!$C(D,`.${Q}`,T))&&(!k||$C(D,k,T))});m.call(I)}function x(){m==null||m.on(".drag",null)}return{update:w,destroy:x}}function f6(t,e,i){const n=[],r={x:t.x-i,y:t.y-i,width:i*2,height:i*2};for(const s of e.values())Cu(r,vc(s))>0&&n.push(s);return n}const p6=250;function g6(t,e,i,n){var c,h;let r=[],s=1/0;const a=f6(t,i,e+p6);for(const d of a){const f=[...((c=d.internals.handleBounds)==null?void 0:c.source)??[],...((h=d.internals.handleBounds)==null?void 0:h.target)??[]];for(const g of f){if(n.nodeId===g.nodeId&&n.type===g.type&&n.id===g.id)continue;const{x:m,y:O}=Za(d,g,g.position,!0),S=Math.sqrt(Math.pow(m-t.x,2)+Math.pow(O-t.y,2));S>e||(S<s?(r=[{...g,x:m,y:O}],s=S):S===s&&r.push({...g,x:m,y:O}))}}if(!r.length)return null;if(r.length>1){const d=n.type==="source"?"target":"source";return r.find(f=>f.type===d)??r[0]}return r[0]}function ZP(t,e,i,n,r,s=!1){var d,f,g;const a=n.get(t);if(!a)return null;const c=r==="strict"?(d=a.internals.handleBounds)==null?void 0:d[e]:[...((f=a.internals.handleBounds)==null?void 0:f.source)??[],...((g=a.internals.handleBounds)==null?void 0:g.target)??[]],h=(i?c==null?void 0:c.find(m=>m.id===i):c==null?void 0:c[0])??null;return h&&s?{...h,...Za(a,h,h.position,!0)}:h}function WP(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function m6(t,e){let i=null;return e?i=!0:t&&!e&&(i=!1),i}const qP=()=>!0;function O6(t,{connectionMode:e,connectionRadius:i,handleId:n,nodeId:r,edgeUpdaterType:s,isTarget:a,domNode:c,nodeLookup:h,lib:d,autoPanOnConnect:f,flowId:g,panBy:m,cancelConnection:O,onConnectStart:S,onConnect:_,onConnectEnd:w,isValidConnection:x=qP,onReconnectEnd:Q,updateConnection:k,getTransform:T,getFromHandle:M,autoPanSpeed:$,dragThreshold:R=1,handleDomNode:V}){const H=EP(t.target);let ee=0,I;const{x:j,y:D}=vr(t),E=WP(s,V),X=c==null?void 0:c.getBoundingClientRect();let P=!1;if(!X||!E)return;const Z=ZP(r,E,n,h,e);if(!Z)return;let L=vr(t,X),B=!1,G=null,z=!1,q=null;function K(){if(!f||!X)return;const[Ee,ke]=TP(L,X,$);m({x:Ee,y:ke}),ee=requestAnimationFrame(K)}const ie={...Z,nodeId:r,type:E,position:Z.position},ce=h.get(r);let pe={inProgress:!0,isValid:null,from:Za(ce,ie,Re.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:ce,to:L,toHandle:null,toPosition:OC[ie.position],toNode:null,pointer:L};function fe(){P=!0,k(pe),S==null||S(t,{nodeId:r,handleId:n,handleType:E})}R===0&&fe();function ve(Ee){if(!P){const{x:Ft,y:rn}=vr(Ee),qi=Ft-j,_n=rn-D;if(!(qi*qi+_n*_n>R*R))return;fe()}if(!M()||!ie){De(Ee);return}const ke=T();L=vr(Ee,X),I=g6(id(L,ke,!1,[1,1]),i,h,ie),B||(K(),B=!0);const me=VP(Ee,{handle:I,connectionMode:e,fromNodeId:r,fromHandleId:n,fromType:a?"target":"source",isValidConnection:x,doc:H,lib:d,flowId:g,nodeLookup:h});q=me.handleDomNode,G=me.connection,z=m6(!!I,me.isValid);const Be=h.get(r),lt=Be?Za(Be,ie,Re.Left,!0):pe.from,He={...pe,from:lt,isValid:z,to:me.toHandle&&z?dg({x:me.toHandle.x,y:me.toHandle.y},ke):L,toHandle:me.toHandle,toPosition:z&&me.toHandle?me.toHandle.position:OC[ie.position],toNode:me.toHandle?h.get(me.toHandle.nodeId):null,pointer:L};k(He),pe=He}function De(Ee){if(!("touches"in Ee&&Ee.touches.length>0)){if(P){(I||q)&&G&&z&&(_==null||_(G));const{inProgress:ke,...me}=pe,Be={...me,toPosition:pe.toHandle?pe.toPosition:null};w==null||w(Ee,Be),s&&(Q==null||Q(Ee,Be))}O(),cancelAnimationFrame(ee),B=!1,z=!1,G=null,q=null,H.removeEventListener("mousemove",ve),H.removeEventListener("mouseup",De),H.removeEventListener("touchmove",ve),H.removeEventListener("touchend",De)}}H.addEventListener("mousemove",ve),H.addEventListener("mouseup",De),H.addEventListener("touchmove",ve),H.addEventListener("touchend",De)}function VP(t,{handle:e,connectionMode:i,fromNodeId:n,fromHandleId:r,fromType:s,doc:a,lib:c,flowId:h,isValidConnection:d=qP,nodeLookup:f}){const g=s==="target",m=e?a.querySelector(`.${c}-flow__handle[data-id="${h}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:O,y:S}=vr(t),_=a.elementFromPoint(O,S),w=_!=null&&_.classList.contains(`${c}-flow__handle`)?_:m,x={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const Q=WP(void 0,w),k=w.getAttribute("data-nodeid"),T=w.getAttribute("data-handleid"),M=w.classList.contains("connectable"),$=w.classList.contains("connectableend");if(!k||!Q)return x;const R={source:g?k:n,sourceHandle:g?T:r,target:g?n:k,targetHandle:g?r:T};x.connection=R;const H=M&&$&&(i===mc.Strict?g&&Q==="source"||!g&&Q==="target":k!==n||T!==r);x.isValid=H&&d(R),x.toHandle=ZP(k,Q,T,f,i,!0)}return x}const My={onPointerDown:O6,isValid:VP};function v6({domNode:t,panZoom:e,getTransform:i,getViewScale:n}){const r=Bn(t);function s({translateExtent:c,width:h,height:d,zoomStep:f=1,pannable:g=!0,zoomable:m=!0,inversePan:O=!1}){const S=k=>{if(k.sourceEvent.type!=="wheel"||!e)return;const T=i(),M=k.sourceEvent.ctrlKey&&Tu()?10:1,$=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*f,R=T[2]*Math.pow(2,$*M);e.scaleTo(R)};let _=[0,0];const w=k=>{(k.sourceEvent.type==="mousedown"||k.sourceEvent.type==="touchstart")&&(_=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY])},x=k=>{const T=i();if(k.sourceEvent.type!=="mousemove"&&k.sourceEvent.type!=="touchmove"||!e)return;const M=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],$=[M[0]-_[0],M[1]-_[1]];_=M;const R=n()*Math.max(T[2],Math.log(T[2]))*(O?-1:1),V={x:T[0]-$[0]*R,y:T[1]-$[1]*R},H=[[0,0],[h,d]];e.setViewportConstrained({x:V.x,y:V.y,zoom:T[2]},H,c)},Q=yP().on("start",w).on("zoom",g?x:null).on("zoom.wheel",m?S:null);r.call(Q,{})}function a(){r.on("zoom",null)}return{update:s,destroy:a,pointer:pr}}const am=t=>({x:t.x,y:t.y,zoom:t.k}),ov=({x:t,y:e,zoom:i})=>rm.translate(t,e).scale(i),Gl=(t,e)=>t.target.closest(`.${e}`),IP=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),y6=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,av=(t,e=0,i=y6,n=()=>{})=>{const r=typeof e=="number"&&e>0;return r||n(),r?t.transition().duration(e).ease(i).on("end",n):t},YP=t=>{const e=t.ctrlKey&&Tu()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function S6({zoomPanValues:t,noWheelClassName:e,d3Selection:i,d3Zoom:n,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:c,onPanZoom:h,onPanZoomEnd:d}){return f=>{if(Gl(f,e))return f.ctrlKey&&f.preventDefault(),!1;f.preventDefault(),f.stopImmediatePropagation();const g=i.property("__zoom").k||1;if(f.ctrlKey&&a){const w=pr(f),x=YP(f),Q=g*Math.pow(2,x);n.scaleTo(i,Q,w,f);return}const m=f.deltaMode===1?20:1;let O=r===za.Vertical?0:f.deltaX*m,S=r===za.Horizontal?0:f.deltaY*m;!Tu()&&f.shiftKey&&r!==za.Vertical&&(O=f.deltaY*m,S=0),n.translateBy(i,-(O/g)*s,-(S/g)*s,{internal:!0});const _=am(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(h==null||h(f,_),t.panScrollTimeout=setTimeout(()=>{d==null||d(f,_),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,c==null||c(f,_))}}function b6({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:i}){return function(n,r){const s=n.type==="wheel",a=!e&&s&&!n.ctrlKey,c=Gl(n,t);if(n.ctrlKey&&s&&c&&n.preventDefault(),a||c)return null;n.preventDefault(),i.call(this,n,r)}}function _6({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:i}){return n=>{var s,a,c;if((s=n.sourceEvent)!=null&&s.internal)return;const r=am(n.transform);t.mouseButton=((a=n.sourceEvent)==null?void 0:a.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=r,((c=n.sourceEvent)==null?void 0:c.type)==="mousedown"&&e(!0),i&&(i==null||i(n.sourceEvent,r))}}function x6({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:i,onTransformChange:n,onPanZoom:r}){return s=>{var a,c;t.usedRightMouseButton=!!(i&&IP(e,t.mouseButton??0)),(a=s.sourceEvent)!=null&&a.sync||n([s.transform.x,s.transform.y,s.transform.k]),r&&!((c=s.sourceEvent)!=null&&c.internal)&&(r==null||r(s.sourceEvent,am(s.transform)))}}function w6({zoomPanValues:t,panOnDrag:e,panOnScroll:i,onDraggingChange:n,onPanZoomEnd:r,onPaneContextMenu:s}){return a=>{var c;if(!((c=a.sourceEvent)!=null&&c.internal)&&(t.isZoomingOrPanning=!1,s&&IP(e,t.mouseButton??0)&&!t.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),t.usedRightMouseButton=!1,n(!1),r)){const h=am(a.transform);t.prevViewport=h,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{r==null||r(a.sourceEvent,h)},i?150:0)}}}function k6({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:i,panOnDrag:n,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:c,noPanClassName:h,lib:d,connectionInProgress:f}){return g=>{var w;const m=t||e,O=i&&g.ctrlKey,S=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Gl(g,`${d}-flow__node`)||Gl(g,`${d}-flow__edge`)))return!0;if(!n&&!m&&!r&&!s&&!i||a||f&&!S||Gl(g,c)&&S||Gl(g,h)&&(!S||r&&S&&!t)||!i&&g.ctrlKey&&S)return!1;if(!i&&g.type==="touchstart"&&((w=g.touches)==null?void 0:w.length)>1)return g.preventDefault(),!1;if(!m&&!r&&!O&&S||!n&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(n)&&!n.includes(g.button)&&g.type==="mousedown")return!1;const _=Array.isArray(n)&&n.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||S)&&_}}function C6({domNode:t,minZoom:e,maxZoom:i,translateExtent:n,viewport:r,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:h}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=t.getBoundingClientRect(),g=yP().scaleExtent([e,i]).translateExtent(n),m=Bn(t).call(g);Q({x:r.x,y:r.y,zoom:Oc(r.zoom,e,i)},[[0,0],[f.width,f.height]],n);const O=m.on("wheel.zoom"),S=m.on("dblclick.zoom");g.wheelDelta(YP);function _(I,j){return m?new Promise(D=>{g==null||g.interpolate((j==null?void 0:j.interpolate)==="linear"?cu:Rp).transform(av(m,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>D(!0)),I)}):Promise.resolve(!1)}function w({noWheelClassName:I,noPanClassName:j,onPaneContextMenu:D,userSelectionActive:E,panOnScroll:X,panOnDrag:P,panOnScrollMode:Z,panOnScrollSpeed:L,preventScrolling:B,zoomOnPinch:G,zoomOnScroll:z,zoomOnDoubleClick:q,zoomActivationKeyPressed:K,lib:ie,onTransformChange:ce,connectionInProgress:de,paneClickDistance:pe,selectionOnDrag:fe}){E&&!d.isZoomingOrPanning&&x();const ve=X&&!K&&!E;g.clickDistance(fe?1/0:!Or(pe)||pe<0?0:pe);const De=ve?S6({zoomPanValues:d,noWheelClassName:I,d3Selection:m,d3Zoom:g,panOnScrollMode:Z,panOnScrollSpeed:L,zoomOnPinch:G,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:c}):b6({noWheelClassName:I,preventScrolling:B,d3ZoomHandler:O});if(m.on("wheel.zoom",De,{passive:!1}),!E){const ke=_6({zoomPanValues:d,onDraggingChange:h,onPanZoomStart:a});g.on("start",ke);const me=x6({zoomPanValues:d,panOnDrag:P,onPaneContextMenu:!!D,onPanZoom:s,onTransformChange:ce});g.on("zoom",me);const Be=w6({zoomPanValues:d,panOnDrag:P,panOnScroll:X,onPaneContextMenu:D,onPanZoomEnd:c,onDraggingChange:h});g.on("end",Be)}const Ee=k6({zoomActivationKeyPressed:K,panOnDrag:P,zoomOnScroll:z,panOnScroll:X,zoomOnDoubleClick:q,zoomOnPinch:G,userSelectionActive:E,noPanClassName:j,noWheelClassName:I,lib:ie,connectionInProgress:de});g.filter(Ee),q?m.on("dblclick.zoom",S):m.on("dblclick.zoom",null)}function x(){g.on("zoom",null)}async function Q(I,j,D){const E=ov(I),X=g==null?void 0:g.constrain()(E,j,D);return X&&await _(X),new Promise(P=>P(X))}async function k(I,j){const D=ov(I);return await _(D,j),new Promise(E=>E(D))}function T(I){if(m){const j=ov(I),D=m.property("__zoom");(D.k!==I.zoom||D.x!==I.x||D.y!==I.y)&&(g==null||g.transform(m,j,null,{sync:!0}))}}function M(){const I=m?vP(m.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function $(I,j){return m?new Promise(D=>{g==null||g.interpolate((j==null?void 0:j.interpolate)==="linear"?cu:Rp).scaleTo(av(m,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>D(!0)),I)}):Promise.resolve(!1)}function R(I,j){return m?new Promise(D=>{g==null||g.interpolate((j==null?void 0:j.interpolate)==="linear"?cu:Rp).scaleBy(av(m,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>D(!0)),I)}):Promise.resolve(!1)}function V(I){g==null||g.scaleExtent(I)}function H(I){g==null||g.translateExtent(I)}function ee(I){const j=!Or(I)||I<0?0:I;g==null||g.clickDistance(j)}return{update:w,destroy:x,setViewport:k,setViewportConstrained:Q,getViewport:M,scaleTo:$,scaleBy:R,setScaleExtent:V,setTranslateExtent:H,syncViewport:T,setClickDistance:ee}}var Sc;(function(t){t.Line="line",t.Handle="handle"})(Sc||(Sc={}));function T6({width:t,prevWidth:e,height:i,prevHeight:n,affectsX:r,affectsY:s}){const a=t-e,c=i-n,h=[a>0?1:a<0?-1:0,c>0?1:c<0?-1:0];return a&&r&&(h[0]=h[0]*-1),c&&s&&(h[1]=h[1]*-1),h}function PC(t){const e=t.includes("right")||t.includes("left"),i=t.includes("bottom")||t.includes("top"),n=t.includes("left"),r=t.includes("top");return{isHorizontal:e,isVertical:i,affectsX:n,affectsY:r}}function vo(t,e){return Math.max(0,e-t)}function yo(t,e){return Math.max(0,t-e)}function Yf(t,e,i){return Math.max(0,e-t,t-i)}function EC(t,e){return t?!e:e}function Q6(t,e,i,n,r,s,a,c){let{affectsX:h,affectsY:d}=e;const{isHorizontal:f,isVertical:g}=e,m=f&&g,{xSnapped:O,ySnapped:S}=i,{minWidth:_,maxWidth:w,minHeight:x,maxHeight:Q}=n,{x:k,y:T,width:M,height:$,aspectRatio:R}=t;let V=Math.floor(f?O-t.pointerX:0),H=Math.floor(g?S-t.pointerY:0);const ee=M+(h?-V:V),I=$+(d?-H:H),j=-s[0]*M,D=-s[1]*$;let E=Yf(ee,_,w),X=Yf(I,x,Q);if(a){let L=0,B=0;h&&V<0?L=vo(k+V+j,a[0][0]):!h&&V>0&&(L=yo(k+ee+j,a[1][0])),d&&H<0?B=vo(T+H+D,a[0][1]):!d&&H>0&&(B=yo(T+I+D,a[1][1])),E=Math.max(E,L),X=Math.max(X,B)}if(c){let L=0,B=0;h&&V>0?L=yo(k+V,c[0][0]):!h&&V<0&&(L=vo(k+ee,c[1][0])),d&&H>0?B=yo(T+H,c[0][1]):!d&&H<0&&(B=vo(T+I,c[1][1])),E=Math.max(E,L),X=Math.max(X,B)}if(r){if(f){const L=Yf(ee/R,x,Q)*R;if(E=Math.max(E,L),a){let B=0;!h&&!d||h&&!d&&m?B=yo(T+D+ee/R,a[1][1])*R:B=vo(T+D+(h?V:-V)/R,a[0][1])*R,E=Math.max(E,B)}if(c){let B=0;!h&&!d||h&&!d&&m?B=vo(T+ee/R,c[1][1])*R:B=yo(T+(h?V:-V)/R,c[0][1])*R,E=Math.max(E,B)}}if(g){const L=Yf(I*R,_,w)/R;if(X=Math.max(X,L),a){let B=0;!h&&!d||d&&!h&&m?B=yo(k+I*R+j,a[1][0])/R:B=vo(k+(d?H:-H)*R+j,a[0][0])/R,X=Math.max(X,B)}if(c){let B=0;!h&&!d||d&&!h&&m?B=vo(k+I*R,c[1][0])/R:B=yo(k+(d?H:-H)*R,c[0][0])/R,X=Math.max(X,B)}}}H=H+(H<0?X:-X),V=V+(V<0?E:-E),r&&(m?ee>I*R?H=(EC(h,d)?-V:V)/R:V=(EC(h,d)?-H:H)*R:f?(H=V/R,d=h):(V=H*R,h=d));const P=h?k+V:k,Z=d?T+H:T;return{width:M+(h?-V:V),height:$+(d?-H:H),x:s[0]*V*(h?-1:1)+P,y:s[1]*H*(d?-1:1)+Z}}const HP={width:0,height:0,x:0,y:0},$6={...HP,pointerX:0,pointerY:0,aspectRatio:1};function P6(t){return[[0,0],[t.measured.width,t.measured.height]]}function E6(t,e,i){const n=e.position.x+t.position.x,r=e.position.y+t.position.y,s=t.measured.width??0,a=t.measured.height??0,c=i[0]*s,h=i[1]*a;return[[n-c,r-h],[n+s-c,r+a-h]]}function R6({domNode:t,nodeId:e,getStoreItems:i,onChange:n,onEnd:r}){const s=Bn(t);let a={controlDirection:PC("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:d,boundaries:f,keepAspectRatio:g,resizeDirection:m,onResizeStart:O,onResize:S,onResizeEnd:_,shouldResize:w}){let x={...HP},Q={...$6};a={boundaries:f,resizeDirection:m,keepAspectRatio:g,controlDirection:PC(d)};let k,T=null,M=[],$,R,V,H=!1;const ee=rP().on("start",I=>{const{nodeLookup:j,transform:D,snapGrid:E,snapToGrid:X,nodeOrigin:P,paneDomNode:Z}=i();if(k=j.get(e),!k)return;T=(Z==null?void 0:Z.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:B}=hu(I.sourceEvent,{transform:D,snapGrid:E,snapToGrid:X,containerBounds:T});x={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},Q={...x,pointerX:L,pointerY:B,aspectRatio:x.width/x.height},$=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&($=j.get(k.parentId),R=$&&k.extent==="parent"?P6($):void 0),M=[],V=void 0;for(const[G,z]of j)if(z.parentId===e&&(M.push({id:G,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const q=E6(z,k,z.origin??P);V?V=[[Math.min(q[0][0],V[0][0]),Math.min(q[0][1],V[0][1])],[Math.max(q[1][0],V[1][0]),Math.max(q[1][1],V[1][1])]]:V=q}O==null||O(I,{...x})}).on("drag",I=>{const{transform:j,snapGrid:D,snapToGrid:E,nodeOrigin:X}=i(),P=hu(I.sourceEvent,{transform:j,snapGrid:D,snapToGrid:E,containerBounds:T}),Z=[];if(!k)return;const{x:L,y:B,width:G,height:z}=x,q={},K=k.origin??X,{width:ie,height:ce,x:de,y:pe}=Q6(Q,a.controlDirection,P,a.boundaries,a.keepAspectRatio,K,R,V),fe=ie!==G,ve=ce!==z,De=de!==L&&fe,Ee=pe!==B&&ve;if(!De&&!Ee&&!fe&&!ve)return;if((De||Ee||K[0]===1||K[1]===1)&&(q.x=De?de:x.x,q.y=Ee?pe:x.y,x.x=q.x,x.y=q.y,M.length>0)){const lt=de-L,He=pe-B;for(const Ft of M)Ft.position={x:Ft.position.x-lt+K[0]*(ie-G),y:Ft.position.y-He+K[1]*(ce-z)},Z.push(Ft)}if((fe||ve)&&(q.width=fe&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ie:x.width,q.height=ve&&(!a.resizeDirection||a.resizeDirection==="vertical")?ce:x.height,x.width=q.width,x.height=q.height),$&&k.expandParent){const lt=K[0]*(q.width??0);q.x&&q.x<lt&&(x.x=lt,Q.x=Q.x-(q.x-lt));const He=K[1]*(q.height??0);q.y&&q.y<He&&(x.y=He,Q.y=Q.y-(q.y-He))}const ke=T6({width:x.width,prevWidth:G,height:x.height,prevHeight:z,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),me={...x,direction:ke};(w==null?void 0:w(I,me))!==!1&&(H=!0,S==null||S(I,me),n(q,Z))}).on("end",I=>{H&&(_==null||_(I,{...x}),r==null||r({...x}),H=!1)});s.call(ee)}function h(){s.on(".drag",null)}return{update:c,destroy:h}}var lv={exports:{}},cv={},hv={exports:{}},uv={};/**
48
+ `+p.stack}}var qi=Object.prototype.hasOwnProperty,_n=t.unstable_scheduleCallback,ar=t.unstable_cancelCallback,oe=t.unstable_shouldYield,We=t.unstable_requestPaint,Le=t.unstable_now,sn=t.unstable_getCurrentPriorityLevel,on=t.unstable_ImmediatePriority,Vi=t.unstable_UserBlockingPriority,Go=t.unstable_NormalPriority,Rm=t.unstable_LowPriority,tl=t.unstable_IdlePriority,Am=t.log,Mm=t.unstable_setDisableYieldValue,Fo=null,Ii=null;function wr(o){if(typeof Am=="function"&&Mm(o),Ii&&typeof Ii.setStrictMode=="function")try{Ii.setStrictMode(Fo,o)}catch{}}var Yi=Math.clz32?Math.clz32:Dm,zm=Math.log,jm=Math.LN2;function Dm(o){return o>>>=0,o===0?32:31-(zm(o)/jm|0)|0}var il=256,nl=262144,rl=4194304;function Kr(o){var l=o&42;if(l!==0)return l;switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function sl(o,l,u){var p=o.pendingLanes;if(p===0)return 0;var y=0,b=o.suspendedLanes,C=o.pingedLanes;o=o.warmLanes;var A=p&134217727;return A!==0?(p=A&~b,p!==0?y=Kr(p):(C&=A,C!==0?y=Kr(C):u||(u=A&~o,u!==0&&(y=Kr(u))))):(A=p&~b,A!==0?y=Kr(A):C!==0?y=Kr(C):u||(u=p&~o,u!==0&&(y=Kr(u)))),y===0?0:l!==0&&l!==y&&(l&b)===0&&(b=y&-y,u=l&-l,b>=u||b===32&&(u&4194048)!==0)?l:y}function Ko(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function Bm(o,l){switch(o){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Od(){var o=rl;return rl<<=1,(rl&62914560)===0&&(rl=4194304),o}function Lc(o){for(var l=[],u=0;31>u;u++)l.push(o);return l}function Jo(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Lm(o,l,u,p,y,b){var C=o.pendingLanes;o.pendingLanes=u,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=u,o.entangledLanes&=u,o.errorRecoveryDisabledLanes&=u,o.shellSuspendCounter=0;var A=o.entanglements,Y=o.expirationTimes,te=o.hiddenUpdates;for(u=C&~u;0<u;){var se=31-Yi(u),he=1<<se;A[se]=0,Y[se]=-1;var ne=te[se];if(ne!==null)for(te[se]=null,se=0;se<ne.length;se++){var re=ne[se];re!==null&&(re.lane&=-536870913)}u&=~he}p!==0&&vd(o,p,0),b!==0&&y===0&&o.tag!==0&&(o.suspendedLanes|=b&~(C&~l))}function vd(o,l,u){o.pendingLanes|=l,o.suspendedLanes&=~l;var p=31-Yi(l);o.entangledLanes|=l,o.entanglements[p]=o.entanglements[p]|1073741824|u&261930}function yd(o,l){var u=o.entangledLanes|=l;for(o=o.entanglements;u;){var p=31-Yi(u),y=1<<p;y&l|o[p]&l&&(o[p]|=l),u&=~y}}function Sd(o,l){var u=l&-l;return u=(u&42)!==0?1:Xc(u),(u&(o.suspendedLanes|l))!==0?0:u}function Xc(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function Nc(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function bd(){var o=Z.p;return o!==0?o:(o=window.event,o===void 0?32:zk(o.type))}function _d(o,l){var u=Z.p;try{return Z.p=o,l()}finally{Z.p=u}}var kr=Math.random().toString(36).slice(2),li="__reactFiber$"+kr,Di="__reactProps$"+kr,Jr="__reactContainer$"+kr,ol="__reactEvents$"+kr,xd="__reactListeners$"+kr,Xm="__reactHandles$"+kr,wd="__reactResources$"+kr,ea="__reactMarker$"+kr;function Zc(o){delete o[li],delete o[Di],delete o[ol],delete o[xd],delete o[Xm]}function Zs(o){var l=o[li];if(l)return l;for(var u=o.parentNode;u;){if(l=u[Jr]||u[li]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(o=yk(o);o!==null;){if(u=o[li])return u;o=yk(o)}return l}o=u,u=o.parentNode}return null}function Ws(o){if(o=o[li]||o[Jr]){var l=o.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return o}return null}function qs(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(n(33))}function Vs(o){var l=o[wd];return l||(l=o[wd]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Kt(o){o[ea]=!0}var kd=new Set,Cd={};function es(o,l){Is(o,l),Is(o+"Capture",l)}function Is(o,l){for(Cd[o]=l,o=0;o<l.length;o++)kd.add(l[o])}var Nm=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Wc={},Td={};function Zm(o){return qi.call(Td,o)?!0:qi.call(Wc,o)?!1:Nm.test(o)?Td[o]=!0:(Wc[o]=!0,!1)}function al(o,l,u){if(Zm(l))if(u===null)o.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":o.removeAttribute(l);return;case"boolean":var p=l.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){o.removeAttribute(l);return}}o.setAttribute(l,""+u)}}function ll(o,l,u){if(u===null)o.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(l);return}o.setAttribute(l,""+u)}}function lr(o,l,u,p){if(p===null)o.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(u);return}o.setAttributeNS(l,u,""+p)}}function an(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Qd(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Wm(o,l,u){var p=Object.getOwnPropertyDescriptor(o.constructor.prototype,l);if(!o.hasOwnProperty(l)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var y=p.get,b=p.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return y.call(this)},set:function(C){u=""+C,b.call(this,C)}}),Object.defineProperty(o,l,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(C){u=""+C},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function Ys(o){if(!o._valueTracker){var l=Qd(o)?"checked":"value";o._valueTracker=Wm(o,l,""+o[l])}}function $d(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var u=l.getValue(),p="";return o&&(p=Qd(o)?o.checked?"true":"false":o.value),o=p,o!==u?(l.setValue(o),!0):!1}function ta(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var qm=/[\n"\\]/g;function ln(o){return o.replace(qm,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function ia(o,l,u,p,y,b,C,A){o.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?o.type=C:o.removeAttribute("type"),l!=null?C==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+an(l)):o.value!==""+an(l)&&(o.value=""+an(l)):C!=="submit"&&C!=="reset"||o.removeAttribute("value"),l!=null?qc(o,C,an(l)):u!=null?qc(o,C,an(u)):p!=null&&o.removeAttribute("value"),y==null&&b!=null&&(o.defaultChecked=!!b),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?o.name=""+an(A):o.removeAttribute("name")}function Pd(o,l,u,p,y,b,C,A){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(o.type=b),l!=null||u!=null){if(!(b!=="submit"&&b!=="reset"||l!=null)){Ys(o);return}u=u!=null?""+an(u):"",l=l!=null?""+an(l):u,A||l===o.value||(o.value=l),o.defaultValue=l}p=p??y,p=typeof p!="function"&&typeof p!="symbol"&&!!p,o.checked=A?o.checked:!!p,o.defaultChecked=!!p,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(o.name=C),Ys(o)}function qc(o,l,u){l==="number"&&ta(o.ownerDocument)===o||o.defaultValue===""+u||(o.defaultValue=""+u)}function ts(o,l,u,p){if(o=o.options,l){l={};for(var y=0;y<u.length;y++)l["$"+u[y]]=!0;for(u=0;u<o.length;u++)y=l.hasOwnProperty("$"+o[u].value),o[u].selected!==y&&(o[u].selected=y),y&&p&&(o[u].defaultSelected=!0)}else{for(u=""+an(u),l=null,y=0;y<o.length;y++){if(o[y].value===u){o[y].selected=!0,p&&(o[y].defaultSelected=!0);return}l!==null||o[y].disabled||(l=o[y])}l!==null&&(l.selected=!0)}}function o_(o,l,u){if(l!=null&&(l=""+an(l),l!==o.value&&(o.value=l),u==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=u!=null?""+an(u):""}function a_(o,l,u,p){if(l==null){if(p!=null){if(u!=null)throw Error(n(92));if(X(p)){if(1<p.length)throw Error(n(93));p=p[0]}u=p}u==null&&(u=""),l=u}u=an(l),o.defaultValue=u,p=o.textContent,p===u&&p!==""&&p!==null&&(o.value=p),Ys(o)}function cl(o,l){if(l){var u=o.firstChild;if(u&&u===o.lastChild&&u.nodeType===3){u.nodeValue=l;return}}o.textContent=l}var jz=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function l_(o,l,u){var p=l.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?o.setProperty(l,""):l==="float"?o.cssFloat="":o[l]="":p?o.setProperty(l,u):typeof u!="number"||u===0||jz.has(l)?l==="float"?o.cssFloat=u:o[l]=(""+u).trim():o[l]=u+"px"}function c_(o,l,u){if(l!=null&&typeof l!="object")throw Error(n(62));if(o=o.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||l!=null&&l.hasOwnProperty(p)||(p.indexOf("--")===0?o.setProperty(p,""):p==="float"?o.cssFloat="":o[p]="");for(var y in l)p=l[y],l.hasOwnProperty(y)&&u[y]!==p&&l_(o,y,p)}else for(var b in l)l.hasOwnProperty(b)&&l_(o,b,l[b])}function Vm(o){if(o.indexOf("-")===-1)return!1;switch(o){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 Dz=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Bz=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ed(o){return Bz.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function is(){}var Im=null;function Ym(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var hl=null,ul=null;function h_(o){var l=Ws(o);if(l&&(o=l.stateNode)){var u=o[Di]||null;e:switch(o=l.stateNode,l.type){case"input":if(ia(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),l=u.name,u.type==="radio"&&l!=null){for(u=o;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+ln(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var p=u[l];if(p!==o&&p.form===o.form){var y=p[Di]||null;if(!y)throw Error(n(90));ia(p,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(l=0;l<u.length;l++)p=u[l],p.form===o.form&&$d(p)}break e;case"textarea":o_(o,u.value,u.defaultValue);break e;case"select":l=u.value,l!=null&&ts(o,!!u.multiple,l,!1)}}}var Hm=!1;function u_(o,l,u){if(Hm)return o(l,u);Hm=!0;try{var p=o(l);return p}finally{if(Hm=!1,(hl!==null||ul!==null)&&(yf(),hl&&(l=hl,o=ul,ul=hl=null,h_(l),o)))for(l=0;l<o.length;l++)h_(o[l])}}function Vc(o,l){var u=o.stateNode;if(u===null)return null;var p=u[Di]||null;if(p===null)return null;u=p[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(o=o.type,p=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!p;break e;default:o=!1}if(o)return null;if(u&&typeof u!="function")throw Error(n(231,l,typeof u));return u}var ns=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Um=!1;if(ns)try{var Ic={};Object.defineProperty(Ic,"passive",{get:function(){Um=!0}}),window.addEventListener("test",Ic,Ic),window.removeEventListener("test",Ic,Ic)}catch{Um=!1}var Hs=null,Gm=null,Rd=null;function d_(){if(Rd)return Rd;var o,l=Gm,u=l.length,p,y="value"in Hs?Hs.value:Hs.textContent,b=y.length;for(o=0;o<u&&l[o]===y[o];o++);var C=u-o;for(p=1;p<=C&&l[u-p]===y[b-p];p++);return Rd=y.slice(o,1<p?1-p:void 0)}function Ad(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function Md(){return!0}function f_(){return!1}function cn(o){function l(u,p,y,b,C){this._reactName=u,this._targetInst=y,this.type=p,this.nativeEvent=b,this.target=C,this.currentTarget=null;for(var A in o)o.hasOwnProperty(A)&&(u=o[A],this[A]=u?u(b):b[A]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Md:f_,this.isPropagationStopped=f_,this}return g(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Md)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Md)},persist:function(){},isPersistent:Md}),l}var na={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zd=cn(na),Yc=g({},na,{view:0,detail:0}),Lz=cn(Yc),Fm,Km,Hc,jd=g({},Yc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:eO,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Hc&&(Hc&&o.type==="mousemove"?(Fm=o.screenX-Hc.screenX,Km=o.screenY-Hc.screenY):Km=Fm=0,Hc=o),Fm)},movementY:function(o){return"movementY"in o?o.movementY:Km}}),p_=cn(jd),Xz=g({},jd,{dataTransfer:0}),Nz=cn(Xz),Zz=g({},Yc,{relatedTarget:0}),Jm=cn(Zz),Wz=g({},na,{animationName:0,elapsedTime:0,pseudoElement:0}),qz=cn(Wz),Vz=g({},na,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),Iz=cn(Vz),Yz=g({},na,{data:0}),g_=cn(Yz),Hz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Uz={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"},Gz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fz(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=Gz[o])?!!l[o]:!1}function eO(){return Fz}var Kz=g({},Yc,{key:function(o){if(o.key){var l=Hz[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=Ad(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?Uz[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:eO,charCode:function(o){return o.type==="keypress"?Ad(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Ad(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),Jz=cn(Kz),ej=g({},jd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),m_=cn(ej),tj=g({},Yc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:eO}),ij=cn(tj),nj=g({},na,{propertyName:0,elapsedTime:0,pseudoElement:0}),rj=cn(nj),sj=g({},jd,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),oj=cn(sj),aj=g({},na,{newState:0,oldState:0}),lj=cn(aj),cj=[9,13,27,32],tO=ns&&"CompositionEvent"in window,Uc=null;ns&&"documentMode"in document&&(Uc=document.documentMode);var hj=ns&&"TextEvent"in window&&!Uc,O_=ns&&(!tO||Uc&&8<Uc&&11>=Uc),v_=" ",y_=!1;function S_(o,l){switch(o){case"keyup":return cj.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function b_(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var dl=!1;function uj(o,l){switch(o){case"compositionend":return b_(l);case"keypress":return l.which!==32?null:(y_=!0,v_);case"textInput":return o=l.data,o===v_&&y_?null:o;default:return null}}function dj(o,l){if(dl)return o==="compositionend"||!tO&&S_(o,l)?(o=d_(),Rd=Gm=Hs=null,dl=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return O_&&l.locale!=="ko"?null:l.data;default:return null}}var fj={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 __(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!fj[o.type]:l==="textarea"}function x_(o,l,u,p){hl?ul?ul.push(p):ul=[p]:hl=p,l=Cf(l,"onChange"),0<l.length&&(u=new zd("onChange","change",null,u,p),o.push({event:u,listeners:l}))}var Gc=null,Fc=null;function pj(o){sk(o,0)}function Dd(o){var l=qs(o);if($d(l))return o}function w_(o,l){if(o==="change")return l}var k_=!1;if(ns){var iO;if(ns){var nO="oninput"in document;if(!nO){var C_=document.createElement("div");C_.setAttribute("oninput","return;"),nO=typeof C_.oninput=="function"}iO=nO}else iO=!1;k_=iO&&(!document.documentMode||9<document.documentMode)}function T_(){Gc&&(Gc.detachEvent("onpropertychange",Q_),Fc=Gc=null)}function Q_(o){if(o.propertyName==="value"&&Dd(Fc)){var l=[];x_(l,Fc,o,Ym(o)),u_(pj,l)}}function gj(o,l,u){o==="focusin"?(T_(),Gc=l,Fc=u,Gc.attachEvent("onpropertychange",Q_)):o==="focusout"&&T_()}function mj(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Dd(Fc)}function Oj(o,l){if(o==="click")return Dd(l)}function vj(o,l){if(o==="input"||o==="change")return Dd(l)}function yj(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var xn=typeof Object.is=="function"?Object.is:yj;function Kc(o,l){if(xn(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var u=Object.keys(o),p=Object.keys(l);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var y=u[p];if(!qi.call(l,y)||!xn(o[y],l[y]))return!1}return!0}function $_(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function P_(o,l){var u=$_(o);o=0;for(var p;u;){if(u.nodeType===3){if(p=o+u.textContent.length,o<=l&&p>=l)return{node:u,offset:l-o};o=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=$_(u)}}function E_(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?E_(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function R_(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=ta(o.document);l instanceof o.HTMLIFrameElement;){try{var u=typeof l.contentWindow.location.href=="string"}catch{u=!1}if(u)o=l.contentWindow;else break;l=ta(o.document)}return l}function rO(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}var Sj=ns&&"documentMode"in document&&11>=document.documentMode,fl=null,sO=null,Jc=null,oO=!1;function A_(o,l,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;oO||fl==null||fl!==ta(p)||(p=fl,"selectionStart"in p&&rO(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Jc&&Kc(Jc,p)||(Jc=p,p=Cf(sO,"onSelect"),0<p.length&&(l=new zd("onSelect","select",null,l,u),o.push({event:l,listeners:p}),l.target=fl)))}function ra(o,l){var u={};return u[o.toLowerCase()]=l.toLowerCase(),u["Webkit"+o]="webkit"+l,u["Moz"+o]="moz"+l,u}var pl={animationend:ra("Animation","AnimationEnd"),animationiteration:ra("Animation","AnimationIteration"),animationstart:ra("Animation","AnimationStart"),transitionrun:ra("Transition","TransitionRun"),transitionstart:ra("Transition","TransitionStart"),transitioncancel:ra("Transition","TransitionCancel"),transitionend:ra("Transition","TransitionEnd")},aO={},M_={};ns&&(M_=document.createElement("div").style,"AnimationEvent"in window||(delete pl.animationend.animation,delete pl.animationiteration.animation,delete pl.animationstart.animation),"TransitionEvent"in window||delete pl.transitionend.transition);function sa(o){if(aO[o])return aO[o];if(!pl[o])return o;var l=pl[o],u;for(u in l)if(l.hasOwnProperty(u)&&u in M_)return aO[o]=l[u];return o}var z_=sa("animationend"),j_=sa("animationiteration"),D_=sa("animationstart"),bj=sa("transitionrun"),_j=sa("transitionstart"),xj=sa("transitioncancel"),B_=sa("transitionend"),L_=new Map,lO="abort auxClick beforeToggle 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(" ");lO.push("scrollEnd");function cr(o,l){L_.set(o,l),es(l,[o])}var Bd=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},Zn=[],gl=0,cO=0;function Ld(){for(var o=gl,l=cO=gl=0;l<o;){var u=Zn[l];Zn[l++]=null;var p=Zn[l];Zn[l++]=null;var y=Zn[l];Zn[l++]=null;var b=Zn[l];if(Zn[l++]=null,p!==null&&y!==null){var C=p.pending;C===null?y.next=y:(y.next=C.next,C.next=y),p.pending=y}b!==0&&X_(u,y,b)}}function Xd(o,l,u,p){Zn[gl++]=o,Zn[gl++]=l,Zn[gl++]=u,Zn[gl++]=p,cO|=p,o.lanes|=p,o=o.alternate,o!==null&&(o.lanes|=p)}function hO(o,l,u,p){return Xd(o,l,u,p),Nd(o)}function oa(o,l){return Xd(o,null,null,l),Nd(o)}function X_(o,l,u){o.lanes|=u;var p=o.alternate;p!==null&&(p.lanes|=u);for(var y=!1,b=o.return;b!==null;)b.childLanes|=u,p=b.alternate,p!==null&&(p.childLanes|=u),b.tag===22&&(o=b.stateNode,o===null||o._visibility&1||(y=!0)),o=b,b=b.return;return o.tag===3?(b=o.stateNode,y&&l!==null&&(y=31-Yi(u),o=b.hiddenUpdates,p=o[y],p===null?o[y]=[l]:p.push(l),l.lane=u|536870912),b):null}function Nd(o){if(50<bh)throw bh=0,y0=null,Error(n(185));for(var l=o.return;l!==null;)o=l,l=o.return;return o.tag===3?o.stateNode:null}var ml={};function wj(o,l,u,p){this.tag=o,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wn(o,l,u,p){return new wj(o,l,u,p)}function uO(o){return o=o.prototype,!(!o||!o.isReactComponent)}function rs(o,l){var u=o.alternate;return u===null?(u=wn(o.tag,l,o.key,o.mode),u.elementType=o.elementType,u.type=o.type,u.stateNode=o.stateNode,u.alternate=o,o.alternate=u):(u.pendingProps=l,u.type=o.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=o.flags&65011712,u.childLanes=o.childLanes,u.lanes=o.lanes,u.child=o.child,u.memoizedProps=o.memoizedProps,u.memoizedState=o.memoizedState,u.updateQueue=o.updateQueue,l=o.dependencies,u.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},u.sibling=o.sibling,u.index=o.index,u.ref=o.ref,u.refCleanup=o.refCleanup,u}function N_(o,l){o.flags&=65011714;var u=o.alternate;return u===null?(o.childLanes=0,o.lanes=l,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=u.childLanes,o.lanes=u.lanes,o.child=u.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=u.memoizedProps,o.memoizedState=u.memoizedState,o.updateQueue=u.updateQueue,o.type=u.type,l=u.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),o}function Zd(o,l,u,p,y,b){var C=0;if(p=o,typeof o=="function")uO(o)&&(C=1);else if(typeof o=="string")C=$3(o,u,ie.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case H:return o=wn(31,u,l,y),o.elementType=H,o.lanes=b,o;case _:return aa(u.children,y,b,l);case w:C=8,y|=24;break;case x:return o=wn(12,u,l,y|2),o.elementType=x,o.lanes=b,o;case M:return o=wn(13,u,l,y),o.elementType=M,o.lanes=b,o;case $:return o=wn(19,u,l,y),o.elementType=$,o.lanes=b,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case k:C=10;break e;case Q:C=9;break e;case T:C=11;break e;case R:C=14;break e;case V:C=16,p=null;break e}C=29,u=Error(n(130,o===null?"null":typeof o,"")),p=null}return l=wn(C,u,l,y),l.elementType=o,l.type=p,l.lanes=b,l}function aa(o,l,u,p){return o=wn(7,o,p,l),o.lanes=u,o}function dO(o,l,u){return o=wn(6,o,null,l),o.lanes=u,o}function Z_(o){var l=wn(18,null,null,0);return l.stateNode=o,l}function fO(o,l,u){return l=wn(4,o.children!==null?o.children:[],o.key,l),l.lanes=u,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var W_=new WeakMap;function Wn(o,l){if(typeof o=="object"&&o!==null){var u=W_.get(o);return u!==void 0?u:(l={value:o,source:l,stack:rn(l)},W_.set(o,l),l)}return{value:o,source:l,stack:rn(l)}}var Ol=[],vl=0,Wd=null,eh=0,qn=[],Vn=0,Us=null,Cr=1,Tr="";function ss(o,l){Ol[vl++]=eh,Ol[vl++]=Wd,Wd=o,eh=l}function q_(o,l,u){qn[Vn++]=Cr,qn[Vn++]=Tr,qn[Vn++]=Us,Us=o;var p=Cr;o=Tr;var y=32-Yi(p)-1;p&=~(1<<y),u+=1;var b=32-Yi(l)+y;if(30<b){var C=y-y%5;b=(p&(1<<C)-1).toString(32),p>>=C,y-=C,Cr=1<<32-Yi(l)+y|u<<y|p,Tr=b+o}else Cr=1<<b|u<<y|p,Tr=o}function pO(o){o.return!==null&&(ss(o,1),q_(o,1,0))}function gO(o){for(;o===Wd;)Wd=Ol[--vl],Ol[vl]=null,eh=Ol[--vl],Ol[vl]=null;for(;o===Us;)Us=qn[--Vn],qn[Vn]=null,Tr=qn[--Vn],qn[Vn]=null,Cr=qn[--Vn],qn[Vn]=null}function V_(o,l){qn[Vn++]=Cr,qn[Vn++]=Tr,qn[Vn++]=Us,Cr=l.id,Tr=l.overflow,Us=o}var ki=null,$t=null,st=!1,Gs=null,In=!1,mO=Error(n(519));function Fs(o){var l=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw th(Wn(l,o)),mO}function I_(o){var l=o.stateNode,u=o.type,p=o.memoizedProps;switch(l[li]=o,l[Di]=p,u){case"dialog":Je("cancel",l),Je("close",l);break;case"iframe":case"object":case"embed":Je("load",l);break;case"video":case"audio":for(u=0;u<xh.length;u++)Je(xh[u],l);break;case"source":Je("error",l);break;case"img":case"image":case"link":Je("error",l),Je("load",l);break;case"details":Je("toggle",l);break;case"input":Je("invalid",l),Pd(l,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Je("invalid",l);break;case"textarea":Je("invalid",l),a_(l,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||l.textContent===""+u||p.suppressHydrationWarning===!0||ck(l.textContent,u)?(p.popover!=null&&(Je("beforetoggle",l),Je("toggle",l)),p.onScroll!=null&&Je("scroll",l),p.onScrollEnd!=null&&Je("scrollend",l),p.onClick!=null&&(l.onclick=is),l=!0):l=!1,l||Fs(o,!0)}function Y_(o){for(ki=o.return;ki;)switch(ki.tag){case 5:case 31:case 13:In=!1;return;case 27:case 3:In=!0;return;default:ki=ki.return}}function yl(o){if(o!==ki)return!1;if(!st)return Y_(o),st=!0,!1;var l=o.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=o.type,u=!(u!=="form"&&u!=="button")||M0(o.type,o.memoizedProps)),u=!u),u&&$t&&Fs(o),Y_(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));$t=vk(o)}else if(l===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));$t=vk(o)}else l===27?(l=$t,uo(o.type)?(o=L0,L0=null,$t=o):$t=l):$t=ki?Hn(o.stateNode.nextSibling):null;return!0}function la(){$t=ki=null,st=!1}function OO(){var o=Gs;return o!==null&&(fn===null?fn=o:fn.push.apply(fn,o),Gs=null),o}function th(o){Gs===null?Gs=[o]:Gs.push(o)}var vO=z(null),ca=null,os=null;function Ks(o,l,u){K(vO,l._currentValue),l._currentValue=u}function as(o){o._currentValue=vO.current,q(vO)}function yO(o,l,u){for(;o!==null;){var p=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,p!==null&&(p.childLanes|=l)):p!==null&&(p.childLanes&l)!==l&&(p.childLanes|=l),o===u)break;o=o.return}}function SO(o,l,u,p){var y=o.child;for(y!==null&&(y.return=o);y!==null;){var b=y.dependencies;if(b!==null){var C=y.child;b=b.firstContext;e:for(;b!==null;){var A=b;b=y;for(var Y=0;Y<l.length;Y++)if(A.context===l[Y]){b.lanes|=u,A=b.alternate,A!==null&&(A.lanes|=u),yO(b.return,u,o),p||(C=null);break e}b=A.next}}else if(y.tag===18){if(C=y.return,C===null)throw Error(n(341));C.lanes|=u,b=C.alternate,b!==null&&(b.lanes|=u),yO(C,u,o),C=null}else C=y.child;if(C!==null)C.return=y;else for(C=y;C!==null;){if(C===o){C=null;break}if(y=C.sibling,y!==null){y.return=C.return,C=y;break}C=C.return}y=C}}function Sl(o,l,u,p){o=null;for(var y=l,b=!1;y!==null;){if(!b){if((y.flags&524288)!==0)b=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var C=y.alternate;if(C===null)throw Error(n(387));if(C=C.memoizedProps,C!==null){var A=y.type;xn(y.pendingProps.value,C.value)||(o!==null?o.push(A):o=[A])}}else if(y===pe.current){if(C=y.alternate,C===null)throw Error(n(387));C.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(o!==null?o.push(Qh):o=[Qh])}y=y.return}o!==null&&SO(l,o,u,p),l.flags|=262144}function qd(o){for(o=o.firstContext;o!==null;){if(!xn(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function ha(o){ca=o,os=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Ci(o){return H_(ca,o)}function Vd(o,l){return ca===null&&ha(o),H_(o,l)}function H_(o,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},os===null){if(o===null)throw Error(n(308));os=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else os=os.next=l;return u}var kj=typeof AbortController<"u"?AbortController:function(){var o=[],l=this.signal={aborted:!1,addEventListener:function(u,p){o.push(p)}};this.abort=function(){l.aborted=!0,o.forEach(function(u){return u()})}},Cj=t.unstable_scheduleCallback,Tj=t.unstable_NormalPriority,Jt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function bO(){return{controller:new kj,data:new Map,refCount:0}}function ih(o){o.refCount--,o.refCount===0&&Cj(Tj,function(){o.controller.abort()})}var nh=null,_O=0,bl=0,_l=null;function Qj(o,l){if(nh===null){var u=nh=[];_O=0,bl=k0(),_l={status:"pending",value:void 0,then:function(p){u.push(p)}}}return _O++,l.then(U_,U_),l}function U_(){if(--_O===0&&nh!==null){_l!==null&&(_l.status="fulfilled");var o=nh;nh=null,bl=0,_l=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function $j(o,l){var u=[],p={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return o.then(function(){p.status="fulfilled",p.value=l;for(var y=0;y<u.length;y++)(0,u[y])(l)},function(y){for(p.status="rejected",p.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),p}var G_=P.S;P.S=function(o,l){Aw=Le(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&Qj(o,l),G_!==null&&G_(o,l)};var ua=z(null);function xO(){var o=ua.current;return o!==null?o:wt.pooledCache}function Id(o,l){l===null?K(ua,ua.current):K(ua,l.pool)}function F_(){var o=xO();return o===null?null:{parent:Jt._currentValue,pool:o}}var xl=Error(n(460)),wO=Error(n(474)),Yd=Error(n(542)),Hd={then:function(){}};function K_(o){return o=o.status,o==="fulfilled"||o==="rejected"}function J_(o,l,u){switch(u=o[u],u===void 0?o.push(l):u!==l&&(l.then(is,is),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,tx(o),o;default:if(typeof l.status=="string")l.then(is,is);else{if(o=wt,o!==null&&100<o.shellSuspendCounter)throw Error(n(482));o=l,o.status="pending",o.then(function(p){if(l.status==="pending"){var y=l;y.status="fulfilled",y.value=p}},function(p){if(l.status==="pending"){var y=l;y.status="rejected",y.reason=p}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,tx(o),o}throw fa=l,xl}}function da(o){try{var l=o._init;return l(o._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(fa=u,xl):u}}var fa=null;function ex(){if(fa===null)throw Error(n(459));var o=fa;return fa=null,o}function tx(o){if(o===xl||o===Yd)throw Error(n(483))}var wl=null,rh=0;function Ud(o){var l=rh;return rh+=1,wl===null&&(wl=[]),J_(wl,o,l)}function sh(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function Gd(o,l){throw l.$$typeof===m?Error(n(525)):(o=Object.prototype.toString.call(l),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o)))}function ix(o){function l(F,U){if(o){var J=F.deletions;J===null?(F.deletions=[U],F.flags|=16):J.push(U)}}function u(F,U){if(!o)return null;for(;U!==null;)l(F,U),U=U.sibling;return null}function p(F){for(var U=new Map;F!==null;)F.key!==null?U.set(F.key,F):U.set(F.index,F),F=F.sibling;return U}function y(F,U){return F=rs(F,U),F.index=0,F.sibling=null,F}function b(F,U,J){return F.index=J,o?(J=F.alternate,J!==null?(J=J.index,J<U?(F.flags|=67108866,U):J):(F.flags|=67108866,U)):(F.flags|=1048576,U)}function C(F){return o&&F.alternate===null&&(F.flags|=67108866),F}function A(F,U,J,ae){return U===null||U.tag!==6?(U=dO(J,F.mode,ae),U.return=F,U):(U=y(U,J),U.return=F,U)}function Y(F,U,J,ae){var Ae=J.type;return Ae===_?se(F,U,J.props.children,ae,J.key):U!==null&&(U.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===V&&da(Ae)===U.type)?(U=y(U,J.props),sh(U,J),U.return=F,U):(U=Zd(J.type,J.key,J.props,null,F.mode,ae),sh(U,J),U.return=F,U)}function te(F,U,J,ae){return U===null||U.tag!==4||U.stateNode.containerInfo!==J.containerInfo||U.stateNode.implementation!==J.implementation?(U=fO(J,F.mode,ae),U.return=F,U):(U=y(U,J.children||[]),U.return=F,U)}function se(F,U,J,ae,Ae){return U===null||U.tag!==7?(U=aa(J,F.mode,ae,Ae),U.return=F,U):(U=y(U,J),U.return=F,U)}function he(F,U,J){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=dO(""+U,F.mode,J),U.return=F,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case O:return J=Zd(U.type,U.key,U.props,null,F.mode,J),sh(J,U),J.return=F,J;case S:return U=fO(U,F.mode,J),U.return=F,U;case V:return U=da(U),he(F,U,J)}if(X(U)||j(U))return U=aa(U,F.mode,J,null),U.return=F,U;if(typeof U.then=="function")return he(F,Ud(U),J);if(U.$$typeof===k)return he(F,Vd(F,U),J);Gd(F,U)}return null}function ne(F,U,J,ae){var Ae=U!==null?U.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Ae!==null?null:A(F,U,""+J,ae);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case O:return J.key===Ae?Y(F,U,J,ae):null;case S:return J.key===Ae?te(F,U,J,ae):null;case V:return J=da(J),ne(F,U,J,ae)}if(X(J)||j(J))return Ae!==null?null:se(F,U,J,ae,null);if(typeof J.then=="function")return ne(F,U,Ud(J),ae);if(J.$$typeof===k)return ne(F,U,Vd(F,J),ae);Gd(F,J)}return null}function re(F,U,J,ae,Ae){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return F=F.get(J)||null,A(U,F,""+ae,Ae);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case O:return F=F.get(ae.key===null?J:ae.key)||null,Y(U,F,ae,Ae);case S:return F=F.get(ae.key===null?J:ae.key)||null,te(U,F,ae,Ae);case V:return ae=da(ae),re(F,U,J,ae,Ae)}if(X(ae)||j(ae))return F=F.get(J)||null,se(U,F,ae,Ae,null);if(typeof ae.then=="function")return re(F,U,J,Ud(ae),Ae);if(ae.$$typeof===k)return re(F,U,J,Vd(U,ae),Ae);Gd(U,ae)}return null}function we(F,U,J,ae){for(var Ae=null,ht=null,Te=U,Ye=U=0,it=null;Te!==null&&Ye<J.length;Ye++){Te.index>Ye?(it=Te,Te=null):it=Te.sibling;var ut=ne(F,Te,J[Ye],ae);if(ut===null){Te===null&&(Te=it);break}o&&Te&&ut.alternate===null&&l(F,Te),U=b(ut,U,Ye),ht===null?Ae=ut:ht.sibling=ut,ht=ut,Te=it}if(Ye===J.length)return u(F,Te),st&&ss(F,Ye),Ae;if(Te===null){for(;Ye<J.length;Ye++)Te=he(F,J[Ye],ae),Te!==null&&(U=b(Te,U,Ye),ht===null?Ae=Te:ht.sibling=Te,ht=Te);return st&&ss(F,Ye),Ae}for(Te=p(Te);Ye<J.length;Ye++)it=re(Te,F,Ye,J[Ye],ae),it!==null&&(o&&it.alternate!==null&&Te.delete(it.key===null?Ye:it.key),U=b(it,U,Ye),ht===null?Ae=it:ht.sibling=it,ht=it);return o&&Te.forEach(function(Oo){return l(F,Oo)}),st&&ss(F,Ye),Ae}function je(F,U,J,ae){if(J==null)throw Error(n(151));for(var Ae=null,ht=null,Te=U,Ye=U=0,it=null,ut=J.next();Te!==null&&!ut.done;Ye++,ut=J.next()){Te.index>Ye?(it=Te,Te=null):it=Te.sibling;var Oo=ne(F,Te,ut.value,ae);if(Oo===null){Te===null&&(Te=it);break}o&&Te&&Oo.alternate===null&&l(F,Te),U=b(Oo,U,Ye),ht===null?Ae=Oo:ht.sibling=Oo,ht=Oo,Te=it}if(ut.done)return u(F,Te),st&&ss(F,Ye),Ae;if(Te===null){for(;!ut.done;Ye++,ut=J.next())ut=he(F,ut.value,ae),ut!==null&&(U=b(ut,U,Ye),ht===null?Ae=ut:ht.sibling=ut,ht=ut);return st&&ss(F,Ye),Ae}for(Te=p(Te);!ut.done;Ye++,ut=J.next())ut=re(Te,F,Ye,ut.value,ae),ut!==null&&(o&&ut.alternate!==null&&Te.delete(ut.key===null?Ye:ut.key),U=b(ut,U,Ye),ht===null?Ae=ut:ht.sibling=ut,ht=ut);return o&&Te.forEach(function(X3){return l(F,X3)}),st&&ss(F,Ye),Ae}function _t(F,U,J,ae){if(typeof J=="object"&&J!==null&&J.type===_&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case O:e:{for(var Ae=J.key;U!==null;){if(U.key===Ae){if(Ae=J.type,Ae===_){if(U.tag===7){u(F,U.sibling),ae=y(U,J.props.children),ae.return=F,F=ae;break e}}else if(U.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===V&&da(Ae)===U.type){u(F,U.sibling),ae=y(U,J.props),sh(ae,J),ae.return=F,F=ae;break e}u(F,U);break}else l(F,U);U=U.sibling}J.type===_?(ae=aa(J.props.children,F.mode,ae,J.key),ae.return=F,F=ae):(ae=Zd(J.type,J.key,J.props,null,F.mode,ae),sh(ae,J),ae.return=F,F=ae)}return C(F);case S:e:{for(Ae=J.key;U!==null;){if(U.key===Ae)if(U.tag===4&&U.stateNode.containerInfo===J.containerInfo&&U.stateNode.implementation===J.implementation){u(F,U.sibling),ae=y(U,J.children||[]),ae.return=F,F=ae;break e}else{u(F,U);break}else l(F,U);U=U.sibling}ae=fO(J,F.mode,ae),ae.return=F,F=ae}return C(F);case V:return J=da(J),_t(F,U,J,ae)}if(X(J))return we(F,U,J,ae);if(j(J)){if(Ae=j(J),typeof Ae!="function")throw Error(n(150));return J=Ae.call(J),je(F,U,J,ae)}if(typeof J.then=="function")return _t(F,U,Ud(J),ae);if(J.$$typeof===k)return _t(F,U,Vd(F,J),ae);Gd(F,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,U!==null&&U.tag===6?(u(F,U.sibling),ae=y(U,J),ae.return=F,F=ae):(u(F,U),ae=dO(J,F.mode,ae),ae.return=F,F=ae),C(F)):u(F,U)}return function(F,U,J,ae){try{rh=0;var Ae=_t(F,U,J,ae);return wl=null,Ae}catch(Te){if(Te===xl||Te===Yd)throw Te;var ht=wn(29,Te,null,F.mode);return ht.lanes=ae,ht.return=F,ht}finally{}}}var pa=ix(!0),nx=ix(!1),Js=!1;function kO(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function CO(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function eo(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function to(o,l,u){var p=o.updateQueue;if(p===null)return null;if(p=p.shared,(ft&2)!==0){var y=p.pending;return y===null?l.next=l:(l.next=y.next,y.next=l),p.pending=l,l=Nd(o),X_(o,null,u),l}return Xd(o,p,l,u),Nd(o)}function oh(o,l,u){if(l=l.updateQueue,l!==null&&(l=l.shared,(u&4194048)!==0)){var p=l.lanes;p&=o.pendingLanes,u|=p,l.lanes=u,yd(o,u)}}function TO(o,l){var u=o.updateQueue,p=o.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var y=null,b=null;if(u=u.firstBaseUpdate,u!==null){do{var C={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};b===null?y=b=C:b=b.next=C,u=u.next}while(u!==null);b===null?y=b=l:b=b.next=l}else y=b=l;u={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:b,shared:p.shared,callbacks:p.callbacks},o.updateQueue=u;return}o=u.lastBaseUpdate,o===null?u.firstBaseUpdate=l:o.next=l,u.lastBaseUpdate=l}var QO=!1;function ah(){if(QO){var o=_l;if(o!==null)throw o}}function lh(o,l,u,p){QO=!1;var y=o.updateQueue;Js=!1;var b=y.firstBaseUpdate,C=y.lastBaseUpdate,A=y.shared.pending;if(A!==null){y.shared.pending=null;var Y=A,te=Y.next;Y.next=null,C===null?b=te:C.next=te,C=Y;var se=o.alternate;se!==null&&(se=se.updateQueue,A=se.lastBaseUpdate,A!==C&&(A===null?se.firstBaseUpdate=te:A.next=te,se.lastBaseUpdate=Y))}if(b!==null){var he=y.baseState;C=0,se=te=Y=null,A=b;do{var ne=A.lane&-536870913,re=ne!==A.lane;if(re?(tt&ne)===ne:(p&ne)===ne){ne!==0&&ne===bl&&(QO=!0),se!==null&&(se=se.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var we=o,je=A;ne=l;var _t=u;switch(je.tag){case 1:if(we=je.payload,typeof we=="function"){he=we.call(_t,he,ne);break e}he=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=je.payload,ne=typeof we=="function"?we.call(_t,he,ne):we,ne==null)break e;he=g({},he,ne);break e;case 2:Js=!0}}ne=A.callback,ne!==null&&(o.flags|=64,re&&(o.flags|=8192),re=y.callbacks,re===null?y.callbacks=[ne]:re.push(ne))}else re={lane:ne,tag:A.tag,payload:A.payload,callback:A.callback,next:null},se===null?(te=se=re,Y=he):se=se.next=re,C|=ne;if(A=A.next,A===null){if(A=y.shared.pending,A===null)break;re=A,A=re.next,re.next=null,y.lastBaseUpdate=re,y.shared.pending=null}}while(!0);se===null&&(Y=he),y.baseState=Y,y.firstBaseUpdate=te,y.lastBaseUpdate=se,b===null&&(y.shared.lanes=0),oo|=C,o.lanes=C,o.memoizedState=he}}function rx(o,l){if(typeof o!="function")throw Error(n(191,o));o.call(l)}function sx(o,l){var u=o.callbacks;if(u!==null)for(o.callbacks=null,o=0;o<u.length;o++)rx(u[o],l)}var kl=z(null),Fd=z(0);function ox(o,l){o=ms,K(Fd,o),K(kl,l),ms=o|l.baseLanes}function $O(){K(Fd,ms),K(kl,kl.current)}function PO(){ms=Fd.current,q(kl),q(Fd)}var kn=z(null),Yn=null;function io(o){var l=o.alternate;K(Vt,Vt.current&1),K(kn,o),Yn===null&&(l===null||kl.current!==null||l.memoizedState!==null)&&(Yn=o)}function EO(o){K(Vt,Vt.current),K(kn,o),Yn===null&&(Yn=o)}function ax(o){o.tag===22?(K(Vt,Vt.current),K(kn,o),Yn===null&&(Yn=o)):no()}function no(){K(Vt,Vt.current),K(kn,kn.current)}function Cn(o){q(kn),Yn===o&&(Yn=null),q(Vt)}var Vt=z(0);function Kd(o){for(var l=o;l!==null;){if(l.tag===13){var u=l.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||D0(u)||B0(u)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var ls=0,Ie=null,St=null,ei=null,Jd=!1,Cl=!1,ga=!1,ef=0,ch=0,Tl=null,Pj=0;function Xt(){throw Error(n(321))}function RO(o,l){if(l===null)return!1;for(var u=0;u<l.length&&u<o.length;u++)if(!xn(o[u],l[u]))return!1;return!0}function AO(o,l,u,p,y,b){return ls=b,Ie=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,P.H=o===null||o.memoizedState===null?qx:HO,ga=!1,b=u(p,y),ga=!1,Cl&&(b=cx(l,u,p,y)),lx(o),b}function lx(o){P.H=dh;var l=St!==null&&St.next!==null;if(ls=0,ei=St=Ie=null,Jd=!1,ch=0,Tl=null,l)throw Error(n(300));o===null||ti||(o=o.dependencies,o!==null&&qd(o)&&(ti=!0))}function cx(o,l,u,p){Ie=o;var y=0;do{if(Cl&&(Tl=null),ch=0,Cl=!1,25<=y)throw Error(n(301));if(y+=1,ei=St=null,o.updateQueue!=null){var b=o.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}P.H=Vx,b=l(u,p)}while(Cl);return b}function Ej(){var o=P.H,l=o.useState()[0];return l=typeof l.then=="function"?hh(l):l,o=o.useState()[0],(St!==null?St.memoizedState:null)!==o&&(Ie.flags|=1024),l}function MO(){var o=ef!==0;return ef=0,o}function zO(o,l,u){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~u}function jO(o){if(Jd){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}Jd=!1}ls=0,ei=St=Ie=null,Cl=!1,ch=ef=0,Tl=null}function Hi(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ei===null?Ie.memoizedState=ei=o:ei=ei.next=o,ei}function It(){if(St===null){var o=Ie.alternate;o=o!==null?o.memoizedState:null}else o=St.next;var l=ei===null?Ie.memoizedState:ei.next;if(l!==null)ei=l,St=o;else{if(o===null)throw Ie.alternate===null?Error(n(467)):Error(n(310));St=o,o={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},ei===null?Ie.memoizedState=ei=o:ei=ei.next=o}return ei}function tf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hh(o){var l=ch;return ch+=1,Tl===null&&(Tl=[]),o=J_(Tl,o,l),l=Ie,(ei===null?l.memoizedState:ei.next)===null&&(l=l.alternate,P.H=l===null||l.memoizedState===null?qx:HO),o}function nf(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return hh(o);if(o.$$typeof===k)return Ci(o)}throw Error(n(438,String(o)))}function DO(o){var l=null,u=Ie.updateQueue;if(u!==null&&(l=u.memoCache),l==null){var p=Ie.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(l={data:p.data.map(function(y){return y.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),u===null&&(u=tf(),Ie.updateQueue=u),u.memoCache=l,u=l.data[l.index],u===void 0)for(u=l.data[l.index]=Array(o),p=0;p<o;p++)u[p]=ee;return l.index++,u}function cs(o,l){return typeof l=="function"?l(o):l}function rf(o){var l=It();return BO(l,St,o)}function BO(o,l,u){var p=o.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=u;var y=o.baseQueue,b=p.pending;if(b!==null){if(y!==null){var C=y.next;y.next=b.next,b.next=C}l.baseQueue=y=b,p.pending=null}if(b=o.baseState,y===null)o.memoizedState=b;else{l=y.next;var A=C=null,Y=null,te=l,se=!1;do{var he=te.lane&-536870913;if(he!==te.lane?(tt&he)===he:(ls&he)===he){var ne=te.revertLane;if(ne===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),he===bl&&(se=!0);else if((ls&ne)===ne){te=te.next,ne===bl&&(se=!0);continue}else he={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},Y===null?(A=Y=he,C=b):Y=Y.next=he,Ie.lanes|=ne,oo|=ne;he=te.action,ga&&u(b,he),b=te.hasEagerState?te.eagerState:u(b,he)}else ne={lane:he,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},Y===null?(A=Y=ne,C=b):Y=Y.next=ne,Ie.lanes|=he,oo|=he;te=te.next}while(te!==null&&te!==l);if(Y===null?C=b:Y.next=A,!xn(b,o.memoizedState)&&(ti=!0,se&&(u=_l,u!==null)))throw u;o.memoizedState=b,o.baseState=C,o.baseQueue=Y,p.lastRenderedState=b}return y===null&&(p.lanes=0),[o.memoizedState,p.dispatch]}function LO(o){var l=It(),u=l.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=o;var p=u.dispatch,y=u.pending,b=l.memoizedState;if(y!==null){u.pending=null;var C=y=y.next;do b=o(b,C.action),C=C.next;while(C!==y);xn(b,l.memoizedState)||(ti=!0),l.memoizedState=b,l.baseQueue===null&&(l.baseState=b),u.lastRenderedState=b}return[b,p]}function hx(o,l,u){var p=Ie,y=It(),b=st;if(b){if(u===void 0)throw Error(n(407));u=u()}else u=l();var C=!xn((St||y).memoizedState,u);if(C&&(y.memoizedState=u,ti=!0),y=y.queue,ZO(fx.bind(null,p,y,o),[o]),y.getSnapshot!==l||C||ei!==null&&ei.memoizedState.tag&1){if(p.flags|=2048,Ql(9,{destroy:void 0},dx.bind(null,p,y,u,l),null),wt===null)throw Error(n(349));b||(ls&127)!==0||ux(p,l,u)}return u}function ux(o,l,u){o.flags|=16384,o={getSnapshot:l,value:u},l=Ie.updateQueue,l===null?(l=tf(),Ie.updateQueue=l,l.stores=[o]):(u=l.stores,u===null?l.stores=[o]:u.push(o))}function dx(o,l,u,p){l.value=u,l.getSnapshot=p,px(l)&&gx(o)}function fx(o,l,u){return u(function(){px(l)&&gx(o)})}function px(o){var l=o.getSnapshot;o=o.value;try{var u=l();return!xn(o,u)}catch{return!0}}function gx(o){var l=oa(o,2);l!==null&&pn(l,o,2)}function XO(o){var l=Hi();if(typeof o=="function"){var u=o;if(o=u(),ga){wr(!0);try{u()}finally{wr(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:o},l}function mx(o,l,u,p){return o.baseState=u,BO(o,St,typeof p=="function"?p:cs)}function Rj(o,l,u,p,y){if(af(o))throw Error(n(485));if(o=l.action,o!==null){var b={payload:y,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){b.listeners.push(C)}};P.T!==null?u(!0):b.isTransition=!1,p(b),u=l.pending,u===null?(b.next=l.pending=b,Ox(l,b)):(b.next=u.next,l.pending=u.next=b)}}function Ox(o,l){var u=l.action,p=l.payload,y=o.state;if(l.isTransition){var b=P.T,C={};P.T=C;try{var A=u(y,p),Y=P.S;Y!==null&&Y(C,A),vx(o,l,A)}catch(te){NO(o,l,te)}finally{b!==null&&C.types!==null&&(b.types=C.types),P.T=b}}else try{b=u(y,p),vx(o,l,b)}catch(te){NO(o,l,te)}}function vx(o,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){yx(o,l,p)},function(p){return NO(o,l,p)}):yx(o,l,u)}function yx(o,l,u){l.status="fulfilled",l.value=u,Sx(l),o.state=u,l=o.pending,l!==null&&(u=l.next,u===l?o.pending=null:(u=u.next,l.next=u,Ox(o,u)))}function NO(o,l,u){var p=o.pending;if(o.pending=null,p!==null){p=p.next;do l.status="rejected",l.reason=u,Sx(l),l=l.next;while(l!==p)}o.action=null}function Sx(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function bx(o,l){return l}function _x(o,l){if(st){var u=wt.formState;if(u!==null){e:{var p=Ie;if(st){if($t){t:{for(var y=$t,b=In;y.nodeType!==8;){if(!b){y=null;break t}if(y=Hn(y.nextSibling),y===null){y=null;break t}}b=y.data,y=b==="F!"||b==="F"?y:null}if(y){$t=Hn(y.nextSibling),p=y.data==="F!";break e}}Fs(p)}p=!1}p&&(l=u[0])}}return u=Hi(),u.memoizedState=u.baseState=l,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bx,lastRenderedState:l},u.queue=p,u=Nx.bind(null,Ie,p),p.dispatch=u,p=XO(!1),b=YO.bind(null,Ie,!1,p.queue),p=Hi(),y={state:l,dispatch:null,action:o,pending:null},p.queue=y,u=Rj.bind(null,Ie,y,b,u),y.dispatch=u,p.memoizedState=o,[l,u,!1]}function xx(o){var l=It();return wx(l,St,o)}function wx(o,l,u){if(l=BO(o,l,bx)[0],o=rf(cs)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var p=hh(l)}catch(C){throw C===xl?Yd:C}else p=l;l=It();var y=l.queue,b=y.dispatch;return u!==l.memoizedState&&(Ie.flags|=2048,Ql(9,{destroy:void 0},Aj.bind(null,y,u),null)),[p,b,o]}function Aj(o,l){o.action=l}function kx(o){var l=It(),u=St;if(u!==null)return wx(l,u,o);It(),l=l.memoizedState,u=It();var p=u.queue.dispatch;return u.memoizedState=o,[l,p,!1]}function Ql(o,l,u,p){return o={tag:o,create:u,deps:p,inst:l,next:null},l=Ie.updateQueue,l===null&&(l=tf(),Ie.updateQueue=l),u=l.lastEffect,u===null?l.lastEffect=o.next=o:(p=u.next,u.next=o,o.next=p,l.lastEffect=o),o}function Cx(){return It().memoizedState}function sf(o,l,u,p){var y=Hi();Ie.flags|=o,y.memoizedState=Ql(1|l,{destroy:void 0},u,p===void 0?null:p)}function of(o,l,u,p){var y=It();p=p===void 0?null:p;var b=y.memoizedState.inst;St!==null&&p!==null&&RO(p,St.memoizedState.deps)?y.memoizedState=Ql(l,b,u,p):(Ie.flags|=o,y.memoizedState=Ql(1|l,b,u,p))}function Tx(o,l){sf(8390656,8,o,l)}function ZO(o,l){of(2048,8,o,l)}function Mj(o){Ie.flags|=4;var l=Ie.updateQueue;if(l===null)l=tf(),Ie.updateQueue=l,l.events=[o];else{var u=l.events;u===null?l.events=[o]:u.push(o)}}function Qx(o){var l=It().memoizedState;return Mj({ref:l,nextImpl:o}),function(){if((ft&2)!==0)throw Error(n(440));return l.impl.apply(void 0,arguments)}}function $x(o,l){return of(4,2,o,l)}function Px(o,l){return of(4,4,o,l)}function Ex(o,l){if(typeof l=="function"){o=o();var u=l(o);return function(){typeof u=="function"?u():l(null)}}if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function Rx(o,l,u){u=u!=null?u.concat([o]):null,of(4,4,Ex.bind(null,l,o),u)}function WO(){}function Ax(o,l){var u=It();l=l===void 0?null:l;var p=u.memoizedState;return l!==null&&RO(l,p[1])?p[0]:(u.memoizedState=[o,l],o)}function Mx(o,l){var u=It();l=l===void 0?null:l;var p=u.memoizedState;if(l!==null&&RO(l,p[1]))return p[0];if(p=o(),ga){wr(!0);try{o()}finally{wr(!1)}}return u.memoizedState=[p,l],p}function qO(o,l,u){return u===void 0||(ls&1073741824)!==0&&(tt&261930)===0?o.memoizedState=l:(o.memoizedState=u,o=zw(),Ie.lanes|=o,oo|=o,u)}function zx(o,l,u,p){return xn(u,l)?u:kl.current!==null?(o=qO(o,u,p),xn(o,l)||(ti=!0),o):(ls&42)===0||(ls&1073741824)!==0&&(tt&261930)===0?(ti=!0,o.memoizedState=u):(o=zw(),Ie.lanes|=o,oo|=o,l)}function jx(o,l,u,p,y){var b=Z.p;Z.p=b!==0&&8>b?b:8;var C=P.T,A={};P.T=A,YO(o,!1,l,u);try{var Y=y(),te=P.S;if(te!==null&&te(A,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var se=$j(Y,p);uh(o,l,se,$n(o))}else uh(o,l,p,$n(o))}catch(he){uh(o,l,{then:function(){},status:"rejected",reason:he},$n())}finally{Z.p=b,C!==null&&A.types!==null&&(C.types=A.types),P.T=C}}function zj(){}function VO(o,l,u,p){if(o.tag!==5)throw Error(n(476));var y=Dx(o).queue;jx(o,y,l,L,u===null?zj:function(){return Bx(o),u(p)})}function Dx(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:L},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:u},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function Bx(o){var l=Dx(o);l.next===null&&(l=o.alternate.memoizedState),uh(o,l.next.queue,{},$n())}function IO(){return Ci(Qh)}function Lx(){return It().memoizedState}function Xx(){return It().memoizedState}function jj(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var u=$n();o=eo(u);var p=to(l,o,u);p!==null&&(pn(p,l,u),oh(p,l,u)),l={cache:bO()},o.payload=l;return}l=l.return}}function Dj(o,l,u){var p=$n();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},af(o)?Zx(l,u):(u=hO(o,l,u,p),u!==null&&(pn(u,o,p),Wx(u,l,p)))}function Nx(o,l,u){var p=$n();uh(o,l,u,p)}function uh(o,l,u,p){var y={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(af(o))Zx(l,y);else{var b=o.alternate;if(o.lanes===0&&(b===null||b.lanes===0)&&(b=l.lastRenderedReducer,b!==null))try{var C=l.lastRenderedState,A=b(C,u);if(y.hasEagerState=!0,y.eagerState=A,xn(A,C))return Xd(o,l,y,0),wt===null&&Ld(),!1}catch{}finally{}if(u=hO(o,l,y,p),u!==null)return pn(u,o,p),Wx(u,l,p),!0}return!1}function YO(o,l,u,p){if(p={lane:2,revertLane:k0(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},af(o)){if(l)throw Error(n(479))}else l=hO(o,u,p,2),l!==null&&pn(l,o,2)}function af(o){var l=o.alternate;return o===Ie||l!==null&&l===Ie}function Zx(o,l){Cl=Jd=!0;var u=o.pending;u===null?l.next=l:(l.next=u.next,u.next=l),o.pending=l}function Wx(o,l,u){if((u&4194048)!==0){var p=l.lanes;p&=o.pendingLanes,u|=p,l.lanes=u,yd(o,u)}}var dh={readContext:Ci,use:nf,useCallback:Xt,useContext:Xt,useEffect:Xt,useImperativeHandle:Xt,useLayoutEffect:Xt,useInsertionEffect:Xt,useMemo:Xt,useReducer:Xt,useRef:Xt,useState:Xt,useDebugValue:Xt,useDeferredValue:Xt,useTransition:Xt,useSyncExternalStore:Xt,useId:Xt,useHostTransitionStatus:Xt,useFormState:Xt,useActionState:Xt,useOptimistic:Xt,useMemoCache:Xt,useCacheRefresh:Xt};dh.useEffectEvent=Xt;var qx={readContext:Ci,use:nf,useCallback:function(o,l){return Hi().memoizedState=[o,l===void 0?null:l],o},useContext:Ci,useEffect:Tx,useImperativeHandle:function(o,l,u){u=u!=null?u.concat([o]):null,sf(4194308,4,Ex.bind(null,l,o),u)},useLayoutEffect:function(o,l){return sf(4194308,4,o,l)},useInsertionEffect:function(o,l){sf(4,2,o,l)},useMemo:function(o,l){var u=Hi();l=l===void 0?null:l;var p=o();if(ga){wr(!0);try{o()}finally{wr(!1)}}return u.memoizedState=[p,l],p},useReducer:function(o,l,u){var p=Hi();if(u!==void 0){var y=u(l);if(ga){wr(!0);try{u(l)}finally{wr(!1)}}}else y=l;return p.memoizedState=p.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},p.queue=o,o=o.dispatch=Dj.bind(null,Ie,o),[p.memoizedState,o]},useRef:function(o){var l=Hi();return o={current:o},l.memoizedState=o},useState:function(o){o=XO(o);var l=o.queue,u=Nx.bind(null,Ie,l);return l.dispatch=u,[o.memoizedState,u]},useDebugValue:WO,useDeferredValue:function(o,l){var u=Hi();return qO(u,o,l)},useTransition:function(){var o=XO(!1);return o=jx.bind(null,Ie,o.queue,!0,!1),Hi().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,u){var p=Ie,y=Hi();if(st){if(u===void 0)throw Error(n(407));u=u()}else{if(u=l(),wt===null)throw Error(n(349));(tt&127)!==0||ux(p,l,u)}y.memoizedState=u;var b={value:u,getSnapshot:l};return y.queue=b,Tx(fx.bind(null,p,b,o),[o]),p.flags|=2048,Ql(9,{destroy:void 0},dx.bind(null,p,b,u,l),null),u},useId:function(){var o=Hi(),l=wt.identifierPrefix;if(st){var u=Tr,p=Cr;u=(p&~(1<<32-Yi(p)-1)).toString(32)+u,l="_"+l+"R_"+u,u=ef++,0<u&&(l+="H"+u.toString(32)),l+="_"}else u=Pj++,l="_"+l+"r_"+u.toString(32)+"_";return o.memoizedState=l},useHostTransitionStatus:IO,useFormState:_x,useActionState:_x,useOptimistic:function(o){var l=Hi();l.memoizedState=l.baseState=o;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=u,l=YO.bind(null,Ie,!0,u),u.dispatch=l,[o,l]},useMemoCache:DO,useCacheRefresh:function(){return Hi().memoizedState=jj.bind(null,Ie)},useEffectEvent:function(o){var l=Hi(),u={impl:o};return l.memoizedState=u,function(){if((ft&2)!==0)throw Error(n(440));return u.impl.apply(void 0,arguments)}}},HO={readContext:Ci,use:nf,useCallback:Ax,useContext:Ci,useEffect:ZO,useImperativeHandle:Rx,useInsertionEffect:$x,useLayoutEffect:Px,useMemo:Mx,useReducer:rf,useRef:Cx,useState:function(){return rf(cs)},useDebugValue:WO,useDeferredValue:function(o,l){var u=It();return zx(u,St.memoizedState,o,l)},useTransition:function(){var o=rf(cs)[0],l=It().memoizedState;return[typeof o=="boolean"?o:hh(o),l]},useSyncExternalStore:hx,useId:Lx,useHostTransitionStatus:IO,useFormState:xx,useActionState:xx,useOptimistic:function(o,l){var u=It();return mx(u,St,o,l)},useMemoCache:DO,useCacheRefresh:Xx};HO.useEffectEvent=Qx;var Vx={readContext:Ci,use:nf,useCallback:Ax,useContext:Ci,useEffect:ZO,useImperativeHandle:Rx,useInsertionEffect:$x,useLayoutEffect:Px,useMemo:Mx,useReducer:LO,useRef:Cx,useState:function(){return LO(cs)},useDebugValue:WO,useDeferredValue:function(o,l){var u=It();return St===null?qO(u,o,l):zx(u,St.memoizedState,o,l)},useTransition:function(){var o=LO(cs)[0],l=It().memoizedState;return[typeof o=="boolean"?o:hh(o),l]},useSyncExternalStore:hx,useId:Lx,useHostTransitionStatus:IO,useFormState:kx,useActionState:kx,useOptimistic:function(o,l){var u=It();return St!==null?mx(u,St,o,l):(u.baseState=o,[o,u.queue.dispatch])},useMemoCache:DO,useCacheRefresh:Xx};Vx.useEffectEvent=Qx;function UO(o,l,u,p){l=o.memoizedState,u=u(p,l),u=u==null?l:g({},l,u),o.memoizedState=u,o.lanes===0&&(o.updateQueue.baseState=u)}var GO={enqueueSetState:function(o,l,u){o=o._reactInternals;var p=$n(),y=eo(p);y.payload=l,u!=null&&(y.callback=u),l=to(o,y,p),l!==null&&(pn(l,o,p),oh(l,o,p))},enqueueReplaceState:function(o,l,u){o=o._reactInternals;var p=$n(),y=eo(p);y.tag=1,y.payload=l,u!=null&&(y.callback=u),l=to(o,y,p),l!==null&&(pn(l,o,p),oh(l,o,p))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var u=$n(),p=eo(u);p.tag=2,l!=null&&(p.callback=l),l=to(o,p,u),l!==null&&(pn(l,o,u),oh(l,o,u))}};function Ix(o,l,u,p,y,b,C){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(p,b,C):l.prototype&&l.prototype.isPureReactComponent?!Kc(u,p)||!Kc(y,b):!0}function Yx(o,l,u,p){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(u,p),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(u,p),l.state!==o&&GO.enqueueReplaceState(l,l.state,null)}function ma(o,l){var u=l;if("ref"in l){u={};for(var p in l)p!=="ref"&&(u[p]=l[p])}if(o=o.defaultProps){u===l&&(u=g({},u));for(var y in o)u[y]===void 0&&(u[y]=o[y])}return u}function Hx(o){Bd(o)}function Ux(o){console.error(o)}function Gx(o){Bd(o)}function lf(o,l){try{var u=o.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(p){setTimeout(function(){throw p})}}function Fx(o,l,u){try{var p=o.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function FO(o,l,u){return u=eo(u),u.tag=3,u.payload={element:null},u.callback=function(){lf(o,l)},u}function Kx(o){return o=eo(o),o.tag=3,o}function Jx(o,l,u,p){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var b=p.value;o.payload=function(){return y(b)},o.callback=function(){Fx(l,u,p)}}var C=u.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(o.callback=function(){Fx(l,u,p),typeof y!="function"&&(ao===null?ao=new Set([this]):ao.add(this));var A=p.stack;this.componentDidCatch(p.value,{componentStack:A!==null?A:""})})}function Bj(o,l,u,p,y){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(l=u.alternate,l!==null&&Sl(l,u,y,!0),u=kn.current,u!==null){switch(u.tag){case 31:case 13:return Yn===null?Sf():u.alternate===null&&Nt===0&&(Nt=3),u.flags&=-257,u.flags|=65536,u.lanes=y,p===Hd?u.flags|=16384:(l=u.updateQueue,l===null?u.updateQueue=new Set([p]):l.add(p),_0(o,p,y)),!1;case 22:return u.flags|=65536,p===Hd?u.flags|=16384:(l=u.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=l):(u=l.retryQueue,u===null?l.retryQueue=new Set([p]):u.add(p)),_0(o,p,y)),!1}throw Error(n(435,u.tag))}return _0(o,p,y),Sf(),!1}if(st)return l=kn.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=y,p!==mO&&(o=Error(n(422),{cause:p}),th(Wn(o,u)))):(p!==mO&&(l=Error(n(423),{cause:p}),th(Wn(l,u))),o=o.current.alternate,o.flags|=65536,y&=-y,o.lanes|=y,p=Wn(p,u),y=FO(o.stateNode,p,y),TO(o,y),Nt!==4&&(Nt=2)),!1;var b=Error(n(520),{cause:p});if(b=Wn(b,u),Sh===null?Sh=[b]:Sh.push(b),Nt!==4&&(Nt=2),l===null)return!0;p=Wn(p,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,o=y&-y,u.lanes|=o,o=FO(u.stateNode,p,o),TO(u,o),!1;case 1:if(l=u.type,b=u.stateNode,(u.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(ao===null||!ao.has(b))))return u.flags|=65536,y&=-y,u.lanes|=y,y=Kx(y),Jx(y,o,u,p),TO(u,y),!1}u=u.return}while(u!==null);return!1}var KO=Error(n(461)),ti=!1;function Ti(o,l,u,p){l.child=o===null?nx(l,null,u,p):pa(l,o.child,u,p)}function ew(o,l,u,p,y){u=u.render;var b=l.ref;if("ref"in p){var C={};for(var A in p)A!=="ref"&&(C[A]=p[A])}else C=p;return ha(l),p=AO(o,l,u,C,b,y),A=MO(),o!==null&&!ti?(zO(o,l,y),hs(o,l,y)):(st&&A&&pO(l),l.flags|=1,Ti(o,l,p,y),l.child)}function tw(o,l,u,p,y){if(o===null){var b=u.type;return typeof b=="function"&&!uO(b)&&b.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=b,iw(o,l,b,p,y)):(o=Zd(u.type,null,p,l,l.mode,y),o.ref=l.ref,o.return=l,l.child=o)}if(b=o.child,!o0(o,y)){var C=b.memoizedProps;if(u=u.compare,u=u!==null?u:Kc,u(C,p)&&o.ref===l.ref)return hs(o,l,y)}return l.flags|=1,o=rs(b,p),o.ref=l.ref,o.return=l,l.child=o}function iw(o,l,u,p,y){if(o!==null){var b=o.memoizedProps;if(Kc(b,p)&&o.ref===l.ref)if(ti=!1,l.pendingProps=p=b,o0(o,y))(o.flags&131072)!==0&&(ti=!0);else return l.lanes=o.lanes,hs(o,l,y)}return JO(o,l,u,p,y)}function nw(o,l,u,p){var y=p.children,b=o!==null?o.memoizedState:null;if(o===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((l.flags&128)!==0){if(b=b!==null?b.baseLanes|u:u,o!==null){for(p=l.child=o.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;p=y&~b}else p=0,l.child=null;return rw(o,l,b,u,p)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&Id(l,b!==null?b.cachePool:null),b!==null?ox(l,b):$O(),ax(l);else return p=l.lanes=536870912,rw(o,l,b!==null?b.baseLanes|u:u,u,p)}else b!==null?(Id(l,b.cachePool),ox(l,b),no(),l.memoizedState=null):(o!==null&&Id(l,null),$O(),no());return Ti(o,l,y,u),l.child}function fh(o,l){return o!==null&&o.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function rw(o,l,u,p,y){var b=xO();return b=b===null?null:{parent:Jt._currentValue,pool:b},l.memoizedState={baseLanes:u,cachePool:b},o!==null&&Id(l,null),$O(),ax(l),o!==null&&Sl(o,l,p,!0),l.childLanes=y,null}function cf(o,l){return l=uf({mode:l.mode,children:l.children},o.mode),l.ref=o.ref,o.child=l,l.return=o,l}function sw(o,l,u){return pa(l,o.child,null,u),o=cf(l,l.pendingProps),o.flags|=2,Cn(l),l.memoizedState=null,o}function Lj(o,l,u){var p=l.pendingProps,y=(l.flags&128)!==0;if(l.flags&=-129,o===null){if(st){if(p.mode==="hidden")return o=cf(l,p),l.lanes=536870912,fh(null,o);if(EO(l),(o=$t)?(o=Ok(o,In),o=o!==null&&o.data==="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:Us!==null?{id:Cr,overflow:Tr}:null,retryLane:536870912,hydrationErrors:null},u=Z_(o),u.return=l,l.child=u,ki=l,$t=null)):o=null,o===null)throw Fs(l);return l.lanes=536870912,null}return cf(l,p)}var b=o.memoizedState;if(b!==null){var C=b.dehydrated;if(EO(l),y)if(l.flags&256)l.flags&=-257,l=sw(o,l,u);else if(l.memoizedState!==null)l.child=o.child,l.flags|=128,l=null;else throw Error(n(558));else if(ti||Sl(o,l,u,!1),y=(u&o.childLanes)!==0,ti||y){if(p=wt,p!==null&&(C=Sd(p,u),C!==0&&C!==b.retryLane))throw b.retryLane=C,oa(o,C),pn(p,o,C),KO;Sf(),l=sw(o,l,u)}else o=b.treeContext,$t=Hn(C.nextSibling),ki=l,st=!0,Gs=null,In=!1,o!==null&&V_(l,o),l=cf(l,p),l.flags|=4096;return l}return o=rs(o.child,{mode:p.mode,children:p.children}),o.ref=l.ref,l.child=o,o.return=l,o}function hf(o,l){var u=l.ref;if(u===null)o!==null&&o.ref!==null&&(l.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(n(284));(o===null||o.ref!==u)&&(l.flags|=4194816)}}function JO(o,l,u,p,y){return ha(l),u=AO(o,l,u,p,void 0,y),p=MO(),o!==null&&!ti?(zO(o,l,y),hs(o,l,y)):(st&&p&&pO(l),l.flags|=1,Ti(o,l,u,y),l.child)}function ow(o,l,u,p,y,b){return ha(l),l.updateQueue=null,u=cx(l,p,u,y),lx(o),p=MO(),o!==null&&!ti?(zO(o,l,b),hs(o,l,b)):(st&&p&&pO(l),l.flags|=1,Ti(o,l,u,b),l.child)}function aw(o,l,u,p,y){if(ha(l),l.stateNode===null){var b=ml,C=u.contextType;typeof C=="object"&&C!==null&&(b=Ci(C)),b=new u(p,b),l.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=GO,l.stateNode=b,b._reactInternals=l,b=l.stateNode,b.props=p,b.state=l.memoizedState,b.refs={},kO(l),C=u.contextType,b.context=typeof C=="object"&&C!==null?Ci(C):ml,b.state=l.memoizedState,C=u.getDerivedStateFromProps,typeof C=="function"&&(UO(l,u,C,p),b.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(C=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),C!==b.state&&GO.enqueueReplaceState(b,b.state,null),lh(l,p,b,y),ah(),b.state=l.memoizedState),typeof b.componentDidMount=="function"&&(l.flags|=4194308),p=!0}else if(o===null){b=l.stateNode;var A=l.memoizedProps,Y=ma(u,A);b.props=Y;var te=b.context,se=u.contextType;C=ml,typeof se=="object"&&se!==null&&(C=Ci(se));var he=u.getDerivedStateFromProps;se=typeof he=="function"||typeof b.getSnapshotBeforeUpdate=="function",A=l.pendingProps!==A,se||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(A||te!==C)&&Yx(l,b,p,C),Js=!1;var ne=l.memoizedState;b.state=ne,lh(l,p,b,y),ah(),te=l.memoizedState,A||ne!==te||Js?(typeof he=="function"&&(UO(l,u,he,p),te=l.memoizedState),(Y=Js||Ix(l,u,Y,p,ne,te,C))?(se||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(l.flags|=4194308)):(typeof b.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=p,l.memoizedState=te),b.props=p,b.state=te,b.context=C,p=Y):(typeof b.componentDidMount=="function"&&(l.flags|=4194308),p=!1)}else{b=l.stateNode,CO(o,l),C=l.memoizedProps,se=ma(u,C),b.props=se,he=l.pendingProps,ne=b.context,te=u.contextType,Y=ml,typeof te=="object"&&te!==null&&(Y=Ci(te)),A=u.getDerivedStateFromProps,(te=typeof A=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(C!==he||ne!==Y)&&Yx(l,b,p,Y),Js=!1,ne=l.memoizedState,b.state=ne,lh(l,p,b,y),ah();var re=l.memoizedState;C!==he||ne!==re||Js||o!==null&&o.dependencies!==null&&qd(o.dependencies)?(typeof A=="function"&&(UO(l,u,A,p),re=l.memoizedState),(se=Js||Ix(l,u,se,p,ne,re,Y)||o!==null&&o.dependencies!==null&&qd(o.dependencies))?(te||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(p,re,Y),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(p,re,Y)),typeof b.componentDidUpdate=="function"&&(l.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof b.componentDidUpdate!="function"||C===o.memoizedProps&&ne===o.memoizedState||(l.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||C===o.memoizedProps&&ne===o.memoizedState||(l.flags|=1024),l.memoizedProps=p,l.memoizedState=re),b.props=p,b.state=re,b.context=Y,p=se):(typeof b.componentDidUpdate!="function"||C===o.memoizedProps&&ne===o.memoizedState||(l.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||C===o.memoizedProps&&ne===o.memoizedState||(l.flags|=1024),p=!1)}return b=p,hf(o,l),p=(l.flags&128)!==0,b||p?(b=l.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:b.render(),l.flags|=1,o!==null&&p?(l.child=pa(l,o.child,null,y),l.child=pa(l,null,u,y)):Ti(o,l,u,y),l.memoizedState=b.state,o=l.child):o=hs(o,l,y),o}function lw(o,l,u,p){return la(),l.flags|=256,Ti(o,l,u,p),l.child}var e0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function t0(o){return{baseLanes:o,cachePool:F_()}}function i0(o,l,u){return o=o!==null?o.childLanes&~u:0,l&&(o|=Qn),o}function cw(o,l,u){var p=l.pendingProps,y=!1,b=(l.flags&128)!==0,C;if((C=b)||(C=o!==null&&o.memoizedState===null?!1:(Vt.current&2)!==0),C&&(y=!0,l.flags&=-129),C=(l.flags&32)!==0,l.flags&=-33,o===null){if(st){if(y?io(l):no(),(o=$t)?(o=Ok(o,In),o=o!==null&&o.data!=="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:Us!==null?{id:Cr,overflow:Tr}:null,retryLane:536870912,hydrationErrors:null},u=Z_(o),u.return=l,l.child=u,ki=l,$t=null)):o=null,o===null)throw Fs(l);return B0(o)?l.lanes=32:l.lanes=536870912,null}var A=p.children;return p=p.fallback,y?(no(),y=l.mode,A=uf({mode:"hidden",children:A},y),p=aa(p,y,u,null),A.return=l,p.return=l,A.sibling=p,l.child=A,p=l.child,p.memoizedState=t0(u),p.childLanes=i0(o,C,u),l.memoizedState=e0,fh(null,p)):(io(l),n0(l,A))}var Y=o.memoizedState;if(Y!==null&&(A=Y.dehydrated,A!==null)){if(b)l.flags&256?(io(l),l.flags&=-257,l=r0(o,l,u)):l.memoizedState!==null?(no(),l.child=o.child,l.flags|=128,l=null):(no(),A=p.fallback,y=l.mode,p=uf({mode:"visible",children:p.children},y),A=aa(A,y,u,null),A.flags|=2,p.return=l,A.return=l,p.sibling=A,l.child=p,pa(l,o.child,null,u),p=l.child,p.memoizedState=t0(u),p.childLanes=i0(o,C,u),l.memoizedState=e0,l=fh(null,p));else if(io(l),B0(A)){if(C=A.nextSibling&&A.nextSibling.dataset,C)var te=C.dgst;C=te,p=Error(n(419)),p.stack="",p.digest=C,th({value:p,source:null,stack:null}),l=r0(o,l,u)}else if(ti||Sl(o,l,u,!1),C=(u&o.childLanes)!==0,ti||C){if(C=wt,C!==null&&(p=Sd(C,u),p!==0&&p!==Y.retryLane))throw Y.retryLane=p,oa(o,p),pn(C,o,p),KO;D0(A)||Sf(),l=r0(o,l,u)}else D0(A)?(l.flags|=192,l.child=o.child,l=null):(o=Y.treeContext,$t=Hn(A.nextSibling),ki=l,st=!0,Gs=null,In=!1,o!==null&&V_(l,o),l=n0(l,p.children),l.flags|=4096);return l}return y?(no(),A=p.fallback,y=l.mode,Y=o.child,te=Y.sibling,p=rs(Y,{mode:"hidden",children:p.children}),p.subtreeFlags=Y.subtreeFlags&65011712,te!==null?A=rs(te,A):(A=aa(A,y,u,null),A.flags|=2),A.return=l,p.return=l,p.sibling=A,l.child=p,fh(null,p),p=l.child,A=o.child.memoizedState,A===null?A=t0(u):(y=A.cachePool,y!==null?(Y=Jt._currentValue,y=y.parent!==Y?{parent:Y,pool:Y}:y):y=F_(),A={baseLanes:A.baseLanes|u,cachePool:y}),p.memoizedState=A,p.childLanes=i0(o,C,u),l.memoizedState=e0,fh(o.child,p)):(io(l),u=o.child,o=u.sibling,u=rs(u,{mode:"visible",children:p.children}),u.return=l,u.sibling=null,o!==null&&(C=l.deletions,C===null?(l.deletions=[o],l.flags|=16):C.push(o)),l.child=u,l.memoizedState=null,u)}function n0(o,l){return l=uf({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function uf(o,l){return o=wn(22,o,null,l),o.lanes=0,o}function r0(o,l,u){return pa(l,o.child,null,u),o=n0(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function hw(o,l,u){o.lanes|=l;var p=o.alternate;p!==null&&(p.lanes|=l),yO(o.return,l,u)}function s0(o,l,u,p,y,b){var C=o.memoizedState;C===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:y,treeForkCount:b}:(C.isBackwards=l,C.rendering=null,C.renderingStartTime=0,C.last=p,C.tail=u,C.tailMode=y,C.treeForkCount=b)}function uw(o,l,u){var p=l.pendingProps,y=p.revealOrder,b=p.tail;p=p.children;var C=Vt.current,A=(C&2)!==0;if(A?(C=C&1|2,l.flags|=128):C&=1,K(Vt,C),Ti(o,l,p,u),p=st?eh:0,!A&&o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&hw(o,u,l);else if(o.tag===19)hw(o,u,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(y){case"forwards":for(u=l.child,y=null;u!==null;)o=u.alternate,o!==null&&Kd(o)===null&&(y=u),u=u.sibling;u=y,u===null?(y=l.child,l.child=null):(y=u.sibling,u.sibling=null),s0(l,!1,y,u,b,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=l.child,l.child=null;y!==null;){if(o=y.alternate,o!==null&&Kd(o)===null){l.child=y;break}o=y.sibling,y.sibling=u,u=y,y=o}s0(l,!0,u,null,b,p);break;case"together":s0(l,!1,null,null,void 0,p);break;default:l.memoizedState=null}return l.child}function hs(o,l,u){if(o!==null&&(l.dependencies=o.dependencies),oo|=l.lanes,(u&l.childLanes)===0)if(o!==null){if(Sl(o,l,u,!1),(u&l.childLanes)===0)return null}else return null;if(o!==null&&l.child!==o.child)throw Error(n(153));if(l.child!==null){for(o=l.child,u=rs(o,o.pendingProps),l.child=u,u.return=l;o.sibling!==null;)o=o.sibling,u=u.sibling=rs(o,o.pendingProps),u.return=l;u.sibling=null}return l.child}function o0(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&qd(o)))}function Xj(o,l,u){switch(l.tag){case 3:fe(l,l.stateNode.containerInfo),Ks(l,Jt,o.memoizedState.cache),la();break;case 27:case 5:De(l);break;case 4:fe(l,l.stateNode.containerInfo);break;case 10:Ks(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,EO(l),null;break;case 13:var p=l.memoizedState;if(p!==null)return p.dehydrated!==null?(io(l),l.flags|=128,null):(u&l.child.childLanes)!==0?cw(o,l,u):(io(l),o=hs(o,l,u),o!==null?o.sibling:null);io(l);break;case 19:var y=(o.flags&128)!==0;if(p=(u&l.childLanes)!==0,p||(Sl(o,l,u,!1),p=(u&l.childLanes)!==0),y){if(p)return uw(o,l,u);l.flags|=128}if(y=l.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),K(Vt,Vt.current),p)break;return null;case 22:return l.lanes=0,nw(o,l,u,l.pendingProps);case 24:Ks(l,Jt,o.memoizedState.cache)}return hs(o,l,u)}function dw(o,l,u){if(o!==null)if(o.memoizedProps!==l.pendingProps)ti=!0;else{if(!o0(o,u)&&(l.flags&128)===0)return ti=!1,Xj(o,l,u);ti=(o.flags&131072)!==0}else ti=!1,st&&(l.flags&1048576)!==0&&q_(l,eh,l.index);switch(l.lanes=0,l.tag){case 16:e:{var p=l.pendingProps;if(o=da(l.elementType),l.type=o,typeof o=="function")uO(o)?(p=ma(o,p),l.tag=1,l=aw(null,l,o,p,u)):(l.tag=0,l=JO(null,l,o,p,u));else{if(o!=null){var y=o.$$typeof;if(y===T){l.tag=11,l=ew(null,l,o,p,u);break e}else if(y===R){l.tag=14,l=tw(null,l,o,p,u);break e}}throw l=E(o)||o,Error(n(306,l,""))}}return l;case 0:return JO(o,l,l.type,l.pendingProps,u);case 1:return p=l.type,y=ma(p,l.pendingProps),aw(o,l,p,y,u);case 3:e:{if(fe(l,l.stateNode.containerInfo),o===null)throw Error(n(387));p=l.pendingProps;var b=l.memoizedState;y=b.element,CO(o,l),lh(l,p,null,u);var C=l.memoizedState;if(p=C.cache,Ks(l,Jt,p),p!==b.cache&&SO(l,[Jt],u,!0),ah(),p=C.element,b.isDehydrated)if(b={element:p,isDehydrated:!1,cache:C.cache},l.updateQueue.baseState=b,l.memoizedState=b,l.flags&256){l=lw(o,l,p,u);break e}else if(p!==y){y=Wn(Error(n(424)),l),th(y),l=lw(o,l,p,u);break e}else{switch(o=l.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for($t=Hn(o.firstChild),ki=l,st=!0,Gs=null,In=!0,u=nx(l,null,p,u),l.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(la(),p===y){l=hs(o,l,u);break e}Ti(o,l,p,u)}l=l.child}return l;case 26:return hf(o,l),o===null?(u=xk(l.type,null,l.pendingProps,null))?l.memoizedState=u:st||(u=l.type,o=l.pendingProps,p=Tf(de.current).createElement(u),p[li]=l,p[Di]=o,Qi(p,u,o),Kt(p),l.stateNode=p):l.memoizedState=xk(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return De(l),o===null&&st&&(p=l.stateNode=Sk(l.type,l.pendingProps,de.current),ki=l,In=!0,y=$t,uo(l.type)?(L0=y,$t=Hn(p.firstChild)):$t=y),Ti(o,l,l.pendingProps.children,u),hf(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&st&&((y=p=$t)&&(p=m3(p,l.type,l.pendingProps,In),p!==null?(l.stateNode=p,ki=l,$t=Hn(p.firstChild),In=!1,y=!0):y=!1),y||Fs(l)),De(l),y=l.type,b=l.pendingProps,C=o!==null?o.memoizedProps:null,p=b.children,M0(y,b)?p=null:C!==null&&M0(y,C)&&(l.flags|=32),l.memoizedState!==null&&(y=AO(o,l,Ej,null,null,u),Qh._currentValue=y),hf(o,l),Ti(o,l,p,u),l.child;case 6:return o===null&&st&&((o=u=$t)&&(u=O3(u,l.pendingProps,In),u!==null?(l.stateNode=u,ki=l,$t=null,o=!0):o=!1),o||Fs(l)),null;case 13:return cw(o,l,u);case 4:return fe(l,l.stateNode.containerInfo),p=l.pendingProps,o===null?l.child=pa(l,null,p,u):Ti(o,l,p,u),l.child;case 11:return ew(o,l,l.type,l.pendingProps,u);case 7:return Ti(o,l,l.pendingProps,u),l.child;case 8:return Ti(o,l,l.pendingProps.children,u),l.child;case 12:return Ti(o,l,l.pendingProps.children,u),l.child;case 10:return p=l.pendingProps,Ks(l,l.type,p.value),Ti(o,l,p.children,u),l.child;case 9:return y=l.type._context,p=l.pendingProps.children,ha(l),y=Ci(y),p=p(y),l.flags|=1,Ti(o,l,p,u),l.child;case 14:return tw(o,l,l.type,l.pendingProps,u);case 15:return iw(o,l,l.type,l.pendingProps,u);case 19:return uw(o,l,u);case 31:return Lj(o,l,u);case 22:return nw(o,l,u,l.pendingProps);case 24:return ha(l),p=Ci(Jt),o===null?(y=xO(),y===null&&(y=wt,b=bO(),y.pooledCache=b,b.refCount++,b!==null&&(y.pooledCacheLanes|=u),y=b),l.memoizedState={parent:p,cache:y},kO(l),Ks(l,Jt,y)):((o.lanes&u)!==0&&(CO(o,l),lh(l,null,null,u),ah()),y=o.memoizedState,b=l.memoizedState,y.parent!==p?(y={parent:p,cache:p},l.memoizedState=y,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=y),Ks(l,Jt,p)):(p=b.cache,Ks(l,Jt,p),p!==y.cache&&SO(l,[Jt],u,!0))),Ti(o,l,l.pendingProps.children,u),l.child;case 29:throw l.pendingProps}throw Error(n(156,l.tag))}function us(o){o.flags|=4}function a0(o,l,u,p,y){if((l=(o.mode&32)!==0)&&(l=!1),l){if(o.flags|=16777216,(y&335544128)===y)if(o.stateNode.complete)o.flags|=8192;else if(Lw())o.flags|=8192;else throw fa=Hd,wO}else o.flags&=-16777217}function fw(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!Qk(l))if(Lw())o.flags|=8192;else throw fa=Hd,wO}function df(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?Od():536870912,o.lanes|=l,Rl|=l)}function ph(o,l){if(!st)switch(o.tailMode){case"hidden":l=o.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?o.tail=null:u.sibling=null;break;case"collapsed":u=o.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:p.sibling=null}}function Pt(o){var l=o.alternate!==null&&o.alternate.child===o.child,u=0,p=0;if(l)for(var y=o.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags&65011712,p|=y.flags&65011712,y.return=o,y=y.sibling;else for(y=o.child;y!==null;)u|=y.lanes|y.childLanes,p|=y.subtreeFlags,p|=y.flags,y.return=o,y=y.sibling;return o.subtreeFlags|=p,o.childLanes=u,l}function Nj(o,l,u){var p=l.pendingProps;switch(gO(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(l),null;case 1:return Pt(l),null;case 3:return u=l.stateNode,p=null,o!==null&&(p=o.memoizedState.cache),l.memoizedState.cache!==p&&(l.flags|=2048),as(Jt),ve(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(o===null||o.child===null)&&(yl(l)?us(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,OO())),Pt(l),null;case 26:var y=l.type,b=l.memoizedState;return o===null?(us(l),b!==null?(Pt(l),fw(l,b)):(Pt(l),a0(l,y,null,p,u))):b?b!==o.memoizedState?(us(l),Pt(l),fw(l,b)):(Pt(l),l.flags&=-16777217):(o=o.memoizedProps,o!==p&&us(l),Pt(l),a0(l,y,o,p,u)),null;case 27:if(Ee(l),u=de.current,y=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&us(l);else{if(!p){if(l.stateNode===null)throw Error(n(166));return Pt(l),null}o=ie.current,yl(l)?I_(l):(o=Sk(y,p,u),l.stateNode=o,us(l))}return Pt(l),null;case 5:if(Ee(l),y=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&us(l);else{if(!p){if(l.stateNode===null)throw Error(n(166));return Pt(l),null}if(b=ie.current,yl(l))I_(l);else{var C=Tf(de.current);switch(b){case 1:b=C.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:b=C.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":b=C.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":b=C.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":b=C.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof p.is=="string"?C.createElement("select",{is:p.is}):C.createElement("select"),p.multiple?b.multiple=!0:p.size&&(b.size=p.size);break;default:b=typeof p.is=="string"?C.createElement(y,{is:p.is}):C.createElement(y)}}b[li]=l,b[Di]=p;e:for(C=l.child;C!==null;){if(C.tag===5||C.tag===6)b.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===l)break e;for(;C.sibling===null;){if(C.return===null||C.return===l)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}l.stateNode=b;e:switch(Qi(b,y,p),y){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&us(l)}}return Pt(l),a0(l,l.type,o===null?null:o.memoizedProps,l.pendingProps,u),null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==p&&us(l);else{if(typeof p!="string"&&l.stateNode===null)throw Error(n(166));if(o=de.current,yl(l)){if(o=l.stateNode,u=l.memoizedProps,p=null,y=ki,y!==null)switch(y.tag){case 27:case 5:p=y.memoizedProps}o[li]=l,o=!!(o.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||ck(o.nodeValue,u)),o||Fs(l,!0)}else o=Tf(o).createTextNode(p),o[li]=l,l.stateNode=o}return Pt(l),null;case 31:if(u=l.memoizedState,o===null||o.memoizedState!==null){if(p=yl(l),u!==null){if(o===null){if(!p)throw Error(n(318));if(o=l.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(557));o[li]=l}else la(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Pt(l),o=!1}else u=OO(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=u),o=!0;if(!o)return l.flags&256?(Cn(l),l):(Cn(l),null);if((l.flags&128)!==0)throw Error(n(558))}return Pt(l),null;case 13:if(p=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=yl(l),p!==null&&p.dehydrated!==null){if(o===null){if(!y)throw Error(n(318));if(y=l.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(n(317));y[li]=l}else la(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Pt(l),y=!1}else y=OO(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=y),y=!0;if(!y)return l.flags&256?(Cn(l),l):(Cn(l),null)}return Cn(l),(l.flags&128)!==0?(l.lanes=u,l):(u=p!==null,o=o!==null&&o.memoizedState!==null,u&&(p=l.child,y=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(y=p.alternate.memoizedState.cachePool.pool),b=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(b=p.memoizedState.cachePool.pool),b!==y&&(p.flags|=2048)),u!==o&&u&&(l.child.flags|=8192),df(l,l.updateQueue),Pt(l),null);case 4:return ve(),o===null&&$0(l.stateNode.containerInfo),Pt(l),null;case 10:return as(l.type),Pt(l),null;case 19:if(q(Vt),p=l.memoizedState,p===null)return Pt(l),null;if(y=(l.flags&128)!==0,b=p.rendering,b===null)if(y)ph(p,!1);else{if(Nt!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(b=Kd(o),b!==null){for(l.flags|=128,ph(p,!1),o=b.updateQueue,l.updateQueue=o,df(l,o),l.subtreeFlags=0,o=u,u=l.child;u!==null;)N_(u,o),u=u.sibling;return K(Vt,Vt.current&1|2),st&&ss(l,p.treeForkCount),l.child}o=o.sibling}p.tail!==null&&Le()>Of&&(l.flags|=128,y=!0,ph(p,!1),l.lanes=4194304)}else{if(!y)if(o=Kd(b),o!==null){if(l.flags|=128,y=!0,o=o.updateQueue,l.updateQueue=o,df(l,o),ph(p,!0),p.tail===null&&p.tailMode==="hidden"&&!b.alternate&&!st)return Pt(l),null}else 2*Le()-p.renderingStartTime>Of&&u!==536870912&&(l.flags|=128,y=!0,ph(p,!1),l.lanes=4194304);p.isBackwards?(b.sibling=l.child,l.child=b):(o=p.last,o!==null?o.sibling=b:l.child=b,p.last=b)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=Le(),o.sibling=null,u=Vt.current,K(Vt,y?u&1|2:u&1),st&&ss(l,p.treeForkCount),o):(Pt(l),null);case 22:case 23:return Cn(l),PO(),p=l.memoizedState!==null,o!==null?o.memoizedState!==null!==p&&(l.flags|=8192):p&&(l.flags|=8192),p?(u&536870912)!==0&&(l.flags&128)===0&&(Pt(l),l.subtreeFlags&6&&(l.flags|=8192)):Pt(l),u=l.updateQueue,u!==null&&df(l,u.retryQueue),u=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==u&&(l.flags|=2048),o!==null&&q(ua),null;case 24:return u=null,o!==null&&(u=o.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),as(Jt),Pt(l),null;case 25:return null;case 30:return null}throw Error(n(156,l.tag))}function Zj(o,l){switch(gO(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return as(Jt),ve(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 26:case 27:case 5:return Ee(l),null;case 31:if(l.memoizedState!==null){if(Cn(l),l.alternate===null)throw Error(n(340));la()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 13:if(Cn(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));la()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return q(Vt),null;case 4:return ve(),null;case 10:return as(l.type),null;case 22:case 23:return Cn(l),PO(),o!==null&&q(ua),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return as(Jt),null;case 25:return null;default:return null}}function pw(o,l){switch(gO(l),l.tag){case 3:as(Jt),ve();break;case 26:case 27:case 5:Ee(l);break;case 4:ve();break;case 31:l.memoizedState!==null&&Cn(l);break;case 13:Cn(l);break;case 19:q(Vt);break;case 10:as(l.type);break;case 22:case 23:Cn(l),PO(),o!==null&&q(ua);break;case 24:as(Jt)}}function gh(o,l){try{var u=l.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var y=p.next;u=y;do{if((u.tag&o)===o){p=void 0;var b=u.create,C=u.inst;p=b(),C.destroy=p}u=u.next}while(u!==y)}}catch(A){yt(l,l.return,A)}}function ro(o,l,u){try{var p=l.updateQueue,y=p!==null?p.lastEffect:null;if(y!==null){var b=y.next;p=b;do{if((p.tag&o)===o){var C=p.inst,A=C.destroy;if(A!==void 0){C.destroy=void 0,y=l;var Y=u,te=A;try{te()}catch(se){yt(y,Y,se)}}}p=p.next}while(p!==b)}}catch(se){yt(l,l.return,se)}}function gw(o){var l=o.updateQueue;if(l!==null){var u=o.stateNode;try{sx(l,u)}catch(p){yt(o,o.return,p)}}}function mw(o,l,u){u.props=ma(o.type,o.memoizedProps),u.state=o.memoizedState;try{u.componentWillUnmount()}catch(p){yt(o,l,p)}}function mh(o,l){try{var u=o.ref;if(u!==null){switch(o.tag){case 26:case 27:case 5:var p=o.stateNode;break;case 30:p=o.stateNode;break;default:p=o.stateNode}typeof u=="function"?o.refCleanup=u(p):u.current=p}}catch(y){yt(o,l,y)}}function Qr(o,l){var u=o.ref,p=o.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(y){yt(o,l,y)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){yt(o,l,y)}else u.current=null}function Ow(o){var l=o.type,u=o.memoizedProps,p=o.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(y){yt(o,o.return,y)}}function l0(o,l,u){try{var p=o.stateNode;h3(p,o.type,u,l),p[Di]=l}catch(y){yt(o,o.return,y)}}function vw(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&uo(o.type)||o.tag===4}function c0(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||vw(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&uo(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function h0(o,l,u){var p=o.tag;if(p===5||p===6)o=o.stateNode,l?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(o,l):(l=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,l.appendChild(o),u=u._reactRootContainer,u!=null||l.onclick!==null||(l.onclick=is));else if(p!==4&&(p===27&&uo(o.type)&&(u=o.stateNode,l=null),o=o.child,o!==null))for(h0(o,l,u),o=o.sibling;o!==null;)h0(o,l,u),o=o.sibling}function ff(o,l,u){var p=o.tag;if(p===5||p===6)o=o.stateNode,l?u.insertBefore(o,l):u.appendChild(o);else if(p!==4&&(p===27&&uo(o.type)&&(u=o.stateNode),o=o.child,o!==null))for(ff(o,l,u),o=o.sibling;o!==null;)ff(o,l,u),o=o.sibling}function yw(o){var l=o.stateNode,u=o.memoizedProps;try{for(var p=o.type,y=l.attributes;y.length;)l.removeAttributeNode(y[0]);Qi(l,p,u),l[li]=o,l[Di]=u}catch(b){yt(o,o.return,b)}}var ds=!1,ii=!1,u0=!1,Sw=typeof WeakSet=="function"?WeakSet:Set,mi=null;function Wj(o,l){if(o=o.containerInfo,R0=Mf,o=R_(o),rO(o)){if("selectionStart"in o)var u={start:o.selectionStart,end:o.selectionEnd};else e:{u=(u=o.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var y=p.anchorOffset,b=p.focusNode;p=p.focusOffset;try{u.nodeType,b.nodeType}catch{u=null;break e}var C=0,A=-1,Y=-1,te=0,se=0,he=o,ne=null;t:for(;;){for(var re;he!==u||y!==0&&he.nodeType!==3||(A=C+y),he!==b||p!==0&&he.nodeType!==3||(Y=C+p),he.nodeType===3&&(C+=he.nodeValue.length),(re=he.firstChild)!==null;)ne=he,he=re;for(;;){if(he===o)break t;if(ne===u&&++te===y&&(A=C),ne===b&&++se===p&&(Y=C),(re=he.nextSibling)!==null)break;he=ne,ne=he.parentNode}he=re}u=A===-1||Y===-1?null:{start:A,end:Y}}else u=null}u=u||{start:0,end:0}}else u=null;for(A0={focusedElem:o,selectionRange:u},Mf=!1,mi=l;mi!==null;)if(l=mi,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,mi=o;else for(;mi!==null;){switch(l=mi,b=l.alternate,o=l.flags,l.tag){case 0:if((o&4)!==0&&(o=l.updateQueue,o=o!==null?o.events:null,o!==null))for(u=0;u<o.length;u++)y=o[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&b!==null){o=void 0,u=l,y=b.memoizedProps,b=b.memoizedState,p=u.stateNode;try{var we=ma(u.type,y);o=p.getSnapshotBeforeUpdate(we,b),p.__reactInternalSnapshotBeforeUpdate=o}catch(je){yt(u,u.return,je)}}break;case 3:if((o&1024)!==0){if(o=l.stateNode.containerInfo,u=o.nodeType,u===9)j0(o);else if(u===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":j0(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(n(163))}if(o=l.sibling,o!==null){o.return=l.return,mi=o;break}mi=l.return}}function bw(o,l,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:ps(o,u),p&4&&gh(5,u);break;case 1:if(ps(o,u),p&4)if(o=u.stateNode,l===null)try{o.componentDidMount()}catch(C){yt(u,u.return,C)}else{var y=ma(u.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(y,l,o.__reactInternalSnapshotBeforeUpdate)}catch(C){yt(u,u.return,C)}}p&64&&gw(u),p&512&&mh(u,u.return);break;case 3:if(ps(o,u),p&64&&(o=u.updateQueue,o!==null)){if(l=null,u.child!==null)switch(u.child.tag){case 27:case 5:l=u.child.stateNode;break;case 1:l=u.child.stateNode}try{sx(o,l)}catch(C){yt(u,u.return,C)}}break;case 27:l===null&&p&4&&yw(u);case 26:case 5:ps(o,u),l===null&&p&4&&Ow(u),p&512&&mh(u,u.return);break;case 12:ps(o,u);break;case 31:ps(o,u),p&4&&ww(o,u);break;case 13:ps(o,u),p&4&&kw(o,u),p&64&&(o=u.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(u=Kj.bind(null,u),v3(o,u))));break;case 22:if(p=u.memoizedState!==null||ds,!p){l=l!==null&&l.memoizedState!==null||ii,y=ds;var b=ii;ds=p,(ii=l)&&!b?gs(o,u,(u.subtreeFlags&8772)!==0):ps(o,u),ds=y,ii=b}break;case 30:break;default:ps(o,u)}}function _w(o){var l=o.alternate;l!==null&&(o.alternate=null,_w(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&Zc(l)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var Rt=null,hn=!1;function fs(o,l,u){for(u=u.child;u!==null;)xw(o,l,u),u=u.sibling}function xw(o,l,u){if(Ii&&typeof Ii.onCommitFiberUnmount=="function")try{Ii.onCommitFiberUnmount(Fo,u)}catch{}switch(u.tag){case 26:ii||Qr(u,l),fs(o,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:ii||Qr(u,l);var p=Rt,y=hn;uo(u.type)&&(Rt=u.stateNode,hn=!1),fs(o,l,u),kh(u.stateNode),Rt=p,hn=y;break;case 5:ii||Qr(u,l);case 6:if(p=Rt,y=hn,Rt=null,fs(o,l,u),Rt=p,hn=y,Rt!==null)if(hn)try{(Rt.nodeType===9?Rt.body:Rt.nodeName==="HTML"?Rt.ownerDocument.body:Rt).removeChild(u.stateNode)}catch(b){yt(u,l,b)}else try{Rt.removeChild(u.stateNode)}catch(b){yt(u,l,b)}break;case 18:Rt!==null&&(hn?(o=Rt,gk(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,u.stateNode),Xl(o)):gk(Rt,u.stateNode));break;case 4:p=Rt,y=hn,Rt=u.stateNode.containerInfo,hn=!0,fs(o,l,u),Rt=p,hn=y;break;case 0:case 11:case 14:case 15:ro(2,u,l),ii||ro(4,u,l),fs(o,l,u);break;case 1:ii||(Qr(u,l),p=u.stateNode,typeof p.componentWillUnmount=="function"&&mw(u,l,p)),fs(o,l,u);break;case 21:fs(o,l,u);break;case 22:ii=(p=ii)||u.memoizedState!==null,fs(o,l,u),ii=p;break;default:fs(o,l,u)}}function ww(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{Xl(o)}catch(u){yt(l,l.return,u)}}}function kw(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{Xl(o)}catch(u){yt(l,l.return,u)}}function qj(o){switch(o.tag){case 31:case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new Sw),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new Sw),l;default:throw Error(n(435,o.tag))}}function pf(o,l){var u=qj(o);l.forEach(function(p){if(!u.has(p)){u.add(p);var y=Jj.bind(null,o,p);p.then(y,y)}})}function un(o,l){var u=l.deletions;if(u!==null)for(var p=0;p<u.length;p++){var y=u[p],b=o,C=l,A=C;e:for(;A!==null;){switch(A.tag){case 27:if(uo(A.type)){Rt=A.stateNode,hn=!1;break e}break;case 5:Rt=A.stateNode,hn=!1;break e;case 3:case 4:Rt=A.stateNode.containerInfo,hn=!0;break e}A=A.return}if(Rt===null)throw Error(n(160));xw(b,C,y),Rt=null,hn=!1,b=y.alternate,b!==null&&(b.return=null),y.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)Cw(l,o),l=l.sibling}var hr=null;function Cw(o,l){var u=o.alternate,p=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:un(l,o),dn(o),p&4&&(ro(3,o,o.return),gh(3,o),ro(5,o,o.return));break;case 1:un(l,o),dn(o),p&512&&(ii||u===null||Qr(u,u.return)),p&64&&ds&&(o=o.updateQueue,o!==null&&(p=o.callbacks,p!==null&&(u=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var y=hr;if(un(l,o),dn(o),p&512&&(ii||u===null||Qr(u,u.return)),p&4){var b=u!==null?u.memoizedState:null;if(p=o.memoizedState,u===null)if(p===null)if(o.stateNode===null){e:{p=o.type,u=o.memoizedProps,y=y.ownerDocument||y;t:switch(p){case"title":b=y.getElementsByTagName("title")[0],(!b||b[ea]||b[li]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=y.createElement(p),y.head.insertBefore(b,y.querySelector("head > title"))),Qi(b,p,u),b[li]=o,Kt(b),p=b;break e;case"link":var C=Ck("link","href",y).get(p+(u.href||""));if(C){for(var A=0;A<C.length;A++)if(b=C[A],b.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&b.getAttribute("rel")===(u.rel==null?null:u.rel)&&b.getAttribute("title")===(u.title==null?null:u.title)&&b.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){C.splice(A,1);break t}}b=y.createElement(p),Qi(b,p,u),y.head.appendChild(b);break;case"meta":if(C=Ck("meta","content",y).get(p+(u.content||""))){for(A=0;A<C.length;A++)if(b=C[A],b.getAttribute("content")===(u.content==null?null:""+u.content)&&b.getAttribute("name")===(u.name==null?null:u.name)&&b.getAttribute("property")===(u.property==null?null:u.property)&&b.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&b.getAttribute("charset")===(u.charSet==null?null:u.charSet)){C.splice(A,1);break t}}b=y.createElement(p),Qi(b,p,u),y.head.appendChild(b);break;default:throw Error(n(468,p))}b[li]=o,Kt(b),p=b}o.stateNode=p}else Tk(y,o.type,o.stateNode);else o.stateNode=kk(y,p,o.memoizedProps);else b!==p?(b===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):b.count--,p===null?Tk(y,o.type,o.stateNode):kk(y,p,o.memoizedProps)):p===null&&o.stateNode!==null&&l0(o,o.memoizedProps,u.memoizedProps)}break;case 27:un(l,o),dn(o),p&512&&(ii||u===null||Qr(u,u.return)),u!==null&&p&4&&l0(o,o.memoizedProps,u.memoizedProps);break;case 5:if(un(l,o),dn(o),p&512&&(ii||u===null||Qr(u,u.return)),o.flags&32){y=o.stateNode;try{cl(y,"")}catch(we){yt(o,o.return,we)}}p&4&&o.stateNode!=null&&(y=o.memoizedProps,l0(o,y,u!==null?u.memoizedProps:y)),p&1024&&(u0=!0);break;case 6:if(un(l,o),dn(o),p&4){if(o.stateNode===null)throw Error(n(162));p=o.memoizedProps,u=o.stateNode;try{u.nodeValue=p}catch(we){yt(o,o.return,we)}}break;case 3:if(Pf=null,y=hr,hr=Qf(l.containerInfo),un(l,o),hr=y,dn(o),p&4&&u!==null&&u.memoizedState.isDehydrated)try{Xl(l.containerInfo)}catch(we){yt(o,o.return,we)}u0&&(u0=!1,Tw(o));break;case 4:p=hr,hr=Qf(o.stateNode.containerInfo),un(l,o),dn(o),hr=p;break;case 12:un(l,o),dn(o);break;case 31:un(l,o),dn(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,pf(o,p)));break;case 13:un(l,o),dn(o),o.child.flags&8192&&o.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(mf=Le()),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,pf(o,p)));break;case 22:y=o.memoizedState!==null;var Y=u!==null&&u.memoizedState!==null,te=ds,se=ii;if(ds=te||y,ii=se||Y,un(l,o),ii=se,ds=te,dn(o),p&8192)e:for(l=o.stateNode,l._visibility=y?l._visibility&-2:l._visibility|1,y&&(u===null||Y||ds||ii||Oa(o)),u=null,l=o;;){if(l.tag===5||l.tag===26){if(u===null){Y=u=l;try{if(b=Y.stateNode,y)C=b.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{A=Y.stateNode;var he=Y.memoizedProps.style,ne=he!=null&&he.hasOwnProperty("display")?he.display:null;A.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(we){yt(Y,Y.return,we)}}}else if(l.tag===6){if(u===null){Y=l;try{Y.stateNode.nodeValue=y?"":Y.memoizedProps}catch(we){yt(Y,Y.return,we)}}}else if(l.tag===18){if(u===null){Y=l;try{var re=Y.stateNode;y?mk(re,!0):mk(Y.stateNode,!1)}catch(we){yt(Y,Y.return,we)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===o)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break e;for(;l.sibling===null;){if(l.return===null||l.return===o)break e;u===l&&(u=null),l=l.return}u===l&&(u=null),l.sibling.return=l.return,l=l.sibling}p&4&&(p=o.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,pf(o,u))));break;case 19:un(l,o),dn(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,pf(o,p)));break;case 30:break;case 21:break;default:un(l,o),dn(o)}}function dn(o){var l=o.flags;if(l&2){try{for(var u,p=o.return;p!==null;){if(vw(p)){u=p;break}p=p.return}if(u==null)throw Error(n(160));switch(u.tag){case 27:var y=u.stateNode,b=c0(o);ff(o,b,y);break;case 5:var C=u.stateNode;u.flags&32&&(cl(C,""),u.flags&=-33);var A=c0(o);ff(o,A,C);break;case 3:case 4:var Y=u.stateNode.containerInfo,te=c0(o);h0(o,te,Y);break;default:throw Error(n(161))}}catch(se){yt(o,o.return,se)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function Tw(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;Tw(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function ps(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)bw(o,l.alternate,l),l=l.sibling}function Oa(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:ro(4,l,l.return),Oa(l);break;case 1:Qr(l,l.return);var u=l.stateNode;typeof u.componentWillUnmount=="function"&&mw(l,l.return,u),Oa(l);break;case 27:kh(l.stateNode);case 26:case 5:Qr(l,l.return),Oa(l);break;case 22:l.memoizedState===null&&Oa(l);break;case 30:Oa(l);break;default:Oa(l)}o=o.sibling}}function gs(o,l,u){for(u=u&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var p=l.alternate,y=o,b=l,C=b.flags;switch(b.tag){case 0:case 11:case 15:gs(y,b,u),gh(4,b);break;case 1:if(gs(y,b,u),p=b,y=p.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(te){yt(p,p.return,te)}if(p=b,y=p.updateQueue,y!==null){var A=p.stateNode;try{var Y=y.shared.hiddenCallbacks;if(Y!==null)for(y.shared.hiddenCallbacks=null,y=0;y<Y.length;y++)rx(Y[y],A)}catch(te){yt(p,p.return,te)}}u&&C&64&&gw(b),mh(b,b.return);break;case 27:yw(b);case 26:case 5:gs(y,b,u),u&&p===null&&C&4&&Ow(b),mh(b,b.return);break;case 12:gs(y,b,u);break;case 31:gs(y,b,u),u&&C&4&&ww(y,b);break;case 13:gs(y,b,u),u&&C&4&&kw(y,b);break;case 22:b.memoizedState===null&&gs(y,b,u),mh(b,b.return);break;case 30:break;default:gs(y,b,u)}l=l.sibling}}function d0(o,l){var u=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==u&&(o!=null&&o.refCount++,u!=null&&ih(u))}function f0(o,l){o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&ih(o))}function ur(o,l,u,p){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Qw(o,l,u,p),l=l.sibling}function Qw(o,l,u,p){var y=l.flags;switch(l.tag){case 0:case 11:case 15:ur(o,l,u,p),y&2048&&gh(9,l);break;case 1:ur(o,l,u,p);break;case 3:ur(o,l,u,p),y&2048&&(o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&ih(o)));break;case 12:if(y&2048){ur(o,l,u,p),o=l.stateNode;try{var b=l.memoizedProps,C=b.id,A=b.onPostCommit;typeof A=="function"&&A(C,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(Y){yt(l,l.return,Y)}}else ur(o,l,u,p);break;case 31:ur(o,l,u,p);break;case 13:ur(o,l,u,p);break;case 23:break;case 22:b=l.stateNode,C=l.alternate,l.memoizedState!==null?b._visibility&2?ur(o,l,u,p):Oh(o,l):b._visibility&2?ur(o,l,u,p):(b._visibility|=2,$l(o,l,u,p,(l.subtreeFlags&10256)!==0||!1)),y&2048&&d0(C,l);break;case 24:ur(o,l,u,p),y&2048&&f0(l.alternate,l);break;default:ur(o,l,u,p)}}function $l(o,l,u,p,y){for(y=y&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var b=o,C=l,A=u,Y=p,te=C.flags;switch(C.tag){case 0:case 11:case 15:$l(b,C,A,Y,y),gh(8,C);break;case 23:break;case 22:var se=C.stateNode;C.memoizedState!==null?se._visibility&2?$l(b,C,A,Y,y):Oh(b,C):(se._visibility|=2,$l(b,C,A,Y,y)),y&&te&2048&&d0(C.alternate,C);break;case 24:$l(b,C,A,Y,y),y&&te&2048&&f0(C.alternate,C);break;default:$l(b,C,A,Y,y)}l=l.sibling}}function Oh(o,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=o,p=l,y=p.flags;switch(p.tag){case 22:Oh(u,p),y&2048&&d0(p.alternate,p);break;case 24:Oh(u,p),y&2048&&f0(p.alternate,p);break;default:Oh(u,p)}l=l.sibling}}var vh=8192;function Pl(o,l,u){if(o.subtreeFlags&vh)for(o=o.child;o!==null;)$w(o,l,u),o=o.sibling}function $w(o,l,u){switch(o.tag){case 26:Pl(o,l,u),o.flags&vh&&o.memoizedState!==null&&P3(u,hr,o.memoizedState,o.memoizedProps);break;case 5:Pl(o,l,u);break;case 3:case 4:var p=hr;hr=Qf(o.stateNode.containerInfo),Pl(o,l,u),hr=p;break;case 22:o.memoizedState===null&&(p=o.alternate,p!==null&&p.memoizedState!==null?(p=vh,vh=16777216,Pl(o,l,u),vh=p):Pl(o,l,u));break;default:Pl(o,l,u)}}function Pw(o){var l=o.alternate;if(l!==null&&(o=l.child,o!==null)){l.child=null;do l=o.sibling,o.sibling=null,o=l;while(o!==null)}}function yh(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var p=l[u];mi=p,Rw(p,o)}Pw(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Ew(o),o=o.sibling}function Ew(o){switch(o.tag){case 0:case 11:case 15:yh(o),o.flags&2048&&ro(9,o,o.return);break;case 3:yh(o);break;case 12:yh(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,gf(o)):yh(o);break;default:yh(o)}}function gf(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var p=l[u];mi=p,Rw(p,o)}Pw(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:ro(8,l,l.return),gf(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,gf(l));break;default:gf(l)}o=o.sibling}}function Rw(o,l){for(;mi!==null;){var u=mi;switch(u.tag){case 0:case 11:case 15:ro(8,u,l);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:ih(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,mi=p;else e:for(u=o;mi!==null;){p=mi;var y=p.sibling,b=p.return;if(_w(p),p===u){mi=null;break e}if(y!==null){y.return=b,mi=y;break e}mi=b}}}var Vj={getCacheForType:function(o){var l=Ci(Jt),u=l.data.get(o);return u===void 0&&(u=o(),l.data.set(o,u)),u},cacheSignal:function(){return Ci(Jt).controller.signal}},Ij=typeof WeakMap=="function"?WeakMap:Map,ft=0,wt=null,Ke=null,tt=0,vt=0,Tn=null,so=!1,El=!1,p0=!1,ms=0,Nt=0,oo=0,va=0,g0=0,Qn=0,Rl=0,Sh=null,fn=null,m0=!1,mf=0,Aw=0,Of=1/0,vf=null,ao=null,ci=0,lo=null,Al=null,Os=0,O0=0,v0=null,Mw=null,bh=0,y0=null;function $n(){return(ft&2)!==0&&tt!==0?tt&-tt:P.T!==null?k0():bd()}function zw(){if(Qn===0)if((tt&536870912)===0||st){var o=nl;nl<<=1,(nl&3932160)===0&&(nl=262144),Qn=o}else Qn=536870912;return o=kn.current,o!==null&&(o.flags|=32),Qn}function pn(o,l,u){(o===wt&&(vt===2||vt===9)||o.cancelPendingCommit!==null)&&(Ml(o,0),co(o,tt,Qn,!1)),Jo(o,u),((ft&2)===0||o!==wt)&&(o===wt&&((ft&2)===0&&(va|=u),Nt===4&&co(o,tt,Qn,!1)),$r(o))}function jw(o,l,u){if((ft&6)!==0)throw Error(n(327));var p=!u&&(l&127)===0&&(l&o.expiredLanes)===0||Ko(o,l),y=p?Uj(o,l):b0(o,l,!0),b=p;do{if(y===0){El&&!p&&co(o,l,0,!1);break}else{if(u=o.current.alternate,b&&!Yj(u)){y=b0(o,l,!1),b=!1;continue}if(y===2){if(b=l,o.errorRecoveryDisabledLanes&b)var C=0;else C=o.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){l=C;e:{var A=o;y=Sh;var Y=A.current.memoizedState.isDehydrated;if(Y&&(Ml(A,C).flags|=256),C=b0(A,C,!1),C!==2){if(p0&&!Y){A.errorRecoveryDisabledLanes|=b,va|=b,y=4;break e}b=fn,fn=y,b!==null&&(fn===null?fn=b:fn.push.apply(fn,b))}y=C}if(b=!1,y!==2)continue}}if(y===1){Ml(o,0),co(o,l,0,!0);break}e:{switch(p=o,b=y,b){case 0:case 1:throw Error(n(345));case 4:if((l&4194048)!==l)break;case 6:co(p,l,Qn,!so);break e;case 2:fn=null;break;case 3:case 5:break;default:throw Error(n(329))}if((l&62914560)===l&&(y=mf+300-Le(),10<y)){if(co(p,l,Qn,!so),sl(p,0,!0)!==0)break e;Os=l,p.timeoutHandle=fk(Dw.bind(null,p,u,fn,vf,m0,l,Qn,va,Rl,so,b,"Throttled",-0,0),y);break e}Dw(p,u,fn,vf,m0,l,Qn,va,Rl,so,b,null,-0,0)}}break}while(!0);$r(o)}function Dw(o,l,u,p,y,b,C,A,Y,te,se,he,ne,re){if(o.timeoutHandle=-1,he=l.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:is},$w(l,b,he);var we=(b&62914560)===b?mf-Le():(b&4194048)===b?Aw-Le():0;if(we=E3(he,we),we!==null){Os=b,o.cancelPendingCommit=we(Vw.bind(null,o,l,b,u,p,y,C,A,Y,se,he,null,ne,re)),co(o,b,C,!te);return}}Vw(o,l,b,u,p,y,C,A,Y)}function Yj(o){for(var l=o;;){var u=l.tag;if((u===0||u===11||u===15)&&l.flags&16384&&(u=l.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var p=0;p<u.length;p++){var y=u[p],b=y.getSnapshot;y=y.value;try{if(!xn(b(),y))return!1}catch{return!1}}if(u=l.child,l.subtreeFlags&16384&&u!==null)u.return=l,l=u;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function co(o,l,u,p){l&=~g0,l&=~va,o.suspendedLanes|=l,o.pingedLanes&=~l,p&&(o.warmLanes|=l),p=o.expirationTimes;for(var y=l;0<y;){var b=31-Yi(y),C=1<<b;p[b]=-1,y&=~C}u!==0&&vd(o,u,l)}function yf(){return(ft&6)===0?(_h(0),!1):!0}function S0(){if(Ke!==null){if(vt===0)var o=Ke.return;else o=Ke,os=ca=null,jO(o),wl=null,rh=0,o=Ke;for(;o!==null;)pw(o.alternate,o),o=o.return;Ke=null}}function Ml(o,l){var u=o.timeoutHandle;u!==-1&&(o.timeoutHandle=-1,f3(u)),u=o.cancelPendingCommit,u!==null&&(o.cancelPendingCommit=null,u()),Os=0,S0(),wt=o,Ke=u=rs(o.current,null),tt=l,vt=0,Tn=null,so=!1,El=Ko(o,l),p0=!1,Rl=Qn=g0=va=oo=Nt=0,fn=Sh=null,m0=!1,(l&8)!==0&&(l|=l&32);var p=o.entangledLanes;if(p!==0)for(o=o.entanglements,p&=l;0<p;){var y=31-Yi(p),b=1<<y;l|=o[y],p&=~b}return ms=l,Ld(),u}function Bw(o,l){Ie=null,P.H=dh,l===xl||l===Yd?(l=ex(),vt=3):l===wO?(l=ex(),vt=4):vt=l===KO?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Tn=l,Ke===null&&(Nt=1,lf(o,Wn(l,o.current)))}function Lw(){var o=kn.current;return o===null?!0:(tt&4194048)===tt?Yn===null:(tt&62914560)===tt||(tt&536870912)!==0?o===Yn:!1}function Xw(){var o=P.H;return P.H=dh,o===null?dh:o}function Nw(){var o=P.A;return P.A=Vj,o}function Sf(){Nt=4,so||(tt&4194048)!==tt&&kn.current!==null||(El=!0),(oo&134217727)===0&&(va&134217727)===0||wt===null||co(wt,tt,Qn,!1)}function b0(o,l,u){var p=ft;ft|=2;var y=Xw(),b=Nw();(wt!==o||tt!==l)&&(vf=null,Ml(o,l)),l=!1;var C=Nt;e:do try{if(vt!==0&&Ke!==null){var A=Ke,Y=Tn;switch(vt){case 8:S0(),C=6;break e;case 3:case 2:case 9:case 6:kn.current===null&&(l=!0);var te=vt;if(vt=0,Tn=null,zl(o,A,Y,te),u&&El){C=0;break e}break;default:te=vt,vt=0,Tn=null,zl(o,A,Y,te)}}Hj(),C=Nt;break}catch(se){Bw(o,se)}while(!0);return l&&o.shellSuspendCounter++,os=ca=null,ft=p,P.H=y,P.A=b,Ke===null&&(wt=null,tt=0,Ld()),C}function Hj(){for(;Ke!==null;)Zw(Ke)}function Uj(o,l){var u=ft;ft|=2;var p=Xw(),y=Nw();wt!==o||tt!==l?(vf=null,Of=Le()+500,Ml(o,l)):El=Ko(o,l);e:do try{if(vt!==0&&Ke!==null){l=Ke;var b=Tn;t:switch(vt){case 1:vt=0,Tn=null,zl(o,l,b,1);break;case 2:case 9:if(K_(b)){vt=0,Tn=null,Ww(l);break}l=function(){vt!==2&&vt!==9||wt!==o||(vt=7),$r(o)},b.then(l,l);break e;case 3:vt=7;break e;case 4:vt=5;break e;case 7:K_(b)?(vt=0,Tn=null,Ww(l)):(vt=0,Tn=null,zl(o,l,b,7));break;case 5:var C=null;switch(Ke.tag){case 26:C=Ke.memoizedState;case 5:case 27:var A=Ke;if(C?Qk(C):A.stateNode.complete){vt=0,Tn=null;var Y=A.sibling;if(Y!==null)Ke=Y;else{var te=A.return;te!==null?(Ke=te,bf(te)):Ke=null}break t}}vt=0,Tn=null,zl(o,l,b,5);break;case 6:vt=0,Tn=null,zl(o,l,b,6);break;case 8:S0(),Nt=6;break e;default:throw Error(n(462))}}Gj();break}catch(se){Bw(o,se)}while(!0);return os=ca=null,P.H=p,P.A=y,ft=u,Ke!==null?0:(wt=null,tt=0,Ld(),Nt)}function Gj(){for(;Ke!==null&&!oe();)Zw(Ke)}function Zw(o){var l=dw(o.alternate,o,ms);o.memoizedProps=o.pendingProps,l===null?bf(o):Ke=l}function Ww(o){var l=o,u=l.alternate;switch(l.tag){case 15:case 0:l=ow(u,l,l.pendingProps,l.type,void 0,tt);break;case 11:l=ow(u,l,l.pendingProps,l.type.render,l.ref,tt);break;case 5:jO(l);default:pw(u,l),l=Ke=N_(l,ms),l=dw(u,l,ms)}o.memoizedProps=o.pendingProps,l===null?bf(o):Ke=l}function zl(o,l,u,p){os=ca=null,jO(l),wl=null,rh=0;var y=l.return;try{if(Bj(o,y,l,u,tt)){Nt=1,lf(o,Wn(u,o.current)),Ke=null;return}}catch(b){if(y!==null)throw Ke=y,b;Nt=1,lf(o,Wn(u,o.current)),Ke=null;return}l.flags&32768?(st||p===1?o=!0:El||(tt&536870912)!==0?o=!1:(so=o=!0,(p===2||p===9||p===3||p===6)&&(p=kn.current,p!==null&&p.tag===13&&(p.flags|=16384))),qw(l,o)):bf(l)}function bf(o){var l=o;do{if((l.flags&32768)!==0){qw(l,so);return}o=l.return;var u=Nj(l.alternate,l,ms);if(u!==null){Ke=u;return}if(l=l.sibling,l!==null){Ke=l;return}Ke=l=o}while(l!==null);Nt===0&&(Nt=5)}function qw(o,l){do{var u=Zj(o.alternate,o);if(u!==null){u.flags&=32767,Ke=u;return}if(u=o.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(o=o.sibling,o!==null)){Ke=o;return}Ke=o=u}while(o!==null);Nt=6,Ke=null}function Vw(o,l,u,p,y,b,C,A,Y){o.cancelPendingCommit=null;do _f();while(ci!==0);if((ft&6)!==0)throw Error(n(327));if(l!==null){if(l===o.current)throw Error(n(177));if(b=l.lanes|l.childLanes,b|=cO,Lm(o,u,b,C,A,Y),o===wt&&(Ke=wt=null,tt=0),Al=l,lo=o,Os=u,O0=b,v0=y,Mw=p,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,e3(Go,function(){return Gw(),null})):(o.callbackNode=null,o.callbackPriority=0),p=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||p){p=P.T,P.T=null,y=Z.p,Z.p=2,C=ft,ft|=4;try{Wj(o,l,u)}finally{ft=C,Z.p=y,P.T=p}}ci=1,Iw(),Yw(),Hw()}}function Iw(){if(ci===1){ci=0;var o=lo,l=Al,u=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||u){u=P.T,P.T=null;var p=Z.p;Z.p=2;var y=ft;ft|=4;try{Cw(l,o);var b=A0,C=R_(o.containerInfo),A=b.focusedElem,Y=b.selectionRange;if(C!==A&&A&&A.ownerDocument&&E_(A.ownerDocument.documentElement,A)){if(Y!==null&&rO(A)){var te=Y.start,se=Y.end;if(se===void 0&&(se=te),"selectionStart"in A)A.selectionStart=te,A.selectionEnd=Math.min(se,A.value.length);else{var he=A.ownerDocument||document,ne=he&&he.defaultView||window;if(ne.getSelection){var re=ne.getSelection(),we=A.textContent.length,je=Math.min(Y.start,we),_t=Y.end===void 0?je:Math.min(Y.end,we);!re.extend&&je>_t&&(C=_t,_t=je,je=C);var F=P_(A,je),U=P_(A,_t);if(F&&U&&(re.rangeCount!==1||re.anchorNode!==F.node||re.anchorOffset!==F.offset||re.focusNode!==U.node||re.focusOffset!==U.offset)){var J=he.createRange();J.setStart(F.node,F.offset),re.removeAllRanges(),je>_t?(re.addRange(J),re.extend(U.node,U.offset)):(J.setEnd(U.node,U.offset),re.addRange(J))}}}}for(he=[],re=A;re=re.parentNode;)re.nodeType===1&&he.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<he.length;A++){var ae=he[A];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}Mf=!!R0,A0=R0=null}finally{ft=y,Z.p=p,P.T=u}}o.current=l,ci=2}}function Yw(){if(ci===2){ci=0;var o=lo,l=Al,u=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||u){u=P.T,P.T=null;var p=Z.p;Z.p=2;var y=ft;ft|=4;try{bw(o,l.alternate,l)}finally{ft=y,Z.p=p,P.T=u}}ci=3}}function Hw(){if(ci===4||ci===3){ci=0,We();var o=lo,l=Al,u=Os,p=Mw;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?ci=5:(ci=0,Al=lo=null,Uw(o,o.pendingLanes));var y=o.pendingLanes;if(y===0&&(ao=null),Nc(u),l=l.stateNode,Ii&&typeof Ii.onCommitFiberRoot=="function")try{Ii.onCommitFiberRoot(Fo,l,void 0,(l.current.flags&128)===128)}catch{}if(p!==null){l=P.T,y=Z.p,Z.p=2,P.T=null;try{for(var b=o.onRecoverableError,C=0;C<p.length;C++){var A=p[C];b(A.value,{componentStack:A.stack})}}finally{P.T=l,Z.p=y}}(Os&3)!==0&&_f(),$r(o),y=o.pendingLanes,(u&261930)!==0&&(y&42)!==0?o===y0?bh++:(bh=0,y0=o):bh=0,_h(0)}}function Uw(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,ih(l)))}function _f(){return Iw(),Yw(),Hw(),Gw()}function Gw(){if(ci!==5)return!1;var o=lo,l=O0;O0=0;var u=Nc(Os),p=P.T,y=Z.p;try{Z.p=32>u?32:u,P.T=null,u=v0,v0=null;var b=lo,C=Os;if(ci=0,Al=lo=null,Os=0,(ft&6)!==0)throw Error(n(331));var A=ft;if(ft|=4,Ew(b.current),Qw(b,b.current,C,u),ft=A,_h(0,!1),Ii&&typeof Ii.onPostCommitFiberRoot=="function")try{Ii.onPostCommitFiberRoot(Fo,b)}catch{}return!0}finally{Z.p=y,P.T=p,Uw(o,l)}}function Fw(o,l,u){l=Wn(u,l),l=FO(o.stateNode,l,2),o=to(o,l,2),o!==null&&(Jo(o,2),$r(o))}function yt(o,l,u){if(o.tag===3)Fw(o,o,u);else for(;l!==null;){if(l.tag===3){Fw(l,o,u);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(ao===null||!ao.has(p))){o=Wn(u,o),u=Kx(2),p=to(l,u,2),p!==null&&(Jx(u,p,l,o),Jo(p,2),$r(p));break}}l=l.return}}function _0(o,l,u){var p=o.pingCache;if(p===null){p=o.pingCache=new Ij;var y=new Set;p.set(l,y)}else y=p.get(l),y===void 0&&(y=new Set,p.set(l,y));y.has(u)||(p0=!0,y.add(u),o=Fj.bind(null,o,l,u),l.then(o,o))}function Fj(o,l,u){var p=o.pingCache;p!==null&&p.delete(l),o.pingedLanes|=o.suspendedLanes&u,o.warmLanes&=~u,wt===o&&(tt&u)===u&&(Nt===4||Nt===3&&(tt&62914560)===tt&&300>Le()-mf?(ft&2)===0&&Ml(o,0):g0|=u,Rl===tt&&(Rl=0)),$r(o)}function Kw(o,l){l===0&&(l=Od()),o=oa(o,l),o!==null&&(Jo(o,l),$r(o))}function Kj(o){var l=o.memoizedState,u=0;l!==null&&(u=l.retryLane),Kw(o,u)}function Jj(o,l){var u=0;switch(o.tag){case 31:case 13:var p=o.stateNode,y=o.memoizedState;y!==null&&(u=y.retryLane);break;case 19:p=o.stateNode;break;case 22:p=o.stateNode._retryCache;break;default:throw Error(n(314))}p!==null&&p.delete(l),Kw(o,u)}function e3(o,l){return _n(o,l)}var xf=null,jl=null,x0=!1,wf=!1,w0=!1,ho=0;function $r(o){o!==jl&&o.next===null&&(jl===null?xf=jl=o:jl=jl.next=o),wf=!0,x0||(x0=!0,i3())}function _h(o,l){if(!w0&&wf){w0=!0;do for(var u=!1,p=xf;p!==null;){if(o!==0){var y=p.pendingLanes;if(y===0)var b=0;else{var C=p.suspendedLanes,A=p.pingedLanes;b=(1<<31-Yi(42|o)+1)-1,b&=y&~(C&~A),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(u=!0,ik(p,b))}else b=tt,b=sl(p,p===wt?b:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(b&3)===0||Ko(p,b)||(u=!0,ik(p,b));p=p.next}while(u);w0=!1}}function t3(){Jw()}function Jw(){wf=x0=!1;var o=0;ho!==0&&d3()&&(o=ho);for(var l=Le(),u=null,p=xf;p!==null;){var y=p.next,b=ek(p,l);b===0?(p.next=null,u===null?xf=y:u.next=y,y===null&&(jl=u)):(u=p,(o!==0||(b&3)!==0)&&(wf=!0)),p=y}ci!==0&&ci!==5||_h(o),ho!==0&&(ho=0)}function ek(o,l){for(var u=o.suspendedLanes,p=o.pingedLanes,y=o.expirationTimes,b=o.pendingLanes&-62914561;0<b;){var C=31-Yi(b),A=1<<C,Y=y[C];Y===-1?((A&u)===0||(A&p)!==0)&&(y[C]=Bm(A,l)):Y<=l&&(o.expiredLanes|=A),b&=~A}if(l=wt,u=tt,u=sl(o,o===l?u:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p=o.callbackNode,u===0||o===l&&(vt===2||vt===9)||o.cancelPendingCommit!==null)return p!==null&&p!==null&&ar(p),o.callbackNode=null,o.callbackPriority=0;if((u&3)===0||Ko(o,u)){if(l=u&-u,l===o.callbackPriority)return l;switch(p!==null&&ar(p),Nc(u)){case 2:case 8:u=Vi;break;case 32:u=Go;break;case 268435456:u=tl;break;default:u=Go}return p=tk.bind(null,o),u=_n(u,p),o.callbackPriority=l,o.callbackNode=u,l}return p!==null&&p!==null&&ar(p),o.callbackPriority=2,o.callbackNode=null,2}function tk(o,l){if(ci!==0&&ci!==5)return o.callbackNode=null,o.callbackPriority=0,null;var u=o.callbackNode;if(_f()&&o.callbackNode!==u)return null;var p=tt;return p=sl(o,o===wt?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p===0?null:(jw(o,p,l),ek(o,Le()),o.callbackNode!=null&&o.callbackNode===u?tk.bind(null,o):null)}function ik(o,l){if(_f())return null;jw(o,l,!0)}function i3(){p3(function(){(ft&6)!==0?_n(on,t3):Jw()})}function k0(){if(ho===0){var o=bl;o===0&&(o=il,il<<=1,(il&261888)===0&&(il=256)),ho=o}return ho}function nk(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Ed(""+o)}function rk(o,l){var u=l.ownerDocument.createElement("input");return u.name=l.name,u.value=l.value,o.id&&u.setAttribute("form",o.id),l.parentNode.insertBefore(u,l),o=new FormData(o),u.parentNode.removeChild(u),o}function n3(o,l,u,p,y){if(l==="submit"&&u&&u.stateNode===y){var b=nk((y[Di]||null).action),C=p.submitter;C&&(l=(l=C[Di]||null)?nk(l.formAction):C.getAttribute("formAction"),l!==null&&(b=l,C=null));var A=new zd("action","action",null,p,y);o.push({event:A,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(ho!==0){var Y=C?rk(y,C):new FormData(y);VO(u,{pending:!0,data:Y,method:y.method,action:b},null,Y)}}else typeof b=="function"&&(A.preventDefault(),Y=C?rk(y,C):new FormData(y),VO(u,{pending:!0,data:Y,method:y.method,action:b},b,Y))},currentTarget:y}]})}}for(var C0=0;C0<lO.length;C0++){var T0=lO[C0],r3=T0.toLowerCase(),s3=T0[0].toUpperCase()+T0.slice(1);cr(r3,"on"+s3)}cr(z_,"onAnimationEnd"),cr(j_,"onAnimationIteration"),cr(D_,"onAnimationStart"),cr("dblclick","onDoubleClick"),cr("focusin","onFocus"),cr("focusout","onBlur"),cr(bj,"onTransitionRun"),cr(_j,"onTransitionStart"),cr(xj,"onTransitionCancel"),cr(B_,"onTransitionEnd"),Is("onMouseEnter",["mouseout","mouseover"]),Is("onMouseLeave",["mouseout","mouseover"]),Is("onPointerEnter",["pointerout","pointerover"]),Is("onPointerLeave",["pointerout","pointerover"]),es("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),es("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),es("onBeforeInput",["compositionend","keypress","textInput","paste"]),es("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xh="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(" "),o3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xh));function sk(o,l){l=(l&4)!==0;for(var u=0;u<o.length;u++){var p=o[u],y=p.event;p=p.listeners;e:{var b=void 0;if(l)for(var C=p.length-1;0<=C;C--){var A=p[C],Y=A.instance,te=A.currentTarget;if(A=A.listener,Y!==b&&y.isPropagationStopped())break e;b=A,y.currentTarget=te;try{b(y)}catch(se){Bd(se)}y.currentTarget=null,b=Y}else for(C=0;C<p.length;C++){if(A=p[C],Y=A.instance,te=A.currentTarget,A=A.listener,Y!==b&&y.isPropagationStopped())break e;b=A,y.currentTarget=te;try{b(y)}catch(se){Bd(se)}y.currentTarget=null,b=Y}}}}function Je(o,l){var u=l[ol];u===void 0&&(u=l[ol]=new Set);var p=o+"__bubble";u.has(p)||(ok(l,o,2,!1),u.add(p))}function Q0(o,l,u){var p=0;l&&(p|=4),ok(u,o,p,l)}var kf="_reactListening"+Math.random().toString(36).slice(2);function $0(o){if(!o[kf]){o[kf]=!0,kd.forEach(function(u){u!=="selectionchange"&&(o3.has(u)||Q0(u,!1,o),Q0(u,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[kf]||(l[kf]=!0,Q0("selectionchange",!1,l))}}function ok(o,l,u,p){switch(zk(l)){case 2:var y=M3;break;case 8:y=z3;break;default:y=q0}u=y.bind(null,l,u,o),y=void 0,!Um||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(y=!0),p?y!==void 0?o.addEventListener(l,u,{capture:!0,passive:y}):o.addEventListener(l,u,!0):y!==void 0?o.addEventListener(l,u,{passive:y}):o.addEventListener(l,u,!1)}function P0(o,l,u,p,y){var b=p;if((l&1)===0&&(l&2)===0&&p!==null)e:for(;;){if(p===null)return;var C=p.tag;if(C===3||C===4){var A=p.stateNode.containerInfo;if(A===y)break;if(C===4)for(C=p.return;C!==null;){var Y=C.tag;if((Y===3||Y===4)&&C.stateNode.containerInfo===y)return;C=C.return}for(;A!==null;){if(C=Zs(A),C===null)return;if(Y=C.tag,Y===5||Y===6||Y===26||Y===27){p=b=C;continue e}A=A.parentNode}}p=p.return}u_(function(){var te=b,se=Ym(u),he=[];e:{var ne=L_.get(o);if(ne!==void 0){var re=zd,we=o;switch(o){case"keypress":if(Ad(u)===0)break e;case"keydown":case"keyup":re=Jz;break;case"focusin":we="focus",re=Jm;break;case"focusout":we="blur",re=Jm;break;case"beforeblur":case"afterblur":re=Jm;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=p_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=Nz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=ij;break;case z_:case j_:case D_:re=qz;break;case B_:re=rj;break;case"scroll":case"scrollend":re=Lz;break;case"wheel":re=oj;break;case"copy":case"cut":case"paste":re=Iz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=m_;break;case"toggle":case"beforetoggle":re=lj}var je=(l&4)!==0,_t=!je&&(o==="scroll"||o==="scrollend"),F=je?ne!==null?ne+"Capture":null:ne;je=[];for(var U=te,J;U!==null;){var ae=U;if(J=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||J===null||F===null||(ae=Vc(U,F),ae!=null&&je.push(wh(U,ae,J))),_t)break;U=U.return}0<je.length&&(ne=new re(ne,we,null,u,se),he.push({event:ne,listeners:je}))}}if((l&7)===0){e:{if(ne=o==="mouseover"||o==="pointerover",re=o==="mouseout"||o==="pointerout",ne&&u!==Im&&(we=u.relatedTarget||u.fromElement)&&(Zs(we)||we[Jr]))break e;if((re||ne)&&(ne=se.window===se?se:(ne=se.ownerDocument)?ne.defaultView||ne.parentWindow:window,re?(we=u.relatedTarget||u.toElement,re=te,we=we?Zs(we):null,we!==null&&(_t=s(we),je=we.tag,we!==_t||je!==5&&je!==27&&je!==6)&&(we=null)):(re=null,we=te),re!==we)){if(je=p_,ae="onMouseLeave",F="onMouseEnter",U="mouse",(o==="pointerout"||o==="pointerover")&&(je=m_,ae="onPointerLeave",F="onPointerEnter",U="pointer"),_t=re==null?ne:qs(re),J=we==null?ne:qs(we),ne=new je(ae,U+"leave",re,u,se),ne.target=_t,ne.relatedTarget=J,ae=null,Zs(se)===te&&(je=new je(F,U+"enter",we,u,se),je.target=J,je.relatedTarget=_t,ae=je),_t=ae,re&&we)t:{for(je=a3,F=re,U=we,J=0,ae=F;ae;ae=je(ae))J++;ae=0;for(var Ae=U;Ae;Ae=je(Ae))ae++;for(;0<J-ae;)F=je(F),J--;for(;0<ae-J;)U=je(U),ae--;for(;J--;){if(F===U||U!==null&&F===U.alternate){je=F;break t}F=je(F),U=je(U)}je=null}else je=null;re!==null&&ak(he,ne,re,je,!1),we!==null&&_t!==null&&ak(he,_t,we,je,!0)}}e:{if(ne=te?qs(te):window,re=ne.nodeName&&ne.nodeName.toLowerCase(),re==="select"||re==="input"&&ne.type==="file")var ht=w_;else if(__(ne))if(k_)ht=vj;else{ht=mj;var Te=gj}else re=ne.nodeName,!re||re.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?te&&Vm(te.elementType)&&(ht=w_):ht=Oj;if(ht&&(ht=ht(o,te))){x_(he,ht,u,se);break e}Te&&Te(o,ne,te),o==="focusout"&&te&&ne.type==="number"&&te.memoizedProps.value!=null&&qc(ne,"number",ne.value)}switch(Te=te?qs(te):window,o){case"focusin":(__(Te)||Te.contentEditable==="true")&&(fl=Te,sO=te,Jc=null);break;case"focusout":Jc=sO=fl=null;break;case"mousedown":oO=!0;break;case"contextmenu":case"mouseup":case"dragend":oO=!1,A_(he,u,se);break;case"selectionchange":if(Sj)break;case"keydown":case"keyup":A_(he,u,se)}var Ye;if(tO)e:{switch(o){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else dl?S_(o,u)&&(it="onCompositionEnd"):o==="keydown"&&u.keyCode===229&&(it="onCompositionStart");it&&(O_&&u.locale!=="ko"&&(dl||it!=="onCompositionStart"?it==="onCompositionEnd"&&dl&&(Ye=d_()):(Hs=se,Gm="value"in Hs?Hs.value:Hs.textContent,dl=!0)),Te=Cf(te,it),0<Te.length&&(it=new g_(it,o,null,u,se),he.push({event:it,listeners:Te}),Ye?it.data=Ye:(Ye=b_(u),Ye!==null&&(it.data=Ye)))),(Ye=hj?uj(o,u):dj(o,u))&&(it=Cf(te,"onBeforeInput"),0<it.length&&(Te=new g_("onBeforeInput","beforeinput",null,u,se),he.push({event:Te,listeners:it}),Te.data=Ye)),n3(he,o,te,u,se)}sk(he,l)})}function wh(o,l,u){return{instance:o,listener:l,currentTarget:u}}function Cf(o,l){for(var u=l+"Capture",p=[];o!==null;){var y=o,b=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||b===null||(y=Vc(o,u),y!=null&&p.unshift(wh(o,y,b)),y=Vc(o,l),y!=null&&p.push(wh(o,y,b))),o.tag===3)return p;o=o.return}return[]}function a3(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function ak(o,l,u,p,y){for(var b=l._reactName,C=[];u!==null&&u!==p;){var A=u,Y=A.alternate,te=A.stateNode;if(A=A.tag,Y!==null&&Y===p)break;A!==5&&A!==26&&A!==27||te===null||(Y=te,y?(te=Vc(u,b),te!=null&&C.unshift(wh(u,te,Y))):y||(te=Vc(u,b),te!=null&&C.push(wh(u,te,Y)))),u=u.return}C.length!==0&&o.push({event:l,listeners:C})}var l3=/\r\n?/g,c3=/\u0000|\uFFFD/g;function lk(o){return(typeof o=="string"?o:""+o).replace(l3,`
49
+ `).replace(c3,"")}function ck(o,l){return l=lk(l),lk(o)===l}function bt(o,l,u,p,y,b){switch(u){case"children":typeof p=="string"?l==="body"||l==="textarea"&&p===""||cl(o,p):(typeof p=="number"||typeof p=="bigint")&&l!=="body"&&cl(o,""+p);break;case"className":ll(o,"class",p);break;case"tabIndex":ll(o,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":ll(o,u,p);break;case"style":c_(o,p,b);break;case"data":if(l!=="object"){ll(o,"data",p);break}case"src":case"href":if(p===""&&(l!=="a"||u!=="href")){o.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(u);break}p=Ed(""+p),o.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="function"){o.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof b=="function"&&(u==="formAction"?(l!=="input"&&bt(o,l,"name",y.name,y,null),bt(o,l,"formEncType",y.formEncType,y,null),bt(o,l,"formMethod",y.formMethod,y,null),bt(o,l,"formTarget",y.formTarget,y,null)):(bt(o,l,"encType",y.encType,y,null),bt(o,l,"method",y.method,y,null),bt(o,l,"target",y.target,y,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(u);break}p=Ed(""+p),o.setAttribute(u,p);break;case"onClick":p!=null&&(o.onclick=is);break;case"onScroll":p!=null&&Je("scroll",o);break;case"onScrollEnd":p!=null&&Je("scrollend",o);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(n(61));if(u=p.__html,u!=null){if(y.children!=null)throw Error(n(60));o.innerHTML=u}}break;case"multiple":o.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":o.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){o.removeAttribute("xlink:href");break}u=Ed(""+p),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(u,""+p):o.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(u,""):o.removeAttribute(u);break;case"capture":case"download":p===!0?o.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(u,p):o.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?o.setAttribute(u,p):o.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?o.removeAttribute(u):o.setAttribute(u,p);break;case"popover":Je("beforetoggle",o),Je("toggle",o),al(o,"popover",p);break;case"xlinkActuate":lr(o,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":lr(o,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":lr(o,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":lr(o,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":lr(o,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":lr(o,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":lr(o,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":lr(o,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":lr(o,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":al(o,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=Dz.get(u)||u,al(o,u,p))}}function E0(o,l,u,p,y,b){switch(u){case"style":c_(o,p,b);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(n(61));if(u=p.__html,u!=null){if(y.children!=null)throw Error(n(60));o.innerHTML=u}}break;case"children":typeof p=="string"?cl(o,p):(typeof p=="number"||typeof p=="bigint")&&cl(o,""+p);break;case"onScroll":p!=null&&Je("scroll",o);break;case"onScrollEnd":p!=null&&Je("scrollend",o);break;case"onClick":p!=null&&(o.onclick=is);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Cd.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),l=u.slice(2,y?u.length-7:void 0),b=o[Di]||null,b=b!=null?b[u]:null,typeof b=="function"&&o.removeEventListener(l,b,y),typeof p=="function")){typeof b!="function"&&b!==null&&(u in o?o[u]=null:o.hasAttribute(u)&&o.removeAttribute(u)),o.addEventListener(l,p,y);break e}u in o?o[u]=p:p===!0?o.setAttribute(u,""):al(o,u,p)}}}function Qi(o,l,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Je("error",o),Je("load",o);var p=!1,y=!1,b;for(b in u)if(u.hasOwnProperty(b)){var C=u[b];if(C!=null)switch(b){case"src":p=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,l));default:bt(o,l,b,C,u,null)}}y&&bt(o,l,"srcSet",u.srcSet,u,null),p&&bt(o,l,"src",u.src,u,null);return;case"input":Je("invalid",o);var A=b=C=y=null,Y=null,te=null;for(p in u)if(u.hasOwnProperty(p)){var se=u[p];if(se!=null)switch(p){case"name":y=se;break;case"type":C=se;break;case"checked":Y=se;break;case"defaultChecked":te=se;break;case"value":b=se;break;case"defaultValue":A=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(n(137,l));break;default:bt(o,l,p,se,u,null)}}Pd(o,b,A,Y,te,C,y,!1);return;case"select":Je("invalid",o),p=C=b=null;for(y in u)if(u.hasOwnProperty(y)&&(A=u[y],A!=null))switch(y){case"value":b=A;break;case"defaultValue":C=A;break;case"multiple":p=A;default:bt(o,l,y,A,u,null)}l=b,u=C,o.multiple=!!p,l!=null?ts(o,!!p,l,!1):u!=null&&ts(o,!!p,u,!0);return;case"textarea":Je("invalid",o),b=y=p=null;for(C in u)if(u.hasOwnProperty(C)&&(A=u[C],A!=null))switch(C){case"value":p=A;break;case"defaultValue":y=A;break;case"children":b=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(n(91));break;default:bt(o,l,C,A,u,null)}a_(o,p,y,b);return;case"option":for(Y in u)if(u.hasOwnProperty(Y)&&(p=u[Y],p!=null))switch(Y){case"selected":o.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:bt(o,l,Y,p,u,null)}return;case"dialog":Je("beforetoggle",o),Je("toggle",o),Je("cancel",o),Je("close",o);break;case"iframe":case"object":Je("load",o);break;case"video":case"audio":for(p=0;p<xh.length;p++)Je(xh[p],o);break;case"image":Je("error",o),Je("load",o);break;case"details":Je("toggle",o);break;case"embed":case"source":case"link":Je("error",o),Je("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in u)if(u.hasOwnProperty(te)&&(p=u[te],p!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,l));default:bt(o,l,te,p,u,null)}return;default:if(Vm(l)){for(se in u)u.hasOwnProperty(se)&&(p=u[se],p!==void 0&&E0(o,l,se,p,u,void 0));return}}for(A in u)u.hasOwnProperty(A)&&(p=u[A],p!=null&&bt(o,l,A,p,u,null))}function h3(o,l,u,p){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,b=null,C=null,A=null,Y=null,te=null,se=null;for(re in u){var he=u[re];if(u.hasOwnProperty(re)&&he!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":Y=he;default:p.hasOwnProperty(re)||bt(o,l,re,null,p,he)}}for(var ne in p){var re=p[ne];if(he=u[ne],p.hasOwnProperty(ne)&&(re!=null||he!=null))switch(ne){case"type":b=re;break;case"name":y=re;break;case"checked":te=re;break;case"defaultChecked":se=re;break;case"value":C=re;break;case"defaultValue":A=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(n(137,l));break;default:re!==he&&bt(o,l,ne,re,p,he)}}ia(o,C,A,Y,te,se,b,y);return;case"select":re=C=A=ne=null;for(b in u)if(Y=u[b],u.hasOwnProperty(b)&&Y!=null)switch(b){case"value":break;case"multiple":re=Y;default:p.hasOwnProperty(b)||bt(o,l,b,null,p,Y)}for(y in p)if(b=p[y],Y=u[y],p.hasOwnProperty(y)&&(b!=null||Y!=null))switch(y){case"value":ne=b;break;case"defaultValue":A=b;break;case"multiple":C=b;default:b!==Y&&bt(o,l,y,b,p,Y)}l=A,u=C,p=re,ne!=null?ts(o,!!u,ne,!1):!!p!=!!u&&(l!=null?ts(o,!!u,l,!0):ts(o,!!u,u?[]:"",!1));return;case"textarea":re=ne=null;for(A in u)if(y=u[A],u.hasOwnProperty(A)&&y!=null&&!p.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:bt(o,l,A,null,p,y)}for(C in p)if(y=p[C],b=u[C],p.hasOwnProperty(C)&&(y!=null||b!=null))switch(C){case"value":ne=y;break;case"defaultValue":re=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(n(91));break;default:y!==b&&bt(o,l,C,y,p,b)}o_(o,ne,re);return;case"option":for(var we in u)if(ne=u[we],u.hasOwnProperty(we)&&ne!=null&&!p.hasOwnProperty(we))switch(we){case"selected":o.selected=!1;break;default:bt(o,l,we,null,p,ne)}for(Y in p)if(ne=p[Y],re=u[Y],p.hasOwnProperty(Y)&&ne!==re&&(ne!=null||re!=null))switch(Y){case"selected":o.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:bt(o,l,Y,ne,p,re)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var je in u)ne=u[je],u.hasOwnProperty(je)&&ne!=null&&!p.hasOwnProperty(je)&&bt(o,l,je,null,p,ne);for(te in p)if(ne=p[te],re=u[te],p.hasOwnProperty(te)&&ne!==re&&(ne!=null||re!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(n(137,l));break;default:bt(o,l,te,ne,p,re)}return;default:if(Vm(l)){for(var _t in u)ne=u[_t],u.hasOwnProperty(_t)&&ne!==void 0&&!p.hasOwnProperty(_t)&&E0(o,l,_t,void 0,p,ne);for(se in p)ne=p[se],re=u[se],!p.hasOwnProperty(se)||ne===re||ne===void 0&&re===void 0||E0(o,l,se,ne,p,re);return}}for(var F in u)ne=u[F],u.hasOwnProperty(F)&&ne!=null&&!p.hasOwnProperty(F)&&bt(o,l,F,null,p,ne);for(he in p)ne=p[he],re=u[he],!p.hasOwnProperty(he)||ne===re||ne==null&&re==null||bt(o,l,he,ne,p,re)}function hk(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function u3(){if(typeof performance.getEntriesByType=="function"){for(var o=0,l=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var y=u[p],b=y.transferSize,C=y.initiatorType,A=y.duration;if(b&&A&&hk(C)){for(C=0,A=y.responseEnd,p+=1;p<u.length;p++){var Y=u[p],te=Y.startTime;if(te>A)break;var se=Y.transferSize,he=Y.initiatorType;se&&hk(he)&&(Y=Y.responseEnd,C+=se*(Y<A?1:(A-te)/(Y-te)))}if(--p,l+=8*(b+C)/(y.duration/1e3),o++,10<o)break}}if(0<o)return l/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var R0=null,A0=null;function Tf(o){return o.nodeType===9?o:o.ownerDocument}function uk(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function dk(o,l){if(o===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&l==="foreignObject"?0:o}function M0(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var z0=null;function d3(){var o=window.event;return o&&o.type==="popstate"?o===z0?!1:(z0=o,!0):(z0=null,!1)}var fk=typeof setTimeout=="function"?setTimeout:void 0,f3=typeof clearTimeout=="function"?clearTimeout:void 0,pk=typeof Promise=="function"?Promise:void 0,p3=typeof queueMicrotask=="function"?queueMicrotask:typeof pk<"u"?function(o){return pk.resolve(null).then(o).catch(g3)}:fk;function g3(o){setTimeout(function(){throw o})}function uo(o){return o==="head"}function gk(o,l){var u=l,p=0;do{var y=u.nextSibling;if(o.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(p===0){o.removeChild(y),Xl(l);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")kh(o.ownerDocument.documentElement);else if(u==="head"){u=o.ownerDocument.head,kh(u);for(var b=u.firstChild;b;){var C=b.nextSibling,A=b.nodeName;b[ea]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&b.rel.toLowerCase()==="stylesheet"||u.removeChild(b),b=C}}else u==="body"&&kh(o.ownerDocument.body);u=y}while(u);Xl(l)}function mk(o,l){var u=o;o=0;do{var p=u.nextSibling;if(u.nodeType===1?l?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(l?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(o===0)break;o--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||o++;u=p}while(u)}function j0(o){var l=o.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var u=l;switch(l=l.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":j0(u),Zc(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}o.removeChild(u)}}function m3(o,l,u,p){for(;o.nodeType===1;){var y=u;if(o.nodeName.toLowerCase()!==l.toLowerCase()){if(!p&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(p){if(!o[ea])switch(l){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(b=o.getAttribute("rel"),b==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(b!==y.rel||o.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||o.getAttribute("title")!==(y.title==null?null:y.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(b=o.getAttribute("src"),(b!==(y.src==null?null:y.src)||o.getAttribute("type")!==(y.type==null?null:y.type)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&b&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(l==="input"&&o.type==="hidden"){var b=y.name==null?null:""+y.name;if(y.type==="hidden"&&o.getAttribute("name")===b)return o}else return o;if(o=Hn(o.nextSibling),o===null)break}return null}function O3(o,l,u){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!u||(o=Hn(o.nextSibling),o===null))return null;return o}function Ok(o,l){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=Hn(o.nextSibling),o===null))return null;return o}function D0(o){return o.data==="$?"||o.data==="$~"}function B0(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function v3(o,l){var u=o.ownerDocument;if(o.data==="$~")o._reactRetry=l;else if(o.data!=="$?"||u.readyState!=="loading")l();else{var p=function(){l(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),o._reactRetry=p}}function Hn(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return o}var L0=null;function vk(o){o=o.nextSibling;for(var l=0;o;){if(o.nodeType===8){var u=o.data;if(u==="/$"||u==="/&"){if(l===0)return Hn(o.nextSibling);l--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||l++}o=o.nextSibling}return null}function yk(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var u=o.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(l===0)return o;l--}else u!=="/$"&&u!=="/&"||l++}o=o.previousSibling}return null}function Sk(o,l,u){switch(l=Tf(u),o){case"html":if(o=l.documentElement,!o)throw Error(n(452));return o;case"head":if(o=l.head,!o)throw Error(n(453));return o;case"body":if(o=l.body,!o)throw Error(n(454));return o;default:throw Error(n(451))}}function kh(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);Zc(o)}var Un=new Map,bk=new Set;function Qf(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var vs=Z.d;Z.d={f:y3,r:S3,D:b3,C:_3,L:x3,m:w3,X:C3,S:k3,M:T3};function y3(){var o=vs.f(),l=yf();return o||l}function S3(o){var l=Ws(o);l!==null&&l.tag===5&&l.type==="form"?Bx(l):vs.r(o)}var Dl=typeof document>"u"?null:document;function _k(o,l,u){var p=Dl;if(p&&typeof l=="string"&&l){var y=ln(l);y='link[rel="'+o+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),bk.has(y)||(bk.add(y),o={rel:o,crossOrigin:u,href:l},p.querySelector(y)===null&&(l=p.createElement("link"),Qi(l,"link",o),Kt(l),p.head.appendChild(l)))}}function b3(o){vs.D(o),_k("dns-prefetch",o,null)}function _3(o,l){vs.C(o,l),_k("preconnect",o,l)}function x3(o,l,u){vs.L(o,l,u);var p=Dl;if(p&&o&&l){var y='link[rel="preload"][as="'+ln(l)+'"]';l==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+ln(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+ln(u.imageSizes)+'"]')):y+='[href="'+ln(o)+'"]';var b=y;switch(l){case"style":b=Bl(o);break;case"script":b=Ll(o)}Un.has(b)||(o=g({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:o,as:l},u),Un.set(b,o),p.querySelector(y)!==null||l==="style"&&p.querySelector(Ch(b))||l==="script"&&p.querySelector(Th(b))||(l=p.createElement("link"),Qi(l,"link",o),Kt(l),p.head.appendChild(l)))}}function w3(o,l){vs.m(o,l);var u=Dl;if(u&&o){var p=l&&typeof l.as=="string"?l.as:"script",y='link[rel="modulepreload"][as="'+ln(p)+'"][href="'+ln(o)+'"]',b=y;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Ll(o)}if(!Un.has(b)&&(o=g({rel:"modulepreload",href:o},l),Un.set(b,o),u.querySelector(y)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Th(b)))return}p=u.createElement("link"),Qi(p,"link",o),Kt(p),u.head.appendChild(p)}}}function k3(o,l,u){vs.S(o,l,u);var p=Dl;if(p&&o){var y=Vs(p).hoistableStyles,b=Bl(o);l=l||"default";var C=y.get(b);if(!C){var A={loading:0,preload:null};if(C=p.querySelector(Ch(b)))A.loading=5;else{o=g({rel:"stylesheet",href:o,"data-precedence":l},u),(u=Un.get(b))&&X0(o,u);var Y=C=p.createElement("link");Kt(Y),Qi(Y,"link",o),Y._p=new Promise(function(te,se){Y.onload=te,Y.onerror=se}),Y.addEventListener("load",function(){A.loading|=1}),Y.addEventListener("error",function(){A.loading|=2}),A.loading|=4,$f(C,l,p)}C={type:"stylesheet",instance:C,count:1,state:A},y.set(b,C)}}}function C3(o,l){vs.X(o,l);var u=Dl;if(u&&o){var p=Vs(u).hoistableScripts,y=Ll(o),b=p.get(y);b||(b=u.querySelector(Th(y)),b||(o=g({src:o,async:!0},l),(l=Un.get(y))&&N0(o,l),b=u.createElement("script"),Kt(b),Qi(b,"link",o),u.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},p.set(y,b))}}function T3(o,l){vs.M(o,l);var u=Dl;if(u&&o){var p=Vs(u).hoistableScripts,y=Ll(o),b=p.get(y);b||(b=u.querySelector(Th(y)),b||(o=g({src:o,async:!0,type:"module"},l),(l=Un.get(y))&&N0(o,l),b=u.createElement("script"),Kt(b),Qi(b,"link",o),u.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},p.set(y,b))}}function xk(o,l,u,p){var y=(y=de.current)?Qf(y):null;if(!y)throw Error(n(446));switch(o){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(l=Bl(u.href),u=Vs(y).hoistableStyles,p=u.get(l),p||(p={type:"style",instance:null,count:0,state:null},u.set(l,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){o=Bl(u.href);var b=Vs(y).hoistableStyles,C=b.get(o);if(C||(y=y.ownerDocument||y,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(o,C),(b=y.querySelector(Ch(o)))&&!b._p&&(C.instance=b,C.state.loading=5),Un.has(o)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Un.set(o,u),b||Q3(y,o,u,C.state))),l&&p===null)throw Error(n(528,""));return C}if(l&&p!==null)throw Error(n(529,""));return null;case"script":return l=u.async,u=u.src,typeof u=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Ll(u),u=Vs(y).hoistableScripts,p=u.get(l),p||(p={type:"script",instance:null,count:0,state:null},u.set(l,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,o))}}function Bl(o){return'href="'+ln(o)+'"'}function Ch(o){return'link[rel="stylesheet"]['+o+"]"}function wk(o){return g({},o,{"data-precedence":o.precedence,precedence:null})}function Q3(o,l,u,p){o.querySelector('link[rel="preload"][as="style"]['+l+"]")?p.loading=1:(l=o.createElement("link"),p.preload=l,l.addEventListener("load",function(){return p.loading|=1}),l.addEventListener("error",function(){return p.loading|=2}),Qi(l,"link",u),Kt(l),o.head.appendChild(l))}function Ll(o){return'[src="'+ln(o)+'"]'}function Th(o){return"script[async]"+o}function kk(o,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var p=o.querySelector('style[data-href~="'+ln(u.href)+'"]');if(p)return l.instance=p,Kt(p),p;var y=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(o.ownerDocument||o).createElement("style"),Kt(p),Qi(p,"style",y),$f(p,u.precedence,o),l.instance=p;case"stylesheet":y=Bl(u.href);var b=o.querySelector(Ch(y));if(b)return l.state.loading|=4,l.instance=b,Kt(b),b;p=wk(u),(y=Un.get(y))&&X0(p,y),b=(o.ownerDocument||o).createElement("link"),Kt(b);var C=b;return C._p=new Promise(function(A,Y){C.onload=A,C.onerror=Y}),Qi(b,"link",p),l.state.loading|=4,$f(b,u.precedence,o),l.instance=b;case"script":return b=Ll(u.src),(y=o.querySelector(Th(b)))?(l.instance=y,Kt(y),y):(p=u,(y=Un.get(b))&&(p=g({},u),N0(p,y)),o=o.ownerDocument||o,y=o.createElement("script"),Kt(y),Qi(y,"link",p),o.head.appendChild(y),l.instance=y);case"void":return null;default:throw Error(n(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(p=l.instance,l.state.loading|=4,$f(p,u.precedence,o));return l.instance}function $f(o,l,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=p.length?p[p.length-1]:null,b=y,C=0;C<p.length;C++){var A=p[C];if(A.dataset.precedence===l)b=A;else if(b!==y)break}b?b.parentNode.insertBefore(o,b.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(o,l.firstChild))}function X0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function N0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var Pf=null;function Ck(o,l,u){if(Pf===null){var p=new Map,y=Pf=new Map;y.set(u,p)}else y=Pf,p=y.get(u),p||(p=new Map,y.set(u,p));if(p.has(o))return p;for(p.set(o,null),u=u.getElementsByTagName(o),y=0;y<u.length;y++){var b=u[y];if(!(b[ea]||b[li]||o==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var C=b.getAttribute(l)||"";C=o+C;var A=p.get(C);A?A.push(b):p.set(C,[b])}}return p}function Tk(o,l,u){o=o.ownerDocument||o,o.head.insertBefore(u,l==="title"?o.querySelector("head > title"):null)}function $3(o,l,u){if(u===1||l.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return o=l.disabled,typeof l.precedence=="string"&&o==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Qk(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function P3(o,l,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=Bl(p.href),b=l.querySelector(Ch(y));if(b){l=b._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(o.count++,o=Ef.bind(o),l.then(o,o)),u.state.loading|=4,u.instance=b,Kt(b);return}b=l.ownerDocument||l,p=wk(p),(y=Un.get(y))&&X0(p,y),b=b.createElement("link"),Kt(b);var C=b;C._p=new Promise(function(A,Y){C.onload=A,C.onerror=Y}),Qi(b,"link",p),u.instance=b}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(u,l),(l=u.state.preload)&&(u.state.loading&3)===0&&(o.count++,u=Ef.bind(o),l.addEventListener("load",u),l.addEventListener("error",u))}}var Z0=0;function E3(o,l){return o.stylesheets&&o.count===0&&Af(o,o.stylesheets),0<o.count||0<o.imgCount?function(u){var p=setTimeout(function(){if(o.stylesheets&&Af(o,o.stylesheets),o.unsuspend){var b=o.unsuspend;o.unsuspend=null,b()}},6e4+l);0<o.imgBytes&&Z0===0&&(Z0=62500*u3());var y=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Af(o,o.stylesheets),o.unsuspend)){var b=o.unsuspend;o.unsuspend=null,b()}},(o.imgBytes>Z0?50:800)+l);return o.unsuspend=u,function(){o.unsuspend=null,clearTimeout(p),clearTimeout(y)}}:null}function Ef(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Af(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Rf=null;function Af(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Rf=new Map,l.forEach(R3,o),Rf=null,Ef.call(o))}function R3(o,l){if(!(l.state.loading&4)){var u=Rf.get(o);if(u)var p=u.get(null);else{u=new Map,Rf.set(o,u);for(var y=o.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<y.length;b++){var C=y[b];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(u.set(C.dataset.precedence,C),p=C)}p&&u.set(null,p)}y=l.instance,C=y.getAttribute("data-precedence"),b=u.get(C)||p,b===p&&u.set(null,y),u.set(C,y),this.count++,p=Ef.bind(this),y.addEventListener("load",p),y.addEventListener("error",p),b?b.parentNode.insertBefore(y,b.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(y,o.firstChild)),l.state.loading|=4}}var Qh={$$typeof:k,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function A3(o,l,u,p,y,b,C,A,Y){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Lc(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lc(0),this.hiddenUpdates=Lc(null),this.identifierPrefix=p,this.onUncaughtError=y,this.onCaughtError=b,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function $k(o,l,u,p,y,b,C,A,Y,te,se,he){return o=new A3(o,l,u,C,Y,te,se,he,A),l=1,b===!0&&(l|=24),b=wn(3,null,null,l),o.current=b,b.stateNode=o,l=bO(),l.refCount++,o.pooledCache=l,l.refCount++,b.memoizedState={element:p,isDehydrated:u,cache:l},kO(b),o}function Pk(o){return o?(o=ml,o):ml}function Ek(o,l,u,p,y,b){y=Pk(y),p.context===null?p.context=y:p.pendingContext=y,p=eo(l),p.payload={element:u},b=b===void 0?null:b,b!==null&&(p.callback=b),u=to(o,p,l),u!==null&&(pn(u,o,l),oh(u,o,l))}function Rk(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var u=o.retryLane;o.retryLane=u!==0&&u<l?u:l}}function W0(o,l){Rk(o,l),(o=o.alternate)&&Rk(o,l)}function Ak(o){if(o.tag===13||o.tag===31){var l=oa(o,67108864);l!==null&&pn(l,o,67108864),W0(o,67108864)}}function Mk(o){if(o.tag===13||o.tag===31){var l=$n();l=Xc(l);var u=oa(o,l);u!==null&&pn(u,o,l),W0(o,l)}}var Mf=!0;function M3(o,l,u,p){var y=P.T;P.T=null;var b=Z.p;try{Z.p=2,q0(o,l,u,p)}finally{Z.p=b,P.T=y}}function z3(o,l,u,p){var y=P.T;P.T=null;var b=Z.p;try{Z.p=8,q0(o,l,u,p)}finally{Z.p=b,P.T=y}}function q0(o,l,u,p){if(Mf){var y=V0(p);if(y===null)P0(o,l,p,zf,u),jk(o,p);else if(D3(y,o,l,u,p))p.stopPropagation();else if(jk(o,p),l&4&&-1<j3.indexOf(o)){for(;y!==null;){var b=Ws(y);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var C=Kr(b.pendingLanes);if(C!==0){var A=b;for(A.pendingLanes|=2,A.entangledLanes|=2;C;){var Y=1<<31-Yi(C);A.entanglements[1]|=Y,C&=~Y}$r(b),(ft&6)===0&&(Of=Le()+500,_h(0))}}break;case 31:case 13:A=oa(b,2),A!==null&&pn(A,b,2),yf(),W0(b,2)}if(b=V0(p),b===null&&P0(o,l,p,zf,u),b===y)break;y=b}y!==null&&p.stopPropagation()}else P0(o,l,p,null,u)}}function V0(o){return o=Ym(o),I0(o)}var zf=null;function I0(o){if(zf=null,o=Zs(o),o!==null){var l=s(o);if(l===null)o=null;else{var u=l.tag;if(u===13){if(o=a(l),o!==null)return o;o=null}else if(u===31){if(o=c(l),o!==null)return o;o=null}else if(u===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null)}}return zf=o,null}function zk(o){switch(o){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(sn()){case on:return 2;case Vi:return 8;case Go:case Rm:return 32;case tl:return 268435456;default:return 32}default:return 32}}var Y0=!1,fo=null,po=null,go=null,$h=new Map,Ph=new Map,mo=[],j3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function jk(o,l){switch(o){case"focusin":case"focusout":fo=null;break;case"dragenter":case"dragleave":po=null;break;case"mouseover":case"mouseout":go=null;break;case"pointerover":case"pointerout":$h.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ph.delete(l.pointerId)}}function Eh(o,l,u,p,y,b){return o===null||o.nativeEvent!==b?(o={blockedOn:l,domEventName:u,eventSystemFlags:p,nativeEvent:b,targetContainers:[y]},l!==null&&(l=Ws(l),l!==null&&Ak(l)),o):(o.eventSystemFlags|=p,l=o.targetContainers,y!==null&&l.indexOf(y)===-1&&l.push(y),o)}function D3(o,l,u,p,y){switch(l){case"focusin":return fo=Eh(fo,o,l,u,p,y),!0;case"dragenter":return po=Eh(po,o,l,u,p,y),!0;case"mouseover":return go=Eh(go,o,l,u,p,y),!0;case"pointerover":var b=y.pointerId;return $h.set(b,Eh($h.get(b)||null,o,l,u,p,y)),!0;case"gotpointercapture":return b=y.pointerId,Ph.set(b,Eh(Ph.get(b)||null,o,l,u,p,y)),!0}return!1}function Dk(o){var l=Zs(o.target);if(l!==null){var u=s(l);if(u!==null){if(l=u.tag,l===13){if(l=a(u),l!==null){o.blockedOn=l,_d(o.priority,function(){Mk(u)});return}}else if(l===31){if(l=c(u),l!==null){o.blockedOn=l,_d(o.priority,function(){Mk(u)});return}}else if(l===3&&u.stateNode.current.memoizedState.isDehydrated){o.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}o.blockedOn=null}function jf(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var u=V0(o.nativeEvent);if(u===null){u=o.nativeEvent;var p=new u.constructor(u.type,u);Im=p,u.target.dispatchEvent(p),Im=null}else return l=Ws(u),l!==null&&Ak(l),o.blockedOn=u,!1;l.shift()}return!0}function Bk(o,l,u){jf(o)&&u.delete(l)}function B3(){Y0=!1,fo!==null&&jf(fo)&&(fo=null),po!==null&&jf(po)&&(po=null),go!==null&&jf(go)&&(go=null),$h.forEach(Bk),Ph.forEach(Bk)}function Df(o,l){o.blockedOn===l&&(o.blockedOn=null,Y0||(Y0=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,B3)))}var Bf=null;function Lk(o){Bf!==o&&(Bf=o,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bf===o&&(Bf=null);for(var l=0;l<o.length;l+=3){var u=o[l],p=o[l+1],y=o[l+2];if(typeof p!="function"){if(I0(p||u)===null)continue;break}var b=Ws(u);b!==null&&(o.splice(l,3),l-=3,VO(b,{pending:!0,data:y,method:u.method,action:p},p,y))}}))}function Xl(o){function l(Y){return Df(Y,o)}fo!==null&&Df(fo,o),po!==null&&Df(po,o),go!==null&&Df(go,o),$h.forEach(l),Ph.forEach(l);for(var u=0;u<mo.length;u++){var p=mo[u];p.blockedOn===o&&(p.blockedOn=null)}for(;0<mo.length&&(u=mo[0],u.blockedOn===null);)Dk(u),u.blockedOn===null&&mo.shift();if(u=(o.ownerDocument||o).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var y=u[p],b=u[p+1],C=y[Di]||null;if(typeof b=="function")C||Lk(u);else if(C){var A=null;if(b&&b.hasAttribute("formAction")){if(y=b,C=b[Di]||null)A=C.formAction;else if(I0(y)!==null)continue}else A=C.action;typeof A=="function"?u[p+1]=A:(u.splice(p,3),p-=3),Lk(u)}}}function Xk(){function o(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(C){return y=C})},focusReset:"manual",scroll:"manual"})}function l(){y!==null&&(y(),y=null),p||setTimeout(u,20)}function u(){if(!p&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,y=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),y!==null&&(y(),y=null)}}}function H0(o){this._internalRoot=o}Lf.prototype.render=H0.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(n(409));var u=l.current,p=$n();Ek(u,p,o,l,null,null)},Lf.prototype.unmount=H0.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;Ek(o.current,2,null,o,null,null),yf(),l[Jr]=null}};function Lf(o){this._internalRoot=o}Lf.prototype.unstable_scheduleHydration=function(o){if(o){var l=bd();o={blockedOn:null,target:o,priority:l};for(var u=0;u<mo.length&&l!==0&&l<mo[u].priority;u++);mo.splice(u,0,o),u===0&&Dk(o)}};var Nk=e.version;if(Nk!=="19.2.4")throw Error(n(527,Nk,"19.2.4"));Z.findDOMNode=function(o){var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=d(l),o=o!==null?f(o):null,o=o===null?null:o.stateNode,o};var L3={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xf.isDisabled&&Xf.supportsFiber)try{Fo=Xf.inject(L3),Ii=Xf}catch{}}return Ah.createRoot=function(o,l){if(!r(o))throw Error(n(299));var u=!1,p="",y=Hx,b=Ux,C=Gx;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(C=l.onRecoverableError)),l=$k(o,1,!1,null,null,u,p,null,y,b,C,Xk),o[Jr]=l.current,$0(o),new H0(l)},Ah.hydrateRoot=function(o,l,u){if(!r(o))throw Error(n(299));var p=!1,y="",b=Hx,C=Ux,A=Gx,Y=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(b=u.onUncaughtError),u.onCaughtError!==void 0&&(C=u.onCaughtError),u.onRecoverableError!==void 0&&(A=u.onRecoverableError),u.formState!==void 0&&(Y=u.formState)),l=$k(o,1,!0,l,u??null,p,y,Y,b,C,A,Xk),l.context=Pk(null),u=l.current,p=$n(),p=Xc(p),y=eo(p),y.callback=null,to(u,y,p),u=p,l.current.lanes=u,Jo(l,u),$r(l),o[Jr]=l.current,$0(o),new Lf(l)},Ah.version="19.2.4",Ah}var Fk;function H3(){if(Fk)return F0.exports;Fk=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),F0.exports=Y3(),F0.exports}var U3=H3();const Kk=t=>{let e;const i=new Set,n=(d,f)=>{const g=typeof d=="function"?d(e):d;if(!Object.is(g,e)){const m=e;e=f??(typeof g!="object"||g===null)?g:Object.assign({},e,g),i.forEach(O=>O(e,m))}},r=()=>e,c={setState:n,getState:r,getInitialState:()=>h,subscribe:d=>(i.add(d),()=>i.delete(d))},h=e=t(n,r,c);return c},G3=(t=>t?Kk(t):Kk),F3=t=>t;function K3(t,e=F3){const i=Ul.useSyncExternalStore(t.subscribe,Ul.useCallback(()=>e(t.getState()),[t,e]),Ul.useCallback(()=>e(t.getInitialState()),[t,e]));return Ul.useDebugValue(i),i}const Jk=t=>{const e=G3(t),i=n=>K3(e,n);return Object.assign(i,e),i},J3=(t=>t?Jk(t):Jk),eD=`ws://${window.location.hostname}:${window.location.port||31415}`,Ui="",Ce=J3((t,e)=>({agents:[],connected:!1,ws:null,daemonHost:null,tunneled:!1,activeTab:"agents",detailPanel:null,activityLog:{},statusMessage:null,commandHistory:[],chatHistory:{},tokenTimeline:{},dashTelemetry:{},editorFiles:{},editorActiveFile:null,editorOpenTabs:[],editorTreeCache:{},editorChangedFiles:{},editorRecentSaves:{},connect(){if(e().ws)return;const i=new WebSocket(eD);i.onopen=()=>{t({connected:!0,ws:i}),fetch(`${Ui}/api/status`).then(n=>n.json()).then(n=>{const r={};n.host&&n.host!=="127.0.0.1"&&(r.daemonHost=n.host);const s=window.location.port||"80";String(n.port)!==s&&(r.tunneled=!0),Object.keys(r).length>0&&t(r)}).catch(()=>{})},i.onmessage=n=>{const r=JSON.parse(n.data);switch(r.type){case"state":{const s={...e().tokenTimeline},a=Date.now();for(const c of r.data){s[c.id]||(s[c.id]=[]);const h=s[c.id],d=h[h.length-1];(!d||c.tokensUsed!==d.v||a-d.t>5e3)&&(h.push({t:a,v:c.tokensUsed||0}),h.length>200&&(s[c.id]=h.slice(-200)))}t({agents:r.data,tokenTimeline:s});break}case"agent:output":{const{agentId:s,data:a}=r,c={...e().activityLog};c[s]||(c[s]=[]),c[s]=[...c[s].slice(-200),{timestamp:Date.now(),text:typeof a.data=="string"?a.data:JSON.stringify(a.data),type:a.type}],t({activityLog:c});break}case"agent:exit":{const s=e().agents.find(h=>h.id===r.agentId),a=(s==null?void 0:s.name)||r.agentId,c=r.status==="completed"?`${a} completed`:r.status==="killed"?`${a} killed`:`${a} crashed (exit ${r.code})`;e().showStatus(c);break}case"rotation:start":e().showStatus(`rotating ${r.agentName}...`);break;case"rotation:complete":{e().showStatus(`rotated ${r.agentName} (saved ${r.tokensSaved} tokens)`);const s=e().detailPanel;(s==null?void 0:s.type)==="agent"&&s.agentId===r.oldAgentId&&r.newAgentId&&t(a=>{const c={...a.chatHistory},h={...a.tokenTimeline},d=c[r.oldAgentId]||[],f=h[r.oldAgentId]||[];return d.length>0&&(c[r.newAgentId]=[...d]),f.length>0&&(h[r.newAgentId]=[...f]),{chatHistory:c,tokenTimeline:h,detailPanel:{type:"agent",agentId:r.newAgentId}}});break}case"rotation:failed":e().showStatus(`rotation failed: ${r.error}`);break;case"file:changed":{const s=e().editorRecentSaves[r.path];if(s&&Date.now()-s<2e3)break;t(a=>({editorChangedFiles:{...a.editorChangedFiles,[r.path]:r.timestamp}}));break}}},i.onclose=()=>{t({connected:!1,ws:null,daemonHost:null,tunneled:!1}),setTimeout(()=>e().connect(),2e3)},i.onerror=()=>i.close()},async spawnAgent(i){const n=await fetch(`${Ui}/api/agents`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!n.ok){const s=await n.json().catch(()=>({}));throw new Error(s.error||"Spawn failed")}const r=await n.json();return e().showStatus(`spawned ${r.name}`),r},async killAgent(i,n=!1){await fetch(`${Ui}/api/agents/${i}?purge=${n}`,{method:"DELETE"})},async rotateAgent(i){const n=await fetch(`${Ui}/api/agents/${i}/rotate`,{method:"POST"});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||"Rotation failed")}return n.json()},async fetchProviders(){return(await fetch(`${Ui}/api/providers`)).json()},setActiveTab(i){t({activeTab:i})},openDetail(i){t({detailPanel:i})},closeDetail(){t({detailPanel:null})},selectAgent(i){t({detailPanel:{type:"agent",agentId:i}})},clearSelection(){t({detailPanel:null})},showStatus(i){t({statusMessage:i}),setTimeout(()=>{e().statusMessage===i&&t({statusMessage:null})},4e3)},addChatMessage(i,n,r,s=!1){t(a=>{const c={...a.chatHistory};return c[i]||(c[i]=[]),c[i]=[...c[i].slice(-100),{from:n,text:r,timestamp:Date.now(),isQuery:s}],{chatHistory:c}})},async instructAgent(i,n){const r=e().agents.find(f=>f.id===i),s=r&&(r.status==="running"||r.status==="starting");e().addChatMessage(i,"user",n,!1),e().addChatMessage(i,"system",s?"sending instruction...":"continuing conversation...");const a=await fetch(`${Ui}/api/agents/${i}/instruct`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:n})});if(!a.ok){const f=await a.json().catch(()=>({}));throw e().addChatMessage(i,"system",`failed: ${f.error||"unknown error"}`),new Error(f.error||"Instruction failed")}const c=await a.json(),h=e().chatHistory[i]||[];h.length>0&&t(f=>{const g={...f.chatHistory};return g[c.id]=[...h],{chatHistory:g}});const d=e().tokenTimeline[i]||[];return d.length>0&&t(f=>{const g={...f.tokenTimeline};return g[c.id]=[...d],{tokenTimeline:g}}),e().selectAgent(c.id),e().addChatMessage(c.id,"system","agent resumed with context"),c},async queryAgent(i,n){e().addChatMessage(i,"user",n,!0);const r=await fetch(`${Ui}/api/agents/${i}/query`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:n})});if(!r.ok){const a=await r.json().catch(()=>({}));throw e().addChatMessage(i,"system",`query failed: ${a.error||"unknown error"}`),new Error(a.error||"Query failed")}const s=await r.json();return e().addChatMessage(i,"agent",s.response),s},async openFile(i){var s;if(e().editorFiles[i]||e().editorOpenTabs.includes(i)){t(a=>({editorActiveFile:i,editorOpenTabs:a.editorOpenTabs.includes(i)?a.editorOpenTabs:[...a.editorOpenTabs,i]}));return}const n=(s=i.split(".").pop())==null?void 0:s.toLowerCase();if(["png","jpg","jpeg","gif","svg","webp","ico","bmp","avif","mp4","webm","mov","avi","mkv","ogv"].includes(n)){t(a=>({editorActiveFile:i,editorOpenTabs:[...a.editorOpenTabs,i]}));return}try{const a=await fetch(`${Ui}/api/files/read?path=${encodeURIComponent(i)}`);if(!a.ok){const d=await a.json().catch(()=>({}));e().showStatus(d.error||"Failed to read file");return}const c=await a.json();if(c.binary){e().showStatus("Binary file — cannot open");return}t(d=>({editorFiles:{...d.editorFiles,[i]:{content:c.content,originalContent:c.content,language:c.language,loadedAt:Date.now()}},editorActiveFile:i,editorOpenTabs:d.editorOpenTabs.includes(i)?d.editorOpenTabs:[...d.editorOpenTabs,i]}));const h=e().ws;(h==null?void 0:h.readyState)===1&&h.send(JSON.stringify({type:"editor:watch",path:i}))}catch{e().showStatus("Failed to open file")}},closeFile(i){t(r=>{const s=r.editorOpenTabs.filter(d=>d!==i),a={...r.editorFiles};delete a[i];const c={...r.editorChangedFiles};delete c[i];let h=r.editorActiveFile;if(h===i){const d=r.editorOpenTabs.indexOf(i);h=s[Math.min(d,s.length-1)]||null}return{editorOpenTabs:s,editorFiles:a,editorChangedFiles:c,editorActiveFile:h}});const n=e().ws;(n==null?void 0:n.readyState)===1&&n.send(JSON.stringify({type:"editor:unwatch",path:i}))},setActiveFile(i){t({editorActiveFile:i})},updateFileContent(i,n){t(r=>({editorFiles:{...r.editorFiles,[i]:{...r.editorFiles[i],content:n}}}))},async saveFile(i){const n=e().editorFiles[i];if(n)try{const r=await fetch(`${Ui}/api/files/write`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:i,content:n.content})});if(!r.ok){const s=await r.json().catch(()=>({}));e().showStatus(s.error||"Save failed");return}t(s=>({editorFiles:{...s.editorFiles,[i]:{...s.editorFiles[i],originalContent:n.content}},editorChangedFiles:(()=>{const a={...s.editorChangedFiles};return delete a[i],a})(),editorRecentSaves:{...s.editorRecentSaves,[i]:Date.now()}})),e().showStatus("Saved")}catch{e().showStatus("Save failed")}},async reloadFile(i){try{const n=await fetch(`${Ui}/api/files/read?path=${encodeURIComponent(i)}`);if(!n.ok)return;const r=await n.json();if(r.binary)return;t(s=>({editorFiles:{...s.editorFiles,[i]:{content:r.content,originalContent:r.content,language:r.language,loadedAt:Date.now()}},editorChangedFiles:(()=>{const a={...s.editorChangedFiles};return delete a[i],a})()}))}catch{}},dismissFileChange(i){t(n=>{const r={...n.editorChangedFiles};return delete r[i],{editorChangedFiles:r}})},async fetchTreeDir(i){try{const n=await fetch(`${Ui}/api/files/tree?path=${encodeURIComponent(i)}`);if(!n.ok)return;const r=await n.json();t(s=>({editorTreeCache:{...s.editorTreeCache,[i]:r.entries}}))}catch{}},async createFile(i){try{const n=await fetch(`${Ui}/api/files/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:i})});if(!n.ok){const s=await n.json().catch(()=>({}));return e().showStatus(s.error||"Create failed"),!1}const r=i.includes("/")?i.split("/").slice(0,-1).join("/"):"";return await e().fetchTreeDir(r),e().showStatus("File created"),!0}catch{return e().showStatus("Create failed"),!1}},async createDir(i){try{const n=await fetch(`${Ui}/api/files/mkdir`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:i})});if(!n.ok){const s=await n.json().catch(()=>({}));return e().showStatus(s.error||"Create failed"),!1}const r=i.includes("/")?i.split("/").slice(0,-1).join("/"):"";return await e().fetchTreeDir(r),e().showStatus("Folder created"),!0}catch{return e().showStatus("Create failed"),!1}},async deleteFile(i){try{const n=await fetch(`${Ui}/api/files/delete?path=${encodeURIComponent(i)}`,{method:"DELETE"});if(!n.ok){const s=await n.json().catch(()=>({}));return e().showStatus(s.error||"Delete failed"),!1}e().editorOpenTabs.includes(i)&&e().closeFile(i);const r=i.includes("/")?i.split("/").slice(0,-1).join("/"):"";return await e().fetchTreeDir(r),t(s=>{const a={...s.editorTreeCache};return delete a[i],{editorTreeCache:a}}),e().showStatus("Deleted"),!0}catch{return e().showStatus("Delete failed"),!1}},async renameFile(i,n){try{const r=await fetch(`${Ui}/api/files/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldPath:i,newPath:n})});if(!r.ok){const c=await r.json().catch(()=>({}));return e().showStatus(c.error||"Rename failed"),!1}t(c=>{const h=c.editorOpenTabs.map(g=>g===i?n:g),d={...c.editorFiles};d[i]&&(d[n]=d[i],delete d[i]);const f=c.editorActiveFile===i?n:c.editorActiveFile;return{editorOpenTabs:h,editorFiles:d,editorActiveFile:f}});const s=i.includes("/")?i.split("/").slice(0,-1).join("/"):"",a=n.includes("/")?n.split("/").slice(0,-1).join("/"):"";return await e().fetchTreeDir(s),a!==s&&await e().fetchTreeDir(a),e().showStatus("Renamed"),!0}catch{return e().showStatus("Rename failed"),!1}},addCommand(i){t(n=>({commandHistory:[...n.commandHistory.slice(-49),i]}))}}));function ai(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let i=0,n;i<t.length;i++)(n=ai(t[i]))!==""&&(e+=(e&&" ")+n);else for(let i in t)t[i]&&(e+=(e&&" ")+i);return e}var tD={value:()=>{}};function em(){for(var t=0,e=arguments.length,i={},n;t<e;++t){if(!(n=arguments[t]+"")||n in i||/[\s.]/.test(n))throw new Error("illegal type: "+n);i[n]=[]}return new Ep(i)}function Ep(t){this._=t}function iD(t,e){return t.trim().split(/^|\s+/).map(function(i){var n="",r=i.indexOf(".");if(r>=0&&(n=i.slice(r+1),i=i.slice(0,r)),i&&!e.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:n}})}Ep.prototype=em.prototype={constructor:Ep,on:function(t,e){var i=this._,n=iD(t+"",i),r,s=-1,a=n.length;if(arguments.length<2){for(;++s<a;)if((r=(t=n[s]).type)&&(r=nD(i[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<a;)if(r=(t=n[s]).type)i[r]=eC(i[r],t.name,e);else if(e==null)for(r in i)i[r]=eC(i[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var i in e)t[i]=e[i].slice();return new Ep(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var i=new Array(r),n=0,r,s;n<r;++n)i[n]=arguments[n+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],n=0,r=s.length;n<r;++n)s[n].value.apply(e,i)},apply:function(t,e,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var n=this._[t],r=0,s=n.length;r<s;++r)n[r].value.apply(e,i)}};function nD(t,e){for(var i=0,n=t.length,r;i<n;++i)if((r=t[i]).name===e)return r.value}function eC(t,e,i){for(var n=0,r=t.length;n<r;++n)if(t[n].name===e){t[n]=tD,t=t.slice(0,n).concat(t.slice(n+1));break}return i!=null&&t.push({name:e,value:i}),t}var _y="http://www.w3.org/1999/xhtml";const tC={svg:"http://www.w3.org/2000/svg",xhtml:_y,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function tm(t){var e=t+="",i=e.indexOf(":");return i>=0&&(e=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),tC.hasOwnProperty(e)?{space:tC[e],local:t}:t}function rD(t){return function(){var e=this.ownerDocument,i=this.namespaceURI;return i===_y&&e.documentElement.namespaceURI===_y?e.createElement(t):e.createElementNS(i,t)}}function sD(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function q$(t){var e=tm(t);return(e.local?sD:rD)(e)}function oD(){}function _1(t){return t==null?oD:function(){return this.querySelector(t)}}function aD(t){typeof t!="function"&&(t=_1(t));for(var e=this._groups,i=e.length,n=new Array(i),r=0;r<i;++r)for(var s=e[r],a=s.length,c=n[r]=new Array(a),h,d,f=0;f<a;++f)(h=s[f])&&(d=t.call(h,h.__data__,f,s))&&("__data__"in h&&(d.__data__=h.__data__),c[f]=d);return new Xn(n,this._parents)}function lD(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function cD(){return[]}function V$(t){return t==null?cD:function(){return this.querySelectorAll(t)}}function hD(t){return function(){return lD(t.apply(this,arguments))}}function uD(t){typeof t=="function"?t=hD(t):t=V$(t);for(var e=this._groups,i=e.length,n=[],r=[],s=0;s<i;++s)for(var a=e[s],c=a.length,h,d=0;d<c;++d)(h=a[d])&&(n.push(t.call(h,h.__data__,d,a)),r.push(h));return new Xn(n,r)}function I$(t){return function(){return this.matches(t)}}function Y$(t){return function(e){return e.matches(t)}}var dD=Array.prototype.find;function fD(t){return function(){return dD.call(this.children,t)}}function pD(){return this.firstElementChild}function gD(t){return this.select(t==null?pD:fD(typeof t=="function"?t:Y$(t)))}var mD=Array.prototype.filter;function OD(){return Array.from(this.children)}function vD(t){return function(){return mD.call(this.children,t)}}function yD(t){return this.selectAll(t==null?OD:vD(typeof t=="function"?t:Y$(t)))}function SD(t){typeof t!="function"&&(t=I$(t));for(var e=this._groups,i=e.length,n=new Array(i),r=0;r<i;++r)for(var s=e[r],a=s.length,c=n[r]=[],h,d=0;d<a;++d)(h=s[d])&&t.call(h,h.__data__,d,s)&&c.push(h);return new Xn(n,this._parents)}function H$(t){return new Array(t.length)}function bD(){return new Xn(this._enter||this._groups.map(H$),this._parents)}function ng(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}ng.prototype={constructor:ng,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function _D(t){return function(){return t}}function xD(t,e,i,n,r,s){for(var a=0,c,h=e.length,d=s.length;a<d;++a)(c=e[a])?(c.__data__=s[a],n[a]=c):i[a]=new ng(t,s[a]);for(;a<h;++a)(c=e[a])&&(r[a]=c)}function wD(t,e,i,n,r,s,a){var c,h,d=new Map,f=e.length,g=s.length,m=new Array(f),O;for(c=0;c<f;++c)(h=e[c])&&(m[c]=O=a.call(h,h.__data__,c,e)+"",d.has(O)?r[c]=h:d.set(O,h));for(c=0;c<g;++c)O=a.call(t,s[c],c,s)+"",(h=d.get(O))?(n[c]=h,h.__data__=s[c],d.delete(O)):i[c]=new ng(t,s[c]);for(c=0;c<f;++c)(h=e[c])&&d.get(m[c])===h&&(r[c]=h)}function kD(t){return t.__data__}function CD(t,e){if(!arguments.length)return Array.from(this,kD);var i=e?wD:xD,n=this._parents,r=this._groups;typeof t!="function"&&(t=_D(t));for(var s=r.length,a=new Array(s),c=new Array(s),h=new Array(s),d=0;d<s;++d){var f=n[d],g=r[d],m=g.length,O=TD(t.call(f,f&&f.__data__,d,n)),S=O.length,_=c[d]=new Array(S),w=a[d]=new Array(S),x=h[d]=new Array(m);i(f,g,_,w,x,O,e);for(var Q=0,k=0,T,M;Q<S;++Q)if(T=_[Q]){for(Q>=k&&(k=Q+1);!(M=w[k])&&++k<S;);T._next=M||null}}return a=new Xn(a,n),a._enter=c,a._exit=h,a}function TD(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function QD(){return new Xn(this._exit||this._groups.map(H$),this._parents)}function $D(t,e,i){var n=this.enter(),r=this,s=this.exit();return typeof t=="function"?(n=t(n),n&&(n=n.selection())):n=n.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),i==null?s.remove():i(s),n&&r?n.merge(r).order():r}function PD(t){for(var e=t.selection?t.selection():t,i=this._groups,n=e._groups,r=i.length,s=n.length,a=Math.min(r,s),c=new Array(r),h=0;h<a;++h)for(var d=i[h],f=n[h],g=d.length,m=c[h]=new Array(g),O,S=0;S<g;++S)(O=d[S]||f[S])&&(m[S]=O);for(;h<r;++h)c[h]=i[h];return new Xn(c,this._parents)}function ED(){for(var t=this._groups,e=-1,i=t.length;++e<i;)for(var n=t[e],r=n.length-1,s=n[r],a;--r>=0;)(a=n[r])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function RD(t){t||(t=AD);function e(g,m){return g&&m?t(g.__data__,m.__data__):!g-!m}for(var i=this._groups,n=i.length,r=new Array(n),s=0;s<n;++s){for(var a=i[s],c=a.length,h=r[s]=new Array(c),d,f=0;f<c;++f)(d=a[f])&&(h[f]=d);h.sort(e)}return new Xn(r,this._parents).order()}function AD(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function MD(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function zD(){return Array.from(this)}function jD(){for(var t=this._groups,e=0,i=t.length;e<i;++e)for(var n=t[e],r=0,s=n.length;r<s;++r){var a=n[r];if(a)return a}return null}function DD(){let t=0;for(const e of this)++t;return t}function BD(){return!this.node()}function LD(t){for(var e=this._groups,i=0,n=e.length;i<n;++i)for(var r=e[i],s=0,a=r.length,c;s<a;++s)(c=r[s])&&t.call(c,c.__data__,s,r);return this}function XD(t){return function(){this.removeAttribute(t)}}function ND(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ZD(t,e){return function(){this.setAttribute(t,e)}}function WD(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function qD(t,e){return function(){var i=e.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function VD(t,e){return function(){var i=e.apply(this,arguments);i==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function ID(t,e){var i=tm(t);if(arguments.length<2){var n=this.node();return i.local?n.getAttributeNS(i.space,i.local):n.getAttribute(i)}return this.each((e==null?i.local?ND:XD:typeof e=="function"?i.local?VD:qD:i.local?WD:ZD)(i,e))}function U$(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function YD(t){return function(){this.style.removeProperty(t)}}function HD(t,e,i){return function(){this.style.setProperty(t,e,i)}}function UD(t,e,i){return function(){var n=e.apply(this,arguments);n==null?this.style.removeProperty(t):this.style.setProperty(t,n,i)}}function GD(t,e,i){return arguments.length>1?this.each((e==null?YD:typeof e=="function"?UD:HD)(t,e,i??"")):pc(this.node(),t)}function pc(t,e){return t.style.getPropertyValue(e)||U$(t).getComputedStyle(t,null).getPropertyValue(e)}function FD(t){return function(){delete this[t]}}function KD(t,e){return function(){this[t]=e}}function JD(t,e){return function(){var i=e.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function eB(t,e){return arguments.length>1?this.each((e==null?FD:typeof e=="function"?JD:KD)(t,e)):this.node()[t]}function G$(t){return t.trim().split(/^|\s+/)}function x1(t){return t.classList||new F$(t)}function F$(t){this._node=t,this._names=G$(t.getAttribute("class")||"")}F$.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function K$(t,e){for(var i=x1(t),n=-1,r=e.length;++n<r;)i.add(e[n])}function J$(t,e){for(var i=x1(t),n=-1,r=e.length;++n<r;)i.remove(e[n])}function tB(t){return function(){K$(this,t)}}function iB(t){return function(){J$(this,t)}}function nB(t,e){return function(){(e.apply(this,arguments)?K$:J$)(this,t)}}function rB(t,e){var i=G$(t+"");if(arguments.length<2){for(var n=x1(this.node()),r=-1,s=i.length;++r<s;)if(!n.contains(i[r]))return!1;return!0}return this.each((typeof e=="function"?nB:e?tB:iB)(i,e))}function sB(){this.textContent=""}function oB(t){return function(){this.textContent=t}}function aB(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function lB(t){return arguments.length?this.each(t==null?sB:(typeof t=="function"?aB:oB)(t)):this.node().textContent}function cB(){this.innerHTML=""}function hB(t){return function(){this.innerHTML=t}}function uB(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function dB(t){return arguments.length?this.each(t==null?cB:(typeof t=="function"?uB:hB)(t)):this.node().innerHTML}function fB(){this.nextSibling&&this.parentNode.appendChild(this)}function pB(){return this.each(fB)}function gB(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mB(){return this.each(gB)}function OB(t){var e=typeof t=="function"?t:q$(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function vB(){return null}function yB(t,e){var i=typeof t=="function"?t:q$(t),n=e==null?vB:typeof e=="function"?e:_1(e);return this.select(function(){return this.insertBefore(i.apply(this,arguments),n.apply(this,arguments)||null)})}function SB(){var t=this.parentNode;t&&t.removeChild(this)}function bB(){return this.each(SB)}function _B(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function xB(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function wB(t){return this.select(t?xB:_B)}function kB(t){return arguments.length?this.property("__data__",t):this.node().__data__}function CB(t){return function(e){t.call(this,e,this.__data__)}}function TB(t){return t.trim().split(/^|\s+/).map(function(e){var i="",n=e.indexOf(".");return n>=0&&(i=e.slice(n+1),e=e.slice(0,n)),{type:e,name:i}})}function QB(t){return function(){var e=this.__on;if(e){for(var i=0,n=-1,r=e.length,s;i<r;++i)s=e[i],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++n]=s;++n?e.length=n:delete this.__on}}}function $B(t,e,i){return function(){var n=this.__on,r,s=CB(e);if(n){for(var a=0,c=n.length;a<c;++a)if((r=n[a]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=i),r.value=e;return}}this.addEventListener(t.type,s,i),r={type:t.type,name:t.name,value:e,listener:s,options:i},n?n.push(r):this.__on=[r]}}function PB(t,e,i){var n=TB(t+""),r,s=n.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var h=0,d=c.length,f;h<d;++h)for(r=0,f=c[h];r<s;++r)if((a=n[r]).type===f.type&&a.name===f.name)return f.value}return}for(c=e?$B:QB,r=0;r<s;++r)this.each(c(n[r],e,i));return this}function eP(t,e,i){var n=U$(t),r=n.CustomEvent;typeof r=="function"?r=new r(e,i):(r=n.document.createEvent("Event"),i?(r.initEvent(e,i.bubbles,i.cancelable),r.detail=i.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function EB(t,e){return function(){return eP(this,t,e)}}function RB(t,e){return function(){return eP(this,t,e.apply(this,arguments))}}function AB(t,e){return this.each((typeof e=="function"?RB:EB)(t,e))}function*MB(){for(var t=this._groups,e=0,i=t.length;e<i;++e)for(var n=t[e],r=0,s=n.length,a;r<s;++r)(a=n[r])&&(yield a)}var tP=[null];function Xn(t,e){this._groups=t,this._parents=e}function Fu(){return new Xn([[document.documentElement]],tP)}function zB(){return this}Xn.prototype=Fu.prototype={constructor:Xn,select:aD,selectAll:uD,selectChild:gD,selectChildren:yD,filter:SD,data:CD,enter:bD,exit:QD,join:$D,merge:PD,selection:zB,order:ED,sort:RD,call:MD,nodes:zD,node:jD,size:DD,empty:BD,each:LD,attr:ID,style:GD,property:eB,classed:rB,text:lB,html:dB,raise:pB,lower:mB,append:OB,insert:yB,remove:bB,clone:wB,datum:kB,on:PB,dispatch:AB,[Symbol.iterator]:MB};function Bn(t){return typeof t=="string"?new Xn([[document.querySelector(t)]],[document.documentElement]):new Xn([[t]],tP)}function jB(t){let e;for(;e=t.sourceEvent;)t=e;return t}function pr(t,e){if(t=jB(t),e===void 0&&(e=t.currentTarget),e){var i=e.ownerSVGElement||e;if(i.createSVGPoint){var n=i.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n=n.matrixTransform(e.getScreenCTM().inverse()),[n.x,n.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}const DB={passive:!1},Su={capture:!0,passive:!1};function tv(t){t.stopImmediatePropagation()}function nc(t){t.preventDefault(),t.stopImmediatePropagation()}function iP(t){var e=t.document.documentElement,i=Bn(t).on("dragstart.drag",nc,Su);"onselectstart"in e?i.on("selectstart.drag",nc,Su):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function nP(t,e){var i=t.document.documentElement,n=Bn(t).on("dragstart.drag",null);e&&(n.on("click.drag",nc,Su),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in i?n.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Nf=t=>()=>t;function xy(t,{sourceEvent:e,subject:i,target:n,identifier:r,active:s,x:a,y:c,dx:h,dy:d,dispatch:f}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:f}})}xy.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function BB(t){return!t.ctrlKey&&!t.button}function LB(){return this.parentNode}function XB(t,e){return e??{x:t.x,y:t.y}}function NB(){return navigator.maxTouchPoints||"ontouchstart"in this}function rP(){var t=BB,e=LB,i=XB,n=NB,r={},s=em("start","drag","end"),a=0,c,h,d,f,g=0;function m(T){T.on("mousedown.drag",O).filter(n).on("touchstart.drag",w).on("touchmove.drag",x,DB).on("touchend.drag touchcancel.drag",Q).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function O(T,M){if(!(f||!t.call(this,T,M))){var $=k(this,e.call(this,T,M),T,M,"mouse");$&&(Bn(T.view).on("mousemove.drag",S,Su).on("mouseup.drag",_,Su),iP(T.view),tv(T),d=!1,c=T.clientX,h=T.clientY,$("start",T))}}function S(T){if(nc(T),!d){var M=T.clientX-c,$=T.clientY-h;d=M*M+$*$>g}r.mouse("drag",T)}function _(T){Bn(T.view).on("mousemove.drag mouseup.drag",null),nP(T.view,d),nc(T),r.mouse("end",T)}function w(T,M){if(t.call(this,T,M)){var $=T.changedTouches,R=e.call(this,T,M),V=$.length,H,ee;for(H=0;H<V;++H)(ee=k(this,R,T,M,$[H].identifier,$[H]))&&(tv(T),ee("start",T,$[H]))}}function x(T){var M=T.changedTouches,$=M.length,R,V;for(R=0;R<$;++R)(V=r[M[R].identifier])&&(nc(T),V("drag",T,M[R]))}function Q(T){var M=T.changedTouches,$=M.length,R,V;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),R=0;R<$;++R)(V=r[M[R].identifier])&&(tv(T),V("end",T,M[R]))}function k(T,M,$,R,V,H){var ee=s.copy(),I=pr(H||$,M),j,D,E;if((E=i.call(T,new xy("beforestart",{sourceEvent:$,target:m,identifier:V,active:a,x:I[0],y:I[1],dx:0,dy:0,dispatch:ee}),R))!=null)return j=E.x-I[0]||0,D=E.y-I[1]||0,function X(P,Z,L){var B=I,G;switch(P){case"start":r[V]=X,G=a++;break;case"end":delete r[V],--a;case"drag":I=pr(L||Z,M),G=a;break}ee.call(P,T,new xy(P,{sourceEvent:Z,subject:E,target:m,identifier:V,active:G,x:I[0]+j,y:I[1]+D,dx:I[0]-B[0],dy:I[1]-B[1],dispatch:ee}),R)}}return m.filter=function(T){return arguments.length?(t=typeof T=="function"?T:Nf(!!T),m):t},m.container=function(T){return arguments.length?(e=typeof T=="function"?T:Nf(T),m):e},m.subject=function(T){return arguments.length?(i=typeof T=="function"?T:Nf(T),m):i},m.touchable=function(T){return arguments.length?(n=typeof T=="function"?T:Nf(!!T),m):n},m.on=function(){var T=s.on.apply(s,arguments);return T===s?m:T},m.clickDistance=function(T){return arguments.length?(g=(T=+T)*T,m):Math.sqrt(g)},m}function w1(t,e,i){t.prototype=e.prototype=i,i.constructor=t}function sP(t,e){var i=Object.create(t.prototype);for(var n in e)i[n]=e[n];return i}function Ku(){}var bu=.7,rg=1/bu,rc="\\s*([+-]?\\d+)\\s*",_u="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Vr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ZB=/^#([0-9a-f]{3,8})$/,WB=new RegExp(`^rgb\\(${rc},${rc},${rc}\\)$`),qB=new RegExp(`^rgb\\(${Vr},${Vr},${Vr}\\)$`),VB=new RegExp(`^rgba\\(${rc},${rc},${rc},${_u}\\)$`),IB=new RegExp(`^rgba\\(${Vr},${Vr},${Vr},${_u}\\)$`),YB=new RegExp(`^hsl\\(${_u},${Vr},${Vr}\\)$`),HB=new RegExp(`^hsla\\(${_u},${Vr},${Vr},${_u}\\)$`),iC={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};w1(Ku,La,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:nC,formatHex:nC,formatHex8:UB,formatHsl:GB,formatRgb:rC,toString:rC});function nC(){return this.rgb().formatHex()}function UB(){return this.rgb().formatHex8()}function GB(){return oP(this).formatHsl()}function rC(){return this.rgb().formatRgb()}function La(t){var e,i;return t=(t+"").trim().toLowerCase(),(e=ZB.exec(t))?(i=e[1].length,e=parseInt(e[1],16),i===6?sC(e):i===3?new yn(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):i===8?Zf(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):i===4?Zf(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=WB.exec(t))?new yn(e[1],e[2],e[3],1):(e=qB.exec(t))?new yn(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=VB.exec(t))?Zf(e[1],e[2],e[3],e[4]):(e=IB.exec(t))?Zf(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=YB.exec(t))?lC(e[1],e[2]/100,e[3]/100,1):(e=HB.exec(t))?lC(e[1],e[2]/100,e[3]/100,e[4]):iC.hasOwnProperty(t)?sC(iC[t]):t==="transparent"?new yn(NaN,NaN,NaN,0):null}function sC(t){return new yn(t>>16&255,t>>8&255,t&255,1)}function Zf(t,e,i,n){return n<=0&&(t=e=i=NaN),new yn(t,e,i,n)}function FB(t){return t instanceof Ku||(t=La(t)),t?(t=t.rgb(),new yn(t.r,t.g,t.b,t.opacity)):new yn}function wy(t,e,i,n){return arguments.length===1?FB(t):new yn(t,e,i,n??1)}function yn(t,e,i,n){this.r=+t,this.g=+e,this.b=+i,this.opacity=+n}w1(yn,wy,sP(Ku,{brighter(t){return t=t==null?rg:Math.pow(rg,t),new yn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?bu:Math.pow(bu,t),new yn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new yn(Ma(this.r),Ma(this.g),Ma(this.b),sg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:oC,formatHex:oC,formatHex8:KB,formatRgb:aC,toString:aC}));function oC(){return`#${$a(this.r)}${$a(this.g)}${$a(this.b)}`}function KB(){return`#${$a(this.r)}${$a(this.g)}${$a(this.b)}${$a((isNaN(this.opacity)?1:this.opacity)*255)}`}function aC(){const t=sg(this.opacity);return`${t===1?"rgb(":"rgba("}${Ma(this.r)}, ${Ma(this.g)}, ${Ma(this.b)}${t===1?")":`, ${t})`}`}function sg(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ma(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function $a(t){return t=Ma(t),(t<16?"0":"")+t.toString(16)}function lC(t,e,i,n){return n<=0?t=e=i=NaN:i<=0||i>=1?t=e=NaN:e<=0&&(t=NaN),new gr(t,e,i,n)}function oP(t){if(t instanceof gr)return new gr(t.h,t.s,t.l,t.opacity);if(t instanceof Ku||(t=La(t)),!t)return new gr;if(t instanceof gr)return t;t=t.rgb();var e=t.r/255,i=t.g/255,n=t.b/255,r=Math.min(e,i,n),s=Math.max(e,i,n),a=NaN,c=s-r,h=(s+r)/2;return c?(e===s?a=(i-n)/c+(i<n)*6:i===s?a=(n-e)/c+2:a=(e-i)/c+4,c/=h<.5?s+r:2-s-r,a*=60):c=h>0&&h<1?0:a,new gr(a,c,h,t.opacity)}function JB(t,e,i,n){return arguments.length===1?oP(t):new gr(t,e,i,n??1)}function gr(t,e,i,n){this.h=+t,this.s=+e,this.l=+i,this.opacity=+n}w1(gr,JB,sP(Ku,{brighter(t){return t=t==null?rg:Math.pow(rg,t),new gr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?bu:Math.pow(bu,t),new gr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,n=i+(i<.5?i:1-i)*e,r=2*i-n;return new yn(iv(t>=240?t-240:t+120,r,n),iv(t,r,n),iv(t<120?t+240:t-120,r,n),this.opacity)},clamp(){return new gr(cC(this.h),Wf(this.s),Wf(this.l),sg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=sg(this.opacity);return`${t===1?"hsl(":"hsla("}${cC(this.h)}, ${Wf(this.s)*100}%, ${Wf(this.l)*100}%${t===1?")":`, ${t})`}`}}));function cC(t){return t=(t||0)%360,t<0?t+360:t}function Wf(t){return Math.max(0,Math.min(1,t||0))}function iv(t,e,i){return(t<60?e+(i-e)*t/60:t<180?i:t<240?e+(i-e)*(240-t)/60:e)*255}const k1=t=>()=>t;function e4(t,e){return function(i){return t+i*e}}function t4(t,e,i){return t=Math.pow(t,i),e=Math.pow(e,i)-t,i=1/i,function(n){return Math.pow(t+n*e,i)}}function i4(t){return(t=+t)==1?aP:function(e,i){return i-e?t4(e,i,t):k1(isNaN(e)?i:e)}}function aP(t,e){var i=e-t;return i?e4(t,i):k1(isNaN(t)?e:t)}const og=(function t(e){var i=i4(e);function n(r,s){var a=i((r=wy(r)).r,(s=wy(s)).r),c=i(r.g,s.g),h=i(r.b,s.b),d=aP(r.opacity,s.opacity);return function(f){return r.r=a(f),r.g=c(f),r.b=h(f),r.opacity=d(f),r+""}}return n.gamma=t,n})(1);function n4(t,e){e||(e=[]);var i=t?Math.min(e.length,t.length):0,n=e.slice(),r;return function(s){for(r=0;r<i;++r)n[r]=t[r]*(1-s)+e[r]*s;return n}}function r4(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function s4(t,e){var i=e?e.length:0,n=t?Math.min(i,t.length):0,r=new Array(n),s=new Array(i),a;for(a=0;a<n;++a)r[a]=cu(t[a],e[a]);for(;a<i;++a)s[a]=e[a];return function(c){for(a=0;a<n;++a)s[a]=r[a](c);return s}}function o4(t,e){var i=new Date;return t=+t,e=+e,function(n){return i.setTime(t*(1-n)+e*n),i}}function Dr(t,e){return t=+t,e=+e,function(i){return t*(1-i)+e*i}}function a4(t,e){var i={},n={},r;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in t?i[r]=cu(t[r],e[r]):n[r]=e[r];return function(s){for(r in i)n[r]=i[r](s);return n}}var ky=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,nv=new RegExp(ky.source,"g");function l4(t){return function(){return t}}function c4(t){return function(e){return t(e)+""}}function lP(t,e){var i=ky.lastIndex=nv.lastIndex=0,n,r,s,a=-1,c=[],h=[];for(t=t+"",e=e+"";(n=ky.exec(t))&&(r=nv.exec(e));)(s=r.index)>i&&(s=e.slice(i,s),c[a]?c[a]+=s:c[++a]=s),(n=n[0])===(r=r[0])?c[a]?c[a]+=r:c[++a]=r:(c[++a]=null,h.push({i:a,x:Dr(n,r)})),i=nv.lastIndex;return i<e.length&&(s=e.slice(i),c[a]?c[a]+=s:c[++a]=s),c.length<2?h[0]?c4(h[0].x):l4(e):(e=h.length,function(d){for(var f=0,g;f<e;++f)c[(g=h[f]).i]=g.x(d);return c.join("")})}function cu(t,e){var i=typeof e,n;return e==null||i==="boolean"?k1(e):(i==="number"?Dr:i==="string"?(n=La(e))?(e=n,og):lP:e instanceof La?og:e instanceof Date?o4:r4(e)?n4:Array.isArray(e)?s4:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?a4:Dr)(t,e)}var hC=180/Math.PI,Cy={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function cP(t,e,i,n,r,s){var a,c,h;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(h=t*i+e*n)&&(i-=t*h,n-=e*h),(c=Math.sqrt(i*i+n*n))&&(i/=c,n/=c,h/=c),t*n<e*i&&(t=-t,e=-e,h=-h,a=-a),{translateX:r,translateY:s,rotate:Math.atan2(e,t)*hC,skewX:Math.atan(h)*hC,scaleX:a,scaleY:c}}var qf;function h4(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Cy:cP(e.a,e.b,e.c,e.d,e.e,e.f)}function u4(t){return t==null||(qf||(qf=document.createElementNS("http://www.w3.org/2000/svg","g")),qf.setAttribute("transform",t),!(t=qf.transform.baseVal.consolidate()))?Cy:(t=t.matrix,cP(t.a,t.b,t.c,t.d,t.e,t.f))}function hP(t,e,i,n){function r(d){return d.length?d.pop()+" ":""}function s(d,f,g,m,O,S){if(d!==g||f!==m){var _=O.push("translate(",null,e,null,i);S.push({i:_-4,x:Dr(d,g)},{i:_-2,x:Dr(f,m)})}else(g||m)&&O.push("translate("+g+e+m+i)}function a(d,f,g,m){d!==f?(d-f>180?f+=360:f-d>180&&(d+=360),m.push({i:g.push(r(g)+"rotate(",null,n)-2,x:Dr(d,f)})):f&&g.push(r(g)+"rotate("+f+n)}function c(d,f,g,m){d!==f?m.push({i:g.push(r(g)+"skewX(",null,n)-2,x:Dr(d,f)}):f&&g.push(r(g)+"skewX("+f+n)}function h(d,f,g,m,O,S){if(d!==g||f!==m){var _=O.push(r(O)+"scale(",null,",",null,")");S.push({i:_-4,x:Dr(d,g)},{i:_-2,x:Dr(f,m)})}else(g!==1||m!==1)&&O.push(r(O)+"scale("+g+","+m+")")}return function(d,f){var g=[],m=[];return d=t(d),f=t(f),s(d.translateX,d.translateY,f.translateX,f.translateY,g,m),a(d.rotate,f.rotate,g,m),c(d.skewX,f.skewX,g,m),h(d.scaleX,d.scaleY,f.scaleX,f.scaleY,g,m),d=f=null,function(O){for(var S=-1,_=m.length,w;++S<_;)g[(w=m[S]).i]=w.x(O);return g.join("")}}}var d4=hP(h4,"px, ","px)","deg)"),f4=hP(u4,", ",")",")"),p4=1e-12;function uC(t){return((t=Math.exp(t))+1/t)/2}function g4(t){return((t=Math.exp(t))-1/t)/2}function m4(t){return((t=Math.exp(2*t))-1)/(t+1)}const Rp=(function t(e,i,n){function r(s,a){var c=s[0],h=s[1],d=s[2],f=a[0],g=a[1],m=a[2],O=f-c,S=g-h,_=O*O+S*S,w,x;if(_<p4)x=Math.log(m/d)/e,w=function(R){return[c+R*O,h+R*S,d*Math.exp(e*R*x)]};else{var Q=Math.sqrt(_),k=(m*m-d*d+n*_)/(2*d*i*Q),T=(m*m-d*d-n*_)/(2*m*i*Q),M=Math.log(Math.sqrt(k*k+1)-k),$=Math.log(Math.sqrt(T*T+1)-T);x=($-M)/e,w=function(R){var V=R*x,H=uC(M),ee=d/(i*Q)*(H*m4(e*V+M)-g4(M));return[c+ee*O,h+ee*S,d*H/uC(e*V+M)]}}return w.duration=x*1e3*e/Math.SQRT2,w}return r.rho=function(s){var a=Math.max(.001,+s),c=a*a,h=c*c;return t(a,c,h)},r})(Math.SQRT2,2,4);var gc=0,Jh=0,Mh=0,uP=1e3,ag,eu,lg=0,Xa=0,im=0,xu=typeof performance=="object"&&performance.now?performance:Date,dP=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function C1(){return Xa||(dP(O4),Xa=xu.now()+im)}function O4(){Xa=0}function cg(){this._call=this._time=this._next=null}cg.prototype=fP.prototype={constructor:cg,restart:function(t,e,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?C1():+i)+(e==null?0:+e),!this._next&&eu!==this&&(eu?eu._next=this:ag=this,eu=this),this._call=t,this._time=i,Ty()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ty())}};function fP(t,e,i){var n=new cg;return n.restart(t,e,i),n}function v4(){C1(),++gc;for(var t=ag,e;t;)(e=Xa-t._time)>=0&&t._call.call(void 0,e),t=t._next;--gc}function dC(){Xa=(lg=xu.now())+im,gc=Jh=0;try{v4()}finally{gc=0,S4(),Xa=0}}function y4(){var t=xu.now(),e=t-lg;e>uP&&(im-=e,lg=t)}function S4(){for(var t,e=ag,i,n=1/0;e;)e._call?(n>e._time&&(n=e._time),t=e,e=e._next):(i=e._next,e._next=null,e=t?t._next=i:ag=i);eu=t,Ty(n)}function Ty(t){if(!gc){Jh&&(Jh=clearTimeout(Jh));var e=t-Xa;e>24?(t<1/0&&(Jh=setTimeout(dC,t-xu.now()-im)),Mh&&(Mh=clearInterval(Mh))):(Mh||(lg=xu.now(),Mh=setInterval(y4,uP)),gc=1,dP(dC))}}function fC(t,e,i){var n=new cg;return e=e==null?0:+e,n.restart(r=>{n.stop(),t(r+e)},e,i),n}var b4=em("start","end","cancel","interrupt"),_4=[],pP=0,pC=1,Qy=2,Ap=3,gC=4,$y=5,Mp=6;function nm(t,e,i,n,r,s){var a=t.__transition;if(!a)t.__transition={};else if(i in a)return;x4(t,i,{name:e,index:n,group:r,on:b4,tween:_4,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:pP})}function T1(t,e){var i=br(t,e);if(i.state>pP)throw new Error("too late; already scheduled");return i}function Fr(t,e){var i=br(t,e);if(i.state>Ap)throw new Error("too late; already running");return i}function br(t,e){var i=t.__transition;if(!i||!(i=i[e]))throw new Error("transition not found");return i}function x4(t,e,i){var n=t.__transition,r;n[e]=i,i.timer=fP(s,0,i.time);function s(d){i.state=pC,i.timer.restart(a,i.delay,i.time),i.delay<=d&&a(d-i.delay)}function a(d){var f,g,m,O;if(i.state!==pC)return h();for(f in n)if(O=n[f],O.name===i.name){if(O.state===Ap)return fC(a);O.state===gC?(O.state=Mp,O.timer.stop(),O.on.call("interrupt",t,t.__data__,O.index,O.group),delete n[f]):+f<e&&(O.state=Mp,O.timer.stop(),O.on.call("cancel",t,t.__data__,O.index,O.group),delete n[f])}if(fC(function(){i.state===Ap&&(i.state=gC,i.timer.restart(c,i.delay,i.time),c(d))}),i.state=Qy,i.on.call("start",t,t.__data__,i.index,i.group),i.state===Qy){for(i.state=Ap,r=new Array(m=i.tween.length),f=0,g=-1;f<m;++f)(O=i.tween[f].value.call(t,t.__data__,i.index,i.group))&&(r[++g]=O);r.length=g+1}}function c(d){for(var f=d<i.duration?i.ease.call(null,d/i.duration):(i.timer.restart(h),i.state=$y,1),g=-1,m=r.length;++g<m;)r[g].call(t,f);i.state===$y&&(i.on.call("end",t,t.__data__,i.index,i.group),h())}function h(){i.state=Mp,i.timer.stop(),delete n[e];for(var d in n)return;delete t.__transition}}function zp(t,e){var i=t.__transition,n,r,s=!0,a;if(i){e=e==null?null:e+"";for(a in i){if((n=i[a]).name!==e){s=!1;continue}r=n.state>Qy&&n.state<$y,n.state=Mp,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete i[a]}s&&delete t.__transition}}function w4(t){return this.each(function(){zp(this,t)})}function k4(t,e){var i,n;return function(){var r=Fr(this,t),s=r.tween;if(s!==i){n=i=s;for(var a=0,c=n.length;a<c;++a)if(n[a].name===e){n=n.slice(),n.splice(a,1);break}}r.tween=n}}function C4(t,e,i){var n,r;if(typeof i!="function")throw new Error;return function(){var s=Fr(this,t),a=s.tween;if(a!==n){r=(n=a).slice();for(var c={name:e,value:i},h=0,d=r.length;h<d;++h)if(r[h].name===e){r[h]=c;break}h===d&&r.push(c)}s.tween=r}}function T4(t,e){var i=this._id;if(t+="",arguments.length<2){for(var n=br(this.node(),i).tween,r=0,s=n.length,a;r<s;++r)if((a=n[r]).name===t)return a.value;return null}return this.each((e==null?k4:C4)(i,t,e))}function Q1(t,e,i){var n=t._id;return t.each(function(){var r=Fr(this,n);(r.value||(r.value={}))[e]=i.apply(this,arguments)}),function(r){return br(r,n).value[e]}}function gP(t,e){var i;return(typeof e=="number"?Dr:e instanceof La?og:(i=La(e))?(e=i,og):lP)(t,e)}function Q4(t){return function(){this.removeAttribute(t)}}function $4(t){return function(){this.removeAttributeNS(t.space,t.local)}}function P4(t,e,i){var n,r=i+"",s;return function(){var a=this.getAttribute(t);return a===r?null:a===n?s:s=e(n=a,i)}}function E4(t,e,i){var n,r=i+"",s;return function(){var a=this.getAttributeNS(t.space,t.local);return a===r?null:a===n?s:s=e(n=a,i)}}function R4(t,e,i){var n,r,s;return function(){var a,c=i(this),h;return c==null?void this.removeAttribute(t):(a=this.getAttribute(t),h=c+"",a===h?null:a===n&&h===r?s:(r=h,s=e(n=a,c)))}}function A4(t,e,i){var n,r,s;return function(){var a,c=i(this),h;return c==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),h=c+"",a===h?null:a===n&&h===r?s:(r=h,s=e(n=a,c)))}}function M4(t,e){var i=tm(t),n=i==="transform"?f4:gP;return this.attrTween(t,typeof e=="function"?(i.local?A4:R4)(i,n,Q1(this,"attr."+t,e)):e==null?(i.local?$4:Q4)(i):(i.local?E4:P4)(i,n,e))}function z4(t,e){return function(i){this.setAttribute(t,e.call(this,i))}}function j4(t,e){return function(i){this.setAttributeNS(t.space,t.local,e.call(this,i))}}function D4(t,e){var i,n;function r(){var s=e.apply(this,arguments);return s!==n&&(i=(n=s)&&j4(t,s)),i}return r._value=e,r}function B4(t,e){var i,n;function r(){var s=e.apply(this,arguments);return s!==n&&(i=(n=s)&&z4(t,s)),i}return r._value=e,r}function L4(t,e){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(e==null)return this.tween(i,null);if(typeof e!="function")throw new Error;var n=tm(t);return this.tween(i,(n.local?D4:B4)(n,e))}function X4(t,e){return function(){T1(this,t).delay=+e.apply(this,arguments)}}function N4(t,e){return e=+e,function(){T1(this,t).delay=e}}function Z4(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?X4:N4)(e,t)):br(this.node(),e).delay}function W4(t,e){return function(){Fr(this,t).duration=+e.apply(this,arguments)}}function q4(t,e){return e=+e,function(){Fr(this,t).duration=e}}function V4(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?W4:q4)(e,t)):br(this.node(),e).duration}function I4(t,e){if(typeof e!="function")throw new Error;return function(){Fr(this,t).ease=e}}function Y4(t){var e=this._id;return arguments.length?this.each(I4(e,t)):br(this.node(),e).ease}function H4(t,e){return function(){var i=e.apply(this,arguments);if(typeof i!="function")throw new Error;Fr(this,t).ease=i}}function U4(t){if(typeof t!="function")throw new Error;return this.each(H4(this._id,t))}function G4(t){typeof t!="function"&&(t=I$(t));for(var e=this._groups,i=e.length,n=new Array(i),r=0;r<i;++r)for(var s=e[r],a=s.length,c=n[r]=[],h,d=0;d<a;++d)(h=s[d])&&t.call(h,h.__data__,d,s)&&c.push(h);return new As(n,this._parents,this._name,this._id)}function F4(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,i=t._groups,n=e.length,r=i.length,s=Math.min(n,r),a=new Array(n),c=0;c<s;++c)for(var h=e[c],d=i[c],f=h.length,g=a[c]=new Array(f),m,O=0;O<f;++O)(m=h[O]||d[O])&&(g[O]=m);for(;c<n;++c)a[c]=e[c];return new As(a,this._parents,this._name,this._id)}function K4(t){return(t+"").trim().split(/^|\s+/).every(function(e){var i=e.indexOf(".");return i>=0&&(e=e.slice(0,i)),!e||e==="start"})}function J4(t,e,i){var n,r,s=K4(e)?T1:Fr;return function(){var a=s(this,t),c=a.on;c!==n&&(r=(n=c).copy()).on(e,i),a.on=r}}function eL(t,e){var i=this._id;return arguments.length<2?br(this.node(),i).on.on(t):this.each(J4(i,t,e))}function tL(t){return function(){var e=this.parentNode;for(var i in this.__transition)if(+i!==t)return;e&&e.removeChild(this)}}function iL(){return this.on("end.remove",tL(this._id))}function nL(t){var e=this._name,i=this._id;typeof t!="function"&&(t=_1(t));for(var n=this._groups,r=n.length,s=new Array(r),a=0;a<r;++a)for(var c=n[a],h=c.length,d=s[a]=new Array(h),f,g,m=0;m<h;++m)(f=c[m])&&(g=t.call(f,f.__data__,m,c))&&("__data__"in f&&(g.__data__=f.__data__),d[m]=g,nm(d[m],e,i,m,d,br(f,i)));return new As(s,this._parents,e,i)}function rL(t){var e=this._name,i=this._id;typeof t!="function"&&(t=V$(t));for(var n=this._groups,r=n.length,s=[],a=[],c=0;c<r;++c)for(var h=n[c],d=h.length,f,g=0;g<d;++g)if(f=h[g]){for(var m=t.call(f,f.__data__,g,h),O,S=br(f,i),_=0,w=m.length;_<w;++_)(O=m[_])&&nm(O,e,i,_,m,S);s.push(m),a.push(f)}return new As(s,a,e,i)}var sL=Fu.prototype.constructor;function oL(){return new sL(this._groups,this._parents)}function aL(t,e){var i,n,r;return function(){var s=pc(this,t),a=(this.style.removeProperty(t),pc(this,t));return s===a?null:s===i&&a===n?r:r=e(i=s,n=a)}}function mP(t){return function(){this.style.removeProperty(t)}}function lL(t,e,i){var n,r=i+"",s;return function(){var a=pc(this,t);return a===r?null:a===n?s:s=e(n=a,i)}}function cL(t,e,i){var n,r,s;return function(){var a=pc(this,t),c=i(this),h=c+"";return c==null&&(h=c=(this.style.removeProperty(t),pc(this,t))),a===h?null:a===n&&h===r?s:(r=h,s=e(n=a,c))}}function hL(t,e){var i,n,r,s="style."+e,a="end."+s,c;return function(){var h=Fr(this,t),d=h.on,f=h.value[s]==null?c||(c=mP(e)):void 0;(d!==i||r!==f)&&(n=(i=d).copy()).on(a,r=f),h.on=n}}function uL(t,e,i){var n=(t+="")=="transform"?d4:gP;return e==null?this.styleTween(t,aL(t,n)).on("end.style."+t,mP(t)):typeof e=="function"?this.styleTween(t,cL(t,n,Q1(this,"style."+t,e))).each(hL(this._id,t)):this.styleTween(t,lL(t,n,e),i).on("end.style."+t,null)}function dL(t,e,i){return function(n){this.style.setProperty(t,e.call(this,n),i)}}function fL(t,e,i){var n,r;function s(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&dL(t,a,i)),n}return s._value=e,s}function pL(t,e,i){var n="style."+(t+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,fL(t,e,i??""))}function gL(t){return function(){this.textContent=t}}function mL(t){return function(){var e=t(this);this.textContent=e??""}}function OL(t){return this.tween("text",typeof t=="function"?mL(Q1(this,"text",t)):gL(t==null?"":t+""))}function vL(t){return function(e){this.textContent=t.call(this,e)}}function yL(t){var e,i;function n(){var r=t.apply(this,arguments);return r!==i&&(e=(i=r)&&vL(r)),e}return n._value=t,n}function SL(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,yL(t))}function bL(){for(var t=this._name,e=this._id,i=OP(),n=this._groups,r=n.length,s=0;s<r;++s)for(var a=n[s],c=a.length,h,d=0;d<c;++d)if(h=a[d]){var f=br(h,e);nm(h,t,i,d,a,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new As(n,this._parents,t,i)}function _L(){var t,e,i=this,n=i._id,r=i.size();return new Promise(function(s,a){var c={value:a},h={value:function(){--r===0&&s()}};i.each(function(){var d=Fr(this,n),f=d.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(c),e._.interrupt.push(c),e._.end.push(h)),d.on=e}),r===0&&s()})}var xL=0;function As(t,e,i,n){this._groups=t,this._parents=e,this._name=i,this._id=n}function OP(){return++xL}var ys=Fu.prototype;As.prototype={constructor:As,select:nL,selectAll:rL,selectChild:ys.selectChild,selectChildren:ys.selectChildren,filter:G4,merge:F4,selection:oL,transition:bL,call:ys.call,nodes:ys.nodes,node:ys.node,size:ys.size,empty:ys.empty,each:ys.each,on:eL,attr:M4,attrTween:L4,style:uL,styleTween:pL,text:OL,textTween:SL,remove:iL,tween:T4,delay:Z4,duration:V4,ease:Y4,easeVarying:U4,end:_L,[Symbol.iterator]:ys[Symbol.iterator]};function wL(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var kL={time:null,delay:0,duration:250,ease:wL};function CL(t,e){for(var i;!(i=t.__transition)||!(i=i[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return i}function TL(t){var e,i;t instanceof As?(e=t._id,t=t._name):(e=OP(),(i=kL).time=C1(),t=t==null?null:t+"");for(var n=this._groups,r=n.length,s=0;s<r;++s)for(var a=n[s],c=a.length,h,d=0;d<c;++d)(h=a[d])&&nm(h,t,e,d,a,i||CL(h,e));return new As(n,this._parents,t,e)}Fu.prototype.interrupt=w4;Fu.prototype.transition=TL;const Vf=t=>()=>t;function QL(t,{sourceEvent:e,target:i,transform:n,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:r}})}function $s(t,e,i){this.k=t,this.x=e,this.y=i}$s.prototype={constructor:$s,scale:function(t){return t===1?this:new $s(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new $s(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var rm=new $s(1,0,0);vP.prototype=$s.prototype;function vP(t){for(;!t.__zoom;)if(!(t=t.parentNode))return rm;return t.__zoom}function rv(t){t.stopImmediatePropagation()}function zh(t){t.preventDefault(),t.stopImmediatePropagation()}function $L(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function PL(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function mC(){return this.__zoom||rm}function EL(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function RL(){return navigator.maxTouchPoints||"ontouchstart"in this}function AL(t,e,i){var n=t.invertX(e[0][0])-i[0][0],r=t.invertX(e[1][0])-i[1][0],s=t.invertY(e[0][1])-i[0][1],a=t.invertY(e[1][1])-i[1][1];return t.translate(r>n?(n+r)/2:Math.min(0,n)||Math.max(0,r),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function yP(){var t=$L,e=PL,i=AL,n=EL,r=RL,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,h=Rp,d=em("start","zoom","end"),f,g,m,O=500,S=150,_=0,w=10;function x(E){E.property("__zoom",mC).on("wheel.zoom",V,{passive:!1}).on("mousedown.zoom",H).on("dblclick.zoom",ee).filter(r).on("touchstart.zoom",I).on("touchmove.zoom",j).on("touchend.zoom touchcancel.zoom",D).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}x.transform=function(E,X,P,Z){var L=E.selection?E.selection():E;L.property("__zoom",mC),E!==L?M(E,X,P,Z):L.interrupt().each(function(){$(this,arguments).event(Z).start().zoom(null,typeof X=="function"?X.apply(this,arguments):X).end()})},x.scaleBy=function(E,X,P,Z){x.scaleTo(E,function(){var L=this.__zoom.k,B=typeof X=="function"?X.apply(this,arguments):X;return L*B},P,Z)},x.scaleTo=function(E,X,P,Z){x.transform(E,function(){var L=e.apply(this,arguments),B=this.__zoom,G=P==null?T(L):typeof P=="function"?P.apply(this,arguments):P,z=B.invert(G),q=typeof X=="function"?X.apply(this,arguments):X;return i(k(Q(B,q),G,z),L,a)},P,Z)},x.translateBy=function(E,X,P,Z){x.transform(E,function(){return i(this.__zoom.translate(typeof X=="function"?X.apply(this,arguments):X,typeof P=="function"?P.apply(this,arguments):P),e.apply(this,arguments),a)},null,Z)},x.translateTo=function(E,X,P,Z,L){x.transform(E,function(){var B=e.apply(this,arguments),G=this.__zoom,z=Z==null?T(B):typeof Z=="function"?Z.apply(this,arguments):Z;return i(rm.translate(z[0],z[1]).scale(G.k).translate(typeof X=="function"?-X.apply(this,arguments):-X,typeof P=="function"?-P.apply(this,arguments):-P),B,a)},Z,L)};function Q(E,X){return X=Math.max(s[0],Math.min(s[1],X)),X===E.k?E:new $s(X,E.x,E.y)}function k(E,X,P){var Z=X[0]-P[0]*E.k,L=X[1]-P[1]*E.k;return Z===E.x&&L===E.y?E:new $s(E.k,Z,L)}function T(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function M(E,X,P,Z){E.on("start.zoom",function(){$(this,arguments).event(Z).start()}).on("interrupt.zoom end.zoom",function(){$(this,arguments).event(Z).end()}).tween("zoom",function(){var L=this,B=arguments,G=$(L,B).event(Z),z=e.apply(L,B),q=P==null?T(z):typeof P=="function"?P.apply(L,B):P,K=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),ie=L.__zoom,ce=typeof X=="function"?X.apply(L,B):X,de=h(ie.invert(q).concat(K/ie.k),ce.invert(q).concat(K/ce.k));return function(pe){if(pe===1)pe=ce;else{var fe=de(pe),ve=K/fe[2];pe=new $s(ve,q[0]-fe[0]*ve,q[1]-fe[1]*ve)}G.zoom(null,pe)}})}function $(E,X,P){return!P&&E.__zooming||new R(E,X)}function R(E,X){this.that=E,this.args=X,this.active=0,this.sourceEvent=null,this.extent=e.apply(E,X),this.taps=0}R.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,X){return this.mouse&&E!=="mouse"&&(this.mouse[1]=X.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=X.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=X.invert(this.touch1[0])),this.that.__zoom=X,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var X=Bn(this.that).datum();d.call(E,this.that,new QL(E,{sourceEvent:this.sourceEvent,target:x,transform:this.that.__zoom,dispatch:d}),X)}};function V(E,...X){if(!t.apply(this,arguments))return;var P=$(this,X).event(E),Z=this.__zoom,L=Math.max(s[0],Math.min(s[1],Z.k*Math.pow(2,n.apply(this,arguments)))),B=pr(E);if(P.wheel)(P.mouse[0][0]!==B[0]||P.mouse[0][1]!==B[1])&&(P.mouse[1]=Z.invert(P.mouse[0]=B)),clearTimeout(P.wheel);else{if(Z.k===L)return;P.mouse=[B,Z.invert(B)],zp(this),P.start()}zh(E),P.wheel=setTimeout(G,S),P.zoom("mouse",i(k(Q(Z,L),P.mouse[0],P.mouse[1]),P.extent,a));function G(){P.wheel=null,P.end()}}function H(E,...X){if(m||!t.apply(this,arguments))return;var P=E.currentTarget,Z=$(this,X,!0).event(E),L=Bn(E.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",K,!0),B=pr(E,P),G=E.clientX,z=E.clientY;iP(E.view),rv(E),Z.mouse=[B,this.__zoom.invert(B)],zp(this),Z.start();function q(ie){if(zh(ie),!Z.moved){var ce=ie.clientX-G,de=ie.clientY-z;Z.moved=ce*ce+de*de>_}Z.event(ie).zoom("mouse",i(k(Z.that.__zoom,Z.mouse[0]=pr(ie,P),Z.mouse[1]),Z.extent,a))}function K(ie){L.on("mousemove.zoom mouseup.zoom",null),nP(ie.view,Z.moved),zh(ie),Z.event(ie).end()}}function ee(E,...X){if(t.apply(this,arguments)){var P=this.__zoom,Z=pr(E.changedTouches?E.changedTouches[0]:E,this),L=P.invert(Z),B=P.k*(E.shiftKey?.5:2),G=i(k(Q(P,B),Z,L),e.apply(this,X),a);zh(E),c>0?Bn(this).transition().duration(c).call(M,G,Z,E):Bn(this).call(x.transform,G,Z,E)}}function I(E,...X){if(t.apply(this,arguments)){var P=E.touches,Z=P.length,L=$(this,X,E.changedTouches.length===Z).event(E),B,G,z,q;for(rv(E),G=0;G<Z;++G)z=P[G],q=pr(z,this),q=[q,this.__zoom.invert(q),z.identifier],L.touch0?!L.touch1&&L.touch0[2]!==q[2]&&(L.touch1=q,L.taps=0):(L.touch0=q,B=!0,L.taps=1+!!f);f&&(f=clearTimeout(f)),B&&(L.taps<2&&(g=q[0],f=setTimeout(function(){f=null},O)),zp(this),L.start())}}function j(E,...X){if(this.__zooming){var P=$(this,X).event(E),Z=E.changedTouches,L=Z.length,B,G,z,q;for(zh(E),B=0;B<L;++B)G=Z[B],z=pr(G,this),P.touch0&&P.touch0[2]===G.identifier?P.touch0[0]=z:P.touch1&&P.touch1[2]===G.identifier&&(P.touch1[0]=z);if(G=P.that.__zoom,P.touch1){var K=P.touch0[0],ie=P.touch0[1],ce=P.touch1[0],de=P.touch1[1],pe=(pe=ce[0]-K[0])*pe+(pe=ce[1]-K[1])*pe,fe=(fe=de[0]-ie[0])*fe+(fe=de[1]-ie[1])*fe;G=Q(G,Math.sqrt(pe/fe)),z=[(K[0]+ce[0])/2,(K[1]+ce[1])/2],q=[(ie[0]+de[0])/2,(ie[1]+de[1])/2]}else if(P.touch0)z=P.touch0[0],q=P.touch0[1];else return;P.zoom("touch",i(k(G,z,q),P.extent,a))}}function D(E,...X){if(this.__zooming){var P=$(this,X).event(E),Z=E.changedTouches,L=Z.length,B,G;for(rv(E),m&&clearTimeout(m),m=setTimeout(function(){m=null},O),B=0;B<L;++B)G=Z[B],P.touch0&&P.touch0[2]===G.identifier?delete P.touch0:P.touch1&&P.touch1[2]===G.identifier&&delete P.touch1;if(P.touch1&&!P.touch0&&(P.touch0=P.touch1,delete P.touch1),P.touch0)P.touch0[1]=this.__zoom.invert(P.touch0[0]);else if(P.end(),P.taps===2&&(G=pr(G,this),Math.hypot(g[0]-G[0],g[1]-G[1])<w)){var z=Bn(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return x.wheelDelta=function(E){return arguments.length?(n=typeof E=="function"?E:Vf(+E),x):n},x.filter=function(E){return arguments.length?(t=typeof E=="function"?E:Vf(!!E),x):t},x.touchable=function(E){return arguments.length?(r=typeof E=="function"?E:Vf(!!E),x):r},x.extent=function(E){return arguments.length?(e=typeof E=="function"?E:Vf([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),x):e},x.scaleExtent=function(E){return arguments.length?(s[0]=+E[0],s[1]=+E[1],x):[s[0],s[1]]},x.translateExtent=function(E){return arguments.length?(a[0][0]=+E[0][0],a[1][0]=+E[1][0],a[0][1]=+E[0][1],a[1][1]=+E[1][1],x):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},x.constrain=function(E){return arguments.length?(i=E,x):i},x.duration=function(E){return arguments.length?(c=+E,x):c},x.interpolate=function(E){return arguments.length?(h=E,x):h},x.on=function(){var E=d.on.apply(d,arguments);return E===d?x:E},x.clickDistance=function(E){return arguments.length?(_=(E=+E)*E,x):Math.sqrt(_)},x.tapDistance=function(E){return arguments.length?(w=+E,x):w},x}const Ur={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:i,targetHandle:n})=>`Couldn't create edge for ${t} handle id: "${t==="source"?i:n}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},wu=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],SP=["Enter"," ","Escape"],bP={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:i})=>`Moved selected node ${t}. New position, x: ${e}, y: ${i}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var mc;(function(t){t.Strict="strict",t.Loose="loose"})(mc||(mc={}));var za;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(za||(za={}));var ku;(function(t){t.Partial="partial",t.Full="full"})(ku||(ku={}));const _P={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Eo;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Eo||(Eo={}));var hg;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(hg||(hg={}));var Re;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Re||(Re={}));const OC={[Re.Left]:Re.Right,[Re.Right]:Re.Left,[Re.Top]:Re.Bottom,[Re.Bottom]:Re.Top};function xP(t){return t===null?null:t?"valid":"invalid"}const wP=t=>"id"in t&&"source"in t&&"target"in t,ML=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),$1=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Ju=(t,e=[0,0])=>{const{width:i,height:n}=Ds(t),r=t.origin??e,s=i*r[0],a=n*r[1];return{x:t.position.x-s,y:t.position.y-a}},zL=(t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const i=t.reduce((n,r)=>{const s=typeof r=="string";let a=!e.nodeLookup&&!s?r:void 0;e.nodeLookup&&(a=s?e.nodeLookup.get(r):$1(r)?r:e.nodeLookup.get(r.id));const c=a?ug(a,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return sm(n,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return om(i)},ed=(t,e={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},n=!1;return t.forEach(r=>{(e.filter===void 0||e.filter(r))&&(i=sm(i,ug(r)),n=!0)}),n?om(i):{x:0,y:0,width:0,height:0}},P1=(t,e,[i,n,r]=[0,0,1],s=!1,a=!1)=>{const c={...id(e,[i,n,r]),width:e.width/r,height:e.height/r},h=[];for(const d of t.values()){const{measured:f,selectable:g=!0,hidden:m=!1}=d;if(a&&!g||m)continue;const O=f.width??d.width??d.initialWidth??null,S=f.height??d.height??d.initialHeight??null,_=Cu(c,vc(d)),w=(O??0)*(S??0),x=s&&_>0;(!d.internals.handleBounds||x||_>=w||d.dragging)&&h.push(d)}return h},jL=(t,e)=>{const i=new Set;return t.forEach(n=>{i.add(n.id)}),e.filter(n=>i.has(n.source)||i.has(n.target))};function DL(t,e){const i=new Map,n=e!=null&&e.nodes?new Set(e.nodes.map(r=>r.id)):null;return t.forEach(r=>{r.measured.width&&r.measured.height&&((e==null?void 0:e.includeHiddenNodes)||!r.hidden)&&(!n||n.has(r.id))&&i.set(r.id,r)}),i}async function BL({nodes:t,width:e,height:i,panZoom:n,minZoom:r,maxZoom:s},a){if(t.size===0)return Promise.resolve(!0);const c=DL(t,a),h=ed(c),d=E1(h,e,i,(a==null?void 0:a.minZoom)??r,(a==null?void 0:a.maxZoom)??s,(a==null?void 0:a.padding)??.1);return await n.setViewport(d,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),Promise.resolve(!0)}function kP({nodeId:t,nextPosition:e,nodeLookup:i,nodeOrigin:n=[0,0],nodeExtent:r,onError:s}){const a=i.get(t),c=a.parentId?i.get(a.parentId):void 0,{x:h,y:d}=c?c.internals.positionAbsolute:{x:0,y:0},f=a.origin??n;let g=a.extent||r;if(a.extent==="parent"&&!a.expandParent)if(!c)s==null||s("005",Ur.error005());else{const O=c.measured.width,S=c.measured.height;O&&S&&(g=[[h,d],[h+O,d+S]])}else c&&yc(a.extent)&&(g=[[a.extent[0][0]+h,a.extent[0][1]+d],[a.extent[1][0]+h,a.extent[1][1]+d]]);const m=yc(g)?Na(e,g,a.measured):e;return(a.measured.width===void 0||a.measured.height===void 0)&&(s==null||s("015",Ur.error015())),{position:{x:m.x-h+(a.measured.width??0)*f[0],y:m.y-d+(a.measured.height??0)*f[1]},positionAbsolute:m}}async function LL({nodesToRemove:t=[],edgesToRemove:e=[],nodes:i,edges:n,onBeforeDelete:r}){const s=new Set(t.map(m=>m.id)),a=[];for(const m of i){if(m.deletable===!1)continue;const O=s.has(m.id),S=!O&&m.parentId&&a.find(_=>_.id===m.parentId);(O||S)&&a.push(m)}const c=new Set(e.map(m=>m.id)),h=n.filter(m=>m.deletable!==!1),f=jL(a,h);for(const m of h)c.has(m.id)&&!f.find(S=>S.id===m.id)&&f.push(m);if(!r)return{edges:f,nodes:a};const g=await r({nodes:a,edges:f});return typeof g=="boolean"?g?{edges:f,nodes:a}:{edges:[],nodes:[]}:g}const Oc=(t,e=0,i=1)=>Math.min(Math.max(t,e),i),Na=(t={x:0,y:0},e,i)=>({x:Oc(t.x,e[0][0],e[1][0]-((i==null?void 0:i.width)??0)),y:Oc(t.y,e[0][1],e[1][1]-((i==null?void 0:i.height)??0))});function CP(t,e,i){const{width:n,height:r}=Ds(i),{x:s,y:a}=i.internals.positionAbsolute;return Na(t,[[s,a],[s+n,a+r]],e)}const vC=(t,e,i)=>t<e?Oc(Math.abs(t-e),1,e)/e:t>i?-Oc(Math.abs(t-i),1,e)/e:0,TP=(t,e,i=15,n=40)=>{const r=vC(t.x,n,e.width-n)*i,s=vC(t.y,n,e.height-n)*i;return[r,s]},sm=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),Py=({x:t,y:e,width:i,height:n})=>({x:t,y:e,x2:t+i,y2:e+n}),om=({x:t,y:e,x2:i,y2:n})=>({x:t,y:e,width:i-t,height:n-e}),vc=(t,e=[0,0])=>{var r,s;const{x:i,y:n}=$1(t)?t.internals.positionAbsolute:Ju(t,e);return{x:i,y:n,width:((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0,height:((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0}},ug=(t,e=[0,0])=>{var r,s;const{x:i,y:n}=$1(t)?t.internals.positionAbsolute:Ju(t,e);return{x:i,y:n,x2:i+(((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0),y2:n+(((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0)}},QP=(t,e)=>om(sm(Py(t),Py(e))),Cu=(t,e)=>{const i=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),n=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(i*n)},yC=t=>Or(t.width)&&Or(t.height)&&Or(t.x)&&Or(t.y),Or=t=>!isNaN(t)&&isFinite(t),XL=(t,e)=>{},td=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),id=({x:t,y:e},[i,n,r],s=!1,a=[1,1])=>{const c={x:(t-i)/r,y:(e-n)/r};return s?td(c,a):c},dg=({x:t,y:e},[i,n,r])=>({x:t*r+i,y:e*r+n});function Nl(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(i)}if(typeof t=="string"&&t.endsWith("%")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(e*i*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function NL(t,e,i){if(typeof t=="string"||typeof t=="number"){const n=Nl(t,i),r=Nl(t,e);return{top:n,right:r,bottom:n,left:r,x:r*2,y:n*2}}if(typeof t=="object"){const n=Nl(t.top??t.y??0,i),r=Nl(t.bottom??t.y??0,i),s=Nl(t.left??t.x??0,e),a=Nl(t.right??t.x??0,e);return{top:n,right:a,bottom:r,left:s,x:s+a,y:n+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function ZL(t,e,i,n,r,s){const{x:a,y:c}=dg(t,[e,i,n]),{x:h,y:d}=dg({x:t.x+t.width,y:t.y+t.height},[e,i,n]),f=r-h,g=s-d;return{left:Math.floor(a),top:Math.floor(c),right:Math.floor(f),bottom:Math.floor(g)}}const E1=(t,e,i,n,r,s)=>{const a=NL(s,e,i),c=(e-a.x)/t.width,h=(i-a.y)/t.height,d=Math.min(c,h),f=Oc(d,n,r),g=t.x+t.width/2,m=t.y+t.height/2,O=e/2-g*f,S=i/2-m*f,_=ZL(t,O,S,f,e,i),w={left:Math.min(_.left-a.left,0),top:Math.min(_.top-a.top,0),right:Math.min(_.right-a.right,0),bottom:Math.min(_.bottom-a.bottom,0)};return{x:O-w.left+w.right,y:S-w.top+w.bottom,zoom:f}},Tu=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function yc(t){return t!=null&&t!=="parent"}function Ds(t){var e,i;return{width:((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth??0,height:((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight??0}}function $P(t){var e,i;return(((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth)!==void 0&&(((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight)!==void 0}function PP(t,e={width:0,height:0},i,n,r){const s={...t},a=n.get(i);if(a){const c=a.origin||r;s.x+=a.internals.positionAbsolute.x-(e.width??0)*c[0],s.y+=a.internals.positionAbsolute.y-(e.height??0)*c[1]}return s}function SC(t,e){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function WL(){let t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}}function qL(t){return{...bP,...t||{}}}function hu(t,{snapGrid:e=[0,0],snapToGrid:i=!1,transform:n,containerBounds:r}){const{x:s,y:a}=vr(t),c=id({x:s-((r==null?void 0:r.left)??0),y:a-((r==null?void 0:r.top)??0)},n),{x:h,y:d}=i?td(c,e):c;return{xSnapped:h,ySnapped:d,...c}}const R1=t=>({width:t.offsetWidth,height:t.offsetHeight}),EP=t=>{var e;return((e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},VL=["INPUT","SELECT","TEXTAREA"];function RP(t){var n,r;const e=((r=(n=t.composedPath)==null?void 0:n.call(t))==null?void 0:r[0])||t.target;return(e==null?void 0:e.nodeType)!==1?!1:VL.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const AP=t=>"clientX"in t,vr=(t,e)=>{var s,a;const i=AP(t),n=i?t.clientX:(s=t.touches)==null?void 0:s[0].clientX,r=i?t.clientY:(a=t.touches)==null?void 0:a[0].clientY;return{x:n-((e==null?void 0:e.left)??0),y:r-((e==null?void 0:e.top)??0)}},bC=(t,e,i,n,r)=>{const s=e.querySelectorAll(`.${t}`);return!s||!s.length?null:Array.from(s).map(a=>{const c=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:t,nodeId:r,position:a.getAttribute("data-handlepos"),x:(c.left-i.left)/n,y:(c.top-i.top)/n,...R1(a)}})};function MP({sourceX:t,sourceY:e,targetX:i,targetY:n,sourceControlX:r,sourceControlY:s,targetControlX:a,targetControlY:c}){const h=t*.125+r*.375+a*.375+i*.125,d=e*.125+s*.375+c*.375+n*.125,f=Math.abs(h-t),g=Math.abs(d-e);return[h,d,f,g]}function If(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function _C({pos:t,x1:e,y1:i,x2:n,y2:r,c:s}){switch(t){case Re.Left:return[e-If(e-n,s),i];case Re.Right:return[e+If(n-e,s),i];case Re.Top:return[e,i-If(i-r,s)];case Re.Bottom:return[e,i+If(r-i,s)]}}function zP({sourceX:t,sourceY:e,sourcePosition:i=Re.Bottom,targetX:n,targetY:r,targetPosition:s=Re.Top,curvature:a=.25}){const[c,h]=_C({pos:i,x1:t,y1:e,x2:n,y2:r,c:a}),[d,f]=_C({pos:s,x1:n,y1:r,x2:t,y2:e,c:a}),[g,m,O,S]=MP({sourceX:t,sourceY:e,targetX:n,targetY:r,sourceControlX:c,sourceControlY:h,targetControlX:d,targetControlY:f});return[`M${t},${e} C${c},${h} ${d},${f} ${n},${r}`,g,m,O,S]}function jP({sourceX:t,sourceY:e,targetX:i,targetY:n}){const r=Math.abs(i-t)/2,s=i<t?i+r:i-r,a=Math.abs(n-e)/2,c=n<e?n+a:n-a;return[s,c,r,a]}function IL({sourceNode:t,targetNode:e,selected:i=!1,zIndex:n=0,elevateOnSelect:r=!1,zIndexMode:s="basic"}){if(s==="manual")return n;const a=r&&i?n+1e3:n,c=Math.max(t.parentId||r&&t.selected?t.internals.z:0,e.parentId||r&&e.selected?e.internals.z:0);return a+c}function YL({sourceNode:t,targetNode:e,width:i,height:n,transform:r}){const s=sm(ug(t),ug(e));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const a={x:-r[0]/r[2],y:-r[1]/r[2],width:i/r[2],height:n/r[2]};return Cu(a,om(s))>0}const HL=({source:t,sourceHandle:e,target:i,targetHandle:n})=>`xy-edge__${t}${e||""}-${i}${n||""}`,UL=(t,e)=>e.some(i=>i.source===t.source&&i.target===t.target&&(i.sourceHandle===t.sourceHandle||!i.sourceHandle&&!t.sourceHandle)&&(i.targetHandle===t.targetHandle||!i.targetHandle&&!t.targetHandle)),GL=(t,e,i={})=>{if(!t.source||!t.target)return e;const n=i.getEdgeId||HL;let r;return wP(t)?r={...t}:r={...t,id:n(t)},UL(r,e)?e:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,e.concat(r))};function DP({sourceX:t,sourceY:e,targetX:i,targetY:n}){const[r,s,a,c]=jP({sourceX:t,sourceY:e,targetX:i,targetY:n});return[`M ${t},${e}L ${i},${n}`,r,s,a,c]}const xC={[Re.Left]:{x:-1,y:0},[Re.Right]:{x:1,y:0},[Re.Top]:{x:0,y:-1},[Re.Bottom]:{x:0,y:1}},FL=({source:t,sourcePosition:e=Re.Bottom,target:i})=>e===Re.Left||e===Re.Right?t.x<i.x?{x:1,y:0}:{x:-1,y:0}:t.y<i.y?{x:0,y:1}:{x:0,y:-1},wC=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function KL({source:t,sourcePosition:e=Re.Bottom,target:i,targetPosition:n=Re.Top,center:r,offset:s,stepPosition:a}){const c=xC[e],h=xC[n],d={x:t.x+c.x*s,y:t.y+c.y*s},f={x:i.x+h.x*s,y:i.y+h.y*s},g=FL({source:d,sourcePosition:e,target:f}),m=g.x!==0?"x":"y",O=g[m];let S=[],_,w;const x={x:0,y:0},Q={x:0,y:0},[,,k,T]=jP({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(c[m]*h[m]===-1){m==="x"?(_=r.x??d.x+(f.x-d.x)*a,w=r.y??(d.y+f.y)/2):(_=r.x??(d.x+f.x)/2,w=r.y??d.y+(f.y-d.y)*a);const V=[{x:_,y:d.y},{x:_,y:f.y}],H=[{x:d.x,y:w},{x:f.x,y:w}];c[m]===O?S=m==="x"?V:H:S=m==="x"?H:V}else{const V=[{x:d.x,y:f.y}],H=[{x:f.x,y:d.y}];if(m==="x"?S=c.x===O?H:V:S=c.y===O?V:H,e===n){const E=Math.abs(t[m]-i[m]);if(E<=s){const X=Math.min(s-1,s-E);c[m]===O?x[m]=(d[m]>t[m]?-1:1)*X:Q[m]=(f[m]>i[m]?-1:1)*X}}if(e!==n){const E=m==="x"?"y":"x",X=c[m]===h[E],P=d[E]>f[E],Z=d[E]<f[E];(c[m]===1&&(!X&&P||X&&Z)||c[m]!==1&&(!X&&Z||X&&P))&&(S=m==="x"?V:H)}const ee={x:d.x+x.x,y:d.y+x.y},I={x:f.x+Q.x,y:f.y+Q.y},j=Math.max(Math.abs(ee.x-S[0].x),Math.abs(I.x-S[0].x)),D=Math.max(Math.abs(ee.y-S[0].y),Math.abs(I.y-S[0].y));j>=D?(_=(ee.x+I.x)/2,w=S[0].y):(_=S[0].x,w=(ee.y+I.y)/2)}const M={x:d.x+x.x,y:d.y+x.y},$={x:f.x+Q.x,y:f.y+Q.y};return[[t,...M.x!==S[0].x||M.y!==S[0].y?[M]:[],...S,...$.x!==S[S.length-1].x||$.y!==S[S.length-1].y?[$]:[],i],_,w,k,T]}function JL(t,e,i,n){const r=Math.min(wC(t,e)/2,wC(e,i)/2,n),{x:s,y:a}=e;if(t.x===s&&s===i.x||t.y===a&&a===i.y)return`L${s} ${a}`;if(t.y===a){const d=t.x<i.x?-1:1,f=t.y<i.y?1:-1;return`L ${s+r*d},${a}Q ${s},${a} ${s},${a+r*f}`}const c=t.x<i.x?1:-1,h=t.y<i.y?-1:1;return`L ${s},${a+r*h}Q ${s},${a} ${s+r*c},${a}`}function Ey({sourceX:t,sourceY:e,sourcePosition:i=Re.Bottom,targetX:n,targetY:r,targetPosition:s=Re.Top,borderRadius:a=5,centerX:c,centerY:h,offset:d=20,stepPosition:f=.5}){const[g,m,O,S,_]=KL({source:{x:t,y:e},sourcePosition:i,target:{x:n,y:r},targetPosition:s,center:{x:c,y:h},offset:d,stepPosition:f});let w=`M${g[0].x} ${g[0].y}`;for(let x=1;x<g.length-1;x++)w+=JL(g[x-1],g[x],g[x+1],a);return w+=`L${g[g.length-1].x} ${g[g.length-1].y}`,[w,m,O,S,_]}function kC(t){var e;return t&&!!(t.internals.handleBounds||(e=t.handles)!=null&&e.length)&&!!(t.measured.width||t.width||t.initialWidth)}function e6(t){var g;const{sourceNode:e,targetNode:i}=t;if(!kC(e)||!kC(i))return null;const n=e.internals.handleBounds||CC(e.handles),r=i.internals.handleBounds||CC(i.handles),s=TC((n==null?void 0:n.source)??[],t.sourceHandle),a=TC(t.connectionMode===mc.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),t.targetHandle);if(!s||!a)return(g=t.onError)==null||g.call(t,"008",Ur.error008(s?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const c=(s==null?void 0:s.position)||Re.Bottom,h=(a==null?void 0:a.position)||Re.Top,d=Za(e,s,c),f=Za(i,a,h);return{sourceX:d.x,sourceY:d.y,targetX:f.x,targetY:f.y,sourcePosition:c,targetPosition:h}}function CC(t){if(!t)return null;const e=[],i=[];for(const n of t)n.width=n.width??1,n.height=n.height??1,n.type==="source"?e.push(n):n.type==="target"&&i.push(n);return{source:e,target:i}}function Za(t,e,i=Re.Left,n=!1){const r=((e==null?void 0:e.x)??0)+t.internals.positionAbsolute.x,s=((e==null?void 0:e.y)??0)+t.internals.positionAbsolute.y,{width:a,height:c}=e??Ds(t);if(n)return{x:r+a/2,y:s+c/2};switch((e==null?void 0:e.position)??i){case Re.Top:return{x:r+a/2,y:s};case Re.Right:return{x:r+a,y:s+c/2};case Re.Bottom:return{x:r+a/2,y:s+c};case Re.Left:return{x:r,y:s+c/2}}}function TC(t,e){return t&&(e?t.find(i=>i.id===e):t[0])||null}function Ry(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(n=>`${n}=${t[n]}`).join("&")}`:""}function t6(t,{id:e,defaultColor:i,defaultMarkerStart:n,defaultMarkerEnd:r}){const s=new Set;return t.reduce((a,c)=>([c.markerStart||n,c.markerEnd||r].forEach(h=>{if(h&&typeof h=="object"){const d=Ry(h,e);s.has(d)||(a.push({id:d,color:h.color||i,...h}),s.add(d))}}),a),[]).sort((a,c)=>a.id.localeCompare(c.id))}const BP=1e3,i6=10,A1={nodeOrigin:[0,0],nodeExtent:wu,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},n6={...A1,checkEquality:!0};function M1(t,e){const i={...t};for(const n in e)e[n]!==void 0&&(i[n]=e[n]);return i}function r6(t,e,i){const n=M1(A1,i);for(const r of t.values())if(r.parentId)j1(r,t,e,n);else{const s=Ju(r,n.nodeOrigin),a=yc(r.extent)?r.extent:n.nodeExtent,c=Na(s,a,Ds(r));r.internals.positionAbsolute=c}}function s6(t,e){if(!t.handles)return t.measured?e==null?void 0:e.internals.handleBounds:void 0;const i=[],n=[];for(const r of t.handles){const s={id:r.id,width:r.width??1,height:r.height??1,nodeId:t.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?i.push(s):r.type==="target"&&n.push(s)}return{source:i,target:n}}function z1(t){return t==="manual"}function Ay(t,e,i,n={}){var f,g;const r=M1(n6,n),s={i:0},a=new Map(e),c=r!=null&&r.elevateNodesOnSelect&&!z1(r.zIndexMode)?BP:0;let h=t.length>0,d=!1;e.clear(),i.clear();for(const m of t){let O=a.get(m.id);if(r.checkEquality&&m===(O==null?void 0:O.internals.userNode))e.set(m.id,O);else{const S=Ju(m,r.nodeOrigin),_=yc(m.extent)?m.extent:r.nodeExtent,w=Na(S,_,Ds(m));O={...r.defaults,...m,measured:{width:(f=m.measured)==null?void 0:f.width,height:(g=m.measured)==null?void 0:g.height},internals:{positionAbsolute:w,handleBounds:s6(m,O),z:LP(m,c,r.zIndexMode),userNode:m}},e.set(m.id,O)}(O.measured===void 0||O.measured.width===void 0||O.measured.height===void 0)&&!O.hidden&&(h=!1),m.parentId&&j1(O,e,i,n,s),d||(d=m.selected??!1)}return{nodesInitialized:h,hasSelectedNodes:d}}function o6(t,e){if(!t.parentId)return;const i=e.get(t.parentId);i?i.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function j1(t,e,i,n,r){const{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:c,zIndexMode:h}=M1(A1,n),d=t.parentId,f=e.get(d);if(!f){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}o6(t,i),r&&!f.parentId&&f.internals.rootParentIndex===void 0&&h==="auto"&&(f.internals.rootParentIndex=++r.i,f.internals.z=f.internals.z+r.i*i6),r&&f.internals.rootParentIndex!==void 0&&(r.i=f.internals.rootParentIndex);const g=s&&!z1(h)?BP:0,{x:m,y:O,z:S}=a6(t,f,a,c,g,h),{positionAbsolute:_}=t.internals,w=m!==_.x||O!==_.y;(w||S!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:w?{x:m,y:O}:_,z:S}})}function LP(t,e,i){const n=Or(t.zIndex)?t.zIndex:0;return z1(i)?n:n+(t.selected?e:0)}function a6(t,e,i,n,r,s){const{x:a,y:c}=e.internals.positionAbsolute,h=Ds(t),d=Ju(t,i),f=yc(t.extent)?Na(d,t.extent,h):d;let g=Na({x:a+f.x,y:c+f.y},n,h);t.extent==="parent"&&(g=CP(g,h,e));const m=LP(t,r,s),O=e.internals.z??0;return{x:g.x,y:g.y,z:O>=m?O+1:m}}function D1(t,e,i,n=[0,0]){var a;const r=[],s=new Map;for(const c of t){const h=e.get(c.parentId);if(!h)continue;const d=((a=s.get(c.parentId))==null?void 0:a.expandedRect)??vc(h),f=QP(d,c.rect);s.set(c.parentId,{expandedRect:f,parent:h})}return s.size>0&&s.forEach(({expandedRect:c,parent:h},d)=>{var k;const f=h.internals.positionAbsolute,g=Ds(h),m=h.origin??n,O=c.x<f.x?Math.round(Math.abs(f.x-c.x)):0,S=c.y<f.y?Math.round(Math.abs(f.y-c.y)):0,_=Math.max(g.width,Math.round(c.width)),w=Math.max(g.height,Math.round(c.height)),x=(_-g.width)*m[0],Q=(w-g.height)*m[1];(O>0||S>0||x||Q)&&(r.push({id:d,type:"position",position:{x:h.position.x-O+x,y:h.position.y-S+Q}}),(k=i.get(d))==null||k.forEach(T=>{t.some(M=>M.id===T.id)||r.push({id:T.id,type:"position",position:{x:T.position.x+O,y:T.position.y+S}})})),(g.width<c.width||g.height<c.height||O||S)&&r.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:_+(O?m[0]*O-x:0),height:w+(S?m[1]*S-Q:0)}})}),r}function l6(t,e,i,n,r,s,a){const c=n==null?void 0:n.querySelector(".xyflow__viewport");let h=!1;if(!c)return{changes:[],updatedInternals:h};const d=[],f=window.getComputedStyle(c),{m22:g}=new window.DOMMatrixReadOnly(f.transform),m=[];for(const O of t.values()){const S=e.get(O.id);if(!S)continue;if(S.hidden){e.set(S.id,{...S,internals:{...S.internals,handleBounds:void 0}}),h=!0;continue}const _=R1(O.nodeElement),w=S.measured.width!==_.width||S.measured.height!==_.height;if(!!(_.width&&_.height&&(w||!S.internals.handleBounds||O.force))){const Q=O.nodeElement.getBoundingClientRect(),k=yc(S.extent)?S.extent:s;let{positionAbsolute:T}=S.internals;S.parentId&&S.extent==="parent"?T=CP(T,_,e.get(S.parentId)):k&&(T=Na(T,k,_));const M={...S,measured:_,internals:{...S.internals,positionAbsolute:T,handleBounds:{source:bC("source",O.nodeElement,Q,g,S.id),target:bC("target",O.nodeElement,Q,g,S.id)}}};e.set(S.id,M),S.parentId&&j1(M,e,i,{nodeOrigin:r,zIndexMode:a}),h=!0,w&&(d.push({id:S.id,type:"dimensions",dimensions:_}),S.expandParent&&S.parentId&&m.push({id:S.id,parentId:S.parentId,rect:vc(M,r)}))}}if(m.length>0){const O=D1(m,e,i,r);d.push(...O)}return{changes:d,updatedInternals:h}}async function c6({delta:t,panZoom:e,transform:i,translateExtent:n,width:r,height:s}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const a=await e.setViewportConstrained({x:i[0]+t.x,y:i[1]+t.y,zoom:i[2]},[[0,0],[r,s]],n),c=!!a&&(a.x!==i[0]||a.y!==i[1]||a.k!==i[2]);return Promise.resolve(c)}function QC(t,e,i,n,r,s){let a=r;const c=n.get(a)||new Map;n.set(a,c.set(i,e)),a=`${r}-${t}`;const h=n.get(a)||new Map;if(n.set(a,h.set(i,e)),s){a=`${r}-${t}-${s}`;const d=n.get(a)||new Map;n.set(a,d.set(i,e))}}function XP(t,e,i){t.clear(),e.clear();for(const n of i){const{source:r,target:s,sourceHandle:a=null,targetHandle:c=null}=n,h={edgeId:n.id,source:r,target:s,sourceHandle:a,targetHandle:c},d=`${r}-${a}--${s}-${c}`,f=`${s}-${c}--${r}-${a}`;QC("source",h,f,t,r,a),QC("target",h,d,t,s,c),e.set(n.id,n)}}function NP(t,e){if(!t.parentId)return!1;const i=e.get(t.parentId);return i?i.selected?!0:NP(i,e):!1}function $C(t,e,i){var r;let n=t;do{if((r=n==null?void 0:n.matches)!=null&&r.call(n,e))return!0;if(n===i)return!1;n=n==null?void 0:n.parentElement}while(n);return!1}function h6(t,e,i,n){const r=new Map;for(const[s,a]of t)if((a.selected||a.id===n)&&(!a.parentId||!NP(a,t))&&(a.draggable||e&&typeof a.draggable>"u")){const c=t.get(s);c&&r.set(s,{id:s,position:c.position||{x:0,y:0},distance:{x:i.x-c.internals.positionAbsolute.x,y:i.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return r}function sv({nodeId:t,dragItems:e,nodeLookup:i,dragging:n=!0}){var a,c,h;const r=[];for(const[d,f]of e){const g=(a=i.get(d))==null?void 0:a.internals.userNode;g&&r.push({...g,position:f.position,dragging:n})}if(!t)return[r[0],r];const s=(c=i.get(t))==null?void 0:c.internals.userNode;return[s?{...s,position:((h=e.get(t))==null?void 0:h.position)||s.position,dragging:n}:r[0],r]}function u6({dragItems:t,snapGrid:e,x:i,y:n}){const r=t.values().next().value;if(!r)return null;const s={x:i-r.distance.x,y:n-r.distance.y},a=td(s,e);return{x:a.x-s.x,y:a.y-s.y}}function d6({onNodeMouseDown:t,getStoreItems:e,onDragStart:i,onDrag:n,onDragStop:r}){let s={x:null,y:null},a=0,c=new Map,h=!1,d={x:0,y:0},f=null,g=!1,m=null,O=!1,S=!1,_=null;function w({noDragClassName:Q,handleSelector:k,domNode:T,isSelectable:M,nodeId:$,nodeClickDistance:R=0}){m=Bn(T);function V({x:j,y:D}){const{nodeLookup:E,nodeExtent:X,snapGrid:P,snapToGrid:Z,nodeOrigin:L,onNodeDrag:B,onSelectionDrag:G,onError:z,updateNodePositions:q}=e();s={x:j,y:D};let K=!1;const ie=c.size>1,ce=ie&&X?Py(ed(c)):null,de=ie&&Z?u6({dragItems:c,snapGrid:P,x:j,y:D}):null;for(const[pe,fe]of c){if(!E.has(pe))continue;let ve={x:j-fe.distance.x,y:D-fe.distance.y};Z&&(ve=de?{x:Math.round(ve.x+de.x),y:Math.round(ve.y+de.y)}:td(ve,P));let De=null;if(ie&&X&&!fe.extent&&ce){const{positionAbsolute:me}=fe.internals,Be=me.x-ce.x+X[0][0],lt=me.x+fe.measured.width-ce.x2+X[1][0],He=me.y-ce.y+X[0][1],Ft=me.y+fe.measured.height-ce.y2+X[1][1];De=[[Be,He],[lt,Ft]]}const{position:Ee,positionAbsolute:ke}=kP({nodeId:pe,nextPosition:ve,nodeLookup:E,nodeExtent:De||X,nodeOrigin:L,onError:z});K=K||fe.position.x!==Ee.x||fe.position.y!==Ee.y,fe.position=Ee,fe.internals.positionAbsolute=ke}if(S=S||K,!!K&&(q(c,!0),_&&(n||B||!$&&G))){const[pe,fe]=sv({nodeId:$,dragItems:c,nodeLookup:E});n==null||n(_,c,pe,fe),B==null||B(_,pe,fe),$||G==null||G(_,fe)}}async function H(){if(!f)return;const{transform:j,panBy:D,autoPanSpeed:E,autoPanOnNodeDrag:X}=e();if(!X){h=!1,cancelAnimationFrame(a);return}const[P,Z]=TP(d,f,E);(P!==0||Z!==0)&&(s.x=(s.x??0)-P/j[2],s.y=(s.y??0)-Z/j[2],await D({x:P,y:Z})&&V(s)),a=requestAnimationFrame(H)}function ee(j){var ie;const{nodeLookup:D,multiSelectionActive:E,nodesDraggable:X,transform:P,snapGrid:Z,snapToGrid:L,selectNodesOnDrag:B,onNodeDragStart:G,onSelectionDragStart:z,unselectNodesAndEdges:q}=e();g=!0,(!B||!M)&&!E&&$&&((ie=D.get($))!=null&&ie.selected||q()),M&&B&&$&&(t==null||t($));const K=hu(j.sourceEvent,{transform:P,snapGrid:Z,snapToGrid:L,containerBounds:f});if(s=K,c=h6(D,X,K,$),c.size>0&&(i||G||!$&&z)){const[ce,de]=sv({nodeId:$,dragItems:c,nodeLookup:D});i==null||i(j.sourceEvent,c,ce,de),G==null||G(j.sourceEvent,ce,de),$||z==null||z(j.sourceEvent,de)}}const I=rP().clickDistance(R).on("start",j=>{const{domNode:D,nodeDragThreshold:E,transform:X,snapGrid:P,snapToGrid:Z}=e();f=(D==null?void 0:D.getBoundingClientRect())||null,O=!1,S=!1,_=j.sourceEvent,E===0&&ee(j),s=hu(j.sourceEvent,{transform:X,snapGrid:P,snapToGrid:Z,containerBounds:f}),d=vr(j.sourceEvent,f)}).on("drag",j=>{const{autoPanOnNodeDrag:D,transform:E,snapGrid:X,snapToGrid:P,nodeDragThreshold:Z,nodeLookup:L}=e(),B=hu(j.sourceEvent,{transform:E,snapGrid:X,snapToGrid:P,containerBounds:f});if(_=j.sourceEvent,(j.sourceEvent.type==="touchmove"&&j.sourceEvent.touches.length>1||$&&!L.has($))&&(O=!0),!O){if(!h&&D&&g&&(h=!0,H()),!g){const G=vr(j.sourceEvent,f),z=G.x-d.x,q=G.y-d.y;Math.sqrt(z*z+q*q)>Z&&ee(j)}(s.x!==B.xSnapped||s.y!==B.ySnapped)&&c&&g&&(d=vr(j.sourceEvent,f),V(B))}}).on("end",j=>{if(!(!g||O)&&(h=!1,g=!1,cancelAnimationFrame(a),c.size>0)){const{nodeLookup:D,updateNodePositions:E,onNodeDragStop:X,onSelectionDragStop:P}=e();if(S&&(E(c,!1),S=!1),r||X||!$&&P){const[Z,L]=sv({nodeId:$,dragItems:c,nodeLookup:D,dragging:!1});r==null||r(j.sourceEvent,c,Z,L),X==null||X(j.sourceEvent,Z,L),$||P==null||P(j.sourceEvent,L)}}}).filter(j=>{const D=j.target;return!j.button&&(!Q||!$C(D,`.${Q}`,T))&&(!k||$C(D,k,T))});m.call(I)}function x(){m==null||m.on(".drag",null)}return{update:w,destroy:x}}function f6(t,e,i){const n=[],r={x:t.x-i,y:t.y-i,width:i*2,height:i*2};for(const s of e.values())Cu(r,vc(s))>0&&n.push(s);return n}const p6=250;function g6(t,e,i,n){var c,h;let r=[],s=1/0;const a=f6(t,i,e+p6);for(const d of a){const f=[...((c=d.internals.handleBounds)==null?void 0:c.source)??[],...((h=d.internals.handleBounds)==null?void 0:h.target)??[]];for(const g of f){if(n.nodeId===g.nodeId&&n.type===g.type&&n.id===g.id)continue;const{x:m,y:O}=Za(d,g,g.position,!0),S=Math.sqrt(Math.pow(m-t.x,2)+Math.pow(O-t.y,2));S>e||(S<s?(r=[{...g,x:m,y:O}],s=S):S===s&&r.push({...g,x:m,y:O}))}}if(!r.length)return null;if(r.length>1){const d=n.type==="source"?"target":"source";return r.find(f=>f.type===d)??r[0]}return r[0]}function ZP(t,e,i,n,r,s=!1){var d,f,g;const a=n.get(t);if(!a)return null;const c=r==="strict"?(d=a.internals.handleBounds)==null?void 0:d[e]:[...((f=a.internals.handleBounds)==null?void 0:f.source)??[],...((g=a.internals.handleBounds)==null?void 0:g.target)??[]],h=(i?c==null?void 0:c.find(m=>m.id===i):c==null?void 0:c[0])??null;return h&&s?{...h,...Za(a,h,h.position,!0)}:h}function WP(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function m6(t,e){let i=null;return e?i=!0:t&&!e&&(i=!1),i}const qP=()=>!0;function O6(t,{connectionMode:e,connectionRadius:i,handleId:n,nodeId:r,edgeUpdaterType:s,isTarget:a,domNode:c,nodeLookup:h,lib:d,autoPanOnConnect:f,flowId:g,panBy:m,cancelConnection:O,onConnectStart:S,onConnect:_,onConnectEnd:w,isValidConnection:x=qP,onReconnectEnd:Q,updateConnection:k,getTransform:T,getFromHandle:M,autoPanSpeed:$,dragThreshold:R=1,handleDomNode:V}){const H=EP(t.target);let ee=0,I;const{x:j,y:D}=vr(t),E=WP(s,V),X=c==null?void 0:c.getBoundingClientRect();let P=!1;if(!X||!E)return;const Z=ZP(r,E,n,h,e);if(!Z)return;let L=vr(t,X),B=!1,G=null,z=!1,q=null;function K(){if(!f||!X)return;const[Ee,ke]=TP(L,X,$);m({x:Ee,y:ke}),ee=requestAnimationFrame(K)}const ie={...Z,nodeId:r,type:E,position:Z.position},ce=h.get(r);let pe={inProgress:!0,isValid:null,from:Za(ce,ie,Re.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:ce,to:L,toHandle:null,toPosition:OC[ie.position],toNode:null,pointer:L};function fe(){P=!0,k(pe),S==null||S(t,{nodeId:r,handleId:n,handleType:E})}R===0&&fe();function ve(Ee){if(!P){const{x:Ft,y:rn}=vr(Ee),qi=Ft-j,_n=rn-D;if(!(qi*qi+_n*_n>R*R))return;fe()}if(!M()||!ie){De(Ee);return}const ke=T();L=vr(Ee,X),I=g6(id(L,ke,!1,[1,1]),i,h,ie),B||(K(),B=!0);const me=VP(Ee,{handle:I,connectionMode:e,fromNodeId:r,fromHandleId:n,fromType:a?"target":"source",isValidConnection:x,doc:H,lib:d,flowId:g,nodeLookup:h});q=me.handleDomNode,G=me.connection,z=m6(!!I,me.isValid);const Be=h.get(r),lt=Be?Za(Be,ie,Re.Left,!0):pe.from,He={...pe,from:lt,isValid:z,to:me.toHandle&&z?dg({x:me.toHandle.x,y:me.toHandle.y},ke):L,toHandle:me.toHandle,toPosition:z&&me.toHandle?me.toHandle.position:OC[ie.position],toNode:me.toHandle?h.get(me.toHandle.nodeId):null,pointer:L};k(He),pe=He}function De(Ee){if(!("touches"in Ee&&Ee.touches.length>0)){if(P){(I||q)&&G&&z&&(_==null||_(G));const{inProgress:ke,...me}=pe,Be={...me,toPosition:pe.toHandle?pe.toPosition:null};w==null||w(Ee,Be),s&&(Q==null||Q(Ee,Be))}O(),cancelAnimationFrame(ee),B=!1,z=!1,G=null,q=null,H.removeEventListener("mousemove",ve),H.removeEventListener("mouseup",De),H.removeEventListener("touchmove",ve),H.removeEventListener("touchend",De)}}H.addEventListener("mousemove",ve),H.addEventListener("mouseup",De),H.addEventListener("touchmove",ve),H.addEventListener("touchend",De)}function VP(t,{handle:e,connectionMode:i,fromNodeId:n,fromHandleId:r,fromType:s,doc:a,lib:c,flowId:h,isValidConnection:d=qP,nodeLookup:f}){const g=s==="target",m=e?a.querySelector(`.${c}-flow__handle[data-id="${h}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:O,y:S}=vr(t),_=a.elementFromPoint(O,S),w=_!=null&&_.classList.contains(`${c}-flow__handle`)?_:m,x={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const Q=WP(void 0,w),k=w.getAttribute("data-nodeid"),T=w.getAttribute("data-handleid"),M=w.classList.contains("connectable"),$=w.classList.contains("connectableend");if(!k||!Q)return x;const R={source:g?k:n,sourceHandle:g?T:r,target:g?n:k,targetHandle:g?r:T};x.connection=R;const H=M&&$&&(i===mc.Strict?g&&Q==="source"||!g&&Q==="target":k!==n||T!==r);x.isValid=H&&d(R),x.toHandle=ZP(k,Q,T,f,i,!0)}return x}const My={onPointerDown:O6,isValid:VP};function v6({domNode:t,panZoom:e,getTransform:i,getViewScale:n}){const r=Bn(t);function s({translateExtent:c,width:h,height:d,zoomStep:f=1,pannable:g=!0,zoomable:m=!0,inversePan:O=!1}){const S=k=>{if(k.sourceEvent.type!=="wheel"||!e)return;const T=i(),M=k.sourceEvent.ctrlKey&&Tu()?10:1,$=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*f,R=T[2]*Math.pow(2,$*M);e.scaleTo(R)};let _=[0,0];const w=k=>{(k.sourceEvent.type==="mousedown"||k.sourceEvent.type==="touchstart")&&(_=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY])},x=k=>{const T=i();if(k.sourceEvent.type!=="mousemove"&&k.sourceEvent.type!=="touchmove"||!e)return;const M=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],$=[M[0]-_[0],M[1]-_[1]];_=M;const R=n()*Math.max(T[2],Math.log(T[2]))*(O?-1:1),V={x:T[0]-$[0]*R,y:T[1]-$[1]*R},H=[[0,0],[h,d]];e.setViewportConstrained({x:V.x,y:V.y,zoom:T[2]},H,c)},Q=yP().on("start",w).on("zoom",g?x:null).on("zoom.wheel",m?S:null);r.call(Q,{})}function a(){r.on("zoom",null)}return{update:s,destroy:a,pointer:pr}}const am=t=>({x:t.x,y:t.y,zoom:t.k}),ov=({x:t,y:e,zoom:i})=>rm.translate(t,e).scale(i),Gl=(t,e)=>t.target.closest(`.${e}`),IP=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),y6=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,av=(t,e=0,i=y6,n=()=>{})=>{const r=typeof e=="number"&&e>0;return r||n(),r?t.transition().duration(e).ease(i).on("end",n):t},YP=t=>{const e=t.ctrlKey&&Tu()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function S6({zoomPanValues:t,noWheelClassName:e,d3Selection:i,d3Zoom:n,panOnScrollMode:r,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:c,onPanZoom:h,onPanZoomEnd:d}){return f=>{if(Gl(f,e))return f.ctrlKey&&f.preventDefault(),!1;f.preventDefault(),f.stopImmediatePropagation();const g=i.property("__zoom").k||1;if(f.ctrlKey&&a){const w=pr(f),x=YP(f),Q=g*Math.pow(2,x);n.scaleTo(i,Q,w,f);return}const m=f.deltaMode===1?20:1;let O=r===za.Vertical?0:f.deltaX*m,S=r===za.Horizontal?0:f.deltaY*m;!Tu()&&f.shiftKey&&r!==za.Vertical&&(O=f.deltaY*m,S=0),n.translateBy(i,-(O/g)*s,-(S/g)*s,{internal:!0});const _=am(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(h==null||h(f,_),t.panScrollTimeout=setTimeout(()=>{d==null||d(f,_),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,c==null||c(f,_))}}function b6({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:i}){return function(n,r){const s=n.type==="wheel",a=!e&&s&&!n.ctrlKey,c=Gl(n,t);if(n.ctrlKey&&s&&c&&n.preventDefault(),a||c)return null;n.preventDefault(),i.call(this,n,r)}}function _6({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:i}){return n=>{var s,a,c;if((s=n.sourceEvent)!=null&&s.internal)return;const r=am(n.transform);t.mouseButton=((a=n.sourceEvent)==null?void 0:a.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=r,((c=n.sourceEvent)==null?void 0:c.type)==="mousedown"&&e(!0),i&&(i==null||i(n.sourceEvent,r))}}function x6({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:i,onTransformChange:n,onPanZoom:r}){return s=>{var a,c;t.usedRightMouseButton=!!(i&&IP(e,t.mouseButton??0)),(a=s.sourceEvent)!=null&&a.sync||n([s.transform.x,s.transform.y,s.transform.k]),r&&!((c=s.sourceEvent)!=null&&c.internal)&&(r==null||r(s.sourceEvent,am(s.transform)))}}function w6({zoomPanValues:t,panOnDrag:e,panOnScroll:i,onDraggingChange:n,onPanZoomEnd:r,onPaneContextMenu:s}){return a=>{var c;if(!((c=a.sourceEvent)!=null&&c.internal)&&(t.isZoomingOrPanning=!1,s&&IP(e,t.mouseButton??0)&&!t.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),t.usedRightMouseButton=!1,n(!1),r)){const h=am(a.transform);t.prevViewport=h,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{r==null||r(a.sourceEvent,h)},i?150:0)}}}function k6({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:i,panOnDrag:n,panOnScroll:r,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:c,noPanClassName:h,lib:d,connectionInProgress:f}){return g=>{var w;const m=t||e,O=i&&g.ctrlKey,S=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Gl(g,`${d}-flow__node`)||Gl(g,`${d}-flow__edge`)))return!0;if(!n&&!m&&!r&&!s&&!i||a||f&&!S||Gl(g,c)&&S||Gl(g,h)&&(!S||r&&S&&!t)||!i&&g.ctrlKey&&S)return!1;if(!i&&g.type==="touchstart"&&((w=g.touches)==null?void 0:w.length)>1)return g.preventDefault(),!1;if(!m&&!r&&!O&&S||!n&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(n)&&!n.includes(g.button)&&g.type==="mousedown")return!1;const _=Array.isArray(n)&&n.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||S)&&_}}function C6({domNode:t,minZoom:e,maxZoom:i,translateExtent:n,viewport:r,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:h}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=t.getBoundingClientRect(),g=yP().scaleExtent([e,i]).translateExtent(n),m=Bn(t).call(g);Q({x:r.x,y:r.y,zoom:Oc(r.zoom,e,i)},[[0,0],[f.width,f.height]],n);const O=m.on("wheel.zoom"),S=m.on("dblclick.zoom");g.wheelDelta(YP);function _(I,j){return m?new Promise(D=>{g==null||g.interpolate((j==null?void 0:j.interpolate)==="linear"?cu:Rp).transform(av(m,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>D(!0)),I)}):Promise.resolve(!1)}function w({noWheelClassName:I,noPanClassName:j,onPaneContextMenu:D,userSelectionActive:E,panOnScroll:X,panOnDrag:P,panOnScrollMode:Z,panOnScrollSpeed:L,preventScrolling:B,zoomOnPinch:G,zoomOnScroll:z,zoomOnDoubleClick:q,zoomActivationKeyPressed:K,lib:ie,onTransformChange:ce,connectionInProgress:de,paneClickDistance:pe,selectionOnDrag:fe}){E&&!d.isZoomingOrPanning&&x();const ve=X&&!K&&!E;g.clickDistance(fe?1/0:!Or(pe)||pe<0?0:pe);const De=ve?S6({zoomPanValues:d,noWheelClassName:I,d3Selection:m,d3Zoom:g,panOnScrollMode:Z,panOnScrollSpeed:L,zoomOnPinch:G,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:c}):b6({noWheelClassName:I,preventScrolling:B,d3ZoomHandler:O});if(m.on("wheel.zoom",De,{passive:!1}),!E){const ke=_6({zoomPanValues:d,onDraggingChange:h,onPanZoomStart:a});g.on("start",ke);const me=x6({zoomPanValues:d,panOnDrag:P,onPaneContextMenu:!!D,onPanZoom:s,onTransformChange:ce});g.on("zoom",me);const Be=w6({zoomPanValues:d,panOnDrag:P,panOnScroll:X,onPaneContextMenu:D,onPanZoomEnd:c,onDraggingChange:h});g.on("end",Be)}const Ee=k6({zoomActivationKeyPressed:K,panOnDrag:P,zoomOnScroll:z,panOnScroll:X,zoomOnDoubleClick:q,zoomOnPinch:G,userSelectionActive:E,noPanClassName:j,noWheelClassName:I,lib:ie,connectionInProgress:de});g.filter(Ee),q?m.on("dblclick.zoom",S):m.on("dblclick.zoom",null)}function x(){g.on("zoom",null)}async function Q(I,j,D){const E=ov(I),X=g==null?void 0:g.constrain()(E,j,D);return X&&await _(X),new Promise(P=>P(X))}async function k(I,j){const D=ov(I);return await _(D,j),new Promise(E=>E(D))}function T(I){if(m){const j=ov(I),D=m.property("__zoom");(D.k!==I.zoom||D.x!==I.x||D.y!==I.y)&&(g==null||g.transform(m,j,null,{sync:!0}))}}function M(){const I=m?vP(m.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}function $(I,j){return m?new Promise(D=>{g==null||g.interpolate((j==null?void 0:j.interpolate)==="linear"?cu:Rp).scaleTo(av(m,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>D(!0)),I)}):Promise.resolve(!1)}function R(I,j){return m?new Promise(D=>{g==null||g.interpolate((j==null?void 0:j.interpolate)==="linear"?cu:Rp).scaleBy(av(m,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>D(!0)),I)}):Promise.resolve(!1)}function V(I){g==null||g.scaleExtent(I)}function H(I){g==null||g.translateExtent(I)}function ee(I){const j=!Or(I)||I<0?0:I;g==null||g.clickDistance(j)}return{update:w,destroy:x,setViewport:k,setViewportConstrained:Q,getViewport:M,scaleTo:$,scaleBy:R,setScaleExtent:V,setTranslateExtent:H,syncViewport:T,setClickDistance:ee}}var Sc;(function(t){t.Line="line",t.Handle="handle"})(Sc||(Sc={}));function T6({width:t,prevWidth:e,height:i,prevHeight:n,affectsX:r,affectsY:s}){const a=t-e,c=i-n,h=[a>0?1:a<0?-1:0,c>0?1:c<0?-1:0];return a&&r&&(h[0]=h[0]*-1),c&&s&&(h[1]=h[1]*-1),h}function PC(t){const e=t.includes("right")||t.includes("left"),i=t.includes("bottom")||t.includes("top"),n=t.includes("left"),r=t.includes("top");return{isHorizontal:e,isVertical:i,affectsX:n,affectsY:r}}function vo(t,e){return Math.max(0,e-t)}function yo(t,e){return Math.max(0,t-e)}function Yf(t,e,i){return Math.max(0,e-t,t-i)}function EC(t,e){return t?!e:e}function Q6(t,e,i,n,r,s,a,c){let{affectsX:h,affectsY:d}=e;const{isHorizontal:f,isVertical:g}=e,m=f&&g,{xSnapped:O,ySnapped:S}=i,{minWidth:_,maxWidth:w,minHeight:x,maxHeight:Q}=n,{x:k,y:T,width:M,height:$,aspectRatio:R}=t;let V=Math.floor(f?O-t.pointerX:0),H=Math.floor(g?S-t.pointerY:0);const ee=M+(h?-V:V),I=$+(d?-H:H),j=-s[0]*M,D=-s[1]*$;let E=Yf(ee,_,w),X=Yf(I,x,Q);if(a){let L=0,B=0;h&&V<0?L=vo(k+V+j,a[0][0]):!h&&V>0&&(L=yo(k+ee+j,a[1][0])),d&&H<0?B=vo(T+H+D,a[0][1]):!d&&H>0&&(B=yo(T+I+D,a[1][1])),E=Math.max(E,L),X=Math.max(X,B)}if(c){let L=0,B=0;h&&V>0?L=yo(k+V,c[0][0]):!h&&V<0&&(L=vo(k+ee,c[1][0])),d&&H>0?B=yo(T+H,c[0][1]):!d&&H<0&&(B=vo(T+I,c[1][1])),E=Math.max(E,L),X=Math.max(X,B)}if(r){if(f){const L=Yf(ee/R,x,Q)*R;if(E=Math.max(E,L),a){let B=0;!h&&!d||h&&!d&&m?B=yo(T+D+ee/R,a[1][1])*R:B=vo(T+D+(h?V:-V)/R,a[0][1])*R,E=Math.max(E,B)}if(c){let B=0;!h&&!d||h&&!d&&m?B=vo(T+ee/R,c[1][1])*R:B=yo(T+(h?V:-V)/R,c[0][1])*R,E=Math.max(E,B)}}if(g){const L=Yf(I*R,_,w)/R;if(X=Math.max(X,L),a){let B=0;!h&&!d||d&&!h&&m?B=yo(k+I*R+j,a[1][0])/R:B=vo(k+(d?H:-H)*R+j,a[0][0])/R,X=Math.max(X,B)}if(c){let B=0;!h&&!d||d&&!h&&m?B=vo(k+I*R,c[1][0])/R:B=yo(k+(d?H:-H)*R,c[0][0])/R,X=Math.max(X,B)}}}H=H+(H<0?X:-X),V=V+(V<0?E:-E),r&&(m?ee>I*R?H=(EC(h,d)?-V:V)/R:V=(EC(h,d)?-H:H)*R:f?(H=V/R,d=h):(V=H*R,h=d));const P=h?k+V:k,Z=d?T+H:T;return{width:M+(h?-V:V),height:$+(d?-H:H),x:s[0]*V*(h?-1:1)+P,y:s[1]*H*(d?-1:1)+Z}}const HP={width:0,height:0,x:0,y:0},$6={...HP,pointerX:0,pointerY:0,aspectRatio:1};function P6(t){return[[0,0],[t.measured.width,t.measured.height]]}function E6(t,e,i){const n=e.position.x+t.position.x,r=e.position.y+t.position.y,s=t.measured.width??0,a=t.measured.height??0,c=i[0]*s,h=i[1]*a;return[[n-c,r-h],[n+s-c,r+a-h]]}function R6({domNode:t,nodeId:e,getStoreItems:i,onChange:n,onEnd:r}){const s=Bn(t);let a={controlDirection:PC("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:d,boundaries:f,keepAspectRatio:g,resizeDirection:m,onResizeStart:O,onResize:S,onResizeEnd:_,shouldResize:w}){let x={...HP},Q={...$6};a={boundaries:f,resizeDirection:m,keepAspectRatio:g,controlDirection:PC(d)};let k,T=null,M=[],$,R,V,H=!1;const ee=rP().on("start",I=>{const{nodeLookup:j,transform:D,snapGrid:E,snapToGrid:X,nodeOrigin:P,paneDomNode:Z}=i();if(k=j.get(e),!k)return;T=(Z==null?void 0:Z.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:B}=hu(I.sourceEvent,{transform:D,snapGrid:E,snapToGrid:X,containerBounds:T});x={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},Q={...x,pointerX:L,pointerY:B,aspectRatio:x.width/x.height},$=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&($=j.get(k.parentId),R=$&&k.extent==="parent"?P6($):void 0),M=[],V=void 0;for(const[G,z]of j)if(z.parentId===e&&(M.push({id:G,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const q=E6(z,k,z.origin??P);V?V=[[Math.min(q[0][0],V[0][0]),Math.min(q[0][1],V[0][1])],[Math.max(q[1][0],V[1][0]),Math.max(q[1][1],V[1][1])]]:V=q}O==null||O(I,{...x})}).on("drag",I=>{const{transform:j,snapGrid:D,snapToGrid:E,nodeOrigin:X}=i(),P=hu(I.sourceEvent,{transform:j,snapGrid:D,snapToGrid:E,containerBounds:T}),Z=[];if(!k)return;const{x:L,y:B,width:G,height:z}=x,q={},K=k.origin??X,{width:ie,height:ce,x:de,y:pe}=Q6(Q,a.controlDirection,P,a.boundaries,a.keepAspectRatio,K,R,V),fe=ie!==G,ve=ce!==z,De=de!==L&&fe,Ee=pe!==B&&ve;if(!De&&!Ee&&!fe&&!ve)return;if((De||Ee||K[0]===1||K[1]===1)&&(q.x=De?de:x.x,q.y=Ee?pe:x.y,x.x=q.x,x.y=q.y,M.length>0)){const lt=de-L,He=pe-B;for(const Ft of M)Ft.position={x:Ft.position.x-lt+K[0]*(ie-G),y:Ft.position.y-He+K[1]*(ce-z)},Z.push(Ft)}if((fe||ve)&&(q.width=fe&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ie:x.width,q.height=ve&&(!a.resizeDirection||a.resizeDirection==="vertical")?ce:x.height,x.width=q.width,x.height=q.height),$&&k.expandParent){const lt=K[0]*(q.width??0);q.x&&q.x<lt&&(x.x=lt,Q.x=Q.x-(q.x-lt));const He=K[1]*(q.height??0);q.y&&q.y<He&&(x.y=He,Q.y=Q.y-(q.y-He))}const ke=T6({width:x.width,prevWidth:G,height:x.height,prevHeight:z,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),me={...x,direction:ke};(w==null?void 0:w(I,me))!==!1&&(H=!0,S==null||S(I,me),n(q,Z))}).on("end",I=>{H&&(_==null||_(I,{...x}),r==null||r({...x}),H=!1)});s.call(ee)}function h(){s.on(".drag",null)}return{update:c,destroy:h}}var lv={exports:{}},cv={},hv={exports:{}},uv={};/**
50
50
  * @license React
51
51
  * use-sync-external-store-shim.production.js
52
52
  *
@@ -74,7 +74,7 @@ Error generating stack: `+p.message+`
74
74
  ...`:""]})]})]})})}function Z8({skills:t,onSelect:e}){const i=t.filter(n=>n.featured).slice(0,3);return i.length===0?null:v.jsxs("div",{style:Me.featuredSection,children:[v.jsx("div",{style:Me.featuredLabel,children:"Featured"}),v.jsx("div",{style:Me.featuredRow,children:i.map(n=>v.jsxs("div",{onClick:()=>e(n),style:Me.featuredCard,onMouseEnter:r=>{r.currentTarget.style.borderColor="var(--accent)",r.currentTarget.style.transform="translateY(-1px)"},onMouseLeave:r=>{r.currentTarget.style.borderColor="var(--border)",r.currentTarget.style.transform="none"},children:[v.jsx("div",{style:Me.featuredGradient,children:v.jsx("div",{style:{...Me.featuredIcon,background:n.installed?"var(--green)":"var(--accent)"},children:n.icon||n.name.charAt(0)})}),v.jsxs("div",{style:Me.featuredInfo,children:[v.jsx("div",{style:Me.featuredName,children:n.name}),v.jsxs("div",{style:Me.featuredAuthorRow,children:[v.jsx("span",{style:Me.featuredAuthor,children:n.author}),v.jsx(q1,{skill:n})]}),v.jsx("div",{style:Me.featuredDesc,children:n.description}),v.jsxs("div",{style:Me.featuredMeta,children:[n.rating>0&&v.jsxs("span",{style:{color:"var(--amber)",fontSize:10},children:[Dy(n.rating)," ",n.rating]}),v.jsxs("span",{style:{color:"var(--text-muted)",fontSize:10},children:["⤓"," ",V1(n.downloads)]})]})]}),n.installed&&v.jsx("div",{style:Me.featuredBadge,children:"installed"})]},n.id))})]})}function W8({skill:t,onSelect:e,hovered:i,onHover:n}){return v.jsxs("div",{onClick:()=>e(t),onMouseEnter:()=>n(t.id),onMouseLeave:()=>n(null),style:{...Me.card,borderColor:t.installed?"var(--green)":i?"var(--accent)":"var(--border)",background:i?"var(--bg-hover)":"var(--bg-surface)",transform:i?"translateY(-1px)":"none"},children:[v.jsxs("div",{style:Me.cardTop,children:[v.jsx("div",{style:{...Me.cardIcon,background:t.installed?"var(--green)":t.price>0?"var(--purple)":"var(--accent)"},children:t.icon||t.name.charAt(0)}),v.jsxs("div",{style:Me.cardInfo,children:[v.jsx("div",{style:Me.cardName,children:t.name}),v.jsxs("div",{style:Me.cardAuthorRow,children:[v.jsx("span",{style:Me.cardAuthor,children:t.author}),v.jsx(q1,{skill:t})]})]}),t.installed&&v.jsx("div",{style:Me.installedBadge,children:"installed"}),t.price>0&&!t.installed&&v.jsxs("div",{style:Me.priceBadge,children:["$",t.price.toFixed(2)]}),t.price===0&&!t.installed&&v.jsx("div",{style:Me.freeBadge,children:"Free"})]}),v.jsx("div",{style:Me.cardDesc,children:t.description}),v.jsxs("div",{style:Me.cardBottom,children:[v.jsxs("div",{style:Me.cardStats,children:[t.rating>0&&v.jsxs("span",{style:Me.cardRating,children:[v.jsx("span",{style:{color:"var(--amber)"},children:"★"})," ",t.rating]}),t.downloads>0&&v.jsxs("span",{style:Me.cardDownloads,children:["⤓"," ",V1(t.downloads)]})]}),v.jsxs("span",{style:Me.catTag,children:[W1[t.category]||""," ",Z1[t.category]||t.category]})]})]})}function q8(){const[t,e]=N.useState([]),[i,n]=N.useState([]),[r,s]=N.useState(""),[a,c]=N.useState("all"),[h,d]=N.useState("popular"),[f,g]=N.useState("browse"),[m,O]=N.useState(!0),[S,_]=N.useState(null),[w,x]=N.useState(null),[Q,k]=N.useState(null),[T,M]=N.useState(null),$=N.useCallback(async()=>{O(!0);try{const D=new URLSearchParams;r&&D.set("search",r),a!=="all"&&D.set("category",a);const X=await(await fetch(`/api/skills/registry?${D}`)).json();e(X.skills||[]),n(X.categories||[])}catch{}O(!1)},[r,a]);N.useEffect(()=>{$()},[$]);async function R(D){_(D);try{await fetch(`/api/skills/${D}/install`,{method:"POST"}),await $(),e(E=>{const X=E.find(P=>P.id===D);return X&&(w==null?void 0:w.id)===D&&x({...X,installed:!0}),E})}catch{}_(null)}async function V(D){_(D);try{await fetch(`/api/skills/${D}`,{method:"DELETE"}),await $(),(w==null?void 0:w.id)===D&&(x(E=>E?{...E,installed:!1}:null),k(null))}catch{}_(null)}async function H(D,E){const X=await fetch(`/api/skills/${D}/rate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rating:E})});if(!X.ok)throw new Error("Rating failed");const P=await X.json();e(Z=>Z.map(L=>L.id===D?{...L,rating:P.rating,ratingCount:P.rating_count??P.ratingCount}:L)),(w==null?void 0:w.id)===D&&x(Z=>Z?{...Z,rating:P.rating,ratingCount:P.rating_count??P.ratingCount}:null)}async function ee(D){if(x(D),k(null),D.installed)try{const X=await(await fetch(`/api/skills/${D.id}/content`)).json();k(X.content)}catch{}}const I=t.filter(D=>D.installed),j=l2(f==="installed"?I:t,h);return v.jsxs("div",{style:Me.root,children:[v.jsxs("div",{style:Me.headerBar,children:[v.jsxs("div",{style:Me.headerLeft,children:[v.jsx("div",{style:Me.title,children:"Skills Store"}),v.jsxs("div",{style:Me.headerTabs,children:[v.jsx("button",{onClick:()=>g("browse"),style:{...Me.headerTab,color:f==="browse"?"var(--text-bright)":"var(--text-dim)",borderBottom:f==="browse"?"2px solid var(--accent)":"2px solid transparent"},children:"Browse"}),v.jsxs("button",{onClick:()=>g("installed"),style:{...Me.headerTab,color:f==="installed"?"var(--text-bright)":"var(--text-dim)",borderBottom:f==="installed"?"2px solid var(--green)":"2px solid transparent"},children:["My Skills (",I.length,")"]})]})]}),v.jsx("div",{style:Me.headerRight,children:v.jsxs("span",{style:Me.headerCount,children:[t.length," skills"]})})]}),v.jsxs("div",{style:Me.toolbar,children:[v.jsxs("div",{style:Me.searchRow,children:[v.jsxs("div",{style:Me.searchWrap,children:[v.jsx("span",{style:Me.searchIcon,children:"⌕"}),v.jsx("input",{style:Me.search,placeholder:"Search skills...",value:r,onChange:D=>s(D.target.value)})]}),v.jsx("div",{style:Me.sortWrap,children:B8.map(D=>v.jsx("button",{onClick:()=>d(D.id),style:{...Me.sortBtn,color:h===D.id?"var(--text-bright)":"var(--text-muted)",background:h===D.id?"var(--bg-active)":"transparent"},children:D.label},D.id))})]}),f==="browse"&&v.jsxs("div",{style:Me.catRow,children:[v.jsx("button",{onClick:()=>c("all"),style:{...Me.catBtn,...a==="all"?Me.catBtnActive:{}},children:"All"}),i.map(D=>v.jsxs("button",{onClick:()=>c(D.id),style:{...Me.catBtn,...a===D.id?Me.catBtnActive:{}},children:[W1[D.id]||""," ",Z1[D.id]||D.id," (",D.count,")"]},D.id))]})]}),v.jsxs("div",{style:Me.scrollArea,children:[f==="browse"&&!r&&a==="all"&&v.jsx(Z8,{skills:t,onSelect:ee}),m&&t.length===0&&v.jsx("div",{style:Me.empty,children:"Loading skills..."}),!m&&j.length===0&&v.jsx("div",{style:Me.empty,children:f==="installed"?"No skills installed yet. Browse the store to find skills.":"No skills match your search."}),v.jsx("div",{style:Me.grid,children:j.map(D=>v.jsx(W8,{skill:D,onSelect:ee,hovered:T===D.id,onHover:M},D.id))})]}),v.jsx(N8,{skill:w,content:Q,installing:S,onInstall:R,onUninstall:V,onRate:H,onClose:()=>{x(null),k(null)}})]})}const Me={root:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},headerBar:{padding:"12px 20px 0",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},headerLeft:{display:"flex",alignItems:"center",gap:20},title:{fontSize:15,fontWeight:700,color:"var(--text-bright)",letterSpacing:.3},headerTabs:{display:"flex",gap:0},headerTab:{padding:"6px 14px",background:"none",border:"none",fontSize:12,fontWeight:500,fontFamily:"var(--font)",cursor:"pointer",transition:"color 0.1s"},headerRight:{display:"flex",alignItems:"center",gap:10},headerCount:{fontSize:11,color:"var(--text-muted)"},toolbar:{padding:"10px 20px",flexShrink:0},searchRow:{display:"flex",gap:10,alignItems:"center"},searchWrap:{flex:1,position:"relative"},searchIcon:{position:"absolute",left:10,top:"50%",transform:"translateY(-50%)",color:"var(--text-muted)",fontSize:13,pointerEvents:"none"},search:{width:"100%",padding:"7px 12px 7px 30px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:6,color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font)",outline:"none"},sortWrap:{display:"flex",gap:2},sortBtn:{padding:"5px 10px",background:"transparent",border:"1px solid transparent",borderRadius:4,fontSize:10,fontWeight:500,fontFamily:"var(--font)",cursor:"pointer",transition:"all 0.1s"},catRow:{display:"flex",gap:4,marginTop:8,flexWrap:"wrap"},catBtn:{padding:"4px 12px",background:"transparent",border:"1px solid var(--border)",borderRadius:14,color:"var(--text-dim)",fontSize:10,fontFamily:"var(--font)",cursor:"pointer",transition:"all 0.1s"},catBtnActive:{borderColor:"var(--accent)",color:"var(--accent)",background:"rgba(51, 175, 188, 0.08)"},scrollArea:{flex:1,overflowY:"auto",padding:"4px 20px 20px"},featuredSection:{marginBottom:16},featuredLabel:{fontSize:11,fontWeight:700,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:1,marginBottom:8},featuredRow:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:8},featuredCard:{padding:"14px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:8,cursor:"pointer",transition:"border-color 0.15s, transform 0.15s",position:"relative",overflow:"hidden"},featuredGradient:{display:"flex",alignItems:"center",marginBottom:10},featuredIcon:{width:40,height:40,borderRadius:10,display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,fontWeight:700,color:"var(--bg-base)"},featuredInfo:{flex:1},featuredName:{fontSize:13,fontWeight:700,color:"var(--text-bright)"},featuredAuthorRow:{display:"flex",alignItems:"center",gap:6,marginTop:2},featuredAuthor:{fontSize:10,color:"var(--text-muted)"},featuredDesc:{fontSize:10,color:"var(--text-dim)",marginTop:6,lineHeight:1.45,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},featuredMeta:{display:"flex",gap:10,marginTop:8},featuredBadge:{position:"absolute",top:8,right:8,fontSize:8,fontWeight:600,color:"var(--green)",border:"1px solid var(--green)",borderRadius:3,padding:"1px 5px",textTransform:"uppercase",letterSpacing:.5},grid:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:8},empty:{padding:"60px 0",textAlign:"center",color:"var(--text-dim)",fontSize:12,gridColumn:"1 / -1"},card:{padding:"14px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:8,cursor:"pointer",transition:"border-color 0.12s, background 0.12s, transform 0.12s",display:"flex",flexDirection:"column"},cardTop:{display:"flex",alignItems:"center",gap:10},cardIcon:{width:36,height:36,borderRadius:8,display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:700,color:"var(--bg-base)",flexShrink:0},cardInfo:{flex:1,minWidth:0},cardName:{fontSize:12,fontWeight:600,color:"var(--text-bright)"},cardAuthorRow:{display:"flex",alignItems:"center",gap:6,marginTop:2},cardAuthor:{fontSize:10,color:"var(--text-muted)"},installedBadge:{fontSize:8,fontWeight:600,color:"var(--green)",border:"1px solid var(--green)",borderRadius:3,padding:"1px 6px",textTransform:"uppercase",letterSpacing:.5,flexShrink:0},priceBadge:{fontSize:10,fontWeight:700,color:"var(--purple)",border:"1px solid var(--purple)",borderRadius:4,padding:"2px 8px",flexShrink:0},freeBadge:{fontSize:9,fontWeight:500,color:"var(--text-muted)",flexShrink:0},cardDesc:{fontSize:11,color:"var(--text-dim)",marginTop:10,lineHeight:1.5,flex:1,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},cardBottom:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:10,paddingTop:8,borderTop:"1px solid var(--border)"},cardStats:{display:"flex",gap:10},cardRating:{fontSize:10,color:"var(--text-dim)"},cardDownloads:{fontSize:10,color:"var(--text-muted)"},catTag:{fontSize:9,padding:"2px 8px",borderRadius:4,background:"var(--bg-active)",color:"var(--text-dim)",fontWeight:500}},Xe={overlay:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,backdropFilter:"blur(2px)"},container:{width:"90%",maxWidth:560,maxHeight:"85vh",background:"var(--bg-chrome)",border:"1px solid var(--border)",borderRadius:10,overflowY:"auto",padding:"0 24px 24px",position:"relative"},topBar:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 0 10px",position:"sticky",top:0,zIndex:1,background:"var(--bg-chrome)"},closeBtn:{background:"none",border:"1px solid var(--border)",borderRadius:4,color:"var(--text-dim)",fontSize:16,cursor:"pointer",fontFamily:"var(--font)",lineHeight:1,padding:"2px 8px",transition:"border-color 0.1s"},header:{display:"flex",gap:14,alignItems:"flex-start",marginBottom:14},actionBar:{display:"flex",alignItems:"center",gap:10,marginBottom:18,paddingBottom:16,borderBottom:"1px solid var(--border)"},icon:{width:52,height:52,borderRadius:12,display:"flex",alignItems:"center",justifyContent:"center",fontSize:20,fontWeight:700,color:"var(--bg-base)",flexShrink:0},headerInfo:{flex:1,minWidth:0},name:{fontSize:16,fontWeight:700,color:"var(--text-bright)"},author:{fontSize:11,color:"var(--text-dim)",marginTop:2},meta:{display:"flex",gap:12,marginTop:6,fontSize:11,color:"var(--text-dim)"},metaItem:{display:"flex",alignItems:"center",gap:3},installBtn:{padding:"8px 28px",background:"var(--accent)",border:"none",borderRadius:6,color:"var(--bg-base)",fontSize:12,fontWeight:700,fontFamily:"var(--font)",cursor:"pointer",transition:"opacity 0.1s"},buyBtn:{padding:"8px 28px",background:"var(--purple)",border:"none",borderRadius:6,color:"#fff",fontSize:12,fontWeight:700,fontFamily:"var(--font)",cursor:"pointer",transition:"opacity 0.1s"},uninstallBtn:{padding:"8px 20px",background:"transparent",border:"1px solid var(--red)",borderRadius:6,color:"var(--red)",fontSize:12,fontWeight:600,fontFamily:"var(--font)",cursor:"pointer"},freeLabel:{fontSize:9,color:"var(--text-muted)",fontWeight:500},section:{marginBottom:16},ratingRow:{display:"flex",gap:20,alignItems:"center",padding:"12px 14px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:6},ratingLeft:{display:"flex",flexDirection:"column",alignItems:"center",gap:2,minWidth:70},ratingBig:{fontSize:24,fontWeight:700,color:"var(--text-bright)",lineHeight:1},ratingCount:{fontSize:9,color:"var(--text-muted)",marginTop:2},ratingRight:{flex:1},rateLabel:{fontSize:11,color:"var(--text-dim)",marginBottom:6},sectionTitle:{fontSize:10,fontWeight:600,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:.8,marginBottom:8},description:{fontSize:12,color:"var(--text-primary)",lineHeight:1.6},tagRow:{display:"flex",gap:5,flexWrap:"wrap"},tag:{fontSize:10,padding:"2px 8px",borderRadius:4,background:"var(--bg-active)",color:"var(--text-dim)"},roleTag:{fontSize:10,padding:"2px 8px",borderRadius:4,background:"rgba(51, 175, 188, 0.1)",color:"var(--accent)"},authorCard:{display:"flex",gap:12,alignItems:"center",padding:"10px 12px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:6},authorAvatar:{width:36,height:36,borderRadius:6,background:"var(--accent)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:700,color:"var(--bg-base)",flexShrink:0},authorDetails:{flex:1},authorName:{fontSize:12,fontWeight:600,color:"var(--text-bright)"},authorLinks:{display:"flex",gap:10,marginTop:4},authorLink:{fontSize:10,color:"var(--accent)",textDecoration:"none"},contentPre:{fontSize:10,color:"var(--text-dim)",lineHeight:1.6,fontFamily:"var(--font)",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:300,overflowY:"auto",padding:"10px 12px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:6}},I1={all:"All",communication:"Communication",productivity:"Productivity",finance:"Finance",developer:"Developer",database:"Database","smart-home":"Smart Home",analytics:"Analytics"},Y1={communication:"✉",productivity:"⚙",finance:"⚖",developer:"⌘",database:"≡","smart-home":"⌂",analytics:"⌕"},H1={slack:"S",github:"G",stripe:"$",calendar:"C",email:"@",gmail:"@",database:"D",search:"?",drive:"D",linear:"L",notion:"N",discord:"D",home:"H",folder:"F",map:"M"},V8=[{id:"popular",label:"Popular"},{id:"name",label:"A–Z"},{id:"category",label:"Category"}];function I8(t){return t.verified==="mcp-official"?{label:"Official",color:"var(--accent)",bg:"rgba(51, 175, 188, 0.12)"}:t.verified==="verified"?{label:"Verified",color:"var(--green)",bg:"rgba(74, 225, 104, 0.10)"}:null}function U1({item:t,size:e="small"}){const i=I8(t);if(!i)return null;const n=e==="small";return v.jsxs("span",{title:`${i.label} MCP server`,style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:n?9:10,fontWeight:600,color:i.color,background:i.bg,padding:n?"1px 6px":"2px 8px",borderRadius:3,letterSpacing:.3,flexShrink:0,cursor:"default"},children:[v.jsx("span",{style:{fontSize:n?8:10,lineHeight:1},children:"✓"}),i.label]})}function c2(t,e){const i=[...t];switch(e){case"popular":return i.sort((n,r)=>(r.featured?1:0)-(n.featured?1:0)||n.name.localeCompare(r.name));case"name":return i.sort((n,r)=>n.name.localeCompare(r.name));case"category":return i.sort((n,r)=>(n.category||"").localeCompare(r.category||"")||n.name.localeCompare(r.name));default:return i}}function Y8({integration:t,onClose:e}){const[i,n]=N.useState({}),[r,s]=N.useState(!1),[a,c]=N.useState({}),[h,d]=N.useState(null),[f,g]=N.useState(""),[m,O]=N.useState(""),[S,_]=N.useState(!1);if(N.useEffect(()=>{(t==null?void 0:t.authType)==="oauth-google"&&(d("checking"),fetch("/api/integrations/google-oauth/status").then($=>$.json()).then($=>d($.configured?"ready":"not-configured")).catch(()=>d("not-configured")))},[t]),!t)return null;const w=t.authType==="oauth-google",x=(t.envKeys||[]).filter($=>!$.hidden),Q=t.setupSteps||[];async function k($){if(i[$]){s(!0);try{(await fetch(`/api/integrations/${t.id}/credentials`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:$,value:i[$]})})).ok&&(c(V=>({...V,[$]:!0})),n(V=>({...V,[$]:""})))}catch{}s(!1)}}async function T(){if(!(!f||!m)){s(!0);try{await fetch("/api/integrations/google-oauth/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:f,clientSecret:m})}),d("ready"),_(!1)}catch{}s(!1)}}async function M(){d("connecting");try{const R=await(await fetch(`/api/integrations/${t.id}/oauth/start`,{method:"POST"})).json();if(R.url){window.open(R.url,"_blank","width=600,height=700");const V=setInterval(async()=>{try{(await(await fetch(`/api/integrations/${t.id}/status`)).json()).configured&&(clearInterval(V),d("ready"),e())}catch{}},2e3);setTimeout(()=>clearInterval(V),3e5)}}catch{d("ready")}}return v.jsx("div",{style:Ge.overlay,onClick:e,children:v.jsxs("div",{style:Ge.container,onClick:$=>$.stopPropagation(),children:[v.jsxs("div",{style:Ge.topBar,children:[v.jsxs("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-bright)"},children:["Connect ",t.name]}),v.jsx("button",{onClick:e,style:Ge.closeBtn,children:"×"})]}),v.jsxs("div",{style:{padding:"16px 0"},children:[Q.length>0&&v.jsxs("div",{style:{marginBottom:20},children:[v.jsx("div",{style:{fontSize:10,fontWeight:700,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:.5,marginBottom:10},children:"Setup Guide"}),Q.map(($,R)=>v.jsxs("div",{style:{display:"flex",gap:10,marginBottom:8,fontSize:11,color:"var(--text-primary)",lineHeight:1.5},children:[v.jsx("span",{style:{width:20,height:20,borderRadius:"50%",flexShrink:0,background:"var(--bg-active)",color:"var(--accent)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:700},children:R+1}),v.jsx("span",{children:$})]},R))]}),t.setupUrl&&!w&&v.jsxs("a",{href:t.setupUrl,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"10px 16px",marginBottom:16,background:"var(--bg-active)",color:"var(--accent)",border:"1px solid var(--accent)",borderRadius:6,fontSize:12,fontWeight:600,textDecoration:"none",cursor:"pointer"},children:["Open ",t.name," Settings ","↗"]}),w&&v.jsxs("div",{style:{marginBottom:16},children:[v.jsx("button",{onClick:h==="ready"?M:()=>_(!0),disabled:h==="checking"||h==="connecting",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,width:"100%",padding:"12px 16px",marginBottom:12,background:h==="connecting"?"var(--bg-active)":"#4285f4",color:"#fff",border:"none",borderRadius:6,fontSize:13,fontWeight:600,cursor:"pointer",fontFamily:"var(--font)",opacity:h==="checking"?.5:1},children:h==="checking"?"Checking...":h==="connecting"?"Waiting for authorization...":"Connect with Google"}),S&&h==="not-configured"&&v.jsxs("div",{style:{padding:14,borderRadius:8,background:"var(--bg-surface)",border:"1px solid var(--border)"},children:[v.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-bright)",marginBottom:8},children:"First-time setup (one time for all Google services)"}),v.jsx("div",{style:{fontSize:10,color:"var(--text-dim)",lineHeight:1.6,marginBottom:10},children:"Create a free Google Cloud OAuth app to let Groove connect on your behalf:"}),v.jsxs("a",{href:"https://console.cloud.google.com/apis/credentials/oauthclient",target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 14px",marginBottom:10,background:"var(--bg-active)",color:"var(--accent)",border:"1px solid var(--accent)",borderRadius:6,fontSize:11,fontWeight:600,textDecoration:"none"},children:["Open Google Cloud Console ","↗"]}),v.jsxs("div",{style:{fontSize:10,color:"var(--text-muted)",lineHeight:1.7,marginBottom:12},children:["1. Create a project if you don't have one",`
75
75
  `,"2. Set up OAuth consent screen (External, add your email as test user)",`
76
76
  `,"3. Create credentials ","→"," OAuth client ID ","→"," Desktop app",`
77
- `,"4. Paste the Client ID and Secret below:"]}),v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[v.jsx("input",{value:f,onChange:$=>g($.target.value),placeholder:"Client ID (e.g. 123456.apps.googleusercontent.com)",style:Ge.input}),v.jsx("input",{type:"password",value:m,onChange:$=>O($.target.value),placeholder:"Client Secret (e.g. GOCSPX-...)",style:Ge.input}),v.jsx("button",{onClick:async()=>{await T(),f&&m&&setTimeout(()=>M(),500)},disabled:r||!f||!m,style:{...Ge.saveBtn,width:"100%",opacity:r||!f||!m?.4:1},children:r?"Saving...":"Save & Connect"})]}),v.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",textAlign:"center",marginTop:6},children:"One-time setup. Works for Gmail, Calendar, and Drive. Encrypted on this machine only."})]})]}),x.length>0&&v.jsxs("div",{children:[v.jsx("div",{style:{fontSize:11,color:"var(--text-dim)",marginBottom:12,lineHeight:1.5},children:"Paste your credentials below. Values are encrypted and stored locally on this machine only."}),x.map($=>v.jsxs("div",{style:{marginBottom:14},children:[v.jsxs("label",{style:Ge.label,children:[$.label||$.key,$.required&&v.jsx("span",{style:{color:"var(--red)",marginLeft:4},children:"*"}),a[$.key]&&v.jsxs("span",{style:{color:"var(--green)",marginLeft:8,fontSize:10,fontWeight:500},children:["✓"," saved"]})]}),v.jsxs("div",{style:{display:"flex",gap:6},children:[v.jsx("input",{type:"password",value:i[$.key]||"",placeholder:$.placeholder||$.key,onChange:R=>n(V=>({...V,[$.key]:R.target.value})),onKeyDown:R=>R.key==="Enter"&&k($.key),style:Ge.input}),v.jsx("button",{onClick:()=>k($.key),disabled:r||!i[$.key],style:{...Ge.saveBtn,opacity:r||!i[$.key]?.4:1},children:"Save"})]})]},$.key))]})]})]})})}function H8({integration:t,installing:e,onInstall:i,onUninstall:n,onConfigure:r,onClose:s}){return t?v.jsx("div",{style:Ge.overlay,onClick:s,children:v.jsxs("div",{style:Ge.container,onClick:a=>a.stopPropagation(),children:[v.jsxs("div",{style:Ge.topBar,children:[v.jsx(U1,{item:t,size:"large"}),v.jsx("button",{onClick:s,style:Ge.closeBtn,children:"×"})]}),v.jsxs("div",{style:Ge.header,children:[v.jsx("div",{style:{...Ge.icon,background:t.installed&&t.configured?"var(--green)":t.installed?"var(--amber)":"var(--accent)"},children:H1[t.icon]||t.name.charAt(0)}),v.jsxs("div",{style:Ge.headerInfo,children:[v.jsx("div",{style:Ge.name,children:t.name}),v.jsxs("div",{style:Ge.meta,children:[v.jsxs("span",{style:Ge.metaItem,children:[Y1[t.category]||""," ",I1[t.category]||t.category]}),v.jsx("span",{style:Ge.metaItem,children:"MCP Server"})]})]})]}),v.jsx("div",{style:Ge.actionBar,children:t.installed?v.jsxs("div",{style:{display:"flex",gap:8,flex:1},children:[v.jsx("button",{onClick:()=>r(t),style:Ge.configureBtn,disabled:(t.envKeys||[]).length===0,children:t.configured?"Reconfigure":"Configure"}),v.jsx("button",{onClick:()=>n(t.id),disabled:e===t.id,style:Ge.uninstallBtn,children:e===t.id?"Removing...":"Uninstall"})]}):v.jsx("button",{onClick:()=>i(t.id),disabled:e===t.id,style:Ge.installBtn,children:e===t.id?"Installing...":"Install"})}),t.installed&&v.jsxs("div",{style:Ge.section,children:[v.jsx("div",{style:Ge.sectionTitle,children:"Status"}),v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",borderRadius:6,background:t.configured?"rgba(74, 225, 104, 0.06)":"rgba(229, 192, 123, 0.06)",border:`1px solid ${t.configured?"var(--green)":"var(--amber)"}`},children:[v.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:t.configured?"var(--green)":"var(--amber)"}}),v.jsx("span",{style:{fontSize:11,color:t.configured?"var(--green)":"var(--amber)"},children:t.configured?"Connected and ready":"Credentials needed"})]})]}),v.jsxs("div",{style:Ge.section,children:[v.jsx("div",{style:Ge.sectionTitle,children:"About"}),v.jsx("div",{style:Ge.description,children:t.description})]}),(t.envKeys||[]).length>0&&v.jsxs("div",{style:Ge.section,children:[v.jsx("div",{style:Ge.sectionTitle,children:"Required Credentials"}),v.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.envKeys.map(a=>v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:11,color:"var(--text-dim)"},children:[v.jsx("code",{style:{fontSize:10,padding:"1px 6px",borderRadius:3,background:"var(--bg-active)",color:"var(--text-primary)",fontFamily:"var(--font)"},children:a.key}),v.jsx("span",{children:a.label}),a.required&&v.jsx("span",{style:{color:"var(--amber)",fontSize:9},children:"required"})]},a.key))})]}),v.jsxs("div",{style:Ge.section,children:[v.jsx("div",{style:Ge.sectionTitle,children:"Tags"}),v.jsxs("div",{style:Ge.tagRow,children:[(t.tags||[]).map(a=>v.jsx("span",{style:Ge.tag,children:a},a)),(t.roles||[]).map(a=>v.jsx("span",{style:Ge.roleTag,children:a},a))]})]}),t.npmPackage&&v.jsxs("div",{style:Ge.section,children:[v.jsx("div",{style:Ge.sectionTitle,children:"Package"}),v.jsx("code",{style:{fontSize:11,padding:"6px 10px",borderRadius:4,background:"var(--bg-active)",color:"var(--text-primary)",display:"block",fontFamily:"var(--font)"},children:t.npmPackage})]})]})}):null}function U8({integrations:t,onSelect:e}){const i=t.filter(n=>n.featured).slice(0,3);return i.length===0?null:v.jsxs("div",{style:je.featuredSection,children:[v.jsx("div",{style:je.featuredLabel,children:"Featured Integrations"}),v.jsx("div",{style:je.featuredRow,children:i.map(n=>v.jsxs("div",{onClick:()=>e(n),style:je.featuredCard,onMouseEnter:r=>{r.currentTarget.style.borderColor="var(--accent)",r.currentTarget.style.transform="translateY(-1px)"},onMouseLeave:r=>{r.currentTarget.style.borderColor="var(--border)",r.currentTarget.style.transform="none"},children:[v.jsx("div",{style:je.featuredGradient,children:v.jsx("div",{style:{...je.featuredIcon,background:n.installed&&n.configured?"var(--green)":n.installed?"var(--amber)":"var(--accent)"},children:H1[n.icon]||n.name.charAt(0)})}),v.jsxs("div",{style:je.featuredInfo,children:[v.jsx("div",{style:je.featuredName,children:n.name}),v.jsx("div",{style:je.featuredAuthorRow,children:v.jsx(U1,{item:n})}),v.jsx("div",{style:je.featuredDesc,children:n.description})]}),n.installed&&n.configured&&v.jsx("div",{style:je.connectedBadge,children:"connected"}),n.installed&&!n.configured&&v.jsx("div",{style:je.setupBadge,children:"needs setup"})]},n.id))})]})}function G8({item:t,onSelect:e,hovered:i,onHover:n}){return v.jsxs("div",{onClick:()=>e(t),onMouseEnter:()=>n(t.id),onMouseLeave:()=>n(null),style:{...je.card,borderColor:t.installed&&t.configured?"var(--green)":t.installed?"var(--amber)":i?"var(--accent)":"var(--border)",background:i?"var(--bg-hover)":"var(--bg-surface)",transform:i?"translateY(-1px)":"none"},children:[v.jsxs("div",{style:je.cardTop,children:[v.jsx("div",{style:{...je.cardIcon,background:t.installed&&t.configured?"var(--green)":t.installed?"var(--amber)":"var(--accent)"},children:H1[t.icon]||t.name.charAt(0)}),v.jsxs("div",{style:je.cardInfo,children:[v.jsx("div",{style:je.cardName,children:t.name}),v.jsx("div",{style:je.cardAuthorRow,children:v.jsx(U1,{item:t})})]}),t.installed&&t.configured&&v.jsx("div",{style:je.connectedBadgeSm,children:"connected"}),t.installed&&!t.configured&&v.jsx("div",{style:je.setupBadgeSm,children:"setup"}),!t.installed&&v.jsx("div",{style:je.freeBadge,children:"MCP"})]}),v.jsx("div",{style:je.cardDesc,children:t.description}),v.jsxs("div",{style:je.cardBottom,children:[v.jsx("div",{style:je.cardStats,children:(t.envKeys||[]).length>0&&v.jsxs("span",{style:je.cardCredCount,children:[t.envKeys.length," credential",t.envKeys.length>1?"s":""]})}),v.jsxs("span",{style:je.catTag,children:[Y1[t.category]||""," ",I1[t.category]||t.category]})]})]})}function F8(){const[t,e]=N.useState([]),[i,n]=N.useState([]),[r,s]=N.useState(""),[a,c]=N.useState("all"),[h,d]=N.useState("popular"),[f,g]=N.useState("browse"),[m,O]=N.useState(!0),[S,_]=N.useState(null),[w,x]=N.useState(null),[Q,k]=N.useState(null),[T,M]=N.useState(null),$=N.useCallback(async()=>{O(!0);try{const E=new URLSearchParams;r&&E.set("search",r),a!=="all"&&E.set("category",a);const P=await(await fetch(`/api/integrations/registry?${E}`)).json();e(P.integrations||[]),n(P.categories||[])}catch{}O(!1)},[r,a]);N.useEffect(()=>{$()},[$]);async function R(E){_(E);try{if(await fetch(`/api/integrations/${E}/install`,{method:"POST"}),await $(),(w==null?void 0:w.id)===E){const X=t.find(P=>P.id===E);X&&x({...X,installed:!0})}}catch{}_(null)}async function V(E){_(E);try{await fetch(`/api/integrations/${E}`,{method:"DELETE"}),await $(),(w==null?void 0:w.id)===E&&x(X=>X?{...X,installed:!1,configured:!1}:null)}catch{}_(null)}function H(E){x(E)}function ee(E){x(null),k(E)}function I(){k(null),$()}const j=t.filter(E=>E.installed),D=c2(f==="installed"?j:t,h);return v.jsxs("div",{style:je.root,children:[v.jsxs("div",{style:je.headerBar,children:[v.jsxs("div",{style:je.headerLeft,children:[v.jsx("div",{style:je.title,children:"Integrations"}),v.jsxs("div",{style:je.headerTabs,children:[v.jsx("button",{onClick:()=>g("browse"),style:{...je.headerTab,color:f==="browse"?"var(--text-bright)":"var(--text-dim)",borderBottom:f==="browse"?"2px solid var(--accent)":"2px solid transparent"},children:"Browse"}),v.jsxs("button",{onClick:()=>g("installed"),style:{...je.headerTab,color:f==="installed"?"var(--text-bright)":"var(--text-dim)",borderBottom:f==="installed"?"2px solid var(--green)":"2px solid transparent"},children:["Installed (",j.length,")"]})]})]}),v.jsx("div",{style:je.headerRight,children:v.jsxs("span",{style:je.headerCount,children:[t.length," integrations"]})})]}),v.jsxs("div",{style:je.toolbar,children:[v.jsxs("div",{style:je.searchRow,children:[v.jsxs("div",{style:je.searchWrap,children:[v.jsx("span",{style:je.searchIcon,children:"⌕"}),v.jsx("input",{style:je.search,placeholder:"Search integrations...",value:r,onChange:E=>s(E.target.value)})]}),v.jsx("div",{style:je.sortWrap,children:V8.map(E=>v.jsx("button",{onClick:()=>d(E.id),style:{...je.sortBtn,color:h===E.id?"var(--text-bright)":"var(--text-muted)",background:h===E.id?"var(--bg-active)":"transparent"},children:E.label},E.id))})]}),f==="browse"&&v.jsxs("div",{style:je.catRow,children:[v.jsx("button",{onClick:()=>c("all"),style:{...je.catBtn,...a==="all"?je.catBtnActive:{}},children:"All"}),i.map(E=>v.jsxs("button",{onClick:()=>c(E.id),style:{...je.catBtn,...a===E.id?je.catBtnActive:{}},children:[Y1[E.id]||""," ",I1[E.id]||E.id," (",E.count,")"]},E.id))]})]}),v.jsxs("div",{style:je.scrollArea,children:[f==="browse"&&!r&&a==="all"&&v.jsx(U8,{integrations:t,onSelect:H}),m&&t.length===0&&v.jsx("div",{style:je.empty,children:"Loading integrations..."}),!m&&D.length===0&&v.jsx("div",{style:je.empty,children:f==="installed"?"No integrations installed yet. Browse to connect your tools.":"No integrations match your search."}),v.jsx("div",{style:je.grid,children:D.map(E=>v.jsx(G8,{item:E,onSelect:H,hovered:T===E.id,onHover:M},E.id))})]}),v.jsx(H8,{integration:w,installing:S,onInstall:R,onUninstall:V,onConfigure:ee,onClose:()=>x(null)}),v.jsx(Y8,{integration:Q,onClose:I})]})}const je={root:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},headerBar:{padding:"12px 20px 0",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},headerLeft:{display:"flex",alignItems:"center",gap:20},title:{fontSize:15,fontWeight:700,color:"var(--text-bright)",letterSpacing:.3},headerTabs:{display:"flex",gap:0},headerTab:{padding:"6px 14px",background:"none",border:"none",fontSize:12,fontWeight:500,fontFamily:"var(--font)",cursor:"pointer",transition:"color 0.1s"},headerRight:{display:"flex",alignItems:"center",gap:10},headerCount:{fontSize:11,color:"var(--text-muted)"},toolbar:{padding:"10px 20px",flexShrink:0},searchRow:{display:"flex",gap:10,alignItems:"center"},searchWrap:{flex:1,position:"relative"},searchIcon:{position:"absolute",left:10,top:"50%",transform:"translateY(-50%)",color:"var(--text-muted)",fontSize:13,pointerEvents:"none"},search:{width:"100%",padding:"7px 12px 7px 30px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:6,color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font)",outline:"none"},sortWrap:{display:"flex",gap:2},sortBtn:{padding:"5px 10px",background:"transparent",border:"1px solid transparent",borderRadius:4,fontSize:10,fontWeight:500,fontFamily:"var(--font)",cursor:"pointer",transition:"all 0.1s"},catRow:{display:"flex",gap:4,marginTop:8,flexWrap:"wrap"},catBtn:{padding:"4px 12px",background:"transparent",border:"1px solid var(--border)",borderRadius:14,color:"var(--text-dim)",fontSize:10,fontFamily:"var(--font)",cursor:"pointer",transition:"all 0.1s"},catBtnActive:{borderColor:"var(--accent)",color:"var(--accent)",background:"rgba(51, 175, 188, 0.08)"},scrollArea:{flex:1,overflowY:"auto",padding:"4px 20px 20px"},featuredSection:{marginBottom:16},featuredLabel:{fontSize:11,fontWeight:700,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:1,marginBottom:8},featuredRow:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:8},featuredCard:{padding:"14px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:8,cursor:"pointer",transition:"border-color 0.15s, transform 0.15s",position:"relative",overflow:"hidden"},featuredGradient:{display:"flex",alignItems:"center",marginBottom:10},featuredIcon:{width:40,height:40,borderRadius:10,display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,fontWeight:700,color:"var(--bg-base)"},featuredInfo:{flex:1},featuredName:{fontSize:13,fontWeight:700,color:"var(--text-bright)"},featuredAuthorRow:{display:"flex",alignItems:"center",gap:6,marginTop:2},featuredDesc:{fontSize:10,color:"var(--text-dim)",marginTop:6,lineHeight:1.45,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},connectedBadge:{position:"absolute",top:8,right:8,fontSize:8,fontWeight:600,color:"var(--green)",border:"1px solid var(--green)",borderRadius:3,padding:"1px 5px",textTransform:"uppercase",letterSpacing:.5},setupBadge:{position:"absolute",top:8,right:8,fontSize:8,fontWeight:600,color:"var(--amber)",border:"1px solid var(--amber)",borderRadius:3,padding:"1px 5px",textTransform:"uppercase",letterSpacing:.5},grid:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:8},empty:{padding:"60px 0",textAlign:"center",color:"var(--text-dim)",fontSize:12,gridColumn:"1 / -1"},card:{padding:"14px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:8,cursor:"pointer",transition:"border-color 0.12s, background 0.12s, transform 0.12s",display:"flex",flexDirection:"column"},cardTop:{display:"flex",alignItems:"center",gap:10},cardIcon:{width:36,height:36,borderRadius:8,display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:700,color:"var(--bg-base)",flexShrink:0},cardInfo:{flex:1,minWidth:0},cardName:{fontSize:12,fontWeight:600,color:"var(--text-bright)"},cardAuthorRow:{display:"flex",alignItems:"center",gap:6,marginTop:2},connectedBadgeSm:{fontSize:8,fontWeight:600,color:"var(--green)",border:"1px solid var(--green)",borderRadius:3,padding:"1px 6px",textTransform:"uppercase",letterSpacing:.5,flexShrink:0},setupBadgeSm:{fontSize:8,fontWeight:600,color:"var(--amber)",border:"1px solid var(--amber)",borderRadius:3,padding:"1px 6px",textTransform:"uppercase",letterSpacing:.5,flexShrink:0},freeBadge:{fontSize:9,fontWeight:500,color:"var(--text-muted)",flexShrink:0},cardDesc:{fontSize:11,color:"var(--text-dim)",marginTop:10,lineHeight:1.5,flex:1,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},cardBottom:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:10,paddingTop:8,borderTop:"1px solid var(--border)"},cardStats:{display:"flex",gap:10},cardCredCount:{fontSize:10,color:"var(--text-muted)"},catTag:{fontSize:9,padding:"2px 8px",borderRadius:4,background:"var(--bg-active)",color:"var(--text-dim)",fontWeight:500}},Ge={overlay:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,backdropFilter:"blur(2px)"},container:{width:"90%",maxWidth:520,maxHeight:"85vh",background:"var(--bg-chrome)",border:"1px solid var(--border)",borderRadius:10,overflowY:"auto",padding:"0 24px 24px",position:"relative"},topBar:{position:"sticky",top:0,background:"var(--bg-chrome)",padding:"16px 0 8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:1},closeBtn:{background:"none",border:"none",color:"var(--text-muted)",fontSize:20,cursor:"pointer",padding:"2px 6px",fontFamily:"var(--font)"},header:{display:"flex",gap:14,alignItems:"flex-start",marginBottom:16},icon:{width:52,height:52,borderRadius:12,display:"flex",alignItems:"center",justifyContent:"center",fontSize:20,fontWeight:700,color:"var(--bg-base)",flexShrink:0},headerInfo:{flex:1},name:{fontSize:17,fontWeight:700,color:"var(--text-bright)"},meta:{display:"flex",gap:10,marginTop:6,flexWrap:"wrap"},metaItem:{fontSize:11,color:"var(--text-dim)"},actionBar:{display:"flex",alignItems:"center",gap:8,padding:"12px 0",borderTop:"1px solid var(--border)",borderBottom:"1px solid var(--border)",marginBottom:16},installBtn:{flex:1,padding:"8px 16px",background:"var(--accent)",color:"var(--bg-base)",border:"none",borderRadius:6,fontSize:12,fontWeight:600,cursor:"pointer",fontFamily:"var(--font)"},configureBtn:{flex:1,padding:"8px 16px",background:"var(--bg-active)",color:"var(--text-bright)",border:"1px solid var(--border)",borderRadius:6,fontSize:12,fontWeight:600,cursor:"pointer",fontFamily:"var(--font)"},uninstallBtn:{padding:"8px 16px",background:"transparent",color:"var(--red)",border:"1px solid var(--red)",borderRadius:6,fontSize:12,fontWeight:500,cursor:"pointer",fontFamily:"var(--font)"},section:{marginBottom:16},sectionTitle:{fontSize:11,fontWeight:700,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:.5,marginBottom:8},description:{fontSize:12,color:"var(--text-primary)",lineHeight:1.6},tagRow:{display:"flex",gap:4,flexWrap:"wrap"},tag:{fontSize:10,padding:"2px 8px",borderRadius:4,background:"var(--bg-active)",color:"var(--text-dim)"},roleTag:{fontSize:10,padding:"2px 8px",borderRadius:4,background:"rgba(51, 175, 188, 0.08)",color:"var(--accent)",border:"1px solid rgba(51, 175, 188, 0.2)"},label:{display:"block",fontSize:11,fontWeight:600,color:"var(--text-primary)",marginBottom:4},input:{flex:1,padding:"7px 10px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:5,color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font)",outline:"none"},saveBtn:{padding:"7px 14px",background:"var(--accent)",color:"var(--bg-base)",border:"none",borderRadius:5,fontSize:11,fontWeight:600,cursor:"pointer",fontFamily:"var(--font)"}},K8=[{label:"Every 5 min",cron:"*/5 * * * *"},{label:"Every 15 min",cron:"*/15 * * * *"},{label:"Every hour",cron:"0 * * * *"},{label:"Every 6 hours",cron:"0 */6 * * *"},{label:"Daily 9 AM",cron:"0 9 * * *"},{label:"Weekdays 9 AM",cron:"0 9 * * 1-5"},{label:"Weekly (Mon)",cron:"0 0 * * 1"},{label:"Monthly",cron:"0 0 1 * *"}],J8=[{id:"backend",label:"Backend"},{id:"frontend",label:"Frontend"},{id:"fullstack",label:"Fullstack"},{id:"testing",label:"Testing"},{id:"devops",label:"DevOps"},{id:"docs",label:"Docs"},{id:"cmo",label:"CMO"},{id:"cfo",label:"CFO"},{id:"ea",label:"EA"},{id:"support",label:"Support"},{id:"analyst",label:"Analyst"}];function PE(t){if(!t)return"never";const e=Date.now()-new Date(t).getTime();return e<6e4?"just now":e<36e5?`${Math.floor(e/6e4)}m ago`:e<864e5?`${Math.floor(e/36e5)}h ago`:`${Math.floor(e/864e5)}d ago`}function EE({status:t}){const e={spawned:"var(--green)",skipped:"var(--amber)",error:"var(--red)"};return v.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:e[t]||"var(--text-muted)",display:"inline-block",marginRight:6}})}function eZ({onSubmit:t,onCancel:e}){const[i,n]=N.useState(""),[r,s]=N.useState("0 9 * * *"),[a,c]=N.useState("fullstack"),[h,d]=N.useState(""),[f,g]=N.useState(!1),[m,O]=N.useState("");async function S(_){if(_.preventDefault(),!i.trim()){O("Name is required");return}if(!h.trim()){O("Task prompt is required");return}g(!0),O("");try{await t({name:i.trim(),cron:r,agentConfig:{role:a,prompt:h.trim()}})}catch(w){O(w.message)}g(!1)}return v.jsxs("form",{onSubmit:S,style:Pe.form,children:[v.jsx("div",{style:Pe.formTitle,children:"New Schedule"}),v.jsx("label",{style:Pe.label,children:"NAME"}),v.jsx("input",{value:i,onChange:_=>n(_.target.value),placeholder:"e.g., Daily standup summary",style:Pe.input}),v.jsx("label",{style:Pe.label,children:"FREQUENCY"}),v.jsx("div",{style:Pe.presetRow,children:K8.map(_=>v.jsx("button",{type:"button",onClick:()=>s(_.cron),style:{...Pe.presetBtn,borderColor:r===_.cron?"var(--accent)":"var(--border)",color:r===_.cron?"var(--accent)":"var(--text-dim)",background:r===_.cron?"rgba(51, 175, 188, 0.08)":"transparent"},children:_.label},_.cron))}),v.jsx("input",{value:r,onChange:_=>s(_.target.value),placeholder:"* * * * * (min hr day mon wkday)",style:{...Pe.input,fontFamily:"var(--font)",fontSize:11}}),v.jsx("label",{style:Pe.label,children:"AGENT ROLE"}),v.jsx("div",{style:Pe.presetRow,children:J8.map(_=>v.jsx("button",{type:"button",onClick:()=>c(_.id),style:{...Pe.presetBtn,borderColor:a===_.id?"var(--accent)":"var(--border)",color:a===_.id?"var(--accent)":"var(--text-dim)",background:a===_.id?"rgba(51, 175, 188, 0.08)":"transparent"},children:_.label},_.id))}),v.jsx("label",{style:Pe.label,children:"TASK"}),v.jsx("textarea",{value:h,onChange:_=>d(_.target.value),placeholder:"What should this agent do each time it runs?",rows:3,style:Pe.textarea}),m&&v.jsx("div",{style:Pe.error,children:m}),v.jsxs("div",{style:Pe.formActions,children:[v.jsx("button",{type:"button",onClick:e,style:Pe.cancelBtn,children:"Cancel"}),v.jsx("button",{type:"submit",disabled:f,style:Pe.submitBtn,children:f?"Creating...":"Create Schedule"})]})]})}function tZ({schedule:t,onToggle:e,onRun:i,onDelete:n,onSelect:r}){var c;const[s,a]=N.useState(!1);return v.jsxs("div",{style:Pe.scheduleRow,onMouseEnter:h=>{h.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:h=>{h.currentTarget.style.background="var(--bg-surface)"},children:[v.jsxs("div",{style:Pe.scheduleMain,onClick:()=>r(t),children:[v.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:t.enabled?t.isRunning?"var(--green)":"var(--accent)":"var(--text-muted)",flexShrink:0,animation:t.isRunning?"pulse 2s infinite":"none"}}),v.jsxs("div",{style:{flex:1,minWidth:0},children:[v.jsx("div",{style:Pe.scheduleName,children:t.name}),v.jsxs("div",{style:Pe.scheduleMeta,children:[v.jsx("span",{children:t.cronDescription||t.cron}),v.jsx("span",{style:{color:"var(--text-muted)"},children:(c=t.agentConfig)==null?void 0:c.role}),t.lastRun&&v.jsxs("span",{style:{color:"var(--text-muted)"},children:[v.jsx(EE,{status:t.lastRun.status}),PE(t.lastRun.timestamp)]})]})]})]}),v.jsxs("div",{style:Pe.scheduleActions,children:[v.jsx("button",{onClick:()=>e(t.id,!t.enabled),title:t.enabled?"Disable":"Enable",style:{...Pe.actionBtn,color:t.enabled?"var(--green)":"var(--text-muted)"},children:t.enabled?"ON":"OFF"}),v.jsx("button",{onClick:()=>i(t.id),title:"Run now",style:{...Pe.actionBtn,color:"var(--accent)"},children:"▶"}),s?v.jsx("button",{onClick:()=>{n(t.id),a(!1)},style:{...Pe.actionBtn,color:"var(--red)"},children:"confirm"}):v.jsx("button",{onClick:()=>a(!0),style:{...Pe.actionBtn,color:"var(--text-muted)"},children:"✕"})]})]})}function iZ({schedule:t,onClose:e}){var i,n;return t?v.jsxs("div",{style:Pe.detailPanel,children:[v.jsxs("div",{style:Pe.detailHeader,children:[v.jsx("div",{style:Pe.detailTitle,children:t.name}),v.jsx("button",{onClick:e,style:Pe.detailClose,children:"×"})]}),v.jsxs("div",{style:Pe.detailGrid,children:[v.jsx("div",{style:Pe.detailLabel,children:"Cron"}),v.jsx("div",{style:Pe.detailValue,children:t.cron}),v.jsx("div",{style:Pe.detailLabel,children:"Description"}),v.jsx("div",{style:Pe.detailValue,children:t.cronDescription}),v.jsx("div",{style:Pe.detailLabel,children:"Role"}),v.jsx("div",{style:Pe.detailValue,children:(i=t.agentConfig)==null?void 0:i.role}),v.jsx("div",{style:Pe.detailLabel,children:"Status"}),v.jsx("div",{style:Pe.detailValue,children:v.jsx("span",{style:{color:t.enabled?"var(--green)":"var(--text-muted)"},children:t.enabled?"Enabled":"Disabled"})}),v.jsx("div",{style:Pe.detailLabel,children:"Created"}),v.jsx("div",{style:Pe.detailValue,children:new Date(t.createdAt).toLocaleString()})]}),((n=t.agentConfig)==null?void 0:n.prompt)&&v.jsxs("div",{style:{marginTop:16},children:[v.jsx("div",{style:Pe.detailLabel,children:"Task Prompt"}),v.jsx("pre",{style:Pe.promptPre,children:t.agentConfig.prompt})]}),(t.history||[]).length>0&&v.jsxs("div",{style:{marginTop:16},children:[v.jsx("div",{style:{...Pe.detailLabel,marginBottom:8},children:"Execution History"}),v.jsx("div",{style:Pe.historyList,children:t.history.slice(0,20).map((r,s)=>v.jsxs("div",{style:Pe.historyEntry,children:[v.jsx(EE,{status:r.status}),v.jsxs("span",{style:{fontSize:10,color:"var(--text-dim)",flex:1},children:[r.status,r.agentId&&v.jsxs("span",{style:{color:"var(--text-muted)"},children:[" (",r.agentId,")"]})]}),v.jsx("span",{style:{fontSize:9,color:"var(--text-muted)"},children:PE(r.timestamp)})]},s))})]})]}):null}function nZ(){const[t,e]=N.useState([]),[i,n]=N.useState(!0),[r,s]=N.useState(!1),[a,c]=N.useState(null),[h,d]=N.useState(""),f=N.useCallback(async()=>{try{const x=await fetch("/api/schedules");e(await x.json())}catch{}n(!1)},[]);N.useEffect(()=>{f();const x=setInterval(f,1e4);return()=>clearInterval(x)},[f]);async function g(x){const Q=await fetch("/api/schedules",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)});if(!Q.ok){const k=await Q.json();throw new Error(k.error||"Failed to create schedule")}s(!1),await f(),w("Schedule created")}async function m(x,Q){await fetch(`/api/schedules/${x}/${Q?"enable":"disable"}`,{method:"POST"}),await f()}async function O(x){try{await fetch(`/api/schedules/${x}/run`,{method:"POST"}),w("Agent spawned"),await f()}catch{w("Failed to run")}}async function S(x){await fetch(`/api/schedules/${x}`,{method:"DELETE"}),(a==null?void 0:a.id)===x&&c(null),await f(),w("Schedule deleted")}async function _(x){try{const Q=await fetch(`/api/schedules/${x.id}`);c(await Q.json())}catch{c(x)}}function w(x){d(x),setTimeout(()=>d(""),3e3)}return v.jsxs("div",{style:Pe.root,children:[v.jsxs("div",{style:Pe.headerBar,children:[v.jsxs("div",{style:Pe.headerLeft,children:[v.jsx("div",{style:Pe.title,children:"Schedules"}),v.jsxs("span",{style:Pe.headerCount,children:[t.length," schedule",t.length!==1?"s":""," • ",t.filter(x=>x.enabled).length," active"]})]}),v.jsx("button",{onClick:()=>{s(!0),c(null)},style:Pe.createBtn,children:"+ New Schedule"})]}),h&&v.jsx("div",{style:Pe.statusMsg,children:h}),v.jsxs("div",{style:Pe.mainRow,children:[v.jsxs("div",{style:Pe.listArea,children:[r&&v.jsx(eZ,{onSubmit:g,onCancel:()=>s(!1)}),i&&t.length===0&&v.jsx("div",{style:Pe.empty,children:"Loading schedules..."}),!i&&t.length===0&&!r&&v.jsxs("div",{style:Pe.empty,children:[v.jsx("div",{style:{fontSize:13,marginBottom:8},children:"No schedules yet"}),v.jsx("div",{style:{fontSize:11,color:"var(--text-muted)"},children:"Create a schedule to run agents on a recurring basis — daily standups, weekly reports, monitoring checks."})]}),t.map(x=>v.jsx(tZ,{schedule:x,onToggle:m,onRun:O,onDelete:S,onSelect:_},x.id))]}),a&&v.jsx(iZ,{schedule:a,onClose:()=>c(null)})]})]})}const Pe={root:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},headerBar:{padding:"12px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},headerLeft:{display:"flex",alignItems:"center",gap:12},title:{fontSize:15,fontWeight:700,color:"var(--text-bright)",letterSpacing:.3},headerCount:{fontSize:11,color:"var(--text-muted)"},createBtn:{padding:"6px 14px",background:"var(--accent)",color:"var(--bg-base)",border:"none",borderRadius:6,fontSize:11,fontWeight:600,cursor:"pointer",fontFamily:"var(--font)"},statusMsg:{padding:"4px 20px",fontSize:10,color:"var(--green)",flexShrink:0},mainRow:{flex:1,display:"flex",overflow:"hidden"},listArea:{flex:1,overflowY:"auto",padding:"0 20px 20px"},empty:{padding:"60px 20px",textAlign:"center",color:"var(--text-dim)",fontSize:12},scheduleRow:{display:"flex",alignItems:"center",padding:"10px 12px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:6,marginBottom:4,cursor:"pointer",transition:"background 0.1s"},scheduleMain:{display:"flex",alignItems:"center",gap:10,flex:1,minWidth:0},scheduleName:{fontSize:12,fontWeight:600,color:"var(--text-bright)"},scheduleMeta:{display:"flex",gap:10,fontSize:10,color:"var(--text-dim)",marginTop:2},scheduleActions:{display:"flex",gap:4,flexShrink:0},actionBtn:{padding:"3px 8px",background:"transparent",border:"1px solid var(--border)",borderRadius:4,fontSize:9,fontWeight:600,fontFamily:"var(--font)",cursor:"pointer"},form:{padding:"16px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:8,marginBottom:12},formTitle:{fontSize:13,fontWeight:700,color:"var(--text-bright)",marginBottom:12},label:{display:"block",fontSize:9,fontWeight:700,color:"var(--text-muted)",letterSpacing:.5,textTransform:"uppercase",marginTop:10,marginBottom:4},input:{width:"100%",padding:"7px 10px",background:"var(--bg-base)",border:"1px solid var(--border)",borderRadius:5,color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font)",outline:"none",boxSizing:"border-box"},textarea:{width:"100%",padding:"7px 10px",background:"var(--bg-base)",border:"1px solid var(--border)",borderRadius:5,color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font)",outline:"none",resize:"vertical",boxSizing:"border-box"},presetRow:{display:"flex",gap:4,flexWrap:"wrap",marginBottom:6},presetBtn:{padding:"3px 10px",background:"transparent",border:"1px solid var(--border)",borderRadius:10,fontSize:10,fontWeight:500,fontFamily:"var(--font)",cursor:"pointer",transition:"all 0.1s"},error:{fontSize:11,color:"var(--red)",marginTop:8},formActions:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:14},cancelBtn:{padding:"6px 14px",background:"transparent",color:"var(--text-dim)",border:"1px solid var(--border)",borderRadius:5,fontSize:11,fontWeight:500,cursor:"pointer",fontFamily:"var(--font)"},submitBtn:{padding:"6px 14px",background:"var(--accent)",color:"var(--bg-base)",border:"none",borderRadius:5,fontSize:11,fontWeight:600,cursor:"pointer",fontFamily:"var(--font)"},detailPanel:{width:320,flexShrink:0,borderLeft:"1px solid var(--border)",padding:"16px",overflowY:"auto"},detailHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},detailTitle:{fontSize:14,fontWeight:700,color:"var(--text-bright)"},detailClose:{background:"none",border:"none",color:"var(--text-muted)",fontSize:18,cursor:"pointer",fontFamily:"var(--font)"},detailGrid:{display:"grid",gridTemplateColumns:"80px 1fr",gap:"6px 10px"},detailLabel:{fontSize:10,fontWeight:600,color:"var(--text-muted)",textTransform:"uppercase"},detailValue:{fontSize:11,color:"var(--text-primary)"},promptPre:{fontSize:11,color:"var(--text-primary)",lineHeight:1.5,padding:"8px 10px",background:"var(--bg-base)",border:"1px solid var(--border)",borderRadius:4,whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"var(--font)",maxHeight:200,overflowY:"auto",marginTop:4},historyList:{display:"flex",flexDirection:"column",gap:4},historyEntry:{display:"flex",alignItems:"center",gap:4,padding:"4px 8px",borderRadius:4,background:"var(--bg-base)"}},h2={javascript:"#e5c07b",typescript:"#61afef",css:"#c678dd",html:"#e06c75",json:"#4ae168",markdown:"#c678dd",python:"#61afef",rust:"#e06c75",go:"#33afbc",shell:"#4ae168",text:"#abb2bf"};function RE({entry:t,depth:e,activeFile:i,expandedDirs:n,onToggleDir:r,onFileClick:s,onContextMenu:a,renamingPath:c,renameValue:h,onRenameChange:d,onRenameSubmit:f,onRenameCancel:g}){const m=t.type==="dir",O=n.has(t.path),S=!m&&t.path===i,_=c===t.path,x=Ce(Q=>Q.editorTreeCache)[t.path]||[];return v.jsxs(v.Fragment,{children:[v.jsxs("div",{onClick:()=>m?r(t.path,t.hasChildren):s(t.path),onContextMenu:Q=>a(Q,t),style:{...Ht.row,paddingLeft:12+e*16,background:S?"var(--bg-active)":"transparent",borderLeft:S?"2px solid var(--accent)":"2px solid transparent"},children:[m?v.jsx("span",{style:Ht.arrow,children:O?"▾":"▸"}):v.jsx("span",{style:{...Ht.fileDot,background:h2[t.language]||h2.text}}),_?v.jsx("input",{autoFocus:!0,value:h,onChange:Q=>d(Q.target.value),onKeyDown:Q=>{Q.key==="Enter"&&f(),Q.key==="Escape"&&g()},onBlur:g,onClick:Q=>Q.stopPropagation(),style:Ht.renameInput}):v.jsx("span",{style:{...Ht.name,color:m?"var(--text-primary)":S?"var(--text-bright)":"var(--text-primary)",fontWeight:m?600:400},children:t.name}),!m&&!_&&t.size>0&&v.jsx("span",{style:Ht.size,children:rZ(t.size)})]}),m&&O&&x.map(Q=>v.jsx(RE,{entry:Q,depth:e+1,activeFile:i,expandedDirs:n,onToggleDir:r,onFileClick:s,onContextMenu:a,renamingPath:c,renameValue:h,onRenameChange:d,onRenameSubmit:f,onRenameCancel:g},Q.path))]})}function rZ(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(0)}K`:`${(t/(1024*1024)).toFixed(1)}M`}function sZ({x:t,y:e,entry:i,onClose:n,onAction:r}){const s=N.useRef(null);N.useEffect(()=>{const h=d=>{s.current&&!s.current.contains(d.target)&&n()};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[n]);const a=(i==null?void 0:i.type)==="dir",c=[{label:"New File",action:a?"newFileIn":"newFileSibling"},{label:"New Folder",action:a?"newDirIn":"newDirSibling"},{sep:!0},{label:"Rename",action:"rename"},{label:"Delete",action:"delete",danger:!0}];return v.jsx("div",{ref:s,style:{...Ht.contextMenu,left:t,top:e},children:c.map((h,d)=>h.sep?v.jsx("div",{style:Ht.contextSep},d):v.jsx("div",{onClick:()=>{r(h.action,i),n()},style:{...Ht.contextItem,color:h.danger?"var(--red)":"var(--text-primary)"},children:h.label},h.action))})}function u2({placeholder:t,onSubmit:e,onCancel:i,depth:n}){const[r,s]=N.useState("");return v.jsx("div",{style:{...Ht.row,paddingLeft:12+(n||0)*16},children:v.jsx("input",{autoFocus:!0,placeholder:t,value:r,onChange:a=>s(a.target.value),onKeyDown:a=>{a.key==="Enter"&&r.trim()&&e(r.trim()),a.key==="Escape"&&i()},onBlur:i,style:Ht.renameInput})})}function oZ(){const t=Ce(j=>j.editorTreeCache),e=Ce(j=>j.editorActiveFile),i=Ce(j=>j.fetchTreeDir),n=Ce(j=>j.openFile),r=Ce(j=>j.createFile),s=Ce(j=>j.createDir),a=Ce(j=>j.deleteFile),c=Ce(j=>j.renameFile),[h,d]=N.useState(new Set([""])),[f,g]=N.useState(""),[m,O]=N.useState(null),[S,_]=N.useState(null),[w,x]=N.useState(null),[Q,k]=N.useState("");N.useEffect(()=>{i("")},[i]);const T=N.useCallback((j,D)=>{d(E=>{const X=new Set(E);return X.has(j)?X.delete(j):(X.add(j),(D||!t[j])&&i(j)),X})},[i,t]),M=N.useCallback((j,D)=>{j.preventDefault(),j.stopPropagation(),O({x:j.clientX,y:j.clientY,entry:D})},[]),$=N.useCallback(async(j,D)=>{const E=D.path.includes("/")?D.path.split("/").slice(0,-1).join("/"):"";switch(j){case"newFileIn":_({type:"file",parentPath:D.path}),d(X=>{const P=new Set(X);return P.add(D.path),t[D.path]||i(D.path),P});break;case"newDirIn":_({type:"dir",parentPath:D.path}),d(X=>{const P=new Set(X);return P.add(D.path),t[D.path]||i(D.path),P});break;case"newFileSibling":_({type:"file",parentPath:E});break;case"newDirSibling":_({type:"dir",parentPath:E});break;case"rename":x(D.path),k(D.name);break;case"delete":confirm(`Delete "${D.name}"?`)&&await a(D.path);break}},[a,i,t]),R=N.useCallback(async j=>{if(!S)return;const D=S.parentPath?`${S.parentPath}/${j}`:j,E=S.type==="file"?await r(D):await s(D);_(null),E&&S.type==="file"&&n(D)},[S,r,s,n]),V=N.useCallback(async()=>{if(!w||!Q.trim()){x(null);return}const j=w.includes("/")?w.split("/").slice(0,-1).join("/"):"",D=j?`${j}/${Q.trim()}`:Q.trim();D!==w&&await c(w,D),x(null)},[w,Q,c]),H=N.useCallback(j=>{j.target===j.currentTarget&&(j.preventDefault(),O({x:j.clientX,y:j.clientY,entry:{type:"dir",path:"",name:"root"}}))},[]),ee=t[""]||[],I=f?ee.filter(j=>j.name.toLowerCase().includes(f.toLowerCase())):ee;return S&&(S.parentPath===""||S.parentPath.split("/").length),v.jsxs("div",{style:Ht.container,children:[v.jsxs("div",{style:Ht.toolbar,children:[v.jsx("span",{style:Ht.toolbarTitle,children:"FILES"}),v.jsxs("div",{style:Ht.toolbarActions,children:[v.jsx("button",{onClick:()=>_({type:"file",parentPath:""}),title:"New File",style:Ht.toolbarBtn,children:v.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.3",children:[v.jsx("path",{d:"M3 1.5h6l4 4V14a.5.5 0 01-.5.5h-9A.5.5 0 013 14V2a.5.5 0 01.5-.5z"}),v.jsx("path",{d:"M9 1.5V5.5h4"}),v.jsx("path",{d:"M8 8.5v4M6 10.5h4",strokeLinecap:"round"})]})}),v.jsx("button",{onClick:()=>_({type:"dir",parentPath:""}),title:"New Folder",style:Ht.toolbarBtn,children:v.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.3",children:[v.jsx("path",{d:"M1.5 3.5h4l1.5 1.5H14a.5.5 0 01.5.5v8a.5.5 0 01-.5.5H2a.5.5 0 01-.5-.5V4z"}),v.jsx("path",{d:"M8 8v3M6.5 9.5h3",strokeLinecap:"round"})]})})]})]}),v.jsx("div",{style:Ht.searchWrap,children:v.jsx("input",{type:"text",placeholder:"Filter...",value:f,onChange:j=>g(j.target.value),style:Ht.searchInput})}),v.jsxs("div",{style:Ht.tree,onContextMenu:H,children:[I.length===0&&!S&&v.jsx("div",{style:Ht.empty,children:ee.length===0?"Loading...":"No matches"}),S&&S.parentPath===""&&v.jsx(u2,{placeholder:S.type==="file"?"filename.ext":"folder-name",onSubmit:R,onCancel:()=>_(null),depth:0}),I.map(j=>v.jsxs(Ul.Fragment,{children:[v.jsx(RE,{entry:j,depth:0,activeFile:e,expandedDirs:h,onToggleDir:T,onFileClick:n,onContextMenu:M,renamingPath:w,renameValue:Q,onRenameChange:k,onRenameSubmit:V,onRenameCancel:()=>x(null)}),S&&S.parentPath===j.path&&h.has(j.path)&&v.jsx(u2,{placeholder:S.type==="file"?"filename.ext":"folder-name",onSubmit:R,onCancel:()=>_(null),depth:1})]},j.path))]}),m&&v.jsx(sZ,{x:m.x,y:m.y,entry:m.entry,onClose:()=>O(null),onAction:$})]})}const Ht={container:{display:"flex",flexDirection:"column",height:"100%",background:"var(--bg-chrome)",position:"relative"},toolbar:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 10px",borderBottom:"1px solid var(--border)"},toolbarTitle:{fontSize:10,fontWeight:700,letterSpacing:1,color:"var(--text-dim)",textTransform:"uppercase"},toolbarActions:{display:"flex",gap:2},toolbarBtn:{background:"none",border:"none",color:"var(--text-dim)",fontSize:11,fontWeight:600,cursor:"pointer",fontFamily:"var(--font)",padding:"2px 5px",borderRadius:3,lineHeight:1},searchWrap:{padding:"6px 8px",borderBottom:"1px solid var(--border)"},searchInput:{width:"100%",padding:"5px 8px",background:"var(--bg-base)",border:"1px solid var(--border)",borderRadius:3,color:"var(--text-primary)",fontSize:11,fontFamily:"var(--font)",outline:"none"},tree:{flex:1,overflowY:"auto",overflowX:"hidden"},row:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",cursor:"pointer",transition:"background 0.08s",whiteSpace:"nowrap"},arrow:{fontSize:10,color:"var(--text-muted)",width:10,flexShrink:0,textAlign:"center"},fileDot:{width:6,height:6,borderRadius:"50%",flexShrink:0},name:{fontSize:12,overflow:"hidden",textOverflow:"ellipsis",flex:1,minWidth:0},size:{fontSize:9,color:"var(--text-muted)",flexShrink:0},empty:{padding:16,textAlign:"center",fontSize:11,color:"var(--text-dim)"},renameInput:{flex:1,padding:"2px 6px",background:"var(--bg-base)",border:"1px solid var(--accent)",borderRadius:2,color:"var(--text-bright)",fontSize:12,fontFamily:"var(--font)",outline:"none",minWidth:0},contextMenu:{position:"fixed",zIndex:300,background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:4,padding:"4px 0",minWidth:160,boxShadow:"0 8px 24px rgba(0,0,0,0.4)",fontFamily:"var(--font)"},contextItem:{padding:"6px 14px",fontSize:11,cursor:"pointer",transition:"background 0.08s"},contextSep:{height:1,background:"var(--border)",margin:"4px 0"}};function aZ(){const t=Ce(s=>s.editorOpenTabs),e=Ce(s=>s.editorActiveFile),i=Ce(s=>s.editorFiles),n=Ce(s=>s.setActiveFile),r=Ce(s=>s.closeFile);return t.length===0?null:v.jsx("div",{style:Bh.container,children:t.map(s=>{const a=i[s],c=s===e,h=a&&a.content!==a.originalContent,d=s.split("/").pop();return v.jsxs("div",{onClick:()=>n(s),title:s,style:{...Bh.tab,color:c?"var(--text-bright)":"var(--text-primary)",borderBottom:c?"1px solid var(--accent)":"1px solid transparent",background:c?"var(--bg-base)":"transparent"},children:[h&&v.jsx("span",{style:Bh.dirtyDot}),v.jsx("span",{style:Bh.tabName,children:d}),v.jsx("button",{onClick:f=>{f.stopPropagation(),r(s)},style:Bh.closeBtn,children:"x"})]},s)})})}const Bh={container:{display:"flex",alignItems:"center",height:32,flexShrink:0,background:"var(--bg-chrome)",borderBottom:"1px solid var(--border)",overflowX:"auto",overflowY:"hidden"},tab:{display:"flex",alignItems:"center",gap:5,padding:"0 12px",height:"100%",cursor:"pointer",whiteSpace:"nowrap",fontSize:11,fontFamily:"var(--font)",transition:"background 0.08s",borderRight:"1px solid rgba(75, 82, 99, 0.4)",flexShrink:0},tabName:{overflow:"hidden",textOverflow:"ellipsis",maxWidth:140},dirtyDot:{width:6,height:6,borderRadius:"50%",background:"var(--amber)",flexShrink:0},closeBtn:{background:"none",border:"none",color:"var(--text-muted)",fontSize:10,cursor:"pointer",fontFamily:"var(--font)",padding:"0 2px",lineHeight:1,opacity:.6}};let By=[],AE=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,i=0;e<t.length;e++)(e%2?AE:By).push(i=i+t[e])})();function lZ(t){if(t<768)return!1;for(let e=0,i=By.length;;){let n=e+i>>1;if(t<By[n])i=n;else if(t>=AE[n])e=n+1;else return!0;if(e==i)return!1}}function d2(t){return t>=127462&&t<=127487}const f2=8205;function cZ(t,e,i=!0,n=!0){return(i?ME:hZ)(t,e,n)}function ME(t,e,i){if(e==t.length)return e;e&&zE(t.charCodeAt(e))&&jE(t.charCodeAt(e-1))&&e--;let n=mv(t,e);for(e+=p2(n);e<t.length;){let r=mv(t,e);if(n==f2||r==f2||i&&lZ(r))e+=p2(r),n=r;else if(d2(r)){let s=0,a=e-2;for(;a>=0&&d2(mv(t,a));)s++,a-=2;if(s%2==0)break;e+=2}else break}return e}function hZ(t,e,i){for(;e>0;){let n=ME(t,e-2,i);if(n<e)return n;e--}return 0}function mv(t,e){let i=t.charCodeAt(e);if(!jE(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return zE(n)?(i-55296<<10)+(n-56320)+65536:i}function zE(t){return t>=56320&&t<57344}function jE(t){return t>=55296&&t<56320}function p2(t){return t<65536?1:2}let dt=class DE{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,i,n){[e,i]=_c(this,e,i);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(i,this.length,r,1),Br.from(r,this.length-(i-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,i=this.length){[e,i]=_c(this,e,i);let n=[];return this.decompose(e,i,n,0),Br.from(n,i-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let i=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new uu(this),s=new uu(e);for(let a=i,c=i;;){if(r.next(a),s.next(a),a=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(c+=r.value.length,r.done||c>=n)return!0}}iter(e=1){return new uu(this,e)}iterRange(e,i=this.length){return new BE(this,e,i)}iterLines(e,i){let n;if(e==null)n=this.iter();else{i==null&&(i=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,i==this.lines+1?this.length:i<=1?0:this.line(i-1).to))}return new LE(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?DE.empty:e.length<=32?new Ut(e):Br.from(Ut.split(e,[]))}};class Ut extends dt{constructor(e,i=uZ(e)){super(),this.text=e,this.length=i}get lines(){return this.text.length}get children(){return null}lineInner(e,i,n,r){for(let s=0;;s++){let a=this.text[s],c=r+a.length;if((i?n:c)>=e)return new dZ(r,c,n,a);r=c+1,n++}}decompose(e,i,n,r){let s=e<=0&&i>=this.length?this:new Ut(g2(this.text,e,i),Math.min(i,this.length)-Math.max(0,e));if(r&1){let a=n.pop(),c=jp(s.text,a.text.slice(),0,s.length);if(c.length<=32)n.push(new Ut(c,a.length+s.length));else{let h=c.length>>1;n.push(new Ut(c.slice(0,h)),new Ut(c.slice(h)))}}else n.push(s)}replace(e,i,n){if(!(n instanceof Ut))return super.replace(e,i,n);[e,i]=_c(this,e,i);let r=jp(this.text,jp(n.text,g2(this.text,0,e)),i),s=this.length+n.length-(i-e);return r.length<=32?new Ut(r,s):Br.from(Ut.split(r,[]),s)}sliceString(e,i=this.length,n=`
77
+ `,"4. Paste the Client ID and Secret below:"]}),v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[v.jsx("input",{value:f,onChange:$=>g($.target.value),placeholder:"Client ID (e.g. 123456.apps.googleusercontent.com)",style:Ge.input}),v.jsx("input",{type:"password",value:m,onChange:$=>O($.target.value),placeholder:"Client Secret (e.g. GOCSPX-...)",style:Ge.input}),v.jsx("button",{onClick:async()=>{await T(),f&&m&&setTimeout(()=>M(),500)},disabled:r||!f||!m,style:{...Ge.saveBtn,width:"100%",opacity:r||!f||!m?.4:1},children:r?"Saving...":"Save & Connect"})]}),v.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",textAlign:"center",marginTop:6},children:"One-time setup. Works for Gmail, Calendar, and Drive. Encrypted on this machine only."})]})]}),x.length>0&&v.jsxs("div",{children:[v.jsx("div",{style:{fontSize:11,color:"var(--text-dim)",marginBottom:12,lineHeight:1.5},children:"Paste your credentials below. Values are encrypted and stored locally on this machine only."}),x.map($=>v.jsxs("div",{style:{marginBottom:14},children:[v.jsxs("label",{style:Ge.label,children:[$.label||$.key,$.required&&v.jsx("span",{style:{color:"var(--red)",marginLeft:4},children:"*"}),a[$.key]&&v.jsxs("span",{style:{color:"var(--green)",marginLeft:8,fontSize:10,fontWeight:500},children:["✓"," saved"]})]}),v.jsxs("div",{style:{display:"flex",gap:6},children:[v.jsx("input",{type:"password",value:i[$.key]||"",placeholder:$.placeholder||$.key,onChange:R=>n(V=>({...V,[$.key]:R.target.value})),onKeyDown:R=>R.key==="Enter"&&k($.key),style:Ge.input}),v.jsx("button",{onClick:()=>k($.key),disabled:r||!i[$.key],style:{...Ge.saveBtn,opacity:r||!i[$.key]?.4:1},children:"Save"})]})]},$.key))]})]})]})})}function H8({integration:t,installing:e,onInstall:i,onUninstall:n,onConfigure:r,onClose:s}){if(!t)return null;const a=t.authType==="none"&&(t.envKeys||[]).length===0,c=(t.envKeys||[]).filter(h=>!h.hidden).length>0||t.authType==="oauth-google";return v.jsx("div",{style:Ge.overlay,onClick:s,children:v.jsxs("div",{style:Ge.container,onClick:h=>h.stopPropagation(),children:[v.jsxs("div",{style:Ge.topBar,children:[v.jsx(U1,{item:t,size:"large"}),v.jsx("button",{onClick:s,style:Ge.closeBtn,children:"×"})]}),v.jsxs("div",{style:Ge.header,children:[v.jsx("div",{style:{...Ge.icon,background:t.installed&&t.configured?"var(--green)":t.installed?"var(--amber)":"var(--accent)"},children:H1[t.icon]||t.name.charAt(0)}),v.jsxs("div",{style:Ge.headerInfo,children:[v.jsx("div",{style:Ge.name,children:t.name}),v.jsxs("div",{style:Ge.meta,children:[v.jsxs("span",{style:Ge.metaItem,children:[Y1[t.category]||""," ",I1[t.category]||t.category]}),v.jsx("span",{style:Ge.metaItem,children:"MCP Server"})]})]})]}),v.jsx("div",{style:Ge.actionBar,children:t.installed?v.jsxs("div",{style:{display:"flex",gap:8,flex:1},children:[c&&v.jsx("button",{onClick:()=>r(t),style:Ge.configureBtn,children:t.configured?"Reconfigure":"Configure"}),v.jsx("button",{onClick:()=>n(t.id),disabled:e===t.id,style:Ge.uninstallBtn,children:e===t.id?"Removing...":"Uninstall"})]}):v.jsx("button",{onClick:()=>i(t.id),disabled:e===t.id,style:Ge.installBtn,children:e===t.id?"Installing...":"Install"})}),t.installed&&v.jsxs("div",{style:Ge.section,children:[v.jsx("div",{style:Ge.sectionTitle,children:"Status"}),v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",borderRadius:6,background:a?"rgba(97, 175, 239, 0.06)":t.configured?"rgba(74, 225, 104, 0.06)":"rgba(229, 192, 123, 0.06)",border:`1px solid ${a?"var(--blue)":t.configured?"var(--green)":"var(--amber)"}`},children:[v.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:a?"var(--blue)":t.configured?"var(--green)":"var(--amber)"}}),v.jsx("span",{style:{fontSize:11,color:a?"var(--blue)":t.configured?"var(--green)":"var(--amber)"},children:a?"Installed — will sign in automatically on first use":t.configured?"Connected and ready":"Credentials needed"})]})]}),v.jsxs("div",{style:Ge.section,children:[v.jsx("div",{style:Ge.sectionTitle,children:"About"}),v.jsx("div",{style:Ge.description,children:t.description})]}),(t.envKeys||[]).length>0&&v.jsxs("div",{style:Ge.section,children:[v.jsx("div",{style:Ge.sectionTitle,children:"Required Credentials"}),v.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.envKeys.map(h=>v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:11,color:"var(--text-dim)"},children:[v.jsx("code",{style:{fontSize:10,padding:"1px 6px",borderRadius:3,background:"var(--bg-active)",color:"var(--text-primary)",fontFamily:"var(--font)"},children:h.key}),v.jsx("span",{children:h.label}),h.required&&v.jsx("span",{style:{color:"var(--amber)",fontSize:9},children:"required"})]},h.key))})]}),v.jsxs("div",{style:Ge.section,children:[v.jsx("div",{style:Ge.sectionTitle,children:"Tags"}),v.jsxs("div",{style:Ge.tagRow,children:[(t.tags||[]).map(h=>v.jsx("span",{style:Ge.tag,children:h},h)),(t.roles||[]).map(h=>v.jsx("span",{style:Ge.roleTag,children:h},h))]})]}),t.npmPackage&&v.jsxs("div",{style:Ge.section,children:[v.jsx("div",{style:Ge.sectionTitle,children:"Package"}),v.jsx("code",{style:{fontSize:11,padding:"6px 10px",borderRadius:4,background:"var(--bg-active)",color:"var(--text-primary)",display:"block",fontFamily:"var(--font)"},children:t.npmPackage})]})]})})}function U8({integrations:t,onSelect:e}){const i=t.filter(n=>n.featured).slice(0,3);return i.length===0?null:v.jsxs("div",{style:ze.featuredSection,children:[v.jsx("div",{style:ze.featuredLabel,children:"Featured Integrations"}),v.jsx("div",{style:ze.featuredRow,children:i.map(n=>v.jsxs("div",{onClick:()=>e(n),style:ze.featuredCard,onMouseEnter:r=>{r.currentTarget.style.borderColor="var(--accent)",r.currentTarget.style.transform="translateY(-1px)"},onMouseLeave:r=>{r.currentTarget.style.borderColor="var(--border)",r.currentTarget.style.transform="none"},children:[v.jsx("div",{style:ze.featuredGradient,children:v.jsx("div",{style:{...ze.featuredIcon,background:n.installed&&n.configured?"var(--green)":n.installed?"var(--amber)":"var(--accent)"},children:H1[n.icon]||n.name.charAt(0)})}),v.jsxs("div",{style:ze.featuredInfo,children:[v.jsx("div",{style:ze.featuredName,children:n.name}),v.jsx("div",{style:ze.featuredAuthorRow,children:v.jsx(U1,{item:n})}),v.jsx("div",{style:ze.featuredDesc,children:n.description})]}),n.installed&&n.authType!=="none"&&n.configured&&v.jsx("div",{style:ze.connectedBadge,children:"connected"}),n.installed&&n.authType==="none"&&v.jsx("div",{style:ze.installedBadge,children:"installed"}),n.installed&&!n.configured&&n.authType!=="none"&&v.jsx("div",{style:ze.setupBadge,children:"needs setup"})]},n.id))})]})}function G8({item:t,onSelect:e,hovered:i,onHover:n}){return v.jsxs("div",{onClick:()=>e(t),onMouseEnter:()=>n(t.id),onMouseLeave:()=>n(null),style:{...ze.card,borderColor:t.installed&&t.authType==="none"?"var(--blue)":t.installed&&t.configured?"var(--green)":t.installed?"var(--amber)":i?"var(--accent)":"var(--border)",background:i?"var(--bg-hover)":"var(--bg-surface)",transform:i?"translateY(-1px)":"none"},children:[v.jsxs("div",{style:ze.cardTop,children:[v.jsx("div",{style:{...ze.cardIcon,background:t.installed&&t.authType==="none"?"var(--blue)":t.installed&&t.configured?"var(--green)":t.installed?"var(--amber)":"var(--accent)"},children:H1[t.icon]||t.name.charAt(0)}),v.jsxs("div",{style:ze.cardInfo,children:[v.jsx("div",{style:ze.cardName,children:t.name}),v.jsx("div",{style:ze.cardAuthorRow,children:v.jsx(U1,{item:t})})]}),t.installed&&t.configured&&t.authType!=="none"&&v.jsx("div",{style:ze.connectedBadgeSm,children:"connected"}),t.installed&&t.authType==="none"&&v.jsx("div",{style:ze.installedBadgeSm,children:"installed"}),t.installed&&!t.configured&&t.authType!=="none"&&v.jsx("div",{style:ze.setupBadgeSm,children:"setup"}),!t.installed&&v.jsx("div",{style:ze.freeBadge,children:"MCP"})]}),v.jsx("div",{style:ze.cardDesc,children:t.description}),v.jsxs("div",{style:ze.cardBottom,children:[v.jsx("div",{style:ze.cardStats,children:(t.envKeys||[]).length>0&&v.jsxs("span",{style:ze.cardCredCount,children:[t.envKeys.length," credential",t.envKeys.length>1?"s":""]})}),v.jsxs("span",{style:ze.catTag,children:[Y1[t.category]||""," ",I1[t.category]||t.category]})]})]})}function F8(){const[t,e]=N.useState([]),[i,n]=N.useState([]),[r,s]=N.useState(""),[a,c]=N.useState("all"),[h,d]=N.useState("popular"),[f,g]=N.useState("browse"),[m,O]=N.useState(!0),[S,_]=N.useState(null),[w,x]=N.useState(null),[Q,k]=N.useState(null),[T,M]=N.useState(null),$=N.useCallback(async()=>{O(!0);try{const E=new URLSearchParams;r&&E.set("search",r),a!=="all"&&E.set("category",a);const P=await(await fetch(`/api/integrations/registry?${E}`)).json();e(P.integrations||[]),n(P.categories||[])}catch{}O(!1)},[r,a]);N.useEffect(()=>{$()},[$]);async function R(E){_(E);try{if(await fetch(`/api/integrations/${E}/install`,{method:"POST"}),await $(),(w==null?void 0:w.id)===E){const X=t.find(P=>P.id===E);X&&x({...X,installed:!0})}}catch{}_(null)}async function V(E){_(E);try{await fetch(`/api/integrations/${E}`,{method:"DELETE"}),await $(),(w==null?void 0:w.id)===E&&x(X=>X?{...X,installed:!1,configured:!1}:null)}catch{}_(null)}function H(E){x(E)}function ee(E){x(null),k(E)}function I(){k(null),$()}const j=t.filter(E=>E.installed),D=c2(f==="installed"?j:t,h);return v.jsxs("div",{style:ze.root,children:[v.jsxs("div",{style:ze.headerBar,children:[v.jsxs("div",{style:ze.headerLeft,children:[v.jsx("div",{style:ze.title,children:"Integrations"}),v.jsxs("div",{style:ze.headerTabs,children:[v.jsx("button",{onClick:()=>g("browse"),style:{...ze.headerTab,color:f==="browse"?"var(--text-bright)":"var(--text-dim)",borderBottom:f==="browse"?"2px solid var(--accent)":"2px solid transparent"},children:"Browse"}),v.jsxs("button",{onClick:()=>g("installed"),style:{...ze.headerTab,color:f==="installed"?"var(--text-bright)":"var(--text-dim)",borderBottom:f==="installed"?"2px solid var(--green)":"2px solid transparent"},children:["Installed (",j.length,")"]})]})]}),v.jsx("div",{style:ze.headerRight,children:v.jsxs("span",{style:ze.headerCount,children:[t.length," integrations"]})})]}),v.jsxs("div",{style:ze.toolbar,children:[v.jsxs("div",{style:ze.searchRow,children:[v.jsxs("div",{style:ze.searchWrap,children:[v.jsx("span",{style:ze.searchIcon,children:"⌕"}),v.jsx("input",{style:ze.search,placeholder:"Search integrations...",value:r,onChange:E=>s(E.target.value)})]}),v.jsx("div",{style:ze.sortWrap,children:V8.map(E=>v.jsx("button",{onClick:()=>d(E.id),style:{...ze.sortBtn,color:h===E.id?"var(--text-bright)":"var(--text-muted)",background:h===E.id?"var(--bg-active)":"transparent"},children:E.label},E.id))})]}),f==="browse"&&v.jsxs("div",{style:ze.catRow,children:[v.jsx("button",{onClick:()=>c("all"),style:{...ze.catBtn,...a==="all"?ze.catBtnActive:{}},children:"All"}),i.map(E=>v.jsxs("button",{onClick:()=>c(E.id),style:{...ze.catBtn,...a===E.id?ze.catBtnActive:{}},children:[Y1[E.id]||""," ",I1[E.id]||E.id," (",E.count,")"]},E.id))]})]}),v.jsxs("div",{style:ze.scrollArea,children:[f==="browse"&&!r&&a==="all"&&v.jsx(U8,{integrations:t,onSelect:H}),m&&t.length===0&&v.jsx("div",{style:ze.empty,children:"Loading integrations..."}),!m&&D.length===0&&v.jsx("div",{style:ze.empty,children:f==="installed"?"No integrations installed yet. Browse to connect your tools.":"No integrations match your search."}),v.jsx("div",{style:ze.grid,children:D.map(E=>v.jsx(G8,{item:E,onSelect:H,hovered:T===E.id,onHover:M},E.id))})]}),v.jsx(H8,{integration:w,installing:S,onInstall:R,onUninstall:V,onConfigure:ee,onClose:()=>x(null)}),v.jsx(Y8,{integration:Q,onClose:I})]})}const ze={root:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},headerBar:{padding:"12px 20px 0",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},headerLeft:{display:"flex",alignItems:"center",gap:20},title:{fontSize:15,fontWeight:700,color:"var(--text-bright)",letterSpacing:.3},headerTabs:{display:"flex",gap:0},headerTab:{padding:"6px 14px",background:"none",border:"none",fontSize:12,fontWeight:500,fontFamily:"var(--font)",cursor:"pointer",transition:"color 0.1s"},headerRight:{display:"flex",alignItems:"center",gap:10},headerCount:{fontSize:11,color:"var(--text-muted)"},toolbar:{padding:"10px 20px",flexShrink:0},searchRow:{display:"flex",gap:10,alignItems:"center"},searchWrap:{flex:1,position:"relative"},searchIcon:{position:"absolute",left:10,top:"50%",transform:"translateY(-50%)",color:"var(--text-muted)",fontSize:13,pointerEvents:"none"},search:{width:"100%",padding:"7px 12px 7px 30px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:6,color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font)",outline:"none"},sortWrap:{display:"flex",gap:2},sortBtn:{padding:"5px 10px",background:"transparent",border:"1px solid transparent",borderRadius:4,fontSize:10,fontWeight:500,fontFamily:"var(--font)",cursor:"pointer",transition:"all 0.1s"},catRow:{display:"flex",gap:4,marginTop:8,flexWrap:"wrap"},catBtn:{padding:"4px 12px",background:"transparent",border:"1px solid var(--border)",borderRadius:14,color:"var(--text-dim)",fontSize:10,fontFamily:"var(--font)",cursor:"pointer",transition:"all 0.1s"},catBtnActive:{borderColor:"var(--accent)",color:"var(--accent)",background:"rgba(51, 175, 188, 0.08)"},scrollArea:{flex:1,overflowY:"auto",padding:"4px 20px 20px"},featuredSection:{marginBottom:16},featuredLabel:{fontSize:11,fontWeight:700,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:1,marginBottom:8},featuredRow:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:8},featuredCard:{padding:"14px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:8,cursor:"pointer",transition:"border-color 0.15s, transform 0.15s",position:"relative",overflow:"hidden"},featuredGradient:{display:"flex",alignItems:"center",marginBottom:10},featuredIcon:{width:40,height:40,borderRadius:10,display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,fontWeight:700,color:"var(--bg-base)"},featuredInfo:{flex:1},featuredName:{fontSize:13,fontWeight:700,color:"var(--text-bright)"},featuredAuthorRow:{display:"flex",alignItems:"center",gap:6,marginTop:2},featuredDesc:{fontSize:10,color:"var(--text-dim)",marginTop:6,lineHeight:1.45,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},connectedBadge:{position:"absolute",top:8,right:8,fontSize:8,fontWeight:600,color:"var(--green)",border:"1px solid var(--green)",borderRadius:3,padding:"1px 5px",textTransform:"uppercase",letterSpacing:.5},installedBadge:{position:"absolute",top:8,right:8,fontSize:8,fontWeight:600,color:"var(--blue)",border:"1px solid var(--blue)",borderRadius:3,padding:"1px 5px",textTransform:"uppercase",letterSpacing:.5},setupBadge:{position:"absolute",top:8,right:8,fontSize:8,fontWeight:600,color:"var(--amber)",border:"1px solid var(--amber)",borderRadius:3,padding:"1px 5px",textTransform:"uppercase",letterSpacing:.5},grid:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:8},empty:{padding:"60px 0",textAlign:"center",color:"var(--text-dim)",fontSize:12,gridColumn:"1 / -1"},card:{padding:"14px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:8,cursor:"pointer",transition:"border-color 0.12s, background 0.12s, transform 0.12s",display:"flex",flexDirection:"column"},cardTop:{display:"flex",alignItems:"center",gap:10},cardIcon:{width:36,height:36,borderRadius:8,display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:700,color:"var(--bg-base)",flexShrink:0},cardInfo:{flex:1,minWidth:0},cardName:{fontSize:12,fontWeight:600,color:"var(--text-bright)"},cardAuthorRow:{display:"flex",alignItems:"center",gap:6,marginTop:2},connectedBadgeSm:{fontSize:8,fontWeight:600,color:"var(--green)",border:"1px solid var(--green)",borderRadius:3,padding:"1px 6px",textTransform:"uppercase",letterSpacing:.5,flexShrink:0},installedBadgeSm:{fontSize:8,fontWeight:600,color:"var(--blue)",border:"1px solid var(--blue)",borderRadius:3,padding:"1px 6px",textTransform:"uppercase",letterSpacing:.5,flexShrink:0},setupBadgeSm:{fontSize:8,fontWeight:600,color:"var(--amber)",border:"1px solid var(--amber)",borderRadius:3,padding:"1px 6px",textTransform:"uppercase",letterSpacing:.5,flexShrink:0},freeBadge:{fontSize:9,fontWeight:500,color:"var(--text-muted)",flexShrink:0},cardDesc:{fontSize:11,color:"var(--text-dim)",marginTop:10,lineHeight:1.5,flex:1,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},cardBottom:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:10,paddingTop:8,borderTop:"1px solid var(--border)"},cardStats:{display:"flex",gap:10},cardCredCount:{fontSize:10,color:"var(--text-muted)"},catTag:{fontSize:9,padding:"2px 8px",borderRadius:4,background:"var(--bg-active)",color:"var(--text-dim)",fontWeight:500}},Ge={overlay:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,backdropFilter:"blur(2px)"},container:{width:"90%",maxWidth:520,maxHeight:"85vh",background:"var(--bg-chrome)",border:"1px solid var(--border)",borderRadius:10,overflowY:"auto",padding:"0 24px 24px",position:"relative"},topBar:{position:"sticky",top:0,background:"var(--bg-chrome)",padding:"16px 0 8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:1},closeBtn:{background:"none",border:"none",color:"var(--text-muted)",fontSize:20,cursor:"pointer",padding:"2px 6px",fontFamily:"var(--font)"},header:{display:"flex",gap:14,alignItems:"flex-start",marginBottom:16},icon:{width:52,height:52,borderRadius:12,display:"flex",alignItems:"center",justifyContent:"center",fontSize:20,fontWeight:700,color:"var(--bg-base)",flexShrink:0},headerInfo:{flex:1},name:{fontSize:17,fontWeight:700,color:"var(--text-bright)"},meta:{display:"flex",gap:10,marginTop:6,flexWrap:"wrap"},metaItem:{fontSize:11,color:"var(--text-dim)"},actionBar:{display:"flex",alignItems:"center",gap:8,padding:"12px 0",borderTop:"1px solid var(--border)",borderBottom:"1px solid var(--border)",marginBottom:16},installBtn:{flex:1,padding:"8px 16px",background:"var(--accent)",color:"var(--bg-base)",border:"none",borderRadius:6,fontSize:12,fontWeight:600,cursor:"pointer",fontFamily:"var(--font)"},configureBtn:{flex:1,padding:"8px 16px",background:"var(--bg-active)",color:"var(--text-bright)",border:"1px solid var(--border)",borderRadius:6,fontSize:12,fontWeight:600,cursor:"pointer",fontFamily:"var(--font)"},uninstallBtn:{padding:"8px 16px",background:"transparent",color:"var(--red)",border:"1px solid var(--red)",borderRadius:6,fontSize:12,fontWeight:500,cursor:"pointer",fontFamily:"var(--font)"},section:{marginBottom:16},sectionTitle:{fontSize:11,fontWeight:700,color:"var(--text-dim)",textTransform:"uppercase",letterSpacing:.5,marginBottom:8},description:{fontSize:12,color:"var(--text-primary)",lineHeight:1.6},tagRow:{display:"flex",gap:4,flexWrap:"wrap"},tag:{fontSize:10,padding:"2px 8px",borderRadius:4,background:"var(--bg-active)",color:"var(--text-dim)"},roleTag:{fontSize:10,padding:"2px 8px",borderRadius:4,background:"rgba(51, 175, 188, 0.08)",color:"var(--accent)",border:"1px solid rgba(51, 175, 188, 0.2)"},label:{display:"block",fontSize:11,fontWeight:600,color:"var(--text-primary)",marginBottom:4},input:{flex:1,padding:"7px 10px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:5,color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font)",outline:"none"},saveBtn:{padding:"7px 14px",background:"var(--accent)",color:"var(--bg-base)",border:"none",borderRadius:5,fontSize:11,fontWeight:600,cursor:"pointer",fontFamily:"var(--font)"}},K8=[{label:"Every 5 min",cron:"*/5 * * * *"},{label:"Every 15 min",cron:"*/15 * * * *"},{label:"Every hour",cron:"0 * * * *"},{label:"Every 6 hours",cron:"0 */6 * * *"},{label:"Daily 9 AM",cron:"0 9 * * *"},{label:"Weekdays 9 AM",cron:"0 9 * * 1-5"},{label:"Weekly (Mon)",cron:"0 0 * * 1"},{label:"Monthly",cron:"0 0 1 * *"}],J8=[{id:"backend",label:"Backend"},{id:"frontend",label:"Frontend"},{id:"fullstack",label:"Fullstack"},{id:"testing",label:"Testing"},{id:"devops",label:"DevOps"},{id:"docs",label:"Docs"},{id:"cmo",label:"CMO"},{id:"cfo",label:"CFO"},{id:"ea",label:"EA"},{id:"support",label:"Support"},{id:"analyst",label:"Analyst"}];function PE(t){if(!t)return"never";const e=Date.now()-new Date(t).getTime();return e<6e4?"just now":e<36e5?`${Math.floor(e/6e4)}m ago`:e<864e5?`${Math.floor(e/36e5)}h ago`:`${Math.floor(e/864e5)}d ago`}function EE({status:t}){const e={spawned:"var(--green)",skipped:"var(--amber)",error:"var(--red)"};return v.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:e[t]||"var(--text-muted)",display:"inline-block",marginRight:6}})}function eZ({onSubmit:t,onCancel:e}){const[i,n]=N.useState(""),[r,s]=N.useState("0 9 * * *"),[a,c]=N.useState("fullstack"),[h,d]=N.useState(""),[f,g]=N.useState(!1),[m,O]=N.useState("");async function S(_){if(_.preventDefault(),!i.trim()){O("Name is required");return}if(!h.trim()){O("Task prompt is required");return}g(!0),O("");try{await t({name:i.trim(),cron:r,agentConfig:{role:a,prompt:h.trim()}})}catch(w){O(w.message)}g(!1)}return v.jsxs("form",{onSubmit:S,style:Pe.form,children:[v.jsx("div",{style:Pe.formTitle,children:"New Schedule"}),v.jsx("label",{style:Pe.label,children:"NAME"}),v.jsx("input",{value:i,onChange:_=>n(_.target.value),placeholder:"e.g., Daily standup summary",style:Pe.input}),v.jsx("label",{style:Pe.label,children:"FREQUENCY"}),v.jsx("div",{style:Pe.presetRow,children:K8.map(_=>v.jsx("button",{type:"button",onClick:()=>s(_.cron),style:{...Pe.presetBtn,borderColor:r===_.cron?"var(--accent)":"var(--border)",color:r===_.cron?"var(--accent)":"var(--text-dim)",background:r===_.cron?"rgba(51, 175, 188, 0.08)":"transparent"},children:_.label},_.cron))}),v.jsx("input",{value:r,onChange:_=>s(_.target.value),placeholder:"* * * * * (min hr day mon wkday)",style:{...Pe.input,fontFamily:"var(--font)",fontSize:11}}),v.jsx("label",{style:Pe.label,children:"AGENT ROLE"}),v.jsx("div",{style:Pe.presetRow,children:J8.map(_=>v.jsx("button",{type:"button",onClick:()=>c(_.id),style:{...Pe.presetBtn,borderColor:a===_.id?"var(--accent)":"var(--border)",color:a===_.id?"var(--accent)":"var(--text-dim)",background:a===_.id?"rgba(51, 175, 188, 0.08)":"transparent"},children:_.label},_.id))}),v.jsx("label",{style:Pe.label,children:"TASK"}),v.jsx("textarea",{value:h,onChange:_=>d(_.target.value),placeholder:"What should this agent do each time it runs?",rows:3,style:Pe.textarea}),m&&v.jsx("div",{style:Pe.error,children:m}),v.jsxs("div",{style:Pe.formActions,children:[v.jsx("button",{type:"button",onClick:e,style:Pe.cancelBtn,children:"Cancel"}),v.jsx("button",{type:"submit",disabled:f,style:Pe.submitBtn,children:f?"Creating...":"Create Schedule"})]})]})}function tZ({schedule:t,onToggle:e,onRun:i,onDelete:n,onSelect:r}){var c;const[s,a]=N.useState(!1);return v.jsxs("div",{style:Pe.scheduleRow,onMouseEnter:h=>{h.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:h=>{h.currentTarget.style.background="var(--bg-surface)"},children:[v.jsxs("div",{style:Pe.scheduleMain,onClick:()=>r(t),children:[v.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:t.enabled?t.isRunning?"var(--green)":"var(--accent)":"var(--text-muted)",flexShrink:0,animation:t.isRunning?"pulse 2s infinite":"none"}}),v.jsxs("div",{style:{flex:1,minWidth:0},children:[v.jsx("div",{style:Pe.scheduleName,children:t.name}),v.jsxs("div",{style:Pe.scheduleMeta,children:[v.jsx("span",{children:t.cronDescription||t.cron}),v.jsx("span",{style:{color:"var(--text-muted)"},children:(c=t.agentConfig)==null?void 0:c.role}),t.lastRun&&v.jsxs("span",{style:{color:"var(--text-muted)"},children:[v.jsx(EE,{status:t.lastRun.status}),PE(t.lastRun.timestamp)]})]})]})]}),v.jsxs("div",{style:Pe.scheduleActions,children:[v.jsx("button",{onClick:()=>e(t.id,!t.enabled),title:t.enabled?"Disable":"Enable",style:{...Pe.actionBtn,color:t.enabled?"var(--green)":"var(--text-muted)"},children:t.enabled?"ON":"OFF"}),v.jsx("button",{onClick:()=>i(t.id),title:"Run now",style:{...Pe.actionBtn,color:"var(--accent)"},children:"▶"}),s?v.jsx("button",{onClick:()=>{n(t.id),a(!1)},style:{...Pe.actionBtn,color:"var(--red)"},children:"confirm"}):v.jsx("button",{onClick:()=>a(!0),style:{...Pe.actionBtn,color:"var(--text-muted)"},children:"✕"})]})]})}function iZ({schedule:t,onClose:e}){var i,n;return t?v.jsxs("div",{style:Pe.detailPanel,children:[v.jsxs("div",{style:Pe.detailHeader,children:[v.jsx("div",{style:Pe.detailTitle,children:t.name}),v.jsx("button",{onClick:e,style:Pe.detailClose,children:"×"})]}),v.jsxs("div",{style:Pe.detailGrid,children:[v.jsx("div",{style:Pe.detailLabel,children:"Cron"}),v.jsx("div",{style:Pe.detailValue,children:t.cron}),v.jsx("div",{style:Pe.detailLabel,children:"Description"}),v.jsx("div",{style:Pe.detailValue,children:t.cronDescription}),v.jsx("div",{style:Pe.detailLabel,children:"Role"}),v.jsx("div",{style:Pe.detailValue,children:(i=t.agentConfig)==null?void 0:i.role}),v.jsx("div",{style:Pe.detailLabel,children:"Status"}),v.jsx("div",{style:Pe.detailValue,children:v.jsx("span",{style:{color:t.enabled?"var(--green)":"var(--text-muted)"},children:t.enabled?"Enabled":"Disabled"})}),v.jsx("div",{style:Pe.detailLabel,children:"Created"}),v.jsx("div",{style:Pe.detailValue,children:new Date(t.createdAt).toLocaleString()})]}),((n=t.agentConfig)==null?void 0:n.prompt)&&v.jsxs("div",{style:{marginTop:16},children:[v.jsx("div",{style:Pe.detailLabel,children:"Task Prompt"}),v.jsx("pre",{style:Pe.promptPre,children:t.agentConfig.prompt})]}),(t.history||[]).length>0&&v.jsxs("div",{style:{marginTop:16},children:[v.jsx("div",{style:{...Pe.detailLabel,marginBottom:8},children:"Execution History"}),v.jsx("div",{style:Pe.historyList,children:t.history.slice(0,20).map((r,s)=>v.jsxs("div",{style:Pe.historyEntry,children:[v.jsx(EE,{status:r.status}),v.jsxs("span",{style:{fontSize:10,color:"var(--text-dim)",flex:1},children:[r.status,r.agentId&&v.jsxs("span",{style:{color:"var(--text-muted)"},children:[" (",r.agentId,")"]})]}),v.jsx("span",{style:{fontSize:9,color:"var(--text-muted)"},children:PE(r.timestamp)})]},s))})]})]}):null}function nZ(){const[t,e]=N.useState([]),[i,n]=N.useState(!0),[r,s]=N.useState(!1),[a,c]=N.useState(null),[h,d]=N.useState(""),f=N.useCallback(async()=>{try{const x=await fetch("/api/schedules");e(await x.json())}catch{}n(!1)},[]);N.useEffect(()=>{f();const x=setInterval(f,1e4);return()=>clearInterval(x)},[f]);async function g(x){const Q=await fetch("/api/schedules",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)});if(!Q.ok){const k=await Q.json();throw new Error(k.error||"Failed to create schedule")}s(!1),await f(),w("Schedule created")}async function m(x,Q){await fetch(`/api/schedules/${x}/${Q?"enable":"disable"}`,{method:"POST"}),await f()}async function O(x){try{await fetch(`/api/schedules/${x}/run`,{method:"POST"}),w("Agent spawned"),await f()}catch{w("Failed to run")}}async function S(x){await fetch(`/api/schedules/${x}`,{method:"DELETE"}),(a==null?void 0:a.id)===x&&c(null),await f(),w("Schedule deleted")}async function _(x){try{const Q=await fetch(`/api/schedules/${x.id}`);c(await Q.json())}catch{c(x)}}function w(x){d(x),setTimeout(()=>d(""),3e3)}return v.jsxs("div",{style:Pe.root,children:[v.jsxs("div",{style:Pe.headerBar,children:[v.jsxs("div",{style:Pe.headerLeft,children:[v.jsx("div",{style:Pe.title,children:"Schedules"}),v.jsxs("span",{style:Pe.headerCount,children:[t.length," schedule",t.length!==1?"s":""," • ",t.filter(x=>x.enabled).length," active"]})]}),v.jsx("button",{onClick:()=>{s(!0),c(null)},style:Pe.createBtn,children:"+ New Schedule"})]}),h&&v.jsx("div",{style:Pe.statusMsg,children:h}),v.jsxs("div",{style:Pe.mainRow,children:[v.jsxs("div",{style:Pe.listArea,children:[r&&v.jsx(eZ,{onSubmit:g,onCancel:()=>s(!1)}),i&&t.length===0&&v.jsx("div",{style:Pe.empty,children:"Loading schedules..."}),!i&&t.length===0&&!r&&v.jsxs("div",{style:Pe.empty,children:[v.jsx("div",{style:{fontSize:13,marginBottom:8},children:"No schedules yet"}),v.jsx("div",{style:{fontSize:11,color:"var(--text-muted)"},children:"Create a schedule to run agents on a recurring basis — daily standups, weekly reports, monitoring checks."})]}),t.map(x=>v.jsx(tZ,{schedule:x,onToggle:m,onRun:O,onDelete:S,onSelect:_},x.id))]}),a&&v.jsx(iZ,{schedule:a,onClose:()=>c(null)})]})]})}const Pe={root:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},headerBar:{padding:"12px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},headerLeft:{display:"flex",alignItems:"center",gap:12},title:{fontSize:15,fontWeight:700,color:"var(--text-bright)",letterSpacing:.3},headerCount:{fontSize:11,color:"var(--text-muted)"},createBtn:{padding:"6px 14px",background:"var(--accent)",color:"var(--bg-base)",border:"none",borderRadius:6,fontSize:11,fontWeight:600,cursor:"pointer",fontFamily:"var(--font)"},statusMsg:{padding:"4px 20px",fontSize:10,color:"var(--green)",flexShrink:0},mainRow:{flex:1,display:"flex",overflow:"hidden"},listArea:{flex:1,overflowY:"auto",padding:"0 20px 20px"},empty:{padding:"60px 20px",textAlign:"center",color:"var(--text-dim)",fontSize:12},scheduleRow:{display:"flex",alignItems:"center",padding:"10px 12px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:6,marginBottom:4,cursor:"pointer",transition:"background 0.1s"},scheduleMain:{display:"flex",alignItems:"center",gap:10,flex:1,minWidth:0},scheduleName:{fontSize:12,fontWeight:600,color:"var(--text-bright)"},scheduleMeta:{display:"flex",gap:10,fontSize:10,color:"var(--text-dim)",marginTop:2},scheduleActions:{display:"flex",gap:4,flexShrink:0},actionBtn:{padding:"3px 8px",background:"transparent",border:"1px solid var(--border)",borderRadius:4,fontSize:9,fontWeight:600,fontFamily:"var(--font)",cursor:"pointer"},form:{padding:"16px",background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:8,marginBottom:12},formTitle:{fontSize:13,fontWeight:700,color:"var(--text-bright)",marginBottom:12},label:{display:"block",fontSize:9,fontWeight:700,color:"var(--text-muted)",letterSpacing:.5,textTransform:"uppercase",marginTop:10,marginBottom:4},input:{width:"100%",padding:"7px 10px",background:"var(--bg-base)",border:"1px solid var(--border)",borderRadius:5,color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font)",outline:"none",boxSizing:"border-box"},textarea:{width:"100%",padding:"7px 10px",background:"var(--bg-base)",border:"1px solid var(--border)",borderRadius:5,color:"var(--text-primary)",fontSize:12,fontFamily:"var(--font)",outline:"none",resize:"vertical",boxSizing:"border-box"},presetRow:{display:"flex",gap:4,flexWrap:"wrap",marginBottom:6},presetBtn:{padding:"3px 10px",background:"transparent",border:"1px solid var(--border)",borderRadius:10,fontSize:10,fontWeight:500,fontFamily:"var(--font)",cursor:"pointer",transition:"all 0.1s"},error:{fontSize:11,color:"var(--red)",marginTop:8},formActions:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:14},cancelBtn:{padding:"6px 14px",background:"transparent",color:"var(--text-dim)",border:"1px solid var(--border)",borderRadius:5,fontSize:11,fontWeight:500,cursor:"pointer",fontFamily:"var(--font)"},submitBtn:{padding:"6px 14px",background:"var(--accent)",color:"var(--bg-base)",border:"none",borderRadius:5,fontSize:11,fontWeight:600,cursor:"pointer",fontFamily:"var(--font)"},detailPanel:{width:320,flexShrink:0,borderLeft:"1px solid var(--border)",padding:"16px",overflowY:"auto"},detailHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},detailTitle:{fontSize:14,fontWeight:700,color:"var(--text-bright)"},detailClose:{background:"none",border:"none",color:"var(--text-muted)",fontSize:18,cursor:"pointer",fontFamily:"var(--font)"},detailGrid:{display:"grid",gridTemplateColumns:"80px 1fr",gap:"6px 10px"},detailLabel:{fontSize:10,fontWeight:600,color:"var(--text-muted)",textTransform:"uppercase"},detailValue:{fontSize:11,color:"var(--text-primary)"},promptPre:{fontSize:11,color:"var(--text-primary)",lineHeight:1.5,padding:"8px 10px",background:"var(--bg-base)",border:"1px solid var(--border)",borderRadius:4,whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"var(--font)",maxHeight:200,overflowY:"auto",marginTop:4},historyList:{display:"flex",flexDirection:"column",gap:4},historyEntry:{display:"flex",alignItems:"center",gap:4,padding:"4px 8px",borderRadius:4,background:"var(--bg-base)"}},h2={javascript:"#e5c07b",typescript:"#61afef",css:"#c678dd",html:"#e06c75",json:"#4ae168",markdown:"#c678dd",python:"#61afef",rust:"#e06c75",go:"#33afbc",shell:"#4ae168",text:"#abb2bf"};function RE({entry:t,depth:e,activeFile:i,expandedDirs:n,onToggleDir:r,onFileClick:s,onContextMenu:a,renamingPath:c,renameValue:h,onRenameChange:d,onRenameSubmit:f,onRenameCancel:g}){const m=t.type==="dir",O=n.has(t.path),S=!m&&t.path===i,_=c===t.path,x=Ce(Q=>Q.editorTreeCache)[t.path]||[];return v.jsxs(v.Fragment,{children:[v.jsxs("div",{onClick:()=>m?r(t.path,t.hasChildren):s(t.path),onContextMenu:Q=>a(Q,t),style:{...Ht.row,paddingLeft:12+e*16,background:S?"var(--bg-active)":"transparent",borderLeft:S?"2px solid var(--accent)":"2px solid transparent"},children:[m?v.jsx("span",{style:Ht.arrow,children:O?"▾":"▸"}):v.jsx("span",{style:{...Ht.fileDot,background:h2[t.language]||h2.text}}),_?v.jsx("input",{autoFocus:!0,value:h,onChange:Q=>d(Q.target.value),onKeyDown:Q=>{Q.key==="Enter"&&f(),Q.key==="Escape"&&g()},onBlur:g,onClick:Q=>Q.stopPropagation(),style:Ht.renameInput}):v.jsx("span",{style:{...Ht.name,color:m?"var(--text-primary)":S?"var(--text-bright)":"var(--text-primary)",fontWeight:m?600:400},children:t.name}),!m&&!_&&t.size>0&&v.jsx("span",{style:Ht.size,children:rZ(t.size)})]}),m&&O&&x.map(Q=>v.jsx(RE,{entry:Q,depth:e+1,activeFile:i,expandedDirs:n,onToggleDir:r,onFileClick:s,onContextMenu:a,renamingPath:c,renameValue:h,onRenameChange:d,onRenameSubmit:f,onRenameCancel:g},Q.path))]})}function rZ(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(0)}K`:`${(t/(1024*1024)).toFixed(1)}M`}function sZ({x:t,y:e,entry:i,onClose:n,onAction:r}){const s=N.useRef(null);N.useEffect(()=>{const h=d=>{s.current&&!s.current.contains(d.target)&&n()};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[n]);const a=(i==null?void 0:i.type)==="dir",c=[{label:"New File",action:a?"newFileIn":"newFileSibling"},{label:"New Folder",action:a?"newDirIn":"newDirSibling"},{sep:!0},{label:"Rename",action:"rename"},{label:"Delete",action:"delete",danger:!0}];return v.jsx("div",{ref:s,style:{...Ht.contextMenu,left:t,top:e},children:c.map((h,d)=>h.sep?v.jsx("div",{style:Ht.contextSep},d):v.jsx("div",{onClick:()=>{r(h.action,i),n()},style:{...Ht.contextItem,color:h.danger?"var(--red)":"var(--text-primary)"},children:h.label},h.action))})}function u2({placeholder:t,onSubmit:e,onCancel:i,depth:n}){const[r,s]=N.useState("");return v.jsx("div",{style:{...Ht.row,paddingLeft:12+(n||0)*16},children:v.jsx("input",{autoFocus:!0,placeholder:t,value:r,onChange:a=>s(a.target.value),onKeyDown:a=>{a.key==="Enter"&&r.trim()&&e(r.trim()),a.key==="Escape"&&i()},onBlur:i,style:Ht.renameInput})})}function oZ(){const t=Ce(j=>j.editorTreeCache),e=Ce(j=>j.editorActiveFile),i=Ce(j=>j.fetchTreeDir),n=Ce(j=>j.openFile),r=Ce(j=>j.createFile),s=Ce(j=>j.createDir),a=Ce(j=>j.deleteFile),c=Ce(j=>j.renameFile),[h,d]=N.useState(new Set([""])),[f,g]=N.useState(""),[m,O]=N.useState(null),[S,_]=N.useState(null),[w,x]=N.useState(null),[Q,k]=N.useState("");N.useEffect(()=>{i("")},[i]);const T=N.useCallback((j,D)=>{d(E=>{const X=new Set(E);return X.has(j)?X.delete(j):(X.add(j),(D||!t[j])&&i(j)),X})},[i,t]),M=N.useCallback((j,D)=>{j.preventDefault(),j.stopPropagation(),O({x:j.clientX,y:j.clientY,entry:D})},[]),$=N.useCallback(async(j,D)=>{const E=D.path.includes("/")?D.path.split("/").slice(0,-1).join("/"):"";switch(j){case"newFileIn":_({type:"file",parentPath:D.path}),d(X=>{const P=new Set(X);return P.add(D.path),t[D.path]||i(D.path),P});break;case"newDirIn":_({type:"dir",parentPath:D.path}),d(X=>{const P=new Set(X);return P.add(D.path),t[D.path]||i(D.path),P});break;case"newFileSibling":_({type:"file",parentPath:E});break;case"newDirSibling":_({type:"dir",parentPath:E});break;case"rename":x(D.path),k(D.name);break;case"delete":confirm(`Delete "${D.name}"?`)&&await a(D.path);break}},[a,i,t]),R=N.useCallback(async j=>{if(!S)return;const D=S.parentPath?`${S.parentPath}/${j}`:j,E=S.type==="file"?await r(D):await s(D);_(null),E&&S.type==="file"&&n(D)},[S,r,s,n]),V=N.useCallback(async()=>{if(!w||!Q.trim()){x(null);return}const j=w.includes("/")?w.split("/").slice(0,-1).join("/"):"",D=j?`${j}/${Q.trim()}`:Q.trim();D!==w&&await c(w,D),x(null)},[w,Q,c]),H=N.useCallback(j=>{j.target===j.currentTarget&&(j.preventDefault(),O({x:j.clientX,y:j.clientY,entry:{type:"dir",path:"",name:"root"}}))},[]),ee=t[""]||[],I=f?ee.filter(j=>j.name.toLowerCase().includes(f.toLowerCase())):ee;return S&&(S.parentPath===""||S.parentPath.split("/").length),v.jsxs("div",{style:Ht.container,children:[v.jsxs("div",{style:Ht.toolbar,children:[v.jsx("span",{style:Ht.toolbarTitle,children:"FILES"}),v.jsxs("div",{style:Ht.toolbarActions,children:[v.jsx("button",{onClick:()=>_({type:"file",parentPath:""}),title:"New File",style:Ht.toolbarBtn,children:v.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.3",children:[v.jsx("path",{d:"M3 1.5h6l4 4V14a.5.5 0 01-.5.5h-9A.5.5 0 013 14V2a.5.5 0 01.5-.5z"}),v.jsx("path",{d:"M9 1.5V5.5h4"}),v.jsx("path",{d:"M8 8.5v4M6 10.5h4",strokeLinecap:"round"})]})}),v.jsx("button",{onClick:()=>_({type:"dir",parentPath:""}),title:"New Folder",style:Ht.toolbarBtn,children:v.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.3",children:[v.jsx("path",{d:"M1.5 3.5h4l1.5 1.5H14a.5.5 0 01.5.5v8a.5.5 0 01-.5.5H2a.5.5 0 01-.5-.5V4z"}),v.jsx("path",{d:"M8 8v3M6.5 9.5h3",strokeLinecap:"round"})]})})]})]}),v.jsx("div",{style:Ht.searchWrap,children:v.jsx("input",{type:"text",placeholder:"Filter...",value:f,onChange:j=>g(j.target.value),style:Ht.searchInput})}),v.jsxs("div",{style:Ht.tree,onContextMenu:H,children:[I.length===0&&!S&&v.jsx("div",{style:Ht.empty,children:ee.length===0?"Loading...":"No matches"}),S&&S.parentPath===""&&v.jsx(u2,{placeholder:S.type==="file"?"filename.ext":"folder-name",onSubmit:R,onCancel:()=>_(null),depth:0}),I.map(j=>v.jsxs(Ul.Fragment,{children:[v.jsx(RE,{entry:j,depth:0,activeFile:e,expandedDirs:h,onToggleDir:T,onFileClick:n,onContextMenu:M,renamingPath:w,renameValue:Q,onRenameChange:k,onRenameSubmit:V,onRenameCancel:()=>x(null)}),S&&S.parentPath===j.path&&h.has(j.path)&&v.jsx(u2,{placeholder:S.type==="file"?"filename.ext":"folder-name",onSubmit:R,onCancel:()=>_(null),depth:1})]},j.path))]}),m&&v.jsx(sZ,{x:m.x,y:m.y,entry:m.entry,onClose:()=>O(null),onAction:$})]})}const Ht={container:{display:"flex",flexDirection:"column",height:"100%",background:"var(--bg-chrome)",position:"relative"},toolbar:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 10px",borderBottom:"1px solid var(--border)"},toolbarTitle:{fontSize:10,fontWeight:700,letterSpacing:1,color:"var(--text-dim)",textTransform:"uppercase"},toolbarActions:{display:"flex",gap:2},toolbarBtn:{background:"none",border:"none",color:"var(--text-dim)",fontSize:11,fontWeight:600,cursor:"pointer",fontFamily:"var(--font)",padding:"2px 5px",borderRadius:3,lineHeight:1},searchWrap:{padding:"6px 8px",borderBottom:"1px solid var(--border)"},searchInput:{width:"100%",padding:"5px 8px",background:"var(--bg-base)",border:"1px solid var(--border)",borderRadius:3,color:"var(--text-primary)",fontSize:11,fontFamily:"var(--font)",outline:"none"},tree:{flex:1,overflowY:"auto",overflowX:"hidden"},row:{display:"flex",alignItems:"center",gap:6,padding:"4px 12px",cursor:"pointer",transition:"background 0.08s",whiteSpace:"nowrap"},arrow:{fontSize:10,color:"var(--text-muted)",width:10,flexShrink:0,textAlign:"center"},fileDot:{width:6,height:6,borderRadius:"50%",flexShrink:0},name:{fontSize:12,overflow:"hidden",textOverflow:"ellipsis",flex:1,minWidth:0},size:{fontSize:9,color:"var(--text-muted)",flexShrink:0},empty:{padding:16,textAlign:"center",fontSize:11,color:"var(--text-dim)"},renameInput:{flex:1,padding:"2px 6px",background:"var(--bg-base)",border:"1px solid var(--accent)",borderRadius:2,color:"var(--text-bright)",fontSize:12,fontFamily:"var(--font)",outline:"none",minWidth:0},contextMenu:{position:"fixed",zIndex:300,background:"var(--bg-surface)",border:"1px solid var(--border)",borderRadius:4,padding:"4px 0",minWidth:160,boxShadow:"0 8px 24px rgba(0,0,0,0.4)",fontFamily:"var(--font)"},contextItem:{padding:"6px 14px",fontSize:11,cursor:"pointer",transition:"background 0.08s"},contextSep:{height:1,background:"var(--border)",margin:"4px 0"}};function aZ(){const t=Ce(s=>s.editorOpenTabs),e=Ce(s=>s.editorActiveFile),i=Ce(s=>s.editorFiles),n=Ce(s=>s.setActiveFile),r=Ce(s=>s.closeFile);return t.length===0?null:v.jsx("div",{style:Bh.container,children:t.map(s=>{const a=i[s],c=s===e,h=a&&a.content!==a.originalContent,d=s.split("/").pop();return v.jsxs("div",{onClick:()=>n(s),title:s,style:{...Bh.tab,color:c?"var(--text-bright)":"var(--text-primary)",borderBottom:c?"1px solid var(--accent)":"1px solid transparent",background:c?"var(--bg-base)":"transparent"},children:[h&&v.jsx("span",{style:Bh.dirtyDot}),v.jsx("span",{style:Bh.tabName,children:d}),v.jsx("button",{onClick:f=>{f.stopPropagation(),r(s)},style:Bh.closeBtn,children:"x"})]},s)})})}const Bh={container:{display:"flex",alignItems:"center",height:32,flexShrink:0,background:"var(--bg-chrome)",borderBottom:"1px solid var(--border)",overflowX:"auto",overflowY:"hidden"},tab:{display:"flex",alignItems:"center",gap:5,padding:"0 12px",height:"100%",cursor:"pointer",whiteSpace:"nowrap",fontSize:11,fontFamily:"var(--font)",transition:"background 0.08s",borderRight:"1px solid rgba(75, 82, 99, 0.4)",flexShrink:0},tabName:{overflow:"hidden",textOverflow:"ellipsis",maxWidth:140},dirtyDot:{width:6,height:6,borderRadius:"50%",background:"var(--amber)",flexShrink:0},closeBtn:{background:"none",border:"none",color:"var(--text-muted)",fontSize:10,cursor:"pointer",fontFamily:"var(--font)",padding:"0 2px",lineHeight:1,opacity:.6}};let By=[],AE=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,i=0;e<t.length;e++)(e%2?AE:By).push(i=i+t[e])})();function lZ(t){if(t<768)return!1;for(let e=0,i=By.length;;){let n=e+i>>1;if(t<By[n])i=n;else if(t>=AE[n])e=n+1;else return!0;if(e==i)return!1}}function d2(t){return t>=127462&&t<=127487}const f2=8205;function cZ(t,e,i=!0,n=!0){return(i?ME:hZ)(t,e,n)}function ME(t,e,i){if(e==t.length)return e;e&&zE(t.charCodeAt(e))&&jE(t.charCodeAt(e-1))&&e--;let n=mv(t,e);for(e+=p2(n);e<t.length;){let r=mv(t,e);if(n==f2||r==f2||i&&lZ(r))e+=p2(r),n=r;else if(d2(r)){let s=0,a=e-2;for(;a>=0&&d2(mv(t,a));)s++,a-=2;if(s%2==0)break;e+=2}else break}return e}function hZ(t,e,i){for(;e>0;){let n=ME(t,e-2,i);if(n<e)return n;e--}return 0}function mv(t,e){let i=t.charCodeAt(e);if(!jE(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return zE(n)?(i-55296<<10)+(n-56320)+65536:i}function zE(t){return t>=56320&&t<57344}function jE(t){return t>=55296&&t<56320}function p2(t){return t<65536?1:2}let dt=class DE{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,i,n){[e,i]=_c(this,e,i);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(i,this.length,r,1),Br.from(r,this.length-(i-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,i=this.length){[e,i]=_c(this,e,i);let n=[];return this.decompose(e,i,n,0),Br.from(n,i-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let i=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new uu(this),s=new uu(e);for(let a=i,c=i;;){if(r.next(a),s.next(a),a=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(c+=r.value.length,r.done||c>=n)return!0}}iter(e=1){return new uu(this,e)}iterRange(e,i=this.length){return new BE(this,e,i)}iterLines(e,i){let n;if(e==null)n=this.iter();else{i==null&&(i=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,i==this.lines+1?this.length:i<=1?0:this.line(i-1).to))}return new LE(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?DE.empty:e.length<=32?new Ut(e):Br.from(Ut.split(e,[]))}};class Ut extends dt{constructor(e,i=uZ(e)){super(),this.text=e,this.length=i}get lines(){return this.text.length}get children(){return null}lineInner(e,i,n,r){for(let s=0;;s++){let a=this.text[s],c=r+a.length;if((i?n:c)>=e)return new dZ(r,c,n,a);r=c+1,n++}}decompose(e,i,n,r){let s=e<=0&&i>=this.length?this:new Ut(g2(this.text,e,i),Math.min(i,this.length)-Math.max(0,e));if(r&1){let a=n.pop(),c=jp(s.text,a.text.slice(),0,s.length);if(c.length<=32)n.push(new Ut(c,a.length+s.length));else{let h=c.length>>1;n.push(new Ut(c.slice(0,h)),new Ut(c.slice(h)))}}else n.push(s)}replace(e,i,n){if(!(n instanceof Ut))return super.replace(e,i,n);[e,i]=_c(this,e,i);let r=jp(this.text,jp(n.text,g2(this.text,0,e)),i),s=this.length+n.length-(i-e);return r.length<=32?new Ut(r,s):Br.from(Ut.split(r,[]),s)}sliceString(e,i=this.length,n=`
78
78
  `){[e,i]=_c(this,e,i);let r="";for(let s=0,a=0;s<=i&&a<this.text.length;a++){let c=this.text[a],h=s+c.length;s>e&&a&&(r+=n),e<h&&i>s&&(r+=c.slice(Math.max(0,e-s),i-s)),s=h+1}return r}flatten(e){for(let i of this.text)e.push(i)}scanIdentical(){return 0}static split(e,i){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(i.push(new Ut(n,r)),n=[],r=-1);return r>-1&&i.push(new Ut(n,r)),i}}class Br extends dt{constructor(e,i){super(),this.children=e,this.length=i,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,i,n,r){for(let s=0;;s++){let a=this.children[s],c=r+a.length,h=n+a.lines-1;if((i?h:c)>=e)return a.lineInner(e,i,n,r);r=c+1,n=h+1}}decompose(e,i,n,r){for(let s=0,a=0;a<=i&&s<this.children.length;s++){let c=this.children[s],h=a+c.length;if(e<=h&&i>=a){let d=r&((a<=e?1:0)|(h>=i?2:0));a>=e&&h<=i&&!d?n.push(c):c.decompose(e-a,i-a,n,d)}a=h+1}}replace(e,i,n){if([e,i]=_c(this,e,i),n.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let a=this.children[r],c=s+a.length;if(e>=s&&i<=c){let h=a.replace(e-s,i-s,n),d=this.lines-a.lines+h.lines;if(h.lines<d>>4&&h.lines>d>>6){let f=this.children.slice();return f[r]=h,new Br(f,this.length-(i-e)+n.length)}return super.replace(s,c,h)}s=c+1}return super.replace(e,i,n)}sliceString(e,i=this.length,n=`
79
79
  `){[e,i]=_c(this,e,i);let r="";for(let s=0,a=0;s<this.children.length&&a<=i;s++){let c=this.children[s],h=a+c.length;a>e&&s&&(r+=n),e<h&&i>a&&(r+=c.sliceString(e-a,i-a,n)),a=h+1}return r}flatten(e){for(let i of this.children)i.flatten(e)}scanIdentical(e,i){if(!(e instanceof Br))return 0;let n=0,[r,s,a,c]=i>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=i,s+=i){if(r==a||s==c)return n;let h=this.children[r],d=e.children[s];if(h!=d)return n+h.scanIdentical(d,i);n+=h.length+1}}static from(e,i=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let O of e)n+=O.lines;if(n<32){let O=[];for(let S of e)S.flatten(O);return new Ut(O,i)}let r=Math.max(32,n>>5),s=r<<1,a=r>>1,c=[],h=0,d=-1,f=[];function g(O){let S;if(O.lines>s&&O instanceof Br)for(let _ of O.children)g(_);else O.lines>a&&(h>a||!h)?(m(),c.push(O)):O instanceof Ut&&h&&(S=f[f.length-1])instanceof Ut&&O.lines+S.lines<=32?(h+=O.lines,d+=O.length+1,f[f.length-1]=new Ut(S.text.concat(O.text),S.length+1+O.length)):(h+O.lines>r&&m(),h+=O.lines,d+=O.length+1,f.push(O))}function m(){h!=0&&(c.push(f.length==1?f[0]:Br.from(f,d)),d=-1,h=f.length=0)}for(let O of e)g(O);return m(),c.length==1?c[0]:new Br(c,i)}}dt.empty=new Ut([""],0);function uZ(t){let e=-1;for(let i of t)e+=i.length+1;return e}function jp(t,e,i=0,n=1e9){for(let r=0,s=0,a=!0;s<t.length&&r<=n;s++){let c=t[s],h=r+c.length;h>=i&&(h>n&&(c=c.slice(0,n-r)),r<i&&(c=c.slice(i-r)),a?(e[e.length-1]+=c,a=!1):e.push(c)),r=h+1}return e}function g2(t,e,i){return jp(t,[""],e,i)}class uu{constructor(e,i=1){this.dir=i,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[i>0?1:(e instanceof Ut?e.text.length:e.children.length)<<1]}nextInner(e,i){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],a=s>>1,c=r instanceof Ut?r.text.length:r.children.length;if(a==(i>0?c:0)){if(n==0)return this.done=!0,this.value="",this;i>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(i>0?0:1)){if(this.offsets[n]+=i,e==0)return this.lineBreak=!0,this.value=`
80
80
  `,this;e--}else if(r instanceof Ut){let h=r.text[a+(i<0?-1:0)];if(this.offsets[n]+=i,h.length>Math.max(0,e))return this.value=e==0?h:i>0?h.slice(e):h.slice(0,h.length-e),this;e-=h.length}else{let h=r.children[a+(i<0?-1:0)];e>h.length?(e-=h.length,this.offsets[n]+=i):(i<0&&this.offsets[n]--,this.nodes.push(h),this.offsets.push(i>0?1:(h instanceof Ut?h.text.length:h.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class BE{constructor(e,i,n){this.value="",this.done=!1,this.cursor=new uu(e,i>n?-1:1),this.pos=i>n?e.length:0,this.from=Math.min(i,n),this.to=Math.max(i,n)}nextInner(e,i){if(i<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,i<0?this.pos-this.to:this.from-this.pos);let n=i<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*i,this.value=r.length<=n?r:i<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class LE{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:i,lineBreak:n,value:r}=this.inner.next(e);return i&&this.afterBreak?(this.value="",this.afterBreak=!1):i?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(dt.prototype[Symbol.iterator]=function(){return this.iter()},uu.prototype[Symbol.iterator]=BE.prototype[Symbol.iterator]=LE.prototype[Symbol.iterator]=function(){return this});let dZ=class{constructor(e,i,n,r){this.from=e,this.to=i,this.number=n,this.text=r}get length(){return this.to-this.from}};function _c(t,e,i){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,i))]}function xi(t,e,i=!0,n=!0){return cZ(t,e,i,n)}function fZ(t){return t>=56320&&t<57344}function pZ(t){return t>=55296&&t<56320}function To(t,e){let i=t.charCodeAt(e);if(!pZ(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return fZ(n)?(i-55296<<10)+(n-56320)+65536:i}function XE(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Ca(t){return t<65536?1:2}const Ly=/\r\n?|\n/;var Ji=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Ji||(Ji={}));class Ir{constructor(e){this.sections=e}get length(){let e=0;for(let i=0;i<this.sections.length;i+=2)e+=this.sections[i];return e}get newLength(){let e=0;for(let i=0;i<this.sections.length;i+=2){let n=this.sections[i+1];e+=n<0?this.sections[i]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let i=0,n=0,r=0;i<this.sections.length;){let s=this.sections[i++],a=this.sections[i++];a<0?(e(n,r,s),r+=s):r+=a,n+=s}}iterChangedRanges(e,i=!1){Xy(this,e,i)}get invertedDesc(){let e=[];for(let i=0;i<this.sections.length;){let n=this.sections[i++],r=this.sections[i++];r<0?e.push(n,r):e.push(r,n)}return new Ir(e)}composeDesc(e){return this.empty?e:e.empty?this:NE(this,e)}mapDesc(e,i=!1){return e.empty?this:Ny(this,e,i)}mapPos(e,i=-1,n=Ji.Simple){let r=0,s=0;for(let a=0;a<this.sections.length;){let c=this.sections[a++],h=this.sections[a++],d=r+c;if(h<0){if(d>e)return s+(e-r);s+=c}else{if(n!=Ji.Simple&&d>=e&&(n==Ji.TrackDel&&r<e&&d>e||n==Ji.TrackBefore&&r<e||n==Ji.TrackAfter&&d>e))return null;if(d>e||d==e&&i<0&&!c)return e==r||i<0?s:s+h;s+=h}r=d}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,i=e){for(let n=0,r=0;n<this.sections.length&&r<=i;){let s=this.sections[n++],a=this.sections[n++],c=r+s;if(a>=0&&r<=i&&c>=e)return r<e&&c>i?"cover":!0;r=c}return!1}toString(){let e="";for(let i=0;i<this.sections.length;){let n=this.sections[i++],r=this.sections[i++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(i=>typeof i!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ir(e)}static create(e){return new Ir(e)}}class fi extends Ir{constructor(e,i){super(e),this.inserted=i}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Xy(this,(i,n,r,s,a)=>e=e.replace(r,r+(n-i),a),!1),e}mapDesc(e,i=!1){return Ny(this,e,i,!0)}invert(e){let i=this.sections.slice(),n=[];for(let r=0,s=0;r<i.length;r+=2){let a=i[r],c=i[r+1];if(c>=0){i[r]=c,i[r+1]=a;let h=r>>1;for(;n.length<h;)n.push(dt.empty);n.push(a?e.slice(s,s+a):dt.empty)}s+=a}return new fi(i,n)}compose(e){return this.empty?e:e.empty?this:NE(this,e,!0)}map(e,i=!1){return e.empty?this:Ny(this,e,i,!0)}iterChanges(e,i=!1){Xy(this,e,i)}get desc(){return Ir.create(this.sections)}filter(e){let i=[],n=[],r=[],s=new $u(this);e:for(let a=0,c=0;;){let h=a==e.length?1e9:e[a++];for(;c<h||c==h&&s.len==0;){if(s.done)break e;let f=Math.min(s.len,h-c);Ni(r,f,-1);let g=s.ins==-1?-1:s.off==0?s.ins:0;Ni(i,f,g),g>0&&Ao(n,i,s.text),s.forward(f),c+=f}let d=e[a++];for(;c<d;){if(s.done)break e;let f=Math.min(s.len,d-c);Ni(i,f,-1),Ni(r,f,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(f),c+=f}}return{changes:new fi(i,n),filtered:Ir.create(r)}}toJSON(){let e=[];for(let i=0;i<this.sections.length;i+=2){let n=this.sections[i],r=this.sections[i+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[i>>1].toJSON()))}return e}static of(e,i,n){let r=[],s=[],a=0,c=null;function h(f=!1){if(!f&&!r.length)return;a<i&&Ni(r,i-a,-1);let g=new fi(r,s);c=c?c.compose(g.map(c)):g,r=[],s=[],a=0}function d(f){if(Array.isArray(f))for(let g of f)d(g);else if(f instanceof fi){if(f.length!=i)throw new RangeError(`Mismatched change set length (got ${f.length}, expected ${i})`);h(),c=c?c.compose(f.map(c)):f}else{let{from:g,to:m=g,insert:O}=f;if(g>m||g<0||m>i)throw new RangeError(`Invalid change range ${g} to ${m} (in doc of length ${i})`);let S=O?typeof O=="string"?dt.of(O.split(n||Ly)):O:dt.empty,_=S.length;if(g==m&&_==0)return;g<a&&h(),g>a&&Ni(r,g-a,-1),Ni(r,m-g,_),Ao(s,r,S),a=m}}return d(e),h(!c),c}static empty(e){return new fi(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let i=[],n=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")i.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((a,c)=>c&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)i.push(s[0],0);else{for(;n.length<r;)n.push(dt.empty);n[r]=dt.of(s.slice(1)),i.push(s[0],n[r].length)}}}return new fi(i,n)}static createSet(e,i){return new fi(e,i)}}function Ni(t,e,i,n=!1){if(e==0&&i<=0)return;let r=t.length-2;r>=0&&i<=0&&i==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=i:n?(t[r]+=e,t[r+1]+=i):t.push(e,i)}function Ao(t,e,i){if(i.length==0)return;let n=e.length-2>>1;if(n<t.length)t[t.length-1]=t[t.length-1].append(i);else{for(;t.length<n;)t.push(dt.empty);t.push(i)}}function Xy(t,e,i){let n=t.inserted;for(let r=0,s=0,a=0;a<t.sections.length;){let c=t.sections[a++],h=t.sections[a++];if(h<0)r+=c,s+=c;else{let d=r,f=s,g=dt.empty;for(;d+=c,f+=h,h&&n&&(g=g.append(n[a-2>>1])),!(i||a==t.sections.length||t.sections[a+1]<0);)c=t.sections[a++],h=t.sections[a++];e(r,d,s,f,g),r=d,s=f}}}function Ny(t,e,i,n=!1){let r=[],s=n?[]:null,a=new $u(t),c=new $u(e);for(let h=-1;;){if(a.done&&c.len||c.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&c.ins==-1){let d=Math.min(a.len,c.len);Ni(r,d,-1),a.forward(d),c.forward(d)}else if(c.ins>=0&&(a.ins<0||h==a.i||a.off==0&&(c.len<a.len||c.len==a.len&&!i))){let d=c.len;for(Ni(r,c.ins,-1);d;){let f=Math.min(a.len,d);a.ins>=0&&h<a.i&&a.len<=f&&(Ni(r,0,a.ins),s&&Ao(s,r,a.text),h=a.i),a.forward(f),d-=f}c.next()}else if(a.ins>=0){let d=0,f=a.len;for(;f;)if(c.ins==-1){let g=Math.min(f,c.len);d+=g,f-=g,c.forward(g)}else if(c.ins==0&&c.len<f)f-=c.len,c.next();else break;Ni(r,d,h<a.i?a.ins:0),s&&h<a.i&&Ao(s,r,a.text),h=a.i,a.forward(a.len-f)}else{if(a.done&&c.done)return s?fi.createSet(r,s):Ir.create(r);throw new Error("Mismatched change set lengths")}}}function NE(t,e,i=!1){let n=[],r=i?[]:null,s=new $u(t),a=new $u(e);for(let c=!1;;){if(s.done&&a.done)return r?fi.createSet(n,r):Ir.create(n);if(s.ins==0)Ni(n,s.len,0,c),s.next();else if(a.len==0&&!a.done)Ni(n,0,a.ins,c),r&&Ao(r,n,a.text),a.next();else{if(s.done||a.done)throw new Error("Mismatched change set lengths");{let h=Math.min(s.len2,a.len),d=n.length;if(s.ins==-1){let f=a.ins==-1?-1:a.off?0:a.ins;Ni(n,h,f,c),r&&f&&Ao(r,n,a.text)}else a.ins==-1?(Ni(n,s.off?0:s.len,h,c),r&&Ao(r,n,s.textBit(h))):(Ni(n,s.off?0:s.len,a.off?0:a.ins,c),r&&!a.off&&Ao(r,n,a.text));c=(s.ins>h||a.ins>=0&&a.len>h)&&(c||n.length>d),s.forward2(h),a.forward(h)}}}}class $u{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length?dt.empty:e[i]}textBit(e){let{inserted:i}=this.set,n=this.i-2>>1;return n>=i.length&&!e?dt.empty:i[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Pa{constructor(e,i,n){this.from=e,this.to=i,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,i=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,i):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new Pa(n,r,this.flags)}extend(e,i=e,n=0){if(e<=this.anchor&&i>=this.anchor)return le.range(e,i,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(i-this.anchor)?e:i;return le.range(this.anchor,r,void 0,void 0,n)}eq(e,i=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!i||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return le.range(e.anchor,e.head)}static create(e,i,n){return new Pa(e,i,n)}}class le{constructor(e,i){this.ranges=e,this.mainIndex=i}map(e,i=-1){return e.empty?this:le.create(this.ranges.map(n=>n.map(e,i)),this.mainIndex)}eq(e,i=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],i))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new le([this.main],0)}addRange(e,i=!0){return le.create([e].concat(this.ranges),i?0:this.mainIndex+1)}replaceRange(e,i=this.mainIndex){let n=this.ranges.slice();return n[i]=e,le.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new le(e.ranges.map(i=>Pa.fromJSON(i)),e.main)}static single(e,i=e){return new le([le.range(e,i)],0)}static create(e,i=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=n:s.from<n)return le.normalized(e.slice(),i);n=s.to}return new le(e,i)}static cursor(e,i=0,n,r){return Pa.create(e,e,(i==0?0:i<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,i,n,r,s){let a=(n??16777215)<<6|(r==null?7:Math.min(6,r));return!s&&e!=i&&(s=i<e?1:-1),i<e?Pa.create(i,e,48|a):Pa.create(e,i,(s?s<0?8:16:0)|a)}static normalized(e,i=0){let n=e[i];e.sort((r,s)=>r.from-s.from),i=e.indexOf(n);for(let r=1;r<e.length;r++){let s=e[r],a=e[r-1];if(s.empty?s.from<=a.to:s.from<a.to){let c=a.from,h=Math.max(s.to,a.to);r<=i&&i--,e.splice(--r,2,s.anchor>s.head?le.range(h,c):le.range(c,h))}}return new le(e,i)}}function ZE(t,e){for(let i of t.ranges)if(i.to>e)throw new RangeError("Selection points outside of document")}let G1=0;class xe{constructor(e,i,n,r,s){this.combine=e,this.compareInput=i,this.compare=n,this.isStatic=r,this.id=G1++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new xe(e.combine||(i=>i),e.compareInput||((i,n)=>i===n),e.compare||(e.combine?(i,n)=>i===n:F1),!!e.static,e.enables)}of(e){return new Dp([],this,0,e)}compute(e,i){if(this.isStatic)throw new Error("Can't compute a static facet");return new Dp(e,this,1,i)}computeN(e,i){if(this.isStatic)throw new Error("Can't compute a static facet");return new Dp(e,this,2,i)}from(e,i){return i||(i=n=>n),this.compute([e],n=>i(n.field(e)))}}function F1(t,e){return t==e||t.length==e.length&&t.every((i,n)=>i===e[n])}class Dp{constructor(e,i,n,r){this.dependencies=e,this.facet=i,this.type=n,this.value=r,this.id=G1++}dynamicSlot(e){var i;let n=this.value,r=this.facet.compareInput,s=this.id,a=e[s]>>1,c=this.type==2,h=!1,d=!1,f=[];for(let g of this.dependencies)g=="doc"?h=!0:g=="selection"?d=!0:(((i=e[g.id])!==null&&i!==void 0?i:1)&1)==0&&f.push(e[g.id]);return{create(g){return g.values[a]=n(g),1},update(g,m){if(h&&m.docChanged||d&&(m.docChanged||m.selection)||Zy(g,f)){let O=n(g);if(c?!m2(O,g.values[a],r):!r(O,g.values[a]))return g.values[a]=O,1}return 0},reconfigure:(g,m)=>{let O,S=m.config.address[s];if(S!=null){let _=gg(m,S);if(this.dependencies.every(w=>w instanceof xe?m.facet(w)===g.facet(w):w instanceof Nn?m.field(w,!1)==g.field(w,!1):!0)||(c?m2(O=n(g),_,r):r(O=n(g),_)))return g.values[a]=_,0}else O=n(g);return g.values[a]=O,1}}}}function m2(t,e,i){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!i(t[n],e[n]))return!1;return!0}function Zy(t,e){let i=!1;for(let n of e)du(t,n)&1&&(i=!0);return i}function gZ(t,e,i){let n=i.map(h=>t[h.id]),r=i.map(h=>h.type),s=n.filter(h=>!(h&1)),a=t[e.id]>>1;function c(h){let d=[];for(let f=0;f<n.length;f++){let g=gg(h,n[f]);if(r[f]==2)for(let m of g)d.push(m);else d.push(g)}return e.combine(d)}return{create(h){for(let d of n)du(h,d);return h.values[a]=c(h),1},update(h,d){if(!Zy(h,s))return 0;let f=c(h);return e.compare(f,h.values[a])?0:(h.values[a]=f,1)},reconfigure(h,d){let f=Zy(h,n),g=d.config.facets[e.id],m=d.facet(e);if(g&&!f&&F1(i,g))return h.values[a]=m,0;let O=c(h);return e.compare(O,m)?(h.values[a]=m,0):(h.values[a]=O,1)}}}const tp=xe.define({static:!0});class Nn{constructor(e,i,n,r,s){this.id=e,this.createF=i,this.updateF=n,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let i=new Nn(G1++,e.create,e.update,e.compare||((n,r)=>n===r),e);return e.provide&&(i.provides=e.provide(i)),i}create(e){let i=e.facet(tp).find(n=>n.field==this);return((i==null?void 0:i.create)||this.createF)(e)}slot(e){let i=e[this.id]>>1;return{create:n=>(n.values[i]=this.create(n),1),update:(n,r)=>{let s=n.values[i],a=this.updateF(s,r);return this.compareF(s,a)?0:(n.values[i]=a,1)},reconfigure:(n,r)=>{let s=n.facet(tp),a=r.facet(tp),c;return(c=s.find(h=>h.field==this))&&c!=a.find(h=>h.field==this)?(n.values[i]=c.create(n),1):r.config.address[this.id]!=null?(n.values[i]=r.field(this),0):(n.values[i]=this.create(n),1)}}}init(e){return[this,tp.of({field:this,create:e})]}get extension(){return this}}const Ta={lowest:4,low:3,default:2,high:1,highest:0};function Lh(t){return e=>new WE(e,t)}const Bs={highest:Lh(Ta.highest),high:Lh(Ta.high),default:Lh(Ta.default),low:Lh(Ta.low),lowest:Lh(Ta.lowest)};class WE{constructor(e,i){this.inner=e,this.prec=i}}class nd{of(e){return new Wy(this,e)}reconfigure(e){return nd.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Wy{constructor(e,i){this.compartment=e,this.inner=i}}class pg{constructor(e,i,n,r,s,a){for(this.base=e,this.compartments=i,this.dynamicSlots=n,this.address=r,this.staticValues=s,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let i=this.address[e.id];return i==null?e.default:this.staticValues[i>>1]}static resolve(e,i,n){let r=[],s=Object.create(null),a=new Map;for(let m of mZ(e,i,a))m instanceof Nn?r.push(m):(s[m.facet.id]||(s[m.facet.id]=[])).push(m);let c=Object.create(null),h=[],d=[];for(let m of r)c[m.id]=d.length<<1,d.push(O=>m.slot(O));let f=n==null?void 0:n.config.facets;for(let m in s){let O=s[m],S=O[0].facet,_=f&&f[m]||[];if(O.every(w=>w.type==0))if(c[S.id]=h.length<<1|1,F1(_,O))h.push(n.facet(S));else{let w=S.combine(O.map(x=>x.value));h.push(n&&S.compare(w,n.facet(S))?n.facet(S):w)}else{for(let w of O)w.type==0?(c[w.id]=h.length<<1|1,h.push(w.value)):(c[w.id]=d.length<<1,d.push(x=>w.dynamicSlot(x)));c[S.id]=d.length<<1,d.push(w=>gZ(w,S,O))}}let g=d.map(m=>m(c));return new pg(e,a,g,c,h,s)}}function mZ(t,e,i){let n=[[],[],[],[],[]],r=new Map;function s(a,c){let h=r.get(a);if(h!=null){if(h<=c)return;let d=n[h].indexOf(a);d>-1&&n[h].splice(d,1),a instanceof Wy&&i.delete(a.compartment)}if(r.set(a,c),Array.isArray(a))for(let d of a)s(d,c);else if(a instanceof Wy){if(i.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(a.compartment)||a.inner;i.set(a.compartment,d),s(d,c)}else if(a instanceof WE)s(a.inner,a.prec);else if(a instanceof Nn)n[c].push(a),a.provides&&s(a.provides,c);else if(a instanceof Dp)n[c].push(a),a.facet.extensions&&s(a.facet.extensions,Ta.default);else{let d=a.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(d,c)}}return s(t,Ta.default),n.reduce((a,c)=>a.concat(c))}function du(t,e){if(e&1)return 2;let i=e>>1,n=t.status[i];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;t.status[i]=4;let r=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|r}function gg(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const qE=xe.define(),qy=xe.define({combine:t=>t.some(e=>e),static:!0}),VE=xe.define({combine:t=>t.length?t[0]:void 0,static:!0}),IE=xe.define(),YE=xe.define(),HE=xe.define(),UE=xe.define({combine:t=>t.length?t[0]:!1});class Ls{constructor(e,i){this.type=e,this.value=i}static define(){return new OZ}}class OZ{of(e){return new Ls(this,e)}}class vZ{constructor(e){this.map=e}of(e){return new et(this,e)}}class et{constructor(e,i){this.type=e,this.value=i}map(e){let i=this.type.map(this.value,e);return i===void 0?void 0:i==this.value?this:new et(this.type,i)}is(e){return this.type==e}static define(e={}){return new vZ(e.map||(i=>i))}static mapEffects(e,i){if(!e.length)return e;let n=[];for(let r of e){let s=r.map(i);s&&n.push(s)}return n}}et.reconfigure=et.define();et.appendConfig=et.define();class oi{constructor(e,i,n,r,s,a){this.startState=e,this.changes=i,this.selection=n,this.effects=r,this.annotations=s,this.scrollIntoView=a,this._doc=null,this._state=null,n&&ZE(n,i.newLength),s.some(c=>c.type==oi.time)||(this.annotations=s.concat(oi.time.of(Date.now())))}static create(e,i,n,r,s,a){return new oi(e,i,n,r,s,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let i of this.annotations)if(i.type==e)return i.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let i=this.annotation(oi.userEvent);return!!(i&&(i==e||i.length>e.length&&i.slice(0,e.length)==e&&i[e.length]=="."))}}oi.time=Ls.define();oi.userEvent=Ls.define();oi.addToHistory=Ls.define();oi.remote=Ls.define();function yZ(t,e){let i=[];for(let n=0,r=0;;){let s,a;if(n<t.length&&(r==e.length||e[r]>=t[n]))s=t[n++],a=t[n++];else if(r<e.length)s=e[r++],a=e[r++];else return i;!i.length||i[i.length-1]<s?i.push(s,a):i[i.length-1]<a&&(i[i.length-1]=a)}}function GE(t,e,i){var n;let r,s,a;return i?(r=e.changes,s=fi.empty(e.changes.length),a=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),a=t.changes.compose(r)),{changes:a,selection:e.selection?e.selection.map(s):(n=t.selection)===null||n===void 0?void 0:n.map(r),effects:et.mapEffects(t.effects,r).concat(et.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function Vy(t,e,i){let n=e.selection,r=sc(e.annotations);return e.userEvent&&(r=r.concat(oi.userEvent.of(e.userEvent))),{changes:e.changes instanceof fi?e.changes:fi.of(e.changes||[],i,t.facet(VE)),selection:n&&(n instanceof le?n:le.single(n.anchor,n.head)),effects:sc(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function FE(t,e,i){let n=Vy(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(i=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(i=!1);let a=!!e[s].sequential;n=GE(n,Vy(t,e[s],a?n.changes.newLength:t.doc.length),a)}let r=oi.create(t,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return bZ(i?SZ(r):r)}function SZ(t){let e=t.startState,i=!0;for(let r of e.facet(IE)){let s=r(t);if(s===!1){i=!1;break}Array.isArray(s)&&(i=i===!0?s:yZ(i,s))}if(i!==!0){let r,s;if(i===!1)s=t.changes.invertedDesc,r=fi.empty(e.doc.length);else{let a=t.changes.filter(i);r=a.changes,s=a.filtered.mapDesc(a.changes).invertedDesc}t=oi.create(e,r,t.selection&&t.selection.map(s),et.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let n=e.facet(YE);for(let r=n.length-1;r>=0;r--){let s=n[r](t);s instanceof oi?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof oi?t=s[0]:t=FE(e,sc(s),!1)}return t}function bZ(t){let e=t.startState,i=e.facet(HE),n=t;for(let r=i.length-1;r>=0;r--){let s=i[r](t);s&&Object.keys(s).length&&(n=GE(n,Vy(e,s,t.changes.newLength),!0))}return n==t?t:oi.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}const _Z=[];function sc(t){return t==null?_Z:Array.isArray(t)?t:[t]}var Gt=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Gt||(Gt={}));const xZ=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Iy;try{Iy=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function wZ(t){if(Iy)return Iy.test(t);for(let e=0;e<t.length;e++){let i=t[e];if(/\w/.test(i)||i>"€"&&(i.toUpperCase()!=i.toLowerCase()||xZ.test(i)))return!0}return!1}function kZ(t){return e=>{if(!/\S/.test(e))return Gt.Space;if(wZ(e))return Gt.Word;for(let i=0;i<t.length;i++)if(e.indexOf(t[i])>-1)return Gt.Word;return Gt.Other}}class ct{constructor(e,i,n,r,s,a){this.config=e,this.doc=i,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,a&&(a._state=this);for(let c=0;c<this.config.dynamicSlots.length;c++)du(this,c<<1);this.computeSlot=null}field(e,i=!0){let n=this.config.address[e.id];if(n==null){if(i)throw new RangeError("Field is not present in this state");return}return du(this,n),gg(this,n)}update(...e){return FE(this,e,!0)}applyTransaction(e){let i=this.config,{base:n,compartments:r}=i;for(let c of e.effects)c.is(nd.reconfigure)?(i&&(r=new Map,i.compartments.forEach((h,d)=>r.set(d,h)),i=null),r.set(c.value.compartment,c.value.extension)):c.is(et.reconfigure)?(i=null,n=c.value):c.is(et.appendConfig)&&(i=null,n=sc(n).concat(c.value));let s;i?s=e.startState.values.slice():(i=pg.resolve(n,r,this),s=new ct(i,this.doc,this.selection,i.dynamicSlots.map(()=>null),(h,d)=>d.reconfigure(h,this),null).values);let a=e.startState.facet(qy)?e.newSelection:e.newSelection.asSingle();new ct(i,e.newDoc,a,s,(c,h)=>h.update(c,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:e},range:le.cursor(i.from+e.length)}))}changeByRange(e){let i=this.selection,n=e(i.ranges[0]),r=this.changes(n.changes),s=[n.range],a=sc(n.effects);for(let c=1;c<i.ranges.length;c++){let h=e(i.ranges[c]),d=this.changes(h.changes),f=d.map(r);for(let m=0;m<c;m++)s[m]=s[m].map(f);let g=r.mapDesc(d,!0);s.push(h.range.map(g)),r=r.compose(f),a=et.mapEffects(a,f).concat(et.mapEffects(sc(h.effects),g))}return{changes:r,selection:le.create(s,i.mainIndex),effects:a}}changes(e=[]){return e instanceof fi?e:fi.of(e,this.doc.length,this.facet(ct.lineSeparator))}toText(e){return dt.of(e.split(this.facet(ct.lineSeparator)||Ly))}sliceDoc(e=0,i=this.doc.length){return this.doc.sliceString(e,i,this.lineBreak)}facet(e){let i=this.config.address[e.id];return i==null?e.default:(du(this,i),gg(this,i))}toJSON(e){let i={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof Nn&&this.config.address[r.id]!=null&&(i[n]=r.spec.toJSON(this.field(e[n]),this))}return i}static fromJSON(e,i={},n){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(n){for(let s in n)if(Object.prototype.hasOwnProperty.call(e,s)){let a=n[s],c=e[s];r.push(a.init(h=>a.spec.fromJSON(c,h)))}}return ct.create({doc:e.doc,selection:le.fromJSON(e.selection),extensions:i.extensions?r.concat([i.extensions]):r})}static create(e={}){let i=pg.resolve(e.extensions||[],new Map),n=e.doc instanceof dt?e.doc:dt.of((e.doc||"").split(i.staticFacet(ct.lineSeparator)||Ly)),r=e.selection?e.selection instanceof le?e.selection:le.single(e.selection.anchor,e.selection.head):le.single(0);return ZE(r,n.length),i.staticFacet(qy)||(r=r.asSingle()),new ct(i,n,r,i.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(ct.tabSize)}get lineBreak(){return this.facet(ct.lineSeparator)||`