voicecc 1.1.13 → 1.1.15

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.
@@ -8,4 +8,4 @@ Error generating stack: `+a.message+`
8
8
  `+a.stack}}var Au=Object.prototype.hasOwnProperty,zu=u.unstable_scheduleCallback,Ru=u.unstable_cancelCallback,Mm=u.unstable_shouldYield,Nm=u.unstable_requestPaint,ht=u.unstable_now,_m=u.unstable_getCurrentPriorityLevel,hr=u.unstable_ImmediatePriority,mr=u.unstable_UserBlockingPriority,Fn=u.unstable_NormalPriority,Om=u.unstable_LowPriority,gr=u.unstable_IdlePriority,Dm=u.log,wm=u.unstable_setDisableYieldValue,Za=null,mt=null;function dl(e){if(typeof Dm=="function"&&wm(e),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(Za,e)}catch{}}var gt=Math.clz32?Math.clz32:Lm,Um=Math.log,Bm=Math.LN2;function Lm(e){return e>>>=0,e===0?32:31-(Um(e)/Bm|0)|0}var In=256,Pn=262144,ei=4194304;function Yl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ti(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var n=0,i=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var m=a&134217727;return m!==0?(a=m&~i,a!==0?n=Yl(a):(s&=m,s!==0?n=Yl(s):l||(l=m&~e,l!==0&&(n=Yl(l))))):(m=a&~i,m!==0?n=Yl(m):s!==0?n=Yl(s):l||(l=a&~e,l!==0&&(n=Yl(l)))),n===0?0:t!==0&&t!==n&&(t&i)===0&&(i=n&-n,l=t&-t,i>=l||i===32&&(l&4194048)!==0)?t:n}function Ka(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Hm(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function yr(){var e=ei;return ei<<=1,(ei&62914560)===0&&(ei=4194304),e}function Mu(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Ja(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ym(e,t,l,a,n,i){var s=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var m=e.entanglements,b=e.expirationTimes,M=e.hiddenUpdates;for(l=s&~l;0<l;){var L=31-gt(l),Q=1<<L;m[L]=0,b[L]=-1;var D=M[L];if(D!==null)for(M[L]=null,L=0;L<D.length;L++){var w=D[L];w!==null&&(w.lane&=-536870913)}l&=~Q}a!==0&&pr(e,a,0),i!==0&&n===0&&e.tag!==0&&(e.suspendedLanes|=i&~(s&~t))}function pr(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-gt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|l&261930}function vr(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var a=31-gt(l),n=1<<a;n&t|e[a]&t&&(e[a]|=t),l&=~n}}function Sr(e,t){var l=t&-t;return l=(l&42)!==0?1:Nu(l),(l&(e.suspendedLanes|t))!==0?0:l}function Nu(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function _u(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function xr(){var e=Z.p;return e!==0?e:(e=window.event,e===void 0?32:ch(e.type))}function br(e,t){var l=Z.p;try{return Z.p=e,t()}finally{Z.p=l}}var hl=Math.random().toString(36).slice(2),We="__reactFiber$"+hl,ut="__reactProps$"+hl,na="__reactContainer$"+hl,Ou="__reactEvents$"+hl,qm="__reactListeners$"+hl,Gm="__reactHandles$"+hl,Er="__reactResources$"+hl,$a="__reactMarker$"+hl;function Du(e){delete e[We],delete e[ut],delete e[Ou],delete e[qm],delete e[Gm]}function ia(e){var t=e[We];if(t)return t;for(var l=e.parentNode;l;){if(t=l[na]||l[We]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=kd(e);e!==null;){if(l=e[We])return l;e=kd(e)}return t}e=l,l=e.parentNode}return null}function ua(e){if(e=e[We]||e[na]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Wa(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function ca(e){var t=e[Er];return t||(t=e[Er]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Je(e){e[$a]=!0}var Cr=new Set,jr={};function ql(e,t){sa(e,t),sa(e+"Capture",t)}function sa(e,t){for(jr[e]=t,e=0;e<t.length;e++)Cr.add(t[e])}var Qm=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]*$"),Tr={},Ar={};function Vm(e){return Au.call(Ar,e)?!0:Au.call(Tr,e)?!1:Qm.test(e)?Ar[e]=!0:(Tr[e]=!0,!1)}function li(e,t,l){if(Vm(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function ai(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function Xt(e,t,l,a){if(a===null)e.removeAttribute(l);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+a)}}function Ct(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zr(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Xm(e,t,l){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var n=a.get,i=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(s){l=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(s){l=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function wu(e){if(!e._valueTracker){var t=zr(e)?"checked":"value";e._valueTracker=Xm(e,t,""+e[t])}}function Rr(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),a="";return e&&(a=zr(e)?e.checked?"true":"false":e.value),e=a,e!==l?(t.setValue(e),!0):!1}function ni(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var km=/[\n"\\]/g;function jt(e){return e.replace(km,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Uu(e,t,l,a,n,i,s,m){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ct(t)):e.value!==""+Ct(t)&&(e.value=""+Ct(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?Bu(e,s,Ct(t)):l!=null?Bu(e,s,Ct(l)):a!=null&&e.removeAttribute("value"),n==null&&i!=null&&(e.defaultChecked=!!i),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.name=""+Ct(m):e.removeAttribute("name")}function Mr(e,t,l,a,n,i,s,m){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||l!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){wu(e);return}l=l!=null?""+Ct(l):"",t=t!=null?""+Ct(t):l,m||t===e.value||(e.value=t),e.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=m?e.checked:!!a,e.defaultChecked=!!a,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s),wu(e)}function Bu(e,t,l){t==="number"&&ni(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function ra(e,t,l,a){if(e=e.options,t){t={};for(var n=0;n<l.length;n++)t["$"+l[n]]=!0;for(l=0;l<e.length;l++)n=t.hasOwnProperty("$"+e[l].value),e[l].selected!==n&&(e[l].selected=n),n&&a&&(e[l].defaultSelected=!0)}else{for(l=""+Ct(l),t=null,n=0;n<e.length;n++){if(e[n].value===l){e[n].selected=!0,a&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function Nr(e,t,l){if(t!=null&&(t=""+Ct(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Ct(l):""}function _r(e,t,l,a){if(t==null){if(a!=null){if(l!=null)throw Error(r(92));if(De(a)){if(1<a.length)throw Error(r(93));a=a[0]}l=a}l==null&&(l=""),t=l}l=Ct(t),e.defaultValue=l,a=e.textContent,a===l&&a!==""&&a!==null&&(e.value=a),wu(e)}function oa(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var Zm=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 Or(e,t,l){var a=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,l):typeof l!="number"||l===0||Zm.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function Dr(e,t,l){if(t!=null&&typeof t!="object")throw Error(r(62));if(e=e.style,l!=null){for(var a in l)!l.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var n in t)a=t[n],t.hasOwnProperty(n)&&l[n]!==a&&Or(e,n,a)}else for(var i in t)t.hasOwnProperty(i)&&Or(e,i,t[i])}function Lu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Km=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"]]),Jm=/^[\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 ii(e){return Jm.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function kt(){}var Hu=null;function Yu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var fa=null,da=null;function wr(e){var t=ua(e);if(t&&(e=t.stateNode)){var l=e[ut]||null;e:switch(e=t.stateNode,t.type){case"input":if(Uu(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+jt(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var a=l[t];if(a!==e&&a.form===e.form){var n=a[ut]||null;if(!n)throw Error(r(90));Uu(a,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name)}}for(t=0;t<l.length;t++)a=l[t],a.form===e.form&&Rr(a)}break e;case"textarea":Nr(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&ra(e,!!l.multiple,t,!1)}}}var qu=!1;function Ur(e,t,l){if(qu)return e(t,l);qu=!0;try{var a=e(t);return a}finally{if(qu=!1,(fa!==null||da!==null)&&(Zi(),fa&&(t=fa,e=da,da=fa=null,wr(t),e)))for(t=0;t<e.length;t++)wr(e[t])}}function Fa(e,t){var l=e.stateNode;if(l===null)return null;var a=l[ut]||null;if(a===null)return null;l=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(r(231,t,typeof l));return l}var Zt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gu=!1;if(Zt)try{var Ia={};Object.defineProperty(Ia,"passive",{get:function(){Gu=!0}}),window.addEventListener("test",Ia,Ia),window.removeEventListener("test",Ia,Ia)}catch{Gu=!1}var ml=null,Qu=null,ui=null;function Br(){if(ui)return ui;var e,t=Qu,l=t.length,a,n="value"in ml?ml.value:ml.textContent,i=n.length;for(e=0;e<l&&t[e]===n[e];e++);var s=l-e;for(a=1;a<=s&&t[l-a]===n[i-a];a++);return ui=n.slice(e,1<a?1-a:void 0)}function ci(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function si(){return!0}function Lr(){return!1}function ct(e){function t(l,a,n,i,s){this._reactName=l,this._targetInst=n,this.type=a,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var m in e)e.hasOwnProperty(m)&&(l=e[m],this[m]=l?l(i):i[m]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?si:Lr,this.isPropagationStopped=Lr,this}return p(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=si)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=si)},persist:function(){},isPersistent:si}),t}var Gl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ri=ct(Gl),Pa=p({},Gl,{view:0,detail:0}),$m=ct(Pa),Vu,Xu,en,oi=p({},Pa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==en&&(en&&e.type==="mousemove"?(Vu=e.screenX-en.screenX,Xu=e.screenY-en.screenY):Xu=Vu=0,en=e),Vu)},movementY:function(e){return"movementY"in e?e.movementY:Xu}}),Hr=ct(oi),Wm=p({},oi,{dataTransfer:0}),Fm=ct(Wm),Im=p({},Pa,{relatedTarget:0}),ku=ct(Im),Pm=p({},Gl,{animationName:0,elapsedTime:0,pseudoElement:0}),eg=ct(Pm),tg=p({},Gl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lg=ct(tg),ag=p({},Gl,{data:0}),Yr=ct(ag),ng={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ig={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"},ug={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ug[e])?!!t[e]:!1}function Zu(){return cg}var sg=p({},Pa,{key:function(e){if(e.key){var t=ng[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ci(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ig[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zu,charCode:function(e){return e.type==="keypress"?ci(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ci(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),rg=ct(sg),og=p({},oi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qr=ct(og),fg=p({},Pa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zu}),dg=ct(fg),hg=p({},Gl,{propertyName:0,elapsedTime:0,pseudoElement:0}),mg=ct(hg),gg=p({},oi,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),yg=ct(gg),pg=p({},Gl,{newState:0,oldState:0}),vg=ct(pg),Sg=[9,13,27,32],Ku=Zt&&"CompositionEvent"in window,tn=null;Zt&&"documentMode"in document&&(tn=document.documentMode);var xg=Zt&&"TextEvent"in window&&!tn,Gr=Zt&&(!Ku||tn&&8<tn&&11>=tn),Qr=" ",Vr=!1;function Xr(e,t){switch(e){case"keyup":return Sg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kr(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ha=!1;function bg(e,t){switch(e){case"compositionend":return kr(t);case"keypress":return t.which!==32?null:(Vr=!0,Qr);case"textInput":return e=t.data,e===Qr&&Vr?null:e;default:return null}}function Eg(e,t){if(ha)return e==="compositionend"||!Ku&&Xr(e,t)?(e=Br(),ui=Qu=ml=null,ha=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Gr&&t.locale!=="ko"?null:t.data;default:return null}}var Cg={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 Zr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Cg[e.type]:t==="textarea"}function Kr(e,t,l,a){fa?da?da.push(a):da=[a]:fa=a,t=Pi(t,"onChange"),0<t.length&&(l=new ri("onChange","change",null,l,a),e.push({event:l,listeners:t}))}var ln=null,an=null;function jg(e){_d(e,0)}function fi(e){var t=Wa(e);if(Rr(t))return e}function Jr(e,t){if(e==="change")return t}var $r=!1;if(Zt){var Ju;if(Zt){var $u="oninput"in document;if(!$u){var Wr=document.createElement("div");Wr.setAttribute("oninput","return;"),$u=typeof Wr.oninput=="function"}Ju=$u}else Ju=!1;$r=Ju&&(!document.documentMode||9<document.documentMode)}function Fr(){ln&&(ln.detachEvent("onpropertychange",Ir),an=ln=null)}function Ir(e){if(e.propertyName==="value"&&fi(an)){var t=[];Kr(t,an,e,Yu(e)),Ur(jg,t)}}function Tg(e,t,l){e==="focusin"?(Fr(),ln=t,an=l,ln.attachEvent("onpropertychange",Ir)):e==="focusout"&&Fr()}function Ag(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return fi(an)}function zg(e,t){if(e==="click")return fi(t)}function Rg(e,t){if(e==="input"||e==="change")return fi(t)}function Mg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yt=typeof Object.is=="function"?Object.is:Mg;function nn(e,t){if(yt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),a=Object.keys(t);if(l.length!==a.length)return!1;for(a=0;a<l.length;a++){var n=l[a];if(!Au.call(t,n)||!yt(e[n],t[n]))return!1}return!0}function Pr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function eo(e,t){var l=Pr(e);e=0;for(var a;l;){if(l.nodeType===3){if(a=e+l.textContent.length,e<=t&&a>=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Pr(l)}}function to(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?to(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lo(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ni(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=ni(e.document)}return t}function Wu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Ng=Zt&&"documentMode"in document&&11>=document.documentMode,ma=null,Fu=null,un=null,Iu=!1;function ao(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Iu||ma==null||ma!==ni(a)||(a=ma,"selectionStart"in a&&Wu(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),un&&nn(un,a)||(un=a,a=Pi(Fu,"onSelect"),0<a.length&&(t=new ri("onSelect","select",null,t,l),e.push({event:t,listeners:a}),t.target=ma)))}function Ql(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var ga={animationend:Ql("Animation","AnimationEnd"),animationiteration:Ql("Animation","AnimationIteration"),animationstart:Ql("Animation","AnimationStart"),transitionrun:Ql("Transition","TransitionRun"),transitionstart:Ql("Transition","TransitionStart"),transitioncancel:Ql("Transition","TransitionCancel"),transitionend:Ql("Transition","TransitionEnd")},Pu={},no={};Zt&&(no=document.createElement("div").style,"AnimationEvent"in window||(delete ga.animationend.animation,delete ga.animationiteration.animation,delete ga.animationstart.animation),"TransitionEvent"in window||delete ga.transitionend.transition);function Vl(e){if(Pu[e])return Pu[e];if(!ga[e])return e;var t=ga[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in no)return Pu[e]=t[l];return e}var io=Vl("animationend"),uo=Vl("animationiteration"),co=Vl("animationstart"),_g=Vl("transitionrun"),Og=Vl("transitionstart"),Dg=Vl("transitioncancel"),so=Vl("transitionend"),ro=new Map,ec="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(" ");ec.push("scrollEnd");function wt(e,t){ro.set(e,t),ql(t,[e])}var di=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Tt=[],ya=0,tc=0;function hi(){for(var e=ya,t=tc=ya=0;t<e;){var l=Tt[t];Tt[t++]=null;var a=Tt[t];Tt[t++]=null;var n=Tt[t];Tt[t++]=null;var i=Tt[t];if(Tt[t++]=null,a!==null&&n!==null){var s=a.pending;s===null?n.next=n:(n.next=s.next,s.next=n),a.pending=n}i!==0&&oo(l,n,i)}}function mi(e,t,l,a){Tt[ya++]=e,Tt[ya++]=t,Tt[ya++]=l,Tt[ya++]=a,tc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function lc(e,t,l,a){return mi(e,t,l,a),gi(e)}function Xl(e,t){return mi(e,null,null,t),gi(e)}function oo(e,t,l){e.lanes|=l;var a=e.alternate;a!==null&&(a.lanes|=l);for(var n=!1,i=e.return;i!==null;)i.childLanes|=l,a=i.alternate,a!==null&&(a.childLanes|=l),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(n=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,n&&t!==null&&(n=31-gt(l),e=i.hiddenUpdates,a=e[n],a===null?e[n]=[t]:a.push(t),t.lane=l|536870912),i):null}function gi(e){if(50<Rn)throw Rn=0,fs=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var pa={};function wg(e,t,l,a){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pt(e,t,l,a){return new wg(e,t,l,a)}function ac(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Kt(e,t){var l=e.alternate;return l===null?(l=pt(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function fo(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function yi(e,t,l,a,n,i){var s=0;if(a=e,typeof e=="function")ac(e)&&(s=1);else if(typeof e=="string")s=Yy(e,l,F.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case X:return e=pt(31,l,t,n),e.elementType=X,e.lanes=i,e;case _:return kl(l.children,n,i,t);case O:s=8,n|=24;break;case B:return e=pt(12,l,t,n|2),e.elementType=B,e.lanes=i,e;case P:return e=pt(13,l,t,n),e.elementType=P,e.lanes=i,e;case V:return e=pt(19,l,t,n),e.elementType=V,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:s=10;break e;case H:s=9;break e;case I:s=11;break e;case K:s=14;break e;case k:s=16,a=null;break e}s=29,l=Error(r(130,e===null?"null":typeof e,"")),a=null}return t=pt(s,l,t,n),t.elementType=e,t.type=a,t.lanes=i,t}function kl(e,t,l,a){return e=pt(7,e,a,t),e.lanes=l,e}function nc(e,t,l){return e=pt(6,e,null,t),e.lanes=l,e}function ho(e){var t=pt(18,null,null,0);return t.stateNode=e,t}function ic(e,t,l){return t=pt(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var mo=new WeakMap;function At(e,t){if(typeof e=="object"&&e!==null){var l=mo.get(e);return l!==void 0?l:(t={value:e,source:t,stack:dr(t)},mo.set(e,t),t)}return{value:e,source:t,stack:dr(t)}}var va=[],Sa=0,pi=null,cn=0,zt=[],Rt=0,gl=null,Yt=1,qt="";function Jt(e,t){va[Sa++]=cn,va[Sa++]=pi,pi=e,cn=t}function go(e,t,l){zt[Rt++]=Yt,zt[Rt++]=qt,zt[Rt++]=gl,gl=e;var a=Yt;e=qt;var n=32-gt(a)-1;a&=~(1<<n),l+=1;var i=32-gt(t)+n;if(30<i){var s=n-n%5;i=(a&(1<<s)-1).toString(32),a>>=s,n-=s,Yt=1<<32-gt(t)+n|l<<n|a,qt=i+e}else Yt=1<<i|l<<n|a,qt=e}function uc(e){e.return!==null&&(Jt(e,1),go(e,1,0))}function cc(e){for(;e===pi;)pi=va[--Sa],va[Sa]=null,cn=va[--Sa],va[Sa]=null;for(;e===gl;)gl=zt[--Rt],zt[Rt]=null,qt=zt[--Rt],zt[Rt]=null,Yt=zt[--Rt],zt[Rt]=null}function yo(e,t){zt[Rt++]=Yt,zt[Rt++]=qt,zt[Rt++]=gl,Yt=t.id,qt=t.overflow,gl=e}var Fe=null,Ne=null,pe=!1,yl=null,Mt=!1,sc=Error(r(519));function pl(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw sn(At(t,e)),sc}function po(e){var t=e.stateNode,l=e.type,a=e.memoizedProps;switch(t[We]=e,t[ut]=a,l){case"dialog":de("cancel",t),de("close",t);break;case"iframe":case"object":case"embed":de("load",t);break;case"video":case"audio":for(l=0;l<Nn.length;l++)de(Nn[l],t);break;case"source":de("error",t);break;case"img":case"image":case"link":de("error",t),de("load",t);break;case"details":de("toggle",t);break;case"input":de("invalid",t),Mr(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":de("invalid",t);break;case"textarea":de("invalid",t),_r(t,a.value,a.defaultValue,a.children)}l=a.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||a.suppressHydrationWarning===!0||Ud(t.textContent,l)?(a.popover!=null&&(de("beforetoggle",t),de("toggle",t)),a.onScroll!=null&&de("scroll",t),a.onScrollEnd!=null&&de("scrollend",t),a.onClick!=null&&(t.onclick=kt),t=!0):t=!1,t||pl(e,!0)}function vo(e){for(Fe=e.return;Fe;)switch(Fe.tag){case 5:case 31:case 13:Mt=!1;return;case 27:case 3:Mt=!0;return;default:Fe=Fe.return}}function xa(e){if(e!==Fe)return!1;if(!pe)return vo(e),pe=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||As(e.type,e.memoizedProps)),l=!l),l&&Ne&&pl(e),vo(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));Ne=Xd(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));Ne=Xd(e)}else t===27?(t=Ne,_l(e.type)?(e=_s,_s=null,Ne=e):Ne=t):Ne=Fe?_t(e.stateNode.nextSibling):null;return!0}function Zl(){Ne=Fe=null,pe=!1}function rc(){var e=yl;return e!==null&&(ft===null?ft=e:ft.push.apply(ft,e),yl=null),e}function sn(e){yl===null?yl=[e]:yl.push(e)}var oc=j(null),Kl=null,$t=null;function vl(e,t,l){J(oc,t._currentValue),t._currentValue=l}function Wt(e){e._currentValue=oc.current,q(oc)}function fc(e,t,l){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===l)break;e=e.return}}function dc(e,t,l,a){var n=e.child;for(n!==null&&(n.return=e);n!==null;){var i=n.dependencies;if(i!==null){var s=n.child;i=i.firstContext;e:for(;i!==null;){var m=i;i=n;for(var b=0;b<t.length;b++)if(m.context===t[b]){i.lanes|=l,m=i.alternate,m!==null&&(m.lanes|=l),fc(i.return,l,e),a||(s=null);break e}i=m.next}}else if(n.tag===18){if(s=n.return,s===null)throw Error(r(341));s.lanes|=l,i=s.alternate,i!==null&&(i.lanes|=l),fc(s,l,e),s=null}else s=n.child;if(s!==null)s.return=n;else for(s=n;s!==null;){if(s===e){s=null;break}if(n=s.sibling,n!==null){n.return=s.return,s=n;break}s=s.return}n=s}}function ba(e,t,l,a){e=null;for(var n=t,i=!1;n!==null;){if(!i){if((n.flags&524288)!==0)i=!0;else if((n.flags&262144)!==0)break}if(n.tag===10){var s=n.alternate;if(s===null)throw Error(r(387));if(s=s.memoizedProps,s!==null){var m=n.type;yt(n.pendingProps.value,s.value)||(e!==null?e.push(m):e=[m])}}else if(n===Ce.current){if(s=n.alternate,s===null)throw Error(r(387));s.memoizedState.memoizedState!==n.memoizedState.memoizedState&&(e!==null?e.push(Un):e=[Un])}n=n.return}e!==null&&dc(t,e,l,a),t.flags|=262144}function vi(e){for(e=e.firstContext;e!==null;){if(!yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Jl(e){Kl=e,$t=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ie(e){return So(Kl,e)}function Si(e,t){return Kl===null&&Jl(e),So(e,t)}function So(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},$t===null){if(e===null)throw Error(r(308));$t=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else $t=$t.next=t;return l}var Ug=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},Bg=u.unstable_scheduleCallback,Lg=u.unstable_NormalPriority,Ge={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hc(){return{controller:new Ug,data:new Map,refCount:0}}function rn(e){e.refCount--,e.refCount===0&&Bg(Lg,function(){e.controller.abort()})}var on=null,mc=0,Ea=0,Ca=null;function Hg(e,t){if(on===null){var l=on=[];mc=0,Ea=ps(),Ca={status:"pending",value:void 0,then:function(a){l.push(a)}}}return mc++,t.then(xo,xo),t}function xo(){if(--mc===0&&on!==null){Ca!==null&&(Ca.status="fulfilled");var e=on;on=null,Ea=0,Ca=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Yg(e,t){var l=[],a={status:"pending",value:null,reason:null,then:function(n){l.push(n)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var n=0;n<l.length;n++)(0,l[n])(t)},function(n){for(a.status="rejected",a.reason=n,n=0;n<l.length;n++)(0,l[n])(void 0)}),a}var bo=U.S;U.S=function(e,t){id=ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Hg(e,t),bo!==null&&bo(e,t)};var $l=j(null);function gc(){var e=$l.current;return e!==null?e:Me.pooledCache}function xi(e,t){t===null?J($l,$l.current):J($l,t.pool)}function Eo(){var e=gc();return e===null?null:{parent:Ge._currentValue,pool:e}}var ja=Error(r(460)),yc=Error(r(474)),bi=Error(r(542)),Ei={then:function(){}};function Co(e){return e=e.status,e==="fulfilled"||e==="rejected"}function jo(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(kt,kt),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ao(e),e;default:if(typeof t.status=="string")t.then(kt,kt);else{if(e=Me,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var n=t;n.status="fulfilled",n.value=a}},function(a){if(t.status==="pending"){var n=t;n.status="rejected",n.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ao(e),e}throw Fl=t,ja}}function Wl(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Fl=l,ja):l}}var Fl=null;function To(){if(Fl===null)throw Error(r(459));var e=Fl;return Fl=null,e}function Ao(e){if(e===ja||e===bi)throw Error(r(483))}var Ta=null,fn=0;function Ci(e){var t=fn;return fn+=1,Ta===null&&(Ta=[]),jo(Ta,e,t)}function dn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ji(e,t){throw t.$$typeof===E?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function zo(e){function t(A,T){if(e){var R=A.deletions;R===null?(A.deletions=[T],A.flags|=16):R.push(T)}}function l(A,T){if(!e)return null;for(;T!==null;)t(A,T),T=T.sibling;return null}function a(A){for(var T=new Map;A!==null;)A.key!==null?T.set(A.key,A):T.set(A.index,A),A=A.sibling;return T}function n(A,T){return A=Kt(A,T),A.index=0,A.sibling=null,A}function i(A,T,R){return A.index=R,e?(R=A.alternate,R!==null?(R=R.index,R<T?(A.flags|=67108866,T):R):(A.flags|=67108866,T)):(A.flags|=1048576,T)}function s(A){return e&&A.alternate===null&&(A.flags|=67108866),A}function m(A,T,R,Y){return T===null||T.tag!==6?(T=nc(R,A.mode,Y),T.return=A,T):(T=n(T,R),T.return=A,T)}function b(A,T,R,Y){var le=R.type;return le===_?L(A,T,R.props.children,Y,R.key):T!==null&&(T.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===k&&Wl(le)===T.type)?(T=n(T,R.props),dn(T,R),T.return=A,T):(T=yi(R.type,R.key,R.props,null,A.mode,Y),dn(T,R),T.return=A,T)}function M(A,T,R,Y){return T===null||T.tag!==4||T.stateNode.containerInfo!==R.containerInfo||T.stateNode.implementation!==R.implementation?(T=ic(R,A.mode,Y),T.return=A,T):(T=n(T,R.children||[]),T.return=A,T)}function L(A,T,R,Y,le){return T===null||T.tag!==7?(T=kl(R,A.mode,Y,le),T.return=A,T):(T=n(T,R),T.return=A,T)}function Q(A,T,R){if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return T=nc(""+T,A.mode,R),T.return=A,T;if(typeof T=="object"&&T!==null){switch(T.$$typeof){case z:return R=yi(T.type,T.key,T.props,null,A.mode,R),dn(R,T),R.return=A,R;case N:return T=ic(T,A.mode,R),T.return=A,T;case k:return T=Wl(T),Q(A,T,R)}if(De(T)||Se(T))return T=kl(T,A.mode,R,null),T.return=A,T;if(typeof T.then=="function")return Q(A,Ci(T),R);if(T.$$typeof===G)return Q(A,Si(A,T),R);ji(A,T)}return null}function D(A,T,R,Y){var le=T!==null?T.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return le!==null?null:m(A,T,""+R,Y);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case z:return R.key===le?b(A,T,R,Y):null;case N:return R.key===le?M(A,T,R,Y):null;case k:return R=Wl(R),D(A,T,R,Y)}if(De(R)||Se(R))return le!==null?null:L(A,T,R,Y,null);if(typeof R.then=="function")return D(A,T,Ci(R),Y);if(R.$$typeof===G)return D(A,T,Si(A,R),Y);ji(A,R)}return null}function w(A,T,R,Y,le){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return A=A.get(R)||null,m(T,A,""+Y,le);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case z:return A=A.get(Y.key===null?R:Y.key)||null,b(T,A,Y,le);case N:return A=A.get(Y.key===null?R:Y.key)||null,M(T,A,Y,le);case k:return Y=Wl(Y),w(A,T,R,Y,le)}if(De(Y)||Se(Y))return A=A.get(R)||null,L(T,A,Y,le,null);if(typeof Y.then=="function")return w(A,T,R,Ci(Y),le);if(Y.$$typeof===G)return w(A,T,R,Si(T,Y),le);ji(T,Y)}return null}function W(A,T,R,Y){for(var le=null,xe=null,ee=T,se=T=0,ge=null;ee!==null&&se<R.length;se++){ee.index>se?(ge=ee,ee=null):ge=ee.sibling;var be=D(A,ee,R[se],Y);if(be===null){ee===null&&(ee=ge);break}e&&ee&&be.alternate===null&&t(A,ee),T=i(be,T,se),xe===null?le=be:xe.sibling=be,xe=be,ee=ge}if(se===R.length)return l(A,ee),pe&&Jt(A,se),le;if(ee===null){for(;se<R.length;se++)ee=Q(A,R[se],Y),ee!==null&&(T=i(ee,T,se),xe===null?le=ee:xe.sibling=ee,xe=ee);return pe&&Jt(A,se),le}for(ee=a(ee);se<R.length;se++)ge=w(ee,A,se,R[se],Y),ge!==null&&(e&&ge.alternate!==null&&ee.delete(ge.key===null?se:ge.key),T=i(ge,T,se),xe===null?le=ge:xe.sibling=ge,xe=ge);return e&&ee.forEach(function(Bl){return t(A,Bl)}),pe&&Jt(A,se),le}function ne(A,T,R,Y){if(R==null)throw Error(r(151));for(var le=null,xe=null,ee=T,se=T=0,ge=null,be=R.next();ee!==null&&!be.done;se++,be=R.next()){ee.index>se?(ge=ee,ee=null):ge=ee.sibling;var Bl=D(A,ee,be.value,Y);if(Bl===null){ee===null&&(ee=ge);break}e&&ee&&Bl.alternate===null&&t(A,ee),T=i(Bl,T,se),xe===null?le=Bl:xe.sibling=Bl,xe=Bl,ee=ge}if(be.done)return l(A,ee),pe&&Jt(A,se),le;if(ee===null){for(;!be.done;se++,be=R.next())be=Q(A,be.value,Y),be!==null&&(T=i(be,T,se),xe===null?le=be:xe.sibling=be,xe=be);return pe&&Jt(A,se),le}for(ee=a(ee);!be.done;se++,be=R.next())be=w(ee,A,se,be.value,Y),be!==null&&(e&&be.alternate!==null&&ee.delete(be.key===null?se:be.key),T=i(be,T,se),xe===null?le=be:xe.sibling=be,xe=be);return e&&ee.forEach(function(Wy){return t(A,Wy)}),pe&&Jt(A,se),le}function Re(A,T,R,Y){if(typeof R=="object"&&R!==null&&R.type===_&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case z:e:{for(var le=R.key;T!==null;){if(T.key===le){if(le=R.type,le===_){if(T.tag===7){l(A,T.sibling),Y=n(T,R.props.children),Y.return=A,A=Y;break e}}else if(T.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===k&&Wl(le)===T.type){l(A,T.sibling),Y=n(T,R.props),dn(Y,R),Y.return=A,A=Y;break e}l(A,T);break}else t(A,T);T=T.sibling}R.type===_?(Y=kl(R.props.children,A.mode,Y,R.key),Y.return=A,A=Y):(Y=yi(R.type,R.key,R.props,null,A.mode,Y),dn(Y,R),Y.return=A,A=Y)}return s(A);case N:e:{for(le=R.key;T!==null;){if(T.key===le)if(T.tag===4&&T.stateNode.containerInfo===R.containerInfo&&T.stateNode.implementation===R.implementation){l(A,T.sibling),Y=n(T,R.children||[]),Y.return=A,A=Y;break e}else{l(A,T);break}else t(A,T);T=T.sibling}Y=ic(R,A.mode,Y),Y.return=A,A=Y}return s(A);case k:return R=Wl(R),Re(A,T,R,Y)}if(De(R))return W(A,T,R,Y);if(Se(R)){if(le=Se(R),typeof le!="function")throw Error(r(150));return R=le.call(R),ne(A,T,R,Y)}if(typeof R.then=="function")return Re(A,T,Ci(R),Y);if(R.$$typeof===G)return Re(A,T,Si(A,R),Y);ji(A,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,T!==null&&T.tag===6?(l(A,T.sibling),Y=n(T,R),Y.return=A,A=Y):(l(A,T),Y=nc(R,A.mode,Y),Y.return=A,A=Y),s(A)):l(A,T)}return function(A,T,R,Y){try{fn=0;var le=Re(A,T,R,Y);return Ta=null,le}catch(ee){if(ee===ja||ee===bi)throw ee;var xe=pt(29,ee,null,A.mode);return xe.lanes=Y,xe.return=A,xe}}}var Il=zo(!0),Ro=zo(!1),Sl=!1;function pc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function xl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function bl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Ee&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=gi(e),oo(e,null,l),t}return mi(e,a,t,l),gi(e)}function hn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,vr(e,l)}}function Sc(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,i=null;if(l=l.firstBaseUpdate,l!==null){do{var s={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};i===null?n=i=s:i=i.next=s,l=l.next}while(l!==null);i===null?n=i=t:i=i.next=t}else n=i=t;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:i,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var xc=!1;function mn(){if(xc){var e=Ca;if(e!==null)throw e}}function gn(e,t,l,a){xc=!1;var n=e.updateQueue;Sl=!1;var i=n.firstBaseUpdate,s=n.lastBaseUpdate,m=n.shared.pending;if(m!==null){n.shared.pending=null;var b=m,M=b.next;b.next=null,s===null?i=M:s.next=M,s=b;var L=e.alternate;L!==null&&(L=L.updateQueue,m=L.lastBaseUpdate,m!==s&&(m===null?L.firstBaseUpdate=M:m.next=M,L.lastBaseUpdate=b))}if(i!==null){var Q=n.baseState;s=0,L=M=b=null,m=i;do{var D=m.lane&-536870913,w=D!==m.lane;if(w?(me&D)===D:(a&D)===D){D!==0&&D===Ea&&(xc=!0),L!==null&&(L=L.next={lane:0,tag:m.tag,payload:m.payload,callback:null,next:null});e:{var W=e,ne=m;D=t;var Re=l;switch(ne.tag){case 1:if(W=ne.payload,typeof W=="function"){Q=W.call(Re,Q,D);break e}Q=W;break e;case 3:W.flags=W.flags&-65537|128;case 0:if(W=ne.payload,D=typeof W=="function"?W.call(Re,Q,D):W,D==null)break e;Q=p({},Q,D);break e;case 2:Sl=!0}}D=m.callback,D!==null&&(e.flags|=64,w&&(e.flags|=8192),w=n.callbacks,w===null?n.callbacks=[D]:w.push(D))}else w={lane:D,tag:m.tag,payload:m.payload,callback:m.callback,next:null},L===null?(M=L=w,b=Q):L=L.next=w,s|=D;if(m=m.next,m===null){if(m=n.shared.pending,m===null)break;w=m,m=w.next,w.next=null,n.lastBaseUpdate=w,n.shared.pending=null}}while(!0);L===null&&(b=Q),n.baseState=b,n.firstBaseUpdate=M,n.lastBaseUpdate=L,i===null&&(n.shared.lanes=0),Al|=s,e.lanes=s,e.memoizedState=Q}}function Mo(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function No(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Mo(l[e],t)}var Aa=j(null),Ti=j(0);function _o(e,t){e=il,J(Ti,e),J(Aa,t),il=e|t.baseLanes}function bc(){J(Ti,il),J(Aa,Aa.current)}function Ec(){il=Ti.current,q(Aa),q(Ti)}var vt=j(null),Nt=null;function El(e){var t=e.alternate;J(Ye,Ye.current&1),J(vt,e),Nt===null&&(t===null||Aa.current!==null||t.memoizedState!==null)&&(Nt=e)}function Cc(e){J(Ye,Ye.current),J(vt,e),Nt===null&&(Nt=e)}function Oo(e){e.tag===22?(J(Ye,Ye.current),J(vt,e),Nt===null&&(Nt=e)):Cl()}function Cl(){J(Ye,Ye.current),J(vt,vt.current)}function St(e){q(vt),Nt===e&&(Nt=null),q(Ye)}var Ye=j(0);function Ai(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Ms(l)||Ns(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ft=0,ce=null,Ae=null,Qe=null,zi=!1,za=!1,Pl=!1,Ri=0,yn=0,Ra=null,qg=0;function Ue(){throw Error(r(321))}function jc(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!yt(e[l],t[l]))return!1;return!0}function Tc(e,t,l,a,n,i){return Ft=i,ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?yf:qc,Pl=!1,i=l(a,n),Pl=!1,za&&(i=wo(t,l,a,n)),Do(e),i}function Do(e){U.H=Sn;var t=Ae!==null&&Ae.next!==null;if(Ft=0,Qe=Ae=ce=null,zi=!1,yn=0,Ra=null,t)throw Error(r(300));e===null||Ve||(e=e.dependencies,e!==null&&vi(e)&&(Ve=!0))}function wo(e,t,l,a){ce=e;var n=0;do{if(za&&(Ra=null),yn=0,za=!1,25<=n)throw Error(r(301));if(n+=1,Qe=Ae=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}U.H=pf,i=t(l,a)}while(za);return i}function Gg(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?pn(t):t,e=e.useState()[0],(Ae!==null?Ae.memoizedState:null)!==e&&(ce.flags|=1024),t}function Ac(){var e=Ri!==0;return Ri=0,e}function zc(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function Rc(e){if(zi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}zi=!1}Ft=0,Qe=Ae=ce=null,za=!1,yn=Ri=0,Ra=null}function nt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qe===null?ce.memoizedState=Qe=e:Qe=Qe.next=e,Qe}function qe(){if(Ae===null){var e=ce.alternate;e=e!==null?e.memoizedState:null}else e=Ae.next;var t=Qe===null?ce.memoizedState:Qe.next;if(t!==null)Qe=t,Ae=e;else{if(e===null)throw ce.alternate===null?Error(r(467)):Error(r(310));Ae=e,e={memoizedState:Ae.memoizedState,baseState:Ae.baseState,baseQueue:Ae.baseQueue,queue:Ae.queue,next:null},Qe===null?ce.memoizedState=Qe=e:Qe=Qe.next=e}return Qe}function Mi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function pn(e){var t=yn;return yn+=1,Ra===null&&(Ra=[]),e=jo(Ra,e,t),t=ce,(Qe===null?t.memoizedState:Qe.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?yf:qc),e}function Ni(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return pn(e);if(e.$$typeof===G)return Ie(e)}throw Error(r(438,String(e)))}function Mc(e){var t=null,l=ce.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var a=ce.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(n){return n.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Mi(),ce.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),a=0;a<e;a++)l[a]=$;return t.index++,l}function It(e,t){return typeof t=="function"?t(e):t}function _i(e){var t=qe();return Nc(t,Ae,e)}function Nc(e,t,l){var a=e.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=l;var n=e.baseQueue,i=a.pending;if(i!==null){if(n!==null){var s=n.next;n.next=i.next,i.next=s}t.baseQueue=n=i,a.pending=null}if(i=e.baseState,n===null)e.memoizedState=i;else{t=n.next;var m=s=null,b=null,M=t,L=!1;do{var Q=M.lane&-536870913;if(Q!==M.lane?(me&Q)===Q:(Ft&Q)===Q){var D=M.revertLane;if(D===0)b!==null&&(b=b.next={lane:0,revertLane:0,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null}),Q===Ea&&(L=!0);else if((Ft&D)===D){M=M.next,D===Ea&&(L=!0);continue}else Q={lane:0,revertLane:M.revertLane,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},b===null?(m=b=Q,s=i):b=b.next=Q,ce.lanes|=D,Al|=D;Q=M.action,Pl&&l(i,Q),i=M.hasEagerState?M.eagerState:l(i,Q)}else D={lane:Q,revertLane:M.revertLane,gesture:M.gesture,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},b===null?(m=b=D,s=i):b=b.next=D,ce.lanes|=Q,Al|=Q;M=M.next}while(M!==null&&M!==t);if(b===null?s=i:b.next=m,!yt(i,e.memoizedState)&&(Ve=!0,L&&(l=Ca,l!==null)))throw l;e.memoizedState=i,e.baseState=s,e.baseQueue=b,a.lastRenderedState=i}return n===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function _c(e){var t=qe(),l=t.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=e;var a=l.dispatch,n=l.pending,i=t.memoizedState;if(n!==null){l.pending=null;var s=n=n.next;do i=e(i,s.action),s=s.next;while(s!==n);yt(i,t.memoizedState)||(Ve=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),l.lastRenderedState=i}return[i,a]}function Uo(e,t,l){var a=ce,n=qe(),i=pe;if(i){if(l===void 0)throw Error(r(407));l=l()}else l=t();var s=!yt((Ae||n).memoizedState,l);if(s&&(n.memoizedState=l,Ve=!0),n=n.queue,wc(Ho.bind(null,a,n,e),[e]),n.getSnapshot!==t||s||Qe!==null&&Qe.memoizedState.tag&1){if(a.flags|=2048,Ma(9,{destroy:void 0},Lo.bind(null,a,n,l,t),null),Me===null)throw Error(r(349));i||(Ft&127)!==0||Bo(a,t,l)}return l}function Bo(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=ce.updateQueue,t===null?(t=Mi(),ce.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function Lo(e,t,l,a){t.value=l,t.getSnapshot=a,Yo(t)&&qo(e)}function Ho(e,t,l){return l(function(){Yo(t)&&qo(e)})}function Yo(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!yt(e,l)}catch{return!0}}function qo(e){var t=Xl(e,2);t!==null&&dt(t,e,2)}function Oc(e){var t=nt();if(typeof e=="function"){var l=e;if(e=l(),Pl){dl(!0);try{l()}finally{dl(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:It,lastRenderedState:e},t}function Go(e,t,l,a){return e.baseState=l,Nc(e,Ae,typeof a=="function"?a:It)}function Qg(e,t,l,a,n){if(wi(e))throw Error(r(485));if(e=t.action,e!==null){var i={payload:n,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(s){i.listeners.push(s)}};U.T!==null?l(!0):i.isTransition=!1,a(i),l=t.pending,l===null?(i.next=t.pending=i,Qo(t,i)):(i.next=l.next,t.pending=l.next=i)}}function Qo(e,t){var l=t.action,a=t.payload,n=e.state;if(t.isTransition){var i=U.T,s={};U.T=s;try{var m=l(n,a),b=U.S;b!==null&&b(s,m),Vo(e,t,m)}catch(M){Dc(e,t,M)}finally{i!==null&&s.types!==null&&(i.types=s.types),U.T=i}}else try{i=l(n,a),Vo(e,t,i)}catch(M){Dc(e,t,M)}}function Vo(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(a){Xo(e,t,a)},function(a){return Dc(e,t,a)}):Xo(e,t,l)}function Xo(e,t,l){t.status="fulfilled",t.value=l,ko(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Qo(e,l)))}function Dc(e,t,l){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=l,ko(t),t=t.next;while(t!==a)}e.action=null}function ko(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zo(e,t){return t}function Ko(e,t){if(pe){var l=Me.formState;if(l!==null){e:{var a=ce;if(pe){if(Ne){t:{for(var n=Ne,i=Mt;n.nodeType!==8;){if(!i){n=null;break t}if(n=_t(n.nextSibling),n===null){n=null;break t}}i=n.data,n=i==="F!"||i==="F"?n:null}if(n){Ne=_t(n.nextSibling),a=n.data==="F!";break e}}pl(a)}a=!1}a&&(t=l[0])}}return l=nt(),l.memoizedState=l.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},l.queue=a,l=hf.bind(null,ce,a),a.dispatch=l,a=Oc(!1),i=Yc.bind(null,ce,!1,a.queue),a=nt(),n={state:t,dispatch:null,action:e,pending:null},a.queue=n,l=Qg.bind(null,ce,n,i,l),n.dispatch=l,a.memoizedState=e,[t,l,!1]}function Jo(e){var t=qe();return $o(t,Ae,e)}function $o(e,t,l){if(t=Nc(e,t,Zo)[0],e=_i(It)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=pn(t)}catch(s){throw s===ja?bi:s}else a=t;t=qe();var n=t.queue,i=n.dispatch;return l!==t.memoizedState&&(ce.flags|=2048,Ma(9,{destroy:void 0},Vg.bind(null,n,l),null)),[a,i,e]}function Vg(e,t){e.action=t}function Wo(e){var t=qe(),l=Ae;if(l!==null)return $o(t,l,e);qe(),t=t.memoizedState,l=qe();var a=l.queue.dispatch;return l.memoizedState=e,[t,a,!1]}function Ma(e,t,l,a){return e={tag:e,create:l,deps:a,inst:t,next:null},t=ce.updateQueue,t===null&&(t=Mi(),ce.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(a=l.next,l.next=e,e.next=a,t.lastEffect=e),e}function Fo(){return qe().memoizedState}function Oi(e,t,l,a){var n=nt();ce.flags|=e,n.memoizedState=Ma(1|t,{destroy:void 0},l,a===void 0?null:a)}function Di(e,t,l,a){var n=qe();a=a===void 0?null:a;var i=n.memoizedState.inst;Ae!==null&&a!==null&&jc(a,Ae.memoizedState.deps)?n.memoizedState=Ma(t,i,l,a):(ce.flags|=e,n.memoizedState=Ma(1|t,i,l,a))}function Io(e,t){Oi(8390656,8,e,t)}function wc(e,t){Di(2048,8,e,t)}function Xg(e){ce.flags|=4;var t=ce.updateQueue;if(t===null)t=Mi(),ce.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Po(e){var t=qe().memoizedState;return Xg({ref:t,nextImpl:e}),function(){if((Ee&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function ef(e,t){return Di(4,2,e,t)}function tf(e,t){return Di(4,4,e,t)}function lf(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function af(e,t,l){l=l!=null?l.concat([e]):null,Di(4,4,lf.bind(null,t,e),l)}function Uc(){}function nf(e,t){var l=qe();t=t===void 0?null:t;var a=l.memoizedState;return t!==null&&jc(t,a[1])?a[0]:(l.memoizedState=[e,t],e)}function uf(e,t){var l=qe();t=t===void 0?null:t;var a=l.memoizedState;if(t!==null&&jc(t,a[1]))return a[0];if(a=e(),Pl){dl(!0);try{e()}finally{dl(!1)}}return l.memoizedState=[a,t],a}function Bc(e,t,l){return l===void 0||(Ft&1073741824)!==0&&(me&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=cd(),ce.lanes|=e,Al|=e,l)}function cf(e,t,l,a){return yt(l,t)?l:Aa.current!==null?(e=Bc(e,l,a),yt(e,t)||(Ve=!0),e):(Ft&42)===0||(Ft&1073741824)!==0&&(me&261930)===0?(Ve=!0,e.memoizedState=l):(e=cd(),ce.lanes|=e,Al|=e,t)}function sf(e,t,l,a,n){var i=Z.p;Z.p=i!==0&&8>i?i:8;var s=U.T,m={};U.T=m,Yc(e,!1,t,l);try{var b=n(),M=U.S;if(M!==null&&M(m,b),b!==null&&typeof b=="object"&&typeof b.then=="function"){var L=Yg(b,a);vn(e,t,L,Et(e))}else vn(e,t,a,Et(e))}catch(Q){vn(e,t,{then:function(){},status:"rejected",reason:Q},Et())}finally{Z.p=i,s!==null&&m.types!==null&&(s.types=m.types),U.T=s}}function kg(){}function Lc(e,t,l,a){if(e.tag!==5)throw Error(r(476));var n=rf(e).queue;sf(e,n,t,te,l===null?kg:function(){return of(e),l(a)})}function rf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:It,lastRenderedState:te},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:It,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function of(e){var t=rf(e);t.next===null&&(t=e.alternate.memoizedState),vn(e,t.next.queue,{},Et())}function Hc(){return Ie(Un)}function ff(){return qe().memoizedState}function df(){return qe().memoizedState}function Zg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Et();e=xl(l);var a=bl(t,e,l);a!==null&&(dt(a,t,l),hn(a,t,l)),t={cache:hc()},e.payload=t;return}t=t.return}}function Kg(e,t,l){var a=Et();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},wi(e)?mf(t,l):(l=lc(e,t,l,a),l!==null&&(dt(l,e,a),gf(l,t,a)))}function hf(e,t,l){var a=Et();vn(e,t,l,a)}function vn(e,t,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(wi(e))mf(t,n);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,m=i(s,l);if(n.hasEagerState=!0,n.eagerState=m,yt(m,s))return mi(e,t,n,0),Me===null&&hi(),!1}catch{}if(l=lc(e,t,n,a),l!==null)return dt(l,e,a),gf(l,t,a),!0}return!1}function Yc(e,t,l,a){if(a={lane:2,revertLane:ps(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},wi(e)){if(t)throw Error(r(479))}else t=lc(e,l,a,2),t!==null&&dt(t,e,2)}function wi(e){var t=e.alternate;return e===ce||t!==null&&t===ce}function mf(e,t){za=zi=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function gf(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,vr(e,l)}}var Sn={readContext:Ie,use:Ni,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useLayoutEffect:Ue,useInsertionEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useSyncExternalStore:Ue,useId:Ue,useHostTransitionStatus:Ue,useFormState:Ue,useActionState:Ue,useOptimistic:Ue,useMemoCache:Ue,useCacheRefresh:Ue};Sn.useEffectEvent=Ue;var yf={readContext:Ie,use:Ni,useCallback:function(e,t){return nt().memoizedState=[e,t===void 0?null:t],e},useContext:Ie,useEffect:Io,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Oi(4194308,4,lf.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Oi(4194308,4,e,t)},useInsertionEffect:function(e,t){Oi(4,2,e,t)},useMemo:function(e,t){var l=nt();t=t===void 0?null:t;var a=e();if(Pl){dl(!0);try{e()}finally{dl(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=nt();if(l!==void 0){var n=l(t);if(Pl){dl(!0);try{l(t)}finally{dl(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=Kg.bind(null,ce,e),[a.memoizedState,e]},useRef:function(e){var t=nt();return e={current:e},t.memoizedState=e},useState:function(e){e=Oc(e);var t=e.queue,l=hf.bind(null,ce,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Uc,useDeferredValue:function(e,t){var l=nt();return Bc(l,e,t)},useTransition:function(){var e=Oc(!1);return e=sf.bind(null,ce,e.queue,!0,!1),nt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=ce,n=nt();if(pe){if(l===void 0)throw Error(r(407));l=l()}else{if(l=t(),Me===null)throw Error(r(349));(me&127)!==0||Bo(a,t,l)}n.memoizedState=l;var i={value:l,getSnapshot:t};return n.queue=i,Io(Ho.bind(null,a,i,e),[e]),a.flags|=2048,Ma(9,{destroy:void 0},Lo.bind(null,a,i,l,t),null),l},useId:function(){var e=nt(),t=Me.identifierPrefix;if(pe){var l=qt,a=Yt;l=(a&~(1<<32-gt(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Ri++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=qg++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Hc,useFormState:Ko,useActionState:Ko,useOptimistic:function(e){var t=nt();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=Yc.bind(null,ce,!0,l),l.dispatch=t,[e,t]},useMemoCache:Mc,useCacheRefresh:function(){return nt().memoizedState=Zg.bind(null,ce)},useEffectEvent:function(e){var t=nt(),l={impl:e};return t.memoizedState=l,function(){if((Ee&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},qc={readContext:Ie,use:Ni,useCallback:nf,useContext:Ie,useEffect:wc,useImperativeHandle:af,useInsertionEffect:ef,useLayoutEffect:tf,useMemo:uf,useReducer:_i,useRef:Fo,useState:function(){return _i(It)},useDebugValue:Uc,useDeferredValue:function(e,t){var l=qe();return cf(l,Ae.memoizedState,e,t)},useTransition:function(){var e=_i(It)[0],t=qe().memoizedState;return[typeof e=="boolean"?e:pn(e),t]},useSyncExternalStore:Uo,useId:ff,useHostTransitionStatus:Hc,useFormState:Jo,useActionState:Jo,useOptimistic:function(e,t){var l=qe();return Go(l,Ae,e,t)},useMemoCache:Mc,useCacheRefresh:df};qc.useEffectEvent=Po;var pf={readContext:Ie,use:Ni,useCallback:nf,useContext:Ie,useEffect:wc,useImperativeHandle:af,useInsertionEffect:ef,useLayoutEffect:tf,useMemo:uf,useReducer:_c,useRef:Fo,useState:function(){return _c(It)},useDebugValue:Uc,useDeferredValue:function(e,t){var l=qe();return Ae===null?Bc(l,e,t):cf(l,Ae.memoizedState,e,t)},useTransition:function(){var e=_c(It)[0],t=qe().memoizedState;return[typeof e=="boolean"?e:pn(e),t]},useSyncExternalStore:Uo,useId:ff,useHostTransitionStatus:Hc,useFormState:Wo,useActionState:Wo,useOptimistic:function(e,t){var l=qe();return Ae!==null?Go(l,Ae,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Mc,useCacheRefresh:df};pf.useEffectEvent=Po;function Gc(e,t,l,a){t=e.memoizedState,l=l(a,t),l=l==null?t:p({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Qc={enqueueSetState:function(e,t,l){e=e._reactInternals;var a=Et(),n=xl(a);n.payload=t,l!=null&&(n.callback=l),t=bl(e,n,a),t!==null&&(dt(t,e,a),hn(t,e,a))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var a=Et(),n=xl(a);n.tag=1,n.payload=t,l!=null&&(n.callback=l),t=bl(e,n,a),t!==null&&(dt(t,e,a),hn(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Et(),a=xl(l);a.tag=2,t!=null&&(a.callback=t),t=bl(e,a,l),t!==null&&(dt(t,e,l),hn(t,e,l))}};function vf(e,t,l,a,n,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,i,s):t.prototype&&t.prototype.isPureReactComponent?!nn(l,a)||!nn(n,i):!0}function Sf(e,t,l,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,a),t.state!==e&&Qc.enqueueReplaceState(t,t.state,null)}function ea(e,t){var l=t;if("ref"in t){l={};for(var a in t)a!=="ref"&&(l[a]=t[a])}if(e=e.defaultProps){l===t&&(l=p({},l));for(var n in e)l[n]===void 0&&(l[n]=e[n])}return l}function xf(e){di(e)}function bf(e){console.error(e)}function Ef(e){di(e)}function Ui(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Cf(e,t,l){try{var a=e.onCaughtError;a(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(n){setTimeout(function(){throw n})}}function Vc(e,t,l){return l=xl(l),l.tag=3,l.payload={element:null},l.callback=function(){Ui(e,t)},l}function jf(e){return e=xl(e),e.tag=3,e}function Tf(e,t,l,a){var n=l.type.getDerivedStateFromError;if(typeof n=="function"){var i=a.value;e.payload=function(){return n(i)},e.callback=function(){Cf(t,l,a)}}var s=l.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(e.callback=function(){Cf(t,l,a),typeof n!="function"&&(zl===null?zl=new Set([this]):zl.add(this));var m=a.stack;this.componentDidCatch(a.value,{componentStack:m!==null?m:""})})}function Jg(e,t,l,a,n){if(l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=l.alternate,t!==null&&ba(t,l,n,!0),l=vt.current,l!==null){switch(l.tag){case 31:case 13:return Nt===null?Ki():l.alternate===null&&Be===0&&(Be=3),l.flags&=-257,l.flags|=65536,l.lanes=n,a===Ei?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([a]):t.add(a),ms(e,a,n)),!1;case 22:return l.flags|=65536,a===Ei?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([a]):l.add(a)),ms(e,a,n)),!1}throw Error(r(435,l.tag))}return ms(e,a,n),Ki(),!1}if(pe)return t=vt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=n,a!==sc&&(e=Error(r(422),{cause:a}),sn(At(e,l)))):(a!==sc&&(t=Error(r(423),{cause:a}),sn(At(t,l))),e=e.current.alternate,e.flags|=65536,n&=-n,e.lanes|=n,a=At(a,l),n=Vc(e.stateNode,a,n),Sc(e,n),Be!==4&&(Be=2)),!1;var i=Error(r(520),{cause:a});if(i=At(i,l),zn===null?zn=[i]:zn.push(i),Be!==4&&(Be=2),t===null)return!0;a=At(a,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=n&-n,l.lanes|=e,e=Vc(l.stateNode,a,e),Sc(l,e),!1;case 1:if(t=l.type,i=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(zl===null||!zl.has(i))))return l.flags|=65536,n&=-n,l.lanes|=n,n=jf(n),Tf(n,e,l,a),Sc(l,n),!1}l=l.return}while(l!==null);return!1}var Xc=Error(r(461)),Ve=!1;function Pe(e,t,l,a){t.child=e===null?Ro(t,null,l,a):Il(t,e.child,l,a)}function Af(e,t,l,a,n){l=l.render;var i=t.ref;if("ref"in a){var s={};for(var m in a)m!=="ref"&&(s[m]=a[m])}else s=a;return Jl(t),a=Tc(e,t,l,s,i,n),m=Ac(),e!==null&&!Ve?(zc(e,t,n),Pt(e,t,n)):(pe&&m&&uc(t),t.flags|=1,Pe(e,t,a,n),t.child)}function zf(e,t,l,a,n){if(e===null){var i=l.type;return typeof i=="function"&&!ac(i)&&i.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=i,Rf(e,t,i,a,n)):(e=yi(l.type,null,a,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!Ic(e,n)){var s=i.memoizedProps;if(l=l.compare,l=l!==null?l:nn,l(s,a)&&e.ref===t.ref)return Pt(e,t,n)}return t.flags|=1,e=Kt(i,a),e.ref=t.ref,e.return=t,t.child=e}function Rf(e,t,l,a,n){if(e!==null){var i=e.memoizedProps;if(nn(i,a)&&e.ref===t.ref)if(Ve=!1,t.pendingProps=a=i,Ic(e,n))(e.flags&131072)!==0&&(Ve=!0);else return t.lanes=e.lanes,Pt(e,t,n)}return kc(e,t,l,a,n)}function Mf(e,t,l,a){var n=a.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|l:l,e!==null){for(a=t.child=e.child,n=0;a!==null;)n=n|a.lanes|a.childLanes,a=a.sibling;a=n&~i}else a=0,t.child=null;return Nf(e,t,i,l,a)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&xi(t,i!==null?i.cachePool:null),i!==null?_o(t,i):bc(),Oo(t);else return a=t.lanes=536870912,Nf(e,t,i!==null?i.baseLanes|l:l,l,a)}else i!==null?(xi(t,i.cachePool),_o(t,i),Cl(),t.memoizedState=null):(e!==null&&xi(t,null),bc(),Cl());return Pe(e,t,n,l),t.child}function xn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Nf(e,t,l,a,n){var i=gc();return i=i===null?null:{parent:Ge._currentValue,pool:i},t.memoizedState={baseLanes:l,cachePool:i},e!==null&&xi(t,null),bc(),Oo(t),e!==null&&ba(e,t,a,!0),t.childLanes=n,null}function Bi(e,t){return t=Hi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function _f(e,t,l){return Il(t,e.child,null,l),e=Bi(t,t.pendingProps),e.flags|=2,St(t),t.memoizedState=null,e}function $g(e,t,l){var a=t.pendingProps,n=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(pe){if(a.mode==="hidden")return e=Bi(t,a),t.lanes=536870912,xn(null,e);if(Cc(t),(e=Ne)?(e=Vd(e,Mt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gl!==null?{id:Yt,overflow:qt}:null,retryLane:536870912,hydrationErrors:null},l=ho(e),l.return=t,t.child=l,Fe=t,Ne=null)):e=null,e===null)throw pl(t);return t.lanes=536870912,null}return Bi(t,a)}var i=e.memoizedState;if(i!==null){var s=i.dehydrated;if(Cc(t),n)if(t.flags&256)t.flags&=-257,t=_f(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if(Ve||ba(e,t,l,!1),n=(l&e.childLanes)!==0,Ve||n){if(a=Me,a!==null&&(s=Sr(a,l),s!==0&&s!==i.retryLane))throw i.retryLane=s,Xl(e,s),dt(a,e,s),Xc;Ki(),t=_f(e,t,l)}else e=i.treeContext,Ne=_t(s.nextSibling),Fe=t,pe=!0,yl=null,Mt=!1,e!==null&&yo(t,e),t=Bi(t,a),t.flags|=4096;return t}return e=Kt(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Li(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function kc(e,t,l,a,n){return Jl(t),l=Tc(e,t,l,a,void 0,n),a=Ac(),e!==null&&!Ve?(zc(e,t,n),Pt(e,t,n)):(pe&&a&&uc(t),t.flags|=1,Pe(e,t,l,n),t.child)}function Of(e,t,l,a,n,i){return Jl(t),t.updateQueue=null,l=wo(t,a,l,n),Do(e),a=Ac(),e!==null&&!Ve?(zc(e,t,i),Pt(e,t,i)):(pe&&a&&uc(t),t.flags|=1,Pe(e,t,l,i),t.child)}function Df(e,t,l,a,n){if(Jl(t),t.stateNode===null){var i=pa,s=l.contextType;typeof s=="object"&&s!==null&&(i=Ie(s)),i=new l(a,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Qc,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=a,i.state=t.memoizedState,i.refs={},pc(t),s=l.contextType,i.context=typeof s=="object"&&s!==null?Ie(s):pa,i.state=t.memoizedState,s=l.getDerivedStateFromProps,typeof s=="function"&&(Gc(t,l,s,a),i.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(s=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),s!==i.state&&Qc.enqueueReplaceState(i,i.state,null),gn(t,a,i,n),mn(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){i=t.stateNode;var m=t.memoizedProps,b=ea(l,m);i.props=b;var M=i.context,L=l.contextType;s=pa,typeof L=="object"&&L!==null&&(s=Ie(L));var Q=l.getDerivedStateFromProps;L=typeof Q=="function"||typeof i.getSnapshotBeforeUpdate=="function",m=t.pendingProps!==m,L||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(m||M!==s)&&Sf(t,i,a,s),Sl=!1;var D=t.memoizedState;i.state=D,gn(t,a,i,n),mn(),M=t.memoizedState,m||D!==M||Sl?(typeof Q=="function"&&(Gc(t,l,Q,a),M=t.memoizedState),(b=Sl||vf(t,l,b,a,D,M,s))?(L||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=M),i.props=a,i.state=M,i.context=s,a=b):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{i=t.stateNode,vc(e,t),s=t.memoizedProps,L=ea(l,s),i.props=L,Q=t.pendingProps,D=i.context,M=l.contextType,b=pa,typeof M=="object"&&M!==null&&(b=Ie(M)),m=l.getDerivedStateFromProps,(M=typeof m=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(s!==Q||D!==b)&&Sf(t,i,a,b),Sl=!1,D=t.memoizedState,i.state=D,gn(t,a,i,n),mn();var w=t.memoizedState;s!==Q||D!==w||Sl||e!==null&&e.dependencies!==null&&vi(e.dependencies)?(typeof m=="function"&&(Gc(t,l,m,a),w=t.memoizedState),(L=Sl||vf(t,l,L,a,D,w,b)||e!==null&&e.dependencies!==null&&vi(e.dependencies))?(M||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(a,w,b),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(a,w,b)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||s===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=w),i.props=a,i.state=w,i.context=b,a=L):(typeof i.componentDidUpdate!="function"||s===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),a=!1)}return i=a,Li(e,t),a=(t.flags&128)!==0,i||a?(i=t.stateNode,l=a&&typeof l.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&a?(t.child=Il(t,e.child,null,n),t.child=Il(t,null,l,n)):Pe(e,t,l,n),t.memoizedState=i.state,e=t.child):e=Pt(e,t,n),e}function wf(e,t,l,a){return Zl(),t.flags|=256,Pe(e,t,l,a),t.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kc(e){return{baseLanes:e,cachePool:Eo()}}function Jc(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=bt),e}function Uf(e,t,l){var a=t.pendingProps,n=!1,i=(t.flags&128)!==0,s;if((s=i)||(s=e!==null&&e.memoizedState===null?!1:(Ye.current&2)!==0),s&&(n=!0,t.flags&=-129),s=(t.flags&32)!==0,t.flags&=-33,e===null){if(pe){if(n?El(t):Cl(),(e=Ne)?(e=Vd(e,Mt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gl!==null?{id:Yt,overflow:qt}:null,retryLane:536870912,hydrationErrors:null},l=ho(e),l.return=t,t.child=l,Fe=t,Ne=null)):e=null,e===null)throw pl(t);return Ns(e)?t.lanes=32:t.lanes=536870912,null}var m=a.children;return a=a.fallback,n?(Cl(),n=t.mode,m=Hi({mode:"hidden",children:m},n),a=kl(a,n,l,null),m.return=t,a.return=t,m.sibling=a,t.child=m,a=t.child,a.memoizedState=Kc(l),a.childLanes=Jc(e,s,l),t.memoizedState=Zc,xn(null,a)):(El(t),$c(t,m))}var b=e.memoizedState;if(b!==null&&(m=b.dehydrated,m!==null)){if(i)t.flags&256?(El(t),t.flags&=-257,t=Wc(e,t,l)):t.memoizedState!==null?(Cl(),t.child=e.child,t.flags|=128,t=null):(Cl(),m=a.fallback,n=t.mode,a=Hi({mode:"visible",children:a.children},n),m=kl(m,n,l,null),m.flags|=2,a.return=t,m.return=t,a.sibling=m,t.child=a,Il(t,e.child,null,l),a=t.child,a.memoizedState=Kc(l),a.childLanes=Jc(e,s,l),t.memoizedState=Zc,t=xn(null,a));else if(El(t),Ns(m)){if(s=m.nextSibling&&m.nextSibling.dataset,s)var M=s.dgst;s=M,a=Error(r(419)),a.stack="",a.digest=s,sn({value:a,source:null,stack:null}),t=Wc(e,t,l)}else if(Ve||ba(e,t,l,!1),s=(l&e.childLanes)!==0,Ve||s){if(s=Me,s!==null&&(a=Sr(s,l),a!==0&&a!==b.retryLane))throw b.retryLane=a,Xl(e,a),dt(s,e,a),Xc;Ms(m)||Ki(),t=Wc(e,t,l)}else Ms(m)?(t.flags|=192,t.child=e.child,t=null):(e=b.treeContext,Ne=_t(m.nextSibling),Fe=t,pe=!0,yl=null,Mt=!1,e!==null&&yo(t,e),t=$c(t,a.children),t.flags|=4096);return t}return n?(Cl(),m=a.fallback,n=t.mode,b=e.child,M=b.sibling,a=Kt(b,{mode:"hidden",children:a.children}),a.subtreeFlags=b.subtreeFlags&65011712,M!==null?m=Kt(M,m):(m=kl(m,n,l,null),m.flags|=2),m.return=t,a.return=t,a.sibling=m,t.child=a,xn(null,a),a=t.child,m=e.child.memoizedState,m===null?m=Kc(l):(n=m.cachePool,n!==null?(b=Ge._currentValue,n=n.parent!==b?{parent:b,pool:b}:n):n=Eo(),m={baseLanes:m.baseLanes|l,cachePool:n}),a.memoizedState=m,a.childLanes=Jc(e,s,l),t.memoizedState=Zc,xn(e.child,a)):(El(t),l=e.child,e=l.sibling,l=Kt(l,{mode:"visible",children:a.children}),l.return=t,l.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=l,t.memoizedState=null,l)}function $c(e,t){return t=Hi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Hi(e,t){return e=pt(22,e,null,t),e.lanes=0,e}function Wc(e,t,l){return Il(t,e.child,null,l),e=$c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Bf(e,t,l){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),fc(e.return,t,l)}function Fc(e,t,l,a,n,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:l,tailMode:n,treeForkCount:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=a,s.tail=l,s.tailMode=n,s.treeForkCount=i)}function Lf(e,t,l){var a=t.pendingProps,n=a.revealOrder,i=a.tail;a=a.children;var s=Ye.current,m=(s&2)!==0;if(m?(s=s&1|2,t.flags|=128):s&=1,J(Ye,s),Pe(e,t,a,l),a=pe?cn:0,!m&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Bf(e,l,t);else if(e.tag===19)Bf(e,l,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(n){case"forwards":for(l=t.child,n=null;l!==null;)e=l.alternate,e!==null&&Ai(e)===null&&(n=l),l=l.sibling;l=n,l===null?(n=t.child,t.child=null):(n=l.sibling,l.sibling=null),Fc(t,!1,n,l,i,a);break;case"backwards":case"unstable_legacy-backwards":for(l=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&Ai(e)===null){t.child=n;break}e=n.sibling,n.sibling=l,l=n,n=e}Fc(t,!0,l,null,i,a);break;case"together":Fc(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Pt(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Al|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(ba(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,l=Kt(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Kt(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Ic(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&vi(e)))}function Wg(e,t,l){switch(t.tag){case 3:at(t,t.stateNode.containerInfo),vl(t,Ge,e.memoizedState.cache),Zl();break;case 27:case 5:ka(t);break;case 4:at(t,t.stateNode.containerInfo);break;case 10:vl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Cc(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(El(t),t.flags|=128,null):(l&t.child.childLanes)!==0?Uf(e,t,l):(El(t),e=Pt(e,t,l),e!==null?e.sibling:null);El(t);break;case 19:var n=(e.flags&128)!==0;if(a=(l&t.childLanes)!==0,a||(ba(e,t,l,!1),a=(l&t.childLanes)!==0),n){if(a)return Lf(e,t,l);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),J(Ye,Ye.current),a)break;return null;case 22:return t.lanes=0,Mf(e,t,l,t.pendingProps);case 24:vl(t,Ge,e.memoizedState.cache)}return Pt(e,t,l)}function Hf(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ve=!0;else{if(!Ic(e,l)&&(t.flags&128)===0)return Ve=!1,Wg(e,t,l);Ve=(e.flags&131072)!==0}else Ve=!1,pe&&(t.flags&1048576)!==0&&go(t,cn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Wl(t.elementType),t.type=e,typeof e=="function")ac(e)?(a=ea(e,a),t.tag=1,t=Df(null,t,e,a,l)):(t.tag=0,t=kc(null,t,e,a,l));else{if(e!=null){var n=e.$$typeof;if(n===I){t.tag=11,t=Af(null,t,e,a,l);break e}else if(n===K){t.tag=14,t=zf(null,t,e,a,l);break e}}throw t=ke(e)||e,Error(r(306,t,""))}}return t;case 0:return kc(e,t,t.type,t.pendingProps,l);case 1:return a=t.type,n=ea(a,t.pendingProps),Df(e,t,a,n,l);case 3:e:{if(at(t,t.stateNode.containerInfo),e===null)throw Error(r(387));a=t.pendingProps;var i=t.memoizedState;n=i.element,vc(e,t),gn(t,a,null,l);var s=t.memoizedState;if(a=s.cache,vl(t,Ge,a),a!==i.cache&&dc(t,[Ge],l,!0),mn(),a=s.element,i.isDehydrated)if(i={element:a,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=wf(e,t,a,l);break e}else if(a!==n){n=At(Error(r(424)),t),sn(n),t=wf(e,t,a,l);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Ne=_t(e.firstChild),Fe=t,pe=!0,yl=null,Mt=!0,l=Ro(t,null,a,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Zl(),a===n){t=Pt(e,t,l);break e}Pe(e,t,a,l)}t=t.child}return t;case 26:return Li(e,t),e===null?(l=$d(t.type,null,t.pendingProps,null))?t.memoizedState=l:pe||(l=t.type,e=t.pendingProps,a=eu(oe.current).createElement(l),a[We]=t,a[ut]=e,et(a,l,e),Je(a),t.stateNode=a):t.memoizedState=$d(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ka(t),e===null&&pe&&(a=t.stateNode=Zd(t.type,t.pendingProps,oe.current),Fe=t,Mt=!0,n=Ne,_l(t.type)?(_s=n,Ne=_t(a.firstChild)):Ne=n),Pe(e,t,t.pendingProps.children,l),Li(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&pe&&((n=a=Ne)&&(a=Ay(a,t.type,t.pendingProps,Mt),a!==null?(t.stateNode=a,Fe=t,Ne=_t(a.firstChild),Mt=!1,n=!0):n=!1),n||pl(t)),ka(t),n=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,a=i.children,As(n,i)?a=null:s!==null&&As(n,s)&&(t.flags|=32),t.memoizedState!==null&&(n=Tc(e,t,Gg,null,null,l),Un._currentValue=n),Li(e,t),Pe(e,t,a,l),t.child;case 6:return e===null&&pe&&((e=l=Ne)&&(l=zy(l,t.pendingProps,Mt),l!==null?(t.stateNode=l,Fe=t,Ne=null,e=!0):e=!1),e||pl(t)),null;case 13:return Uf(e,t,l);case 4:return at(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Il(t,null,a,l):Pe(e,t,a,l),t.child;case 11:return Af(e,t,t.type,t.pendingProps,l);case 7:return Pe(e,t,t.pendingProps,l),t.child;case 8:return Pe(e,t,t.pendingProps.children,l),t.child;case 12:return Pe(e,t,t.pendingProps.children,l),t.child;case 10:return a=t.pendingProps,vl(t,t.type,a.value),Pe(e,t,a.children,l),t.child;case 9:return n=t.type._context,a=t.pendingProps.children,Jl(t),n=Ie(n),a=a(n),t.flags|=1,Pe(e,t,a,l),t.child;case 14:return zf(e,t,t.type,t.pendingProps,l);case 15:return Rf(e,t,t.type,t.pendingProps,l);case 19:return Lf(e,t,l);case 31:return $g(e,t,l);case 22:return Mf(e,t,l,t.pendingProps);case 24:return Jl(t),a=Ie(Ge),e===null?(n=gc(),n===null&&(n=Me,i=hc(),n.pooledCache=i,i.refCount++,i!==null&&(n.pooledCacheLanes|=l),n=i),t.memoizedState={parent:a,cache:n},pc(t),vl(t,Ge,n)):((e.lanes&l)!==0&&(vc(e,t),gn(t,null,null,l),mn()),n=e.memoizedState,i=t.memoizedState,n.parent!==a?(n={parent:a,cache:a},t.memoizedState=n,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=n),vl(t,Ge,a)):(a=i.cache,vl(t,Ge,a),a!==n.cache&&dc(t,[Ge],l,!0))),Pe(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function el(e){e.flags|=4}function Pc(e,t,l,a,n){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(n&335544128)===n)if(e.stateNode.complete)e.flags|=8192;else if(fd())e.flags|=8192;else throw Fl=Ei,yc}else e.flags&=-16777217}function Yf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!eh(t))if(fd())e.flags|=8192;else throw Fl=Ei,yc}function Yi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?yr():536870912,e.lanes|=t,Da|=t)}function bn(e,t){if(!pe)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var a=null;l!==null;)l.alternate!==null&&(a=l),l=l.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function _e(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,a=0;if(t)for(var n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags&65011712,a|=n.flags&65011712,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)l|=n.lanes|n.childLanes,a|=n.subtreeFlags,a|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=a,e.childLanes=l,t}function Fg(e,t,l){var a=t.pendingProps;switch(cc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _e(t),null;case 1:return _e(t),null;case 3:return l=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Wt(Ge),He(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(xa(t)?el(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,rc())),_e(t),null;case 26:var n=t.type,i=t.memoizedState;return e===null?(el(t),i!==null?(_e(t),Yf(t,i)):(_e(t),Pc(t,n,null,a,l))):i?i!==e.memoizedState?(el(t),_e(t),Yf(t,i)):(_e(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&el(t),_e(t),Pc(t,n,e,a,l)),null;case 27:if(Wn(t),l=oe.current,n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&el(t);else{if(!a){if(t.stateNode===null)throw Error(r(166));return _e(t),null}e=F.current,xa(t)?po(t):(e=Zd(n,a,l),t.stateNode=e,el(t))}return _e(t),null;case 5:if(Wn(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&el(t);else{if(!a){if(t.stateNode===null)throw Error(r(166));return _e(t),null}if(i=F.current,xa(t))po(t);else{var s=eu(oe.current);switch(i){case 1:i=s.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:i=s.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":i=s.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":i=s.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":i=s.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof a.is=="string"?s.createElement("select",{is:a.is}):s.createElement("select"),a.multiple?i.multiple=!0:a.size&&(i.size=a.size);break;default:i=typeof a.is=="string"?s.createElement(n,{is:a.is}):s.createElement(n)}}i[We]=t,i[ut]=a;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)i.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=i;e:switch(et(i,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&el(t)}}return _e(t),Pc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&el(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(r(166));if(e=oe.current,xa(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,n=Fe,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[We]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||Ud(e.nodeValue,l)),e||pl(t,!0)}else e=eu(e).createTextNode(a),e[We]=t,t.stateNode=e}return _e(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=xa(t),l!==null){if(e===null){if(!a)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[We]=t}else Zl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;_e(t),e=!1}else l=rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(St(t),t):(St(t),null);if((t.flags&128)!==0)throw Error(r(558))}return _e(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=xa(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(r(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));n[We]=t}else Zl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;_e(t),n=!1}else n=rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(St(t),t):(St(t),null)}return St(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==n&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Yi(t,t.updateQueue),_e(t),null);case 4:return He(),e===null&&bs(t.stateNode.containerInfo),_e(t),null;case 10:return Wt(t.type),_e(t),null;case 19:if(q(Ye),a=t.memoizedState,a===null)return _e(t),null;if(n=(t.flags&128)!==0,i=a.rendering,i===null)if(n)bn(a,!1);else{if(Be!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=Ai(e),i!==null){for(t.flags|=128,bn(a,!1),e=i.updateQueue,t.updateQueue=e,Yi(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)fo(l,e),l=l.sibling;return J(Ye,Ye.current&1|2),pe&&Jt(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ht()>Xi&&(t.flags|=128,n=!0,bn(a,!1),t.lanes=4194304)}else{if(!n)if(e=Ai(i),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,Yi(t,e),bn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!pe)return _e(t),null}else 2*ht()-a.renderingStartTime>Xi&&l!==536870912&&(t.flags|=128,n=!0,bn(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(e=a.last,e!==null?e.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ht(),e.sibling=null,l=Ye.current,J(Ye,n?l&1|2:l&1),pe&&Jt(t,a.treeForkCount),e):(_e(t),null);case 22:case 23:return St(t),Ec(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(_e(t),t.subtreeFlags&6&&(t.flags|=8192)):_e(t),l=t.updateQueue,l!==null&&Yi(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&q($l),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Wt(Ge),_e(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function Ig(e,t){switch(cc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wt(Ge),He(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Wn(t),null;case 31:if(t.memoizedState!==null){if(St(t),t.alternate===null)throw Error(r(340));Zl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(St(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Zl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(Ye),null;case 4:return He(),null;case 10:return Wt(t.type),null;case 22:case 23:return St(t),Ec(),e!==null&&q($l),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wt(Ge),null;case 25:return null;default:return null}}function qf(e,t){switch(cc(t),t.tag){case 3:Wt(Ge),He();break;case 26:case 27:case 5:Wn(t);break;case 4:He();break;case 31:t.memoizedState!==null&&St(t);break;case 13:St(t);break;case 19:q(Ye);break;case 10:Wt(t.type);break;case 22:case 23:St(t),Ec(),e!==null&&q($l);break;case 24:Wt(Ge)}}function En(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&e)===e){a=void 0;var i=l.create,s=l.inst;a=i(),s.destroy=a}l=l.next}while(l!==n)}}catch(m){Te(t,t.return,m)}}function jl(e,t,l){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var i=n.next;a=i;do{if((a.tag&e)===e){var s=a.inst,m=s.destroy;if(m!==void 0){s.destroy=void 0,n=t;var b=l,M=m;try{M()}catch(L){Te(n,b,L)}}}a=a.next}while(a!==i)}}catch(L){Te(t,t.return,L)}}function Gf(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{No(t,l)}catch(a){Te(e,e.return,a)}}}function Qf(e,t,l){l.props=ea(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){Te(e,t,a)}}function Cn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(n){Te(e,t,n)}}function Gt(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){Te(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){Te(e,t,n)}else l.current=null}function Vf(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){Te(e,e.return,n)}}function es(e,t,l){try{var a=e.stateNode;xy(a,e.type,l,t),a[ut]=t}catch(n){Te(e,e.return,n)}}function Xf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&_l(e.type)||e.tag===4}function ts(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&_l(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ls(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=kt));else if(a!==4&&(a===27&&_l(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(ls(e,t,l),e=e.sibling;e!==null;)ls(e,t,l),e=e.sibling}function qi(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&_l(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(qi(e,t,l),e=e.sibling;e!==null;)qi(e,t,l),e=e.sibling}function kf(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);et(t,a,l),t[We]=e,t[ut]=l}catch(i){Te(e,e.return,i)}}var tl=!1,Xe=!1,as=!1,Zf=typeof WeakSet=="function"?WeakSet:Set,$e=null;function Pg(e,t){if(e=e.containerInfo,js=cu,e=lo(e),Wu(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,i=a.focusNode;a=a.focusOffset;try{l.nodeType,i.nodeType}catch{l=null;break e}var s=0,m=-1,b=-1,M=0,L=0,Q=e,D=null;t:for(;;){for(var w;Q!==l||n!==0&&Q.nodeType!==3||(m=s+n),Q!==i||a!==0&&Q.nodeType!==3||(b=s+a),Q.nodeType===3&&(s+=Q.nodeValue.length),(w=Q.firstChild)!==null;)D=Q,Q=w;for(;;){if(Q===e)break t;if(D===l&&++M===n&&(m=s),D===i&&++L===a&&(b=s),(w=Q.nextSibling)!==null)break;Q=D,D=Q.parentNode}Q=w}l=m===-1||b===-1?null:{start:m,end:b}}else l=null}l=l||{start:0,end:0}}else l=null;for(Ts={focusedElem:e,selectionRange:l},cu=!1,$e=t;$e!==null;)if(t=$e,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,$e=e;else for(;$e!==null;){switch(t=$e,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)n=e[l],n.ref.impl=n.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,l=t,n=i.memoizedProps,i=i.memoizedState,a=l.stateNode;try{var W=ea(l.type,n);e=a.getSnapshotBeforeUpdate(W,i),a.__reactInternalSnapshotBeforeUpdate=e}catch(ne){Te(l,l.return,ne)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)Rs(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Rs(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(r(163))}if(e=t.sibling,e!==null){e.return=t.return,$e=e;break}$e=t.return}}function Kf(e,t,l){var a=l.flags;switch(l.tag){case 0:case 11:case 15:al(e,l),a&4&&En(5,l);break;case 1:if(al(e,l),a&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(s){Te(l,l.return,s)}else{var n=ea(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(n,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){Te(l,l.return,s)}}a&64&&Gf(l),a&512&&Cn(l,l.return);break;case 3:if(al(e,l),a&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{No(e,t)}catch(s){Te(l,l.return,s)}}break;case 27:t===null&&a&4&&kf(l);case 26:case 5:al(e,l),t===null&&a&4&&Vf(l),a&512&&Cn(l,l.return);break;case 12:al(e,l);break;case 31:al(e,l),a&4&&Wf(e,l);break;case 13:al(e,l),a&4&&Ff(e,l),a&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=sy.bind(null,l),Ry(e,l))));break;case 22:if(a=l.memoizedState!==null||tl,!a){t=t!==null&&t.memoizedState!==null||Xe,n=tl;var i=Xe;tl=a,(Xe=t)&&!i?nl(e,l,(l.subtreeFlags&8772)!==0):al(e,l),tl=n,Xe=i}break;case 30:break;default:al(e,l)}}function Jf(e){var t=e.alternate;t!==null&&(e.alternate=null,Jf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Du(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Oe=null,st=!1;function ll(e,t,l){for(l=l.child;l!==null;)$f(e,t,l),l=l.sibling}function $f(e,t,l){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(Za,l)}catch{}switch(l.tag){case 26:Xe||Gt(l,t),ll(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Xe||Gt(l,t);var a=Oe,n=st;_l(l.type)&&(Oe=l.stateNode,st=!1),ll(e,t,l),On(l.stateNode),Oe=a,st=n;break;case 5:Xe||Gt(l,t);case 6:if(a=Oe,n=st,Oe=null,ll(e,t,l),Oe=a,st=n,Oe!==null)if(st)try{(Oe.nodeType===9?Oe.body:Oe.nodeName==="HTML"?Oe.ownerDocument.body:Oe).removeChild(l.stateNode)}catch(i){Te(l,t,i)}else try{Oe.removeChild(l.stateNode)}catch(i){Te(l,t,i)}break;case 18:Oe!==null&&(st?(e=Oe,Gd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),Ga(e)):Gd(Oe,l.stateNode));break;case 4:a=Oe,n=st,Oe=l.stateNode.containerInfo,st=!0,ll(e,t,l),Oe=a,st=n;break;case 0:case 11:case 14:case 15:jl(2,l,t),Xe||jl(4,l,t),ll(e,t,l);break;case 1:Xe||(Gt(l,t),a=l.stateNode,typeof a.componentWillUnmount=="function"&&Qf(l,t,a)),ll(e,t,l);break;case 21:ll(e,t,l);break;case 22:Xe=(a=Xe)||l.memoizedState!==null,ll(e,t,l),Xe=a;break;default:ll(e,t,l)}}function Wf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ga(e)}catch(l){Te(t,t.return,l)}}}function Ff(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ga(e)}catch(l){Te(t,t.return,l)}}function ey(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zf),t;default:throw Error(r(435,e.tag))}}function Gi(e,t){var l=ey(e);t.forEach(function(a){if(!l.has(a)){l.add(a);var n=ry.bind(null,e,a);a.then(n,n)}})}function rt(e,t){var l=t.deletions;if(l!==null)for(var a=0;a<l.length;a++){var n=l[a],i=e,s=t,m=s;e:for(;m!==null;){switch(m.tag){case 27:if(_l(m.type)){Oe=m.stateNode,st=!1;break e}break;case 5:Oe=m.stateNode,st=!1;break e;case 3:case 4:Oe=m.stateNode.containerInfo,st=!0;break e}m=m.return}if(Oe===null)throw Error(r(160));$f(i,s,n),Oe=null,st=!1,i=n.alternate,i!==null&&(i.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)If(t,e),t=t.sibling}var Ut=null;function If(e,t){var l=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:rt(t,e),ot(e),a&4&&(jl(3,e,e.return),En(3,e),jl(5,e,e.return));break;case 1:rt(t,e),ot(e),a&512&&(Xe||l===null||Gt(l,l.return)),a&64&&tl&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?a:l.concat(a))));break;case 26:var n=Ut;if(rt(t,e),ot(e),a&512&&(Xe||l===null||Gt(l,l.return)),a&4){var i=l!==null?l.memoizedState:null;if(a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null){e:{a=e.type,l=e.memoizedProps,n=n.ownerDocument||n;t:switch(a){case"title":i=n.getElementsByTagName("title")[0],(!i||i[$a]||i[We]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=n.createElement(a),n.head.insertBefore(i,n.querySelector("head > title"))),et(i,a,l),i[We]=e,Je(i),a=i;break e;case"link":var s=Id("link","href",n).get(a+(l.href||""));if(s){for(var m=0;m<s.length;m++)if(i=s[m],i.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&i.getAttribute("rel")===(l.rel==null?null:l.rel)&&i.getAttribute("title")===(l.title==null?null:l.title)&&i.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){s.splice(m,1);break t}}i=n.createElement(a),et(i,a,l),n.head.appendChild(i);break;case"meta":if(s=Id("meta","content",n).get(a+(l.content||""))){for(m=0;m<s.length;m++)if(i=s[m],i.getAttribute("content")===(l.content==null?null:""+l.content)&&i.getAttribute("name")===(l.name==null?null:l.name)&&i.getAttribute("property")===(l.property==null?null:l.property)&&i.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&i.getAttribute("charset")===(l.charSet==null?null:l.charSet)){s.splice(m,1);break t}}i=n.createElement(a),et(i,a,l),n.head.appendChild(i);break;default:throw Error(r(468,a))}i[We]=e,Je(i),a=i}e.stateNode=a}else Pd(n,e.type,e.stateNode);else e.stateNode=Fd(n,a,e.memoizedProps);else i!==a?(i===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):i.count--,a===null?Pd(n,e.type,e.stateNode):Fd(n,a,e.memoizedProps)):a===null&&e.stateNode!==null&&es(e,e.memoizedProps,l.memoizedProps)}break;case 27:rt(t,e),ot(e),a&512&&(Xe||l===null||Gt(l,l.return)),l!==null&&a&4&&es(e,e.memoizedProps,l.memoizedProps);break;case 5:if(rt(t,e),ot(e),a&512&&(Xe||l===null||Gt(l,l.return)),e.flags&32){n=e.stateNode;try{oa(n,"")}catch(W){Te(e,e.return,W)}}a&4&&e.stateNode!=null&&(n=e.memoizedProps,es(e,n,l!==null?l.memoizedProps:n)),a&1024&&(as=!0);break;case 6:if(rt(t,e),ot(e),a&4){if(e.stateNode===null)throw Error(r(162));a=e.memoizedProps,l=e.stateNode;try{l.nodeValue=a}catch(W){Te(e,e.return,W)}}break;case 3:if(au=null,n=Ut,Ut=tu(t.containerInfo),rt(t,e),Ut=n,ot(e),a&4&&l!==null&&l.memoizedState.isDehydrated)try{Ga(t.containerInfo)}catch(W){Te(e,e.return,W)}as&&(as=!1,Pf(e));break;case 4:a=Ut,Ut=tu(e.stateNode.containerInfo),rt(t,e),ot(e),Ut=a;break;case 12:rt(t,e),ot(e);break;case 31:rt(t,e),ot(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Gi(e,a)));break;case 13:rt(t,e),ot(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Vi=ht()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Gi(e,a)));break;case 22:n=e.memoizedState!==null;var b=l!==null&&l.memoizedState!==null,M=tl,L=Xe;if(tl=M||n,Xe=L||b,rt(t,e),Xe=L,tl=M,ot(e),a&8192)e:for(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,n&&(l===null||b||tl||Xe||ta(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){b=l=t;try{if(i=b.stateNode,n)s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none";else{m=b.stateNode;var Q=b.memoizedProps.style,D=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;m.style.display=D==null||typeof D=="boolean"?"":(""+D).trim()}}catch(W){Te(b,b.return,W)}}}else if(t.tag===6){if(l===null){b=t;try{b.stateNode.nodeValue=n?"":b.memoizedProps}catch(W){Te(b,b.return,W)}}}else if(t.tag===18){if(l===null){b=t;try{var w=b.stateNode;n?Qd(w,!0):Qd(b.stateNode,!1)}catch(W){Te(b,b.return,W)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(l=a.retryQueue,l!==null&&(a.retryQueue=null,Gi(e,l))));break;case 19:rt(t,e),ot(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Gi(e,a)));break;case 30:break;case 21:break;default:rt(t,e),ot(e)}}function ot(e){var t=e.flags;if(t&2){try{for(var l,a=e.return;a!==null;){if(Xf(a)){l=a;break}a=a.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var n=l.stateNode,i=ts(e);qi(e,i,n);break;case 5:var s=l.stateNode;l.flags&32&&(oa(s,""),l.flags&=-33);var m=ts(e);qi(e,m,s);break;case 3:case 4:var b=l.stateNode.containerInfo,M=ts(e);ls(e,M,b);break;default:throw Error(r(161))}}catch(L){Te(e,e.return,L)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Pf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Pf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function al(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Kf(e,t.alternate,t),t=t.sibling}function ta(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:jl(4,t,t.return),ta(t);break;case 1:Gt(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Qf(t,t.return,l),ta(t);break;case 27:On(t.stateNode);case 26:case 5:Gt(t,t.return),ta(t);break;case 22:t.memoizedState===null&&ta(t);break;case 30:ta(t);break;default:ta(t)}e=e.sibling}}function nl(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,n=e,i=t,s=i.flags;switch(i.tag){case 0:case 11:case 15:nl(n,i,l),En(4,i);break;case 1:if(nl(n,i,l),a=i,n=a.stateNode,typeof n.componentDidMount=="function")try{n.componentDidMount()}catch(M){Te(a,a.return,M)}if(a=i,n=a.updateQueue,n!==null){var m=a.stateNode;try{var b=n.shared.hiddenCallbacks;if(b!==null)for(n.shared.hiddenCallbacks=null,n=0;n<b.length;n++)Mo(b[n],m)}catch(M){Te(a,a.return,M)}}l&&s&64&&Gf(i),Cn(i,i.return);break;case 27:kf(i);case 26:case 5:nl(n,i,l),l&&a===null&&s&4&&Vf(i),Cn(i,i.return);break;case 12:nl(n,i,l);break;case 31:nl(n,i,l),l&&s&4&&Wf(n,i);break;case 13:nl(n,i,l),l&&s&4&&Ff(n,i);break;case 22:i.memoizedState===null&&nl(n,i,l),Cn(i,i.return);break;case 30:break;default:nl(n,i,l)}t=t.sibling}}function ns(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&rn(l))}function is(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&rn(e))}function Bt(e,t,l,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ed(e,t,l,a),t=t.sibling}function ed(e,t,l,a){var n=t.flags;switch(t.tag){case 0:case 11:case 15:Bt(e,t,l,a),n&2048&&En(9,t);break;case 1:Bt(e,t,l,a);break;case 3:Bt(e,t,l,a),n&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&rn(e)));break;case 12:if(n&2048){Bt(e,t,l,a),e=t.stateNode;try{var i=t.memoizedProps,s=i.id,m=i.onPostCommit;typeof m=="function"&&m(s,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(b){Te(t,t.return,b)}}else Bt(e,t,l,a);break;case 31:Bt(e,t,l,a);break;case 13:Bt(e,t,l,a);break;case 23:break;case 22:i=t.stateNode,s=t.alternate,t.memoizedState!==null?i._visibility&2?Bt(e,t,l,a):jn(e,t):i._visibility&2?Bt(e,t,l,a):(i._visibility|=2,Na(e,t,l,a,(t.subtreeFlags&10256)!==0||!1)),n&2048&&ns(s,t);break;case 24:Bt(e,t,l,a),n&2048&&is(t.alternate,t);break;default:Bt(e,t,l,a)}}function Na(e,t,l,a,n){for(n=n&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,s=t,m=l,b=a,M=s.flags;switch(s.tag){case 0:case 11:case 15:Na(i,s,m,b,n),En(8,s);break;case 23:break;case 22:var L=s.stateNode;s.memoizedState!==null?L._visibility&2?Na(i,s,m,b,n):jn(i,s):(L._visibility|=2,Na(i,s,m,b,n)),n&&M&2048&&ns(s.alternate,s);break;case 24:Na(i,s,m,b,n),n&&M&2048&&is(s.alternate,s);break;default:Na(i,s,m,b,n)}t=t.sibling}}function jn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,a=t,n=a.flags;switch(a.tag){case 22:jn(l,a),n&2048&&ns(a.alternate,a);break;case 24:jn(l,a),n&2048&&is(a.alternate,a);break;default:jn(l,a)}t=t.sibling}}var Tn=8192;function _a(e,t,l){if(e.subtreeFlags&Tn)for(e=e.child;e!==null;)td(e,t,l),e=e.sibling}function td(e,t,l){switch(e.tag){case 26:_a(e,t,l),e.flags&Tn&&e.memoizedState!==null&&qy(l,Ut,e.memoizedState,e.memoizedProps);break;case 5:_a(e,t,l);break;case 3:case 4:var a=Ut;Ut=tu(e.stateNode.containerInfo),_a(e,t,l),Ut=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Tn,Tn=16777216,_a(e,t,l),Tn=a):_a(e,t,l));break;default:_a(e,t,l)}}function ld(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function An(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];$e=a,nd(a,e)}ld(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ad(e),e=e.sibling}function ad(e){switch(e.tag){case 0:case 11:case 15:An(e),e.flags&2048&&jl(9,e,e.return);break;case 3:An(e);break;case 12:An(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Qi(e)):An(e);break;default:An(e)}}function Qi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var a=t[l];$e=a,nd(a,e)}ld(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:jl(8,t,t.return),Qi(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,Qi(t));break;default:Qi(t)}e=e.sibling}}function nd(e,t){for(;$e!==null;){var l=$e;switch(l.tag){case 0:case 11:case 15:jl(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var a=l.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:rn(l.memoizedState.cache)}if(a=l.child,a!==null)a.return=l,$e=a;else e:for(l=e;$e!==null;){a=$e;var n=a.sibling,i=a.return;if(Jf(a),a===l){$e=null;break e}if(n!==null){n.return=i,$e=n;break e}$e=i}}}var ty={getCacheForType:function(e){var t=Ie(Ge),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return Ie(Ge).controller.signal}},ly=typeof WeakMap=="function"?WeakMap:Map,Ee=0,Me=null,fe=null,me=0,je=0,xt=null,Tl=!1,Oa=!1,us=!1,il=0,Be=0,Al=0,la=0,cs=0,bt=0,Da=0,zn=null,ft=null,ss=!1,Vi=0,id=0,Xi=1/0,ki=null,zl=null,Ze=0,Rl=null,wa=null,ul=0,rs=0,os=null,ud=null,Rn=0,fs=null;function Et(){return(Ee&2)!==0&&me!==0?me&-me:U.T!==null?ps():xr()}function cd(){if(bt===0)if((me&536870912)===0||pe){var e=Pn;Pn<<=1,(Pn&3932160)===0&&(Pn=262144),bt=e}else bt=536870912;return e=vt.current,e!==null&&(e.flags|=32),bt}function dt(e,t,l){(e===Me&&(je===2||je===9)||e.cancelPendingCommit!==null)&&(Ua(e,0),Ml(e,me,bt,!1)),Ja(e,l),((Ee&2)===0||e!==Me)&&(e===Me&&((Ee&2)===0&&(la|=l),Be===4&&Ml(e,me,bt,!1)),Qt(e))}function sd(e,t,l){if((Ee&6)!==0)throw Error(r(327));var a=!l&&(t&127)===0&&(t&e.expiredLanes)===0||Ka(e,t),n=a?iy(e,t):hs(e,t,!0),i=a;do{if(n===0){Oa&&!a&&Ml(e,t,0,!1);break}else{if(l=e.current.alternate,i&&!ay(l)){n=hs(e,t,!1),i=!1;continue}if(n===2){if(i=t,e.errorRecoveryDisabledLanes&i)var s=0;else s=e.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){t=s;e:{var m=e;n=zn;var b=m.current.memoizedState.isDehydrated;if(b&&(Ua(m,s).flags|=256),s=hs(m,s,!1),s!==2){if(us&&!b){m.errorRecoveryDisabledLanes|=i,la|=i,n=4;break e}i=ft,ft=n,i!==null&&(ft===null?ft=i:ft.push.apply(ft,i))}n=s}if(i=!1,n!==2)continue}}if(n===1){Ua(e,0),Ml(e,t,0,!0);break}e:{switch(a=e,i=n,i){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t)break;case 6:Ml(a,t,bt,!Tl);break e;case 2:ft=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(n=Vi+300-ht(),10<n)){if(Ml(a,t,bt,!Tl),ti(a,0,!0)!==0)break e;ul=t,a.timeoutHandle=Yd(rd.bind(null,a,l,ft,ki,ss,t,bt,la,Da,Tl,i,"Throttled",-0,0),n);break e}rd(a,l,ft,ki,ss,t,bt,la,Da,Tl,i,null,-0,0)}}break}while(!0);Qt(e)}function rd(e,t,l,a,n,i,s,m,b,M,L,Q,D,w){if(e.timeoutHandle=-1,Q=t.subtreeFlags,Q&8192||(Q&16785408)===16785408){Q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:kt},td(t,i,Q);var W=(i&62914560)===i?Vi-ht():(i&4194048)===i?id-ht():0;if(W=Gy(Q,W),W!==null){ul=i,e.cancelPendingCommit=W(pd.bind(null,e,t,i,l,a,n,s,m,b,L,Q,null,D,w)),Ml(e,i,s,!M);return}}pd(e,t,i,l,a,n,s,m,b)}function ay(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var a=0;a<l.length;a++){var n=l[a],i=n.getSnapshot;n=n.value;try{if(!yt(i(),n))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ml(e,t,l,a){t&=~cs,t&=~la,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var n=t;0<n;){var i=31-gt(n),s=1<<i;a[i]=-1,n&=~s}l!==0&&pr(e,l,t)}function Zi(){return(Ee&6)===0?(Mn(0),!1):!0}function ds(){if(fe!==null){if(je===0)var e=fe.return;else e=fe,$t=Kl=null,Rc(e),Ta=null,fn=0,e=fe;for(;e!==null;)qf(e.alternate,e),e=e.return;fe=null}}function Ua(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Cy(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),ul=0,ds(),Me=e,fe=l=Kt(e.current,null),me=t,je=0,xt=null,Tl=!1,Oa=Ka(e,t),us=!1,Da=bt=cs=la=Al=Be=0,ft=zn=null,ss=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var n=31-gt(a),i=1<<n;t|=e[n],a&=~i}return il=t,hi(),l}function od(e,t){ce=null,U.H=Sn,t===ja||t===bi?(t=To(),je=3):t===yc?(t=To(),je=4):je=t===Xc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,xt=t,fe===null&&(Be=1,Ui(e,At(t,e.current)))}function fd(){var e=vt.current;return e===null?!0:(me&4194048)===me?Nt===null:(me&62914560)===me||(me&536870912)!==0?e===Nt:!1}function dd(){var e=U.H;return U.H=Sn,e===null?Sn:e}function hd(){var e=U.A;return U.A=ty,e}function Ki(){Be=4,Tl||(me&4194048)!==me&&vt.current!==null||(Oa=!0),(Al&134217727)===0&&(la&134217727)===0||Me===null||Ml(Me,me,bt,!1)}function hs(e,t,l){var a=Ee;Ee|=2;var n=dd(),i=hd();(Me!==e||me!==t)&&(ki=null,Ua(e,t)),t=!1;var s=Be;e:do try{if(je!==0&&fe!==null){var m=fe,b=xt;switch(je){case 8:ds(),s=6;break e;case 3:case 2:case 9:case 6:vt.current===null&&(t=!0);var M=je;if(je=0,xt=null,Ba(e,m,b,M),l&&Oa){s=0;break e}break;default:M=je,je=0,xt=null,Ba(e,m,b,M)}}ny(),s=Be;break}catch(L){od(e,L)}while(!0);return t&&e.shellSuspendCounter++,$t=Kl=null,Ee=a,U.H=n,U.A=i,fe===null&&(Me=null,me=0,hi()),s}function ny(){for(;fe!==null;)md(fe)}function iy(e,t){var l=Ee;Ee|=2;var a=dd(),n=hd();Me!==e||me!==t?(ki=null,Xi=ht()+500,Ua(e,t)):Oa=Ka(e,t);e:do try{if(je!==0&&fe!==null){t=fe;var i=xt;t:switch(je){case 1:je=0,xt=null,Ba(e,t,i,1);break;case 2:case 9:if(Co(i)){je=0,xt=null,gd(t);break}t=function(){je!==2&&je!==9||Me!==e||(je=7),Qt(e)},i.then(t,t);break e;case 3:je=7;break e;case 4:je=5;break e;case 7:Co(i)?(je=0,xt=null,gd(t)):(je=0,xt=null,Ba(e,t,i,7));break;case 5:var s=null;switch(fe.tag){case 26:s=fe.memoizedState;case 5:case 27:var m=fe;if(s?eh(s):m.stateNode.complete){je=0,xt=null;var b=m.sibling;if(b!==null)fe=b;else{var M=m.return;M!==null?(fe=M,Ji(M)):fe=null}break t}}je=0,xt=null,Ba(e,t,i,5);break;case 6:je=0,xt=null,Ba(e,t,i,6);break;case 8:ds(),Be=6;break e;default:throw Error(r(462))}}uy();break}catch(L){od(e,L)}while(!0);return $t=Kl=null,U.H=a,U.A=n,Ee=l,fe!==null?0:(Me=null,me=0,hi(),Be)}function uy(){for(;fe!==null&&!Mm();)md(fe)}function md(e){var t=Hf(e.alternate,e,il);e.memoizedProps=e.pendingProps,t===null?Ji(e):fe=t}function gd(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Of(l,t,t.pendingProps,t.type,void 0,me);break;case 11:t=Of(l,t,t.pendingProps,t.type.render,t.ref,me);break;case 5:Rc(t);default:qf(l,t),t=fe=fo(t,il),t=Hf(l,t,il)}e.memoizedProps=e.pendingProps,t===null?Ji(e):fe=t}function Ba(e,t,l,a){$t=Kl=null,Rc(t),Ta=null,fn=0;var n=t.return;try{if(Jg(e,n,t,l,me)){Be=1,Ui(e,At(l,e.current)),fe=null;return}}catch(i){if(n!==null)throw fe=n,i;Be=1,Ui(e,At(l,e.current)),fe=null;return}t.flags&32768?(pe||a===1?e=!0:Oa||(me&536870912)!==0?e=!1:(Tl=e=!0,(a===2||a===9||a===3||a===6)&&(a=vt.current,a!==null&&a.tag===13&&(a.flags|=16384))),yd(t,e)):Ji(t)}function Ji(e){var t=e;do{if((t.flags&32768)!==0){yd(t,Tl);return}e=t.return;var l=Fg(t.alternate,t,il);if(l!==null){fe=l;return}if(t=t.sibling,t!==null){fe=t;return}fe=t=e}while(t!==null);Be===0&&(Be=5)}function yd(e,t){do{var l=Ig(e.alternate,e);if(l!==null){l.flags&=32767,fe=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){fe=e;return}fe=e=l}while(e!==null);Be=6,fe=null}function pd(e,t,l,a,n,i,s,m,b){e.cancelPendingCommit=null;do $i();while(Ze!==0);if((Ee&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));if(i=t.lanes|t.childLanes,i|=tc,Ym(e,l,i,s,m,b),e===Me&&(fe=Me=null,me=0),wa=t,Rl=e,ul=l,rs=i,os=n,ud=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,oy(Fn,function(){return Ed(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=U.T,U.T=null,n=Z.p,Z.p=2,s=Ee,Ee|=4;try{Pg(e,t,l)}finally{Ee=s,Z.p=n,U.T=a}}Ze=1,vd(),Sd(),xd()}}function vd(){if(Ze===1){Ze=0;var e=Rl,t=wa,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=U.T,U.T=null;var a=Z.p;Z.p=2;var n=Ee;Ee|=4;try{If(t,e);var i=Ts,s=lo(e.containerInfo),m=i.focusedElem,b=i.selectionRange;if(s!==m&&m&&m.ownerDocument&&to(m.ownerDocument.documentElement,m)){if(b!==null&&Wu(m)){var M=b.start,L=b.end;if(L===void 0&&(L=M),"selectionStart"in m)m.selectionStart=M,m.selectionEnd=Math.min(L,m.value.length);else{var Q=m.ownerDocument||document,D=Q&&Q.defaultView||window;if(D.getSelection){var w=D.getSelection(),W=m.textContent.length,ne=Math.min(b.start,W),Re=b.end===void 0?ne:Math.min(b.end,W);!w.extend&&ne>Re&&(s=Re,Re=ne,ne=s);var A=eo(m,ne),T=eo(m,Re);if(A&&T&&(w.rangeCount!==1||w.anchorNode!==A.node||w.anchorOffset!==A.offset||w.focusNode!==T.node||w.focusOffset!==T.offset)){var R=Q.createRange();R.setStart(A.node,A.offset),w.removeAllRanges(),ne>Re?(w.addRange(R),w.extend(T.node,T.offset)):(R.setEnd(T.node,T.offset),w.addRange(R))}}}}for(Q=[],w=m;w=w.parentNode;)w.nodeType===1&&Q.push({element:w,left:w.scrollLeft,top:w.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<Q.length;m++){var Y=Q[m];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}cu=!!js,Ts=js=null}finally{Ee=n,Z.p=a,U.T=l}}e.current=t,Ze=2}}function Sd(){if(Ze===2){Ze=0;var e=Rl,t=wa,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=U.T,U.T=null;var a=Z.p;Z.p=2;var n=Ee;Ee|=4;try{Kf(e,t.alternate,t)}finally{Ee=n,Z.p=a,U.T=l}}Ze=3}}function xd(){if(Ze===4||Ze===3){Ze=0,Nm();var e=Rl,t=wa,l=ul,a=ud;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ze=5:(Ze=0,wa=Rl=null,bd(e,e.pendingLanes));var n=e.pendingLanes;if(n===0&&(zl=null),_u(l),t=t.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(Za,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=U.T,n=Z.p,Z.p=2,U.T=null;try{for(var i=e.onRecoverableError,s=0;s<a.length;s++){var m=a[s];i(m.value,{componentStack:m.stack})}}finally{U.T=t,Z.p=n}}(ul&3)!==0&&$i(),Qt(e),n=e.pendingLanes,(l&261930)!==0&&(n&42)!==0?e===fs?Rn++:(Rn=0,fs=e):Rn=0,Mn(0)}}function bd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,rn(t)))}function $i(){return vd(),Sd(),xd(),Ed()}function Ed(){if(Ze!==5)return!1;var e=Rl,t=rs;rs=0;var l=_u(ul),a=U.T,n=Z.p;try{Z.p=32>l?32:l,U.T=null,l=os,os=null;var i=Rl,s=ul;if(Ze=0,wa=Rl=null,ul=0,(Ee&6)!==0)throw Error(r(331));var m=Ee;if(Ee|=4,ad(i.current),ed(i,i.current,s,l),Ee=m,Mn(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(Za,i)}catch{}return!0}finally{Z.p=n,U.T=a,bd(e,t)}}function Cd(e,t,l){t=At(l,t),t=Vc(e.stateNode,t,2),e=bl(e,t,2),e!==null&&(Ja(e,2),Qt(e))}function Te(e,t,l){if(e.tag===3)Cd(e,e,l);else for(;t!==null;){if(t.tag===3){Cd(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(zl===null||!zl.has(a))){e=At(l,e),l=jf(2),a=bl(t,l,2),a!==null&&(Tf(l,a,t,e),Ja(a,2),Qt(a));break}}t=t.return}}function ms(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new ly;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(l)||(us=!0,n.add(l),e=cy.bind(null,e,t,l),t.then(e,e))}function cy(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Me===e&&(me&l)===l&&(Be===4||Be===3&&(me&62914560)===me&&300>ht()-Vi?(Ee&2)===0&&Ua(e,0):cs|=l,Da===me&&(Da=0)),Qt(e)}function jd(e,t){t===0&&(t=yr()),e=Xl(e,t),e!==null&&(Ja(e,t),Qt(e))}function sy(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),jd(e,l)}function ry(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(r(314))}a!==null&&a.delete(t),jd(e,l)}function oy(e,t){return zu(e,t)}var Wi=null,La=null,gs=!1,Fi=!1,ys=!1,Nl=0;function Qt(e){e!==La&&e.next===null&&(La===null?Wi=La=e:La=La.next=e),Fi=!0,gs||(gs=!0,dy())}function Mn(e,t){if(!ys&&Fi){ys=!0;do for(var l=!1,a=Wi;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var i=0;else{var s=a.suspendedLanes,m=a.pingedLanes;i=(1<<31-gt(42|e)+1)-1,i&=n&~(s&~m),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(l=!0,Rd(a,i))}else i=me,i=ti(a,a===Me?i:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(i&3)===0||Ka(a,i)||(l=!0,Rd(a,i));a=a.next}while(l);ys=!1}}function fy(){Td()}function Td(){Fi=gs=!1;var e=0;Nl!==0&&Ey()&&(e=Nl);for(var t=ht(),l=null,a=Wi;a!==null;){var n=a.next,i=Ad(a,t);i===0?(a.next=null,l===null?Wi=n:l.next=n,n===null&&(La=l)):(l=a,(e!==0||(i&3)!==0)&&(Fi=!0)),a=n}Ze!==0&&Ze!==5||Mn(e),Nl!==0&&(Nl=0)}function Ad(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var s=31-gt(i),m=1<<s,b=n[s];b===-1?((m&l)===0||(m&a)!==0)&&(n[s]=Hm(m,t)):b<=t&&(e.expiredLanes|=m),i&=~m}if(t=Me,l=me,l=ti(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,l===0||e===t&&(je===2||je===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Ru(a),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Ka(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(a!==null&&Ru(a),_u(l)){case 2:case 8:l=mr;break;case 32:l=Fn;break;case 268435456:l=gr;break;default:l=Fn}return a=zd.bind(null,e),l=zu(l,a),e.callbackPriority=t,e.callbackNode=l,t}return a!==null&&a!==null&&Ru(a),e.callbackPriority=2,e.callbackNode=null,2}function zd(e,t){if(Ze!==0&&Ze!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if($i()&&e.callbackNode!==l)return null;var a=me;return a=ti(e,e===Me?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(sd(e,a,t),Ad(e,ht()),e.callbackNode!=null&&e.callbackNode===l?zd.bind(null,e):null)}function Rd(e,t){if($i())return null;sd(e,t,!0)}function dy(){jy(function(){(Ee&6)!==0?zu(hr,fy):Td()})}function ps(){if(Nl===0){var e=Ea;e===0&&(e=In,In<<=1,(In&261888)===0&&(In=256)),Nl=e}return Nl}function Md(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ii(""+e)}function Nd(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function hy(e,t,l,a,n){if(t==="submit"&&l&&l.stateNode===n){var i=Md((n[ut]||null).action),s=a.submitter;s&&(t=(t=s[ut]||null)?Md(t.formAction):s.getAttribute("formAction"),t!==null&&(i=t,s=null));var m=new ri("action","action",null,a,n);e.push({event:m,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Nl!==0){var b=s?Nd(n,s):new FormData(n);Lc(l,{pending:!0,data:b,method:n.method,action:i},null,b)}}else typeof i=="function"&&(m.preventDefault(),b=s?Nd(n,s):new FormData(n),Lc(l,{pending:!0,data:b,method:n.method,action:i},i,b))},currentTarget:n}]})}}for(var vs=0;vs<ec.length;vs++){var Ss=ec[vs],my=Ss.toLowerCase(),gy=Ss[0].toUpperCase()+Ss.slice(1);wt(my,"on"+gy)}wt(io,"onAnimationEnd"),wt(uo,"onAnimationIteration"),wt(co,"onAnimationStart"),wt("dblclick","onDoubleClick"),wt("focusin","onFocus"),wt("focusout","onBlur"),wt(_g,"onTransitionRun"),wt(Og,"onTransitionStart"),wt(Dg,"onTransitionCancel"),wt(so,"onTransitionEnd"),sa("onMouseEnter",["mouseout","mouseover"]),sa("onMouseLeave",["mouseout","mouseover"]),sa("onPointerEnter",["pointerout","pointerover"]),sa("onPointerLeave",["pointerout","pointerover"]),ql("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ql("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ql("onBeforeInput",["compositionend","keypress","textInput","paste"]),ql("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ql("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ql("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Nn="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(" "),yy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Nn));function _d(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var a=e[l],n=a.event;a=a.listeners;e:{var i=void 0;if(t)for(var s=a.length-1;0<=s;s--){var m=a[s],b=m.instance,M=m.currentTarget;if(m=m.listener,b!==i&&n.isPropagationStopped())break e;i=m,n.currentTarget=M;try{i(n)}catch(L){di(L)}n.currentTarget=null,i=b}else for(s=0;s<a.length;s++){if(m=a[s],b=m.instance,M=m.currentTarget,m=m.listener,b!==i&&n.isPropagationStopped())break e;i=m,n.currentTarget=M;try{i(n)}catch(L){di(L)}n.currentTarget=null,i=b}}}}function de(e,t){var l=t[Ou];l===void 0&&(l=t[Ou]=new Set);var a=e+"__bubble";l.has(a)||(Od(t,e,2,!1),l.add(a))}function xs(e,t,l){var a=0;t&&(a|=4),Od(l,e,a,t)}var Ii="_reactListening"+Math.random().toString(36).slice(2);function bs(e){if(!e[Ii]){e[Ii]=!0,Cr.forEach(function(l){l!=="selectionchange"&&(yy.has(l)||xs(l,!1,e),xs(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ii]||(t[Ii]=!0,xs("selectionchange",!1,t))}}function Od(e,t,l,a){switch(ch(t)){case 2:var n=Xy;break;case 8:n=ky;break;default:n=Bs}l=n.bind(null,t,l,e),n=void 0,!Gu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),a?n!==void 0?e.addEventListener(t,l,{capture:!0,passive:n}):e.addEventListener(t,l,!0):n!==void 0?e.addEventListener(t,l,{passive:n}):e.addEventListener(t,l,!1)}function Es(e,t,l,a,n){var i=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var s=a.tag;if(s===3||s===4){var m=a.stateNode.containerInfo;if(m===n)break;if(s===4)for(s=a.return;s!==null;){var b=s.tag;if((b===3||b===4)&&s.stateNode.containerInfo===n)return;s=s.return}for(;m!==null;){if(s=ia(m),s===null)return;if(b=s.tag,b===5||b===6||b===26||b===27){a=i=s;continue e}m=m.parentNode}}a=a.return}Ur(function(){var M=i,L=Yu(l),Q=[];e:{var D=ro.get(e);if(D!==void 0){var w=ri,W=e;switch(e){case"keypress":if(ci(l)===0)break e;case"keydown":case"keyup":w=rg;break;case"focusin":W="focus",w=ku;break;case"focusout":W="blur",w=ku;break;case"beforeblur":case"afterblur":w=ku;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":w=Hr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":w=Fm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":w=dg;break;case io:case uo:case co:w=eg;break;case so:w=mg;break;case"scroll":case"scrollend":w=$m;break;case"wheel":w=yg;break;case"copy":case"cut":case"paste":w=lg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":w=qr;break;case"toggle":case"beforetoggle":w=vg}var ne=(t&4)!==0,Re=!ne&&(e==="scroll"||e==="scrollend"),A=ne?D!==null?D+"Capture":null:D;ne=[];for(var T=M,R;T!==null;){var Y=T;if(R=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||R===null||A===null||(Y=Fa(T,A),Y!=null&&ne.push(_n(T,Y,R))),Re)break;T=T.return}0<ne.length&&(D=new w(D,W,null,l,L),Q.push({event:D,listeners:ne}))}}if((t&7)===0){e:{if(D=e==="mouseover"||e==="pointerover",w=e==="mouseout"||e==="pointerout",D&&l!==Hu&&(W=l.relatedTarget||l.fromElement)&&(ia(W)||W[na]))break e;if((w||D)&&(D=L.window===L?L:(D=L.ownerDocument)?D.defaultView||D.parentWindow:window,w?(W=l.relatedTarget||l.toElement,w=M,W=W?ia(W):null,W!==null&&(Re=g(W),ne=W.tag,W!==Re||ne!==5&&ne!==27&&ne!==6)&&(W=null)):(w=null,W=M),w!==W)){if(ne=Hr,Y="onMouseLeave",A="onMouseEnter",T="mouse",(e==="pointerout"||e==="pointerover")&&(ne=qr,Y="onPointerLeave",A="onPointerEnter",T="pointer"),Re=w==null?D:Wa(w),R=W==null?D:Wa(W),D=new ne(Y,T+"leave",w,l,L),D.target=Re,D.relatedTarget=R,Y=null,ia(L)===M&&(ne=new ne(A,T+"enter",W,l,L),ne.target=R,ne.relatedTarget=Re,Y=ne),Re=Y,w&&W)t:{for(ne=py,A=w,T=W,R=0,Y=A;Y;Y=ne(Y))R++;Y=0;for(var le=T;le;le=ne(le))Y++;for(;0<R-Y;)A=ne(A),R--;for(;0<Y-R;)T=ne(T),Y--;for(;R--;){if(A===T||T!==null&&A===T.alternate){ne=A;break t}A=ne(A),T=ne(T)}ne=null}else ne=null;w!==null&&Dd(Q,D,w,ne,!1),W!==null&&Re!==null&&Dd(Q,Re,W,ne,!0)}}e:{if(D=M?Wa(M):window,w=D.nodeName&&D.nodeName.toLowerCase(),w==="select"||w==="input"&&D.type==="file")var xe=Jr;else if(Zr(D))if($r)xe=Rg;else{xe=Ag;var ee=Tg}else w=D.nodeName,!w||w.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?M&&Lu(M.elementType)&&(xe=Jr):xe=zg;if(xe&&(xe=xe(e,M))){Kr(Q,xe,l,L);break e}ee&&ee(e,D,M),e==="focusout"&&M&&D.type==="number"&&M.memoizedProps.value!=null&&Bu(D,"number",D.value)}switch(ee=M?Wa(M):window,e){case"focusin":(Zr(ee)||ee.contentEditable==="true")&&(ma=ee,Fu=M,un=null);break;case"focusout":un=Fu=ma=null;break;case"mousedown":Iu=!0;break;case"contextmenu":case"mouseup":case"dragend":Iu=!1,ao(Q,l,L);break;case"selectionchange":if(Ng)break;case"keydown":case"keyup":ao(Q,l,L)}var se;if(Ku)e:{switch(e){case"compositionstart":var ge="onCompositionStart";break e;case"compositionend":ge="onCompositionEnd";break e;case"compositionupdate":ge="onCompositionUpdate";break e}ge=void 0}else ha?Xr(e,l)&&(ge="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(ge="onCompositionStart");ge&&(Gr&&l.locale!=="ko"&&(ha||ge!=="onCompositionStart"?ge==="onCompositionEnd"&&ha&&(se=Br()):(ml=L,Qu="value"in ml?ml.value:ml.textContent,ha=!0)),ee=Pi(M,ge),0<ee.length&&(ge=new Yr(ge,e,null,l,L),Q.push({event:ge,listeners:ee}),se?ge.data=se:(se=kr(l),se!==null&&(ge.data=se)))),(se=xg?bg(e,l):Eg(e,l))&&(ge=Pi(M,"onBeforeInput"),0<ge.length&&(ee=new Yr("onBeforeInput","beforeinput",null,l,L),Q.push({event:ee,listeners:ge}),ee.data=se)),hy(Q,e,M,l,L)}_d(Q,t)})}function _n(e,t,l){return{instance:e,listener:t,currentTarget:l}}function Pi(e,t){for(var l=t+"Capture",a=[];e!==null;){var n=e,i=n.stateNode;if(n=n.tag,n!==5&&n!==26&&n!==27||i===null||(n=Fa(e,l),n!=null&&a.unshift(_n(e,n,i)),n=Fa(e,t),n!=null&&a.push(_n(e,n,i))),e.tag===3)return a;e=e.return}return[]}function py(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(e,t,l,a,n){for(var i=t._reactName,s=[];l!==null&&l!==a;){var m=l,b=m.alternate,M=m.stateNode;if(m=m.tag,b!==null&&b===a)break;m!==5&&m!==26&&m!==27||M===null||(b=M,n?(M=Fa(l,i),M!=null&&s.unshift(_n(l,M,b))):n||(M=Fa(l,i),M!=null&&s.push(_n(l,M,b)))),l=l.return}s.length!==0&&e.push({event:t,listeners:s})}var vy=/\r\n?/g,Sy=/\u0000|\uFFFD/g;function wd(e){return(typeof e=="string"?e:""+e).replace(vy,`
9
9
  `).replace(Sy,"")}function Ud(e,t){return t=wd(t),wd(e)===t}function ze(e,t,l,a,n,i){switch(l){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||oa(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&oa(e,""+a);break;case"className":ai(e,"class",a);break;case"tabIndex":ai(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":ai(e,l,a);break;case"style":Dr(e,a,i);break;case"data":if(t!=="object"){ai(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=ii(""+a),e.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(l,"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 i=="function"&&(l==="formAction"?(t!=="input"&&ze(e,t,"name",n.name,n,null),ze(e,t,"formEncType",n.formEncType,n,null),ze(e,t,"formMethod",n.formMethod,n,null),ze(e,t,"formTarget",n.formTarget,n,null)):(ze(e,t,"encType",n.encType,n,null),ze(e,t,"method",n.method,n,null),ze(e,t,"target",n.target,n,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(l);break}a=ii(""+a),e.setAttribute(l,a);break;case"onClick":a!=null&&(e.onclick=kt);break;case"onScroll":a!=null&&de("scroll",e);break;case"onScrollEnd":a!=null&&de("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(r(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(r(60));e.innerHTML=l}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}l=ii(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""+a):e.removeAttribute(l);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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":a===!0?e.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(l,a):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(l,a):e.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(l):e.setAttribute(l,a);break;case"popover":de("beforetoggle",e),de("toggle",e),li(e,"popover",a);break;case"xlinkActuate":Xt(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Xt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Xt(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Xt(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Xt(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Xt(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Xt(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Xt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Xt(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":li(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Km.get(l)||l,li(e,l,a))}}function Cs(e,t,l,a,n,i){switch(l){case"style":Dr(e,a,i);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(r(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(r(60));e.innerHTML=l}}break;case"children":typeof a=="string"?oa(e,a):(typeof a=="number"||typeof a=="bigint")&&oa(e,""+a);break;case"onScroll":a!=null&&de("scroll",e);break;case"onScrollEnd":a!=null&&de("scrollend",e);break;case"onClick":a!=null&&(e.onclick=kt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!jr.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(n=l.endsWith("Capture"),t=l.slice(2,n?l.length-7:void 0),i=e[ut]||null,i=i!=null?i[l]:null,typeof i=="function"&&e.removeEventListener(t,i,n),typeof a=="function")){typeof i!="function"&&i!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,a,n);break e}l in e?e[l]=a:a===!0?e.setAttribute(l,""):li(e,l,a)}}}function et(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":de("error",e),de("load",e);var a=!1,n=!1,i;for(i in l)if(l.hasOwnProperty(i)){var s=l[i];if(s!=null)switch(i){case"src":a=!0;break;case"srcSet":n=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:ze(e,t,i,s,l,null)}}n&&ze(e,t,"srcSet",l.srcSet,l,null),a&&ze(e,t,"src",l.src,l,null);return;case"input":de("invalid",e);var m=i=s=n=null,b=null,M=null;for(a in l)if(l.hasOwnProperty(a)){var L=l[a];if(L!=null)switch(a){case"name":n=L;break;case"type":s=L;break;case"checked":b=L;break;case"defaultChecked":M=L;break;case"value":i=L;break;case"defaultValue":m=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(137,t));break;default:ze(e,t,a,L,l,null)}}Mr(e,i,m,b,M,s,n,!1);return;case"select":de("invalid",e),a=s=i=null;for(n in l)if(l.hasOwnProperty(n)&&(m=l[n],m!=null))switch(n){case"value":i=m;break;case"defaultValue":s=m;break;case"multiple":a=m;default:ze(e,t,n,m,l,null)}t=i,l=s,e.multiple=!!a,t!=null?ra(e,!!a,t,!1):l!=null&&ra(e,!!a,l,!0);return;case"textarea":de("invalid",e),i=n=a=null;for(s in l)if(l.hasOwnProperty(s)&&(m=l[s],m!=null))switch(s){case"value":a=m;break;case"defaultValue":n=m;break;case"children":i=m;break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(r(91));break;default:ze(e,t,s,m,l,null)}_r(e,a,n,i);return;case"option":for(b in l)l.hasOwnProperty(b)&&(a=l[b],a!=null)&&(b==="selected"?e.selected=a&&typeof a!="function"&&typeof a!="symbol":ze(e,t,b,a,l,null));return;case"dialog":de("beforetoggle",e),de("toggle",e),de("cancel",e),de("close",e);break;case"iframe":case"object":de("load",e);break;case"video":case"audio":for(a=0;a<Nn.length;a++)de(Nn[a],e);break;case"image":de("error",e),de("load",e);break;case"details":de("toggle",e);break;case"embed":case"source":case"link":de("error",e),de("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(M in l)if(l.hasOwnProperty(M)&&(a=l[M],a!=null))switch(M){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:ze(e,t,M,a,l,null)}return;default:if(Lu(t)){for(L in l)l.hasOwnProperty(L)&&(a=l[L],a!==void 0&&Cs(e,t,L,a,l,void 0));return}}for(m in l)l.hasOwnProperty(m)&&(a=l[m],a!=null&&ze(e,t,m,a,l,null))}function xy(e,t,l,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var n=null,i=null,s=null,m=null,b=null,M=null,L=null;for(w in l){var Q=l[w];if(l.hasOwnProperty(w)&&Q!=null)switch(w){case"checked":break;case"value":break;case"defaultValue":b=Q;default:a.hasOwnProperty(w)||ze(e,t,w,null,a,Q)}}for(var D in a){var w=a[D];if(Q=l[D],a.hasOwnProperty(D)&&(w!=null||Q!=null))switch(D){case"type":i=w;break;case"name":n=w;break;case"checked":M=w;break;case"defaultChecked":L=w;break;case"value":s=w;break;case"defaultValue":m=w;break;case"children":case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(137,t));break;default:w!==Q&&ze(e,t,D,w,a,Q)}}Uu(e,s,m,b,M,L,i,n);return;case"select":w=s=m=D=null;for(i in l)if(b=l[i],l.hasOwnProperty(i)&&b!=null)switch(i){case"value":break;case"multiple":w=b;default:a.hasOwnProperty(i)||ze(e,t,i,null,a,b)}for(n in a)if(i=a[n],b=l[n],a.hasOwnProperty(n)&&(i!=null||b!=null))switch(n){case"value":D=i;break;case"defaultValue":m=i;break;case"multiple":s=i;default:i!==b&&ze(e,t,n,i,a,b)}t=m,l=s,a=w,D!=null?ra(e,!!l,D,!1):!!a!=!!l&&(t!=null?ra(e,!!l,t,!0):ra(e,!!l,l?[]:"",!1));return;case"textarea":w=D=null;for(m in l)if(n=l[m],l.hasOwnProperty(m)&&n!=null&&!a.hasOwnProperty(m))switch(m){case"value":break;case"children":break;default:ze(e,t,m,null,a,n)}for(s in a)if(n=a[s],i=l[s],a.hasOwnProperty(s)&&(n!=null||i!=null))switch(s){case"value":D=n;break;case"defaultValue":w=n;break;case"children":break;case"dangerouslySetInnerHTML":if(n!=null)throw Error(r(91));break;default:n!==i&&ze(e,t,s,n,a,i)}Nr(e,D,w);return;case"option":for(var W in l)D=l[W],l.hasOwnProperty(W)&&D!=null&&!a.hasOwnProperty(W)&&(W==="selected"?e.selected=!1:ze(e,t,W,null,a,D));for(b in a)D=a[b],w=l[b],a.hasOwnProperty(b)&&D!==w&&(D!=null||w!=null)&&(b==="selected"?e.selected=D&&typeof D!="function"&&typeof D!="symbol":ze(e,t,b,D,a,w));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 ne in l)D=l[ne],l.hasOwnProperty(ne)&&D!=null&&!a.hasOwnProperty(ne)&&ze(e,t,ne,null,a,D);for(M in a)if(D=a[M],w=l[M],a.hasOwnProperty(M)&&D!==w&&(D!=null||w!=null))switch(M){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(r(137,t));break;default:ze(e,t,M,D,a,w)}return;default:if(Lu(t)){for(var Re in l)D=l[Re],l.hasOwnProperty(Re)&&D!==void 0&&!a.hasOwnProperty(Re)&&Cs(e,t,Re,void 0,a,D);for(L in a)D=a[L],w=l[L],!a.hasOwnProperty(L)||D===w||D===void 0&&w===void 0||Cs(e,t,L,D,a,w);return}}for(var A in l)D=l[A],l.hasOwnProperty(A)&&D!=null&&!a.hasOwnProperty(A)&&ze(e,t,A,null,a,D);for(Q in a)D=a[Q],w=l[Q],!a.hasOwnProperty(Q)||D===w||D==null&&w==null||ze(e,t,Q,D,a,w)}function Bd(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function by(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),a=0;a<l.length;a++){var n=l[a],i=n.transferSize,s=n.initiatorType,m=n.duration;if(i&&m&&Bd(s)){for(s=0,m=n.responseEnd,a+=1;a<l.length;a++){var b=l[a],M=b.startTime;if(M>m)break;var L=b.transferSize,Q=b.initiatorType;L&&Bd(Q)&&(b=b.responseEnd,s+=L*(b<m?1:(m-M)/(b-M)))}if(--a,t+=8*(i+s)/(n.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var js=null,Ts=null;function eu(e){return e.nodeType===9?e:e.ownerDocument}function Ld(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function As(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var zs=null;function Ey(){var e=window.event;return e&&e.type==="popstate"?e===zs?!1:(zs=e,!0):(zs=null,!1)}var Yd=typeof setTimeout=="function"?setTimeout:void 0,Cy=typeof clearTimeout=="function"?clearTimeout:void 0,qd=typeof Promise=="function"?Promise:void 0,jy=typeof queueMicrotask=="function"?queueMicrotask:typeof qd<"u"?function(e){return qd.resolve(null).then(e).catch(Ty)}:Yd;function Ty(e){setTimeout(function(){throw e})}function _l(e){return e==="head"}function Gd(e,t){var l=t,a=0;do{var n=l.nextSibling;if(e.removeChild(l),n&&n.nodeType===8)if(l=n.data,l==="/$"||l==="/&"){if(a===0){e.removeChild(n),Ga(t);return}a--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")a++;else if(l==="html")On(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,On(l);for(var i=l.firstChild;i;){var s=i.nextSibling,m=i.nodeName;i[$a]||m==="SCRIPT"||m==="STYLE"||m==="LINK"&&i.rel.toLowerCase()==="stylesheet"||l.removeChild(i),i=s}}else l==="body"&&On(e.ownerDocument.body);l=n}while(l);Ga(t)}function Qd(e,t){var l=e;e=0;do{var a=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),a&&a.nodeType===8)if(l=a.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=a}while(l)}function Rs(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Rs(l),Du(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Ay(e,t,l,a){for(;e.nodeType===1;){var n=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[$a])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==n.rel||e.getAttribute("href")!==(n.href==null||n.href===""?null:n.href)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin)||e.getAttribute("title")!==(n.title==null?null:n.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(n.src==null?null:n.src)||e.getAttribute("type")!==(n.type==null?null:n.type)||e.getAttribute("crossorigin")!==(n.crossOrigin==null?null:n.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=n.name==null?null:""+n.name;if(n.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=_t(e.nextSibling),e===null)break}return null}function zy(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=_t(e.nextSibling),e===null))return null;return e}function Vd(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=_t(e.nextSibling),e===null))return null;return e}function Ms(e){return e.data==="$?"||e.data==="$~"}function Ns(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ry(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var a=function(){t(),l.removeEventListener("DOMContentLoaded",a)};l.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function _t(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var _s=null;function Xd(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return _t(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function kd(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function Zd(e,t,l){switch(t=eu(l),e){case"html":if(e=t.documentElement,!e)throw Error(r(452));return e;case"head":if(e=t.head,!e)throw Error(r(453));return e;case"body":if(e=t.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function On(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Du(e)}var Ot=new Map,Kd=new Set;function tu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var cl=Z.d;Z.d={f:My,r:Ny,D:_y,C:Oy,L:Dy,m:wy,X:By,S:Uy,M:Ly};function My(){var e=cl.f(),t=Zi();return e||t}function Ny(e){var t=ua(e);t!==null&&t.tag===5&&t.type==="form"?of(t):cl.r(e)}var Ha=typeof document>"u"?null:document;function Jd(e,t,l){var a=Ha;if(a&&typeof t=="string"&&t){var n=jt(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),Kd.has(n)||(Kd.add(n),e={rel:e,crossOrigin:l,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),et(t,"link",e),Je(t),a.head.appendChild(t)))}}function _y(e){cl.D(e),Jd("dns-prefetch",e,null)}function Oy(e,t){cl.C(e,t),Jd("preconnect",e,t)}function Dy(e,t,l){cl.L(e,t,l);var a=Ha;if(a&&e&&t){var n='link[rel="preload"][as="'+jt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+jt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+jt(l.imageSizes)+'"]')):n+='[href="'+jt(e)+'"]';var i=n;switch(t){case"style":i=Ya(e);break;case"script":i=qa(e)}Ot.has(i)||(e=p({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Ot.set(i,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(Dn(i))||t==="script"&&a.querySelector(wn(i))||(t=a.createElement("link"),et(t,"link",e),Je(t),a.head.appendChild(t)))}}function wy(e,t){cl.m(e,t);var l=Ha;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+jt(a)+'"][href="'+jt(e)+'"]',i=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=qa(e)}if(!Ot.has(i)&&(e=p({rel:"modulepreload",href:e},t),Ot.set(i,e),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(wn(i)))return}a=l.createElement("link"),et(a,"link",e),Je(a),l.head.appendChild(a)}}}function Uy(e,t,l){cl.S(e,t,l);var a=Ha;if(a&&e){var n=ca(a).hoistableStyles,i=Ya(e);t=t||"default";var s=n.get(i);if(!s){var m={loading:0,preload:null};if(s=a.querySelector(Dn(i)))m.loading=5;else{e=p({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Ot.get(i))&&Os(e,l);var b=s=a.createElement("link");Je(b),et(b,"link",e),b._p=new Promise(function(M,L){b.onload=M,b.onerror=L}),b.addEventListener("load",function(){m.loading|=1}),b.addEventListener("error",function(){m.loading|=2}),m.loading|=4,lu(s,t,a)}s={type:"stylesheet",instance:s,count:1,state:m},n.set(i,s)}}}function By(e,t){cl.X(e,t);var l=Ha;if(l&&e){var a=ca(l).hoistableScripts,n=qa(e),i=a.get(n);i||(i=l.querySelector(wn(n)),i||(e=p({src:e,async:!0},t),(t=Ot.get(n))&&Ds(e,t),i=l.createElement("script"),Je(i),et(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(n,i))}}function Ly(e,t){cl.M(e,t);var l=Ha;if(l&&e){var a=ca(l).hoistableScripts,n=qa(e),i=a.get(n);i||(i=l.querySelector(wn(n)),i||(e=p({src:e,async:!0,type:"module"},t),(t=Ot.get(n))&&Ds(e,t),i=l.createElement("script"),Je(i),et(i,"link",e),l.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(n,i))}}function $d(e,t,l,a){var n=(n=oe.current)?tu(n):null;if(!n)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Ya(l.href),l=ca(n).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Ya(l.href);var i=ca(n).hoistableStyles,s=i.get(e);if(s||(n=n.ownerDocument||n,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,s),(i=n.querySelector(Dn(e)))&&!i._p&&(s.instance=i,s.state.loading=5),Ot.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Ot.set(e,l),i||Hy(n,e,l,s.state))),t&&a===null)throw Error(r(528,""));return s}if(t&&a!==null)throw Error(r(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=qa(l),l=ca(n).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Ya(e){return'href="'+jt(e)+'"'}function Dn(e){return'link[rel="stylesheet"]['+e+"]"}function Wd(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Hy(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),et(t,"link",l),Je(t),e.head.appendChild(t))}function qa(e){return'[src="'+jt(e)+'"]'}function wn(e){return"script[async]"+e}function Fd(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+jt(l.href)+'"]');if(a)return t.instance=a,Je(a),a;var n=p({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Je(a),et(a,"style",n),lu(a,l.precedence,e),t.instance=a;case"stylesheet":n=Ya(l.href);var i=e.querySelector(Dn(n));if(i)return t.state.loading|=4,t.instance=i,Je(i),i;a=Wd(l),(n=Ot.get(n))&&Os(a,n),i=(e.ownerDocument||e).createElement("link"),Je(i);var s=i;return s._p=new Promise(function(m,b){s.onload=m,s.onerror=b}),et(i,"link",a),t.state.loading|=4,lu(i,l.precedence,e),t.instance=i;case"script":return i=qa(l.src),(n=e.querySelector(wn(i)))?(t.instance=n,Je(n),n):(a=l,(n=Ot.get(i))&&(a=p({},l),Ds(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),Je(n),et(n,"link",a),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,lu(a,l.precedence,e));return t.instance}function lu(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,i=n,s=0;s<a.length;s++){var m=a[s];if(m.dataset.precedence===t)i=m;else if(i!==n)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function Os(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ds(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var au=null;function Id(e,t,l){if(au===null){var a=new Map,n=au=new Map;n.set(l,a)}else n=au,a=n.get(l),a||(a=new Map,n.set(l,a));if(a.has(e))return a;for(a.set(e,null),l=l.getElementsByTagName(e),n=0;n<l.length;n++){var i=l[n];if(!(i[$a]||i[We]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var s=i.getAttribute(t)||"";s=e+s;var m=a.get(s);m?m.push(i):a.set(s,[i])}}return a}function Pd(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Yy(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function eh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function qy(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=Ya(a.href),i=t.querySelector(Dn(n));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=nu.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=i,Je(i);return}i=t.ownerDocument||t,a=Wd(a),(n=Ot.get(n))&&Os(a,n),i=i.createElement("link"),Je(i);var s=i;s._p=new Promise(function(m,b){s.onload=m,s.onerror=b}),et(i,"link",a),l.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=nu.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var ws=0;function Gy(e,t){return e.stylesheets&&e.count===0&&uu(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var a=setTimeout(function(){if(e.stylesheets&&uu(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&ws===0&&(ws=62500*by());var n=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&uu(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>ws?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function nu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)uu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var iu=null;function uu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,iu=new Map,t.forEach(Qy,e),iu=null,nu.call(e))}function Qy(e,t){if(!(t.state.loading&4)){var l=iu.get(e);if(l)var a=l.get(null);else{l=new Map,iu.set(e,l);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<n.length;i++){var s=n[i];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(l.set(s.dataset.precedence,s),a=s)}a&&l.set(null,a)}n=t.instance,s=n.getAttribute("data-precedence"),i=l.get(s)||a,i===a&&l.set(null,n),l.set(s,n),this.count++,a=nu.bind(this),n.addEventListener("load",a),n.addEventListener("error",a),i?i.parentNode.insertBefore(n,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(n,e.firstChild)),t.state.loading|=4}}var Un={$$typeof:G,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function Vy(e,t,l,a,n,i,s,m,b){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Mu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mu(0),this.hiddenUpdates=Mu(null),this.identifierPrefix=a,this.onUncaughtError=n,this.onCaughtError=i,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=b,this.incompleteTransitions=new Map}function th(e,t,l,a,n,i,s,m,b,M,L,Q){return e=new Vy(e,t,l,s,b,M,L,Q,m),t=1,i===!0&&(t|=24),i=pt(3,null,null,t),e.current=i,i.stateNode=e,t=hc(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:a,isDehydrated:l,cache:t},pc(i),e}function lh(e){return e?(e=pa,e):pa}function ah(e,t,l,a,n,i){n=lh(n),a.context===null?a.context=n:a.pendingContext=n,a=xl(t),a.payload={element:l},i=i===void 0?null:i,i!==null&&(a.callback=i),l=bl(e,a,t),l!==null&&(dt(l,e,t),hn(l,e,t))}function nh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function Us(e,t){nh(e,t),(e=e.alternate)&&nh(e,t)}function ih(e){if(e.tag===13||e.tag===31){var t=Xl(e,67108864);t!==null&&dt(t,e,67108864),Us(e,67108864)}}function uh(e){if(e.tag===13||e.tag===31){var t=Et();t=Nu(t);var l=Xl(e,t);l!==null&&dt(l,e,t),Us(e,t)}}var cu=!0;function Xy(e,t,l,a){var n=U.T;U.T=null;var i=Z.p;try{Z.p=2,Bs(e,t,l,a)}finally{Z.p=i,U.T=n}}function ky(e,t,l,a){var n=U.T;U.T=null;var i=Z.p;try{Z.p=8,Bs(e,t,l,a)}finally{Z.p=i,U.T=n}}function Bs(e,t,l,a){if(cu){var n=Ls(a);if(n===null)Es(e,t,a,su,l),sh(e,a);else if(Ky(n,e,t,l,a))a.stopPropagation();else if(sh(e,a),t&4&&-1<Zy.indexOf(e)){for(;n!==null;){var i=ua(n);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var s=Yl(i.pendingLanes);if(s!==0){var m=i;for(m.pendingLanes|=2,m.entangledLanes|=2;s;){var b=1<<31-gt(s);m.entanglements[1]|=b,s&=~b}Qt(i),(Ee&6)===0&&(Xi=ht()+500,Mn(0))}}break;case 31:case 13:m=Xl(i,2),m!==null&&dt(m,i,2),Zi(),Us(i,2)}if(i=Ls(a),i===null&&Es(e,t,a,su,l),i===n)break;n=i}n!==null&&a.stopPropagation()}else Es(e,t,a,null,l)}}function Ls(e){return e=Yu(e),Hs(e)}var su=null;function Hs(e){if(su=null,e=ia(e),e!==null){var t=g(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=x(t),e!==null)return e;e=null}else if(l===31){if(e=C(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return su=e,null}function ch(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"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(_m()){case hr:return 2;case mr:return 8;case Fn:case Om:return 32;case gr:return 268435456;default:return 32}default:return 32}}var Ys=!1,Ol=null,Dl=null,wl=null,Bn=new Map,Ln=new Map,Ul=[],Zy="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 sh(e,t){switch(e){case"focusin":case"focusout":Ol=null;break;case"dragenter":case"dragleave":Dl=null;break;case"mouseover":case"mouseout":wl=null;break;case"pointerover":case"pointerout":Bn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ln.delete(t.pointerId)}}function Hn(e,t,l,a,n,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:l,eventSystemFlags:a,nativeEvent:i,targetContainers:[n]},t!==null&&(t=ua(t),t!==null&&ih(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function Ky(e,t,l,a,n){switch(t){case"focusin":return Ol=Hn(Ol,e,t,l,a,n),!0;case"dragenter":return Dl=Hn(Dl,e,t,l,a,n),!0;case"mouseover":return wl=Hn(wl,e,t,l,a,n),!0;case"pointerover":var i=n.pointerId;return Bn.set(i,Hn(Bn.get(i)||null,e,t,l,a,n)),!0;case"gotpointercapture":return i=n.pointerId,Ln.set(i,Hn(Ln.get(i)||null,e,t,l,a,n)),!0}return!1}function rh(e){var t=ia(e.target);if(t!==null){var l=g(t);if(l!==null){if(t=l.tag,t===13){if(t=x(l),t!==null){e.blockedOn=t,br(e.priority,function(){uh(l)});return}}else if(t===31){if(t=C(l),t!==null){e.blockedOn=t,br(e.priority,function(){uh(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ru(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=Ls(e.nativeEvent);if(l===null){l=e.nativeEvent;var a=new l.constructor(l.type,l);Hu=a,l.target.dispatchEvent(a),Hu=null}else return t=ua(l),t!==null&&ih(t),e.blockedOn=l,!1;t.shift()}return!0}function oh(e,t,l){ru(e)&&l.delete(t)}function Jy(){Ys=!1,Ol!==null&&ru(Ol)&&(Ol=null),Dl!==null&&ru(Dl)&&(Dl=null),wl!==null&&ru(wl)&&(wl=null),Bn.forEach(oh),Ln.forEach(oh)}function ou(e,t){e.blockedOn===t&&(e.blockedOn=null,Ys||(Ys=!0,u.unstable_scheduleCallback(u.unstable_NormalPriority,Jy)))}var fu=null;function fh(e){fu!==e&&(fu=e,u.unstable_scheduleCallback(u.unstable_NormalPriority,function(){fu===e&&(fu=null);for(var t=0;t<e.length;t+=3){var l=e[t],a=e[t+1],n=e[t+2];if(typeof a!="function"){if(Hs(a||l)===null)continue;break}var i=ua(l);i!==null&&(e.splice(t,3),t-=3,Lc(i,{pending:!0,data:n,method:l.method,action:a},a,n))}}))}function Ga(e){function t(b){return ou(b,e)}Ol!==null&&ou(Ol,e),Dl!==null&&ou(Dl,e),wl!==null&&ou(wl,e),Bn.forEach(t),Ln.forEach(t);for(var l=0;l<Ul.length;l++){var a=Ul[l];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Ul.length&&(l=Ul[0],l.blockedOn===null);)rh(l),l.blockedOn===null&&Ul.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(a=0;a<l.length;a+=3){var n=l[a],i=l[a+1],s=n[ut]||null;if(typeof i=="function")s||fh(l);else if(s){var m=null;if(i&&i.hasAttribute("formAction")){if(n=i,s=i[ut]||null)m=s.formAction;else if(Hs(n)!==null)continue}else m=s.action;typeof m=="function"?l[a+1]=m:(l.splice(a,3),a-=3),fh(l)}}}function dh(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(s){return n=s})},focusReset:"manual",scroll:"manual"})}function t(){n!==null&&(n(),n=null),a||setTimeout(l,20)}function l(){if(!a&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,n=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),n!==null&&(n(),n=null)}}}function qs(e){this._internalRoot=e}du.prototype.render=qs.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var l=t.current,a=Et();ah(l,a,e,t,null,null)},du.prototype.unmount=qs.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ah(e.current,2,null,e,null,null),Zi(),t[na]=null}};function du(e){this._internalRoot=e}du.prototype.unstable_scheduleHydration=function(e){if(e){var t=xr();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Ul.length&&t!==0&&t<Ul[l].priority;l++);Ul.splice(l,0,e),l===0&&rh(e)}};var hh=o.version;if(hh!=="19.2.4")throw Error(r(527,hh,"19.2.4"));Z.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=d(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var $y={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hu.isDisabled&&hu.supportsFiber)try{Za=hu.inject($y),mt=hu}catch{}}return qn.createRoot=function(e,t){if(!y(e))throw Error(r(299));var l=!1,a="",n=xf,i=bf,s=Ef;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(n=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=th(e,1,!1,null,null,l,a,null,n,i,s,dh),e[na]=t.current,bs(e),new qs(t)},qn.hydrateRoot=function(e,t,l){if(!y(e))throw Error(r(299));var a=!1,n="",i=xf,s=bf,m=Ef,b=null;return l!=null&&(l.unstable_strictMode===!0&&(a=!0),l.identifierPrefix!==void 0&&(n=l.identifierPrefix),l.onUncaughtError!==void 0&&(i=l.onUncaughtError),l.onCaughtError!==void 0&&(s=l.onCaughtError),l.onRecoverableError!==void 0&&(m=l.onRecoverableError),l.formState!==void 0&&(b=l.formState)),t=th(e,1,!0,t,l??null,a,n,b,i,s,m,dh),t.context=lh(null),l=t.current,a=Et(),a=Nu(a),n=xl(a),n.callback=null,bl(l,n,a),l=a,t.current.lanes=l,Ja(t,l),Qt(t),e[na]=t.current,bs(e),new du(t)},qn.version="19.2.4",qn}var Ch;function up(){if(Ch)return Vs.exports;Ch=1;function u(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(u)}catch(o){console.error(o)}}return u(),Vs.exports=ip(),Vs.exports}var cp=up();var jh="popstate";function sp(u={}){function o(r,y){let{pathname:g,search:x,hash:C}=r.location;return er("",{pathname:g,search:x,hash:C},y.state&&y.state.usr||null,y.state&&y.state.key||"default")}function f(r,y){return typeof y=="string"?y:Zn(y)}return op(o,f,null,u)}function we(u,o){if(u===!1||u===null||typeof u>"u")throw new Error(o)}function Lt(u,o){if(!u){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function rp(){return Math.random().toString(36).substring(2,10)}function Th(u,o){return{usr:u.state,key:u.key,idx:o}}function er(u,o,f=null,r){return{pathname:typeof u=="string"?u:u.pathname,search:"",hash:"",...typeof o=="string"?Va(o):o,state:f,key:o&&o.key||r||rp()}}function Zn({pathname:u="/",search:o="",hash:f=""}){return o&&o!=="?"&&(u+=o.charAt(0)==="?"?o:"?"+o),f&&f!=="#"&&(u+=f.charAt(0)==="#"?f:"#"+f),u}function Va(u){let o={};if(u){let f=u.indexOf("#");f>=0&&(o.hash=u.substring(f),u=u.substring(0,f));let r=u.indexOf("?");r>=0&&(o.search=u.substring(r),u=u.substring(0,r)),u&&(o.pathname=u)}return o}function op(u,o,f,r={}){let{window:y=document.defaultView,v5Compat:g=!1}=r,x=y.history,C="POP",h=null,d=v();d==null&&(d=0,x.replaceState({...x.state,idx:d},""));function v(){return(x.state||{idx:null}).idx}function p(){C="POP";let O=v(),B=O==null?null:O-d;d=O,h&&h({action:C,location:_.location,delta:B})}function E(O,B){C="PUSH";let H=er(_.location,O,B);d=v()+1;let G=Th(H,d),I=_.createHref(H);try{x.pushState(G,"",I)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;y.location.assign(I)}g&&h&&h({action:C,location:_.location,delta:1})}function z(O,B){C="REPLACE";let H=er(_.location,O,B);d=v();let G=Th(H,d),I=_.createHref(H);x.replaceState(G,"",I),g&&h&&h({action:C,location:_.location,delta:0})}function N(O){return fp(O)}let _={get action(){return C},get location(){return u(y,x)},listen(O){if(h)throw new Error("A history only accepts one active listener");return y.addEventListener(jh,p),h=O,()=>{y.removeEventListener(jh,p),h=null}},createHref(O){return o(y,O)},createURL:N,encodeLocation(O){let B=N(O);return{pathname:B.pathname,search:B.search,hash:B.hash}},push:E,replace:z,go(O){return x.go(O)}};return _}function fp(u,o=!1){let f="http://localhost";typeof window<"u"&&(f=window.location.origin!=="null"?window.location.origin:window.location.href),we(f,"No window.location.(origin|href) available to create URL");let r=typeof u=="string"?u:Zn(u);return r=r.replace(/ $/,"%20"),!o&&r.startsWith("//")&&(r=f+r),new URL(r,f)}function Hh(u,o,f="/"){return dp(u,o,f,!1)}function dp(u,o,f,r){let y=typeof o=="string"?Va(o):o,g=ol(y.pathname||"/",f);if(g==null)return null;let x=Yh(u);hp(x);let C=null;for(let h=0;C==null&&h<x.length;++h){let d=jp(g);C=Ep(x[h],d,r)}return C}function Yh(u,o=[],f=[],r="",y=!1){let g=(x,C,h=y,d)=>{let v={relativePath:d===void 0?x.path||"":d,caseSensitive:x.caseSensitive===!0,childrenIndex:C,route:x};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(r)&&h)return;we(v.relativePath.startsWith(r),`Absolute route path "${v.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(r.length)}let p=rl([r,v.relativePath]),E=f.concat(v);x.children&&x.children.length>0&&(we(x.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),Yh(x.children,o,E,p,h)),!(x.path==null&&!x.index)&&o.push({path:p,score:xp(p,x.index),routesMeta:E})};return u.forEach((x,C)=>{if(x.path===""||!x.path?.includes("?"))g(x,C);else for(let h of qh(x.path))g(x,C,!0,h)}),o}function qh(u){let o=u.split("/");if(o.length===0)return[];let[f,...r]=o,y=f.endsWith("?"),g=f.replace(/\?$/,"");if(r.length===0)return y?[g,""]:[g];let x=qh(r.join("/")),C=[];return C.push(...x.map(h=>h===""?g:[g,h].join("/"))),y&&C.push(...x),C.map(h=>u.startsWith("/")&&h===""?"/":h)}function hp(u){u.sort((o,f)=>o.score!==f.score?f.score-o.score:bp(o.routesMeta.map(r=>r.childrenIndex),f.routesMeta.map(r=>r.childrenIndex)))}var mp=/^:[\w-]+$/,gp=3,yp=2,pp=1,vp=10,Sp=-2,Ah=u=>u==="*";function xp(u,o){let f=u.split("/"),r=f.length;return f.some(Ah)&&(r+=Sp),o&&(r+=yp),f.filter(y=>!Ah(y)).reduce((y,g)=>y+(mp.test(g)?gp:g===""?pp:vp),r)}function bp(u,o){return u.length===o.length&&u.slice(0,-1).every((r,y)=>r===o[y])?u[u.length-1]-o[o.length-1]:0}function Ep(u,o,f=!1){let{routesMeta:r}=u,y={},g="/",x=[];for(let C=0;C<r.length;++C){let h=r[C],d=C===r.length-1,v=g==="/"?o:o.slice(g.length)||"/",p=vu({path:h.relativePath,caseSensitive:h.caseSensitive,end:d},v),E=h.route;if(!p&&d&&f&&!r[r.length-1].route.index&&(p=vu({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},v)),!p)return null;Object.assign(y,p.params),x.push({params:y,pathname:rl([g,p.pathname]),pathnameBase:Rp(rl([g,p.pathnameBase])),route:E}),p.pathnameBase!=="/"&&(g=rl([g,p.pathnameBase]))}return x}function vu(u,o){typeof u=="string"&&(u={path:u,caseSensitive:!1,end:!0});let[f,r]=Cp(u.path,u.caseSensitive,u.end),y=o.match(f);if(!y)return null;let g=y[0],x=g.replace(/(.)\/+$/,"$1"),C=y.slice(1);return{params:r.reduce((d,{paramName:v,isOptional:p},E)=>{if(v==="*"){let N=C[E]||"";x=g.slice(0,g.length-N.length).replace(/(.)\/+$/,"$1")}const z=C[E];return p&&!z?d[v]=void 0:d[v]=(z||"").replace(/%2F/g,"/"),d},{}),pathname:g,pathnameBase:x,pattern:u}}function Cp(u,o=!1,f=!0){Lt(u==="*"||!u.endsWith("*")||u.endsWith("/*"),`Route path "${u}" will be treated as if it were "${u.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${u.replace(/\*$/,"/*")}".`);let r=[],y="^"+u.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(x,C,h)=>(r.push({paramName:C,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return u.endsWith("*")?(r.push({paramName:"*"}),y+=u==="*"||u==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):f?y+="\\/*$":u!==""&&u!=="/"&&(y+="(?:(?=\\/|$))"),[new RegExp(y,o?void 0:"i"),r]}function jp(u){try{return u.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return Lt(!1,`The URL path "${u}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${o}).`),u}}function ol(u,o){if(o==="/")return u;if(!u.toLowerCase().startsWith(o.toLowerCase()))return null;let f=o.endsWith("/")?o.length-1:o.length,r=u.charAt(f);return r&&r!=="/"?null:u.slice(f)||"/"}var Tp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Ap(u,o="/"){let{pathname:f,search:r="",hash:y=""}=typeof u=="string"?Va(u):u,g;return f?(f=f.replace(/\/\/+/g,"/"),f.startsWith("/")?g=zh(f.substring(1),"/"):g=zh(f,o)):g=o,{pathname:g,search:Mp(r),hash:Np(y)}}function zh(u,o){let f=o.replace(/\/+$/,"").split("/");return u.split("/").forEach(y=>{y===".."?f.length>1&&f.pop():y!=="."&&f.push(y)}),f.length>1?f.join("/"):"/"}function Ks(u,o,f,r){return`Cannot include a '${u}' character in a manually specified \`to.${o}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${f}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function zp(u){return u.filter((o,f)=>f===0||o.route.path&&o.route.path.length>0)}function Gh(u){let o=zp(u);return o.map((f,r)=>r===o.length-1?f.pathname:f.pathnameBase)}function Qh(u,o,f,r=!1){let y;typeof u=="string"?y=Va(u):(y={...u},we(!y.pathname||!y.pathname.includes("?"),Ks("?","pathname","search",y)),we(!y.pathname||!y.pathname.includes("#"),Ks("#","pathname","hash",y)),we(!y.search||!y.search.includes("#"),Ks("#","search","hash",y)));let g=u===""||y.pathname==="",x=g?"/":y.pathname,C;if(x==null)C=f;else{let p=o.length-1;if(!r&&x.startsWith("..")){let E=x.split("/");for(;E[0]==="..";)E.shift(),p-=1;y.pathname=E.join("/")}C=p>=0?o[p]:"/"}let h=Ap(y,C),d=x&&x!=="/"&&x.endsWith("/"),v=(g||x===".")&&f.endsWith("/");return!h.pathname.endsWith("/")&&(d||v)&&(h.pathname+="/"),h}var rl=u=>u.join("/").replace(/\/\/+/g,"/"),Rp=u=>u.replace(/\/+$/,"").replace(/^\/*/,"/"),Mp=u=>!u||u==="?"?"":u.startsWith("?")?u:"?"+u,Np=u=>!u||u==="#"?"":u.startsWith("#")?u:"#"+u,_p=class{constructor(u,o,f,r=!1){this.status=u,this.statusText=o||"",this.internal=r,f instanceof Error?(this.data=f.toString(),this.error=f):this.data=f}};function Op(u){return u!=null&&typeof u.status=="number"&&typeof u.statusText=="string"&&typeof u.internal=="boolean"&&"data"in u}function Dp(u){return u.map(o=>o.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Vh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Xh(u,o){let f=u;if(typeof f!="string"||!Tp.test(f))return{absoluteURL:void 0,isExternal:!1,to:f};let r=f,y=!1;if(Vh)try{let g=new URL(window.location.href),x=f.startsWith("//")?new URL(g.protocol+f):new URL(f),C=ol(x.pathname,o);x.origin===g.origin&&C!=null?f=C+x.search+x.hash:y=!0}catch{Lt(!1,`<Link to="${f}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:y,to:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var kh=["POST","PUT","PATCH","DELETE"];new Set(kh);var wp=["GET",...kh];new Set(wp);var Xa=S.createContext(null);Xa.displayName="DataRouter";var xu=S.createContext(null);xu.displayName="DataRouterState";var Up=S.createContext(!1),Zh=S.createContext({isTransitioning:!1});Zh.displayName="ViewTransition";var Bp=S.createContext(new Map);Bp.displayName="Fetchers";var Lp=S.createContext(null);Lp.displayName="Await";var Dt=S.createContext(null);Dt.displayName="Navigation";var Kn=S.createContext(null);Kn.displayName="Location";var Ht=S.createContext({outlet:null,matches:[],isDataRoute:!1});Ht.displayName="Route";var ur=S.createContext(null);ur.displayName="RouteError";var Kh="REACT_ROUTER_ERROR",Hp="REDIRECT",Yp="ROUTE_ERROR_RESPONSE";function qp(u){if(u.startsWith(`${Kh}:${Hp}:{`))try{let o=JSON.parse(u.slice(28));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.location=="string"&&typeof o.reloadDocument=="boolean"&&typeof o.replace=="boolean")return o}catch{}}function Gp(u){if(u.startsWith(`${Kh}:${Yp}:{`))try{let o=JSON.parse(u.slice(40));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string")return new _p(o.status,o.statusText,o.data)}catch{}}function Qp(u,{relative:o}={}){we(Jn(),"useHref() may be used only in the context of a <Router> component.");let{basename:f,navigator:r}=S.useContext(Dt),{hash:y,pathname:g,search:x}=$n(u,{relative:o}),C=g;return f!=="/"&&(C=g==="/"?f:rl([f,g])),r.createHref({pathname:C,search:x,hash:y})}function Jn(){return S.useContext(Kn)!=null}function fl(){return we(Jn(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(Kn).location}var Jh="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function $h(u){S.useContext(Dt).static||S.useLayoutEffect(u)}function bu(){let{isDataRoute:u}=S.useContext(Ht);return u?lv():Vp()}function Vp(){we(Jn(),"useNavigate() may be used only in the context of a <Router> component.");let u=S.useContext(Xa),{basename:o,navigator:f}=S.useContext(Dt),{matches:r}=S.useContext(Ht),{pathname:y}=fl(),g=JSON.stringify(Gh(r)),x=S.useRef(!1);return $h(()=>{x.current=!0}),S.useCallback((h,d={})=>{if(Lt(x.current,Jh),!x.current)return;if(typeof h=="number"){f.go(h);return}let v=Qh(h,JSON.parse(g),y,d.relative==="path");u==null&&o!=="/"&&(v.pathname=v.pathname==="/"?o:rl([o,v.pathname])),(d.replace?f.replace:f.push)(v,d.state,d)},[o,f,g,y,u])}var Wh=S.createContext(null);function Fh(){return S.useContext(Wh)}function Xp(u){let o=S.useContext(Ht).outlet;return S.useMemo(()=>o&&S.createElement(Wh.Provider,{value:u},o),[o,u])}function Ih(){let{matches:u}=S.useContext(Ht),o=u[u.length-1];return o?o.params:{}}function $n(u,{relative:o}={}){let{matches:f}=S.useContext(Ht),{pathname:r}=fl(),y=JSON.stringify(Gh(f));return S.useMemo(()=>Qh(u,JSON.parse(y),r,o==="path"),[u,y,r,o])}function kp(u,o){return Ph(u,o)}function Ph(u,o,f,r,y){we(Jn(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:g}=S.useContext(Dt),{matches:x}=S.useContext(Ht),C=x[x.length-1],h=C?C.params:{},d=C?C.pathname:"/",v=C?C.pathnameBase:"/",p=C&&C.route;{let H=p&&p.path||"";tm(d,!p||H.endsWith("*")||H.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${H}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
10
10
 
11
- Please change the parent <Route path="${H}"> to <Route path="${H==="/"?"*":`${H}/*`}">.`)}let E=fl(),z;if(o){let H=typeof o=="string"?Va(o):o;we(v==="/"||H.pathname?.startsWith(v),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${v}" but pathname "${H.pathname}" was given in the \`location\` prop.`),z=H}else z=E;let N=z.pathname||"/",_=N;if(v!=="/"){let H=v.replace(/^\//,"").split("/");_="/"+N.replace(/^\//,"").split("/").slice(H.length).join("/")}let O=Hh(u,{pathname:_});Lt(p||O!=null,`No routes matched location "${z.pathname}${z.search}${z.hash}" `),Lt(O==null||O[O.length-1].route.element!==void 0||O[O.length-1].route.Component!==void 0||O[O.length-1].route.lazy!==void 0,`Matched leaf route at location "${z.pathname}${z.search}${z.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let B=Wp(O&&O.map(H=>Object.assign({},H,{params:Object.assign({},h,H.params),pathname:rl([v,g.encodeLocation?g.encodeLocation(H.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:H.pathname]),pathnameBase:H.pathnameBase==="/"?v:rl([v,g.encodeLocation?g.encodeLocation(H.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:H.pathnameBase])})),x,f,r,y);return o&&B?S.createElement(Kn.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...z},navigationType:"POP"}},B):B}function Zp(){let u=tv(),o=Op(u)?`${u.status} ${u.statusText}`:u instanceof Error?u.message:JSON.stringify(u),f=u instanceof Error?u.stack:null,r="rgba(200,200,200, 0.5)",y={padding:"0.5rem",backgroundColor:r},g={padding:"2px 4px",backgroundColor:r},x=null;return console.error("Error handled by React Router default ErrorBoundary:",u),x=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:g},"ErrorBoundary")," or"," ",S.createElement("code",{style:g},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},o),f?S.createElement("pre",{style:y},f):null,x)}var Kp=S.createElement(Zp,null),em=class extends S.Component{constructor(u){super(u),this.state={location:u.location,revalidation:u.revalidation,error:u.error}}static getDerivedStateFromError(u){return{error:u}}static getDerivedStateFromProps(u,o){return o.location!==u.location||o.revalidation!=="idle"&&u.revalidation==="idle"?{error:u.error,location:u.location,revalidation:u.revalidation}:{error:u.error!==void 0?u.error:o.error,location:o.location,revalidation:u.revalidation||o.revalidation}}componentDidCatch(u,o){this.props.onError?this.props.onError(u,o):console.error("React Router caught the following error during render",u)}render(){let u=this.state.error;if(this.context&&typeof u=="object"&&u&&"digest"in u&&typeof u.digest=="string"){const f=Gp(u.digest);f&&(u=f)}let o=u!==void 0?S.createElement(Ht.Provider,{value:this.props.routeContext},S.createElement(ur.Provider,{value:u,children:this.props.component})):this.props.children;return this.context?S.createElement(Jp,{error:u},o):o}};em.contextType=Up;var Js=new WeakMap;function Jp({children:u,error:o}){let{basename:f}=S.useContext(Dt);if(typeof o=="object"&&o&&"digest"in o&&typeof o.digest=="string"){let r=qp(o.digest);if(r){let y=Js.get(o);if(y)throw y;let g=Xh(r.location,f);if(Vh&&!Js.get(o))if(g.isExternal||r.reloadDocument)window.location.href=g.absoluteURL||g.to;else{const x=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(g.to,{replace:r.replace}));throw Js.set(o,x),x}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${g.absoluteURL||g.to}`})}}return u}function $p({routeContext:u,match:o,children:f}){let r=S.useContext(Xa);return r&&r.static&&r.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=o.route.id),S.createElement(Ht.Provider,{value:u},f)}function Wp(u,o=[],f=null,r=null,y=null){if(u==null){if(!f)return null;if(f.errors)u=f.matches;else if(o.length===0&&!f.initialized&&f.matches.length>0)u=f.matches;else return null}let g=u,x=f?.errors;if(x!=null){let v=g.findIndex(p=>p.route.id&&x?.[p.route.id]!==void 0);we(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(x).join(",")}`),g=g.slice(0,Math.min(g.length,v+1))}let C=!1,h=-1;if(f)for(let v=0;v<g.length;v++){let p=g[v];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(h=v),p.route.id){let{loaderData:E,errors:z}=f,N=p.route.loader&&!E.hasOwnProperty(p.route.id)&&(!z||z[p.route.id]===void 0);if(p.route.lazy||N){C=!0,h>=0?g=g.slice(0,h+1):g=[g[0]];break}}}let d=f&&r?(v,p)=>{r(v,{location:f.location,params:f.matches?.[0]?.params??{},unstable_pattern:Dp(f.matches),errorInfo:p})}:void 0;return g.reduceRight((v,p,E)=>{let z,N=!1,_=null,O=null;f&&(z=x&&p.route.id?x[p.route.id]:void 0,_=p.route.errorElement||Kp,C&&(h<0&&E===0?(tm("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,O=null):h===E&&(N=!0,O=p.route.hydrateFallbackElement||null)));let B=o.concat(g.slice(0,E+1)),H=()=>{let G;return z?G=_:N?G=O:p.route.Component?G=S.createElement(p.route.Component,null):p.route.element?G=p.route.element:G=v,S.createElement($p,{match:p,routeContext:{outlet:v,matches:B,isDataRoute:f!=null},children:G})};return f&&(p.route.ErrorBoundary||p.route.errorElement||E===0)?S.createElement(em,{location:f.location,revalidation:f.revalidation,component:_,error:z,children:H(),routeContext:{outlet:null,matches:B,isDataRoute:!0},onError:d}):H()},null)}function cr(u){return`${u} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Fp(u){let o=S.useContext(Xa);return we(o,cr(u)),o}function Ip(u){let o=S.useContext(xu);return we(o,cr(u)),o}function Pp(u){let o=S.useContext(Ht);return we(o,cr(u)),o}function sr(u){let o=Pp(u),f=o.matches[o.matches.length-1];return we(f.route.id,`${u} can only be used on routes that contain a unique "id"`),f.route.id}function ev(){return sr("useRouteId")}function tv(){let u=S.useContext(ur),o=Ip("useRouteError"),f=sr("useRouteError");return u!==void 0?u:o.errors?.[f]}function lv(){let{router:u}=Fp("useNavigate"),o=sr("useNavigate"),f=S.useRef(!1);return $h(()=>{f.current=!0}),S.useCallback(async(y,g={})=>{Lt(f.current,Jh),f.current&&(typeof y=="number"?await u.navigate(y):await u.navigate(y,{fromRouteId:o,...g}))},[u,o])}var Rh={};function tm(u,o,f){!o&&!Rh[u]&&(Rh[u]=!0,Lt(!1,f))}S.memo(av);function av({routes:u,future:o,state:f,onError:r}){return Ph(u,void 0,f,r,o)}function nv(u){return Xp(u.context)}function Ll(u){we(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function iv({basename:u="/",children:o=null,location:f,navigationType:r="POP",navigator:y,static:g=!1,unstable_useTransitions:x}){we(!Jn(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let C=u.replace(/^\/*/,"/"),h=S.useMemo(()=>({basename:C,navigator:y,static:g,unstable_useTransitions:x,future:{}}),[C,y,g,x]);typeof f=="string"&&(f=Va(f));let{pathname:d="/",search:v="",hash:p="",state:E=null,key:z="default"}=f,N=S.useMemo(()=>{let _=ol(d,C);return _==null?null:{location:{pathname:_,search:v,hash:p,state:E,key:z},navigationType:r}},[C,d,v,p,E,z,r]);return Lt(N!=null,`<Router basename="${C}"> is not able to match the URL "${d}${v}${p}" because it does not start with the basename, so the <Router> won't render anything.`),N==null?null:S.createElement(Dt.Provider,{value:h},S.createElement(Kn.Provider,{children:o,value:N}))}function uv({children:u,location:o}){return kp(tr(u),o)}function tr(u,o=[]){let f=[];return S.Children.forEach(u,(r,y)=>{if(!S.isValidElement(r))return;let g=[...o,y];if(r.type===S.Fragment){f.push.apply(f,tr(r.props.children,g));return}we(r.type===Ll,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),we(!r.props.index||!r.props.children,"An index route cannot have child routes.");let x={id:r.props.id||g.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(x.children=tr(r.props.children,g)),f.push(x)}),f}var yu="get",pu="application/x-www-form-urlencoded";function Eu(u){return typeof HTMLElement<"u"&&u instanceof HTMLElement}function cv(u){return Eu(u)&&u.tagName.toLowerCase()==="button"}function sv(u){return Eu(u)&&u.tagName.toLowerCase()==="form"}function rv(u){return Eu(u)&&u.tagName.toLowerCase()==="input"}function ov(u){return!!(u.metaKey||u.altKey||u.ctrlKey||u.shiftKey)}function fv(u,o){return u.button===0&&(!o||o==="_self")&&!ov(u)}function lr(u=""){return new URLSearchParams(typeof u=="string"||Array.isArray(u)||u instanceof URLSearchParams?u:Object.keys(u).reduce((o,f)=>{let r=u[f];return o.concat(Array.isArray(r)?r.map(y=>[f,y]):[[f,r]])},[]))}function dv(u,o){let f=lr(u);return o&&o.forEach((r,y)=>{f.has(y)||o.getAll(y).forEach(g=>{f.append(y,g)})}),f}var mu=null;function hv(){if(mu===null)try{new FormData(document.createElement("form"),0),mu=!1}catch{mu=!0}return mu}var mv=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function $s(u){return u!=null&&!mv.has(u)?(Lt(!1,`"${u}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${pu}"`),null):u}function gv(u,o){let f,r,y,g,x;if(sv(u)){let C=u.getAttribute("action");r=C?ol(C,o):null,f=u.getAttribute("method")||yu,y=$s(u.getAttribute("enctype"))||pu,g=new FormData(u)}else if(cv(u)||rv(u)&&(u.type==="submit"||u.type==="image")){let C=u.form;if(C==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=u.getAttribute("formaction")||C.getAttribute("action");if(r=h?ol(h,o):null,f=u.getAttribute("formmethod")||C.getAttribute("method")||yu,y=$s(u.getAttribute("formenctype"))||$s(C.getAttribute("enctype"))||pu,g=new FormData(C,u),!hv()){let{name:d,type:v,value:p}=u;if(v==="image"){let E=d?`${d}.`:"";g.append(`${E}x`,"0"),g.append(`${E}y`,"0")}else d&&g.append(d,p)}}else{if(Eu(u))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');f=yu,r=null,y=pu,x=u}return g&&y==="text/plain"&&(x=g,g=void 0),{action:r,method:f.toLowerCase(),encType:y,formData:g,body:x}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function rr(u,o){if(u===!1||u===null||typeof u>"u")throw new Error(o)}function yv(u,o,f,r){let y=typeof u=="string"?new URL(u,typeof window>"u"?"server://singlefetch/":window.location.origin):u;return f?y.pathname.endsWith("/")?y.pathname=`${y.pathname}_.${r}`:y.pathname=`${y.pathname}.${r}`:y.pathname==="/"?y.pathname=`_root.${r}`:o&&ol(y.pathname,o)==="/"?y.pathname=`${o.replace(/\/$/,"")}/_root.${r}`:y.pathname=`${y.pathname.replace(/\/$/,"")}.${r}`,y}async function pv(u,o){if(u.id in o)return o[u.id];try{let f=await import(u.module);return o[u.id]=f,f}catch(f){return console.error(`Error loading route module \`${u.module}\`, reloading page...`),console.error(f),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function vv(u){return u==null?!1:u.href==null?u.rel==="preload"&&typeof u.imageSrcSet=="string"&&typeof u.imageSizes=="string":typeof u.rel=="string"&&typeof u.href=="string"}async function Sv(u,o,f){let r=await Promise.all(u.map(async y=>{let g=o.routes[y.route.id];if(g){let x=await pv(g,f);return x.links?x.links():[]}return[]}));return Cv(r.flat(1).filter(vv).filter(y=>y.rel==="stylesheet"||y.rel==="preload").map(y=>y.rel==="stylesheet"?{...y,rel:"prefetch",as:"style"}:{...y,rel:"prefetch"}))}function Mh(u,o,f,r,y,g){let x=(h,d)=>f[d]?h.route.id!==f[d].route.id:!0,C=(h,d)=>f[d].pathname!==h.pathname||f[d].route.path?.endsWith("*")&&f[d].params["*"]!==h.params["*"];return g==="assets"?o.filter((h,d)=>x(h,d)||C(h,d)):g==="data"?o.filter((h,d)=>{let v=r.routes[h.route.id];if(!v||!v.hasLoader)return!1;if(x(h,d)||C(h,d))return!0;if(h.route.shouldRevalidate){let p=h.route.shouldRevalidate({currentUrl:new URL(y.pathname+y.search+y.hash,window.origin),currentParams:f[0]?.params||{},nextUrl:new URL(u,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function xv(u,o,{includeHydrateFallback:f}={}){return bv(u.map(r=>{let y=o.routes[r.route.id];if(!y)return[];let g=[y.module];return y.clientActionModule&&(g=g.concat(y.clientActionModule)),y.clientLoaderModule&&(g=g.concat(y.clientLoaderModule)),f&&y.hydrateFallbackModule&&(g=g.concat(y.hydrateFallbackModule)),y.imports&&(g=g.concat(y.imports)),g}).flat(1))}function bv(u){return[...new Set(u)]}function Ev(u){let o={},f=Object.keys(u).sort();for(let r of f)o[r]=u[r];return o}function Cv(u,o){let f=new Set;return new Set(o),u.reduce((r,y)=>{let g=JSON.stringify(Ev(y));return f.has(g)||(f.add(g),r.push({key:g,link:y})),r},[])}function lm(){let u=S.useContext(Xa);return rr(u,"You must render this element inside a <DataRouterContext.Provider> element"),u}function jv(){let u=S.useContext(xu);return rr(u,"You must render this element inside a <DataRouterStateContext.Provider> element"),u}var or=S.createContext(void 0);or.displayName="FrameworkContext";function am(){let u=S.useContext(or);return rr(u,"You must render this element inside a <HydratedRouter> element"),u}function Tv(u,o){let f=S.useContext(or),[r,y]=S.useState(!1),[g,x]=S.useState(!1),{onFocus:C,onBlur:h,onMouseEnter:d,onMouseLeave:v,onTouchStart:p}=o,E=S.useRef(null);S.useEffect(()=>{if(u==="render"&&x(!0),u==="viewport"){let _=B=>{B.forEach(H=>{x(H.isIntersecting)})},O=new IntersectionObserver(_,{threshold:.5});return E.current&&O.observe(E.current),()=>{O.disconnect()}}},[u]),S.useEffect(()=>{if(r){let _=setTimeout(()=>{x(!0)},100);return()=>{clearTimeout(_)}}},[r]);let z=()=>{y(!0)},N=()=>{y(!1),x(!1)};return f?u!=="intent"?[g,E,{}]:[g,E,{onFocus:Gn(C,z),onBlur:Gn(h,N),onMouseEnter:Gn(d,z),onMouseLeave:Gn(v,N),onTouchStart:Gn(p,z)}]:[!1,E,{}]}function Gn(u,o){return f=>{u&&u(f),f.defaultPrevented||o(f)}}function Av({page:u,...o}){let{router:f}=lm(),r=S.useMemo(()=>Hh(f.routes,u,f.basename),[f.routes,u,f.basename]);return r?S.createElement(Rv,{page:u,matches:r,...o}):null}function zv(u){let{manifest:o,routeModules:f}=am(),[r,y]=S.useState([]);return S.useEffect(()=>{let g=!1;return Sv(u,o,f).then(x=>{g||y(x)}),()=>{g=!0}},[u,o,f]),r}function Rv({page:u,matches:o,...f}){let r=fl(),{future:y,manifest:g,routeModules:x}=am(),{basename:C}=lm(),{loaderData:h,matches:d}=jv(),v=S.useMemo(()=>Mh(u,o,d,g,r,"data"),[u,o,d,g,r]),p=S.useMemo(()=>Mh(u,o,d,g,r,"assets"),[u,o,d,g,r]),E=S.useMemo(()=>{if(u===r.pathname+r.search+r.hash)return[];let _=new Set,O=!1;if(o.forEach(H=>{let G=g.routes[H.route.id];!G||!G.hasLoader||(!v.some(I=>I.route.id===H.route.id)&&H.route.id in h&&x[H.route.id]?.shouldRevalidate||G.hasClientLoader?O=!0:_.add(H.route.id))}),_.size===0)return[];let B=yv(u,C,y.unstable_trailingSlashAwareDataRequests,"data");return O&&_.size>0&&B.searchParams.set("_routes",o.filter(H=>_.has(H.route.id)).map(H=>H.route.id).join(",")),[B.pathname+B.search]},[C,y.unstable_trailingSlashAwareDataRequests,h,r,g,v,o,u,x]),z=S.useMemo(()=>xv(p,g),[p,g]),N=zv(p);return S.createElement(S.Fragment,null,E.map(_=>S.createElement("link",{key:_,rel:"prefetch",as:"fetch",href:_,...f})),z.map(_=>S.createElement("link",{key:_,rel:"modulepreload",href:_,...f})),N.map(({key:_,link:O})=>S.createElement("link",{key:_,nonce:f.nonce,...O,crossOrigin:O.crossOrigin??f.crossOrigin})))}function Mv(...u){return o=>{u.forEach(f=>{typeof f=="function"?f(o):f!=null&&(f.current=o)})}}var Nv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Nv&&(window.__reactRouterVersion="7.13.0")}catch{}function _v({basename:u,children:o,unstable_useTransitions:f,window:r}){let y=S.useRef();y.current==null&&(y.current=sp({window:r,v5Compat:!0}));let g=y.current,[x,C]=S.useState({action:g.action,location:g.location}),h=S.useCallback(d=>{f===!1?C(d):S.startTransition(()=>C(d))},[f]);return S.useLayoutEffect(()=>g.listen(h),[g,h]),S.createElement(iv,{basename:u,children:o,location:x.location,navigationType:x.action,navigator:g,unstable_useTransitions:f})}var nm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vt=S.forwardRef(function({onClick:o,discover:f="render",prefetch:r="none",relative:y,reloadDocument:g,replace:x,state:C,target:h,to:d,preventScrollReset:v,viewTransition:p,unstable_defaultShouldRevalidate:E,...z},N){let{basename:_,unstable_useTransitions:O}=S.useContext(Dt),B=typeof d=="string"&&nm.test(d),H=Xh(d,_);d=H.to;let G=Qp(d,{relative:y}),[I,P,V]=Tv(r,z),K=Uv(d,{replace:x,state:C,target:h,preventScrollReset:v,relative:y,viewTransition:p,unstable_defaultShouldRevalidate:E,unstable_useTransitions:O});function k($){o&&o($),$.defaultPrevented||K($)}let X=S.createElement("a",{...z,...V,href:H.absoluteURL||G,onClick:H.isExternal||g?o:k,ref:Mv(N,P),target:h,"data-discover":!B&&f==="render"?"true":void 0});return I&&!B?S.createElement(S.Fragment,null,X,S.createElement(Av,{page:G})):X});Vt.displayName="Link";var Ov=S.forwardRef(function({"aria-current":o="page",caseSensitive:f=!1,className:r="",end:y=!1,style:g,to:x,viewTransition:C,children:h,...d},v){let p=$n(x,{relative:d.relative}),E=fl(),z=S.useContext(xu),{navigator:N,basename:_}=S.useContext(Dt),O=z!=null&&Gv(p)&&C===!0,B=N.encodeLocation?N.encodeLocation(p).pathname:p.pathname,H=E.pathname,G=z&&z.navigation&&z.navigation.location?z.navigation.location.pathname:null;f||(H=H.toLowerCase(),G=G?G.toLowerCase():null,B=B.toLowerCase()),G&&_&&(G=ol(G,_)||G);const I=B!=="/"&&B.endsWith("/")?B.length-1:B.length;let P=H===B||!y&&H.startsWith(B)&&H.charAt(I)==="/",V=G!=null&&(G===B||!y&&G.startsWith(B)&&G.charAt(B.length)==="/"),K={isActive:P,isPending:V,isTransitioning:O},k=P?o:void 0,X;typeof r=="function"?X=r(K):X=[r,P?"active":null,V?"pending":null,O?"transitioning":null].filter(Boolean).join(" ");let $=typeof g=="function"?g(K):g;return S.createElement(Vt,{...d,"aria-current":k,className:X,ref:v,style:$,to:x,viewTransition:C},typeof h=="function"?h(K):h)});Ov.displayName="NavLink";var Dv=S.forwardRef(({discover:u="render",fetcherKey:o,navigate:f,reloadDocument:r,replace:y,state:g,method:x=yu,action:C,onSubmit:h,relative:d,preventScrollReset:v,viewTransition:p,unstable_defaultShouldRevalidate:E,...z},N)=>{let{unstable_useTransitions:_}=S.useContext(Dt),O=Yv(),B=qv(C,{relative:d}),H=x.toLowerCase()==="get"?"get":"post",G=typeof C=="string"&&nm.test(C),I=P=>{if(h&&h(P),P.defaultPrevented)return;P.preventDefault();let V=P.nativeEvent.submitter,K=V?.getAttribute("formmethod")||x,k=()=>O(V||P.currentTarget,{fetcherKey:o,method:K,navigate:f,replace:y,state:g,relative:d,preventScrollReset:v,viewTransition:p,unstable_defaultShouldRevalidate:E});_&&f!==!1?S.startTransition(()=>k()):k()};return S.createElement("form",{ref:N,method:H,action:B,onSubmit:r?h:I,...z,"data-discover":!G&&u==="render"?"true":void 0})});Dv.displayName="Form";function wv(u){return`${u} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function im(u){let o=S.useContext(Xa);return we(o,wv(u)),o}function Uv(u,{target:o,replace:f,state:r,preventScrollReset:y,relative:g,viewTransition:x,unstable_defaultShouldRevalidate:C,unstable_useTransitions:h}={}){let d=bu(),v=fl(),p=$n(u,{relative:g});return S.useCallback(E=>{if(fv(E,o)){E.preventDefault();let z=f!==void 0?f:Zn(v)===Zn(p),N=()=>d(u,{replace:z,state:r,preventScrollReset:y,relative:g,viewTransition:x,unstable_defaultShouldRevalidate:C});h?S.startTransition(()=>N()):N()}},[v,d,p,f,r,o,u,y,g,x,C,h])}function Bv(u){Lt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let o=S.useRef(lr(u)),f=S.useRef(!1),r=fl(),y=S.useMemo(()=>dv(r.search,f.current?null:o.current),[r.search]),g=bu(),x=S.useCallback((C,h)=>{const d=lr(typeof C=="function"?C(new URLSearchParams(y)):C);f.current=!0,g("?"+d,h)},[g,y]);return[y,x]}var Lv=0,Hv=()=>`__${String(++Lv)}__`;function Yv(){let{router:u}=im("useSubmit"),{basename:o}=S.useContext(Dt),f=ev(),r=u.fetch,y=u.navigate;return S.useCallback(async(g,x={})=>{let{action:C,method:h,encType:d,formData:v,body:p}=gv(g,o);if(x.navigate===!1){let E=x.fetcherKey||Hv();await r(E,f,x.action||C,{unstable_defaultShouldRevalidate:x.unstable_defaultShouldRevalidate,preventScrollReset:x.preventScrollReset,formData:v,body:p,formMethod:x.method||h,formEncType:x.encType||d,flushSync:x.flushSync})}else await y(x.action||C,{unstable_defaultShouldRevalidate:x.unstable_defaultShouldRevalidate,preventScrollReset:x.preventScrollReset,formData:v,body:p,formMethod:x.method||h,formEncType:x.encType||d,replace:x.replace,state:x.state,fromRouteId:f,flushSync:x.flushSync,viewTransition:x.viewTransition})},[r,y,o,f])}function qv(u,{relative:o}={}){let{basename:f}=S.useContext(Dt),r=S.useContext(Ht);we(r,"useFormAction must be used inside a RouteContext");let[y]=r.matches.slice(-1),g={...$n(u||".",{relative:o})},x=fl();if(u==null){g.search=x.search;let C=new URLSearchParams(g.search),h=C.getAll("index");if(h.some(v=>v==="")){C.delete("index"),h.filter(p=>p).forEach(p=>C.append("index",p));let v=C.toString();g.search=v?`?${v}`:""}}return(!u||u===".")&&y.route.index&&(g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index"),f!=="/"&&(g.pathname=g.pathname==="/"?f:rl([f,g.pathname])),Zn(g)}function Gv(u,{relative:o}={}){let f=S.useContext(Zh);we(f!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=im("useViewTransitionState"),y=$n(u,{relative:o});if(!f.isTransitioning)return!1;let g=ol(f.currentLocation.pathname,r)||f.currentLocation.pathname,x=ol(f.nextLocation.pathname,r)||f.nextLocation.pathname;return vu(y.pathname,x)!=null||vu(y.pathname,g)!=null}async function ve(u){const o=await fetch(u);if(!o.ok){const f=await o.json().catch(()=>({error:"Request failed"}));throw{status:o.status,message:f.error||"Request failed"}}return o.json()}async function tt(u,o){const f=await fetch(u,{method:"POST",headers:o!==void 0?{"Content-Type":"application/json"}:{},body:o!==void 0?JSON.stringify(o):void 0});if(!f.ok){const r=await f.json().catch(()=>({error:"Request failed"}));throw{status:f.status,message:r.error||"Request failed"}}return f.json()}async function Qv(u,o){const f=await fetch(u,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!f.ok){const r=await f.json().catch(()=>({error:"Request failed"}));throw{status:f.status,message:r.error||"Request failed"}}return f.json()}async function um(u){const o=await fetch(u,{method:"DELETE"});if(!o.ok){const f=await o.json().catch(()=>({error:"Request failed"}));throw{status:o.status,message:f.error||"Request failed"}}return o.json()}function Vv({twilioStatus:u,authStatus:o}){const[f,r]=S.useState([]),y=fl(),[g,x]=S.useState(()=>localStorage.getItem("theme")==="dark"||!localStorage.getItem("theme")&&window.matchMedia("(prefers-color-scheme: dark)").matches);S.useEffect(()=>{ve("/api/conversations").then(r).catch(()=>{})},[]),S.useEffect(()=>{g?(document.body.classList.add("dark"),document.body.classList.remove("light"),localStorage.setItem("theme","dark")):(document.body.classList.remove("dark"),document.body.classList.add("light"),localStorage.setItem("theme","light"))},[g]);const C=h=>{const v=new Date(h.timestamp).toLocaleDateString(void 0,{month:"short",day:"numeric"}),p=h.firstMessage.slice(0,30);return`${v} - ${p}`};return c.jsxs("div",{className:"sidebar",children:[c.jsx("div",{style:{padding:"24px 16px 8px 24px",display:"flex",alignItems:"center",gap:10},children:c.jsx("span",{style:{fontSize:"28px",fontWeight:"400",fontFamily:"'IBM Plex Serif', serif",letterSpacing:"-0.5px",color:"var(--text-primary)"},children:"VoiceCC"})}),c.jsxs("div",{className:"sidebar-nav",children:[c.jsxs(Vt,{to:"/",className:`sidebar-item ${y.pathname==="/"?"active":""}`,style:{textDecoration:"none",display:"flex",alignItems:"center"},children:[c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),c.jsx("polyline",{points:"9 22 9 12 15 12 15 22"})]}),"Home"]}),c.jsxs(Vt,{to:"/agents",className:`sidebar-item ${y.pathname.startsWith("/agents")?"active":""}`,style:{textDecoration:"none",display:"flex",alignItems:"center"},children:[c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),c.jsx("circle",{cx:"9",cy:"7",r:"4"}),c.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),c.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),"Agents"]}),c.jsxs(Vt,{to:"/settings",className:`sidebar-item ${y.pathname.startsWith("/settings")?"active":""}`,style:{textDecoration:"none",display:"flex",alignItems:"center"},children:[c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("circle",{cx:"12",cy:"12",r:"3"}),c.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),"Settings"]}),c.jsx("div",{className:"sidebar-section-label",style:{marginTop:16,flexShrink:0},children:"History"}),c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,flex:1,overflowY:"auto"},children:[f.length===0&&c.jsx("div",{style:{padding:"8px 12px",fontSize:13,color:"var(--text-secondary)"},children:"No history yet."}),f.map(h=>c.jsx(Vt,{to:`/c/${h.sessionId}`,className:`sidebar-conversation ${y.pathname===`/c/${h.sessionId}`?"active":""}`,title:h.firstMessage,style:{textDecoration:"none",display:"block"},children:C(h)},h.sessionId))]})]}),c.jsxs("div",{className:"sidebar-footer",children:[o===!1&&c.jsx("div",{style:{margin:"0 12px 8px",padding:"8px 10px",fontSize:12,color:"#d73a49",background:"var(--bg-tertiary)",borderRadius:6,border:"1px solid #d73a49"},children:"Claude not authenticated"}),c.jsxs("button",{className:"sidebar-item",onClick:()=>x(!g),children:[g?c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("circle",{cx:"12",cy:"12",r:"5"}),c.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),c.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),c.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),c.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),c.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),c.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),c.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),c.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),g?"Light Mode":"Dark Mode"]}),c.jsxs("button",{className:"sidebar-item",onClick:()=>{},children:[c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("circle",{cx:"12",cy:"12",r:"10"}),c.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),c.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),"Support"]})]})]})}function Xv(){const[u,o]=S.useState({running:!1,tunnelUrl:null}),[f,r]=S.useState({running:!1,tunnelUrl:null}),[y,g]=S.useState(null),[x,C]=S.useState(null),[h,d]=S.useState(!1);S.useEffect(()=>{const p=()=>{ve("/api/twilio/status").then(o).catch(()=>{}),ve("/api/browser-call/status").then(r).catch(()=>{})};p();const E=setInterval(p,5e3);return()=>clearInterval(E)},[]),S.useEffect(()=>{ve("/api/auth").then(p=>g(p.authenticated)).catch(()=>g(!1))},[]),S.useEffect(()=>{ve("/api/version").then(C).catch(()=>{})},[]);const v=x?.updateAvailable&&!h;return c.jsxs("div",{style:{display:"flex",height:"100vh"},children:[c.jsx(Vv,{twilioStatus:u,authStatus:y}),c.jsxs("div",{className:"main",style:{display:"flex",flexDirection:"column",height:"100vh",overflow:"hidden"},children:[v&&c.jsxs("div",{style:{padding:"8px 16px",background:"var(--bg-surface)",borderBottom:"1px solid var(--border-color)",fontSize:12,color:"var(--text-secondary)",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},children:[c.jsxs("span",{children:["Update available: ",c.jsxs("strong",{style:{color:"var(--text-primary)"},children:["v",x.latest]})," (current: v",x.current,"). Run ",c.jsx("code",{style:{background:"var(--bg-main)",padding:"1px 5px",fontFamily:'"SF Mono", "Fira Code", monospace',fontSize:11,color:"var(--accent-color)"},children:"npm install -g voicecc"})," to update."]}),c.jsx("button",{onClick:()=>d(!0),style:{background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer",fontSize:14,padding:"0 4px",lineHeight:1},children:"x"})]}),c.jsx(nv,{context:{authStatus:y,setAuthStatus:g,browserCallStatus:f}})]})]})}const kv={display:"flex",gap:0,marginBottom:20,borderBottom:"1px solid var(--border-color)"},Nh=u=>({padding:"8px 16px",fontSize:13,fontWeight:u?600:400,color:u?"var(--text-primary)":"var(--text-secondary)",background:"none",border:"none",borderBottom:u?"2px solid var(--accent-color)":"2px solid transparent",cursor:"pointer",marginBottom:-1}),Zv={fontSize:12,color:"var(--text-secondary)",background:"color-mix(in srgb, var(--warning-color, #f59e0b) 8%, transparent)",border:"1px solid color-mix(in srgb, var(--warning-color, #f59e0b) 20%, transparent)",padding:"8px 12px",borderRadius:6,marginTop:12,lineHeight:1.5},_h={width:"100%",padding:"8px 10px",fontSize:13,fontFamily:'"SF Mono", "Fira Code", monospace',background:"var(--bg-main)",border:"1px solid var(--border-color)",color:"var(--text-primary)",boxSizing:"border-box"},Ws={display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},Fs={background:"var(--btn-secondary-bg)",color:"var(--btn-secondary-text)",border:"1px solid var(--btn-secondary-border)"},Kv={fontSize:10,fontWeight:600,color:"var(--accent-color)",background:"color-mix(in srgb, var(--accent-color) 12%, transparent)",padding:"2px 6px",borderRadius:4,marginLeft:6,verticalAlign:"middle"};function cm({onClose:u,onAuthenticated:o}){const[f,r]=S.useState("oauth"),[y,g]=S.useState(null),[x,C]=S.useState(""),[h,d]=S.useState(!1),[v,p]=S.useState(!1),[E,z]=S.useState(null),[N,_]=S.useState(""),[O,B]=S.useState(!1),[H,G]=S.useState(null),I=k=>{k.target===k.currentTarget&&u()},P=async()=>{d(!0),z(null),g(null),C("");try{const k=await tt("/api/auth/oauth/start");g(k.url)}catch(k){z(k?.message||"Failed to start login")}d(!1)},V=async()=>{const k=x.trim();if(k){p(!0),z(null);try{(await tt("/api/auth/oauth/code",{code:k})).authenticated?(o(),u()):z("Login completed but authentication check failed. Try again.")}catch(X){z(X?.message||"Failed to complete login")}p(!1)}},K=async()=>{const k=N.trim();if(k){B(!0),G(null);try{(await tt("/api/auth/token",{token:k})).authenticated?(o(),u()):G("Token was saved but authentication failed. Check that the token is valid.")}catch(X){G(X?.message||"Failed to save token")}B(!1)}};return c.jsx("div",{className:"modal-overlay visible",onClick:I,children:c.jsxs("div",{className:"modal",style:{width:520},children:[c.jsx("button",{className:"modal-close",onClick:u,children:"×"}),c.jsx("h2",{children:"Authenticate with Claude"}),c.jsxs("div",{style:kv,children:[c.jsxs("button",{style:Nh(f==="oauth"),onClick:()=>r("oauth"),children:["Login with Claude",c.jsx("span",{style:Kv,children:"recommended"})]}),c.jsx("button",{style:Nh(f==="token"),onClick:()=>r("token"),children:"Setup Token"})]}),f==="oauth"&&c.jsxs("div",{children:[!y&&c.jsxs("div",{children:[c.jsx("div",{style:{fontSize:13,color:"var(--text-secondary)",lineHeight:1.6},children:c.jsx("p",{style:{marginBottom:12},children:"Sign in with your Claude account. This authenticates the CLI directly, enabling all features including cloud integrations like Gmail, Google Calendar, and Slack."})}),c.jsxs("div",{style:Ws,children:[c.jsx("button",{style:Fs,onClick:u,children:"Cancel"}),c.jsx("button",{onClick:P,disabled:h,children:h?"Starting...":"Start login"})]})]}),y&&c.jsxs("div",{children:[c.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)",lineHeight:1.6},children:[c.jsx("p",{style:{marginBottom:12},children:"Open this URL in your browser and sign in:"}),c.jsx("div",{style:{background:"var(--bg-main)",border:"1px solid var(--border-color)",padding:"8px 12px",fontFamily:'"SF Mono", "Fira Code", monospace',fontSize:11,color:"var(--accent-color)",marginBottom:12,wordBreak:"break-all",cursor:"pointer"},onClick:()=>navigator.clipboard.writeText(y),title:"Click to copy",children:y}),c.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginBottom:16},children:"Click the URL above to copy it. After signing in, paste the code below."})]}),c.jsx("input",{type:"text",placeholder:"Paste the code here...",value:x,onChange:k=>C(k.target.value),onKeyDown:k=>{k.key==="Enter"&&V()},style:_h,autoFocus:!0}),c.jsxs("div",{style:Ws,children:[c.jsx("button",{style:Fs,onClick:u,children:"Cancel"}),c.jsx("button",{onClick:V,disabled:v||!x.trim(),children:v?"Authenticating...":"Submit code"})]})]}),E&&c.jsx("p",{style:{fontSize:12,color:"#d73a49",marginTop:8},children:E})]}),f==="token"&&c.jsxs("div",{children:[c.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:16,lineHeight:1.5},children:[c.jsx("p",{style:{marginBottom:12},children:"Run the following command in your terminal to generate a token:"}),c.jsx("code",{style:{display:"block",background:"var(--bg-main)",border:"1px solid var(--border-color)",padding:"8px 12px",fontFamily:'"SF Mono", "Fira Code", monospace',fontSize:12,color:"var(--accent-color)",marginBottom:12},children:"claude setup-token"}),c.jsx("p",{children:"Complete the sign-in in your browser, then paste the token below."})]}),c.jsx("input",{type:"password",placeholder:"sk-ant-oat01-...",value:N,onChange:k=>_(k.target.value),onKeyDown:k=>{k.key==="Enter"&&K()},style:_h}),c.jsx("div",{style:Zv,children:'Cloud MCP servers (Gmail, Google Calendar, Slack, etc.) will not be available with this method. Use "Login with Claude" for full integration support.'}),H&&c.jsx("p",{style:{fontSize:12,color:"#d73a49",marginTop:8},children:H}),c.jsxs("div",{style:Ws,children:[c.jsx("button",{style:Fs,onClick:u,children:"Cancel"}),c.jsx("button",{onClick:K,disabled:O||!N.trim(),children:O?"Saving...":"Save token"})]})]})]})})}function Jv(){const{authStatus:u,setAuthStatus:o}=Fh(),[f,r]=S.useState(null),[y,g]=S.useState(null),[x,C]=S.useState(!1);return S.useEffect(()=>{ve("/api/browser-call/status").then(h=>r(h.running)).catch(()=>r(!1)),ve("/api/mcp-servers").then(h=>g(h.servers)).catch(()=>g([]))},[]),c.jsxs("div",{className:"page active",style:{display:"flex",flexDirection:"column"},children:[c.jsx("div",{className:"page-header",style:{padding:"48px 64px 24px"},children:c.jsxs("div",{children:[c.jsx("h1",{children:"Getting started"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginTop:4},children:"Set up your environment to get started."})]})}),c.jsxs("div",{style:{padding:"0 64px 48px"},children:[c.jsxs("div",{className:"settings-panel",children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Connect your Claude Code"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:20},children:"VoiceCC needs an authenticated Claude Code session to work. The check below verifies your local CLI is logged in."}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:u===null?"#666":u?"var(--accent-color)":"#d73a49",flexShrink:0}}),c.jsx("span",{style:{fontSize:13,color:u===null?"var(--text-secondary)":u?"var(--accent-color)":"#d73a49"},children:u===null?"Checking authentication...":u?"Claude Code is authenticated":"Claude Code is not authenticated"})]}),u===!1&&c.jsx("div",{className:"settings-actions",children:c.jsx("button",{onClick:()=>C(!0),children:"Set up authentication"})})]}),x&&c.jsx(cm,{onClose:()=>C(!1),onAuthenticated:()=>o(!0)}),c.jsxs("div",{className:"settings-panel",children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Enable calling from anywhere"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:20},children:"Call your voice assistant from any device using a browser."}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:f===null?"#666":f?"var(--accent-color)":"#d73a49",flexShrink:0}}),c.jsx("span",{style:{fontSize:13,color:f===null?"var(--text-secondary)":f?"var(--accent-color)":"#d73a49"},children:f===null?"Checking status...":f?"Browser calling is active":"Browser calling is not enabled"})]}),f===!1&&c.jsx("div",{className:"settings-actions",children:c.jsx(Vt,{to:"/settings?tab=integrations",style:{textDecoration:"none"},children:c.jsx("button",{children:"Set up in Settings"})})})]}),c.jsxs("div",{className:"settings-panel",children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"MCP Integrations"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:20},children:"Connect external tools and services via MCP servers."}),y===null&&c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"#666",flexShrink:0}}),c.jsx("span",{style:{fontSize:13,color:"var(--text-secondary)"},children:"Checking..."})]}),y!==null&&y.length===0&&c.jsx("div",{className:"settings-actions",children:c.jsx(Vt,{to:"/settings?tab=integrations",style:{textDecoration:"none"},children:c.jsx("button",{children:"Set up in Settings"})})}),y!==null&&y.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:y.map(h=>c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:h.status==="connected"?"var(--accent-color)":h.status==="needs_auth"?"#d29922":"#d73a49",flexShrink:0}}),c.jsx("span",{style:{fontSize:13,color:"var(--text-primary)"},children:h.name})]},h.name))}),c.jsx("div",{className:"settings-actions",children:c.jsx(Vt,{to:"/settings?tab=integrations",style:{textDecoration:"none"},children:c.jsx("button",{children:"Add more in Settings"})})})]})]})]})]})}const $v=5e3;function Wv({twilioRunning:u}){const[o,f]=S.useState(""),[r,y]=S.useState(""),[g,x]=S.useState(""),[C,h]=S.useState(!1),[d,v]=S.useState({running:!1,url:null}),[p,E]=S.useState(!1),[z,N]=S.useState(""),[_,O]=S.useState(null),[B,H]=S.useState(!1),G=S.useCallback(()=>{ve("/api/auth").then(O).catch(()=>O(null))},[]);S.useEffect(()=>{ve("/api/settings").then(V=>{f(V.MAX_CONCURRENT_SESSIONS||""),y(V.USER_PHONE_NUMBER||"")}).catch(()=>x("Error loading settings")),G()},[G]),S.useEffect(()=>{const V=()=>{ve("/api/tunnel/status").then(v).catch(()=>{})};V();const K=setInterval(V,$v);return()=>clearInterval(K)},[]);const I=S.useCallback(async()=>{h(!0),x("Saving...");try{await tt("/api/settings",{MAX_CONCURRENT_SESSIONS:o,USER_PHONE_NUMBER:r}),x("Saved!"),setTimeout(()=>x(V=>V==="Saved!"?"":V),2e3)}catch{x("Error saving settings")}h(!1)},[o,r]),P=S.useCallback(async()=>{E(!0),N("");try{d.running?await tt("/api/tunnel/stop"):await tt("/api/tunnel/start");const V=await ve("/api/tunnel/status");v(V)}catch(V){const K=V instanceof Error?V.message:V?.message||"Failed";N(K),setTimeout(()=>N(""),5e3)}finally{E(!1)}},[d.running]);return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"page-header",style:{borderBottom:"none",padding:0,marginBottom:24},children:c.jsxs("div",{children:[c.jsx("h1",{children:"General Settings"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginTop:4},children:"Manage your workspace settings and core behavior."})]})}),c.jsxs("div",{className:"settings-panel",children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Authentication"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:20},children:"Claude Code authentication status for this server."}),_===null&&c.jsx("div",{style:{fontSize:13,color:"var(--text-secondary)"},children:"Checking..."}),_&&!_.authenticated&&c.jsxs("div",{children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"#d73a49",flexShrink:0}}),c.jsx("span",{style:{fontSize:14,fontWeight:500,color:"var(--text-primary)"},children:"Not authenticated"})]}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:16},children:"Claude Code is not logged in. Sign in to enable voice sessions."}),c.jsx("button",{onClick:()=>H(!0),children:"Sign in"})]}),_&&_.authenticated&&c.jsxs("div",{children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"#22c55e",flexShrink:0}}),c.jsxs("span",{style:{fontSize:14,fontWeight:500,color:"var(--text-primary)"},children:["Authenticated",_.authMethod==="claude.ai"&&c.jsx("span",{style:{fontSize:11,fontWeight:600,color:"var(--accent-color)",background:"color-mix(in srgb, var(--accent-color) 12%, transparent)",padding:"2px 6px",borderRadius:4,marginLeft:8},children:"Claude.ai OAuth"}),_.authMethod!=="claude.ai"&&_.authMethod!=="none"&&c.jsx("span",{style:{fontSize:11,fontWeight:600,color:"var(--text-secondary)",background:"color-mix(in srgb, var(--text-secondary) 12%, transparent)",padding:"2px 6px",borderRadius:4,marginLeft:8},children:_.authMethod})]})]}),_.email&&c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:8},children:_.email}),_.authMethod!=="claude.ai"&&c.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",background:"color-mix(in srgb, var(--warning-color, #f59e0b) 8%, transparent)",border:"1px solid color-mix(in srgb, var(--warning-color, #f59e0b) 20%, transparent)",padding:"8px 12px",borderRadius:6,marginTop:8,lineHeight:1.5},children:["Authenticated via token. Cloud MCP servers (Gmail, Google Calendar, Slack, etc.) are not available with this method."," ",c.jsx("button",{onClick:()=>H(!0),style:{background:"none",border:"none",color:"var(--accent-color)",cursor:"pointer",padding:0,fontSize:12,fontWeight:600,textDecoration:"underline"},children:"Switch to Claude.ai login"})]})]})]}),B&&c.jsx(cm,{onClose:()=>H(!1),onAuthenticated:()=>{H(!1),G()}}),c.jsxs("div",{className:"settings-panel",children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Public Tunnel"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:20},children:"Exposes your voice server via a Cloudflare tunnel. Required if you want to access VoiceCC on a remote server, and/or want to make use of phone calling."}),c.jsx("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:12},children:c.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:p?"wait":"pointer"},children:[c.jsx("input",{type:"checkbox",checked:d.running,disabled:p,onChange:P,style:{width:16,height:16,cursor:p?"wait":"pointer"}}),c.jsx("span",{style:{fontSize:14,fontWeight:500,color:"var(--text-primary)"},children:p?d.running?"Stopping...":"Starting...":d.running?"Enabled":"Disabled"})]})}),d.running&&d.url&&c.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)"},children:["URL: ",c.jsx("code",{style:{userSelect:"all",cursor:"text"},children:d.url})]}),z&&c.jsx("div",{style:{color:"#d73a49",marginTop:8,fontSize:12},children:z})]}),c.jsxs("div",{className:"settings-panel",children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"General Options"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:20},children:"Configure the core behavior of your voice assistant instance."}),c.jsxs("div",{className:"settings-row",children:[c.jsx("label",{htmlFor:"setting-max-sessions",style:{fontWeight:500,color:"var(--text-primary)"},children:"Max Concurrent Sessions"}),c.jsx("input",{type:"text",id:"setting-max-sessions",placeholder:"2",value:o,onChange:V=>f(V.target.value)})]}),c.jsxs("div",{className:"settings-row",children:[c.jsx("label",{htmlFor:"setting-user-phone",style:{fontWeight:500,color:"var(--text-primary)"},children:"Your Phone Number"}),c.jsx("input",{type:"text",id:"setting-user-phone",placeholder:"+15551234567",value:r,onChange:V=>y(V.target.value)})]}),c.jsxs("div",{className:"settings-actions",style:{marginTop:20},children:[c.jsx("button",{disabled:C,onClick:I,children:"Save changes"}),c.jsx("span",{className:"settings-status",children:g})]})]})]})}const sm="JBFqnCBsd6RMkjVDRZzb",rm="eleven_turbo_v2_5",om="scribe_v1";async function Fv(){return ve("/api/providers/tts")}async function Iv(){return ve("/api/providers/stt")}async function Pv(){return ve("/api/settings")}function e0({status:u}){let o,f,r;return u.ready?(o="Ready",f="rgba(34, 197, 94, 0.15)",r="#22c55e"):u.reason==="missing_api_key"?(o="Missing API Key",f="rgba(239, 68, 68, 0.15)",r="#ef4444"):(o="Unknown",f="rgba(156, 163, 175, 0.15)",r="#9ca3af"),c.jsx("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:600,background:f,color:r},children:o})}function Oh({provider:u,selected:o,onSelect:f,onAction:r,actionLabel:y,actionDisabled:g}){const x=!u.status.ready;return c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 12px",border:o?"1px solid var(--btn-primary-bg)":"1px solid var(--border-color)",borderRadius:"4px",background:o?"rgba(59, 130, 246, 0.05)":"var(--bg-main)",cursor:x?"default":"pointer",transition:"all 0.15s ease"},onClick:x?void 0:f,children:[c.jsx("input",{type:"radio",checked:o,disabled:x,onChange:x?void 0:f,style:{margin:0,cursor:x?"default":"pointer"}}),c.jsxs("div",{style:{flex:1,minWidth:0},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[c.jsx("span",{style:{fontSize:"13px",fontWeight:600,color:"var(--text-primary)"},children:u.name}),c.jsx(e0,{status:u.status})]}),c.jsx("div",{style:{fontSize:"12px",color:"var(--text-secondary)",marginTop:"2px"},children:u.description})]}),r&&y&&c.jsx("button",{disabled:g,onClick:C=>{C.stopPropagation(),r()},style:{padding:"4px 12px",fontSize:"12px",background:"var(--btn-primary-bg)",color:"var(--btn-primary-text)",border:"none",borderRadius:"4px",cursor:g?"default":"pointer",opacity:g?.6:1},children:y})]})}const Vn={marginBottom:14},Xn={display:"block",fontSize:12,fontWeight:500,color:"var(--text-primary)",marginBottom:4},kn={width:"100%",boxSizing:"border-box"},fm={display:"flex",justifyContent:"flex-end",gap:8,marginTop:8},dm={padding:"6px 16px",fontSize:"13px",background:"var(--bg-main)",color:"var(--text-primary)",border:"1px solid var(--border-color)",borderRadius:"4px",cursor:"pointer"},hm={padding:"6px 16px",fontSize:"13px",background:"var(--btn-primary-bg)",color:"var(--btn-primary-text)",border:"none",borderRadius:"4px",cursor:"pointer"};function t0({apiKey:u,voiceId:o,modelId:f,onSave:r,onClose:y}){const[g,x]=S.useState(u),[C,h]=S.useState(o),[d,v]=S.useState(f),p=()=>{r({apiKey:g,voiceId:C,modelId:d}),y()};return c.jsx("div",{className:"modal-overlay visible",onClick:E=>{E.target===E.currentTarget&&y()},children:c.jsxs("div",{className:"modal",style:{width:480},children:[c.jsx("button",{className:"modal-close",onClick:y,children:"×"}),c.jsx("h2",{children:"ElevenLabs TTS"}),c.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:16},children:"Configure API key, voice, and model for ElevenLabs text-to-speech."}),c.jsxs("div",{style:Vn,children:[c.jsx("label",{style:Xn,children:"API Key"}),c.jsx("input",{type:"password",value:g,onChange:E=>x(E.target.value),placeholder:"Enter your ElevenLabs API key",style:kn})]}),c.jsxs("div",{style:Vn,children:[c.jsx("label",{style:Xn,children:"Voice ID"}),c.jsx("input",{type:"text",value:C,onChange:E=>h(E.target.value),placeholder:sm,style:kn})]}),c.jsxs("div",{style:Vn,children:[c.jsx("label",{style:Xn,children:"TTS Model ID"}),c.jsx("input",{type:"text",value:d,onChange:E=>v(E.target.value),placeholder:rm,style:kn})]}),c.jsxs("div",{style:fm,children:[c.jsx("button",{onClick:y,style:dm,children:"Cancel"}),c.jsx("button",{onClick:p,style:hm,children:"Apply"})]})]})})}function l0({apiKey:u,sttModelId:o,onSave:f,onClose:r}){const[y,g]=S.useState(u),[x,C]=S.useState(o),h=()=>{f({apiKey:y,sttModelId:x}),r()};return c.jsx("div",{className:"modal-overlay visible",onClick:d=>{d.target===d.currentTarget&&r()},children:c.jsxs("div",{className:"modal",style:{width:480},children:[c.jsx("button",{className:"modal-close",onClick:r,children:"×"}),c.jsx("h2",{children:"ElevenLabs STT"}),c.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:16},children:"Configure API key and model for ElevenLabs speech-to-text."}),c.jsxs("div",{style:Vn,children:[c.jsx("label",{style:Xn,children:"API Key"}),c.jsx("input",{type:"password",value:y,onChange:d=>g(d.target.value),placeholder:"Enter your ElevenLabs API key",style:kn})]}),c.jsxs("div",{style:Vn,children:[c.jsx("label",{style:Xn,children:"STT Model ID"}),c.jsx("input",{type:"text",value:x,onChange:d=>C(d.target.value),placeholder:om,style:kn})]}),c.jsxs("div",{style:fm,children:[c.jsx("button",{onClick:r,style:dm,children:"Cancel"}),c.jsx("button",{onClick:h,style:hm,children:"Apply"})]})]})})}function a0(){const[u,o]=S.useState([]),[f,r]=S.useState([]),[y,g]=S.useState("elevenlabs"),[x,C]=S.useState("elevenlabs"),[h,d]=S.useState(""),[v,p]=S.useState(sm),[E,z]=S.useState(rm),[N,_]=S.useState(om),[O,B]=S.useState(null),H=S.useCallback(async V=>{try{await tt("/api/settings",V)}catch{}},[]);S.useEffect(()=>{Fv().then(V=>{o(V.providers),g(V.active)}).catch(()=>{}),Iv().then(V=>{r(V.providers),C(V.active)}).catch(()=>{}),Pv().then(V=>{V.ELEVENLABS_API_KEY&&d(V.ELEVENLABS_API_KEY),V.ELEVENLABS_VOICE_ID&&p(V.ELEVENLABS_VOICE_ID),V.ELEVENLABS_MODEL_ID&&z(V.ELEVENLABS_MODEL_ID),V.ELEVENLABS_STT_MODEL_ID&&_(V.ELEVENLABS_STT_MODEL_ID)}).catch(()=>{})},[]);const G=S.useCallback(V=>{g(V),H({TTS_PROVIDER:V})},[H]),I=S.useCallback(V=>{C(V),H({STT_PROVIDER:V})},[H]),P=(V,K,k)=>{const X=k==="tts"?"elevenlabs-tts":"elevenlabs-stt";return{label:"Configure",onAction:()=>B({kind:X})}};return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"page-header",style:{borderBottom:"none",padding:0,marginBottom:24},children:c.jsxs("div",{children:[c.jsx("h1",{children:"Voice Providers"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginTop:4},children:"Select and configure TTS and STT providers. Changes take effect on the next voice session."})]})}),c.jsxs("div",{className:"settings-panel",style:{marginBottom:24},children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"TTS Provider"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:16},children:"Choose which text-to-speech engine to use."}),c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:u.map(V=>{const K=P(V.type,V.status,"tts");return c.jsx(Oh,{provider:V,selected:y===V.type,onSelect:()=>G(V.type),onAction:K.onAction,actionLabel:K.label},V.type)})})]}),c.jsxs("div",{className:"settings-panel",style:{marginBottom:24},children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"STT Provider"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:16},children:"Choose which speech-to-text engine to use."}),c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:f.map(V=>{const K=P(V.type,V.status,"stt");return c.jsx(Oh,{provider:V,selected:x===V.type,onSelect:()=>I(V.type),onAction:K.onAction,actionLabel:K.label},V.type)})})]}),O?.kind==="elevenlabs-tts"&&c.jsx(t0,{apiKey:h,voiceId:v,modelId:E,onSave:V=>{d(V.apiKey),p(V.voiceId),z(V.modelId),H({ELEVENLABS_API_KEY:V.apiKey,ELEVENLABS_VOICE_ID:V.voiceId,ELEVENLABS_MODEL_ID:V.modelId})},onClose:()=>B(null)}),O?.kind==="elevenlabs-stt"&&c.jsx(l0,{apiKey:h,sttModelId:N,onSave:V=>{d(V.apiKey),_(V.sttModelId),H({ELEVENLABS_API_KEY:V.apiKey,ELEVENLABS_STT_MODEL_ID:V.sttModelId})},onClose:()=>B(null)})]})}function n0({onClose:u}){const[o,f]=S.useState(""),[r,y]=S.useState(""),[g,x]=S.useState(null),[C,h]=S.useState([]),[d,v]=S.useState(""),[p,E]=S.useState(!1),[z,N]=S.useState(!1),[_,O]=S.useState(""),[B,H]=S.useState("");S.useEffect(()=>{ve("/api/settings").then($=>{$.TWILIO_ACCOUNT_SID&&f($.TWILIO_ACCOUNT_SID),$.TWILIO_AUTH_TOKEN&&y($.TWILIO_AUTH_TOKEN)}).catch(()=>{}),ve("/api/integrations").then($=>E($.twilio.enabled)).catch(()=>{}),G();const X=setInterval(G,5e3);return()=>clearInterval(X)},[]),S.useEffect(()=>{o&&r&&ve("/api/twilio/phone-numbers").then(X=>h(X.numbers||[])).catch(()=>{})},[o,r]);const G=()=>{ve("/api/twilio/status").then(x).catch(()=>{})},I=S.useCallback(async(X,$)=>{try{return await tt("/api/settings",{[X]:$}),!0}catch{return!1}},[]),P=S.useCallback(async()=>{const X=!p;N(!0);try{await tt("/api/integrations/twilio",{enabled:X}),E(X),G()}catch($){const ae=$ instanceof Error?$.message:$?.message||"Failed";v(ae),setTimeout(()=>v(""),4e3)}finally{N(!1)}},[p]),V=X=>{X.target===X.currentTarget&&u()},K=g?.running??!1,k=g?.tunnelUrl?`${g.tunnelUrl}/twilio/incoming-call`:null;return c.jsx("div",{className:"modal-overlay visible",onClick:V,children:c.jsxs("div",{className:"modal",children:[c.jsx("button",{className:"modal-close",onClick:u,children:"×"}),c.jsx("h2",{children:"Twilio Voice Setup"}),c.jsxs("div",{className:"setup-step",children:[c.jsxs("div",{className:"setup-step-title",children:[c.jsx("span",{className:"setup-step-number",children:"1"}),"Create a Twilio account"]}),c.jsxs("div",{className:"setup-step-desc",children:["Sign up at ",c.jsx("a",{href:"https://www.twilio.com/try-twilio",target:"_blank",rel:"noreferrer",children:"twilio.com/try-twilio"}),". Copy your Account SID and Auth Token from the console dashboard."]}),c.jsxs("div",{className:"setup-paste-row",children:[c.jsx("input",{type:"text",placeholder:"Account SID (ACxxxxxxxx...)",value:o,onChange:X=>f(X.target.value)}),c.jsx(Dh,{onClick:()=>I("TWILIO_ACCOUNT_SID",o.trim())})]}),c.jsxs("div",{className:"setup-paste-row",children:[c.jsx("input",{type:"text",placeholder:"Auth Token",value:r,onChange:X=>y(X.target.value)}),c.jsx(Dh,{onClick:()=>I("TWILIO_AUTH_TOKEN",r.trim())})]})]}),c.jsxs("div",{className:"setup-step",children:[c.jsxs("div",{className:"setup-step-title",children:[c.jsx("span",{className:"setup-step-number",children:"2"}),"Get a phone number"]}),c.jsxs("div",{className:"setup-step-desc",children:["In the Twilio console, go to ",c.jsx("strong",{children:"Phone Numbers"})," → ",c.jsx("strong",{children:"Buy a Number"}),". Pick any number with voice capability."]})]}),c.jsx("hr",{className:"setup-divider"}),c.jsxs("div",{className:"setup-step",children:[c.jsxs("div",{className:"setup-step-title",children:[c.jsx("span",{className:"setup-step-number",children:"3"}),K?"Server running":"Enable integration"]}),c.jsxs("div",{className:"setup-step-desc",children:[K?c.jsxs(c.Fragment,{children:["Server is running.",g?.tunnelUrl&&c.jsxs(c.Fragment,{children:[" Tunnel URL: ",c.jsx("code",{children:g.tunnelUrl})]})]}):"Enable to start the Twilio server and auto-start on boot.",d&&c.jsx("div",{style:{color:"#d73a49",marginTop:4,fontSize:12},children:d})]}),c.jsx("div",{className:"setup-paste-row",children:c.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:z?"wait":"pointer"},children:[c.jsx("input",{type:"checkbox",checked:p,disabled:z,onChange:P,style:{width:16,height:16,cursor:z?"wait":"pointer"}}),c.jsx("span",{style:{fontSize:14,fontWeight:500,color:"var(--text-primary)"},children:z?p?"Stopping...":"Starting...":"Enabled"})]})})]}),c.jsxs("div",{className:"setup-step",children:[c.jsxs("div",{className:"setup-step-title",children:[c.jsx("span",{className:"setup-step-number",children:"4"}),"Configure the Twilio webhook"]}),c.jsx("div",{className:"setup-step-desc",children:k?c.jsxs(c.Fragment,{children:["In the Twilio console, go to your phone number's configuration.",c.jsx("br",{}),"Under ",c.jsx("strong",{children:"Voice & Fax"})," → ",c.jsx("strong",{children:"A Call Comes In"}),", set:",c.jsx("br",{}),c.jsx("code",{style:{userSelect:"all",cursor:"text"},children:k}),c.jsx("br",{}),"Method: ",c.jsx("strong",{children:"HTTP POST"})]}):"Start the server first, then the webhook URL will appear here."})]}),c.jsx("hr",{className:"setup-divider"}),c.jsxs("div",{className:"setup-step",children:[c.jsxs("div",{className:"setup-step-title",children:[c.jsx("span",{className:"setup-step-number",children:"5"}),"Your phone number"]}),c.jsx("div",{className:"setup-step-desc",children:C.length>0?c.jsxs(c.Fragment,{children:["Call this number to talk to Claude:",c.jsx("br",{}),C.map(X=>c.jsx("strong",{style:{color:"#d4d4d4",fontSize:16,fontFamily:"SF Mono, Fira Code, monospace",display:"inline-block",marginTop:4},children:X.phoneNumber},X.phoneNumber))]}):o&&r?"Fetching phone number...":"Set your Account SID and Auth Token to fetch your phone number."})]}),c.jsx("hr",{className:"setup-divider"}),c.jsxs("div",{className:"setup-step",children:[c.jsxs("div",{className:"setup-step-title",children:[c.jsx("span",{className:"setup-step-number",children:"6"}),"Test your setup"]}),c.jsxs("div",{className:"setup-step-desc",children:["Enter your phone number and we'll call you with a test message.",B&&c.jsx("div",{style:{color:B.startsWith("Error")?"#d73a49":"#2ea043",marginTop:4,fontSize:12},children:B})]}),c.jsxs("div",{className:"setup-paste-row",children:[c.jsx("input",{type:"tel",placeholder:"+1234567890",value:_,onChange:X=>O(X.target.value)}),c.jsx("button",{disabled:!_.trim()||!o||!r||B==="Calling...",onClick:async()=>{H("Calling...");try{await tt("/api/twilio/test-call",{to:_.trim()}),H("Call initiated! Check your phone.")}catch(X){const $=X instanceof Error?X.message:X?.message||"Failed";H(`Error: ${$}`)}setTimeout(()=>H(""),6e3)},children:"Test Call"})]})]})]})})}function Dh({onClick:u}){const[o,f]=S.useState("Apply"),[r,y]=S.useState(!1),g=async()=>{f("Saving...");const x=await u();f(x?"Saved":"Error"),y(x),setTimeout(()=>{f("Apply"),y(!1)},1500)};return c.jsx("button",{className:r?"applied":"",onClick:g,children:o})}const i0=5e3;function u0({onClose:u}){const[o,f]=S.useState(null),[r,y]=S.useState(""),[g,x]=S.useState(!1),[C,h]=S.useState(!1);S.useEffect(()=>{ve("/api/integrations").then(_=>x(_.browserCall.enabled)).catch(()=>{}),d();const N=setInterval(d,i0);return()=>clearInterval(N)},[]);const d=()=>{ve("/api/browser-call/status").then(f).catch(()=>{})},v=S.useCallback(async()=>{const N=!g;h(!0);try{await tt("/api/integrations/browser-call",{enabled:N}),x(N),d()}catch(_){const O=_ instanceof Error?_.message:_?.message||"Failed";y(O),setTimeout(()=>y(""),4e3)}finally{h(!1)}},[g]),p=N=>{N.target===N.currentTarget&&u()},E=o?.running??!1,z=o?.tunnelUrl?`${o.tunnelUrl}/call`:null;return c.jsx("div",{className:"modal-overlay visible",onClick:p,children:c.jsxs("div",{className:"modal",children:[c.jsx("button",{className:"modal-close",onClick:u,children:"×"}),c.jsx("h2",{children:"Browser Call from Anywhere"}),c.jsxs("div",{className:"setup-step",children:[c.jsxs("div",{className:"setup-step-title",children:[c.jsx("span",{className:"setup-step-number",children:"1"}),E?"Server running":"Enable integration"]}),c.jsxs("div",{className:"setup-step-desc",children:[E?c.jsxs(c.Fragment,{children:["Server is running.",o?.tunnelUrl&&c.jsxs(c.Fragment,{children:[" Tunnel URL: ",c.jsx("code",{children:o.tunnelUrl})]})]}):"Enable to start the browser call server and auto-start on boot.",r&&c.jsx("div",{style:{color:"#d73a49",marginTop:4,fontSize:12},children:r})]}),c.jsx("div",{className:"setup-paste-row",children:c.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:C?"wait":"pointer"},children:[c.jsx("input",{type:"checkbox",checked:g,disabled:C,onChange:v,style:{width:16,height:16,cursor:C?"wait":"pointer"}}),c.jsx("span",{style:{fontSize:14,fontWeight:500,color:"var(--text-primary)"},children:C?g?"Stopping...":"Starting...":"Enabled"})]})})]}),c.jsx("hr",{className:"setup-divider"}),c.jsxs("div",{className:"setup-step",children:[c.jsxs("div",{className:"setup-step-title",children:[c.jsx("span",{className:"setup-step-number",children:"2"}),"Call from any device"]}),c.jsx("div",{className:"setup-step-desc",children:z?c.jsxs(c.Fragment,{children:["Open this URL on any device to start a voice call:",c.jsx("br",{}),c.jsx("a",{href:z,target:"_blank",rel:"noreferrer",style:{wordBreak:"break-all"},children:z}),c.jsx("br",{}),"Or use the ",c.jsx("strong",{children:"Call via Browser"})," button in the sidebar to get a QR code."]}):"Start the server first (step 2), then the call page URL will appear here."})]})]})})}const c0=[{name:"notion",description:"Connect to Notion workspaces, pages, and databases.",url:"https://mcp.notion.com/mcp",transport:"http"},{name:"figma",description:"Read Figma designs, components, and design tokens.",url:"https://mcp.figma.com/mcp",transport:"http"},{name:"sentry",description:"Access Sentry issues, events, and project data.",url:"https://mcp.sentry.dev/mcp",transport:"http"},{name:"context7",description:"Fetch up-to-date library docs and code examples.",url:"https://mcp.context7.com/mcp",transport:"http"},{name:"langfuse",description:"Search Langfuse documentation and API references.",url:"https://langfuse.com/api/mcp",transport:"http"},{name:"slack",description:"Send messages, create canvases, and fetch Slack data.",url:"https://mcp.slack.com/mcp",transport:"http"},{name:"atlassian",description:"Access Jira & Confluence from Claude.",url:"https://mcp.atlassian.com/v1/mcp",transport:"http"},{name:"linear",description:"Manage issues, projects & team workflows in Linear.",url:"https://mcp.linear.app/mcp",transport:"http"},{name:"gamma",description:"Create presentations, docs, socials, and sites with AI.",url:"https://mcp.gamma.app/mcp",transport:"http"},{name:"granola",description:"The AI notepad for meetings.",url:"https://mcp.granola.ai/mcp",transport:"http"}];function mm({message:u,onDismiss:o,timeout:f=4e3}){return S.useEffect(()=>{if(!u)return;const r=setTimeout(o,f);return()=>clearTimeout(r)},[u,o,f]),u?c.jsxs("div",{className:"toast",children:[c.jsx("span",{children:u}),c.jsx("button",{className:"toast-close",onClick:o,children:"×"})]}):null}function s0({servers:u,onClose:o,onAdded:f}){const[r,y]=S.useState(null),[g,x]=S.useState(null),C=u===null,h=p=>u?.find(E=>E.url===p),d=p=>{p.target===p.currentTarget&&o()},v=async p=>{y(p.name);try{await tt("/api/mcp-servers/add",{name:p.name,url:p.url,transport:p.transport,scope:"user"}),await f()}catch(E){const z=E?.message||"Failed to add server";x(z)}y(null)};return c.jsxs("div",{className:"modal-overlay visible",onClick:d,children:[c.jsxs("div",{className:"modal",style:{width:620},children:[c.jsx("button",{className:"modal-close",onClick:o,children:"×"}),c.jsx("h2",{children:"Add MCP Server"}),c.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:16},children:"Select a server to add. Authentication is handled automatically via your browser."}),c.jsx("div",{className:"mcp-add-grid",children:c0.map(p=>{const E=h(p.url),z=E?.status==="needs_auth",N=E?.status==="connected",_=r===p.name;return c.jsxs("div",{className:`mcp-add-card${N?" installed":""}`,children:[c.jsxs("div",{className:"mcp-add-card-header",children:[c.jsx("span",{className:"mcp-add-card-name",children:p.name}),N&&c.jsx("span",{className:"mcp-add-card-badge",children:"Installed"}),z&&c.jsx("span",{className:"mcp-add-card-badge needs-auth",children:"Needs authentication"})]}),c.jsx("p",{className:"mcp-add-card-desc",children:p.description}),c.jsxs("div",{className:"mcp-add-card-footer",children:[c.jsx("span",{className:"mcp-add-card-url",children:p.url}),C?c.jsx("span",{style:{fontSize:11,color:"var(--text-secondary)"},children:"Loading..."}):!E&&c.jsx("button",{className:"mcp-add-card-btn",disabled:_,onClick:()=>v(p),children:_?"Adding...":"Add"})]})]},p.url)})})]}),c.jsx(mm,{message:g,onDismiss:()=>x(null)})]})}function r0({twilioRunning:u,browserCallRunning:o}){const[f,r]=S.useState(null),[y,g]=S.useState(!1),[x,C]=S.useState(!1),[h,d]=S.useState(!1),[v,p]=S.useState(!1),[E,z]=S.useState(null),N=S.useCallback(async()=>{try{const B=await ve("/api/mcp-servers");r(B.servers)}catch{g(!0)}},[]);S.useEffect(()=>{N()},[N]);const _=B=>B==="connected"?"connected":B==="needs_auth"?"needs-auth":"failed",O=B=>B==="connected"?"Connected":B==="needs_auth"?"Needs auth":"Failed";return c.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[c.jsx("div",{className:"page-header",style:{borderBottom:"none",padding:0,marginBottom:24},children:c.jsxs("div",{children:[c.jsx("h1",{children:"Integrations & MCP"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginTop:4},children:"Connect external services and configure MCP servers."})]})}),c.jsxs("div",{className:"integrations-panel",children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Integrations"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:20},children:"Connect external services to enable voice calling capabilities."}),c.jsxs("div",{style:{display:"flex",gap:12},children:[c.jsxs("button",{className:"btn-integration",onClick:()=>C(!0),children:[c.jsx("span",{className:`integration-dot${u?" running":""}`}),"Twilio"]}),c.jsxs("button",{className:"btn-integration",onClick:()=>d(!0),children:[c.jsx("span",{className:`integration-dot${o?" running":""}`}),"Browser Call from Anywhere"]})]})]}),c.jsxs("div",{className:"mcp-panel",children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:4},children:[c.jsxs("div",{children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"MCP Servers"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:20},children:"Configure Model Context Protocol servers to provide external tools to Claude."})]}),c.jsx("button",{className:"mcp-add-btn",onClick:()=>p(!0),children:"+ Add MCP Server"})]}),c.jsxs("div",{className:"mcp-server-list",children:[!f&&!y&&c.jsx("div",{className:"mcp-loading",children:"Loading..."}),y&&c.jsx("div",{className:"mcp-error",children:"Failed to load MCP servers."}),f&&f.length===0&&c.jsx("div",{className:"mcp-loading",style:{color:"var(--text-secondary)",fontSize:13},children:"No MCP servers configured."}),f?.map(B=>{const H=B.scope==="user";return c.jsxs("div",{className:"mcp-server-row",children:[c.jsx("span",{className:`mcp-dot ${_(B.status)}`}),c.jsx("span",{className:"mcp-server-name",children:B.name}),c.jsx("span",{className:"mcp-server-url",title:B.url,children:B.url}),c.jsx("span",{className:"mcp-server-badge",children:B.type.toUpperCase()}),c.jsx("span",{className:`mcp-server-status ${_(B.status)}`,children:O(B.status)}),c.jsxs("span",{className:"mcp-delete-wrap",children:[c.jsx("button",{className:`mcp-delete-btn${H?" disabled":""}`,onClick:()=>{H||um(`/api/mcp-servers/${B.name}`).then(N).catch(G=>{z(G?.message||"Failed to remove server")})},children:"×"}),c.jsx("span",{className:"mcp-delete-tooltip",children:H?"Globally installed, please delete through Claude Code":`Remove ${B.name}`})]})]},B.name)})]})]}),x&&c.jsx(n0,{onClose:()=>C(!1)}),h&&c.jsx(u0,{onClose:()=>d(!1)}),v&&c.jsx(s0,{servers:f,onClose:()=>p(!1),onAdded:N}),c.jsx(mm,{message:E,onDismiss:()=>z(null)})]})}function o0(){const[u,o]=S.useState(""),[f,r]=S.useState(!1),[y,g]=S.useState(""),[x,C]=S.useState(null),h=S.useRef(null);S.useEffect(()=>{ve("/api/claude-md").then(E=>o(E.content)).catch(()=>g("Error loading file")),ve("/api/status").then(E=>{E.userClaudeMdExists&&C(`A user-level ${E.userClaudeMdPath} was detected. Its instructions will also apply and may interfere with this project config.`)}).catch(()=>{})},[]);const d=S.useCallback(async()=>{g("Saving...");try{await tt("/api/claude-md",{content:u}),r(!1),g("Saved"),setTimeout(()=>g(E=>E==="Saved"?"":E),2e3)}catch{g("Error saving")}},[u]);S.useEffect(()=>{const E=z=>{(z.metaKey||z.ctrlKey)&&z.key==="s"&&(z.preventDefault(),f&&d())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[f,d]);const v=E=>{o(E.target.value),r(!0),g("Modified")},p=E=>{if(E.key==="Tab"){E.preventDefault();const z=h.current;if(!z)return;const N=z.selectionStart,_=z.selectionEnd,O=u.substring(0,N)+" "+u.substring(_);o(O),r(!0),g("Modified"),requestAnimationFrame(()=>{z.selectionStart=z.selectionEnd=N+2})}};return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"page-header",style:{borderBottom:"none",padding:0,marginBottom:24},children:c.jsxs("div",{children:[c.jsx("h1",{children:"System Prompt"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginTop:4},children:"Configure global system instructions for Claude."})]})}),c.jsxs("div",{className:"settings-panel",style:{flex:1,display:"flex",flexDirection:"column",marginBottom:32},children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:16},children:[c.jsxs("div",{children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Global Instructions"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)"},children:"Edit the CLAUDE.md file to provide custom instructions."})]}),c.jsxs("div",{className:"toolbar",children:[c.jsx("span",{id:"status",style:{fontSize:12,color:"var(--text-secondary)",marginRight:8},children:y}),c.jsx("button",{disabled:!f,onClick:d,style:{background:"var(--btn-primary-bg)",color:"var(--btn-primary-text)",border:"none",padding:"6px 14px",borderRadius:"6px",fontSize:"13px",fontWeight:500,cursor:f?"pointer":"not-allowed",opacity:f?1:.5},children:"Save"})]})]}),x&&c.jsx("div",{className:"warning visible",style:{borderRadius:0,marginBottom:16,border:"1px solid #665500",background:"#fff8c5"},children:x}),c.jsx("textarea",{ref:h,id:"editor",spellCheck:!1,placeholder:"Loading...",value:u,onChange:v,onKeyDown:p,style:{flex:1,minHeight:"300px",border:"1px solid var(--border-color)",borderRadius:"8px",background:"var(--bg-main)",padding:"16px",color:"var(--text-primary)"}})]})]})}function f0(){const[u]=Bv(),o=u.get("tab"),[f,r]=S.useState(o==="voice"||o==="integrations"||o==="system"?o:"general"),[y,g]=S.useState({running:!1,url:null}),[x,C]=S.useState({running:!1,tunnelUrl:null}),[h,d]=S.useState({running:!1,tunnelUrl:null});S.useEffect(()=>{const p=()=>{ve("/api/tunnel/status").then(g).catch(()=>{}),ve("/api/twilio/status").then(C).catch(()=>{}),ve("/api/browser-call/status").then(d).catch(()=>{})};p();const E=setInterval(p,5e3);return()=>clearInterval(E)},[]);const v=p=>({padding:"6px 14px",background:f===p?"var(--btn-primary-bg)":"var(--bg-main)",border:"1px solid "+(f===p?"transparent":"var(--border-color)"),borderRadius:"0",color:f===p?"var(--btn-primary-text)":"var(--text-primary)",fontWeight:500,cursor:"pointer",fontSize:"13px",transition:"all 0.1s ease"});return c.jsxs("div",{className:"page active",style:{display:"flex",flexDirection:"column",padding:0},children:[c.jsxs("div",{style:{display:"flex",gap:"8px",padding:"24px 32px 16px",borderBottom:"1px solid var(--border-color)",flexShrink:0},children:[c.jsx("button",{style:v("general"),onClick:()=>r("general"),children:"General"}),c.jsx("button",{style:v("voice"),onClick:()=>r("voice"),children:"Voice"}),c.jsx("button",{style:v("integrations"),onClick:()=>r("integrations"),children:"Integrations & MCP"}),c.jsx("button",{style:v("system"),onClick:()=>r("system"),children:"System Prompt"})]}),c.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"48px 64px"},children:[f==="general"&&c.jsx(Wv,{twilioRunning:x.running}),f==="voice"&&c.jsx(a0,{}),f==="integrations"&&c.jsx(r0,{twilioRunning:x.running,browserCallRunning:h.running}),f==="system"&&c.jsx(o0,{})]})]})}const Is={id:""};function d0(){const u=bu(),[o,f]=S.useState([]),[r,y]=S.useState(!1),[g,x]=S.useState(Is),[C,h]=S.useState(!1),[d,v]=S.useState(null),[p,E]=S.useState(!1);S.useEffect(()=>{ve("/api/agents").then(f).catch(()=>{})},[]);const z=async()=>{v(null),h(!0);try{await tt("/api/agents",{id:g.id});const O=await ve("/api/agents");f(O),x(Is),y(!1)}catch(O){const B=O?.message||"Failed to create agent";v(B)}finally{h(!1)}},N=()=>{x(Is),y(!1),v(null)},_=async O=>{const B=window.prompt("Enter an ID for the imported agent:",O.name.replace(/\.zip$/i,""));if(B){E(!0),v(null);try{const H=new FormData;H.append("file",O),H.append("id",B);const G=await fetch("/api/agents/import",{method:"POST",body:H});if(!G.ok){const P=await G.json().catch(()=>({error:"Import failed"}));throw new Error(P.error||"Import failed")}const I=await ve("/api/agents");f(I)}catch(H){const G=H?.message||"Failed to import agent";v(G)}finally{E(!1)}}};return c.jsxs("div",{className:"page active",style:{display:"flex",flexDirection:"column",padding:0},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"24px 32px 16px",borderBottom:"1px solid var(--border-color)",flexShrink:0},children:[c.jsx("h2",{style:{margin:0,fontSize:18,fontWeight:600,color:"var(--text-primary)"},children:"Agents"}),!r&&c.jsxs("div",{style:{display:"flex",gap:8},children:[c.jsxs("label",{style:{padding:"6px 14px",background:"var(--bg-main)",color:"var(--text-primary)",border:"1px solid var(--border-color)",borderRadius:0,fontWeight:500,fontSize:13,cursor:p?"not-allowed":"pointer",opacity:p?.6:1},children:[p?"Importing...":"Import",c.jsx("input",{type:"file",accept:".zip",style:{display:"none"},onChange:O=>{const B=O.target.files?.[0];B&&_(B),O.target.value=""},disabled:p})]}),c.jsx("button",{onClick:()=>y(!0),style:{padding:"6px 14px",background:"var(--btn-primary-bg)",color:"var(--btn-primary-text)",border:"none",borderRadius:0,fontWeight:500,fontSize:13,cursor:"pointer"},children:"Create Agent"})]})]}),d&&!r&&c.jsx("div",{style:{margin:"16px 32px 0",padding:"8px 10px",fontSize:12,color:"#d73a49",background:"var(--bg-tertiary)",borderRadius:6,border:"1px solid #d73a49"},children:d}),c.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"48px 64px"},children:[r&&c.jsxs("div",{className:"settings-panel",style:{marginBottom:24,padding:20},children:[c.jsx("h3",{style:{margin:"0 0 16px",fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:"New Agent"}),d&&c.jsx("div",{style:{marginBottom:12,padding:"8px 10px",fontSize:12,color:"#d73a49",background:"var(--bg-tertiary)",borderRadius:6,border:"1px solid #d73a49"},children:d}),c.jsxs("div",{style:{marginBottom:16},children:[c.jsx("label",{style:{display:"block",marginBottom:4,fontSize:13,fontWeight:500,color:"var(--text-primary)"},children:"ID"}),c.jsx("input",{type:"text",value:g.id,onChange:O=>x({...g,id:O.target.value}),placeholder:"my-agent",style:{width:"100%",padding:"6px 10px",fontSize:13,background:"var(--bg-main)",color:"var(--text-primary)",border:"1px solid var(--border-color)",borderRadius:0,boxSizing:"border-box"}})]}),c.jsxs("div",{style:{display:"flex",gap:8},children:[c.jsx("button",{onClick:z,disabled:C||!g.id.trim(),style:{padding:"6px 14px",background:"var(--btn-primary-bg)",color:"var(--btn-primary-text)",border:"none",borderRadius:0,fontWeight:500,fontSize:13,cursor:C?"not-allowed":"pointer",opacity:C||!g.id.trim()?.6:1},children:C?"Creating...":"Create"}),c.jsx("button",{onClick:N,style:{padding:"6px 14px",background:"var(--bg-main)",color:"var(--text-primary)",border:"1px solid var(--border-color)",borderRadius:0,fontWeight:500,fontSize:13,cursor:"pointer"},children:"Cancel"})]})]}),c.jsxs("div",{className:"settings-panel",style:{padding:0},children:[o.length===0&&!r&&c.jsx("div",{style:{padding:20,fontSize:13,color:"var(--text-secondary)"},children:'No agents yet. Click "Create Agent" to get started.'}),o.map(O=>c.jsxs("div",{onClick:()=>u(`/agents/${O.id}`),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 20px",borderBottom:"1px solid var(--border-color)",cursor:"pointer",transition:"background 0.1s ease"},onMouseEnter:B=>B.currentTarget.style.background="var(--bg-tertiary)",onMouseLeave:B=>B.currentTarget.style.background="transparent",children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:O.enabled?"#2ea043":"#8b949e",flexShrink:0}}),c.jsx("span",{style:{fontSize:14,fontWeight:500,color:"var(--text-primary)"},children:O.id})]}),c.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)"},children:["every ",O.heartbeatIntervalMinutes,"m"]})]},O.id))]})]})]})}var h0=Object.defineProperty,Su=Object.getOwnPropertySymbols,gm=Object.prototype.hasOwnProperty,ym=Object.prototype.propertyIsEnumerable,wh=(u,o,f)=>o in u?h0(u,o,{enumerable:!0,configurable:!0,writable:!0,value:f}):u[o]=f,ar=(u,o)=>{for(var f in o||(o={}))gm.call(o,f)&&wh(u,f,o[f]);if(Su)for(var f of Su(o))ym.call(o,f)&&wh(u,f,o[f]);return u},nr=(u,o)=>{var f={};for(var r in u)gm.call(u,r)&&o.indexOf(r)<0&&(f[r]=u[r]);if(u!=null&&Su)for(var r of Su(u))o.indexOf(r)<0&&ym.call(u,r)&&(f[r]=u[r]);return f};var aa;(u=>{const o=class he{constructor(h,d,v,p){if(this.version=h,this.errorCorrectionLevel=d,this.modules=[],this.isFunction=[],h<he.MIN_VERSION||h>he.MAX_VERSION)throw new RangeError("Version value out of range");if(p<-1||p>7)throw new RangeError("Mask value out of range");this.size=h*4+17;let E=[];for(let N=0;N<this.size;N++)E.push(!1);for(let N=0;N<this.size;N++)this.modules.push(E.slice()),this.isFunction.push(E.slice());this.drawFunctionPatterns();const z=this.addEccAndInterleave(v);if(this.drawCodewords(z),p==-1){let N=1e9;for(let _=0;_<8;_++){this.applyMask(_),this.drawFormatBits(_);const O=this.getPenaltyScore();O<N&&(p=_,N=O),this.applyMask(_)}}y(0<=p&&p<=7),this.mask=p,this.applyMask(p),this.drawFormatBits(p),this.isFunction=[]}static encodeText(h,d){const v=u.QrSegment.makeSegments(h);return he.encodeSegments(v,d)}static encodeBinary(h,d){const v=u.QrSegment.makeBytes(h);return he.encodeSegments([v],d)}static encodeSegments(h,d,v=1,p=40,E=-1,z=!0){if(!(he.MIN_VERSION<=v&&v<=p&&p<=he.MAX_VERSION)||E<-1||E>7)throw new RangeError("Invalid value");let N,_;for(N=v;;N++){const G=he.getNumDataCodewords(N,d)*8,I=x.getTotalBits(h,N);if(I<=G){_=I;break}if(N>=p)throw new RangeError("Data too long")}for(const G of[he.Ecc.MEDIUM,he.Ecc.QUARTILE,he.Ecc.HIGH])z&&_<=he.getNumDataCodewords(N,G)*8&&(d=G);let O=[];for(const G of h){f(G.mode.modeBits,4,O),f(G.numChars,G.mode.numCharCountBits(N),O);for(const I of G.getData())O.push(I)}y(O.length==_);const B=he.getNumDataCodewords(N,d)*8;y(O.length<=B),f(0,Math.min(4,B-O.length),O),f(0,(8-O.length%8)%8,O),y(O.length%8==0);for(let G=236;O.length<B;G^=253)f(G,8,O);let H=[];for(;H.length*8<O.length;)H.push(0);return O.forEach((G,I)=>H[I>>>3]|=G<<7-(I&7)),new he(N,d,H,E)}getModule(h,d){return 0<=h&&h<this.size&&0<=d&&d<this.size&&this.modules[d][h]}getModules(){return this.modules}drawFunctionPatterns(){for(let v=0;v<this.size;v++)this.setFunctionModule(6,v,v%2==0),this.setFunctionModule(v,6,v%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const h=this.getAlignmentPatternPositions(),d=h.length;for(let v=0;v<d;v++)for(let p=0;p<d;p++)v==0&&p==0||v==0&&p==d-1||v==d-1&&p==0||this.drawAlignmentPattern(h[v],h[p]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(h){const d=this.errorCorrectionLevel.formatBits<<3|h;let v=d;for(let E=0;E<10;E++)v=v<<1^(v>>>9)*1335;const p=(d<<10|v)^21522;y(p>>>15==0);for(let E=0;E<=5;E++)this.setFunctionModule(8,E,r(p,E));this.setFunctionModule(8,7,r(p,6)),this.setFunctionModule(8,8,r(p,7)),this.setFunctionModule(7,8,r(p,8));for(let E=9;E<15;E++)this.setFunctionModule(14-E,8,r(p,E));for(let E=0;E<8;E++)this.setFunctionModule(this.size-1-E,8,r(p,E));for(let E=8;E<15;E++)this.setFunctionModule(8,this.size-15+E,r(p,E));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let h=this.version;for(let v=0;v<12;v++)h=h<<1^(h>>>11)*7973;const d=this.version<<12|h;y(d>>>18==0);for(let v=0;v<18;v++){const p=r(d,v),E=this.size-11+v%3,z=Math.floor(v/3);this.setFunctionModule(E,z,p),this.setFunctionModule(z,E,p)}}drawFinderPattern(h,d){for(let v=-4;v<=4;v++)for(let p=-4;p<=4;p++){const E=Math.max(Math.abs(p),Math.abs(v)),z=h+p,N=d+v;0<=z&&z<this.size&&0<=N&&N<this.size&&this.setFunctionModule(z,N,E!=2&&E!=4)}}drawAlignmentPattern(h,d){for(let v=-2;v<=2;v++)for(let p=-2;p<=2;p++)this.setFunctionModule(h+p,d+v,Math.max(Math.abs(p),Math.abs(v))!=1)}setFunctionModule(h,d,v){this.modules[d][h]=v,this.isFunction[d][h]=!0}addEccAndInterleave(h){const d=this.version,v=this.errorCorrectionLevel;if(h.length!=he.getNumDataCodewords(d,v))throw new RangeError("Invalid argument");const p=he.NUM_ERROR_CORRECTION_BLOCKS[v.ordinal][d],E=he.ECC_CODEWORDS_PER_BLOCK[v.ordinal][d],z=Math.floor(he.getNumRawDataModules(d)/8),N=p-z%p,_=Math.floor(z/p);let O=[];const B=he.reedSolomonComputeDivisor(E);for(let G=0,I=0;G<p;G++){let P=h.slice(I,I+_-E+(G<N?0:1));I+=P.length;const V=he.reedSolomonComputeRemainder(P,B);G<N&&P.push(0),O.push(P.concat(V))}let H=[];for(let G=0;G<O[0].length;G++)O.forEach((I,P)=>{(G!=_-E||P>=N)&&H.push(I[G])});return y(H.length==z),H}drawCodewords(h){if(h.length!=Math.floor(he.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let d=0;for(let v=this.size-1;v>=1;v-=2){v==6&&(v=5);for(let p=0;p<this.size;p++)for(let E=0;E<2;E++){const z=v-E,_=(v+1&2)==0?this.size-1-p:p;!this.isFunction[_][z]&&d<h.length*8&&(this.modules[_][z]=r(h[d>>>3],7-(d&7)),d++)}}y(d==h.length*8)}applyMask(h){if(h<0||h>7)throw new RangeError("Mask value out of range");for(let d=0;d<this.size;d++)for(let v=0;v<this.size;v++){let p;switch(h){case 0:p=(v+d)%2==0;break;case 1:p=d%2==0;break;case 2:p=v%3==0;break;case 3:p=(v+d)%3==0;break;case 4:p=(Math.floor(v/3)+Math.floor(d/2))%2==0;break;case 5:p=v*d%2+v*d%3==0;break;case 6:p=(v*d%2+v*d%3)%2==0;break;case 7:p=((v+d)%2+v*d%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[d][v]&&p&&(this.modules[d][v]=!this.modules[d][v])}}getPenaltyScore(){let h=0;for(let E=0;E<this.size;E++){let z=!1,N=0,_=[0,0,0,0,0,0,0];for(let O=0;O<this.size;O++)this.modules[E][O]==z?(N++,N==5?h+=he.PENALTY_N1:N>5&&h++):(this.finderPenaltyAddHistory(N,_),z||(h+=this.finderPenaltyCountPatterns(_)*he.PENALTY_N3),z=this.modules[E][O],N=1);h+=this.finderPenaltyTerminateAndCount(z,N,_)*he.PENALTY_N3}for(let E=0;E<this.size;E++){let z=!1,N=0,_=[0,0,0,0,0,0,0];for(let O=0;O<this.size;O++)this.modules[O][E]==z?(N++,N==5?h+=he.PENALTY_N1:N>5&&h++):(this.finderPenaltyAddHistory(N,_),z||(h+=this.finderPenaltyCountPatterns(_)*he.PENALTY_N3),z=this.modules[O][E],N=1);h+=this.finderPenaltyTerminateAndCount(z,N,_)*he.PENALTY_N3}for(let E=0;E<this.size-1;E++)for(let z=0;z<this.size-1;z++){const N=this.modules[E][z];N==this.modules[E][z+1]&&N==this.modules[E+1][z]&&N==this.modules[E+1][z+1]&&(h+=he.PENALTY_N2)}let d=0;for(const E of this.modules)d=E.reduce((z,N)=>z+(N?1:0),d);const v=this.size*this.size,p=Math.ceil(Math.abs(d*20-v*10)/v)-1;return y(0<=p&&p<=9),h+=p*he.PENALTY_N4,y(0<=h&&h<=2568888),h}getAlignmentPatternPositions(){if(this.version==1)return[];{const h=Math.floor(this.version/7)+2,d=this.version==32?26:Math.ceil((this.version*4+4)/(h*2-2))*2;let v=[6];for(let p=this.size-7;v.length<h;p-=d)v.splice(1,0,p);return v}}static getNumRawDataModules(h){if(h<he.MIN_VERSION||h>he.MAX_VERSION)throw new RangeError("Version number out of range");let d=(16*h+128)*h+64;if(h>=2){const v=Math.floor(h/7)+2;d-=(25*v-10)*v-55,h>=7&&(d-=36)}return y(208<=d&&d<=29648),d}static getNumDataCodewords(h,d){return Math.floor(he.getNumRawDataModules(h)/8)-he.ECC_CODEWORDS_PER_BLOCK[d.ordinal][h]*he.NUM_ERROR_CORRECTION_BLOCKS[d.ordinal][h]}static reedSolomonComputeDivisor(h){if(h<1||h>255)throw new RangeError("Degree out of range");let d=[];for(let p=0;p<h-1;p++)d.push(0);d.push(1);let v=1;for(let p=0;p<h;p++){for(let E=0;E<d.length;E++)d[E]=he.reedSolomonMultiply(d[E],v),E+1<d.length&&(d[E]^=d[E+1]);v=he.reedSolomonMultiply(v,2)}return d}static reedSolomonComputeRemainder(h,d){let v=d.map(p=>0);for(const p of h){const E=p^v.shift();v.push(0),d.forEach((z,N)=>v[N]^=he.reedSolomonMultiply(z,E))}return v}static reedSolomonMultiply(h,d){if(h>>>8||d>>>8)throw new RangeError("Byte out of range");let v=0;for(let p=7;p>=0;p--)v=v<<1^(v>>>7)*285,v^=(d>>>p&1)*h;return y(v>>>8==0),v}finderPenaltyCountPatterns(h){const d=h[1];y(d<=this.size*3);const v=d>0&&h[2]==d&&h[3]==d*3&&h[4]==d&&h[5]==d;return(v&&h[0]>=d*4&&h[6]>=d?1:0)+(v&&h[6]>=d*4&&h[0]>=d?1:0)}finderPenaltyTerminateAndCount(h,d,v){return h&&(this.finderPenaltyAddHistory(d,v),d=0),d+=this.size,this.finderPenaltyAddHistory(d,v),this.finderPenaltyCountPatterns(v)}finderPenaltyAddHistory(h,d){d[0]==0&&(h+=this.size),d.pop(),d.unshift(h)}};o.MIN_VERSION=1,o.MAX_VERSION=40,o.PENALTY_N1=3,o.PENALTY_N2=3,o.PENALTY_N3=40,o.PENALTY_N4=10,o.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],o.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],u.QrCode=o;function f(C,h,d){if(h<0||h>31||C>>>h)throw new RangeError("Value out of range");for(let v=h-1;v>=0;v--)d.push(C>>>v&1)}function r(C,h){return(C>>>h&1)!=0}function y(C){if(!C)throw new Error("Assertion error")}const g=class Le{constructor(h,d,v){if(this.mode=h,this.numChars=d,this.bitData=v,d<0)throw new RangeError("Invalid argument");this.bitData=v.slice()}static makeBytes(h){let d=[];for(const v of h)f(v,8,d);return new Le(Le.Mode.BYTE,h.length,d)}static makeNumeric(h){if(!Le.isNumeric(h))throw new RangeError("String contains non-numeric characters");let d=[];for(let v=0;v<h.length;){const p=Math.min(h.length-v,3);f(parseInt(h.substring(v,v+p),10),p*3+1,d),v+=p}return new Le(Le.Mode.NUMERIC,h.length,d)}static makeAlphanumeric(h){if(!Le.isAlphanumeric(h))throw new RangeError("String contains unencodable characters in alphanumeric mode");let d=[],v;for(v=0;v+2<=h.length;v+=2){let p=Le.ALPHANUMERIC_CHARSET.indexOf(h.charAt(v))*45;p+=Le.ALPHANUMERIC_CHARSET.indexOf(h.charAt(v+1)),f(p,11,d)}return v<h.length&&f(Le.ALPHANUMERIC_CHARSET.indexOf(h.charAt(v)),6,d),new Le(Le.Mode.ALPHANUMERIC,h.length,d)}static makeSegments(h){return h==""?[]:Le.isNumeric(h)?[Le.makeNumeric(h)]:Le.isAlphanumeric(h)?[Le.makeAlphanumeric(h)]:[Le.makeBytes(Le.toUtf8ByteArray(h))]}static makeEci(h){let d=[];if(h<0)throw new RangeError("ECI assignment value out of range");if(h<128)f(h,8,d);else if(h<16384)f(2,2,d),f(h,14,d);else if(h<1e6)f(6,3,d),f(h,21,d);else throw new RangeError("ECI assignment value out of range");return new Le(Le.Mode.ECI,0,d)}static isNumeric(h){return Le.NUMERIC_REGEX.test(h)}static isAlphanumeric(h){return Le.ALPHANUMERIC_REGEX.test(h)}getData(){return this.bitData.slice()}static getTotalBits(h,d){let v=0;for(const p of h){const E=p.mode.numCharCountBits(d);if(p.numChars>=1<<E)return 1/0;v+=4+E+p.bitData.length}return v}static toUtf8ByteArray(h){h=encodeURI(h);let d=[];for(let v=0;v<h.length;v++)h.charAt(v)!="%"?d.push(h.charCodeAt(v)):(d.push(parseInt(h.substring(v+1,v+3),16)),v+=2);return d}};g.NUMERIC_REGEX=/^[0-9]*$/,g.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,g.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let x=g;u.QrSegment=g})(aa||(aa={}));(u=>{(o=>{const f=class{constructor(y,g){this.ordinal=y,this.formatBits=g}};f.LOW=new f(0,1),f.MEDIUM=new f(1,0),f.QUARTILE=new f(2,3),f.HIGH=new f(3,2),o.Ecc=f})(u.QrCode||(u.QrCode={}))})(aa||(aa={}));(u=>{(o=>{const f=class{constructor(y,g){this.modeBits=y,this.numBitsCharCount=g}numCharCountBits(y){return this.numBitsCharCount[Math.floor((y+7)/17)]}};f.NUMERIC=new f(1,[10,12,14]),f.ALPHANUMERIC=new f(2,[9,11,13]),f.BYTE=new f(4,[8,16,16]),f.KANJI=new f(8,[8,10,12]),f.ECI=new f(7,[0,0,0]),o.Mode=f})(u.QrSegment||(u.QrSegment={}))})(aa||(aa={}));var Qa=aa;var m0={L:Qa.QrCode.Ecc.LOW,M:Qa.QrCode.Ecc.MEDIUM,Q:Qa.QrCode.Ecc.QUARTILE,H:Qa.QrCode.Ecc.HIGH},pm=128,vm="L",Sm="#FFFFFF",xm="#000000",bm=!1,Em=1,g0=4,y0=0,p0=.1;function Cm(u,o=0){const f=[];return u.forEach(function(r,y){let g=null;r.forEach(function(x,C){if(!x&&g!==null){f.push(`M${g+o} ${y+o}h${C-g}v1H${g+o}z`),g=null;return}if(C===r.length-1){if(!x)return;g===null?f.push(`M${C+o},${y+o} h1v1H${C+o}z`):f.push(`M${g+o},${y+o} h${C+1-g}v1H${g+o}z`);return}x&&g===null&&(g=C)})}),f.join("")}function jm(u,o){return u.slice().map((f,r)=>r<o.y||r>=o.y+o.h?f:f.map((y,g)=>g<o.x||g>=o.x+o.w?y:!1))}function v0(u,o,f,r){if(r==null)return null;const y=u.length+f*2,g=Math.floor(o*p0),x=y/o,C=(r.width||g)*x,h=(r.height||g)*x,d=r.x==null?u.length/2-C/2:r.x*x,v=r.y==null?u.length/2-h/2:r.y*x,p=r.opacity==null?1:r.opacity;let E=null;if(r.excavate){let N=Math.floor(d),_=Math.floor(v),O=Math.ceil(C+d-N),B=Math.ceil(h+v-_);E={x:N,y:_,w:O,h:B}}const z=r.crossOrigin;return{x:d,y:v,h,w:C,excavation:E,opacity:p,crossOrigin:z}}function S0(u,o){return o!=null?Math.max(Math.floor(o),0):u?g0:y0}function Tm({value:u,level:o,minVersion:f,includeMargin:r,marginSize:y,imageSettings:g,size:x,boostLevel:C}){let h=Ke.useMemo(()=>{const N=(Array.isArray(u)?u:[u]).reduce((_,O)=>(_.push(...Qa.QrSegment.makeSegments(O)),_),[]);return Qa.QrCode.encodeSegments(N,m0[o],f,void 0,void 0,C)},[u,o,f,C]);const{cells:d,margin:v,numCells:p,calculatedImageSettings:E}=Ke.useMemo(()=>{let z=h.getModules();const N=S0(r,y),_=z.length+N*2,O=v0(z,x,N,g);return{cells:z,margin:N,numCells:_,calculatedImageSettings:O}},[h,x,g,r,y]);return{qrcode:h,margin:v,cells:d,numCells:p,calculatedImageSettings:E}}var x0=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),b0=Ke.forwardRef(function(o,f){const r=o,{value:y,size:g=pm,level:x=vm,bgColor:C=Sm,fgColor:h=xm,includeMargin:d=bm,minVersion:v=Em,boostLevel:p,marginSize:E,imageSettings:z}=r,_=nr(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:O}=_,B=nr(_,["style"]),H=z?.src,G=Ke.useRef(null),I=Ke.useRef(null),P=Ke.useCallback(ke=>{G.current=ke,typeof f=="function"?f(ke):f&&(f.current=ke)},[f]),[V,K]=Ke.useState(!1),{margin:k,cells:X,numCells:$,calculatedImageSettings:ae}=Tm({value:y,level:x,minVersion:v,boostLevel:p,includeMargin:d,marginSize:E,imageSettings:z,size:g});Ke.useEffect(()=>{if(G.current!=null){const ke=G.current,De=ke.getContext("2d");if(!De)return;let U=X;const Z=I.current,te=ae!=null&&Z!==null&&Z.complete&&Z.naturalHeight!==0&&Z.naturalWidth!==0;te&&ae.excavation!=null&&(U=jm(X,ae.excavation));const re=window.devicePixelRatio||1;ke.height=ke.width=g*re;const ye=g/$*re;De.scale(ye,ye),De.fillStyle=C,De.fillRect(0,0,$,$),De.fillStyle=h,x0?De.fill(new Path2D(Cm(U,k))):X.forEach(function(j,q){j.forEach(function(J,F){J&&De.fillRect(F+k,q+k,1,1)})}),ae&&(De.globalAlpha=ae.opacity),te&&De.drawImage(Z,ae.x+k,ae.y+k,ae.w,ae.h)}}),Ke.useEffect(()=>{K(!1)},[H]);const Se=ar({height:g,width:g},O);let it=null;return H!=null&&(it=Ke.createElement("img",{src:H,key:H,style:{display:"none"},onLoad:()=>{K(!0)},ref:I,crossOrigin:ae?.crossOrigin})),Ke.createElement(Ke.Fragment,null,Ke.createElement("canvas",ar({style:Se,height:g,width:g,ref:P,role:"img"},B)),it)});b0.displayName="QRCodeCanvas";var Am=Ke.forwardRef(function(o,f){const r=o,{value:y,size:g=pm,level:x=vm,bgColor:C=Sm,fgColor:h=xm,includeMargin:d=bm,minVersion:v=Em,boostLevel:p,title:E,marginSize:z,imageSettings:N}=r,_=nr(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:O,cells:B,numCells:H,calculatedImageSettings:G}=Tm({value:y,level:x,minVersion:v,boostLevel:p,includeMargin:d,marginSize:z,imageSettings:N,size:g});let I=B,P=null;N!=null&&G!=null&&(G.excavation!=null&&(I=jm(B,G.excavation)),P=Ke.createElement("image",{href:N.src,height:G.h,width:G.w,x:G.x+O,y:G.y+O,preserveAspectRatio:"none",opacity:G.opacity,crossOrigin:G.crossOrigin}));const V=Cm(I,O);return Ke.createElement("svg",ar({height:g,width:g,viewBox:`0 0 ${H} ${H}`,ref:f,role:"img"},_),!!E&&Ke.createElement("title",null,E),Ke.createElement("path",{fill:C,d:`M0,0 h${H}v${H}H0z`,shapeRendering:"crispEdges"}),Ke.createElement("path",{fill:h,d:V,shapeRendering:"crispEdges"}),P)});Am.displayName="QRCodeSVG";function E0({tunnelUrl:u,agentId:o,onClose:f}){const[r,y]=S.useState(null),[g,x]=S.useState(0),[C,h]=S.useState(""),[d,v]=S.useState(null),[p,E]=S.useState(!1),[z,N]=S.useState(!1),_=S.useRef(null),O=S.useRef(null),B=S.useRef(null),H=r?`${u}/call?code=${r}&agentId=${o}`:`${u}/call`,G=S.useCallback(async()=>{y(null),h(""),v(null),E(!1);try{const K=await tt("/api/webrtc/generate-code",{agentId:o});y(K.code),x(K.expiresAt)}catch(K){const k=K instanceof Error?K.message:K?.message||"Failed to generate code";v(k)}},[o]);S.useEffect(()=>(G(),ve("/api/tunnel/status").then(K=>{if(K.startedAt){const k=Date.now()-K.startedAt;k<6e4&&(N(!0),B.current=setTimeout(()=>N(!1),6e4-k))}}).catch(()=>{}),()=>{_.current&&clearInterval(_.current),O.current&&clearInterval(O.current),B.current&&clearTimeout(B.current)}),[G]),S.useEffect(()=>{if(!g||p)return;const K=()=>{const k=Math.max(0,Math.floor((g-Date.now())/1e3));if(k<=0){h("Code expired"),_.current&&(clearInterval(_.current),_.current=null);return}const X=Math.floor(k/60),$=k%60;h(`Expires in ${X}:${String($).padStart(2,"0")}`)};return K(),_.current=setInterval(K,1e3),()=>{_.current&&clearInterval(_.current)}},[g,p]),S.useEffect(()=>{if(!(!r||p))return O.current=setInterval(async()=>{try{!(await ve(`/api/webrtc/code-status?code=${r}`)).active&&Date.now()<g&&(E(!0),_.current&&(clearInterval(_.current),_.current=null),O.current&&(clearInterval(O.current),O.current=null))}catch{}},2e3),()=>{O.current&&clearInterval(O.current)}},[r,g,p]);const I=K=>{K.target===K.currentTarget&&f()},P=r?`${r.slice(0,3)} ${r.slice(3)}`:"------",V=C==="Code expired";return c.jsx("div",{className:"modal-overlay visible",onClick:I,children:c.jsxs("div",{className:"modal",style:{textAlign:"center"},children:[c.jsx("button",{className:"modal-close",onClick:f,children:"×"}),c.jsx("h2",{children:"Call via Browser"}),c.jsx("p",{style:{fontSize:12,color:"#999",marginBottom:12},children:"Scan the QR code or open the link on any device, then enter the pairing code."}),c.jsx("div",{className:"qr-container",children:H&&c.jsx(Am,{value:H,size:160,level:"M"})}),c.jsx("div",{className:"call-url",children:c.jsx("a",{href:H,target:"_blank",rel:"noreferrer",children:H})}),z&&c.jsx("div",{style:{fontSize:11,color:"#d29922",marginBottom:8},children:"Tunnel is warming up — link may take a moment to become reachable"}),p?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"pairing-code",style:{color:"#2ea043"},children:"Paired"}),c.jsx("div",{className:"pairing-countdown",style:{color:"#2ea043"},children:"Device connected successfully"})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"pairing-code",style:{opacity:V?.4:1},children:d?"Error":P}),c.jsx("div",{className:"pairing-countdown",children:d||C})]}),c.jsx("button",{className:"btn-regenerate",onClick:G,children:p?"New Code":"Regenerate Code"})]})})}const gu={margin:0,padding:12,fontSize:13,fontFamily:"monospace",whiteSpace:"pre-wrap",wordWrap:"break-word",background:"var(--bg-main)",color:"var(--text-primary)",border:"1px solid var(--border-color)",borderRadius:0},Qn={margin:"0 0 8px",fontSize:14,fontWeight:600,color:"var(--text-primary)"};function C0(){const{id:u}=Ih(),o=bu(),{browserCallStatus:f}=Fh(),[r,y]=S.useState(null),[g,x]=S.useState(!1),[C,h]=S.useState(null),[d,v]=S.useState(!1),[p,E]=S.useState(null),[z,N]=S.useState([]),[_,O]=S.useState(null),[B,H]=S.useState(!1),[G,I]=S.useState(!1),P=f.running&&!!f.tunnelUrl;S.useEffect(()=>{u&&ve(`/api/agents/${u}`).then(y).catch(()=>{})},[u]),S.useEffect(()=>{ve("/api/providers/tts").then(X=>(E(X.active),ve(`/api/providers/tts/${X.active}/voices`))).then(X=>N(X.voices)).catch(X=>O(X?.message||"Failed to load voices"))},[]);const V=async X=>{if(!(!u||!r||!p)){H(!0);try{const $=p,Se={...r.config.voice??{},[$]:{id:X,name:z.find(it=>it.id===X)?.name??""}};await Qv(`/api/agents/${u}`,{config:{voice:Se}}),y({...r,config:{...r.config,voice:Se}})}finally{H(!1)}}},K=async()=>{if(u){x(!0),h(null);try{await tt(`/api/agents/${u}/call`)}catch(X){const $=X?.message||"Failed to initiate call";h($)}finally{x(!1)}}},k=async()=>{if(u&&window.confirm(`Delete agent "${u}"? This cannot be undone.`)){v(!0);try{await um(`/api/agents/${u}`),o("/agents")}catch{v(!1)}}};return r?c.jsxs("div",{className:"page active",style:{display:"flex",flexDirection:"column",padding:0},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"24px 32px 16px",borderBottom:"1px solid var(--border-color)",flexShrink:0},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[c.jsx(Vt,{to:"/agents",style:{fontSize:13,color:"var(--text-secondary)",textDecoration:"none"},children:"Agents"}),c.jsx("span",{style:{color:"var(--text-secondary)",fontSize:13},children:"/"}),c.jsx("h2",{style:{margin:0,fontSize:18,fontWeight:600,color:"var(--text-primary)"},children:r.id})]}),c.jsxs("div",{style:{display:"flex",gap:8},children:[c.jsx("a",{href:`/api/agents/${u}/export`,download:`${u}.zip`,style:{padding:"6px 14px",background:"var(--bg-main)",color:"var(--text-primary)",border:"1px solid var(--border-color)",borderRadius:0,fontWeight:500,fontSize:13,cursor:"pointer",textDecoration:"none",display:"inline-flex",alignItems:"center"},children:"Export"}),c.jsx("button",{onClick:K,disabled:g,style:{padding:"6px 14px",background:"var(--btn-primary-bg)",color:"var(--btn-primary-text)",border:"none",borderRadius:0,fontWeight:500,fontSize:13,cursor:g?"not-allowed":"pointer",opacity:g?.6:1},children:g?"Calling...":"Call via Phone"}),c.jsx("span",{title:P?void 0:"Enable browser calling in Settings",children:c.jsx("button",{onClick:()=>I(!0),disabled:!P,style:{padding:"6px 14px",background:"var(--btn-primary-bg)",color:"var(--btn-primary-text)",border:"none",borderRadius:0,fontWeight:500,fontSize:13,cursor:P?"pointer":"not-allowed",opacity:P?1:.6},children:"Call via Browser"})}),c.jsx("button",{onClick:k,disabled:d,style:{padding:"6px 14px",background:"transparent",color:"#d73a49",border:"1px solid #d73a49",borderRadius:0,fontWeight:500,fontSize:13,cursor:d?"not-allowed":"pointer",opacity:d?.6:1},children:d?"Deleting...":"Delete"})]})]}),C&&c.jsx("div",{style:{margin:"16px 32px 0",padding:"8px 10px",fontSize:12,color:"#d73a49",background:"var(--bg-tertiary)",borderRadius:6,border:"1px solid #d73a49"},children:C}),c.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"48px 64px"},children:[c.jsxs("div",{className:"settings-panel",style:{marginBottom:24,padding:20},children:[c.jsx("h3",{style:Qn,children:"SOUL.md"}),c.jsx("pre",{style:gu,children:r.soulMd||"(empty)"})]}),c.jsxs("div",{className:"settings-panel",style:{marginBottom:24,padding:20},children:[c.jsx("h3",{style:Qn,children:"MEMORY.md"}),c.jsx("pre",{style:gu,children:r.memoryMd||"(empty)"})]}),c.jsxs("div",{className:"settings-panel",style:{marginBottom:24,padding:20},children:[c.jsx("h3",{style:Qn,children:"HEARTBEAT.md"}),c.jsx("pre",{style:gu,children:r.heartbeatMd||"(empty)"})]}),c.jsxs("div",{className:"settings-panel",style:{marginBottom:24,padding:20},children:[c.jsx("h3",{style:Qn,children:"Voice"}),p&&z.length>0?c.jsxs("div",{children:[c.jsx("label",{style:{display:"block",fontSize:13,color:"var(--text-secondary)",marginBottom:6},children:"ElevenLabs voice"}),c.jsx("select",{value:r.config.voice?.[p]?.id??"",onChange:X=>V(X.target.value),disabled:B,style:{padding:"6px 10px",fontSize:13,background:"var(--bg-main)",color:"var(--text-primary)",border:"1px solid var(--border-color)",borderRadius:0,cursor:B?"not-allowed":"pointer",opacity:B?.6:1,minWidth:200},children:z.map(X=>c.jsx("option",{value:X.id,children:X.name},X.id))})]}):_?c.jsx("p",{style:{margin:0,fontSize:13,color:"#d73a49"},children:_}):c.jsx("p",{style:{margin:0,fontSize:13,color:"var(--text-secondary)"},children:"Loading voices..."})]}),c.jsxs("div",{className:"settings-panel",style:{marginBottom:24,padding:20},children:[c.jsx("h3",{style:Qn,children:"Config"}),c.jsx("pre",{style:gu,children:JSON.stringify(r.config,null,2)})]})]}),G&&f.tunnelUrl&&u&&c.jsx(E0,{agentId:u,tunnelUrl:f.tunnelUrl,onClose:()=>I(!1)})]}):c.jsx("div",{className:"page active",style:{display:"flex",flexDirection:"column",padding:0},children:c.jsx("div",{style:{padding:"24px 32px",color:"var(--text-secondary)",fontSize:14},children:"Loading..."})})}function j0({sessionId:u}){const[o,f]=S.useState([]),[r,y]=S.useState("Loading..."),[g,x]=S.useState(null),C=S.useRef(null);return S.useEffect(()=>{y("Loading..."),x(null),f([]),ve(`/api/conversations/${u}`).then(h=>{f(h),y(`Conversation (${h.length} messages)`)}).catch(()=>{x("Error loading conversation."),y("Conversation")})},[u]),S.useEffect(()=>{C.current&&(C.current.scrollTop=C.current.scrollHeight)},[o]),c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"page-header",style:{padding:"48px 64px 24px"},children:c.jsx("div",{children:c.jsx("h1",{children:r})})}),c.jsxs("div",{className:"conversation-messages",ref:C,style:{padding:"0 64px 48px"},children:[g&&c.jsx("div",{className:"conversation-empty",children:g}),!g&&o.length===0&&!r.includes("Loading")&&c.jsx("div",{className:"conversation-empty",children:"No messages in this session."}),o.map((h,d)=>c.jsxs("div",{className:`msg msg-${h.role}`,children:[c.jsxs("div",{className:"msg-header",children:[c.jsx("span",{className:"msg-role",children:h.role==="user"?"User":"VoiceCC"}),c.jsx("span",{className:"msg-time",children:new Date(h.timestamp).toLocaleTimeString()})]}),c.jsx("div",{className:"msg-content",children:h.content})]},d))]})]})}function T0(){const{id:u}=Ih();return u?c.jsx("div",{className:"page active",children:c.jsx(j0,{sessionId:u})}):c.jsxs("div",{className:"page active",style:{display:"flex",flexDirection:"column"},children:[c.jsx("div",{className:"page-header",style:{padding:"48px 64px 24px"},children:c.jsx("div",{children:c.jsx("h1",{children:"Error"})})}),c.jsx("div",{className:"conversation-messages",style:{padding:"0 64px 48px"},children:c.jsx("div",{className:"conversation-empty",children:"No conversation ID provided."})})]})}const sl=6,Ps="claude-voice-device-token",Uh="claude-voice-agent-",A0=16e3,Bh=24e3;function z0(u,o,f){const r=o/f,y=Math.floor(u.length/r),g=new Float32Array(y);for(let x=0;x<y;x++){const C=Math.floor(x*r),h=u[C]??0,d=u[C+1]??0,v=C>0?u[C-1]??0:h;g[x]=(h+d+v)/3}return g}function Lh(u,o,f){const r=f/o,y=Math.round(u.length*r),g=new Float32Array(y);for(let x=0;x<y;x++){const C=x/r,h=Math.floor(C),d=C-h,v=u[h]??0,p=u[Math.min(h+1,u.length-1)]??0;g[x]=v+d*(p-v)}return g}function R0(){const[u,o]=S.useState("pairing"),[f,r]=S.useState(""),[y,g]=S.useState(""),[x,C]=S.useState(Array(sl).fill("")),h=S.useRef([]),d=S.useRef(localStorage.getItem(Ps)||""),v=S.useRef(""),p=S.useRef(null),E=S.useRef(null),z=S.useRef(null),N=S.useRef(null),_=S.useCallback(()=>x.join(""),[x]),O=()=>{C(Array(sl).fill("")),h.current[0]?.focus()},B=S.useCallback(async k=>{const X=k||_();if(console.log("[Call] submitPairing called, code length:",X.length),X.length!==sl){r("Enter all 6 digits");return}r("");try{console.log("[Call] POST /api/webrtc/pair ...");const $=await tt("/api/webrtc/pair",{code:X});console.log("[Call] Pairing success, got token"),d.current=$.token,localStorage.setItem(Ps,$.token),v.current&&localStorage.setItem(`${Uh}${$.token}`,v.current),o("ready")}catch($){const ae=$?.message||"Pairing failed";console.error("[Call] Pairing failed:",ae),r(ae),O()}},[_]);S.useEffect(()=>{const k=d.current,X=new URLSearchParams(window.location.search),$=X.get("code"),ae=X.get("agentId");if(console.log("[Call] mount: token=%s, urlCode=%s, agentId=%s",k?"present":"none",$??"none",ae??"none"),ae&&(v.current=ae),$&&$.length===sl&&!k){console.log("[Call] auto-pairing from URL code"),B($);return}if(!k){console.log("[Call] no token, showing PIN input"),h.current[0]?.focus();return}if(!ae){const Se=localStorage.getItem(`${Uh}${k}`);Se&&(v.current=Se,console.log("[Call] restored agentId from localStorage:",Se))}console.log("[Call] validating existing token..."),fetch("/api/webrtc/validate",{headers:{Authorization:`Bearer ${k}`}}).then(Se=>(console.log("[Call] validate response status:",Se.status),Se.json())).then(Se=>{console.log("[Call] validate result:",Se),Se.valid?o("ready"):(localStorage.removeItem(Ps),d.current="",$&&$.length===sl?B($):h.current[0]?.focus())}).catch(Se=>{console.error("[Call] validate error:",Se),h.current[0]?.focus()})},[]);const H=(k,X)=>{const $=X.replace(/\D/g,"").slice(0,1),ae=[...x];ae[k]=$,C(ae),$&&k<sl-1&&h.current[k+1]?.focus(),$&&ae.every(Se=>Se!=="")&&B(ae.join(""))},G=(k,X)=>{X.key==="Backspace"&&!x[k]&&k>0&&h.current[k-1]?.focus()},I=k=>{k.preventDefault();const X=(k.clipboardData.getData("text")||"").replace(/\D/g,"").slice(0,sl),$=[...x];for(let ae=0;ae<X.length;ae++)$[ae]=X[ae];C($),X.length===sl?B(X):X.length>0&&h.current[Math.min(X.length,sl-1)]?.focus()},P=S.useCallback(()=>{p.current&&(p.current.onopen=null,p.current.onclose=null,p.current.onerror=null,p.current.onmessage=null,(p.current.readyState===WebSocket.OPEN||p.current.readyState===WebSocket.CONNECTING)&&p.current.close(),p.current=null),z.current&&(z.current.getTracks().forEach(k=>k.stop()),z.current=null),N.current&&(N.current.disconnect(),N.current=null),E.current&&(E.current.close().catch(()=>{}),E.current=null)},[]),V=S.useCallback(async()=>{g(""),o("connecting");let k=null;try{let X;try{X=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{g("Microphone access denied. Please allow microphone access and try again."),o("ready");return}z.current=X,k=new AudioContext,E.current=k,await k.resume();const $=k.sampleRate;await k.audioWorklet.addModule("/audio-processor.js");const ae=new AudioWorkletNode(k,"audio-processor");N.current=ae,k.createMediaStreamSource(X).connect(ae),ae.connect(k.destination);const it=window.location.protocol==="http:"?"ws:":"wss:",ke=v.current?`&agentId=${encodeURIComponent(v.current)}`:"",De=`${it}//${window.location.host}/audio?token=${d.current}${ke}`,U=new WebSocket(De);p.current=U,ae.port.onmessage=Z=>{if(Z.data.type!=="audio"||U.readyState!==WebSocket.OPEN)return;const te=Z.data.samples,re=z0(te,$,A0);U.send(re.buffer)},U.onmessage=async Z=>{if(Z.data instanceof Blob){const te=await Z.data.arrayBuffer(),re=new Int16Array(te),ye=new Float32Array(re.length);for(let q=0;q<re.length;q++)ye[q]=re[q]/32768;const j=Lh(ye,Bh,$);ae.port.postMessage({type:"playback",samples:j});return}if(Z.data instanceof ArrayBuffer){const te=new Int16Array(Z.data),re=new Float32Array(te.length);for(let j=0;j<te.length;j++)re[j]=te[j]/32768;const ye=Lh(re,Bh,$);ae.port.postMessage({type:"playback",samples:ye});return}if(typeof Z.data=="string")try{JSON.parse(Z.data).type==="clear"&&ae.port.postMessage({type:"clear"})}catch{}},U.onopen=()=>{console.log("[Call] WebSocket connected"),o("active")},U.onclose=Z=>{console.log("[Call] WebSocket closed, code:",Z.code,"reason:",Z.reason),P(),o("ready")},U.onerror=Z=>{console.error("[Call] WebSocket error:",Z),g("WebSocket connection failed"),P(),o("ready")}}catch(X){const $=X instanceof Error?X.message:"Connection failed";g(`Connection failed: ${$}`),P(),o("ready")}},[P]),K=S.useCallback(()=>{P(),o("ready")},[P]);return c.jsxs("div",{className:"call-container",children:[c.jsx("h1",{children:"Claude Voice"}),c.jsx("p",{className:"subtitle",children:"Enter the pairing code shown on the dashboard"}),u==="pairing"&&c.jsxs("div",{className:"call-state",children:[c.jsx("div",{className:"pin-inputs",children:x.map((k,X)=>c.jsx("input",{ref:$=>{h.current[X]=$},type:"text",inputMode:"numeric",maxLength:1,value:k,onChange:$=>H(X,$.target.value),onKeyDown:$=>G(X,$),onPaste:X===0?I:void 0},X))}),c.jsx("button",{className:"btn btn-pair",onClick:()=>B(),children:"Pair Device"}),c.jsx("div",{className:"error-msg",children:f})]}),u==="ready"&&c.jsxs("div",{className:"call-state",children:[c.jsx("p",{className:"status-msg",style:{marginBottom:24},children:"Device paired. Ready to call."}),c.jsx("button",{className:"btn btn-call",onClick:V,children:"Start Call"}),c.jsx("div",{className:"error-msg",children:y})]}),u==="connecting"&&c.jsx("div",{className:"call-state",children:c.jsx("p",{className:"status-msg",children:"Connecting..."})}),u==="active"&&c.jsxs("div",{className:"call-state",children:[c.jsx("div",{className:"pulse-ring"}),c.jsx("div",{className:"call-label",children:"Call in progress"}),c.jsx("button",{className:"btn btn-hangup",onClick:K,children:"Hang Up"})]})]})}function M0(){return c.jsx(_v,{children:c.jsxs(uv,{children:[c.jsxs(Ll,{element:c.jsx(Xv,{}),children:[c.jsx(Ll,{path:"/",element:c.jsx(Jv,{})}),c.jsx(Ll,{path:"/settings",element:c.jsx(f0,{})}),c.jsx(Ll,{path:"/agents",element:c.jsx(d0,{})}),c.jsx(Ll,{path:"/agents/:id",element:c.jsx(C0,{})}),c.jsx(Ll,{path:"/c/:id",element:c.jsx(T0,{})})]}),c.jsx(Ll,{path:"/call",element:c.jsx(R0,{})})]})})}const zm=document.getElementById("root");if(!zm)throw new Error("Root element #root not found");cp.createRoot(zm).render(c.jsx(S.StrictMode,{children:c.jsx(M0,{})}));
11
+ Please change the parent <Route path="${H}"> to <Route path="${H==="/"?"*":`${H}/*`}">.`)}let E=fl(),z;if(o){let H=typeof o=="string"?Va(o):o;we(v==="/"||H.pathname?.startsWith(v),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${v}" but pathname "${H.pathname}" was given in the \`location\` prop.`),z=H}else z=E;let N=z.pathname||"/",_=N;if(v!=="/"){let H=v.replace(/^\//,"").split("/");_="/"+N.replace(/^\//,"").split("/").slice(H.length).join("/")}let O=Hh(u,{pathname:_});Lt(p||O!=null,`No routes matched location "${z.pathname}${z.search}${z.hash}" `),Lt(O==null||O[O.length-1].route.element!==void 0||O[O.length-1].route.Component!==void 0||O[O.length-1].route.lazy!==void 0,`Matched leaf route at location "${z.pathname}${z.search}${z.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let B=Wp(O&&O.map(H=>Object.assign({},H,{params:Object.assign({},h,H.params),pathname:rl([v,g.encodeLocation?g.encodeLocation(H.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:H.pathname]),pathnameBase:H.pathnameBase==="/"?v:rl([v,g.encodeLocation?g.encodeLocation(H.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:H.pathnameBase])})),x,f,r,y);return o&&B?S.createElement(Kn.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...z},navigationType:"POP"}},B):B}function Zp(){let u=tv(),o=Op(u)?`${u.status} ${u.statusText}`:u instanceof Error?u.message:JSON.stringify(u),f=u instanceof Error?u.stack:null,r="rgba(200,200,200, 0.5)",y={padding:"0.5rem",backgroundColor:r},g={padding:"2px 4px",backgroundColor:r},x=null;return console.error("Error handled by React Router default ErrorBoundary:",u),x=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:g},"ErrorBoundary")," or"," ",S.createElement("code",{style:g},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},o),f?S.createElement("pre",{style:y},f):null,x)}var Kp=S.createElement(Zp,null),em=class extends S.Component{constructor(u){super(u),this.state={location:u.location,revalidation:u.revalidation,error:u.error}}static getDerivedStateFromError(u){return{error:u}}static getDerivedStateFromProps(u,o){return o.location!==u.location||o.revalidation!=="idle"&&u.revalidation==="idle"?{error:u.error,location:u.location,revalidation:u.revalidation}:{error:u.error!==void 0?u.error:o.error,location:o.location,revalidation:u.revalidation||o.revalidation}}componentDidCatch(u,o){this.props.onError?this.props.onError(u,o):console.error("React Router caught the following error during render",u)}render(){let u=this.state.error;if(this.context&&typeof u=="object"&&u&&"digest"in u&&typeof u.digest=="string"){const f=Gp(u.digest);f&&(u=f)}let o=u!==void 0?S.createElement(Ht.Provider,{value:this.props.routeContext},S.createElement(ur.Provider,{value:u,children:this.props.component})):this.props.children;return this.context?S.createElement(Jp,{error:u},o):o}};em.contextType=Up;var Js=new WeakMap;function Jp({children:u,error:o}){let{basename:f}=S.useContext(Dt);if(typeof o=="object"&&o&&"digest"in o&&typeof o.digest=="string"){let r=qp(o.digest);if(r){let y=Js.get(o);if(y)throw y;let g=Xh(r.location,f);if(Vh&&!Js.get(o))if(g.isExternal||r.reloadDocument)window.location.href=g.absoluteURL||g.to;else{const x=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(g.to,{replace:r.replace}));throw Js.set(o,x),x}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${g.absoluteURL||g.to}`})}}return u}function $p({routeContext:u,match:o,children:f}){let r=S.useContext(Xa);return r&&r.static&&r.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=o.route.id),S.createElement(Ht.Provider,{value:u},f)}function Wp(u,o=[],f=null,r=null,y=null){if(u==null){if(!f)return null;if(f.errors)u=f.matches;else if(o.length===0&&!f.initialized&&f.matches.length>0)u=f.matches;else return null}let g=u,x=f?.errors;if(x!=null){let v=g.findIndex(p=>p.route.id&&x?.[p.route.id]!==void 0);we(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(x).join(",")}`),g=g.slice(0,Math.min(g.length,v+1))}let C=!1,h=-1;if(f)for(let v=0;v<g.length;v++){let p=g[v];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(h=v),p.route.id){let{loaderData:E,errors:z}=f,N=p.route.loader&&!E.hasOwnProperty(p.route.id)&&(!z||z[p.route.id]===void 0);if(p.route.lazy||N){C=!0,h>=0?g=g.slice(0,h+1):g=[g[0]];break}}}let d=f&&r?(v,p)=>{r(v,{location:f.location,params:f.matches?.[0]?.params??{},unstable_pattern:Dp(f.matches),errorInfo:p})}:void 0;return g.reduceRight((v,p,E)=>{let z,N=!1,_=null,O=null;f&&(z=x&&p.route.id?x[p.route.id]:void 0,_=p.route.errorElement||Kp,C&&(h<0&&E===0?(tm("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,O=null):h===E&&(N=!0,O=p.route.hydrateFallbackElement||null)));let B=o.concat(g.slice(0,E+1)),H=()=>{let G;return z?G=_:N?G=O:p.route.Component?G=S.createElement(p.route.Component,null):p.route.element?G=p.route.element:G=v,S.createElement($p,{match:p,routeContext:{outlet:v,matches:B,isDataRoute:f!=null},children:G})};return f&&(p.route.ErrorBoundary||p.route.errorElement||E===0)?S.createElement(em,{location:f.location,revalidation:f.revalidation,component:_,error:z,children:H(),routeContext:{outlet:null,matches:B,isDataRoute:!0},onError:d}):H()},null)}function cr(u){return`${u} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Fp(u){let o=S.useContext(Xa);return we(o,cr(u)),o}function Ip(u){let o=S.useContext(xu);return we(o,cr(u)),o}function Pp(u){let o=S.useContext(Ht);return we(o,cr(u)),o}function sr(u){let o=Pp(u),f=o.matches[o.matches.length-1];return we(f.route.id,`${u} can only be used on routes that contain a unique "id"`),f.route.id}function ev(){return sr("useRouteId")}function tv(){let u=S.useContext(ur),o=Ip("useRouteError"),f=sr("useRouteError");return u!==void 0?u:o.errors?.[f]}function lv(){let{router:u}=Fp("useNavigate"),o=sr("useNavigate"),f=S.useRef(!1);return $h(()=>{f.current=!0}),S.useCallback(async(y,g={})=>{Lt(f.current,Jh),f.current&&(typeof y=="number"?await u.navigate(y):await u.navigate(y,{fromRouteId:o,...g}))},[u,o])}var Rh={};function tm(u,o,f){!o&&!Rh[u]&&(Rh[u]=!0,Lt(!1,f))}S.memo(av);function av({routes:u,future:o,state:f,onError:r}){return Ph(u,void 0,f,r,o)}function nv(u){return Xp(u.context)}function Ll(u){we(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function iv({basename:u="/",children:o=null,location:f,navigationType:r="POP",navigator:y,static:g=!1,unstable_useTransitions:x}){we(!Jn(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let C=u.replace(/^\/*/,"/"),h=S.useMemo(()=>({basename:C,navigator:y,static:g,unstable_useTransitions:x,future:{}}),[C,y,g,x]);typeof f=="string"&&(f=Va(f));let{pathname:d="/",search:v="",hash:p="",state:E=null,key:z="default"}=f,N=S.useMemo(()=>{let _=ol(d,C);return _==null?null:{location:{pathname:_,search:v,hash:p,state:E,key:z},navigationType:r}},[C,d,v,p,E,z,r]);return Lt(N!=null,`<Router basename="${C}"> is not able to match the URL "${d}${v}${p}" because it does not start with the basename, so the <Router> won't render anything.`),N==null?null:S.createElement(Dt.Provider,{value:h},S.createElement(Kn.Provider,{children:o,value:N}))}function uv({children:u,location:o}){return kp(tr(u),o)}function tr(u,o=[]){let f=[];return S.Children.forEach(u,(r,y)=>{if(!S.isValidElement(r))return;let g=[...o,y];if(r.type===S.Fragment){f.push.apply(f,tr(r.props.children,g));return}we(r.type===Ll,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),we(!r.props.index||!r.props.children,"An index route cannot have child routes.");let x={id:r.props.id||g.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(x.children=tr(r.props.children,g)),f.push(x)}),f}var yu="get",pu="application/x-www-form-urlencoded";function Eu(u){return typeof HTMLElement<"u"&&u instanceof HTMLElement}function cv(u){return Eu(u)&&u.tagName.toLowerCase()==="button"}function sv(u){return Eu(u)&&u.tagName.toLowerCase()==="form"}function rv(u){return Eu(u)&&u.tagName.toLowerCase()==="input"}function ov(u){return!!(u.metaKey||u.altKey||u.ctrlKey||u.shiftKey)}function fv(u,o){return u.button===0&&(!o||o==="_self")&&!ov(u)}function lr(u=""){return new URLSearchParams(typeof u=="string"||Array.isArray(u)||u instanceof URLSearchParams?u:Object.keys(u).reduce((o,f)=>{let r=u[f];return o.concat(Array.isArray(r)?r.map(y=>[f,y]):[[f,r]])},[]))}function dv(u,o){let f=lr(u);return o&&o.forEach((r,y)=>{f.has(y)||o.getAll(y).forEach(g=>{f.append(y,g)})}),f}var mu=null;function hv(){if(mu===null)try{new FormData(document.createElement("form"),0),mu=!1}catch{mu=!0}return mu}var mv=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function $s(u){return u!=null&&!mv.has(u)?(Lt(!1,`"${u}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${pu}"`),null):u}function gv(u,o){let f,r,y,g,x;if(sv(u)){let C=u.getAttribute("action");r=C?ol(C,o):null,f=u.getAttribute("method")||yu,y=$s(u.getAttribute("enctype"))||pu,g=new FormData(u)}else if(cv(u)||rv(u)&&(u.type==="submit"||u.type==="image")){let C=u.form;if(C==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=u.getAttribute("formaction")||C.getAttribute("action");if(r=h?ol(h,o):null,f=u.getAttribute("formmethod")||C.getAttribute("method")||yu,y=$s(u.getAttribute("formenctype"))||$s(C.getAttribute("enctype"))||pu,g=new FormData(C,u),!hv()){let{name:d,type:v,value:p}=u;if(v==="image"){let E=d?`${d}.`:"";g.append(`${E}x`,"0"),g.append(`${E}y`,"0")}else d&&g.append(d,p)}}else{if(Eu(u))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');f=yu,r=null,y=pu,x=u}return g&&y==="text/plain"&&(x=g,g=void 0),{action:r,method:f.toLowerCase(),encType:y,formData:g,body:x}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function rr(u,o){if(u===!1||u===null||typeof u>"u")throw new Error(o)}function yv(u,o,f,r){let y=typeof u=="string"?new URL(u,typeof window>"u"?"server://singlefetch/":window.location.origin):u;return f?y.pathname.endsWith("/")?y.pathname=`${y.pathname}_.${r}`:y.pathname=`${y.pathname}.${r}`:y.pathname==="/"?y.pathname=`_root.${r}`:o&&ol(y.pathname,o)==="/"?y.pathname=`${o.replace(/\/$/,"")}/_root.${r}`:y.pathname=`${y.pathname.replace(/\/$/,"")}.${r}`,y}async function pv(u,o){if(u.id in o)return o[u.id];try{let f=await import(u.module);return o[u.id]=f,f}catch(f){return console.error(`Error loading route module \`${u.module}\`, reloading page...`),console.error(f),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function vv(u){return u==null?!1:u.href==null?u.rel==="preload"&&typeof u.imageSrcSet=="string"&&typeof u.imageSizes=="string":typeof u.rel=="string"&&typeof u.href=="string"}async function Sv(u,o,f){let r=await Promise.all(u.map(async y=>{let g=o.routes[y.route.id];if(g){let x=await pv(g,f);return x.links?x.links():[]}return[]}));return Cv(r.flat(1).filter(vv).filter(y=>y.rel==="stylesheet"||y.rel==="preload").map(y=>y.rel==="stylesheet"?{...y,rel:"prefetch",as:"style"}:{...y,rel:"prefetch"}))}function Mh(u,o,f,r,y,g){let x=(h,d)=>f[d]?h.route.id!==f[d].route.id:!0,C=(h,d)=>f[d].pathname!==h.pathname||f[d].route.path?.endsWith("*")&&f[d].params["*"]!==h.params["*"];return g==="assets"?o.filter((h,d)=>x(h,d)||C(h,d)):g==="data"?o.filter((h,d)=>{let v=r.routes[h.route.id];if(!v||!v.hasLoader)return!1;if(x(h,d)||C(h,d))return!0;if(h.route.shouldRevalidate){let p=h.route.shouldRevalidate({currentUrl:new URL(y.pathname+y.search+y.hash,window.origin),currentParams:f[0]?.params||{},nextUrl:new URL(u,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function xv(u,o,{includeHydrateFallback:f}={}){return bv(u.map(r=>{let y=o.routes[r.route.id];if(!y)return[];let g=[y.module];return y.clientActionModule&&(g=g.concat(y.clientActionModule)),y.clientLoaderModule&&(g=g.concat(y.clientLoaderModule)),f&&y.hydrateFallbackModule&&(g=g.concat(y.hydrateFallbackModule)),y.imports&&(g=g.concat(y.imports)),g}).flat(1))}function bv(u){return[...new Set(u)]}function Ev(u){let o={},f=Object.keys(u).sort();for(let r of f)o[r]=u[r];return o}function Cv(u,o){let f=new Set;return new Set(o),u.reduce((r,y)=>{let g=JSON.stringify(Ev(y));return f.has(g)||(f.add(g),r.push({key:g,link:y})),r},[])}function lm(){let u=S.useContext(Xa);return rr(u,"You must render this element inside a <DataRouterContext.Provider> element"),u}function jv(){let u=S.useContext(xu);return rr(u,"You must render this element inside a <DataRouterStateContext.Provider> element"),u}var or=S.createContext(void 0);or.displayName="FrameworkContext";function am(){let u=S.useContext(or);return rr(u,"You must render this element inside a <HydratedRouter> element"),u}function Tv(u,o){let f=S.useContext(or),[r,y]=S.useState(!1),[g,x]=S.useState(!1),{onFocus:C,onBlur:h,onMouseEnter:d,onMouseLeave:v,onTouchStart:p}=o,E=S.useRef(null);S.useEffect(()=>{if(u==="render"&&x(!0),u==="viewport"){let _=B=>{B.forEach(H=>{x(H.isIntersecting)})},O=new IntersectionObserver(_,{threshold:.5});return E.current&&O.observe(E.current),()=>{O.disconnect()}}},[u]),S.useEffect(()=>{if(r){let _=setTimeout(()=>{x(!0)},100);return()=>{clearTimeout(_)}}},[r]);let z=()=>{y(!0)},N=()=>{y(!1),x(!1)};return f?u!=="intent"?[g,E,{}]:[g,E,{onFocus:Gn(C,z),onBlur:Gn(h,N),onMouseEnter:Gn(d,z),onMouseLeave:Gn(v,N),onTouchStart:Gn(p,z)}]:[!1,E,{}]}function Gn(u,o){return f=>{u&&u(f),f.defaultPrevented||o(f)}}function Av({page:u,...o}){let{router:f}=lm(),r=S.useMemo(()=>Hh(f.routes,u,f.basename),[f.routes,u,f.basename]);return r?S.createElement(Rv,{page:u,matches:r,...o}):null}function zv(u){let{manifest:o,routeModules:f}=am(),[r,y]=S.useState([]);return S.useEffect(()=>{let g=!1;return Sv(u,o,f).then(x=>{g||y(x)}),()=>{g=!0}},[u,o,f]),r}function Rv({page:u,matches:o,...f}){let r=fl(),{future:y,manifest:g,routeModules:x}=am(),{basename:C}=lm(),{loaderData:h,matches:d}=jv(),v=S.useMemo(()=>Mh(u,o,d,g,r,"data"),[u,o,d,g,r]),p=S.useMemo(()=>Mh(u,o,d,g,r,"assets"),[u,o,d,g,r]),E=S.useMemo(()=>{if(u===r.pathname+r.search+r.hash)return[];let _=new Set,O=!1;if(o.forEach(H=>{let G=g.routes[H.route.id];!G||!G.hasLoader||(!v.some(I=>I.route.id===H.route.id)&&H.route.id in h&&x[H.route.id]?.shouldRevalidate||G.hasClientLoader?O=!0:_.add(H.route.id))}),_.size===0)return[];let B=yv(u,C,y.unstable_trailingSlashAwareDataRequests,"data");return O&&_.size>0&&B.searchParams.set("_routes",o.filter(H=>_.has(H.route.id)).map(H=>H.route.id).join(",")),[B.pathname+B.search]},[C,y.unstable_trailingSlashAwareDataRequests,h,r,g,v,o,u,x]),z=S.useMemo(()=>xv(p,g),[p,g]),N=zv(p);return S.createElement(S.Fragment,null,E.map(_=>S.createElement("link",{key:_,rel:"prefetch",as:"fetch",href:_,...f})),z.map(_=>S.createElement("link",{key:_,rel:"modulepreload",href:_,...f})),N.map(({key:_,link:O})=>S.createElement("link",{key:_,nonce:f.nonce,...O,crossOrigin:O.crossOrigin??f.crossOrigin})))}function Mv(...u){return o=>{u.forEach(f=>{typeof f=="function"?f(o):f!=null&&(f.current=o)})}}var Nv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Nv&&(window.__reactRouterVersion="7.13.0")}catch{}function _v({basename:u,children:o,unstable_useTransitions:f,window:r}){let y=S.useRef();y.current==null&&(y.current=sp({window:r,v5Compat:!0}));let g=y.current,[x,C]=S.useState({action:g.action,location:g.location}),h=S.useCallback(d=>{f===!1?C(d):S.startTransition(()=>C(d))},[f]);return S.useLayoutEffect(()=>g.listen(h),[g,h]),S.createElement(iv,{basename:u,children:o,location:x.location,navigationType:x.action,navigator:g,unstable_useTransitions:f})}var nm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vt=S.forwardRef(function({onClick:o,discover:f="render",prefetch:r="none",relative:y,reloadDocument:g,replace:x,state:C,target:h,to:d,preventScrollReset:v,viewTransition:p,unstable_defaultShouldRevalidate:E,...z},N){let{basename:_,unstable_useTransitions:O}=S.useContext(Dt),B=typeof d=="string"&&nm.test(d),H=Xh(d,_);d=H.to;let G=Qp(d,{relative:y}),[I,P,V]=Tv(r,z),K=Uv(d,{replace:x,state:C,target:h,preventScrollReset:v,relative:y,viewTransition:p,unstable_defaultShouldRevalidate:E,unstable_useTransitions:O});function k($){o&&o($),$.defaultPrevented||K($)}let X=S.createElement("a",{...z,...V,href:H.absoluteURL||G,onClick:H.isExternal||g?o:k,ref:Mv(N,P),target:h,"data-discover":!B&&f==="render"?"true":void 0});return I&&!B?S.createElement(S.Fragment,null,X,S.createElement(Av,{page:G})):X});Vt.displayName="Link";var Ov=S.forwardRef(function({"aria-current":o="page",caseSensitive:f=!1,className:r="",end:y=!1,style:g,to:x,viewTransition:C,children:h,...d},v){let p=$n(x,{relative:d.relative}),E=fl(),z=S.useContext(xu),{navigator:N,basename:_}=S.useContext(Dt),O=z!=null&&Gv(p)&&C===!0,B=N.encodeLocation?N.encodeLocation(p).pathname:p.pathname,H=E.pathname,G=z&&z.navigation&&z.navigation.location?z.navigation.location.pathname:null;f||(H=H.toLowerCase(),G=G?G.toLowerCase():null,B=B.toLowerCase()),G&&_&&(G=ol(G,_)||G);const I=B!=="/"&&B.endsWith("/")?B.length-1:B.length;let P=H===B||!y&&H.startsWith(B)&&H.charAt(I)==="/",V=G!=null&&(G===B||!y&&G.startsWith(B)&&G.charAt(B.length)==="/"),K={isActive:P,isPending:V,isTransitioning:O},k=P?o:void 0,X;typeof r=="function"?X=r(K):X=[r,P?"active":null,V?"pending":null,O?"transitioning":null].filter(Boolean).join(" ");let $=typeof g=="function"?g(K):g;return S.createElement(Vt,{...d,"aria-current":k,className:X,ref:v,style:$,to:x,viewTransition:C},typeof h=="function"?h(K):h)});Ov.displayName="NavLink";var Dv=S.forwardRef(({discover:u="render",fetcherKey:o,navigate:f,reloadDocument:r,replace:y,state:g,method:x=yu,action:C,onSubmit:h,relative:d,preventScrollReset:v,viewTransition:p,unstable_defaultShouldRevalidate:E,...z},N)=>{let{unstable_useTransitions:_}=S.useContext(Dt),O=Yv(),B=qv(C,{relative:d}),H=x.toLowerCase()==="get"?"get":"post",G=typeof C=="string"&&nm.test(C),I=P=>{if(h&&h(P),P.defaultPrevented)return;P.preventDefault();let V=P.nativeEvent.submitter,K=V?.getAttribute("formmethod")||x,k=()=>O(V||P.currentTarget,{fetcherKey:o,method:K,navigate:f,replace:y,state:g,relative:d,preventScrollReset:v,viewTransition:p,unstable_defaultShouldRevalidate:E});_&&f!==!1?S.startTransition(()=>k()):k()};return S.createElement("form",{ref:N,method:H,action:B,onSubmit:r?h:I,...z,"data-discover":!G&&u==="render"?"true":void 0})});Dv.displayName="Form";function wv(u){return`${u} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function im(u){let o=S.useContext(Xa);return we(o,wv(u)),o}function Uv(u,{target:o,replace:f,state:r,preventScrollReset:y,relative:g,viewTransition:x,unstable_defaultShouldRevalidate:C,unstable_useTransitions:h}={}){let d=bu(),v=fl(),p=$n(u,{relative:g});return S.useCallback(E=>{if(fv(E,o)){E.preventDefault();let z=f!==void 0?f:Zn(v)===Zn(p),N=()=>d(u,{replace:z,state:r,preventScrollReset:y,relative:g,viewTransition:x,unstable_defaultShouldRevalidate:C});h?S.startTransition(()=>N()):N()}},[v,d,p,f,r,o,u,y,g,x,C,h])}function Bv(u){Lt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let o=S.useRef(lr(u)),f=S.useRef(!1),r=fl(),y=S.useMemo(()=>dv(r.search,f.current?null:o.current),[r.search]),g=bu(),x=S.useCallback((C,h)=>{const d=lr(typeof C=="function"?C(new URLSearchParams(y)):C);f.current=!0,g("?"+d,h)},[g,y]);return[y,x]}var Lv=0,Hv=()=>`__${String(++Lv)}__`;function Yv(){let{router:u}=im("useSubmit"),{basename:o}=S.useContext(Dt),f=ev(),r=u.fetch,y=u.navigate;return S.useCallback(async(g,x={})=>{let{action:C,method:h,encType:d,formData:v,body:p}=gv(g,o);if(x.navigate===!1){let E=x.fetcherKey||Hv();await r(E,f,x.action||C,{unstable_defaultShouldRevalidate:x.unstable_defaultShouldRevalidate,preventScrollReset:x.preventScrollReset,formData:v,body:p,formMethod:x.method||h,formEncType:x.encType||d,flushSync:x.flushSync})}else await y(x.action||C,{unstable_defaultShouldRevalidate:x.unstable_defaultShouldRevalidate,preventScrollReset:x.preventScrollReset,formData:v,body:p,formMethod:x.method||h,formEncType:x.encType||d,replace:x.replace,state:x.state,fromRouteId:f,flushSync:x.flushSync,viewTransition:x.viewTransition})},[r,y,o,f])}function qv(u,{relative:o}={}){let{basename:f}=S.useContext(Dt),r=S.useContext(Ht);we(r,"useFormAction must be used inside a RouteContext");let[y]=r.matches.slice(-1),g={...$n(u||".",{relative:o})},x=fl();if(u==null){g.search=x.search;let C=new URLSearchParams(g.search),h=C.getAll("index");if(h.some(v=>v==="")){C.delete("index"),h.filter(p=>p).forEach(p=>C.append("index",p));let v=C.toString();g.search=v?`?${v}`:""}}return(!u||u===".")&&y.route.index&&(g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index"),f!=="/"&&(g.pathname=g.pathname==="/"?f:rl([f,g.pathname])),Zn(g)}function Gv(u,{relative:o}={}){let f=S.useContext(Zh);we(f!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=im("useViewTransitionState"),y=$n(u,{relative:o});if(!f.isTransitioning)return!1;let g=ol(f.currentLocation.pathname,r)||f.currentLocation.pathname,x=ol(f.nextLocation.pathname,r)||f.nextLocation.pathname;return vu(y.pathname,x)!=null||vu(y.pathname,g)!=null}async function ve(u){const o=await fetch(u);if(!o.ok){const f=await o.json().catch(()=>({error:"Request failed"}));throw{status:o.status,message:f.error||"Request failed"}}return o.json()}async function tt(u,o){const f=await fetch(u,{method:"POST",headers:o!==void 0?{"Content-Type":"application/json"}:{},body:o!==void 0?JSON.stringify(o):void 0});if(!f.ok){const r=await f.json().catch(()=>({error:"Request failed"}));throw{status:f.status,message:r.error||"Request failed"}}return f.json()}async function Qv(u,o){const f=await fetch(u,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(!f.ok){const r=await f.json().catch(()=>({error:"Request failed"}));throw{status:f.status,message:r.error||"Request failed"}}return f.json()}async function um(u){const o=await fetch(u,{method:"DELETE"});if(!o.ok){const f=await o.json().catch(()=>({error:"Request failed"}));throw{status:o.status,message:f.error||"Request failed"}}return o.json()}function Vv({twilioStatus:u,authStatus:o}){const[f,r]=S.useState([]),y=fl(),[g,x]=S.useState(()=>localStorage.getItem("theme")==="dark"||!localStorage.getItem("theme")&&window.matchMedia("(prefers-color-scheme: dark)").matches);S.useEffect(()=>{ve("/api/conversations").then(r).catch(()=>{})},[]),S.useEffect(()=>{g?(document.body.classList.add("dark"),document.body.classList.remove("light"),localStorage.setItem("theme","dark")):(document.body.classList.remove("dark"),document.body.classList.add("light"),localStorage.setItem("theme","light"))},[g]);const C=h=>{const v=new Date(h.timestamp).toLocaleDateString(void 0,{month:"short",day:"numeric"}),p=h.firstMessage.slice(0,30);return`${v} - ${p}`};return c.jsxs("div",{className:"sidebar",children:[c.jsx("div",{style:{padding:"24px 16px 8px 24px",display:"flex",alignItems:"center",gap:10},children:c.jsx("span",{style:{fontSize:"28px",fontWeight:"400",fontFamily:"'IBM Plex Serif', serif",letterSpacing:"-0.5px",color:"var(--text-primary)"},children:"VoiceCC"})}),c.jsxs("div",{className:"sidebar-nav",children:[c.jsxs(Vt,{to:"/",className:`sidebar-item ${y.pathname==="/"?"active":""}`,style:{textDecoration:"none",display:"flex",alignItems:"center"},children:[c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),c.jsx("polyline",{points:"9 22 9 12 15 12 15 22"})]}),"Home"]}),c.jsxs(Vt,{to:"/agents",className:`sidebar-item ${y.pathname.startsWith("/agents")?"active":""}`,style:{textDecoration:"none",display:"flex",alignItems:"center"},children:[c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),c.jsx("circle",{cx:"9",cy:"7",r:"4"}),c.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),c.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),"Agents"]}),c.jsxs(Vt,{to:"/settings",className:`sidebar-item ${y.pathname.startsWith("/settings")?"active":""}`,style:{textDecoration:"none",display:"flex",alignItems:"center"},children:[c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("circle",{cx:"12",cy:"12",r:"3"}),c.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),"Settings"]}),c.jsx("div",{className:"sidebar-section-label",style:{marginTop:16,flexShrink:0},children:"History"}),c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,flex:1,overflowY:"auto"},children:[f.length===0&&c.jsx("div",{style:{padding:"8px 12px",fontSize:13,color:"var(--text-secondary)"},children:"No history yet."}),f.map(h=>c.jsx(Vt,{to:`/c/${h.sessionId}`,className:`sidebar-conversation ${y.pathname===`/c/${h.sessionId}`?"active":""}`,title:h.firstMessage,style:{textDecoration:"none",display:"block"},children:C(h)},h.sessionId))]})]}),c.jsxs("div",{className:"sidebar-footer",children:[o===!1&&c.jsx("div",{style:{margin:"0 12px 8px",padding:"8px 10px",fontSize:12,color:"#d73a49",background:"var(--bg-tertiary)",borderRadius:6,border:"1px solid #d73a49"},children:"Claude not authenticated"}),c.jsxs("button",{className:"sidebar-item",onClick:()=>x(!g),children:[g?c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("circle",{cx:"12",cy:"12",r:"5"}),c.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),c.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),c.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),c.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),c.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),c.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),c.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),c.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),g?"Light Mode":"Dark Mode"]}),c.jsxs("button",{className:"sidebar-item",onClick:()=>{},children:[c.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("circle",{cx:"12",cy:"12",r:"10"}),c.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),c.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),"Support"]})]})]})}function Xv(){const[u,o]=S.useState({running:!1,tunnelUrl:null}),[f,r]=S.useState({running:!1,tunnelUrl:null}),[y,g]=S.useState(null),[x,C]=S.useState(null),[h,d]=S.useState(!1);S.useEffect(()=>{const p=()=>{ve("/api/twilio/status").then(o).catch(()=>{}),ve("/api/browser-call/status").then(r).catch(()=>{})};p();const E=setInterval(p,5e3);return()=>clearInterval(E)},[]),S.useEffect(()=>{ve("/api/auth").then(p=>g(p.authenticated)).catch(()=>g(!1))},[]),S.useEffect(()=>{ve("/api/version").then(C).catch(()=>{})},[]);const v=x?.updateAvailable&&!h;return c.jsxs("div",{style:{display:"flex",height:"100vh"},children:[c.jsx(Vv,{twilioStatus:u,authStatus:y}),c.jsxs("div",{className:"main",style:{display:"flex",flexDirection:"column",height:"100vh",overflow:"hidden"},children:[v&&c.jsxs("div",{style:{padding:"8px 16px",background:"var(--bg-surface)",borderBottom:"1px solid var(--border-color)",fontSize:12,color:"var(--text-secondary)",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0},children:[c.jsxs("span",{children:["Update available: ",c.jsxs("strong",{style:{color:"var(--text-primary)"},children:["v",x.latest]})," (current: v",x.current,"). Run ",c.jsx("code",{style:{background:"var(--bg-main)",padding:"1px 5px",fontFamily:'"SF Mono", "Fira Code", monospace',fontSize:11,color:"var(--accent-color)"},children:"npm install -g voicecc"})," to update."]}),c.jsx("button",{onClick:()=>d(!0),style:{background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer",fontSize:14,padding:"0 4px",lineHeight:1},children:"x"})]}),c.jsx(nv,{context:{authStatus:y,setAuthStatus:g,browserCallStatus:f}})]})]})}const kv={display:"flex",gap:0,marginBottom:20,borderBottom:"1px solid var(--border-color)"},Nh=u=>({padding:"8px 16px",fontSize:13,fontWeight:u?600:400,color:u?"var(--text-primary)":"var(--text-secondary)",background:"none",border:"none",borderBottom:u?"2px solid var(--accent-color)":"2px solid transparent",cursor:"pointer",marginBottom:-1}),Zv={fontSize:12,color:"var(--text-secondary)",background:"color-mix(in srgb, var(--warning-color, #f59e0b) 8%, transparent)",border:"1px solid color-mix(in srgb, var(--warning-color, #f59e0b) 20%, transparent)",padding:"8px 12px",borderRadius:6,marginTop:12,lineHeight:1.5},_h={width:"100%",padding:"8px 10px",fontSize:13,fontFamily:'"SF Mono", "Fira Code", monospace',background:"var(--bg-main)",border:"1px solid var(--border-color)",color:"var(--text-primary)",boxSizing:"border-box"},Ws={display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},Fs={background:"var(--btn-secondary-bg)",color:"var(--btn-secondary-text)",border:"1px solid var(--btn-secondary-border)"},Kv={fontSize:10,fontWeight:600,color:"var(--accent-color)",background:"color-mix(in srgb, var(--accent-color) 12%, transparent)",padding:"2px 6px",borderRadius:4,marginLeft:6,verticalAlign:"middle"};function cm({onClose:u,onAuthenticated:o}){const[f,r]=S.useState("oauth"),[y,g]=S.useState(null),[x,C]=S.useState(""),[h,d]=S.useState(!1),[v,p]=S.useState(!1),[E,z]=S.useState(null),[N,_]=S.useState(""),[O,B]=S.useState(!1),[H,G]=S.useState(null),I=k=>{k.target===k.currentTarget&&u()},P=async()=>{d(!0),z(null),g(null),C("");try{const k=await tt("/api/auth/oauth/start");g(k.url)}catch(k){z(k?.message||"Failed to start login")}d(!1)},V=async()=>{const k=x.trim();if(k){p(!0),z(null);try{(await tt("/api/auth/oauth/code",{code:k})).authenticated?(o(),u()):z("Login completed but authentication check failed. Try again.")}catch(X){z(X?.message||"Failed to complete login")}p(!1)}},K=async()=>{const k=N.trim();if(k){B(!0),G(null);try{(await tt("/api/auth/token",{token:k})).authenticated?(o(),u()):G("Token was saved but authentication failed. Check that the token is valid.")}catch(X){G(X?.message||"Failed to save token")}B(!1)}};return c.jsx("div",{className:"modal-overlay visible",onClick:I,children:c.jsxs("div",{className:"modal",style:{width:520},children:[c.jsx("button",{className:"modal-close",onClick:u,children:"×"}),c.jsx("h2",{children:"Authenticate with Claude"}),c.jsxs("div",{style:kv,children:[c.jsxs("button",{style:Nh(f==="oauth"),onClick:()=>r("oauth"),children:["Login with Claude",c.jsx("span",{style:Kv,children:"recommended"})]}),c.jsx("button",{style:Nh(f==="token"),onClick:()=>r("token"),children:"Setup Token"})]}),f==="oauth"&&c.jsxs("div",{children:[!y&&c.jsxs("div",{children:[c.jsx("div",{style:{fontSize:13,color:"var(--text-secondary)",lineHeight:1.6},children:c.jsx("p",{style:{marginBottom:12},children:"Sign in with your Claude account. This authenticates the CLI directly, enabling all features including cloud integrations like Gmail, Google Calendar, and Slack."})}),c.jsxs("div",{style:Ws,children:[c.jsx("button",{style:Fs,onClick:u,children:"Cancel"}),c.jsx("button",{onClick:P,disabled:h,children:h?"Starting...":"Start login"})]})]}),y&&c.jsxs("div",{children:[c.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)",lineHeight:1.6},children:[c.jsx("p",{style:{marginBottom:12},children:"Open this URL in your browser and sign in:"}),c.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",style:{display:"block",background:"var(--bg-main)",border:"1px solid var(--border-color)",padding:"8px 12px",fontFamily:'"SF Mono", "Fira Code", monospace',fontSize:11,color:"var(--accent-color)",marginBottom:12,wordBreak:"break-all",textDecoration:"none"},children:y}),c.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginBottom:16},children:"Click the link to open it in your browser. After signing in, paste the code below."})]}),c.jsx("input",{type:"text",placeholder:"Paste the code here...",value:x,onChange:k=>C(k.target.value),onKeyDown:k=>{k.key==="Enter"&&V()},style:_h,autoFocus:!0}),c.jsxs("div",{style:Ws,children:[c.jsx("button",{style:Fs,onClick:u,children:"Cancel"}),c.jsx("button",{onClick:V,disabled:v||!x.trim(),children:v?"Authenticating...":"Submit code"})]})]}),E&&c.jsx("p",{style:{fontSize:12,color:"#d73a49",marginTop:8},children:E})]}),f==="token"&&c.jsxs("div",{children:[c.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:16,lineHeight:1.5},children:[c.jsx("p",{style:{marginBottom:12},children:"Run the following command in your terminal to generate a token:"}),c.jsx("code",{style:{display:"block",background:"var(--bg-main)",border:"1px solid var(--border-color)",padding:"8px 12px",fontFamily:'"SF Mono", "Fira Code", monospace',fontSize:12,color:"var(--accent-color)",marginBottom:12},children:"claude setup-token"}),c.jsx("p",{children:"Complete the sign-in in your browser, then paste the token below."})]}),c.jsx("input",{type:"password",placeholder:"sk-ant-oat01-...",value:N,onChange:k=>_(k.target.value),onKeyDown:k=>{k.key==="Enter"&&K()},style:_h}),c.jsx("div",{style:Zv,children:'Cloud MCP servers (Gmail, Google Calendar, Slack, etc.) will not be available with this method. Use "Login with Claude" for full integration support.'}),H&&c.jsx("p",{style:{fontSize:12,color:"#d73a49",marginTop:8},children:H}),c.jsxs("div",{style:Ws,children:[c.jsx("button",{style:Fs,onClick:u,children:"Cancel"}),c.jsx("button",{onClick:K,disabled:O||!N.trim(),children:O?"Saving...":"Save token"})]})]})]})})}function Jv(){const{authStatus:u,setAuthStatus:o}=Fh(),[f,r]=S.useState(null),[y,g]=S.useState(null),[x,C]=S.useState(!1);return S.useEffect(()=>{ve("/api/browser-call/status").then(h=>r(h.running)).catch(()=>r(!1)),ve("/api/mcp-servers").then(h=>g(h.servers)).catch(()=>g([]))},[]),c.jsxs("div",{className:"page active",style:{display:"flex",flexDirection:"column"},children:[c.jsx("div",{className:"page-header",style:{padding:"48px 64px 24px"},children:c.jsxs("div",{children:[c.jsx("h1",{children:"Getting started"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginTop:4},children:"Set up your environment to get started."})]})}),c.jsxs("div",{style:{padding:"0 64px 48px"},children:[c.jsxs("div",{className:"settings-panel",children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Connect your Claude Code"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:20},children:"VoiceCC needs an authenticated Claude Code session to work. The check below verifies your local CLI is logged in."}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:u===null?"#666":u?"var(--accent-color)":"#d73a49",flexShrink:0}}),c.jsx("span",{style:{fontSize:13,color:u===null?"var(--text-secondary)":u?"var(--accent-color)":"#d73a49"},children:u===null?"Checking authentication...":u?"Claude Code is authenticated":"Claude Code is not authenticated"})]}),u===!1&&c.jsx("div",{className:"settings-actions",children:c.jsx("button",{onClick:()=>C(!0),children:"Set up authentication"})})]}),x&&c.jsx(cm,{onClose:()=>C(!1),onAuthenticated:()=>o(!0)}),c.jsxs("div",{className:"settings-panel",children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Enable calling from anywhere"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:20},children:"Call your voice assistant from any device using a browser."}),c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:f===null?"#666":f?"var(--accent-color)":"#d73a49",flexShrink:0}}),c.jsx("span",{style:{fontSize:13,color:f===null?"var(--text-secondary)":f?"var(--accent-color)":"#d73a49"},children:f===null?"Checking status...":f?"Browser calling is active":"Browser calling is not enabled"})]}),f===!1&&c.jsx("div",{className:"settings-actions",children:c.jsx(Vt,{to:"/settings?tab=integrations",style:{textDecoration:"none"},children:c.jsx("button",{children:"Set up in Settings"})})})]}),c.jsxs("div",{className:"settings-panel",children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"MCP Integrations"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:20},children:"Connect external tools and services via MCP servers."}),y===null&&c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"#666",flexShrink:0}}),c.jsx("span",{style:{fontSize:13,color:"var(--text-secondary)"},children:"Checking..."})]}),y!==null&&y.length===0&&c.jsx("div",{className:"settings-actions",children:c.jsx(Vt,{to:"/settings?tab=integrations",style:{textDecoration:"none"},children:c.jsx("button",{children:"Set up in Settings"})})}),y!==null&&y.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:y.map(h=>c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:h.status==="connected"?"var(--accent-color)":h.status==="needs_auth"?"#d29922":"#d73a49",flexShrink:0}}),c.jsx("span",{style:{fontSize:13,color:"var(--text-primary)"},children:h.name})]},h.name))}),c.jsx("div",{className:"settings-actions",children:c.jsx(Vt,{to:"/settings?tab=integrations",style:{textDecoration:"none"},children:c.jsx("button",{children:"Add more in Settings"})})})]})]})]})]})}const $v=5e3;function Wv({twilioRunning:u}){const[o,f]=S.useState(""),[r,y]=S.useState(""),[g,x]=S.useState(""),[C,h]=S.useState(!1),[d,v]=S.useState({running:!1,url:null}),[p,E]=S.useState(!1),[z,N]=S.useState(""),[_,O]=S.useState(null),[B,H]=S.useState(!1),G=S.useCallback(()=>{ve("/api/auth").then(O).catch(()=>O(null))},[]);S.useEffect(()=>{ve("/api/settings").then(V=>{f(V.MAX_CONCURRENT_SESSIONS||""),y(V.USER_PHONE_NUMBER||"")}).catch(()=>x("Error loading settings")),G()},[G]),S.useEffect(()=>{const V=()=>{ve("/api/tunnel/status").then(v).catch(()=>{})};V();const K=setInterval(V,$v);return()=>clearInterval(K)},[]);const I=S.useCallback(async()=>{h(!0),x("Saving...");try{await tt("/api/settings",{MAX_CONCURRENT_SESSIONS:o,USER_PHONE_NUMBER:r}),x("Saved!"),setTimeout(()=>x(V=>V==="Saved!"?"":V),2e3)}catch{x("Error saving settings")}h(!1)},[o,r]),P=S.useCallback(async()=>{E(!0),N("");try{d.running?await tt("/api/tunnel/stop"):await tt("/api/tunnel/start");const V=await ve("/api/tunnel/status");v(V)}catch(V){const K=V instanceof Error?V.message:V?.message||"Failed";N(K),setTimeout(()=>N(""),5e3)}finally{E(!1)}},[d.running]);return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"page-header",style:{borderBottom:"none",padding:0,marginBottom:24},children:c.jsxs("div",{children:[c.jsx("h1",{children:"General Settings"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginTop:4},children:"Manage your workspace settings and core behavior."})]})}),c.jsxs("div",{className:"settings-panel",children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Authentication"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:20},children:"Claude Code authentication status for this server."}),_===null&&c.jsx("div",{style:{fontSize:13,color:"var(--text-secondary)"},children:"Checking..."}),_&&!_.authenticated&&c.jsxs("div",{children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"#d73a49",flexShrink:0}}),c.jsx("span",{style:{fontSize:14,fontWeight:500,color:"var(--text-primary)"},children:"Not authenticated"})]}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:16},children:"Claude Code is not logged in. Sign in to enable voice sessions."}),c.jsx("button",{onClick:()=>H(!0),children:"Sign in"})]}),_&&_.authenticated&&c.jsxs("div",{children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"#22c55e",flexShrink:0}}),c.jsxs("span",{style:{fontSize:14,fontWeight:500,color:"var(--text-primary)"},children:["Authenticated",_.authMethod==="claude.ai"&&c.jsx("span",{style:{fontSize:11,fontWeight:600,color:"var(--accent-color)",background:"color-mix(in srgb, var(--accent-color) 12%, transparent)",padding:"2px 6px",borderRadius:4,marginLeft:8},children:"Claude.ai OAuth"}),_.authMethod!=="claude.ai"&&_.authMethod!=="none"&&c.jsx("span",{style:{fontSize:11,fontWeight:600,color:"var(--text-secondary)",background:"color-mix(in srgb, var(--text-secondary) 12%, transparent)",padding:"2px 6px",borderRadius:4,marginLeft:8},children:_.authMethod})]})]}),_.email&&c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:8},children:_.email}),_.authMethod!=="claude.ai"&&c.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",background:"color-mix(in srgb, var(--warning-color, #f59e0b) 8%, transparent)",border:"1px solid color-mix(in srgb, var(--warning-color, #f59e0b) 20%, transparent)",padding:"8px 12px",borderRadius:6,marginTop:8,lineHeight:1.5},children:["Authenticated via token. Cloud MCP servers (Gmail, Google Calendar, Slack, etc.) are not available with this method."," ",c.jsx("button",{onClick:()=>H(!0),style:{background:"none",border:"none",color:"var(--accent-color)",cursor:"pointer",padding:0,fontSize:12,fontWeight:600,textDecoration:"underline"},children:"Switch to Claude.ai login"})]})]})]}),B&&c.jsx(cm,{onClose:()=>H(!1),onAuthenticated:()=>{H(!1),G()}}),c.jsxs("div",{className:"settings-panel",children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Public Tunnel"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:20},children:"Exposes your voice server via a Cloudflare tunnel. Required if you want to access VoiceCC on a remote server, and/or want to make use of phone calling."}),c.jsx("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:12},children:c.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:p?"wait":"pointer"},children:[c.jsx("input",{type:"checkbox",checked:d.running,disabled:p,onChange:P,style:{width:16,height:16,cursor:p?"wait":"pointer"}}),c.jsx("span",{style:{fontSize:14,fontWeight:500,color:"var(--text-primary)"},children:p?d.running?"Stopping...":"Starting...":d.running?"Enabled":"Disabled"})]})}),d.running&&d.url&&c.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)"},children:["URL: ",c.jsx("code",{style:{userSelect:"all",cursor:"text"},children:d.url})]}),z&&c.jsx("div",{style:{color:"#d73a49",marginTop:8,fontSize:12},children:z})]}),c.jsxs("div",{className:"settings-panel",children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"General Options"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:20},children:"Configure the core behavior of your voice assistant instance."}),c.jsxs("div",{className:"settings-row",children:[c.jsx("label",{htmlFor:"setting-max-sessions",style:{fontWeight:500,color:"var(--text-primary)"},children:"Max Concurrent Sessions"}),c.jsx("input",{type:"text",id:"setting-max-sessions",placeholder:"2",value:o,onChange:V=>f(V.target.value)})]}),c.jsxs("div",{className:"settings-row",children:[c.jsx("label",{htmlFor:"setting-user-phone",style:{fontWeight:500,color:"var(--text-primary)"},children:"Your Phone Number"}),c.jsx("input",{type:"text",id:"setting-user-phone",placeholder:"+15551234567",value:r,onChange:V=>y(V.target.value)})]}),c.jsxs("div",{className:"settings-actions",style:{marginTop:20},children:[c.jsx("button",{disabled:C,onClick:I,children:"Save changes"}),c.jsx("span",{className:"settings-status",children:g})]})]})]})}const sm="JBFqnCBsd6RMkjVDRZzb",rm="eleven_turbo_v2_5",om="scribe_v1";async function Fv(){return ve("/api/providers/tts")}async function Iv(){return ve("/api/providers/stt")}async function Pv(){return ve("/api/settings")}function e0({status:u}){let o,f,r;return u.ready?(o="Ready",f="rgba(34, 197, 94, 0.15)",r="#22c55e"):u.reason==="missing_api_key"?(o="Missing API Key",f="rgba(239, 68, 68, 0.15)",r="#ef4444"):(o="Unknown",f="rgba(156, 163, 175, 0.15)",r="#9ca3af"),c.jsx("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:600,background:f,color:r},children:o})}function Oh({provider:u,selected:o,onSelect:f,onAction:r,actionLabel:y,actionDisabled:g}){const x=!u.status.ready;return c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 12px",border:o?"1px solid var(--btn-primary-bg)":"1px solid var(--border-color)",borderRadius:"4px",background:o?"rgba(59, 130, 246, 0.05)":"var(--bg-main)",cursor:x?"default":"pointer",transition:"all 0.15s ease"},onClick:x?void 0:f,children:[c.jsx("input",{type:"radio",checked:o,disabled:x,onChange:x?void 0:f,style:{margin:0,cursor:x?"default":"pointer"}}),c.jsxs("div",{style:{flex:1,minWidth:0},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[c.jsx("span",{style:{fontSize:"13px",fontWeight:600,color:"var(--text-primary)"},children:u.name}),c.jsx(e0,{status:u.status})]}),c.jsx("div",{style:{fontSize:"12px",color:"var(--text-secondary)",marginTop:"2px"},children:u.description})]}),r&&y&&c.jsx("button",{disabled:g,onClick:C=>{C.stopPropagation(),r()},style:{padding:"4px 12px",fontSize:"12px",background:"var(--btn-primary-bg)",color:"var(--btn-primary-text)",border:"none",borderRadius:"4px",cursor:g?"default":"pointer",opacity:g?.6:1},children:y})]})}const Vn={marginBottom:14},Xn={display:"block",fontSize:12,fontWeight:500,color:"var(--text-primary)",marginBottom:4},kn={width:"100%",boxSizing:"border-box"},fm={display:"flex",justifyContent:"flex-end",gap:8,marginTop:8},dm={padding:"6px 16px",fontSize:"13px",background:"var(--bg-main)",color:"var(--text-primary)",border:"1px solid var(--border-color)",borderRadius:"4px",cursor:"pointer"},hm={padding:"6px 16px",fontSize:"13px",background:"var(--btn-primary-bg)",color:"var(--btn-primary-text)",border:"none",borderRadius:"4px",cursor:"pointer"};function t0({apiKey:u,voiceId:o,modelId:f,onSave:r,onClose:y}){const[g,x]=S.useState(u),[C,h]=S.useState(o),[d,v]=S.useState(f),p=()=>{r({apiKey:g,voiceId:C,modelId:d}),y()};return c.jsx("div",{className:"modal-overlay visible",onClick:E=>{E.target===E.currentTarget&&y()},children:c.jsxs("div",{className:"modal",style:{width:480},children:[c.jsx("button",{className:"modal-close",onClick:y,children:"×"}),c.jsx("h2",{children:"ElevenLabs TTS"}),c.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:16},children:"Configure API key, voice, and model for ElevenLabs text-to-speech."}),c.jsxs("div",{style:Vn,children:[c.jsx("label",{style:Xn,children:"API Key"}),c.jsx("input",{type:"password",value:g,onChange:E=>x(E.target.value),placeholder:"Enter your ElevenLabs API key",style:kn})]}),c.jsxs("div",{style:Vn,children:[c.jsx("label",{style:Xn,children:"Voice ID"}),c.jsx("input",{type:"text",value:C,onChange:E=>h(E.target.value),placeholder:sm,style:kn})]}),c.jsxs("div",{style:Vn,children:[c.jsx("label",{style:Xn,children:"TTS Model ID"}),c.jsx("input",{type:"text",value:d,onChange:E=>v(E.target.value),placeholder:rm,style:kn})]}),c.jsxs("div",{style:fm,children:[c.jsx("button",{onClick:y,style:dm,children:"Cancel"}),c.jsx("button",{onClick:p,style:hm,children:"Apply"})]})]})})}function l0({apiKey:u,sttModelId:o,onSave:f,onClose:r}){const[y,g]=S.useState(u),[x,C]=S.useState(o),h=()=>{f({apiKey:y,sttModelId:x}),r()};return c.jsx("div",{className:"modal-overlay visible",onClick:d=>{d.target===d.currentTarget&&r()},children:c.jsxs("div",{className:"modal",style:{width:480},children:[c.jsx("button",{className:"modal-close",onClick:r,children:"×"}),c.jsx("h2",{children:"ElevenLabs STT"}),c.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:16},children:"Configure API key and model for ElevenLabs speech-to-text."}),c.jsxs("div",{style:Vn,children:[c.jsx("label",{style:Xn,children:"API Key"}),c.jsx("input",{type:"password",value:y,onChange:d=>g(d.target.value),placeholder:"Enter your ElevenLabs API key",style:kn})]}),c.jsxs("div",{style:Vn,children:[c.jsx("label",{style:Xn,children:"STT Model ID"}),c.jsx("input",{type:"text",value:x,onChange:d=>C(d.target.value),placeholder:om,style:kn})]}),c.jsxs("div",{style:fm,children:[c.jsx("button",{onClick:r,style:dm,children:"Cancel"}),c.jsx("button",{onClick:h,style:hm,children:"Apply"})]})]})})}function a0(){const[u,o]=S.useState([]),[f,r]=S.useState([]),[y,g]=S.useState("elevenlabs"),[x,C]=S.useState("elevenlabs"),[h,d]=S.useState(""),[v,p]=S.useState(sm),[E,z]=S.useState(rm),[N,_]=S.useState(om),[O,B]=S.useState(null),H=S.useCallback(async V=>{try{await tt("/api/settings",V)}catch{}},[]);S.useEffect(()=>{Fv().then(V=>{o(V.providers),g(V.active)}).catch(()=>{}),Iv().then(V=>{r(V.providers),C(V.active)}).catch(()=>{}),Pv().then(V=>{V.ELEVENLABS_API_KEY&&d(V.ELEVENLABS_API_KEY),V.ELEVENLABS_VOICE_ID&&p(V.ELEVENLABS_VOICE_ID),V.ELEVENLABS_MODEL_ID&&z(V.ELEVENLABS_MODEL_ID),V.ELEVENLABS_STT_MODEL_ID&&_(V.ELEVENLABS_STT_MODEL_ID)}).catch(()=>{})},[]);const G=S.useCallback(V=>{g(V),H({TTS_PROVIDER:V})},[H]),I=S.useCallback(V=>{C(V),H({STT_PROVIDER:V})},[H]),P=(V,K,k)=>{const X=k==="tts"?"elevenlabs-tts":"elevenlabs-stt";return{label:"Configure",onAction:()=>B({kind:X})}};return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"page-header",style:{borderBottom:"none",padding:0,marginBottom:24},children:c.jsxs("div",{children:[c.jsx("h1",{children:"Voice Providers"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginTop:4},children:"Select and configure TTS and STT providers. Changes take effect on the next voice session."})]})}),c.jsxs("div",{className:"settings-panel",style:{marginBottom:24},children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"TTS Provider"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:16},children:"Choose which text-to-speech engine to use."}),c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:u.map(V=>{const K=P(V.type,V.status,"tts");return c.jsx(Oh,{provider:V,selected:y===V.type,onSelect:()=>G(V.type),onAction:K.onAction,actionLabel:K.label},V.type)})})]}),c.jsxs("div",{className:"settings-panel",style:{marginBottom:24},children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"STT Provider"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:16},children:"Choose which speech-to-text engine to use."}),c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:f.map(V=>{const K=P(V.type,V.status,"stt");return c.jsx(Oh,{provider:V,selected:x===V.type,onSelect:()=>I(V.type),onAction:K.onAction,actionLabel:K.label},V.type)})})]}),O?.kind==="elevenlabs-tts"&&c.jsx(t0,{apiKey:h,voiceId:v,modelId:E,onSave:V=>{d(V.apiKey),p(V.voiceId),z(V.modelId),H({ELEVENLABS_API_KEY:V.apiKey,ELEVENLABS_VOICE_ID:V.voiceId,ELEVENLABS_MODEL_ID:V.modelId})},onClose:()=>B(null)}),O?.kind==="elevenlabs-stt"&&c.jsx(l0,{apiKey:h,sttModelId:N,onSave:V=>{d(V.apiKey),_(V.sttModelId),H({ELEVENLABS_API_KEY:V.apiKey,ELEVENLABS_STT_MODEL_ID:V.sttModelId})},onClose:()=>B(null)})]})}function n0({onClose:u}){const[o,f]=S.useState(""),[r,y]=S.useState(""),[g,x]=S.useState(null),[C,h]=S.useState([]),[d,v]=S.useState(""),[p,E]=S.useState(!1),[z,N]=S.useState(!1),[_,O]=S.useState(""),[B,H]=S.useState("");S.useEffect(()=>{ve("/api/settings").then($=>{$.TWILIO_ACCOUNT_SID&&f($.TWILIO_ACCOUNT_SID),$.TWILIO_AUTH_TOKEN&&y($.TWILIO_AUTH_TOKEN)}).catch(()=>{}),ve("/api/integrations").then($=>E($.twilio.enabled)).catch(()=>{}),G();const X=setInterval(G,5e3);return()=>clearInterval(X)},[]),S.useEffect(()=>{o&&r&&ve("/api/twilio/phone-numbers").then(X=>h(X.numbers||[])).catch(()=>{})},[o,r]);const G=()=>{ve("/api/twilio/status").then(x).catch(()=>{})},I=S.useCallback(async(X,$)=>{try{return await tt("/api/settings",{[X]:$}),!0}catch{return!1}},[]),P=S.useCallback(async()=>{const X=!p;N(!0);try{await tt("/api/integrations/twilio",{enabled:X}),E(X),G()}catch($){const ae=$ instanceof Error?$.message:$?.message||"Failed";v(ae),setTimeout(()=>v(""),4e3)}finally{N(!1)}},[p]),V=X=>{X.target===X.currentTarget&&u()},K=g?.running??!1,k=g?.tunnelUrl?`${g.tunnelUrl}/twilio/incoming-call`:null;return c.jsx("div",{className:"modal-overlay visible",onClick:V,children:c.jsxs("div",{className:"modal",children:[c.jsx("button",{className:"modal-close",onClick:u,children:"×"}),c.jsx("h2",{children:"Twilio Voice Setup"}),c.jsxs("div",{className:"setup-step",children:[c.jsxs("div",{className:"setup-step-title",children:[c.jsx("span",{className:"setup-step-number",children:"1"}),"Create a Twilio account"]}),c.jsxs("div",{className:"setup-step-desc",children:["Sign up at ",c.jsx("a",{href:"https://www.twilio.com/try-twilio",target:"_blank",rel:"noreferrer",children:"twilio.com/try-twilio"}),". Copy your Account SID and Auth Token from the console dashboard."]}),c.jsxs("div",{className:"setup-paste-row",children:[c.jsx("input",{type:"text",placeholder:"Account SID (ACxxxxxxxx...)",value:o,onChange:X=>f(X.target.value)}),c.jsx(Dh,{onClick:()=>I("TWILIO_ACCOUNT_SID",o.trim())})]}),c.jsxs("div",{className:"setup-paste-row",children:[c.jsx("input",{type:"text",placeholder:"Auth Token",value:r,onChange:X=>y(X.target.value)}),c.jsx(Dh,{onClick:()=>I("TWILIO_AUTH_TOKEN",r.trim())})]})]}),c.jsxs("div",{className:"setup-step",children:[c.jsxs("div",{className:"setup-step-title",children:[c.jsx("span",{className:"setup-step-number",children:"2"}),"Get a phone number"]}),c.jsxs("div",{className:"setup-step-desc",children:["In the Twilio console, go to ",c.jsx("strong",{children:"Phone Numbers"})," → ",c.jsx("strong",{children:"Buy a Number"}),". Pick any number with voice capability."]})]}),c.jsx("hr",{className:"setup-divider"}),c.jsxs("div",{className:"setup-step",children:[c.jsxs("div",{className:"setup-step-title",children:[c.jsx("span",{className:"setup-step-number",children:"3"}),K?"Server running":"Enable integration"]}),c.jsxs("div",{className:"setup-step-desc",children:[K?c.jsxs(c.Fragment,{children:["Server is running.",g?.tunnelUrl&&c.jsxs(c.Fragment,{children:[" Tunnel URL: ",c.jsx("code",{children:g.tunnelUrl})]})]}):"Enable to start the Twilio server and auto-start on boot.",d&&c.jsx("div",{style:{color:"#d73a49",marginTop:4,fontSize:12},children:d})]}),c.jsx("div",{className:"setup-paste-row",children:c.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:z?"wait":"pointer"},children:[c.jsx("input",{type:"checkbox",checked:p,disabled:z,onChange:P,style:{width:16,height:16,cursor:z?"wait":"pointer"}}),c.jsx("span",{style:{fontSize:14,fontWeight:500,color:"var(--text-primary)"},children:z?p?"Stopping...":"Starting...":"Enabled"})]})})]}),c.jsxs("div",{className:"setup-step",children:[c.jsxs("div",{className:"setup-step-title",children:[c.jsx("span",{className:"setup-step-number",children:"4"}),"Configure the Twilio webhook"]}),c.jsx("div",{className:"setup-step-desc",children:k?c.jsxs(c.Fragment,{children:["In the Twilio console, go to your phone number's configuration.",c.jsx("br",{}),"Under ",c.jsx("strong",{children:"Voice & Fax"})," → ",c.jsx("strong",{children:"A Call Comes In"}),", set:",c.jsx("br",{}),c.jsx("code",{style:{userSelect:"all",cursor:"text"},children:k}),c.jsx("br",{}),"Method: ",c.jsx("strong",{children:"HTTP POST"})]}):"Start the server first, then the webhook URL will appear here."})]}),c.jsx("hr",{className:"setup-divider"}),c.jsxs("div",{className:"setup-step",children:[c.jsxs("div",{className:"setup-step-title",children:[c.jsx("span",{className:"setup-step-number",children:"5"}),"Your phone number"]}),c.jsx("div",{className:"setup-step-desc",children:C.length>0?c.jsxs(c.Fragment,{children:["Call this number to talk to Claude:",c.jsx("br",{}),C.map(X=>c.jsx("strong",{style:{color:"#d4d4d4",fontSize:16,fontFamily:"SF Mono, Fira Code, monospace",display:"inline-block",marginTop:4},children:X.phoneNumber},X.phoneNumber))]}):o&&r?"Fetching phone number...":"Set your Account SID and Auth Token to fetch your phone number."})]}),c.jsx("hr",{className:"setup-divider"}),c.jsxs("div",{className:"setup-step",children:[c.jsxs("div",{className:"setup-step-title",children:[c.jsx("span",{className:"setup-step-number",children:"6"}),"Test your setup"]}),c.jsxs("div",{className:"setup-step-desc",children:["Enter your phone number and we'll call you with a test message.",B&&c.jsx("div",{style:{color:B.startsWith("Error")?"#d73a49":"#2ea043",marginTop:4,fontSize:12},children:B})]}),c.jsxs("div",{className:"setup-paste-row",children:[c.jsx("input",{type:"tel",placeholder:"+1234567890",value:_,onChange:X=>O(X.target.value)}),c.jsx("button",{disabled:!_.trim()||!o||!r||B==="Calling...",onClick:async()=>{H("Calling...");try{await tt("/api/twilio/test-call",{to:_.trim()}),H("Call initiated! Check your phone.")}catch(X){const $=X instanceof Error?X.message:X?.message||"Failed";H(`Error: ${$}`)}setTimeout(()=>H(""),6e3)},children:"Test Call"})]})]})]})})}function Dh({onClick:u}){const[o,f]=S.useState("Apply"),[r,y]=S.useState(!1),g=async()=>{f("Saving...");const x=await u();f(x?"Saved":"Error"),y(x),setTimeout(()=>{f("Apply"),y(!1)},1500)};return c.jsx("button",{className:r?"applied":"",onClick:g,children:o})}const i0=5e3;function u0({onClose:u}){const[o,f]=S.useState(null),[r,y]=S.useState(""),[g,x]=S.useState(!1),[C,h]=S.useState(!1);S.useEffect(()=>{ve("/api/integrations").then(_=>x(_.browserCall.enabled)).catch(()=>{}),d();const N=setInterval(d,i0);return()=>clearInterval(N)},[]);const d=()=>{ve("/api/browser-call/status").then(f).catch(()=>{})},v=S.useCallback(async()=>{const N=!g;h(!0);try{await tt("/api/integrations/browser-call",{enabled:N}),x(N),d()}catch(_){const O=_ instanceof Error?_.message:_?.message||"Failed";y(O),setTimeout(()=>y(""),4e3)}finally{h(!1)}},[g]),p=N=>{N.target===N.currentTarget&&u()},E=o?.running??!1,z=o?.tunnelUrl?`${o.tunnelUrl}/call`:null;return c.jsx("div",{className:"modal-overlay visible",onClick:p,children:c.jsxs("div",{className:"modal",children:[c.jsx("button",{className:"modal-close",onClick:u,children:"×"}),c.jsx("h2",{children:"Browser Call from Anywhere"}),c.jsxs("div",{className:"setup-step",children:[c.jsxs("div",{className:"setup-step-title",children:[c.jsx("span",{className:"setup-step-number",children:"1"}),E?"Server running":"Enable integration"]}),c.jsxs("div",{className:"setup-step-desc",children:[E?c.jsxs(c.Fragment,{children:["Server is running.",o?.tunnelUrl&&c.jsxs(c.Fragment,{children:[" Tunnel URL: ",c.jsx("code",{children:o.tunnelUrl})]})]}):"Enable to start the browser call server and auto-start on boot.",r&&c.jsx("div",{style:{color:"#d73a49",marginTop:4,fontSize:12},children:r})]}),c.jsx("div",{className:"setup-paste-row",children:c.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:C?"wait":"pointer"},children:[c.jsx("input",{type:"checkbox",checked:g,disabled:C,onChange:v,style:{width:16,height:16,cursor:C?"wait":"pointer"}}),c.jsx("span",{style:{fontSize:14,fontWeight:500,color:"var(--text-primary)"},children:C?g?"Stopping...":"Starting...":"Enabled"})]})})]}),c.jsx("hr",{className:"setup-divider"}),c.jsxs("div",{className:"setup-step",children:[c.jsxs("div",{className:"setup-step-title",children:[c.jsx("span",{className:"setup-step-number",children:"2"}),"Call from any device"]}),c.jsx("div",{className:"setup-step-desc",children:z?c.jsxs(c.Fragment,{children:["Open this URL on any device to start a voice call:",c.jsx("br",{}),c.jsx("a",{href:z,target:"_blank",rel:"noreferrer",style:{wordBreak:"break-all"},children:z}),c.jsx("br",{}),"Or use the ",c.jsx("strong",{children:"Call via Browser"})," button in the sidebar to get a QR code."]}):"Start the server first (step 2), then the call page URL will appear here."})]})]})})}const c0=[{name:"notion",description:"Connect to Notion workspaces, pages, and databases.",url:"https://mcp.notion.com/mcp",transport:"http"},{name:"figma",description:"Read Figma designs, components, and design tokens.",url:"https://mcp.figma.com/mcp",transport:"http"},{name:"sentry",description:"Access Sentry issues, events, and project data.",url:"https://mcp.sentry.dev/mcp",transport:"http"},{name:"context7",description:"Fetch up-to-date library docs and code examples.",url:"https://mcp.context7.com/mcp",transport:"http"},{name:"langfuse",description:"Search Langfuse documentation and API references.",url:"https://langfuse.com/api/mcp",transport:"http"},{name:"slack",description:"Send messages, create canvases, and fetch Slack data.",url:"https://mcp.slack.com/mcp",transport:"http"},{name:"atlassian",description:"Access Jira & Confluence from Claude.",url:"https://mcp.atlassian.com/v1/mcp",transport:"http"},{name:"linear",description:"Manage issues, projects & team workflows in Linear.",url:"https://mcp.linear.app/mcp",transport:"http"},{name:"gamma",description:"Create presentations, docs, socials, and sites with AI.",url:"https://mcp.gamma.app/mcp",transport:"http"},{name:"granola",description:"The AI notepad for meetings.",url:"https://mcp.granola.ai/mcp",transport:"http"}];function mm({message:u,onDismiss:o,timeout:f=4e3}){return S.useEffect(()=>{if(!u)return;const r=setTimeout(o,f);return()=>clearTimeout(r)},[u,o,f]),u?c.jsxs("div",{className:"toast",children:[c.jsx("span",{children:u}),c.jsx("button",{className:"toast-close",onClick:o,children:"×"})]}):null}function s0({servers:u,onClose:o,onAdded:f}){const[r,y]=S.useState(null),[g,x]=S.useState(null),C=u===null,h=p=>u?.find(E=>E.url===p),d=p=>{p.target===p.currentTarget&&o()},v=async p=>{y(p.name);try{await tt("/api/mcp-servers/add",{name:p.name,url:p.url,transport:p.transport,scope:"user"}),await f()}catch(E){const z=E?.message||"Failed to add server";x(z)}y(null)};return c.jsxs("div",{className:"modal-overlay visible",onClick:d,children:[c.jsxs("div",{className:"modal",style:{width:620},children:[c.jsx("button",{className:"modal-close",onClick:o,children:"×"}),c.jsx("h2",{children:"Add MCP Server"}),c.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:16},children:"Select a server to add. Authentication is handled automatically via your browser."}),c.jsx("div",{className:"mcp-add-grid",children:c0.map(p=>{const E=h(p.url),z=E?.status==="needs_auth",N=E?.status==="connected",_=r===p.name;return c.jsxs("div",{className:`mcp-add-card${N?" installed":""}`,children:[c.jsxs("div",{className:"mcp-add-card-header",children:[c.jsx("span",{className:"mcp-add-card-name",children:p.name}),N&&c.jsx("span",{className:"mcp-add-card-badge",children:"Installed"}),z&&c.jsx("span",{className:"mcp-add-card-badge needs-auth",children:"Needs authentication"})]}),c.jsx("p",{className:"mcp-add-card-desc",children:p.description}),c.jsxs("div",{className:"mcp-add-card-footer",children:[c.jsx("span",{className:"mcp-add-card-url",children:p.url}),C?c.jsx("span",{style:{fontSize:11,color:"var(--text-secondary)"},children:"Loading..."}):!E&&c.jsx("button",{className:"mcp-add-card-btn",disabled:_,onClick:()=>v(p),children:_?"Adding...":"Add"})]})]},p.url)})})]}),c.jsx(mm,{message:g,onDismiss:()=>x(null)})]})}function r0({twilioRunning:u,browserCallRunning:o}){const[f,r]=S.useState(null),[y,g]=S.useState(!1),[x,C]=S.useState(!1),[h,d]=S.useState(!1),[v,p]=S.useState(!1),[E,z]=S.useState(null),N=S.useCallback(async()=>{try{const B=await ve("/api/mcp-servers");r(B.servers)}catch{g(!0)}},[]);S.useEffect(()=>{N()},[N]);const _=B=>B==="connected"?"connected":B==="needs_auth"?"needs-auth":"failed",O=B=>B==="connected"?"Connected":B==="needs_auth"?"Needs auth":"Failed";return c.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[c.jsx("div",{className:"page-header",style:{borderBottom:"none",padding:0,marginBottom:24},children:c.jsxs("div",{children:[c.jsx("h1",{children:"Integrations & MCP"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginTop:4},children:"Connect external services and configure MCP servers."})]})}),c.jsxs("div",{className:"integrations-panel",children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Integrations"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:20},children:"Connect external services to enable voice calling capabilities."}),c.jsxs("div",{style:{display:"flex",gap:12},children:[c.jsxs("button",{className:"btn-integration",onClick:()=>C(!0),children:[c.jsx("span",{className:`integration-dot${u?" running":""}`}),"Twilio"]}),c.jsxs("button",{className:"btn-integration",onClick:()=>d(!0),children:[c.jsx("span",{className:`integration-dot${o?" running":""}`}),"Browser Call from Anywhere"]})]})]}),c.jsxs("div",{className:"mcp-panel",children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:4},children:[c.jsxs("div",{children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"MCP Servers"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:20},children:"Configure Model Context Protocol servers to provide external tools to Claude."})]}),c.jsx("button",{className:"mcp-add-btn",onClick:()=>p(!0),children:"+ Add MCP Server"})]}),c.jsxs("div",{className:"mcp-server-list",children:[!f&&!y&&c.jsx("div",{className:"mcp-loading",children:"Loading..."}),y&&c.jsx("div",{className:"mcp-error",children:"Failed to load MCP servers."}),f&&f.length===0&&c.jsx("div",{className:"mcp-loading",style:{color:"var(--text-secondary)",fontSize:13},children:"No MCP servers configured."}),f?.map(B=>{const H=B.scope==="user";return c.jsxs("div",{className:"mcp-server-row",children:[c.jsx("span",{className:`mcp-dot ${_(B.status)}`}),c.jsx("span",{className:"mcp-server-name",children:B.name}),c.jsx("span",{className:"mcp-server-url",title:B.url,children:B.url}),c.jsx("span",{className:"mcp-server-badge",children:B.type.toUpperCase()}),c.jsx("span",{className:`mcp-server-status ${_(B.status)}`,children:O(B.status)}),c.jsxs("span",{className:"mcp-delete-wrap",children:[c.jsx("button",{className:`mcp-delete-btn${H?" disabled":""}`,onClick:()=>{H||um(`/api/mcp-servers/${B.name}`).then(N).catch(G=>{z(G?.message||"Failed to remove server")})},children:"×"}),c.jsx("span",{className:"mcp-delete-tooltip",children:H?"Globally installed, please delete through Claude Code":`Remove ${B.name}`})]})]},B.name)})]})]}),x&&c.jsx(n0,{onClose:()=>C(!1)}),h&&c.jsx(u0,{onClose:()=>d(!1)}),v&&c.jsx(s0,{servers:f,onClose:()=>p(!1),onAdded:N}),c.jsx(mm,{message:E,onDismiss:()=>z(null)})]})}function o0(){const[u,o]=S.useState(""),[f,r]=S.useState(!1),[y,g]=S.useState(""),[x,C]=S.useState(null),h=S.useRef(null);S.useEffect(()=>{ve("/api/claude-md").then(E=>o(E.content)).catch(()=>g("Error loading file")),ve("/api/status").then(E=>{E.userClaudeMdExists&&C(`A user-level ${E.userClaudeMdPath} was detected. Its instructions will also apply and may interfere with this project config.`)}).catch(()=>{})},[]);const d=S.useCallback(async()=>{g("Saving...");try{await tt("/api/claude-md",{content:u}),r(!1),g("Saved"),setTimeout(()=>g(E=>E==="Saved"?"":E),2e3)}catch{g("Error saving")}},[u]);S.useEffect(()=>{const E=z=>{(z.metaKey||z.ctrlKey)&&z.key==="s"&&(z.preventDefault(),f&&d())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[f,d]);const v=E=>{o(E.target.value),r(!0),g("Modified")},p=E=>{if(E.key==="Tab"){E.preventDefault();const z=h.current;if(!z)return;const N=z.selectionStart,_=z.selectionEnd,O=u.substring(0,N)+" "+u.substring(_);o(O),r(!0),g("Modified"),requestAnimationFrame(()=>{z.selectionStart=z.selectionEnd=N+2})}};return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"page-header",style:{borderBottom:"none",padding:0,marginBottom:24},children:c.jsxs("div",{children:[c.jsx("h1",{children:"System Prompt"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginTop:4},children:"Configure global system instructions for Claude."})]})}),c.jsxs("div",{className:"settings-panel",style:{flex:1,display:"flex",flexDirection:"column",marginBottom:32},children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:16},children:[c.jsxs("div",{children:[c.jsx("h2",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",marginBottom:4},children:"Global Instructions"}),c.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)"},children:"Edit the CLAUDE.md file to provide custom instructions."})]}),c.jsxs("div",{className:"toolbar",children:[c.jsx("span",{id:"status",style:{fontSize:12,color:"var(--text-secondary)",marginRight:8},children:y}),c.jsx("button",{disabled:!f,onClick:d,style:{background:"var(--btn-primary-bg)",color:"var(--btn-primary-text)",border:"none",padding:"6px 14px",borderRadius:"6px",fontSize:"13px",fontWeight:500,cursor:f?"pointer":"not-allowed",opacity:f?1:.5},children:"Save"})]})]}),x&&c.jsx("div",{className:"warning visible",style:{borderRadius:0,marginBottom:16,border:"1px solid #665500",background:"#fff8c5"},children:x}),c.jsx("textarea",{ref:h,id:"editor",spellCheck:!1,placeholder:"Loading...",value:u,onChange:v,onKeyDown:p,style:{flex:1,minHeight:"300px",border:"1px solid var(--border-color)",borderRadius:"8px",background:"var(--bg-main)",padding:"16px",color:"var(--text-primary)"}})]})]})}function f0(){const[u]=Bv(),o=u.get("tab"),[f,r]=S.useState(o==="voice"||o==="integrations"||o==="system"?o:"general"),[y,g]=S.useState({running:!1,url:null}),[x,C]=S.useState({running:!1,tunnelUrl:null}),[h,d]=S.useState({running:!1,tunnelUrl:null});S.useEffect(()=>{const p=()=>{ve("/api/tunnel/status").then(g).catch(()=>{}),ve("/api/twilio/status").then(C).catch(()=>{}),ve("/api/browser-call/status").then(d).catch(()=>{})};p();const E=setInterval(p,5e3);return()=>clearInterval(E)},[]);const v=p=>({padding:"6px 14px",background:f===p?"var(--btn-primary-bg)":"var(--bg-main)",border:"1px solid "+(f===p?"transparent":"var(--border-color)"),borderRadius:"0",color:f===p?"var(--btn-primary-text)":"var(--text-primary)",fontWeight:500,cursor:"pointer",fontSize:"13px",transition:"all 0.1s ease"});return c.jsxs("div",{className:"page active",style:{display:"flex",flexDirection:"column",padding:0},children:[c.jsxs("div",{style:{display:"flex",gap:"8px",padding:"24px 32px 16px",borderBottom:"1px solid var(--border-color)",flexShrink:0},children:[c.jsx("button",{style:v("general"),onClick:()=>r("general"),children:"General"}),c.jsx("button",{style:v("voice"),onClick:()=>r("voice"),children:"Voice"}),c.jsx("button",{style:v("integrations"),onClick:()=>r("integrations"),children:"Integrations & MCP"}),c.jsx("button",{style:v("system"),onClick:()=>r("system"),children:"System Prompt"})]}),c.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"48px 64px"},children:[f==="general"&&c.jsx(Wv,{twilioRunning:x.running}),f==="voice"&&c.jsx(a0,{}),f==="integrations"&&c.jsx(r0,{twilioRunning:x.running,browserCallRunning:h.running}),f==="system"&&c.jsx(o0,{})]})]})}const Is={id:""};function d0(){const u=bu(),[o,f]=S.useState([]),[r,y]=S.useState(!1),[g,x]=S.useState(Is),[C,h]=S.useState(!1),[d,v]=S.useState(null),[p,E]=S.useState(!1);S.useEffect(()=>{ve("/api/agents").then(f).catch(()=>{})},[]);const z=async()=>{v(null),h(!0);try{await tt("/api/agents",{id:g.id});const O=await ve("/api/agents");f(O),x(Is),y(!1)}catch(O){const B=O?.message||"Failed to create agent";v(B)}finally{h(!1)}},N=()=>{x(Is),y(!1),v(null)},_=async O=>{const B=window.prompt("Enter an ID for the imported agent:",O.name.replace(/\.zip$/i,""));if(B){E(!0),v(null);try{const H=new FormData;H.append("file",O),H.append("id",B);const G=await fetch("/api/agents/import",{method:"POST",body:H});if(!G.ok){const P=await G.json().catch(()=>({error:"Import failed"}));throw new Error(P.error||"Import failed")}const I=await ve("/api/agents");f(I)}catch(H){const G=H?.message||"Failed to import agent";v(G)}finally{E(!1)}}};return c.jsxs("div",{className:"page active",style:{display:"flex",flexDirection:"column",padding:0},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"24px 32px 16px",borderBottom:"1px solid var(--border-color)",flexShrink:0},children:[c.jsx("h2",{style:{margin:0,fontSize:18,fontWeight:600,color:"var(--text-primary)"},children:"Agents"}),!r&&c.jsxs("div",{style:{display:"flex",gap:8},children:[c.jsxs("label",{style:{padding:"6px 14px",background:"var(--bg-main)",color:"var(--text-primary)",border:"1px solid var(--border-color)",borderRadius:0,fontWeight:500,fontSize:13,cursor:p?"not-allowed":"pointer",opacity:p?.6:1},children:[p?"Importing...":"Import",c.jsx("input",{type:"file",accept:".zip",style:{display:"none"},onChange:O=>{const B=O.target.files?.[0];B&&_(B),O.target.value=""},disabled:p})]}),c.jsx("button",{onClick:()=>y(!0),style:{padding:"6px 14px",background:"var(--btn-primary-bg)",color:"var(--btn-primary-text)",border:"none",borderRadius:0,fontWeight:500,fontSize:13,cursor:"pointer"},children:"Create Agent"})]})]}),d&&!r&&c.jsx("div",{style:{margin:"16px 32px 0",padding:"8px 10px",fontSize:12,color:"#d73a49",background:"var(--bg-tertiary)",borderRadius:6,border:"1px solid #d73a49"},children:d}),c.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"48px 64px"},children:[r&&c.jsxs("div",{className:"settings-panel",style:{marginBottom:24,padding:20},children:[c.jsx("h3",{style:{margin:"0 0 16px",fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:"New Agent"}),d&&c.jsx("div",{style:{marginBottom:12,padding:"8px 10px",fontSize:12,color:"#d73a49",background:"var(--bg-tertiary)",borderRadius:6,border:"1px solid #d73a49"},children:d}),c.jsxs("div",{style:{marginBottom:16},children:[c.jsx("label",{style:{display:"block",marginBottom:4,fontSize:13,fontWeight:500,color:"var(--text-primary)"},children:"ID"}),c.jsx("input",{type:"text",value:g.id,onChange:O=>x({...g,id:O.target.value}),placeholder:"my-agent",style:{width:"100%",padding:"6px 10px",fontSize:13,background:"var(--bg-main)",color:"var(--text-primary)",border:"1px solid var(--border-color)",borderRadius:0,boxSizing:"border-box"}})]}),c.jsxs("div",{style:{display:"flex",gap:8},children:[c.jsx("button",{onClick:z,disabled:C||!g.id.trim(),style:{padding:"6px 14px",background:"var(--btn-primary-bg)",color:"var(--btn-primary-text)",border:"none",borderRadius:0,fontWeight:500,fontSize:13,cursor:C?"not-allowed":"pointer",opacity:C||!g.id.trim()?.6:1},children:C?"Creating...":"Create"}),c.jsx("button",{onClick:N,style:{padding:"6px 14px",background:"var(--bg-main)",color:"var(--text-primary)",border:"1px solid var(--border-color)",borderRadius:0,fontWeight:500,fontSize:13,cursor:"pointer"},children:"Cancel"})]})]}),c.jsxs("div",{className:"settings-panel",style:{padding:0},children:[o.length===0&&!r&&c.jsx("div",{style:{padding:20,fontSize:13,color:"var(--text-secondary)"},children:'No agents yet. Click "Create Agent" to get started.'}),o.map(O=>c.jsxs("div",{onClick:()=>u(`/agents/${O.id}`),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 20px",borderBottom:"1px solid var(--border-color)",cursor:"pointer",transition:"background 0.1s ease"},onMouseEnter:B=>B.currentTarget.style.background="var(--bg-tertiary)",onMouseLeave:B=>B.currentTarget.style.background="transparent",children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:O.enabled?"#2ea043":"#8b949e",flexShrink:0}}),c.jsx("span",{style:{fontSize:14,fontWeight:500,color:"var(--text-primary)"},children:O.id})]}),c.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)"},children:["every ",O.heartbeatIntervalMinutes,"m"]})]},O.id))]})]})]})}var h0=Object.defineProperty,Su=Object.getOwnPropertySymbols,gm=Object.prototype.hasOwnProperty,ym=Object.prototype.propertyIsEnumerable,wh=(u,o,f)=>o in u?h0(u,o,{enumerable:!0,configurable:!0,writable:!0,value:f}):u[o]=f,ar=(u,o)=>{for(var f in o||(o={}))gm.call(o,f)&&wh(u,f,o[f]);if(Su)for(var f of Su(o))ym.call(o,f)&&wh(u,f,o[f]);return u},nr=(u,o)=>{var f={};for(var r in u)gm.call(u,r)&&o.indexOf(r)<0&&(f[r]=u[r]);if(u!=null&&Su)for(var r of Su(u))o.indexOf(r)<0&&ym.call(u,r)&&(f[r]=u[r]);return f};var aa;(u=>{const o=class he{constructor(h,d,v,p){if(this.version=h,this.errorCorrectionLevel=d,this.modules=[],this.isFunction=[],h<he.MIN_VERSION||h>he.MAX_VERSION)throw new RangeError("Version value out of range");if(p<-1||p>7)throw new RangeError("Mask value out of range");this.size=h*4+17;let E=[];for(let N=0;N<this.size;N++)E.push(!1);for(let N=0;N<this.size;N++)this.modules.push(E.slice()),this.isFunction.push(E.slice());this.drawFunctionPatterns();const z=this.addEccAndInterleave(v);if(this.drawCodewords(z),p==-1){let N=1e9;for(let _=0;_<8;_++){this.applyMask(_),this.drawFormatBits(_);const O=this.getPenaltyScore();O<N&&(p=_,N=O),this.applyMask(_)}}y(0<=p&&p<=7),this.mask=p,this.applyMask(p),this.drawFormatBits(p),this.isFunction=[]}static encodeText(h,d){const v=u.QrSegment.makeSegments(h);return he.encodeSegments(v,d)}static encodeBinary(h,d){const v=u.QrSegment.makeBytes(h);return he.encodeSegments([v],d)}static encodeSegments(h,d,v=1,p=40,E=-1,z=!0){if(!(he.MIN_VERSION<=v&&v<=p&&p<=he.MAX_VERSION)||E<-1||E>7)throw new RangeError("Invalid value");let N,_;for(N=v;;N++){const G=he.getNumDataCodewords(N,d)*8,I=x.getTotalBits(h,N);if(I<=G){_=I;break}if(N>=p)throw new RangeError("Data too long")}for(const G of[he.Ecc.MEDIUM,he.Ecc.QUARTILE,he.Ecc.HIGH])z&&_<=he.getNumDataCodewords(N,G)*8&&(d=G);let O=[];for(const G of h){f(G.mode.modeBits,4,O),f(G.numChars,G.mode.numCharCountBits(N),O);for(const I of G.getData())O.push(I)}y(O.length==_);const B=he.getNumDataCodewords(N,d)*8;y(O.length<=B),f(0,Math.min(4,B-O.length),O),f(0,(8-O.length%8)%8,O),y(O.length%8==0);for(let G=236;O.length<B;G^=253)f(G,8,O);let H=[];for(;H.length*8<O.length;)H.push(0);return O.forEach((G,I)=>H[I>>>3]|=G<<7-(I&7)),new he(N,d,H,E)}getModule(h,d){return 0<=h&&h<this.size&&0<=d&&d<this.size&&this.modules[d][h]}getModules(){return this.modules}drawFunctionPatterns(){for(let v=0;v<this.size;v++)this.setFunctionModule(6,v,v%2==0),this.setFunctionModule(v,6,v%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const h=this.getAlignmentPatternPositions(),d=h.length;for(let v=0;v<d;v++)for(let p=0;p<d;p++)v==0&&p==0||v==0&&p==d-1||v==d-1&&p==0||this.drawAlignmentPattern(h[v],h[p]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(h){const d=this.errorCorrectionLevel.formatBits<<3|h;let v=d;for(let E=0;E<10;E++)v=v<<1^(v>>>9)*1335;const p=(d<<10|v)^21522;y(p>>>15==0);for(let E=0;E<=5;E++)this.setFunctionModule(8,E,r(p,E));this.setFunctionModule(8,7,r(p,6)),this.setFunctionModule(8,8,r(p,7)),this.setFunctionModule(7,8,r(p,8));for(let E=9;E<15;E++)this.setFunctionModule(14-E,8,r(p,E));for(let E=0;E<8;E++)this.setFunctionModule(this.size-1-E,8,r(p,E));for(let E=8;E<15;E++)this.setFunctionModule(8,this.size-15+E,r(p,E));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let h=this.version;for(let v=0;v<12;v++)h=h<<1^(h>>>11)*7973;const d=this.version<<12|h;y(d>>>18==0);for(let v=0;v<18;v++){const p=r(d,v),E=this.size-11+v%3,z=Math.floor(v/3);this.setFunctionModule(E,z,p),this.setFunctionModule(z,E,p)}}drawFinderPattern(h,d){for(let v=-4;v<=4;v++)for(let p=-4;p<=4;p++){const E=Math.max(Math.abs(p),Math.abs(v)),z=h+p,N=d+v;0<=z&&z<this.size&&0<=N&&N<this.size&&this.setFunctionModule(z,N,E!=2&&E!=4)}}drawAlignmentPattern(h,d){for(let v=-2;v<=2;v++)for(let p=-2;p<=2;p++)this.setFunctionModule(h+p,d+v,Math.max(Math.abs(p),Math.abs(v))!=1)}setFunctionModule(h,d,v){this.modules[d][h]=v,this.isFunction[d][h]=!0}addEccAndInterleave(h){const d=this.version,v=this.errorCorrectionLevel;if(h.length!=he.getNumDataCodewords(d,v))throw new RangeError("Invalid argument");const p=he.NUM_ERROR_CORRECTION_BLOCKS[v.ordinal][d],E=he.ECC_CODEWORDS_PER_BLOCK[v.ordinal][d],z=Math.floor(he.getNumRawDataModules(d)/8),N=p-z%p,_=Math.floor(z/p);let O=[];const B=he.reedSolomonComputeDivisor(E);for(let G=0,I=0;G<p;G++){let P=h.slice(I,I+_-E+(G<N?0:1));I+=P.length;const V=he.reedSolomonComputeRemainder(P,B);G<N&&P.push(0),O.push(P.concat(V))}let H=[];for(let G=0;G<O[0].length;G++)O.forEach((I,P)=>{(G!=_-E||P>=N)&&H.push(I[G])});return y(H.length==z),H}drawCodewords(h){if(h.length!=Math.floor(he.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let d=0;for(let v=this.size-1;v>=1;v-=2){v==6&&(v=5);for(let p=0;p<this.size;p++)for(let E=0;E<2;E++){const z=v-E,_=(v+1&2)==0?this.size-1-p:p;!this.isFunction[_][z]&&d<h.length*8&&(this.modules[_][z]=r(h[d>>>3],7-(d&7)),d++)}}y(d==h.length*8)}applyMask(h){if(h<0||h>7)throw new RangeError("Mask value out of range");for(let d=0;d<this.size;d++)for(let v=0;v<this.size;v++){let p;switch(h){case 0:p=(v+d)%2==0;break;case 1:p=d%2==0;break;case 2:p=v%3==0;break;case 3:p=(v+d)%3==0;break;case 4:p=(Math.floor(v/3)+Math.floor(d/2))%2==0;break;case 5:p=v*d%2+v*d%3==0;break;case 6:p=(v*d%2+v*d%3)%2==0;break;case 7:p=((v+d)%2+v*d%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[d][v]&&p&&(this.modules[d][v]=!this.modules[d][v])}}getPenaltyScore(){let h=0;for(let E=0;E<this.size;E++){let z=!1,N=0,_=[0,0,0,0,0,0,0];for(let O=0;O<this.size;O++)this.modules[E][O]==z?(N++,N==5?h+=he.PENALTY_N1:N>5&&h++):(this.finderPenaltyAddHistory(N,_),z||(h+=this.finderPenaltyCountPatterns(_)*he.PENALTY_N3),z=this.modules[E][O],N=1);h+=this.finderPenaltyTerminateAndCount(z,N,_)*he.PENALTY_N3}for(let E=0;E<this.size;E++){let z=!1,N=0,_=[0,0,0,0,0,0,0];for(let O=0;O<this.size;O++)this.modules[O][E]==z?(N++,N==5?h+=he.PENALTY_N1:N>5&&h++):(this.finderPenaltyAddHistory(N,_),z||(h+=this.finderPenaltyCountPatterns(_)*he.PENALTY_N3),z=this.modules[O][E],N=1);h+=this.finderPenaltyTerminateAndCount(z,N,_)*he.PENALTY_N3}for(let E=0;E<this.size-1;E++)for(let z=0;z<this.size-1;z++){const N=this.modules[E][z];N==this.modules[E][z+1]&&N==this.modules[E+1][z]&&N==this.modules[E+1][z+1]&&(h+=he.PENALTY_N2)}let d=0;for(const E of this.modules)d=E.reduce((z,N)=>z+(N?1:0),d);const v=this.size*this.size,p=Math.ceil(Math.abs(d*20-v*10)/v)-1;return y(0<=p&&p<=9),h+=p*he.PENALTY_N4,y(0<=h&&h<=2568888),h}getAlignmentPatternPositions(){if(this.version==1)return[];{const h=Math.floor(this.version/7)+2,d=this.version==32?26:Math.ceil((this.version*4+4)/(h*2-2))*2;let v=[6];for(let p=this.size-7;v.length<h;p-=d)v.splice(1,0,p);return v}}static getNumRawDataModules(h){if(h<he.MIN_VERSION||h>he.MAX_VERSION)throw new RangeError("Version number out of range");let d=(16*h+128)*h+64;if(h>=2){const v=Math.floor(h/7)+2;d-=(25*v-10)*v-55,h>=7&&(d-=36)}return y(208<=d&&d<=29648),d}static getNumDataCodewords(h,d){return Math.floor(he.getNumRawDataModules(h)/8)-he.ECC_CODEWORDS_PER_BLOCK[d.ordinal][h]*he.NUM_ERROR_CORRECTION_BLOCKS[d.ordinal][h]}static reedSolomonComputeDivisor(h){if(h<1||h>255)throw new RangeError("Degree out of range");let d=[];for(let p=0;p<h-1;p++)d.push(0);d.push(1);let v=1;for(let p=0;p<h;p++){for(let E=0;E<d.length;E++)d[E]=he.reedSolomonMultiply(d[E],v),E+1<d.length&&(d[E]^=d[E+1]);v=he.reedSolomonMultiply(v,2)}return d}static reedSolomonComputeRemainder(h,d){let v=d.map(p=>0);for(const p of h){const E=p^v.shift();v.push(0),d.forEach((z,N)=>v[N]^=he.reedSolomonMultiply(z,E))}return v}static reedSolomonMultiply(h,d){if(h>>>8||d>>>8)throw new RangeError("Byte out of range");let v=0;for(let p=7;p>=0;p--)v=v<<1^(v>>>7)*285,v^=(d>>>p&1)*h;return y(v>>>8==0),v}finderPenaltyCountPatterns(h){const d=h[1];y(d<=this.size*3);const v=d>0&&h[2]==d&&h[3]==d*3&&h[4]==d&&h[5]==d;return(v&&h[0]>=d*4&&h[6]>=d?1:0)+(v&&h[6]>=d*4&&h[0]>=d?1:0)}finderPenaltyTerminateAndCount(h,d,v){return h&&(this.finderPenaltyAddHistory(d,v),d=0),d+=this.size,this.finderPenaltyAddHistory(d,v),this.finderPenaltyCountPatterns(v)}finderPenaltyAddHistory(h,d){d[0]==0&&(h+=this.size),d.pop(),d.unshift(h)}};o.MIN_VERSION=1,o.MAX_VERSION=40,o.PENALTY_N1=3,o.PENALTY_N2=3,o.PENALTY_N3=40,o.PENALTY_N4=10,o.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],o.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],u.QrCode=o;function f(C,h,d){if(h<0||h>31||C>>>h)throw new RangeError("Value out of range");for(let v=h-1;v>=0;v--)d.push(C>>>v&1)}function r(C,h){return(C>>>h&1)!=0}function y(C){if(!C)throw new Error("Assertion error")}const g=class Le{constructor(h,d,v){if(this.mode=h,this.numChars=d,this.bitData=v,d<0)throw new RangeError("Invalid argument");this.bitData=v.slice()}static makeBytes(h){let d=[];for(const v of h)f(v,8,d);return new Le(Le.Mode.BYTE,h.length,d)}static makeNumeric(h){if(!Le.isNumeric(h))throw new RangeError("String contains non-numeric characters");let d=[];for(let v=0;v<h.length;){const p=Math.min(h.length-v,3);f(parseInt(h.substring(v,v+p),10),p*3+1,d),v+=p}return new Le(Le.Mode.NUMERIC,h.length,d)}static makeAlphanumeric(h){if(!Le.isAlphanumeric(h))throw new RangeError("String contains unencodable characters in alphanumeric mode");let d=[],v;for(v=0;v+2<=h.length;v+=2){let p=Le.ALPHANUMERIC_CHARSET.indexOf(h.charAt(v))*45;p+=Le.ALPHANUMERIC_CHARSET.indexOf(h.charAt(v+1)),f(p,11,d)}return v<h.length&&f(Le.ALPHANUMERIC_CHARSET.indexOf(h.charAt(v)),6,d),new Le(Le.Mode.ALPHANUMERIC,h.length,d)}static makeSegments(h){return h==""?[]:Le.isNumeric(h)?[Le.makeNumeric(h)]:Le.isAlphanumeric(h)?[Le.makeAlphanumeric(h)]:[Le.makeBytes(Le.toUtf8ByteArray(h))]}static makeEci(h){let d=[];if(h<0)throw new RangeError("ECI assignment value out of range");if(h<128)f(h,8,d);else if(h<16384)f(2,2,d),f(h,14,d);else if(h<1e6)f(6,3,d),f(h,21,d);else throw new RangeError("ECI assignment value out of range");return new Le(Le.Mode.ECI,0,d)}static isNumeric(h){return Le.NUMERIC_REGEX.test(h)}static isAlphanumeric(h){return Le.ALPHANUMERIC_REGEX.test(h)}getData(){return this.bitData.slice()}static getTotalBits(h,d){let v=0;for(const p of h){const E=p.mode.numCharCountBits(d);if(p.numChars>=1<<E)return 1/0;v+=4+E+p.bitData.length}return v}static toUtf8ByteArray(h){h=encodeURI(h);let d=[];for(let v=0;v<h.length;v++)h.charAt(v)!="%"?d.push(h.charCodeAt(v)):(d.push(parseInt(h.substring(v+1,v+3),16)),v+=2);return d}};g.NUMERIC_REGEX=/^[0-9]*$/,g.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,g.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let x=g;u.QrSegment=g})(aa||(aa={}));(u=>{(o=>{const f=class{constructor(y,g){this.ordinal=y,this.formatBits=g}};f.LOW=new f(0,1),f.MEDIUM=new f(1,0),f.QUARTILE=new f(2,3),f.HIGH=new f(3,2),o.Ecc=f})(u.QrCode||(u.QrCode={}))})(aa||(aa={}));(u=>{(o=>{const f=class{constructor(y,g){this.modeBits=y,this.numBitsCharCount=g}numCharCountBits(y){return this.numBitsCharCount[Math.floor((y+7)/17)]}};f.NUMERIC=new f(1,[10,12,14]),f.ALPHANUMERIC=new f(2,[9,11,13]),f.BYTE=new f(4,[8,16,16]),f.KANJI=new f(8,[8,10,12]),f.ECI=new f(7,[0,0,0]),o.Mode=f})(u.QrSegment||(u.QrSegment={}))})(aa||(aa={}));var Qa=aa;var m0={L:Qa.QrCode.Ecc.LOW,M:Qa.QrCode.Ecc.MEDIUM,Q:Qa.QrCode.Ecc.QUARTILE,H:Qa.QrCode.Ecc.HIGH},pm=128,vm="L",Sm="#FFFFFF",xm="#000000",bm=!1,Em=1,g0=4,y0=0,p0=.1;function Cm(u,o=0){const f=[];return u.forEach(function(r,y){let g=null;r.forEach(function(x,C){if(!x&&g!==null){f.push(`M${g+o} ${y+o}h${C-g}v1H${g+o}z`),g=null;return}if(C===r.length-1){if(!x)return;g===null?f.push(`M${C+o},${y+o} h1v1H${C+o}z`):f.push(`M${g+o},${y+o} h${C+1-g}v1H${g+o}z`);return}x&&g===null&&(g=C)})}),f.join("")}function jm(u,o){return u.slice().map((f,r)=>r<o.y||r>=o.y+o.h?f:f.map((y,g)=>g<o.x||g>=o.x+o.w?y:!1))}function v0(u,o,f,r){if(r==null)return null;const y=u.length+f*2,g=Math.floor(o*p0),x=y/o,C=(r.width||g)*x,h=(r.height||g)*x,d=r.x==null?u.length/2-C/2:r.x*x,v=r.y==null?u.length/2-h/2:r.y*x,p=r.opacity==null?1:r.opacity;let E=null;if(r.excavate){let N=Math.floor(d),_=Math.floor(v),O=Math.ceil(C+d-N),B=Math.ceil(h+v-_);E={x:N,y:_,w:O,h:B}}const z=r.crossOrigin;return{x:d,y:v,h,w:C,excavation:E,opacity:p,crossOrigin:z}}function S0(u,o){return o!=null?Math.max(Math.floor(o),0):u?g0:y0}function Tm({value:u,level:o,minVersion:f,includeMargin:r,marginSize:y,imageSettings:g,size:x,boostLevel:C}){let h=Ke.useMemo(()=>{const N=(Array.isArray(u)?u:[u]).reduce((_,O)=>(_.push(...Qa.QrSegment.makeSegments(O)),_),[]);return Qa.QrCode.encodeSegments(N,m0[o],f,void 0,void 0,C)},[u,o,f,C]);const{cells:d,margin:v,numCells:p,calculatedImageSettings:E}=Ke.useMemo(()=>{let z=h.getModules();const N=S0(r,y),_=z.length+N*2,O=v0(z,x,N,g);return{cells:z,margin:N,numCells:_,calculatedImageSettings:O}},[h,x,g,r,y]);return{qrcode:h,margin:v,cells:d,numCells:p,calculatedImageSettings:E}}var x0=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),b0=Ke.forwardRef(function(o,f){const r=o,{value:y,size:g=pm,level:x=vm,bgColor:C=Sm,fgColor:h=xm,includeMargin:d=bm,minVersion:v=Em,boostLevel:p,marginSize:E,imageSettings:z}=r,_=nr(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:O}=_,B=nr(_,["style"]),H=z?.src,G=Ke.useRef(null),I=Ke.useRef(null),P=Ke.useCallback(ke=>{G.current=ke,typeof f=="function"?f(ke):f&&(f.current=ke)},[f]),[V,K]=Ke.useState(!1),{margin:k,cells:X,numCells:$,calculatedImageSettings:ae}=Tm({value:y,level:x,minVersion:v,boostLevel:p,includeMargin:d,marginSize:E,imageSettings:z,size:g});Ke.useEffect(()=>{if(G.current!=null){const ke=G.current,De=ke.getContext("2d");if(!De)return;let U=X;const Z=I.current,te=ae!=null&&Z!==null&&Z.complete&&Z.naturalHeight!==0&&Z.naturalWidth!==0;te&&ae.excavation!=null&&(U=jm(X,ae.excavation));const re=window.devicePixelRatio||1;ke.height=ke.width=g*re;const ye=g/$*re;De.scale(ye,ye),De.fillStyle=C,De.fillRect(0,0,$,$),De.fillStyle=h,x0?De.fill(new Path2D(Cm(U,k))):X.forEach(function(j,q){j.forEach(function(J,F){J&&De.fillRect(F+k,q+k,1,1)})}),ae&&(De.globalAlpha=ae.opacity),te&&De.drawImage(Z,ae.x+k,ae.y+k,ae.w,ae.h)}}),Ke.useEffect(()=>{K(!1)},[H]);const Se=ar({height:g,width:g},O);let it=null;return H!=null&&(it=Ke.createElement("img",{src:H,key:H,style:{display:"none"},onLoad:()=>{K(!0)},ref:I,crossOrigin:ae?.crossOrigin})),Ke.createElement(Ke.Fragment,null,Ke.createElement("canvas",ar({style:Se,height:g,width:g,ref:P,role:"img"},B)),it)});b0.displayName="QRCodeCanvas";var Am=Ke.forwardRef(function(o,f){const r=o,{value:y,size:g=pm,level:x=vm,bgColor:C=Sm,fgColor:h=xm,includeMargin:d=bm,minVersion:v=Em,boostLevel:p,title:E,marginSize:z,imageSettings:N}=r,_=nr(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:O,cells:B,numCells:H,calculatedImageSettings:G}=Tm({value:y,level:x,minVersion:v,boostLevel:p,includeMargin:d,marginSize:z,imageSettings:N,size:g});let I=B,P=null;N!=null&&G!=null&&(G.excavation!=null&&(I=jm(B,G.excavation)),P=Ke.createElement("image",{href:N.src,height:G.h,width:G.w,x:G.x+O,y:G.y+O,preserveAspectRatio:"none",opacity:G.opacity,crossOrigin:G.crossOrigin}));const V=Cm(I,O);return Ke.createElement("svg",ar({height:g,width:g,viewBox:`0 0 ${H} ${H}`,ref:f,role:"img"},_),!!E&&Ke.createElement("title",null,E),Ke.createElement("path",{fill:C,d:`M0,0 h${H}v${H}H0z`,shapeRendering:"crispEdges"}),Ke.createElement("path",{fill:h,d:V,shapeRendering:"crispEdges"}),P)});Am.displayName="QRCodeSVG";function E0({tunnelUrl:u,agentId:o,onClose:f}){const[r,y]=S.useState(null),[g,x]=S.useState(0),[C,h]=S.useState(""),[d,v]=S.useState(null),[p,E]=S.useState(!1),[z,N]=S.useState(!1),_=S.useRef(null),O=S.useRef(null),B=S.useRef(null),H=r?`${u}/call?code=${r}&agentId=${o}`:`${u}/call`,G=S.useCallback(async()=>{y(null),h(""),v(null),E(!1);try{const K=await tt("/api/webrtc/generate-code",{agentId:o});y(K.code),x(K.expiresAt)}catch(K){const k=K instanceof Error?K.message:K?.message||"Failed to generate code";v(k)}},[o]);S.useEffect(()=>(G(),ve("/api/tunnel/status").then(K=>{if(K.startedAt){const k=Date.now()-K.startedAt;k<6e4&&(N(!0),B.current=setTimeout(()=>N(!1),6e4-k))}}).catch(()=>{}),()=>{_.current&&clearInterval(_.current),O.current&&clearInterval(O.current),B.current&&clearTimeout(B.current)}),[G]),S.useEffect(()=>{if(!g||p)return;const K=()=>{const k=Math.max(0,Math.floor((g-Date.now())/1e3));if(k<=0){h("Code expired"),_.current&&(clearInterval(_.current),_.current=null);return}const X=Math.floor(k/60),$=k%60;h(`Expires in ${X}:${String($).padStart(2,"0")}`)};return K(),_.current=setInterval(K,1e3),()=>{_.current&&clearInterval(_.current)}},[g,p]),S.useEffect(()=>{if(!(!r||p))return O.current=setInterval(async()=>{try{!(await ve(`/api/webrtc/code-status?code=${r}`)).active&&Date.now()<g&&(E(!0),_.current&&(clearInterval(_.current),_.current=null),O.current&&(clearInterval(O.current),O.current=null))}catch{}},2e3),()=>{O.current&&clearInterval(O.current)}},[r,g,p]);const I=K=>{K.target===K.currentTarget&&f()},P=r?`${r.slice(0,3)} ${r.slice(3)}`:"------",V=C==="Code expired";return c.jsx("div",{className:"modal-overlay visible",onClick:I,children:c.jsxs("div",{className:"modal",style:{textAlign:"center"},children:[c.jsx("button",{className:"modal-close",onClick:f,children:"×"}),c.jsx("h2",{children:"Call via Browser"}),c.jsx("p",{style:{fontSize:12,color:"#999",marginBottom:12},children:"Scan the QR code or open the link on any device, then enter the pairing code."}),c.jsx("div",{className:"qr-container",children:H&&c.jsx(Am,{value:H,size:160,level:"M"})}),c.jsx("div",{className:"call-url",children:c.jsx("a",{href:H,target:"_blank",rel:"noreferrer",children:H})}),z&&c.jsx("div",{style:{fontSize:11,color:"#d29922",marginBottom:8},children:"Tunnel is warming up — link may take a moment to become reachable"}),p?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"pairing-code",style:{color:"#2ea043"},children:"Paired"}),c.jsx("div",{className:"pairing-countdown",style:{color:"#2ea043"},children:"Device connected successfully"})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"pairing-code",style:{opacity:V?.4:1},children:d?"Error":P}),c.jsx("div",{className:"pairing-countdown",children:d||C})]}),c.jsx("button",{className:"btn-regenerate",onClick:G,children:p?"New Code":"Regenerate Code"})]})})}const gu={margin:0,padding:12,fontSize:13,fontFamily:"monospace",whiteSpace:"pre-wrap",wordWrap:"break-word",background:"var(--bg-main)",color:"var(--text-primary)",border:"1px solid var(--border-color)",borderRadius:0},Qn={margin:"0 0 8px",fontSize:14,fontWeight:600,color:"var(--text-primary)"};function C0(){const{id:u}=Ih(),o=bu(),{browserCallStatus:f}=Fh(),[r,y]=S.useState(null),[g,x]=S.useState(!1),[C,h]=S.useState(null),[d,v]=S.useState(!1),[p,E]=S.useState(null),[z,N]=S.useState([]),[_,O]=S.useState(null),[B,H]=S.useState(!1),[G,I]=S.useState(!1),P=f.running&&!!f.tunnelUrl;S.useEffect(()=>{u&&ve(`/api/agents/${u}`).then(y).catch(()=>{})},[u]),S.useEffect(()=>{ve("/api/providers/tts").then(X=>(E(X.active),ve(`/api/providers/tts/${X.active}/voices`))).then(X=>N(X.voices)).catch(X=>O(X?.message||"Failed to load voices"))},[]);const V=async X=>{if(!(!u||!r||!p)){H(!0);try{const $=p,Se={...r.config.voice??{},[$]:{id:X,name:z.find(it=>it.id===X)?.name??""}};await Qv(`/api/agents/${u}`,{config:{voice:Se}}),y({...r,config:{...r.config,voice:Se}})}finally{H(!1)}}},K=async()=>{if(u){x(!0),h(null);try{await tt(`/api/agents/${u}/call`)}catch(X){const $=X?.message||"Failed to initiate call";h($)}finally{x(!1)}}},k=async()=>{if(u&&window.confirm(`Delete agent "${u}"? This cannot be undone.`)){v(!0);try{await um(`/api/agents/${u}`),o("/agents")}catch{v(!1)}}};return r?c.jsxs("div",{className:"page active",style:{display:"flex",flexDirection:"column",padding:0},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"24px 32px 16px",borderBottom:"1px solid var(--border-color)",flexShrink:0},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[c.jsx(Vt,{to:"/agents",style:{fontSize:13,color:"var(--text-secondary)",textDecoration:"none"},children:"Agents"}),c.jsx("span",{style:{color:"var(--text-secondary)",fontSize:13},children:"/"}),c.jsx("h2",{style:{margin:0,fontSize:18,fontWeight:600,color:"var(--text-primary)"},children:r.id})]}),c.jsxs("div",{style:{display:"flex",gap:8},children:[c.jsx("a",{href:`/api/agents/${u}/export`,download:`${u}.zip`,style:{padding:"6px 14px",background:"var(--bg-main)",color:"var(--text-primary)",border:"1px solid var(--border-color)",borderRadius:0,fontWeight:500,fontSize:13,cursor:"pointer",textDecoration:"none",display:"inline-flex",alignItems:"center"},children:"Export"}),c.jsx("button",{onClick:K,disabled:g,style:{padding:"6px 14px",background:"var(--btn-primary-bg)",color:"var(--btn-primary-text)",border:"none",borderRadius:0,fontWeight:500,fontSize:13,cursor:g?"not-allowed":"pointer",opacity:g?.6:1},children:g?"Calling...":"Call via Phone"}),c.jsx("span",{title:P?void 0:"Enable browser calling in Settings",children:c.jsx("button",{onClick:()=>I(!0),disabled:!P,style:{padding:"6px 14px",background:"var(--btn-primary-bg)",color:"var(--btn-primary-text)",border:"none",borderRadius:0,fontWeight:500,fontSize:13,cursor:P?"pointer":"not-allowed",opacity:P?1:.6},children:"Call via Browser"})}),c.jsx("button",{onClick:k,disabled:d,style:{padding:"6px 14px",background:"transparent",color:"#d73a49",border:"1px solid #d73a49",borderRadius:0,fontWeight:500,fontSize:13,cursor:d?"not-allowed":"pointer",opacity:d?.6:1},children:d?"Deleting...":"Delete"})]})]}),C&&c.jsx("div",{style:{margin:"16px 32px 0",padding:"8px 10px",fontSize:12,color:"#d73a49",background:"var(--bg-tertiary)",borderRadius:6,border:"1px solid #d73a49"},children:C}),c.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"48px 64px"},children:[c.jsxs("div",{className:"settings-panel",style:{marginBottom:24,padding:20},children:[c.jsx("h3",{style:Qn,children:"SOUL.md"}),c.jsx("pre",{style:gu,children:r.soulMd||"(empty)"})]}),c.jsxs("div",{className:"settings-panel",style:{marginBottom:24,padding:20},children:[c.jsx("h3",{style:Qn,children:"MEMORY.md"}),c.jsx("pre",{style:gu,children:r.memoryMd||"(empty)"})]}),c.jsxs("div",{className:"settings-panel",style:{marginBottom:24,padding:20},children:[c.jsx("h3",{style:Qn,children:"HEARTBEAT.md"}),c.jsx("pre",{style:gu,children:r.heartbeatMd||"(empty)"})]}),c.jsxs("div",{className:"settings-panel",style:{marginBottom:24,padding:20},children:[c.jsx("h3",{style:Qn,children:"Voice"}),p&&z.length>0?c.jsxs("div",{children:[c.jsx("label",{style:{display:"block",fontSize:13,color:"var(--text-secondary)",marginBottom:6},children:"ElevenLabs voice"}),c.jsx("select",{value:r.config.voice?.[p]?.id??"",onChange:X=>V(X.target.value),disabled:B,style:{padding:"6px 10px",fontSize:13,background:"var(--bg-main)",color:"var(--text-primary)",border:"1px solid var(--border-color)",borderRadius:0,cursor:B?"not-allowed":"pointer",opacity:B?.6:1,minWidth:200},children:z.map(X=>c.jsx("option",{value:X.id,children:X.name},X.id))})]}):_?c.jsx("p",{style:{margin:0,fontSize:13,color:"#d73a49"},children:_}):c.jsx("p",{style:{margin:0,fontSize:13,color:"var(--text-secondary)"},children:"Loading voices..."})]}),c.jsxs("div",{className:"settings-panel",style:{marginBottom:24,padding:20},children:[c.jsx("h3",{style:Qn,children:"Config"}),c.jsx("pre",{style:gu,children:JSON.stringify(r.config,null,2)})]})]}),G&&f.tunnelUrl&&u&&c.jsx(E0,{agentId:u,tunnelUrl:f.tunnelUrl,onClose:()=>I(!1)})]}):c.jsx("div",{className:"page active",style:{display:"flex",flexDirection:"column",padding:0},children:c.jsx("div",{style:{padding:"24px 32px",color:"var(--text-secondary)",fontSize:14},children:"Loading..."})})}function j0({sessionId:u}){const[o,f]=S.useState([]),[r,y]=S.useState("Loading..."),[g,x]=S.useState(null),C=S.useRef(null);return S.useEffect(()=>{y("Loading..."),x(null),f([]),ve(`/api/conversations/${u}`).then(h=>{f(h),y(`Conversation (${h.length} messages)`)}).catch(()=>{x("Error loading conversation."),y("Conversation")})},[u]),S.useEffect(()=>{C.current&&(C.current.scrollTop=C.current.scrollHeight)},[o]),c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"page-header",style:{padding:"48px 64px 24px"},children:c.jsx("div",{children:c.jsx("h1",{children:r})})}),c.jsxs("div",{className:"conversation-messages",ref:C,style:{padding:"0 64px 48px"},children:[g&&c.jsx("div",{className:"conversation-empty",children:g}),!g&&o.length===0&&!r.includes("Loading")&&c.jsx("div",{className:"conversation-empty",children:"No messages in this session."}),o.map((h,d)=>c.jsxs("div",{className:`msg msg-${h.role}`,children:[c.jsxs("div",{className:"msg-header",children:[c.jsx("span",{className:"msg-role",children:h.role==="user"?"User":"VoiceCC"}),c.jsx("span",{className:"msg-time",children:new Date(h.timestamp).toLocaleTimeString()})]}),c.jsx("div",{className:"msg-content",children:h.content})]},d))]})]})}function T0(){const{id:u}=Ih();return u?c.jsx("div",{className:"page active",children:c.jsx(j0,{sessionId:u})}):c.jsxs("div",{className:"page active",style:{display:"flex",flexDirection:"column"},children:[c.jsx("div",{className:"page-header",style:{padding:"48px 64px 24px"},children:c.jsx("div",{children:c.jsx("h1",{children:"Error"})})}),c.jsx("div",{className:"conversation-messages",style:{padding:"0 64px 48px"},children:c.jsx("div",{className:"conversation-empty",children:"No conversation ID provided."})})]})}const sl=6,Ps="claude-voice-device-token",Uh="claude-voice-agent-",A0=16e3,Bh=24e3;function z0(u,o,f){const r=o/f,y=Math.floor(u.length/r),g=new Float32Array(y);for(let x=0;x<y;x++){const C=Math.floor(x*r),h=u[C]??0,d=u[C+1]??0,v=C>0?u[C-1]??0:h;g[x]=(h+d+v)/3}return g}function Lh(u,o,f){const r=f/o,y=Math.round(u.length*r),g=new Float32Array(y);for(let x=0;x<y;x++){const C=x/r,h=Math.floor(C),d=C-h,v=u[h]??0,p=u[Math.min(h+1,u.length-1)]??0;g[x]=v+d*(p-v)}return g}function R0(){const[u,o]=S.useState("pairing"),[f,r]=S.useState(""),[y,g]=S.useState(""),[x,C]=S.useState(Array(sl).fill("")),h=S.useRef([]),d=S.useRef(localStorage.getItem(Ps)||""),v=S.useRef(""),p=S.useRef(null),E=S.useRef(null),z=S.useRef(null),N=S.useRef(null),_=S.useCallback(()=>x.join(""),[x]),O=()=>{C(Array(sl).fill("")),h.current[0]?.focus()},B=S.useCallback(async k=>{const X=k||_();if(console.log("[Call] submitPairing called, code length:",X.length),X.length!==sl){r("Enter all 6 digits");return}r("");try{console.log("[Call] POST /api/webrtc/pair ...");const $=await tt("/api/webrtc/pair",{code:X});console.log("[Call] Pairing success, got token"),d.current=$.token,localStorage.setItem(Ps,$.token),v.current&&localStorage.setItem(`${Uh}${$.token}`,v.current),o("ready")}catch($){const ae=$?.message||"Pairing failed";console.error("[Call] Pairing failed:",ae),r(ae),O()}},[_]);S.useEffect(()=>{const k=d.current,X=new URLSearchParams(window.location.search),$=X.get("code"),ae=X.get("agentId");if(console.log("[Call] mount: token=%s, urlCode=%s, agentId=%s",k?"present":"none",$??"none",ae??"none"),ae&&(v.current=ae),$&&$.length===sl&&!k){console.log("[Call] auto-pairing from URL code"),B($);return}if(!k){console.log("[Call] no token, showing PIN input"),h.current[0]?.focus();return}if(!ae){const Se=localStorage.getItem(`${Uh}${k}`);Se&&(v.current=Se,console.log("[Call] restored agentId from localStorage:",Se))}console.log("[Call] validating existing token..."),fetch("/api/webrtc/validate",{headers:{Authorization:`Bearer ${k}`}}).then(Se=>(console.log("[Call] validate response status:",Se.status),Se.json())).then(Se=>{console.log("[Call] validate result:",Se),Se.valid?o("ready"):(localStorage.removeItem(Ps),d.current="",$&&$.length===sl?B($):h.current[0]?.focus())}).catch(Se=>{console.error("[Call] validate error:",Se),h.current[0]?.focus()})},[]);const H=(k,X)=>{const $=X.replace(/\D/g,"").slice(0,1),ae=[...x];ae[k]=$,C(ae),$&&k<sl-1&&h.current[k+1]?.focus(),$&&ae.every(Se=>Se!=="")&&B(ae.join(""))},G=(k,X)=>{X.key==="Backspace"&&!x[k]&&k>0&&h.current[k-1]?.focus()},I=k=>{k.preventDefault();const X=(k.clipboardData.getData("text")||"").replace(/\D/g,"").slice(0,sl),$=[...x];for(let ae=0;ae<X.length;ae++)$[ae]=X[ae];C($),X.length===sl?B(X):X.length>0&&h.current[Math.min(X.length,sl-1)]?.focus()},P=S.useCallback(()=>{p.current&&(p.current.onopen=null,p.current.onclose=null,p.current.onerror=null,p.current.onmessage=null,(p.current.readyState===WebSocket.OPEN||p.current.readyState===WebSocket.CONNECTING)&&p.current.close(),p.current=null),z.current&&(z.current.getTracks().forEach(k=>k.stop()),z.current=null),N.current&&(N.current.disconnect(),N.current=null),E.current&&(E.current.close().catch(()=>{}),E.current=null)},[]),V=S.useCallback(async()=>{g(""),o("connecting");let k=null;try{let X;try{X=await navigator.mediaDevices.getUserMedia({audio:!0})}catch{g("Microphone access denied. Please allow microphone access and try again."),o("ready");return}z.current=X,k=new AudioContext,E.current=k,await k.resume();const $=k.sampleRate;await k.audioWorklet.addModule("/audio-processor.js");const ae=new AudioWorkletNode(k,"audio-processor");N.current=ae,k.createMediaStreamSource(X).connect(ae),ae.connect(k.destination);const it=window.location.protocol==="http:"?"ws:":"wss:",ke=v.current?`&agentId=${encodeURIComponent(v.current)}`:"",De=`${it}//${window.location.host}/audio?token=${d.current}${ke}`,U=new WebSocket(De);p.current=U,ae.port.onmessage=Z=>{if(Z.data.type!=="audio"||U.readyState!==WebSocket.OPEN)return;const te=Z.data.samples,re=z0(te,$,A0);U.send(re.buffer)},U.onmessage=async Z=>{if(Z.data instanceof Blob){const te=await Z.data.arrayBuffer(),re=new Int16Array(te),ye=new Float32Array(re.length);for(let q=0;q<re.length;q++)ye[q]=re[q]/32768;const j=Lh(ye,Bh,$);ae.port.postMessage({type:"playback",samples:j});return}if(Z.data instanceof ArrayBuffer){const te=new Int16Array(Z.data),re=new Float32Array(te.length);for(let j=0;j<te.length;j++)re[j]=te[j]/32768;const ye=Lh(re,Bh,$);ae.port.postMessage({type:"playback",samples:ye});return}if(typeof Z.data=="string")try{JSON.parse(Z.data).type==="clear"&&ae.port.postMessage({type:"clear"})}catch{}},U.onopen=()=>{console.log("[Call] WebSocket connected"),o("active")},U.onclose=Z=>{console.log("[Call] WebSocket closed, code:",Z.code,"reason:",Z.reason),P(),o("ready")},U.onerror=Z=>{console.error("[Call] WebSocket error:",Z),g("WebSocket connection failed"),P(),o("ready")}}catch(X){const $=X instanceof Error?X.message:"Connection failed";g(`Connection failed: ${$}`),P(),o("ready")}},[P]),K=S.useCallback(()=>{P(),o("ready")},[P]);return c.jsxs("div",{className:"call-container",children:[c.jsx("h1",{children:"Claude Voice"}),c.jsx("p",{className:"subtitle",children:"Enter the pairing code shown on the dashboard"}),u==="pairing"&&c.jsxs("div",{className:"call-state",children:[c.jsx("div",{className:"pin-inputs",children:x.map((k,X)=>c.jsx("input",{ref:$=>{h.current[X]=$},type:"text",inputMode:"numeric",maxLength:1,value:k,onChange:$=>H(X,$.target.value),onKeyDown:$=>G(X,$),onPaste:X===0?I:void 0},X))}),c.jsx("button",{className:"btn btn-pair",onClick:()=>B(),children:"Pair Device"}),c.jsx("div",{className:"error-msg",children:f})]}),u==="ready"&&c.jsxs("div",{className:"call-state",children:[c.jsx("p",{className:"status-msg",style:{marginBottom:24},children:"Device paired. Ready to call."}),c.jsx("button",{className:"btn btn-call",onClick:V,children:"Start Call"}),c.jsx("div",{className:"error-msg",children:y})]}),u==="connecting"&&c.jsx("div",{className:"call-state",children:c.jsx("p",{className:"status-msg",children:"Connecting..."})}),u==="active"&&c.jsxs("div",{className:"call-state",children:[c.jsx("div",{className:"pulse-ring"}),c.jsx("div",{className:"call-label",children:"Call in progress"}),c.jsx("button",{className:"btn btn-hangup",onClick:K,children:"Hang Up"})]})]})}function M0(){return c.jsx(_v,{children:c.jsxs(uv,{children:[c.jsxs(Ll,{element:c.jsx(Xv,{}),children:[c.jsx(Ll,{path:"/",element:c.jsx(Jv,{})}),c.jsx(Ll,{path:"/settings",element:c.jsx(f0,{})}),c.jsx(Ll,{path:"/agents",element:c.jsx(d0,{})}),c.jsx(Ll,{path:"/agents/:id",element:c.jsx(C0,{})}),c.jsx(Ll,{path:"/c/:id",element:c.jsx(T0,{})})]}),c.jsx(Ll,{path:"/call",element:c.jsx(R0,{})})]})})}const zm=document.getElementById("root");if(!zm)throw new Error("Root element #root not found");cp.createRoot(zm).render(c.jsx(S.StrictMode,{children:c.jsx(M0,{})}));