@ainyc/canonry 1.28.0 → 1.28.2

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.
@@ -5,7 +5,7 @@ function ek(e,t){for(var s=0;s<t.length;s++){const a=t[s];if(typeof a!="string"&
5
5
  `);for(h=d=0;d<D.length&&!D[d].includes("DetermineComponentFrameRoot");)d++;for(;h<F.length&&!F[h].includes("DetermineComponentFrameRoot");)h++;if(d===D.length||h===F.length)for(d=D.length-1,h=F.length-1;1<=d&&0<=h&&D[d]!==F[h];)h--;for(;1<=d&&0<=h;d--,h--)if(D[d]!==F[h]){if(d!==1||h!==1)do if(d--,h--,0>h||D[d]!==F[h]){var W=`
6
6
  `+D[d].replace(" at new "," at ");return n.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",n.displayName)),W}while(1<=d&&0<=h);break}}}finally{Zt=!1,Error.prepareStackTrace=l}return(l=n?n.displayName||n.name:"")?at(l):""}function Dn(n,i){switch(n.tag){case 26:case 27:case 5:return at(n.type);case 16:return at("Lazy");case 13:return n.child!==i&&i!==null?at("Suspense Fallback"):at("Suspense");case 19:return at("SuspenseList");case 0:case 15:return $t(n.type,!1);case 11:return $t(n.type.render,!1);case 1:return $t(n.type,!0);case 31:return at("Activity");default:return""}}function nn(n){try{var i="",l=null;do i+=Dn(n,l),l=n,n=n.return;while(n);return i}catch(d){return`
7
7
  Error generating stack: `+d.message+`
8
- `+d.stack}}var _t=Object.prototype.hasOwnProperty,re=e.unstable_scheduleCallback,Ge=e.unstable_cancelCallback,gt=e.unstable_shouldYield,Vt=e.unstable_requestPaint,Qe=e.unstable_now,De=e.unstable_getCurrentPriorityLevel,Ye=e.unstable_ImmediatePriority,Nt=e.unstable_UserBlockingPriority,Be=e.unstable_NormalPriority,Da=e.unstable_LowPriority,pn=e.unstable_IdlePriority,nt=e.log,Yr=e.unstable_setDisableYieldValue,ts=null,ht=null;function gn(n){if(typeof nt=="function"&&Yr(n),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(ts,n)}catch{}}var ce=Math.clz32?Math.clz32:jl,kn=Math.log,Ma=Math.LN2;function jl(n){return n>>>=0,n===0?32:31-(kn(n)/Ma|0)|0}var Ki=256,$a=262144,Cs=4194304;function hs(n){var i=n&42;if(i!==0)return i;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Pa(n,i,l){var d=n.pendingLanes;if(d===0)return 0;var h=0,g=n.suspendedLanes,j=n.pingedLanes;n=n.warmLanes;var _=d&134217727;return _!==0?(d=_&~g,d!==0?h=hs(d):(j&=_,j!==0?h=hs(j):l||(l=_&~n,l!==0&&(h=hs(l))))):(_=d&~g,_!==0?h=hs(_):j!==0?h=hs(j):l||(l=d&~n,l!==0&&(h=hs(l)))),h===0?0:i!==0&&i!==h&&(i&g)===0&&(g=h&-h,l=i&-i,g>=l||g===32&&(l&4194048)!==0)?i:h}function Ys(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function xd(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 wl(){var n=Cs;return Cs<<=1,(Cs&62914560)===0&&(Cs=4194304),n}function Jr(n){for(var i=[],l=0;31>l;l++)i.push(n);return i}function Gi(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Nl(n,i,l,d,h,g){var j=n.pendingLanes;n.pendingLanes=l,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=l,n.entangledLanes&=l,n.errorRecoveryDisabledLanes&=l,n.shellSuspendCounter=0;var _=n.entanglements,D=n.expirationTimes,F=n.hiddenUpdates;for(l=j&~l;0<l;){var W=31-ce(l),ie=1<<W;_[W]=0,D[W]=-1;var Z=F[W];if(Z!==null)for(F[W]=null,W=0;W<Z.length;W++){var Y=Z[W];Y!==null&&(Y.lane&=-536870913)}l&=~ie}d!==0&&I(n,d,0),g!==0&&h===0&&n.tag!==0&&(n.suspendedLanes|=g&~(j&~i))}function I(n,i,l){n.pendingLanes|=i,n.suspendedLanes&=~i;var d=31-ce(i);n.entangledLanes|=i,n.entanglements[d]=n.entanglements[d]|1073741824|l&261930}function he(n,i){var l=n.entangledLanes|=i;for(n=n.entanglements;l;){var d=31-ce(l),h=1<<d;h&i|n[d]&i&&(n[d]|=i),l&=~h}}function xt(n,i){var l=i&-i;return l=(l&42)!==0?1:Ht(l),(l&(n.suspendedLanes|i))!==0?0:l}function Ht(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function ln(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Ua(){var n=ae.p;return n!==0?n:(n=window.event,n===void 0?32:Uv(n.type))}function ms(n,i){var l=ae.p;try{return ae.p=n,i()}finally{ae.p=l}}var cn=Math.random().toString(36).slice(2),st="__reactFiber$"+cn,sn="__reactProps$"+cn,zn="__reactContainer$"+cn,ks="__reactEvents$"+cn,Ia="__reactListeners$"+cn,Cl="__reactHandles$"+cn,kl="__reactResources$"+cn,ps="__reactMarker$"+cn;function Js(n){delete n[st],delete n[sn],delete n[ks],delete n[Ia],delete n[Cl]}function Xs(n){var i=n[st];if(i)return i;for(var l=n.parentNode;l;){if(i=l[zn]||l[st]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(n=wv(n);n!==null;){if(l=n[st])return l;n=wv(n)}return i}n=l,l=n.parentNode}return null}function Ws(n){if(n=n[st]||n[zn]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function Me(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(a(33))}function Je(n){var i=n[kl];return i||(i=n[kl]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function it(n){n[ps]=!0}var ns=new Set,Fi={};function gs(n,i){Ba(n,i),Ba(n+"Capture",i)}function Ba(n,i){for(Fi[n]=i,n=0;n<i.length;n++)ns.add(i[n])}var GN=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]*$"),ag={},rg={};function FN(n){return _t.call(rg,n)?!0:_t.call(ag,n)?!1:GN.test(n)?rg[n]=!0:(ag[n]=!0,!1)}function zl(n,i,l){if(FN(i))if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+l)}}function _l(n,i,l){if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+l)}}function zs(n,i,l,d){if(d===null)n.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(l);return}n.setAttributeNS(i,l,""+d)}}function Mn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function og(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function ZN(n,i,l){var d=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var h=d.get,g=d.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return h.call(this)},set:function(j){l=""+j,g.call(this,j)}}),Object.defineProperty(n,i,{enumerable:d.enumerable}),{getValue:function(){return l},setValue:function(j){l=""+j},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function bd(n){if(!n._valueTracker){var i=og(n)?"checked":"value";n._valueTracker=ZN(n,i,""+n[i])}}function lg(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var l=i.getValue(),d="";return n&&(d=og(n)?n.checked?"true":"false":n.value),n=d,n!==l?(i.setValue(n),!0):!1}function El(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var VN=/[\n"\\]/g;function $n(n){return n.replace(VN,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Sd(n,i,l,d,h,g,j,_){n.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?n.type=j:n.removeAttribute("type"),i!=null?j==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+Mn(i)):n.value!==""+Mn(i)&&(n.value=""+Mn(i)):j!=="submit"&&j!=="reset"||n.removeAttribute("value"),i!=null?jd(n,j,Mn(i)):l!=null?jd(n,j,Mn(l)):d!=null&&n.removeAttribute("value"),h==null&&g!=null&&(n.defaultChecked=!!g),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?n.name=""+Mn(_):n.removeAttribute("name")}function cg(n,i,l,d,h,g,j,_){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),i!=null||l!=null){if(!(g!=="submit"&&g!=="reset"||i!=null)){bd(n);return}l=l!=null?""+Mn(l):"",i=i!=null?""+Mn(i):l,_||i===n.value||(n.value=i),n.defaultValue=i}d=d??h,d=typeof d!="function"&&typeof d!="symbol"&&!!d,n.checked=_?n.checked:!!d,n.defaultChecked=!!d,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(n.name=j),bd(n)}function jd(n,i,l){i==="number"&&El(n.ownerDocument)===n||n.defaultValue===""+l||(n.defaultValue=""+l)}function qa(n,i,l,d){if(n=n.options,i){i={};for(var h=0;h<l.length;h++)i["$"+l[h]]=!0;for(l=0;l<n.length;l++)h=i.hasOwnProperty("$"+n[l].value),n[l].selected!==h&&(n[l].selected=h),h&&d&&(n[l].defaultSelected=!0)}else{for(l=""+Mn(l),i=null,h=0;h<n.length;h++){if(n[h].value===l){n[h].selected=!0,d&&(n[h].defaultSelected=!0);return}i!==null||n[h].disabled||(i=n[h])}i!==null&&(i.selected=!0)}}function ug(n,i,l){if(i!=null&&(i=""+Mn(i),i!==n.value&&(n.value=i),l==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=l!=null?""+Mn(l):""}function dg(n,i,l,d){if(i==null){if(d!=null){if(l!=null)throw Error(a(92));if(je(d)){if(1<d.length)throw Error(a(93));d=d[0]}l=d}l==null&&(l=""),i=l}l=Mn(i),n.defaultValue=l,d=n.textContent,d===l&&d!==""&&d!==null&&(n.value=d),bd(n)}function Ha(n,i){if(i){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=i;return}}n.textContent=i}var QN=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 fg(n,i,l){var d=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?d?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":d?n.setProperty(i,l):typeof l!="number"||l===0||QN.has(i)?i==="float"?n.cssFloat=l:n[i]=(""+l).trim():n[i]=l+"px"}function hg(n,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(n=n.style,l!=null){for(var d in l)!l.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?n.setProperty(d,""):d==="float"?n.cssFloat="":n[d]="");for(var h in i)d=i[h],i.hasOwnProperty(h)&&l[h]!==d&&fg(n,h,d)}else for(var g in i)i.hasOwnProperty(g)&&fg(n,g,i[g])}function wd(n){if(n.indexOf("-")===-1)return!1;switch(n){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 YN=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"]]),JN=/^[\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 Rl(n){return JN.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function _s(){}var Nd=null;function Cd(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Ka=null,Ga=null;function mg(n){var i=Ws(n);if(i&&(n=i.stateNode)){var l=n[sn]||null;e:switch(n=i.stateNode,i.type){case"input":if(Sd(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+$n(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var d=l[i];if(d!==n&&d.form===n.form){var h=d[sn]||null;if(!h)throw Error(a(90));Sd(d,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(i=0;i<l.length;i++)d=l[i],d.form===n.form&&lg(d)}break e;case"textarea":ug(n,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&qa(n,!!l.multiple,i,!1)}}}var kd=!1;function pg(n,i,l){if(kd)return n(i,l);kd=!0;try{var d=n(i);return d}finally{if(kd=!1,(Ka!==null||Ga!==null)&&(yc(),Ka&&(i=Ka,n=Ga,Ga=Ka=null,mg(i),n)))for(i=0;i<n.length;i++)mg(n[i])}}function Xr(n,i){var l=n.stateNode;if(l===null)return null;var d=l[sn]||null;if(d===null)return null;l=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(n=n.type,d=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!d;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(a(231,i,typeof l));return l}var Es=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zd=!1;if(Es)try{var Wr={};Object.defineProperty(Wr,"passive",{get:function(){zd=!0}}),window.addEventListener("test",Wr,Wr),window.removeEventListener("test",Wr,Wr)}catch{zd=!1}var ei=null,_d=null,Al=null;function gg(){if(Al)return Al;var n,i=_d,l=i.length,d,h="value"in ei?ei.value:ei.textContent,g=h.length;for(n=0;n<l&&i[n]===h[n];n++);var j=l-n;for(d=1;d<=j&&i[l-d]===h[g-d];d++);return Al=h.slice(n,1<d?1-d:void 0)}function Tl(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function Ol(){return!0}function yg(){return!1}function yn(n){function i(l,d,h,g,j){this._reactName=l,this._targetInst=h,this.type=d,this.nativeEvent=g,this.target=j,this.currentTarget=null;for(var _ in n)n.hasOwnProperty(_)&&(l=n[_],this[_]=l?l(g):g[_]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Ol:yg,this.isPropagationStopped=yg,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ol)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ol)},persist:function(){},isPersistent:Ol}),i}var Zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ll=yn(Zi),eo=y({},Zi,{view:0,detail:0}),XN=yn(eo),Ed,Rd,to,Dl=y({},eo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Td,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==to&&(to&&n.type==="mousemove"?(Ed=n.screenX-to.screenX,Rd=n.screenY-to.screenY):Rd=Ed=0,to=n),Ed)},movementY:function(n){return"movementY"in n?n.movementY:Rd}}),vg=yn(Dl),WN=y({},Dl,{dataTransfer:0}),e1=yn(WN),t1=y({},eo,{relatedTarget:0}),Ad=yn(t1),n1=y({},Zi,{animationName:0,elapsedTime:0,pseudoElement:0}),s1=yn(n1),i1=y({},Zi,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),a1=yn(i1),r1=y({},Zi,{data:0}),xg=yn(r1),o1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},l1={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"},c1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function u1(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=c1[n])?!!i[n]:!1}function Td(){return u1}var d1=y({},eo,{key:function(n){if(n.key){var i=o1[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=Tl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?l1[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Td,charCode:function(n){return n.type==="keypress"?Tl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Tl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),f1=yn(d1),h1=y({},Dl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bg=yn(h1),m1=y({},eo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Td}),p1=yn(m1),g1=y({},Zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),y1=yn(g1),v1=y({},Dl,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),x1=yn(v1),b1=y({},Zi,{newState:0,oldState:0}),S1=yn(b1),j1=[9,13,27,32],Od=Es&&"CompositionEvent"in window,no=null;Es&&"documentMode"in document&&(no=document.documentMode);var w1=Es&&"TextEvent"in window&&!no,Sg=Es&&(!Od||no&&8<no&&11>=no),jg=" ",wg=!1;function Ng(n,i){switch(n){case"keyup":return j1.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Fa=!1;function N1(n,i){switch(n){case"compositionend":return Cg(i);case"keypress":return i.which!==32?null:(wg=!0,jg);case"textInput":return n=i.data,n===jg&&wg?null:n;default:return null}}function C1(n,i){if(Fa)return n==="compositionend"||!Od&&Ng(n,i)?(n=gg(),Al=_d=ei=null,Fa=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Sg&&i.locale!=="ko"?null:i.data;default:return null}}var k1={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 kg(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!k1[n.type]:i==="textarea"}function zg(n,i,l,d){Ka?Ga?Ga.push(d):Ga=[d]:Ka=d,i=Nc(i,"onChange"),0<i.length&&(l=new Ll("onChange","change",null,l,d),n.push({event:l,listeners:i}))}var so=null,io=null;function z1(n){cv(n,0)}function Ml(n){var i=Me(n);if(lg(i))return n}function _g(n,i){if(n==="change")return i}var Eg=!1;if(Es){var Ld;if(Es){var Dd="oninput"in document;if(!Dd){var Rg=document.createElement("div");Rg.setAttribute("oninput","return;"),Dd=typeof Rg.oninput=="function"}Ld=Dd}else Ld=!1;Eg=Ld&&(!document.documentMode||9<document.documentMode)}function Ag(){so&&(so.detachEvent("onpropertychange",Tg),io=so=null)}function Tg(n){if(n.propertyName==="value"&&Ml(io)){var i=[];zg(i,io,n,Cd(n)),pg(z1,i)}}function _1(n,i,l){n==="focusin"?(Ag(),so=i,io=l,so.attachEvent("onpropertychange",Tg)):n==="focusout"&&Ag()}function E1(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Ml(io)}function R1(n,i){if(n==="click")return Ml(i)}function A1(n,i){if(n==="input"||n==="change")return Ml(i)}function T1(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var _n=typeof Object.is=="function"?Object.is:T1;function ao(n,i){if(_n(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var l=Object.keys(n),d=Object.keys(i);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var h=l[d];if(!_t.call(i,h)||!_n(n[h],i[h]))return!1}return!0}function Og(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Lg(n,i){var l=Og(n);n=0;for(var d;l;){if(l.nodeType===3){if(d=n+l.textContent.length,n<=i&&d>=i)return{node:l,offset:i-n};n=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Og(l)}}function Dg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Dg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function Mg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=El(n.document);i instanceof n.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)n=i.contentWindow;else break;i=El(n.document)}return i}function Md(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var O1=Es&&"documentMode"in document&&11>=document.documentMode,Za=null,$d=null,ro=null,Pd=!1;function $g(n,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Pd||Za==null||Za!==El(d)||(d=Za,"selectionStart"in d&&Md(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),ro&&ao(ro,d)||(ro=d,d=Nc($d,"onSelect"),0<d.length&&(i=new Ll("onSelect","select",null,i,l),n.push({event:i,listeners:d}),i.target=Za)))}function Vi(n,i){var l={};return l[n.toLowerCase()]=i.toLowerCase(),l["Webkit"+n]="webkit"+i,l["Moz"+n]="moz"+i,l}var Va={animationend:Vi("Animation","AnimationEnd"),animationiteration:Vi("Animation","AnimationIteration"),animationstart:Vi("Animation","AnimationStart"),transitionrun:Vi("Transition","TransitionRun"),transitionstart:Vi("Transition","TransitionStart"),transitioncancel:Vi("Transition","TransitionCancel"),transitionend:Vi("Transition","TransitionEnd")},Ud={},Pg={};Es&&(Pg=document.createElement("div").style,"AnimationEvent"in window||(delete Va.animationend.animation,delete Va.animationiteration.animation,delete Va.animationstart.animation),"TransitionEvent"in window||delete Va.transitionend.transition);function Qi(n){if(Ud[n])return Ud[n];if(!Va[n])return n;var i=Va[n],l;for(l in i)if(i.hasOwnProperty(l)&&l in Pg)return Ud[n]=i[l];return n}var Ug=Qi("animationend"),Ig=Qi("animationiteration"),Bg=Qi("animationstart"),L1=Qi("transitionrun"),D1=Qi("transitionstart"),M1=Qi("transitioncancel"),qg=Qi("transitionend"),Hg=new Map,Id="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(" ");Id.push("scrollEnd");function ss(n,i){Hg.set(n,i),gs(i,[n])}var $l=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Pn=[],Qa=0,Bd=0;function Pl(){for(var n=Qa,i=Bd=Qa=0;i<n;){var l=Pn[i];Pn[i++]=null;var d=Pn[i];Pn[i++]=null;var h=Pn[i];Pn[i++]=null;var g=Pn[i];if(Pn[i++]=null,d!==null&&h!==null){var j=d.pending;j===null?h.next=h:(h.next=j.next,j.next=h),d.pending=h}g!==0&&Kg(l,h,g)}}function Ul(n,i,l,d){Pn[Qa++]=n,Pn[Qa++]=i,Pn[Qa++]=l,Pn[Qa++]=d,Bd|=d,n.lanes|=d,n=n.alternate,n!==null&&(n.lanes|=d)}function qd(n,i,l,d){return Ul(n,i,l,d),Il(n)}function Yi(n,i){return Ul(n,null,null,i),Il(n)}function Kg(n,i,l){n.lanes|=l;var d=n.alternate;d!==null&&(d.lanes|=l);for(var h=!1,g=n.return;g!==null;)g.childLanes|=l,d=g.alternate,d!==null&&(d.childLanes|=l),g.tag===22&&(n=g.stateNode,n===null||n._visibility&1||(h=!0)),n=g,g=g.return;return n.tag===3?(g=n.stateNode,h&&i!==null&&(h=31-ce(l),n=g.hiddenUpdates,d=n[h],d===null?n[h]=[i]:d.push(i),i.lane=l|536870912),g):null}function Il(n){if(50<Eo)throw Eo=0,Xf=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Ya={};function $1(n,i,l,d){this.tag=n,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=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function En(n,i,l,d){return new $1(n,i,l,d)}function Hd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Rs(n,i){var l=n.alternate;return l===null?(l=En(n.tag,i,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=i,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&65011712,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,i=n.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l.refCleanup=n.refCleanup,l}function Gg(n,i){n.flags&=65011714;var l=n.alternate;return l===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,i=l.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function Bl(n,i,l,d,h,g){var j=0;if(d=n,typeof n=="function")Hd(n)&&(j=1);else if(typeof n=="string")j=qC(n,l,le.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case U:return n=En(31,l,i,h),n.elementType=U,n.lanes=g,n;case S:return Ji(l.children,h,g,i);case C:j=8,h|=24;break;case k:return n=En(12,l,i,h|2),n.elementType=k,n.lanes=g,n;case O:return n=En(13,l,i,h),n.elementType=O,n.lanes=g,n;case M:return n=En(19,l,i,h),n.elementType=M,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case R:j=10;break e;case A:j=9;break e;case z:j=11;break e;case E:j=14;break e;case L:j=16,d=null;break e}j=29,l=Error(a(130,n===null?"null":typeof n,"")),d=null}return i=En(j,l,i,h),i.elementType=n,i.type=d,i.lanes=g,i}function Ji(n,i,l,d){return n=En(7,n,d,i),n.lanes=l,n}function Kd(n,i,l){return n=En(6,n,null,i),n.lanes=l,n}function Fg(n){var i=En(18,null,null,0);return i.stateNode=n,i}function Gd(n,i,l){return i=En(4,n.children!==null?n.children:[],n.key,i),i.lanes=l,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var Zg=new WeakMap;function Un(n,i){if(typeof n=="object"&&n!==null){var l=Zg.get(n);return l!==void 0?l:(i={value:n,source:i,stack:nn(i)},Zg.set(n,i),i)}return{value:n,source:i,stack:nn(i)}}var Ja=[],Xa=0,ql=null,oo=0,In=[],Bn=0,ti=null,ys=1,vs="";function As(n,i){Ja[Xa++]=oo,Ja[Xa++]=ql,ql=n,oo=i}function Vg(n,i,l){In[Bn++]=ys,In[Bn++]=vs,In[Bn++]=ti,ti=n;var d=ys;n=vs;var h=32-ce(d)-1;d&=~(1<<h),l+=1;var g=32-ce(i)+h;if(30<g){var j=h-h%5;g=(d&(1<<j)-1).toString(32),d>>=j,h-=j,ys=1<<32-ce(i)+h|l<<h|d,vs=g+n}else ys=1<<g|l<<h|d,vs=n}function Fd(n){n.return!==null&&(As(n,1),Vg(n,1,0))}function Zd(n){for(;n===ql;)ql=Ja[--Xa],Ja[Xa]=null,oo=Ja[--Xa],Ja[Xa]=null;for(;n===ti;)ti=In[--Bn],In[Bn]=null,vs=In[--Bn],In[Bn]=null,ys=In[--Bn],In[Bn]=null}function Qg(n,i){In[Bn++]=ys,In[Bn++]=vs,In[Bn++]=ti,ys=i.id,vs=i.overflow,ti=n}var Yt=null,yt=null,Fe=!1,ni=null,qn=!1,Vd=Error(a(519));function si(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw lo(Un(i,n)),Vd}function Yg(n){var i=n.stateNode,l=n.type,d=n.memoizedProps;switch(i[st]=n,i[sn]=d,l){case"dialog":Ie("cancel",i),Ie("close",i);break;case"iframe":case"object":case"embed":Ie("load",i);break;case"video":case"audio":for(l=0;l<Ao.length;l++)Ie(Ao[l],i);break;case"source":Ie("error",i);break;case"img":case"image":case"link":Ie("error",i),Ie("load",i);break;case"details":Ie("toggle",i);break;case"input":Ie("invalid",i),cg(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Ie("invalid",i);break;case"textarea":Ie("invalid",i),dg(i,d.value,d.defaultValue,d.children)}l=d.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||d.suppressHydrationWarning===!0||hv(i.textContent,l)?(d.popover!=null&&(Ie("beforetoggle",i),Ie("toggle",i)),d.onScroll!=null&&Ie("scroll",i),d.onScrollEnd!=null&&Ie("scrollend",i),d.onClick!=null&&(i.onclick=_s),i=!0):i=!1,i||si(n,!0)}function Jg(n){for(Yt=n.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:qn=!1;return;case 27:case 3:qn=!0;return;default:Yt=Yt.return}}function Wa(n){if(n!==Yt)return!1;if(!Fe)return Jg(n),Fe=!0,!1;var i=n.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=n.type,l=!(l!=="form"&&l!=="button")||hh(n.type,n.memoizedProps)),l=!l),l&&yt&&si(n),Jg(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));yt=jv(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));yt=jv(n)}else i===27?(i=yt,yi(n.type)?(n=vh,vh=null,yt=n):yt=i):yt=Yt?Kn(n.stateNode.nextSibling):null;return!0}function Xi(){yt=Yt=null,Fe=!1}function Qd(){var n=ni;return n!==null&&(Sn===null?Sn=n:Sn.push.apply(Sn,n),ni=null),n}function lo(n){ni===null?ni=[n]:ni.push(n)}var Yd=T(null),Wi=null,Ts=null;function ii(n,i,l){se(Yd,i._currentValue),i._currentValue=l}function Os(n){n._currentValue=Yd.current,B(Yd)}function Jd(n,i,l){for(;n!==null;){var d=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),n===l)break;n=n.return}}function Xd(n,i,l,d){var h=n.child;for(h!==null&&(h.return=n);h!==null;){var g=h.dependencies;if(g!==null){var j=h.child;g=g.firstContext;e:for(;g!==null;){var _=g;g=h;for(var D=0;D<i.length;D++)if(_.context===i[D]){g.lanes|=l,_=g.alternate,_!==null&&(_.lanes|=l),Jd(g.return,l,n),d||(j=null);break e}g=_.next}}else if(h.tag===18){if(j=h.return,j===null)throw Error(a(341));j.lanes|=l,g=j.alternate,g!==null&&(g.lanes|=l),Jd(j,l,n),j=null}else j=h.child;if(j!==null)j.return=h;else for(j=h;j!==null;){if(j===n){j=null;break}if(h=j.sibling,h!==null){h.return=j.return,j=h;break}j=j.return}h=j}}function er(n,i,l,d){n=null;for(var h=i,g=!1;h!==null;){if(!g){if((h.flags&524288)!==0)g=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var j=h.alternate;if(j===null)throw Error(a(387));if(j=j.memoizedProps,j!==null){var _=h.type;_n(h.pendingProps.value,j.value)||(n!==null?n.push(_):n=[_])}}else if(h===ye.current){if(j=h.alternate,j===null)throw Error(a(387));j.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(Mo):n=[Mo])}h=h.return}n!==null&&Xd(i,n,l,d),i.flags|=262144}function Hl(n){for(n=n.firstContext;n!==null;){if(!_n(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function ea(n){Wi=n,Ts=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Jt(n){return Xg(Wi,n)}function Kl(n,i){return Wi===null&&ea(n),Xg(n,i)}function Xg(n,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},Ts===null){if(n===null)throw Error(a(308));Ts=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else Ts=Ts.next=i;return l}var P1=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(l,d){n.push(d)}};this.abort=function(){i.aborted=!0,n.forEach(function(l){return l()})}},U1=e.unstable_scheduleCallback,I1=e.unstable_NormalPriority,Pt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Wd(){return{controller:new P1,data:new Map,refCount:0}}function co(n){n.refCount--,n.refCount===0&&U1(I1,function(){n.controller.abort()})}var uo=null,ef=0,tr=0,nr=null;function B1(n,i){if(uo===null){var l=uo=[];ef=0,tr=ih(),nr={status:"pending",value:void 0,then:function(d){l.push(d)}}}return ef++,i.then(Wg,Wg),i}function Wg(){if(--ef===0&&uo!==null){nr!==null&&(nr.status="fulfilled");var n=uo;uo=null,tr=0,nr=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function q1(n,i){var l=[],d={status:"pending",value:null,reason:null,then:function(h){l.push(h)}};return n.then(function(){d.status="fulfilled",d.value=i;for(var h=0;h<l.length;h++)(0,l[h])(i)},function(h){for(d.status="rejected",d.reason=h,h=0;h<l.length;h++)(0,l[h])(void 0)}),d}var ey=K.S;K.S=function(n,i){$0=Qe(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&B1(n,i),ey!==null&&ey(n,i)};var ta=T(null);function tf(){var n=ta.current;return n!==null?n:mt.pooledCache}function Gl(n,i){i===null?se(ta,ta.current):se(ta,i.pool)}function ty(){var n=tf();return n===null?null:{parent:Pt._currentValue,pool:n}}var sr=Error(a(460)),nf=Error(a(474)),Fl=Error(a(542)),Zl={then:function(){}};function ny(n){return n=n.status,n==="fulfilled"||n==="rejected"}function sy(n,i,l){switch(l=n[l],l===void 0?n.push(i):l!==i&&(i.then(_s,_s),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,ay(n),n;default:if(typeof i.status=="string")i.then(_s,_s);else{if(n=mt,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=i,n.status="pending",n.then(function(d){if(i.status==="pending"){var h=i;h.status="fulfilled",h.value=d}},function(d){if(i.status==="pending"){var h=i;h.status="rejected",h.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,ay(n),n}throw sa=i,sr}}function na(n){try{var i=n._init;return i(n._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(sa=l,sr):l}}var sa=null;function iy(){if(sa===null)throw Error(a(459));var n=sa;return sa=null,n}function ay(n){if(n===sr||n===Fl)throw Error(a(483))}var ir=null,fo=0;function Vl(n){var i=fo;return fo+=1,ir===null&&(ir=[]),sy(ir,n,i)}function ho(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function Ql(n,i){throw i.$$typeof===x?Error(a(525)):(n=Object.prototype.toString.call(i),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function ry(n){function i(q,$){if(n){var G=q.deletions;G===null?(q.deletions=[$],q.flags|=16):G.push($)}}function l(q,$){if(!n)return null;for(;$!==null;)i(q,$),$=$.sibling;return null}function d(q){for(var $=new Map;q!==null;)q.key!==null?$.set(q.key,q):$.set(q.index,q),q=q.sibling;return $}function h(q,$){return q=Rs(q,$),q.index=0,q.sibling=null,q}function g(q,$,G){return q.index=G,n?(G=q.alternate,G!==null?(G=G.index,G<$?(q.flags|=67108866,$):G):(q.flags|=67108866,$)):(q.flags|=1048576,$)}function j(q){return n&&q.alternate===null&&(q.flags|=67108866),q}function _(q,$,G,te){return $===null||$.tag!==6?($=Kd(G,q.mode,te),$.return=q,$):($=h($,G),$.return=q,$)}function D(q,$,G,te){var Ne=G.type;return Ne===S?W(q,$,G.props.children,te,G.key):$!==null&&($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===L&&na(Ne)===$.type)?($=h($,G.props),ho($,G),$.return=q,$):($=Bl(G.type,G.key,G.props,null,q.mode,te),ho($,G),$.return=q,$)}function F(q,$,G,te){return $===null||$.tag!==4||$.stateNode.containerInfo!==G.containerInfo||$.stateNode.implementation!==G.implementation?($=Gd(G,q.mode,te),$.return=q,$):($=h($,G.children||[]),$.return=q,$)}function W(q,$,G,te,Ne){return $===null||$.tag!==7?($=Ji(G,q.mode,te,Ne),$.return=q,$):($=h($,G),$.return=q,$)}function ie(q,$,G){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Kd(""+$,q.mode,G),$.return=q,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case b:return G=Bl($.type,$.key,$.props,null,q.mode,G),ho(G,$),G.return=q,G;case N:return $=Gd($,q.mode,G),$.return=q,$;case L:return $=na($),ie(q,$,G)}if(je($)||ee($))return $=Ji($,q.mode,G,null),$.return=q,$;if(typeof $.then=="function")return ie(q,Vl($),G);if($.$$typeof===R)return ie(q,Kl(q,$),G);Ql(q,$)}return null}function Z(q,$,G,te){var Ne=$!==null?$.key:null;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return Ne!==null?null:_(q,$,""+G,te);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case b:return G.key===Ne?D(q,$,G,te):null;case N:return G.key===Ne?F(q,$,G,te):null;case L:return G=na(G),Z(q,$,G,te)}if(je(G)||ee(G))return Ne!==null?null:W(q,$,G,te,null);if(typeof G.then=="function")return Z(q,$,Vl(G),te);if(G.$$typeof===R)return Z(q,$,Kl(q,G),te);Ql(q,G)}return null}function Y(q,$,G,te,Ne){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return q=q.get(G)||null,_($,q,""+te,Ne);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case b:return q=q.get(te.key===null?G:te.key)||null,D($,q,te,Ne);case N:return q=q.get(te.key===null?G:te.key)||null,F($,q,te,Ne);case L:return te=na(te),Y(q,$,G,te,Ne)}if(je(te)||ee(te))return q=q.get(G)||null,W($,q,te,Ne,null);if(typeof te.then=="function")return Y(q,$,G,Vl(te),Ne);if(te.$$typeof===R)return Y(q,$,G,Kl($,te),Ne);Ql($,te)}return null}function ve(q,$,G,te){for(var Ne=null,Xe=null,Se=$,Te=$=0,He=null;Se!==null&&Te<G.length;Te++){Se.index>Te?(He=Se,Se=null):He=Se.sibling;var We=Z(q,Se,G[Te],te);if(We===null){Se===null&&(Se=He);break}n&&Se&&We.alternate===null&&i(q,Se),$=g(We,$,Te),Xe===null?Ne=We:Xe.sibling=We,Xe=We,Se=He}if(Te===G.length)return l(q,Se),Fe&&As(q,Te),Ne;if(Se===null){for(;Te<G.length;Te++)Se=ie(q,G[Te],te),Se!==null&&($=g(Se,$,Te),Xe===null?Ne=Se:Xe.sibling=Se,Xe=Se);return Fe&&As(q,Te),Ne}for(Se=d(Se);Te<G.length;Te++)He=Y(Se,q,Te,G[Te],te),He!==null&&(n&&He.alternate!==null&&Se.delete(He.key===null?Te:He.key),$=g(He,$,Te),Xe===null?Ne=He:Xe.sibling=He,Xe=He);return n&&Se.forEach(function(ji){return i(q,ji)}),Fe&&As(q,Te),Ne}function Ce(q,$,G,te){if(G==null)throw Error(a(151));for(var Ne=null,Xe=null,Se=$,Te=$=0,He=null,We=G.next();Se!==null&&!We.done;Te++,We=G.next()){Se.index>Te?(He=Se,Se=null):He=Se.sibling;var ji=Z(q,Se,We.value,te);if(ji===null){Se===null&&(Se=He);break}n&&Se&&ji.alternate===null&&i(q,Se),$=g(ji,$,Te),Xe===null?Ne=ji:Xe.sibling=ji,Xe=ji,Se=He}if(We.done)return l(q,Se),Fe&&As(q,Te),Ne;if(Se===null){for(;!We.done;Te++,We=G.next())We=ie(q,We.value,te),We!==null&&($=g(We,$,Te),Xe===null?Ne=We:Xe.sibling=We,Xe=We);return Fe&&As(q,Te),Ne}for(Se=d(Se);!We.done;Te++,We=G.next())We=Y(Se,q,Te,We.value,te),We!==null&&(n&&We.alternate!==null&&Se.delete(We.key===null?Te:We.key),$=g(We,$,Te),Xe===null?Ne=We:Xe.sibling=We,Xe=We);return n&&Se.forEach(function(WC){return i(q,WC)}),Fe&&As(q,Te),Ne}function ft(q,$,G,te){if(typeof G=="object"&&G!==null&&G.type===S&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case b:e:{for(var Ne=G.key;$!==null;){if($.key===Ne){if(Ne=G.type,Ne===S){if($.tag===7){l(q,$.sibling),te=h($,G.props.children),te.return=q,q=te;break e}}else if($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===L&&na(Ne)===$.type){l(q,$.sibling),te=h($,G.props),ho(te,G),te.return=q,q=te;break e}l(q,$);break}else i(q,$);$=$.sibling}G.type===S?(te=Ji(G.props.children,q.mode,te,G.key),te.return=q,q=te):(te=Bl(G.type,G.key,G.props,null,q.mode,te),ho(te,G),te.return=q,q=te)}return j(q);case N:e:{for(Ne=G.key;$!==null;){if($.key===Ne)if($.tag===4&&$.stateNode.containerInfo===G.containerInfo&&$.stateNode.implementation===G.implementation){l(q,$.sibling),te=h($,G.children||[]),te.return=q,q=te;break e}else{l(q,$);break}else i(q,$);$=$.sibling}te=Gd(G,q.mode,te),te.return=q,q=te}return j(q);case L:return G=na(G),ft(q,$,G,te)}if(je(G))return ve(q,$,G,te);if(ee(G)){if(Ne=ee(G),typeof Ne!="function")throw Error(a(150));return G=Ne.call(G),Ce(q,$,G,te)}if(typeof G.then=="function")return ft(q,$,Vl(G),te);if(G.$$typeof===R)return ft(q,$,Kl(q,G),te);Ql(q,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,$!==null&&$.tag===6?(l(q,$.sibling),te=h($,G),te.return=q,q=te):(l(q,$),te=Kd(G,q.mode,te),te.return=q,q=te),j(q)):l(q,$)}return function(q,$,G,te){try{fo=0;var Ne=ft(q,$,G,te);return ir=null,Ne}catch(Se){if(Se===sr||Se===Fl)throw Se;var Xe=En(29,Se,null,q.mode);return Xe.lanes=te,Xe.return=q,Xe}}}var ia=ry(!0),oy=ry(!1),ai=!1;function sf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function af(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function ri(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function oi(n,i,l){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(tt&2)!==0){var h=d.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),d.pending=i,i=Il(n),Kg(n,null,l),i}return Ul(n,d,i,l),Il(n)}function mo(n,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var d=i.lanes;d&=n.pendingLanes,l|=d,i.lanes=l,he(n,l)}}function rf(n,i){var l=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var h=null,g=null;if(l=l.firstBaseUpdate,l!==null){do{var j={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};g===null?h=g=j:g=g.next=j,l=l.next}while(l!==null);g===null?h=g=i:g=g.next=i}else h=g=i;l={baseState:d.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:d.shared,callbacks:d.callbacks},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=i:n.next=i,l.lastBaseUpdate=i}var of=!1;function po(){if(of){var n=nr;if(n!==null)throw n}}function go(n,i,l,d){of=!1;var h=n.updateQueue;ai=!1;var g=h.firstBaseUpdate,j=h.lastBaseUpdate,_=h.shared.pending;if(_!==null){h.shared.pending=null;var D=_,F=D.next;D.next=null,j===null?g=F:j.next=F,j=D;var W=n.alternate;W!==null&&(W=W.updateQueue,_=W.lastBaseUpdate,_!==j&&(_===null?W.firstBaseUpdate=F:_.next=F,W.lastBaseUpdate=D))}if(g!==null){var ie=h.baseState;j=0,W=F=D=null,_=g;do{var Z=_.lane&-536870913,Y=Z!==_.lane;if(Y?(qe&Z)===Z:(d&Z)===Z){Z!==0&&Z===tr&&(of=!0),W!==null&&(W=W.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ve=n,Ce=_;Z=i;var ft=l;switch(Ce.tag){case 1:if(ve=Ce.payload,typeof ve=="function"){ie=ve.call(ft,ie,Z);break e}ie=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Ce.payload,Z=typeof ve=="function"?ve.call(ft,ie,Z):ve,Z==null)break e;ie=y({},ie,Z);break e;case 2:ai=!0}}Z=_.callback,Z!==null&&(n.flags|=64,Y&&(n.flags|=8192),Y=h.callbacks,Y===null?h.callbacks=[Z]:Y.push(Z))}else Y={lane:Z,tag:_.tag,payload:_.payload,callback:_.callback,next:null},W===null?(F=W=Y,D=ie):W=W.next=Y,j|=Z;if(_=_.next,_===null){if(_=h.shared.pending,_===null)break;Y=_,_=Y.next,Y.next=null,h.lastBaseUpdate=Y,h.shared.pending=null}}while(!0);W===null&&(D=ie),h.baseState=D,h.firstBaseUpdate=F,h.lastBaseUpdate=W,g===null&&(h.shared.lanes=0),fi|=j,n.lanes=j,n.memoizedState=ie}}function ly(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function cy(n,i){var l=n.callbacks;if(l!==null)for(n.callbacks=null,n=0;n<l.length;n++)ly(l[n],i)}var ar=T(null),Yl=T(0);function uy(n,i){n=qs,se(Yl,n),se(ar,i),qs=n|i.baseLanes}function lf(){se(Yl,qs),se(ar,ar.current)}function cf(){qs=Yl.current,B(ar),B(Yl)}var Rn=T(null),Hn=null;function li(n){var i=n.alternate;se(Tt,Tt.current&1),se(Rn,n),Hn===null&&(i===null||ar.current!==null||i.memoizedState!==null)&&(Hn=n)}function uf(n){se(Tt,Tt.current),se(Rn,n),Hn===null&&(Hn=n)}function dy(n){n.tag===22?(se(Tt,Tt.current),se(Rn,n),Hn===null&&(Hn=n)):ci()}function ci(){se(Tt,Tt.current),se(Rn,Rn.current)}function An(n){B(Rn),Hn===n&&(Hn=null),B(Tt)}var Tt=T(0);function Jl(n){for(var i=n;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||gh(l)||yh(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Ls=0,Ae=null,ut=null,Ut=null,Xl=!1,rr=!1,aa=!1,Wl=0,yo=0,or=null,H1=0;function Et(){throw Error(a(321))}function df(n,i){if(i===null)return!1;for(var l=0;l<i.length&&l<n.length;l++)if(!_n(n[l],i[l]))return!1;return!0}function ff(n,i,l,d,h,g){return Ls=g,Ae=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,K.H=n===null||n.memoizedState===null?Vy:zf,aa=!1,g=l(d,h),aa=!1,rr&&(g=hy(i,l,d,h)),fy(n),g}function fy(n){K.H=bo;var i=ut!==null&&ut.next!==null;if(Ls=0,Ut=ut=Ae=null,Xl=!1,yo=0,or=null,i)throw Error(a(300));n===null||It||(n=n.dependencies,n!==null&&Hl(n)&&(It=!0))}function hy(n,i,l,d){Ae=n;var h=0;do{if(rr&&(or=null),yo=0,rr=!1,25<=h)throw Error(a(301));if(h+=1,Ut=ut=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}K.H=Qy,g=i(l,d)}while(rr);return g}function K1(){var n=K.H,i=n.useState()[0];return i=typeof i.then=="function"?vo(i):i,n=n.useState()[0],(ut!==null?ut.memoizedState:null)!==n&&(Ae.flags|=1024),i}function hf(){var n=Wl!==0;return Wl=0,n}function mf(n,i,l){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~l}function pf(n){if(Xl){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Xl=!1}Ls=0,Ut=ut=Ae=null,rr=!1,yo=Wl=0,or=null}function un(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Ae.memoizedState=Ut=n:Ut=Ut.next=n,Ut}function Ot(){if(ut===null){var n=Ae.alternate;n=n!==null?n.memoizedState:null}else n=ut.next;var i=Ut===null?Ae.memoizedState:Ut.next;if(i!==null)Ut=i,ut=n;else{if(n===null)throw Ae.alternate===null?Error(a(467)):Error(a(310));ut=n,n={memoizedState:ut.memoizedState,baseState:ut.baseState,baseQueue:ut.baseQueue,queue:ut.queue,next:null},Ut===null?Ae.memoizedState=Ut=n:Ut=Ut.next=n}return Ut}function ec(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vo(n){var i=yo;return yo+=1,or===null&&(or=[]),n=sy(or,n,i),i=Ae,(Ut===null?i.memoizedState:Ut.next)===null&&(i=i.alternate,K.H=i===null||i.memoizedState===null?Vy:zf),n}function tc(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return vo(n);if(n.$$typeof===R)return Jt(n)}throw Error(a(438,String(n)))}function gf(n){var i=null,l=Ae.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var d=Ae.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(h){return h.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=ec(),Ae.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(n),d=0;d<n;d++)l[d]=X;return i.index++,l}function Ds(n,i){return typeof i=="function"?i(n):i}function nc(n){var i=Ot();return yf(i,ut,n)}function yf(n,i,l){var d=n.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=l;var h=n.baseQueue,g=d.pending;if(g!==null){if(h!==null){var j=h.next;h.next=g.next,g.next=j}i.baseQueue=h=g,d.pending=null}if(g=n.baseState,h===null)n.memoizedState=g;else{i=h.next;var _=j=null,D=null,F=i,W=!1;do{var ie=F.lane&-536870913;if(ie!==F.lane?(qe&ie)===ie:(Ls&ie)===ie){var Z=F.revertLane;if(Z===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),ie===tr&&(W=!0);else if((Ls&Z)===Z){F=F.next,Z===tr&&(W=!0);continue}else ie={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(_=D=ie,j=g):D=D.next=ie,Ae.lanes|=Z,fi|=Z;ie=F.action,aa&&l(g,ie),g=F.hasEagerState?F.eagerState:l(g,ie)}else Z={lane:ie,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(_=D=Z,j=g):D=D.next=Z,Ae.lanes|=ie,fi|=ie;F=F.next}while(F!==null&&F!==i);if(D===null?j=g:D.next=_,!_n(g,n.memoizedState)&&(It=!0,W&&(l=nr,l!==null)))throw l;n.memoizedState=g,n.baseState=j,n.baseQueue=D,d.lastRenderedState=g}return h===null&&(d.lanes=0),[n.memoizedState,d.dispatch]}function vf(n){var i=Ot(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=n;var d=l.dispatch,h=l.pending,g=i.memoizedState;if(h!==null){l.pending=null;var j=h=h.next;do g=n(g,j.action),j=j.next;while(j!==h);_n(g,i.memoizedState)||(It=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),l.lastRenderedState=g}return[g,d]}function my(n,i,l){var d=Ae,h=Ot(),g=Fe;if(g){if(l===void 0)throw Error(a(407));l=l()}else l=i();var j=!_n((ut||h).memoizedState,l);if(j&&(h.memoizedState=l,It=!0),h=h.queue,Sf(yy.bind(null,d,h,n),[n]),h.getSnapshot!==i||j||Ut!==null&&Ut.memoizedState.tag&1){if(d.flags|=2048,lr(9,{destroy:void 0},gy.bind(null,d,h,l,i),null),mt===null)throw Error(a(349));g||(Ls&127)!==0||py(d,i,l)}return l}function py(n,i,l){n.flags|=16384,n={getSnapshot:i,value:l},i=Ae.updateQueue,i===null?(i=ec(),Ae.updateQueue=i,i.stores=[n]):(l=i.stores,l===null?i.stores=[n]:l.push(n))}function gy(n,i,l,d){i.value=l,i.getSnapshot=d,vy(i)&&xy(n)}function yy(n,i,l){return l(function(){vy(i)&&xy(n)})}function vy(n){var i=n.getSnapshot;n=n.value;try{var l=i();return!_n(n,l)}catch{return!0}}function xy(n){var i=Yi(n,2);i!==null&&jn(i,n,2)}function xf(n){var i=un();if(typeof n=="function"){var l=n;if(n=l(),aa){gn(!0);try{l()}finally{gn(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:n},i}function by(n,i,l,d){return n.baseState=l,yf(n,ut,typeof d=="function"?d:Ds)}function G1(n,i,l,d,h){if(ac(n))throw Error(a(485));if(n=i.action,n!==null){var g={payload:h,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){g.listeners.push(j)}};K.T!==null?l(!0):g.isTransition=!1,d(g),l=i.pending,l===null?(g.next=i.pending=g,Sy(i,g)):(g.next=l.next,i.pending=l.next=g)}}function Sy(n,i){var l=i.action,d=i.payload,h=n.state;if(i.isTransition){var g=K.T,j={};K.T=j;try{var _=l(h,d),D=K.S;D!==null&&D(j,_),jy(n,i,_)}catch(F){bf(n,i,F)}finally{g!==null&&j.types!==null&&(g.types=j.types),K.T=g}}else try{g=l(h,d),jy(n,i,g)}catch(F){bf(n,i,F)}}function jy(n,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(d){wy(n,i,d)},function(d){return bf(n,i,d)}):wy(n,i,l)}function wy(n,i,l){i.status="fulfilled",i.value=l,Ny(i),n.state=l,i=n.pending,i!==null&&(l=i.next,l===i?n.pending=null:(l=l.next,i.next=l,Sy(n,l)))}function bf(n,i,l){var d=n.pending;if(n.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=l,Ny(i),i=i.next;while(i!==d)}n.action=null}function Ny(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function Cy(n,i){return i}function ky(n,i){if(Fe){var l=mt.formState;if(l!==null){e:{var d=Ae;if(Fe){if(yt){t:{for(var h=yt,g=qn;h.nodeType!==8;){if(!g){h=null;break t}if(h=Kn(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){yt=Kn(h.nextSibling),d=h.data==="F!";break e}}si(d)}d=!1}d&&(i=l[0])}}return l=un(),l.memoizedState=l.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cy,lastRenderedState:i},l.queue=d,l=Gy.bind(null,Ae,d),d.dispatch=l,d=xf(!1),g=kf.bind(null,Ae,!1,d.queue),d=un(),h={state:i,dispatch:null,action:n,pending:null},d.queue=h,l=G1.bind(null,Ae,h,g,l),h.dispatch=l,d.memoizedState=n,[i,l,!1]}function zy(n){var i=Ot();return _y(i,ut,n)}function _y(n,i,l){if(i=yf(n,i,Cy)[0],n=nc(Ds)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=vo(i)}catch(j){throw j===sr?Fl:j}else d=i;i=Ot();var h=i.queue,g=h.dispatch;return l!==i.memoizedState&&(Ae.flags|=2048,lr(9,{destroy:void 0},F1.bind(null,h,l),null)),[d,g,n]}function F1(n,i){n.action=i}function Ey(n){var i=Ot(),l=ut;if(l!==null)return _y(i,l,n);Ot(),i=i.memoizedState,l=Ot();var d=l.queue.dispatch;return l.memoizedState=n,[i,d,!1]}function lr(n,i,l,d){return n={tag:n,create:l,deps:d,inst:i,next:null},i=Ae.updateQueue,i===null&&(i=ec(),Ae.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=n.next=n:(d=l.next,l.next=n,n.next=d,i.lastEffect=n),n}function Ry(){return Ot().memoizedState}function sc(n,i,l,d){var h=un();Ae.flags|=n,h.memoizedState=lr(1|i,{destroy:void 0},l,d===void 0?null:d)}function ic(n,i,l,d){var h=Ot();d=d===void 0?null:d;var g=h.memoizedState.inst;ut!==null&&d!==null&&df(d,ut.memoizedState.deps)?h.memoizedState=lr(i,g,l,d):(Ae.flags|=n,h.memoizedState=lr(1|i,g,l,d))}function Ay(n,i){sc(8390656,8,n,i)}function Sf(n,i){ic(2048,8,n,i)}function Z1(n){Ae.flags|=4;var i=Ae.updateQueue;if(i===null)i=ec(),Ae.updateQueue=i,i.events=[n];else{var l=i.events;l===null?i.events=[n]:l.push(n)}}function Ty(n){var i=Ot().memoizedState;return Z1({ref:i,nextImpl:n}),function(){if((tt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Oy(n,i){return ic(4,2,n,i)}function Ly(n,i){return ic(4,4,n,i)}function Dy(n,i){if(typeof i=="function"){n=n();var l=i(n);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function My(n,i,l){l=l!=null?l.concat([n]):null,ic(4,4,Dy.bind(null,i,n),l)}function jf(){}function $y(n,i){var l=Ot();i=i===void 0?null:i;var d=l.memoizedState;return i!==null&&df(i,d[1])?d[0]:(l.memoizedState=[n,i],n)}function Py(n,i){var l=Ot();i=i===void 0?null:i;var d=l.memoizedState;if(i!==null&&df(i,d[1]))return d[0];if(d=n(),aa){gn(!0);try{n()}finally{gn(!1)}}return l.memoizedState=[d,i],d}function wf(n,i,l){return l===void 0||(Ls&1073741824)!==0&&(qe&261930)===0?n.memoizedState=i:(n.memoizedState=l,n=U0(),Ae.lanes|=n,fi|=n,l)}function Uy(n,i,l,d){return _n(l,i)?l:ar.current!==null?(n=wf(n,l,d),_n(n,i)||(It=!0),n):(Ls&42)===0||(Ls&1073741824)!==0&&(qe&261930)===0?(It=!0,n.memoizedState=l):(n=U0(),Ae.lanes|=n,fi|=n,i)}function Iy(n,i,l,d,h){var g=ae.p;ae.p=g!==0&&8>g?g:8;var j=K.T,_={};K.T=_,kf(n,!1,i,l);try{var D=h(),F=K.S;if(F!==null&&F(_,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var W=q1(D,d);xo(n,i,W,Ln(n))}else xo(n,i,d,Ln(n))}catch(ie){xo(n,i,{then:function(){},status:"rejected",reason:ie},Ln())}finally{ae.p=g,j!==null&&_.types!==null&&(j.types=_.types),K.T=j}}function V1(){}function Nf(n,i,l,d){if(n.tag!==5)throw Error(a(476));var h=By(n).queue;Iy(n,h,i,me,l===null?V1:function(){return qy(n),l(d)})}function By(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:me,baseState:me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:me},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:l},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function qy(n){var i=By(n);i.next===null&&(i=n.alternate.memoizedState),xo(n,i.next.queue,{},Ln())}function Cf(){return Jt(Mo)}function Hy(){return Ot().memoizedState}function Ky(){return Ot().memoizedState}function Q1(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var l=Ln();n=ri(l);var d=oi(i,n,l);d!==null&&(jn(d,i,l),mo(d,i,l)),i={cache:Wd()},n.payload=i;return}i=i.return}}function Y1(n,i,l){var d=Ln();l={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ac(n)?Fy(i,l):(l=qd(n,i,l,d),l!==null&&(jn(l,n,d),Zy(l,i,d)))}function Gy(n,i,l){var d=Ln();xo(n,i,l,d)}function xo(n,i,l,d){var h={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ac(n))Fy(i,h);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var j=i.lastRenderedState,_=g(j,l);if(h.hasEagerState=!0,h.eagerState=_,_n(_,j))return Ul(n,i,h,0),mt===null&&Pl(),!1}catch{}if(l=qd(n,i,h,d),l!==null)return jn(l,n,d),Zy(l,i,d),!0}return!1}function kf(n,i,l,d){if(d={lane:2,revertLane:ih(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},ac(n)){if(i)throw Error(a(479))}else i=qd(n,l,d,2),i!==null&&jn(i,n,2)}function ac(n){var i=n.alternate;return n===Ae||i!==null&&i===Ae}function Fy(n,i){rr=Xl=!0;var l=n.pending;l===null?i.next=i:(i.next=l.next,l.next=i),n.pending=i}function Zy(n,i,l){if((l&4194048)!==0){var d=i.lanes;d&=n.pendingLanes,l|=d,i.lanes=l,he(n,l)}}var bo={readContext:Jt,use:tc,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};bo.useEffectEvent=Et;var Vy={readContext:Jt,use:tc,useCallback:function(n,i){return un().memoizedState=[n,i===void 0?null:i],n},useContext:Jt,useEffect:Ay,useImperativeHandle:function(n,i,l){l=l!=null?l.concat([n]):null,sc(4194308,4,Dy.bind(null,i,n),l)},useLayoutEffect:function(n,i){return sc(4194308,4,n,i)},useInsertionEffect:function(n,i){sc(4,2,n,i)},useMemo:function(n,i){var l=un();i=i===void 0?null:i;var d=n();if(aa){gn(!0);try{n()}finally{gn(!1)}}return l.memoizedState=[d,i],d},useReducer:function(n,i,l){var d=un();if(l!==void 0){var h=l(i);if(aa){gn(!0);try{l(i)}finally{gn(!1)}}}else h=i;return d.memoizedState=d.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},d.queue=n,n=n.dispatch=Y1.bind(null,Ae,n),[d.memoizedState,n]},useRef:function(n){var i=un();return n={current:n},i.memoizedState=n},useState:function(n){n=xf(n);var i=n.queue,l=Gy.bind(null,Ae,i);return i.dispatch=l,[n.memoizedState,l]},useDebugValue:jf,useDeferredValue:function(n,i){var l=un();return wf(l,n,i)},useTransition:function(){var n=xf(!1);return n=Iy.bind(null,Ae,n.queue,!0,!1),un().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,l){var d=Ae,h=un();if(Fe){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),mt===null)throw Error(a(349));(qe&127)!==0||py(d,i,l)}h.memoizedState=l;var g={value:l,getSnapshot:i};return h.queue=g,Ay(yy.bind(null,d,g,n),[n]),d.flags|=2048,lr(9,{destroy:void 0},gy.bind(null,d,g,l,i),null),l},useId:function(){var n=un(),i=mt.identifierPrefix;if(Fe){var l=vs,d=ys;l=(d&~(1<<32-ce(d)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Wl++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=H1++,i="_"+i+"r_"+l.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:Cf,useFormState:ky,useActionState:ky,useOptimistic:function(n){var i=un();i.memoizedState=i.baseState=n;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=kf.bind(null,Ae,!0,l),l.dispatch=i,[n,i]},useMemoCache:gf,useCacheRefresh:function(){return un().memoizedState=Q1.bind(null,Ae)},useEffectEvent:function(n){var i=un(),l={impl:n};return i.memoizedState=l,function(){if((tt&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},zf={readContext:Jt,use:tc,useCallback:$y,useContext:Jt,useEffect:Sf,useImperativeHandle:My,useInsertionEffect:Oy,useLayoutEffect:Ly,useMemo:Py,useReducer:nc,useRef:Ry,useState:function(){return nc(Ds)},useDebugValue:jf,useDeferredValue:function(n,i){var l=Ot();return Uy(l,ut.memoizedState,n,i)},useTransition:function(){var n=nc(Ds)[0],i=Ot().memoizedState;return[typeof n=="boolean"?n:vo(n),i]},useSyncExternalStore:my,useId:Hy,useHostTransitionStatus:Cf,useFormState:zy,useActionState:zy,useOptimistic:function(n,i){var l=Ot();return by(l,ut,n,i)},useMemoCache:gf,useCacheRefresh:Ky};zf.useEffectEvent=Ty;var Qy={readContext:Jt,use:tc,useCallback:$y,useContext:Jt,useEffect:Sf,useImperativeHandle:My,useInsertionEffect:Oy,useLayoutEffect:Ly,useMemo:Py,useReducer:vf,useRef:Ry,useState:function(){return vf(Ds)},useDebugValue:jf,useDeferredValue:function(n,i){var l=Ot();return ut===null?wf(l,n,i):Uy(l,ut.memoizedState,n,i)},useTransition:function(){var n=vf(Ds)[0],i=Ot().memoizedState;return[typeof n=="boolean"?n:vo(n),i]},useSyncExternalStore:my,useId:Hy,useHostTransitionStatus:Cf,useFormState:Ey,useActionState:Ey,useOptimistic:function(n,i){var l=Ot();return ut!==null?by(l,ut,n,i):(l.baseState=n,[n,l.queue.dispatch])},useMemoCache:gf,useCacheRefresh:Ky};Qy.useEffectEvent=Ty;function _f(n,i,l,d){i=n.memoizedState,l=l(d,i),l=l==null?i:y({},i,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var Ef={enqueueSetState:function(n,i,l){n=n._reactInternals;var d=Ln(),h=ri(d);h.payload=i,l!=null&&(h.callback=l),i=oi(n,h,d),i!==null&&(jn(i,n,d),mo(i,n,d))},enqueueReplaceState:function(n,i,l){n=n._reactInternals;var d=Ln(),h=ri(d);h.tag=1,h.payload=i,l!=null&&(h.callback=l),i=oi(n,h,d),i!==null&&(jn(i,n,d),mo(i,n,d))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var l=Ln(),d=ri(l);d.tag=2,i!=null&&(d.callback=i),i=oi(n,d,l),i!==null&&(jn(i,n,l),mo(i,n,l))}};function Yy(n,i,l,d,h,g,j){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,g,j):i.prototype&&i.prototype.isPureReactComponent?!ao(l,d)||!ao(h,g):!0}function Jy(n,i,l,d){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,d),i.state!==n&&Ef.enqueueReplaceState(i,i.state,null)}function ra(n,i){var l=i;if("ref"in i){l={};for(var d in i)d!=="ref"&&(l[d]=i[d])}if(n=n.defaultProps){l===i&&(l=y({},l));for(var h in n)l[h]===void 0&&(l[h]=n[h])}return l}function Xy(n){$l(n)}function Wy(n){console.error(n)}function e0(n){$l(n)}function rc(n,i){try{var l=n.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function t0(n,i,l){try{var d=n.onCaughtError;d(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Rf(n,i,l){return l=ri(l),l.tag=3,l.payload={element:null},l.callback=function(){rc(n,i)},l}function n0(n){return n=ri(n),n.tag=3,n}function s0(n,i,l,d){var h=l.type.getDerivedStateFromError;if(typeof h=="function"){var g=d.value;n.payload=function(){return h(g)},n.callback=function(){t0(i,l,d)}}var j=l.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(n.callback=function(){t0(i,l,d),typeof h!="function"&&(hi===null?hi=new Set([this]):hi.add(this));var _=d.stack;this.componentDidCatch(d.value,{componentStack:_!==null?_:""})})}function J1(n,i,l,d,h){if(l.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=l.alternate,i!==null&&er(i,l,h,!0),l=Rn.current,l!==null){switch(l.tag){case 31:case 13:return Hn===null?vc():l.alternate===null&&Rt===0&&(Rt=3),l.flags&=-257,l.flags|=65536,l.lanes=h,d===Zl?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([d]):i.add(d),th(n,d,h)),!1;case 22:return l.flags|=65536,d===Zl?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([d]):l.add(d)),th(n,d,h)),!1}throw Error(a(435,l.tag))}return th(n,d,h),vc(),!1}if(Fe)return i=Rn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,d!==Vd&&(n=Error(a(422),{cause:d}),lo(Un(n,l)))):(d!==Vd&&(i=Error(a(423),{cause:d}),lo(Un(i,l))),n=n.current.alternate,n.flags|=65536,h&=-h,n.lanes|=h,d=Un(d,l),h=Rf(n.stateNode,d,h),rf(n,h),Rt!==4&&(Rt=2)),!1;var g=Error(a(520),{cause:d});if(g=Un(g,l),_o===null?_o=[g]:_o.push(g),Rt!==4&&(Rt=2),i===null)return!0;d=Un(d,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,n=h&-h,l.lanes|=n,n=Rf(l.stateNode,d,n),rf(l,n),!1;case 1:if(i=l.type,g=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(hi===null||!hi.has(g))))return l.flags|=65536,h&=-h,l.lanes|=h,h=n0(h),s0(h,n,l,d),rf(l,h),!1}l=l.return}while(l!==null);return!1}var Af=Error(a(461)),It=!1;function Xt(n,i,l,d){i.child=n===null?oy(i,null,l,d):ia(i,n.child,l,d)}function i0(n,i,l,d,h){l=l.render;var g=i.ref;if("ref"in d){var j={};for(var _ in d)_!=="ref"&&(j[_]=d[_])}else j=d;return ea(i),d=ff(n,i,l,j,g,h),_=hf(),n!==null&&!It?(mf(n,i,h),Ms(n,i,h)):(Fe&&_&&Fd(i),i.flags|=1,Xt(n,i,d,h),i.child)}function a0(n,i,l,d,h){if(n===null){var g=l.type;return typeof g=="function"&&!Hd(g)&&g.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=g,r0(n,i,g,d,h)):(n=Bl(l.type,null,d,i,i.mode,h),n.ref=i.ref,n.return=i,i.child=n)}if(g=n.child,!Uf(n,h)){var j=g.memoizedProps;if(l=l.compare,l=l!==null?l:ao,l(j,d)&&n.ref===i.ref)return Ms(n,i,h)}return i.flags|=1,n=Rs(g,d),n.ref=i.ref,n.return=i,i.child=n}function r0(n,i,l,d,h){if(n!==null){var g=n.memoizedProps;if(ao(g,d)&&n.ref===i.ref)if(It=!1,i.pendingProps=d=g,Uf(n,h))(n.flags&131072)!==0&&(It=!0);else return i.lanes=n.lanes,Ms(n,i,h)}return Tf(n,i,l,d,h)}function o0(n,i,l,d){var h=d.children,g=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(g=g!==null?g.baseLanes|l:l,n!==null){for(d=i.child=n.child,h=0;d!==null;)h=h|d.lanes|d.childLanes,d=d.sibling;d=h&~g}else d=0,i.child=null;return l0(n,i,g,l,d)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Gl(i,g!==null?g.cachePool:null),g!==null?uy(i,g):lf(),dy(i);else return d=i.lanes=536870912,l0(n,i,g!==null?g.baseLanes|l:l,l,d)}else g!==null?(Gl(i,g.cachePool),uy(i,g),ci(),i.memoizedState=null):(n!==null&&Gl(i,null),lf(),ci());return Xt(n,i,h,l),i.child}function So(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function l0(n,i,l,d,h){var g=tf();return g=g===null?null:{parent:Pt._currentValue,pool:g},i.memoizedState={baseLanes:l,cachePool:g},n!==null&&Gl(i,null),lf(),dy(i),n!==null&&er(n,i,d,!0),i.childLanes=h,null}function oc(n,i){return i=cc({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function c0(n,i,l){return ia(i,n.child,null,l),n=oc(i,i.pendingProps),n.flags|=2,An(i),i.memoizedState=null,n}function X1(n,i,l){var d=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Fe){if(d.mode==="hidden")return n=oc(i,d),i.lanes=536870912,So(null,n);if(uf(i),(n=yt)?(n=Sv(n,qn),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ti!==null?{id:ys,overflow:vs}:null,retryLane:536870912,hydrationErrors:null},l=Fg(n),l.return=i,i.child=l,Yt=i,yt=null)):n=null,n===null)throw si(i);return i.lanes=536870912,null}return oc(i,d)}var g=n.memoizedState;if(g!==null){var j=g.dehydrated;if(uf(i),h)if(i.flags&256)i.flags&=-257,i=c0(n,i,l);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if(It||er(n,i,l,!1),h=(l&n.childLanes)!==0,It||h){if(d=mt,d!==null&&(j=xt(d,l),j!==0&&j!==g.retryLane))throw g.retryLane=j,Yi(n,j),jn(d,n,j),Af;vc(),i=c0(n,i,l)}else n=g.treeContext,yt=Kn(j.nextSibling),Yt=i,Fe=!0,ni=null,qn=!1,n!==null&&Qg(i,n),i=oc(i,d),i.flags|=4096;return i}return n=Rs(n.child,{mode:d.mode,children:d.children}),n.ref=i.ref,i.child=n,n.return=i,n}function lc(n,i){var l=i.ref;if(l===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(n===null||n.ref!==l)&&(i.flags|=4194816)}}function Tf(n,i,l,d,h){return ea(i),l=ff(n,i,l,d,void 0,h),d=hf(),n!==null&&!It?(mf(n,i,h),Ms(n,i,h)):(Fe&&d&&Fd(i),i.flags|=1,Xt(n,i,l,h),i.child)}function u0(n,i,l,d,h,g){return ea(i),i.updateQueue=null,l=hy(i,d,l,h),fy(n),d=hf(),n!==null&&!It?(mf(n,i,g),Ms(n,i,g)):(Fe&&d&&Fd(i),i.flags|=1,Xt(n,i,l,g),i.child)}function d0(n,i,l,d,h){if(ea(i),i.stateNode===null){var g=Ya,j=l.contextType;typeof j=="object"&&j!==null&&(g=Jt(j)),g=new l(d,g),i.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Ef,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=d,g.state=i.memoizedState,g.refs={},sf(i),j=l.contextType,g.context=typeof j=="object"&&j!==null?Jt(j):Ya,g.state=i.memoizedState,j=l.getDerivedStateFromProps,typeof j=="function"&&(_f(i,l,j,d),g.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(j=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),j!==g.state&&Ef.enqueueReplaceState(g,g.state,null),go(i,d,g,h),po(),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(n===null){g=i.stateNode;var _=i.memoizedProps,D=ra(l,_);g.props=D;var F=g.context,W=l.contextType;j=Ya,typeof W=="object"&&W!==null&&(j=Jt(W));var ie=l.getDerivedStateFromProps;W=typeof ie=="function"||typeof g.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,W||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(_||F!==j)&&Jy(i,g,d,j),ai=!1;var Z=i.memoizedState;g.state=Z,go(i,d,g,h),po(),F=i.memoizedState,_||Z!==F||ai?(typeof ie=="function"&&(_f(i,l,ie,d),F=i.memoizedState),(D=ai||Yy(i,l,D,d,Z,F,j))?(W||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(i.flags|=4194308)):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=F),g.props=d,g.state=F,g.context=j,d=D):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{g=i.stateNode,af(n,i),j=i.memoizedProps,W=ra(l,j),g.props=W,ie=i.pendingProps,Z=g.context,F=l.contextType,D=Ya,typeof F=="object"&&F!==null&&(D=Jt(F)),_=l.getDerivedStateFromProps,(F=typeof _=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(j!==ie||Z!==D)&&Jy(i,g,d,D),ai=!1,Z=i.memoizedState,g.state=Z,go(i,d,g,h),po();var Y=i.memoizedState;j!==ie||Z!==Y||ai||n!==null&&n.dependencies!==null&&Hl(n.dependencies)?(typeof _=="function"&&(_f(i,l,_,d),Y=i.memoizedState),(W=ai||Yy(i,l,W,d,Z,Y,D)||n!==null&&n.dependencies!==null&&Hl(n.dependencies))?(F||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(d,Y,D),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(d,Y,D)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&Z===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&Z===n.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=Y),g.props=d,g.state=Y,g.context=D,d=W):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&Z===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&Z===n.memoizedState||(i.flags|=1024),d=!1)}return g=d,lc(n,i),d=(i.flags&128)!==0,g||d?(g=i.stateNode,l=d&&typeof l.getDerivedStateFromError!="function"?null:g.render(),i.flags|=1,n!==null&&d?(i.child=ia(i,n.child,null,h),i.child=ia(i,null,l,h)):Xt(n,i,l,h),i.memoizedState=g.state,n=i.child):n=Ms(n,i,h),n}function f0(n,i,l,d){return Xi(),i.flags|=256,Xt(n,i,l,d),i.child}var Of={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Lf(n){return{baseLanes:n,cachePool:ty()}}function Df(n,i,l){return n=n!==null?n.childLanes&~l:0,i&&(n|=On),n}function h0(n,i,l){var d=i.pendingProps,h=!1,g=(i.flags&128)!==0,j;if((j=g)||(j=n!==null&&n.memoizedState===null?!1:(Tt.current&2)!==0),j&&(h=!0,i.flags&=-129),j=(i.flags&32)!==0,i.flags&=-33,n===null){if(Fe){if(h?li(i):ci(),(n=yt)?(n=Sv(n,qn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ti!==null?{id:ys,overflow:vs}:null,retryLane:536870912,hydrationErrors:null},l=Fg(n),l.return=i,i.child=l,Yt=i,yt=null)):n=null,n===null)throw si(i);return yh(n)?i.lanes=32:i.lanes=536870912,null}var _=d.children;return d=d.fallback,h?(ci(),h=i.mode,_=cc({mode:"hidden",children:_},h),d=Ji(d,h,l,null),_.return=i,d.return=i,_.sibling=d,i.child=_,d=i.child,d.memoizedState=Lf(l),d.childLanes=Df(n,j,l),i.memoizedState=Of,So(null,d)):(li(i),Mf(i,_))}var D=n.memoizedState;if(D!==null&&(_=D.dehydrated,_!==null)){if(g)i.flags&256?(li(i),i.flags&=-257,i=$f(n,i,l)):i.memoizedState!==null?(ci(),i.child=n.child,i.flags|=128,i=null):(ci(),_=d.fallback,h=i.mode,d=cc({mode:"visible",children:d.children},h),_=Ji(_,h,l,null),_.flags|=2,d.return=i,_.return=i,d.sibling=_,i.child=d,ia(i,n.child,null,l),d=i.child,d.memoizedState=Lf(l),d.childLanes=Df(n,j,l),i.memoizedState=Of,i=So(null,d));else if(li(i),yh(_)){if(j=_.nextSibling&&_.nextSibling.dataset,j)var F=j.dgst;j=F,d=Error(a(419)),d.stack="",d.digest=j,lo({value:d,source:null,stack:null}),i=$f(n,i,l)}else if(It||er(n,i,l,!1),j=(l&n.childLanes)!==0,It||j){if(j=mt,j!==null&&(d=xt(j,l),d!==0&&d!==D.retryLane))throw D.retryLane=d,Yi(n,d),jn(j,n,d),Af;gh(_)||vc(),i=$f(n,i,l)}else gh(_)?(i.flags|=192,i.child=n.child,i=null):(n=D.treeContext,yt=Kn(_.nextSibling),Yt=i,Fe=!0,ni=null,qn=!1,n!==null&&Qg(i,n),i=Mf(i,d.children),i.flags|=4096);return i}return h?(ci(),_=d.fallback,h=i.mode,D=n.child,F=D.sibling,d=Rs(D,{mode:"hidden",children:d.children}),d.subtreeFlags=D.subtreeFlags&65011712,F!==null?_=Rs(F,_):(_=Ji(_,h,l,null),_.flags|=2),_.return=i,d.return=i,d.sibling=_,i.child=d,So(null,d),d=i.child,_=n.child.memoizedState,_===null?_=Lf(l):(h=_.cachePool,h!==null?(D=Pt._currentValue,h=h.parent!==D?{parent:D,pool:D}:h):h=ty(),_={baseLanes:_.baseLanes|l,cachePool:h}),d.memoizedState=_,d.childLanes=Df(n,j,l),i.memoizedState=Of,So(n.child,d)):(li(i),l=n.child,n=l.sibling,l=Rs(l,{mode:"visible",children:d.children}),l.return=i,l.sibling=null,n!==null&&(j=i.deletions,j===null?(i.deletions=[n],i.flags|=16):j.push(n)),i.child=l,i.memoizedState=null,l)}function Mf(n,i){return i=cc({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function cc(n,i){return n=En(22,n,null,i),n.lanes=0,n}function $f(n,i,l){return ia(i,n.child,null,l),n=Mf(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function m0(n,i,l){n.lanes|=i;var d=n.alternate;d!==null&&(d.lanes|=i),Jd(n.return,i,l)}function Pf(n,i,l,d,h,g){var j=n.memoizedState;j===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:h,treeForkCount:g}:(j.isBackwards=i,j.rendering=null,j.renderingStartTime=0,j.last=d,j.tail=l,j.tailMode=h,j.treeForkCount=g)}function p0(n,i,l){var d=i.pendingProps,h=d.revealOrder,g=d.tail;d=d.children;var j=Tt.current,_=(j&2)!==0;if(_?(j=j&1|2,i.flags|=128):j&=1,se(Tt,j),Xt(n,i,d,l),d=Fe?oo:0,!_&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&m0(n,l,i);else if(n.tag===19)m0(n,l,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(h){case"forwards":for(l=i.child,h=null;l!==null;)n=l.alternate,n!==null&&Jl(n)===null&&(h=l),l=l.sibling;l=h,l===null?(h=i.child,i.child=null):(h=l.sibling,l.sibling=null),Pf(i,!1,h,l,g,d);break;case"backwards":case"unstable_legacy-backwards":for(l=null,h=i.child,i.child=null;h!==null;){if(n=h.alternate,n!==null&&Jl(n)===null){i.child=h;break}n=h.sibling,h.sibling=l,l=h,h=n}Pf(i,!0,l,null,g,d);break;case"together":Pf(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function Ms(n,i,l){if(n!==null&&(i.dependencies=n.dependencies),fi|=i.lanes,(l&i.childLanes)===0)if(n!==null){if(er(n,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(a(153));if(i.child!==null){for(n=i.child,l=Rs(n,n.pendingProps),i.child=l,l.return=i;n.sibling!==null;)n=n.sibling,l=l.sibling=Rs(n,n.pendingProps),l.return=i;l.sibling=null}return i.child}function Uf(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Hl(n)))}function W1(n,i,l){switch(i.tag){case 3:_e(i,i.stateNode.containerInfo),ii(i,Pt,n.memoizedState.cache),Xi();break;case 27:case 5:Ze(i);break;case 4:_e(i,i.stateNode.containerInfo);break;case 10:ii(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,uf(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(li(i),i.flags|=128,null):(l&i.child.childLanes)!==0?h0(n,i,l):(li(i),n=Ms(n,i,l),n!==null?n.sibling:null);li(i);break;case 19:var h=(n.flags&128)!==0;if(d=(l&i.childLanes)!==0,d||(er(n,i,l,!1),d=(l&i.childLanes)!==0),h){if(d)return p0(n,i,l);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),se(Tt,Tt.current),d)break;return null;case 22:return i.lanes=0,o0(n,i,l,i.pendingProps);case 24:ii(i,Pt,n.memoizedState.cache)}return Ms(n,i,l)}function g0(n,i,l){if(n!==null)if(n.memoizedProps!==i.pendingProps)It=!0;else{if(!Uf(n,l)&&(i.flags&128)===0)return It=!1,W1(n,i,l);It=(n.flags&131072)!==0}else It=!1,Fe&&(i.flags&1048576)!==0&&Vg(i,oo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(n=na(i.elementType),i.type=n,typeof n=="function")Hd(n)?(d=ra(n,d),i.tag=1,i=d0(null,i,n,d,l)):(i.tag=0,i=Tf(null,i,n,d,l));else{if(n!=null){var h=n.$$typeof;if(h===z){i.tag=11,i=i0(null,i,n,d,l);break e}else if(h===E){i.tag=14,i=a0(null,i,n,d,l);break e}}throw i=ze(n)||n,Error(a(306,i,""))}}return i;case 0:return Tf(n,i,i.type,i.pendingProps,l);case 1:return d=i.type,h=ra(d,i.pendingProps),d0(n,i,d,h,l);case 3:e:{if(_e(i,i.stateNode.containerInfo),n===null)throw Error(a(387));d=i.pendingProps;var g=i.memoizedState;h=g.element,af(n,i),go(i,d,null,l);var j=i.memoizedState;if(d=j.cache,ii(i,Pt,d),d!==g.cache&&Xd(i,[Pt],l,!0),po(),d=j.element,g.isDehydrated)if(g={element:d,isDehydrated:!1,cache:j.cache},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){i=f0(n,i,d,l);break e}else if(d!==h){h=Un(Error(a(424)),i),lo(h),i=f0(n,i,d,l);break e}else for(n=i.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,yt=Kn(n.firstChild),Yt=i,Fe=!0,ni=null,qn=!0,l=oy(i,null,d,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Xi(),d===h){i=Ms(n,i,l);break e}Xt(n,i,d,l)}i=i.child}return i;case 26:return lc(n,i),n===null?(l=zv(i.type,null,i.pendingProps,null))?i.memoizedState=l:Fe||(l=i.type,n=i.pendingProps,d=Cc(fe.current).createElement(l),d[st]=i,d[sn]=n,Wt(d,l,n),it(d),i.stateNode=d):i.memoizedState=zv(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Ze(i),n===null&&Fe&&(d=i.stateNode=Nv(i.type,i.pendingProps,fe.current),Yt=i,qn=!0,h=yt,yi(i.type)?(vh=h,yt=Kn(d.firstChild)):yt=h),Xt(n,i,i.pendingProps.children,l),lc(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Fe&&((h=d=yt)&&(d=EC(d,i.type,i.pendingProps,qn),d!==null?(i.stateNode=d,Yt=i,yt=Kn(d.firstChild),qn=!1,h=!0):h=!1),h||si(i)),Ze(i),h=i.type,g=i.pendingProps,j=n!==null?n.memoizedProps:null,d=g.children,hh(h,g)?d=null:j!==null&&hh(h,j)&&(i.flags|=32),i.memoizedState!==null&&(h=ff(n,i,K1,null,null,l),Mo._currentValue=h),lc(n,i),Xt(n,i,d,l),i.child;case 6:return n===null&&Fe&&((n=l=yt)&&(l=RC(l,i.pendingProps,qn),l!==null?(i.stateNode=l,Yt=i,yt=null,n=!0):n=!1),n||si(i)),null;case 13:return h0(n,i,l);case 4:return _e(i,i.stateNode.containerInfo),d=i.pendingProps,n===null?i.child=ia(i,null,d,l):Xt(n,i,d,l),i.child;case 11:return i0(n,i,i.type,i.pendingProps,l);case 7:return Xt(n,i,i.pendingProps,l),i.child;case 8:return Xt(n,i,i.pendingProps.children,l),i.child;case 12:return Xt(n,i,i.pendingProps.children,l),i.child;case 10:return d=i.pendingProps,ii(i,i.type,d.value),Xt(n,i,d.children,l),i.child;case 9:return h=i.type._context,d=i.pendingProps.children,ea(i),h=Jt(h),d=d(h),i.flags|=1,Xt(n,i,d,l),i.child;case 14:return a0(n,i,i.type,i.pendingProps,l);case 15:return r0(n,i,i.type,i.pendingProps,l);case 19:return p0(n,i,l);case 31:return X1(n,i,l);case 22:return o0(n,i,l,i.pendingProps);case 24:return ea(i),d=Jt(Pt),n===null?(h=tf(),h===null&&(h=mt,g=Wd(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=l),h=g),i.memoizedState={parent:d,cache:h},sf(i),ii(i,Pt,h)):((n.lanes&l)!==0&&(af(n,i),go(i,null,null,l),po()),h=n.memoizedState,g=i.memoizedState,h.parent!==d?(h={parent:d,cache:d},i.memoizedState=h,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=h),ii(i,Pt,d)):(d=g.cache,ii(i,Pt,d),d!==h.cache&&Xd(i,[Pt],l,!0))),Xt(n,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function $s(n){n.flags|=4}function If(n,i,l,d,h){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(h&335544128)===h)if(n.stateNode.complete)n.flags|=8192;else if(H0())n.flags|=8192;else throw sa=Zl,nf}else n.flags&=-16777217}function y0(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Tv(i))if(H0())n.flags|=8192;else throw sa=Zl,nf}function uc(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?wl():536870912,n.lanes|=i,fr|=i)}function jo(n,i){if(!Fe)switch(n.tailMode){case"hidden":i=n.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null}}function vt(n){var i=n.alternate!==null&&n.alternate.child===n.child,l=0,d=0;if(i)for(var h=n.child;h!==null;)l|=h.lanes|h.childLanes,d|=h.subtreeFlags&65011712,d|=h.flags&65011712,h.return=n,h=h.sibling;else for(h=n.child;h!==null;)l|=h.lanes|h.childLanes,d|=h.subtreeFlags,d|=h.flags,h.return=n,h=h.sibling;return n.subtreeFlags|=d,n.childLanes=l,i}function eC(n,i,l){var d=i.pendingProps;switch(Zd(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vt(i),null;case 1:return vt(i),null;case 3:return l=i.stateNode,d=null,n!==null&&(d=n.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),Os(Pt),ge(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(n===null||n.child===null)&&(Wa(i)?$s(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Qd())),vt(i),null;case 26:var h=i.type,g=i.memoizedState;return n===null?($s(i),g!==null?(vt(i),y0(i,g)):(vt(i),If(i,h,null,d,l))):g?g!==n.memoizedState?($s(i),vt(i),y0(i,g)):(vt(i),i.flags&=-16777217):(n=n.memoizedProps,n!==d&&$s(i),vt(i),If(i,h,n,d,l)),null;case 27:if(et(i),l=fe.current,h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==d&&$s(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return vt(i),null}n=le.current,Wa(i)?Yg(i):(n=Nv(h,d,l),i.stateNode=n,$s(i))}return vt(i),null;case 5:if(et(i),h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==d&&$s(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return vt(i),null}if(g=le.current,Wa(i))Yg(i);else{var j=Cc(fe.current);switch(g){case 1:g=j.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:g=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":g=j.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":g=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":g=j.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof d.is=="string"?j.createElement("select",{is:d.is}):j.createElement("select"),d.multiple?g.multiple=!0:d.size&&(g.size=d.size);break;default:g=typeof d.is=="string"?j.createElement(h,{is:d.is}):j.createElement(h)}}g[st]=i,g[sn]=d;e:for(j=i.child;j!==null;){if(j.tag===5||j.tag===6)g.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===i)break e;for(;j.sibling===null;){if(j.return===null||j.return===i)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}i.stateNode=g;e:switch(Wt(g,h,d),h){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&$s(i)}}return vt(i),If(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,l),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==d&&$s(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(n=fe.current,Wa(i)){if(n=i.stateNode,l=i.memoizedProps,d=null,h=Yt,h!==null)switch(h.tag){case 27:case 5:d=h.memoizedProps}n[st]=i,n=!!(n.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||hv(n.nodeValue,l)),n||si(i,!0)}else n=Cc(n).createTextNode(d),n[st]=i,i.stateNode=n}return vt(i),null;case 31:if(l=i.memoizedState,n===null||n.memoizedState!==null){if(d=Wa(i),l!==null){if(n===null){if(!d)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[st]=i}else Xi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;vt(i),n=!1}else l=Qd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=l),n=!0;if(!n)return i.flags&256?(An(i),i):(An(i),null);if((i.flags&128)!==0)throw Error(a(558))}return vt(i),null;case 13:if(d=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=Wa(i),d!==null&&d.dehydrated!==null){if(n===null){if(!h)throw Error(a(318));if(h=i.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[st]=i}else Xi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;vt(i),h=!1}else h=Qd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return i.flags&256?(An(i),i):(An(i),null)}return An(i),(i.flags&128)!==0?(i.lanes=l,i):(l=d!==null,n=n!==null&&n.memoizedState!==null,l&&(d=i.child,h=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(h=d.alternate.memoizedState.cachePool.pool),g=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(g=d.memoizedState.cachePool.pool),g!==h&&(d.flags|=2048)),l!==n&&l&&(i.child.flags|=8192),uc(i,i.updateQueue),vt(i),null);case 4:return ge(),n===null&&lh(i.stateNode.containerInfo),vt(i),null;case 10:return Os(i.type),vt(i),null;case 19:if(B(Tt),d=i.memoizedState,d===null)return vt(i),null;if(h=(i.flags&128)!==0,g=d.rendering,g===null)if(h)jo(d,!1);else{if(Rt!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(g=Jl(n),g!==null){for(i.flags|=128,jo(d,!1),n=g.updateQueue,i.updateQueue=n,uc(i,n),i.subtreeFlags=0,n=l,l=i.child;l!==null;)Gg(l,n),l=l.sibling;return se(Tt,Tt.current&1|2),Fe&&As(i,d.treeForkCount),i.child}n=n.sibling}d.tail!==null&&Qe()>pc&&(i.flags|=128,h=!0,jo(d,!1),i.lanes=4194304)}else{if(!h)if(n=Jl(g),n!==null){if(i.flags|=128,h=!0,n=n.updateQueue,i.updateQueue=n,uc(i,n),jo(d,!0),d.tail===null&&d.tailMode==="hidden"&&!g.alternate&&!Fe)return vt(i),null}else 2*Qe()-d.renderingStartTime>pc&&l!==536870912&&(i.flags|=128,h=!0,jo(d,!1),i.lanes=4194304);d.isBackwards?(g.sibling=i.child,i.child=g):(n=d.last,n!==null?n.sibling=g:i.child=g,d.last=g)}return d.tail!==null?(n=d.tail,d.rendering=n,d.tail=n.sibling,d.renderingStartTime=Qe(),n.sibling=null,l=Tt.current,se(Tt,h?l&1|2:l&1),Fe&&As(i,d.treeForkCount),n):(vt(i),null);case 22:case 23:return An(i),cf(),d=i.memoizedState!==null,n!==null?n.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(l&536870912)!==0&&(i.flags&128)===0&&(vt(i),i.subtreeFlags&6&&(i.flags|=8192)):vt(i),l=i.updateQueue,l!==null&&uc(i,l.retryQueue),l=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==l&&(i.flags|=2048),n!==null&&B(ta),null;case 24:return l=null,n!==null&&(l=n.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Os(Pt),vt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function tC(n,i){switch(Zd(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Os(Pt),ge(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return et(i),null;case 31:if(i.memoizedState!==null){if(An(i),i.alternate===null)throw Error(a(340));Xi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(An(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Xi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return B(Tt),null;case 4:return ge(),null;case 10:return Os(i.type),null;case 22:case 23:return An(i),cf(),n!==null&&B(ta),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return Os(Pt),null;case 25:return null;default:return null}}function v0(n,i){switch(Zd(i),i.tag){case 3:Os(Pt),ge();break;case 26:case 27:case 5:et(i);break;case 4:ge();break;case 31:i.memoizedState!==null&&An(i);break;case 13:An(i);break;case 19:B(Tt);break;case 10:Os(i.type);break;case 22:case 23:An(i),cf(),n!==null&&B(ta);break;case 24:Os(Pt)}}function wo(n,i){try{var l=i.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var h=d.next;l=h;do{if((l.tag&n)===n){d=void 0;var g=l.create,j=l.inst;d=g(),j.destroy=d}l=l.next}while(l!==h)}}catch(_){ot(i,i.return,_)}}function ui(n,i,l){try{var d=i.updateQueue,h=d!==null?d.lastEffect:null;if(h!==null){var g=h.next;d=g;do{if((d.tag&n)===n){var j=d.inst,_=j.destroy;if(_!==void 0){j.destroy=void 0,h=i;var D=l,F=_;try{F()}catch(W){ot(h,D,W)}}}d=d.next}while(d!==g)}}catch(W){ot(i,i.return,W)}}function x0(n){var i=n.updateQueue;if(i!==null){var l=n.stateNode;try{cy(i,l)}catch(d){ot(n,n.return,d)}}}function b0(n,i,l){l.props=ra(n.type,n.memoizedProps),l.state=n.memoizedState;try{l.componentWillUnmount()}catch(d){ot(n,i,d)}}function No(n,i){try{var l=n.ref;if(l!==null){switch(n.tag){case 26:case 27:case 5:var d=n.stateNode;break;case 30:d=n.stateNode;break;default:d=n.stateNode}typeof l=="function"?n.refCleanup=l(d):l.current=d}}catch(h){ot(n,i,h)}}function xs(n,i){var l=n.ref,d=n.refCleanup;if(l!==null)if(typeof d=="function")try{d()}catch(h){ot(n,i,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(h){ot(n,i,h)}else l.current=null}function S0(n){var i=n.type,l=n.memoizedProps,d=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&d.focus();break e;case"img":l.src?d.src=l.src:l.srcSet&&(d.srcset=l.srcSet)}}catch(h){ot(n,n.return,h)}}function Bf(n,i,l){try{var d=n.stateNode;wC(d,n.type,l,i),d[sn]=i}catch(h){ot(n,n.return,h)}}function j0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&yi(n.type)||n.tag===4}function qf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||j0(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&yi(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Hf(n,i,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(n,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(n),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=_s));else if(d!==4&&(d===27&&yi(n.type)&&(l=n.stateNode,i=null),n=n.child,n!==null))for(Hf(n,i,l),n=n.sibling;n!==null;)Hf(n,i,l),n=n.sibling}function dc(n,i,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,i?l.insertBefore(n,i):l.appendChild(n);else if(d!==4&&(d===27&&yi(n.type)&&(l=n.stateNode),n=n.child,n!==null))for(dc(n,i,l),n=n.sibling;n!==null;)dc(n,i,l),n=n.sibling}function w0(n){var i=n.stateNode,l=n.memoizedProps;try{for(var d=n.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);Wt(i,d,l),i[st]=n,i[sn]=l}catch(g){ot(n,n.return,g)}}var Ps=!1,Bt=!1,Kf=!1,N0=typeof WeakSet=="function"?WeakSet:Set,Qt=null;function nC(n,i){if(n=n.containerInfo,dh=Tc,n=Mg(n),Md(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var h=d.anchorOffset,g=d.focusNode;d=d.focusOffset;try{l.nodeType,g.nodeType}catch{l=null;break e}var j=0,_=-1,D=-1,F=0,W=0,ie=n,Z=null;t:for(;;){for(var Y;ie!==l||h!==0&&ie.nodeType!==3||(_=j+h),ie!==g||d!==0&&ie.nodeType!==3||(D=j+d),ie.nodeType===3&&(j+=ie.nodeValue.length),(Y=ie.firstChild)!==null;)Z=ie,ie=Y;for(;;){if(ie===n)break t;if(Z===l&&++F===h&&(_=j),Z===g&&++W===d&&(D=j),(Y=ie.nextSibling)!==null)break;ie=Z,Z=ie.parentNode}ie=Y}l=_===-1||D===-1?null:{start:_,end:D}}else l=null}l=l||{start:0,end:0}}else l=null;for(fh={focusedElem:n,selectionRange:l},Tc=!1,Qt=i;Qt!==null;)if(i=Qt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Qt=n;else for(;Qt!==null;){switch(i=Qt,g=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(l=0;l<n.length;l++)h=n[l],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&g!==null){n=void 0,l=i,h=g.memoizedProps,g=g.memoizedState,d=l.stateNode;try{var ve=ra(l.type,h);n=d.getSnapshotBeforeUpdate(ve,g),d.__reactInternalSnapshotBeforeUpdate=n}catch(Ce){ot(l,l.return,Ce)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,l=n.nodeType,l===9)ph(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":ph(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(a(163))}if(n=i.sibling,n!==null){n.return=i.return,Qt=n;break}Qt=i.return}}function C0(n,i,l){var d=l.flags;switch(l.tag){case 0:case 11:case 15:Is(n,l),d&4&&wo(5,l);break;case 1:if(Is(n,l),d&4)if(n=l.stateNode,i===null)try{n.componentDidMount()}catch(j){ot(l,l.return,j)}else{var h=ra(l.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(h,i,n.__reactInternalSnapshotBeforeUpdate)}catch(j){ot(l,l.return,j)}}d&64&&x0(l),d&512&&No(l,l.return);break;case 3:if(Is(n,l),d&64&&(n=l.updateQueue,n!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{cy(n,i)}catch(j){ot(l,l.return,j)}}break;case 27:i===null&&d&4&&w0(l);case 26:case 5:Is(n,l),i===null&&d&4&&S0(l),d&512&&No(l,l.return);break;case 12:Is(n,l);break;case 31:Is(n,l),d&4&&_0(n,l);break;case 13:Is(n,l),d&4&&E0(n,l),d&64&&(n=l.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(l=dC.bind(null,l),AC(n,l))));break;case 22:if(d=l.memoizedState!==null||Ps,!d){i=i!==null&&i.memoizedState!==null||Bt,h=Ps;var g=Bt;Ps=d,(Bt=i)&&!g?Bs(n,l,(l.subtreeFlags&8772)!==0):Is(n,l),Ps=h,Bt=g}break;case 30:break;default:Is(n,l)}}function k0(n){var i=n.alternate;i!==null&&(n.alternate=null,k0(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&Js(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var bt=null,vn=!1;function Us(n,i,l){for(l=l.child;l!==null;)z0(n,i,l),l=l.sibling}function z0(n,i,l){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(ts,l)}catch{}switch(l.tag){case 26:Bt||xs(l,i),Us(n,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Bt||xs(l,i);var d=bt,h=vn;yi(l.type)&&(bt=l.stateNode,vn=!1),Us(n,i,l),Oo(l.stateNode),bt=d,vn=h;break;case 5:Bt||xs(l,i);case 6:if(d=bt,h=vn,bt=null,Us(n,i,l),bt=d,vn=h,bt!==null)if(vn)try{(bt.nodeType===9?bt.body:bt.nodeName==="HTML"?bt.ownerDocument.body:bt).removeChild(l.stateNode)}catch(g){ot(l,i,g)}else try{bt.removeChild(l.stateNode)}catch(g){ot(l,i,g)}break;case 18:bt!==null&&(vn?(n=bt,xv(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,l.stateNode),br(n)):xv(bt,l.stateNode));break;case 4:d=bt,h=vn,bt=l.stateNode.containerInfo,vn=!0,Us(n,i,l),bt=d,vn=h;break;case 0:case 11:case 14:case 15:ui(2,l,i),Bt||ui(4,l,i),Us(n,i,l);break;case 1:Bt||(xs(l,i),d=l.stateNode,typeof d.componentWillUnmount=="function"&&b0(l,i,d)),Us(n,i,l);break;case 21:Us(n,i,l);break;case 22:Bt=(d=Bt)||l.memoizedState!==null,Us(n,i,l),Bt=d;break;default:Us(n,i,l)}}function _0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{br(n)}catch(l){ot(i,i.return,l)}}}function E0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{br(n)}catch(l){ot(i,i.return,l)}}function sC(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new N0),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new N0),i;default:throw Error(a(435,n.tag))}}function fc(n,i){var l=sC(n);i.forEach(function(d){if(!l.has(d)){l.add(d);var h=fC.bind(null,n,d);d.then(h,h)}})}function xn(n,i){var l=i.deletions;if(l!==null)for(var d=0;d<l.length;d++){var h=l[d],g=n,j=i,_=j;e:for(;_!==null;){switch(_.tag){case 27:if(yi(_.type)){bt=_.stateNode,vn=!1;break e}break;case 5:bt=_.stateNode,vn=!1;break e;case 3:case 4:bt=_.stateNode.containerInfo,vn=!0;break e}_=_.return}if(bt===null)throw Error(a(160));z0(g,j,h),bt=null,vn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)R0(i,n),i=i.sibling}var is=null;function R0(n,i){var l=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:xn(i,n),bn(n),d&4&&(ui(3,n,n.return),wo(3,n),ui(5,n,n.return));break;case 1:xn(i,n),bn(n),d&512&&(Bt||l===null||xs(l,l.return)),d&64&&Ps&&(n=n.updateQueue,n!==null&&(d=n.callbacks,d!==null&&(l=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=l===null?d:l.concat(d))));break;case 26:var h=is;if(xn(i,n),bn(n),d&512&&(Bt||l===null||xs(l,l.return)),d&4){var g=l!==null?l.memoizedState:null;if(d=n.memoizedState,l===null)if(d===null)if(n.stateNode===null){e:{d=n.type,l=n.memoizedProps,h=h.ownerDocument||h;t:switch(d){case"title":g=h.getElementsByTagName("title")[0],(!g||g[ps]||g[st]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=h.createElement(d),h.head.insertBefore(g,h.querySelector("head > title"))),Wt(g,d,l),g[st]=n,it(g),d=g;break e;case"link":var j=Rv("link","href",h).get(d+(l.href||""));if(j){for(var _=0;_<j.length;_++)if(g=j[_],g.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&g.getAttribute("rel")===(l.rel==null?null:l.rel)&&g.getAttribute("title")===(l.title==null?null:l.title)&&g.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){j.splice(_,1);break t}}g=h.createElement(d),Wt(g,d,l),h.head.appendChild(g);break;case"meta":if(j=Rv("meta","content",h).get(d+(l.content||""))){for(_=0;_<j.length;_++)if(g=j[_],g.getAttribute("content")===(l.content==null?null:""+l.content)&&g.getAttribute("name")===(l.name==null?null:l.name)&&g.getAttribute("property")===(l.property==null?null:l.property)&&g.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&g.getAttribute("charset")===(l.charSet==null?null:l.charSet)){j.splice(_,1);break t}}g=h.createElement(d),Wt(g,d,l),h.head.appendChild(g);break;default:throw Error(a(468,d))}g[st]=n,it(g),d=g}n.stateNode=d}else Av(h,n.type,n.stateNode);else n.stateNode=Ev(h,d,n.memoizedProps);else g!==d?(g===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):g.count--,d===null?Av(h,n.type,n.stateNode):Ev(h,d,n.memoizedProps)):d===null&&n.stateNode!==null&&Bf(n,n.memoizedProps,l.memoizedProps)}break;case 27:xn(i,n),bn(n),d&512&&(Bt||l===null||xs(l,l.return)),l!==null&&d&4&&Bf(n,n.memoizedProps,l.memoizedProps);break;case 5:if(xn(i,n),bn(n),d&512&&(Bt||l===null||xs(l,l.return)),n.flags&32){h=n.stateNode;try{Ha(h,"")}catch(ve){ot(n,n.return,ve)}}d&4&&n.stateNode!=null&&(h=n.memoizedProps,Bf(n,h,l!==null?l.memoizedProps:h)),d&1024&&(Kf=!0);break;case 6:if(xn(i,n),bn(n),d&4){if(n.stateNode===null)throw Error(a(162));d=n.memoizedProps,l=n.stateNode;try{l.nodeValue=d}catch(ve){ot(n,n.return,ve)}}break;case 3:if(_c=null,h=is,is=kc(i.containerInfo),xn(i,n),is=h,bn(n),d&4&&l!==null&&l.memoizedState.isDehydrated)try{br(i.containerInfo)}catch(ve){ot(n,n.return,ve)}Kf&&(Kf=!1,A0(n));break;case 4:d=is,is=kc(n.stateNode.containerInfo),xn(i,n),bn(n),is=d;break;case 12:xn(i,n),bn(n);break;case 31:xn(i,n),bn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,fc(n,d)));break;case 13:xn(i,n),bn(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(mc=Qe()),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,fc(n,d)));break;case 22:h=n.memoizedState!==null;var D=l!==null&&l.memoizedState!==null,F=Ps,W=Bt;if(Ps=F||h,Bt=W||D,xn(i,n),Bt=W,Ps=F,bn(n),d&8192)e:for(i=n.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(l===null||D||Ps||Bt||oa(n)),l=null,i=n;;){if(i.tag===5||i.tag===26){if(l===null){D=l=i;try{if(g=D.stateNode,h)j=g.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{_=D.stateNode;var ie=D.memoizedProps.style,Z=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;_.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(ve){ot(D,D.return,ve)}}}else if(i.tag===6){if(l===null){D=i;try{D.stateNode.nodeValue=h?"":D.memoizedProps}catch(ve){ot(D,D.return,ve)}}}else if(i.tag===18){if(l===null){D=i;try{var Y=D.stateNode;h?bv(Y,!0):bv(D.stateNode,!1)}catch(ve){ot(D,D.return,ve)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=n.updateQueue,d!==null&&(l=d.retryQueue,l!==null&&(d.retryQueue=null,fc(n,l))));break;case 19:xn(i,n),bn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,fc(n,d)));break;case 30:break;case 21:break;default:xn(i,n),bn(n)}}function bn(n){var i=n.flags;if(i&2){try{for(var l,d=n.return;d!==null;){if(j0(d)){l=d;break}d=d.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var h=l.stateNode,g=qf(n);dc(n,g,h);break;case 5:var j=l.stateNode;l.flags&32&&(Ha(j,""),l.flags&=-33);var _=qf(n);dc(n,_,j);break;case 3:case 4:var D=l.stateNode.containerInfo,F=qf(n);Hf(n,F,D);break;default:throw Error(a(161))}}catch(W){ot(n,n.return,W)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function A0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;A0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function Is(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)C0(n,i.alternate,i),i=i.sibling}function oa(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:ui(4,i,i.return),oa(i);break;case 1:xs(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&b0(i,i.return,l),oa(i);break;case 27:Oo(i.stateNode);case 26:case 5:xs(i,i.return),oa(i);break;case 22:i.memoizedState===null&&oa(i);break;case 30:oa(i);break;default:oa(i)}n=n.sibling}}function Bs(n,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,h=n,g=i,j=g.flags;switch(g.tag){case 0:case 11:case 15:Bs(h,g,l),wo(4,g);break;case 1:if(Bs(h,g,l),d=g,h=d.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(F){ot(d,d.return,F)}if(d=g,h=d.updateQueue,h!==null){var _=d.stateNode;try{var D=h.shared.hiddenCallbacks;if(D!==null)for(h.shared.hiddenCallbacks=null,h=0;h<D.length;h++)ly(D[h],_)}catch(F){ot(d,d.return,F)}}l&&j&64&&x0(g),No(g,g.return);break;case 27:w0(g);case 26:case 5:Bs(h,g,l),l&&d===null&&j&4&&S0(g),No(g,g.return);break;case 12:Bs(h,g,l);break;case 31:Bs(h,g,l),l&&j&4&&_0(h,g);break;case 13:Bs(h,g,l),l&&j&4&&E0(h,g);break;case 22:g.memoizedState===null&&Bs(h,g,l),No(g,g.return);break;case 30:break;default:Bs(h,g,l)}i=i.sibling}}function Gf(n,i){var l=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==l&&(n!=null&&n.refCount++,l!=null&&co(l))}function Ff(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&co(n))}function as(n,i,l,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)T0(n,i,l,d),i=i.sibling}function T0(n,i,l,d){var h=i.flags;switch(i.tag){case 0:case 11:case 15:as(n,i,l,d),h&2048&&wo(9,i);break;case 1:as(n,i,l,d);break;case 3:as(n,i,l,d),h&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&co(n)));break;case 12:if(h&2048){as(n,i,l,d),n=i.stateNode;try{var g=i.memoizedProps,j=g.id,_=g.onPostCommit;typeof _=="function"&&_(j,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(D){ot(i,i.return,D)}}else as(n,i,l,d);break;case 31:as(n,i,l,d);break;case 13:as(n,i,l,d);break;case 23:break;case 22:g=i.stateNode,j=i.alternate,i.memoizedState!==null?g._visibility&2?as(n,i,l,d):Co(n,i):g._visibility&2?as(n,i,l,d):(g._visibility|=2,cr(n,i,l,d,(i.subtreeFlags&10256)!==0||!1)),h&2048&&Gf(j,i);break;case 24:as(n,i,l,d),h&2048&&Ff(i.alternate,i);break;default:as(n,i,l,d)}}function cr(n,i,l,d,h){for(h=h&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var g=n,j=i,_=l,D=d,F=j.flags;switch(j.tag){case 0:case 11:case 15:cr(g,j,_,D,h),wo(8,j);break;case 23:break;case 22:var W=j.stateNode;j.memoizedState!==null?W._visibility&2?cr(g,j,_,D,h):Co(g,j):(W._visibility|=2,cr(g,j,_,D,h)),h&&F&2048&&Gf(j.alternate,j);break;case 24:cr(g,j,_,D,h),h&&F&2048&&Ff(j.alternate,j);break;default:cr(g,j,_,D,h)}i=i.sibling}}function Co(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=n,d=i,h=d.flags;switch(d.tag){case 22:Co(l,d),h&2048&&Gf(d.alternate,d);break;case 24:Co(l,d),h&2048&&Ff(d.alternate,d);break;default:Co(l,d)}i=i.sibling}}var ko=8192;function ur(n,i,l){if(n.subtreeFlags&ko)for(n=n.child;n!==null;)O0(n,i,l),n=n.sibling}function O0(n,i,l){switch(n.tag){case 26:ur(n,i,l),n.flags&ko&&n.memoizedState!==null&&HC(l,is,n.memoizedState,n.memoizedProps);break;case 5:ur(n,i,l);break;case 3:case 4:var d=is;is=kc(n.stateNode.containerInfo),ur(n,i,l),is=d;break;case 22:n.memoizedState===null&&(d=n.alternate,d!==null&&d.memoizedState!==null?(d=ko,ko=16777216,ur(n,i,l),ko=d):ur(n,i,l));break;default:ur(n,i,l)}}function L0(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function zo(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];Qt=d,M0(d,n)}L0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)D0(n),n=n.sibling}function D0(n){switch(n.tag){case 0:case 11:case 15:zo(n),n.flags&2048&&ui(9,n,n.return);break;case 3:zo(n);break;case 12:zo(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,hc(n)):zo(n);break;default:zo(n)}}function hc(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];Qt=d,M0(d,n)}L0(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:ui(8,i,i.return),hc(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,hc(i));break;default:hc(i)}n=n.sibling}}function M0(n,i){for(;Qt!==null;){var l=Qt;switch(l.tag){case 0:case 11:case 15:ui(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var d=l.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:co(l.memoizedState.cache)}if(d=l.child,d!==null)d.return=l,Qt=d;else e:for(l=n;Qt!==null;){d=Qt;var h=d.sibling,g=d.return;if(k0(d),d===l){Qt=null;break e}if(h!==null){h.return=g,Qt=h;break e}Qt=g}}}var iC={getCacheForType:function(n){var i=Jt(Pt),l=i.data.get(n);return l===void 0&&(l=n(),i.data.set(n,l)),l},cacheSignal:function(){return Jt(Pt).controller.signal}},aC=typeof WeakMap=="function"?WeakMap:Map,tt=0,mt=null,Ue=null,qe=0,rt=0,Tn=null,di=!1,dr=!1,Zf=!1,qs=0,Rt=0,fi=0,la=0,Vf=0,On=0,fr=0,_o=null,Sn=null,Qf=!1,mc=0,$0=0,pc=1/0,gc=null,hi=null,Kt=0,mi=null,hr=null,Hs=0,Yf=0,Jf=null,P0=null,Eo=0,Xf=null;function Ln(){return(tt&2)!==0&&qe!==0?qe&-qe:K.T!==null?ih():Ua()}function U0(){if(On===0)if((qe&536870912)===0||Fe){var n=$a;$a<<=1,($a&3932160)===0&&($a=262144),On=n}else On=536870912;return n=Rn.current,n!==null&&(n.flags|=32),On}function jn(n,i,l){(n===mt&&(rt===2||rt===9)||n.cancelPendingCommit!==null)&&(mr(n,0),pi(n,qe,On,!1)),Gi(n,l),((tt&2)===0||n!==mt)&&(n===mt&&((tt&2)===0&&(la|=l),Rt===4&&pi(n,qe,On,!1)),bs(n))}function I0(n,i,l){if((tt&6)!==0)throw Error(a(327));var d=!l&&(i&127)===0&&(i&n.expiredLanes)===0||Ys(n,i),h=d?lC(n,i):eh(n,i,!0),g=d;do{if(h===0){dr&&!d&&pi(n,i,0,!1);break}else{if(l=n.current.alternate,g&&!rC(l)){h=eh(n,i,!1),g=!1;continue}if(h===2){if(g=i,n.errorRecoveryDisabledLanes&g)var j=0;else j=n.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){i=j;e:{var _=n;h=_o;var D=_.current.memoizedState.isDehydrated;if(D&&(mr(_,j).flags|=256),j=eh(_,j,!1),j!==2){if(Zf&&!D){_.errorRecoveryDisabledLanes|=g,la|=g,h=4;break e}g=Sn,Sn=h,g!==null&&(Sn===null?Sn=g:Sn.push.apply(Sn,g))}h=j}if(g=!1,h!==2)continue}}if(h===1){mr(n,0),pi(n,i,0,!0);break}e:{switch(d=n,g=h,g){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:pi(d,i,On,!di);break e;case 2:Sn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(h=mc+300-Qe(),10<h)){if(pi(d,i,On,!di),Pa(d,0,!0)!==0)break e;Hs=i,d.timeoutHandle=yv(B0.bind(null,d,l,Sn,gc,Qf,i,On,la,fr,di,g,"Throttled",-0,0),h);break e}B0(d,l,Sn,gc,Qf,i,On,la,fr,di,g,null,-0,0)}}break}while(!0);bs(n)}function B0(n,i,l,d,h,g,j,_,D,F,W,ie,Z,Y){if(n.timeoutHandle=-1,ie=i.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:_s},O0(i,g,ie);var ve=(g&62914560)===g?mc-Qe():(g&4194048)===g?$0-Qe():0;if(ve=KC(ie,ve),ve!==null){Hs=g,n.cancelPendingCommit=ve(Q0.bind(null,n,i,g,l,d,h,j,_,D,W,ie,null,Z,Y)),pi(n,g,j,!F);return}}Q0(n,i,g,l,d,h,j,_,D)}function rC(n){for(var i=n;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var d=0;d<l.length;d++){var h=l[d],g=h.getSnapshot;h=h.value;try{if(!_n(g(),h))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function pi(n,i,l,d){i&=~Vf,i&=~la,n.suspendedLanes|=i,n.pingedLanes&=~i,d&&(n.warmLanes|=i),d=n.expirationTimes;for(var h=i;0<h;){var g=31-ce(h),j=1<<g;d[g]=-1,h&=~j}l!==0&&I(n,l,i)}function yc(){return(tt&6)===0?(Ro(0),!1):!0}function Wf(){if(Ue!==null){if(rt===0)var n=Ue.return;else n=Ue,Ts=Wi=null,pf(n),ir=null,fo=0,n=Ue;for(;n!==null;)v0(n.alternate,n),n=n.return;Ue=null}}function mr(n,i){var l=n.timeoutHandle;l!==-1&&(n.timeoutHandle=-1,kC(l)),l=n.cancelPendingCommit,l!==null&&(n.cancelPendingCommit=null,l()),Hs=0,Wf(),mt=n,Ue=l=Rs(n.current,null),qe=i,rt=0,Tn=null,di=!1,dr=Ys(n,i),Zf=!1,fr=On=Vf=la=fi=Rt=0,Sn=_o=null,Qf=!1,(i&8)!==0&&(i|=i&32);var d=n.entangledLanes;if(d!==0)for(n=n.entanglements,d&=i;0<d;){var h=31-ce(d),g=1<<h;i|=n[h],d&=~g}return qs=i,Pl(),l}function q0(n,i){Ae=null,K.H=bo,i===sr||i===Fl?(i=iy(),rt=3):i===nf?(i=iy(),rt=4):rt=i===Af?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Tn=i,Ue===null&&(Rt=1,rc(n,Un(i,n.current)))}function H0(){var n=Rn.current;return n===null?!0:(qe&4194048)===qe?Hn===null:(qe&62914560)===qe||(qe&536870912)!==0?n===Hn:!1}function K0(){var n=K.H;return K.H=bo,n===null?bo:n}function G0(){var n=K.A;return K.A=iC,n}function vc(){Rt=4,di||(qe&4194048)!==qe&&Rn.current!==null||(dr=!0),(fi&134217727)===0&&(la&134217727)===0||mt===null||pi(mt,qe,On,!1)}function eh(n,i,l){var d=tt;tt|=2;var h=K0(),g=G0();(mt!==n||qe!==i)&&(gc=null,mr(n,i)),i=!1;var j=Rt;e:do try{if(rt!==0&&Ue!==null){var _=Ue,D=Tn;switch(rt){case 8:Wf(),j=6;break e;case 3:case 2:case 9:case 6:Rn.current===null&&(i=!0);var F=rt;if(rt=0,Tn=null,pr(n,_,D,F),l&&dr){j=0;break e}break;default:F=rt,rt=0,Tn=null,pr(n,_,D,F)}}oC(),j=Rt;break}catch(W){q0(n,W)}while(!0);return i&&n.shellSuspendCounter++,Ts=Wi=null,tt=d,K.H=h,K.A=g,Ue===null&&(mt=null,qe=0,Pl()),j}function oC(){for(;Ue!==null;)F0(Ue)}function lC(n,i){var l=tt;tt|=2;var d=K0(),h=G0();mt!==n||qe!==i?(gc=null,pc=Qe()+500,mr(n,i)):dr=Ys(n,i);e:do try{if(rt!==0&&Ue!==null){i=Ue;var g=Tn;t:switch(rt){case 1:rt=0,Tn=null,pr(n,i,g,1);break;case 2:case 9:if(ny(g)){rt=0,Tn=null,Z0(i);break}i=function(){rt!==2&&rt!==9||mt!==n||(rt=7),bs(n)},g.then(i,i);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:ny(g)?(rt=0,Tn=null,Z0(i)):(rt=0,Tn=null,pr(n,i,g,7));break;case 5:var j=null;switch(Ue.tag){case 26:j=Ue.memoizedState;case 5:case 27:var _=Ue;if(j?Tv(j):_.stateNode.complete){rt=0,Tn=null;var D=_.sibling;if(D!==null)Ue=D;else{var F=_.return;F!==null?(Ue=F,xc(F)):Ue=null}break t}}rt=0,Tn=null,pr(n,i,g,5);break;case 6:rt=0,Tn=null,pr(n,i,g,6);break;case 8:Wf(),Rt=6;break e;default:throw Error(a(462))}}cC();break}catch(W){q0(n,W)}while(!0);return Ts=Wi=null,K.H=d,K.A=h,tt=l,Ue!==null?0:(mt=null,qe=0,Pl(),Rt)}function cC(){for(;Ue!==null&&!gt();)F0(Ue)}function F0(n){var i=g0(n.alternate,n,qs);n.memoizedProps=n.pendingProps,i===null?xc(n):Ue=i}function Z0(n){var i=n,l=i.alternate;switch(i.tag){case 15:case 0:i=u0(l,i,i.pendingProps,i.type,void 0,qe);break;case 11:i=u0(l,i,i.pendingProps,i.type.render,i.ref,qe);break;case 5:pf(i);default:v0(l,i),i=Ue=Gg(i,qs),i=g0(l,i,qs)}n.memoizedProps=n.pendingProps,i===null?xc(n):Ue=i}function pr(n,i,l,d){Ts=Wi=null,pf(i),ir=null,fo=0;var h=i.return;try{if(J1(n,h,i,l,qe)){Rt=1,rc(n,Un(l,n.current)),Ue=null;return}}catch(g){if(h!==null)throw Ue=h,g;Rt=1,rc(n,Un(l,n.current)),Ue=null;return}i.flags&32768?(Fe||d===1?n=!0:dr||(qe&536870912)!==0?n=!1:(di=n=!0,(d===2||d===9||d===3||d===6)&&(d=Rn.current,d!==null&&d.tag===13&&(d.flags|=16384))),V0(i,n)):xc(i)}function xc(n){var i=n;do{if((i.flags&32768)!==0){V0(i,di);return}n=i.return;var l=eC(i.alternate,i,qs);if(l!==null){Ue=l;return}if(i=i.sibling,i!==null){Ue=i;return}Ue=i=n}while(i!==null);Rt===0&&(Rt=5)}function V0(n,i){do{var l=tC(n.alternate,n);if(l!==null){l.flags&=32767,Ue=l;return}if(l=n.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(n=n.sibling,n!==null)){Ue=n;return}Ue=n=l}while(n!==null);Rt=6,Ue=null}function Q0(n,i,l,d,h,g,j,_,D){n.cancelPendingCommit=null;do bc();while(Kt!==0);if((tt&6)!==0)throw Error(a(327));if(i!==null){if(i===n.current)throw Error(a(177));if(g=i.lanes|i.childLanes,g|=Bd,Nl(n,l,g,j,_,D),n===mt&&(Ue=mt=null,qe=0),hr=i,mi=n,Hs=l,Yf=g,Jf=h,P0=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,hC(Be,function(){return ev(),null})):(n.callbackNode=null,n.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=K.T,K.T=null,h=ae.p,ae.p=2,j=tt,tt|=4;try{nC(n,i,l)}finally{tt=j,ae.p=h,K.T=d}}Kt=1,Y0(),J0(),X0()}}function Y0(){if(Kt===1){Kt=0;var n=mi,i=hr,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=K.T,K.T=null;var d=ae.p;ae.p=2;var h=tt;tt|=4;try{R0(i,n);var g=fh,j=Mg(n.containerInfo),_=g.focusedElem,D=g.selectionRange;if(j!==_&&_&&_.ownerDocument&&Dg(_.ownerDocument.documentElement,_)){if(D!==null&&Md(_)){var F=D.start,W=D.end;if(W===void 0&&(W=F),"selectionStart"in _)_.selectionStart=F,_.selectionEnd=Math.min(W,_.value.length);else{var ie=_.ownerDocument||document,Z=ie&&ie.defaultView||window;if(Z.getSelection){var Y=Z.getSelection(),ve=_.textContent.length,Ce=Math.min(D.start,ve),ft=D.end===void 0?Ce:Math.min(D.end,ve);!Y.extend&&Ce>ft&&(j=ft,ft=Ce,Ce=j);var q=Lg(_,Ce),$=Lg(_,ft);if(q&&$&&(Y.rangeCount!==1||Y.anchorNode!==q.node||Y.anchorOffset!==q.offset||Y.focusNode!==$.node||Y.focusOffset!==$.offset)){var G=ie.createRange();G.setStart(q.node,q.offset),Y.removeAllRanges(),Ce>ft?(Y.addRange(G),Y.extend($.node,$.offset)):(G.setEnd($.node,$.offset),Y.addRange(G))}}}}for(ie=[],Y=_;Y=Y.parentNode;)Y.nodeType===1&&ie.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<ie.length;_++){var te=ie[_];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}Tc=!!dh,fh=dh=null}finally{tt=h,ae.p=d,K.T=l}}n.current=i,Kt=2}}function J0(){if(Kt===2){Kt=0;var n=mi,i=hr,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=K.T,K.T=null;var d=ae.p;ae.p=2;var h=tt;tt|=4;try{C0(n,i.alternate,i)}finally{tt=h,ae.p=d,K.T=l}}Kt=3}}function X0(){if(Kt===4||Kt===3){Kt=0,Vt();var n=mi,i=hr,l=Hs,d=P0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Kt=5:(Kt=0,hr=mi=null,W0(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(hi=null),ln(l),i=i.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(ts,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=K.T,h=ae.p,ae.p=2,K.T=null;try{for(var g=n.onRecoverableError,j=0;j<d.length;j++){var _=d[j];g(_.value,{componentStack:_.stack})}}finally{K.T=i,ae.p=h}}(Hs&3)!==0&&bc(),bs(n),h=n.pendingLanes,(l&261930)!==0&&(h&42)!==0?n===Xf?Eo++:(Eo=0,Xf=n):Eo=0,Ro(0)}}function W0(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,co(i)))}function bc(){return Y0(),J0(),X0(),ev()}function ev(){if(Kt!==5)return!1;var n=mi,i=Yf;Yf=0;var l=ln(Hs),d=K.T,h=ae.p;try{ae.p=32>l?32:l,K.T=null,l=Jf,Jf=null;var g=mi,j=Hs;if(Kt=0,hr=mi=null,Hs=0,(tt&6)!==0)throw Error(a(331));var _=tt;if(tt|=4,D0(g.current),T0(g,g.current,j,l),tt=_,Ro(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(ts,g)}catch{}return!0}finally{ae.p=h,K.T=d,W0(n,i)}}function tv(n,i,l){i=Un(l,i),i=Rf(n.stateNode,i,2),n=oi(n,i,2),n!==null&&(Gi(n,2),bs(n))}function ot(n,i,l){if(n.tag===3)tv(n,n,l);else for(;i!==null;){if(i.tag===3){tv(i,n,l);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(hi===null||!hi.has(d))){n=Un(l,n),l=n0(2),d=oi(i,l,2),d!==null&&(s0(l,d,i,n),Gi(d,2),bs(d));break}}i=i.return}}function th(n,i,l){var d=n.pingCache;if(d===null){d=n.pingCache=new aC;var h=new Set;d.set(i,h)}else h=d.get(i),h===void 0&&(h=new Set,d.set(i,h));h.has(l)||(Zf=!0,h.add(l),n=uC.bind(null,n,i,l),i.then(n,n))}function uC(n,i,l){var d=n.pingCache;d!==null&&d.delete(i),n.pingedLanes|=n.suspendedLanes&l,n.warmLanes&=~l,mt===n&&(qe&l)===l&&(Rt===4||Rt===3&&(qe&62914560)===qe&&300>Qe()-mc?(tt&2)===0&&mr(n,0):Vf|=l,fr===qe&&(fr=0)),bs(n)}function nv(n,i){i===0&&(i=wl()),n=Yi(n,i),n!==null&&(Gi(n,i),bs(n))}function dC(n){var i=n.memoizedState,l=0;i!==null&&(l=i.retryLane),nv(n,l)}function fC(n,i){var l=0;switch(n.tag){case 31:case 13:var d=n.stateNode,h=n.memoizedState;h!==null&&(l=h.retryLane);break;case 19:d=n.stateNode;break;case 22:d=n.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),nv(n,l)}function hC(n,i){return re(n,i)}var Sc=null,gr=null,nh=!1,jc=!1,sh=!1,gi=0;function bs(n){n!==gr&&n.next===null&&(gr===null?Sc=gr=n:gr=gr.next=n),jc=!0,nh||(nh=!0,pC())}function Ro(n,i){if(!sh&&jc){sh=!0;do for(var l=!1,d=Sc;d!==null;){if(n!==0){var h=d.pendingLanes;if(h===0)var g=0;else{var j=d.suspendedLanes,_=d.pingedLanes;g=(1<<31-ce(42|n)+1)-1,g&=h&~(j&~_),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(l=!0,rv(d,g))}else g=qe,g=Pa(d,d===mt?g:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(g&3)===0||Ys(d,g)||(l=!0,rv(d,g));d=d.next}while(l);sh=!1}}function mC(){sv()}function sv(){jc=nh=!1;var n=0;gi!==0&&CC()&&(n=gi);for(var i=Qe(),l=null,d=Sc;d!==null;){var h=d.next,g=iv(d,i);g===0?(d.next=null,l===null?Sc=h:l.next=h,h===null&&(gr=l)):(l=d,(n!==0||(g&3)!==0)&&(jc=!0)),d=h}Kt!==0&&Kt!==5||Ro(n),gi!==0&&(gi=0)}function iv(n,i){for(var l=n.suspendedLanes,d=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var j=31-ce(g),_=1<<j,D=h[j];D===-1?((_&l)===0||(_&d)!==0)&&(h[j]=xd(_,i)):D<=i&&(n.expiredLanes|=_),g&=~_}if(i=mt,l=qe,l=Pa(n,n===i?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d=n.callbackNode,l===0||n===i&&(rt===2||rt===9)||n.cancelPendingCommit!==null)return d!==null&&d!==null&&Ge(d),n.callbackNode=null,n.callbackPriority=0;if((l&3)===0||Ys(n,l)){if(i=l&-l,i===n.callbackPriority)return i;switch(d!==null&&Ge(d),ln(l)){case 2:case 8:l=Nt;break;case 32:l=Be;break;case 268435456:l=pn;break;default:l=Be}return d=av.bind(null,n),l=re(l,d),n.callbackPriority=i,n.callbackNode=l,i}return d!==null&&d!==null&&Ge(d),n.callbackPriority=2,n.callbackNode=null,2}function av(n,i){if(Kt!==0&&Kt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var l=n.callbackNode;if(bc()&&n.callbackNode!==l)return null;var d=qe;return d=Pa(n,n===mt?d:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d===0?null:(I0(n,d,i),iv(n,Qe()),n.callbackNode!=null&&n.callbackNode===l?av.bind(null,n):null)}function rv(n,i){if(bc())return null;I0(n,i,!0)}function pC(){zC(function(){(tt&6)!==0?re(Ye,mC):sv()})}function ih(){if(gi===0){var n=tr;n===0&&(n=Ki,Ki<<=1,(Ki&261888)===0&&(Ki=256)),gi=n}return gi}function ov(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Rl(""+n)}function lv(n,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,n.id&&l.setAttribute("form",n.id),i.parentNode.insertBefore(l,i),n=new FormData(n),l.parentNode.removeChild(l),n}function gC(n,i,l,d,h){if(i==="submit"&&l&&l.stateNode===h){var g=ov((h[sn]||null).action),j=d.submitter;j&&(i=(i=j[sn]||null)?ov(i.formAction):j.getAttribute("formAction"),i!==null&&(g=i,j=null));var _=new Ll("action","action",null,d,h);n.push({event:_,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(gi!==0){var D=j?lv(h,j):new FormData(h);Nf(l,{pending:!0,data:D,method:h.method,action:g},null,D)}}else typeof g=="function"&&(_.preventDefault(),D=j?lv(h,j):new FormData(h),Nf(l,{pending:!0,data:D,method:h.method,action:g},g,D))},currentTarget:h}]})}}for(var ah=0;ah<Id.length;ah++){var rh=Id[ah],yC=rh.toLowerCase(),vC=rh[0].toUpperCase()+rh.slice(1);ss(yC,"on"+vC)}ss(Ug,"onAnimationEnd"),ss(Ig,"onAnimationIteration"),ss(Bg,"onAnimationStart"),ss("dblclick","onDoubleClick"),ss("focusin","onFocus"),ss("focusout","onBlur"),ss(L1,"onTransitionRun"),ss(D1,"onTransitionStart"),ss(M1,"onTransitionCancel"),ss(qg,"onTransitionEnd"),Ba("onMouseEnter",["mouseout","mouseover"]),Ba("onMouseLeave",["mouseout","mouseover"]),Ba("onPointerEnter",["pointerout","pointerover"]),Ba("onPointerLeave",["pointerout","pointerover"]),gs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),gs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),gs("onBeforeInput",["compositionend","keypress","textInput","paste"]),gs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),gs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),gs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ao="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(" "),xC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ao));function cv(n,i){i=(i&4)!==0;for(var l=0;l<n.length;l++){var d=n[l],h=d.event;d=d.listeners;e:{var g=void 0;if(i)for(var j=d.length-1;0<=j;j--){var _=d[j],D=_.instance,F=_.currentTarget;if(_=_.listener,D!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=F;try{g(h)}catch(W){$l(W)}h.currentTarget=null,g=D}else for(j=0;j<d.length;j++){if(_=d[j],D=_.instance,F=_.currentTarget,_=_.listener,D!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=F;try{g(h)}catch(W){$l(W)}h.currentTarget=null,g=D}}}}function Ie(n,i){var l=i[ks];l===void 0&&(l=i[ks]=new Set);var d=n+"__bubble";l.has(d)||(uv(i,n,2,!1),l.add(d))}function oh(n,i,l){var d=0;i&&(d|=4),uv(l,n,d,i)}var wc="_reactListening"+Math.random().toString(36).slice(2);function lh(n){if(!n[wc]){n[wc]=!0,ns.forEach(function(l){l!=="selectionchange"&&(xC.has(l)||oh(l,!1,n),oh(l,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[wc]||(i[wc]=!0,oh("selectionchange",!1,i))}}function uv(n,i,l,d){switch(Uv(i)){case 2:var h=ZC;break;case 8:h=VC;break;default:h=wh}l=h.bind(null,i,l,n),h=void 0,!zd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(h=!0),d?h!==void 0?n.addEventListener(i,l,{capture:!0,passive:h}):n.addEventListener(i,l,!0):h!==void 0?n.addEventListener(i,l,{passive:h}):n.addEventListener(i,l,!1)}function ch(n,i,l,d,h){var g=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var j=d.tag;if(j===3||j===4){var _=d.stateNode.containerInfo;if(_===h)break;if(j===4)for(j=d.return;j!==null;){var D=j.tag;if((D===3||D===4)&&j.stateNode.containerInfo===h)return;j=j.return}for(;_!==null;){if(j=Xs(_),j===null)return;if(D=j.tag,D===5||D===6||D===26||D===27){d=g=j;continue e}_=_.parentNode}}d=d.return}pg(function(){var F=g,W=Cd(l),ie=[];e:{var Z=Hg.get(n);if(Z!==void 0){var Y=Ll,ve=n;switch(n){case"keypress":if(Tl(l)===0)break e;case"keydown":case"keyup":Y=f1;break;case"focusin":ve="focus",Y=Ad;break;case"focusout":ve="blur",Y=Ad;break;case"beforeblur":case"afterblur":Y=Ad;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":Y=vg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=e1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=p1;break;case Ug:case Ig:case Bg:Y=s1;break;case qg:Y=y1;break;case"scroll":case"scrollend":Y=XN;break;case"wheel":Y=x1;break;case"copy":case"cut":case"paste":Y=a1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=bg;break;case"toggle":case"beforetoggle":Y=S1}var Ce=(i&4)!==0,ft=!Ce&&(n==="scroll"||n==="scrollend"),q=Ce?Z!==null?Z+"Capture":null:Z;Ce=[];for(var $=F,G;$!==null;){var te=$;if(G=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||G===null||q===null||(te=Xr($,q),te!=null&&Ce.push(To($,te,G))),ft)break;$=$.return}0<Ce.length&&(Z=new Y(Z,ve,null,l,W),ie.push({event:Z,listeners:Ce}))}}if((i&7)===0){e:{if(Z=n==="mouseover"||n==="pointerover",Y=n==="mouseout"||n==="pointerout",Z&&l!==Nd&&(ve=l.relatedTarget||l.fromElement)&&(Xs(ve)||ve[zn]))break e;if((Y||Z)&&(Z=W.window===W?W:(Z=W.ownerDocument)?Z.defaultView||Z.parentWindow:window,Y?(ve=l.relatedTarget||l.toElement,Y=F,ve=ve?Xs(ve):null,ve!==null&&(ft=c(ve),Ce=ve.tag,ve!==ft||Ce!==5&&Ce!==27&&Ce!==6)&&(ve=null)):(Y=null,ve=F),Y!==ve)){if(Ce=vg,te="onMouseLeave",q="onMouseEnter",$="mouse",(n==="pointerout"||n==="pointerover")&&(Ce=bg,te="onPointerLeave",q="onPointerEnter",$="pointer"),ft=Y==null?Z:Me(Y),G=ve==null?Z:Me(ve),Z=new Ce(te,$+"leave",Y,l,W),Z.target=ft,Z.relatedTarget=G,te=null,Xs(W)===F&&(Ce=new Ce(q,$+"enter",ve,l,W),Ce.target=G,Ce.relatedTarget=ft,te=Ce),ft=te,Y&&ve)t:{for(Ce=bC,q=Y,$=ve,G=0,te=q;te;te=Ce(te))G++;te=0;for(var Ne=$;Ne;Ne=Ce(Ne))te++;for(;0<G-te;)q=Ce(q),G--;for(;0<te-G;)$=Ce($),te--;for(;G--;){if(q===$||$!==null&&q===$.alternate){Ce=q;break t}q=Ce(q),$=Ce($)}Ce=null}else Ce=null;Y!==null&&dv(ie,Z,Y,Ce,!1),ve!==null&&ft!==null&&dv(ie,ft,ve,Ce,!0)}}e:{if(Z=F?Me(F):window,Y=Z.nodeName&&Z.nodeName.toLowerCase(),Y==="select"||Y==="input"&&Z.type==="file")var Xe=_g;else if(kg(Z))if(Eg)Xe=A1;else{Xe=E1;var Se=_1}else Y=Z.nodeName,!Y||Y.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?F&&wd(F.elementType)&&(Xe=_g):Xe=R1;if(Xe&&(Xe=Xe(n,F))){zg(ie,Xe,l,W);break e}Se&&Se(n,Z,F),n==="focusout"&&F&&Z.type==="number"&&F.memoizedProps.value!=null&&jd(Z,"number",Z.value)}switch(Se=F?Me(F):window,n){case"focusin":(kg(Se)||Se.contentEditable==="true")&&(Za=Se,$d=F,ro=null);break;case"focusout":ro=$d=Za=null;break;case"mousedown":Pd=!0;break;case"contextmenu":case"mouseup":case"dragend":Pd=!1,$g(ie,l,W);break;case"selectionchange":if(O1)break;case"keydown":case"keyup":$g(ie,l,W)}var Te;if(Od)e:{switch(n){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else Fa?Ng(n,l)&&(He="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(He="onCompositionStart");He&&(Sg&&l.locale!=="ko"&&(Fa||He!=="onCompositionStart"?He==="onCompositionEnd"&&Fa&&(Te=gg()):(ei=W,_d="value"in ei?ei.value:ei.textContent,Fa=!0)),Se=Nc(F,He),0<Se.length&&(He=new xg(He,n,null,l,W),ie.push({event:He,listeners:Se}),Te?He.data=Te:(Te=Cg(l),Te!==null&&(He.data=Te)))),(Te=w1?N1(n,l):C1(n,l))&&(He=Nc(F,"onBeforeInput"),0<He.length&&(Se=new xg("onBeforeInput","beforeinput",null,l,W),ie.push({event:Se,listeners:He}),Se.data=Te)),gC(ie,n,F,l,W)}cv(ie,i)})}function To(n,i,l){return{instance:n,listener:i,currentTarget:l}}function Nc(n,i){for(var l=i+"Capture",d=[];n!==null;){var h=n,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=Xr(n,l),h!=null&&d.unshift(To(n,h,g)),h=Xr(n,i),h!=null&&d.push(To(n,h,g))),n.tag===3)return d;n=n.return}return[]}function bC(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function dv(n,i,l,d,h){for(var g=i._reactName,j=[];l!==null&&l!==d;){var _=l,D=_.alternate,F=_.stateNode;if(_=_.tag,D!==null&&D===d)break;_!==5&&_!==26&&_!==27||F===null||(D=F,h?(F=Xr(l,g),F!=null&&j.unshift(To(l,F,D))):h||(F=Xr(l,g),F!=null&&j.push(To(l,F,D)))),l=l.return}j.length!==0&&n.push({event:i,listeners:j})}var SC=/\r\n?/g,jC=/\u0000|\uFFFD/g;function fv(n){return(typeof n=="string"?n:""+n).replace(SC,`
8
+ `+d.stack}}var _t=Object.prototype.hasOwnProperty,re=e.unstable_scheduleCallback,Ge=e.unstable_cancelCallback,gt=e.unstable_shouldYield,Vt=e.unstable_requestPaint,Qe=e.unstable_now,De=e.unstable_getCurrentPriorityLevel,Ye=e.unstable_ImmediatePriority,Nt=e.unstable_UserBlockingPriority,Be=e.unstable_NormalPriority,Da=e.unstable_LowPriority,pn=e.unstable_IdlePriority,nt=e.log,Yr=e.unstable_setDisableYieldValue,ts=null,ht=null;function gn(n){if(typeof nt=="function"&&Yr(n),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(ts,n)}catch{}}var ce=Math.clz32?Math.clz32:jl,kn=Math.log,Ma=Math.LN2;function jl(n){return n>>>=0,n===0?32:31-(kn(n)/Ma|0)|0}var Ki=256,$a=262144,Cs=4194304;function hs(n){var i=n&42;if(i!==0)return i;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Pa(n,i,l){var d=n.pendingLanes;if(d===0)return 0;var h=0,g=n.suspendedLanes,j=n.pingedLanes;n=n.warmLanes;var _=d&134217727;return _!==0?(d=_&~g,d!==0?h=hs(d):(j&=_,j!==0?h=hs(j):l||(l=_&~n,l!==0&&(h=hs(l))))):(_=d&~g,_!==0?h=hs(_):j!==0?h=hs(j):l||(l=d&~n,l!==0&&(h=hs(l)))),h===0?0:i!==0&&i!==h&&(i&g)===0&&(g=h&-h,l=i&-i,g>=l||g===32&&(l&4194048)!==0)?i:h}function Ys(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function xd(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 wl(){var n=Cs;return Cs<<=1,(Cs&62914560)===0&&(Cs=4194304),n}function Jr(n){for(var i=[],l=0;31>l;l++)i.push(n);return i}function Gi(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Nl(n,i,l,d,h,g){var j=n.pendingLanes;n.pendingLanes=l,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=l,n.entangledLanes&=l,n.errorRecoveryDisabledLanes&=l,n.shellSuspendCounter=0;var _=n.entanglements,D=n.expirationTimes,F=n.hiddenUpdates;for(l=j&~l;0<l;){var W=31-ce(l),ie=1<<W;_[W]=0,D[W]=-1;var Z=F[W];if(Z!==null)for(F[W]=null,W=0;W<Z.length;W++){var Y=Z[W];Y!==null&&(Y.lane&=-536870913)}l&=~ie}d!==0&&I(n,d,0),g!==0&&h===0&&n.tag!==0&&(n.suspendedLanes|=g&~(j&~i))}function I(n,i,l){n.pendingLanes|=i,n.suspendedLanes&=~i;var d=31-ce(i);n.entangledLanes|=i,n.entanglements[d]=n.entanglements[d]|1073741824|l&261930}function he(n,i){var l=n.entangledLanes|=i;for(n=n.entanglements;l;){var d=31-ce(l),h=1<<d;h&i|n[d]&i&&(n[d]|=i),l&=~h}}function xt(n,i){var l=i&-i;return l=(l&42)!==0?1:Ht(l),(l&(n.suspendedLanes|i))!==0?0:l}function Ht(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function ln(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Ua(){var n=ae.p;return n!==0?n:(n=window.event,n===void 0?32:Uv(n.type))}function ms(n,i){var l=ae.p;try{return ae.p=n,i()}finally{ae.p=l}}var cn=Math.random().toString(36).slice(2),st="__reactFiber$"+cn,sn="__reactProps$"+cn,zn="__reactContainer$"+cn,ks="__reactEvents$"+cn,Ia="__reactListeners$"+cn,Cl="__reactHandles$"+cn,kl="__reactResources$"+cn,ps="__reactMarker$"+cn;function Js(n){delete n[st],delete n[sn],delete n[ks],delete n[Ia],delete n[Cl]}function Xs(n){var i=n[st];if(i)return i;for(var l=n.parentNode;l;){if(i=l[zn]||l[st]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(n=wv(n);n!==null;){if(l=n[st])return l;n=wv(n)}return i}n=l,l=n.parentNode}return null}function Ws(n){if(n=n[st]||n[zn]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function Me(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(a(33))}function Je(n){var i=n[kl];return i||(i=n[kl]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function it(n){n[ps]=!0}var ns=new Set,Fi={};function gs(n,i){Ba(n,i),Ba(n+"Capture",i)}function Ba(n,i){for(Fi[n]=i,n=0;n<i.length;n++)ns.add(i[n])}var GN=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]*$"),ag={},rg={};function FN(n){return _t.call(rg,n)?!0:_t.call(ag,n)?!1:GN.test(n)?rg[n]=!0:(ag[n]=!0,!1)}function zl(n,i,l){if(FN(i))if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+l)}}function _l(n,i,l){if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+l)}}function zs(n,i,l,d){if(d===null)n.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(l);return}n.setAttributeNS(i,l,""+d)}}function Mn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function og(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function ZN(n,i,l){var d=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var h=d.get,g=d.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return h.call(this)},set:function(j){l=""+j,g.call(this,j)}}),Object.defineProperty(n,i,{enumerable:d.enumerable}),{getValue:function(){return l},setValue:function(j){l=""+j},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function bd(n){if(!n._valueTracker){var i=og(n)?"checked":"value";n._valueTracker=ZN(n,i,""+n[i])}}function lg(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var l=i.getValue(),d="";return n&&(d=og(n)?n.checked?"true":"false":n.value),n=d,n!==l?(i.setValue(n),!0):!1}function El(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var VN=/[\n"\\]/g;function $n(n){return n.replace(VN,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Sd(n,i,l,d,h,g,j,_){n.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?n.type=j:n.removeAttribute("type"),i!=null?j==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+Mn(i)):n.value!==""+Mn(i)&&(n.value=""+Mn(i)):j!=="submit"&&j!=="reset"||n.removeAttribute("value"),i!=null?jd(n,j,Mn(i)):l!=null?jd(n,j,Mn(l)):d!=null&&n.removeAttribute("value"),h==null&&g!=null&&(n.defaultChecked=!!g),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?n.name=""+Mn(_):n.removeAttribute("name")}function cg(n,i,l,d,h,g,j,_){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),i!=null||l!=null){if(!(g!=="submit"&&g!=="reset"||i!=null)){bd(n);return}l=l!=null?""+Mn(l):"",i=i!=null?""+Mn(i):l,_||i===n.value||(n.value=i),n.defaultValue=i}d=d??h,d=typeof d!="function"&&typeof d!="symbol"&&!!d,n.checked=_?n.checked:!!d,n.defaultChecked=!!d,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(n.name=j),bd(n)}function jd(n,i,l){i==="number"&&El(n.ownerDocument)===n||n.defaultValue===""+l||(n.defaultValue=""+l)}function qa(n,i,l,d){if(n=n.options,i){i={};for(var h=0;h<l.length;h++)i["$"+l[h]]=!0;for(l=0;l<n.length;l++)h=i.hasOwnProperty("$"+n[l].value),n[l].selected!==h&&(n[l].selected=h),h&&d&&(n[l].defaultSelected=!0)}else{for(l=""+Mn(l),i=null,h=0;h<n.length;h++){if(n[h].value===l){n[h].selected=!0,d&&(n[h].defaultSelected=!0);return}i!==null||n[h].disabled||(i=n[h])}i!==null&&(i.selected=!0)}}function ug(n,i,l){if(i!=null&&(i=""+Mn(i),i!==n.value&&(n.value=i),l==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=l!=null?""+Mn(l):""}function dg(n,i,l,d){if(i==null){if(d!=null){if(l!=null)throw Error(a(92));if(je(d)){if(1<d.length)throw Error(a(93));d=d[0]}l=d}l==null&&(l=""),i=l}l=Mn(i),n.defaultValue=l,d=n.textContent,d===l&&d!==""&&d!==null&&(n.value=d),bd(n)}function Ha(n,i){if(i){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=i;return}}n.textContent=i}var QN=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 fg(n,i,l){var d=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?d?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":d?n.setProperty(i,l):typeof l!="number"||l===0||QN.has(i)?i==="float"?n.cssFloat=l:n[i]=(""+l).trim():n[i]=l+"px"}function hg(n,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(n=n.style,l!=null){for(var d in l)!l.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?n.setProperty(d,""):d==="float"?n.cssFloat="":n[d]="");for(var h in i)d=i[h],i.hasOwnProperty(h)&&l[h]!==d&&fg(n,h,d)}else for(var g in i)i.hasOwnProperty(g)&&fg(n,g,i[g])}function wd(n){if(n.indexOf("-")===-1)return!1;switch(n){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 YN=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"]]),JN=/^[\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 Rl(n){return JN.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function _s(){}var Nd=null;function Cd(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Ka=null,Ga=null;function mg(n){var i=Ws(n);if(i&&(n=i.stateNode)){var l=n[sn]||null;e:switch(n=i.stateNode,i.type){case"input":if(Sd(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+$n(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var d=l[i];if(d!==n&&d.form===n.form){var h=d[sn]||null;if(!h)throw Error(a(90));Sd(d,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(i=0;i<l.length;i++)d=l[i],d.form===n.form&&lg(d)}break e;case"textarea":ug(n,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&qa(n,!!l.multiple,i,!1)}}}var kd=!1;function pg(n,i,l){if(kd)return n(i,l);kd=!0;try{var d=n(i);return d}finally{if(kd=!1,(Ka!==null||Ga!==null)&&(yc(),Ka&&(i=Ka,n=Ga,Ga=Ka=null,mg(i),n)))for(i=0;i<n.length;i++)mg(n[i])}}function Xr(n,i){var l=n.stateNode;if(l===null)return null;var d=l[sn]||null;if(d===null)return null;l=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(n=n.type,d=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!d;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(a(231,i,typeof l));return l}var Es=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zd=!1;if(Es)try{var Wr={};Object.defineProperty(Wr,"passive",{get:function(){zd=!0}}),window.addEventListener("test",Wr,Wr),window.removeEventListener("test",Wr,Wr)}catch{zd=!1}var ei=null,_d=null,Al=null;function gg(){if(Al)return Al;var n,i=_d,l=i.length,d,h="value"in ei?ei.value:ei.textContent,g=h.length;for(n=0;n<l&&i[n]===h[n];n++);var j=l-n;for(d=1;d<=j&&i[l-d]===h[g-d];d++);return Al=h.slice(n,1<d?1-d:void 0)}function Tl(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function Ol(){return!0}function yg(){return!1}function yn(n){function i(l,d,h,g,j){this._reactName=l,this._targetInst=h,this.type=d,this.nativeEvent=g,this.target=j,this.currentTarget=null;for(var _ in n)n.hasOwnProperty(_)&&(l=n[_],this[_]=l?l(g):g[_]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Ol:yg,this.isPropagationStopped=yg,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ol)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ol)},persist:function(){},isPersistent:Ol}),i}var Zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ll=yn(Zi),eo=y({},Zi,{view:0,detail:0}),XN=yn(eo),Ed,Rd,to,Dl=y({},eo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Td,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==to&&(to&&n.type==="mousemove"?(Ed=n.screenX-to.screenX,Rd=n.screenY-to.screenY):Rd=Ed=0,to=n),Ed)},movementY:function(n){return"movementY"in n?n.movementY:Rd}}),vg=yn(Dl),WN=y({},Dl,{dataTransfer:0}),e1=yn(WN),t1=y({},eo,{relatedTarget:0}),Ad=yn(t1),n1=y({},Zi,{animationName:0,elapsedTime:0,pseudoElement:0}),s1=yn(n1),i1=y({},Zi,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),a1=yn(i1),r1=y({},Zi,{data:0}),xg=yn(r1),o1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},l1={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"},c1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function u1(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=c1[n])?!!i[n]:!1}function Td(){return u1}var d1=y({},eo,{key:function(n){if(n.key){var i=o1[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=Tl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?l1[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Td,charCode:function(n){return n.type==="keypress"?Tl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Tl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),f1=yn(d1),h1=y({},Dl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bg=yn(h1),m1=y({},eo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Td}),p1=yn(m1),g1=y({},Zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),y1=yn(g1),v1=y({},Dl,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),x1=yn(v1),b1=y({},Zi,{newState:0,oldState:0}),S1=yn(b1),j1=[9,13,27,32],Od=Es&&"CompositionEvent"in window,no=null;Es&&"documentMode"in document&&(no=document.documentMode);var w1=Es&&"TextEvent"in window&&!no,Sg=Es&&(!Od||no&&8<no&&11>=no),jg=" ",wg=!1;function Ng(n,i){switch(n){case"keyup":return j1.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Fa=!1;function N1(n,i){switch(n){case"compositionend":return Cg(i);case"keypress":return i.which!==32?null:(wg=!0,jg);case"textInput":return n=i.data,n===jg&&wg?null:n;default:return null}}function C1(n,i){if(Fa)return n==="compositionend"||!Od&&Ng(n,i)?(n=gg(),Al=_d=ei=null,Fa=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Sg&&i.locale!=="ko"?null:i.data;default:return null}}var k1={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 kg(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!k1[n.type]:i==="textarea"}function zg(n,i,l,d){Ka?Ga?Ga.push(d):Ga=[d]:Ka=d,i=Nc(i,"onChange"),0<i.length&&(l=new Ll("onChange","change",null,l,d),n.push({event:l,listeners:i}))}var so=null,io=null;function z1(n){cv(n,0)}function Ml(n){var i=Me(n);if(lg(i))return n}function _g(n,i){if(n==="change")return i}var Eg=!1;if(Es){var Ld;if(Es){var Dd="oninput"in document;if(!Dd){var Rg=document.createElement("div");Rg.setAttribute("oninput","return;"),Dd=typeof Rg.oninput=="function"}Ld=Dd}else Ld=!1;Eg=Ld&&(!document.documentMode||9<document.documentMode)}function Ag(){so&&(so.detachEvent("onpropertychange",Tg),io=so=null)}function Tg(n){if(n.propertyName==="value"&&Ml(io)){var i=[];zg(i,io,n,Cd(n)),pg(z1,i)}}function _1(n,i,l){n==="focusin"?(Ag(),so=i,io=l,so.attachEvent("onpropertychange",Tg)):n==="focusout"&&Ag()}function E1(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Ml(io)}function R1(n,i){if(n==="click")return Ml(i)}function A1(n,i){if(n==="input"||n==="change")return Ml(i)}function T1(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var _n=typeof Object.is=="function"?Object.is:T1;function ao(n,i){if(_n(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var l=Object.keys(n),d=Object.keys(i);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var h=l[d];if(!_t.call(i,h)||!_n(n[h],i[h]))return!1}return!0}function Og(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Lg(n,i){var l=Og(n);n=0;for(var d;l;){if(l.nodeType===3){if(d=n+l.textContent.length,n<=i&&d>=i)return{node:l,offset:i-n};n=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Og(l)}}function Dg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Dg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function Mg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=El(n.document);i instanceof n.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)n=i.contentWindow;else break;i=El(n.document)}return i}function Md(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var O1=Es&&"documentMode"in document&&11>=document.documentMode,Za=null,$d=null,ro=null,Pd=!1;function $g(n,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Pd||Za==null||Za!==El(d)||(d=Za,"selectionStart"in d&&Md(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),ro&&ao(ro,d)||(ro=d,d=Nc($d,"onSelect"),0<d.length&&(i=new Ll("onSelect","select",null,i,l),n.push({event:i,listeners:d}),i.target=Za)))}function Vi(n,i){var l={};return l[n.toLowerCase()]=i.toLowerCase(),l["Webkit"+n]="webkit"+i,l["Moz"+n]="moz"+i,l}var Va={animationend:Vi("Animation","AnimationEnd"),animationiteration:Vi("Animation","AnimationIteration"),animationstart:Vi("Animation","AnimationStart"),transitionrun:Vi("Transition","TransitionRun"),transitionstart:Vi("Transition","TransitionStart"),transitioncancel:Vi("Transition","TransitionCancel"),transitionend:Vi("Transition","TransitionEnd")},Ud={},Pg={};Es&&(Pg=document.createElement("div").style,"AnimationEvent"in window||(delete Va.animationend.animation,delete Va.animationiteration.animation,delete Va.animationstart.animation),"TransitionEvent"in window||delete Va.transitionend.transition);function Qi(n){if(Ud[n])return Ud[n];if(!Va[n])return n;var i=Va[n],l;for(l in i)if(i.hasOwnProperty(l)&&l in Pg)return Ud[n]=i[l];return n}var Ug=Qi("animationend"),Ig=Qi("animationiteration"),Bg=Qi("animationstart"),L1=Qi("transitionrun"),D1=Qi("transitionstart"),M1=Qi("transitioncancel"),qg=Qi("transitionend"),Hg=new Map,Id="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(" ");Id.push("scrollEnd");function ss(n,i){Hg.set(n,i),gs(i,[n])}var $l=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Pn=[],Qa=0,Bd=0;function Pl(){for(var n=Qa,i=Bd=Qa=0;i<n;){var l=Pn[i];Pn[i++]=null;var d=Pn[i];Pn[i++]=null;var h=Pn[i];Pn[i++]=null;var g=Pn[i];if(Pn[i++]=null,d!==null&&h!==null){var j=d.pending;j===null?h.next=h:(h.next=j.next,j.next=h),d.pending=h}g!==0&&Kg(l,h,g)}}function Ul(n,i,l,d){Pn[Qa++]=n,Pn[Qa++]=i,Pn[Qa++]=l,Pn[Qa++]=d,Bd|=d,n.lanes|=d,n=n.alternate,n!==null&&(n.lanes|=d)}function qd(n,i,l,d){return Ul(n,i,l,d),Il(n)}function Yi(n,i){return Ul(n,null,null,i),Il(n)}function Kg(n,i,l){n.lanes|=l;var d=n.alternate;d!==null&&(d.lanes|=l);for(var h=!1,g=n.return;g!==null;)g.childLanes|=l,d=g.alternate,d!==null&&(d.childLanes|=l),g.tag===22&&(n=g.stateNode,n===null||n._visibility&1||(h=!0)),n=g,g=g.return;return n.tag===3?(g=n.stateNode,h&&i!==null&&(h=31-ce(l),n=g.hiddenUpdates,d=n[h],d===null?n[h]=[i]:d.push(i),i.lane=l|536870912),g):null}function Il(n){if(50<Eo)throw Eo=0,Xf=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Ya={};function $1(n,i,l,d){this.tag=n,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=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function En(n,i,l,d){return new $1(n,i,l,d)}function Hd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Rs(n,i){var l=n.alternate;return l===null?(l=En(n.tag,i,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=i,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&65011712,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,i=n.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l.refCleanup=n.refCleanup,l}function Gg(n,i){n.flags&=65011714;var l=n.alternate;return l===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,i=l.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function Bl(n,i,l,d,h,g){var j=0;if(d=n,typeof n=="function")Hd(n)&&(j=1);else if(typeof n=="string")j=qC(n,l,le.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case U:return n=En(31,l,i,h),n.elementType=U,n.lanes=g,n;case S:return Ji(l.children,h,g,i);case C:j=8,h|=24;break;case k:return n=En(12,l,i,h|2),n.elementType=k,n.lanes=g,n;case O:return n=En(13,l,i,h),n.elementType=O,n.lanes=g,n;case M:return n=En(19,l,i,h),n.elementType=M,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case R:j=10;break e;case A:j=9;break e;case z:j=11;break e;case E:j=14;break e;case L:j=16,d=null;break e}j=29,l=Error(a(130,n===null?"null":typeof n,"")),d=null}return i=En(j,l,i,h),i.elementType=n,i.type=d,i.lanes=g,i}function Ji(n,i,l,d){return n=En(7,n,d,i),n.lanes=l,n}function Kd(n,i,l){return n=En(6,n,null,i),n.lanes=l,n}function Fg(n){var i=En(18,null,null,0);return i.stateNode=n,i}function Gd(n,i,l){return i=En(4,n.children!==null?n.children:[],n.key,i),i.lanes=l,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var Zg=new WeakMap;function Un(n,i){if(typeof n=="object"&&n!==null){var l=Zg.get(n);return l!==void 0?l:(i={value:n,source:i,stack:nn(i)},Zg.set(n,i),i)}return{value:n,source:i,stack:nn(i)}}var Ja=[],Xa=0,ql=null,oo=0,In=[],Bn=0,ti=null,ys=1,vs="";function As(n,i){Ja[Xa++]=oo,Ja[Xa++]=ql,ql=n,oo=i}function Vg(n,i,l){In[Bn++]=ys,In[Bn++]=vs,In[Bn++]=ti,ti=n;var d=ys;n=vs;var h=32-ce(d)-1;d&=~(1<<h),l+=1;var g=32-ce(i)+h;if(30<g){var j=h-h%5;g=(d&(1<<j)-1).toString(32),d>>=j,h-=j,ys=1<<32-ce(i)+h|l<<h|d,vs=g+n}else ys=1<<g|l<<h|d,vs=n}function Fd(n){n.return!==null&&(As(n,1),Vg(n,1,0))}function Zd(n){for(;n===ql;)ql=Ja[--Xa],Ja[Xa]=null,oo=Ja[--Xa],Ja[Xa]=null;for(;n===ti;)ti=In[--Bn],In[Bn]=null,vs=In[--Bn],In[Bn]=null,ys=In[--Bn],In[Bn]=null}function Qg(n,i){In[Bn++]=ys,In[Bn++]=vs,In[Bn++]=ti,ys=i.id,vs=i.overflow,ti=n}var Yt=null,yt=null,Fe=!1,ni=null,qn=!1,Vd=Error(a(519));function si(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw lo(Un(i,n)),Vd}function Yg(n){var i=n.stateNode,l=n.type,d=n.memoizedProps;switch(i[st]=n,i[sn]=d,l){case"dialog":Ie("cancel",i),Ie("close",i);break;case"iframe":case"object":case"embed":Ie("load",i);break;case"video":case"audio":for(l=0;l<Ao.length;l++)Ie(Ao[l],i);break;case"source":Ie("error",i);break;case"img":case"image":case"link":Ie("error",i),Ie("load",i);break;case"details":Ie("toggle",i);break;case"input":Ie("invalid",i),cg(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Ie("invalid",i);break;case"textarea":Ie("invalid",i),dg(i,d.value,d.defaultValue,d.children)}l=d.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||d.suppressHydrationWarning===!0||hv(i.textContent,l)?(d.popover!=null&&(Ie("beforetoggle",i),Ie("toggle",i)),d.onScroll!=null&&Ie("scroll",i),d.onScrollEnd!=null&&Ie("scrollend",i),d.onClick!=null&&(i.onclick=_s),i=!0):i=!1,i||si(n,!0)}function Jg(n){for(Yt=n.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:qn=!1;return;case 27:case 3:qn=!0;return;default:Yt=Yt.return}}function Wa(n){if(n!==Yt)return!1;if(!Fe)return Jg(n),Fe=!0,!1;var i=n.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=n.type,l=!(l!=="form"&&l!=="button")||hh(n.type,n.memoizedProps)),l=!l),l&&yt&&si(n),Jg(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));yt=jv(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));yt=jv(n)}else i===27?(i=yt,yi(n.type)?(n=vh,vh=null,yt=n):yt=i):yt=Yt?Kn(n.stateNode.nextSibling):null;return!0}function Xi(){yt=Yt=null,Fe=!1}function Qd(){var n=ni;return n!==null&&(Sn===null?Sn=n:Sn.push.apply(Sn,n),ni=null),n}function lo(n){ni===null?ni=[n]:ni.push(n)}var Yd=T(null),Wi=null,Ts=null;function ii(n,i,l){se(Yd,i._currentValue),i._currentValue=l}function Os(n){n._currentValue=Yd.current,B(Yd)}function Jd(n,i,l){for(;n!==null;){var d=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),n===l)break;n=n.return}}function Xd(n,i,l,d){var h=n.child;for(h!==null&&(h.return=n);h!==null;){var g=h.dependencies;if(g!==null){var j=h.child;g=g.firstContext;e:for(;g!==null;){var _=g;g=h;for(var D=0;D<i.length;D++)if(_.context===i[D]){g.lanes|=l,_=g.alternate,_!==null&&(_.lanes|=l),Jd(g.return,l,n),d||(j=null);break e}g=_.next}}else if(h.tag===18){if(j=h.return,j===null)throw Error(a(341));j.lanes|=l,g=j.alternate,g!==null&&(g.lanes|=l),Jd(j,l,n),j=null}else j=h.child;if(j!==null)j.return=h;else for(j=h;j!==null;){if(j===n){j=null;break}if(h=j.sibling,h!==null){h.return=j.return,j=h;break}j=j.return}h=j}}function er(n,i,l,d){n=null;for(var h=i,g=!1;h!==null;){if(!g){if((h.flags&524288)!==0)g=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var j=h.alternate;if(j===null)throw Error(a(387));if(j=j.memoizedProps,j!==null){var _=h.type;_n(h.pendingProps.value,j.value)||(n!==null?n.push(_):n=[_])}}else if(h===ye.current){if(j=h.alternate,j===null)throw Error(a(387));j.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(Mo):n=[Mo])}h=h.return}n!==null&&Xd(i,n,l,d),i.flags|=262144}function Hl(n){for(n=n.firstContext;n!==null;){if(!_n(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function ea(n){Wi=n,Ts=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Jt(n){return Xg(Wi,n)}function Kl(n,i){return Wi===null&&ea(n),Xg(n,i)}function Xg(n,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},Ts===null){if(n===null)throw Error(a(308));Ts=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else Ts=Ts.next=i;return l}var P1=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(l,d){n.push(d)}};this.abort=function(){i.aborted=!0,n.forEach(function(l){return l()})}},U1=e.unstable_scheduleCallback,I1=e.unstable_NormalPriority,Pt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Wd(){return{controller:new P1,data:new Map,refCount:0}}function co(n){n.refCount--,n.refCount===0&&U1(I1,function(){n.controller.abort()})}var uo=null,ef=0,tr=0,nr=null;function B1(n,i){if(uo===null){var l=uo=[];ef=0,tr=ih(),nr={status:"pending",value:void 0,then:function(d){l.push(d)}}}return ef++,i.then(Wg,Wg),i}function Wg(){if(--ef===0&&uo!==null){nr!==null&&(nr.status="fulfilled");var n=uo;uo=null,tr=0,nr=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function q1(n,i){var l=[],d={status:"pending",value:null,reason:null,then:function(h){l.push(h)}};return n.then(function(){d.status="fulfilled",d.value=i;for(var h=0;h<l.length;h++)(0,l[h])(i)},function(h){for(d.status="rejected",d.reason=h,h=0;h<l.length;h++)(0,l[h])(void 0)}),d}var ey=K.S;K.S=function(n,i){$0=Qe(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&B1(n,i),ey!==null&&ey(n,i)};var ta=T(null);function tf(){var n=ta.current;return n!==null?n:mt.pooledCache}function Gl(n,i){i===null?se(ta,ta.current):se(ta,i.pool)}function ty(){var n=tf();return n===null?null:{parent:Pt._currentValue,pool:n}}var sr=Error(a(460)),nf=Error(a(474)),Fl=Error(a(542)),Zl={then:function(){}};function ny(n){return n=n.status,n==="fulfilled"||n==="rejected"}function sy(n,i,l){switch(l=n[l],l===void 0?n.push(i):l!==i&&(i.then(_s,_s),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,ay(n),n;default:if(typeof i.status=="string")i.then(_s,_s);else{if(n=mt,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=i,n.status="pending",n.then(function(d){if(i.status==="pending"){var h=i;h.status="fulfilled",h.value=d}},function(d){if(i.status==="pending"){var h=i;h.status="rejected",h.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,ay(n),n}throw sa=i,sr}}function na(n){try{var i=n._init;return i(n._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(sa=l,sr):l}}var sa=null;function iy(){if(sa===null)throw Error(a(459));var n=sa;return sa=null,n}function ay(n){if(n===sr||n===Fl)throw Error(a(483))}var ir=null,fo=0;function Vl(n){var i=fo;return fo+=1,ir===null&&(ir=[]),sy(ir,n,i)}function ho(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function Ql(n,i){throw i.$$typeof===x?Error(a(525)):(n=Object.prototype.toString.call(i),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function ry(n){function i(q,$){if(n){var G=q.deletions;G===null?(q.deletions=[$],q.flags|=16):G.push($)}}function l(q,$){if(!n)return null;for(;$!==null;)i(q,$),$=$.sibling;return null}function d(q){for(var $=new Map;q!==null;)q.key!==null?$.set(q.key,q):$.set(q.index,q),q=q.sibling;return $}function h(q,$){return q=Rs(q,$),q.index=0,q.sibling=null,q}function g(q,$,G){return q.index=G,n?(G=q.alternate,G!==null?(G=G.index,G<$?(q.flags|=67108866,$):G):(q.flags|=67108866,$)):(q.flags|=1048576,$)}function j(q){return n&&q.alternate===null&&(q.flags|=67108866),q}function _(q,$,G,te){return $===null||$.tag!==6?($=Kd(G,q.mode,te),$.return=q,$):($=h($,G),$.return=q,$)}function D(q,$,G,te){var Ne=G.type;return Ne===S?W(q,$,G.props.children,te,G.key):$!==null&&($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===L&&na(Ne)===$.type)?($=h($,G.props),ho($,G),$.return=q,$):($=Bl(G.type,G.key,G.props,null,q.mode,te),ho($,G),$.return=q,$)}function F(q,$,G,te){return $===null||$.tag!==4||$.stateNode.containerInfo!==G.containerInfo||$.stateNode.implementation!==G.implementation?($=Gd(G,q.mode,te),$.return=q,$):($=h($,G.children||[]),$.return=q,$)}function W(q,$,G,te,Ne){return $===null||$.tag!==7?($=Ji(G,q.mode,te,Ne),$.return=q,$):($=h($,G),$.return=q,$)}function ie(q,$,G){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Kd(""+$,q.mode,G),$.return=q,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case b:return G=Bl($.type,$.key,$.props,null,q.mode,G),ho(G,$),G.return=q,G;case N:return $=Gd($,q.mode,G),$.return=q,$;case L:return $=na($),ie(q,$,G)}if(je($)||ee($))return $=Ji($,q.mode,G,null),$.return=q,$;if(typeof $.then=="function")return ie(q,Vl($),G);if($.$$typeof===R)return ie(q,Kl(q,$),G);Ql(q,$)}return null}function Z(q,$,G,te){var Ne=$!==null?$.key:null;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return Ne!==null?null:_(q,$,""+G,te);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case b:return G.key===Ne?D(q,$,G,te):null;case N:return G.key===Ne?F(q,$,G,te):null;case L:return G=na(G),Z(q,$,G,te)}if(je(G)||ee(G))return Ne!==null?null:W(q,$,G,te,null);if(typeof G.then=="function")return Z(q,$,Vl(G),te);if(G.$$typeof===R)return Z(q,$,Kl(q,G),te);Ql(q,G)}return null}function Y(q,$,G,te,Ne){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return q=q.get(G)||null,_($,q,""+te,Ne);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case b:return q=q.get(te.key===null?G:te.key)||null,D($,q,te,Ne);case N:return q=q.get(te.key===null?G:te.key)||null,F($,q,te,Ne);case L:return te=na(te),Y(q,$,G,te,Ne)}if(je(te)||ee(te))return q=q.get(G)||null,W($,q,te,Ne,null);if(typeof te.then=="function")return Y(q,$,G,Vl(te),Ne);if(te.$$typeof===R)return Y(q,$,G,Kl($,te),Ne);Ql($,te)}return null}function ve(q,$,G,te){for(var Ne=null,Xe=null,Se=$,Oe=$=0,He=null;Se!==null&&Oe<G.length;Oe++){Se.index>Oe?(He=Se,Se=null):He=Se.sibling;var We=Z(q,Se,G[Oe],te);if(We===null){Se===null&&(Se=He);break}n&&Se&&We.alternate===null&&i(q,Se),$=g(We,$,Oe),Xe===null?Ne=We:Xe.sibling=We,Xe=We,Se=He}if(Oe===G.length)return l(q,Se),Fe&&As(q,Oe),Ne;if(Se===null){for(;Oe<G.length;Oe++)Se=ie(q,G[Oe],te),Se!==null&&($=g(Se,$,Oe),Xe===null?Ne=Se:Xe.sibling=Se,Xe=Se);return Fe&&As(q,Oe),Ne}for(Se=d(Se);Oe<G.length;Oe++)He=Y(Se,q,Oe,G[Oe],te),He!==null&&(n&&He.alternate!==null&&Se.delete(He.key===null?Oe:He.key),$=g(He,$,Oe),Xe===null?Ne=He:Xe.sibling=He,Xe=He);return n&&Se.forEach(function(ji){return i(q,ji)}),Fe&&As(q,Oe),Ne}function Ce(q,$,G,te){if(G==null)throw Error(a(151));for(var Ne=null,Xe=null,Se=$,Oe=$=0,He=null,We=G.next();Se!==null&&!We.done;Oe++,We=G.next()){Se.index>Oe?(He=Se,Se=null):He=Se.sibling;var ji=Z(q,Se,We.value,te);if(ji===null){Se===null&&(Se=He);break}n&&Se&&ji.alternate===null&&i(q,Se),$=g(ji,$,Oe),Xe===null?Ne=ji:Xe.sibling=ji,Xe=ji,Se=He}if(We.done)return l(q,Se),Fe&&As(q,Oe),Ne;if(Se===null){for(;!We.done;Oe++,We=G.next())We=ie(q,We.value,te),We!==null&&($=g(We,$,Oe),Xe===null?Ne=We:Xe.sibling=We,Xe=We);return Fe&&As(q,Oe),Ne}for(Se=d(Se);!We.done;Oe++,We=G.next())We=Y(Se,q,Oe,We.value,te),We!==null&&(n&&We.alternate!==null&&Se.delete(We.key===null?Oe:We.key),$=g(We,$,Oe),Xe===null?Ne=We:Xe.sibling=We,Xe=We);return n&&Se.forEach(function(WC){return i(q,WC)}),Fe&&As(q,Oe),Ne}function ft(q,$,G,te){if(typeof G=="object"&&G!==null&&G.type===S&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case b:e:{for(var Ne=G.key;$!==null;){if($.key===Ne){if(Ne=G.type,Ne===S){if($.tag===7){l(q,$.sibling),te=h($,G.props.children),te.return=q,q=te;break e}}else if($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===L&&na(Ne)===$.type){l(q,$.sibling),te=h($,G.props),ho(te,G),te.return=q,q=te;break e}l(q,$);break}else i(q,$);$=$.sibling}G.type===S?(te=Ji(G.props.children,q.mode,te,G.key),te.return=q,q=te):(te=Bl(G.type,G.key,G.props,null,q.mode,te),ho(te,G),te.return=q,q=te)}return j(q);case N:e:{for(Ne=G.key;$!==null;){if($.key===Ne)if($.tag===4&&$.stateNode.containerInfo===G.containerInfo&&$.stateNode.implementation===G.implementation){l(q,$.sibling),te=h($,G.children||[]),te.return=q,q=te;break e}else{l(q,$);break}else i(q,$);$=$.sibling}te=Gd(G,q.mode,te),te.return=q,q=te}return j(q);case L:return G=na(G),ft(q,$,G,te)}if(je(G))return ve(q,$,G,te);if(ee(G)){if(Ne=ee(G),typeof Ne!="function")throw Error(a(150));return G=Ne.call(G),Ce(q,$,G,te)}if(typeof G.then=="function")return ft(q,$,Vl(G),te);if(G.$$typeof===R)return ft(q,$,Kl(q,G),te);Ql(q,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,$!==null&&$.tag===6?(l(q,$.sibling),te=h($,G),te.return=q,q=te):(l(q,$),te=Kd(G,q.mode,te),te.return=q,q=te),j(q)):l(q,$)}return function(q,$,G,te){try{fo=0;var Ne=ft(q,$,G,te);return ir=null,Ne}catch(Se){if(Se===sr||Se===Fl)throw Se;var Xe=En(29,Se,null,q.mode);return Xe.lanes=te,Xe.return=q,Xe}}}var ia=ry(!0),oy=ry(!1),ai=!1;function sf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function af(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function ri(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function oi(n,i,l){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(tt&2)!==0){var h=d.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),d.pending=i,i=Il(n),Kg(n,null,l),i}return Ul(n,d,i,l),Il(n)}function mo(n,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var d=i.lanes;d&=n.pendingLanes,l|=d,i.lanes=l,he(n,l)}}function rf(n,i){var l=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var h=null,g=null;if(l=l.firstBaseUpdate,l!==null){do{var j={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};g===null?h=g=j:g=g.next=j,l=l.next}while(l!==null);g===null?h=g=i:g=g.next=i}else h=g=i;l={baseState:d.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:d.shared,callbacks:d.callbacks},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=i:n.next=i,l.lastBaseUpdate=i}var of=!1;function po(){if(of){var n=nr;if(n!==null)throw n}}function go(n,i,l,d){of=!1;var h=n.updateQueue;ai=!1;var g=h.firstBaseUpdate,j=h.lastBaseUpdate,_=h.shared.pending;if(_!==null){h.shared.pending=null;var D=_,F=D.next;D.next=null,j===null?g=F:j.next=F,j=D;var W=n.alternate;W!==null&&(W=W.updateQueue,_=W.lastBaseUpdate,_!==j&&(_===null?W.firstBaseUpdate=F:_.next=F,W.lastBaseUpdate=D))}if(g!==null){var ie=h.baseState;j=0,W=F=D=null,_=g;do{var Z=_.lane&-536870913,Y=Z!==_.lane;if(Y?(qe&Z)===Z:(d&Z)===Z){Z!==0&&Z===tr&&(of=!0),W!==null&&(W=W.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ve=n,Ce=_;Z=i;var ft=l;switch(Ce.tag){case 1:if(ve=Ce.payload,typeof ve=="function"){ie=ve.call(ft,ie,Z);break e}ie=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Ce.payload,Z=typeof ve=="function"?ve.call(ft,ie,Z):ve,Z==null)break e;ie=y({},ie,Z);break e;case 2:ai=!0}}Z=_.callback,Z!==null&&(n.flags|=64,Y&&(n.flags|=8192),Y=h.callbacks,Y===null?h.callbacks=[Z]:Y.push(Z))}else Y={lane:Z,tag:_.tag,payload:_.payload,callback:_.callback,next:null},W===null?(F=W=Y,D=ie):W=W.next=Y,j|=Z;if(_=_.next,_===null){if(_=h.shared.pending,_===null)break;Y=_,_=Y.next,Y.next=null,h.lastBaseUpdate=Y,h.shared.pending=null}}while(!0);W===null&&(D=ie),h.baseState=D,h.firstBaseUpdate=F,h.lastBaseUpdate=W,g===null&&(h.shared.lanes=0),fi|=j,n.lanes=j,n.memoizedState=ie}}function ly(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function cy(n,i){var l=n.callbacks;if(l!==null)for(n.callbacks=null,n=0;n<l.length;n++)ly(l[n],i)}var ar=T(null),Yl=T(0);function uy(n,i){n=qs,se(Yl,n),se(ar,i),qs=n|i.baseLanes}function lf(){se(Yl,qs),se(ar,ar.current)}function cf(){qs=Yl.current,B(ar),B(Yl)}var Rn=T(null),Hn=null;function li(n){var i=n.alternate;se(Tt,Tt.current&1),se(Rn,n),Hn===null&&(i===null||ar.current!==null||i.memoizedState!==null)&&(Hn=n)}function uf(n){se(Tt,Tt.current),se(Rn,n),Hn===null&&(Hn=n)}function dy(n){n.tag===22?(se(Tt,Tt.current),se(Rn,n),Hn===null&&(Hn=n)):ci()}function ci(){se(Tt,Tt.current),se(Rn,Rn.current)}function An(n){B(Rn),Hn===n&&(Hn=null),B(Tt)}var Tt=T(0);function Jl(n){for(var i=n;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||gh(l)||yh(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Ls=0,Ae=null,ut=null,Ut=null,Xl=!1,rr=!1,aa=!1,Wl=0,yo=0,or=null,H1=0;function Et(){throw Error(a(321))}function df(n,i){if(i===null)return!1;for(var l=0;l<i.length&&l<n.length;l++)if(!_n(n[l],i[l]))return!1;return!0}function ff(n,i,l,d,h,g){return Ls=g,Ae=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,K.H=n===null||n.memoizedState===null?Vy:zf,aa=!1,g=l(d,h),aa=!1,rr&&(g=hy(i,l,d,h)),fy(n),g}function fy(n){K.H=bo;var i=ut!==null&&ut.next!==null;if(Ls=0,Ut=ut=Ae=null,Xl=!1,yo=0,or=null,i)throw Error(a(300));n===null||It||(n=n.dependencies,n!==null&&Hl(n)&&(It=!0))}function hy(n,i,l,d){Ae=n;var h=0;do{if(rr&&(or=null),yo=0,rr=!1,25<=h)throw Error(a(301));if(h+=1,Ut=ut=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}K.H=Qy,g=i(l,d)}while(rr);return g}function K1(){var n=K.H,i=n.useState()[0];return i=typeof i.then=="function"?vo(i):i,n=n.useState()[0],(ut!==null?ut.memoizedState:null)!==n&&(Ae.flags|=1024),i}function hf(){var n=Wl!==0;return Wl=0,n}function mf(n,i,l){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~l}function pf(n){if(Xl){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Xl=!1}Ls=0,Ut=ut=Ae=null,rr=!1,yo=Wl=0,or=null}function un(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Ae.memoizedState=Ut=n:Ut=Ut.next=n,Ut}function Ot(){if(ut===null){var n=Ae.alternate;n=n!==null?n.memoizedState:null}else n=ut.next;var i=Ut===null?Ae.memoizedState:Ut.next;if(i!==null)Ut=i,ut=n;else{if(n===null)throw Ae.alternate===null?Error(a(467)):Error(a(310));ut=n,n={memoizedState:ut.memoizedState,baseState:ut.baseState,baseQueue:ut.baseQueue,queue:ut.queue,next:null},Ut===null?Ae.memoizedState=Ut=n:Ut=Ut.next=n}return Ut}function ec(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vo(n){var i=yo;return yo+=1,or===null&&(or=[]),n=sy(or,n,i),i=Ae,(Ut===null?i.memoizedState:Ut.next)===null&&(i=i.alternate,K.H=i===null||i.memoizedState===null?Vy:zf),n}function tc(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return vo(n);if(n.$$typeof===R)return Jt(n)}throw Error(a(438,String(n)))}function gf(n){var i=null,l=Ae.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var d=Ae.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(h){return h.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=ec(),Ae.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(n),d=0;d<n;d++)l[d]=X;return i.index++,l}function Ds(n,i){return typeof i=="function"?i(n):i}function nc(n){var i=Ot();return yf(i,ut,n)}function yf(n,i,l){var d=n.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=l;var h=n.baseQueue,g=d.pending;if(g!==null){if(h!==null){var j=h.next;h.next=g.next,g.next=j}i.baseQueue=h=g,d.pending=null}if(g=n.baseState,h===null)n.memoizedState=g;else{i=h.next;var _=j=null,D=null,F=i,W=!1;do{var ie=F.lane&-536870913;if(ie!==F.lane?(qe&ie)===ie:(Ls&ie)===ie){var Z=F.revertLane;if(Z===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),ie===tr&&(W=!0);else if((Ls&Z)===Z){F=F.next,Z===tr&&(W=!0);continue}else ie={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(_=D=ie,j=g):D=D.next=ie,Ae.lanes|=Z,fi|=Z;ie=F.action,aa&&l(g,ie),g=F.hasEagerState?F.eagerState:l(g,ie)}else Z={lane:ie,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(_=D=Z,j=g):D=D.next=Z,Ae.lanes|=ie,fi|=ie;F=F.next}while(F!==null&&F!==i);if(D===null?j=g:D.next=_,!_n(g,n.memoizedState)&&(It=!0,W&&(l=nr,l!==null)))throw l;n.memoizedState=g,n.baseState=j,n.baseQueue=D,d.lastRenderedState=g}return h===null&&(d.lanes=0),[n.memoizedState,d.dispatch]}function vf(n){var i=Ot(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=n;var d=l.dispatch,h=l.pending,g=i.memoizedState;if(h!==null){l.pending=null;var j=h=h.next;do g=n(g,j.action),j=j.next;while(j!==h);_n(g,i.memoizedState)||(It=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),l.lastRenderedState=g}return[g,d]}function my(n,i,l){var d=Ae,h=Ot(),g=Fe;if(g){if(l===void 0)throw Error(a(407));l=l()}else l=i();var j=!_n((ut||h).memoizedState,l);if(j&&(h.memoizedState=l,It=!0),h=h.queue,Sf(yy.bind(null,d,h,n),[n]),h.getSnapshot!==i||j||Ut!==null&&Ut.memoizedState.tag&1){if(d.flags|=2048,lr(9,{destroy:void 0},gy.bind(null,d,h,l,i),null),mt===null)throw Error(a(349));g||(Ls&127)!==0||py(d,i,l)}return l}function py(n,i,l){n.flags|=16384,n={getSnapshot:i,value:l},i=Ae.updateQueue,i===null?(i=ec(),Ae.updateQueue=i,i.stores=[n]):(l=i.stores,l===null?i.stores=[n]:l.push(n))}function gy(n,i,l,d){i.value=l,i.getSnapshot=d,vy(i)&&xy(n)}function yy(n,i,l){return l(function(){vy(i)&&xy(n)})}function vy(n){var i=n.getSnapshot;n=n.value;try{var l=i();return!_n(n,l)}catch{return!0}}function xy(n){var i=Yi(n,2);i!==null&&jn(i,n,2)}function xf(n){var i=un();if(typeof n=="function"){var l=n;if(n=l(),aa){gn(!0);try{l()}finally{gn(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:n},i}function by(n,i,l,d){return n.baseState=l,yf(n,ut,typeof d=="function"?d:Ds)}function G1(n,i,l,d,h){if(ac(n))throw Error(a(485));if(n=i.action,n!==null){var g={payload:h,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){g.listeners.push(j)}};K.T!==null?l(!0):g.isTransition=!1,d(g),l=i.pending,l===null?(g.next=i.pending=g,Sy(i,g)):(g.next=l.next,i.pending=l.next=g)}}function Sy(n,i){var l=i.action,d=i.payload,h=n.state;if(i.isTransition){var g=K.T,j={};K.T=j;try{var _=l(h,d),D=K.S;D!==null&&D(j,_),jy(n,i,_)}catch(F){bf(n,i,F)}finally{g!==null&&j.types!==null&&(g.types=j.types),K.T=g}}else try{g=l(h,d),jy(n,i,g)}catch(F){bf(n,i,F)}}function jy(n,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(d){wy(n,i,d)},function(d){return bf(n,i,d)}):wy(n,i,l)}function wy(n,i,l){i.status="fulfilled",i.value=l,Ny(i),n.state=l,i=n.pending,i!==null&&(l=i.next,l===i?n.pending=null:(l=l.next,i.next=l,Sy(n,l)))}function bf(n,i,l){var d=n.pending;if(n.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=l,Ny(i),i=i.next;while(i!==d)}n.action=null}function Ny(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function Cy(n,i){return i}function ky(n,i){if(Fe){var l=mt.formState;if(l!==null){e:{var d=Ae;if(Fe){if(yt){t:{for(var h=yt,g=qn;h.nodeType!==8;){if(!g){h=null;break t}if(h=Kn(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){yt=Kn(h.nextSibling),d=h.data==="F!";break e}}si(d)}d=!1}d&&(i=l[0])}}return l=un(),l.memoizedState=l.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cy,lastRenderedState:i},l.queue=d,l=Gy.bind(null,Ae,d),d.dispatch=l,d=xf(!1),g=kf.bind(null,Ae,!1,d.queue),d=un(),h={state:i,dispatch:null,action:n,pending:null},d.queue=h,l=G1.bind(null,Ae,h,g,l),h.dispatch=l,d.memoizedState=n,[i,l,!1]}function zy(n){var i=Ot();return _y(i,ut,n)}function _y(n,i,l){if(i=yf(n,i,Cy)[0],n=nc(Ds)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=vo(i)}catch(j){throw j===sr?Fl:j}else d=i;i=Ot();var h=i.queue,g=h.dispatch;return l!==i.memoizedState&&(Ae.flags|=2048,lr(9,{destroy:void 0},F1.bind(null,h,l),null)),[d,g,n]}function F1(n,i){n.action=i}function Ey(n){var i=Ot(),l=ut;if(l!==null)return _y(i,l,n);Ot(),i=i.memoizedState,l=Ot();var d=l.queue.dispatch;return l.memoizedState=n,[i,d,!1]}function lr(n,i,l,d){return n={tag:n,create:l,deps:d,inst:i,next:null},i=Ae.updateQueue,i===null&&(i=ec(),Ae.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=n.next=n:(d=l.next,l.next=n,n.next=d,i.lastEffect=n),n}function Ry(){return Ot().memoizedState}function sc(n,i,l,d){var h=un();Ae.flags|=n,h.memoizedState=lr(1|i,{destroy:void 0},l,d===void 0?null:d)}function ic(n,i,l,d){var h=Ot();d=d===void 0?null:d;var g=h.memoizedState.inst;ut!==null&&d!==null&&df(d,ut.memoizedState.deps)?h.memoizedState=lr(i,g,l,d):(Ae.flags|=n,h.memoizedState=lr(1|i,g,l,d))}function Ay(n,i){sc(8390656,8,n,i)}function Sf(n,i){ic(2048,8,n,i)}function Z1(n){Ae.flags|=4;var i=Ae.updateQueue;if(i===null)i=ec(),Ae.updateQueue=i,i.events=[n];else{var l=i.events;l===null?i.events=[n]:l.push(n)}}function Ty(n){var i=Ot().memoizedState;return Z1({ref:i,nextImpl:n}),function(){if((tt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Oy(n,i){return ic(4,2,n,i)}function Ly(n,i){return ic(4,4,n,i)}function Dy(n,i){if(typeof i=="function"){n=n();var l=i(n);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function My(n,i,l){l=l!=null?l.concat([n]):null,ic(4,4,Dy.bind(null,i,n),l)}function jf(){}function $y(n,i){var l=Ot();i=i===void 0?null:i;var d=l.memoizedState;return i!==null&&df(i,d[1])?d[0]:(l.memoizedState=[n,i],n)}function Py(n,i){var l=Ot();i=i===void 0?null:i;var d=l.memoizedState;if(i!==null&&df(i,d[1]))return d[0];if(d=n(),aa){gn(!0);try{n()}finally{gn(!1)}}return l.memoizedState=[d,i],d}function wf(n,i,l){return l===void 0||(Ls&1073741824)!==0&&(qe&261930)===0?n.memoizedState=i:(n.memoizedState=l,n=U0(),Ae.lanes|=n,fi|=n,l)}function Uy(n,i,l,d){return _n(l,i)?l:ar.current!==null?(n=wf(n,l,d),_n(n,i)||(It=!0),n):(Ls&42)===0||(Ls&1073741824)!==0&&(qe&261930)===0?(It=!0,n.memoizedState=l):(n=U0(),Ae.lanes|=n,fi|=n,i)}function Iy(n,i,l,d,h){var g=ae.p;ae.p=g!==0&&8>g?g:8;var j=K.T,_={};K.T=_,kf(n,!1,i,l);try{var D=h(),F=K.S;if(F!==null&&F(_,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var W=q1(D,d);xo(n,i,W,Ln(n))}else xo(n,i,d,Ln(n))}catch(ie){xo(n,i,{then:function(){},status:"rejected",reason:ie},Ln())}finally{ae.p=g,j!==null&&_.types!==null&&(j.types=_.types),K.T=j}}function V1(){}function Nf(n,i,l,d){if(n.tag!==5)throw Error(a(476));var h=By(n).queue;Iy(n,h,i,me,l===null?V1:function(){return qy(n),l(d)})}function By(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:me,baseState:me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:me},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:l},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function qy(n){var i=By(n);i.next===null&&(i=n.alternate.memoizedState),xo(n,i.next.queue,{},Ln())}function Cf(){return Jt(Mo)}function Hy(){return Ot().memoizedState}function Ky(){return Ot().memoizedState}function Q1(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var l=Ln();n=ri(l);var d=oi(i,n,l);d!==null&&(jn(d,i,l),mo(d,i,l)),i={cache:Wd()},n.payload=i;return}i=i.return}}function Y1(n,i,l){var d=Ln();l={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ac(n)?Fy(i,l):(l=qd(n,i,l,d),l!==null&&(jn(l,n,d),Zy(l,i,d)))}function Gy(n,i,l){var d=Ln();xo(n,i,l,d)}function xo(n,i,l,d){var h={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ac(n))Fy(i,h);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var j=i.lastRenderedState,_=g(j,l);if(h.hasEagerState=!0,h.eagerState=_,_n(_,j))return Ul(n,i,h,0),mt===null&&Pl(),!1}catch{}if(l=qd(n,i,h,d),l!==null)return jn(l,n,d),Zy(l,i,d),!0}return!1}function kf(n,i,l,d){if(d={lane:2,revertLane:ih(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},ac(n)){if(i)throw Error(a(479))}else i=qd(n,l,d,2),i!==null&&jn(i,n,2)}function ac(n){var i=n.alternate;return n===Ae||i!==null&&i===Ae}function Fy(n,i){rr=Xl=!0;var l=n.pending;l===null?i.next=i:(i.next=l.next,l.next=i),n.pending=i}function Zy(n,i,l){if((l&4194048)!==0){var d=i.lanes;d&=n.pendingLanes,l|=d,i.lanes=l,he(n,l)}}var bo={readContext:Jt,use:tc,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};bo.useEffectEvent=Et;var Vy={readContext:Jt,use:tc,useCallback:function(n,i){return un().memoizedState=[n,i===void 0?null:i],n},useContext:Jt,useEffect:Ay,useImperativeHandle:function(n,i,l){l=l!=null?l.concat([n]):null,sc(4194308,4,Dy.bind(null,i,n),l)},useLayoutEffect:function(n,i){return sc(4194308,4,n,i)},useInsertionEffect:function(n,i){sc(4,2,n,i)},useMemo:function(n,i){var l=un();i=i===void 0?null:i;var d=n();if(aa){gn(!0);try{n()}finally{gn(!1)}}return l.memoizedState=[d,i],d},useReducer:function(n,i,l){var d=un();if(l!==void 0){var h=l(i);if(aa){gn(!0);try{l(i)}finally{gn(!1)}}}else h=i;return d.memoizedState=d.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},d.queue=n,n=n.dispatch=Y1.bind(null,Ae,n),[d.memoizedState,n]},useRef:function(n){var i=un();return n={current:n},i.memoizedState=n},useState:function(n){n=xf(n);var i=n.queue,l=Gy.bind(null,Ae,i);return i.dispatch=l,[n.memoizedState,l]},useDebugValue:jf,useDeferredValue:function(n,i){var l=un();return wf(l,n,i)},useTransition:function(){var n=xf(!1);return n=Iy.bind(null,Ae,n.queue,!0,!1),un().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,l){var d=Ae,h=un();if(Fe){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),mt===null)throw Error(a(349));(qe&127)!==0||py(d,i,l)}h.memoizedState=l;var g={value:l,getSnapshot:i};return h.queue=g,Ay(yy.bind(null,d,g,n),[n]),d.flags|=2048,lr(9,{destroy:void 0},gy.bind(null,d,g,l,i),null),l},useId:function(){var n=un(),i=mt.identifierPrefix;if(Fe){var l=vs,d=ys;l=(d&~(1<<32-ce(d)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Wl++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=H1++,i="_"+i+"r_"+l.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:Cf,useFormState:ky,useActionState:ky,useOptimistic:function(n){var i=un();i.memoizedState=i.baseState=n;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=kf.bind(null,Ae,!0,l),l.dispatch=i,[n,i]},useMemoCache:gf,useCacheRefresh:function(){return un().memoizedState=Q1.bind(null,Ae)},useEffectEvent:function(n){var i=un(),l={impl:n};return i.memoizedState=l,function(){if((tt&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},zf={readContext:Jt,use:tc,useCallback:$y,useContext:Jt,useEffect:Sf,useImperativeHandle:My,useInsertionEffect:Oy,useLayoutEffect:Ly,useMemo:Py,useReducer:nc,useRef:Ry,useState:function(){return nc(Ds)},useDebugValue:jf,useDeferredValue:function(n,i){var l=Ot();return Uy(l,ut.memoizedState,n,i)},useTransition:function(){var n=nc(Ds)[0],i=Ot().memoizedState;return[typeof n=="boolean"?n:vo(n),i]},useSyncExternalStore:my,useId:Hy,useHostTransitionStatus:Cf,useFormState:zy,useActionState:zy,useOptimistic:function(n,i){var l=Ot();return by(l,ut,n,i)},useMemoCache:gf,useCacheRefresh:Ky};zf.useEffectEvent=Ty;var Qy={readContext:Jt,use:tc,useCallback:$y,useContext:Jt,useEffect:Sf,useImperativeHandle:My,useInsertionEffect:Oy,useLayoutEffect:Ly,useMemo:Py,useReducer:vf,useRef:Ry,useState:function(){return vf(Ds)},useDebugValue:jf,useDeferredValue:function(n,i){var l=Ot();return ut===null?wf(l,n,i):Uy(l,ut.memoizedState,n,i)},useTransition:function(){var n=vf(Ds)[0],i=Ot().memoizedState;return[typeof n=="boolean"?n:vo(n),i]},useSyncExternalStore:my,useId:Hy,useHostTransitionStatus:Cf,useFormState:Ey,useActionState:Ey,useOptimistic:function(n,i){var l=Ot();return ut!==null?by(l,ut,n,i):(l.baseState=n,[n,l.queue.dispatch])},useMemoCache:gf,useCacheRefresh:Ky};Qy.useEffectEvent=Ty;function _f(n,i,l,d){i=n.memoizedState,l=l(d,i),l=l==null?i:y({},i,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var Ef={enqueueSetState:function(n,i,l){n=n._reactInternals;var d=Ln(),h=ri(d);h.payload=i,l!=null&&(h.callback=l),i=oi(n,h,d),i!==null&&(jn(i,n,d),mo(i,n,d))},enqueueReplaceState:function(n,i,l){n=n._reactInternals;var d=Ln(),h=ri(d);h.tag=1,h.payload=i,l!=null&&(h.callback=l),i=oi(n,h,d),i!==null&&(jn(i,n,d),mo(i,n,d))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var l=Ln(),d=ri(l);d.tag=2,i!=null&&(d.callback=i),i=oi(n,d,l),i!==null&&(jn(i,n,l),mo(i,n,l))}};function Yy(n,i,l,d,h,g,j){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,g,j):i.prototype&&i.prototype.isPureReactComponent?!ao(l,d)||!ao(h,g):!0}function Jy(n,i,l,d){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,d),i.state!==n&&Ef.enqueueReplaceState(i,i.state,null)}function ra(n,i){var l=i;if("ref"in i){l={};for(var d in i)d!=="ref"&&(l[d]=i[d])}if(n=n.defaultProps){l===i&&(l=y({},l));for(var h in n)l[h]===void 0&&(l[h]=n[h])}return l}function Xy(n){$l(n)}function Wy(n){console.error(n)}function e0(n){$l(n)}function rc(n,i){try{var l=n.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function t0(n,i,l){try{var d=n.onCaughtError;d(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Rf(n,i,l){return l=ri(l),l.tag=3,l.payload={element:null},l.callback=function(){rc(n,i)},l}function n0(n){return n=ri(n),n.tag=3,n}function s0(n,i,l,d){var h=l.type.getDerivedStateFromError;if(typeof h=="function"){var g=d.value;n.payload=function(){return h(g)},n.callback=function(){t0(i,l,d)}}var j=l.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(n.callback=function(){t0(i,l,d),typeof h!="function"&&(hi===null?hi=new Set([this]):hi.add(this));var _=d.stack;this.componentDidCatch(d.value,{componentStack:_!==null?_:""})})}function J1(n,i,l,d,h){if(l.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=l.alternate,i!==null&&er(i,l,h,!0),l=Rn.current,l!==null){switch(l.tag){case 31:case 13:return Hn===null?vc():l.alternate===null&&Rt===0&&(Rt=3),l.flags&=-257,l.flags|=65536,l.lanes=h,d===Zl?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([d]):i.add(d),th(n,d,h)),!1;case 22:return l.flags|=65536,d===Zl?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([d]):l.add(d)),th(n,d,h)),!1}throw Error(a(435,l.tag))}return th(n,d,h),vc(),!1}if(Fe)return i=Rn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,d!==Vd&&(n=Error(a(422),{cause:d}),lo(Un(n,l)))):(d!==Vd&&(i=Error(a(423),{cause:d}),lo(Un(i,l))),n=n.current.alternate,n.flags|=65536,h&=-h,n.lanes|=h,d=Un(d,l),h=Rf(n.stateNode,d,h),rf(n,h),Rt!==4&&(Rt=2)),!1;var g=Error(a(520),{cause:d});if(g=Un(g,l),_o===null?_o=[g]:_o.push(g),Rt!==4&&(Rt=2),i===null)return!0;d=Un(d,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,n=h&-h,l.lanes|=n,n=Rf(l.stateNode,d,n),rf(l,n),!1;case 1:if(i=l.type,g=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(hi===null||!hi.has(g))))return l.flags|=65536,h&=-h,l.lanes|=h,h=n0(h),s0(h,n,l,d),rf(l,h),!1}l=l.return}while(l!==null);return!1}var Af=Error(a(461)),It=!1;function Xt(n,i,l,d){i.child=n===null?oy(i,null,l,d):ia(i,n.child,l,d)}function i0(n,i,l,d,h){l=l.render;var g=i.ref;if("ref"in d){var j={};for(var _ in d)_!=="ref"&&(j[_]=d[_])}else j=d;return ea(i),d=ff(n,i,l,j,g,h),_=hf(),n!==null&&!It?(mf(n,i,h),Ms(n,i,h)):(Fe&&_&&Fd(i),i.flags|=1,Xt(n,i,d,h),i.child)}function a0(n,i,l,d,h){if(n===null){var g=l.type;return typeof g=="function"&&!Hd(g)&&g.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=g,r0(n,i,g,d,h)):(n=Bl(l.type,null,d,i,i.mode,h),n.ref=i.ref,n.return=i,i.child=n)}if(g=n.child,!Uf(n,h)){var j=g.memoizedProps;if(l=l.compare,l=l!==null?l:ao,l(j,d)&&n.ref===i.ref)return Ms(n,i,h)}return i.flags|=1,n=Rs(g,d),n.ref=i.ref,n.return=i,i.child=n}function r0(n,i,l,d,h){if(n!==null){var g=n.memoizedProps;if(ao(g,d)&&n.ref===i.ref)if(It=!1,i.pendingProps=d=g,Uf(n,h))(n.flags&131072)!==0&&(It=!0);else return i.lanes=n.lanes,Ms(n,i,h)}return Tf(n,i,l,d,h)}function o0(n,i,l,d){var h=d.children,g=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(g=g!==null?g.baseLanes|l:l,n!==null){for(d=i.child=n.child,h=0;d!==null;)h=h|d.lanes|d.childLanes,d=d.sibling;d=h&~g}else d=0,i.child=null;return l0(n,i,g,l,d)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Gl(i,g!==null?g.cachePool:null),g!==null?uy(i,g):lf(),dy(i);else return d=i.lanes=536870912,l0(n,i,g!==null?g.baseLanes|l:l,l,d)}else g!==null?(Gl(i,g.cachePool),uy(i,g),ci(),i.memoizedState=null):(n!==null&&Gl(i,null),lf(),ci());return Xt(n,i,h,l),i.child}function So(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function l0(n,i,l,d,h){var g=tf();return g=g===null?null:{parent:Pt._currentValue,pool:g},i.memoizedState={baseLanes:l,cachePool:g},n!==null&&Gl(i,null),lf(),dy(i),n!==null&&er(n,i,d,!0),i.childLanes=h,null}function oc(n,i){return i=cc({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function c0(n,i,l){return ia(i,n.child,null,l),n=oc(i,i.pendingProps),n.flags|=2,An(i),i.memoizedState=null,n}function X1(n,i,l){var d=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Fe){if(d.mode==="hidden")return n=oc(i,d),i.lanes=536870912,So(null,n);if(uf(i),(n=yt)?(n=Sv(n,qn),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ti!==null?{id:ys,overflow:vs}:null,retryLane:536870912,hydrationErrors:null},l=Fg(n),l.return=i,i.child=l,Yt=i,yt=null)):n=null,n===null)throw si(i);return i.lanes=536870912,null}return oc(i,d)}var g=n.memoizedState;if(g!==null){var j=g.dehydrated;if(uf(i),h)if(i.flags&256)i.flags&=-257,i=c0(n,i,l);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if(It||er(n,i,l,!1),h=(l&n.childLanes)!==0,It||h){if(d=mt,d!==null&&(j=xt(d,l),j!==0&&j!==g.retryLane))throw g.retryLane=j,Yi(n,j),jn(d,n,j),Af;vc(),i=c0(n,i,l)}else n=g.treeContext,yt=Kn(j.nextSibling),Yt=i,Fe=!0,ni=null,qn=!1,n!==null&&Qg(i,n),i=oc(i,d),i.flags|=4096;return i}return n=Rs(n.child,{mode:d.mode,children:d.children}),n.ref=i.ref,i.child=n,n.return=i,n}function lc(n,i){var l=i.ref;if(l===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(n===null||n.ref!==l)&&(i.flags|=4194816)}}function Tf(n,i,l,d,h){return ea(i),l=ff(n,i,l,d,void 0,h),d=hf(),n!==null&&!It?(mf(n,i,h),Ms(n,i,h)):(Fe&&d&&Fd(i),i.flags|=1,Xt(n,i,l,h),i.child)}function u0(n,i,l,d,h,g){return ea(i),i.updateQueue=null,l=hy(i,d,l,h),fy(n),d=hf(),n!==null&&!It?(mf(n,i,g),Ms(n,i,g)):(Fe&&d&&Fd(i),i.flags|=1,Xt(n,i,l,g),i.child)}function d0(n,i,l,d,h){if(ea(i),i.stateNode===null){var g=Ya,j=l.contextType;typeof j=="object"&&j!==null&&(g=Jt(j)),g=new l(d,g),i.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Ef,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=d,g.state=i.memoizedState,g.refs={},sf(i),j=l.contextType,g.context=typeof j=="object"&&j!==null?Jt(j):Ya,g.state=i.memoizedState,j=l.getDerivedStateFromProps,typeof j=="function"&&(_f(i,l,j,d),g.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(j=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),j!==g.state&&Ef.enqueueReplaceState(g,g.state,null),go(i,d,g,h),po(),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(n===null){g=i.stateNode;var _=i.memoizedProps,D=ra(l,_);g.props=D;var F=g.context,W=l.contextType;j=Ya,typeof W=="object"&&W!==null&&(j=Jt(W));var ie=l.getDerivedStateFromProps;W=typeof ie=="function"||typeof g.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,W||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(_||F!==j)&&Jy(i,g,d,j),ai=!1;var Z=i.memoizedState;g.state=Z,go(i,d,g,h),po(),F=i.memoizedState,_||Z!==F||ai?(typeof ie=="function"&&(_f(i,l,ie,d),F=i.memoizedState),(D=ai||Yy(i,l,D,d,Z,F,j))?(W||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(i.flags|=4194308)):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=F),g.props=d,g.state=F,g.context=j,d=D):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{g=i.stateNode,af(n,i),j=i.memoizedProps,W=ra(l,j),g.props=W,ie=i.pendingProps,Z=g.context,F=l.contextType,D=Ya,typeof F=="object"&&F!==null&&(D=Jt(F)),_=l.getDerivedStateFromProps,(F=typeof _=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(j!==ie||Z!==D)&&Jy(i,g,d,D),ai=!1,Z=i.memoizedState,g.state=Z,go(i,d,g,h),po();var Y=i.memoizedState;j!==ie||Z!==Y||ai||n!==null&&n.dependencies!==null&&Hl(n.dependencies)?(typeof _=="function"&&(_f(i,l,_,d),Y=i.memoizedState),(W=ai||Yy(i,l,W,d,Z,Y,D)||n!==null&&n.dependencies!==null&&Hl(n.dependencies))?(F||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(d,Y,D),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(d,Y,D)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&Z===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&Z===n.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=Y),g.props=d,g.state=Y,g.context=D,d=W):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&Z===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&Z===n.memoizedState||(i.flags|=1024),d=!1)}return g=d,lc(n,i),d=(i.flags&128)!==0,g||d?(g=i.stateNode,l=d&&typeof l.getDerivedStateFromError!="function"?null:g.render(),i.flags|=1,n!==null&&d?(i.child=ia(i,n.child,null,h),i.child=ia(i,null,l,h)):Xt(n,i,l,h),i.memoizedState=g.state,n=i.child):n=Ms(n,i,h),n}function f0(n,i,l,d){return Xi(),i.flags|=256,Xt(n,i,l,d),i.child}var Of={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Lf(n){return{baseLanes:n,cachePool:ty()}}function Df(n,i,l){return n=n!==null?n.childLanes&~l:0,i&&(n|=On),n}function h0(n,i,l){var d=i.pendingProps,h=!1,g=(i.flags&128)!==0,j;if((j=g)||(j=n!==null&&n.memoizedState===null?!1:(Tt.current&2)!==0),j&&(h=!0,i.flags&=-129),j=(i.flags&32)!==0,i.flags&=-33,n===null){if(Fe){if(h?li(i):ci(),(n=yt)?(n=Sv(n,qn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ti!==null?{id:ys,overflow:vs}:null,retryLane:536870912,hydrationErrors:null},l=Fg(n),l.return=i,i.child=l,Yt=i,yt=null)):n=null,n===null)throw si(i);return yh(n)?i.lanes=32:i.lanes=536870912,null}var _=d.children;return d=d.fallback,h?(ci(),h=i.mode,_=cc({mode:"hidden",children:_},h),d=Ji(d,h,l,null),_.return=i,d.return=i,_.sibling=d,i.child=_,d=i.child,d.memoizedState=Lf(l),d.childLanes=Df(n,j,l),i.memoizedState=Of,So(null,d)):(li(i),Mf(i,_))}var D=n.memoizedState;if(D!==null&&(_=D.dehydrated,_!==null)){if(g)i.flags&256?(li(i),i.flags&=-257,i=$f(n,i,l)):i.memoizedState!==null?(ci(),i.child=n.child,i.flags|=128,i=null):(ci(),_=d.fallback,h=i.mode,d=cc({mode:"visible",children:d.children},h),_=Ji(_,h,l,null),_.flags|=2,d.return=i,_.return=i,d.sibling=_,i.child=d,ia(i,n.child,null,l),d=i.child,d.memoizedState=Lf(l),d.childLanes=Df(n,j,l),i.memoizedState=Of,i=So(null,d));else if(li(i),yh(_)){if(j=_.nextSibling&&_.nextSibling.dataset,j)var F=j.dgst;j=F,d=Error(a(419)),d.stack="",d.digest=j,lo({value:d,source:null,stack:null}),i=$f(n,i,l)}else if(It||er(n,i,l,!1),j=(l&n.childLanes)!==0,It||j){if(j=mt,j!==null&&(d=xt(j,l),d!==0&&d!==D.retryLane))throw D.retryLane=d,Yi(n,d),jn(j,n,d),Af;gh(_)||vc(),i=$f(n,i,l)}else gh(_)?(i.flags|=192,i.child=n.child,i=null):(n=D.treeContext,yt=Kn(_.nextSibling),Yt=i,Fe=!0,ni=null,qn=!1,n!==null&&Qg(i,n),i=Mf(i,d.children),i.flags|=4096);return i}return h?(ci(),_=d.fallback,h=i.mode,D=n.child,F=D.sibling,d=Rs(D,{mode:"hidden",children:d.children}),d.subtreeFlags=D.subtreeFlags&65011712,F!==null?_=Rs(F,_):(_=Ji(_,h,l,null),_.flags|=2),_.return=i,d.return=i,d.sibling=_,i.child=d,So(null,d),d=i.child,_=n.child.memoizedState,_===null?_=Lf(l):(h=_.cachePool,h!==null?(D=Pt._currentValue,h=h.parent!==D?{parent:D,pool:D}:h):h=ty(),_={baseLanes:_.baseLanes|l,cachePool:h}),d.memoizedState=_,d.childLanes=Df(n,j,l),i.memoizedState=Of,So(n.child,d)):(li(i),l=n.child,n=l.sibling,l=Rs(l,{mode:"visible",children:d.children}),l.return=i,l.sibling=null,n!==null&&(j=i.deletions,j===null?(i.deletions=[n],i.flags|=16):j.push(n)),i.child=l,i.memoizedState=null,l)}function Mf(n,i){return i=cc({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function cc(n,i){return n=En(22,n,null,i),n.lanes=0,n}function $f(n,i,l){return ia(i,n.child,null,l),n=Mf(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function m0(n,i,l){n.lanes|=i;var d=n.alternate;d!==null&&(d.lanes|=i),Jd(n.return,i,l)}function Pf(n,i,l,d,h,g){var j=n.memoizedState;j===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:h,treeForkCount:g}:(j.isBackwards=i,j.rendering=null,j.renderingStartTime=0,j.last=d,j.tail=l,j.tailMode=h,j.treeForkCount=g)}function p0(n,i,l){var d=i.pendingProps,h=d.revealOrder,g=d.tail;d=d.children;var j=Tt.current,_=(j&2)!==0;if(_?(j=j&1|2,i.flags|=128):j&=1,se(Tt,j),Xt(n,i,d,l),d=Fe?oo:0,!_&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&m0(n,l,i);else if(n.tag===19)m0(n,l,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(h){case"forwards":for(l=i.child,h=null;l!==null;)n=l.alternate,n!==null&&Jl(n)===null&&(h=l),l=l.sibling;l=h,l===null?(h=i.child,i.child=null):(h=l.sibling,l.sibling=null),Pf(i,!1,h,l,g,d);break;case"backwards":case"unstable_legacy-backwards":for(l=null,h=i.child,i.child=null;h!==null;){if(n=h.alternate,n!==null&&Jl(n)===null){i.child=h;break}n=h.sibling,h.sibling=l,l=h,h=n}Pf(i,!0,l,null,g,d);break;case"together":Pf(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function Ms(n,i,l){if(n!==null&&(i.dependencies=n.dependencies),fi|=i.lanes,(l&i.childLanes)===0)if(n!==null){if(er(n,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(a(153));if(i.child!==null){for(n=i.child,l=Rs(n,n.pendingProps),i.child=l,l.return=i;n.sibling!==null;)n=n.sibling,l=l.sibling=Rs(n,n.pendingProps),l.return=i;l.sibling=null}return i.child}function Uf(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Hl(n)))}function W1(n,i,l){switch(i.tag){case 3:_e(i,i.stateNode.containerInfo),ii(i,Pt,n.memoizedState.cache),Xi();break;case 27:case 5:Ze(i);break;case 4:_e(i,i.stateNode.containerInfo);break;case 10:ii(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,uf(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(li(i),i.flags|=128,null):(l&i.child.childLanes)!==0?h0(n,i,l):(li(i),n=Ms(n,i,l),n!==null?n.sibling:null);li(i);break;case 19:var h=(n.flags&128)!==0;if(d=(l&i.childLanes)!==0,d||(er(n,i,l,!1),d=(l&i.childLanes)!==0),h){if(d)return p0(n,i,l);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),se(Tt,Tt.current),d)break;return null;case 22:return i.lanes=0,o0(n,i,l,i.pendingProps);case 24:ii(i,Pt,n.memoizedState.cache)}return Ms(n,i,l)}function g0(n,i,l){if(n!==null)if(n.memoizedProps!==i.pendingProps)It=!0;else{if(!Uf(n,l)&&(i.flags&128)===0)return It=!1,W1(n,i,l);It=(n.flags&131072)!==0}else It=!1,Fe&&(i.flags&1048576)!==0&&Vg(i,oo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(n=na(i.elementType),i.type=n,typeof n=="function")Hd(n)?(d=ra(n,d),i.tag=1,i=d0(null,i,n,d,l)):(i.tag=0,i=Tf(null,i,n,d,l));else{if(n!=null){var h=n.$$typeof;if(h===z){i.tag=11,i=i0(null,i,n,d,l);break e}else if(h===E){i.tag=14,i=a0(null,i,n,d,l);break e}}throw i=ze(n)||n,Error(a(306,i,""))}}return i;case 0:return Tf(n,i,i.type,i.pendingProps,l);case 1:return d=i.type,h=ra(d,i.pendingProps),d0(n,i,d,h,l);case 3:e:{if(_e(i,i.stateNode.containerInfo),n===null)throw Error(a(387));d=i.pendingProps;var g=i.memoizedState;h=g.element,af(n,i),go(i,d,null,l);var j=i.memoizedState;if(d=j.cache,ii(i,Pt,d),d!==g.cache&&Xd(i,[Pt],l,!0),po(),d=j.element,g.isDehydrated)if(g={element:d,isDehydrated:!1,cache:j.cache},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){i=f0(n,i,d,l);break e}else if(d!==h){h=Un(Error(a(424)),i),lo(h),i=f0(n,i,d,l);break e}else for(n=i.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,yt=Kn(n.firstChild),Yt=i,Fe=!0,ni=null,qn=!0,l=oy(i,null,d,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Xi(),d===h){i=Ms(n,i,l);break e}Xt(n,i,d,l)}i=i.child}return i;case 26:return lc(n,i),n===null?(l=zv(i.type,null,i.pendingProps,null))?i.memoizedState=l:Fe||(l=i.type,n=i.pendingProps,d=Cc(fe.current).createElement(l),d[st]=i,d[sn]=n,Wt(d,l,n),it(d),i.stateNode=d):i.memoizedState=zv(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Ze(i),n===null&&Fe&&(d=i.stateNode=Nv(i.type,i.pendingProps,fe.current),Yt=i,qn=!0,h=yt,yi(i.type)?(vh=h,yt=Kn(d.firstChild)):yt=h),Xt(n,i,i.pendingProps.children,l),lc(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Fe&&((h=d=yt)&&(d=EC(d,i.type,i.pendingProps,qn),d!==null?(i.stateNode=d,Yt=i,yt=Kn(d.firstChild),qn=!1,h=!0):h=!1),h||si(i)),Ze(i),h=i.type,g=i.pendingProps,j=n!==null?n.memoizedProps:null,d=g.children,hh(h,g)?d=null:j!==null&&hh(h,j)&&(i.flags|=32),i.memoizedState!==null&&(h=ff(n,i,K1,null,null,l),Mo._currentValue=h),lc(n,i),Xt(n,i,d,l),i.child;case 6:return n===null&&Fe&&((n=l=yt)&&(l=RC(l,i.pendingProps,qn),l!==null?(i.stateNode=l,Yt=i,yt=null,n=!0):n=!1),n||si(i)),null;case 13:return h0(n,i,l);case 4:return _e(i,i.stateNode.containerInfo),d=i.pendingProps,n===null?i.child=ia(i,null,d,l):Xt(n,i,d,l),i.child;case 11:return i0(n,i,i.type,i.pendingProps,l);case 7:return Xt(n,i,i.pendingProps,l),i.child;case 8:return Xt(n,i,i.pendingProps.children,l),i.child;case 12:return Xt(n,i,i.pendingProps.children,l),i.child;case 10:return d=i.pendingProps,ii(i,i.type,d.value),Xt(n,i,d.children,l),i.child;case 9:return h=i.type._context,d=i.pendingProps.children,ea(i),h=Jt(h),d=d(h),i.flags|=1,Xt(n,i,d,l),i.child;case 14:return a0(n,i,i.type,i.pendingProps,l);case 15:return r0(n,i,i.type,i.pendingProps,l);case 19:return p0(n,i,l);case 31:return X1(n,i,l);case 22:return o0(n,i,l,i.pendingProps);case 24:return ea(i),d=Jt(Pt),n===null?(h=tf(),h===null&&(h=mt,g=Wd(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=l),h=g),i.memoizedState={parent:d,cache:h},sf(i),ii(i,Pt,h)):((n.lanes&l)!==0&&(af(n,i),go(i,null,null,l),po()),h=n.memoizedState,g=i.memoizedState,h.parent!==d?(h={parent:d,cache:d},i.memoizedState=h,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=h),ii(i,Pt,d)):(d=g.cache,ii(i,Pt,d),d!==h.cache&&Xd(i,[Pt],l,!0))),Xt(n,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function $s(n){n.flags|=4}function If(n,i,l,d,h){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(h&335544128)===h)if(n.stateNode.complete)n.flags|=8192;else if(H0())n.flags|=8192;else throw sa=Zl,nf}else n.flags&=-16777217}function y0(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Tv(i))if(H0())n.flags|=8192;else throw sa=Zl,nf}function uc(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?wl():536870912,n.lanes|=i,fr|=i)}function jo(n,i){if(!Fe)switch(n.tailMode){case"hidden":i=n.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null}}function vt(n){var i=n.alternate!==null&&n.alternate.child===n.child,l=0,d=0;if(i)for(var h=n.child;h!==null;)l|=h.lanes|h.childLanes,d|=h.subtreeFlags&65011712,d|=h.flags&65011712,h.return=n,h=h.sibling;else for(h=n.child;h!==null;)l|=h.lanes|h.childLanes,d|=h.subtreeFlags,d|=h.flags,h.return=n,h=h.sibling;return n.subtreeFlags|=d,n.childLanes=l,i}function eC(n,i,l){var d=i.pendingProps;switch(Zd(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vt(i),null;case 1:return vt(i),null;case 3:return l=i.stateNode,d=null,n!==null&&(d=n.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),Os(Pt),ge(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(n===null||n.child===null)&&(Wa(i)?$s(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Qd())),vt(i),null;case 26:var h=i.type,g=i.memoizedState;return n===null?($s(i),g!==null?(vt(i),y0(i,g)):(vt(i),If(i,h,null,d,l))):g?g!==n.memoizedState?($s(i),vt(i),y0(i,g)):(vt(i),i.flags&=-16777217):(n=n.memoizedProps,n!==d&&$s(i),vt(i),If(i,h,n,d,l)),null;case 27:if(et(i),l=fe.current,h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==d&&$s(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return vt(i),null}n=le.current,Wa(i)?Yg(i):(n=Nv(h,d,l),i.stateNode=n,$s(i))}return vt(i),null;case 5:if(et(i),h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==d&&$s(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return vt(i),null}if(g=le.current,Wa(i))Yg(i);else{var j=Cc(fe.current);switch(g){case 1:g=j.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:g=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":g=j.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":g=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":g=j.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof d.is=="string"?j.createElement("select",{is:d.is}):j.createElement("select"),d.multiple?g.multiple=!0:d.size&&(g.size=d.size);break;default:g=typeof d.is=="string"?j.createElement(h,{is:d.is}):j.createElement(h)}}g[st]=i,g[sn]=d;e:for(j=i.child;j!==null;){if(j.tag===5||j.tag===6)g.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===i)break e;for(;j.sibling===null;){if(j.return===null||j.return===i)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}i.stateNode=g;e:switch(Wt(g,h,d),h){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&$s(i)}}return vt(i),If(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,l),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==d&&$s(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(n=fe.current,Wa(i)){if(n=i.stateNode,l=i.memoizedProps,d=null,h=Yt,h!==null)switch(h.tag){case 27:case 5:d=h.memoizedProps}n[st]=i,n=!!(n.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||hv(n.nodeValue,l)),n||si(i,!0)}else n=Cc(n).createTextNode(d),n[st]=i,i.stateNode=n}return vt(i),null;case 31:if(l=i.memoizedState,n===null||n.memoizedState!==null){if(d=Wa(i),l!==null){if(n===null){if(!d)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[st]=i}else Xi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;vt(i),n=!1}else l=Qd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=l),n=!0;if(!n)return i.flags&256?(An(i),i):(An(i),null);if((i.flags&128)!==0)throw Error(a(558))}return vt(i),null;case 13:if(d=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=Wa(i),d!==null&&d.dehydrated!==null){if(n===null){if(!h)throw Error(a(318));if(h=i.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[st]=i}else Xi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;vt(i),h=!1}else h=Qd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return i.flags&256?(An(i),i):(An(i),null)}return An(i),(i.flags&128)!==0?(i.lanes=l,i):(l=d!==null,n=n!==null&&n.memoizedState!==null,l&&(d=i.child,h=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(h=d.alternate.memoizedState.cachePool.pool),g=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(g=d.memoizedState.cachePool.pool),g!==h&&(d.flags|=2048)),l!==n&&l&&(i.child.flags|=8192),uc(i,i.updateQueue),vt(i),null);case 4:return ge(),n===null&&lh(i.stateNode.containerInfo),vt(i),null;case 10:return Os(i.type),vt(i),null;case 19:if(B(Tt),d=i.memoizedState,d===null)return vt(i),null;if(h=(i.flags&128)!==0,g=d.rendering,g===null)if(h)jo(d,!1);else{if(Rt!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(g=Jl(n),g!==null){for(i.flags|=128,jo(d,!1),n=g.updateQueue,i.updateQueue=n,uc(i,n),i.subtreeFlags=0,n=l,l=i.child;l!==null;)Gg(l,n),l=l.sibling;return se(Tt,Tt.current&1|2),Fe&&As(i,d.treeForkCount),i.child}n=n.sibling}d.tail!==null&&Qe()>pc&&(i.flags|=128,h=!0,jo(d,!1),i.lanes=4194304)}else{if(!h)if(n=Jl(g),n!==null){if(i.flags|=128,h=!0,n=n.updateQueue,i.updateQueue=n,uc(i,n),jo(d,!0),d.tail===null&&d.tailMode==="hidden"&&!g.alternate&&!Fe)return vt(i),null}else 2*Qe()-d.renderingStartTime>pc&&l!==536870912&&(i.flags|=128,h=!0,jo(d,!1),i.lanes=4194304);d.isBackwards?(g.sibling=i.child,i.child=g):(n=d.last,n!==null?n.sibling=g:i.child=g,d.last=g)}return d.tail!==null?(n=d.tail,d.rendering=n,d.tail=n.sibling,d.renderingStartTime=Qe(),n.sibling=null,l=Tt.current,se(Tt,h?l&1|2:l&1),Fe&&As(i,d.treeForkCount),n):(vt(i),null);case 22:case 23:return An(i),cf(),d=i.memoizedState!==null,n!==null?n.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(l&536870912)!==0&&(i.flags&128)===0&&(vt(i),i.subtreeFlags&6&&(i.flags|=8192)):vt(i),l=i.updateQueue,l!==null&&uc(i,l.retryQueue),l=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==l&&(i.flags|=2048),n!==null&&B(ta),null;case 24:return l=null,n!==null&&(l=n.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Os(Pt),vt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function tC(n,i){switch(Zd(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Os(Pt),ge(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return et(i),null;case 31:if(i.memoizedState!==null){if(An(i),i.alternate===null)throw Error(a(340));Xi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(An(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Xi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return B(Tt),null;case 4:return ge(),null;case 10:return Os(i.type),null;case 22:case 23:return An(i),cf(),n!==null&&B(ta),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return Os(Pt),null;case 25:return null;default:return null}}function v0(n,i){switch(Zd(i),i.tag){case 3:Os(Pt),ge();break;case 26:case 27:case 5:et(i);break;case 4:ge();break;case 31:i.memoizedState!==null&&An(i);break;case 13:An(i);break;case 19:B(Tt);break;case 10:Os(i.type);break;case 22:case 23:An(i),cf(),n!==null&&B(ta);break;case 24:Os(Pt)}}function wo(n,i){try{var l=i.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var h=d.next;l=h;do{if((l.tag&n)===n){d=void 0;var g=l.create,j=l.inst;d=g(),j.destroy=d}l=l.next}while(l!==h)}}catch(_){ot(i,i.return,_)}}function ui(n,i,l){try{var d=i.updateQueue,h=d!==null?d.lastEffect:null;if(h!==null){var g=h.next;d=g;do{if((d.tag&n)===n){var j=d.inst,_=j.destroy;if(_!==void 0){j.destroy=void 0,h=i;var D=l,F=_;try{F()}catch(W){ot(h,D,W)}}}d=d.next}while(d!==g)}}catch(W){ot(i,i.return,W)}}function x0(n){var i=n.updateQueue;if(i!==null){var l=n.stateNode;try{cy(i,l)}catch(d){ot(n,n.return,d)}}}function b0(n,i,l){l.props=ra(n.type,n.memoizedProps),l.state=n.memoizedState;try{l.componentWillUnmount()}catch(d){ot(n,i,d)}}function No(n,i){try{var l=n.ref;if(l!==null){switch(n.tag){case 26:case 27:case 5:var d=n.stateNode;break;case 30:d=n.stateNode;break;default:d=n.stateNode}typeof l=="function"?n.refCleanup=l(d):l.current=d}}catch(h){ot(n,i,h)}}function xs(n,i){var l=n.ref,d=n.refCleanup;if(l!==null)if(typeof d=="function")try{d()}catch(h){ot(n,i,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(h){ot(n,i,h)}else l.current=null}function S0(n){var i=n.type,l=n.memoizedProps,d=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&d.focus();break e;case"img":l.src?d.src=l.src:l.srcSet&&(d.srcset=l.srcSet)}}catch(h){ot(n,n.return,h)}}function Bf(n,i,l){try{var d=n.stateNode;wC(d,n.type,l,i),d[sn]=i}catch(h){ot(n,n.return,h)}}function j0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&yi(n.type)||n.tag===4}function qf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||j0(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&yi(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Hf(n,i,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(n,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(n),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=_s));else if(d!==4&&(d===27&&yi(n.type)&&(l=n.stateNode,i=null),n=n.child,n!==null))for(Hf(n,i,l),n=n.sibling;n!==null;)Hf(n,i,l),n=n.sibling}function dc(n,i,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,i?l.insertBefore(n,i):l.appendChild(n);else if(d!==4&&(d===27&&yi(n.type)&&(l=n.stateNode),n=n.child,n!==null))for(dc(n,i,l),n=n.sibling;n!==null;)dc(n,i,l),n=n.sibling}function w0(n){var i=n.stateNode,l=n.memoizedProps;try{for(var d=n.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);Wt(i,d,l),i[st]=n,i[sn]=l}catch(g){ot(n,n.return,g)}}var Ps=!1,Bt=!1,Kf=!1,N0=typeof WeakSet=="function"?WeakSet:Set,Qt=null;function nC(n,i){if(n=n.containerInfo,dh=Tc,n=Mg(n),Md(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var h=d.anchorOffset,g=d.focusNode;d=d.focusOffset;try{l.nodeType,g.nodeType}catch{l=null;break e}var j=0,_=-1,D=-1,F=0,W=0,ie=n,Z=null;t:for(;;){for(var Y;ie!==l||h!==0&&ie.nodeType!==3||(_=j+h),ie!==g||d!==0&&ie.nodeType!==3||(D=j+d),ie.nodeType===3&&(j+=ie.nodeValue.length),(Y=ie.firstChild)!==null;)Z=ie,ie=Y;for(;;){if(ie===n)break t;if(Z===l&&++F===h&&(_=j),Z===g&&++W===d&&(D=j),(Y=ie.nextSibling)!==null)break;ie=Z,Z=ie.parentNode}ie=Y}l=_===-1||D===-1?null:{start:_,end:D}}else l=null}l=l||{start:0,end:0}}else l=null;for(fh={focusedElem:n,selectionRange:l},Tc=!1,Qt=i;Qt!==null;)if(i=Qt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Qt=n;else for(;Qt!==null;){switch(i=Qt,g=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(l=0;l<n.length;l++)h=n[l],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&g!==null){n=void 0,l=i,h=g.memoizedProps,g=g.memoizedState,d=l.stateNode;try{var ve=ra(l.type,h);n=d.getSnapshotBeforeUpdate(ve,g),d.__reactInternalSnapshotBeforeUpdate=n}catch(Ce){ot(l,l.return,Ce)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,l=n.nodeType,l===9)ph(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":ph(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(a(163))}if(n=i.sibling,n!==null){n.return=i.return,Qt=n;break}Qt=i.return}}function C0(n,i,l){var d=l.flags;switch(l.tag){case 0:case 11:case 15:Is(n,l),d&4&&wo(5,l);break;case 1:if(Is(n,l),d&4)if(n=l.stateNode,i===null)try{n.componentDidMount()}catch(j){ot(l,l.return,j)}else{var h=ra(l.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(h,i,n.__reactInternalSnapshotBeforeUpdate)}catch(j){ot(l,l.return,j)}}d&64&&x0(l),d&512&&No(l,l.return);break;case 3:if(Is(n,l),d&64&&(n=l.updateQueue,n!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{cy(n,i)}catch(j){ot(l,l.return,j)}}break;case 27:i===null&&d&4&&w0(l);case 26:case 5:Is(n,l),i===null&&d&4&&S0(l),d&512&&No(l,l.return);break;case 12:Is(n,l);break;case 31:Is(n,l),d&4&&_0(n,l);break;case 13:Is(n,l),d&4&&E0(n,l),d&64&&(n=l.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(l=dC.bind(null,l),AC(n,l))));break;case 22:if(d=l.memoizedState!==null||Ps,!d){i=i!==null&&i.memoizedState!==null||Bt,h=Ps;var g=Bt;Ps=d,(Bt=i)&&!g?Bs(n,l,(l.subtreeFlags&8772)!==0):Is(n,l),Ps=h,Bt=g}break;case 30:break;default:Is(n,l)}}function k0(n){var i=n.alternate;i!==null&&(n.alternate=null,k0(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&Js(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var bt=null,vn=!1;function Us(n,i,l){for(l=l.child;l!==null;)z0(n,i,l),l=l.sibling}function z0(n,i,l){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(ts,l)}catch{}switch(l.tag){case 26:Bt||xs(l,i),Us(n,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Bt||xs(l,i);var d=bt,h=vn;yi(l.type)&&(bt=l.stateNode,vn=!1),Us(n,i,l),Oo(l.stateNode),bt=d,vn=h;break;case 5:Bt||xs(l,i);case 6:if(d=bt,h=vn,bt=null,Us(n,i,l),bt=d,vn=h,bt!==null)if(vn)try{(bt.nodeType===9?bt.body:bt.nodeName==="HTML"?bt.ownerDocument.body:bt).removeChild(l.stateNode)}catch(g){ot(l,i,g)}else try{bt.removeChild(l.stateNode)}catch(g){ot(l,i,g)}break;case 18:bt!==null&&(vn?(n=bt,xv(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,l.stateNode),br(n)):xv(bt,l.stateNode));break;case 4:d=bt,h=vn,bt=l.stateNode.containerInfo,vn=!0,Us(n,i,l),bt=d,vn=h;break;case 0:case 11:case 14:case 15:ui(2,l,i),Bt||ui(4,l,i),Us(n,i,l);break;case 1:Bt||(xs(l,i),d=l.stateNode,typeof d.componentWillUnmount=="function"&&b0(l,i,d)),Us(n,i,l);break;case 21:Us(n,i,l);break;case 22:Bt=(d=Bt)||l.memoizedState!==null,Us(n,i,l),Bt=d;break;default:Us(n,i,l)}}function _0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{br(n)}catch(l){ot(i,i.return,l)}}}function E0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{br(n)}catch(l){ot(i,i.return,l)}}function sC(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new N0),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new N0),i;default:throw Error(a(435,n.tag))}}function fc(n,i){var l=sC(n);i.forEach(function(d){if(!l.has(d)){l.add(d);var h=fC.bind(null,n,d);d.then(h,h)}})}function xn(n,i){var l=i.deletions;if(l!==null)for(var d=0;d<l.length;d++){var h=l[d],g=n,j=i,_=j;e:for(;_!==null;){switch(_.tag){case 27:if(yi(_.type)){bt=_.stateNode,vn=!1;break e}break;case 5:bt=_.stateNode,vn=!1;break e;case 3:case 4:bt=_.stateNode.containerInfo,vn=!0;break e}_=_.return}if(bt===null)throw Error(a(160));z0(g,j,h),bt=null,vn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)R0(i,n),i=i.sibling}var is=null;function R0(n,i){var l=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:xn(i,n),bn(n),d&4&&(ui(3,n,n.return),wo(3,n),ui(5,n,n.return));break;case 1:xn(i,n),bn(n),d&512&&(Bt||l===null||xs(l,l.return)),d&64&&Ps&&(n=n.updateQueue,n!==null&&(d=n.callbacks,d!==null&&(l=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=l===null?d:l.concat(d))));break;case 26:var h=is;if(xn(i,n),bn(n),d&512&&(Bt||l===null||xs(l,l.return)),d&4){var g=l!==null?l.memoizedState:null;if(d=n.memoizedState,l===null)if(d===null)if(n.stateNode===null){e:{d=n.type,l=n.memoizedProps,h=h.ownerDocument||h;t:switch(d){case"title":g=h.getElementsByTagName("title")[0],(!g||g[ps]||g[st]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=h.createElement(d),h.head.insertBefore(g,h.querySelector("head > title"))),Wt(g,d,l),g[st]=n,it(g),d=g;break e;case"link":var j=Rv("link","href",h).get(d+(l.href||""));if(j){for(var _=0;_<j.length;_++)if(g=j[_],g.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&g.getAttribute("rel")===(l.rel==null?null:l.rel)&&g.getAttribute("title")===(l.title==null?null:l.title)&&g.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){j.splice(_,1);break t}}g=h.createElement(d),Wt(g,d,l),h.head.appendChild(g);break;case"meta":if(j=Rv("meta","content",h).get(d+(l.content||""))){for(_=0;_<j.length;_++)if(g=j[_],g.getAttribute("content")===(l.content==null?null:""+l.content)&&g.getAttribute("name")===(l.name==null?null:l.name)&&g.getAttribute("property")===(l.property==null?null:l.property)&&g.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&g.getAttribute("charset")===(l.charSet==null?null:l.charSet)){j.splice(_,1);break t}}g=h.createElement(d),Wt(g,d,l),h.head.appendChild(g);break;default:throw Error(a(468,d))}g[st]=n,it(g),d=g}n.stateNode=d}else Av(h,n.type,n.stateNode);else n.stateNode=Ev(h,d,n.memoizedProps);else g!==d?(g===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):g.count--,d===null?Av(h,n.type,n.stateNode):Ev(h,d,n.memoizedProps)):d===null&&n.stateNode!==null&&Bf(n,n.memoizedProps,l.memoizedProps)}break;case 27:xn(i,n),bn(n),d&512&&(Bt||l===null||xs(l,l.return)),l!==null&&d&4&&Bf(n,n.memoizedProps,l.memoizedProps);break;case 5:if(xn(i,n),bn(n),d&512&&(Bt||l===null||xs(l,l.return)),n.flags&32){h=n.stateNode;try{Ha(h,"")}catch(ve){ot(n,n.return,ve)}}d&4&&n.stateNode!=null&&(h=n.memoizedProps,Bf(n,h,l!==null?l.memoizedProps:h)),d&1024&&(Kf=!0);break;case 6:if(xn(i,n),bn(n),d&4){if(n.stateNode===null)throw Error(a(162));d=n.memoizedProps,l=n.stateNode;try{l.nodeValue=d}catch(ve){ot(n,n.return,ve)}}break;case 3:if(_c=null,h=is,is=kc(i.containerInfo),xn(i,n),is=h,bn(n),d&4&&l!==null&&l.memoizedState.isDehydrated)try{br(i.containerInfo)}catch(ve){ot(n,n.return,ve)}Kf&&(Kf=!1,A0(n));break;case 4:d=is,is=kc(n.stateNode.containerInfo),xn(i,n),bn(n),is=d;break;case 12:xn(i,n),bn(n);break;case 31:xn(i,n),bn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,fc(n,d)));break;case 13:xn(i,n),bn(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(mc=Qe()),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,fc(n,d)));break;case 22:h=n.memoizedState!==null;var D=l!==null&&l.memoizedState!==null,F=Ps,W=Bt;if(Ps=F||h,Bt=W||D,xn(i,n),Bt=W,Ps=F,bn(n),d&8192)e:for(i=n.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(l===null||D||Ps||Bt||oa(n)),l=null,i=n;;){if(i.tag===5||i.tag===26){if(l===null){D=l=i;try{if(g=D.stateNode,h)j=g.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{_=D.stateNode;var ie=D.memoizedProps.style,Z=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;_.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(ve){ot(D,D.return,ve)}}}else if(i.tag===6){if(l===null){D=i;try{D.stateNode.nodeValue=h?"":D.memoizedProps}catch(ve){ot(D,D.return,ve)}}}else if(i.tag===18){if(l===null){D=i;try{var Y=D.stateNode;h?bv(Y,!0):bv(D.stateNode,!1)}catch(ve){ot(D,D.return,ve)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=n.updateQueue,d!==null&&(l=d.retryQueue,l!==null&&(d.retryQueue=null,fc(n,l))));break;case 19:xn(i,n),bn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,fc(n,d)));break;case 30:break;case 21:break;default:xn(i,n),bn(n)}}function bn(n){var i=n.flags;if(i&2){try{for(var l,d=n.return;d!==null;){if(j0(d)){l=d;break}d=d.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var h=l.stateNode,g=qf(n);dc(n,g,h);break;case 5:var j=l.stateNode;l.flags&32&&(Ha(j,""),l.flags&=-33);var _=qf(n);dc(n,_,j);break;case 3:case 4:var D=l.stateNode.containerInfo,F=qf(n);Hf(n,F,D);break;default:throw Error(a(161))}}catch(W){ot(n,n.return,W)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function A0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;A0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function Is(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)C0(n,i.alternate,i),i=i.sibling}function oa(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:ui(4,i,i.return),oa(i);break;case 1:xs(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&b0(i,i.return,l),oa(i);break;case 27:Oo(i.stateNode);case 26:case 5:xs(i,i.return),oa(i);break;case 22:i.memoizedState===null&&oa(i);break;case 30:oa(i);break;default:oa(i)}n=n.sibling}}function Bs(n,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,h=n,g=i,j=g.flags;switch(g.tag){case 0:case 11:case 15:Bs(h,g,l),wo(4,g);break;case 1:if(Bs(h,g,l),d=g,h=d.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(F){ot(d,d.return,F)}if(d=g,h=d.updateQueue,h!==null){var _=d.stateNode;try{var D=h.shared.hiddenCallbacks;if(D!==null)for(h.shared.hiddenCallbacks=null,h=0;h<D.length;h++)ly(D[h],_)}catch(F){ot(d,d.return,F)}}l&&j&64&&x0(g),No(g,g.return);break;case 27:w0(g);case 26:case 5:Bs(h,g,l),l&&d===null&&j&4&&S0(g),No(g,g.return);break;case 12:Bs(h,g,l);break;case 31:Bs(h,g,l),l&&j&4&&_0(h,g);break;case 13:Bs(h,g,l),l&&j&4&&E0(h,g);break;case 22:g.memoizedState===null&&Bs(h,g,l),No(g,g.return);break;case 30:break;default:Bs(h,g,l)}i=i.sibling}}function Gf(n,i){var l=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==l&&(n!=null&&n.refCount++,l!=null&&co(l))}function Ff(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&co(n))}function as(n,i,l,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)T0(n,i,l,d),i=i.sibling}function T0(n,i,l,d){var h=i.flags;switch(i.tag){case 0:case 11:case 15:as(n,i,l,d),h&2048&&wo(9,i);break;case 1:as(n,i,l,d);break;case 3:as(n,i,l,d),h&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&co(n)));break;case 12:if(h&2048){as(n,i,l,d),n=i.stateNode;try{var g=i.memoizedProps,j=g.id,_=g.onPostCommit;typeof _=="function"&&_(j,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(D){ot(i,i.return,D)}}else as(n,i,l,d);break;case 31:as(n,i,l,d);break;case 13:as(n,i,l,d);break;case 23:break;case 22:g=i.stateNode,j=i.alternate,i.memoizedState!==null?g._visibility&2?as(n,i,l,d):Co(n,i):g._visibility&2?as(n,i,l,d):(g._visibility|=2,cr(n,i,l,d,(i.subtreeFlags&10256)!==0||!1)),h&2048&&Gf(j,i);break;case 24:as(n,i,l,d),h&2048&&Ff(i.alternate,i);break;default:as(n,i,l,d)}}function cr(n,i,l,d,h){for(h=h&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var g=n,j=i,_=l,D=d,F=j.flags;switch(j.tag){case 0:case 11:case 15:cr(g,j,_,D,h),wo(8,j);break;case 23:break;case 22:var W=j.stateNode;j.memoizedState!==null?W._visibility&2?cr(g,j,_,D,h):Co(g,j):(W._visibility|=2,cr(g,j,_,D,h)),h&&F&2048&&Gf(j.alternate,j);break;case 24:cr(g,j,_,D,h),h&&F&2048&&Ff(j.alternate,j);break;default:cr(g,j,_,D,h)}i=i.sibling}}function Co(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=n,d=i,h=d.flags;switch(d.tag){case 22:Co(l,d),h&2048&&Gf(d.alternate,d);break;case 24:Co(l,d),h&2048&&Ff(d.alternate,d);break;default:Co(l,d)}i=i.sibling}}var ko=8192;function ur(n,i,l){if(n.subtreeFlags&ko)for(n=n.child;n!==null;)O0(n,i,l),n=n.sibling}function O0(n,i,l){switch(n.tag){case 26:ur(n,i,l),n.flags&ko&&n.memoizedState!==null&&HC(l,is,n.memoizedState,n.memoizedProps);break;case 5:ur(n,i,l);break;case 3:case 4:var d=is;is=kc(n.stateNode.containerInfo),ur(n,i,l),is=d;break;case 22:n.memoizedState===null&&(d=n.alternate,d!==null&&d.memoizedState!==null?(d=ko,ko=16777216,ur(n,i,l),ko=d):ur(n,i,l));break;default:ur(n,i,l)}}function L0(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function zo(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];Qt=d,M0(d,n)}L0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)D0(n),n=n.sibling}function D0(n){switch(n.tag){case 0:case 11:case 15:zo(n),n.flags&2048&&ui(9,n,n.return);break;case 3:zo(n);break;case 12:zo(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,hc(n)):zo(n);break;default:zo(n)}}function hc(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];Qt=d,M0(d,n)}L0(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:ui(8,i,i.return),hc(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,hc(i));break;default:hc(i)}n=n.sibling}}function M0(n,i){for(;Qt!==null;){var l=Qt;switch(l.tag){case 0:case 11:case 15:ui(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var d=l.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:co(l.memoizedState.cache)}if(d=l.child,d!==null)d.return=l,Qt=d;else e:for(l=n;Qt!==null;){d=Qt;var h=d.sibling,g=d.return;if(k0(d),d===l){Qt=null;break e}if(h!==null){h.return=g,Qt=h;break e}Qt=g}}}var iC={getCacheForType:function(n){var i=Jt(Pt),l=i.data.get(n);return l===void 0&&(l=n(),i.data.set(n,l)),l},cacheSignal:function(){return Jt(Pt).controller.signal}},aC=typeof WeakMap=="function"?WeakMap:Map,tt=0,mt=null,Ue=null,qe=0,rt=0,Tn=null,di=!1,dr=!1,Zf=!1,qs=0,Rt=0,fi=0,la=0,Vf=0,On=0,fr=0,_o=null,Sn=null,Qf=!1,mc=0,$0=0,pc=1/0,gc=null,hi=null,Kt=0,mi=null,hr=null,Hs=0,Yf=0,Jf=null,P0=null,Eo=0,Xf=null;function Ln(){return(tt&2)!==0&&qe!==0?qe&-qe:K.T!==null?ih():Ua()}function U0(){if(On===0)if((qe&536870912)===0||Fe){var n=$a;$a<<=1,($a&3932160)===0&&($a=262144),On=n}else On=536870912;return n=Rn.current,n!==null&&(n.flags|=32),On}function jn(n,i,l){(n===mt&&(rt===2||rt===9)||n.cancelPendingCommit!==null)&&(mr(n,0),pi(n,qe,On,!1)),Gi(n,l),((tt&2)===0||n!==mt)&&(n===mt&&((tt&2)===0&&(la|=l),Rt===4&&pi(n,qe,On,!1)),bs(n))}function I0(n,i,l){if((tt&6)!==0)throw Error(a(327));var d=!l&&(i&127)===0&&(i&n.expiredLanes)===0||Ys(n,i),h=d?lC(n,i):eh(n,i,!0),g=d;do{if(h===0){dr&&!d&&pi(n,i,0,!1);break}else{if(l=n.current.alternate,g&&!rC(l)){h=eh(n,i,!1),g=!1;continue}if(h===2){if(g=i,n.errorRecoveryDisabledLanes&g)var j=0;else j=n.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){i=j;e:{var _=n;h=_o;var D=_.current.memoizedState.isDehydrated;if(D&&(mr(_,j).flags|=256),j=eh(_,j,!1),j!==2){if(Zf&&!D){_.errorRecoveryDisabledLanes|=g,la|=g,h=4;break e}g=Sn,Sn=h,g!==null&&(Sn===null?Sn=g:Sn.push.apply(Sn,g))}h=j}if(g=!1,h!==2)continue}}if(h===1){mr(n,0),pi(n,i,0,!0);break}e:{switch(d=n,g=h,g){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:pi(d,i,On,!di);break e;case 2:Sn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(h=mc+300-Qe(),10<h)){if(pi(d,i,On,!di),Pa(d,0,!0)!==0)break e;Hs=i,d.timeoutHandle=yv(B0.bind(null,d,l,Sn,gc,Qf,i,On,la,fr,di,g,"Throttled",-0,0),h);break e}B0(d,l,Sn,gc,Qf,i,On,la,fr,di,g,null,-0,0)}}break}while(!0);bs(n)}function B0(n,i,l,d,h,g,j,_,D,F,W,ie,Z,Y){if(n.timeoutHandle=-1,ie=i.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:_s},O0(i,g,ie);var ve=(g&62914560)===g?mc-Qe():(g&4194048)===g?$0-Qe():0;if(ve=KC(ie,ve),ve!==null){Hs=g,n.cancelPendingCommit=ve(Q0.bind(null,n,i,g,l,d,h,j,_,D,W,ie,null,Z,Y)),pi(n,g,j,!F);return}}Q0(n,i,g,l,d,h,j,_,D)}function rC(n){for(var i=n;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var d=0;d<l.length;d++){var h=l[d],g=h.getSnapshot;h=h.value;try{if(!_n(g(),h))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function pi(n,i,l,d){i&=~Vf,i&=~la,n.suspendedLanes|=i,n.pingedLanes&=~i,d&&(n.warmLanes|=i),d=n.expirationTimes;for(var h=i;0<h;){var g=31-ce(h),j=1<<g;d[g]=-1,h&=~j}l!==0&&I(n,l,i)}function yc(){return(tt&6)===0?(Ro(0),!1):!0}function Wf(){if(Ue!==null){if(rt===0)var n=Ue.return;else n=Ue,Ts=Wi=null,pf(n),ir=null,fo=0,n=Ue;for(;n!==null;)v0(n.alternate,n),n=n.return;Ue=null}}function mr(n,i){var l=n.timeoutHandle;l!==-1&&(n.timeoutHandle=-1,kC(l)),l=n.cancelPendingCommit,l!==null&&(n.cancelPendingCommit=null,l()),Hs=0,Wf(),mt=n,Ue=l=Rs(n.current,null),qe=i,rt=0,Tn=null,di=!1,dr=Ys(n,i),Zf=!1,fr=On=Vf=la=fi=Rt=0,Sn=_o=null,Qf=!1,(i&8)!==0&&(i|=i&32);var d=n.entangledLanes;if(d!==0)for(n=n.entanglements,d&=i;0<d;){var h=31-ce(d),g=1<<h;i|=n[h],d&=~g}return qs=i,Pl(),l}function q0(n,i){Ae=null,K.H=bo,i===sr||i===Fl?(i=iy(),rt=3):i===nf?(i=iy(),rt=4):rt=i===Af?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Tn=i,Ue===null&&(Rt=1,rc(n,Un(i,n.current)))}function H0(){var n=Rn.current;return n===null?!0:(qe&4194048)===qe?Hn===null:(qe&62914560)===qe||(qe&536870912)!==0?n===Hn:!1}function K0(){var n=K.H;return K.H=bo,n===null?bo:n}function G0(){var n=K.A;return K.A=iC,n}function vc(){Rt=4,di||(qe&4194048)!==qe&&Rn.current!==null||(dr=!0),(fi&134217727)===0&&(la&134217727)===0||mt===null||pi(mt,qe,On,!1)}function eh(n,i,l){var d=tt;tt|=2;var h=K0(),g=G0();(mt!==n||qe!==i)&&(gc=null,mr(n,i)),i=!1;var j=Rt;e:do try{if(rt!==0&&Ue!==null){var _=Ue,D=Tn;switch(rt){case 8:Wf(),j=6;break e;case 3:case 2:case 9:case 6:Rn.current===null&&(i=!0);var F=rt;if(rt=0,Tn=null,pr(n,_,D,F),l&&dr){j=0;break e}break;default:F=rt,rt=0,Tn=null,pr(n,_,D,F)}}oC(),j=Rt;break}catch(W){q0(n,W)}while(!0);return i&&n.shellSuspendCounter++,Ts=Wi=null,tt=d,K.H=h,K.A=g,Ue===null&&(mt=null,qe=0,Pl()),j}function oC(){for(;Ue!==null;)F0(Ue)}function lC(n,i){var l=tt;tt|=2;var d=K0(),h=G0();mt!==n||qe!==i?(gc=null,pc=Qe()+500,mr(n,i)):dr=Ys(n,i);e:do try{if(rt!==0&&Ue!==null){i=Ue;var g=Tn;t:switch(rt){case 1:rt=0,Tn=null,pr(n,i,g,1);break;case 2:case 9:if(ny(g)){rt=0,Tn=null,Z0(i);break}i=function(){rt!==2&&rt!==9||mt!==n||(rt=7),bs(n)},g.then(i,i);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:ny(g)?(rt=0,Tn=null,Z0(i)):(rt=0,Tn=null,pr(n,i,g,7));break;case 5:var j=null;switch(Ue.tag){case 26:j=Ue.memoizedState;case 5:case 27:var _=Ue;if(j?Tv(j):_.stateNode.complete){rt=0,Tn=null;var D=_.sibling;if(D!==null)Ue=D;else{var F=_.return;F!==null?(Ue=F,xc(F)):Ue=null}break t}}rt=0,Tn=null,pr(n,i,g,5);break;case 6:rt=0,Tn=null,pr(n,i,g,6);break;case 8:Wf(),Rt=6;break e;default:throw Error(a(462))}}cC();break}catch(W){q0(n,W)}while(!0);return Ts=Wi=null,K.H=d,K.A=h,tt=l,Ue!==null?0:(mt=null,qe=0,Pl(),Rt)}function cC(){for(;Ue!==null&&!gt();)F0(Ue)}function F0(n){var i=g0(n.alternate,n,qs);n.memoizedProps=n.pendingProps,i===null?xc(n):Ue=i}function Z0(n){var i=n,l=i.alternate;switch(i.tag){case 15:case 0:i=u0(l,i,i.pendingProps,i.type,void 0,qe);break;case 11:i=u0(l,i,i.pendingProps,i.type.render,i.ref,qe);break;case 5:pf(i);default:v0(l,i),i=Ue=Gg(i,qs),i=g0(l,i,qs)}n.memoizedProps=n.pendingProps,i===null?xc(n):Ue=i}function pr(n,i,l,d){Ts=Wi=null,pf(i),ir=null,fo=0;var h=i.return;try{if(J1(n,h,i,l,qe)){Rt=1,rc(n,Un(l,n.current)),Ue=null;return}}catch(g){if(h!==null)throw Ue=h,g;Rt=1,rc(n,Un(l,n.current)),Ue=null;return}i.flags&32768?(Fe||d===1?n=!0:dr||(qe&536870912)!==0?n=!1:(di=n=!0,(d===2||d===9||d===3||d===6)&&(d=Rn.current,d!==null&&d.tag===13&&(d.flags|=16384))),V0(i,n)):xc(i)}function xc(n){var i=n;do{if((i.flags&32768)!==0){V0(i,di);return}n=i.return;var l=eC(i.alternate,i,qs);if(l!==null){Ue=l;return}if(i=i.sibling,i!==null){Ue=i;return}Ue=i=n}while(i!==null);Rt===0&&(Rt=5)}function V0(n,i){do{var l=tC(n.alternate,n);if(l!==null){l.flags&=32767,Ue=l;return}if(l=n.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(n=n.sibling,n!==null)){Ue=n;return}Ue=n=l}while(n!==null);Rt=6,Ue=null}function Q0(n,i,l,d,h,g,j,_,D){n.cancelPendingCommit=null;do bc();while(Kt!==0);if((tt&6)!==0)throw Error(a(327));if(i!==null){if(i===n.current)throw Error(a(177));if(g=i.lanes|i.childLanes,g|=Bd,Nl(n,l,g,j,_,D),n===mt&&(Ue=mt=null,qe=0),hr=i,mi=n,Hs=l,Yf=g,Jf=h,P0=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,hC(Be,function(){return ev(),null})):(n.callbackNode=null,n.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=K.T,K.T=null,h=ae.p,ae.p=2,j=tt,tt|=4;try{nC(n,i,l)}finally{tt=j,ae.p=h,K.T=d}}Kt=1,Y0(),J0(),X0()}}function Y0(){if(Kt===1){Kt=0;var n=mi,i=hr,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=K.T,K.T=null;var d=ae.p;ae.p=2;var h=tt;tt|=4;try{R0(i,n);var g=fh,j=Mg(n.containerInfo),_=g.focusedElem,D=g.selectionRange;if(j!==_&&_&&_.ownerDocument&&Dg(_.ownerDocument.documentElement,_)){if(D!==null&&Md(_)){var F=D.start,W=D.end;if(W===void 0&&(W=F),"selectionStart"in _)_.selectionStart=F,_.selectionEnd=Math.min(W,_.value.length);else{var ie=_.ownerDocument||document,Z=ie&&ie.defaultView||window;if(Z.getSelection){var Y=Z.getSelection(),ve=_.textContent.length,Ce=Math.min(D.start,ve),ft=D.end===void 0?Ce:Math.min(D.end,ve);!Y.extend&&Ce>ft&&(j=ft,ft=Ce,Ce=j);var q=Lg(_,Ce),$=Lg(_,ft);if(q&&$&&(Y.rangeCount!==1||Y.anchorNode!==q.node||Y.anchorOffset!==q.offset||Y.focusNode!==$.node||Y.focusOffset!==$.offset)){var G=ie.createRange();G.setStart(q.node,q.offset),Y.removeAllRanges(),Ce>ft?(Y.addRange(G),Y.extend($.node,$.offset)):(G.setEnd($.node,$.offset),Y.addRange(G))}}}}for(ie=[],Y=_;Y=Y.parentNode;)Y.nodeType===1&&ie.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<ie.length;_++){var te=ie[_];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}Tc=!!dh,fh=dh=null}finally{tt=h,ae.p=d,K.T=l}}n.current=i,Kt=2}}function J0(){if(Kt===2){Kt=0;var n=mi,i=hr,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=K.T,K.T=null;var d=ae.p;ae.p=2;var h=tt;tt|=4;try{C0(n,i.alternate,i)}finally{tt=h,ae.p=d,K.T=l}}Kt=3}}function X0(){if(Kt===4||Kt===3){Kt=0,Vt();var n=mi,i=hr,l=Hs,d=P0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Kt=5:(Kt=0,hr=mi=null,W0(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(hi=null),ln(l),i=i.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(ts,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=K.T,h=ae.p,ae.p=2,K.T=null;try{for(var g=n.onRecoverableError,j=0;j<d.length;j++){var _=d[j];g(_.value,{componentStack:_.stack})}}finally{K.T=i,ae.p=h}}(Hs&3)!==0&&bc(),bs(n),h=n.pendingLanes,(l&261930)!==0&&(h&42)!==0?n===Xf?Eo++:(Eo=0,Xf=n):Eo=0,Ro(0)}}function W0(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,co(i)))}function bc(){return Y0(),J0(),X0(),ev()}function ev(){if(Kt!==5)return!1;var n=mi,i=Yf;Yf=0;var l=ln(Hs),d=K.T,h=ae.p;try{ae.p=32>l?32:l,K.T=null,l=Jf,Jf=null;var g=mi,j=Hs;if(Kt=0,hr=mi=null,Hs=0,(tt&6)!==0)throw Error(a(331));var _=tt;if(tt|=4,D0(g.current),T0(g,g.current,j,l),tt=_,Ro(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(ts,g)}catch{}return!0}finally{ae.p=h,K.T=d,W0(n,i)}}function tv(n,i,l){i=Un(l,i),i=Rf(n.stateNode,i,2),n=oi(n,i,2),n!==null&&(Gi(n,2),bs(n))}function ot(n,i,l){if(n.tag===3)tv(n,n,l);else for(;i!==null;){if(i.tag===3){tv(i,n,l);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(hi===null||!hi.has(d))){n=Un(l,n),l=n0(2),d=oi(i,l,2),d!==null&&(s0(l,d,i,n),Gi(d,2),bs(d));break}}i=i.return}}function th(n,i,l){var d=n.pingCache;if(d===null){d=n.pingCache=new aC;var h=new Set;d.set(i,h)}else h=d.get(i),h===void 0&&(h=new Set,d.set(i,h));h.has(l)||(Zf=!0,h.add(l),n=uC.bind(null,n,i,l),i.then(n,n))}function uC(n,i,l){var d=n.pingCache;d!==null&&d.delete(i),n.pingedLanes|=n.suspendedLanes&l,n.warmLanes&=~l,mt===n&&(qe&l)===l&&(Rt===4||Rt===3&&(qe&62914560)===qe&&300>Qe()-mc?(tt&2)===0&&mr(n,0):Vf|=l,fr===qe&&(fr=0)),bs(n)}function nv(n,i){i===0&&(i=wl()),n=Yi(n,i),n!==null&&(Gi(n,i),bs(n))}function dC(n){var i=n.memoizedState,l=0;i!==null&&(l=i.retryLane),nv(n,l)}function fC(n,i){var l=0;switch(n.tag){case 31:case 13:var d=n.stateNode,h=n.memoizedState;h!==null&&(l=h.retryLane);break;case 19:d=n.stateNode;break;case 22:d=n.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),nv(n,l)}function hC(n,i){return re(n,i)}var Sc=null,gr=null,nh=!1,jc=!1,sh=!1,gi=0;function bs(n){n!==gr&&n.next===null&&(gr===null?Sc=gr=n:gr=gr.next=n),jc=!0,nh||(nh=!0,pC())}function Ro(n,i){if(!sh&&jc){sh=!0;do for(var l=!1,d=Sc;d!==null;){if(n!==0){var h=d.pendingLanes;if(h===0)var g=0;else{var j=d.suspendedLanes,_=d.pingedLanes;g=(1<<31-ce(42|n)+1)-1,g&=h&~(j&~_),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(l=!0,rv(d,g))}else g=qe,g=Pa(d,d===mt?g:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(g&3)===0||Ys(d,g)||(l=!0,rv(d,g));d=d.next}while(l);sh=!1}}function mC(){sv()}function sv(){jc=nh=!1;var n=0;gi!==0&&CC()&&(n=gi);for(var i=Qe(),l=null,d=Sc;d!==null;){var h=d.next,g=iv(d,i);g===0?(d.next=null,l===null?Sc=h:l.next=h,h===null&&(gr=l)):(l=d,(n!==0||(g&3)!==0)&&(jc=!0)),d=h}Kt!==0&&Kt!==5||Ro(n),gi!==0&&(gi=0)}function iv(n,i){for(var l=n.suspendedLanes,d=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var j=31-ce(g),_=1<<j,D=h[j];D===-1?((_&l)===0||(_&d)!==0)&&(h[j]=xd(_,i)):D<=i&&(n.expiredLanes|=_),g&=~_}if(i=mt,l=qe,l=Pa(n,n===i?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d=n.callbackNode,l===0||n===i&&(rt===2||rt===9)||n.cancelPendingCommit!==null)return d!==null&&d!==null&&Ge(d),n.callbackNode=null,n.callbackPriority=0;if((l&3)===0||Ys(n,l)){if(i=l&-l,i===n.callbackPriority)return i;switch(d!==null&&Ge(d),ln(l)){case 2:case 8:l=Nt;break;case 32:l=Be;break;case 268435456:l=pn;break;default:l=Be}return d=av.bind(null,n),l=re(l,d),n.callbackPriority=i,n.callbackNode=l,i}return d!==null&&d!==null&&Ge(d),n.callbackPriority=2,n.callbackNode=null,2}function av(n,i){if(Kt!==0&&Kt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var l=n.callbackNode;if(bc()&&n.callbackNode!==l)return null;var d=qe;return d=Pa(n,n===mt?d:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d===0?null:(I0(n,d,i),iv(n,Qe()),n.callbackNode!=null&&n.callbackNode===l?av.bind(null,n):null)}function rv(n,i){if(bc())return null;I0(n,i,!0)}function pC(){zC(function(){(tt&6)!==0?re(Ye,mC):sv()})}function ih(){if(gi===0){var n=tr;n===0&&(n=Ki,Ki<<=1,(Ki&261888)===0&&(Ki=256)),gi=n}return gi}function ov(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Rl(""+n)}function lv(n,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,n.id&&l.setAttribute("form",n.id),i.parentNode.insertBefore(l,i),n=new FormData(n),l.parentNode.removeChild(l),n}function gC(n,i,l,d,h){if(i==="submit"&&l&&l.stateNode===h){var g=ov((h[sn]||null).action),j=d.submitter;j&&(i=(i=j[sn]||null)?ov(i.formAction):j.getAttribute("formAction"),i!==null&&(g=i,j=null));var _=new Ll("action","action",null,d,h);n.push({event:_,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(gi!==0){var D=j?lv(h,j):new FormData(h);Nf(l,{pending:!0,data:D,method:h.method,action:g},null,D)}}else typeof g=="function"&&(_.preventDefault(),D=j?lv(h,j):new FormData(h),Nf(l,{pending:!0,data:D,method:h.method,action:g},g,D))},currentTarget:h}]})}}for(var ah=0;ah<Id.length;ah++){var rh=Id[ah],yC=rh.toLowerCase(),vC=rh[0].toUpperCase()+rh.slice(1);ss(yC,"on"+vC)}ss(Ug,"onAnimationEnd"),ss(Ig,"onAnimationIteration"),ss(Bg,"onAnimationStart"),ss("dblclick","onDoubleClick"),ss("focusin","onFocus"),ss("focusout","onBlur"),ss(L1,"onTransitionRun"),ss(D1,"onTransitionStart"),ss(M1,"onTransitionCancel"),ss(qg,"onTransitionEnd"),Ba("onMouseEnter",["mouseout","mouseover"]),Ba("onMouseLeave",["mouseout","mouseover"]),Ba("onPointerEnter",["pointerout","pointerover"]),Ba("onPointerLeave",["pointerout","pointerover"]),gs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),gs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),gs("onBeforeInput",["compositionend","keypress","textInput","paste"]),gs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),gs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),gs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ao="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(" "),xC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ao));function cv(n,i){i=(i&4)!==0;for(var l=0;l<n.length;l++){var d=n[l],h=d.event;d=d.listeners;e:{var g=void 0;if(i)for(var j=d.length-1;0<=j;j--){var _=d[j],D=_.instance,F=_.currentTarget;if(_=_.listener,D!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=F;try{g(h)}catch(W){$l(W)}h.currentTarget=null,g=D}else for(j=0;j<d.length;j++){if(_=d[j],D=_.instance,F=_.currentTarget,_=_.listener,D!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=F;try{g(h)}catch(W){$l(W)}h.currentTarget=null,g=D}}}}function Ie(n,i){var l=i[ks];l===void 0&&(l=i[ks]=new Set);var d=n+"__bubble";l.has(d)||(uv(i,n,2,!1),l.add(d))}function oh(n,i,l){var d=0;i&&(d|=4),uv(l,n,d,i)}var wc="_reactListening"+Math.random().toString(36).slice(2);function lh(n){if(!n[wc]){n[wc]=!0,ns.forEach(function(l){l!=="selectionchange"&&(xC.has(l)||oh(l,!1,n),oh(l,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[wc]||(i[wc]=!0,oh("selectionchange",!1,i))}}function uv(n,i,l,d){switch(Uv(i)){case 2:var h=ZC;break;case 8:h=VC;break;default:h=wh}l=h.bind(null,i,l,n),h=void 0,!zd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(h=!0),d?h!==void 0?n.addEventListener(i,l,{capture:!0,passive:h}):n.addEventListener(i,l,!0):h!==void 0?n.addEventListener(i,l,{passive:h}):n.addEventListener(i,l,!1)}function ch(n,i,l,d,h){var g=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var j=d.tag;if(j===3||j===4){var _=d.stateNode.containerInfo;if(_===h)break;if(j===4)for(j=d.return;j!==null;){var D=j.tag;if((D===3||D===4)&&j.stateNode.containerInfo===h)return;j=j.return}for(;_!==null;){if(j=Xs(_),j===null)return;if(D=j.tag,D===5||D===6||D===26||D===27){d=g=j;continue e}_=_.parentNode}}d=d.return}pg(function(){var F=g,W=Cd(l),ie=[];e:{var Z=Hg.get(n);if(Z!==void 0){var Y=Ll,ve=n;switch(n){case"keypress":if(Tl(l)===0)break e;case"keydown":case"keyup":Y=f1;break;case"focusin":ve="focus",Y=Ad;break;case"focusout":ve="blur",Y=Ad;break;case"beforeblur":case"afterblur":Y=Ad;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":Y=vg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=e1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=p1;break;case Ug:case Ig:case Bg:Y=s1;break;case qg:Y=y1;break;case"scroll":case"scrollend":Y=XN;break;case"wheel":Y=x1;break;case"copy":case"cut":case"paste":Y=a1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=bg;break;case"toggle":case"beforetoggle":Y=S1}var Ce=(i&4)!==0,ft=!Ce&&(n==="scroll"||n==="scrollend"),q=Ce?Z!==null?Z+"Capture":null:Z;Ce=[];for(var $=F,G;$!==null;){var te=$;if(G=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||G===null||q===null||(te=Xr($,q),te!=null&&Ce.push(To($,te,G))),ft)break;$=$.return}0<Ce.length&&(Z=new Y(Z,ve,null,l,W),ie.push({event:Z,listeners:Ce}))}}if((i&7)===0){e:{if(Z=n==="mouseover"||n==="pointerover",Y=n==="mouseout"||n==="pointerout",Z&&l!==Nd&&(ve=l.relatedTarget||l.fromElement)&&(Xs(ve)||ve[zn]))break e;if((Y||Z)&&(Z=W.window===W?W:(Z=W.ownerDocument)?Z.defaultView||Z.parentWindow:window,Y?(ve=l.relatedTarget||l.toElement,Y=F,ve=ve?Xs(ve):null,ve!==null&&(ft=c(ve),Ce=ve.tag,ve!==ft||Ce!==5&&Ce!==27&&Ce!==6)&&(ve=null)):(Y=null,ve=F),Y!==ve)){if(Ce=vg,te="onMouseLeave",q="onMouseEnter",$="mouse",(n==="pointerout"||n==="pointerover")&&(Ce=bg,te="onPointerLeave",q="onPointerEnter",$="pointer"),ft=Y==null?Z:Me(Y),G=ve==null?Z:Me(ve),Z=new Ce(te,$+"leave",Y,l,W),Z.target=ft,Z.relatedTarget=G,te=null,Xs(W)===F&&(Ce=new Ce(q,$+"enter",ve,l,W),Ce.target=G,Ce.relatedTarget=ft,te=Ce),ft=te,Y&&ve)t:{for(Ce=bC,q=Y,$=ve,G=0,te=q;te;te=Ce(te))G++;te=0;for(var Ne=$;Ne;Ne=Ce(Ne))te++;for(;0<G-te;)q=Ce(q),G--;for(;0<te-G;)$=Ce($),te--;for(;G--;){if(q===$||$!==null&&q===$.alternate){Ce=q;break t}q=Ce(q),$=Ce($)}Ce=null}else Ce=null;Y!==null&&dv(ie,Z,Y,Ce,!1),ve!==null&&ft!==null&&dv(ie,ft,ve,Ce,!0)}}e:{if(Z=F?Me(F):window,Y=Z.nodeName&&Z.nodeName.toLowerCase(),Y==="select"||Y==="input"&&Z.type==="file")var Xe=_g;else if(kg(Z))if(Eg)Xe=A1;else{Xe=E1;var Se=_1}else Y=Z.nodeName,!Y||Y.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?F&&wd(F.elementType)&&(Xe=_g):Xe=R1;if(Xe&&(Xe=Xe(n,F))){zg(ie,Xe,l,W);break e}Se&&Se(n,Z,F),n==="focusout"&&F&&Z.type==="number"&&F.memoizedProps.value!=null&&jd(Z,"number",Z.value)}switch(Se=F?Me(F):window,n){case"focusin":(kg(Se)||Se.contentEditable==="true")&&(Za=Se,$d=F,ro=null);break;case"focusout":ro=$d=Za=null;break;case"mousedown":Pd=!0;break;case"contextmenu":case"mouseup":case"dragend":Pd=!1,$g(ie,l,W);break;case"selectionchange":if(O1)break;case"keydown":case"keyup":$g(ie,l,W)}var Oe;if(Od)e:{switch(n){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else Fa?Ng(n,l)&&(He="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(He="onCompositionStart");He&&(Sg&&l.locale!=="ko"&&(Fa||He!=="onCompositionStart"?He==="onCompositionEnd"&&Fa&&(Oe=gg()):(ei=W,_d="value"in ei?ei.value:ei.textContent,Fa=!0)),Se=Nc(F,He),0<Se.length&&(He=new xg(He,n,null,l,W),ie.push({event:He,listeners:Se}),Oe?He.data=Oe:(Oe=Cg(l),Oe!==null&&(He.data=Oe)))),(Oe=w1?N1(n,l):C1(n,l))&&(He=Nc(F,"onBeforeInput"),0<He.length&&(Se=new xg("onBeforeInput","beforeinput",null,l,W),ie.push({event:Se,listeners:He}),Se.data=Oe)),gC(ie,n,F,l,W)}cv(ie,i)})}function To(n,i,l){return{instance:n,listener:i,currentTarget:l}}function Nc(n,i){for(var l=i+"Capture",d=[];n!==null;){var h=n,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=Xr(n,l),h!=null&&d.unshift(To(n,h,g)),h=Xr(n,i),h!=null&&d.push(To(n,h,g))),n.tag===3)return d;n=n.return}return[]}function bC(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function dv(n,i,l,d,h){for(var g=i._reactName,j=[];l!==null&&l!==d;){var _=l,D=_.alternate,F=_.stateNode;if(_=_.tag,D!==null&&D===d)break;_!==5&&_!==26&&_!==27||F===null||(D=F,h?(F=Xr(l,g),F!=null&&j.unshift(To(l,F,D))):h||(F=Xr(l,g),F!=null&&j.push(To(l,F,D)))),l=l.return}j.length!==0&&n.push({event:i,listeners:j})}var SC=/\r\n?/g,jC=/\u0000|\uFFFD/g;function fv(n){return(typeof n=="string"?n:""+n).replace(SC,`
9
9
  `).replace(jC,"")}function hv(n,i){return i=fv(i),fv(n)===i}function dt(n,i,l,d,h,g){switch(l){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Ha(n,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Ha(n,""+d);break;case"className":_l(n,"class",d);break;case"tabIndex":_l(n,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":_l(n,l,d);break;case"style":hg(n,d,g);break;case"data":if(i!=="object"){_l(n,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||l!=="href")){n.removeAttribute(l);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=Rl(""+d),n.setAttribute(l,d);break;case"action":case"formAction":if(typeof d=="function"){n.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 g=="function"&&(l==="formAction"?(i!=="input"&&dt(n,i,"name",h.name,h,null),dt(n,i,"formEncType",h.formEncType,h,null),dt(n,i,"formMethod",h.formMethod,h,null),dt(n,i,"formTarget",h.formTarget,h,null)):(dt(n,i,"encType",h.encType,h,null),dt(n,i,"method",h.method,h,null),dt(n,i,"target",h.target,h,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=Rl(""+d),n.setAttribute(l,d);break;case"onClick":d!=null&&(n.onclick=_s);break;case"onScroll":d!=null&&Ie("scroll",n);break;case"onScrollEnd":d!=null&&Ie("scrollend",n);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(l=d.__html,l!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=l}}break;case"multiple":n.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":n.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){n.removeAttribute("xlink:href");break}l=Rl(""+d),n.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":d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,""+d):n.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":d&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,""):n.removeAttribute(l);break;case"capture":case"download":d===!0?n.setAttribute(l,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,d):n.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?n.setAttribute(l,d):n.removeAttribute(l);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?n.removeAttribute(l):n.setAttribute(l,d);break;case"popover":Ie("beforetoggle",n),Ie("toggle",n),zl(n,"popover",d);break;case"xlinkActuate":zs(n,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":zs(n,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":zs(n,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":zs(n,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":zs(n,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":zs(n,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":zs(n,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":zs(n,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":zs(n,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":zl(n,"is",d);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=YN.get(l)||l,zl(n,l,d))}}function uh(n,i,l,d,h,g){switch(l){case"style":hg(n,d,g);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(l=d.__html,l!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=l}}break;case"children":typeof d=="string"?Ha(n,d):(typeof d=="number"||typeof d=="bigint")&&Ha(n,""+d);break;case"onScroll":d!=null&&Ie("scroll",n);break;case"onScrollEnd":d!=null&&Ie("scrollend",n);break;case"onClick":d!=null&&(n.onclick=_s);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fi.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(h=l.endsWith("Capture"),i=l.slice(2,h?l.length-7:void 0),g=n[sn]||null,g=g!=null?g[l]:null,typeof g=="function"&&n.removeEventListener(i,g,h),typeof d=="function")){typeof g!="function"&&g!==null&&(l in n?n[l]=null:n.hasAttribute(l)&&n.removeAttribute(l)),n.addEventListener(i,d,h);break e}l in n?n[l]=d:d===!0?n.setAttribute(l,""):zl(n,l,d)}}}function Wt(n,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",n),Ie("load",n);var d=!1,h=!1,g;for(g in l)if(l.hasOwnProperty(g)){var j=l[g];if(j!=null)switch(g){case"src":d=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:dt(n,i,g,j,l,null)}}h&&dt(n,i,"srcSet",l.srcSet,l,null),d&&dt(n,i,"src",l.src,l,null);return;case"input":Ie("invalid",n);var _=g=j=h=null,D=null,F=null;for(d in l)if(l.hasOwnProperty(d)){var W=l[d];if(W!=null)switch(d){case"name":h=W;break;case"type":j=W;break;case"checked":D=W;break;case"defaultChecked":F=W;break;case"value":g=W;break;case"defaultValue":_=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(a(137,i));break;default:dt(n,i,d,W,l,null)}}cg(n,g,_,D,F,j,h,!1);return;case"select":Ie("invalid",n),d=j=g=null;for(h in l)if(l.hasOwnProperty(h)&&(_=l[h],_!=null))switch(h){case"value":g=_;break;case"defaultValue":j=_;break;case"multiple":d=_;default:dt(n,i,h,_,l,null)}i=g,l=j,n.multiple=!!d,i!=null?qa(n,!!d,i,!1):l!=null&&qa(n,!!d,l,!0);return;case"textarea":Ie("invalid",n),g=h=d=null;for(j in l)if(l.hasOwnProperty(j)&&(_=l[j],_!=null))switch(j){case"value":d=_;break;case"defaultValue":h=_;break;case"children":g=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:dt(n,i,j,_,l,null)}dg(n,d,h,g);return;case"option":for(D in l)l.hasOwnProperty(D)&&(d=l[D],d!=null)&&(D==="selected"?n.selected=d&&typeof d!="function"&&typeof d!="symbol":dt(n,i,D,d,l,null));return;case"dialog":Ie("beforetoggle",n),Ie("toggle",n),Ie("cancel",n),Ie("close",n);break;case"iframe":case"object":Ie("load",n);break;case"video":case"audio":for(d=0;d<Ao.length;d++)Ie(Ao[d],n);break;case"image":Ie("error",n),Ie("load",n);break;case"details":Ie("toggle",n);break;case"embed":case"source":case"link":Ie("error",n),Ie("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in l)if(l.hasOwnProperty(F)&&(d=l[F],d!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:dt(n,i,F,d,l,null)}return;default:if(wd(i)){for(W in l)l.hasOwnProperty(W)&&(d=l[W],d!==void 0&&uh(n,i,W,d,l,void 0));return}}for(_ in l)l.hasOwnProperty(_)&&(d=l[_],d!=null&&dt(n,i,_,d,l,null))}function wC(n,i,l,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,g=null,j=null,_=null,D=null,F=null,W=null;for(Y in l){var ie=l[Y];if(l.hasOwnProperty(Y)&&ie!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":D=ie;default:d.hasOwnProperty(Y)||dt(n,i,Y,null,d,ie)}}for(var Z in d){var Y=d[Z];if(ie=l[Z],d.hasOwnProperty(Z)&&(Y!=null||ie!=null))switch(Z){case"type":g=Y;break;case"name":h=Y;break;case"checked":F=Y;break;case"defaultChecked":W=Y;break;case"value":j=Y;break;case"defaultValue":_=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:Y!==ie&&dt(n,i,Z,Y,d,ie)}}Sd(n,j,_,D,F,W,g,h);return;case"select":Y=j=_=Z=null;for(g in l)if(D=l[g],l.hasOwnProperty(g)&&D!=null)switch(g){case"value":break;case"multiple":Y=D;default:d.hasOwnProperty(g)||dt(n,i,g,null,d,D)}for(h in d)if(g=d[h],D=l[h],d.hasOwnProperty(h)&&(g!=null||D!=null))switch(h){case"value":Z=g;break;case"defaultValue":_=g;break;case"multiple":j=g;default:g!==D&&dt(n,i,h,g,d,D)}i=_,l=j,d=Y,Z!=null?qa(n,!!l,Z,!1):!!d!=!!l&&(i!=null?qa(n,!!l,i,!0):qa(n,!!l,l?[]:"",!1));return;case"textarea":Y=Z=null;for(_ in l)if(h=l[_],l.hasOwnProperty(_)&&h!=null&&!d.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:dt(n,i,_,null,d,h)}for(j in d)if(h=d[j],g=l[j],d.hasOwnProperty(j)&&(h!=null||g!=null))switch(j){case"value":Z=h;break;case"defaultValue":Y=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==g&&dt(n,i,j,h,d,g)}ug(n,Z,Y);return;case"option":for(var ve in l)Z=l[ve],l.hasOwnProperty(ve)&&Z!=null&&!d.hasOwnProperty(ve)&&(ve==="selected"?n.selected=!1:dt(n,i,ve,null,d,Z));for(D in d)Z=d[D],Y=l[D],d.hasOwnProperty(D)&&Z!==Y&&(Z!=null||Y!=null)&&(D==="selected"?n.selected=Z&&typeof Z!="function"&&typeof Z!="symbol":dt(n,i,D,Z,d,Y));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 Ce in l)Z=l[Ce],l.hasOwnProperty(Ce)&&Z!=null&&!d.hasOwnProperty(Ce)&&dt(n,i,Ce,null,d,Z);for(F in d)if(Z=d[F],Y=l[F],d.hasOwnProperty(F)&&Z!==Y&&(Z!=null||Y!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(a(137,i));break;default:dt(n,i,F,Z,d,Y)}return;default:if(wd(i)){for(var ft in l)Z=l[ft],l.hasOwnProperty(ft)&&Z!==void 0&&!d.hasOwnProperty(ft)&&uh(n,i,ft,void 0,d,Z);for(W in d)Z=d[W],Y=l[W],!d.hasOwnProperty(W)||Z===Y||Z===void 0&&Y===void 0||uh(n,i,W,Z,d,Y);return}}for(var q in l)Z=l[q],l.hasOwnProperty(q)&&Z!=null&&!d.hasOwnProperty(q)&&dt(n,i,q,null,d,Z);for(ie in d)Z=d[ie],Y=l[ie],!d.hasOwnProperty(ie)||Z===Y||Z==null&&Y==null||dt(n,i,ie,Z,d,Y)}function mv(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function NC(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,l=performance.getEntriesByType("resource"),d=0;d<l.length;d++){var h=l[d],g=h.transferSize,j=h.initiatorType,_=h.duration;if(g&&_&&mv(j)){for(j=0,_=h.responseEnd,d+=1;d<l.length;d++){var D=l[d],F=D.startTime;if(F>_)break;var W=D.transferSize,ie=D.initiatorType;W&&mv(ie)&&(D=D.responseEnd,j+=W*(D<_?1:(_-F)/(D-F)))}if(--d,i+=8*(g+j)/(h.duration/1e3),n++,10<n)break}}if(0<n)return i/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var dh=null,fh=null;function Cc(n){return n.nodeType===9?n:n.ownerDocument}function pv(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function gv(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function hh(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var mh=null;function CC(){var n=window.event;return n&&n.type==="popstate"?n===mh?!1:(mh=n,!0):(mh=null,!1)}var yv=typeof setTimeout=="function"?setTimeout:void 0,kC=typeof clearTimeout=="function"?clearTimeout:void 0,vv=typeof Promise=="function"?Promise:void 0,zC=typeof queueMicrotask=="function"?queueMicrotask:typeof vv<"u"?function(n){return vv.resolve(null).then(n).catch(_C)}:yv;function _C(n){setTimeout(function(){throw n})}function yi(n){return n==="head"}function xv(n,i){var l=i,d=0;do{var h=l.nextSibling;if(n.removeChild(l),h&&h.nodeType===8)if(l=h.data,l==="/$"||l==="/&"){if(d===0){n.removeChild(h),br(i);return}d--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")d++;else if(l==="html")Oo(n.ownerDocument.documentElement);else if(l==="head"){l=n.ownerDocument.head,Oo(l);for(var g=l.firstChild;g;){var j=g.nextSibling,_=g.nodeName;g[ps]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&g.rel.toLowerCase()==="stylesheet"||l.removeChild(g),g=j}}else l==="body"&&Oo(n.ownerDocument.body);l=h}while(l);br(i)}function bv(n,i){var l=n;n=0;do{var d=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),d&&d.nodeType===8)if(l=d.data,l==="/$"){if(n===0)break;n--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||n++;l=d}while(l)}function ph(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":ph(l),Js(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}n.removeChild(l)}}function EC(n,i,l,d){for(;n.nodeType===1;){var h=l;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(d){if(!n[ps])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(g=n.getAttribute("rel"),g==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(g!==h.rel||n.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||n.getAttribute("title")!==(h.title==null?null:h.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(g=n.getAttribute("src"),(g!==(h.src==null?null:h.src)||n.getAttribute("type")!==(h.type==null?null:h.type)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&g&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var g=h.name==null?null:""+h.name;if(h.type==="hidden"&&n.getAttribute("name")===g)return n}else return n;if(n=Kn(n.nextSibling),n===null)break}return null}function RC(n,i,l){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!l||(n=Kn(n.nextSibling),n===null))return null;return n}function Sv(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=Kn(n.nextSibling),n===null))return null;return n}function gh(n){return n.data==="$?"||n.data==="$~"}function yh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function AC(n,i){var l=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||l.readyState!=="loading")i();else{var d=function(){i(),l.removeEventListener("DOMContentLoaded",d)};l.addEventListener("DOMContentLoaded",d),n._reactRetry=d}}function Kn(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return n}var vh=null;function jv(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"||l==="/&"){if(i===0)return Kn(n.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}n=n.nextSibling}return null}function wv(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return n;i--}else l!=="/$"&&l!=="/&"||i++}n=n.previousSibling}return null}function Nv(n,i,l){switch(i=Cc(l),n){case"html":if(n=i.documentElement,!n)throw Error(a(452));return n;case"head":if(n=i.head,!n)throw Error(a(453));return n;case"body":if(n=i.body,!n)throw Error(a(454));return n;default:throw Error(a(451))}}function Oo(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);Js(n)}var Gn=new Map,Cv=new Set;function kc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Ks=ae.d;ae.d={f:TC,r:OC,D:LC,C:DC,L:MC,m:$C,X:UC,S:PC,M:IC};function TC(){var n=Ks.f(),i=yc();return n||i}function OC(n){var i=Ws(n);i!==null&&i.tag===5&&i.type==="form"?qy(i):Ks.r(n)}var yr=typeof document>"u"?null:document;function kv(n,i,l){var d=yr;if(d&&typeof i=="string"&&i){var h=$n(i);h='link[rel="'+n+'"][href="'+h+'"]',typeof l=="string"&&(h+='[crossorigin="'+l+'"]'),Cv.has(h)||(Cv.add(h),n={rel:n,crossOrigin:l,href:i},d.querySelector(h)===null&&(i=d.createElement("link"),Wt(i,"link",n),it(i),d.head.appendChild(i)))}}function LC(n){Ks.D(n),kv("dns-prefetch",n,null)}function DC(n,i){Ks.C(n,i),kv("preconnect",n,i)}function MC(n,i,l){Ks.L(n,i,l);var d=yr;if(d&&n&&i){var h='link[rel="preload"][as="'+$n(i)+'"]';i==="image"&&l&&l.imageSrcSet?(h+='[imagesrcset="'+$n(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(h+='[imagesizes="'+$n(l.imageSizes)+'"]')):h+='[href="'+$n(n)+'"]';var g=h;switch(i){case"style":g=vr(n);break;case"script":g=xr(n)}Gn.has(g)||(n=y({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:n,as:i},l),Gn.set(g,n),d.querySelector(h)!==null||i==="style"&&d.querySelector(Lo(g))||i==="script"&&d.querySelector(Do(g))||(i=d.createElement("link"),Wt(i,"link",n),it(i),d.head.appendChild(i)))}}function $C(n,i){Ks.m(n,i);var l=yr;if(l&&n){var d=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+$n(d)+'"][href="'+$n(n)+'"]',g=h;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=xr(n)}if(!Gn.has(g)&&(n=y({rel:"modulepreload",href:n},i),Gn.set(g,n),l.querySelector(h)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Do(g)))return}d=l.createElement("link"),Wt(d,"link",n),it(d),l.head.appendChild(d)}}}function PC(n,i,l){Ks.S(n,i,l);var d=yr;if(d&&n){var h=Je(d).hoistableStyles,g=vr(n);i=i||"default";var j=h.get(g);if(!j){var _={loading:0,preload:null};if(j=d.querySelector(Lo(g)))_.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":i},l),(l=Gn.get(g))&&xh(n,l);var D=j=d.createElement("link");it(D),Wt(D,"link",n),D._p=new Promise(function(F,W){D.onload=F,D.onerror=W}),D.addEventListener("load",function(){_.loading|=1}),D.addEventListener("error",function(){_.loading|=2}),_.loading|=4,zc(j,i,d)}j={type:"stylesheet",instance:j,count:1,state:_},h.set(g,j)}}}function UC(n,i){Ks.X(n,i);var l=yr;if(l&&n){var d=Je(l).hoistableScripts,h=xr(n),g=d.get(h);g||(g=l.querySelector(Do(h)),g||(n=y({src:n,async:!0},i),(i=Gn.get(h))&&bh(n,i),g=l.createElement("script"),it(g),Wt(g,"link",n),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},d.set(h,g))}}function IC(n,i){Ks.M(n,i);var l=yr;if(l&&n){var d=Je(l).hoistableScripts,h=xr(n),g=d.get(h);g||(g=l.querySelector(Do(h)),g||(n=y({src:n,async:!0,type:"module"},i),(i=Gn.get(h))&&bh(n,i),g=l.createElement("script"),it(g),Wt(g,"link",n),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},d.set(h,g))}}function zv(n,i,l,d){var h=(h=fe.current)?kc(h):null;if(!h)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=vr(l.href),l=Je(h).hoistableStyles,d=l.get(i),d||(d={type:"style",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){n=vr(l.href);var g=Je(h).hoistableStyles,j=g.get(n);if(j||(h=h.ownerDocument||h,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,j),(g=h.querySelector(Lo(n)))&&!g._p&&(j.instance=g,j.state.loading=5),Gn.has(n)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Gn.set(n,l),g||BC(h,n,l,j.state))),i&&d===null)throw Error(a(528,""));return j}if(i&&d!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=xr(l),l=Je(h).hoistableScripts,d=l.get(i),d||(d={type:"script",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function vr(n){return'href="'+$n(n)+'"'}function Lo(n){return'link[rel="stylesheet"]['+n+"]"}function _v(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function BC(n,i,l,d){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=n.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),Wt(i,"link",l),it(i),n.head.appendChild(i))}function xr(n){return'[src="'+$n(n)+'"]'}function Do(n){return"script[async]"+n}function Ev(n,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var d=n.querySelector('style[data-href~="'+$n(l.href)+'"]');if(d)return i.instance=d,it(d),d;var h=y({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(n.ownerDocument||n).createElement("style"),it(d),Wt(d,"style",h),zc(d,l.precedence,n),i.instance=d;case"stylesheet":h=vr(l.href);var g=n.querySelector(Lo(h));if(g)return i.state.loading|=4,i.instance=g,it(g),g;d=_v(l),(h=Gn.get(h))&&xh(d,h),g=(n.ownerDocument||n).createElement("link"),it(g);var j=g;return j._p=new Promise(function(_,D){j.onload=_,j.onerror=D}),Wt(g,"link",d),i.state.loading|=4,zc(g,l.precedence,n),i.instance=g;case"script":return g=xr(l.src),(h=n.querySelector(Do(g)))?(i.instance=h,it(h),h):(d=l,(h=Gn.get(g))&&(d=y({},l),bh(d,h)),n=n.ownerDocument||n,h=n.createElement("script"),it(h),Wt(h,"link",d),n.head.appendChild(h),i.instance=h);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(d=i.instance,i.state.loading|=4,zc(d,l.precedence,n));return i.instance}function zc(n,i,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=d.length?d[d.length-1]:null,g=h,j=0;j<d.length;j++){var _=d[j];if(_.dataset.precedence===i)g=_;else if(g!==h)break}g?g.parentNode.insertBefore(n,g.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(n,i.firstChild))}function xh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function bh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var _c=null;function Rv(n,i,l){if(_c===null){var d=new Map,h=_c=new Map;h.set(l,d)}else h=_c,d=h.get(l),d||(d=new Map,h.set(l,d));if(d.has(n))return d;for(d.set(n,null),l=l.getElementsByTagName(n),h=0;h<l.length;h++){var g=l[h];if(!(g[ps]||g[st]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var j=g.getAttribute(i)||"";j=n+j;var _=d.get(j);_?_.push(g):d.set(j,[g])}}return d}function Av(n,i,l){n=n.ownerDocument||n,n.head.insertBefore(l,i==="title"?n.querySelector("head > title"):null)}function qC(n,i,l){if(l===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(n=i.disabled,typeof i.precedence=="string"&&n==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Tv(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function HC(n,i,l,d){if(l.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var h=vr(d.href),g=i.querySelector(Lo(h));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=Ec.bind(n),i.then(n,n)),l.state.loading|=4,l.instance=g,it(g);return}g=i.ownerDocument||i,d=_v(d),(h=Gn.get(h))&&xh(d,h),g=g.createElement("link"),it(g);var j=g;j._p=new Promise(function(_,D){j.onload=_,j.onerror=D}),Wt(g,"link",d),l.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(n.count++,l=Ec.bind(n),i.addEventListener("load",l),i.addEventListener("error",l))}}var Sh=0;function KC(n,i){return n.stylesheets&&n.count===0&&Ac(n,n.stylesheets),0<n.count||0<n.imgCount?function(l){var d=setTimeout(function(){if(n.stylesheets&&Ac(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+i);0<n.imgBytes&&Sh===0&&(Sh=62500*NC());var h=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Ac(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>Sh?50:800)+i);return n.unsuspend=l,function(){n.unsuspend=null,clearTimeout(d),clearTimeout(h)}}:null}function Ec(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ac(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Rc=null;function Ac(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Rc=new Map,i.forEach(GC,n),Rc=null,Ec.call(n))}function GC(n,i){if(!(i.state.loading&4)){var l=Rc.get(n);if(l)var d=l.get(null);else{l=new Map,Rc.set(n,l);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<h.length;g++){var j=h[g];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(l.set(j.dataset.precedence,j),d=j)}d&&l.set(null,d)}h=i.instance,j=h.getAttribute("data-precedence"),g=l.get(j)||d,g===d&&l.set(null,h),l.set(j,h),this.count++,d=Ec.bind(this),h.addEventListener("load",d),h.addEventListener("error",d),g?g.parentNode.insertBefore(h,g.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(h,n.firstChild)),i.state.loading|=4}}var Mo={$$typeof:R,Provider:null,Consumer:null,_currentValue:me,_currentValue2:me,_threadCount:0};function FC(n,i,l,d,h,g,j,_,D){this.tag=1,this.containerInfo=n,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=Jr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jr(0),this.hiddenUpdates=Jr(null),this.identifierPrefix=d,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Ov(n,i,l,d,h,g,j,_,D,F,W,ie){return n=new FC(n,i,l,j,D,F,W,ie,_),i=1,g===!0&&(i|=24),g=En(3,null,null,i),n.current=g,g.stateNode=n,i=Wd(),i.refCount++,n.pooledCache=i,i.refCount++,g.memoizedState={element:d,isDehydrated:l,cache:i},sf(g),n}function Lv(n){return n?(n=Ya,n):Ya}function Dv(n,i,l,d,h,g){h=Lv(h),d.context===null?d.context=h:d.pendingContext=h,d=ri(i),d.payload={element:l},g=g===void 0?null:g,g!==null&&(d.callback=g),l=oi(n,d,i),l!==null&&(jn(l,n,i),mo(l,n,i))}function Mv(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<i?l:i}}function jh(n,i){Mv(n,i),(n=n.alternate)&&Mv(n,i)}function $v(n){if(n.tag===13||n.tag===31){var i=Yi(n,67108864);i!==null&&jn(i,n,67108864),jh(n,67108864)}}function Pv(n){if(n.tag===13||n.tag===31){var i=Ln();i=Ht(i);var l=Yi(n,i);l!==null&&jn(l,n,i),jh(n,i)}}var Tc=!0;function ZC(n,i,l,d){var h=K.T;K.T=null;var g=ae.p;try{ae.p=2,wh(n,i,l,d)}finally{ae.p=g,K.T=h}}function VC(n,i,l,d){var h=K.T;K.T=null;var g=ae.p;try{ae.p=8,wh(n,i,l,d)}finally{ae.p=g,K.T=h}}function wh(n,i,l,d){if(Tc){var h=Nh(d);if(h===null)ch(n,i,d,Oc,l),Iv(n,d);else if(YC(h,n,i,l,d))d.stopPropagation();else if(Iv(n,d),i&4&&-1<QC.indexOf(n)){for(;h!==null;){var g=Ws(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var j=hs(g.pendingLanes);if(j!==0){var _=g;for(_.pendingLanes|=2,_.entangledLanes|=2;j;){var D=1<<31-ce(j);_.entanglements[1]|=D,j&=~D}bs(g),(tt&6)===0&&(pc=Qe()+500,Ro(0))}}break;case 31:case 13:_=Yi(g,2),_!==null&&jn(_,g,2),yc(),jh(g,2)}if(g=Nh(d),g===null&&ch(n,i,d,Oc,l),g===h)break;h=g}h!==null&&d.stopPropagation()}else ch(n,i,d,null,l)}}function Nh(n){return n=Cd(n),Ch(n)}var Oc=null;function Ch(n){if(Oc=null,n=Xs(n),n!==null){var i=c(n);if(i===null)n=null;else{var l=i.tag;if(l===13){if(n=u(i),n!==null)return n;n=null}else if(l===31){if(n=f(i),n!==null)return n;n=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return Oc=n,null}function Uv(n){switch(n){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(De()){case Ye:return 2;case Nt:return 8;case Be:case Da:return 32;case pn:return 268435456;default:return 32}default:return 32}}var kh=!1,vi=null,xi=null,bi=null,$o=new Map,Po=new Map,Si=[],QC="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 Iv(n,i){switch(n){case"focusin":case"focusout":vi=null;break;case"dragenter":case"dragleave":xi=null;break;case"mouseover":case"mouseout":bi=null;break;case"pointerover":case"pointerout":$o.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Po.delete(i.pointerId)}}function Uo(n,i,l,d,h,g){return n===null||n.nativeEvent!==g?(n={blockedOn:i,domEventName:l,eventSystemFlags:d,nativeEvent:g,targetContainers:[h]},i!==null&&(i=Ws(i),i!==null&&$v(i)),n):(n.eventSystemFlags|=d,i=n.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),n)}function YC(n,i,l,d,h){switch(i){case"focusin":return vi=Uo(vi,n,i,l,d,h),!0;case"dragenter":return xi=Uo(xi,n,i,l,d,h),!0;case"mouseover":return bi=Uo(bi,n,i,l,d,h),!0;case"pointerover":var g=h.pointerId;return $o.set(g,Uo($o.get(g)||null,n,i,l,d,h)),!0;case"gotpointercapture":return g=h.pointerId,Po.set(g,Uo(Po.get(g)||null,n,i,l,d,h)),!0}return!1}function Bv(n){var i=Xs(n.target);if(i!==null){var l=c(i);if(l!==null){if(i=l.tag,i===13){if(i=u(l),i!==null){n.blockedOn=i,ms(n.priority,function(){Pv(l)});return}}else if(i===31){if(i=f(l),i!==null){n.blockedOn=i,ms(n.priority,function(){Pv(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Lc(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var l=Nh(n.nativeEvent);if(l===null){l=n.nativeEvent;var d=new l.constructor(l.type,l);Nd=d,l.target.dispatchEvent(d),Nd=null}else return i=Ws(l),i!==null&&$v(i),n.blockedOn=l,!1;i.shift()}return!0}function qv(n,i,l){Lc(n)&&l.delete(i)}function JC(){kh=!1,vi!==null&&Lc(vi)&&(vi=null),xi!==null&&Lc(xi)&&(xi=null),bi!==null&&Lc(bi)&&(bi=null),$o.forEach(qv),Po.forEach(qv)}function Dc(n,i){n.blockedOn===i&&(n.blockedOn=null,kh||(kh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,JC)))}var Mc=null;function Hv(n){Mc!==n&&(Mc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Mc===n&&(Mc=null);for(var i=0;i<n.length;i+=3){var l=n[i],d=n[i+1],h=n[i+2];if(typeof d!="function"){if(Ch(d||l)===null)continue;break}var g=Ws(l);g!==null&&(n.splice(i,3),i-=3,Nf(g,{pending:!0,data:h,method:l.method,action:d},d,h))}}))}function br(n){function i(D){return Dc(D,n)}vi!==null&&Dc(vi,n),xi!==null&&Dc(xi,n),bi!==null&&Dc(bi,n),$o.forEach(i),Po.forEach(i);for(var l=0;l<Si.length;l++){var d=Si[l];d.blockedOn===n&&(d.blockedOn=null)}for(;0<Si.length&&(l=Si[0],l.blockedOn===null);)Bv(l),l.blockedOn===null&&Si.shift();if(l=(n.ownerDocument||n).$$reactFormReplay,l!=null)for(d=0;d<l.length;d+=3){var h=l[d],g=l[d+1],j=h[sn]||null;if(typeof g=="function")j||Hv(l);else if(j){var _=null;if(g&&g.hasAttribute("formAction")){if(h=g,j=g[sn]||null)_=j.formAction;else if(Ch(h)!==null)continue}else _=j.action;typeof _=="function"?l[d+1]=_:(l.splice(d,3),d-=3),Hv(l)}}}function Kv(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(j){return h=j})},focusReset:"manual",scroll:"manual"})}function i(){h!==null&&(h(),h=null),d||setTimeout(l,20)}function l(){if(!d&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,h=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){d=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),h!==null&&(h(),h=null)}}}function zh(n){this._internalRoot=n}$c.prototype.render=zh.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,d=Ln();Dv(l,d,n,i,null,null)},$c.prototype.unmount=zh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Dv(n.current,2,null,n,null,null),yc(),i[zn]=null}};function $c(n){this._internalRoot=n}$c.prototype.unstable_scheduleHydration=function(n){if(n){var i=Ua();n={blockedOn:null,target:n,priority:i};for(var l=0;l<Si.length&&i!==0&&i<Si[l].priority;l++);Si.splice(l,0,n),l===0&&Bv(n)}};var Gv=t.version;if(Gv!=="19.2.4")throw Error(a(527,Gv,"19.2.4"));ae.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=p(i),n=n!==null?v(n):null,n=n===null?null:n.stateNode,n};var XC={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pc.isDisabled&&Pc.supportsFiber)try{ts=Pc.inject(XC),ht=Pc}catch{}}return Bo.createRoot=function(n,i){if(!r(n))throw Error(a(299));var l=!1,d="",h=Xy,g=Wy,j=e0;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(j=i.onRecoverableError)),i=Ov(n,1,!1,null,null,l,d,null,h,g,j,Kv),n[zn]=i.current,lh(n),new zh(i)},Bo.hydrateRoot=function(n,i,l){if(!r(n))throw Error(a(299));var d=!1,h="",g=Xy,j=Wy,_=e0,D=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(g=l.onUncaughtError),l.onCaughtError!==void 0&&(j=l.onCaughtError),l.onRecoverableError!==void 0&&(_=l.onRecoverableError),l.formState!==void 0&&(D=l.formState)),i=Ov(n,1,!0,i,l??null,d,h,D,g,j,_,Kv),i.context=Lv(null),l=i.current,d=Ln(),d=Ht(d),h=ri(d),h.callback=null,oi(l,h,d),l=d,i.current.lanes=l,Gi(i,l),bs(i),n[zn]=i.current,lh(n),new $c(i)},Bo.version="19.2.4",Bo}var tx;function lk(){if(tx)return Rh.exports;tx=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Rh.exports=ok(),Rh.exports}var ck=lk(),Ea=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},uk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},dk=class{#t=uk;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,t){return this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}},ha=new dk;function fk(e){setTimeout(e,0)}var Na=typeof window>"u"||"Deno"in globalThis;function rn(){}function hk(e,t){return typeof e=="function"?e(t):e}function mm(e){return typeof e=="number"&&e>=0&&e!==1/0}function pS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ri(e,t){return typeof e=="function"?e(t):e}function Fn(e,t){return typeof e=="function"?e(t):e}function nx(e,t){const{type:s="all",exact:a,fetchStatus:r,predicate:c,queryKey:u,stale:f}=e;if(u){if(a){if(t.queryHash!==ep(u,t.options))return!1}else if(!el(t.queryKey,u))return!1}if(s!=="all"){const m=t.isActive();if(s==="active"&&!m||s==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||r&&r!==t.state.fetchStatus||c&&!c(t))}function sx(e,t){const{exact:s,status:a,predicate:r,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(s){if(Ca(t.options.mutationKey)!==Ca(c))return!1}else if(!el(t.options.mutationKey,c))return!1}return!(a&&t.state.status!==a||r&&!r(t))}function ep(e,t){return(t?.queryKeyHashFn||Ca)(e)}function Ca(e){return JSON.stringify(e,(t,s)=>pm(s)?Object.keys(s).sort().reduce((a,r)=>(a[r]=s[r],a),{}):s)}function el(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>el(e[s],t[s])):!1}var mk=Object.prototype.hasOwnProperty;function tp(e,t,s=0){if(e===t)return e;if(s>500)return t;const a=ix(e)&&ix(t);if(!a&&!(pm(e)&&pm(t)))return t;const c=(a?e:Object.keys(e)).length,u=a?t:Object.keys(t),f=u.length,m=a?new Array(f):{};let p=0;for(let v=0;v<f;v++){const y=a?v:u[v],x=e[y],b=t[y];if(x===b){m[y]=x,(a?v<c:mk.call(e,y))&&p++;continue}if(x===null||b===null||typeof x!="object"||typeof b!="object"){m[y]=b;continue}const N=tp(x,b,s+1);m[y]=N,N===x&&p++}return c===f&&p===c?e:m}function tl(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function ix(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function pm(e){if(!ax(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!ax(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ax(e){return Object.prototype.toString.call(e)==="[object Object]"}function pk(e){return new Promise(t=>{ha.setTimeout(t,e)})}function gm(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?tp(e,t):t}function gk(e,t,s=0){const a=[...e,t];return s&&a.length>s?a.slice(1):a}function yk(e,t,s=0){const a=[t,...e];return s&&a.length>s?a.slice(0,-1):a}var np=Symbol();function gS(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===np?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function sp(e,t){return typeof e=="function"?e(...t):!!e}function vk(e,t,s){let a=!1,r;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??=t(),a||(a=!0,r.aborted?s():r.addEventListener("abort",s,{once:!0})),r)}),e}var xk=class extends Ea{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Na&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},ip=new xk;function ym(){let e,t;const s=new Promise((r,c)=>{e=r,t=c});s.status="pending",s.catch(()=>{});function a(r){Object.assign(s,r),delete s.resolve,delete s.reject}return s.resolve=r=>{a({status:"fulfilled",value:r}),e(r)},s.reject=r=>{a({status:"rejected",reason:r}),t(r)},s}var bk=fk;function Sk(){let e=[],t=0,s=f=>{f()},a=f=>{f()},r=bk;const c=f=>{t?e.push(f):r(()=>{s(f)})},u=()=>{const f=e;e=[],f.length&&r(()=>{a(()=>{f.forEach(m=>{s(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||u()}return m},batchCalls:f=>(...m)=>{c(()=>{f(...m)})},schedule:c,setNotifyFunction:f=>{s=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{r=f}}}var At=Sk(),jk=class extends Ea{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Na&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(s=>{s(e)}))}isOnline(){return this.#t}},yu=new jk;function wk(e){return Math.min(1e3*2**e,3e4)}function yS(e){return(e??"online")==="online"?yu.isOnline():!0}var vm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function vS(e){let t=!1,s=0,a;const r=ym(),c=()=>r.status!=="pending",u=S=>{if(!c()){const C=new vm(S);x(C),e.onCancel?.(C)}},f=()=>{t=!0},m=()=>{t=!1},p=()=>ip.isFocused()&&(e.networkMode==="always"||yu.isOnline())&&e.canRun(),v=()=>yS(e.networkMode)&&e.canRun(),y=S=>{c()||(a?.(),r.resolve(S))},x=S=>{c()||(a?.(),r.reject(S))},b=()=>new Promise(S=>{a=C=>{(c()||p())&&S(C)},e.onPause?.()}).then(()=>{a=void 0,c()||e.onContinue?.()}),N=()=>{if(c())return;let S;const C=s===0?e.initialPromise:void 0;try{S=C??e.fn()}catch(k){S=Promise.reject(k)}Promise.resolve(S).then(y).catch(k=>{if(c())return;const A=e.retry??(Na?0:3),R=e.retryDelay??wk,z=typeof R=="function"?R(s,k):R,O=A===!0||typeof A=="number"&&s<A||typeof A=="function"&&A(s,k);if(t||!O){x(k);return}s++,e.onFail?.(s,k),pk(z).then(()=>p()?void 0:b()).then(()=>{t?x(k):N()})})};return{promise:r,status:()=>r.status,cancel:u,continue:()=>(a?.(),r),cancelRetry:f,continueRetry:m,canStart:v,start:()=>(v()?N():b().then(N),r)}}var xS=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mm(this.gcTime)&&(this.#t=ha.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Na?1/0:300*1e3))}clearGcTimeout(){this.#t&&(ha.clearTimeout(this.#t),this.#t=void 0)}},Nk=class extends xS{#t;#e;#n;#i;#s;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ox(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=ox(this.options);t.data!==void 0&&(this.setState(rx(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const s=gm(this.state.data,e,this.options);return this.#r({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e,t){this.#r({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(rn).catch(rn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Fn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===np||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ri(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!pS(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#s&&(this.#o?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#r({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(m=>m.options.queryFn);f&&this.setOptions(f.options)}const s=new AbortController,a=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},r=()=>{const f=gS(this.options,t),p=(()=>{const v={client:this.#i,queryKey:this.queryKey,meta:this.meta};return a(v),v})();return this.#o=!1,this.options.persister?this.options.persister(f,p,this):f(p)},u=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:r};return a(f),f})();this.options.behavior?.onFetch(u,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#r({type:"fetch",meta:u.fetchOptions?.meta}),this.#s=vS({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:f=>{f instanceof vm&&f.revert&&this.setState({...this.#e,fetchStatus:"idle"}),s.abort()},onFail:(f,m)=>{this.#r({type:"failed",failureCount:f,error:m})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const f=await this.#s.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof vm){if(f.silent)return this.#s.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#r({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#r(e){const t=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...bS(s.data,this.options),fetchMeta:e.meta??null};case"success":const a={...s,...rx(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?a:void 0,a;case"error":const r=e.error;return{...s,error:r,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=t(this.state),At.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function bS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:yS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function rx(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ox(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,a=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var ap=class extends Ea{constructor(e,t){super(),this.options=t,this.#t=e,this.#r=null,this.#o=ym(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#i=void 0;#s;#a;#o;#r;#m;#d;#f;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),lx(this.#e,this.options)?this.#p():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return xm(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return xm(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,s=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Fn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#e.setOptions(this.options),t._defaulted&&!tl(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&cx(this.#e,s,this.options,t)&&this.#p(),this.updateResult(),a&&(this.#e!==s||Fn(this.options.enabled,this.#e)!==Fn(t.enabled,this.#e)||Ri(this.options.staleTime,this.#e)!==Ri(t.staleTime,this.#e))&&this.#g();const r=this.#y();a&&(this.#e!==s||Fn(this.options.enabled,this.#e)!==Fn(t.enabled,this.#e)||r!==this.#l)&&this.#v(r)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),s=this.createResult(t,e);return kk(this,s)&&(this.#i=s,this.#a=this.options,this.#s=this.#e.state),s}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(s,a)=>(this.trackProp(a),t?.(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,a))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),s=this.#t.getQueryCache().build(this.#t,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#p({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#p(e){this.#j();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(rn)),t}#g(){this.#b();const e=Ri(this.options.staleTime,this.#e);if(Na||this.#i.isStale||!mm(e))return;const s=pS(this.#i.dataUpdatedAt,e)+1;this.#c=ha.setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(e){this.#S(),this.#l=e,!(Na||Fn(this.options.enabled,this.#e)===!1||!mm(this.#l)||this.#l===0)&&(this.#u=ha.setInterval(()=>{(this.options.refetchIntervalInBackground||ip.isFocused())&&this.#p()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(ha.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(ha.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const s=this.#e,a=this.options,r=this.#i,c=this.#s,u=this.#a,m=e!==s?e.state:this.#n,{state:p}=e;let v={...p},y=!1,x;if(t._optimisticResults){const L=this.hasListeners(),U=!L&&lx(e,t),X=L&&cx(e,s,t,a);(U||X)&&(v={...v,...bS(p.data,e.options)}),t._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:b,errorUpdatedAt:N,status:S}=v;x=v.data;let C=!1;if(t.placeholderData!==void 0&&x===void 0&&S==="pending"){let L;r?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(L=r.data,C=!0):L=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,L!==void 0&&(S="success",x=gm(r?.data,L,t),y=!0)}if(t.select&&x!==void 0&&!C)if(r&&x===c?.data&&t.select===this.#m)x=this.#d;else try{this.#m=t.select,x=t.select(x),x=gm(r?.data,x,t),this.#d=x,this.#r=null}catch(L){this.#r=L}this.#r&&(b=this.#r,x=this.#d,N=Date.now(),S="error");const k=v.fetchStatus==="fetching",A=S==="pending",R=S==="error",z=A&&k,O=x!==void 0,E={status:S,fetchStatus:v.fetchStatus,isPending:A,isSuccess:S==="success",isError:R,isInitialLoading:z,isLoading:z,data:x,dataUpdatedAt:v.dataUpdatedAt,error:b,errorUpdatedAt:N,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>m.dataUpdateCount||v.errorUpdateCount>m.errorUpdateCount,isFetching:k,isRefetching:k&&!A,isLoadingError:R&&!O,isPaused:v.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:R&&O,isStale:rp(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Fn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const L=E.data!==void 0,U=E.status==="error"&&!L,X=ue=>{U?ue.reject(E.error):L&&ue.resolve(E.data)},Q=()=>{const ue=this.#o=E.promise=ym();X(ue)},ee=this.#o;switch(ee.status){case"pending":e.queryHash===s.queryHash&&X(ee);break;case"fulfilled":(U||E.data!==ee.value)&&Q();break;case"rejected":(!U||E.error!==ee.reason)&&Q();break}}return E}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#s=this.#e.state,this.#a=this.options,this.#s.data!==void 0&&(this.#f=this.#e),tl(t,e))return;this.#i=t;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,r=typeof a=="function"?a():a;if(r==="all"||!r&&!this.#h.size)return!0;const c=new Set(r??this.#h);return this.options.throwOnError&&c.add("error"),Object.keys(this.#i).some(u=>{const f=u;return this.#i[f]!==e[f]&&c.has(f)})};this.#w({listeners:s()})}#j(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#w(e){At.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Ck(e,t){return Fn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function lx(e,t){return Ck(e,t)||e.state.data!==void 0&&xm(e,t,t.refetchOnMount)}function xm(e,t,s){if(Fn(t.enabled,e)!==!1&&Ri(t.staleTime,e)!=="static"){const a=typeof s=="function"?s(e):s;return a==="always"||a!==!1&&rp(e,t)}return!1}function cx(e,t,s,a){return(e!==t||Fn(a.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&rp(e,s)}function rp(e,t){return Fn(t.enabled,e)!==!1&&e.isStaleByTime(Ri(t.staleTime,e))}function kk(e,t){return!tl(e.getCurrentResult(),t)}function ux(e){return{onFetch:(t,s)=>{const a=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},m=0;const p=async()=>{let v=!1;const y=N=>{vk(N,()=>t.signal,()=>v=!0)},x=gS(t.options,t.fetchOptions),b=async(N,S,C)=>{if(v)return Promise.reject();if(S==null&&N.pages.length)return Promise.resolve(N);const A=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return y(M),M})(),R=await x(A),{maxPages:z}=t.options,O=C?yk:gk;return{pages:O(N.pages,R,z),pageParams:O(N.pageParams,S,z)}};if(r&&c.length){const N=r==="backward",S=N?zk:dx,C={pages:c,pageParams:u},k=S(a,C);f=await b(C,k,N)}else{const N=e??c.length;do{const S=m===0?u[0]??a.initialPageParam:dx(a,f);if(m>0&&S==null)break;f=await b(f,S),m++}while(m<N)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=p}}}function dx(e,{pages:t,pageParams:s}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,s[a],s):void 0}function zk(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var _k=class extends xS{#t;#e;#n;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||SS(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#s({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=vS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(c,u)=>{this.#s({type:"failed",failureCount:c,error:u})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const a=this.state.status==="pending",r=!this.#i.canStart();try{if(a)t();else{this.#s({type:"pending",variables:e,isPaused:r}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,s);const u=await this.options.onMutate?.(e,s);u!==this.state.context&&this.#s({type:"pending",context:u,variables:e,isPaused:r})}const c=await this.#i.start();return await this.#n.config.onSuccess?.(c,e,this.state.context,this,s),await this.options.onSuccess?.(c,e,this.state.context,s),await this.#n.config.onSettled?.(c,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(c,null,e,this.state.context,s),this.#s({type:"success",data:c}),c}catch(c){try{await this.#n.config.onError?.(c,e,this.state.context,this,s)}catch(u){Promise.reject(u)}try{await this.options.onError?.(c,e,this.state.context,s)}catch(u){Promise.reject(u)}try{await this.#n.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,s)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,c,e,this.state.context,s)}catch(u){Promise.reject(u)}throw this.#s({type:"error",error:c}),c}finally{this.#n.runNext(this)}}#s(e){const t=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),At.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function SS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var jS=class extends Ea{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,s){const a=new _k({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:s});return this.add(a),a}add(e){this.#t.add(e);const t=Uc(e);if(typeof t=="string"){const s=this.#e.get(t);s?s.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=Uc(e);if(typeof t=="string"){const s=this.#e.get(t);if(s)if(s.length>1){const a=s.indexOf(e);a!==-1&&s.splice(a,1)}else s[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Uc(e);if(typeof t=="string"){const a=this.#e.get(t)?.find(r=>r.state.status==="pending");return!a||a===e}else return!0}runNext(e){const t=Uc(e);return typeof t=="string"?this.#e.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){At.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(s=>sx(t,s))}findAll(e={}){return this.getAll().filter(t=>sx(e,t))}notify(e){At.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return At.batch(()=>Promise.all(e.map(t=>t.continue().catch(rn))))}};function Uc(e){return e.options.scope?.id}var Ek=class extends Ea{#t;#e=void 0;#n;#i;constructor(t,s){super(),this.#t=t,this.setOptions(s),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#t.defaultMutationOptions(t),tl(this.options,s)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),s?.mutationKey&&this.options.mutationKey&&Ca(s.mutationKey)!==Ca(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#s(),this.#a(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#a()}mutate(t,s){return this.#i=s,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#s(){const t=this.#n?.state??SS();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){At.batch(()=>{if(this.#i&&this.hasListeners()){const s=this.#e.variables,a=this.#e.context,r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,s,a,r)}catch(c){Promise.reject(c)}try{this.#i.onSettled?.(t.data,null,s,a,r)}catch(c){Promise.reject(c)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,s,a,r)}catch(c){Promise.reject(c)}try{this.#i.onSettled?.(void 0,t.error,s,a,r)}catch(c){Promise.reject(c)}}}this.listeners.forEach(s=>{s(this.#e)})})}};function fx(e,t){const s=new Set(t);return e.filter(a=>!s.has(a))}function Rk(e,t,s){const a=e.slice(0);return a[t]=s,a}var Ak=class extends Ea{#t;#e;#n;#i;#s;#a;#o;#r;#m;#d=[];constructor(e,t,s){super(),this.#t=e,this.#i=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#i=t,At.batch(()=>{const s=this.#s,a=this.#u(this.#n);a.forEach(v=>v.observer.setOptions(v.defaultedQueryOptions));const r=a.map(v=>v.observer),c=r.map(v=>v.getCurrentResult()),u=s.length!==r.length,f=r.some((v,y)=>v!==s[y]),m=u||f,p=m?!0:c.some((v,y)=>{const x=this.#e[y];return!x||!tl(v,x)});!m&&!p||(m&&(this.#d=a,this.#s=r),this.#e=c,this.hasListeners()&&(m&&(fx(s,r).forEach(v=>{v.destroy()}),fx(r,s).forEach(v=>{v.subscribe(y=>{this.#l(v,y)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(e=>e.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(e,t){const s=this.#u(e),a=s.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),r=s.map(c=>c.defaultedQueryOptions.queryHash);return[a,c=>this.#c(c??a,t,r),()=>this.#f(a,s)]}#f(e,t){return t.map((s,a)=>{const r=e[a];return s.defaultedQueryOptions.notifyOnChangeProps?r:s.observer.trackResult(r,c=>{t.forEach(u=>{u.observer.trackProp(c)})})})}#c(e,t,s){if(t){const a=this.#m,r=s!==void 0&&a!==void 0&&(a.length!==s.length||s.some((c,u)=>c!==a[u]));return(!this.#a||this.#e!==this.#r||r||t!==this.#o)&&(this.#o=t,this.#r=this.#e,s!==void 0&&(this.#m=s),this.#a=tp(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#s.forEach(a=>{const r=a.options.queryHash;if(!r)return;const c=t.get(r);c?c.push(a):t.set(r,[a])});const s=[];return e.forEach(a=>{const r=this.#t.defaultQueryOptions(a),u=t.get(r.queryHash)?.shift()??new ap(this.#t,r);s.push({defaultedQueryOptions:r,observer:u})}),s}#l(e,t){const s=this.#s.indexOf(e);s!==-1&&(this.#e=Rk(this.#e,s,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#a,t=this.#f(this.#e,this.#d),s=this.#c(t,this.#i?.combine);e!==s&&At.batch(()=>{this.listeners.forEach(a=>{a(this.#e)})})}}},Tk=class extends Ea{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,s){const a=t.queryKey,r=t.queryHash??ep(a,t);let c=this.get(r);return c||(c=new Nk({client:e,queryKey:a,queryHash:r,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(a)}),this.add(c)),c}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){At.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(s=>nx(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>nx(e,s)):t}notify(e){At.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){At.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){At.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ok=class{#t;#e;#n;#i;#s;#a;#o;#r;constructor(e={}){this.#t=e.queryCache||new Tk,this.#e=e.mutationCache||new jS,this.#n=e.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ip.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#r=yu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#r?.(),this.#r=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=this.#t.build(this,t),a=s.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(Ri(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:s})=>{const a=s.data;return[t,a]})}setQueryData(e,t,s){const a=this.defaultQueryOptions({queryKey:e}),c=this.#t.get(a.queryHash)?.state.data,u=hk(t,c);if(u!==void 0)return this.#t.build(this,a).setData(u,{...s,manual:!0})}setQueriesData(e,t,s){return At.batch(()=>this.#t.findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,s)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;At.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#t;return At.batch(()=>(s.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},a=At.batch(()=>this.#t.findAll(e).map(r=>r.cancel(s)));return Promise.all(a).then(rn).catch(rn)}invalidateQueries(e,t={}){return At.batch(()=>(this.#t.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},a=At.batch(()=>this.#t.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let c=r.fetch(void 0,s);return s.throwOnError||(c=c.catch(rn)),r.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(a).then(rn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#t.build(this,t);return s.isStaleByTime(Ri(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(rn).catch(rn)}fetchInfiniteQuery(e){return e.behavior=ux(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(rn).catch(rn)}ensureInfiniteQueryData(e){return e.behavior=ux(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return yu.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(Ca(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],s={};return t.forEach(a=>{el(e,a.queryKey)&&Object.assign(s,a.defaultOptions)}),s}setMutationDefaults(e,t){this.#s.set(Ca(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],s={};return t.forEach(a=>{el(e,a.mutationKey)&&Object.assign(s,a.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ep(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===np&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},wS=w.createContext(void 0),Pi=e=>{const t=w.useContext(wS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Lk=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(wS.Provider,{value:e,children:t})),NS=w.createContext(!1),CS=()=>w.useContext(NS);NS.Provider;function Dk(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Mk=w.createContext(Dk()),kS=()=>w.useContext(Mk),zS=(e,t,s)=>{const a=s?.state.error&&typeof e.throwOnError=="function"?sp(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},_S=e=>{w.useEffect(()=>{e.clearReset()},[e])},ES=({result:e,errorResetBoundary:t,throwOnError:s,query:a,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(r&&e.data===void 0||sp(s,[e.error,a])),RS=e=>{if(e.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...r)=>s(a(...r)):s(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},$k=(e,t)=>e.isLoading&&e.isFetching&&!t,bm=(e,t)=>e?.suspense&&t.isPending,Sm=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Pk({queries:e,...t},s){const a=Pi(),r=CS(),c=kS(),u=w.useMemo(()=>e.map(S=>{const C=a.defaultQueryOptions(S);return C._optimisticResults=r?"isRestoring":"optimistic",C}),[e,a,r]);u.forEach(S=>{RS(S);const C=a.getQueryCache().get(S.queryHash);zS(S,c,C)}),_S(c);const[f]=w.useState(()=>new Ak(a,u,t)),[m,p,v]=f.getOptimisticResult(u,t.combine),y=!r&&t.subscribed!==!1;w.useSyncExternalStore(w.useCallback(S=>y?f.subscribe(At.batchCalls(S)):rn,[f,y]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),w.useEffect(()=>{f.setQueries(u,t)},[u,t,f]);const b=m.some((S,C)=>bm(u[C],S))?m.flatMap((S,C)=>{const k=u[C];if(k&&bm(k,S)){const A=new ap(a,k);return Sm(k,A,c)}return[]}):[];if(b.length>0)throw Promise.all(b);const N=m.find((S,C)=>{const k=u[C];return k&&ES({result:S,errorResetBoundary:c,throwOnError:k.throwOnError,query:a.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(N?.error)throw N.error;return p(v())}function Uk(e,t,s){const a=CS(),r=kS(),c=Pi(),u=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const f=c.getQueryCache().get(u.queryHash);u._optimisticResults=a?"isRestoring":"optimistic",RS(u),zS(u,r,f),_S(r);const m=!c.getQueryCache().get(u.queryHash),[p]=w.useState(()=>new t(c,u)),v=p.getOptimisticResult(u),y=!a&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(x=>{const b=y?p.subscribe(At.batchCalls(x)):rn;return p.updateResult(),b},[p,y]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),w.useEffect(()=>{p.setOptions(u)},[u,p]),bm(u,v))throw Sm(u,p,r);if(ES({result:v,errorResetBoundary:r,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw v.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(u,v),u.experimental_prefetchInRender&&!Na&&$k(v,a)&&(m?Sm(u,p,r):f?.promise)?.catch(rn).finally(()=>{p.updateResult()}),u.notifyOnChangeProps?v:p.trackResult(v)}function xa(e,t){return Uk(e,ap)}function hl(e,t){const s=Pi(),[a]=w.useState(()=>new Ek(s,e));w.useEffect(()=>{a.setOptions(e)},[a,e]);const r=w.useSyncExternalStore(w.useCallback(u=>a.subscribe(At.batchCalls(u)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),c=w.useCallback((u,f)=>{a.mutate(u,f).catch(rn)},[a]);if(r.error&&sp(a.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:c,mutateAsync:r.mutate}}var Ic=typeof window<"u"?w.useLayoutEffect:w.useEffect;function Lh(e){const t=w.useRef({value:e,prev:null}),s=t.current.value;return e!==s&&(t.current={value:e,prev:s}),t.current.prev}function Ik(e,t,s={},a={}){w.useEffect(()=>{if(!e.current||a.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([c])=>{t(c)},s);return r.observe(e.current),()=>{r.disconnect()}},[t,s,a.disabled,e])}function Bk(e){const t=w.useRef(null);return w.useImperativeHandle(e,()=>t.current,[]),t}var qk=!1;function nl(e){return e[e.length-1]}function Hk(e){return typeof e=="function"}function _i(e,t){return Hk(e)?e(t):e}var Kk=Object.prototype.hasOwnProperty,hx=Object.prototype.propertyIsEnumerable,Gk=()=>Object.create(null),ca=(e,t)=>ma(e,t,Gk);function ma(e,t,s=()=>({}),a=0){if(e===t)return e;if(a>500)return t;const r=t,c=gx(e)&&gx(r);if(!c&&!(vu(e)&&vu(r)))return r;const u=c?e:mx(e);if(!u)return r;const f=c?r:mx(r);if(!f)return r;const m=u.length,p=f.length,v=c?new Array(p):s();let y=0;for(let x=0;x<p;x++){const b=c?x:f[x],N=e[b],S=r[b];if(N===S){v[b]=N,(c?x<m:Kk.call(e,b))&&y++;continue}if(N===null||S===null||typeof N!="object"||typeof S!="object"){v[b]=S;continue}const C=ma(N,S,s,a+1);v[b]=C,C===N&&y++}return m===p&&y===m?e:v}function mx(e){const t=Object.getOwnPropertyNames(e);for(const r of t)if(!hx.call(e,r))return!1;const s=Object.getOwnPropertySymbols(e);if(s.length===0)return t;const a=t;for(const r of s){if(!hx.call(e,r))return!1;a.push(r)}return a}function vu(e){if(!px(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!px(s)||!s.hasOwnProperty("isPrototypeOf"))}function px(e){return Object.prototype.toString.call(e)==="[object Object]"}function gx(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ba(e,t,s){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let a=0,r=e.length;a<r;a++)if(!ba(e[a],t[a],s))return!1;return!0}if(vu(e)&&vu(t)){const a=s?.ignoreUndefined??!0;if(s?.partial){for(const u in t)if((!a||t[u]!==void 0)&&!ba(e[u],t[u],s))return!1;return!0}let r=0;if(!a)r=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&r++;let c=0;for(const u in t)if((!a||t[u]!==void 0)&&(c++,c>r||!ba(e[u],t[u],s)))return!1;return r===c}return!1}function $r(e){let t,s;const a=new Promise((r,c)=>{t=r,s=c});return a.status="pending",a.resolve=r=>{a.status="resolved",a.value=r,t(r),e?.(r)},a.reject=r=>{a.status="rejected",s(r)},a}function sl(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Fk(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function yx(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return Fk(t)}var Zk=["http:","https:","mailto:","tel:"];function xu(e,t){if(!e)return!1;try{const s=new URL(e);return!t.has(s.protocol)}catch{return!1}}function qo(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let s=0,a="",r;for(;(r=t.exec(e))!==null;)a+=yx(e.slice(s,r.index))+r[0],s=t.lastIndex;a=a+yx(s?e.slice(s):e);let c=!1;return a.startsWith("//")&&(c=!0,a="/"+a.replace(/^\/+/,"")),{path:a,handledProtocolRelativeURL:c}}function Vk(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function bu(e){const t=new Map;let s,a;const r=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,a&&(a.next=c,c.prev=a)):(c.next.prev=void 0,s=c.next,c.next=void 0,a&&(c.prev=a,a.next=c)),a=c)};return{get(c){const u=t.get(c);if(u)return r(u),u.value},set(c,u){if(t.size>=e&&s){const m=s;t.delete(m.key),m.next&&(s=m.next,m.next.prev=void 0),m===a&&(a=void 0)}const f=t.get(c);if(f)f.value=u,r(f);else{const m={key:c,value:u,prev:a};a&&(a.next=m),a=m,s||(s=m),t.set(c,m)}},clear(){t.clear(),s=void 0,a=void 0}}}var Qk="Invariant failed";function Di(e,t){if(!e)throw new Error(Qk)}var pa=4,AS=5;function Yk(e){const t=e.indexOf("{");if(t===-1)return null;const s=e.indexOf("}",t);return s===-1||t+1>=e.length?null:[t,s]}function op(e,t,s=new Uint16Array(6)){const a=e.indexOf("/",t),r=a===-1?e.length:a,c=e.substring(t,r);if(!c||!c.includes("$"))return s[0]=0,s[1]=t,s[2]=t,s[3]=r,s[4]=r,s[5]=r,s;if(c==="$"){const f=e.length;return s[0]=2,s[1]=t,s[2]=t,s[3]=f,s[4]=f,s[5]=f,s}if(c.charCodeAt(0)===36)return s[0]=1,s[1]=t,s[2]=t+1,s[3]=r,s[4]=r,s[5]=r,s;const u=Yk(c);if(u){const[f,m]=u,p=c.charCodeAt(f+1);if(p===45){if(f+2<c.length&&c.charCodeAt(f+2)===36){const v=f+3,y=m;if(v<y)return s[0]=3,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+m+1,s[5]=r,s}}else if(p===36){const v=f+1,y=f+2;return y===m?(s[0]=2,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+m+1,s[5]=e.length,s):(s[0]=1,s[1]=t+f,s[2]=t+y,s[3]=t+m,s[4]=t+m+1,s[5]=r,s)}}return s[0]=0,s[1]=t,s[2]=t,s[3]=r,s[4]=r,s[5]=r,s}function Uu(e,t,s,a,r,c,u){u?.(s);let f=a;{const m=s.fullPath??s.from,p=m.length,v=s.options?.caseSensitive??e,y=!!(s.options?.params?.parse&&s.options?.skipRouteOnParseError?.params);for(;f<p;){const b=op(m,f,t);let N;const S=f,C=b[5];switch(f=C+1,c++,b[0]){case 0:{const k=m.substring(b[2],b[3]);if(v){const A=r.static?.get(k);if(A)N=A;else{r.static??=new Map;const R=ga(s.fullPath??s.from);R.parent=r,R.depth=c,N=R,r.static.set(k,R)}}else{const A=k.toLowerCase(),R=r.staticInsensitive?.get(A);if(R)N=R;else{r.staticInsensitive??=new Map;const z=ga(s.fullPath??s.from);z.parent=r,z.depth=c,N=z,r.staticInsensitive.set(A,z)}}break}case 1:{const k=m.substring(S,b[1]),A=m.substring(b[4],C),R=v&&!!(k||A),z=k?R?k:k.toLowerCase():void 0,O=A?R?A:A.toLowerCase():void 0,M=!y&&r.dynamic?.find(E=>!E.skipOnParamError&&E.caseSensitive===R&&E.prefix===z&&E.suffix===O);if(M)N=M;else{const E=Mh(1,s.fullPath??s.from,R,z,O);N=E,E.depth=c,E.parent=r,r.dynamic??=[],r.dynamic.push(E)}break}case 3:{const k=m.substring(S,b[1]),A=m.substring(b[4],C),R=v&&!!(k||A),z=k?R?k:k.toLowerCase():void 0,O=A?R?A:A.toLowerCase():void 0,M=!y&&r.optional?.find(E=>!E.skipOnParamError&&E.caseSensitive===R&&E.prefix===z&&E.suffix===O);if(M)N=M;else{const E=Mh(3,s.fullPath??s.from,R,z,O);N=E,E.parent=r,E.depth=c,r.optional??=[],r.optional.push(E)}break}case 2:{const k=m.substring(S,b[1]),A=m.substring(b[4],C),R=v&&!!(k||A),z=k?R?k:k.toLowerCase():void 0,O=A?R?A:A.toLowerCase():void 0,M=Mh(2,s.fullPath??s.from,R,z,O);N=M,M.parent=r,M.depth=c,r.wildcard??=[],r.wildcard.push(M)}}r=N}if(y&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const b=ga(s.fullPath??s.from);b.kind=AS,b.parent=r,c++,b.depth=c,r.pathless??=[],r.pathless.push(b),r=b}const x=(s.path||!s.children)&&!s.isRoot;if(x&&m.endsWith("/")){const b=ga(s.fullPath??s.from);b.kind=pa,b.parent=r,c++,b.depth=c,r.index=b,r=b}r.parse=s.options?.params?.parse??null,r.skipOnParamError=y,r.parsingPriority=s.options?.skipRouteOnParseError?.priority??0,x&&!r.route&&(r.route=s,r.fullPath=s.fullPath??s.from)}if(s.children)for(const m of s.children)Uu(e,t,m,f,r,c,u)}function Dh(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function ki(e){if(e.pathless)for(const t of e.pathless)ki(t);if(e.static)for(const t of e.static.values())ki(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())ki(t);if(e.dynamic?.length){e.dynamic.sort(Dh);for(const t of e.dynamic)ki(t)}if(e.optional?.length){e.optional.sort(Dh);for(const t of e.optional)ki(t)}if(e.wildcard?.length){e.wildcard.sort(Dh);for(const t of e.wildcard)ki(t)}}function ga(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Mh(e,t,s,a,r){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:s,prefix:a,suffix:r}}function Jk(e,t){const s=ga("/"),a=new Uint16Array(6);for(const r of e)Uu(!1,a,r,1,s,0);ki(s),t.masksTree=s,t.flatCache=bu(1e3)}function Xk(e,t){e||="/";const s=t.flatCache.get(e);if(s)return s;const a=lp(e,t.masksTree);return t.flatCache.set(e,a),a}function Wk(e,t,s,a,r){e||="/",a||="/";const c=t?`case\0${e}`:e;let u=r.singleCache.get(c);return u||(u=ga("/"),Uu(t,new Uint16Array(6),{from:e},1,u,0),r.singleCache.set(c,u)),lp(a,u,s)}function ez(e,t,s=!1){const a=s?e:`nofuzz\0${e}`,r=t.matchCache.get(a);if(r!==void 0)return r;e||="/";let c;try{c=lp(e,t.segmentTree,s)}catch(u){if(u instanceof URIError)c=null;else throw u}return c&&(c.branch=sz(c.route)),t.matchCache.set(a,c),c}function tz(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function nz(e,t=!1,s){const a=ga(e.fullPath),r=new Uint16Array(6),c={},u={};let f=0;return Uu(t,r,e,1,a,0,m=>{if(s?.(m,f),Di(!(m.id in c),`Duplicate routes found with id: ${String(m.id)}`),c[m.id]=m,f!==0&&m.path){const p=tz(m.fullPath);(!u[p]||m.fullPath.endsWith("/"))&&(u[p]=m)}f++}),ki(a),{processedTree:{segmentTree:a,singleCache:bu(1e3),matchCache:bu(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:u}}function lp(e,t,s=!1){const a=e.split("/"),r=az(e,a,t,s);if(!r)return null;const[c]=TS(e,a,r);return{route:r.node.route,rawParams:c,parsedParams:r.parsedParams}}function TS(e,t,s){const a=iz(s.node);let r=null;const c=Object.create(null);let u=s.extract?.part??0,f=s.extract?.node??0,m=s.extract?.path??0,p=s.extract?.segment??0;for(;f<a.length;u++,f++,m++,p++){const v=a[f];if(v.kind===pa)break;if(v.kind===AS){p--,u--,m--;continue}const y=t[u],x=m;if(y&&(m+=y.length),v.kind===1){r??=s.node.fullPath.split("/");const b=r[p],N=v.prefix?.length??0;if(b.charCodeAt(N)===123){const S=v.suffix?.length??0,C=b.substring(N+2,b.length-S-1),k=y.substring(N,y.length-S);c[C]=decodeURIComponent(k)}else{const S=b.substring(1);c[S]=decodeURIComponent(y)}}else if(v.kind===3){if(s.skipped&1<<f){u--,m=x-1;continue}r??=s.node.fullPath.split("/");const b=r[p],N=v.prefix?.length??0,S=v.suffix?.length??0,C=b.substring(N+3,b.length-S-1),k=v.suffix||v.prefix?y.substring(N,y.length-S):y;k&&(c[C]=decodeURIComponent(k))}else if(v.kind===2){const b=v,N=e.substring(x+(b.prefix?.length??0),e.length-(b.suffix?.length??0)),S=decodeURIComponent(N);c["*"]=S,c._splat=S;break}}return s.rawParams&&Object.assign(c,s.rawParams),[c,{part:u,node:f,path:m,segment:p}]}function sz(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function iz(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function az(e,t,s,a){if(e==="/"&&s.index)return{node:s.index,skipped:0};const r=!nl(t),c=r&&e!=="/",u=t.length-(r?1:0),f=[{node:s,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let m=null,p=null,v=null;for(;f.length;){const y=f.pop(),{node:x,index:b,skipped:N,depth:S,statics:C,dynamics:k,optionals:A}=y;let{extract:R,rawParams:z,parsedParams:O}=y;if(x.skipOnParamError){if(!$h(e,t,y))continue;z=y.rawParams,R=y.extract,O=y.parsedParams}a&&x.route&&x.kind!==pa&&Ho(p,y)&&(p=y);const M=b===u;if(M&&(x.route&&!c&&Ho(v,y)&&(v=y),!x.optional&&!x.wildcard&&!x.index&&!x.pathless))continue;const E=M?void 0:t[b];let L;if(M&&x.index){const U={node:x.index,index:b,skipped:N,depth:S+1,statics:C,dynamics:k,optionals:A,extract:R,rawParams:z,parsedParams:O};let X=!0;if(x.index.skipOnParamError&&($h(e,t,U)||(X=!1)),X){if(C===u&&!k&&!A&&!N)return U;Ho(v,U)&&(v=U)}}if(x.wildcard&&Ho(m,y))for(const U of x.wildcard){const{prefix:X,suffix:Q}=U;if(X&&(M||!(U.caseSensitive?E:L??=E.toLowerCase()).startsWith(X)))continue;if(Q){if(M)continue;const ue=t.slice(b).join("/").slice(-Q.length);if((U.caseSensitive?ue:ue.toLowerCase())!==Q)continue}const ee={node:U,index:u,skipped:N,depth:S,statics:C,dynamics:k,optionals:A,extract:R,rawParams:z,parsedParams:O};if(!(U.skipOnParamError&&!$h(e,t,ee))){m=ee;break}}if(x.optional){const U=N|1<<S,X=S+1;for(let Q=x.optional.length-1;Q>=0;Q--){const ee=x.optional[Q];f.push({node:ee,index:b,skipped:U,depth:X,statics:C,dynamics:k,optionals:A,extract:R,rawParams:z,parsedParams:O})}if(!M)for(let Q=x.optional.length-1;Q>=0;Q--){const ee=x.optional[Q],{prefix:ue,suffix:ze}=ee;if(ue||ze){const je=ee.caseSensitive?E:L??=E.toLowerCase();if(ue&&!je.startsWith(ue)||ze&&!je.endsWith(ze))continue}f.push({node:ee,index:b+1,skipped:N,depth:X,statics:C,dynamics:k,optionals:A+1,extract:R,rawParams:z,parsedParams:O})}}if(!M&&x.dynamic&&E)for(let U=x.dynamic.length-1;U>=0;U--){const X=x.dynamic[U],{prefix:Q,suffix:ee}=X;if(Q||ee){const ue=X.caseSensitive?E:L??=E.toLowerCase();if(Q&&!ue.startsWith(Q)||ee&&!ue.endsWith(ee))continue}f.push({node:X,index:b+1,skipped:N,depth:S+1,statics:C,dynamics:k+1,optionals:A,extract:R,rawParams:z,parsedParams:O})}if(!M&&x.staticInsensitive){const U=x.staticInsensitive.get(L??=E.toLowerCase());U&&f.push({node:U,index:b+1,skipped:N,depth:S+1,statics:C+1,dynamics:k,optionals:A,extract:R,rawParams:z,parsedParams:O})}if(!M&&x.static){const U=x.static.get(E);U&&f.push({node:U,index:b+1,skipped:N,depth:S+1,statics:C+1,dynamics:k,optionals:A,extract:R,rawParams:z,parsedParams:O})}if(x.pathless){const U=S+1;for(let X=x.pathless.length-1;X>=0;X--){const Q=x.pathless[X];f.push({node:Q,index:b,skipped:N,depth:U,statics:C,dynamics:k,optionals:A,extract:R,rawParams:z,parsedParams:O})}}}if(v&&m)return Ho(m,v)?v:m;if(v)return v;if(m)return m;if(a&&p){let y=p.index;for(let b=0;b<p.index;b++)y+=t[b].length;const x=y===e.length?"/":e.slice(y);return p.rawParams??=Object.create(null),p.rawParams["**"]=decodeURIComponent(x),p}return null}function $h(e,t,s){try{const[a,r]=TS(e,t,s);s.rawParams=a,s.extract=r;const c=s.node.parse(a);return s.parsedParams=Object.assign(Object.create(null),s.parsedParams,c),!0}catch{return null}}function Ho(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===pa)>(e.node.kind===pa)||t.node.kind===pa==(e.node.kind===pa)&&t.depth>e.depth))):!0}function ou(e){return cp(e.filter(t=>t!==void 0).join("/"))}function cp(e){return e.replace(/\/{2,}/g,"/")}function OS(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Ai(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function LS(e){return Ai(OS(e))}function Su(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function rz(e,t,s){return Su(e,s)===Su(t,s)}function oz({base:e,to:t,trailingSlash:s="never",cache:a}){const r=t.startsWith("/"),c=!r&&t===".";let u;if(a){u=r?t:c?e:e+"\0"+t;const y=a.get(u);if(y)return y}let f;if(c)f=e.split("/");else if(r)f=t.split("/");else{for(f=e.split("/");f.length>1&&nl(f)==="";)f.pop();const y=t.split("/");for(let x=0,b=y.length;x<b;x++){const N=y[x];N===""?x?x===b-1&&f.push(N):f=[N]:N===".."?f.pop():N==="."||f.push(N)}}f.length>1&&(nl(f)===""?s==="never"&&f.pop():s==="always"&&f.push(""));let m,p="";for(let y=0;y<f.length;y++){y>0&&(p+="/");const x=f[y];if(!x)continue;m=op(x,0,m);const b=m[0];if(b===0){p+=x;continue}const N=m[5],S=x.substring(0,m[1]),C=x.substring(m[4],N),k=x.substring(m[2],m[3]);b===1?p+=S||C?`${S}{$${k}}${C}`:`$${k}`:b===2?p+=S||C?`${S}{$}${C}`:"$":p+=`${S}{-$${k}}${C}`}p=cp(p);const v=p||"/";return u&&a&&a.set(u,v),v}function lz(e){const t=new Map(e.map(r=>[encodeURIComponent(r),r])),s=Array.from(t.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),a=new RegExp(s,"g");return r=>r.replace(a,c=>t.get(c)??c)}function Ph(e,t,s){const a=t[e];return typeof a!="string"?a:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(a)?a:a.split("/").map(r=>xx(r,s)).join("/"):xx(a,s)}function vx({path:e,params:t,decoder:s,...a}){let r=!1;const c=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:r};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:r};const u=e.length;let f=0,m,p="";for(;f<u;){const v=f;m=op(e,v,m);const y=m[5];if(f=y+1,v===y)continue;const x=m[0];if(x===0){p+="/"+e.substring(v,y);continue}if(x===2){const b=t._splat;c._splat=b,c["*"]=b;const N=e.substring(v,m[1]),S=e.substring(m[4],y);if(!b){r=!0,(N||S)&&(p+="/"+N+S);continue}const C=Ph("_splat",t,s);p+="/"+N+C+S;continue}if(x===1){const b=e.substring(m[2],m[3]);!r&&!(b in t)&&(r=!0),c[b]=t[b];const N=e.substring(v,m[1]),S=e.substring(m[4],y),C=Ph(b,t,s)??"undefined";p+="/"+N+C+S;continue}if(x===3){const b=e.substring(m[2],m[3]),N=t[b];if(N==null)continue;c[b]=N;const S=e.substring(v,m[1]),C=e.substring(m[4],y),k=Ph(b,t,s)??"";p+="/"+S+k+C;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:c,interpolatedPath:p||"/",isMissingParams:r}}function xx(e,t){const s=encodeURIComponent(e);return t?.(s)??s}function hn(e){return!!e?.isNotFound}function cz(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var jm="tsr-scroll-restoration-v1_3",uz=(e,t)=>{let s;return(...a)=>{s||(s=setTimeout(()=>{e(...a),s=null},t))}};function dz(){const e=cz();if(!e)return null;const t=e.getItem(jm);let s=t?JSON.parse(t):{};return{state:s,set:a=>{s=_i(a,s)||s;try{e.setItem(jm,JSON.stringify(s))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Bc=dz(),fz=e=>e.state.__TSR_key||e.href;function hz(e){const t=[];let s;for(;s=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(s.children,e)+1})`),e=s;return`${t.reverse().join(" > ")}`.toLowerCase()}var ju=!1;function mz({storageKey:e,key:t,behavior:s,shouldScrollRestoration:a,scrollToTopSelectors:r,location:c}){let u;try{u=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(p){console.error(p);return}const f=t||window.history.state?.__TSR_key,m=u[f];ju=!0;e:{if(a&&m&&Object.keys(m).length>0){for(const y in m){const x=m[y];if(y==="window")window.scrollTo({top:x.scrollY,left:x.scrollX,behavior:s});else if(y){const b=document.querySelector(y);b&&(b.scrollLeft=x.scrollX,b.scrollTop=x.scrollY)}}break e}const p=(c??window.location).hash.split("#",2)[1];if(p){const y=window.history.state?.__hashScrollIntoViewOptions??!0;if(y){const x=document.getElementById(p);x&&x.scrollIntoView(y)}break e}const v={top:0,left:0,behavior:s};if(window.scrollTo(v),r)for(const y of r){if(y==="window")continue;const x=typeof y=="function"?y():document.querySelector(y);x&&x.scrollTo(v)}}ju=!1}function pz(e,t){if(!Bc||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Bc))return;e.isScrollRestorationSetup=!0,ju=!1;const s=e.options.getScrollRestorationKey||fz;window.history.scrollRestoration="manual";const a=r=>{if(ju||!e.isScrollRestoring)return;let c="";if(r.target===document||r.target===window)c="window";else{const f=r.target.getAttribute("data-scroll-restoration-id");f?c=`[data-scroll-restoration-id="${f}"]`:c=hz(r.target)}const u=s(e.state.location);Bc.set(f=>{const m=f[u]||={},p=m[c]||={};if(c==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(c){const v=document.querySelector(c);v&&(p.scrollX=v.scrollLeft||0,p.scrollY=v.scrollTop||0)}return f})};typeof document<"u"&&document.addEventListener("scroll",uz(a,100),!0),e.subscribe("onRendered",r=>{const c=s(r.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(mz({storageKey:jm,key:c,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Bc.set(u=>(u[c]||={},u)))})}function gz(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const s=document.getElementById(e.state.location.hash);s&&s.scrollIntoView(t)}}}function yz(e,t=String){const s=new URLSearchParams;for(const a in e){const r=e[a];r!==void 0&&s.set(a,t(r))}return s.toString()}function Uh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function vz(e){const t=new URLSearchParams(e),s=Object.create(null);for(const[a,r]of t.entries()){const c=s[a];c==null?s[a]=Uh(r):Array.isArray(c)?c.push(Uh(r)):s[a]=[c,Uh(r)]}return s}var xz=Sz(JSON.parse),bz=jz(JSON.stringify,JSON.parse);function Sz(e){return t=>{t[0]==="?"&&(t=t.substring(1));const s=vz(t);for(const a in s){const r=s[a];if(typeof r=="string")try{s[a]=e(r)}catch{}}return s}}function jz(e,t){const s=typeof t=="function";function a(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch{}else if(s&&typeof r=="string")try{return t(r),e(r)}catch{}return r}return r=>{const c=yz(r,a);return c?`?${c}`:""}}var Sa="__root__";function up(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const s=new Response(null,{status:e.statusCode,headers:t});if(s.options=e,e.throw)throw s;return s}function wn(e){return e instanceof Response&&!!e.options}function wz(e){return{input:({url:t})=>{for(const s of e)t=wm(s,t);return t},output:({url:t})=>{for(let s=e.length-1;s>=0;s--)t=DS(e[s],t);return t}}}function Nz(e){const t=LS(e.basepath),s=`/${t}`,a=`${s}/`,r=e.caseSensitive?s:s.toLowerCase(),c=e.caseSensitive?a:a.toLowerCase();return{input:({url:u})=>{const f=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return f===r?u.pathname="/":f.startsWith(c)&&(u.pathname=u.pathname.slice(s.length)),u},output:({url:u})=>(u.pathname=ou(["/",t,u.pathname]),u)}}function wm(e,t){const s=e?.input?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}function DS(e,t){const s=e?.output?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}var jt=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(jt||{});function MS({update:e,notify:t,unwatched:s}){return{link:a,unlink:r,propagate:c,checkDirty:u,shallowPropagate:f};function a(p,v,y){const x=v.depsTail;if(x!==void 0&&x.dep===p)return;const b=x!==void 0?x.nextDep:v.deps;if(b!==void 0&&b.dep===p){b.version=y,v.depsTail=b;return}const N=p.subsTail;if(N!==void 0&&N.version===y&&N.sub===v)return;const S=v.depsTail=p.subsTail={version:y,dep:p,sub:v,prevDep:x,nextDep:b,prevSub:N,nextSub:void 0};b!==void 0&&(b.prevDep=S),x!==void 0?x.nextDep=S:v.deps=S,N!==void 0?N.nextSub=S:p.subs=S}function r(p,v=p.sub){const y=p.dep,x=p.prevDep,b=p.nextDep,N=p.nextSub,S=p.prevSub;return b!==void 0?b.prevDep=x:v.depsTail=x,x!==void 0?x.nextDep=b:v.deps=b,N!==void 0?N.prevSub=S:y.subsTail=S,S!==void 0?S.nextSub=N:(y.subs=N)===void 0&&s(y),b}function c(p){let v=p.nextSub,y;e:do{const x=p.sub;let b=x.flags;if(b&60?b&12?b&4?!(b&48)&&m(p,x)?(x.flags=b|40,b&=1):b=0:x.flags=b&-9|32:b=0:x.flags=b|32,b&2&&t(x),b&1){const N=x.subs;if(N!==void 0){const S=(p=N).nextSub;S!==void 0&&(y={value:v,prev:y},v=S);continue}}if((p=v)!==void 0){v=p.nextSub;continue}for(;y!==void 0;)if(p=y.value,y=y.prev,p!==void 0){v=p.nextSub;continue e}break}while(!0)}function u(p,v){let y,x=0,b=!1;e:do{const N=p.dep,S=N.flags;if(v.flags&16)b=!0;else if((S&17)===17){if(e(N)){const C=N.subs;C.nextSub!==void 0&&f(C),b=!0}}else if((S&33)===33){(p.nextSub!==void 0||p.prevSub!==void 0)&&(y={value:p,prev:y}),p=N.deps,v=N,++x;continue}if(!b){const C=p.nextDep;if(C!==void 0){p=C;continue}}for(;x--;){const C=v.subs,k=C.nextSub!==void 0;if(k?(p=y.value,y=y.prev):p=C,b){if(e(v)){k&&f(C),v=p.sub;continue}b=!1}else v.flags&=-33;v=p.sub;const A=p.nextDep;if(A!==void 0){p=A;continue e}}return b}while(!0)}function f(p){do{const v=p.sub,y=v.flags;(y&48)===32&&(v.flags=y|16,(y&6)===2&&t(v))}while((p=p.nextSub)!==void 0)}function m(p,v){let y=v.depsTail;for(;y!==void 0;){if(y===p)return!0;y=y.prevDep}return!1}}let dp=0,ua=0,Yo=0;const Fs=[],{link:V$,unlink:$S,propagate:Q$,checkDirty:Cz,shallowPropagate:Y$}=MS({update(e){return e.depsTail!==void 0?Ez(e):Rz(e)},notify(e){let t=Yo,s=t;do if(Fs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Yo=t;s<--t;){const a=Fs[s];Fs[s++]=Fs[t],Fs[t]=a}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Iu(e)):Oz.call(e)}});function kz(){return dp}function zz(){++dp}function _z(){--dp||Tz()}function Ez(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Iu(e)}}function Rz(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function Az(e){const t=e.flags;if(t&16||t&32&&Cz(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Iu(e)}}else e.flags=2}function Tz(){try{for(;ua<Yo;){const e=Fs[ua];Fs[ua++]=void 0,Az(e)}}finally{for(;ua<Yo;){const e=Fs[ua];Fs[ua++]=void 0,e.flags|=10}ua=0,Yo=0}}function Oz(){this.depsTail=void 0,this.flags=0,Iu(this);const e=this.subs;e!==void 0&&$S(e)}function Iu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=$S(s,e)}function fp(e,t,s){const a=typeof e=="object",r=a?e:void 0;return{next:(a?e.next:e)?.bind(r),error:(a?e.error:t)?.bind(r),complete:(a?e.complete:s)?.bind(r)}}const Nm=[];let lu=0;const{link:bx,unlink:Lz,propagate:Dz,checkDirty:PS,shallowPropagate:Sx}=MS({update(e){return e._update()},notify(e){Nm[Cm++]=e,e.flags&=~jt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=jt.Mutable|jt.Dirty,wu(e))}});let qc=0,Cm=0,Ss;function wu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=Lz(s,e)}function US(){if(!(kz()>0)){for(;qc<Cm;){const e=Nm[qc];Nm[qc++]=void 0,e.notify()}qc=0,Cm=0}}function IS(e,t){const s=typeof e=="function",a=e,r={_snapshot:s?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:s?jt.None:jt.Mutable,get(){return Ss!==void 0&&bx(r,Ss,lu),r._snapshot},subscribe(c){const u=fp(c),f={current:!1},m=Mz(()=>{r.get(),f.current?u.next?.(r._snapshot):f.current=!0});return{unsubscribe:()=>{m.stop()}}},_update(c){const u=Ss,f=Object.is;if(s)Ss=r,++lu,r.depsTail=void 0;else if(c===void 0)return!1;s&&(r.flags=jt.Mutable|jt.RecursedCheck);try{const m=r._snapshot,p=typeof c=="function"?c(m):c===void 0&&s?a(m):c;return m===void 0||!f(m,p)?(r._snapshot=p,!0):!1}finally{Ss=u,s&&(r.flags&=~jt.RecursedCheck),wu(r)}}};return s?(r.flags=jt.Mutable|jt.Dirty,r.get=function(){const c=r.flags;if(c&jt.Dirty||c&jt.Pending&&PS(r.deps,r)){if(r._update()){const u=r.subs;u!==void 0&&Sx(u)}}else c&jt.Pending&&(r.flags=c&~jt.Pending);return Ss!==void 0&&bx(r,Ss,lu),r._snapshot}):r.set=function(c){if(r._update(c)){const u=r.subs;u!==void 0&&(Dz(u),Sx(u),US())}},r}function Mz(e){const t=()=>{const a=Ss;Ss=s,++lu,s.depsTail=void 0,s.flags=jt.Watching|jt.RecursedCheck;try{return e()}finally{Ss=a,s.flags&=~jt.RecursedCheck,wu(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:jt.Watching|jt.RecursedCheck,notify(){const a=this.flags;a&jt.Dirty||a&jt.Pending&&PS(this.deps,this)?t():this.flags=jt.Watching},stop(){this.flags=jt.None,this.depsTail=void 0,wu(this)}};return t(),s}class $z{constructor(t){this.atom=IS(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(fp(t))}}class Pz{constructor(t){this.atom=IS(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(fp(t))}}function Uz(e){return typeof e=="function"?new Pz(e):new $z(e)}function Iz(e){try{zz(),e()}finally{_z(),US()}}function Jo(e){let t;return Iz(()=>{t=e()}),t}var km=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Bu=(e,t)=>!!(e.preload&&!e.router.state.matches.some(s=>s.id===t)),ja=(e,t,s=!0)=>{const a={...e.router.options.context??{}},r=s?t:t-1;for(let c=0;c<=r;c++){const u=e.matches[c];if(!u)continue;const f=e.router.getMatch(u.id);f&&Object.assign(a,f.__routeContext,f.__beforeLoadContext)}return a},jx=(e,t)=>{if(!e.matches.length)return;const s=t.routeId,a=e.matches.findIndex(u=>u.routeId===e.router.routeTree.id),r=a>=0?a:0;let c=s?e.matches.findIndex(u=>u.routeId===s):e.firstBadMatchIndex??e.matches.length-1;c<0&&(c=r);for(let u=c;u>=0;u--){const f=e.matches[u];if(e.router.looseRoutesById[f.routeId].options.notFoundComponent)return u}return s?c:r},Ei=(e,t,s)=>{if(!(!wn(s)&&!hn(s)))throw wn(s)&&s.redirectHandled&&!s.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=s,e.updateMatch(t.id,a=>({...a,status:wn(s)?"redirected":a.status==="pending"?"success":a.status,context:ja(e,t.index),isFetching:!1,error:s})),hn(s)&&!s.routeId&&(s.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),wn(s)&&(e.rendered=!0,s.options._fromLocation=e.location,s.redirectHandled=!0,s=e.router.resolveRedirect(s))),s},BS=(e,t)=>{const s=e.router.getMatch(t);return!!(!s||s._nonReactive.dehydrated)},wx=(e,t,s)=>{const a=ja(e,s);e.updateMatch(t,r=>({...r,context:a}))},Ko=(e,t,s,a)=>{const{id:r,routeId:c}=e.matches[t],u=e.router.looseRoutesById[c];if(s instanceof Promise)throw s;s.routerCode=a,e.firstBadMatchIndex??=t,Ei(e,e.router.getMatch(r),s);try{u.options.onError?.(s)}catch(f){s=f,Ei(e,e.router.getMatch(r),s)}e.updateMatch(r,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!wn(s)&&!hn(s)&&(e.serialError??=s)},qS=(e,t,s,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const r=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Bu(e,t)&&(s.options.loader||s.options.beforeLoad||KS(s))&&typeof r=="number"&&r!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent)){const c=setTimeout(()=>{km(e)},r);a._nonReactive.pendingTimeout=c}},Bz=(e,t,s)=>{const a=e.router.getMatch(t);if(!a._nonReactive.beforeLoadPromise&&!a._nonReactive.loaderPromise)return;qS(e,t,s,a);const r=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&Ei(e,c,c.error)};return a._nonReactive.beforeLoadPromise?a._nonReactive.beforeLoadPromise.then(r):r()},qz=(e,t,s,a)=>{const r=e.router.getMatch(t);let c=r._nonReactive.loadPromise;r._nonReactive.loadPromise=$r(()=>{c?.resolve(),c=void 0});const{paramsError:u,searchError:f}=r;u&&Ko(e,s,u,"PARSE_PARAMS"),f&&Ko(e,s,f,"VALIDATE_SEARCH"),qS(e,t,a,r);const m=new AbortController;let p=!1;const v=()=>{p||(p=!0,e.updateMatch(t,z=>({...z,isFetching:"beforeLoad",fetchCount:z.fetchCount+1,abortController:m})))},y=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,z=>({...z,isFetching:!1}))};if(!a.options.beforeLoad){Jo(()=>{v(),y()});return}r._nonReactive.beforeLoadPromise=$r();const x={...ja(e,s,!1),...r.__routeContext},{search:b,params:N,cause:S}=r,C=Bu(e,t),k={search:b,abortController:m,params:N,preload:C,context:x,location:e.location,navigate:z=>e.router.navigate({...z,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:C?"preload":S,matches:e.matches,routeId:a.id,...e.router.options.additionalContext},A=z=>{if(z===void 0){Jo(()=>{v(),y()});return}(wn(z)||hn(z))&&(v(),Ko(e,s,z,"BEFORE_LOAD")),Jo(()=>{v(),e.updateMatch(t,O=>({...O,__beforeLoadContext:z})),y()})};let R;try{if(R=a.options.beforeLoad(k),sl(R))return v(),R.catch(z=>{Ko(e,s,z,"BEFORE_LOAD")}).then(A)}catch(z){v(),Ko(e,s,z,"BEFORE_LOAD")}A(R)},Hz=(e,t)=>{const{id:s,routeId:a}=e.matches[t],r=e.router.looseRoutesById[a],c=()=>f(),u=()=>qz(e,s,t,r),f=()=>{if(BS(e,s))return;const m=Bz(e,s,r);return sl(m)?m.then(u):u()};return c()},Kz=(e,t,s)=>{const a=e.router.getMatch(t);if(!a||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const r={ssr:e.router.options.ssr,matches:e.matches,match:a,params:a.params,loaderData:a.loaderData};return Promise.all([s.options.head?.(r),s.options.scripts?.(r),s.options.headers?.(r)]).then(([c,u,f])=>({meta:c?.meta,links:c?.links,headScripts:c?.scripts,headers:f,scripts:u,styles:c?.styles}))},HS=(e,t,s,a,r)=>{const c=t[a-1],{params:u,loaderDeps:f,abortController:m,cause:p}=e.router.getMatch(s),v=ja(e,a),y=Bu(e,s);return{params:u,deps:f,preload:!!y,parentMatchPromise:c,abortController:m,context:v,location:e.location,navigate:x=>e.router.navigate({...x,_fromLocation:e.location}),cause:y?"preload":p,route:r,...e.router.options.additionalContext}},Nx=async(e,t,s,a,r)=>{try{const c=e.router.getMatch(s);try{(!(qk??e.router.isServer)||c.ssr===!0)&&il(r);const u=r.options.loader,f=typeof u=="function"?u:u?.handler,m=f?.(HS(e,t,s,a,r)),p=!!f&&sl(m);if((p||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||c._nonReactive.minPendingPromise)&&e.updateMatch(s,y=>({...y,isFetching:"loader"})),f){const y=p?await m:m;Ei(e,e.router.getMatch(s),y),y!==void 0&&e.updateMatch(s,x=>({...x,loaderData:y}))}r._lazyPromise&&await r._lazyPromise;const v=c._nonReactive.minPendingPromise;v&&await v,r._componentsPromise&&await r._componentsPromise,e.updateMatch(s,y=>({...y,error:void 0,context:ja(e,a),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(u){let f=u;if(f?.name==="AbortError"){if(c.abortController.signal.aborted){c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loaderPromise=void 0;return}e.updateMatch(s,p=>({...p,status:p.status==="pending"?"success":p.status,isFetching:!1,context:ja(e,a)}));return}const m=c._nonReactive.minPendingPromise;m&&await m,hn(u)&&await r.options.notFoundComponent?.preload?.(),Ei(e,e.router.getMatch(s),u);try{r.options.onError?.(u)}catch(p){f=p,Ei(e,e.router.getMatch(s),p)}!wn(f)&&!hn(f)&&await il(r,["errorComponent"]),e.updateMatch(s,p=>({...p,error:f,context:ja(e,a),status:"error",isFetching:!1}))}}catch(c){const u=e.router.getMatch(s);u&&(u._nonReactive.loaderPromise=void 0),Ei(e,u,c)}},Gz=async(e,t,s)=>{async function a(b,N,S,C,k){const A=Date.now()-N.updatedAt,R=b?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,z=k.options.shouldReload,O=typeof z=="function"?z(HS(e,t,r,s,k)):z,{status:M,invalid:E}=C,L=A>R&&(!!e.forceStaleReload||C.cause==="enter"||S!==void 0&&S!==C.id);u=M==="success"&&(E||(O??L)),b&&k.options.preload===!1||(u&&!e.sync&&v?(f=!0,(async()=>{try{await Nx(e,t,r,s,k);const U=e.router.getMatch(r);U._nonReactive.loaderPromise?.resolve(),U._nonReactive.loadPromise?.resolve(),U._nonReactive.loaderPromise=void 0,U._nonReactive.loadPromise=void 0}catch(U){wn(U)&&await e.router.navigate(U.options)}})()):M!=="success"||u?await Nx(e,t,r,s,k):wx(e,r,s))}const{id:r,routeId:c}=e.matches[s];let u=!1,f=!1;const m=e.router.looseRoutesById[c],p=m.options.loader,v=((typeof p=="function"?void 0:p?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(BS(e,r)){if(!e.router.getMatch(r))return e.matches[s];wx(e,r,s)}else{const b=e.router.getMatch(r),N=e.router.state.matches[s]?.routeId===c?e.router.state.matches[s].id:e.router.state.matches.find(C=>C.routeId===c)?.id,S=Bu(e,r);if(b._nonReactive.loaderPromise){if(b.status==="success"&&!e.sync&&!b.preload&&v)return b;await b._nonReactive.loaderPromise;const C=e.router.getMatch(r),k=C._nonReactive.error||C.error;k&&Ei(e,C,k),C.status==="pending"&&await a(S,b,N,C,m)}else{const C=S&&!e.router.state.matches.some(A=>A.id===r),k=e.router.getMatch(r);k._nonReactive.loaderPromise=$r(),C!==k.preload&&e.updateMatch(r,A=>({...A,preload:C})),await a(S,b,N,k,m)}}const y=e.router.getMatch(r);f||(y._nonReactive.loaderPromise?.resolve(),y._nonReactive.loadPromise?.resolve(),y._nonReactive.loadPromise=void 0),clearTimeout(y._nonReactive.pendingTimeout),y._nonReactive.pendingTimeout=void 0,f||(y._nonReactive.loaderPromise=void 0),y._nonReactive.dehydrated=void 0;const x=f?y.isFetching:!1;return x!==y.isFetching||y.invalid!==!1?(e.updateMatch(r,b=>({...b,isFetching:x,invalid:!1})),e.router.getMatch(r)):y};async function Cx(e){const t=e,s=[];t.router.state.matches.some(x=>x._forcePending)&&km(t);let a;for(let x=0;x<t.matches.length;x++){try{const b=Hz(t,x);sl(b)&&await b}catch(b){if(wn(b))throw b;if(hn(b))a=b;else if(!t.preload)throw b;break}if(t.serialError)break}const r=t.firstBadMatchIndex??t.matches.length,c=a&&!t.preload?jx(t,a):void 0,u=a&&t.preload?0:c!==void 0?Math.min(c+1,r):r;let f,m;for(let x=0;x<u;x++)s.push(Gz(t,s,x));try{await Promise.all(s)}catch{const x=await Promise.allSettled(s);for(const b of x){if(b.status!=="rejected")continue;const N=b.reason;if(wn(N))throw N;hn(N)?f??=N:m??=N}if(m!==void 0)throw m}const p=f??(a&&!t.preload?a:void 0);let v=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!p&&a&&t.preload)return t.matches;if(p){const x=jx(t,p);Di(x!==void 0);const b=t.matches[x],N=t.router.looseRoutesById[b.routeId],S=t.router.options?.defaultNotFoundComponent;!N.options.notFoundComponent&&S&&(N.options.notFoundComponent=S),p.routeId=b.routeId;const C=b.routeId===t.router.routeTree.id;t.updateMatch(b.id,k=>({...k,...C?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:p},isFetching:!1})),v=x,await il(N,["notFoundComponent"])}else if(!t.preload){const x=t.matches[0];x.globalNotFound||t.router.getMatch(x.id)?.globalNotFound&&t.updateMatch(x.id,b=>({...b,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const x=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await il(x,["errorComponent"])}for(let x=0;x<=v;x++){const{id:b,routeId:N}=t.matches[x],S=t.router.looseRoutesById[N];try{const C=Kz(t,b,S);if(C){const k=await C;t.updateMatch(b,A=>({...A,...k}))}}catch(C){console.error(`Error executing head for route ${N}:`,C)}}const y=km(t);if(sl(y)&&await y,p)throw p;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function kx(e,t){const s=t.map(a=>e.options[a]?.preload?.()).filter(Boolean);if(s.length!==0)return Promise.all(s)}function il(e,t=cu){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(a=>{const{id:r,...c}=a.options;Object.assign(e.options,c),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const s=()=>e._componentsLoaded?void 0:t===cu?(()=>{if(e._componentsPromise===void 0){const a=kx(e,cu);a?e._componentsPromise=a.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():kx(e,t);return e._lazyPromise?e._lazyPromise.then(s):s()}function KS(e){for(const t of cu)if(e.options[t]?.preload)return!0;return!1}var cu=["component","errorComponent","pendingComponent","notFoundComponent"],Ti="__TSR_index",zx="popstate",_x="beforeunload";function Fz(e){let t=e.getLocation();const s=new Set,a=u=>{t=e.getLocation(),s.forEach(f=>f({location:t,action:u}))},r=u=>{e.notifyOnIndexChange??!0?a(u):t=e.getLocation()},c=async({task:u,navigateOpts:f,...m})=>{if(f?.ignoreBlocker??!1){u();return}const p=e.getBlockers?.()??[],v=m.type==="PUSH"||m.type==="REPLACE";if(typeof document<"u"&&p.length&&v)for(const y of p){const x=Nu(m.path,m.state);if(await y.blockerFn({currentLocation:t,nextLocation:x,action:m.type})){e.onBlocked?.();return}}u()};return{get location(){return t},get length(){return e.getLength()},subscribers:s,subscribe:u=>(s.add(u),()=>{s.delete(u)}),push:(u,f,m)=>{const p=t.state[Ti];f=Ex(p+1,f),c({task:()=>{e.pushState(u,f),a({type:"PUSH"})},navigateOpts:m,type:"PUSH",path:u,state:f})},replace:(u,f,m)=>{const p=t.state[Ti];f=Ex(p,f),c({task:()=>{e.replaceState(u,f),a({type:"REPLACE"})},navigateOpts:m,type:"REPLACE",path:u,state:f})},go:(u,f)=>{c({task:()=>{e.go(u),r({type:"GO",index:u})},navigateOpts:f,type:"GO"})},back:u=>{c({task:()=>{e.back(u?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{c({task:()=>{e.forward(u?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>t.state[Ti]!==0,createHref:u=>e.createHref(u),block:u=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,u]),()=>{const m=e.getBlockers?.()??[];e.setBlockers?.(m.filter(p=>p!==u))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:a}}function Ex(e,t){t||(t={});const s=hp();return{...t,key:s,__TSR_key:s,[Ti]:e}}function Zz(e){const t=typeof document<"u"?window:void 0,s=t.history.pushState,a=t.history.replaceState;let r=[];const c=()=>r,u=L=>r=L,f=(L=>L),m=(()=>Nu(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const L=hp();t.history.replaceState({[Ti]:0,key:L,__TSR_key:L},"")}let p=m(),v,y=!1,x=!1,b=!1,N=!1;const S=()=>p;let C,k;const A=()=>{C&&(E._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),E._ignoreSubscribers=!1,C=void 0,k=void 0,v=void 0)},R=(L,U,X)=>{const Q=f(U);k||(v=p),p=Nu(U,X),C={href:Q,state:X,isPush:C?.isPush||L==="push"},k||(k=Promise.resolve().then(()=>A()))},z=L=>{p=m(),E.notify({type:L})},O=async()=>{if(x){x=!1;return}const L=m(),U=L.state[Ti]-p.state[Ti],X=U===1,Q=U===-1,ee=!X&&!Q||y;y=!1;const ue=ee?"GO":Q?"BACK":"FORWARD",ze=ee?{type:"GO",index:U}:{type:Q?"BACK":"FORWARD"};if(b)b=!1;else{const je=c();if(typeof document<"u"&&je.length){for(const K of je)if(await K.blockerFn({currentLocation:p,nextLocation:L,action:ue})){x=!0,t.history.go(1),E.notify(ze);return}}}p=m(),E.notify(ze)},M=L=>{if(N){N=!1;return}let U=!1;const X=c();if(typeof document<"u"&&X.length)for(const Q of X){const ee=Q.enableBeforeUnload??!0;if(ee===!0){U=!0;break}if(typeof ee=="function"&&ee()===!0){U=!0;break}}if(U)return L.preventDefault(),L.returnValue=""},E=Fz({getLocation:S,getLength:()=>t.history.length,pushState:(L,U)=>R("push",L,U),replaceState:(L,U)=>R("replace",L,U),back:L=>(L&&(b=!0),N=!0,t.history.back()),forward:L=>{L&&(b=!0),N=!0,t.history.forward()},go:L=>{y=!0,t.history.go(L)},createHref:L=>f(L),flush:A,destroy:()=>{t.history.pushState=s,t.history.replaceState=a,t.removeEventListener(_x,M,{capture:!0}),t.removeEventListener(zx,O)},onBlocked:()=>{v&&p!==v&&(p=v)},getBlockers:c,setBlockers:u,notifyOnIndexChange:!1});return t.addEventListener(_x,M,{capture:!0}),t.addEventListener(zx,O),t.history.pushState=function(...L){const U=s.apply(t.history,L);return E._ignoreSubscribers||z("PUSH"),U},t.history.replaceState=function(...L){const U=a.apply(t.history,L);return E._ignoreSubscribers||z("REPLACE"),U},E}function Vz(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Nu(e,t){const s=Vz(e),a=s.indexOf("#"),r=s.indexOf("?"),c=hp();return{href:s,pathname:s.substring(0,a>0?r>0?Math.min(a,r):a:r>0?r:s.length),hash:a>-1?s.substring(a):"",search:r>-1?s.slice(r,a===-1?void 0:a):"",state:t||{[Ti]:0,key:c,__TSR_key:c}}}function hp(){return(Math.random()+1).toString(36).substring(7)}function wa(e){const t=e.resolvedLocation,s=e.location;return{fromLocation:t,toLocation:s,pathChanged:t?.pathname!==s.pathname,hrefChanged:t?.href!==s.href,hashChanged:t?.hash!==s.hash}}function Qz(e){const t=e.filter(s=>s.status!=="redirected");return t.length===e.length?e:t}var Yz=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=t=>t(),this.update=t=>{const s=this.options,a=this.basepath??s?.basepath??"/",r=this.basepath===void 0,c=s?.rewrite;if(this.options={...s,...t},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=lz(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Zz()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let p;this.resolvePathCache=bu(1e3),p=this.buildRouteTree(),this.setRoutes(p)}!this.__store&&this.latestLocation&&(this.__store=Uz(Xz(this.latestLocation)),pz(this));let u=!1;const f=this.options.basepath??"/",m=this.options.rewrite;if(r||a!==f||c!==m){this.basepath=f;const p=[],v=LS(f);v&&v!=="/"&&p.push(Nz({basepath:f})),m&&p.push(m),this.rewrite=p.length===0?void 0:p.length===1?p[0]:wz(p),this.history&&this.updateLatestLocation(),u=!0}u&&this.__store&&this.__store.setState(p=>({...p,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=nz(this.routeTree,this.options.caseSensitive,(s,a)=>{s.init({originalIndex:a})});return this.options.routeMasks&&Jk(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,s)=>{const a={eventType:t,fn:s};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=t=>{this.subscribers.forEach(s=>{s.eventType===t.type&&s.fn(t)})},this.parseLocation=(t,s)=>{const a=({pathname:f,search:m,hash:p,href:v,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(f)){const C=this.options.parseSearch(m),k=this.options.stringifySearch(C);return{href:f+k+p,publicHref:v,pathname:qo(f).path,external:!1,searchStr:k,search:ca(s?.search,C),hash:qo(p.slice(1)).path,state:ma(s?.state,y)}}const x=new URL(v,this.origin),b=wm(this.rewrite,x),N=this.options.parseSearch(b.search),S=this.options.stringifySearch(N);return b.search=S,{href:b.href.replace(b.origin,""),publicHref:v,pathname:qo(b.pathname).path,external:!!this.rewrite&&b.origin!==this.origin,searchStr:S,search:ca(s?.search,N),hash:qo(b.hash.slice(1)).path,state:ma(s?.state,y)}},r=a(t),{__tempLocation:c,__tempKey:u}=r.state;if(c&&(!u||u===this.tempLocationKey)){const f=a(c);return f.state.key=r.state.key,f.state.__TSR_key=r.state.__TSR_key,delete f.state.__tempLocation,{...f,maskedLocation:r}}return r},this.resolvePathWithBase=(t,s)=>oz({base:t,to:cp(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,s,a)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:s},a):this.matchRoutesInternal(t,s),this.getMatchedRoutes=t=>Wz({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const s=this.getMatch(t);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(a=>a.status==="pending"),s=this.state.matches.filter(a=>a.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...s]).forEach(a=>{this.cancelMatch(a.id)})},this.buildLocation=t=>{const s=(r={})=>{const c=r._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutesLightweight(c);r.from;const f=r.unsafeRelative==="path"?c.pathname:r.from??u.fullPath,m=this.resolvePathWithBase(f,"."),p=u.search,v=Object.assign(Object.create(null),u.params),y=r.to?this.resolvePathWithBase(m,`${r.to}`):this.resolvePathWithBase(m,"."),x=r.params===!1||r.params===null?Object.create(null):(r.params??!0)===!0?v:Object.assign(v,_i(r.params,v)),b=this.getMatchedRoutes(y);let N=b.matchedRoutes;if((!b.foundRoute||b.foundRoute.path!=="/"&&b.routeParams["**"])&&this.options.notFoundRoute&&(N=[...N,this.options.notFoundRoute]),Object.keys(x).length>0)for(const U of N){const X=U.options.params?.stringify??U.options.stringifyParams;if(X)try{Object.assign(x,X(x))}catch{}}const S=t.leaveParams?y:qo(vx({path:y,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let C=p;if(t._includeValidateSearch&&this.options.search?.strict){const U={};N.forEach(X=>{if(X.options.validateSearch)try{Object.assign(U,uu(X.options.validateSearch,{...U,...C}))}catch{}}),C=U}C=e_({search:C,dest:r,destRoutes:N,_includeValidateSearch:t._includeValidateSearch}),C=ca(p,C);const k=this.options.stringifySearch(C),A=r.hash===!0?c.hash:r.hash?_i(r.hash,c.hash):void 0,R=A?`#${A}`:"";let z=r.state===!0?c.state:r.state?_i(r.state,c.state):{};z=ma(c.state,z);const O=`${S}${k}${R}`;let M,E,L=!1;if(this.rewrite){const U=new URL(O,this.origin),X=DS(this.rewrite,U);M=U.href.replace(U.origin,""),X.origin!==this.origin?(E=X.href,L=!0):E=X.pathname+X.search+X.hash}else M=Vk(O),E=M;return{publicHref:E,href:M,pathname:S,search:C,searchStr:k,state:z,hash:A??"",external:L,unmaskOnReload:r.unmaskOnReload}},a=(r={},c)=>{const u=s(r);let f=c?s(c):void 0;if(!f){const m=Object.create(null);if(this.options.routeMasks){const p=Xk(u.pathname,this.processedTree);if(p){Object.assign(m,p.rawParams);const{from:v,params:y,...x}=p.route,b=y===!1||y===null?Object.create(null):(y??!0)===!0?m:Object.assign(m,_i(y,m));c={from:t.from,...x,params:b},f=s(c)}}}return f&&(u.maskedLocation=f),u};return t.mask?a(t,{from:t.from,...t.mask}):a(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:s,...a})=>{const r=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(p=>{a.state[p]=this.latestLocation.state[p]});const m=ba(a.state,this.latestLocation.state);return f.forEach(p=>{delete a.state[p]}),m},c=Ai(this.latestLocation.href)===Ai(a.href);let u=this.commitLocationPromise;if(this.commitLocationPromise=$r(()=>{u?.resolve(),u=void 0}),c&&r())this.load();else{let{maskedLocation:f,hashScrollIntoView:m,...p}=a;f&&(p={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=m??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[a.replace?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:s})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:s,hashScrollIntoView:a,viewTransition:r,ignoreBlocker:c,href:u,...f}={})=>{if(u){const v=this.history.location.state.__TSR_index,y=Nu(u,{__TSR_index:t?v:v+1}),x=new URL(y.pathname,this.origin);f.to=wm(this.rewrite,x).pathname,f.search=this.options.parseSearch(y.search),f.hash=y.hash.slice(1)}const m=this.buildLocation({...f,_includeValidateSearch:!0});this.pendingBuiltLocation=m;const p=this.commitLocation({...m,viewTransition:r,replace:t,resetScroll:s,hashScrollIntoView:a,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===m&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:t,reloadDocument:s,href:a,publicHref:r,...c})=>{let u=!1;if(a)try{new URL(`${a}`),u=!0}catch{}if(u&&!s&&(s=!0),s){if(t!==void 0||!a){const m=this.buildLocation({to:t,...c});a=a??m.publicHref,r=r??m.publicHref}const f=!u&&r?r:a;if(xu(f,this.protocolAllowlist))return Promise.resolve();if(!c.ignoreBlocker){const m=this.history.getBlockers?.()??[];for(const p of m)if(p?.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return c.replace?window.location.replace(f):window.location.href=f,Promise.resolve()}return this.buildAndCommitLocation({...c,href:a,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:s.cachedMatches.filter(a=>!t.some(r=>r.id===a.id))}))},this.load=async t=>{let s,a,r;const c=this.state.resolvedLocation??this.state.location;for(r=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const m=this.latestLocation,p=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...wa({resolvedLocation:p,location:m})}),this.emit({type:"onBeforeLoad",...wa({resolvedLocation:p,location:m})}),await Cx({router:this,sync:t?.sync,forceStaleReload:c.href===m.href,matches:this.state.pendingMatches,location:m,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let v=[],y=[],x=[],b=[];Jo(()=>{this.__store.setState(N=>{const S=N.matches,C=N.pendingMatches||N.matches;return v=S.filter(k=>!C.some(A=>A.id===k.id)),y=S.filter(k=>!C.some(A=>A.routeId===k.routeId)),x=C.filter(k=>!S.some(A=>A.routeId===k.routeId)),b=C.filter(k=>S.some(A=>A.routeId===k.routeId)),{...N,isLoading:!1,loadedAt:Date.now(),matches:C,pendingMatches:void 0,cachedMatches:[...N.cachedMatches,...v.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[y,"onLeave"],[x,"onEnter"],[b,"onStay"]].forEach(([N,S])=>{N.forEach(C=>{this.looseRoutesById[C.routeId].options[S]?.(C)})})})})}})}catch(m){wn(m)?(s=m,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):hn(m)&&(a=m),this.__store.setState(p=>({...p,statusCode:s?s.status:a?404:p.matches.some(v=>v.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.__store.state.matches.some(f=>f.status==="error")&&(u=500),u!==void 0&&this.__store.setState(f=>({...f,statusCode:u}))},this.startViewTransition=t=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const r=this.latestLocation,c=this.state.resolvedLocation,u=typeof s.types=="function"?s.types(wa({resolvedLocation:c,location:r})):s.types;if(u===!1){t();return}a={update:t,types:u}}else a=t;document.startViewTransition(a)}else t()},this.updateMatch=(t,s)=>{this.startTransition(()=>{const a=this.state.pendingMatches?.some(r=>r.id===t)?"pendingMatches":this.state.matches.some(r=>r.id===t)?"matches":this.state.cachedMatches.some(r=>r.id===t)?"cachedMatches":"";a&&(a==="cachedMatches"?this.__store.setState(r=>({...r,cachedMatches:Qz(r.cachedMatches.map(c=>c.id===t?s(c):c))})):this.__store.setState(r=>({...r,[a]:r[a]?.map(c=>c.id===t?s(c):c)})))})},this.getMatch=t=>{const s=a=>a.id===t;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=t=>{const s=a=>t?.filter?.(a)??!0?{...a,invalid:!0,...t?.forcePending||a.status==="error"||a.status==="notFound"?{status:"pending",error:void 0}:void 0}:a;return this.__store.setState(a=>({...a,matches:a.matches.map(s),cachedMatches:a.cachedMatches.map(s),pendingMatches:a.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const s=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const a=t.options._builtLocation??this.buildLocation(t.options),r=this.getParsedLocationHref(a);t.options.href=r,t.headers.set("Location",r)}else if(s)try{const a=new URL(s);if(this.origin&&a.origin===this.origin){const r=a.pathname+a.search+a.hash;t.options.href=r,t.headers.set("Location",r)}}catch{}if(t.options.href&&!t.options._builtLocation&&xu(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{const s=t?.filter;s!==void 0?this.__store.setState(a=>({...a,cachedMatches:a.cachedMatches.filter(r=>!s(r))})):this.__store.setState(a=>({...a,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=s=>{const a=this.looseRoutesById[s.routeId];if(!a.options.loader)return!0;const r=(s.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=r};this.clearCache({filter:t})},this.loadRouteChunk=il,this.preloadRoute=async t=>{const s=t._builtLocation??this.buildLocation(t);let a=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:t});const r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(u=>u.id)),c=new Set([...r,...this.state.cachedMatches.map(u=>u.id)]);Jo(()=>{a.forEach(u=>{c.has(u.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,u]}))})});try{return a=await Cx({router:this,matches:a,location:s,preload:!0,updateMatch:(u,f)=>{r.has(u)?a=a.map(m=>m.id===u?f(m):m):this.updateMatch(u,f)}}),a}catch(u){if(wn(u))return u.options.reloadDocument?void 0:await this.preloadRoute({...u.options,_fromLocation:s});hn(u)||console.error(u);return}},this.matchRoute=(t,s)=>{const a={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},r=this.buildLocation(a);if(s?.pending&&this.state.status!=="pending")return!1;const c=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,u=Wk(r.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,c.pathname,this.processedTree);return!u||t.params&&!ba(u.rawParams,t.params,{partial:!0})?!1:s?.includeSearch??!0?ba(c.search,r.search,{partial:!0})?u.rawParams:!1:u.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??bz,parseSearch:e.parseSearch??xz,protocolAllowlist:e.protocolAllowlist??Zk}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:s}){this.routesById=e,this.routesByPath=t,this.processedTree=s;const a=this.options.notFoundRoute;a&&(a.init({originalIndex:99999999999}),this.routesById[a.id]=a)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const s=this.getMatchedRoutes(e.pathname),{foundRoute:a,routeParams:r,parsedParams:c}=s;let{matchedRoutes:u}=s,f=!1;(a?a.path!=="/"&&r["**"]:Ai(e.pathname))&&(this.options.notFoundRoute?u=[...u,this.options.notFoundRoute]:f=!0);const m=f?n_(this.options.notFoundMode,u):void 0,p=new Array(u.length),v=new Map(this.state.matches.map(y=>[y.routeId,y]));for(let y=0;y<u.length;y++){const x=u[y],b=p[y-1];let N,S,C;{const ue=b?.search??e.search,ze=b?._strictSearch??void 0;try{const je=uu(x.options.validateSearch,{...ue})??void 0;N={...ue,...je},S={...ze,...je},C=void 0}catch(je){let K=je;if(je instanceof Cu||(K=new Cu(je.message,{cause:je})),t?.throwOnError)throw K;N=ue,S={},C=K}}const k=x.options.loaderDeps?.({search:N})??"",A=k?JSON.stringify(k):"",{interpolatedPath:R,usedParams:z}=vx({path:x.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),O=x.id+R+A,M=this.getMatch(O),E=v.get(x.id),L=M?._strictParams??z;let U;if(!M)try{Rx(x,z,c,L)}catch(ue){if(hn(ue)||wn(ue)?U=ue:U=new Jz(ue.message,{cause:ue}),t?.throwOnError)throw U}Object.assign(r,L);const X=E?"stay":"enter";let Q;if(M)Q={...M,cause:X,params:E?.params??r,_strictParams:L,search:ca(E?E.search:M.search,N),_strictSearch:S};else{const ue=x.options.loader||x.options.beforeLoad||x.lazyFn||KS(x)?"pending":"success";Q={id:O,ssr:x.options.ssr,index:y,routeId:x.id,params:E?.params??r,_strictParams:L,pathname:R,updatedAt:Date.now(),search:E?ca(E.search,N):N,_strictSearch:S,searchError:void 0,status:ue,isFetching:!1,error:void 0,paramsError:U,__routeContext:void 0,_nonReactive:{loadPromise:$r()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:X,loaderDeps:E?ma(E.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:x.options.staticData||{},fullPath:x.fullPath}}t?.preload||(Q.globalNotFound=m===x.id),Q.searchError=C;const ee=this.getParentContext(b);Q.context={...ee,...Q.__routeContext,...Q.__beforeLoadContext},p[y]=Q}for(let y=0;y<p.length;y++){const x=p[y],b=this.looseRoutesById[x.routeId],N=this.getMatch(x.id),S=v.get(x.routeId);if(x.params=S?ca(S.params,r):r,!N){const C=p[y-1],k=this.getParentContext(C);if(b.options.context){const A={deps:x.loaderDeps,params:x.params,context:k??{},location:e,navigate:R=>this.navigate({...R,_fromLocation:e}),buildLocation:this.buildLocation,cause:x.cause,abortController:x.abortController,preload:!!x.preload,matches:p,routeId:b.id};x.__routeContext=b.options.context(A)??void 0}x.context={...k,...x.__routeContext,...x.__beforeLoadContext}}}return p}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:s,parsedParams:a}=this.getMatchedRoutes(e.pathname),r=nl(t),c={...e.search};for(const p of t)try{Object.assign(c,uu(p.options.validateSearch,c))}catch{}const u=nl(this.state.matches),f=u&&u.routeId===r.id&&e.pathname===this.state.location.pathname;let m;if(f)m=u.params;else{const p=Object.assign(Object.create(null),s);for(const v of t)try{Rx(v,s,a??{},p)}catch{}m=p}return{matchedRoutes:t,fullPath:r.fullPath,search:c,params:m}}},Cu=class extends Error{},Jz=class extends Error{};function Xz(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function uu(e,t){if(e==null)return{};if("~standard"in e){const s=e["~standard"].validate(t);if(s instanceof Promise)throw new Cu("Async validation not supported");if(s.issues)throw new Cu(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function Wz({pathname:e,routesById:t,processedTree:s}){const a=Object.create(null),r=Ai(e);let c,u;const f=ez(r,s,!0);return f&&(c=f.route,Object.assign(a,f.rawParams),u=Object.assign(Object.create(null),f.parsedParams)),{matchedRoutes:f?.branch||[t.__root__],routeParams:a,foundRoute:c,parsedParams:u}}function e_({search:e,dest:t,destRoutes:s,_includeValidateSearch:a}){return t_(s)(e,t,a??!1)}function t_(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const r of e){if("search"in r.options)r.options.search?.middlewares&&t.middlewares.push(...r.options.search.middlewares);else if(r.options.preSearchFilters||r.options.postSearchFilters){const c=({search:u,next:f})=>{let m=u;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(m=r.options.preSearchFilters.reduce((v,y)=>y(v),u));const p=f(m);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((v,y)=>y(v),p):p};t.middlewares.push(c)}if(r.options.validateSearch){const c=({search:u,next:f})=>{const m=f(u);if(!t._includeValidateSearch)return m;try{return{...m,...uu(r.options.validateSearch,m)??void 0}}catch{return m}};t.middlewares.push(c)}}const s=({search:r})=>{const c=t.dest;return c.search?c.search===!0?r:_i(c.search,r):{}};t.middlewares.push(s);const a=(r,c,u)=>{if(r>=u.length)return c;const f=u[r];return f({search:c,next:p=>a(r+1,p,u)})};return function(c,u,f){return t.dest=u,t._includeValidateSearch=f,a(0,c,t.middlewares)}}function n_(e,t){if(e!=="root")for(let s=t.length-1;s>=0;s--){const a=t[s];if(a.children)return a.id}return Sa}function Rx(e,t,s,a){const r=e.options.params?.parse??e.options.parseParams;if(r)if(e.options.skipRouteOnParseError)for(const c in t)c in s&&(a[c]=s[c]);else{const c=r(a);Object.assign(a,c)}}var s_="Error preloading route! ☝️",GS=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const s=this.options,a=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=Sa:this.parentRoute||Di(!1);let r=a?Sa:s?.path;r&&r!=="/"&&(r=OS(r));const c=s?.id||r;let u=a?Sa:ou([this.parentRoute.id==="__root__"?"":this.parentRoute.id,c]);r==="__root__"&&(r="/"),u!=="__root__"&&(u=ou(["/",u]));const f=u==="__root__"?"/":ou([this.parentRoute.fullPath,r]);this._path=r,this._id=u,this._fullPath=f,this._to=Ai(f)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>up({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},i_=class extends GS{constructor(e){super(e)}};function mp(e){const t=e.errorComponent??pp;return o.jsx(a_,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:a})=>s?w.createElement(t,{error:s,reset:a}):e.children})}var a_=class extends w.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}};function pp({error:e}){const[t,s]=w.useState(!1);return o.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[o.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),o.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(a=>!a),children:t?"Hide Error":"Show Error"})]}),o.jsx("div",{style:{height:".25rem"}}),t?o.jsx("div",{children:o.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?o.jsx("code",{children:e.message}):null})}):null]})}function r_({children:e,fallback:t=null}){return FS()?o.jsx(cs.Fragment,{children:e}):o.jsx(cs.Fragment,{children:t})}function FS(){return cs.useSyncExternalStore(o_,()=>!0,()=>!1)}function o_(){return()=>{}}var ZS=w.createContext(null);function Jn(e){const t=w.useContext(ZS);return e?.warn,t}var Ih={exports:{}},Bh={},qh={exports:{}},Hh={};var Ax;function l_(){if(Ax)return Hh;Ax=1;var e=fl();function t(y,x){return y===x&&(y!==0||1/y===1/x)||y!==y&&x!==x}var s=typeof Object.is=="function"?Object.is:t,a=e.useState,r=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue;function f(y,x){var b=x(),N=a({inst:{value:b,getSnapshot:x}}),S=N[0].inst,C=N[1];return c(function(){S.value=b,S.getSnapshot=x,m(S)&&C({inst:S})},[y,b,x]),r(function(){return m(S)&&C({inst:S}),y(function(){m(S)&&C({inst:S})})},[y]),u(b),b}function m(y){var x=y.getSnapshot;y=y.value;try{var b=x();return!s(y,b)}catch{return!0}}function p(y,x){return x()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return Hh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Hh}var Tx;function c_(){return Tx||(Tx=1,qh.exports=l_()),qh.exports}var Ox;function u_(){if(Ox)return Bh;Ox=1;var e=fl(),t=c_();function s(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var a=typeof Object.is=="function"?Object.is:s,r=t.useSyncExternalStore,c=e.useRef,u=e.useEffect,f=e.useMemo,m=e.useDebugValue;return Bh.useSyncExternalStoreWithSelector=function(p,v,y,x,b){var N=c(null);if(N.current===null){var S={hasValue:!1,value:null};N.current=S}else S=N.current;N=f(function(){function k(M){if(!A){if(A=!0,R=M,M=x(M),b!==void 0&&S.hasValue){var E=S.value;if(b(E,M))return z=E}return z=M}if(E=z,a(R,M))return E;var L=x(M);return b!==void 0&&b(E,L)?(R=M,E):(R=M,z=L)}var A=!1,R,z,O=y===void 0?null:y;return[function(){return k(v())},O===null?void 0:function(){return k(O())}]},[v,y,x,b]);var C=r(p,N[0],N[1]);return u(function(){S.hasValue=!0,S.value=C},[C]),m(C),C},Bh}var Lx;function d_(){return Lx||(Lx=1,Ih.exports=u_()),Ih.exports}var f_=d_();function h_(e,t){return e===t}function m_(e,t,s=h_){const a=w.useCallback(u=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(u);return f},[e]),r=w.useCallback(()=>e?.get(),[e]);return f_.useSyncExternalStoreWithSelector(a,r,r,t,s)}function Nn(e){const t=Jn({warn:e?.router===void 0}),s=e?.router||t,a=w.useRef(void 0);return m_(s.__store,r=>{if(e?.select){if(e.structuralSharing??s.options.defaultStructuralSharing){const c=ma(a.current,e.select(r));return a.current=c,c}return e.select(r)}return r})}var qu=w.createContext(void 0),p_=w.createContext(void 0);function Ui(e){const t=w.useContext(e.from?p_:qu);return Nn({select:s=>{const a=s.matches.find(r=>e.from?e.from===r.routeId:r.id===t);if(Di(!((e.shouldThrow??!0)&&!a),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),a!==void 0)return e.select?e.select(a):a},structuralSharing:e.structuralSharing})}function gp(e){return Ui({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function yp(e){const{select:t,...s}=e;return Ui({...s,select:a=>t?t(a.loaderDeps):a.loaderDeps})}function Hu(e){return Ui({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const s=e.strict===!1?t.params:t._strictParams;return e.select?e.select(s):s}})}function Ku(e){return Ui({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Ii(e){const t=Jn();return w.useCallback(s=>t.navigate({...s,from:s.from??e?.from}),[e?.from,t])}function vp(e){return Ui({...e,select:t=>e.select?e.select(t.context):t.context})}var xp=mS();const g_=hS(xp);function y_(e,t){const s=Jn(),a=Bk(t),{activeProps:r,inactiveProps:c,activeOptions:u,to:f,preload:m,preloadDelay:p,hashScrollIntoView:v,replace:y,startTransition:x,resetScroll:b,viewTransition:N,children:S,target:C,disabled:k,style:A,className:R,onClick:z,onBlur:O,onFocus:M,onMouseEnter:E,onMouseLeave:L,onTouchStart:U,ignoreBlocker:X,params:Q,search:ee,hash:ue,state:ze,mask:je,reloadDocument:K,unsafeRelative:ae,from:me,_fromLocation:V,...H}=e,T=FS(),B=Nn({select:De=>{const Ye=De.matches[De.matches.length-1];return{search:Ye?.search,hash:De.location.hash,path:Ye?.pathname}},structuralSharing:!0}),se=e.from,le=w.useMemo(()=>({...e,from:se}),[s,B,se,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),J=w.useMemo(()=>s.buildLocation({...le}),[s,le]),fe=J.maskedLocation?J.maskedLocation.publicHref:J.publicHref,ye=J.maskedLocation?J.maskedLocation.external:J.external,_e=w.useMemo(()=>w_(fe,ye,s.history,k),[k,ye,fe,s.history]),ge=w.useMemo(()=>{if(_e?.external)return xu(_e.href,s.protocolAllowlist)?void 0:_e.href;if(!N_(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),xu(f,s.protocolAllowlist)?void 0:f}catch{}},[f,_e,s.protocolAllowlist]),Ze=Nn({select:De=>{if(ge)return!1;if(u?.exact){if(!rz(De.location.pathname,J.pathname,s.basepath))return!1}else{const Ye=Su(De.location.pathname,s.basepath),Nt=Su(J.pathname,s.basepath);if(!(Ye.startsWith(Nt)&&(Ye.length===Nt.length||Ye[Nt.length]==="/")))return!1}return(u?.includeSearch??!0)&&!ba(De.location.search,J.search,{partial:!u?.exact,ignoreUndefined:!u?.explicitUndefined})?!1:u?.includeHash?T&&De.location.hash===J.hash:!0}}),et=Ze?_i(r,{})??v_:Kh,de=Ze?Kh:_i(c,{})??Kh,Ve=[R,et.className,de.className].filter(Boolean).join(" "),at=(A||et.style||de.style)&&{...A,...et.style,...de.style},[Zt,$t]=w.useState(!1),Dn=w.useRef(!1),nn=e.reloadDocument||ge?!1:m??s.options.defaultPreload,_t=p??s.options.defaultPreloadDelay??0,re=w.useCallback(()=>{s.preloadRoute({...le,_builtLocation:J}).catch(De=>{console.warn(De),console.warn(s_)})},[s,le,J]);Ik(a,w.useCallback(De=>{De?.isIntersecting&&re()},[re]),j_,{disabled:!!k||nn!=="viewport"}),w.useEffect(()=>{Dn.current||!k&&nn==="render"&&(re(),Dn.current=!0)},[k,re,nn]);const Ge=De=>{const Ye=De.currentTarget.getAttribute("target"),Nt=C!==void 0?C:Ye;if(!k&&!C_(De)&&!De.defaultPrevented&&(!Nt||Nt==="_self")&&De.button===0){De.preventDefault(),xp.flushSync(()=>{$t(!0)});const Be=s.subscribe("onResolved",()=>{Be(),$t(!1)});s.navigate({...le,replace:y,resetScroll:b,hashScrollIntoView:v,startTransition:x,viewTransition:N,ignoreBlocker:X})}};if(ge)return{...H,ref:a,href:ge,...S&&{children:S},...C&&{target:C},...k&&{disabled:k},...A&&{style:A},...R&&{className:R},...z&&{onClick:z},...O&&{onBlur:O},...M&&{onFocus:M},...E&&{onMouseEnter:E},...L&&{onMouseLeave:L},...U&&{onTouchStart:U}};const gt=De=>{if(k||nn!=="intent")return;if(!_t){re();return}const Ye=De.currentTarget;if(Go.has(Ye))return;const Nt=setTimeout(()=>{Go.delete(Ye),re()},_t);Go.set(Ye,Nt)},Vt=De=>{k||nn!=="intent"||re()},Qe=De=>{if(k||!nn||!_t)return;const Ye=De.currentTarget,Nt=Go.get(Ye);Nt&&(clearTimeout(Nt),Go.delete(Ye))};return{...H,...et,...de,href:_e?.href,ref:a,onClick:Sr([z,Ge]),onBlur:Sr([O,Qe]),onFocus:Sr([M,gt]),onMouseEnter:Sr([E,gt]),onMouseLeave:Sr([L,Qe]),onTouchStart:Sr([U,Vt]),disabled:!!k,target:C,...at&&{style:at},...Ve&&{className:Ve},...k&&x_,...Ze&&b_,...T&&Zt&&S_}}var Kh={},v_={className:"active"},x_={role:"link","aria-disabled":!0},b_={"data-status":"active","aria-current":"page"},S_={"data-transitioning":"transitioning"},Go=new WeakMap,j_={rootMargin:"100px"},Sr=e=>t=>{for(const s of e)if(s){if(t.defaultPrevented)return;s(t)}};function w_(e,t,s,a){if(!a)return t?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function N_(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var St=w.forwardRef((e,t)=>{const{_asChild:s,...a}=e,{type:r,...c}=y_(a,t),u=typeof a.children=="function"?a.children({isActive:c["data-status"]==="active"}):a.children;if(!s){const{disabled:f,...m}=c;return w.createElement("a",m,u)}return w.createElement(s,c,u)});function C_(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var k_=class extends GS{constructor(e){super(e),this.useMatch=t=>Ui({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>vp({...t,from:this.id}),this.useSearch=t=>Ku({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Hu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>yp({...t,from:this.id}),this.useLoaderData=t=>gp({...t,from:this.id}),this.useNavigate=()=>Ii({from:this.fullPath}),this.Link=cs.forwardRef((t,s)=>o.jsx(St,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Xn(e){return new k_(e)}function z_(){return e=>E_(e)}var __=class extends i_{constructor(e){super(e),this.useMatch=t=>Ui({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>vp({...t,from:this.id}),this.useSearch=t=>Ku({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Hu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>yp({...t,from:this.id}),this.useLoaderData=t=>gp({...t,from:this.id}),this.useNavigate=()=>Ii({from:this.fullPath}),this.Link=cs.forwardRef((t,s)=>o.jsx(St,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function E_(e){return new __(e)}function Dx(e){return typeof e=="object"?new Mx(e,{silent:!0}).createRoute(e):new Mx(e,{silent:!0}).createRoute}var Mx=class{constructor(e,t){this.path=e,this.createRoute=s=>{const a=Xn(s);return a.isRoot=!1,a},this.silent=t?.silent}},$x=class{constructor(e){this.useMatch=t=>Ui({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>vp({...t,from:this.options.id}),this.useSearch=t=>Ku({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Hu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>yp({...t,from:this.options.id}),this.useLoaderData=t=>gp({...t,from:this.options.id}),this.useNavigate=()=>Ii({from:Jn().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function Px(e){return typeof e=="object"?new $x(e):t=>new $x({id:e,...t})}function R_(e){const t=Nn({select:s=>`not-found-${s.location.pathname}-${s.status}`});return o.jsx(mp,{getResetKey:()=>t,onCatch:(s,a)=>{if(hn(s))e.onCatch?.(s,a);else throw s},errorComponent:({error:s})=>{if(hn(s))return e.fallback?.(s);throw s},children:e.children})}function A_(){return o.jsx("p",{children:"Not Found"})}function zr(e){return o.jsx(o.Fragment,{children:e.children})}function VS(e,t,s){return t.options.notFoundComponent?o.jsx(t.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?o.jsx(e.options.defaultNotFoundComponent,{...s}):o.jsx(A_,{})}function T_(){return Jn().isScrollRestoring,null}var QS=w.memo(function({matchId:t}){const s=Jn(),a=Nn({select:N=>{const S=N.matches.findIndex(k=>k.id===t),C=N.matches[S];return Di(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:N.loadedAt,parentRouteId:N.matches[S-1]?.routeId}},structuralSharing:!0}),r=s.routesById[a.routeId],c=r.options.pendingComponent??s.options.defaultPendingComponent,u=c?o.jsx(c,{}):null,f=r.options.errorComponent??s.options.defaultErrorComponent,m=r.options.onCatch??s.options.defaultOnCatch,p=r.isRoot?r.options.notFoundComponent??s.options.notFoundRoute?.options.component:r.options.notFoundComponent,v=a.ssr===!1||a.ssr==="data-only",y=(!r.isRoot||r.options.wrapInSuspense||v)&&(r.options.wrapInSuspense??c??(r.options.errorComponent?.preload||v))?w.Suspense:zr,x=f?mp:zr,b=p?R_:zr;return o.jsxs(r.isRoot?r.options.shellComponent??zr:zr,{children:[o.jsx(qu.Provider,{value:t,children:o.jsx(y,{fallback:u,children:o.jsx(x,{getResetKey:()=>a.resetKey,errorComponent:f||pp,onCatch:(N,S)=>{if(hn(N))throw N;m?.(N,S)},children:o.jsx(b,{fallback:N=>{if(!p||N.routeId&&N.routeId!==a.routeId||!N.routeId&&!r.isRoot)throw N;return w.createElement(p,N)},children:v||a._displayPending?o.jsx(r_,{fallback:u,children:o.jsx(Ux,{matchId:t})}):o.jsx(Ux,{matchId:t})})})})}),a.parentRouteId===Sa&&s.options.scrollRestoration?o.jsxs(o.Fragment,{children:[o.jsx(O_,{}),o.jsx(T_,{})]}):null]})});function O_(){const e=Jn(),t=w.useRef(void 0);return o.jsx("script",{suppressHydrationWarning:!0,ref:s=>{s&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...wa(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var Ux=w.memo(function({matchId:t}){const s=Jn(),{match:a,key:r,routeId:c}=Nn({select:m=>{const p=m.matches.find(x=>x.id===t),v=p.routeId,y=(s.routesById[v].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:v,loaderDeps:p.loaderDeps,params:p._strictParams,search:p._strictSearch});return{key:y?JSON.stringify(y):void 0,routeId:v,match:{id:p.id,status:p.status,error:p.error,_forcePending:p._forcePending,_displayPending:p._displayPending}}},structuralSharing:!0}),u=s.routesById[c],f=w.useMemo(()=>{const m=u.options.component??s.options.defaultComponent;return m?o.jsx(m,{},r):o.jsx(bp,{})},[r,u.options.component,s.options.defaultComponent]);if(a._displayPending)throw s.getMatch(a.id)?._nonReactive.displayPendingPromise;if(a._forcePending)throw s.getMatch(a.id)?._nonReactive.minPendingPromise;if(a.status==="pending"){const m=u.options.pendingMinMs??s.options.defaultPendingMinMs;if(m){const p=s.getMatch(a.id);if(p&&!p._nonReactive.minPendingPromise){const v=$r();p._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),p._nonReactive.minPendingPromise=void 0},m)}}throw s.getMatch(a.id)?._nonReactive.loadPromise}if(a.status==="notFound")return Di(hn(a.error)),VS(s,u,a.error);if(a.status==="redirected")throw Di(wn(a.error)),s.getMatch(a.id)?._nonReactive.loadPromise;if(a.status==="error")throw a.error;return f}),bp=w.memo(function(){const t=Jn(),s=w.useContext(qu),a=Nn({select:p=>p.matches.find(v=>v.id===s)?.routeId}),r=t.routesById[a],c=Nn({select:p=>{const v=p.matches.find(y=>y.id===s);return Di(v),v.globalNotFound}}),u=Nn({select:p=>{const v=p.matches;return v[v.findIndex(y=>y.id===s)+1]?.id}}),f=t.options.defaultPendingComponent?o.jsx(t.options.defaultPendingComponent,{}):null;if(c)return VS(t,r,void 0);if(!u)return null;const m=o.jsx(QS,{matchId:u});return a===Sa?o.jsx(w.Suspense,{fallback:f,children:m}):m});function L_(){const e=Jn(),t=w.useRef({router:e,mounted:!1}),[s,a]=w.useState(!1),{hasPendingMatches:r,isLoading:c}=Nn({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(x=>x.status==="pending")}),structuralSharing:!0}),u=Lh(c),f=c||s||r,m=Lh(f),p=c||r,v=Lh(p);return e.startTransition=y=>{a(!0),w.startTransition(()=>{y(),a(!1)})},w.useEffect(()=>{const y=e.history.subscribe(e.load),x=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ai(e.latestLocation.publicHref)!==Ai(x.publicHref)&&e.commitLocation({...x,replace:!0}),()=>{y()}},[e,e.history]),Ic(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(x){console.error(x)}})()},[e]),Ic(()=>{u&&!c&&e.emit({type:"onLoad",...wa(e.state)})},[u,e,c]),Ic(()=>{v&&!p&&e.emit({type:"onBeforeRouteMount",...wa(e.state)})},[p,v,e]),Ic(()=>{if(m&&!f){const y=wa(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(x=>({...x,status:"idle",resolvedLocation:x.location})),y.hrefChanged&&gz(e)}},[f,m,e]),null}function D_(){const e=Jn(),t=e.routesById[Sa].options.pendingComponent??e.options.defaultPendingComponent,s=t?o.jsx(t,{}):null,a=o.jsxs(typeof document<"u"&&e.ssr?zr:w.Suspense,{fallback:s,children:[o.jsx(L_,{}),o.jsx(M_,{})]});return e.options.InnerWrap?o.jsx(e.options.InnerWrap,{children:a}):a}function M_(){const e=Jn(),t=Nn({select:r=>r.matches[0]?.id}),s=Nn({select:r=>r.loadedAt}),a=t?o.jsx(QS,{matchId:t}):null;return o.jsx(qu.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?a:o.jsx(mp,{getResetKey:()=>s,errorComponent:pp,onCatch:void 0,children:a})})}var $_=e=>new P_(e),P_=class extends Yz{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=Dx,globalThis.createLazyFileRoute=Px):typeof window<"u"&&(window.createFileRoute=Dx,window.createLazyFileRoute=Px);function U_({router:e,children:t,...s}){Object.keys(s).length>0&&e.update({...e.options,...s,context:{...e.options.context,...s.context}});const a=o.jsx(ZS.Provider,{value:e,children:t});return e.options.Wrap?o.jsx(e.options.Wrap,{children:a}):a}function I_({router:e,...t}){return o.jsx(U_,{router:e,...t,children:o.jsx(D_,{})})}function B_(e){return Nn({select:t=>t.location})}class ku extends Error{code;statusCode;constructor(t,s,a){super(t),this.name="ApiError",this.code=a??"UNKNOWN",this.statusCode=s}}function q_(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const H_=q_();function K_(){return""}function Ix(){return!!K_()}async function pe(e,t){const s=await fetch(`${H_}${e}`,{...t,credentials:t?.credentials??"same-origin",headers:{"Content-Type":"application/json",...t?.headers}});if(!s.ok){const a=await s.text();let r=`API ${s.status}: ${s.statusText}`,c;if(a)try{const u=JSON.parse(a);typeof u.error=="string"?r=u.error:u.error?.message?(r=u.error.message,c=u.error.code):u.message&&(r=u.message)}catch{r=a}throw new ku(r,s.status,c)}if(s.status!==204)return s.json()}function YS(){return pe("/projects")}function JS(e){return pe(`/projects/${encodeURIComponent(e)}`)}function XS(){return pe("/runs")}function Pr(e){return pe(`/runs/${encodeURIComponent(e)}`)}function G_(e){return pe(`/projects/${encodeURIComponent(e)}/keywords`)}function WS(e){return pe(`/projects/${encodeURIComponent(e)}/competitors`)}function ej(e,t){const s=new URLSearchParams;t!==void 0&&s.set("location",t);const a=s.toString();return pe(`/projects/${encodeURIComponent(e)}/timeline${a?`?${a}`:""}`)}function Gu(e,t){return pe(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function F_(e,t){return pe(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function Z_(e,t){return pe(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function tj(e,t){return pe(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function Bx(e,t){const s=await JS(e);return Gu(e,{displayName:s.displayName,canonicalDomain:s.canonicalDomain,ownedDomains:t,country:s.country,language:s.language,tags:s.tags,labels:s.labels,providers:s.providers,locations:s.locations,defaultLocation:s.defaultLocation})}async function V_(e,t){const s=await JS(e);return Gu(e,{displayName:t.displayName??s.displayName,canonicalDomain:t.canonicalDomain??s.canonicalDomain,ownedDomains:t.ownedDomains??s.ownedDomains,country:t.country??s.country,language:t.language??s.language,tags:s.tags,labels:s.labels,providers:s.providers,locations:t.locations??s.locations,defaultLocation:t.defaultLocation!==void 0?t.defaultLocation:s.defaultLocation})}function Q_(e,t){const s={};return t?.location&&(s.location=t.location),t?.allLocations&&(s.allLocations=!0),t?.noLocation&&(s.noLocation=!0),pe(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(s)})}function Y_(e,t){return pe(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function J_(e,t){await pe(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function X_(e,t){return pe(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function W_(e){await pe(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function e2(e){return pe(`/projects/${encodeURIComponent(e)}/export`)}function Sp(){return pe("/settings")}function t2(){return pe("/session")}function n2(e){return pe("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function s2(e){return pe("/session",{method:"POST",body:JSON.stringify({password:e})})}function i2(e,t){return pe(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function a2(e){return pe("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function r2(e){try{return await pe(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Error&&t.message.includes("404"))return null;throw t}}function qx(e,t){return pe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function o2(e){await pe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function l2(e){return pe(`/projects/${encodeURIComponent(e)}/notifications`)}function c2(e,t){return pe(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function u2(e,t){await pe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function d2(e,t){return pe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function f2(e,t,s){return pe(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:s})})}function h2(e){return pe("/apply",{method:"POST",body:JSON.stringify(e)})}function m2(e){return pe("/runs",{method:"POST",body:JSON.stringify(e??{})})}function nj(e){return pe(`/projects/${encodeURIComponent(e)}/google/connections`)}function p2(e,t){return pe(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function g2(e,t){return pe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function y2(e){return pe(`/projects/${encodeURIComponent(e)}/google/properties`)}function v2(e,t,s){return pe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:s})})}function x2(e,t,s){return pe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:s})})}function sj(e,t){return pe(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function b2(e,t){const s=new URLSearchParams;t?.startDate&&s.set("startDate",t.startDate),t?.endDate&&s.set("endDate",t.endDate),t?.query&&s.set("query",t.query),t?.page&&s.set("page",t.page),t?.limit!==void 0&&s.set("limit",String(t.limit));const a=s.toString()?`?${s.toString()}`:"";return pe(`/projects/${encodeURIComponent(e)}/google/gsc/performance${a}`)}function S2(e,t){return pe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function j2(e,t){const s=new URLSearchParams;t?.url&&s.set("url",t.url),s.set("limit",String(t.limit));const a=s.toString()?`?${s.toString()}`:"";return pe(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${a}`)}function w2(e){return pe(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function jp(e){return pe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function N2(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return pe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${a}`)}function C2(e,t){return pe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function k2(e){return pe(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function z2(e){return pe(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function Hx(){return pe("/cdp/status")}function _2(e,t){return pe("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function Kx(e,t){return pe(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function ij(e){return pe(`/projects/${encodeURIComponent(e)}/bing/status`)}function E2(e,t){return pe(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function R2(e){return pe(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function A2(e){return pe(`/projects/${encodeURIComponent(e)}/bing/sites`)}function T2(e,t){return pe(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function wp(e){return pe(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function aj(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return pe(`/projects/${encodeURIComponent(e)}/bing/inspections${a}`)}function rj(e,t){return pe(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function Gx(e,t){return pe(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function O2(e){return pe(`/projects/${encodeURIComponent(e)}/bing/performance`)}function L2(e){return pe("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function D2(e,t){const s=t?`?window=${t}`:"";return pe(`/projects/${encodeURIComponent(e)}/analytics/metrics${s}`)}function M2(e,t){const s=t?`?window=${t}`:"";return pe(`/projects/${encodeURIComponent(e)}/analytics/gaps${s}`)}function $2(e,t){const s=t?`?window=${t}`:"";return pe(`/projects/${encodeURIComponent(e)}/analytics/sources${s}`)}function Fx(e){return pe(`/projects/${encodeURIComponent(e)}/ga/status`)}function Zx(e,t){return pe(`/projects/${encodeURIComponent(e)}/ga/traffic`)}function oj(e,t){return pe(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function P2(e,t){return pe(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function U2(e){return pe(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}async function I2(e,t){try{const s=await fetch(e);if(!s.ok)return{label:t,state:"error",detail:`HTTP ${s.status}`};const a=await s.json(),r=typeof a.version=="string"?a.version:"unknown",c=typeof a.databaseUrlConfigured=="boolean"?a.databaseUrlConfigured:void 0,u=typeof a.lastHeartbeatAt=="string"?a.lastHeartbeatAt:void 0,f=[r,c===!1?"database not configured":"database configured",u?`heartbeat ${u}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:f,version:r,databaseConfigured:c,lastHeartbeatAt:u}}catch(s){return{label:t,state:"error",detail:s instanceof Error?s.message:"unreachable"}}}const B2=6e3,q2=5,H2=180;let on=[],K2=0;const zm=new Set,_m=new Map,Em=new Map;function zu(){const e=[...on];for(const t of zm)t(e)}function Np(e){const t=_m.get(e);t&&(clearTimeout(t),_m.delete(e));const s=Em.get(e);s&&(clearTimeout(s),Em.delete(e))}function lj(e){Np(e);const t=on.length;on=on.filter(s=>s.id!==e),on.length!==t&&zu()}function Vx(e){Np(e.id),_m.set(e.id,setTimeout(()=>{Rm(e.id)},e.durationMs))}function G2(e,t,s){return typeof e=="string"?{title:e,tone:t,durationMs:s}:e}function Ke(e,t="negative",s=B2){const a=G2(e,t,s),r={id:String(++K2),title:a.title,detail:a.detail,tone:a.tone??t,durationMs:a.durationMs??s,dedupeKey:a.dedupeKey,cta:a.cta,state:"open"};if(a.dedupeKey){const c=on.find(u=>u.dedupeKey===a.dedupeKey);if(c){if((a.dedupeMode??"drop")==="drop")return c.id;const u={...c,title:r.title,detail:r.detail,tone:r.tone,durationMs:r.durationMs,cta:r.cta,state:"open"};return on=on.map(f=>f.id===c.id?u:f),zu(),Vx(u),c.id}}return on.length>=q2&&lj(on[0].id),on=[...on,r],zu(),Vx(r),r.id}function Rm(e){const t=on.find(s=>s.id===e);!t||t.state==="closing"||(Np(e),on=on.map(s=>s.id===e?{...s,state:"closing"}:s),zu(),Em.set(e,setTimeout(()=>{lj(e)},H2)))}function F2(e){return zm.add(e),()=>{zm.delete(e)}}function Qx(){return on}function Z2(){return new Ok({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new jS({onError:(e,t,s,a)=>{a.meta?.skipGlobalErrorToast||Ke({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const V2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Q2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,a)=>a?a.toUpperCase():s.toLowerCase()),Yx=e=>{const t=Q2(e);return t.charAt(0).toUpperCase()+t.slice(1)},cj=(...e)=>e.filter((t,s,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===s).join(" ").trim(),Y2=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var J2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const X2=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:r="",children:c,iconNode:u,...f},m)=>w.createElement("svg",{ref:m,...J2,width:t,height:t,stroke:e,strokeWidth:a?Number(s)*24/Number(t):s,className:cj("lucide",r),...!c&&!Y2(f)&&{"aria-hidden":"true"},...f},[...u.map(([p,v])=>w.createElement(p,v)),...Array.isArray(c)?c:[c]]));const tn=(e,t)=>{const s=w.forwardRef(({className:a,...r},c)=>w.createElement(X2,{ref:c,iconNode:t,className:cj(`lucide-${V2(Yx(e))}`,`lucide-${e}`,a),...r}));return s.displayName=Yx(e),s};const W2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Fu=tn("chevron-right",W2);const eE=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],tE=tn("download",eE);const nE=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],sE=tn("github",nE);const iE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],aE=tn("globe",iE);const rE=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],oE=tn("layout-dashboard",rE);const lE=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],cE=tn("menu",lE);const uE=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],dE=tn("play",uE);const fE=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Jx=tn("plus",fE);const hE=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Xx=tn("refresh-cw",hE);const mE=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],pE=tn("rocket",mE);const gE=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],yE=tn("rotate-ccw",gE);const vE=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],xE=tn("settings",vE);const bE=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],SE=tn("trash-2",bE);const jE=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],wE=tn("triangle-alert",jE);const NE=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],CE=tn("unplug",NE);const kE=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],zE=tn("upload",kE);const _E=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zu=tn("x",_E);function EE(e){const t=e.match(/^(\[.*?\])\s*(.+)/);if(t){const s=t[1],a=t[2],r=a.indexOf("{");if(r>=0){const c=a.slice(0,r).trim(),u=a.slice(r);try{const f=JSON.parse(u);return`${s} ${c}
10
10
 
11
11
  ${JSON.stringify(f,null,2)}`}catch{}}return`${s}
@@ -91,7 +91,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
91
91
 
92
92
  `)}b.write("payload.value = newResult;"),b.write("return payload;");const A=b.compile();return(R,z)=>A(x,R,z)};let c;const u=Tu,f=!xw.jitless,p=f&&RT.value,v=t.catchall;let y;e._zod.parse=(x,b)=>{y??(y=a.value);const N=x.value;return u(N)?f&&p&&b?.async===!1&&b.jitless!==!0?(c||(c=r(t.shape)),x=c(x,b),v?Mw([],N,x,b,y,e):x):s(x,b):(x.issues.push({expected:"object",code:"invalid_type",input:N,inst:e}),x)}});function _b(e,t,s,a){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const r=e.filter(c=>!_r(c));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:s,errors:e.map(c=>c.issues.map(u=>$i(u,a,Mi())))}),t)}const gL=ne("$ZodUnion",(e,t)=>{Ct.init(e,t),ct(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),ct(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),ct(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),ct(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${r.map(c=>Mp(c.source)).join("|")})$`)}});const s=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(r,c)=>{if(s)return a(r,c);let u=!1;const f=[];for(const m of t.options){const p=m._zod.run({value:r.value,issues:[]},c);if(p instanceof Promise)f.push(p),u=!0;else{if(p.issues.length===0)return p;f.push(p)}}return u?Promise.all(f).then(m=>_b(m,r,e,c)):_b(f,r,e,c)}}),yL=ne("$ZodIntersection",(e,t)=>{Ct.init(e,t),e._zod.parse=(s,a)=>{const r=s.value,c=t.left._zod.run({value:r,issues:[]},a),u=t.right._zod.run({value:r,issues:[]},a);return c instanceof Promise||u instanceof Promise?Promise.all([c,u]).then(([m,p])=>Eb(s,m,p)):Eb(s,c,u)}});function $m(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ur(e)&&Ur(t)){const s=Object.keys(t),a=Object.keys(e).filter(c=>s.indexOf(c)!==-1),r={...e,...t};for(const c of a){const u=$m(e[c],t[c]);if(!u.valid)return{valid:!1,mergeErrorPath:[c,...u.mergeErrorPath]};r[c]=u.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const s=[];for(let a=0;a<e.length;a++){const r=e[a],c=t[a],u=$m(r,c);if(!u.valid)return{valid:!1,mergeErrorPath:[a,...u.mergeErrorPath]};s.push(u.data)}return{valid:!0,data:s}}return{valid:!1,mergeErrorPath:[]}}function Eb(e,t,s){const a=new Map;let r;for(const f of t.issues)if(f.code==="unrecognized_keys"){r??(r=f);for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).l=!0}else e.issues.push(f);for(const f of s.issues)if(f.code==="unrecognized_keys")for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).r=!0;else e.issues.push(f);const c=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(c.length&&r&&e.issues.push({...r,keys:c}),_r(e))return e;const u=$m(t.value,s.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const vL=ne("$ZodRecord",(e,t)=>{Ct.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Ur(r))return s.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),s;const c=[],u=t.keyType._zod.values;if(u){s.value={};const f=new Set;for(const p of u)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){f.add(typeof p=="number"?p.toString():p);const v=t.valueType._zod.run({value:r[p],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&s.issues.push(...Er(p,y.issues)),s.value[p]=y.value})):(v.issues.length&&s.issues.push(...Er(p,v.issues)),s.value[p]=v.value)}let m;for(const p in r)f.has(p)||(m=m??[],m.push(p));m&&m.length>0&&s.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:m})}else{s.value={};for(const f of Reflect.ownKeys(r)){if(f==="__proto__")continue;let m=t.keyType._zod.run({value:f,issues:[]},a);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Ew.test(f)&&m.issues.length){const y=t.keyType._zod.run({value:Number(f),issues:[]},a);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(m=y)}if(m.issues.length){t.mode==="loose"?s.value[f]=r[f]:s.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(y=>$i(y,a,Mi())),input:f,path:[f],inst:e});continue}const v=t.valueType._zod.run({value:r[f],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&s.issues.push(...Er(f,y.issues)),s.value[m.value]=y.value})):(v.issues.length&&s.issues.push(...Er(f,v.issues)),s.value[m.value]=v.value)}}return c.length?Promise.all(c).then(()=>s):s}}),xL=ne("$ZodEnum",(e,t)=>{Ct.init(e,t);const s=bw(t.entries),a=new Set(s);e._zod.values=a,e._zod.pattern=new RegExp(`^(${s.filter(r=>AT.has(typeof r)).map(r=>typeof r=="string"?Ir(r):r.toString()).join("|")})$`),e._zod.parse=(r,c)=>{const u=r.value;return a.has(u)||r.issues.push({code:"invalid_value",values:s,input:u,inst:e}),r}}),bL=ne("$ZodLiteral",(e,t)=>{if(Ct.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const s=new Set(t.values);e._zod.values=s,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Ir(a):a?Ir(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,r)=>{const c=a.value;return s.has(c)||a.issues.push({code:"invalid_value",values:t.values,input:c,inst:e}),a}}),SL=ne("$ZodTransform",(e,t)=>{Ct.init(e,t),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new vw(e.constructor.name);const r=t.transform(s.value,s);if(a.async)return(r instanceof Promise?r:Promise.resolve(r)).then(u=>(s.value=u,s));if(r instanceof Promise)throw new Lr;return s.value=r,s}});function Rb(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const $w=ne("$ZodOptional",(e,t)=>{Ct.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ct(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ct(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${Mp(s.source)})?$`):void 0}),e._zod.parse=(s,a)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>Rb(c,s.value)):Rb(r,s.value)}return s.value===void 0?s:t.innerType._zod.run(s,a)}}),jL=ne("$ZodExactOptional",(e,t)=>{$w.init(e,t),ct(e._zod,"values",()=>t.innerType._zod.values),ct(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(s,a)=>t.innerType._zod.run(s,a)}),wL=ne("$ZodNullable",(e,t)=>{Ct.init(e,t),ct(e._zod,"optin",()=>t.innerType._zod.optin),ct(e._zod,"optout",()=>t.innerType._zod.optout),ct(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${Mp(s.source)}|null)$`):void 0}),ct(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(s,a)=>s.value===null?s:t.innerType._zod.run(s,a)}),NL=ne("$ZodDefault",(e,t)=>{Ct.init(e,t),e._zod.optin="optional",ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);if(s.value===void 0)return s.value=t.defaultValue,s;const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>Ab(c,t)):Ab(r,t)}});function Ab(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const CL=ne("$ZodPrefault",(e,t)=>{Ct.init(e,t),e._zod.optin="optional",ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>(a.direction==="backward"||s.value===void 0&&(s.value=t.defaultValue),t.innerType._zod.run(s,a))}),kL=ne("$ZodNonOptional",(e,t)=>{Ct.init(e,t),ct(e._zod,"values",()=>{const s=t.innerType._zod.values;return s?new Set([...s].filter(a=>a!==void 0)):void 0}),e._zod.parse=(s,a)=>{const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>Tb(c,e)):Tb(r,e)}});function Tb(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const zL=ne("$ZodCatch",(e,t)=>{Ct.init(e,t),ct(e._zod,"optin",()=>t.innerType._zod.optin),ct(e._zod,"optout",()=>t.innerType._zod.optout),ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>(s.value=c.value,c.issues.length&&(s.value=t.catchValue({...s,error:{issues:c.issues.map(u=>$i(u,a,Mi()))},input:s.value}),s.issues=[]),s)):(s.value=r.value,r.issues.length&&(s.value=t.catchValue({...s,error:{issues:r.issues.map(c=>$i(c,a,Mi()))},input:s.value}),s.issues=[]),s)}}),_L=ne("$ZodPipe",(e,t)=>{Ct.init(e,t),ct(e._zod,"values",()=>t.in._zod.values),ct(e._zod,"optin",()=>t.in._zod.optin),ct(e._zod,"optout",()=>t.out._zod.optout),ct(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(s,a)=>{if(a.direction==="backward"){const c=t.out._zod.run(s,a);return c instanceof Promise?c.then(u=>Jc(u,t.in,a)):Jc(c,t.in,a)}const r=t.in._zod.run(s,a);return r instanceof Promise?r.then(c=>Jc(c,t.out,a)):Jc(r,t.out,a)}});function Jc(e,t,s){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},s)}const EL=ne("$ZodReadonly",(e,t)=>{Ct.init(e,t),ct(e._zod,"propValues",()=>t.innerType._zod.propValues),ct(e._zod,"values",()=>t.innerType._zod.values),ct(e._zod,"optin",()=>t.innerType?._zod?.optin),ct(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(Ob):Ob(r)}});function Ob(e){return e.value=Object.freeze(e.value),e}const RL=ne("$ZodCustom",(e,t)=>{Cn.init(e,t),Ct.init(e,t),e._zod.parse=(s,a)=>s,e._zod.check=s=>{const a=s.value,r=t.fn(a);if(r instanceof Promise)return r.then(c=>Lb(c,s,a,e));Lb(r,s,a,e)}});function Lb(e,t,s,a){if(!e){const r={code:"custom",input:s,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(r.params=a._zod.def.params),t.issues.push(ll(r))}}var Db;class AL{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...s){const a=s[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const s=this._map.get(t);return s&&typeof s=="object"&&"id"in s&&this._idmap.delete(s.id),this._map.delete(t),this}get(t){const s=t._zod.parent;if(s){const a={...this.get(s)??{}};delete a.id;const r={...a,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function TL(){return new AL}(Db=globalThis).__zod_globalRegistry??(Db.__zod_globalRegistry=TL());const Vo=globalThis.__zod_globalRegistry;function OL(e,t){return new e({type:"string",...we(t)})}function LL(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...we(t)})}function Mb(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...we(t)})}function DL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...we(t)})}function ML(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...we(t)})}function $L(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...we(t)})}function PL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...we(t)})}function UL(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...we(t)})}function IL(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...we(t)})}function BL(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...we(t)})}function qL(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...we(t)})}function HL(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...we(t)})}function KL(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...we(t)})}function GL(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...we(t)})}function FL(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...we(t)})}function ZL(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...we(t)})}function VL(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...we(t)})}function QL(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...we(t)})}function YL(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...we(t)})}function JL(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...we(t)})}function XL(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...we(t)})}function WL(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...we(t)})}function eD(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...we(t)})}function tD(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...we(t)})}function nD(e,t){return new e({type:"string",format:"date",check:"string_format",...we(t)})}function sD(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...we(t)})}function iD(e,t){return new e({type:"string",format:"duration",check:"string_format",...we(t)})}function aD(e,t){return new e({type:"number",checks:[],...we(t)})}function rD(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...we(t)})}function oD(e,t){return new e({type:"boolean",...we(t)})}function lD(e){return new e({type:"unknown"})}function cD(e,t){return new e({type:"never",...we(t)})}function $b(e,t){return new Aw({check:"less_than",...we(t),value:e,inclusive:!1})}function tm(e,t){return new Aw({check:"less_than",...we(t),value:e,inclusive:!0})}function Pb(e,t){return new Tw({check:"greater_than",...we(t),value:e,inclusive:!1})}function nm(e,t){return new Tw({check:"greater_than",...we(t),value:e,inclusive:!0})}function Ub(e,t){return new NO({check:"multiple_of",...we(t),value:e})}function Pw(e,t){return new kO({check:"max_length",...we(t),maximum:e})}function Lu(e,t){return new zO({check:"min_length",...we(t),minimum:e})}function Uw(e,t){return new _O({check:"length_equals",...we(t),length:e})}function uD(e,t){return new EO({check:"string_format",format:"regex",...we(t),pattern:e})}function dD(e){return new RO({check:"string_format",format:"lowercase",...we(e)})}function fD(e){return new AO({check:"string_format",format:"uppercase",...we(e)})}function hD(e,t){return new TO({check:"string_format",format:"includes",...we(t),includes:e})}function mD(e,t){return new OO({check:"string_format",format:"starts_with",...we(t),prefix:e})}function pD(e,t){return new LO({check:"string_format",format:"ends_with",...we(t),suffix:e})}function Hr(e){return new DO({check:"overwrite",tx:e})}function gD(e){return Hr(t=>t.normalize(e))}function yD(){return Hr(e=>e.trim())}function vD(){return Hr(e=>e.toLowerCase())}function xD(){return Hr(e=>e.toUpperCase())}function bD(){return Hr(e=>ET(e))}function SD(e,t,s){return new e({type:"array",element:t,...we(s)})}function jD(e,t,s){return new e({type:"custom",check:"custom",fn:t,...we(s)})}function wD(e){const t=ND(s=>(s.addIssue=a=>{if(typeof a=="string")s.issues.push(ll(a,s.value,t._zod.def));else{const r=a;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=s.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),s.issues.push(ll(r))}},e(s.value,s)));return t}function ND(e,t){const s=new Cn({check:"custom",...we(t)});return s._zod.check=e,s}function Iw(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Vo,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function qt(e,t,s={path:[],schemaPath:[]}){var a;const r=e._zod.def,c=t.seen.get(e);if(c)return c.count++,s.schemaPath.includes(e)&&(c.cycle=s.path),c.schema;const u={schema:{},count:1,cycle:void 0,path:s.path};t.seen.set(e,u);const f=e._zod.toJSONSchema?.();if(f)u.schema=f;else{const v={...s,schemaPath:[...s.schemaPath,e],path:s.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,u.schema,v);else{const x=u.schema,b=t.processors[r.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);b(e,t,x,v)}const y=e._zod.parent;y&&(u.ref||(u.ref=y),qt(y,t,v),t.seen.get(y).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(u.schema,m),t.io==="input"&&dn(e)&&(delete u.schema.examples,delete u.schema.default),t.io==="input"&&u.schema._prefault&&((a=u.schema).default??(a.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function Bw(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const u of e.seen.entries()){const f=e.metadataRegistry.get(u[0])?.id;if(f){const m=a.get(f);if(m&&m!==u[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(f,u[0])}}const r=u=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(u[0])?.id,x=e.external.uri??(N=>N);if(y)return{ref:x(y)};const b=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=b,{defId:b,ref:`${x("__shared")}#/${f}/${b}`}}if(u[1]===s)return{ref:"#"};const p=`#/${f}/`,v=u[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:p+v}},c=u=>{if(u[1].schema.$ref)return;const f=u[1],{ref:m,defId:p}=r(u);f.def={...f.schema},p&&(f.defId=p);const v=f.schema;for(const y in v)delete v[y];v.$ref=m};if(e.cycles==="throw")for(const u of e.seen.entries()){const f=u[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
93
93
 
94
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const f=u[1];if(t===u[0]){c(u);continue}if(e.external){const p=e.external.registry.get(u[0])?.id;if(t!==u[0]&&p){c(u);continue}}if(e.metadataRegistry.get(u[0])?.id){c(u);continue}if(f.cycle){c(u);continue}if(f.count>1&&e.reused==="ref"){c(u);continue}}}function qw(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=u=>{const f=e.seen.get(u);if(f.ref===null)return;const m=f.def??f.schema,p={...m},v=f.ref;if(f.ref=null,v){a(v);const x=e.seen.get(v),b=x.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(b)):Object.assign(m,b),Object.assign(m,p),u._zod.parent===v)for(const S in m)S==="$ref"||S==="allOf"||S in p||delete m[S];if(b.$ref&&x.def)for(const S in m)S==="$ref"||S==="allOf"||S in x.def&&JSON.stringify(m[S])===JSON.stringify(x.def[S])&&delete m[S]}const y=u._zod.parent;if(y&&y!==v){a(y);const x=e.seen.get(y);if(x?.schema.$ref&&(m.$ref=x.schema.$ref,x.def))for(const b in m)b==="$ref"||b==="allOf"||b in x.def&&JSON.stringify(m[b])===JSON.stringify(x.def[b])&&delete m[b]}e.override({zodSchema:u,jsonSchema:m,path:f.path??[]})};for(const u of[...e.seen.entries()].reverse())a(u[0]);const r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const u=e.external.registry.get(t)?.id;if(!u)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(u)}Object.assign(r,s.def??s.schema);const c=e.external?.defs??{};for(const u of e.seen.entries()){const f=u[1];f.def&&f.defId&&(c[f.defId]=f.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?r.$defs=c:r.definitions=c);try{const u=JSON.parse(JSON.stringify(r));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:Du(t,"input",e.processors),output:Du(t,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function dn(e,t){const s=t??{seen:new Set};if(s.seen.has(e))return!1;s.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return dn(a.element,s);if(a.type==="set")return dn(a.valueType,s);if(a.type==="lazy")return dn(a.getter(),s);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return dn(a.innerType,s);if(a.type==="intersection")return dn(a.left,s)||dn(a.right,s);if(a.type==="record"||a.type==="map")return dn(a.keyType,s)||dn(a.valueType,s);if(a.type==="pipe")return dn(a.in,s)||dn(a.out,s);if(a.type==="object"){for(const r in a.shape)if(dn(a.shape[r],s))return!0;return!1}if(a.type==="union"){for(const r of a.options)if(dn(r,s))return!0;return!1}if(a.type==="tuple"){for(const r of a.items)if(dn(r,s))return!0;return!!(a.rest&&dn(a.rest,s))}return!1}const CD=(e,t={})=>s=>{const a=Iw({...s,processors:t});return qt(e,a),Bw(a,e),qw(a,e)},Du=(e,t,s={})=>a=>{const{libraryOptions:r,target:c}=a??{},u=Iw({...r??{},target:c,io:t,processors:s});return qt(e,u),Bw(u,e),qw(u,e)},kD={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},zD=(e,t,s,a)=>{const r=s;r.type="string";const{minimum:c,maximum:u,format:f,patterns:m,contentEncoding:p}=e._zod.bag;if(typeof c=="number"&&(r.minLength=c),typeof u=="number"&&(r.maxLength=u),f&&(r.format=kD[f]??f,r.format===""&&delete r.format,f==="time"&&delete r.format),p&&(r.contentEncoding=p),m&&m.size>0){const v=[...m];v.length===1?r.pattern=v[0].source:v.length>1&&(r.allOf=[...v.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},_D=(e,t,s,a)=>{const r=s,{minimum:c,maximum:u,format:f,multipleOf:m,exclusiveMaximum:p,exclusiveMinimum:v}=e._zod.bag;typeof f=="string"&&f.includes("int")?r.type="integer":r.type="number",typeof v=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.minimum=v,r.exclusiveMinimum=!0):r.exclusiveMinimum=v),typeof c=="number"&&(r.minimum=c,typeof v=="number"&&t.target!=="draft-04"&&(v>=c?delete r.minimum:delete r.exclusiveMinimum)),typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.maximum=p,r.exclusiveMaximum=!0):r.exclusiveMaximum=p),typeof u=="number"&&(r.maximum=u,typeof p=="number"&&t.target!=="draft-04"&&(p<=u?delete r.maximum:delete r.exclusiveMaximum)),typeof m=="number"&&(r.multipleOf=m)},ED=(e,t,s,a)=>{s.type="boolean"},RD=(e,t,s,a)=>{s.not={}},AD=(e,t,s,a)=>{},TD=(e,t,s,a)=>{const r=e._zod.def,c=bw(r.entries);c.every(u=>typeof u=="number")&&(s.type="number"),c.every(u=>typeof u=="string")&&(s.type="string"),s.enum=c},OD=(e,t,s,a)=>{const r=e._zod.def,c=[];for(const u of r.values)if(u===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof u=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(u))}else c.push(u);if(c.length!==0)if(c.length===1){const u=c[0];s.type=u===null?"null":typeof u,t.target==="draft-04"||t.target==="openapi-3.0"?s.enum=[u]:s.const=u}else c.every(u=>typeof u=="number")&&(s.type="number"),c.every(u=>typeof u=="string")&&(s.type="string"),c.every(u=>typeof u=="boolean")&&(s.type="boolean"),c.every(u=>u===null)&&(s.type="null"),s.enum=c},LD=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},DD=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},MD=(e,t,s,a)=>{const r=s,c=e._zod.def,{minimum:u,maximum:f}=e._zod.bag;typeof u=="number"&&(r.minItems=u),typeof f=="number"&&(r.maxItems=f),r.type="array",r.items=qt(c.element,t,{...a,path:[...a.path,"items"]})},$D=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object",r.properties={};const u=c.shape;for(const p in u)r.properties[p]=qt(u[p],t,{...a,path:[...a.path,"properties",p]});const f=new Set(Object.keys(u)),m=new Set([...f].filter(p=>{const v=c.shape[p]._zod;return t.io==="input"?v.optin===void 0:v.optout===void 0}));m.size>0&&(r.required=Array.from(m)),c.catchall?._zod.def.type==="never"?r.additionalProperties=!1:c.catchall?c.catchall&&(r.additionalProperties=qt(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},PD=(e,t,s,a)=>{const r=e._zod.def,c=r.inclusive===!1,u=r.options.map((f,m)=>qt(f,t,{...a,path:[...a.path,c?"oneOf":"anyOf",m]}));c?s.oneOf=u:s.anyOf=u},UD=(e,t,s,a)=>{const r=e._zod.def,c=qt(r.left,t,{...a,path:[...a.path,"allOf",0]}),u=qt(r.right,t,{...a,path:[...a.path,"allOf",1]}),f=p=>"allOf"in p&&Object.keys(p).length===1,m=[...f(c)?c.allOf:[c],...f(u)?u.allOf:[u]];s.allOf=m},ID=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object";const u=c.keyType,m=u._zod.bag?.patterns;if(c.mode==="loose"&&m&&m.size>0){const v=qt(c.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});r.patternProperties={};for(const y of m)r.patternProperties[y.source]=v}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=qt(c.keyType,t,{...a,path:[...a.path,"propertyNames"]})),r.additionalProperties=qt(c.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const p=u._zod.values;if(p){const v=[...p].filter(y=>typeof y=="string"||typeof y=="number");v.length>0&&(r.required=v)}},BD=(e,t,s,a)=>{const r=e._zod.def,c=qt(r.innerType,t,a),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=r.innerType,s.nullable=!0):s.anyOf=[c,{type:"null"}]},qD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},HD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.default=JSON.parse(JSON.stringify(r.defaultValue))},KD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,t.io==="input"&&(s._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},GD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType;let u;try{u=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}s.default=u},FD=(e,t,s,a)=>{const r=e._zod.def,c=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;qt(c,t,a);const u=t.seen.get(e);u.ref=c},ZD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.readOnly=!0},Hw=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},VD=ne("ZodISODateTime",(e,t)=>{QO.init(e,t),zt.init(e,t)});function QD(e){return tD(VD,e)}const YD=ne("ZodISODate",(e,t)=>{YO.init(e,t),zt.init(e,t)});function JD(e){return nD(YD,e)}const XD=ne("ZodISOTime",(e,t)=>{JO.init(e,t),zt.init(e,t)});function WD(e){return sD(XD,e)}const e5=ne("ZodISODuration",(e,t)=>{XO.init(e,t),zt.init(e,t)});function t5(e){return iD(e5,e)}const n5=(e,t)=>{Nw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>qT(e,s)},flatten:{value:s=>BT(e,s)},addIssue:{value:s=>{e.issues.push(s),e.message=JSON.stringify(e.issues,Mm,2)}},addIssues:{value:s=>{e.issues.push(...s),e.message=JSON.stringify(e.issues,Mm,2)}},isEmpty:{get(){return e.issues.length===0}}})},es=ne("ZodError",n5,{Parent:Error}),s5=Pp(es),i5=Up(es),a5=td(es),r5=nd(es),o5=GT(es),l5=FT(es),c5=ZT(es),u5=VT(es),d5=QT(es),f5=YT(es),h5=JT(es),m5=XT(es),kt=ne("ZodType",(e,t)=>(Ct.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Du(e,"input"),output:Du(e,"output")}}),e.toJSONSchema=CD(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...s)=>e.clone(qi(t,{checks:[...t.checks??[],...s.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(s,a)=>Hi(e,s,a),e.brand=()=>e,e.register=((s,a)=>(s.add(e,a),e)),e.parse=(s,a)=>s5(e,s,a,{callee:e.parse}),e.safeParse=(s,a)=>a5(e,s,a),e.parseAsync=async(s,a)=>i5(e,s,a,{callee:e.parseAsync}),e.safeParseAsync=async(s,a)=>r5(e,s,a),e.spa=e.safeParseAsync,e.encode=(s,a)=>o5(e,s,a),e.decode=(s,a)=>l5(e,s,a),e.encodeAsync=async(s,a)=>c5(e,s,a),e.decodeAsync=async(s,a)=>u5(e,s,a),e.safeEncode=(s,a)=>d5(e,s,a),e.safeDecode=(s,a)=>f5(e,s,a),e.safeEncodeAsync=async(s,a)=>h5(e,s,a),e.safeDecodeAsync=async(s,a)=>m5(e,s,a),e.refine=(s,a)=>e.check(lM(s,a)),e.superRefine=s=>e.check(cM(s)),e.overwrite=s=>e.check(Hr(s)),e.optional=()=>qb(e),e.exactOptional=()=>Q5(e),e.nullable=()=>Hb(e),e.nullish=()=>qb(Hb(e)),e.nonoptional=s=>tM(e,s),e.array=()=>Pe(e),e.or=s=>B5([e,s]),e.and=s=>H5(e,s),e.transform=s=>Kb(e,Z5(s)),e.default=s=>X5(e,s),e.prefault=s=>eM(e,s),e.catch=s=>sM(e,s),e.pipe=s=>Kb(e,s),e.readonly=()=>rM(e),e.describe=s=>{const a=e.clone();return Vo.add(a,{description:s}),a},Object.defineProperty(e,"description",{get(){return Vo.get(e)?.description},configurable:!0}),e.meta=(...s)=>{if(s.length===0)return Vo.get(e);const a=e.clone();return Vo.add(a,s[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=s=>s(e),e)),Kw=ne("_ZodString",(e,t)=>{Ip.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>zD(e,a,r);const s=e._zod.bag;e.format=s.format??null,e.minLength=s.minimum??null,e.maxLength=s.maximum??null,e.regex=(...a)=>e.check(uD(...a)),e.includes=(...a)=>e.check(hD(...a)),e.startsWith=(...a)=>e.check(mD(...a)),e.endsWith=(...a)=>e.check(pD(...a)),e.min=(...a)=>e.check(Lu(...a)),e.max=(...a)=>e.check(Pw(...a)),e.length=(...a)=>e.check(Uw(...a)),e.nonempty=(...a)=>e.check(Lu(1,...a)),e.lowercase=a=>e.check(dD(a)),e.uppercase=a=>e.check(fD(a)),e.trim=()=>e.check(yD()),e.normalize=(...a)=>e.check(gD(...a)),e.toLowerCase=()=>e.check(vD()),e.toUpperCase=()=>e.check(xD()),e.slugify=()=>e.check(bD())}),p5=ne("ZodString",(e,t)=>{Ip.init(e,t),Kw.init(e,t),e.email=s=>e.check(LL(g5,s)),e.url=s=>e.check(UL(y5,s)),e.jwt=s=>e.check(eD(T5,s)),e.emoji=s=>e.check(IL(v5,s)),e.guid=s=>e.check(Mb(Ib,s)),e.uuid=s=>e.check(DL(Xc,s)),e.uuidv4=s=>e.check(ML(Xc,s)),e.uuidv6=s=>e.check($L(Xc,s)),e.uuidv7=s=>e.check(PL(Xc,s)),e.nanoid=s=>e.check(BL(x5,s)),e.guid=s=>e.check(Mb(Ib,s)),e.cuid=s=>e.check(qL(b5,s)),e.cuid2=s=>e.check(HL(S5,s)),e.ulid=s=>e.check(KL(j5,s)),e.base64=s=>e.check(JL(E5,s)),e.base64url=s=>e.check(XL(R5,s)),e.xid=s=>e.check(GL(w5,s)),e.ksuid=s=>e.check(FL(N5,s)),e.ipv4=s=>e.check(ZL(C5,s)),e.ipv6=s=>e.check(VL(k5,s)),e.cidrv4=s=>e.check(QL(z5,s)),e.cidrv6=s=>e.check(YL(_5,s)),e.e164=s=>e.check(WL(A5,s)),e.datetime=s=>e.check(QD(s)),e.date=s=>e.check(JD(s)),e.time=s=>e.check(WD(s)),e.duration=s=>e.check(t5(s))});function P(e){return OL(p5,e)}const zt=ne("ZodStringFormat",(e,t)=>{wt.init(e,t),Kw.init(e,t)}),g5=ne("ZodEmail",(e,t)=>{IO.init(e,t),zt.init(e,t)}),Ib=ne("ZodGUID",(e,t)=>{PO.init(e,t),zt.init(e,t)}),Xc=ne("ZodUUID",(e,t)=>{UO.init(e,t),zt.init(e,t)}),y5=ne("ZodURL",(e,t)=>{BO.init(e,t),zt.init(e,t)}),v5=ne("ZodEmoji",(e,t)=>{qO.init(e,t),zt.init(e,t)}),x5=ne("ZodNanoID",(e,t)=>{HO.init(e,t),zt.init(e,t)}),b5=ne("ZodCUID",(e,t)=>{KO.init(e,t),zt.init(e,t)}),S5=ne("ZodCUID2",(e,t)=>{GO.init(e,t),zt.init(e,t)}),j5=ne("ZodULID",(e,t)=>{FO.init(e,t),zt.init(e,t)}),w5=ne("ZodXID",(e,t)=>{ZO.init(e,t),zt.init(e,t)}),N5=ne("ZodKSUID",(e,t)=>{VO.init(e,t),zt.init(e,t)}),C5=ne("ZodIPv4",(e,t)=>{WO.init(e,t),zt.init(e,t)}),k5=ne("ZodIPv6",(e,t)=>{eL.init(e,t),zt.init(e,t)}),z5=ne("ZodCIDRv4",(e,t)=>{tL.init(e,t),zt.init(e,t)}),_5=ne("ZodCIDRv6",(e,t)=>{nL.init(e,t),zt.init(e,t)}),E5=ne("ZodBase64",(e,t)=>{sL.init(e,t),zt.init(e,t)}),R5=ne("ZodBase64URL",(e,t)=>{aL.init(e,t),zt.init(e,t)}),A5=ne("ZodE164",(e,t)=>{rL.init(e,t),zt.init(e,t)}),T5=ne("ZodJWT",(e,t)=>{lL.init(e,t),zt.init(e,t)}),Gw=ne("ZodNumber",(e,t)=>{Lw.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>_D(e,a,r),e.gt=(a,r)=>e.check(Pb(a,r)),e.gte=(a,r)=>e.check(nm(a,r)),e.min=(a,r)=>e.check(nm(a,r)),e.lt=(a,r)=>e.check($b(a,r)),e.lte=(a,r)=>e.check(tm(a,r)),e.max=(a,r)=>e.check(tm(a,r)),e.int=a=>e.check(Bb(a)),e.safe=a=>e.check(Bb(a)),e.positive=a=>e.check(Pb(0,a)),e.nonnegative=a=>e.check(nm(0,a)),e.negative=a=>e.check($b(0,a)),e.nonpositive=a=>e.check(tm(0,a)),e.multipleOf=(a,r)=>e.check(Ub(a,r)),e.step=(a,r)=>e.check(Ub(a,r)),e.finite=()=>e;const s=e._zod.bag;e.minValue=Math.max(s.minimum??Number.NEGATIVE_INFINITY,s.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(s.maximum??Number.POSITIVE_INFINITY,s.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(s.format??"").includes("int")||Number.isSafeInteger(s.multipleOf??.5),e.isFinite=!0,e.format=s.format??null});function Oe(e){return aD(Gw,e)}const O5=ne("ZodNumberFormat",(e,t)=>{cL.init(e,t),Gw.init(e,t)});function Bb(e){return rD(O5,e)}const L5=ne("ZodBoolean",(e,t)=>{uL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ED(e,s,a)});function Ft(e){return oD(L5,e)}const D5=ne("ZodUnknown",(e,t)=>{dL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>AD()});function Mu(){return lD(D5)}const M5=ne("ZodNever",(e,t)=>{fL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>RD(e,s,a)});function $5(e){return cD(M5,e)}const P5=ne("ZodArray",(e,t)=>{hL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>MD(e,s,a,r),e.element=t.element,e.min=(s,a)=>e.check(Lu(s,a)),e.nonempty=s=>e.check(Lu(1,s)),e.max=(s,a)=>e.check(Pw(s,a)),e.length=(s,a)=>e.check(Uw(s,a)),e.unwrap=()=>e.element});function Pe(e,t){return SD(P5,e,t)}const U5=ne("ZodObject",(e,t)=>{pL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>$D(e,s,a,r),ct(e,"shape",()=>t.shape),e.keyof=()=>en(Object.keys(e._zod.def.shape)),e.catchall=s=>e.clone({...e._zod.def,catchall:s}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Mu()}),e.loose=()=>e.clone({...e._zod.def,catchall:Mu()}),e.strict=()=>e.clone({...e._zod.def,catchall:$5()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=s=>MT(e,s),e.safeExtend=s=>$T(e,s),e.merge=s=>PT(e,s),e.pick=s=>LT(e,s),e.omit=s=>DT(e,s),e.partial=(...s)=>UT(Fw,e,s[0]),e.required=(...s)=>IT(Zw,e,s[0])});function ke(e,t){const s={type:"object",shape:e??{},...we(t)};return new U5(s)}const I5=ne("ZodUnion",(e,t)=>{gL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>PD(e,s,a,r),e.options=t.options});function B5(e,t){return new I5({type:"union",options:e,...we(t)})}const q5=ne("ZodIntersection",(e,t)=>{yL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>UD(e,s,a,r)});function H5(e,t){return new q5({type:"intersection",left:e,right:t})}const K5=ne("ZodRecord",(e,t)=>{vL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ID(e,s,a,r),e.keyType=t.keyType,e.valueType=t.valueType});function ml(e,t,s){return new K5({type:"record",keyType:e,valueType:t,...we(s)})}const Pm=ne("ZodEnum",(e,t)=>{xL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>TD(e,a,r),e.enum=t.entries,e.options=Object.values(t.entries);const s=new Set(Object.keys(t.entries));e.extract=(a,r)=>{const c={};for(const u of a)if(s.has(u))c[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new Pm({...t,checks:[],...we(r),entries:c})},e.exclude=(a,r)=>{const c={...t.entries};for(const u of a)if(s.has(u))delete c[u];else throw new Error(`Key ${u} not found in enum`);return new Pm({...t,checks:[],...we(r),entries:c})}});function en(e,t){const s=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Pm({type:"enum",entries:s,...we(t)})}const G5=ne("ZodLiteral",(e,t)=>{bL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>OD(e,s,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function cl(e,t){return new G5({type:"literal",values:Array.isArray(e)?e:[e],...we(t)})}const F5=ne("ZodTransform",(e,t)=>{SL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>DD(e,s),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new vw(e.constructor.name);s.addIssue=c=>{if(typeof c=="string")s.issues.push(ll(c,s.value,t));else{const u=c;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=s.value),u.inst??(u.inst=e),s.issues.push(ll(u))}};const r=t.transform(s.value,s);return r instanceof Promise?r.then(c=>(s.value=c,s)):(s.value=r,s)}});function Z5(e){return new F5({type:"transform",transform:e})}const Fw=ne("ZodOptional",(e,t)=>{$w.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>Hw(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function qb(e){return new Fw({type:"optional",innerType:e})}const V5=ne("ZodExactOptional",(e,t)=>{jL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>Hw(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function Q5(e){return new V5({type:"optional",innerType:e})}const Y5=ne("ZodNullable",(e,t)=>{wL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>BD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function Hb(e){return new Y5({type:"nullable",innerType:e})}const J5=ne("ZodDefault",(e,t)=>{NL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>HD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function X5(e,t){return new J5({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():jw(t)}})}const W5=ne("ZodPrefault",(e,t)=>{CL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>KD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function eM(e,t){return new W5({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():jw(t)}})}const Zw=ne("ZodNonOptional",(e,t)=>{kL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>qD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function tM(e,t){return new Zw({type:"nonoptional",innerType:e,...we(t)})}const nM=ne("ZodCatch",(e,t)=>{zL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>GD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function sM(e,t){return new nM({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const iM=ne("ZodPipe",(e,t)=>{_L.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>FD(e,s,a,r),e.in=t.in,e.out=t.out});function Kb(e,t){return new iM({type:"pipe",in:e,out:t})}const aM=ne("ZodReadonly",(e,t)=>{EL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ZD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function rM(e){return new aM({type:"readonly",innerType:e})}const oM=ne("ZodCustom",(e,t)=>{RL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>LD(e,s)});function lM(e,t={}){return jD(oM,e,t)}function cM(e){return wD(e)}ke({maxConcurrency:Oe().int().positive(),maxRequestsPerMinute:Oe().int().positive(),maxRequestsPerDay:Oe().int().positive()});const Kr=P().min(1);P().min(1);const Bp=ke({label:P().min(1),city:P().min(1),region:P().min(1),country:P().length(2),timezone:P().optional()}),Vw=en(["citation.lost","citation.gained","run.completed","run.failed"]);ke({id:P(),projectId:P(),channel:cl("webhook"),url:P().url(),urlDisplay:P(),urlHost:P(),events:Pe(Vw),enabled:Ft().default(!0),webhookSecret:P().optional(),createdAt:P(),updatedAt:P()});const Qw=en(["cli","api","config-file"]);function uM(e){const t=new Set,s=new Set;for(const a of e){if(t.has(a.label)){s.add(a.label);continue}t.add(a.label)}return[...s]}function dM(e,t){return t?e.some(s=>s.label===t):!0}ke({displayName:P().min(1),canonicalDomain:P().min(1),ownedDomains:Pe(P().min(1)).optional(),country:P().length(2),language:P().min(2),tags:Pe(P()).optional(),labels:ml(P(),P()).optional(),providers:Pe(Kr).optional(),locations:Pe(Bp).optional(),defaultLocation:P().nullable().optional(),configSource:Qw.optional()});ke({id:P(),name:P(),displayName:P().optional(),canonicalDomain:P(),ownedDomains:Pe(P()).default([]),country:P().length(2),language:P().min(2),tags:Pe(P()).default([]),labels:ml(P(),P()).default({}),locations:Pe(Bp).default([]),defaultLocation:P().nullable().optional(),configSource:Qw.default("cli"),configRevision:Oe().int().positive().default(1),createdAt:P().optional(),updatedAt:P().optional()});function Um(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function fM(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],s=new Set,a=[];for(const r of t){const c=r.trim();if(!c)continue;const u=Um(c);s.has(u)||(s.add(u),a.push(c))}return a}const hM=ke({name:P().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,{message:"Name must be a lowercase slug (letters, numbers, hyphens)"}),labels:ml(P(),P()).optional().default({})}),mM=ke({preset:P().optional(),cron:P().optional(),timezone:P().optional().default("UTC"),providers:Pe(Kr).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),pM=ke({channel:cl("webhook"),url:P().url(),events:Pe(Vw).min(1)}),gM=ke({gsc:ke({propertyUrl:P()}).optional(),syncSchedule:ke({preset:P().optional(),cron:P().optional()}).optional()}).optional(),yM=ke({displayName:P().min(1),canonicalDomain:P().min(1),ownedDomains:Pe(P().min(1)).optional().default([]),country:P().length(2),language:P().min(2),keywords:Pe(P().min(1)).optional().default([]),competitors:Pe(P().min(1)).optional().default([]),providers:Pe(Kr).optional().default([]),locations:Pe(Bp).optional().default([]),defaultLocation:P().optional(),schedule:mM,notifications:Pe(pM).optional().default([]),google:gM}).superRefine((e,t)=>{const s=uM(e.locations);s.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${s.join(", ")}`,path:["locations"]}),dM(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});ke({apiVersion:cl("canonry/v1"),kind:cl("Project"),metadata:hM,spec:yM});const vM=en(["gsc","ga4"]);ke({id:P(),domain:P(),connectionType:vM,propertyId:P().nullable().optional(),sitemapUrl:P().nullable().optional(),scopes:Pe(P()).default([]),createdAt:P(),updatedAt:P()});ke({date:P(),query:P(),page:P(),country:P().nullable().optional(),device:P().nullable().optional(),clicks:Oe(),impressions:Oe(),ctr:Oe(),position:Oe()});const Im=ke({id:P(),url:P(),indexingState:P().nullable().optional(),verdict:P().nullable().optional(),coverageState:P().nullable().optional(),pageFetchState:P().nullable().optional(),robotsTxtState:P().nullable().optional(),crawlTime:P().nullable().optional(),lastCrawlResult:P().nullable().optional(),isMobileFriendly:Ft().nullable().optional(),richResults:Pe(P()).default([]),inspectedAt:P()});en(["stable","reindexed","deindexed","still-missing","new"]);const xM=ke({url:P(),previousState:P().nullable(),currentState:P().nullable(),transitionDate:P()}),bM=ke({reason:P(),count:Oe(),urls:Pe(Im).default([])});ke({summary:ke({total:Oe(),indexed:Oe(),notIndexed:Oe(),deindexed:Oe(),percentage:Oe()}),lastInspectedAt:P().nullable(),indexed:Pe(Im).default([]),notIndexed:Pe(Im).default([]),deindexed:Pe(xM).default([]),reasonGroups:Pe(bM).default([])});ke({url:P(),type:en(["URL_UPDATED","URL_DELETED"]),notifiedAt:P()});ke({url:P(),type:en(["URL_UPDATED","URL_DELETED"]),notifiedAt:P(),status:en(["success","error"]),error:P().optional()});ke({date:P(),indexed:Oe(),notIndexed:Oe(),reasonBreakdown:ml(P(),Oe()).default({})});ke({id:P(),domain:P(),siteUrl:P().nullable().optional(),createdAt:P(),updatedAt:P()});const sm=ke({id:P(),url:P(),httpCode:Oe().nullable().optional(),inIndex:Ft().nullable().optional(),lastCrawledDate:P().nullable().optional(),inIndexDate:P().nullable().optional(),inspectedAt:P(),documentSize:Oe().nullable().optional(),anchorCount:Oe().nullable().optional(),discoveryDate:P().nullable().optional()});ke({summary:ke({total:Oe(),indexed:Oe(),notIndexed:Oe(),unknown:Oe().optional(),percentage:Oe()}),lastInspectedAt:P().nullable(),indexed:Pe(sm).default([]),notIndexed:Pe(sm).default([]),unknown:Pe(sm).default([]).optional()});ke({query:P(),impressions:Oe(),clicks:Oe(),ctr:Oe(),averagePosition:Oe()});ke({url:P(),status:en(["success","error"]),submittedAt:P(),error:P().optional()});const qp=en(["live","staging"]);ke({projectName:P(),url:P(),stagingUrl:P().optional(),username:P(),defaultEnv:qp,createdAt:P(),updatedAt:P()});const Gb=ke({url:P(),reachable:Ft(),pageCount:Oe().nullable().optional(),version:P().nullable().optional(),error:P().nullable().optional(),plugins:Pe(P()).optional()});ke({connected:Ft(),projectName:P(),defaultEnv:qp,live:Gb.nullable(),staging:Gb.nullable(),adminUrl:P().nullable().optional()});const SM=ke({id:Oe(),slug:P(),title:P(),status:P(),modifiedAt:P().nullable().optional(),link:P().nullable().optional()}),Yw=ke({title:P().nullable(),description:P().nullable(),noindex:Ft().nullable(),writable:Ft().default(!1),writeTargets:Pe(P()).default([])}),jM=ke({type:P(),json:ml(P(),Mu())}),wM=SM.extend({env:qp,content:P(),seo:Yw,schemaBlocks:Pe(jM).default([])}),Fb=wM.extend({contentHash:P(),contentSnippet:P()});ke({manualRequired:cl(!0),targetUrl:P(),adminUrl:P().nullable().optional(),content:P(),nextSteps:Pe(P()).default([])});const NM=ke({slug:P(),severity:en(["high","medium","low"]),code:en(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:P()});ke({slug:P(),title:P(),status:P(),wordCount:Oe(),seo:Yw,schemaPresent:Ft(),issues:Pe(NM).default([])});ke({slug:P(),live:Fb,staging:Fb,hasDifferences:Ft(),differences:ke({title:Ft(),slug:Ft(),content:Ft(),seoTitle:Ft(),seoDescription:Ft(),noindex:Ft(),schema:Ft()})});const CM=en(["queued","running","completed","partial","failed","cancelled"]),kM=en(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),zM=en(["manual","scheduled","config-apply"]),_M=en(["cited","not-cited"]),EM=en(["new","cited","lost","emerging","not-cited"]);ke({id:P(),projectId:P(),kind:kM,status:CM,trigger:zM.default("manual"),location:P().nullable().optional(),startedAt:P().nullable().optional(),finishedAt:P().nullable().optional(),error:P().nullable().optional(),createdAt:P()});const RM=ke({uri:P(),title:P()});ke({id:P(),runId:P(),keywordId:P(),keyword:P().optional(),provider:Kr,citationState:_M,transition:EM.optional(),answerText:P().nullable().optional(),citedDomains:Pe(P()).default([]),competitorOverlap:Pe(P()).default([]),groundingSources:Pe(RM).default([]),searchQueries:Pe(P()).default([]),model:P().nullable().optional(),location:P().nullable().optional(),createdAt:P()});ke({id:P(),projectId:P().nullable().optional(),actor:P(),action:P(),entityType:P(),entityId:P().nullable().optional(),diff:Mu().optional(),createdAt:P()});ke({id:P(),projectId:P(),cronExpr:P(),preset:P().nullable().optional(),timezone:P().default("UTC"),enabled:Ft().default(!0),providers:Pe(Kr).default([]),lastRunAt:P().nullable().optional(),nextRunAt:P().nullable().optional(),createdAt:P(),updatedAt:P()});ke({preset:P().optional(),cron:P().optional(),timezone:P().optional().default("UTC"),enabled:Ft().optional().default(!0),providers:Pe(Kr).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});ke({id:P(),projectId:P(),propertyId:P(),clientEmail:P(),connected:Ft(),createdAt:P(),updatedAt:P()});ke({date:P(),landingPage:P(),sessions:Oe(),organicSessions:Oe(),users:Oe()});ke({totalSessions:Oe(),totalOrganicSessions:Oe(),totalUsers:Oe(),topPages:Pe(ke({landingPage:P(),sessions:Oe(),organicSessions:Oe(),users:Oe()})),lastSyncedAt:P().nullable()});function Bm({state:e}){return o.jsx(lt,{tone:BR(e),children:Vu(e)})}function Zb(e,t){const s=t.filter(u=>u.trim().length>1),a=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(u=>u.startsWith("**")&&u.endsWith("**")?{type:"bold",value:u.slice(2,-2)}:{type:"text",value:u});if(s.length===0)return a.map((u,f)=>u.type==="bold"?cs.createElement("strong",{key:`b-${f}`,className:"text-zinc-200 font-semibold"},u.value):u.value).filter(Boolean);const r=s.map(u=>u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${r.join("|")})`,"gi");return a.flatMap((u,f)=>u.value.split(c).map((p,v)=>p?v%2===1?u.type==="bold"?cs.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},cs.createElement("strong",{className:"text-zinc-200 font-semibold"},p)):cs.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},p):u.type==="bold"?cs.createElement("strong",{key:`b-${f}-${v}`,className:"text-zinc-200 font-semibold"},p):p:null)).filter(Boolean)}function AM({evidence:e,project:t,onClose:s}){const[a,r]=w.useState(!1),[c,u]=w.useState(-1),[f,m]=w.useState(null),[p,v]=w.useState(!1),[y,x]=w.useState({}),b=fM(t.project),N=new Set(b.map(Um)),S=e.runHistory,C=S.length>1,[k,A]=w.useState(null),R=w.useRef(!1);w.useEffect(()=>{if(R.current||e.answerSnippet)return;const H=S.at(-1);H&&(R.current=!0,Pr(H.runId).then(T=>{const B=T.snapshots.find(se=>se.keyword===e.keyword&&se.provider===e.provider);B?.answerText&&A({citationState:e.citationState,provider:e.provider,model:B.model??e.model,answerSnippet:B.answerText,citedDomains:B.citedDomains??e.citedDomains,competitorDomains:B.competitorOverlap??e.competitorDomains,groundingSources:B.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,S]);const z=c>=0&&f!==null,O=z?f:k||{citationState:e.citationState,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.changeLabel,summary:e.summary},M=O.citationState==="cited"||O.citationState==="emerging",L=O.citedDomains.findIndex(H=>N.has(H.toLowerCase().replace(/^www\./,"")))+1,U=O.citedDomains.length,X=t.project.displayName||t.project.name,Q=[...b.map(Um),X,X.split(" ").slice(0,2).join(" ")].filter(H=>H.trim().length>2),ee=M?"cited":O.citationState==="lost"?"lost":O.citationState==="pending"?"pending":"not-cited",ue=w.useRef(0),ze=w.useCallback(async H=>{const T=++ue.current;if(H===-1||H===S.length-1){u(-1),m(null),r(!1);return}u(H),r(!1);const B=S[H],se=`${B.runId}::${e.keyword}::${e.provider}`;if(y[se]){m(y[se]);return}v(!0);try{const le=await Pr(B.runId);if(T!==ue.current)return;const J=le.snapshots.find(ye=>ye.keyword===e.keyword&&ye.provider===e.provider)??le.snapshots.find(ye=>ye.keyword===e.keyword),fe=J?{citationState:J.citationState,provider:J.provider,model:J.model??null,answerSnippet:J.answerText??"",citedDomains:J.citedDomains,competitorDomains:J.competitorOverlap,groundingSources:J.groundingSources,evidenceUrls:[],changeLabel:B.citationState,summary:""}:{citationState:B.citationState,provider:e.provider,model:B.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:B.citationState,summary:"Snapshot data not available for this run."};x(ye=>({...ye,[se]:fe})),m(fe)}catch{if(T!==ue.current)return;m({citationState:B.citationState,provider:e.provider,model:B.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:B.citationState,summary:"Failed to load historical run data."})}finally{T===ue.current&&v(!1)}},[S,e.keyword,e.provider,y]),K=(z||e.historyScope!=="provider")&&O.model?`${O.provider} (${O.model}) · ${O.changeLabel.toLowerCase()}`:`${O.provider} · ${O.changeLabel.toLowerCase()}`,ae=!z&&e.historyScope==="provider"?[e.model?`Current model: ${e.model}`:null,e.modelsSeen&&e.modelsSeen.length>1?`History spans ${e.modelsSeen.length} models`:null].filter(Boolean).join(" · "):"",me=M&&L>0?{label:"Citation confirmed",title:`Cited #${L} of ${U} domain${U!==1?"s":""}`,meta:K}:M?{label:"Citation confirmed",title:"Cited in this answer",meta:K}:O.citationState==="lost"?{label:"Citation lost",title:U>0?`${U} domain${U!==1?"s":""} cited instead`:"No longer appearing in this answer",meta:K}:O.citationState==="pending"?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not in this answer",title:U>0?`${U} domain${U!==1?"s":""} cited instead`:"No domains cited for this query",meta:K},V=()=>{if(!O.answerSnippet)return null;const H=O.answerSnippet.split(`
94
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const f=u[1];if(t===u[0]){c(u);continue}if(e.external){const p=e.external.registry.get(u[0])?.id;if(t!==u[0]&&p){c(u);continue}}if(e.metadataRegistry.get(u[0])?.id){c(u);continue}if(f.cycle){c(u);continue}if(f.count>1&&e.reused==="ref"){c(u);continue}}}function qw(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=u=>{const f=e.seen.get(u);if(f.ref===null)return;const m=f.def??f.schema,p={...m},v=f.ref;if(f.ref=null,v){a(v);const x=e.seen.get(v),b=x.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(b)):Object.assign(m,b),Object.assign(m,p),u._zod.parent===v)for(const S in m)S==="$ref"||S==="allOf"||S in p||delete m[S];if(b.$ref&&x.def)for(const S in m)S==="$ref"||S==="allOf"||S in x.def&&JSON.stringify(m[S])===JSON.stringify(x.def[S])&&delete m[S]}const y=u._zod.parent;if(y&&y!==v){a(y);const x=e.seen.get(y);if(x?.schema.$ref&&(m.$ref=x.schema.$ref,x.def))for(const b in m)b==="$ref"||b==="allOf"||b in x.def&&JSON.stringify(m[b])===JSON.stringify(x.def[b])&&delete m[b]}e.override({zodSchema:u,jsonSchema:m,path:f.path??[]})};for(const u of[...e.seen.entries()].reverse())a(u[0]);const r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const u=e.external.registry.get(t)?.id;if(!u)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(u)}Object.assign(r,s.def??s.schema);const c=e.external?.defs??{};for(const u of e.seen.entries()){const f=u[1];f.def&&f.defId&&(c[f.defId]=f.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?r.$defs=c:r.definitions=c);try{const u=JSON.parse(JSON.stringify(r));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:Du(t,"input",e.processors),output:Du(t,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function dn(e,t){const s=t??{seen:new Set};if(s.seen.has(e))return!1;s.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return dn(a.element,s);if(a.type==="set")return dn(a.valueType,s);if(a.type==="lazy")return dn(a.getter(),s);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return dn(a.innerType,s);if(a.type==="intersection")return dn(a.left,s)||dn(a.right,s);if(a.type==="record"||a.type==="map")return dn(a.keyType,s)||dn(a.valueType,s);if(a.type==="pipe")return dn(a.in,s)||dn(a.out,s);if(a.type==="object"){for(const r in a.shape)if(dn(a.shape[r],s))return!0;return!1}if(a.type==="union"){for(const r of a.options)if(dn(r,s))return!0;return!1}if(a.type==="tuple"){for(const r of a.items)if(dn(r,s))return!0;return!!(a.rest&&dn(a.rest,s))}return!1}const CD=(e,t={})=>s=>{const a=Iw({...s,processors:t});return qt(e,a),Bw(a,e),qw(a,e)},Du=(e,t,s={})=>a=>{const{libraryOptions:r,target:c}=a??{},u=Iw({...r??{},target:c,io:t,processors:s});return qt(e,u),Bw(u,e),qw(u,e)},kD={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},zD=(e,t,s,a)=>{const r=s;r.type="string";const{minimum:c,maximum:u,format:f,patterns:m,contentEncoding:p}=e._zod.bag;if(typeof c=="number"&&(r.minLength=c),typeof u=="number"&&(r.maxLength=u),f&&(r.format=kD[f]??f,r.format===""&&delete r.format,f==="time"&&delete r.format),p&&(r.contentEncoding=p),m&&m.size>0){const v=[...m];v.length===1?r.pattern=v[0].source:v.length>1&&(r.allOf=[...v.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},_D=(e,t,s,a)=>{const r=s,{minimum:c,maximum:u,format:f,multipleOf:m,exclusiveMaximum:p,exclusiveMinimum:v}=e._zod.bag;typeof f=="string"&&f.includes("int")?r.type="integer":r.type="number",typeof v=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.minimum=v,r.exclusiveMinimum=!0):r.exclusiveMinimum=v),typeof c=="number"&&(r.minimum=c,typeof v=="number"&&t.target!=="draft-04"&&(v>=c?delete r.minimum:delete r.exclusiveMinimum)),typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.maximum=p,r.exclusiveMaximum=!0):r.exclusiveMaximum=p),typeof u=="number"&&(r.maximum=u,typeof p=="number"&&t.target!=="draft-04"&&(p<=u?delete r.maximum:delete r.exclusiveMaximum)),typeof m=="number"&&(r.multipleOf=m)},ED=(e,t,s,a)=>{s.type="boolean"},RD=(e,t,s,a)=>{s.not={}},AD=(e,t,s,a)=>{},TD=(e,t,s,a)=>{const r=e._zod.def,c=bw(r.entries);c.every(u=>typeof u=="number")&&(s.type="number"),c.every(u=>typeof u=="string")&&(s.type="string"),s.enum=c},OD=(e,t,s,a)=>{const r=e._zod.def,c=[];for(const u of r.values)if(u===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof u=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(u))}else c.push(u);if(c.length!==0)if(c.length===1){const u=c[0];s.type=u===null?"null":typeof u,t.target==="draft-04"||t.target==="openapi-3.0"?s.enum=[u]:s.const=u}else c.every(u=>typeof u=="number")&&(s.type="number"),c.every(u=>typeof u=="string")&&(s.type="string"),c.every(u=>typeof u=="boolean")&&(s.type="boolean"),c.every(u=>u===null)&&(s.type="null"),s.enum=c},LD=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},DD=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},MD=(e,t,s,a)=>{const r=s,c=e._zod.def,{minimum:u,maximum:f}=e._zod.bag;typeof u=="number"&&(r.minItems=u),typeof f=="number"&&(r.maxItems=f),r.type="array",r.items=qt(c.element,t,{...a,path:[...a.path,"items"]})},$D=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object",r.properties={};const u=c.shape;for(const p in u)r.properties[p]=qt(u[p],t,{...a,path:[...a.path,"properties",p]});const f=new Set(Object.keys(u)),m=new Set([...f].filter(p=>{const v=c.shape[p]._zod;return t.io==="input"?v.optin===void 0:v.optout===void 0}));m.size>0&&(r.required=Array.from(m)),c.catchall?._zod.def.type==="never"?r.additionalProperties=!1:c.catchall?c.catchall&&(r.additionalProperties=qt(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},PD=(e,t,s,a)=>{const r=e._zod.def,c=r.inclusive===!1,u=r.options.map((f,m)=>qt(f,t,{...a,path:[...a.path,c?"oneOf":"anyOf",m]}));c?s.oneOf=u:s.anyOf=u},UD=(e,t,s,a)=>{const r=e._zod.def,c=qt(r.left,t,{...a,path:[...a.path,"allOf",0]}),u=qt(r.right,t,{...a,path:[...a.path,"allOf",1]}),f=p=>"allOf"in p&&Object.keys(p).length===1,m=[...f(c)?c.allOf:[c],...f(u)?u.allOf:[u]];s.allOf=m},ID=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object";const u=c.keyType,m=u._zod.bag?.patterns;if(c.mode==="loose"&&m&&m.size>0){const v=qt(c.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});r.patternProperties={};for(const y of m)r.patternProperties[y.source]=v}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=qt(c.keyType,t,{...a,path:[...a.path,"propertyNames"]})),r.additionalProperties=qt(c.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const p=u._zod.values;if(p){const v=[...p].filter(y=>typeof y=="string"||typeof y=="number");v.length>0&&(r.required=v)}},BD=(e,t,s,a)=>{const r=e._zod.def,c=qt(r.innerType,t,a),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=r.innerType,s.nullable=!0):s.anyOf=[c,{type:"null"}]},qD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},HD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.default=JSON.parse(JSON.stringify(r.defaultValue))},KD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,t.io==="input"&&(s._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},GD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType;let u;try{u=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}s.default=u},FD=(e,t,s,a)=>{const r=e._zod.def,c=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;qt(c,t,a);const u=t.seen.get(e);u.ref=c},ZD=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.readOnly=!0},Hw=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},VD=ne("ZodISODateTime",(e,t)=>{QO.init(e,t),zt.init(e,t)});function QD(e){return tD(VD,e)}const YD=ne("ZodISODate",(e,t)=>{YO.init(e,t),zt.init(e,t)});function JD(e){return nD(YD,e)}const XD=ne("ZodISOTime",(e,t)=>{JO.init(e,t),zt.init(e,t)});function WD(e){return sD(XD,e)}const e5=ne("ZodISODuration",(e,t)=>{XO.init(e,t),zt.init(e,t)});function t5(e){return iD(e5,e)}const n5=(e,t)=>{Nw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>qT(e,s)},flatten:{value:s=>BT(e,s)},addIssue:{value:s=>{e.issues.push(s),e.message=JSON.stringify(e.issues,Mm,2)}},addIssues:{value:s=>{e.issues.push(...s),e.message=JSON.stringify(e.issues,Mm,2)}},isEmpty:{get(){return e.issues.length===0}}})},es=ne("ZodError",n5,{Parent:Error}),s5=Pp(es),i5=Up(es),a5=td(es),r5=nd(es),o5=GT(es),l5=FT(es),c5=ZT(es),u5=VT(es),d5=QT(es),f5=YT(es),h5=JT(es),m5=XT(es),kt=ne("ZodType",(e,t)=>(Ct.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Du(e,"input"),output:Du(e,"output")}}),e.toJSONSchema=CD(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...s)=>e.clone(qi(t,{checks:[...t.checks??[],...s.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(s,a)=>Hi(e,s,a),e.brand=()=>e,e.register=((s,a)=>(s.add(e,a),e)),e.parse=(s,a)=>s5(e,s,a,{callee:e.parse}),e.safeParse=(s,a)=>a5(e,s,a),e.parseAsync=async(s,a)=>i5(e,s,a,{callee:e.parseAsync}),e.safeParseAsync=async(s,a)=>r5(e,s,a),e.spa=e.safeParseAsync,e.encode=(s,a)=>o5(e,s,a),e.decode=(s,a)=>l5(e,s,a),e.encodeAsync=async(s,a)=>c5(e,s,a),e.decodeAsync=async(s,a)=>u5(e,s,a),e.safeEncode=(s,a)=>d5(e,s,a),e.safeDecode=(s,a)=>f5(e,s,a),e.safeEncodeAsync=async(s,a)=>h5(e,s,a),e.safeDecodeAsync=async(s,a)=>m5(e,s,a),e.refine=(s,a)=>e.check(lM(s,a)),e.superRefine=s=>e.check(cM(s)),e.overwrite=s=>e.check(Hr(s)),e.optional=()=>qb(e),e.exactOptional=()=>Q5(e),e.nullable=()=>Hb(e),e.nullish=()=>qb(Hb(e)),e.nonoptional=s=>tM(e,s),e.array=()=>Pe(e),e.or=s=>B5([e,s]),e.and=s=>H5(e,s),e.transform=s=>Kb(e,Z5(s)),e.default=s=>X5(e,s),e.prefault=s=>eM(e,s),e.catch=s=>sM(e,s),e.pipe=s=>Kb(e,s),e.readonly=()=>rM(e),e.describe=s=>{const a=e.clone();return Vo.add(a,{description:s}),a},Object.defineProperty(e,"description",{get(){return Vo.get(e)?.description},configurable:!0}),e.meta=(...s)=>{if(s.length===0)return Vo.get(e);const a=e.clone();return Vo.add(a,s[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=s=>s(e),e)),Kw=ne("_ZodString",(e,t)=>{Ip.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>zD(e,a,r);const s=e._zod.bag;e.format=s.format??null,e.minLength=s.minimum??null,e.maxLength=s.maximum??null,e.regex=(...a)=>e.check(uD(...a)),e.includes=(...a)=>e.check(hD(...a)),e.startsWith=(...a)=>e.check(mD(...a)),e.endsWith=(...a)=>e.check(pD(...a)),e.min=(...a)=>e.check(Lu(...a)),e.max=(...a)=>e.check(Pw(...a)),e.length=(...a)=>e.check(Uw(...a)),e.nonempty=(...a)=>e.check(Lu(1,...a)),e.lowercase=a=>e.check(dD(a)),e.uppercase=a=>e.check(fD(a)),e.trim=()=>e.check(yD()),e.normalize=(...a)=>e.check(gD(...a)),e.toLowerCase=()=>e.check(vD()),e.toUpperCase=()=>e.check(xD()),e.slugify=()=>e.check(bD())}),p5=ne("ZodString",(e,t)=>{Ip.init(e,t),Kw.init(e,t),e.email=s=>e.check(LL(g5,s)),e.url=s=>e.check(UL(y5,s)),e.jwt=s=>e.check(eD(T5,s)),e.emoji=s=>e.check(IL(v5,s)),e.guid=s=>e.check(Mb(Ib,s)),e.uuid=s=>e.check(DL(Xc,s)),e.uuidv4=s=>e.check(ML(Xc,s)),e.uuidv6=s=>e.check($L(Xc,s)),e.uuidv7=s=>e.check(PL(Xc,s)),e.nanoid=s=>e.check(BL(x5,s)),e.guid=s=>e.check(Mb(Ib,s)),e.cuid=s=>e.check(qL(b5,s)),e.cuid2=s=>e.check(HL(S5,s)),e.ulid=s=>e.check(KL(j5,s)),e.base64=s=>e.check(JL(E5,s)),e.base64url=s=>e.check(XL(R5,s)),e.xid=s=>e.check(GL(w5,s)),e.ksuid=s=>e.check(FL(N5,s)),e.ipv4=s=>e.check(ZL(C5,s)),e.ipv6=s=>e.check(VL(k5,s)),e.cidrv4=s=>e.check(QL(z5,s)),e.cidrv6=s=>e.check(YL(_5,s)),e.e164=s=>e.check(WL(A5,s)),e.datetime=s=>e.check(QD(s)),e.date=s=>e.check(JD(s)),e.time=s=>e.check(WD(s)),e.duration=s=>e.check(t5(s))});function P(e){return OL(p5,e)}const zt=ne("ZodStringFormat",(e,t)=>{wt.init(e,t),Kw.init(e,t)}),g5=ne("ZodEmail",(e,t)=>{IO.init(e,t),zt.init(e,t)}),Ib=ne("ZodGUID",(e,t)=>{PO.init(e,t),zt.init(e,t)}),Xc=ne("ZodUUID",(e,t)=>{UO.init(e,t),zt.init(e,t)}),y5=ne("ZodURL",(e,t)=>{BO.init(e,t),zt.init(e,t)}),v5=ne("ZodEmoji",(e,t)=>{qO.init(e,t),zt.init(e,t)}),x5=ne("ZodNanoID",(e,t)=>{HO.init(e,t),zt.init(e,t)}),b5=ne("ZodCUID",(e,t)=>{KO.init(e,t),zt.init(e,t)}),S5=ne("ZodCUID2",(e,t)=>{GO.init(e,t),zt.init(e,t)}),j5=ne("ZodULID",(e,t)=>{FO.init(e,t),zt.init(e,t)}),w5=ne("ZodXID",(e,t)=>{ZO.init(e,t),zt.init(e,t)}),N5=ne("ZodKSUID",(e,t)=>{VO.init(e,t),zt.init(e,t)}),C5=ne("ZodIPv4",(e,t)=>{WO.init(e,t),zt.init(e,t)}),k5=ne("ZodIPv6",(e,t)=>{eL.init(e,t),zt.init(e,t)}),z5=ne("ZodCIDRv4",(e,t)=>{tL.init(e,t),zt.init(e,t)}),_5=ne("ZodCIDRv6",(e,t)=>{nL.init(e,t),zt.init(e,t)}),E5=ne("ZodBase64",(e,t)=>{sL.init(e,t),zt.init(e,t)}),R5=ne("ZodBase64URL",(e,t)=>{aL.init(e,t),zt.init(e,t)}),A5=ne("ZodE164",(e,t)=>{rL.init(e,t),zt.init(e,t)}),T5=ne("ZodJWT",(e,t)=>{lL.init(e,t),zt.init(e,t)}),Gw=ne("ZodNumber",(e,t)=>{Lw.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>_D(e,a,r),e.gt=(a,r)=>e.check(Pb(a,r)),e.gte=(a,r)=>e.check(nm(a,r)),e.min=(a,r)=>e.check(nm(a,r)),e.lt=(a,r)=>e.check($b(a,r)),e.lte=(a,r)=>e.check(tm(a,r)),e.max=(a,r)=>e.check(tm(a,r)),e.int=a=>e.check(Bb(a)),e.safe=a=>e.check(Bb(a)),e.positive=a=>e.check(Pb(0,a)),e.nonnegative=a=>e.check(nm(0,a)),e.negative=a=>e.check($b(0,a)),e.nonpositive=a=>e.check(tm(0,a)),e.multipleOf=(a,r)=>e.check(Ub(a,r)),e.step=(a,r)=>e.check(Ub(a,r)),e.finite=()=>e;const s=e._zod.bag;e.minValue=Math.max(s.minimum??Number.NEGATIVE_INFINITY,s.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(s.maximum??Number.POSITIVE_INFINITY,s.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(s.format??"").includes("int")||Number.isSafeInteger(s.multipleOf??.5),e.isFinite=!0,e.format=s.format??null});function Te(e){return aD(Gw,e)}const O5=ne("ZodNumberFormat",(e,t)=>{cL.init(e,t),Gw.init(e,t)});function Bb(e){return rD(O5,e)}const L5=ne("ZodBoolean",(e,t)=>{uL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ED(e,s,a)});function Ft(e){return oD(L5,e)}const D5=ne("ZodUnknown",(e,t)=>{dL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>AD()});function Mu(){return lD(D5)}const M5=ne("ZodNever",(e,t)=>{fL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>RD(e,s,a)});function $5(e){return cD(M5,e)}const P5=ne("ZodArray",(e,t)=>{hL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>MD(e,s,a,r),e.element=t.element,e.min=(s,a)=>e.check(Lu(s,a)),e.nonempty=s=>e.check(Lu(1,s)),e.max=(s,a)=>e.check(Pw(s,a)),e.length=(s,a)=>e.check(Uw(s,a)),e.unwrap=()=>e.element});function Pe(e,t){return SD(P5,e,t)}const U5=ne("ZodObject",(e,t)=>{pL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>$D(e,s,a,r),ct(e,"shape",()=>t.shape),e.keyof=()=>en(Object.keys(e._zod.def.shape)),e.catchall=s=>e.clone({...e._zod.def,catchall:s}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Mu()}),e.loose=()=>e.clone({...e._zod.def,catchall:Mu()}),e.strict=()=>e.clone({...e._zod.def,catchall:$5()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=s=>MT(e,s),e.safeExtend=s=>$T(e,s),e.merge=s=>PT(e,s),e.pick=s=>LT(e,s),e.omit=s=>DT(e,s),e.partial=(...s)=>UT(Fw,e,s[0]),e.required=(...s)=>IT(Zw,e,s[0])});function ke(e,t){const s={type:"object",shape:e??{},...we(t)};return new U5(s)}const I5=ne("ZodUnion",(e,t)=>{gL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>PD(e,s,a,r),e.options=t.options});function B5(e,t){return new I5({type:"union",options:e,...we(t)})}const q5=ne("ZodIntersection",(e,t)=>{yL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>UD(e,s,a,r)});function H5(e,t){return new q5({type:"intersection",left:e,right:t})}const K5=ne("ZodRecord",(e,t)=>{vL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ID(e,s,a,r),e.keyType=t.keyType,e.valueType=t.valueType});function ml(e,t,s){return new K5({type:"record",keyType:e,valueType:t,...we(s)})}const Pm=ne("ZodEnum",(e,t)=>{xL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>TD(e,a,r),e.enum=t.entries,e.options=Object.values(t.entries);const s=new Set(Object.keys(t.entries));e.extract=(a,r)=>{const c={};for(const u of a)if(s.has(u))c[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new Pm({...t,checks:[],...we(r),entries:c})},e.exclude=(a,r)=>{const c={...t.entries};for(const u of a)if(s.has(u))delete c[u];else throw new Error(`Key ${u} not found in enum`);return new Pm({...t,checks:[],...we(r),entries:c})}});function en(e,t){const s=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Pm({type:"enum",entries:s,...we(t)})}const G5=ne("ZodLiteral",(e,t)=>{bL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>OD(e,s,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function cl(e,t){return new G5({type:"literal",values:Array.isArray(e)?e:[e],...we(t)})}const F5=ne("ZodTransform",(e,t)=>{SL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>DD(e,s),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new vw(e.constructor.name);s.addIssue=c=>{if(typeof c=="string")s.issues.push(ll(c,s.value,t));else{const u=c;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=s.value),u.inst??(u.inst=e),s.issues.push(ll(u))}};const r=t.transform(s.value,s);return r instanceof Promise?r.then(c=>(s.value=c,s)):(s.value=r,s)}});function Z5(e){return new F5({type:"transform",transform:e})}const Fw=ne("ZodOptional",(e,t)=>{$w.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>Hw(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function qb(e){return new Fw({type:"optional",innerType:e})}const V5=ne("ZodExactOptional",(e,t)=>{jL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>Hw(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function Q5(e){return new V5({type:"optional",innerType:e})}const Y5=ne("ZodNullable",(e,t)=>{wL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>BD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function Hb(e){return new Y5({type:"nullable",innerType:e})}const J5=ne("ZodDefault",(e,t)=>{NL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>HD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function X5(e,t){return new J5({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():jw(t)}})}const W5=ne("ZodPrefault",(e,t)=>{CL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>KD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function eM(e,t){return new W5({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():jw(t)}})}const Zw=ne("ZodNonOptional",(e,t)=>{kL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>qD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function tM(e,t){return new Zw({type:"nonoptional",innerType:e,...we(t)})}const nM=ne("ZodCatch",(e,t)=>{zL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>GD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function sM(e,t){return new nM({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const iM=ne("ZodPipe",(e,t)=>{_L.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>FD(e,s,a,r),e.in=t.in,e.out=t.out});function Kb(e,t){return new iM({type:"pipe",in:e,out:t})}const aM=ne("ZodReadonly",(e,t)=>{EL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ZD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function rM(e){return new aM({type:"readonly",innerType:e})}const oM=ne("ZodCustom",(e,t)=>{RL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>LD(e,s)});function lM(e,t={}){return jD(oM,e,t)}function cM(e){return wD(e)}ke({maxConcurrency:Te().int().positive(),maxRequestsPerMinute:Te().int().positive(),maxRequestsPerDay:Te().int().positive()});const Kr=P().min(1);P().min(1);const Bp=ke({label:P().min(1),city:P().min(1),region:P().min(1),country:P().length(2),timezone:P().optional()}),Vw=en(["citation.lost","citation.gained","run.completed","run.failed"]);ke({id:P(),projectId:P(),channel:cl("webhook"),url:P().url(),urlDisplay:P(),urlHost:P(),events:Pe(Vw),enabled:Ft().default(!0),webhookSecret:P().optional(),createdAt:P(),updatedAt:P()});const Qw=en(["cli","api","config-file"]);function uM(e){const t=new Set,s=new Set;for(const a of e){if(t.has(a.label)){s.add(a.label);continue}t.add(a.label)}return[...s]}function dM(e,t){return t?e.some(s=>s.label===t):!0}ke({displayName:P().min(1),canonicalDomain:P().min(1),ownedDomains:Pe(P().min(1)).optional(),country:P().length(2),language:P().min(2),tags:Pe(P()).optional(),labels:ml(P(),P()).optional(),providers:Pe(Kr).optional(),locations:Pe(Bp).optional(),defaultLocation:P().nullable().optional(),configSource:Qw.optional()});ke({id:P(),name:P(),displayName:P().optional(),canonicalDomain:P(),ownedDomains:Pe(P()).default([]),country:P().length(2),language:P().min(2),tags:Pe(P()).default([]),labels:ml(P(),P()).default({}),locations:Pe(Bp).default([]),defaultLocation:P().nullable().optional(),configSource:Qw.default("cli"),configRevision:Te().int().positive().default(1),createdAt:P().optional(),updatedAt:P().optional()});function Um(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function fM(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],s=new Set,a=[];for(const r of t){const c=r.trim();if(!c)continue;const u=Um(c);s.has(u)||(s.add(u),a.push(c))}return a}const hM=ke({name:P().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,{message:"Name must be a lowercase slug (letters, numbers, hyphens)"}),labels:ml(P(),P()).optional().default({})}),mM=ke({preset:P().optional(),cron:P().optional(),timezone:P().optional().default("UTC"),providers:Pe(Kr).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),pM=ke({channel:cl("webhook"),url:P().url(),events:Pe(Vw).min(1)}),gM=ke({gsc:ke({propertyUrl:P()}).optional(),syncSchedule:ke({preset:P().optional(),cron:P().optional()}).optional()}).optional(),yM=ke({displayName:P().min(1),canonicalDomain:P().min(1),ownedDomains:Pe(P().min(1)).optional().default([]),country:P().length(2),language:P().min(2),keywords:Pe(P().min(1)).optional().default([]),competitors:Pe(P().min(1)).optional().default([]),providers:Pe(Kr).optional().default([]),locations:Pe(Bp).optional().default([]),defaultLocation:P().optional(),schedule:mM,notifications:Pe(pM).optional().default([]),google:gM}).superRefine((e,t)=>{const s=uM(e.locations);s.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${s.join(", ")}`,path:["locations"]}),dM(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});ke({apiVersion:cl("canonry/v1"),kind:cl("Project"),metadata:hM,spec:yM});const vM=en(["gsc","ga4"]);ke({id:P(),domain:P(),connectionType:vM,propertyId:P().nullable().optional(),sitemapUrl:P().nullable().optional(),scopes:Pe(P()).default([]),createdAt:P(),updatedAt:P()});ke({date:P(),query:P(),page:P(),country:P().nullable().optional(),device:P().nullable().optional(),clicks:Te(),impressions:Te(),ctr:Te(),position:Te()});const Im=ke({id:P(),url:P(),indexingState:P().nullable().optional(),verdict:P().nullable().optional(),coverageState:P().nullable().optional(),pageFetchState:P().nullable().optional(),robotsTxtState:P().nullable().optional(),crawlTime:P().nullable().optional(),lastCrawlResult:P().nullable().optional(),isMobileFriendly:Ft().nullable().optional(),richResults:Pe(P()).default([]),inspectedAt:P()});en(["stable","reindexed","deindexed","still-missing","new"]);const xM=ke({url:P(),previousState:P().nullable(),currentState:P().nullable(),transitionDate:P()}),bM=ke({reason:P(),count:Te(),urls:Pe(Im).default([])});ke({summary:ke({total:Te(),indexed:Te(),notIndexed:Te(),deindexed:Te(),percentage:Te()}),lastInspectedAt:P().nullable(),indexed:Pe(Im).default([]),notIndexed:Pe(Im).default([]),deindexed:Pe(xM).default([]),reasonGroups:Pe(bM).default([])});ke({url:P(),type:en(["URL_UPDATED","URL_DELETED"]),notifiedAt:P()});ke({url:P(),type:en(["URL_UPDATED","URL_DELETED"]),notifiedAt:P(),status:en(["success","error"]),error:P().optional()});ke({date:P(),indexed:Te(),notIndexed:Te(),reasonBreakdown:ml(P(),Te()).default({})});ke({id:P(),domain:P(),siteUrl:P().nullable().optional(),createdAt:P(),updatedAt:P()});const sm=ke({id:P(),url:P(),httpCode:Te().nullable().optional(),inIndex:Ft().nullable().optional(),lastCrawledDate:P().nullable().optional(),inIndexDate:P().nullable().optional(),inspectedAt:P(),documentSize:Te().nullable().optional(),anchorCount:Te().nullable().optional(),discoveryDate:P().nullable().optional()});ke({summary:ke({total:Te(),indexed:Te(),notIndexed:Te(),unknown:Te().optional(),percentage:Te()}),lastInspectedAt:P().nullable(),indexed:Pe(sm).default([]),notIndexed:Pe(sm).default([]),unknown:Pe(sm).default([]).optional()});ke({query:P(),impressions:Te(),clicks:Te(),ctr:Te(),averagePosition:Te()});ke({url:P(),status:en(["success","error"]),submittedAt:P(),error:P().optional()});const qp=en(["live","staging"]);ke({projectName:P(),url:P(),stagingUrl:P().optional(),username:P(),defaultEnv:qp,createdAt:P(),updatedAt:P()});const Gb=ke({url:P(),reachable:Ft(),pageCount:Te().nullable().optional(),version:P().nullable().optional(),error:P().nullable().optional(),plugins:Pe(P()).optional(),authenticatedUser:ke({id:Te(),slug:P()}).nullable().optional()});ke({connected:Ft(),projectName:P(),defaultEnv:qp,live:Gb.nullable(),staging:Gb.nullable(),adminUrl:P().nullable().optional()});const SM=ke({id:Te(),slug:P(),title:P(),status:P(),modifiedAt:P().nullable().optional(),link:P().nullable().optional()}),Yw=ke({title:P().nullable(),description:P().nullable(),noindex:Ft().nullable(),writable:Ft().default(!1),writeTargets:Pe(P()).default([])}),jM=ke({type:P(),json:ml(P(),Mu())}),wM=SM.extend({env:qp,content:P(),seo:Yw,schemaBlocks:Pe(jM).default([])}),Fb=wM.extend({contentHash:P(),contentSnippet:P()});ke({manualRequired:cl(!0),targetUrl:P(),adminUrl:P().nullable().optional(),content:P(),nextSteps:Pe(P()).default([])});const NM=ke({slug:P(),severity:en(["high","medium","low"]),code:en(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:P()});ke({slug:P(),title:P(),status:P(),wordCount:Te(),seo:Yw,schemaPresent:Ft(),issues:Pe(NM).default([])});ke({slug:P(),live:Fb,staging:Fb,hasDifferences:Ft(),differences:ke({title:Ft(),slug:Ft(),content:Ft(),seoTitle:Ft(),seoDescription:Ft(),noindex:Ft(),schema:Ft()})});const CM=en(["queued","running","completed","partial","failed","cancelled"]),kM=en(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),zM=en(["manual","scheduled","config-apply"]),_M=en(["cited","not-cited"]),EM=en(["new","cited","lost","emerging","not-cited"]);ke({id:P(),projectId:P(),kind:kM,status:CM,trigger:zM.default("manual"),location:P().nullable().optional(),startedAt:P().nullable().optional(),finishedAt:P().nullable().optional(),error:P().nullable().optional(),createdAt:P()});const RM=ke({uri:P(),title:P()});ke({id:P(),runId:P(),keywordId:P(),keyword:P().optional(),provider:Kr,citationState:_M,transition:EM.optional(),answerText:P().nullable().optional(),citedDomains:Pe(P()).default([]),competitorOverlap:Pe(P()).default([]),groundingSources:Pe(RM).default([]),searchQueries:Pe(P()).default([]),model:P().nullable().optional(),location:P().nullable().optional(),createdAt:P()});ke({id:P(),projectId:P().nullable().optional(),actor:P(),action:P(),entityType:P(),entityId:P().nullable().optional(),diff:Mu().optional(),createdAt:P()});ke({id:P(),projectId:P(),cronExpr:P(),preset:P().nullable().optional(),timezone:P().default("UTC"),enabled:Ft().default(!0),providers:Pe(Kr).default([]),lastRunAt:P().nullable().optional(),nextRunAt:P().nullable().optional(),createdAt:P(),updatedAt:P()});ke({preset:P().optional(),cron:P().optional(),timezone:P().optional().default("UTC"),enabled:Ft().optional().default(!0),providers:Pe(Kr).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});ke({id:P(),projectId:P(),propertyId:P(),clientEmail:P(),connected:Ft(),createdAt:P(),updatedAt:P()});ke({date:P(),landingPage:P(),sessions:Te(),organicSessions:Te(),users:Te()});ke({totalSessions:Te(),totalOrganicSessions:Te(),totalUsers:Te(),topPages:Pe(ke({landingPage:P(),sessions:Te(),organicSessions:Te(),users:Te()})),lastSyncedAt:P().nullable()});function Bm({state:e}){return o.jsx(lt,{tone:BR(e),children:Vu(e)})}function Zb(e,t){const s=t.filter(u=>u.trim().length>1),a=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(u=>u.startsWith("**")&&u.endsWith("**")?{type:"bold",value:u.slice(2,-2)}:{type:"text",value:u});if(s.length===0)return a.map((u,f)=>u.type==="bold"?cs.createElement("strong",{key:`b-${f}`,className:"text-zinc-200 font-semibold"},u.value):u.value).filter(Boolean);const r=s.map(u=>u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${r.join("|")})`,"gi");return a.flatMap((u,f)=>u.value.split(c).map((p,v)=>p?v%2===1?u.type==="bold"?cs.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},cs.createElement("strong",{className:"text-zinc-200 font-semibold"},p)):cs.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},p):u.type==="bold"?cs.createElement("strong",{key:`b-${f}-${v}`,className:"text-zinc-200 font-semibold"},p):p:null)).filter(Boolean)}function AM({evidence:e,project:t,onClose:s}){const[a,r]=w.useState(!1),[c,u]=w.useState(-1),[f,m]=w.useState(null),[p,v]=w.useState(!1),[y,x]=w.useState({}),b=fM(t.project),N=new Set(b.map(Um)),S=e.runHistory,C=S.length>1,[k,A]=w.useState(null),R=w.useRef(!1);w.useEffect(()=>{if(R.current||e.answerSnippet)return;const H=S.at(-1);H&&(R.current=!0,Pr(H.runId).then(T=>{const B=T.snapshots.find(se=>se.keyword===e.keyword&&se.provider===e.provider);B?.answerText&&A({citationState:e.citationState,provider:e.provider,model:B.model??e.model,answerSnippet:B.answerText,citedDomains:B.citedDomains??e.citedDomains,competitorDomains:B.competitorOverlap??e.competitorDomains,groundingSources:B.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,S]);const z=c>=0&&f!==null,O=z?f:k||{citationState:e.citationState,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.changeLabel,summary:e.summary},M=O.citationState==="cited"||O.citationState==="emerging",L=O.citedDomains.findIndex(H=>N.has(H.toLowerCase().replace(/^www\./,"")))+1,U=O.citedDomains.length,X=t.project.displayName||t.project.name,Q=[...b.map(Um),X,X.split(" ").slice(0,2).join(" ")].filter(H=>H.trim().length>2),ee=M?"cited":O.citationState==="lost"?"lost":O.citationState==="pending"?"pending":"not-cited",ue=w.useRef(0),ze=w.useCallback(async H=>{const T=++ue.current;if(H===-1||H===S.length-1){u(-1),m(null),r(!1);return}u(H),r(!1);const B=S[H],se=`${B.runId}::${e.keyword}::${e.provider}`;if(y[se]){m(y[se]);return}v(!0);try{const le=await Pr(B.runId);if(T!==ue.current)return;const J=le.snapshots.find(ye=>ye.keyword===e.keyword&&ye.provider===e.provider)??le.snapshots.find(ye=>ye.keyword===e.keyword),fe=J?{citationState:J.citationState,provider:J.provider,model:J.model??null,answerSnippet:J.answerText??"",citedDomains:J.citedDomains,competitorDomains:J.competitorOverlap,groundingSources:J.groundingSources,evidenceUrls:[],changeLabel:B.citationState,summary:""}:{citationState:B.citationState,provider:e.provider,model:B.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:B.citationState,summary:"Snapshot data not available for this run."};x(ye=>({...ye,[se]:fe})),m(fe)}catch{if(T!==ue.current)return;m({citationState:B.citationState,provider:e.provider,model:B.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:B.citationState,summary:"Failed to load historical run data."})}finally{T===ue.current&&v(!1)}},[S,e.keyword,e.provider,y]),K=(z||e.historyScope!=="provider")&&O.model?`${O.provider} (${O.model}) · ${O.changeLabel.toLowerCase()}`:`${O.provider} · ${O.changeLabel.toLowerCase()}`,ae=!z&&e.historyScope==="provider"?[e.model?`Current model: ${e.model}`:null,e.modelsSeen&&e.modelsSeen.length>1?`History spans ${e.modelsSeen.length} models`:null].filter(Boolean).join(" · "):"",me=M&&L>0?{label:"Citation confirmed",title:`Cited #${L} of ${U} domain${U!==1?"s":""}`,meta:K}:M?{label:"Citation confirmed",title:"Cited in this answer",meta:K}:O.citationState==="lost"?{label:"Citation lost",title:U>0?`${U} domain${U!==1?"s":""} cited instead`:"No longer appearing in this answer",meta:K}:O.citationState==="pending"?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not in this answer",title:U>0?`${U} domain${U!==1?"s":""} cited instead`:"No domains cited for this query",meta:K},V=()=>{if(!O.answerSnippet)return null;const H=O.answerSnippet.split(`
95
95
  `),T=[];let B=[],se=0;const le=()=>{if(B.length===0)return;const J=B.join(" ").trim();J&&T.push(o.jsx("p",{className:T.length>0?"mt-2.5":"",children:Zb(J,Q)},se++)),B=[]};for(const J of H){const fe=J.trim();if(/^[-\u2013\u2014]{3,}$/.test(fe)){le(),T.push(o.jsx("hr",{className:"border-zinc-800/60 my-3"},se++));continue}const ye=fe.match(/^(#{1,3})\s+(.+)$/);if(ye){le();const _e=ye[1].length,ge=ye[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||ye[2],Ze=_e===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":_e===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";T.push(o.jsx("p",{className:Ze,children:Zb(ge,Q)},se++));continue}if(fe===""){le();continue}B.push(fe)}return le(),T};return o.jsx(uw,{open:!0,onOpenChange:H=>{H||s()},children:o.jsxs(dw,{children:[o.jsx(Ap,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),o.jsxs(Tp,{className:"evidence-modal","aria-describedby":void 0,children:[o.jsxs("div",{className:"evidence-modal-header",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," \\u00b7 ",O.provider||"All providers"]}),o.jsx(Op,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),o.jsxs(hw,{className:"inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-800 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 shrink-0",children:[o.jsx(Zu,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]}),C&&o.jsxs("div",{className:"evidence-modal-timeline",children:[o.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),o.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:S.map((H,T)=>{const B=c===-1&&T===S.length-1||c===T,se=H.citationState==="cited"?"bg-emerald-400":H.citationState==="emerging"?"bg-amber-400":H.citationState==="lost"?"bg-rose-400":"bg-zinc-600",J=new Date(H.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),fe=!!(H.model&&T>0&&S[T-1]?.model&&S[T-1].model!==H.model);return o.jsxs("button",{type:"button",className:`evidence-run-dot ${B?"evidence-run-dot--selected":""}`,onClick:()=>ze(T===S.length-1?-1:T),"aria-label":[`Run ${J}: ${H.citationState}`,H.model?`model ${H.model}`:null,fe?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":B,children:[o.jsx("span",{className:`size-2 rounded-full ${se} ${fe?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),o.jsx("span",{className:"text-[10px] text-zinc-500",children:J})]},T)})}),c>=0&&c<S.length&&o.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(S[c].createdAt).toLocaleString()," \\u2014 ",o.jsx("span",{className:"capitalize",children:S[c].citationState}),o.jsx("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>ze(-1),children:"\\u2190 Back to latest"})]}),!z&&(e.modelTransitions?.length??0)>0&&o.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(H=>o.jsx("span",{className:"inline-flex items-center rounded-full border border-amber-400/30 bg-amber-400/10 px-2 py-1 text-[10px] text-amber-100",children:`${H.fromModel??"unknown"} -> ${H.toModel??"unknown"} on ${new Date(H.createdAt).toLocaleDateString()}`},`${H.runId}:${H.toModel??"unknown"}`))})]}),o.jsxs("div",{className:"evidence-modal-body",children:[p&&o.jsx("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:"Loading historical run data\\u2026"}),!p&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"evidence-modal-main",children:[o.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${ee}`,children:[o.jsx("p",{className:`evidence-position-label evidence-position-label--${ee}`,children:me.label}),o.jsx("p",{className:`evidence-position-title evidence-position-title--${ee}`,children:me.title}),o.jsx("p",{className:"evidence-position-meta",children:me.meta}),ae&&o.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:ae})]}),O.answerSnippet&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),o.jsx("div",{className:`answer-snippet-block ${a?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:V()}),O.answerSnippet.length>280&&o.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>r(!a),children:a?"↑ Collapse":"↓ Show full answer"})]}),!O.answerSnippet&&!p&&o.jsx("div",{className:"rounded-lg border border-zinc-800/40 bg-zinc-900/20 px-4 py-8 text-center text-zinc-600 text-sm",children:"No answer text recorded for this run"}),!z&&e.relatedTechnicalSignals.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:M?"Why you're cited":"What to fix"}),o.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((H,T)=>o.jsxs("div",{className:"action-item",children:[o.jsx("svg",{className:`action-item-icon ${M?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:M?o.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):o.jsxs(o.Fragment,{children:[o.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),o.jsx("span",{className:"action-item-text",children:H})]},T))})]}),O.summary&&o.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:O.summary})]}),o.jsxs("div",{className:"evidence-modal-sidebar",children:[O.citedDomains.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:"Who was cited \\u2014 in order"}),o.jsxs("div",{className:"citation-leaderboard",children:[O.citedDomains.map((H,T)=>{const B=H.toLowerCase().replace(/^www\./,""),se=N.has(B),le=!se&&O.competitorDomains.some(fe=>fe.toLowerCase().replace(/^www\./,"")===B),J=se?"you":le?"competitor":"other";return o.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${J}`,children:[o.jsxs("span",{className:"citation-leaderboard-rank",children:["#",T+1]}),o.jsx("span",{className:"citation-leaderboard-domain",children:H}),se&&o.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),le&&o.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},H)}),!M&&o.jsxs("div",{className:"citation-leaderboard-item citation-leaderboard-item--not-cited border-dashed",children:[o.jsx("span",{className:"citation-leaderboard-rank text-zinc-600",children:"—"}),o.jsx("span",{className:"citation-leaderboard-domain text-zinc-600",children:t.project.canonicalDomain}),o.jsx("span",{className:"citation-leaderboard-tag text-zinc-600",children:"Not cited"})]})]})]}),O.groundingSources.length>0&&o.jsxs("div",{children:[o.jsxs("p",{className:"drawer-section-label",children:["Grounding sources (",O.groundingSources.length,")"]}),o.jsx("ul",{className:"grid gap-0.5",children:O.groundingSources.map((H,T)=>o.jsx("li",{className:"truncate text-sm",children:o.jsx("a",{href:H.uri,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:H.title||H.uri})},T))})]}),O.evidenceUrls.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),o.jsx("ul",{className:"grid gap-1",children:O.evidenceUrls.map(H=>o.jsx("li",{className:"truncate text-sm",children:o.jsx("a",{href:H,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:H})},H))})]}),O.citedDomains.length===0&&O.groundingSources.length===0&&O.evidenceUrls.length===0&&o.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No citation data ",z?"for this run":"yet"]})]})]})]})]})]})})}function os(e){const t=new Date("2026-02-20");return e.map((s,a)=>({runId:`run_mock_${a+1}`,citationState:s,createdAt:new Date(t.getTime()+a*2*24*60*60*1e3).toISOString()}))}const im=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_harbor",name:"Harbor Legal Group",canonicalDomain:"harborlegal.com",ownedDomains:[],country:"US",language:"en",tags:["lead gen"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_northstar",name:"Northstar Orthopedics",canonicalDomain:"northstarortho.com",ownedDomains:[],country:"US",language:"en",tags:["multi-location"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1}];function id(e){return{id:e.id,projectId:e.projectId,projectName:e.projectName,kind:e.kind,kindLabel:e.kindLabel,status:e.status,trigger:e.trigger??"manual",createdAt:e.createdAt,startedAt:e.startedAt,duration:e.duration,statusDetail:e.statusDetail,summary:e.summary,triggerLabel:e.triggerLabel}}const TM=id({id:"run_citypoint_visibility_20260308",projectId:"project_citypoint",projectName:"Citypoint Dental NYC",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"completed",createdAt:"2026-03-08T12:15:00.000Z",startedAt:"Mar 8, 12:15 PM",duration:"6m 12s",statusDetail:"18 tracked queries checked; 3 citation losses detected on emergency-intent prompts.",summary:"Citation losses on emergency-intent prompts",triggerLabel:"Scheduled"}),OM=id({id:"run_citypoint_queued_20260309",projectId:"project_citypoint",projectName:"Citypoint Dental NYC",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"queued",createdAt:"2026-03-09T08:05:00.000Z",startedAt:"Mar 9, 8:05 AM",duration:"Waiting for slot",statusDetail:"Ready to enqueue after the next provider rate window clears.",summary:"Queued follow-up after local ranking movement",triggerLabel:"Manual"}),LM=id({id:"run_harbor_visibility_20260308",projectId:"project_harbor",projectName:"Harbor Legal Group",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"completed",createdAt:"2026-03-08T11:05:00.000Z",startedAt:"Mar 8, 11:05 AM",duration:"5m 07s",statusDetail:"12 tracked queries checked; local-intent visibility held steady across branded prompts.",summary:"Branded prompts remain stable",triggerLabel:"Scheduled"}),DM=id({id:"run_northstar_visibility_20260308",projectId:"project_northstar",projectName:"Northstar Orthopedics",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"running",createdAt:"2026-03-08T13:40:00.000Z",startedAt:"Mar 8, 1:40 PM",duration:"3m 10s",statusDetail:"Provider responses still in flight for 9 multi-location prompts.",summary:"Mid-run on treatment-location prompts",triggerLabel:"Manual"}),MM=[{id:"evidence_citypoint_emergency_gemini",keyword:"emergency dentist brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"lost",changeLabel:"Lost since Mar 5",answerSnippet:"For urgent dental care in Brooklyn, Downtown Smiles and Harbor Dental are now cited first for emergency availability and same-day booking.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:["https://downtownsmiles.com/emergency-dentist-brooklyn","https://harbordental.com/same-day-emergency-care"],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing on the emergency service page","llms.txt not found during latest site audit","Location pages link weakly into the emergency care hub"],summary:"AI answers now cite two competitors while your emergency page is no longer grounded.",runHistory:os(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",keyword:"emergency dentist brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"Cited for 6 runs",answerSnippet:"Citypoint Dental is listed as a top emergency dentist in Brooklyn for same-day appointments and walk-in availability.",citedDomains:["citypointdental.com","downtownsmiles.com"],evidenceUrls:["https://citypointdental.com/emergency-dentist-brooklyn"],competitorDomains:["downtownsmiles.com"],groundingSources:[],relatedTechnicalSignals:["Emergency page indexed with structured data"],summary:"OpenAI cites your emergency page consistently alongside one competitor.",runHistory:os(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",keyword:"emergency dentist brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"Based on the search results, top-rated emergency dental practices in Brooklyn include Downtown Smiles and Harbor Dental.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:[],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing","llms.txt not found"],summary:"Claude does not cite your domain for this emergency query.",runHistory:os(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_invisalign_openai",keyword:"best invisalign dentist downtown brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"emerging",changeLabel:"First citation in 7 days",answerSnippet:"Citypoint Dental appears as an emerging recommendation for Invisalign in Downtown Brooklyn, supported by recent before-and-after case pages.",citedDomains:["citypointdental.com","clearlineortho.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn","https://citypointdental.com/case-studies/invisalign-open-bite"],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["Structured data now present on two case-study pages","Internal links from service pages to case studies improved crawl depth"],summary:"Fresh case-study content is starting to earn citations on Invisalign prompts.",runHistory:os(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",keyword:"best invisalign dentist downtown brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"cited",changeLabel:"Cited for 8 runs",answerSnippet:"Citypoint Dental in Downtown Brooklyn is highlighted for its Invisalign expertise and patient outcomes.",citedDomains:["citypointdental.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn"],competitorDomains:[],groundingSources:[],relatedTechnicalSignals:["Case study pages well-indexed"],summary:"Gemini consistently cites your Invisalign page with no competitor overlap.",runHistory:os(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",keyword:"best invisalign dentist downtown brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For Invisalign in Downtown Brooklyn, Clear Line Ortho and Brooklyn Smiles are frequently recommended for their experienced orthodontists.",citedDomains:["clearlineortho.com","brooklynsmiles.com"],evidenceUrls:[],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["No before/after schema on case study pages"],summary:"Claude does not surface your Invisalign content despite strong page quality.",runHistory:os(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_claude",keyword:"pediatric dentist brooklyn heights",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 4 runs",answerSnippet:"Answers cite neighborhood-specific pediatric practices with stronger family-focused FAQ content and clearer insurance details.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:["https://brightkidsdental.com/pediatric-dentist-brooklyn-heights","https://parkpediatricdental.com/insurance"],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric service page exists for Brooklyn Heights","Insurance content is buried three clicks deep"],summary:"Coverage gap is content-driven, not purely technical.",runHistory:os(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",keyword:"pediatric dentist brooklyn heights",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For pediatric dentistry in Brooklyn Heights, Bright Kids Dental and Park Pediatric Dental are cited for family-friendly care.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:[],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric page for Brooklyn Heights"],summary:"Gemini does not surface your domain for pediatric queries in this area.",runHistory:os(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_openai",keyword:"pediatric dentist brooklyn heights",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"First citation this month",answerSnippet:"Citypoint Dental is mentioned as offering pediatric services in Brooklyn, though specialized pediatric-only practices are also highlighted.",citedDomains:["citypointdental.com","brightkidsdental.com"],evidenceUrls:["https://citypointdental.com/family-dentistry"],competitorDomains:["brightkidsdental.com"],groundingSources:[],relatedTechnicalSignals:["Family dentistry page recently updated"],summary:"OpenAI recently started citing your family dentistry page for this query.",runHistory:os(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];im[0],im[1],os(["cited","cited","cited","cited","cited"]),im[2],2/7,os(["not-cited","not-cited","not-cited","cited"]);function $M(e,t){return e.projects.find(s=>s.project.id===t)}function PM(e,t){return e.runs.find(s=>s.id===t)}function UM(e,t){for(const s of e.projects){const a=s.visibilityEvidence.find(r=>r.id===t);if(a)return{project:s,evidence:a}}}function Jw(e){return{id:e.id,name:e.name,displayName:e.displayName,canonicalDomain:e.canonicalDomain,ownedDomains:e.ownedDomains??[],country:e.country,language:e.language,tags:e.tags,labels:e.labels,locations:e.locations??[],defaultLocation:e.defaultLocation??null,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function Vb(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function IM(e,t){if(!e)return"Waiting";if(!t)return"Running";const s=new Date(t).getTime()-new Date(e).getTime();if(s<1e3)return"<1s";const a=Math.floor(s/1e3);if(a<60)return`${a}s`;const r=Math.floor(a/60),c=a%60;return`${r}m ${c}s`}function Xw(e){return e==="answer-visibility"?"Answer visibility sweep":e}function BM(e){return e==="manual"?"Manual":e==="scheduled"?"Scheduled":e==="config-apply"?"Config apply":e}function Hp(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:Xw(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?Vb(e.startedAt):Vb(e.createdAt),duration:IM(e.startedAt,e.finishedAt),statusDetail:e.error?Ww(e.error):qM(e),summary:HM(e),triggerLabel:BM(e.trigger)}}function Ww(e){try{const s=JSON.parse(e);if(typeof s=="object"&&s!==null){const a=s.message??s.error?.message??s[0]?.error?.message;if(typeof a=="string"&&a.length>0)return a.length>200?a.slice(0,200)+"…":a}}catch{}const t=e.match(/\[.*?\]\s*(.+)/);if(t){const s=t[1];return s.length>200?s.slice(0,200)+"…":s}return e.length>200?e.slice(0,200)+"…":e}function qM(e){switch(e.status){case"queued":return"Waiting for execution slot.";case"running":return"Provider queries in progress.";case"completed":return"All key phrases checked.";case"partial":return"Run completed with some key phrases skipped.";case"failed":return e.error?Ww(e.error):"Run failed.";default:return""}}function HM(e){switch(e.status){case"queued":return"Queued for execution";case"running":return"In progress";case"completed":return"Visibility sweep completed";case"partial":return"Partial completion";case"failed":return"Run failed";default:return e.status}}function eN(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const t=new Map;for(const c of e){const u=c.keyword??c.id;t.has(u)||t.set(u,!1),c.citationState==="cited"&&t.set(u,!0)}const s=t.size,a=[...t.values()].filter(Boolean).length;return{score:s>0?Math.round(a/s*100):0,citedCount:a,totalCount:s}}function KM(e){return e>=70?"positive":e>=40?"caution":"negative"}function GM(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function FM(e,t){return e===0?"positive":(t>0?e/t:0)>=.3?"negative":"caution"}function ZM(e){if(e.length===0)return{label:"Gap Key Phrases",value:"No data",delta:"Run a sweep first",tone:"neutral",description:"Run a visibility sweep to identify key phrases where competitors are cited and your domain is not.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[]};const t=new Map;for(const c of e){const u=c.keywordId,f=t.get(u)??{cited:!1,competitorOverlap:new Set};c.citationState==="cited"&&(f.cited=!0);for(const m of c.competitorOverlap)f.competitorOverlap.add(m);t.set(u,f)}const s=t.size,a=[...t.values()].filter(c=>!c.cited&&c.competitorOverlap.size>0).length,r=a===1?"key phrase":"key phrases";return{label:"Gap Key Phrases",value:`${a}`,delta:`${a} of ${s} key phrases at risk`,tone:FM(a,s),description:a>0?`${a} tracked ${r} currently cite competitors without citing your domain.`:"No competitive key phrase gaps detected in the latest visibility run.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[],progress:s>0?a/s:0}}function VM(e,t){return e&&e.summary.total>0?{provider:"Google",...e.summary}:t&&t.summary.total>0?{provider:"Bing",...t.summary,deindexed:0}:e?{provider:"Google",...e.summary}:t?{provider:"Bing",...t.summary,deindexed:0}:null}function QM(e){return e.provider==="Google"&&e.deindexed>0?"negative":e.percentage>=90?"positive":e.percentage>=70?"caution":"negative"}function YM(e,t){const s=VM(e,t);if(!s||s.total===0)return{label:"Index Coverage",value:"No data",delta:"Connect GSC or Bing",tone:"neutral",description:"Connect Google Search Console or Bing Webmaster Tools and inspect your sitemap to populate coverage.",tooltip:"Percentage of inspected URLs currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used.",trend:[]};const a=s.notIndexed===1?"URL is":"URLs are",r=s.deindexed===1?"URL":"URLs";return{label:"Index Coverage",value:`${Math.round(s.percentage)}`,delta:`${s.provider} · ${s.indexed} of ${s.total} indexed`,tone:QM(s),description:s.provider==="Google"&&s.deindexed>0?`${s.deindexed} deindexed ${r} detected in the latest Google Search Console inspection.`:`${s.notIndexed} ${a} not indexed in ${s.provider==="Google"?"Google Search Console":"Bing Webmaster Tools"}.`,tooltip:"Percentage of inspected URLs currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used.",trend:[]}}function tN(e,t){if(e.length===0||t.length===0)return{label:"None",count:0};const s=new Set(t);let a=0;for(const c of e)c.competitorOverlap.some(u=>s.has(u))&&a++;const r=a/e.length;return r>=.5?{label:"High",count:a}:r>=.2?{label:"Moderate",count:a}:{label:"Low",count:a}}function JM(e,t,s,a){const r=[];let c=0;const u=new Set;if(s){const f=new Map;for(const x of s.snapshots)if(x.keyword){const b=`${x.keyword}::${x.provider}`;f.set(b,x)}const m=new Set(s.snapshots.map(x=>x.provider)),p=new Set(t.flatMap(x=>Object.keys(x.providerRuns??{}))),v=[...new Set([...m,...p])].sort(),y=v.length>0?v:["gemini"];for(const x of t){if(x.runs.length===0)continue;u.add(x.keyword);const N=x.runs.at(-1)?.transition??"not-cited";for(const S of y){const C=f.get(`${x.keyword}::${S}`),k=(x.providerRuns?.[S]?.length??0)>0;if(!C&&!k)continue;const A=C?.model??null,R=A?`${S}:${A}`:null,z=R?x.modelRuns?.[R]:void 0,O=x.providerRuns?.[S],M=(O?.length?O:null)??(z?.length?z:null),E=O?.length?"provider":z?.length?"model":"keyword",L=M?M.at(-1).transition:N,U=M?.at(-1)?.citationState,X=C?L==="lost"?"lost":L==="emerging"?"emerging":C.citationState==="cited"?"cited":"not-cited":U==="cited"?"cited":"not-cited",Q=qm(M||x.runs),ee=XM(x,S),ue=(M??x.runs).map(ae=>({runId:ae.runId,citationState:ae.citationState,createdAt:ae.createdAt,model:ee.get(ae.runId)??null})),ze=WM(ue),je=E==="provider"&&ze.length<=1?"model":E,K=e4(ue);r.push({id:`evidence_${e}_${c++}`,keyword:x.keyword,provider:C?.provider??S,model:C?.model??null,location:C?.location??null,citationState:X,changeLabel:t4(L,Q),answerSnippet:C?.answerText??"",citedDomains:C?.citedDomains??[],evidenceUrls:[],competitorDomains:C?.competitorOverlap??[],relatedTechnicalSignals:[],groundingSources:C?.groundingSources??[],summary:n4(X,x.keyword),runHistory:ue,historyScope:je,modelsSeen:ze,modelTransitions:K})}}}for(const f of a)u.has(f.keyword)||r.push({id:`evidence_${e}_${c++}`,keyword:f.keyword,provider:"",model:null,location:null,citationState:"pending",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${f.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return r}function XM(e,t){const s=new Map,a=`${t}:`;for(const[r,c]of Object.entries(e.modelRuns??{})){if(!r.startsWith(a))continue;const u=r.slice(a.length),f=u==="unknown"?null:u;for(const m of c)s.set(m.runId,f)}return s}function WM(e){const t=new Set;for(const s of e)s.model&&t.add(s.model);return[...t]}function e4(e){const t=[];let s=null;for(const a of e){const r=a.model??null;r!==s&&s!==null&&t.push({runId:a.runId,createdAt:a.createdAt,fromModel:s,toModel:r}),s=r}return t}function qm(e){if(e.length===0)return 0;const t=e[e.length-1].citationState;let s=0;for(let a=e.length-1;a>=0&&e[a].citationState===t;a--)s++;return s}function t4(e,t){switch(e){case"new":return"First observation";case"cited":return t<=1?"Cited in latest run":`Cited for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return"First citation";case"not-cited":return t<=1?"Not cited in latest run":`Not cited across ${t} runs`;default:return e}}function n4(e,t){switch(e){case"cited":return`Your domain is cited in AI answers for "${t}".`;case"lost":return`Citation was lost for "${t}". Competitors may have gained ground.`;case"emerging":return`Your domain is starting to appear in answers for "${t}".`;case"not-cited":return`No citation detected for "${t}".`;case"pending":return`"${t}" has been added but no visibility run has been triggered yet.`}}function Qb(e,t){const s=new Set(t),a=new Map;for(const r of e)if(r.keyword)for(const c of r.competitorOverlap){if(!s.has(c))continue;const u=a.get(c)??new Set;u.add(r.keyword),a.set(c,u)}return a}const am=3;function s4(e){const{evidence:t,timeline:s,latestSnapshots:a,previousSnapshots:r,trackedCompetitors:c}=e,u=[],f=[],m=new Set;for(const k of t)k.citationState==="lost"&&(m.has(k.keyword)||(m.add(k.keyword),f.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"lost"})));f.length>0&&u.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${f.length} key phrase${f.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:f});const p=Qb(a,c),v=Qb(r,c);for(const k of c){const A=p.get(k)??new Set,R=v.get(k)??new Set,z=[...A].filter(O=>!R.has(O));z.length>0&&u.push({id:`insight_comp_gained_${k}`,tone:"negative",title:`${k} appeared on ${z.length} key phrase${z.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:z.map(O=>{const M=t.find(E=>E.keyword===O);return{keyword:O,evidenceId:M?.id??"",citationState:"cited"}})})}const y=new Map;for(const k of s){const A=k.runs.at(-1);A&&y.set(k.keyword,{transition:A.transition,citationState:A.citationState})}const x=[],b=[],N=new Set;for(const[k,{transition:A,citationState:R}]of y){if(!(A==="emerging"||A==="new"&&R==="cited"))continue;N.add(k);const O=t.find(M=>M.keyword===k&&(M.citationState==="emerging"||M.citationState==="cited"));x.push({keyword:k,evidenceId:O?.id??"",provider:O?.provider,citationState:"emerging"})}for(const k of t)k.citationState==="emerging"&&(N.has(k.keyword)||b.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"emerging"}));if(b.length>0){const k=new Set(b.map(A=>A.keyword)).size;u.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${k} key phrase${k>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:b})}x.length>0&&u.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${N.size} key phrase${N.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:x});const S=new Set(t.map(k=>k.keyword)),C=[];for(const k of s){if(!S.has(k.keyword)||k.runs.length<am||k.runs.at(-1)?.citationState!=="not-cited")continue;if(qm(k.runs)>=am){const z=t.find(O=>O.keyword===k.keyword);C.push({keyword:k.keyword,evidenceId:z?.id??"",citationState:"not-cited"})}}C.length>0&&u.push({id:"insight_persistent_gap",tone:"caution",title:`${C.length} key phrase${C.length>1?"s":""} uncited for ${am}+ runs`,detail:"These key phrases have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:C});for(const k of c){const A=p.get(k)??new Set,z=[...v.get(k)??new Set].filter(O=>!A.has(O));z.length>0&&u.push({id:`insight_comp_lost_${k}`,tone:"neutral",title:`${k} dropped from ${z.length} key phrase${z.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:z.map(O=>{const M=t.find(E=>E.keyword===O);return{keyword:O,evidenceId:M?.id??"",citationState:"not-cited"}})})}return u.length===0&&u.push({id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}),u}function i4(e,t){if(t.length===0){const m=new Set(e.filter(p=>p.citationState==="cited").map(p=>p.keyword)).size;return{gained:m,lost:0,tone:m>0?"positive":"neutral",hasPreviousRun:!1}}const s=m=>{const p=new Set;for(const v of m)v.citationState==="cited"&&v.keyword&&p.add(v.keyword);return p},a=s(e),r=s(t);let c=0,u=0;for(const m of a)r.has(m)||c++;for(const m of r)a.has(m)||u++;const f=u>c?"negative":c>u?"positive":"neutral";return{gained:c,lost:u,tone:f,hasPreviousRun:!0}}function a4(e){const t=e[0];if(!t)return{label:"Run Status",value:"None",delta:"No runs yet",tone:"neutral",description:"Trigger a visibility sweep to start tracking.",tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]};const s=t.status==="completed"?"Healthy":t.status==="running"?"Running":t.status==="queued"?"Queued":t.status==="partial"?"Partial":"Failed",a=t.status==="completed"?"positive":t.status==="failed"?"negative":t.status==="partial"?"caution":"neutral";return{label:"Run Status",value:s,delta:`${e.length} total runs`,tone:a,description:`Latest: ${Xw(t.kind)} — ${t.status}`,tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]}}function r4(e){const t=Jw(e.project),s=JM(t.name,e.timeline,e.latestRunDetail,e.keywords),a=e.latestRunDetail?.snapshots??[],r=eN(a),c=ZM(a),u=YM(e.gscCoverage,e.bingCoverage),f=tN(a,e.competitors.map(b=>b.domain)),m=s4({evidence:s,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(b=>b.domain)}),p=[...e.runs].sort((b,N)=>N.createdAt.localeCompare(b.createdAt)),v=p.map(b=>Hp(b,e.project.displayName||e.project.name)),y=new Map;for(const b of a){const N=b.provider||"gemini",S=b.model??null,C=`${N}::${S??"unknown"}`,k=y.get(C)??{provider:N,model:S,cited:0,total:0};k.total++,b.citationState==="cited"&&k.cited++,y.set(C,k)}const x=[...y.values()].sort((b,N)=>b.provider.localeCompare(N.provider)||(b.model??"").localeCompare(N.model??"")).map(({provider:b,model:N,cited:S,total:C})=>({provider:b,model:N,score:C>0?Math.round(S/C*100):0,cited:S,total:C}));return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:a.length>0?`${r.score}`:"No data",delta:a.length>0?`${r.citedCount} of ${r.totalCount} key phrases visible`:"Run a sweep first",tone:a.length>0?KM(r.score):"neutral",description:a.length>0?`${r.citedCount} of ${r.totalCount} tracked key phrases found your domain in at least one AI answer engine.`:"No visibility data yet. Trigger a run to start tracking.",tooltip:'Percentage of tracked key phrases where your domain is cited by at least one AI answer engine. A key phrase is "visible" if any configured provider includes your site in its response.',trend:[]},keywordCounts:{cited:r.citedCount,total:r.totalCount},gapKeyPhrases:c,indexCoverage:u,providerScores:x,competitorPressure:{label:"Competitor Pressure",value:f.label,delta:f.count>0?`${f.count} overlapping citations`:"No overlap detected",tone:GM(f.label),description:e.competitors.length>0?`${e.competitors.length} competitor${e.competitors.length>1?"s":""} tracked.`:"No competitors configured.",tooltip:"How often competitor domains appear alongside yours in AI answers. High pressure means competitors are frequently cited for the same key phrases.",trend:[]},runStatus:a4(p),movementSummary:i4(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:m,visibilityEvidence:s,competitors:e.competitors.map((b,N)=>{const S=new Set;for(const z of a)(z.competitorOverlap.includes(b.domain)||z.citedDomains.includes(b.domain))&&z.keyword&&S.add(z.keyword);const C=[...S],k=new Set(a.map(z=>z.keyword).filter(Boolean)),A=k.size>0?C.length/k.size:0,R=A>=.5?"High":A>=.2?"Moderate":C.length>0?"Low":"None";return{id:b.id||`comp_${N}`,domain:b.domain,citationCount:C.length,totalKeywords:k.size,pressureLabel:R,citedKeywords:C,movement:"",notes:""}}),recentRuns:v.slice(0,5)}}function o4(e){const t=Jw(e.project),s=e.latestRunDetail?.snapshots??[],a=eN(s),r=tN(s,e.competitors.map(m=>m.domain)),u=[...e.runs].sort((m,p)=>p.createdAt.localeCompare(m.createdAt))[0],f=u?Hp(u,e.project.displayName||e.project.name):{id:"none",projectId:e.project.id,projectName:e.project.displayName||e.project.name,kind:"answer-visibility",kindLabel:"No runs yet",status:"queued",trigger:"manual",createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""};return{project:t,visibilityScore:a.score,visibilityDelta:s.length>0?`${a.citedCount} of ${a.totalCount} key phrases`:"No data",lastRun:f,insight:s.length>0?`${a.citedCount} of ${a.totalCount} key phrases visible across ${new Set(s.map(m=>m.provider)).size} provider${new Set(s.map(m=>m.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:r.label}}function l4(e,t){const s=[],a=[],r=[];for(const u of e){a.push(r4(u)),r.push(o4(u));const f=[...u.runs].sort((m,p)=>p.createdAt.localeCompare(m.createdAt));for(const m of f)s.push(Hp(m,u.project.displayName||u.project.name))}s.sort((u,f)=>f.createdAt.localeCompare(u.createdAt));const c=e.length>0;return{portfolioOverview:{projects:r,attentionItems:c?c4(a):[{id:"attention_setup",tone:"neutral",title:"No projects yet",detail:"Create your first project using the setup wizard, CLI, or API.",actionLabel:"Open setup",href:"/setup"}],recentRuns:s.slice(0,5),systemHealth:[{id:"api",label:"API",tone:"positive",detail:"Connected",meta:"Real-time data"},{id:"provider",label:"Gemini",tone:"positive",detail:"Configured",meta:"Provider active"}],lastUpdatedAt:new Date().toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),...c?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small key phrase set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:a,runs:s,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"API is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"provider",label:"Provider configured",detail:"Gemini key is configured.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"",canonicalDomain:"",country:"US",language:"en"},keywordImportState:{mode:"paste",keywordCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:c,ctaLabel:c?"Trigger run":"Create a project first",summary:c?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(u=>({name:u.name,displayName:u.displayName,keyUrl:u.keyUrl,modelHint:u.modelHint,model:u.model,state:u.configured?"ready":"needs-config",detail:u.configured?"Provider is configured.":"API key is missing.",quota:u.quota})),google:{state:t?.google?.configured?"ready":"needs-config",detail:t?.google?.configured?"Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard.":"Google OAuth client ID and client secret are not configured yet."},bing:{state:t?.bing?.configured?"ready":"needs-config",detail:t?.bing?.configured?"Bing Webmaster Tools API key is configured. Project-level Bing connections can be created from the dashboard.":"Bing Webmaster Tools API key is not configured yet."},selfHostNotes:["Configuration is stored in ~/.canonry/config.yaml.","The local config file is the source of truth for authentication credentials.","Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.","Database is SQLite at ~/.canonry/data.db.","API key was auto-generated during canonry init."],bootstrapNote:"Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config."}}}function c4(e){const t=[];for(const s of e){const a=s.visibilityEvidence.filter(c=>c.citationState==="lost");a.length>0&&t.push({id:`attention_${s.project.id}_lost`,tone:"negative",title:`${s.project.displayName||s.project.name} lost citations`,detail:`${a.length} key phrase${a.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${s.project.id}`});const r=s.recentRuns.filter(c=>c.status==="running"||c.status==="queued");r.length>0&&t.push({id:`attention_${s.project.id}_active`,tone:"neutral",title:`${s.project.displayName||s.project.name} has active runs`,detail:`${r.length} run${r.length>1?"s":""} in progress.`,actionLabel:"View runs",href:"/runs"})}return t.length===0&&t.push({id:"attention_stable",tone:"positive",title:"All projects stable",detail:"No citation losses or active runs to flag.",actionLabel:"View portfolio",href:"/"}),t}const Vn={projects:{all:["projects"],detail:(e,t)=>["projects",e,t],keywords:e=>["projects",e,"keywords"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"]},nN=w.createContext(null);nN.Provider;function pl(){return w.useContext(nN)}function Oa(e){const s=pl()?.dashboard??null,a=xa({queryKey:Vn.projects.all,queryFn:YS,enabled:!s}),r=xa({queryKey:Vn.runs.all,queryFn:XS,enabled:!s,refetchInterval:N=>N.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:!1}),c=xa({queryKey:Vn.settings,queryFn:()=>Sp().catch(()=>null),enabled:!s}),u=a.data??[],f=r.data??[],m=Pk({queries:u.map(N=>{const S=f.filter(k=>k.projectId===N.id),C=S.filter(k=>(k.status==="completed"||k.status==="partial")&&k.kind==="answer-visibility").sort((k,A)=>A.createdAt.localeCompare(k.createdAt));return{queryKey:Vn.projects.detail(N.id,C[0]?.id),queryFn:async()=>{const[k,A,R,z,O,M,E]=await Promise.all([G_(N.name).catch(()=>[]),WS(N.name).catch(()=>[]),ej(N.name).catch(()=>[]),C[0]?Pr(C[0].id).catch(()=>null):Promise.resolve(null),C[1]?Pr(C[1].id).catch(()=>null):Promise.resolve(null),jp(N.name).catch(()=>null),wp(N.name).catch(()=>null)]);return{project:N,runs:S,keywords:k,competitors:A,timeline:R,latestRunDetail:z,previousRunDetail:O,gscCoverage:M,bingCoverage:E}},enabled:!s&&a.isSuccess&&r.isSuccess}})}),p=m.every(N=>N.isSuccess),v=w.useMemo(()=>{if(s)return s;if(!a.data||!r.data||u.length>0&&!p)return null;const N=m.map(S=>S.data).filter(S=>S!=null);return l4(N,c.data??null)},[s,a.data,r.data,c.data,p,m,u.length]),y=!s&&(a.isError||r.isError),x=!s&&!v&&!y,b=w.useCallback(async()=>{await Promise.all([a.refetch(),r.refetch(),c.refetch()])},[a.refetch,r.refetch,c.refetch]);return{dashboard:v,isLoading:x,isError:y,refetch:b}}function u4(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const Yb=u4(),Hm=Yb==="/"?"":Yb.replace(/\/$/,"");async function d4(){const e=Hm?`${Hm}/health`:"/health",t=await I2(e,"API"),s=t.state==="ok"?{label:"Runner",state:"ok",detail:"In-process job runner"}:{label:"Runner",state:t.state,detail:"Depends on API"};return{apiStatus:t,workerStatus:s}}function ad(e,t){return xa({queryKey:Vn.health,queryFn:d4,enabled:e,refetchInterval:15e3,initialData:t})}function f4(e){return xa({queryKey:Vn.runs.detail(e??""),queryFn:()=>Pr(e),enabled:!!e,refetchInterval:t=>{const s=t.state.data?.status;return s==="running"||s==="queued"?3e3:!1}})}function Gr(){const e=Ii(),t=Ku({strict:!1}),s=Nn({select:m=>m.location.pathname}),a=t.runId??null,r=t.evidenceId??null;return{runId:a,evidenceId:r,openRun:m=>e({to:s,from:us.to,search:p=>({...p,runId:m,evidenceId:void 0})}),openEvidence:m=>e({to:s,from:us.to,search:p=>({...p,evidenceId:m,runId:void 0})}),closeDrawer:()=>e({to:s,from:us.to,search:m=>({...m,runId:void 0,evidenceId:void 0})})}}const h4={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function m4(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function p4(){const e=w.useSyncExternalStore(F2,Qx,Qx),t=Ii(),{openRun:s}=Gr(),a=w.useCallback(c=>{Rm(c)},[]),r=w.useCallback(c=>{c.cta&&(c.cta.intent==="open-run-drawer"?s(c.cta.runId):t({to:"/runs"}),Rm(c.id))},[t,s]);return e.length===0?null:o.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(c=>o.jsxs("section",{role:c.tone==="negative"?"alert":"status","aria-live":c.tone==="negative"?"assertive":"polite","data-state":c.state,className:`toast-card ${h4[c.tone]}`,children:[o.jsxs("div",{className:"toast-copy",children:[o.jsx("p",{className:"toast-title",children:c.title}),c.detail?o.jsx("p",{className:"toast-detail",children:c.detail}):null,c.cta?o.jsx("button",{type:"button",className:"toast-action",onClick:()=>r(c),"aria-label":m4(c),children:c.cta.label}):null]}),o.jsx("button",{type:"button",onClick:()=>a(c.id),className:"toast-dismiss","aria-label":"Dismiss",children:o.jsx(Zu,{className:"size-3.5"})})]},c.id))})}const Jb=[{label:"Architecture",href:"https://github.com/AINYC/canonry/blob/main/docs/architecture.md"},{label:"Testing Guide",href:"https://github.com/AINYC/canonry/blob/main/docs/testing.md"}],Xb=e=>({label:e,state:"checking",detail:"Checking service health"}),g4={apiStatus:Xb("API"),workerStatus:Xb("Worker")};function y4(e){return e==="gsc-sync"?"GSC sync":e==="inspect-sitemap"?"Sitemap inspection":"Visibility sweep"}function v4(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function x4(e){const t=y4(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function b4(e,t){return e.error?`${t}: ${e.error}`:e.location?`${t} · ${e.location}`:t}function S4(e,t,s){if(t)return t;const a=s.find(r=>r.id===e);return a?.displayName||a?.name||e}function j4(e,t){return[e.completed>0?`${e.completed} completed`:null,e.partial>0?`${e.partial} partial`:null,e.failed>0?`${e.failed} failed`:null,e.cancelled>0?`${e.cancelled} cancelled`:null,t>0?`${t} skipped at queue time`:null].filter(Boolean).join(", ")}function w4(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function N4(){const e=w.useSyncExternalStore(ME,ka,ka),t=Object.keys(e.runs).length>0||Object.keys(e.batches).length>0,s=xa({queryKey:Vn.runs.all,queryFn:XS,enabled:t}),a=xa({queryKey:Vn.projects.all,queryFn:YS,enabled:t}),r=w.useRef({}),c=w.useCallback(()=>{s.refetch()},[s.refetch]);return w.useEffect(()=>{t&&c()},[t,c]),w.useEffect(()=>{if(!t||typeof window>"u")return;const u=()=>{document.visibilityState==="visible"&&c()};return window.addEventListener("focus",c),document.addEventListener("visibilitychange",u),()=>{window.removeEventListener("focus",c),document.removeEventListener("visibilitychange",u)}},[t,c]),w.useEffect(()=>{const u=s.data??[],f=a.data??[],m=Object.fromEntries(u.map(v=>[v.id,v])),p=Object.fromEntries(u.map(v=>[v.id,v.status]));for(const v of Object.values(e.runs)){const y=m[v.runId];if(!y||!UE(y.status)||(r.current[y.id]??v.lastAnnouncedStatus)===y.status)continue;if(v.sourceAction==="run-all"){tb(y.id);continue}const b=S4(y.projectId,v.projectLabel,f);Ke({title:x4(y),detail:b4(y,b),tone:v4(y.status),dedupeKey:`run:${y.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:y.id}}),tb(y.id)}for(const v of Object.values(e.batches)){const y=IE(v.runIds,m);y.finished&&(Ke({title:"Run-all batch finished",detail:j4(y,v.skippedCount),tone:w4(y),dedupeKey:`batch:${v.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),PE(v.batchId))}r.current=p},[a.data,s.data,e]),null}function C4(){const e=pl(),{dashboard:t,isLoading:s,refetch:a}=Oa(),u=ad(!e,e?.health).data??e?.health??g4,f=B_(),{runId:m,evidenceId:p,closeDrawer:v}=Gr(),[y,x]=w.useState(!1),b=f4(m),N=b.data??null,S=b.isLoading;w.useEffect(()=>{N&&N.status!=="running"&&N.status!=="queued"&&a()},[N?.status,a]),w.useEffect(()=>{x(!1)},[f.pathname]),w.useEffect(()=>{if(typeof window>"u"||!m&&!p)return;const z=O=>{O.key==="Escape"&&v()};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[m,p,v]);const C=t??e?.dashboard??null,k=m&&C?PM(C,m):void 0,A=p&&C?UM(C,p):void 0,R=(()=>{const z=f.pathname;if(z==="/")return"Portfolio";if(z==="/projects")return"Projects";if(z==="/runs")return"Runs";if(z==="/settings")return"Settings";if(z==="/setup")return"Setup";if(z.startsWith("/projects/")){const M=z.split("/").filter(Boolean)[1];if(M&&C){const E=C.projects.find(L=>L.project.id===M);if(E)return E.project.name}return"Project"}return"Not found"})();return o.jsxs("div",{className:"app-shell",children:[o.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),o.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[o.jsx("div",{className:"sidebar-brand",children:o.jsx(db,{})}),o.jsxs("nav",{className:"sidebar-nav",children:[o.jsxs(St,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(oE,{className:"sidebar-icon"}),o.jsx("span",{children:"Overview"})]}),o.jsxs(St,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[o.jsx(aE,{className:"sidebar-icon"}),o.jsx("span",{children:"Projects"})]}),o.jsxs(St,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(dE,{className:"sidebar-icon"}),o.jsx("span",{children:"Runs"})]}),o.jsxs(St,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(xE,{className:"sidebar-icon"}),o.jsx("span",{children:"Settings"})]}),s?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(z=>o.jsxs("div",{className:"sidebar-skeleton-item",children:[o.jsx("span",{className:"skeleton-circle size-2"}),o.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+z*15}%`}})]},z))]}):C&&C.projects.length>0?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sidebar-section-title",children:"Projects"}),C.projects.map(z=>{const O=z.visibilitySummary.tone;return o.jsxs(St,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[o.jsx("span",{className:`sidebar-dot sidebar-dot-${O}`}),o.jsx("span",{children:z.project.name})]},z.project.id)})]}):s?null:o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sidebar-section-title",children:"Resources"}),o.jsxs(St,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(pE,{className:"sidebar-icon"}),o.jsx("span",{children:"Setup"})]})]})]}),o.jsx("div",{className:"sidebar-footer",children:Jb.map(z=>o.jsx("a",{className:"sidebar-footer-link",href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]}),o.jsxs("div",{className:"main-area",children:[o.jsxs("header",{className:"topbar",children:[o.jsxs("div",{className:"topbar-left",children:[o.jsx("div",{className:"topbar-brand-mobile",children:o.jsx(db,{compact:!0})}),o.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[o.jsx(St,{to:"/",children:"Home"}),o.jsx(Fu,{className:"breadcrumb-sep size-3"}),o.jsx("span",{className:"breadcrumb-current",children:R})]})]}),o.jsxs("div",{className:"topbar-actions",children:[o.jsxs("div",{className:"health-pill-row",children:[o.jsxs("span",{className:`health-pill health-pill-${u.apiStatus.state}`,children:["API ",u.apiStatus.state==="ok"?"ok":u.apiStatus.state]}),o.jsxs("span",{className:`health-pill health-pill-${u.workerStatus.state}`,children:["Worker ",u.workerStatus.state==="ok"?"ok":u.workerStatus.state]})]}),o.jsxs(oe,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":y,"aria-controls":"mobile-nav",onClick:()=>x(z=>!z),children:[o.jsx(cE,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),o.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${y?"mobile-nav-open":""}`,children:[o.jsxs(oe,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>x(!1),children:[o.jsx(Zu,{className:"size-5"}),o.jsx("span",{className:"sr-only",children:"Close navigation"})]}),o.jsx(St,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),o.jsx(St,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),o.jsx(St,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),o.jsx(St,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),C&&C.projects.length>0?o.jsxs("div",{className:"mobile-nav-section",children:[o.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),C.projects.map(z=>o.jsx(St,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"mobile-nav-link",children:z.project.name},z.project.id))]}):null]}),o.jsx("main",{id:"content",className:"page-shell",children:s&&!e?o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-40"}),o.jsx("div",{className:"skeleton-text-sm w-72"})]}),o.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(z=>o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-24"}),o.jsx("div",{className:"skeleton-text w-full"}),o.jsx("div",{className:"skeleton-text-sm w-3/4"})]},z))}),o.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(z=>o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-20"}),o.jsx("div",{className:"space-y-2",children:[1,2,3].map(O=>o.jsx("div",{className:"skeleton-text-sm w-full"},O))})]},z))})]}):o.jsx(bp,{})}),o.jsxs("footer",{className:"footer",children:[o.jsxs("a",{href:"https://github.com/AINYC/canonry",target:"_blank",rel:"noreferrer",className:"footer-brand",children:[o.jsx(sE,{className:"size-3.5"}),o.jsx("span",{children:"Canonry"})]}),o.jsx("div",{className:"footer-links",children:Jb.map(z=>o.jsx("a",{href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]})]}),k?o.jsxs(zT,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:v,children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[o.jsx(Ju,{status:k.status}),o.jsx("span",{className:"text-zinc-400",children:k.startedAt}),o.jsx("span",{className:"text-zinc-500",children:k.duration}),o.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&o.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.statusDetail}),o.jsxs("div",{className:"mt-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),S?o.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):N&&N.snapshots.length>0?o.jsxs("div",{className:"space-y-2",children:[N.snapshots.map(z=>o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[o.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:z.keyword??"Unknown key phrase"}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(al,{provider:z.provider}),o.jsx(Aj,{variant:z.citationState==="cited"?"success":"neutral",children:z.citationState})]})]}),z.model&&o.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:z.model}),z.citedDomains.length>0&&o.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[o.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",z.citedDomains.join(", ")]}),z.competitorOverlap.length>0&&o.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",z.competitorOverlap.join(", ")]}),z.groundingSources&&z.groundingSources.length>0&&o.jsxs("details",{className:"mt-2",children:[o.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[z.groundingSources.length," grounding source",z.groundingSources.length!==1?"s":""]}),o.jsx("ul",{className:"mt-1 space-y-0.5",children:z.groundingSources.map((O,M)=>o.jsx("li",{className:"text-xs text-zinc-500 truncate",children:o.jsx("a",{href:O.uri,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300",children:O.title||O.uri})},M))})]}),z.answerText&&o.jsxs("details",{className:"mt-1",children:[o.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),o.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:z.answerText})]})]},z.id)),N.status==="running"&&o.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Querying remaining key phrases..."]})]}):N&&N.status==="running"?o.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first key phrase result..."]}):N&&N.status==="queued"?o.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):N&&N.error?o.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[o.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),o.jsx("pre",{className:"text-xs text-rose-300/80 whitespace-pre-wrap break-words max-h-48 overflow-y-auto font-mono leading-5",children:EE(N.error)})]}):o.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,A?o.jsx(AM,{evidence:A.evidence,project:A.project,onClose:v}):null,o.jsx(N4,{}),o.jsx(p4,{})]})}class k4 extends w.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,s){console.error("[ErrorBoundary]",t,s.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?o.jsx("div",{className:"page-container",children:o.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[o.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:o.jsx(wE,{className:"size-6 text-rose-400"})}),o.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),o.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),o.jsxs("div",{className:"flex gap-3 mt-2",children:[o.jsxs(oe,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[o.jsx(yE,{className:"size-3.5 mr-1.5"}),"Try again"]}),o.jsx(oe,{variant:"secondary",size:"sm",onClick:()=>{window.location.href="/"},children:"Go home"})]})]})}):this.props.children}}const Le=w.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Wn("rounded-xl border border-zinc-800 bg-zinc-950/75 shadow-[0_0_0_1px_rgba(255,255,255,0.01)] backdrop-blur",e),...t}));Le.displayName="Card";const Km=w.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Wn("flex flex-col gap-1.5 p-5",e),...t}));Km.displayName="CardHeader";const Gm=w.forwardRef(({className:e,...t},s)=>o.jsx("h3",{ref:s,className:Wn("font-medium tracking-tight text-zinc-50",e),...t}));Gm.displayName="CardTitle";const Fm=w.forwardRef(({className:e,...t},s)=>o.jsx("p",{ref:s,className:Wn("text-sm text-zinc-500",e),...t}));Fm.displayName="CardDescription";const hu=w.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Wn("p-5 pt-0",e),...t}));hu.displayName="CardContent";function z4({points:e,tone:t}){const s=w.useId();if(e.length===0)return null;const a=42,r=132,c=5,u=Math.min(...e),m=Math.max(...e)-u||1,p=r-c*2,v=a-c*2,y=e.map((x,b)=>{const N=c+b/Math.max(e.length-1,1)*p,S=c+(1-(x-u)/m)*v;return`${N},${S}`}).join(" ");return o.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${r} ${a}`,"aria-hidden":"true",children:[o.jsx("defs",{children:o.jsx("clipPath",{id:s,children:o.jsx("rect",{x:c,y:c,width:p,height:v,rx:"8"})})}),o.jsx("line",{className:"sparkline-guide",x1:c,x2:r-c,y1:a-c,y2:a-c}),o.jsx("polyline",{clipPath:`url(#${s})`,points:y,vectorEffect:"non-scaling-stroke"})]})}function _4(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function E4(e,t,s){return e.map(a=>{if(a.id==="api")return{...a,tone:Ru(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(a.id==="worker")return{...a,tone:Ru(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const r=s.providerStatuses.filter(m=>m.state==="ready").length,c=s.providerStatuses.length,u=r>0,f=s.providerStatuses.filter(m=>m.state==="ready").map(m=>_4(m)).join(" · ");return{...a,label:"Providers",tone:u?"positive":"caution",detail:`${r} of ${c} configured`,meta:f||"None configured"}})}function R4(e,t){if(e.apiStatus.state!=="ok")return"Launch is blocked until the API responds cleanly.";if(e.apiStatus.databaseConfigured===!1)return"Launch is blocked until the API has a database connection configured.";if(e.workerStatus.state!=="ok")return"Launch is blocked until the worker is healthy and heartbeats are current.";if(!t.providerStatuses.some(s=>s.state==="ready"))return"Launch is blocked until at least one provider is configured."}function A4(e,t,s){const a=R4(t,s),r=structuredClone(e);return r.healthChecks=r.healthChecks.map(c=>{if(c.id==="api")return{...c,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(c.id==="worker")return{...c,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const u=s.providerStatuses.some(f=>f.state==="ready");return{...c,detail:u?"At least one provider configured.":"No providers configured.",state:u?"ready":"attention"}}),r.launchState.enabled=a===void 0,r.launchState.blockedReason=a,r.launchState.summary=a??"Queue a visibility sweep first, then follow with a site audit to explain movement.",r}function T4({project:e}){return o.jsxs(St,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[o.jsxs("div",{className:"project-row-primary",children:[o.jsxs("div",{children:[o.jsx("p",{className:"project-name",children:e.project.name}),o.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),o.jsx("p",{className:"project-insight",children:e.insight})]}),o.jsx("div",{className:"project-row-stat",children:o.jsxs("div",{className:"metric-inline-block",children:[o.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),o.jsx("p",{className:"metric-inline-value",children:e.visibilityScore}),o.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta})]})}),o.jsx("div",{className:"project-row-stat",children:o.jsxs("div",{className:"metric-inline-block",children:[o.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),o.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),o.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",Vu(e.lastRun.status)]})]})}),o.jsx("div",{className:"project-row-chart",children:o.jsx(z4,{points:e.trend,tone:Tj(e.lastRun.status)})}),o.jsx("span",{className:"project-row-link",children:o.jsx(Fu,{className:"h-4 w-4 text-zinc-500"})})]})}function O4(){const e=pl(),{dashboard:t,isLoading:s}=Oa(),a=t??e?.dashboard;if(!a||s)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-32"}),o.jsx("div",{className:"skeleton-text-sm w-64"})]}),o.jsx("div",{className:"space-y-3",children:[1,2,3].map(v=>o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsx("div",{className:"skeleton-text w-36"}),o.jsx("div",{className:"skeleton-text-sm w-48"})]}),o.jsx("div",{className:"skeleton-text w-16"}),o.jsx("div",{className:"skeleton-text w-16"}),o.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},v))})]});const r=a.portfolioOverview,f=ad(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},m=E4(r.systemHealth,f,a.settings),{openRun:p}=Gr();return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Portfolio"}),o.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),o.jsx("div",{className:"page-header-right",children:o.jsx("p",{className:"text-[11px] text-zinc-600",children:r.lastUpdatedAt})})]}),r.projects.length>0?o.jsx("div",{className:"project-list project-list-scrollable",children:r.projects.map(v=>o.jsx(T4,{project:v},v.project.id))}):o.jsxs(Le,{className:"surface-card empty-card",children:[o.jsx("h3",{children:r.emptyState?.title??"No projects yet"}),o.jsx("p",{className:"supporting-copy",children:r.emptyState?.detail}),o.jsx(oe,{size:"sm",asChild:!0,children:o.jsx(St,{to:r.emptyState?.ctaHref==="/setup"||!r.emptyState?.ctaHref?"/setup":"/",children:r.emptyState?.ctaLabel??"Launch setup"})})]}),o.jsxs("div",{className:"overview-secondary-grid",children:[r.attentionItems.length>0&&o.jsxs("section",{className:"overview-secondary-section",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),o.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),o.jsx("div",{className:"attention-list attention-list-scrollable",children:r.attentionItems.map(v=>o.jsxs(St,{to:v.href,className:`attention-item attention-item-${v.tone}`,children:[o.jsxs("div",{children:[o.jsx("p",{className:"attention-title",children:v.title}),o.jsx("p",{className:"attention-detail",children:v.detail})]}),o.jsx("span",{className:"attention-action",children:v.actionLabel})]},v.id))})]}),o.jsxs("section",{className:"overview-secondary-section",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),o.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),o.jsx("div",{className:"compact-stack compact-stack-scrollable",children:r.recentRuns.length>0?r.recentRuns.map(v=>o.jsxs("button",{className:"compact-run",type:"button",onClick:()=>p(v.id),children:[o.jsxs("div",{children:[o.jsx("p",{className:"compact-run-title",children:v.projectName}),o.jsx("p",{className:"compact-run-detail",children:v.summary})]}),o.jsx(Ju,{status:v.status})]},v.id)):o.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),o.jsxs("section",{className:"page-section",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),o.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),o.jsx("div",{className:"health-grid",children:m.map(v=>o.jsxs(Le,{className:"surface-card compact-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:v.label}),o.jsx("h3",{children:v.detail})]}),o.jsx(lt,{tone:v.tone,children:v.label})]}),o.jsx("p",{className:"supporting-copy",children:v.meta})]},v.id))})]})]})}const Kp=Symbol.for("yaml.alias"),Zm=Symbol.for("yaml.document"),Li=Symbol.for("yaml.map"),sN=Symbol.for("yaml.pair"),Ns=Symbol.for("yaml.scalar"),Fr=Symbol.for("yaml.seq"),Yn=Symbol.for("yaml.node.type"),La=e=>!!e&&typeof e=="object"&&e[Yn]===Kp,rd=e=>!!e&&typeof e=="object"&&e[Yn]===Zm,gl=e=>!!e&&typeof e=="object"&&e[Yn]===Li,Mt=e=>!!e&&typeof e=="object"&&e[Yn]===sN,pt=e=>!!e&&typeof e=="object"&&e[Yn]===Ns,yl=e=>!!e&&typeof e=="object"&&e[Yn]===Fr;function Lt(e){if(e&&typeof e=="object")switch(e[Yn]){case Li:case Fr:return!0}return!1}function Dt(e){if(e&&typeof e=="object")switch(e[Yn]){case Kp:case Li:case Ns:case Fr:return!0}return!1}const iN=e=>(pt(e)||Lt(e))&&!!e.anchor,fa=Symbol("break visit"),L4=Symbol("skip children"),Xo=Symbol("remove node");function Zr(e,t){const s=D4(t);rd(e)?Rr(null,e.contents,s,Object.freeze([e]))===Xo&&(e.contents=null):Rr(null,e,s,Object.freeze([]))}Zr.BREAK=fa;Zr.SKIP=L4;Zr.REMOVE=Xo;function Rr(e,t,s,a){const r=M4(e,t,s,a);if(Dt(r)||Mt(r))return $4(e,a,r),Rr(e,r,s,a);if(typeof r!="symbol"){if(Lt(t)){a=Object.freeze(a.concat(t));for(let c=0;c<t.items.length;++c){const u=Rr(c,t.items[c],s,a);if(typeof u=="number")c=u-1;else{if(u===fa)return fa;u===Xo&&(t.items.splice(c,1),c-=1)}}}else if(Mt(t)){a=Object.freeze(a.concat(t));const c=Rr("key",t.key,s,a);if(c===fa)return fa;c===Xo&&(t.key=null);const u=Rr("value",t.value,s,a);if(u===fa)return fa;u===Xo&&(t.value=null)}}return r}function D4(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function M4(e,t,s,a){if(typeof s=="function")return s(e,t,a);if(gl(t))return s.Map?.(e,t,a);if(yl(t))return s.Seq?.(e,t,a);if(Mt(t))return s.Pair?.(e,t,a);if(pt(t))return s.Scalar?.(e,t,a);if(La(t))return s.Alias?.(e,t,a)}function $4(e,t,s){const a=t[t.length-1];if(Lt(a))a.items[e]=s;else if(Mt(a))e==="key"?a.key=s:a.value=s;else if(rd(a))a.contents=s;else{const r=La(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const P4={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},U4=e=>e.replace(/[!,[\]{}]/g,t=>P4[t]);class fn{constructor(t,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},fn.defaultYaml,t),this.tags=Object.assign({},fn.defaultTags,s)}clone(){const t=new fn(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new fn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:fn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},fn.defaultTags);break}return t}add(t,s){this.atNextDocument&&(this.yaml={explicit:fn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},fn.defaultTags),this.atNextDocument=!1);const a=t.trim().split(/[ \t]+/),r=a.shift();switch(r){case"%TAG":{if(a.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),a.length<2))return!1;const[c,u]=a;return this.tags[c]=u,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;const[c]=a;if(c==="1.1"||c==="1.2")return this.yaml.version=c,!0;{const u=/^\d+\.\d+$/.test(c);return s(6,`Unsupported YAML version ${c}`,u),!1}}default:return s(0,`Unknown directive ${r}`,!0),!1}}tagName(t,s){if(t==="!")return"!";if(t[0]!=="!")return s(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const u=t.slice(2,-1);return u==="!"||u==="!!"?(s(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&s("Verbatim tags must end with a >"),u)}const[,a,r]=t.match(/^(.*!)([^!]*)$/s);r||s(`The ${t} tag has no suffix`);const c=this.tags[a];if(c)try{return c+decodeURIComponent(r)}catch(u){return s(String(u)),null}return a==="!"?t:(s(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[s,a]of Object.entries(this.tags))if(t.startsWith(a))return s+U4(t.substring(a.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let r;if(t&&a.length>0&&Dt(t.contents)){const c={};Zr(t.contents,(u,f)=>{Dt(f)&&f.tag&&(c[f.tag]=!0)}),r=Object.keys(c)}else r=[];for(const[c,u]of a)c==="!!"&&u==="tag:yaml.org,2002:"||(!t||r.some(f=>f.startsWith(u)))&&s.push(`%TAG ${c} ${u}`);return s.join(`
96
96
  `)}}fn.defaultYaml={explicit:!1,version:"1.2"};fn.defaultTags={"!!":"tag:yaml.org,2002:"};function aN(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(s)}return!0}function rN(e){const t=new Set;return Zr(e,{Value(s,a){a.anchor&&t.add(a.anchor)}}),t}function oN(e,t){for(let s=1;;++s){const a=`${e}${s}`;if(!t.has(a))return a}}function I4(e,t){const s=[],a=new Map;let r=null;return{onAnchor:c=>{s.push(c),r??(r=rN(e));const u=oN(t,r);return r.add(u),u},setAnchors:()=>{for(const c of s){const u=a.get(c);if(typeof u=="object"&&u.anchor&&(pt(u.node)||Lt(u.node)))u.node.anchor=u.anchor;else{const f=new Error("Failed to resolve repeated object (this should not happen)");throw f.source=c,f}}},sourceObjects:a}}function Ar(e,t,s,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let r=0,c=a.length;r<c;++r){const u=a[r],f=Ar(e,a,String(r),u);f===void 0?delete a[r]:f!==u&&(a[r]=f)}else if(a instanceof Map)for(const r of Array.from(a.keys())){const c=a.get(r),u=Ar(e,a,r,c);u===void 0?a.delete(r):u!==c&&a.set(r,u)}else if(a instanceof Set)for(const r of Array.from(a)){const c=Ar(e,a,r,r);c===void 0?a.delete(r):c!==r&&(a.delete(r),a.add(c))}else for(const[r,c]of Object.entries(a)){const u=Ar(e,a,r,c);u===void 0?delete a[r]:u!==c&&(a[r]=u)}return e.call(t,s,a)}function Qn(e,t,s){if(Array.isArray(e))return e.map((a,r)=>Qn(a,String(r),s));if(e&&typeof e.toJSON=="function"){if(!s||!iN(e))return e.toJSON(t,s);const a={aliasCount:0,count:1,res:void 0};s.anchors.set(e,a),s.onCreate=c=>{a.res=c,delete s.onCreate};const r=e.toJSON(t,s);return s.onCreate&&s.onCreate(r),r}return typeof e=="bigint"&&!s?.keep?Number(e):e}class Gp{constructor(t){Object.defineProperty(this,Yn,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:s,maxAliasCount:a,onAnchor:r,reviver:c}={}){if(!rd(t))throw new TypeError("A document argument is required");const u={anchors:new Map,doc:t,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},f=Qn(this,"",u);if(typeof r=="function")for(const{count:m,res:p}of u.anchors.values())r(p,m);return typeof c=="function"?Ar(c,{"":f},"",f):f}}class Fp extends Gp{constructor(t){super(Kp),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,s){let a;s?.aliasResolveCache?a=s.aliasResolveCache:(a=[],Zr(t,{Node:(c,u)=>{(La(u)||iN(u))&&a.push(u)}}),s&&(s.aliasResolveCache=a));let r;for(const c of a){if(c===this)break;c.anchor===this.source&&(r=c)}return r}toJSON(t,s){if(!s)return{source:this.source};const{anchors:a,doc:r,maxAliasCount:c}=s,u=this.resolve(r,s);if(!u){const m=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(m)}let f=a.get(u);if(f||(Qn(u,null,s),f=a.get(u)),f?.res===void 0){const m="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(m)}if(c>=0&&(f.count+=1,f.aliasCount===0&&(f.aliasCount=mu(r,u,a)),f.count*f.aliasCount>c)){const m="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(m)}return f.res}toString(t,s,a){const r=`*${this.source}`;if(t){if(aN(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(c)}if(t.implicitKey)return`${r} `}return r}}function mu(e,t,s){if(La(t)){const a=t.resolve(e),r=s&&a&&s.get(a);return r?r.count*r.aliasCount:0}else if(Lt(t)){let a=0;for(const r of t.items){const c=mu(e,r,s);c>a&&(a=c)}return a}else if(Mt(t)){const a=mu(e,t.key,s),r=mu(e,t.value,s);return Math.max(a,r)}return 1}const lN=e=>!e||typeof e!="function"&&typeof e!="object";class Re extends Gp{constructor(t){super(Ns),this.value=t}toJSON(t,s){return s?.keep?this.value:Qn(this.value,t,s)}toString(){return String(this.value)}}Re.BLOCK_FOLDED="BLOCK_FOLDED";Re.BLOCK_LITERAL="BLOCK_LITERAL";Re.PLAIN="PLAIN";Re.QUOTE_DOUBLE="QUOTE_DOUBLE";Re.QUOTE_SINGLE="QUOTE_SINGLE";const B4="tag:yaml.org,2002:";function q4(e,t,s){if(t){const a=s.filter(c=>c.tag===t),r=a.find(c=>!c.format)??a[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return s.find(a=>a.identify?.(e)&&!a.format)}function ul(e,t,s){if(rd(e)&&(e=e.contents),Dt(e))return e;if(Mt(e)){const y=s.schema[Li].createNode?.(s.schema,null,s);return y.items.push(e),y}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:a,onAnchor:r,onTagObj:c,schema:u,sourceObjects:f}=s;let m;if(a&&e&&typeof e=="object"){if(m=f.get(e),m)return m.anchor??(m.anchor=r(e)),new Fp(m.anchor);m={anchor:null,node:null},f.set(e,m)}t?.startsWith("!!")&&(t=B4+t.slice(2));let p=q4(e,t,u.tags);if(!p){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const y=new Re(e);return m&&(m.node=y),y}p=e instanceof Map?u[Li]:Symbol.iterator in Object(e)?u[Fr]:u[Li]}c&&(c(p),delete s.onTagObj);const v=p?.createNode?p.createNode(s.schema,e,s):typeof p?.nodeClass?.from=="function"?p.nodeClass.from(s.schema,e,s):new Re(e);return t?v.tag=t:p.default||(v.tag=p.tag),m&&(m.node=v),v}function $u(e,t,s){let a=s;for(let r=t.length-1;r>=0;--r){const c=t[r];if(typeof c=="number"&&Number.isInteger(c)&&c>=0){const u=[];u[c]=a,a=u}else a=new Map([[c,a]])}return ul(a,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Qo=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class cN extends Gp{constructor(t,s){super(t),Object.defineProperty(this,"schema",{value:s,configurable:!0,enumerable:!1,writable:!0})}clone(t){const s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(s.schema=t),s.items=s.items.map(a=>Dt(a)||Mt(a)?a.clone(t):a),this.range&&(s.range=this.range.slice()),s}addIn(t,s){if(Qo(t))this.add(s);else{const[a,...r]=t,c=this.get(a,!0);if(Lt(c))c.addIn(r,s);else if(c===void 0&&this.schema)this.set(a,$u(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}deleteIn(t){const[s,...a]=t;if(a.length===0)return this.delete(s);const r=this.get(s,!0);if(Lt(r))return r.deleteIn(a);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${a}`)}getIn(t,s){const[a,...r]=t,c=this.get(a,!0);return r.length===0?!s&&pt(c)?c.value:c:Lt(c)?c.getIn(r,s):void 0}hasAllNullValues(t){return this.items.every(s=>{if(!Mt(s))return!1;const a=s.value;return a==null||t&&pt(a)&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn(t){const[s,...a]=t;if(a.length===0)return this.has(s);const r=this.get(s,!0);return Lt(r)?r.hasIn(a):!1}setIn(t,s){const[a,...r]=t;if(r.length===0)this.set(a,s);else{const c=this.get(a,!0);if(Lt(c))c.setIn(r,s);else if(c===void 0&&this.schema)this.set(a,$u(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}}const H4=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Zs(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ya=(e,t,s)=>e.endsWith(`
97
97
  `)?Zs(s,t):s.includes(`
@@ -233,7 +233,7 @@ spec:
233
233
  keywords: []`,value:t,onChange:v=>s(v.target.value)}),c.length>0&&o.jsx("ul",{className:"mt-2 space-y-1",children:c.map((v,y)=>o.jsx("li",{className:"text-emerald-400 text-sm",children:v},y))}),f.length>0&&o.jsx("ul",{className:"mt-2 space-y-1",children:f.map((v,y)=>o.jsx("li",{className:"text-rose-400 text-sm",children:v},y))}),o.jsx("div",{className:"mt-3",children:o.jsx(oe,{type:"button",disabled:!t.trim()||a,onClick:p,children:a?"Applying...":"Apply"})})]})}function G3(){const{dashboard:e,isLoading:t,refetch:s}=Oa();if(!e||t)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-28"}),o.jsx("div",{className:"skeleton-text-sm w-40"})]}),o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[o.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(E=>o.jsx("div",{className:"skeleton-text-sm w-16"},E))}),[1,2,3].map(E=>o.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[o.jsxs("div",{className:"flex-1 space-y-1",children:[o.jsx("div",{className:"skeleton-text w-28"}),o.jsx("div",{className:"skeleton-text-sm w-16"})]}),o.jsx("div",{className:"skeleton-text w-24"}),o.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),o.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),o.jsx("div",{className:"skeleton-text-sm w-8"})]},E))]})]});const a=e.projects,r=Ii(),[c,u]=w.useState(!1),[f,m]=w.useState(""),[p,v]=w.useState(""),[y,x]=w.useState(""),[b,N]=w.useState("US"),[S,C]=w.useState("en"),[k,A]=w.useState(!1),[R,z]=w.useState(null),O=f.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),M=async()=>{if(!(!O||!y)){A(!0),z(null);try{const E=await Gu(O,{displayName:p||f,canonicalDomain:y,country:b,language:S});Ke({title:"Project created",detail:`${E.displayName||E.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${E.name}`,dedupeMode:"drop"}),s(),m(""),v(""),x(""),N("US"),C("en"),u(!1),r({to:"/projects/$projectId",params:{projectId:E.id}})}catch(E){z(E instanceof Error?E.message:"Failed to create project")}finally{A(!1)}}};return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Projects"}),o.jsxs("p",{className:"page-subtitle",children:[a.length," project",a.length!==1?"s":""," tracked"]})]}),o.jsx("div",{className:"page-header-right",children:o.jsxs(oe,{type:"button",onClick:()=>u(E=>!E),children:[o.jsx(Jx,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?o.jsxs(Le,{className:"surface-card mb-6",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),o.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),o.jsxs("div",{className:"compact-stack mt-4",children:[o.jsxs("div",{className:"setup-field-row",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),o.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:f,onChange:E=>m(E.target.value)}),O&&O!==f?o.jsxs("p",{className:"supporting-copy",children:["Slug: ",O]}):null]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),o.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:p,onChange:E=>v(E.target.value)})]})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),o.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:y,onChange:E=>x(E.target.value)})]}),o.jsxs("div",{className:"setup-field-row",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),o.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:b,onChange:E=>N(E.target.value.toUpperCase())})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),o.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:S,onChange:E=>C(E.target.value.toLowerCase())})]})]})]}),R?o.jsx("p",{className:"text-rose-400 text-sm mt-3",children:R}):null,o.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[o.jsx(oe,{type:"button",disabled:!O||!y||k,onClick:M,children:k?"Creating...":"Create project"}),o.jsx(oe,{type:"button",variant:"ghost",onClick:()=>u(!1),children:"Cancel"})]})]}):null,a.length>0?o.jsx("div",{className:"data-table-wrapper",children:o.jsxs("table",{className:"data-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Name"}),o.jsx("th",{children:"Domain"}),o.jsx("th",{children:"Visibility"}),o.jsx("th",{children:"Last run"}),o.jsx("th",{className:"text-right",children:"Country"})]})}),o.jsx("tbody",{children:a.map(E=>{const L=E.recentRuns[0];return o.jsxs("tr",{className:"cursor-pointer",onClick:()=>r({to:"/projects/$projectId",params:{projectId:E.project.id}}),children:[o.jsxs("td",{children:[o.jsx(St,{to:"/projects/$projectId",params:{projectId:E.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:U=>U.stopPropagation(),children:E.project.displayName||E.project.name}),o.jsx("p",{className:"text-[11px] text-zinc-500",children:E.project.name})]}),o.jsx("td",{className:"text-zinc-400",children:E.project.canonicalDomain}),o.jsx("td",{children:o.jsx(lt,{tone:E.visibilitySummary.tone,children:E.visibilitySummary.value})}),o.jsx("td",{className:"text-zinc-500 text-sm",children:L?o.jsx(Ju,{status:L.status}):o.jsx("span",{className:"text-zinc-600",children:"No runs"})}),o.jsx("td",{className:"text-right text-zinc-500",children:E.project.country})]},E.project.id)})})]})}):c?null:o.jsxs(Le,{className:"surface-card empty-card",children:[o.jsx("h3",{children:"No projects yet"}),o.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),o.jsxs(oe,{type:"button",onClick:()=>u(!0),children:[o.jsx(Jx,{className:"size-4 mr-1.5"}),"Add project"]})]}),o.jsx(K3,{onApplied:()=>{s()}})]})}function ws({text:e}){return o.jsxs("span",{className:"info-tooltip-wrapper",children:[o.jsxs("svg",{className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),o.jsx("span",{className:"info-tooltip-bubble",role:"tooltip",children:e})]})}function UN({run:e}){const{openRun:t}=Gr();return o.jsxs("article",{className:"run-row",children:[o.jsxs("div",{className:"run-row-main",children:[o.jsxs("div",{className:"run-row-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:e.summary}),o.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),o.jsx(Ju,{status:e.status})]}),o.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),o.jsxs("dl",{className:"run-row-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Started"}),o.jsx("dd",{children:e.startedAt})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Duration"}),o.jsx("dd",{children:e.duration})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Trigger"}),o.jsx("dd",{children:e.triggerLabel})]})]}),o.jsx(oe,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function IN({value:e,label:t,delta:s,tone:a,description:r,tooltip:c,isNumeric:u=!0,progress:f}){const v=2*Math.PI*48,y=Number.parseInt(e,10),x=typeof f=="number"&&Number.isFinite(f)?Math.min(Math.max(f,0),1):u&&!Number.isNaN(y)?Math.min(y/100,1):.5,b=v*(1-x);return o.jsxs("div",{className:"score-gauge",children:[o.jsxs("div",{className:"gauge-ring-wrapper",children:[o.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[o.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),o.jsx("circle",{className:`gauge-fill gauge-fill-${a}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:v,strokeDashoffset:b,transform:"rotate(-90 60 60)"})]}),o.jsx("div",{className:"gauge-center",children:o.jsx("span",{className:u?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),o.jsxs("p",{className:"gauge-label",children:[t,c&&o.jsx(ws,{text:c})]}),o.jsx("p",{className:"gauge-delta",children:s}),o.jsx("p",{className:"gauge-description",children:r})]})}function uS({history:e,maxDots:t=12}){const s=e.slice(-t);if(s.length===0)return o.jsx("span",{className:"text-[11px] text-zinc-600",children:"No data"});const a={cited:"bg-emerald-400","not-cited":"bg-zinc-600",lost:"bg-rose-400",emerging:"bg-amber-400 ring-1 ring-amber-300/60"},r=new Date(s[0].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),c=new Date(s[s.length-1].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"});return o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:r}),o.jsx("div",{className:"flex items-center gap-[3px]",title:`${s.length} runs`,children:s.map((u,f)=>o.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${a[u.citationState]??"bg-zinc-700"} ${u.model&&f>0&&s[f-1]?.model&&s[f-1].model!==u.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[u.citationState,new Date(u.createdAt).toLocaleDateString(),u.model?`model ${u.model}`:null,u.model&&f>0&&s[f-1]?.model&&s[f-1].model!==u.model?"model changed":null].filter(Boolean).join(" — ")},f))}),o.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:c})]})}function F3(e){const t=new Map;for(const a of e)for(const r of a.runHistory){const c=t.get(r.createdAt);c?c.states.push(r.citationState):t.set(r.createdAt,{states:[r.citationState],runId:r.runId})}return[...t.entries()].sort(([a],[r])=>a.localeCompare(r)).map(([a,{states:r,runId:c}])=>({runId:c,createdAt:a,citationState:r.includes("cited")?"cited":r.includes("emerging")?"emerging":"not-cited"}))}function Z3({evidence:e}){const{openEvidence:t}=Gr(),[s,a]=w.useState(new Set),r=w.useMemo(()=>{const u=new Map;for(const f of e){const m=u.get(f.keyword)??[];u.set(f.keyword,[...m,f])}return[...u.entries()].map(([f,m])=>({phrase:f,items:m}))},[e]),c=u=>{a(f=>{const m=new Set(f);return m.has(u)?m.delete(u):m.add(u),m})};return o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:{width:"2rem"}}),o.jsx("th",{children:"Key Phrase"}),o.jsx("th",{children:"Status"}),o.jsx("th",{children:"Citation History"}),o.jsx("th",{children:"Change"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:r.map(({phrase:u,items:f})=>{const m=s.has(u),p=f.map(N=>N.citationState),v=p.includes("cited")?"cited":p.includes("emerging")?"emerging":p.includes("lost")?"lost":p.every(N=>N==="pending")?"pending":"not-cited",y=F3(f),x=f.filter(N=>N.citationState==="cited"||N.citationState==="emerging").length,b=(()=>{if(y.length===0)return"Awaiting first run";if(y.length===1)return"First observation";const N=y[y.length-1].citationState,S=y[y.length-2].citationState;if(S!=="cited"&&N==="cited")return"Newly cited";if(S==="cited"&&N!=="cited")return"Lost since last run";let C=0;for(let k=y.length-1;k>=0&&y[k].citationState===N;k--)C++;return N==="cited"?C<=1?"Cited in latest run":`Cited for ${C} runs`:C<=1?"Not cited in latest run":`Not cited across ${C} runs`})();return o.jsxs(w.Fragment,{children:[o.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>c(u),"aria-expanded":m,children:[o.jsx("td",{children:o.jsx(Fu,{size:14,className:`transition-transform duration-150 text-zinc-500 ${m?"rotate-90":""}`})}),o.jsx("td",{className:"evidence-keyword-cell",children:o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-zinc-100",children:u}),o.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:f.map(N=>o.jsx(al,{provider:N.provider},N.id))})]})}),o.jsx("td",{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Bm,{state:v}),o.jsxs("span",{className:"text-[11px] text-zinc-500",children:[x,"/",f.length]})]})}),o.jsx("td",{children:o.jsx(uS,{history:y})}),o.jsx("td",{className:"evidence-change-cell",children:b}),o.jsx("td",{})]}),m&&f.map(N=>o.jsxs("tr",{className:"bg-zinc-900/30",children:[o.jsx("td",{}),o.jsx("td",{className:"evidence-keyword-cell pl-5",children:o.jsx(al,{provider:N.provider})}),o.jsx("td",{children:o.jsx(Bm,{state:N.citationState})}),o.jsx("td",{children:o.jsx(uS,{history:N.runHistory})}),o.jsx("td",{className:"evidence-change-cell",children:N.changeLabel}),o.jsx("td",{children:o.jsx(oe,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(N.id)},children:"View"})})]},N.id))]},u)})})]})})}function V3({competitors:e}){return e.length===0?o.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):o.jsx("div",{className:"competitor-table-wrap",children:o.jsxs("table",{className:"competitor-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Domain"}),o.jsx("th",{children:"Pressure"}),o.jsx("th",{children:"Citations"}),o.jsx("th",{children:"Key Phrases"})]})}),o.jsx("tbody",{children:e.map(t=>o.jsxs("tr",{children:[o.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),o.jsx("td",{children:o.jsx(lt,{tone:qR(t.pressureLabel),children:t.pressureLabel})}),o.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalKeywords>0?`${t.citationCount} / ${t.totalKeywords}`:"—"}),o.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedKeywords.length>0?t.citedKeywords.join(", "):"Not cited"})]},t.id))})]})})}const Q3=["7d","30d","90d","all"],Y3=["gap","cited","uncited"],BN={forum:"bg-amber-500",social:"bg-blue-500",news:"bg-zinc-400",reference:"bg-purple-500",blog:"bg-emerald-500",ecommerce:"bg-orange-500",video:"bg-red-500",academic:"bg-cyan-500",other:"bg-zinc-600"};function J3({projectName:e}){const[t,s]=w.useState("30d"),[a,r]=w.useState(null),[c,u]=w.useState(null),[f,m]=w.useState(null),[p,v]=w.useState(null),[y,x]=w.useState(!0);return w.useEffect(()=>{let b=!1;return x(!0),Promise.all([D2(e,t),M2(e,t),$2(e,t)]).then(([N,S,C])=>{b||(r(N),u(S),m(C),x(!1))}).catch(()=>{b||x(!1)}),()=>{b=!0}},[e,t]),y&&!a?o.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"}):o.jsxs(o.Fragment,{children:[o.jsxs("section",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Citation Metrics"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Citation Rate Trends ",o.jsx(ws,{text:"Citation rate over time across all runs within the selected window. Each data point represents the percentage of queries where your brand was cited by AI providers."})]})]}),o.jsx("div",{className:"flex gap-1",children:Q3.map(b=>o.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${t===b?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>s(b),children:b==="all"?"All":b},b))})]}),a&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-6",children:[o.jsx(IN,{value:`${Math.round(a.overall.citationRate*100)}`,label:"Citation Rate",delta:`${a.overall.cited} / ${a.overall.total}`,tone:a.trend==="improving"?"positive":a.trend==="declining"?"negative":"neutral",description:`Trend: ${a.trend}`,isNumeric:!0}),o.jsxs("div",{className:"flex-1 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs text-zinc-500",children:"Trend"}),o.jsx(lt,{tone:a.trend==="improving"?"positive":a.trend==="declining"?"negative":"neutral",children:a.trend})]}),Object.keys(a.byProvider).length>0&&o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx("th",{className:"text-left py-1 font-medium",children:"Provider"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Rate"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Cited / Total"})]})}),o.jsx("tbody",{children:Object.entries(a.byProvider).map(([b,N])=>o.jsxs("tr",{className:"border-t border-zinc-800/40",children:[o.jsx("td",{className:"py-1.5 text-zinc-300",children:b}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(N.citationRate*100).toFixed(1),"%"]}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[N.cited," / ",N.total]})]},b))})]})]})]}),a.buckets.length>=1&&o.jsx(X3,{buckets:a.buckets,keywordChanges:a.keywordChanges??[]})]})]}),o.jsx("div",{className:"page-section-divider"}),o.jsxs("section",{children:[o.jsx("div",{className:"flex items-center justify-between mb-4",children:o.jsxs("div",{children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Opportunity Analysis"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Brand Gap Analysis ",o.jsx(ws,{text:"Classification based on the most recent completed run. Cited: your brand appeared in the AI answer. Gap: a competitor was cited but you were not. Not Cited: neither mentioned. Consistency shows how often each key phrase was cited across all runs in the selected window."})]})]})}),c&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex gap-1 mb-4",children:Y3.map(b=>{const N=b==="cited"?c.cited.length:b==="gap"?c.gap.length:c.uncited.length,S=p===b;return o.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${S?b==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":b==="cited"?"bg-emerald-900/40 border-emerald-700/60 text-emerald-300":"bg-zinc-800/40 border-zinc-700 text-zinc-300":"border-zinc-800 text-zinc-400 hover:border-zinc-700"}`,onClick:()=>v(S?null:b),children:[b==="gap"?"Gap":b==="cited"?"Cited":"Not Cited"," (",N,")"]},b)})}),o.jsx(W3,{gaps:c,filter:p})]})]}),o.jsx("div",{className:"page-section-divider"}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Source Intelligence"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Source Origin Breakdown ",o.jsx(ws,{text:"Aggregated across all runs in the selected window. Shows what types of websites AI engines cite as grounding sources. More runs = more statistically meaningful breakdown."})]})]}),f&&f.overall.length>0&&o.jsxs("div",{className:"space-y-4",children:[o.jsx(e$,{categories:f.overall}),o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx("th",{className:"text-left py-1 font-medium",children:"Category"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Count"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"%"}),o.jsx("th",{className:"text-left py-1 pl-4 font-medium",children:"Top Sources"})]})}),o.jsx("tbody",{children:f.overall.map(b=>o.jsxs("tr",{className:"border-t border-zinc-800/40",children:[o.jsxs("td",{className:"py-1.5 text-zinc-300 flex items-center gap-2",children:[o.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${BN[b.category]??"bg-zinc-600"}`}),b.label]}),o.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:b.count}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(b.percentage*100).toFixed(1),"%"]}),o.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:b.topDomains.slice(0,3).map(N=>N.domain).join(", ")})]},b.category))})]})]}),f&&f.overall.length===0&&o.jsx("p",{className:"text-sm text-zinc-500 py-4",children:"No source data available. Run a visibility sweep first."})]})]})}function X3({buckets:e,keywordChanges:t}){const[s,a]=w.useState(null),r=600,c=140,u={top:30,right:10,bottom:20,left:40},f=r-u.left-u.right,m=c-u.top-u.bottom,p=1,v=e.map((b,N)=>{const S=u.left+(e.length>1?N/(e.length-1)*f:f/2),C=u.top+m-b.citationRate/p*m;return{x:S,y:C}}),y=w.useMemo(()=>{if(!t||t.length===0||e.length<2)return[];const b=new Date(e[0].startDate).getTime(),S=new Date(e[e.length-1].startDate).getTime()-b;return S<=0?[]:t.map(C=>{const A=(new Date(C.date).getTime()-b)/S;return A<0||A>1?null:{...C,x:u.left+A*f}}).filter(C=>C!==null)},[e,t,u.left,f]),x=v.map(b=>`${b.x},${b.y}`).join(" ");return o.jsxs("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:[o.jsx("p",{className:"text-[10px] text-zinc-500 mb-1 flex items-center gap-1",children:"kp = key phrases tracked in this window"}),o.jsxs("svg",{viewBox:`0 0 ${r} ${c}`,className:"w-full h-auto","aria-label":"Citation rate trend chart",onMouseLeave:()=>a(null),children:[o.jsxs("text",{x:u.left-4,y:u.top+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:[(p*100).toFixed(0),"%"]}),o.jsx("text",{x:u.left-4,y:u.top+m+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:"0%"}),o.jsx("line",{x1:u.left,y1:u.top+m,x2:u.left+f,y2:u.top+m,stroke:"currentColor",className:"text-zinc-800",strokeWidth:"0.5"}),o.jsx("polyline",{fill:"none",stroke:"currentColor",className:"text-emerald-500",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:x}),y.map((b,N)=>o.jsxs("g",{children:[o.jsx("line",{x1:b.x,y1:u.top,x2:b.x,y2:u.top+m,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"4 2"}),o.jsx("text",{x:b.x,y:u.top-6,textAnchor:"middle",className:"fill-zinc-500",fontSize:"7",fontWeight:"500",children:b.label})]},`kw-change-${N}`)),s!==null&&o.jsx("line",{x1:v[s].x,y1:u.top,x2:v[s].x,y2:u.top+m,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"3 2"}),e.map((b,N)=>{const{x:S,y:C}=v[N],k=s===N;return o.jsxs("g",{children:[o.jsx("circle",{cx:S,cy:C,r:"10",fill:"transparent",onMouseEnter:()=>a(N),style:{cursor:"pointer"}}),o.jsx("circle",{cx:S,cy:C,r:k?5:3,className:k?"fill-emerald-400":"fill-emerald-500"})]},N)}),s!==null&&(()=>{const b=e[s],{x:N,y:S}=v[s],C=`${(b.citationRate*100).toFixed(1)}%`,k=b.keywordCount?`${b.keywordCount} kp`:"",A=56,R=30,z=Math.max(u.left,Math.min(N-A/2,r-u.right-A)),O=S-R-8;return o.jsxs("g",{children:[o.jsx("rect",{x:z,y:O,width:A,height:R,rx:"4",className:"fill-zinc-800",stroke:"currentColor",strokeWidth:"0.5"}),o.jsx("text",{x:z+A/2,y:O+13,textAnchor:"middle",className:"fill-zinc-50",fontSize:"11",fontWeight:"600",children:C}),k&&o.jsx("text",{x:z+A/2,y:O+24,textAnchor:"middle",className:"fill-zinc-400",fontSize:"8",children:k})]})})(),e.map((b,N)=>({b,i:N})).filter(({i:b})=>b===0||b===e.length-1||e.length<=7).map(({b,i:N})=>{const S=v[N].x;return o.jsx("text",{x:S,y:c-2,textAnchor:"middle",className:"fill-zinc-500",fontSize:"8",children:b.startDate.slice(5,10)},N)})]})]})}function W3({gaps:e,filter:t}){const s=w.useMemo(()=>{const a=[...e.gap.map(r=>({...r,_sort:0})),...e.cited.map(r=>({...r,_sort:1})),...e.uncited.map(r=>({...r,_sort:2}))];return t?a.filter(r=>r.category===t):a.sort((r,c)=>r._sort-c._sort)},[e,t]);return s.length===0?o.jsxs("p",{className:"text-sm text-zinc-500 py-4",children:["No key phrases found",t?` with status "${t}"`:"","."]}):o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx("th",{className:"text-left py-1 font-medium",children:"Keyword"}),o.jsx("th",{className:"text-left py-1 font-medium",children:"Status"}),o.jsx("th",{className:"text-left py-1 font-medium",children:"Providers Citing"}),o.jsx("th",{className:"text-left py-1 font-medium",children:"Competitors Citing"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Consistency"})]})}),o.jsx("tbody",{children:s.map(a=>{const r=a.category==="cited"?"positive":a.category==="gap"?"caution":"neutral";return o.jsxs("tr",{className:`border-t border-zinc-800/40 ${a.category==="gap"?"border-l-2 border-l-amber-600/60":""}`,children:[o.jsx("td",{className:"py-1.5 text-zinc-200",children:a.keyword}),o.jsx("td",{className:"py-1.5",children:o.jsx(lt,{tone:r,children:a.category==="gap"?"Gap":a.category==="cited"?"Cited":"Not Cited"})}),o.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.providers.length>0?a.providers.join(", "):"—"}),o.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.competitorsCiting.length>0?a.competitorsCiting.join(", "):"—"}),o.jsx("td",{className:"py-1.5 text-right text-zinc-400 text-xs",children:a.consistency.totalRuns>0?`${a.consistency.citedRuns}/${a.consistency.totalRuns} runs`:"—"})]},a.keywordId)})})]})}function e$({categories:e}){const t=e.reduce((s,a)=>s+a.count,0);return t===0?null:o.jsx("div",{className:"flex rounded-full overflow-hidden h-3 bg-zinc-800","aria-label":"Source category distribution",children:e.map(s=>{const a=s.count/t*100;return a<.5?null:o.jsx("div",{className:`${BN[s.category]??"bg-zinc-600"} transition-all`,style:{width:`${a}%`},title:`${s.label}: ${(s.percentage*100).toFixed(1)}%`},s.category)})})}function fm(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function t$(e){const t=Date.now()-new Date(e).getTime(),s=Math.floor(t/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function n$({projectName:e}){const[t,s]=w.useState(null),[a,r]=w.useState(null),[c,u]=w.useState(!0),[f,m]=w.useState(!1),[p,v]=w.useState(!1),[y,x]=w.useState(null),[b,N]=w.useState(null),[S,C]=w.useState("sessions"),[k,A]=w.useState("desc");function R(U){u(!0),Fx(e).then(X=>{if(!U.current)return s(X),X.connected?Zx(e):null}).then(X=>{U.current||(X&&r(X),u(!1))}).catch(X=>{U.current||(x(X instanceof Error?X.message:"Failed to load GA4 data"),u(!1))})}w.useEffect(()=>{const U={current:!1};return R(U),()=>{U.current=!0}},[e]);async function z(){m(!0),x(null),N(null);try{const U=await oj(e);N(`Synced ${U.rowCount.toLocaleString()} rows (${U.days} days)`);const X=await Zx(e);r(X);const Q=await Fx(e);s(Q)}catch(U){x(U instanceof Error?U.message:"Sync failed")}finally{m(!1)}}async function O(){v(!0),x(null),N(null);try{await U2(e),s({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),r(null),N("GA4 disconnected")}catch(U){x(U instanceof Error?U.message:"Disconnect failed")}finally{v(!1)}}function M(U){S===U?A(X=>X==="desc"?"asc":"desc"):(C(U),A("desc"))}const E=w.useMemo(()=>a?.topPages?[...a.topPages].sort((U,X)=>{const Q=U[S],ee=X[S];return typeof Q=="string"&&typeof ee=="string"?k==="asc"?Q.localeCompare(ee):ee.localeCompare(Q):k==="asc"?Q-ee:ee-Q}):[],[a?.topPages,S,k]);if(c&&!t)return o.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!t?.connected)return o.jsx(s$,{projectName:e,onConnected:()=>R({current:!1})});const L=a&&a.totalSessions>0?Math.round(a.totalOrganicSessions/a.totalSessions*100):0;return o.jsxs(o.Fragment,{children:[y&&o.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:y}),b&&o.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-emerald-900/20 border border-emerald-800/60 text-sm text-emerald-300",children:b}),o.jsxs("div",{className:"flex items-center justify-between mb-6",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),o.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",o.jsx("span",{className:"text-zinc-300",children:t.propertyId}),t.clientEmail&&o.jsxs(o.Fragment,{children:[" · ",o.jsx("span",{className:"text-zinc-500",children:t.clientEmail})]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(oe,{variant:"outline",size:"sm",disabled:f,onClick:z,children:[o.jsx(Xx,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"Syncing…":"Sync"]}),o.jsxs(oe,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:p,onClick:O,children:[o.jsx(CE,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",o.jsx(ws,{text:"Aggregated traffic metrics from Google Analytics 4. Sessions and users are summed across all synced dates. Organic sessions are Google organic search sessions specifically."})]})]}),a?o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsx(hm,{value:fm(a.totalSessions),label:"Total Sessions",subtitle:a.totalSessions.toLocaleString(),tone:"neutral"}),o.jsx(hm,{value:fm(a.totalOrganicSessions),label:"Organic Sessions",subtitle:`${L}% of total`,tone:"positive"}),o.jsx(hm,{value:fm(a.totalUsers),label:"Total Users",subtitle:a.totalUsers.toLocaleString(),tone:"neutral"})]}):o.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[o.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),o.jsxs(oe,{variant:"outline",size:"sm",disabled:f,onClick:z,children:[o.jsx(Xx,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),"Sync from GA4"]})]})]}),a&&a.topPages.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"page-section-divider"}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",o.jsx(ws,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx(au,{label:"Landing Page",sortKey:"landingPage",current:S,dir:k,onSort:M,align:"left"}),o.jsx(au,{label:"Sessions",sortKey:"sessions",current:S,dir:k,onSort:M,align:"right"}),o.jsx(au,{label:"Organic",sortKey:"organicSessions",current:S,dir:k,onSort:M,align:"right"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),o.jsx(au,{label:"Users",sortKey:"users",current:S,dir:k,onSort:M,align:"right"})]})}),o.jsx("tbody",{children:E.map(U=>o.jsx(a$,{page:U},U.landingPage))})]})})]})]}),o.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[o.jsx("span",{children:a?.lastSyncedAt?`Last synced ${t$(a.lastSyncedAt)}`:"Never synced"}),o.jsx("span",{children:a?`${a.topPages.length} pages shown`:""})]})]})}function s$({projectName:e,onConnected:t}){const[s,a]=w.useState(""),[r,c]=w.useState(null),[u,f]=w.useState(null),[m,p]=w.useState(!1),[v,y]=w.useState(null),x=w.useRef(null),b=w.useCallback(S=>{const C=S.target.files?.[0];if(!C)return;y(null),c(C.name);const k=new FileReader;k.onload=()=>{const A=k.result;try{const R=JSON.parse(A);if(!R.client_email||!R.private_key){y("JSON file is missing required fields: client_email and private_key. Make sure you downloaded a service account key (not an OAuth client)."),f(null);return}f(A)}catch{y("File is not valid JSON. Please upload a service account key file (.json) downloaded from Google Cloud Console."),f(null)}},k.onerror=()=>{y("Failed to read file."),f(null)},k.readAsText(C)},[]);async function N(){if(y(null),!s.trim()){y("Property ID is required.");return}if(!u){y("Please upload a service account key file.");return}p(!0);try{await P2(e,{propertyId:s.trim(),keyJson:u});try{await oj(e)}catch{}t()}catch(S){y(S instanceof Error?S.message:"Failed to connect GA4")}finally{p(!1)}}return o.jsxs(Le,{className:"surface-card p-6",children:[o.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-1",children:"Connect Google Analytics 4"}),o.jsx("p",{className:"text-sm text-zinc-400 mb-5",children:"Connect a GA4 property to see traffic data for this project. You'll need a service account key file from Google Cloud Console."}),v&&o.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:v}),o.jsxs("div",{className:"mb-4",children:[o.jsx("label",{htmlFor:"ga4-property-id",className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"GA4 Property ID"}),o.jsx("input",{id:"ga4-property-id",type:"text",placeholder:"e.g. 123456789",value:s,onChange:S=>a(S.target.value),className:"w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 px-3 py-2 text-sm text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus:ring-1 focus:ring-zinc-600"}),o.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Find this in GA4 → Admin → Property Settings. It's a numeric ID, not the Measurement ID (G-XXXXXX)."})]}),o.jsxs("div",{className:"mb-5",children:[o.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"Service Account Key File"}),o.jsx("input",{ref:x,type:"file",accept:".json,application/json",onChange:b,className:"hidden"}),o.jsxs("button",{type:"button",onClick:()=>x.current?.click(),className:"flex items-center gap-2 w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 border-dashed px-4 py-3 text-sm text-zinc-400 hover:border-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:[o.jsx(zE,{className:"w-4 h-4 shrink-0"}),r?o.jsx("span",{className:"text-zinc-200 truncate",children:r}):o.jsx("span",{children:"Upload .json key file"})]}),o.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Download from Google Cloud Console → IAM & Admin → Service Accounts → Keys → Add Key → JSON. The service account must have ",o.jsx("span",{className:"text-zinc-400",children:"Viewer"})," access on the GA4 property."]})]}),o.jsx(oe,{variant:"default",size:"sm",disabled:m||!s.trim()||!u,onClick:N,children:m?"Connecting & syncing…":"Connect GA4"})]})}function au({label:e,sortKey:t,current:s,dir:a,onSort:r,align:c}){const u=s===t;return o.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${c==="right"?"text-right":"text-left"}`,onClick:()=>r(t),children:[e,u&&o.jsx("span",{className:"ml-0.5",children:a==="asc"?"↑":"↓"})]})}const i$={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function hm({value:e,label:t,subtitle:s,tone:a}){return o.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),o.jsx("p",{className:`text-2xl font-bold tabular-nums ${i$[a]}`,children:e}),o.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:s})]})}function a$({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return o.jsxs("tr",{className:"border-t border-zinc-800/40",children:[o.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),o.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),o.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),o.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function bl(e){e.invalidateQueries({queryKey:Vn.runs.all}),e.invalidateQueries({queryKey:Vn.projects.all})}function r$(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function o$(e,t){const s=e??"Project";return t==="gsc-sync"?`${s} will refresh after the sync completes.`:t==="inspect-sitemap"?`${s} will notify you when sitemap inspection finishes.`:`${s} will notify you when the run finishes.`}function gd(e,t){fj({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),Ke({title:r$(e.kind),detail:o$(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function l$(e){const t=e.filter(r=>r.status!=="conflict"),s=e.filter(r=>r.status==="conflict");if(t.length===0){Ke({title:"No runs queued",detail:s.length>0?`${s.length} project${s.length===1?"":"s"} already had a run in progress.`:"No projects were available to queue.",tone:"caution",durationMs:8e3,dedupeKey:"run-all:conflict",dedupeMode:"replace"});return}for(const r of t)fj({id:r.id,projectId:r.projectId,kind:r.kind,projectLabel:r.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const a=$E({runIds:t.map(r=>r.id),queuedCount:t.length,skippedCount:s.length});Ke({title:"Run-all batch queued",detail:s.length>0?`${t.length} project${t.length===1?"":"s"} queued, ${s.length} skipped because a run is already active.`:`${t.length} project${t.length===1?"":"s"} queued.`,tone:s.length>0?"caution":"neutral",dedupeKey:`batch:${a}`,dedupeMode:"replace"})}function yd(e,t){if(e instanceof ku&&e.code==="RUN_IN_PROGRESS"){Ke({title:"Run already in progress",detail:t?.projectLabel?`${t.projectLabel} already has an active run. Wait for it to finish, then retry.`:"This project already has an active run. Wait for it to finish, then retry.",tone:"caution",durationMs:8e3,dedupeKey:`run-in-progress:${t?.projectKey??"project"}:${t?.sourceAction??"run"}`,dedupeMode:"replace"});return}Ke({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function qN(){const e=Pi();return hl({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:s})=>Q_(t,s),onSuccess:(t,s)=>{bl(e),gd(t,{projectLabel:s.projectLabel??s.projectName,sourceAction:s.sourceAction})},onError:(t,s)=>{yd(t,{projectKey:s.projectName,projectLabel:s.projectLabel??s.projectName,sourceAction:s.sourceAction})}})}function c$(){const e=Pi();return hl({meta:{skipGlobalErrorToast:!0},mutationFn:t=>m2(t),onSuccess:t=>{bl(e),l$(t)},onError:t=>{Ke({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function u$(){const e=Pi();return hl({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:s})=>sj(t,s),onSuccess:(t,s)=>{bl(e),gd(t,{projectLabel:s.projectLabel??s.projectName,sourceAction:"gsc-sync"})},onError:(t,s)=>{yd(t,{projectKey:s.projectName,projectLabel:s.projectLabel??s.projectName,sourceAction:"gsc-sync"})}})}function d$(){const e=Pi();return hl({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>z2(t),onSuccess:(t,s)=>{bl(e),gd(t.run,{projectLabel:s.projectLabel??s.projectName,sourceAction:"discover-sitemaps"})},onError:(t,s)=>{yd(t,{projectKey:s.projectName,projectLabel:s.projectLabel??s.projectName,sourceAction:"discover-sitemaps"})}})}function f$(){const e=Pi();return hl({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:s})=>C2(t,s),onSuccess:(t,s)=>{bl(e),gd(t,{projectLabel:s.projectLabel??s.projectName,sourceAction:"inspect-sitemap"})},onError:(t,s)=>{yd(t,{projectKey:s.projectName,projectLabel:s.projectLabel??s.projectName,sourceAction:"inspect-sitemap"})}})}function h$({projectName:e}){const[t,s]=w.useState(!1),[a,r]=w.useState([]),[c,u]=w.useState([]),[f,m]=w.useState([]),[p,v]=w.useState([]),[y,x]=w.useState([]),[b,N]=w.useState(null),[S,C]=w.useState(""),[k,A]=w.useState(""),[R,z]=w.useState("30"),[O,M]=w.useState(!1),[E,L]=w.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[U,X]=w.useState(""),[Q,ee]=w.useState(!0),[ue,ze]=w.useState(!1),[je,K]=w.useState(!1),[ae,me]=w.useState(!1),[V,H]=w.useState(!1),[T,B]=w.useState(!1),[se,le]=w.useState(!1),[J,fe]=w.useState(null),[ye,_e]=w.useState(!1),[ge,Ze]=w.useState(!1),[et,de]=w.useState(null),[Ve,at]=w.useState(""),[Zt,$t]=w.useState(!1),[Dn,nn]=w.useState(!1),[_t,re]=w.useState("indexed"),[Ge,gt]=w.useState([]),[Vt,Qe]=w.useState(null),[De,Ye]=w.useState(!1),[Nt,Be]=w.useState(null),[Da,pn]=w.useState(null),nt=a.find(I=>I.connectionType==="gsc"),Yr=f.length>0||p.length>0||y.length>0,ts=u$(),ht=d$(),gn=f$();async function ce(I){if(!I){u([]),C("");return}K(!0);try{const{sites:he}=await y2(e);u(he),C(I.propertyId??he[0]?.siteUrl??"")}catch(he){u([]),Be(he instanceof Error?he.message:"Failed to load Search Console properties")}finally{K(!1)}}async function kn(){H(!0);try{const I=await b2(e,{startDate:E.startDate||void 0,endDate:E.endDate||void 0,query:E.query||void 0,page:E.page||void 0,limit:parseInt(E.limit,10)||20});m(I)}catch(I){m([]),Be(I instanceof Error?I.message:"Failed to load GSC performance data")}finally{H(!1)}}async function Ma(){B(!0);try{const[I,he]=await Promise.all([j2(e,{url:U.trim()||void 0,limit:20}),w2(e)]);v(I),x(he)}catch(I){v([]),x([]),Be(I instanceof Error?I.message:"Failed to load GSC inspection history")}finally{B(!1)}}async function jl(){_e(!0);try{const[I,he]=await Promise.all([jp(e),N2(e).catch(()=>[])]);fe(I),gt(he)}catch(I){fe(null),gt([]),Be(I instanceof Error?I.message:"Failed to load coverage data")}finally{_e(!1)}}async function Ki(I){Ye(!0),Be(null);try{const he=await Kx(e,{urls:I}),{succeeded:xt,failed:Ht,total:ln}=he.summary;Ke({title:"Indexing requested",detail:Ht===0?`${xt} URL${xt!==1?"s":""} submitted for indexing.`:`${xt}/${ln} submitted successfully, ${Ht} failed.`,tone:Ht===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(he){Be(he instanceof Error?he.message:"Failed to request indexing")}finally{Ye(!1)}}async function $a(){Ye(!0),Be(null);try{const I=await Kx(e,{urls:[],allUnindexed:!0}),{succeeded:he,failed:xt,total:Ht}=I.summary;Ke({title:"Indexing requested",detail:xt===0?`${he} unindexed URL${he!==1?"s":""} submitted for indexing.`:`${he}/${Ht} submitted successfully, ${xt} failed.`,tone:xt===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(I){Be(I instanceof Error?I.message:"Failed to request indexing")}finally{Ye(!1)}}async function Cs(){if(Ve.trim()){$t(!0),Be(null);try{await x2(e,"gsc",Ve.trim()),r(I=>I.map(he=>he.connectionType==="gsc"?{...he,sitemapUrl:Ve.trim()}:he)),Ke({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),at("")}catch(I){Be(I instanceof Error?I.message:"Failed to save sitemap URL")}finally{$t(!1)}}}async function hs(){Be(null);try{const I=await ht.mutateAsync({projectName:e,projectLabel:e});de(I.sitemaps),r(he=>he.map(xt=>xt.connectionType==="gsc"?{...xt,sitemapUrl:I.primarySitemapUrl}:xt))}catch{}}async function Pa(){Ze(!0),Be(null);try{const I=await k2(e);de(I.sitemaps),I.sitemaps.length===0&&pn("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(I){Be(I instanceof Error?I.message:"Failed to list sitemaps")}finally{Ze(!1)}}async function Ys(){ee(!0),Be(null);try{const[I,he]=await Promise.all([Sp().catch(()=>null),nj(e).catch(()=>[])]);s(!!I?.google?.configured),r(he);const xt=he.find(Ht=>Ht.connectionType==="gsc");await Promise.all([ce(xt),kn(),Ma(),jl()])}finally{ee(!1)}}w.useEffect(()=>{Ys()},[e]);async function xd(){if(!t){Be("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}ze(!0),Be(null),pn(null);try{const{authUrl:I}=await p2(e,"gsc");if(!I.startsWith("https://accounts.google.com/")){Be("Unexpected OAuth redirect URL. Please try again.");return}const he=window.open(I,"_blank","width=600,height=700");if(!he){window.location.assign(I);return}pn("Finish the Google consent flow in the popup, then close it to refresh this project.");const xt=window.setInterval(()=>{he.closed&&(window.clearInterval(xt),pn(null),Ys())},1e3)}catch(I){Be(I instanceof Error?I.message:"Failed to start OAuth flow")}finally{ze(!1)}}async function wl(){Be(null),pn(null);try{await g2(e,"gsc"),r(I=>I.filter(he=>he.connectionType!=="gsc")),u([]),C("")}catch(I){Be(I instanceof Error?I.message:"Failed to disconnect")}}async function Jr(){if(S){me(!0),Be(null);try{await v2(e,"gsc",S),r(I=>I.map(he=>he.connectionType==="gsc"?{...he,propertyId:S}:he)),Ke({title:"GSC property updated",detail:`${e} is now linked to ${S}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(I){Be(I instanceof Error?I.message:"Failed to save GSC property")}finally{me(!1)}}}async function Gi(){Be(null),pn(null);try{await ts.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(R,10)||void 0,full:O||void 0}})}catch{}}async function Nl(){if(k.trim()){le(!0),Be(null),pn(null);try{const I=await S2(e,k.trim());N(I),A(""),await Ma()}catch(I){Be(I instanceof Error?I.message:"Failed to inspect URL")}finally{le(!1)}}}return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),o.jsx("h2",{children:"Google Search Console"})]}),o.jsx("div",{className:"flex items-center gap-2",children:nt&&o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:V,onClick:()=>{kn()},children:V?"Refreshing…":"Refresh data"})})]}),Nt&&o.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[Nt,o.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>Be(null),children:"×"})]}),Da&&o.jsxs("div",{className:"mb-3 rounded-lg border border-emerald-800/40 bg-emerald-950/20 px-3 py-2 text-sm text-emerald-300",children:[Da,o.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>pn(null),children:"×"})]}),Q?o.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):o.jsxs("div",{className:"space-y-3",children:[o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsx(lt,{tone:nt?"positive":t?"caution":"negative",children:nt?"Connected":t?"Ready to connect":"App credentials missing"})]}),nt?o.jsxs("div",{className:"mt-3 space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),o.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),o.jsx("span",{className:"text-xs text-zinc-500",children:nt.domain}),o.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:wl,children:"Disconnect"})]}),o.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",o.jsx("code",{children:nt.domain}),"."]})]}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:nt.propertyId??"No property selected yet"})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ls(nt.updatedAt)})]})]})]}):o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[o.jsx("p",{className:"text-sm text-zinc-300",children:t?"Generate a Google OAuth link for this project and have the client sign in with a Google account that already has access to the correct Search Console property.":"Set Google OAuth client credentials first. Once configured, you can generate a consent link for this project domain."}),o.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t?o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:ue,onClick:xd,children:ue?"Opening…":"Connect Google Search Console"}):o.jsx(oe,{type:"button",variant:"outline",size:"sm",asChild:!0,children:o.jsx(St,{to:"/settings",children:"Open Settings"})}),!t&&o.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),nt&&!nt.sitemapUrl&&o.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("span",{className:"mt-0.5 text-amber-400",children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5","aria-hidden":"true",children:o.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),o.jsx("p",{className:"mt-1 text-xs text-amber-400/70",children:"Canonry uses your sitemap to discover URLs for index coverage inspection. Auto-discover from GSC or enter it manually."}),o.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx(oe,{type:"button",size:"sm",disabled:ht.isPending||!nt.propertyId,onClick:hs,children:ht.isPending?"Discovering…":"Auto-discover from GSC"}),o.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-amber-800/40 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-500 focus:border-amber-600 focus:outline-none",type:"url",placeholder:"https://example.com/sitemap.xml",value:Ve,onChange:I=>at(I.target.value),onKeyDown:I=>I.key==="Enter"&&void Cs()}),o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:Zt||!Ve.trim(),onClick:Cs,children:Zt?"Saving…":"Save sitemap URL"})]})]})]})]})}),(nt||Yr)&&o.jsxs(o.Fragment,{children:[o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),o.jsx("h3",{children:"Index coverage"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[J&&J.notIndexed.length>0&&o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:De,onClick:()=>{$a()},children:De?"Requesting…":`Request indexing (${J.notIndexed.length})`}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:ye,onClick:()=>{jl()},children:ye?"Loading…":"Refresh coverage"})]})]}),J&&J.summary.total>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const I=J.summary.indexed+J.summary.notIndexed,he=I>0?J.summary.indexed/I:0,xt=I>0?J.summary.notIndexed/I:0,Ht=54,ln=2*Math.PI*Ht,Ua=ln*(1-he),ms=ln*xt,cn=ln*he;return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"relative h-48 w-48",children:[o.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[o.jsx("circle",{cx:"64",cy:"64",r:Ht,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),o.jsx("circle",{cx:"64",cy:"64",r:Ht,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:ln,strokeDashoffset:Ua,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),J.summary.notIndexed>0&&o.jsx("circle",{cx:"64",cy:"64",r:Ht,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${ms} ${ln-ms}`,strokeDashoffset:-cn,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[o.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(he*100).toFixed(0),"%"]}),o.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),o.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:J.summary.indexed.toLocaleString()}),o.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),o.jsx("div",{className:"h-8 w-px bg-zinc-800"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:J.summary.notIndexed.toLocaleString()}),o.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(J.reasonGroups??[]).length>0&&o.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(J.reasonGroups??[]).length," ",(J.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),J.summary.deindexed>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-8 w-px bg-zinc-800"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:J.summary.deindexed.toLocaleString()}),o.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),o.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(I=>{const he=I==="indexed"?J.indexed.length:I==="notIndexed"?J.notIndexed.length:J.deindexed.length,xt=I==="indexed"?"Indexed":I==="notIndexed"?"Not Indexed":"Deindexed";return o.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${_t===I?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{re(I),Qe(null)},children:[xt," (",he,")"]},I)})}),o.jsxs("div",{className:"mt-3 overflow-x-auto",children:[_t==="indexed"&&J.indexed.length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Verdict"}),o.jsx("th",{className:"text-left",children:"Last Crawl"}),o.jsx("th",{className:"text-left",children:"Mobile"})]})}),o.jsx("tbody",{children:J.indexed.map(I=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),o.jsx("td",{className:"text-zinc-400",children:I.verdict??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:I.crawlTime?I.crawlTime.split("T")[0]:"—"}),o.jsx("td",{className:"text-zinc-400",children:I.isMobileFriendly===!0?"Yes":I.isMobileFriendly===!1?"No":"—"})]},I.id))})]}),_t==="notIndexed"&&!Vt&&(J.reasonGroups??[]).length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"Reason"}),o.jsx("th",{className:"text-right",children:"Pages"})]})}),o.jsx("tbody",{children:(J.reasonGroups??[]).map(I=>o.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Qe(I.reason),children:[o.jsx("td",{className:"text-zinc-200",children:I.reason}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:I.count})]},I.reason))})]}),_t==="notIndexed"&&!Vt&&(J.reasonGroups??[]).length===0&&J.notIndexed.length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Indexing State"}),o.jsx("th",{className:"text-left",children:"Coverage"})]})}),o.jsx("tbody",{children:J.notIndexed.map(I=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),o.jsx("td",{className:"text-zinc-400",children:I.indexingState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:I.coverageState??"Unknown"})]},I.id))})]}),_t==="notIndexed"&&Vt&&(()=>{const I=(J.reasonGroups??[]).find(he=>he.reason===Vt);return I?o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center gap-2 mb-3",children:o.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Qe(null),children:"\\u2190 Back to reasons"})}),o.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-zinc-200",children:I.reason}),o.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[I.count," affected page",I.count!==1?"s":""]})]}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:De,onClick:()=>{Ki(I.urls.map(he=>he.url))},children:De?"Requesting…":`Request indexing (${I.count})`})]}),o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Last Crawl"}),o.jsx("th",{className:"w-8"})]})}),o.jsx("tbody",{children:I.urls.map(he=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:he.url}),o.jsx("td",{className:"text-zinc-400",children:he.crawlTime?he.crawlTime.split("T")[0]:"—"}),o.jsx("td",{children:o.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:De,onClick:()=>{Ki([he.url])},title:"Request indexing",children:"Index"})})]},he.id))})]})]}):null})(),_t==="deindexed"&&J.deindexed.length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Previous"}),o.jsx("th",{className:"text-left",children:"Current"}),o.jsx("th",{className:"text-left",children:"Detected"})]})}),o.jsx("tbody",{children:J.deindexed.map((I,he)=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),o.jsx("td",{className:"text-zinc-400",children:I.previousState}),o.jsx("td",{className:"text-zinc-400",children:I.currentState}),o.jsx("td",{className:"text-zinc-400",children:I.transitionDate.split("T")[0]})]},`${I.url}-${he}`))})]}),(_t==="indexed"&&J.indexed.length===0||_t==="notIndexed"&&!Vt&&J.notIndexed.length===0||_t==="deindexed"&&J.deindexed.length===0)&&o.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:ye?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),o.jsx("h3",{children:"Search performance"})]}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:V,onClick:()=>{kn()},children:V?"Loading…":"Apply filters"})]}),f.length>0&&(()=>{const I=new Map;for(const Me of f){const Je=I.get(Me.date);Je?(Je.clicks+=Me.clicks,Je.impressions+=Me.impressions):I.set(Me.date,{clicks:Me.clicks,impressions:Me.impressions})}const he=[...I.entries()].sort(([Me],[Je])=>Me.localeCompare(Je));if(he.length===0)return null;const xt=Math.max(...he.map(([,Me])=>Me.impressions),1),Ht=he.reduce((Me,[,Je])=>Me+Je.clicks,0),ln=he.reduce((Me,[,Je])=>Me+Je.impressions,0),Ua=ln>0?(Ht/ln*100).toFixed(1):"0.0",ms=700,cn=220,st={top:12,bottom:36,left:48,right:12},sn=ms-st.left-st.right,zn=cn-st.top-st.bottom,ks=sn/he.length,Ia=Math.max(Math.min(ks*.35,24),4),Cl=Math.max(Ia*.15,1),kl=Me=>{if(Me<=0)return 1;const Je=Math.pow(10,Math.floor(Math.log10(Me))),it=Me/Je,ns=it<=1.5?1.5:it<=3?3:it<=5?5:10;return Math.ceil(ns*Je)},ps=4,Js=Math.ceil(kl(xt)/ps)*ps,Xs=Array.from({length:ps+1},(Me,Je)=>Js/ps*Je),Ws=Me=>Me>=1e3?`${(Me/1e3).toFixed(Me>=1e4?0:1)}k`:String(Me);return o.jsxs("div",{className:"mt-3",children:[o.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),o.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",o.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Ht.toLocaleString()})]})]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),o.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",o.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:ln.toLocaleString()})]})]}),o.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",o.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Ua,"%"]})]})]}),o.jsx("div",{className:"relative w-full",style:{aspectRatio:`${ms} / ${cn}`},children:o.jsxs("svg",{viewBox:`0 0 ${ms} ${cn}`,className:"h-full w-full",children:[Xs.map((Me,Je)=>{const it=st.top+zn-Me/Js*zn;return o.jsxs("g",{children:[o.jsx("line",{x1:st.left,y1:it,x2:ms-st.right,y2:it,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),o.jsx("text",{x:st.left-6,y:it+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Ws(Me)})]},`t-${Je}`)}),he.map(([Me,Je],it)=>{const ns=st.left+ks*it+ks/2,Fi=Je.impressions/Js*zn,gs=Je.clicks/Js*zn;return o.jsxs("g",{children:[o.jsx("title",{children:`${Me}
234
234
  Clicks: ${Je.clicks}
235
235
  Impressions: ${Je.impressions}
236
- CTR: ${Je.impressions>0?(Je.clicks/Je.impressions*100).toFixed(1):0}%`}),o.jsx("rect",{x:ns-Ia-Cl/2,y:st.top+zn-Fi,width:Ia,height:Math.max(Fi,1),rx:2,fill:"#3b82f6",opacity:.85}),o.jsx("rect",{x:ns+Cl/2,y:st.top+zn-gs,width:Ia,height:Math.max(gs,1),rx:2,fill:"#10b981",opacity:.85})]},Me)}),(()=>{const Me=Math.min(he.length,7);return Array.from({length:Me},(Je,it)=>{const ns=he.length===1?0:Math.round(it/(Me-1)*(he.length-1)),Fi=st.left+ks*ns+ks/2;return o.jsx("text",{x:Fi,y:cn-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:he[ns][0].slice(5)},`xl-${ns}`)})})()]})})]})})(),o.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:E.startDate,onChange:I=>L(he=>({...he,startDate:I.target.value}))}),o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:E.endDate,onChange:I=>L(he=>({...he,endDate:I.target.value}))}),o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter query",value:E.query,onChange:I=>L(he=>({...he,query:I.target.value}))}),o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter page",value:E.page,onChange:I=>L(he=>({...he,page:I.target.value}))}),o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"number",min:"1",placeholder:"Limit",value:E.limit,onChange:I=>L(he=>({...he,limit:I.target.value}))})]}),f.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"Date"}),o.jsx("th",{className:"text-left",children:"Query"}),o.jsx("th",{className:"text-left",children:"Page"}),o.jsx("th",{className:"text-right",children:"Clicks"}),o.jsx("th",{className:"text-right",children:"Impressions"}),o.jsx("th",{className:"text-right",children:"CTR"}),o.jsx("th",{className:"text-right",children:"Position"})]})}),o.jsx("tbody",{children:f.map((I,he)=>o.jsxs("tr",{children:[o.jsx("td",{className:"text-zinc-400",children:I.date}),o.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:I.query}),o.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:I.page}),o.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:I.clicks.toLocaleString()}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:I.impressions.toLocaleString()}),o.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(I.ctr*100).toFixed(1),"%"]}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:I.position.toFixed(1)})]},`${I.date}:${I.query}:${I.page}:${he}`))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),o.jsx("h3",{children:"Inspect a URL"})]})}),o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://example.com/page",value:k,onChange:I=>A(I.target.value),onKeyDown:I=>I.key==="Enter"&&void Nl()}),o.jsx(oe,{type:"button",size:"sm",disabled:se||!nt?.propertyId||!k.trim(),onClick:Nl,children:se?"Inspecting…":"Inspect URL"})]}),b&&o.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:b.indexingState??"Unknown"})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:b.verdict??"Unknown"})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Wx(b.isMobileFriendly)})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ls(b.crawlTime)})]})]})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),o.jsx("h3",{children:"Inspection log"})]}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:T,onClick:()=>{Ma()},children:T?"Loading…":"Refresh history"})]}),o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter exact URL",value:U,onChange:I=>X(I.target.value)}),o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:T,onClick:()=>{Ma()},children:"Apply filter"})]}),p.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Indexing"}),o.jsx("th",{className:"text-left",children:"Verdict"}),o.jsx("th",{className:"text-left",children:"Coverage"}),o.jsx("th",{className:"text-left",children:"Mobile"}),o.jsx("th",{className:"text-left",children:"Inspected"})]})}),o.jsx("tbody",{children:p.map(I=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),o.jsx("td",{className:"text-zinc-300",children:I.indexingState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:I.verdict??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:I.coverageState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:Wx(I.isMobileFriendly)}),o.jsx("td",{className:"text-zinc-400",children:ls(I.inspectedAt)})]},I.id))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),o.jsx("h3",{children:"Recent indexing losses"})]})}),y.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Previous"}),o.jsx("th",{className:"text-left",children:"Current"}),o.jsx("th",{className:"text-left",children:"Changed at"})]})}),o.jsx("tbody",{children:y.map(I=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),o.jsx("td",{className:"text-zinc-400",children:I.previousState??"Unknown"}),o.jsx("td",{className:"text-zinc-300",children:I.currentState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:ls(I.transitionDate)})]},`${I.url}:${I.transitionDate}`))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),nt&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:o.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>nn(I=>!I),children:[o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:`h-4 w-4 text-zinc-500 transition-transform ${Dn?"rotate-90":""}`,"aria-hidden":"true",children:o.jsx("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",clipRule:"evenodd"})}),o.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),Dn&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),o.jsx("h3",{children:"Pick the Search Console property"})]})}),o.jsxs("div",{className:"mt-3 space-y-2",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),o.jsx("select",{id:`gsc-property-${e}`,className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:S,disabled:je||c.length===0,onChange:I=>C(I.target.value),children:c.length===0?o.jsx("option",{value:"",children:je?"Loading properties…":"No properties available"}):c.map(I=>o.jsxs("option",{value:I.siteUrl,children:[I.siteUrl," · ",I.permissionLevel]},I.siteUrl))}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:je,onClick:()=>{ce(nt)},children:je?"Refreshing…":"Refresh properties"}),o.jsx(oe,{type:"button",size:"sm",disabled:!S||ae,onClick:Jr,children:ae?"Saving…":"Save property"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),o.jsx("h3",{children:"Import GSC performance data"})]})}),o.jsxs("div",{className:"mt-3 space-y-3",children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),o.jsx("input",{id:`gsc-sync-days-${e}`,type:"number",min:"1",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",value:R,onChange:I=>z(I.target.value)})]}),o.jsxs("label",{className:"flex items-center gap-2 rounded border border-zinc-800/60 bg-zinc-900/20 px-3 py-2 text-sm text-zinc-300",children:[o.jsx("input",{type:"checkbox",checked:O,onChange:I=>M(I.target.checked)}),"Replace existing imported rows for the requested range"]})]}),o.jsx(oe,{type:"button",size:"sm",disabled:ts.isPending||!nt.propertyId,onClick:Gi,children:ts.isPending?"Queueing…":"Queue sync"}),!nt.propertyId&&o.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),o.jsx("h3",{children:"Sitemap configuration"})]})}),o.jsxs("div",{className:"mt-3 space-y-3",children:[nt.sitemapUrl&&o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:nt.sitemapUrl})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:ge||!nt.propertyId,onClick:()=>{Pa()},children:ge?"Loading…":"Browse sitemaps from GSC"}),o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:ht.isPending||!nt.propertyId,onClick:hs,children:ht.isPending?"Discovering…":"Auto-discover and queue inspection"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:"Browse lists available sitemaps without queueing a run. Auto-discover saves the primary sitemap and queues an inspection."}),et&&et.length>0&&o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[o.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",et.length,")"]}),et.map(I=>{const he=I.contents?.[0];return o.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-zinc-200 break-all",children:I.path}),I.lastSubmitted&&o.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",I.lastSubmitted.split("T")[0]]})]}),o.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[he&&o.jsxs("div",{className:"text-right",children:[o.jsxs("p",{className:"text-zinc-300",children:[he.indexed," / ",he.submitted]}),o.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),o.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>at(I.path),children:"Use"})]})]},I.path)})]}),o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:nt.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Ve,onChange:I=>at(I.target.value),onKeyDown:I=>I.key==="Enter"&&Ve.trim()&&void Cs()}),o.jsx(oe,{type:"button",size:"sm",disabled:Zt||!Ve.trim(),onClick:Cs,children:Zt?"Saving…":nt.sitemapUrl?"Update":"Save"})]}),o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"Sitemap URL for inspection (leave empty for saved default)",id:`gsc-sitemap-inspect-${e}`}),o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:gn.isPending||!nt.propertyId,onClick:async()=>{const he=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||nt.sitemapUrl||void 0;Be(null),pn(null);try{await gn.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:he}})}catch{}},children:gn.isPending?"Queueing…":"Inspect sitemap"})]}),!nt.propertyId&&o.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function m$({project:e,onUpdateProject:t,onRefresh:s}){const[a,r]=w.useState(!1),[c,u]=w.useState(!1),[f,m]=w.useState(null),[p,v]=w.useState(e.displayName),[y,x]=w.useState(e.canonicalDomain),[b,N]=w.useState(e.country),[S,C]=w.useState(e.language),[k,A]=w.useState(e.ownedDomains??[]),[R,z]=w.useState(""),[O,M]=w.useState(null),[E,L]=w.useState(!1),[U,X]=w.useState(!1),[Q,ee]=w.useState(""),[ue,ze]=w.useState(""),[je,K]=w.useState(""),[ae,me]=w.useState(""),[V,H]=w.useState("");w.useEffect(()=>{a||(v(e.displayName),x(e.canonicalDomain),N(e.country),C(e.language),A(e.ownedDomains??[]))},[e,a]);function T(){r(!1),m(null),v(e.displayName),x(e.canonicalDomain),N(e.country),C(e.language),A(e.ownedDomains??[]),z("")}function B(){const de=R.trim();de&&(k.includes(de)||A([...k,de]),z(""))}function se(de){A(k.filter(Ve=>Ve!==de))}async function le(){if(!(!p.trim()||!y.trim()||!b.trim()||!S.trim())){u(!0),m(null);try{await t(e.name,{displayName:p.trim(),canonicalDomain:y.trim(),ownedDomains:k,country:b.trim(),language:S.trim()}),r(!1),Ke({title:"Project settings saved",detail:`${p.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(de){m(de instanceof Error?de.message:"Failed to save")}finally{u(!1)}}}async function J(){const de=Q.trim(),Ve=ue.trim(),at=je.trim(),Zt=ae.trim();if(!(!de||!Ve||!at||!Zt)){L(!0),M(null);try{const $t={label:de,city:Ve,region:at,country:Zt};V.trim()&&($t.timezone=V.trim()),await Y_(e.name,$t),s(),ee(""),ze(""),K(""),me(""),H(""),X(!1),Ke({title:"Location added",detail:`${de} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${de}`,dedupeMode:"drop"})}catch($t){M($t instanceof Error?$t.message:"Failed to add location")}finally{L(!1)}}}async function fe(de){L(!0),M(null);try{await J_(e.name,de),s(),Ke({title:"Location removed",detail:`${de} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${de}`,dedupeMode:"drop"})}catch(Ve){M(Ve instanceof Error?Ve.message:"Failed to remove location")}finally{L(!1)}}async function ye(de){L(!0),M(null);try{await X_(e.name,de),s(),Ke({title:"Default location updated",detail:`${de} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Ve){M(Ve instanceof Error?Ve.message:"Failed to set default location")}finally{L(!1)}}const _e=p!==e.displayName||y!==e.canonicalDomain||b!==e.country||S!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[]),ge="w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",Ze="block text-xs font-medium text-zinc-400 mb-1",et=Q.trim()&&ue.trim()&&je.trim()&&ae.trim();return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),o.jsx("h2",{children:"Project settings"})]}),!a&&o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),children:"Edit settings"})]}),f&&o.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[f,o.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>m(null),children:"×"})]}),a?o.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Display name"}),o.jsx("input",{className:ge,type:"text",value:p,onChange:de=>v(de.target.value),placeholder:"My Project"})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Canonical domain"}),o.jsx("input",{className:ge,type:"text",value:y,onChange:de=>x(de.target.value),placeholder:"example.com"})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Country"}),o.jsx("input",{className:ge,type:"text",value:b,onChange:de=>N(de.target.value),placeholder:"US",maxLength:2})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Language"}),o.jsx("input",{className:ge,type:"text",value:S,onChange:de=>C(de.target.value),placeholder:"en"})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Owned domains"}),o.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(de=>o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[de,o.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>se(de),"aria-label":`Remove ${de}`,children:"×"})]},de))}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{className:`${ge} flex-1`,type:"text",placeholder:"docs.example.com",value:R,onChange:de=>z(de.target.value),onKeyDown:de=>de.key==="Enter"&&(de.preventDefault(),B())}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:!R.trim(),onClick:B,children:"Add"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[o.jsx(oe,{type:"button",disabled:c||!_e||!p.trim()||!y.trim(),onClick:le,children:c?"Saving...":"Save changes"}),o.jsx(oe,{type:"button",variant:"outline",disabled:c,onClick:T,children:"Cancel"})]})]}):o.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:o.jsx("table",{className:"w-full text-sm",children:o.jsxs("tbody",{children:[o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),o.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?o.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(de=>o.jsx("span",{className:"rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:de},de))}):o.jsx("span",{className:"text-zinc-500",children:"—"})})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),o.jsxs("tr",{children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),o.jsxs("td",{className:"px-4 py-2.5",children:[O&&o.jsxs("div",{className:"mb-2 rounded border border-rose-800/40 bg-rose-950/20 px-2 py-1 text-xs text-rose-300",children:[O,o.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>M(null),children:"×"})]}),(e.locations??[]).length>0?o.jsxs("table",{className:"w-full text-xs mb-2",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-zinc-600",children:[o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),o.jsx("th",{className:"pb-1"})]})}),o.jsx("tbody",{children:e.locations.map(de=>o.jsxs("tr",{className:"border-t border-zinc-800/30",children:[o.jsx("td",{className:"py-1.5 pr-3",children:o.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${de.label===e.defaultLocation?"border-emerald-700/60 bg-emerald-950/30 text-emerald-300":"border-zinc-700/60 bg-zinc-800/40 text-zinc-300"}`,children:[de.label,de.label===e.defaultLocation?" ★":""]})}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:de.city}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:de.region}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:de.country}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:de.timezone??"—"}),o.jsx("td",{className:"py-1.5",children:o.jsxs("div",{className:"flex items-center gap-1.5",children:[de.label!==e.defaultLocation&&o.jsx("button",{type:"button",disabled:E,onClick:()=>ye(de.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${de.label} as default location`,children:"Set default"}),o.jsx("button",{type:"button",disabled:E,onClick:()=>fe(de.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${de.label}`,children:"Remove"})]})})]},de.label))})]}):o.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),U?o.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[o.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),o.jsx("input",{className:ge,type:"text",value:Q,onChange:de=>ee(de.target.value),placeholder:"nyc"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),o.jsx("input",{className:ge,type:"text",value:ue,onChange:de=>ze(de.target.value),placeholder:"New York"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),o.jsx("input",{className:ge,type:"text",value:je,onChange:de=>K(de.target.value),placeholder:"NY"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),o.jsx("input",{className:ge,type:"text",value:ae,onChange:de=>me(de.target.value),placeholder:"US",maxLength:2})]}),o.jsxs("div",{className:"col-span-2",children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),o.jsx("input",{className:ge,type:"text",value:V,onChange:de=>H(de.target.value),placeholder:"America/New_York"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[o.jsx(oe,{type:"button",size:"sm",disabled:E||!et,onClick:J,children:E?"Adding...":"Add location"}),o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:E,onClick:()=>{X(!1),M(null)},children:"Cancel"})]})]}):o.jsx(oe,{type:"button",size:"sm",variant:"outline",onClick:()=>X(!0),children:"+ Add location"})]})]})]})})})]})}const p$=[{value:"daily",label:"Every day"},{value:"weekly@mon",label:"Every Monday"},{value:"weekly@wed",label:"Every Wednesday"},{value:"weekly@fri",label:"Every Friday"},{value:"twice-daily",label:"Twice a day (6am & 6pm)"},{value:"custom",label:"Custom cron expression"}],dS=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","America/Toronto","America/Vancouver","Europe/London","Europe/Paris","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Asia/Singapore","Australia/Sydney"];function g$({projectName:e}){const[t,s]=w.useState("loading"),[a,r]=w.useState(!1),[c,u]=w.useState("daily"),[f,m]=w.useState(6),[p,v]=w.useState(""),[y,x]=w.useState("UTC"),[b,N]=w.useState(!1),[S,C]=w.useState(""),[k,A]=w.useState(!1),[R,z]=w.useState(!1),[O,M]=w.useState(null);w.useEffect(()=>{r2(e).then(s).catch(()=>s(null))},[e]);const E=()=>{if(t&&t!=="loading"){const Q=AE(t.preset??null,t.cronExpr);u(Q.freq),m(Q.hour),v(Q.customCron);const ee=dS.includes(t.timezone);x(ee?t.timezone:"Other"),N(!ee),C(ee?"":t.timezone)}else u("daily"),m(6),v(""),x("UTC"),N(!1),C("");M(null),r(!0)},L=async()=>{A(!0),M(null);try{const ee={timezone:b?S.trim()||"UTC":y};c==="custom"?ee.cron=p.trim():ee.preset=RE(c,f);const ue=await qx(e,ee);s(ue),r(!1),Ke({title:"Schedule saved",detail:Gh(ue.preset??null,ue.cronExpr,ue.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(Q){M(Q instanceof Error?Q.message:"Failed to save schedule")}finally{A(!1)}},U=async()=>{if(!(!t||t==="loading")){A(!0),M(null);try{const Q={timezone:t.timezone,enabled:!t.enabled};t.preset?Q.preset=t.preset:Q.cron=t.cronExpr;const ee=await qx(e,Q);s(ee),Ke({title:ee.enabled?"Schedule resumed":"Schedule paused",detail:Gh(ee.preset??null,ee.cronExpr,ee.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(Q){M(Q instanceof Error?Q.message:"Failed to update schedule")}finally{A(!1)}}},X=async()=>{z(!0),M(null);try{await o2(e),s(null),r(!1),Ke({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch(Q){M(Q instanceof Error?Q.message:"Failed to remove schedule")}finally{z(!1)}};return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),o.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!a&&o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:E,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&o.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!a&&t===null&&o.jsx(Le,{className:"surface-card compact-card",children:o.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!a&&t!==null&&o.jsxs(Le,{className:"surface-card compact-card",children:[o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Gh(t.preset??null,t.cronExpr,t.timezone)}),o.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",o.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&o.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&o.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),o.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[o.jsx(lt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:U,children:t.enabled?"Pause":"Resume"}),o.jsx(oe,{type:"button",variant:"ghost",size:"sm",disabled:R,onClick:X,children:R?"Removing...":"Remove"})]})]}),O&&o.jsx("p",{className:"text-rose-400 text-sm mt-2",children:O})]}),a&&o.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),o.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:c,onChange:Q=>u(Q.target.value),children:p$.map(Q=>o.jsx("option",{value:Q.value,children:Q.label},Q.value))})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),o.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none disabled:opacity-40",value:f,disabled:c==="twice-daily"||c==="custom",onChange:Q=>m(parseInt(Q.target.value)),children:Array.from({length:24},(Q,ee)=>o.jsx("option",{value:ee,children:Am(ee)},ee))})]})]}),c==="custom"&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),o.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 font-mono focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"0 9 * * 1-5",value:p,onChange:Q=>v(Q.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),o.jsxs("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:b?"Other":y,onChange:Q=>{Q.target.value==="Other"?(N(!0),x("Other")):(N(!1),x(Q.target.value))},children:[dS.map(Q=>o.jsx("option",{value:Q,children:Q},Q)),o.jsx("option",{value:"Other",children:"Other (enter manually)\\u2026"})]}),b&&o.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"e.g. America/New_York",value:S,onChange:Q=>C(Q.target.value)})]}),O&&o.jsx("p",{className:"text-rose-400 text-sm",children:O}),o.jsxs("div",{className:"flex gap-2 justify-end",children:[o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),M(null)},children:"Cancel"}),o.jsx(oe,{type:"button",size:"sm",disabled:k||c==="custom"&&!p.trim(),onClick:L,children:k?"Saving...":"Save schedule"})]})]})]})}const y$=[{value:"citation.lost",label:"Citation lost"},{value:"citation.gained",label:"Citation gained"},{value:"run.completed",label:"Run completed"},{value:"run.failed",label:"Run failed"}];function v$({projectName:e}){const[t,s]=w.useState("loading"),[a,r]=w.useState(!1),[c,u]=w.useState(""),[f,m]=w.useState(["citation.lost","citation.gained"]),[p,v]=w.useState(!1),[y,x]=w.useState(null),[b,N]=w.useState({});w.useEffect(()=>{l2(e).then(s).catch(()=>s([]))},[e]);const S=R=>{m(z=>z.includes(R)?z.filter(O=>O!==R):[...z,R])},C=async()=>{if(!(!c.trim()||f.length===0)){v(!0),x(null);try{const R=await c2(e,{channel:"webhook",url:c.trim(),events:f});s(z=>z==="loading"?[R]:[...z,R]),u(""),m(["citation.lost","citation.gained"]),r(!1),Ke({title:"Webhook added",detail:`Notifications will be sent to ${R.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(R){x(R instanceof Error?R.message:"Failed to add webhook")}finally{v(!1)}}},k=async R=>{try{await u2(e,R),s(z=>z==="loading"?z:z.filter(O=>O.id!==R)),Ke({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${R}`,dedupeMode:"drop"})}catch(z){x(z instanceof Error?z.message:"Failed to remove webhook")}},A=async R=>{N(z=>({...z,[R]:{state:"testing"}}));try{const z=await d2(e,R);N(O=>({...O,[R]:{state:z.ok?"ok":"fail",status:z.status}})),z.ok&&Ke({title:"Test notification sent",detail:`Webhook returned status ${z.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${R}`,dedupeMode:"replace"})}catch{N(z=>({...z,[R]:{state:"fail"}}))}};return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),o.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!a),x(null)},children:a?"Cancel":"+ Add webhook"})]}),a&&o.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),o.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://hooks.example.com/canonry",value:c,onChange:R=>u(R.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),o.jsx("div",{className:"flex flex-wrap gap-3",children:y$.map(R=>o.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[o.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:f.includes(R.value),onChange:()=>S(R.value)}),o.jsx("span",{className:"text-sm text-zinc-300",children:R.label})]},R.value))})]}),y&&o.jsx("p",{className:"text-rose-400 text-sm",children:y}),o.jsxs("div",{className:"flex gap-2 justify-end",children:[o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),x(null)},children:"Cancel"}),o.jsx(oe,{type:"button",size:"sm",disabled:p||!c.trim()||f.length===0,onClick:C,children:p?"Adding...":"Add webhook"})]})]}),t==="loading"&&o.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!a&&o.jsx(Le,{className:"surface-card compact-card",children:o.jsx("p",{className:"supporting-copy",children:"No webhooks configured. Add one to get alerted when citations change or runs complete."})}),t!=="loading"&&t.length>0&&o.jsxs("div",{className:"evidence-table-wrap",children:[o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Endpoint"}),o.jsx("th",{children:"Events"}),o.jsx("th",{children:"Status"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:t.map(R=>o.jsxs("tr",{children:[o.jsx("td",{className:"evidence-keyword-cell",children:o.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:R.urlHost,children:R.urlDisplay??R.url})}),o.jsx("td",{children:o.jsx("div",{className:"flex flex-wrap gap-1",children:R.events.map(z=>o.jsx("span",{className:"inline-flex items-center rounded-full border border-zinc-700 bg-zinc-800/60 px-2 py-0.5 text-[10px] font-medium text-zinc-400 uppercase tracking-wide",children:z.replace("."," ")},z))})}),o.jsx("td",{children:o.jsx(lt,{tone:R.enabled?"positive":"neutral",children:R.enabled?"Active":"Paused"})}),o.jsx("td",{children:o.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[b[R.id]&&(()=>{const z=b[R.id],O=z.state==="testing"?"Sending…":z.state==="ok"?`Delivered${z.status?` (${z.status})`:""}`:`Failed${z.status?` (${z.status})`:""}`;return o.jsx(lt,{tone:z.state==="ok"?"positive":z.state==="fail"?"negative":"neutral",children:O})})(),o.jsx(oe,{variant:"ghost",size:"sm",type:"button",disabled:b[R.id]?.state==="testing",onClick:()=>A(R.id),children:"Test"}),o.jsx(oe,{variant:"ghost",size:"sm",type:"button",onClick:()=>k(R.id),children:"Remove"})]})})]},R.id))})]}),y&&o.jsx("p",{className:"text-rose-400 text-sm mt-2",children:y})]})]})}function fS({eyebrow:e,title:t,status:s,tone:a,targetLabel:r,targetValue:c,coverageValue:u,note:f,updatedAt:m,active:p,onClick:v}){return o.jsxs("button",{type:"button",onClick:v,className:`surface-card w-full text-left transition-colors ${p?"border-zinc-200 bg-zinc-900/50":"hover:border-zinc-700 hover:bg-zinc-900/40"}`,children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),o.jsx("h3",{children:t})]}),o.jsx(lt,{tone:a,children:s})]}),o.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:r}),o.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:c})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:u})]})]}),o.jsxs("div",{className:"mt-3 flex flex-col gap-1 text-xs text-zinc-500 sm:flex-row sm:items-center sm:justify-between",children:[o.jsx("span",{children:f}),o.jsx("span",{children:m?`Updated ${ls(m)}`:"No recent sync yet"})]})]})}function ru({label:e,value:t,tone:s}){const a=s==="positive"?"text-emerald-400":s==="negative"?"text-rose-400":"text-zinc-200";return o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),o.jsx("p",{className:`mt-2 text-2xl font-semibold ${a}`,children:t})]})}function x$({projectName:e}){const[t,s]=w.useState(null),[a,r]=w.useState([]),[c,u]=w.useState(null),[f,m]=w.useState([]),[p,v]=w.useState([]),[y,x]=w.useState(null),[b,N]=w.useState(""),[S,C]=w.useState(""),[k,A]=w.useState(""),[R,z]=w.useState(!0),[O,M]=w.useState(!1),[E,L]=w.useState(null),[U,X]=w.useState("coverage");w.useEffect(()=>{Q()},[e]);async function Q(){z(!0),L(null);try{const V=await ij(e);if(s(V),V.connected){const[H,T,B]=await Promise.all([wp(e).catch(()=>null),aj(e).catch(()=>[]),O2(e).catch(()=>[])]);H&&u(H),m(T),v(B)}}catch(V){L(V instanceof Error?V.message:"Failed to load Bing data")}finally{z(!1)}}async function ee(){if(S.trim()){L(null);try{const V=await E2(e,S.trim());C(""),V.availableSites.length>0&&r(V.availableSites),await Q()}catch(V){L(V instanceof Error?V.message:"Failed to connect")}}}async function ue(){try{await R2(e),s(null),r([]),u(null),m([]),v([]),x(null),A(""),L(null)}catch(V){L(V instanceof Error?V.message:"Failed to disconnect")}}async function ze(){if(k)try{await T2(e,k),await Q()}catch(V){L(V instanceof Error?V.message:"Failed to set site")}}async function je(){if(b.trim())try{const V=await rj(e,b.trim());x(V),m(H=>[V,...H])}catch(V){L(V instanceof Error?V.message:"Inspection failed")}}async function K(V){M(!0),L(null);try{const H=await Gx(e,{urls:[V]}),{succeeded:T,failed:B,total:se}=H.summary;Ke({title:"Bing submission requested",detail:B===0?`${T} URL submitted to Bing.`:`${T}/${se} submitted successfully, ${B} failed.`,tone:B===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${V}`,dedupeMode:"replace"})}catch(H){const T=H instanceof Error?H.message:"Submission failed";L(T),Ke({title:"Bing submission failed",detail:T,tone:"negative",dedupeKey:`bing:indexing:${e}:${V}`,dedupeMode:"replace"})}finally{M(!1)}}async function ae(){M(!0),L(null),Ke({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const V=await Gx(e,{allUnindexed:!0}),{succeeded:H,failed:T,total:B}=V.summary;Ke({title:"Bing submissions requested",detail:T===0?`${H}/${B} URL${B!==1?"s":""} submitted to Bing.`:`${H}/${B} submitted successfully, ${T} failed.`,tone:T===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(V){const H=V instanceof Error?V.message:"Batch submission failed";L(H),Ke({title:"Bing submissions failed",detail:H,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{M(!1)}}if(R)return o.jsx(Le,{className:"surface-card",children:o.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!t?.connected)return o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsx(lt,{tone:"caution",children:"Not connected"})]}),o.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),o.jsxs("div",{className:"mt-3",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),o.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[o.jsx("input",{id:"bing-api-key",type:"password",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:S,onChange:V=>C(V.target.value),onKeyDown:V=>V.key==="Enter"&&ee()}),o.jsx(oe,{size:"sm",disabled:!S.trim(),onClick:ee,children:"Connect"})]}),o.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",o.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]})]}),E&&o.jsx("p",{className:"mt-3 text-xs text-rose-400",children:E})]});if(!t.siteUrl)return o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(lt,{tone:"positive",children:"Connected"}),o.jsx(oe,{size:"sm",variant:"ghost",onClick:ue,children:"Disconnect"})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),o.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),o.jsx("span",{className:"text-xs text-zinc-500",children:t.domain})]}),o.jsx("p",{className:"mt-2 text-xs text-zinc-500",children:"The API key is connected, but no Bing site is selected yet. Pick the verified site that should receive inspections and indexing requests."})]}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.domain})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.updatedAt?ls(t.updatedAt):"—"})]})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),a.length>0?o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.jsxs("select",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:k,onChange:V=>A(V.target.value),children:[o.jsx("option",{value:"",children:"Select a site..."}),a.map(V=>o.jsxs("option",{value:V.url,children:[V.url,V.verified?" (verified)":""]},V.url))]}),o.jsx(oe,{size:"sm",disabled:!k,onClick:ze,children:"Set Site"})]}):o.jsx("div",{className:"mt-3",children:o.jsx(oe,{size:"sm",onClick:async()=>{const V=await A2(e);r(V.sites)},children:"Load Sites"})})]})]}),E&&o.jsx("p",{className:"mt-3 text-xs text-rose-400",children:E})]});const me=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return o.jsxs("div",{className:"space-y-3",children:[o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(lt,{tone:"positive",children:"Connected"}),o.jsx(oe,{size:"sm",variant:"ghost",onClick:ue,children:"Disconnect"})]})]}),E&&o.jsx("p",{className:"mb-3 text-xs text-rose-400",children:E}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),o.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),o.jsx("span",{className:"text-xs text-zinc-500",children:t.domain})]}),o.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",o.jsx("code",{children:t.siteUrl}),"."]})]}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.siteUrl})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.updatedAt?ls(t.updatedAt):"—"})]})]})]})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),o.jsx("h3",{children:"Index monitoring"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:c?.lastInspectedAt?`Last inspected ${ls(c.lastInspectedAt)}`:"No inspection history yet"})]}),o.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:me.map(V=>o.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${U===V.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>X(V.key),children:V.label},V.key))}),U==="coverage"&&c&&o.jsxs("div",{className:"mt-4 space-y-4",children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[o.jsx(ru,{label:"Indexed",value:c.summary.indexed,tone:"positive"}),o.jsx(ru,{label:"Not in index",value:c.summary.notIndexed+(c.summary.unknown??0),tone:"negative"}),o.jsx(ru,{label:"Status unknown",value:c.summary.unknown??0,tone:"neutral"}),o.jsx(ru,{label:"Coverage",value:`${c.summary.percentage}%`,tone:"neutral"})]}),c.notIndexed.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[o.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",c.notIndexed.length,")"]}),o.jsx(oe,{size:"sm",variant:"ghost",disabled:O,onClick:ae,children:O?"Submitting…":"Submit all to Bing"})]}),o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),o.jsx("tbody",{children:c.notIndexed.map(V=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:V.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:V.httpCode??"—"}),o.jsx("td",{className:"py-1.5 px-3 text-right",children:o.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:O,onClick:()=>K(V.url),children:"Submit"})})]},V.id))})]})})]}),(c.unknown??[]).length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[o.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(c.unknown??[]).length,")"]}),o.jsx(oe,{size:"sm",variant:"ghost",disabled:O,onClick:ae,children:O?"Submitting…":"Submit all to Bing"})]}),o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),o.jsx("tbody",{children:(c.unknown??[]).map(V=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:V.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:V.lastCrawledDate?ls(V.lastCrawledDate):"—"}),o.jsx("td",{className:"py-1.5 px-3 text-right",children:o.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:O,onClick:()=>K(V.url),children:"Submit"})})]},V.id))})]})})]}),c.indexed.length>0&&o.jsxs("div",{children:[o.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",c.indexed.length,")"]}),o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),o.jsx("tbody",{children:c.indexed.map(V=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:V.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:V.lastCrawledDate?ls(V.lastCrawledDate):"—"})]},V.id))})]})})]})]}),U==="coverage"&&!c&&o.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),U==="inspections"&&o.jsxs("div",{className:"mt-4 space-y-3",children:[o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{type:"text",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"URL to inspect",value:b,onChange:V=>N(V.target.value),onKeyDown:V=>V.key==="Enter"&&je()}),o.jsx(oe,{size:"sm",disabled:!b.trim(),onClick:je,children:"Inspect"})]}),y&&o.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[o.jsx("div",{className:"font-medium text-zinc-200",children:y.url}),o.jsxs("div",{className:"text-zinc-400",children:["In Index: ",o.jsx("span",{className:y.inIndex?"text-emerald-400":"text-rose-400",children:y.inIndex?"Yes":"No"})," · ","HTTP: ",y.httpCode??"—"," · ","Crawled: ",y.lastCrawledDate??"—"]})]}),f.length>0&&o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),o.jsx("tbody",{children:f.map(V=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:V.url}),o.jsx("td",{className:"py-1.5 px-3",children:o.jsx(lt,{tone:V.inIndex?"positive":"negative",children:V.inIndex?"Yes":"No"})}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:V.httpCode??"—"}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:ls(V.inspectedAt)})]},V.id))})]})})]}),U==="performance"&&o.jsx("div",{className:"mt-4",children:p.length===0?o.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Clicks"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Impr"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"CTR"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"Pos"})]})}),o.jsx("tbody",{children:p.map((V,H)=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:V.query}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:V.clicks}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:V.impressions}),o.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(V.ctr*100).toFixed(1),"%"]}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:V.averagePosition.toFixed(1)})]},H))})]})})})]})]})}function b$({projectName:e}){const[t,s]=w.useState("google"),[a,r]=w.useState(!0),[c,u]=w.useState("idle"),[f,m]=w.useState(null),p=w.useRef(null),[v,y]=w.useState(!1),[x,b]=w.useState(null),[N,S]=w.useState(null),[C,k]=w.useState(!1),[A,R]=w.useState(null),[z,O]=w.useState(null);async function M(V=!1){V||r(!0),m(null);try{const[H,T,B]=await Promise.all([Sp().catch(()=>null),nj(e).catch(()=>[]),ij(e).catch(()=>null)]),se=T.find(fe=>fe.connectionType==="gsc")??null;y(!!H?.google?.configured),k(!!H?.bing?.configured),b(se),R(B);const[le,J]=await Promise.all([se?jp(e).catch(()=>null):Promise.resolve(null),B?.connected?wp(e).catch(()=>null):Promise.resolve(null)]);S(le),O(J)}catch(H){m(H instanceof Error?H.message:"Failed to load search console overview")}finally{r(!1)}}async function E(){if(c!=="idle")return;p.current?.abort();const V=new AbortController;p.current=V;const H=V.signal;u("syncing"),m(null);const T=[];try{async function B(){if(!x)return;const fe=await sj(e);if(!fe?.id)return;const ye=2e3,ge=Date.now()+12e4;for(;Date.now()<ge;){if(H.aborted||(await new Promise(et=>setTimeout(et,ye)),H.aborted))return;const Ze=await Pr(fe.id).catch(()=>null);if(!Ze)break;if(["completed","failed","cancelled"].includes(Ze.status)){Ze.status!=="completed"&&T.push(`Google sync ${Ze.status}`);break}}}const se=10;async function le(){if(!A?.connected)return;const fe=await aj(e).catch(()=>[]),ye=[...new Set(fe.map(_e=>_e.url))];if(ye.length!==0)for(let _e=0;_e<ye.length;_e+=se){if(H.aborted)return;const ge=ye.slice(_e,_e+se),et=(await Promise.allSettled(ge.map(de=>rj(e,de)))).filter(de=>de.status==="rejected").length;et>0&&T.push(`${et} Bing inspection(s) failed`)}}const J=await Promise.allSettled([B(),le()]);for(const fe of J)fe.status==="rejected"&&T.push(fe.reason instanceof Error?fe.reason.message:"Sync failed");if(H.aborted)return;u("reloading"),await M(!0),T.length>0&&m(`Partial refresh: ${T.join("; ")}`)}catch(B){H.aborted||m(B instanceof Error?B.message:"Refresh failed")}finally{H.aborted||u("idle")}}w.useEffect(()=>(M(),()=>{p.current?.abort()}),[e]);const L=x?"positive":v?"caution":"negative",U=x?"Connected":v?"Ready to connect":"Needs setup",X=N?`${N.summary.percentage}% indexed`:x?"Awaiting coverage":"No coverage data",Q=N?`${N.summary.notIndexed} not indexed${N.summary.deindexed>0?` · ${N.summary.deindexed} deindexed`:""}`:x?"Run sitemap inspection to populate coverage":v?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",ee=N?.lastInspectedAt??x?.updatedAt??null,ue=A?.connected?"positive":C?"caution":"negative",ze=A?.connected?"Connected":C?"Ready to connect":"Needs setup",je=z?`${z.summary.percentage}% indexed`:A?.connected?"Awaiting coverage":"No coverage data",K=z?z.summary.notIndexed+(z.summary.unknown??0):0,ae=z?`${K} not in index`:A?.connected?"Inspect URLs to populate coverage":C?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",me=z?.lastInspectedAt??A?.updatedAt??null;return o.jsxs("div",{className:"space-y-6",children:[o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),o.jsx("h2",{children:"Search Engine Intelligence"}),o.jsx("p",{className:"mt-1 max-w-3xl text-sm leading-6 text-zinc-500",children:"Scan both engines at a glance, then open the Google or Bing workspace when you need to inspect coverage or take action."})]}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:a||c!=="idle",onClick:()=>{E()},children:a?"Loading…":c==="syncing"?"Querying Google & Bing…":c==="reloading"?"Reloading…":"Refresh overview"})]}),f&&o.jsx("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:f}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsx(fS,{eyebrow:"Google",title:"Google Search Console",status:a?"Loading…":U,tone:a?"neutral":L,targetLabel:"Selected property",targetValue:x?.propertyId??"No property selected",coverageValue:a?"Loading…":X,note:a?"Loading overview…":Q,updatedAt:ee,active:t==="google",onClick:()=>s("google")}),o.jsx(fS,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:a?"Loading…":ze,tone:a?"neutral":ue,targetLabel:"Selected site",targetValue:A?.siteUrl??"No site selected",coverageValue:a?"Loading…":je,note:a?"Loading overview…":ae,updatedAt:me,active:t==="bing",onClick:()=>s("bing")})]})]}),o.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([V,H])=>o.jsx("button",{type:"button",role:"tab","aria-selected":t===V,className:`project-subnav-link ${t===V?"project-subnav-link-active":""}`,onClick:()=>s(V),children:H},V))}),t==="google"&&o.jsx(h$,{projectName:e}),t==="bing"&&o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),o.jsx("h2",{children:"Bing Webmaster Tools"})]})}),o.jsx(x$,{projectName:e})]})]})}function S$({insights:e}){const{openEvidence:t}=Gr(),[s,a]=w.useState(null);return o.jsx("div",{className:"insight-list",children:e.map(r=>{const c=s===r.id,u=r.affectedPhrases.length>0;return o.jsxs("div",{children:[o.jsxs("div",{className:`insight-row insight-row-${r.tone} ${u?"cursor-pointer":""}`,onClick:u?()=>a(c?null:r.id):void 0,children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u&&o.jsx(Fu,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${c?"rotate-90":""}`}),o.jsx(lt,{tone:r.tone,children:r.actionLabel}),o.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:r.title}),o.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:r.detail})]}),u&&o.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[r.affectedPhrases.length," phrase",r.affectedPhrases.length>1?"s":""]})]}),c&&o.jsx("div",{className:"divide-y divide-zinc-800/20",children:r.affectedPhrases.map(f=>o.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Bm,{state:f.citationState}),o.jsx("span",{className:"text-sm text-zinc-200 truncate",children:f.keyword}),o.jsx("div",{className:"hidden sm:flex gap-1",children:f.provider&&o.jsx(al,{provider:f.provider})})]}),o.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:m=>{m.stopPropagation(),t(f.evidenceId)},children:"View →"})]},f.evidenceId))})]},r.id)})})}function vd({tab:e}){const{projectId:t}=Hu({from:"/projects/$projectId"}),s=Ii(),{dashboard:a,isLoading:r,refetch:c}=Oa();if(!a||r)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-48"}),o.jsx("div",{className:"skeleton-text-sm w-32"})]}),o.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(re=>o.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[o.jsx("div",{className:"skeleton-circle size-20"}),o.jsx("div",{className:"skeleton-text w-16 mt-3"})]},re))}),o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-28"}),o.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(re=>o.jsx("div",{className:"skeleton-text-sm w-full"},re))})]})]});const u=$M(a,t),[f,m]=w.useState(!1),[p,v]=w.useState(!1),[y,x]=w.useState(!1),[b,N]=w.useState(""),[S,C]=w.useState(!1),[k,A]=w.useState(!1),[R,z]=w.useState(""),[O,M]=w.useState(!1),[E,L]=w.useState(!1),[U,X]=w.useState(""),[Q,ee]=w.useState(!1),[ue,ze]=w.useState(void 0),[je,K]=w.useState(!1),[ae,me]=w.useState(null),[V,H]=w.useState(!1),T=u?.visibilityEvidence??[],B=u?.project.name??"",se=u?.project.displayName||u?.project.name||B,le=qN(),J=w.useMemo(()=>new Set(T.map(re=>re.location??"")),[T]),fe=J.has(""),ye=w.useMemo(()=>[...J].filter(Boolean),[J]);w.useEffect(()=>{if(ue===void 0||ue===""||!B){me(null),H(!1);return}H(!0),ej(B,ue).then(re=>{me(re),H(!1)}).catch(()=>{me(null),H(!1)})},[ue,B]);const _e=w.useMemo(()=>{if(!ae)return null;const re=new Map;for(const Ge of ae){for(const[gt,Vt]of Object.entries(Ge.providerRuns??{}))re.set(`${Ge.keyword}::${gt}`,Vt.map(Qe=>({runId:Qe.runId,citationState:Qe.citationState,createdAt:Qe.createdAt})));(!Ge.providerRuns||Object.keys(Ge.providerRuns).length===0)&&re.set(`${Ge.keyword}::`,Ge.runs.map(gt=>({runId:gt.runId,citationState:gt.citationState,createdAt:gt.createdAt})))}return re},[ae]),ge=w.useMemo(()=>{const re=ue!==void 0?T.filter(Ge=>ue===""?!Ge.location:Ge.location===ue):T;return _e?re.map(Ge=>{const gt=_e.get(`${Ge.keyword}::${Ge.provider}`)??_e.get(`${Ge.keyword}::`);return gt?{...Ge,runHistory:gt}:Ge}):re},[T,ue,_e]);if(!u)return o.jsx("div",{className:"page-container",children:o.jsxs(Le,{className:"surface-card empty-card",children:[o.jsx("h1",{children:"Project not found"}),o.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),o.jsx(oe,{asChild:!0,children:o.jsx(St,{to:"/",children:"Return to overview"})})]})});async function Ze(){try{await le.mutateAsync({projectName:B,projectLabel:se,sourceAction:"project-run"}),c()}catch{}}async function et(){v(!0);try{await W_(B),Ke({title:"Project deleted",detail:`${se} was removed.`,tone:"positive",dedupeKey:`project:delete:${B}`,dedupeMode:"drop"}),s({to:"/"}),c()}catch(re){console.error("Failed to delete project:",re)}finally{v(!1)}}async function de(){const re=await e2(B),Ge=typeof re=="string"?re:JSON.stringify(re,null,2),gt=new Blob([Ge],{type:"text/yaml"}),Vt=URL.createObjectURL(gt),Qe=document.createElement("a");Qe.href=Vt,Qe.download=`${B}.yaml`,Qe.click()}async function Ve(){const re=b.split(`
236
+ CTR: ${Je.impressions>0?(Je.clicks/Je.impressions*100).toFixed(1):0}%`}),o.jsx("rect",{x:ns-Ia-Cl/2,y:st.top+zn-Fi,width:Ia,height:Math.max(Fi,1),rx:2,fill:"#3b82f6",opacity:.85}),o.jsx("rect",{x:ns+Cl/2,y:st.top+zn-gs,width:Ia,height:Math.max(gs,1),rx:2,fill:"#10b981",opacity:.85})]},Me)}),(()=>{const Me=Math.min(he.length,7);return Array.from({length:Me},(Je,it)=>{const ns=he.length===1?0:Math.round(it/(Me-1)*(he.length-1)),Fi=st.left+ks*ns+ks/2;return o.jsx("text",{x:Fi,y:cn-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:he[ns][0].slice(5)},`xl-${ns}`)})})()]})})]})})(),o.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:E.startDate,onChange:I=>L(he=>({...he,startDate:I.target.value}))}),o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:E.endDate,onChange:I=>L(he=>({...he,endDate:I.target.value}))}),o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter query",value:E.query,onChange:I=>L(he=>({...he,query:I.target.value}))}),o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter page",value:E.page,onChange:I=>L(he=>({...he,page:I.target.value}))}),o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"number",min:"1",placeholder:"Limit",value:E.limit,onChange:I=>L(he=>({...he,limit:I.target.value}))})]}),f.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"Date"}),o.jsx("th",{className:"text-left",children:"Query"}),o.jsx("th",{className:"text-left",children:"Page"}),o.jsx("th",{className:"text-right",children:"Clicks"}),o.jsx("th",{className:"text-right",children:"Impressions"}),o.jsx("th",{className:"text-right",children:"CTR"}),o.jsx("th",{className:"text-right",children:"Position"})]})}),o.jsx("tbody",{children:f.map((I,he)=>o.jsxs("tr",{children:[o.jsx("td",{className:"text-zinc-400",children:I.date}),o.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:I.query}),o.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:I.page}),o.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:I.clicks.toLocaleString()}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:I.impressions.toLocaleString()}),o.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(I.ctr)?I.ctr*100:0).toFixed(1),"%"]}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:I.position.toFixed(1)})]},`${I.date}:${I.query}:${I.page}:${he}`))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),o.jsx("h3",{children:"Inspect a URL"})]})}),o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://example.com/page",value:k,onChange:I=>A(I.target.value),onKeyDown:I=>I.key==="Enter"&&void Nl()}),o.jsx(oe,{type:"button",size:"sm",disabled:se||!nt?.propertyId||!k.trim(),onClick:Nl,children:se?"Inspecting…":"Inspect URL"})]}),b&&o.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:b.indexingState??"Unknown"})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:b.verdict??"Unknown"})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Wx(b.isMobileFriendly)})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ls(b.crawlTime)})]})]})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),o.jsx("h3",{children:"Inspection log"})]}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:T,onClick:()=>{Ma()},children:T?"Loading…":"Refresh history"})]}),o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter exact URL",value:U,onChange:I=>X(I.target.value)}),o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:T,onClick:()=>{Ma()},children:"Apply filter"})]}),p.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Indexing"}),o.jsx("th",{className:"text-left",children:"Verdict"}),o.jsx("th",{className:"text-left",children:"Coverage"}),o.jsx("th",{className:"text-left",children:"Mobile"}),o.jsx("th",{className:"text-left",children:"Inspected"})]})}),o.jsx("tbody",{children:p.map(I=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),o.jsx("td",{className:"text-zinc-300",children:I.indexingState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:I.verdict??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:I.coverageState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:Wx(I.isMobileFriendly)}),o.jsx("td",{className:"text-zinc-400",children:ls(I.inspectedAt)})]},I.id))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),o.jsx("h3",{children:"Recent indexing losses"})]})}),y.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Previous"}),o.jsx("th",{className:"text-left",children:"Current"}),o.jsx("th",{className:"text-left",children:"Changed at"})]})}),o.jsx("tbody",{children:y.map(I=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),o.jsx("td",{className:"text-zinc-400",children:I.previousState??"Unknown"}),o.jsx("td",{className:"text-zinc-300",children:I.currentState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:ls(I.transitionDate)})]},`${I.url}:${I.transitionDate}`))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),nt&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:o.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>nn(I=>!I),children:[o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:`h-4 w-4 text-zinc-500 transition-transform ${Dn?"rotate-90":""}`,"aria-hidden":"true",children:o.jsx("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",clipRule:"evenodd"})}),o.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),Dn&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),o.jsx("h3",{children:"Pick the Search Console property"})]})}),o.jsxs("div",{className:"mt-3 space-y-2",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),o.jsx("select",{id:`gsc-property-${e}`,className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:S,disabled:je||c.length===0,onChange:I=>C(I.target.value),children:c.length===0?o.jsx("option",{value:"",children:je?"Loading properties…":"No properties available"}):c.map(I=>o.jsxs("option",{value:I.siteUrl,children:[I.siteUrl," · ",I.permissionLevel]},I.siteUrl))}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:je,onClick:()=>{ce(nt)},children:je?"Refreshing…":"Refresh properties"}),o.jsx(oe,{type:"button",size:"sm",disabled:!S||ae,onClick:Jr,children:ae?"Saving…":"Save property"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),o.jsx("h3",{children:"Import GSC performance data"})]})}),o.jsxs("div",{className:"mt-3 space-y-3",children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),o.jsx("input",{id:`gsc-sync-days-${e}`,type:"number",min:"1",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",value:R,onChange:I=>z(I.target.value)})]}),o.jsxs("label",{className:"flex items-center gap-2 rounded border border-zinc-800/60 bg-zinc-900/20 px-3 py-2 text-sm text-zinc-300",children:[o.jsx("input",{type:"checkbox",checked:O,onChange:I=>M(I.target.checked)}),"Replace existing imported rows for the requested range"]})]}),o.jsx(oe,{type:"button",size:"sm",disabled:ts.isPending||!nt.propertyId,onClick:Gi,children:ts.isPending?"Queueing…":"Queue sync"}),!nt.propertyId&&o.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),o.jsx("h3",{children:"Sitemap configuration"})]})}),o.jsxs("div",{className:"mt-3 space-y-3",children:[nt.sitemapUrl&&o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:nt.sitemapUrl})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:ge||!nt.propertyId,onClick:()=>{Pa()},children:ge?"Loading…":"Browse sitemaps from GSC"}),o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:ht.isPending||!nt.propertyId,onClick:hs,children:ht.isPending?"Discovering…":"Auto-discover and queue inspection"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:"Browse lists available sitemaps without queueing a run. Auto-discover saves the primary sitemap and queues an inspection."}),et&&et.length>0&&o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[o.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",et.length,")"]}),et.map(I=>{const he=I.contents?.[0];return o.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-zinc-200 break-all",children:I.path}),I.lastSubmitted&&o.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",I.lastSubmitted.split("T")[0]]})]}),o.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[he&&o.jsxs("div",{className:"text-right",children:[o.jsxs("p",{className:"text-zinc-300",children:[he.indexed," / ",he.submitted]}),o.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),o.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>at(I.path),children:"Use"})]})]},I.path)})]}),o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:nt.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Ve,onChange:I=>at(I.target.value),onKeyDown:I=>I.key==="Enter"&&Ve.trim()&&void Cs()}),o.jsx(oe,{type:"button",size:"sm",disabled:Zt||!Ve.trim(),onClick:Cs,children:Zt?"Saving…":nt.sitemapUrl?"Update":"Save"})]}),o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"Sitemap URL for inspection (leave empty for saved default)",id:`gsc-sitemap-inspect-${e}`}),o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:gn.isPending||!nt.propertyId,onClick:async()=>{const he=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||nt.sitemapUrl||void 0;Be(null),pn(null);try{await gn.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:he}})}catch{}},children:gn.isPending?"Queueing…":"Inspect sitemap"})]}),!nt.propertyId&&o.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function m$({project:e,onUpdateProject:t,onRefresh:s}){const[a,r]=w.useState(!1),[c,u]=w.useState(!1),[f,m]=w.useState(null),[p,v]=w.useState(e.displayName),[y,x]=w.useState(e.canonicalDomain),[b,N]=w.useState(e.country),[S,C]=w.useState(e.language),[k,A]=w.useState(e.ownedDomains??[]),[R,z]=w.useState(""),[O,M]=w.useState(null),[E,L]=w.useState(!1),[U,X]=w.useState(!1),[Q,ee]=w.useState(""),[ue,ze]=w.useState(""),[je,K]=w.useState(""),[ae,me]=w.useState(""),[V,H]=w.useState("");w.useEffect(()=>{a||(v(e.displayName),x(e.canonicalDomain),N(e.country),C(e.language),A(e.ownedDomains??[]))},[e,a]);function T(){r(!1),m(null),v(e.displayName),x(e.canonicalDomain),N(e.country),C(e.language),A(e.ownedDomains??[]),z("")}function B(){const de=R.trim();de&&(k.includes(de)||A([...k,de]),z(""))}function se(de){A(k.filter(Ve=>Ve!==de))}async function le(){if(!(!p.trim()||!y.trim()||!b.trim()||!S.trim())){u(!0),m(null);try{await t(e.name,{displayName:p.trim(),canonicalDomain:y.trim(),ownedDomains:k,country:b.trim(),language:S.trim()}),r(!1),Ke({title:"Project settings saved",detail:`${p.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(de){m(de instanceof Error?de.message:"Failed to save")}finally{u(!1)}}}async function J(){const de=Q.trim(),Ve=ue.trim(),at=je.trim(),Zt=ae.trim();if(!(!de||!Ve||!at||!Zt)){L(!0),M(null);try{const $t={label:de,city:Ve,region:at,country:Zt};V.trim()&&($t.timezone=V.trim()),await Y_(e.name,$t),s(),ee(""),ze(""),K(""),me(""),H(""),X(!1),Ke({title:"Location added",detail:`${de} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${de}`,dedupeMode:"drop"})}catch($t){M($t instanceof Error?$t.message:"Failed to add location")}finally{L(!1)}}}async function fe(de){L(!0),M(null);try{await J_(e.name,de),s(),Ke({title:"Location removed",detail:`${de} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${de}`,dedupeMode:"drop"})}catch(Ve){M(Ve instanceof Error?Ve.message:"Failed to remove location")}finally{L(!1)}}async function ye(de){L(!0),M(null);try{await X_(e.name,de),s(),Ke({title:"Default location updated",detail:`${de} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Ve){M(Ve instanceof Error?Ve.message:"Failed to set default location")}finally{L(!1)}}const _e=p!==e.displayName||y!==e.canonicalDomain||b!==e.country||S!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[]),ge="w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",Ze="block text-xs font-medium text-zinc-400 mb-1",et=Q.trim()&&ue.trim()&&je.trim()&&ae.trim();return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),o.jsx("h2",{children:"Project settings"})]}),!a&&o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),children:"Edit settings"})]}),f&&o.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[f,o.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>m(null),children:"×"})]}),a?o.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Display name"}),o.jsx("input",{className:ge,type:"text",value:p,onChange:de=>v(de.target.value),placeholder:"My Project"})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Canonical domain"}),o.jsx("input",{className:ge,type:"text",value:y,onChange:de=>x(de.target.value),placeholder:"example.com"})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Country"}),o.jsx("input",{className:ge,type:"text",value:b,onChange:de=>N(de.target.value),placeholder:"US",maxLength:2})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Language"}),o.jsx("input",{className:ge,type:"text",value:S,onChange:de=>C(de.target.value),placeholder:"en"})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Owned domains"}),o.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(de=>o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[de,o.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>se(de),"aria-label":`Remove ${de}`,children:"×"})]},de))}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{className:`${ge} flex-1`,type:"text",placeholder:"docs.example.com",value:R,onChange:de=>z(de.target.value),onKeyDown:de=>de.key==="Enter"&&(de.preventDefault(),B())}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:!R.trim(),onClick:B,children:"Add"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[o.jsx(oe,{type:"button",disabled:c||!_e||!p.trim()||!y.trim(),onClick:le,children:c?"Saving...":"Save changes"}),o.jsx(oe,{type:"button",variant:"outline",disabled:c,onClick:T,children:"Cancel"})]})]}):o.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:o.jsx("table",{className:"w-full text-sm",children:o.jsxs("tbody",{children:[o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),o.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?o.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(de=>o.jsx("span",{className:"rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:de},de))}):o.jsx("span",{className:"text-zinc-500",children:"—"})})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),o.jsxs("tr",{children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),o.jsxs("td",{className:"px-4 py-2.5",children:[O&&o.jsxs("div",{className:"mb-2 rounded border border-rose-800/40 bg-rose-950/20 px-2 py-1 text-xs text-rose-300",children:[O,o.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>M(null),children:"×"})]}),(e.locations??[]).length>0?o.jsxs("table",{className:"w-full text-xs mb-2",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-zinc-600",children:[o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),o.jsx("th",{className:"pb-1"})]})}),o.jsx("tbody",{children:e.locations.map(de=>o.jsxs("tr",{className:"border-t border-zinc-800/30",children:[o.jsx("td",{className:"py-1.5 pr-3",children:o.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${de.label===e.defaultLocation?"border-emerald-700/60 bg-emerald-950/30 text-emerald-300":"border-zinc-700/60 bg-zinc-800/40 text-zinc-300"}`,children:[de.label,de.label===e.defaultLocation?" ★":""]})}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:de.city}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:de.region}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:de.country}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:de.timezone??"—"}),o.jsx("td",{className:"py-1.5",children:o.jsxs("div",{className:"flex items-center gap-1.5",children:[de.label!==e.defaultLocation&&o.jsx("button",{type:"button",disabled:E,onClick:()=>ye(de.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${de.label} as default location`,children:"Set default"}),o.jsx("button",{type:"button",disabled:E,onClick:()=>fe(de.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${de.label}`,children:"Remove"})]})})]},de.label))})]}):o.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),U?o.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[o.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),o.jsx("input",{className:ge,type:"text",value:Q,onChange:de=>ee(de.target.value),placeholder:"nyc"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),o.jsx("input",{className:ge,type:"text",value:ue,onChange:de=>ze(de.target.value),placeholder:"New York"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),o.jsx("input",{className:ge,type:"text",value:je,onChange:de=>K(de.target.value),placeholder:"NY"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),o.jsx("input",{className:ge,type:"text",value:ae,onChange:de=>me(de.target.value),placeholder:"US",maxLength:2})]}),o.jsxs("div",{className:"col-span-2",children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),o.jsx("input",{className:ge,type:"text",value:V,onChange:de=>H(de.target.value),placeholder:"America/New_York"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[o.jsx(oe,{type:"button",size:"sm",disabled:E||!et,onClick:J,children:E?"Adding...":"Add location"}),o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:E,onClick:()=>{X(!1),M(null)},children:"Cancel"})]})]}):o.jsx(oe,{type:"button",size:"sm",variant:"outline",onClick:()=>X(!0),children:"+ Add location"})]})]})]})})})]})}const p$=[{value:"daily",label:"Every day"},{value:"weekly@mon",label:"Every Monday"},{value:"weekly@wed",label:"Every Wednesday"},{value:"weekly@fri",label:"Every Friday"},{value:"twice-daily",label:"Twice a day (6am & 6pm)"},{value:"custom",label:"Custom cron expression"}],dS=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","America/Toronto","America/Vancouver","Europe/London","Europe/Paris","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Asia/Singapore","Australia/Sydney"];function g$({projectName:e}){const[t,s]=w.useState("loading"),[a,r]=w.useState(!1),[c,u]=w.useState("daily"),[f,m]=w.useState(6),[p,v]=w.useState(""),[y,x]=w.useState("UTC"),[b,N]=w.useState(!1),[S,C]=w.useState(""),[k,A]=w.useState(!1),[R,z]=w.useState(!1),[O,M]=w.useState(null);w.useEffect(()=>{r2(e).then(s).catch(()=>s(null))},[e]);const E=()=>{if(t&&t!=="loading"){const Q=AE(t.preset??null,t.cronExpr);u(Q.freq),m(Q.hour),v(Q.customCron);const ee=dS.includes(t.timezone);x(ee?t.timezone:"Other"),N(!ee),C(ee?"":t.timezone)}else u("daily"),m(6),v(""),x("UTC"),N(!1),C("");M(null),r(!0)},L=async()=>{A(!0),M(null);try{const ee={timezone:b?S.trim()||"UTC":y};c==="custom"?ee.cron=p.trim():ee.preset=RE(c,f);const ue=await qx(e,ee);s(ue),r(!1),Ke({title:"Schedule saved",detail:Gh(ue.preset??null,ue.cronExpr,ue.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(Q){M(Q instanceof Error?Q.message:"Failed to save schedule")}finally{A(!1)}},U=async()=>{if(!(!t||t==="loading")){A(!0),M(null);try{const Q={timezone:t.timezone,enabled:!t.enabled};t.preset?Q.preset=t.preset:Q.cron=t.cronExpr;const ee=await qx(e,Q);s(ee),Ke({title:ee.enabled?"Schedule resumed":"Schedule paused",detail:Gh(ee.preset??null,ee.cronExpr,ee.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(Q){M(Q instanceof Error?Q.message:"Failed to update schedule")}finally{A(!1)}}},X=async()=>{z(!0),M(null);try{await o2(e),s(null),r(!1),Ke({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch(Q){M(Q instanceof Error?Q.message:"Failed to remove schedule")}finally{z(!1)}};return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),o.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!a&&o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:E,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&o.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!a&&t===null&&o.jsx(Le,{className:"surface-card compact-card",children:o.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!a&&t!==null&&o.jsxs(Le,{className:"surface-card compact-card",children:[o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Gh(t.preset??null,t.cronExpr,t.timezone)}),o.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",o.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&o.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&o.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),o.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[o.jsx(lt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:U,children:t.enabled?"Pause":"Resume"}),o.jsx(oe,{type:"button",variant:"ghost",size:"sm",disabled:R,onClick:X,children:R?"Removing...":"Remove"})]})]}),O&&o.jsx("p",{className:"text-rose-400 text-sm mt-2",children:O})]}),a&&o.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),o.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:c,onChange:Q=>u(Q.target.value),children:p$.map(Q=>o.jsx("option",{value:Q.value,children:Q.label},Q.value))})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),o.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none disabled:opacity-40",value:f,disabled:c==="twice-daily"||c==="custom",onChange:Q=>m(parseInt(Q.target.value)),children:Array.from({length:24},(Q,ee)=>o.jsx("option",{value:ee,children:Am(ee)},ee))})]})]}),c==="custom"&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),o.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 font-mono focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"0 9 * * 1-5",value:p,onChange:Q=>v(Q.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),o.jsxs("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:b?"Other":y,onChange:Q=>{Q.target.value==="Other"?(N(!0),x("Other")):(N(!1),x(Q.target.value))},children:[dS.map(Q=>o.jsx("option",{value:Q,children:Q},Q)),o.jsx("option",{value:"Other",children:"Other (enter manually)\\u2026"})]}),b&&o.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"e.g. America/New_York",value:S,onChange:Q=>C(Q.target.value)})]}),O&&o.jsx("p",{className:"text-rose-400 text-sm",children:O}),o.jsxs("div",{className:"flex gap-2 justify-end",children:[o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),M(null)},children:"Cancel"}),o.jsx(oe,{type:"button",size:"sm",disabled:k||c==="custom"&&!p.trim(),onClick:L,children:k?"Saving...":"Save schedule"})]})]})]})}const y$=[{value:"citation.lost",label:"Citation lost"},{value:"citation.gained",label:"Citation gained"},{value:"run.completed",label:"Run completed"},{value:"run.failed",label:"Run failed"}];function v$({projectName:e}){const[t,s]=w.useState("loading"),[a,r]=w.useState(!1),[c,u]=w.useState(""),[f,m]=w.useState(["citation.lost","citation.gained"]),[p,v]=w.useState(!1),[y,x]=w.useState(null),[b,N]=w.useState({});w.useEffect(()=>{l2(e).then(s).catch(()=>s([]))},[e]);const S=R=>{m(z=>z.includes(R)?z.filter(O=>O!==R):[...z,R])},C=async()=>{if(!(!c.trim()||f.length===0)){v(!0),x(null);try{const R=await c2(e,{channel:"webhook",url:c.trim(),events:f});s(z=>z==="loading"?[R]:[...z,R]),u(""),m(["citation.lost","citation.gained"]),r(!1),Ke({title:"Webhook added",detail:`Notifications will be sent to ${R.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(R){x(R instanceof Error?R.message:"Failed to add webhook")}finally{v(!1)}}},k=async R=>{try{await u2(e,R),s(z=>z==="loading"?z:z.filter(O=>O.id!==R)),Ke({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${R}`,dedupeMode:"drop"})}catch(z){x(z instanceof Error?z.message:"Failed to remove webhook")}},A=async R=>{N(z=>({...z,[R]:{state:"testing"}}));try{const z=await d2(e,R);N(O=>({...O,[R]:{state:z.ok?"ok":"fail",status:z.status}})),z.ok&&Ke({title:"Test notification sent",detail:`Webhook returned status ${z.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${R}`,dedupeMode:"replace"})}catch{N(z=>({...z,[R]:{state:"fail"}}))}};return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),o.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!a),x(null)},children:a?"Cancel":"+ Add webhook"})]}),a&&o.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),o.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://hooks.example.com/canonry",value:c,onChange:R=>u(R.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),o.jsx("div",{className:"flex flex-wrap gap-3",children:y$.map(R=>o.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[o.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:f.includes(R.value),onChange:()=>S(R.value)}),o.jsx("span",{className:"text-sm text-zinc-300",children:R.label})]},R.value))})]}),y&&o.jsx("p",{className:"text-rose-400 text-sm",children:y}),o.jsxs("div",{className:"flex gap-2 justify-end",children:[o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),x(null)},children:"Cancel"}),o.jsx(oe,{type:"button",size:"sm",disabled:p||!c.trim()||f.length===0,onClick:C,children:p?"Adding...":"Add webhook"})]})]}),t==="loading"&&o.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!a&&o.jsx(Le,{className:"surface-card compact-card",children:o.jsx("p",{className:"supporting-copy",children:"No webhooks configured. Add one to get alerted when citations change or runs complete."})}),t!=="loading"&&t.length>0&&o.jsxs("div",{className:"evidence-table-wrap",children:[o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Endpoint"}),o.jsx("th",{children:"Events"}),o.jsx("th",{children:"Status"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:t.map(R=>o.jsxs("tr",{children:[o.jsx("td",{className:"evidence-keyword-cell",children:o.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:R.urlHost,children:R.urlDisplay??R.url})}),o.jsx("td",{children:o.jsx("div",{className:"flex flex-wrap gap-1",children:R.events.map(z=>o.jsx("span",{className:"inline-flex items-center rounded-full border border-zinc-700 bg-zinc-800/60 px-2 py-0.5 text-[10px] font-medium text-zinc-400 uppercase tracking-wide",children:z.replace("."," ")},z))})}),o.jsx("td",{children:o.jsx(lt,{tone:R.enabled?"positive":"neutral",children:R.enabled?"Active":"Paused"})}),o.jsx("td",{children:o.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[b[R.id]&&(()=>{const z=b[R.id],O=z.state==="testing"?"Sending…":z.state==="ok"?`Delivered${z.status?` (${z.status})`:""}`:`Failed${z.status?` (${z.status})`:""}`;return o.jsx(lt,{tone:z.state==="ok"?"positive":z.state==="fail"?"negative":"neutral",children:O})})(),o.jsx(oe,{variant:"ghost",size:"sm",type:"button",disabled:b[R.id]?.state==="testing",onClick:()=>A(R.id),children:"Test"}),o.jsx(oe,{variant:"ghost",size:"sm",type:"button",onClick:()=>k(R.id),children:"Remove"})]})})]},R.id))})]}),y&&o.jsx("p",{className:"text-rose-400 text-sm mt-2",children:y})]})]})}function fS({eyebrow:e,title:t,status:s,tone:a,targetLabel:r,targetValue:c,coverageValue:u,note:f,updatedAt:m,active:p,onClick:v}){return o.jsxs("button",{type:"button",onClick:v,className:`surface-card w-full text-left transition-colors ${p?"border-zinc-200 bg-zinc-900/50":"hover:border-zinc-700 hover:bg-zinc-900/40"}`,children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),o.jsx("h3",{children:t})]}),o.jsx(lt,{tone:a,children:s})]}),o.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:r}),o.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:c})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:u})]})]}),o.jsxs("div",{className:"mt-3 flex flex-col gap-1 text-xs text-zinc-500 sm:flex-row sm:items-center sm:justify-between",children:[o.jsx("span",{children:f}),o.jsx("span",{children:m?`Updated ${ls(m)}`:"No recent sync yet"})]})]})}function ru({label:e,value:t,tone:s}){const a=s==="positive"?"text-emerald-400":s==="negative"?"text-rose-400":"text-zinc-200";return o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),o.jsx("p",{className:`mt-2 text-2xl font-semibold ${a}`,children:t})]})}function x$({projectName:e}){const[t,s]=w.useState(null),[a,r]=w.useState([]),[c,u]=w.useState(null),[f,m]=w.useState([]),[p,v]=w.useState([]),[y,x]=w.useState(null),[b,N]=w.useState(""),[S,C]=w.useState(""),[k,A]=w.useState(""),[R,z]=w.useState(!0),[O,M]=w.useState(!1),[E,L]=w.useState(null),[U,X]=w.useState("coverage");w.useEffect(()=>{Q()},[e]);async function Q(){z(!0),L(null);try{const V=await ij(e);if(s(V),V.connected){const[H,T,B]=await Promise.all([wp(e).catch(()=>null),aj(e).catch(()=>[]),O2(e).catch(()=>[])]);H&&u(H),m(T),v(B)}}catch(V){L(V instanceof Error?V.message:"Failed to load Bing data")}finally{z(!1)}}async function ee(){if(S.trim()){L(null);try{const V=await E2(e,S.trim());C(""),V.availableSites.length>0&&r(V.availableSites),await Q()}catch(V){L(V instanceof Error?V.message:"Failed to connect")}}}async function ue(){try{await R2(e),s(null),r([]),u(null),m([]),v([]),x(null),A(""),L(null)}catch(V){L(V instanceof Error?V.message:"Failed to disconnect")}}async function ze(){if(k)try{await T2(e,k),await Q()}catch(V){L(V instanceof Error?V.message:"Failed to set site")}}async function je(){if(b.trim())try{const V=await rj(e,b.trim());x(V),m(H=>[V,...H])}catch(V){L(V instanceof Error?V.message:"Inspection failed")}}async function K(V){M(!0),L(null);try{const H=await Gx(e,{urls:[V]}),{succeeded:T,failed:B,total:se}=H.summary;Ke({title:"Bing submission requested",detail:B===0?`${T} URL submitted to Bing.`:`${T}/${se} submitted successfully, ${B} failed.`,tone:B===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${V}`,dedupeMode:"replace"})}catch(H){const T=H instanceof Error?H.message:"Submission failed";L(T),Ke({title:"Bing submission failed",detail:T,tone:"negative",dedupeKey:`bing:indexing:${e}:${V}`,dedupeMode:"replace"})}finally{M(!1)}}async function ae(){M(!0),L(null),Ke({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const V=await Gx(e,{allUnindexed:!0}),{succeeded:H,failed:T,total:B}=V.summary;Ke({title:"Bing submissions requested",detail:T===0?`${H}/${B} URL${B!==1?"s":""} submitted to Bing.`:`${H}/${B} submitted successfully, ${T} failed.`,tone:T===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(V){const H=V instanceof Error?V.message:"Batch submission failed";L(H),Ke({title:"Bing submissions failed",detail:H,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{M(!1)}}if(R)return o.jsx(Le,{className:"surface-card",children:o.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!t?.connected)return o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsx(lt,{tone:"caution",children:"Not connected"})]}),o.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),o.jsxs("div",{className:"mt-3",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),o.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[o.jsx("input",{id:"bing-api-key",type:"password",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:S,onChange:V=>C(V.target.value),onKeyDown:V=>V.key==="Enter"&&ee()}),o.jsx(oe,{size:"sm",disabled:!S.trim(),onClick:ee,children:"Connect"})]}),o.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",o.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]})]}),E&&o.jsx("p",{className:"mt-3 text-xs text-rose-400",children:E})]});if(!t.siteUrl)return o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(lt,{tone:"positive",children:"Connected"}),o.jsx(oe,{size:"sm",variant:"ghost",onClick:ue,children:"Disconnect"})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),o.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),o.jsx("span",{className:"text-xs text-zinc-500",children:t.domain})]}),o.jsx("p",{className:"mt-2 text-xs text-zinc-500",children:"The API key is connected, but no Bing site is selected yet. Pick the verified site that should receive inspections and indexing requests."})]}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.domain})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.updatedAt?ls(t.updatedAt):"—"})]})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),a.length>0?o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.jsxs("select",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:k,onChange:V=>A(V.target.value),children:[o.jsx("option",{value:"",children:"Select a site..."}),a.map(V=>o.jsxs("option",{value:V.url,children:[V.url,V.verified?" (verified)":""]},V.url))]}),o.jsx(oe,{size:"sm",disabled:!k,onClick:ze,children:"Set Site"})]}):o.jsx("div",{className:"mt-3",children:o.jsx(oe,{size:"sm",onClick:async()=>{const V=await A2(e);r(V.sites)},children:"Load Sites"})})]})]}),E&&o.jsx("p",{className:"mt-3 text-xs text-rose-400",children:E})]});const me=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return o.jsxs("div",{className:"space-y-3",children:[o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(lt,{tone:"positive",children:"Connected"}),o.jsx(oe,{size:"sm",variant:"ghost",onClick:ue,children:"Disconnect"})]})]}),E&&o.jsx("p",{className:"mb-3 text-xs text-rose-400",children:E}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),o.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),o.jsx("span",{className:"text-xs text-zinc-500",children:t.domain})]}),o.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",o.jsx("code",{children:t.siteUrl}),"."]})]}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.siteUrl})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.updatedAt?ls(t.updatedAt):"—"})]})]})]})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),o.jsx("h3",{children:"Index monitoring"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:c?.lastInspectedAt?`Last inspected ${ls(c.lastInspectedAt)}`:"No inspection history yet"})]}),o.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:me.map(V=>o.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${U===V.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>X(V.key),children:V.label},V.key))}),U==="coverage"&&c&&o.jsxs("div",{className:"mt-4 space-y-4",children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[o.jsx(ru,{label:"Indexed",value:c.summary.indexed,tone:"positive"}),o.jsx(ru,{label:"Not in index",value:c.summary.notIndexed+(c.summary.unknown??0),tone:"negative"}),o.jsx(ru,{label:"Status unknown",value:c.summary.unknown??0,tone:"neutral"}),o.jsx(ru,{label:"Coverage",value:`${c.summary.percentage}%`,tone:"neutral"})]}),c.notIndexed.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[o.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",c.notIndexed.length,")"]}),o.jsx(oe,{size:"sm",variant:"ghost",disabled:O,onClick:ae,children:O?"Submitting…":"Submit all to Bing"})]}),o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),o.jsx("tbody",{children:c.notIndexed.map(V=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:V.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:V.httpCode??"—"}),o.jsx("td",{className:"py-1.5 px-3 text-right",children:o.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:O,onClick:()=>K(V.url),children:"Submit"})})]},V.id))})]})})]}),(c.unknown??[]).length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[o.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(c.unknown??[]).length,")"]}),o.jsx(oe,{size:"sm",variant:"ghost",disabled:O,onClick:ae,children:O?"Submitting…":"Submit all to Bing"})]}),o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),o.jsx("tbody",{children:(c.unknown??[]).map(V=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:V.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:V.lastCrawledDate?ls(V.lastCrawledDate):"—"}),o.jsx("td",{className:"py-1.5 px-3 text-right",children:o.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:O,onClick:()=>K(V.url),children:"Submit"})})]},V.id))})]})})]}),c.indexed.length>0&&o.jsxs("div",{children:[o.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",c.indexed.length,")"]}),o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),o.jsx("tbody",{children:c.indexed.map(V=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:V.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:V.lastCrawledDate?ls(V.lastCrawledDate):"—"})]},V.id))})]})})]})]}),U==="coverage"&&!c&&o.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),U==="inspections"&&o.jsxs("div",{className:"mt-4 space-y-3",children:[o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{type:"text",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"URL to inspect",value:b,onChange:V=>N(V.target.value),onKeyDown:V=>V.key==="Enter"&&je()}),o.jsx(oe,{size:"sm",disabled:!b.trim(),onClick:je,children:"Inspect"})]}),y&&o.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[o.jsx("div",{className:"font-medium text-zinc-200",children:y.url}),o.jsxs("div",{className:"text-zinc-400",children:["In Index: ",o.jsx("span",{className:y.inIndex?"text-emerald-400":"text-rose-400",children:y.inIndex?"Yes":"No"})," · ","HTTP: ",y.httpCode??"—"," · ","Crawled: ",y.lastCrawledDate??"—"]})]}),f.length>0&&o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),o.jsx("tbody",{children:f.map(V=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:V.url}),o.jsx("td",{className:"py-1.5 px-3",children:o.jsx(lt,{tone:V.inIndex?"positive":"negative",children:V.inIndex?"Yes":"No"})}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:V.httpCode??"—"}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:ls(V.inspectedAt)})]},V.id))})]})})]}),U==="performance"&&o.jsx("div",{className:"mt-4",children:p.length===0?o.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Clicks"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Impr"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"CTR"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"Pos"})]})}),o.jsx("tbody",{children:p.map((V,H)=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:V.query}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:V.clicks}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:V.impressions}),o.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(V.ctr)?V.ctr*100:0).toFixed(1),"%"]}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:V.averagePosition.toFixed(1)})]},H))})]})})})]})]})}function b$({projectName:e}){const[t,s]=w.useState("google"),[a,r]=w.useState(!0),[c,u]=w.useState("idle"),[f,m]=w.useState(null),p=w.useRef(null),[v,y]=w.useState(!1),[x,b]=w.useState(null),[N,S]=w.useState(null),[C,k]=w.useState(!1),[A,R]=w.useState(null),[z,O]=w.useState(null);async function M(V=!1){V||r(!0),m(null);try{const[H,T,B]=await Promise.all([Sp().catch(()=>null),nj(e).catch(()=>[]),ij(e).catch(()=>null)]),se=T.find(fe=>fe.connectionType==="gsc")??null;y(!!H?.google?.configured),k(!!H?.bing?.configured),b(se),R(B);const[le,J]=await Promise.all([se?jp(e).catch(()=>null):Promise.resolve(null),B?.connected?wp(e).catch(()=>null):Promise.resolve(null)]);S(le),O(J)}catch(H){m(H instanceof Error?H.message:"Failed to load search console overview")}finally{r(!1)}}async function E(){if(c!=="idle")return;p.current?.abort();const V=new AbortController;p.current=V;const H=V.signal;u("syncing"),m(null);const T=[];try{async function B(){if(!x)return;const fe=await sj(e);if(!fe?.id)return;const ye=2e3,ge=Date.now()+12e4;for(;Date.now()<ge;){if(H.aborted||(await new Promise(et=>setTimeout(et,ye)),H.aborted))return;const Ze=await Pr(fe.id).catch(()=>null);if(!Ze)break;if(["completed","failed","cancelled"].includes(Ze.status)){Ze.status!=="completed"&&T.push(`Google sync ${Ze.status}`);break}}}const se=10;async function le(){if(!A?.connected)return;const fe=await aj(e).catch(()=>[]),ye=[...new Set(fe.map(_e=>_e.url))];if(ye.length!==0)for(let _e=0;_e<ye.length;_e+=se){if(H.aborted)return;const ge=ye.slice(_e,_e+se),et=(await Promise.allSettled(ge.map(de=>rj(e,de)))).filter(de=>de.status==="rejected").length;et>0&&T.push(`${et} Bing inspection(s) failed`)}}const J=await Promise.allSettled([B(),le()]);for(const fe of J)fe.status==="rejected"&&T.push(fe.reason instanceof Error?fe.reason.message:"Sync failed");if(H.aborted)return;u("reloading"),await M(!0),T.length>0&&m(`Partial refresh: ${T.join("; ")}`)}catch(B){H.aborted||m(B instanceof Error?B.message:"Refresh failed")}finally{H.aborted||u("idle")}}w.useEffect(()=>(M(),()=>{p.current?.abort()}),[e]);const L=x?"positive":v?"caution":"negative",U=x?"Connected":v?"Ready to connect":"Needs setup",X=N?`${N.summary.percentage}% indexed`:x?"Awaiting coverage":"No coverage data",Q=N?`${N.summary.notIndexed} not indexed${N.summary.deindexed>0?` · ${N.summary.deindexed} deindexed`:""}`:x?"Run sitemap inspection to populate coverage":v?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",ee=N?.lastInspectedAt??x?.updatedAt??null,ue=A?.connected?"positive":C?"caution":"negative",ze=A?.connected?"Connected":C?"Ready to connect":"Needs setup",je=z?`${z.summary.percentage}% indexed`:A?.connected?"Awaiting coverage":"No coverage data",K=z?z.summary.notIndexed+(z.summary.unknown??0):0,ae=z?`${K} not in index`:A?.connected?"Inspect URLs to populate coverage":C?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",me=z?.lastInspectedAt??A?.updatedAt??null;return o.jsxs("div",{className:"space-y-6",children:[o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),o.jsx("h2",{children:"Search Engine Intelligence"}),o.jsx("p",{className:"mt-1 max-w-3xl text-sm leading-6 text-zinc-500",children:"Scan both engines at a glance, then open the Google or Bing workspace when you need to inspect coverage or take action."})]}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:a||c!=="idle",onClick:()=>{E()},children:a?"Loading…":c==="syncing"?"Querying Google & Bing…":c==="reloading"?"Reloading…":"Refresh overview"})]}),f&&o.jsx("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:f}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsx(fS,{eyebrow:"Google",title:"Google Search Console",status:a?"Loading…":U,tone:a?"neutral":L,targetLabel:"Selected property",targetValue:x?.propertyId??"No property selected",coverageValue:a?"Loading…":X,note:a?"Loading overview…":Q,updatedAt:ee,active:t==="google",onClick:()=>s("google")}),o.jsx(fS,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:a?"Loading…":ze,tone:a?"neutral":ue,targetLabel:"Selected site",targetValue:A?.siteUrl??"No site selected",coverageValue:a?"Loading…":je,note:a?"Loading overview…":ae,updatedAt:me,active:t==="bing",onClick:()=>s("bing")})]})]}),o.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([V,H])=>o.jsx("button",{type:"button",role:"tab","aria-selected":t===V,className:`project-subnav-link ${t===V?"project-subnav-link-active":""}`,onClick:()=>s(V),children:H},V))}),t==="google"&&o.jsx(h$,{projectName:e}),t==="bing"&&o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),o.jsx("h2",{children:"Bing Webmaster Tools"})]})}),o.jsx(x$,{projectName:e})]})]})}function S$({insights:e}){const{openEvidence:t}=Gr(),[s,a]=w.useState(null);return o.jsx("div",{className:"insight-list",children:e.map(r=>{const c=s===r.id,u=r.affectedPhrases.length>0;return o.jsxs("div",{children:[o.jsxs("div",{className:`insight-row insight-row-${r.tone} ${u?"cursor-pointer":""}`,onClick:u?()=>a(c?null:r.id):void 0,children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u&&o.jsx(Fu,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${c?"rotate-90":""}`}),o.jsx(lt,{tone:r.tone,children:r.actionLabel}),o.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:r.title}),o.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:r.detail})]}),u&&o.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[r.affectedPhrases.length," phrase",r.affectedPhrases.length>1?"s":""]})]}),c&&o.jsx("div",{className:"divide-y divide-zinc-800/20",children:r.affectedPhrases.map(f=>o.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Bm,{state:f.citationState}),o.jsx("span",{className:"text-sm text-zinc-200 truncate",children:f.keyword}),o.jsx("div",{className:"hidden sm:flex gap-1",children:f.provider&&o.jsx(al,{provider:f.provider})})]}),o.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:m=>{m.stopPropagation(),t(f.evidenceId)},children:"View →"})]},f.evidenceId))})]},r.id)})})}function vd({tab:e}){const{projectId:t}=Hu({from:"/projects/$projectId"}),s=Ii(),{dashboard:a,isLoading:r,refetch:c}=Oa();if(!a||r)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-48"}),o.jsx("div",{className:"skeleton-text-sm w-32"})]}),o.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(re=>o.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[o.jsx("div",{className:"skeleton-circle size-20"}),o.jsx("div",{className:"skeleton-text w-16 mt-3"})]},re))}),o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-28"}),o.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(re=>o.jsx("div",{className:"skeleton-text-sm w-full"},re))})]})]});const u=$M(a,t),[f,m]=w.useState(!1),[p,v]=w.useState(!1),[y,x]=w.useState(!1),[b,N]=w.useState(""),[S,C]=w.useState(!1),[k,A]=w.useState(!1),[R,z]=w.useState(""),[O,M]=w.useState(!1),[E,L]=w.useState(!1),[U,X]=w.useState(""),[Q,ee]=w.useState(!1),[ue,ze]=w.useState(void 0),[je,K]=w.useState(!1),[ae,me]=w.useState(null),[V,H]=w.useState(!1),T=u?.visibilityEvidence??[],B=u?.project.name??"",se=u?.project.displayName||u?.project.name||B,le=qN(),J=w.useMemo(()=>new Set(T.map(re=>re.location??"")),[T]),fe=J.has(""),ye=w.useMemo(()=>[...J].filter(Boolean),[J]);w.useEffect(()=>{if(ue===void 0||ue===""||!B){me(null),H(!1);return}H(!0),ej(B,ue).then(re=>{me(re),H(!1)}).catch(()=>{me(null),H(!1)})},[ue,B]);const _e=w.useMemo(()=>{if(!ae)return null;const re=new Map;for(const Ge of ae){for(const[gt,Vt]of Object.entries(Ge.providerRuns??{}))re.set(`${Ge.keyword}::${gt}`,Vt.map(Qe=>({runId:Qe.runId,citationState:Qe.citationState,createdAt:Qe.createdAt})));(!Ge.providerRuns||Object.keys(Ge.providerRuns).length===0)&&re.set(`${Ge.keyword}::`,Ge.runs.map(gt=>({runId:gt.runId,citationState:gt.citationState,createdAt:gt.createdAt})))}return re},[ae]),ge=w.useMemo(()=>{const re=ue!==void 0?T.filter(Ge=>ue===""?!Ge.location:Ge.location===ue):T;return _e?re.map(Ge=>{const gt=_e.get(`${Ge.keyword}::${Ge.provider}`)??_e.get(`${Ge.keyword}::`);return gt?{...Ge,runHistory:gt}:Ge}):re},[T,ue,_e]);if(!u)return o.jsx("div",{className:"page-container",children:o.jsxs(Le,{className:"surface-card empty-card",children:[o.jsx("h1",{children:"Project not found"}),o.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),o.jsx(oe,{asChild:!0,children:o.jsx(St,{to:"/",children:"Return to overview"})})]})});async function Ze(){try{await le.mutateAsync({projectName:B,projectLabel:se,sourceAction:"project-run"}),c()}catch{}}async function et(){v(!0);try{await W_(B),Ke({title:"Project deleted",detail:`${se} was removed.`,tone:"positive",dedupeKey:`project:delete:${B}`,dedupeMode:"drop"}),s({to:"/"}),c()}catch(re){console.error("Failed to delete project:",re)}finally{v(!1)}}async function de(){const re=await e2(B),Ge=typeof re=="string"?re:JSON.stringify(re,null,2),gt=new Blob([Ge],{type:"text/yaml"}),Vt=URL.createObjectURL(gt),Qe=document.createElement("a");Qe.href=Vt,Qe.download=`${B}.yaml`,Qe.click()}async function Ve(){const re=b.split(`
237
237
  `).map(Ge=>Ge.trim()).filter(Boolean);if(re.length!==0){C(!0);try{await Z_(B,re),c(),N(""),x(!1)}finally{C(!1)}}}async function at(){const re=R.trim();if(re){M(!0);try{const gt=(await WS(B)).map(Qe=>Qe.domain),Vt=[...new Set([...gt,re])];await tj(B,Vt),c(),z(""),A(!1)}finally{M(!1)}}}async function Zt(){const re=U.trim();if(re){ee(!0);try{const Ge=u?.project.ownedDomains??[];await Bx(B,[...Ge,re]),c(),X(""),L(!1)}finally{ee(!1)}}}async function $t(re){ee(!0);try{const Ge=u?.project.ownedDomains??[];await Bx(B,Ge.filter(gt=>gt!==re)),c()}finally{ee(!1)}}async function Dn(re,Ge){await V_(re,Ge),c()}const nn=re=>!Number.isNaN(Number.parseInt(re,10)),_t=[{key:"overview",label:"Overview",href:`/projects/${u.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${u.project.id}/search-console`},{key:"traffic",label:"Traffic",href:`/projects/${u.project.id}/traffic`},{key:"analytics",label:"Visibility",href:`/projects/${u.project.id}/analytics`}];return o.jsxs("div",{className:"page-container",children:[f?o.jsxs(Le,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[o.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),o.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",o.jsx("strong",{className:"text-zinc-200",children:u.project.displayName||u.project.name})," and all its key phrases, competitors, runs, and snapshots. This cannot be undone."]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(oe,{type:"button",variant:"destructive",disabled:p,onClick:et,children:p?"Deleting...":"Yes, delete project"}),o.jsx(oe,{type:"button",variant:"outline",disabled:p,onClick:()=>m(!1),children:"Cancel"})]})]}):null,o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:u.project.displayName||u.project.name}),o.jsxs("p",{className:"page-subtitle",children:[u.project.canonicalDomain,(u.project.ownedDomains??[]).length===0&&!E&&o.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>L(!0),children:"+ add domain"})," "," · ",u.contextLabel]}),o.jsxs("div",{className:"tag-row",children:[o.jsx("span",{className:"tag",children:u.project.country}),o.jsx("span",{className:"tag",children:u.project.language.toUpperCase()}),u.project.tags.map(re=>o.jsx("span",{className:"tag",children:re},re))]}),((u.project.ownedDomains??[]).length>0||E)&&o.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(u.project.ownedDomains??[]).map(re=>o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[re,o.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:Q,onClick:()=>$t(re),"aria-label":`Remove ${re}`,children:"×"})]},re)),E?o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-1.5 py-0.5 text-xs text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none w-40",type:"text",placeholder:"docs.example.com",value:U,onChange:re=>X(re.target.value),onKeyDown:re=>re.key==="Enter"&&Zt(),autoFocus:!0}),o.jsx(oe,{type:"button",size:"sm",disabled:!U.trim()||Q,onClick:Zt,children:Q?"...":"Add"}),o.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{L(!1),X("")},children:"Cancel"})]}):o.jsx("button",{type:"button",className:"rounded-full border border-dashed border-zinc-700 px-2 py-0.5 text-[10px] uppercase tracking-wide text-zinc-500 hover:text-zinc-300 hover:border-zinc-500 transition-colors",onClick:()=>L(!0),children:"+ domain"})]})]}),o.jsxs("div",{className:"page-header-right",children:[o.jsx("p",{className:"text-sm text-zinc-500",children:u.dateRangeLabel}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(oe,{type:"button",variant:"outline",size:"icon",onClick:de,"aria-label":"Export project as YAML",children:o.jsx(tE,{className:"h-4 w-4 text-zinc-400"})}),o.jsx(oe,{type:"button",variant:"outline",size:"icon",onClick:()=>m(!0),"aria-label":"Delete project",children:o.jsx(SE,{className:"h-4 w-4 text-zinc-400"})}),o.jsx(oe,{type:"button",disabled:le.isPending,onClick:Ze,children:le.isPending?"Starting...":"Run now"})]})]})]}),o.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:_t.map(re=>o.jsx(St,{to:re.href,className:`project-subnav-link ${re.key===e?"project-subnav-link-active":""}`,"aria-current":re.key===e?"page":void 0,children:re.label},re.key))}),e==="overview"?o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:"gauge-row",children:[o.jsx(IN,{value:u.visibilitySummary.value,label:u.visibilitySummary.label,delta:u.visibilitySummary.delta,tone:u.visibilitySummary.tone,description:u.visibilitySummary.description,tooltip:u.visibilitySummary.tooltip,isNumeric:nn(u.visibilitySummary.value),progress:u.visibilitySummary.progress}),o.jsxs("div",{className:"metric-card",children:[o.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Key Phrases",o.jsx(ws,{text:"Tracked key phrases where competitors are cited in the latest completed visibility run but your domain is not."})]}),o.jsxs("p",{className:"metric-card-big-value",children:[o.jsx("span",{className:"text-zinc-50",children:u.gapKeyPhrases.value}),o.jsxs("span",{className:"text-zinc-600",children:[" / ",u.keywordCounts.total]})]}),o.jsx("div",{className:"metric-card-bar",children:o.jsx("div",{className:`metric-card-bar-fill progress-fill-${u.gapKeyPhrases.tone}`,style:{width:u.gapKeyPhrases.progress!==void 0?`${u.gapKeyPhrases.progress*100}%`:"0%"}})}),o.jsx("p",{className:"metric-card-detail",children:u.gapKeyPhrases.delta}),o.jsx("p",{className:"metric-card-sub",children:u.gapKeyPhrases.description})]}),o.jsxs("div",{className:"metric-card",children:[o.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",o.jsx(ws,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),o.jsxs("p",{className:"metric-card-big-value",children:[o.jsx("span",{className:"text-zinc-50",children:u.indexCoverage.value}),o.jsx("span",{className:"text-zinc-600",children:"%"})]}),o.jsx("div",{className:"metric-card-bar",children:o.jsx("div",{className:`metric-card-bar-fill progress-fill-${u.indexCoverage.tone}`,style:{width:`${Number.parseInt(u.indexCoverage.value,10)||0}%`}})}),o.jsx("p",{className:"metric-card-detail",children:u.indexCoverage.delta}),o.jsx("p",{className:"metric-card-sub",children:u.indexCoverage.description})]}),o.jsxs("div",{className:"metric-card",children:[o.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",o.jsx(ws,{text:"Keyword-level citation changes compared to the previous completed run."})]}),u.movementSummary.hasPreviousRun?o.jsxs("div",{className:"metric-card-movement",children:[o.jsxs("span",{className:u.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",u.movementSummary.gained," gained"]}),o.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),o.jsxs("span",{className:u.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",u.movementSummary.lost," lost"]})]}):o.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),o.jsx("p",{className:"metric-card-sub mt-auto",children:u.movementSummary.gained===0&&u.movementSummary.lost===0&&u.movementSummary.hasPreviousRun?"No changes since last run":u.movementSummary.gained>u.movementSummary.lost?"Visibility improving":u.movementSummary.lost>u.movementSummary.gained?"Visibility declining":""})]})]}),u.providerScores.length>1&&o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),o.jsxs("h2",{children:["Visibility by model ",o.jsx(ws,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked key phrases. Switching models can significantly affect citation rates."})]})]})}),o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Model"}),o.jsx("th",{children:"Score"}),o.jsx("th",{children:"Cited key phrases"})]})}),o.jsx("tbody",{children:u.providerScores.map(re=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[o.jsx(al,{provider:re.provider}),re.model&&o.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:re.model})]})}),o.jsx("td",{children:o.jsxs("span",{className:`font-semibold ${re.score>=70?"text-emerald-400":re.score>=40?"text-amber-400":"text-rose-400"}`,children:[re.score,"%"]})}),o.jsxs("td",{className:"text-zinc-500",children:[re.cited," of ",re.total]})]},`${re.provider}::${re.model??"unknown"}`))})]})})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),o.jsx("h2",{children:"Citation signals"})]})}),o.jsx(S$,{insights:u.insights})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),o.jsx("h2",{children:"Key phrase citation tracking"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("p",{className:"supporting-copy",children:[new Set(u.visibilityEvidence.map(re=>re.keyword)).size," key phrases tracked"]}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>x(!y),children:y?"Cancel":"+ Add key phrases"})]})]}),y&&o.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[o.jsx("textarea",{className:"w-full resize-none rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",rows:3,placeholder:"Enter key phrases, one per line",value:b,onChange:re=>N(re.target.value)}),o.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[o.jsxs("p",{className:"text-xs text-zinc-500",children:[b.split(`
238
238
  `).filter(re=>re.trim()).length," key phrases"]}),o.jsx(oe,{type:"button",size:"sm",disabled:!b.trim()||S,onClick:Ve,children:S?"Adding...":"Add key phrases"})]})]}),u.project.locations&&u.project.locations.length>0&&o.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[o.jsx("button",{className:`filter-chip ${ue===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":ue===void 0,onClick:()=>{ze(void 0)},children:"All locations"}),u.project.locations.map(re=>J.has(re.label)&&o.jsx("button",{className:`filter-chip ${ue===re.label?"filter-chip-active":""}`,type:"button","aria-pressed":ue===re.label,onClick:()=>{ze(re.label),K(!1)},children:re.label},re.label)),fe&&o.jsx("button",{className:`filter-chip ${ue===""?"filter-chip-active":""}`,type:"button","aria-pressed":ue==="",onClick:()=>{ze(""),K(!1)},children:"No location"}),ye.length>1&&ue===void 0&&o.jsx("button",{className:`filter-chip filter-chip-compare ${je?"filter-chip-active":""}`,type:"button","aria-pressed":je,onClick:()=>K(re=>!re),title:"Side-by-side location comparison",children:"Compare"})]}),o.jsx(Z3,{evidence:ge})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),o.jsx("h2",{children:"Competitive landscape"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("p",{className:"supporting-copy",children:[u.competitors.length," tracked"]}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>A(!k),children:k?"Cancel":"+ Add competitor"})]})]}),k&&o.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"competitor.com",value:R,onChange:re=>z(re.target.value),onKeyDown:re=>re.key==="Enter"&&at()}),o.jsx(oe,{type:"button",size:"sm",disabled:!R.trim()||O,onClick:at,children:O?"Adding...":"Add"})]}),o.jsx(V3,{competitors:u.competitors})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),o.jsx("h2",{children:"Recent execution history"})]})}),o.jsx("div",{className:"run-list",children:u.recentRuns.map(re=>o.jsx(UN,{run:re},re.id))})]}),o.jsx(m$,{project:{...u.project,displayName:u.project.displayName??u.project.name,defaultLocation:u.project.defaultLocation??null},onUpdateProject:Dn,onRefresh:()=>{c()}}),o.jsx(g$,{projectName:u.project.name}),o.jsx(v$,{projectName:u.project.name})]}):e==="analytics"?o.jsx(J3,{projectName:u.project.name}):e==="traffic"?o.jsx(n$,{projectName:u.project.name}):o.jsx(b$,{projectName:u.project.name})]})}function j$(){const{dashboard:e,isLoading:t}=Oa(),s=c$();if(!e||t)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-20"}),o.jsx("div",{className:"skeleton-text-sm w-72"})]}),o.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(m=>o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[o.jsxs("div",{className:"flex-1 space-y-1.5",children:[o.jsx("div",{className:"skeleton-text w-40"}),o.jsx("div",{className:"skeleton-text-sm w-56"})]}),o.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},m))})]});const a=e.runs,[r,c]=w.useState("all"),u=r==="all"?a:a.filter(m=>m.status===r),f=async()=>{try{await s.mutateAsync(void 0)}catch{}};return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Runs"}),o.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:s.isPending,onClick:()=>{f()},children:s.isPending?"Queueing…":"Run all projects"})]}),o.jsxs("section",{children:[o.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(m=>o.jsx("button",{className:`filter-chip ${r===m?"filter-chip-active":""}`,type:"button","aria-pressed":r===m,onClick:()=>c(m),children:m==="all"?"All runs":Vu(m)},m))}),o.jsx("div",{className:"run-list",children:u.length>0?u.map(m=>o.jsx(UN,{run:m},m.id)):o.jsxs(Le,{className:"surface-card empty-card",children:[o.jsx("h2",{children:"No runs match this filter"}),o.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function w$({providerName:e,keyUrl:t,modelHint:s,onSaved:a}){const r=e.toLowerCase()==="local",[c,u]=w.useState(""),[f,m]=w.useState(""),[p,v]=w.useState(""),[y,x]=w.useState(""),[b,N]=w.useState(""),[S,C]=w.useState(""),[k,A]=w.useState(!1),[R,z]=w.useState(null),[O,M]=w.useState(!1),E=r?f.trim().length>0:c.trim().length>0;async function L(){if(E){A(!0),z(null),M(!1);try{const X=je=>{const K=parseInt(je.trim(),10);return Number.isFinite(K)&&K>0?K:void 0},Q={},ee=X(y);ee!==void 0&&(Q.maxConcurrency=ee);const ue=X(b);ue!==void 0&&(Q.maxRequestsPerMinute=ue);const ze=X(S);ze!==void 0&&(Q.maxRequestsPerDay=ze),await i2(e.toLowerCase(),{...c.trim()?{apiKey:c.trim()}:{},...f.trim()?{baseUrl:f.trim()}:{},...p.trim()?{model:p.trim()}:{},...Object.keys(Q).length>0?{quota:Q}:{}}),u(""),m(""),v(""),x(""),N(""),C(""),M(!0),Ke({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),a()}catch(X){z(X instanceof Error?X.message:"Failed to update provider")}finally{A(!1)}}}const U=s??"Use default model";return o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[r&&o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),o.jsx("input",{id:`base-url-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"http://localhost:11434/v1",value:f,onChange:X=>m(X.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",r?" (optional)":""]}),t&&o.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:["Get API key ","↗"]})]}),o.jsx("input",{id:`api-key-${e}`,type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:r?"Optional — most local servers don't need one":`Enter ${e} API key`,value:c,onChange:X=>u(X.target.value)})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),o.jsx("input",{id:`model-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:U,value:p,onChange:X=>v(X.target.value)})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),o.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[o.jsxs("div",{children:[o.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Concurrent",value:y,onChange:X=>x(X.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),o.jsxs("div",{children:[o.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/min",value:b,onChange:X=>N(X.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),o.jsxs("div",{children:[o.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/day",value:S,onChange:X=>C(X.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),R&&o.jsx("p",{className:"text-xs text-rose-400",children:R}),O&&o.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),o.jsx(oe,{type:"button",size:"sm",disabled:!E||k,onClick:L,children:k?"Saving...":"Save"})]})}function N$({onSaved:e}){const[t,s]=w.useState(""),[a,r]=w.useState(""),[c,u]=w.useState(!1),[f,m]=w.useState(null),[p,v]=w.useState(!1),y=t.trim().length>0&&a.trim().length>0;async function x(){if(y){u(!0),m(null),v(!1);try{await a2({clientId:t.trim(),clientSecret:a.trim()}),s(""),r(""),v(!0),Ke({title:"Google OAuth app updated",detail:"Dashboard Google credentials were saved.",tone:"positive",dedupeKey:"settings:google-oauth",dedupeMode:"replace"}),e()}catch(b){m(b instanceof Error?b.message:"Failed to update Google OAuth credentials")}finally{u(!1)}}}return o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),o.jsx("a",{href:"https://console.cloud.google.com/apis/credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Google Cloud \\u2197"})]}),o.jsx("input",{id:"google-client-id",type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client ID",value:t,onChange:b=>s(b.target.value)})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),o.jsx("input",{id:"google-client-secret",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client secret",value:a,onChange:b=>r(b.target.value)})]}),o.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",o.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),f&&o.jsx("p",{className:"text-xs text-rose-400",children:f}),p&&o.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),o.jsx(oe,{type:"button",size:"sm",disabled:!y||c,onClick:x,children:c?"Saving...":"Save Google OAuth app"})]})}function C$(){const[e,t]=w.useState(null),[s,a]=w.useState(null),[r,c]=w.useState(!1),[u,f]=w.useState("localhost"),[m,p]=w.useState("9222"),[v,y]=w.useState(!1);return w.useEffect(()=>{Hx().then(t).catch(x=>{const b=x instanceof Error?x.message:String(x);b.includes("501")||a(b)})},[]),o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),o.jsx("h2",{children:"ChatGPT (CDP)"})]}),o.jsx(lt,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&o.jsxs("div",{children:[o.jsx("dt",{children:"Endpoint"}),o.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&o.jsxs("div",{children:[o.jsx("dt",{children:"Browser"}),o.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&o.jsxs("div",{children:[o.jsx("dt",{children:"Tabs"}),o.jsx("dd",{children:e.targets.map(x=>o.jsxs("span",{className:"mr-2",children:[x.name,": ",x.alive?"● alive":"○ idle"]},x.name))})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:e?.connected?"Connected to Chrome via CDP. Launch Chrome with --remote-debugging-port to use this provider.":s||"Not configured. Set an endpoint below or run: canonry cdp connect --host localhost --port 9222"}),o.jsx("div",{className:"mt-2",children:o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>c(!r),children:r?"Cancel":e?.connected?"Update endpoint":"Configure"})}),r&&o.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async x=>{x.preventDefault(),y(!0);try{await _2(u,parseInt(m,10)||9222);const b=await Hx().catch(()=>null);b&&t(b),c(!1),Ke({title:"CDP endpoint saved",detail:`${u}:${parseInt(m,10)||9222} is now configured.`,tone:"positive",dedupeKey:"settings:cdp",dedupeMode:"replace"})}catch(b){a(b instanceof Error?b.message:String(b))}finally{y(!1)}},children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"localhost",value:u,onChange:x=>f(x.target.value),"aria-label":"CDP host"}),o.jsx("input",{className:"w-24 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"9222",value:m,onChange:x=>p(x.target.value),"aria-label":"CDP port"})]}),o.jsx("div",{children:o.jsx(oe,{type:"submit",size:"sm",disabled:v,children:v?"Saving…":"Save endpoint"})})]})]})}const k$={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function z$(){const e=pl(),{dashboard:t}=Oa(),s=t?.settings??e?.dashboard?.settings,c=ad(!e,e?.health).data??e?.health??k$,[u,f]=w.useState(null),[m,p]=w.useState(!1),[v,y]=w.useState(!1),[x,b]=w.useState(""),[N,S]=w.useState(!1),[C,k]=w.useState(null),[A,R]=w.useState(!1);return s?o.jsxs("div",{className:"page-container",children:[o.jsx("div",{className:"page-header",children:o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Settings"}),o.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),o.jsxs("section",{className:"settings-grid",children:[s.providerStatuses.map(z=>o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),o.jsx("h2",{children:z.displayName??z.name})]}),o.jsx(lt,{tone:z.state==="ready"?"positive":"caution",children:z.state==="ready"?"Ready":"Needs config"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Model"}),o.jsx("dd",{className:"font-mono text-xs",children:z.model})]}),z.quota&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Concurrency"}),o.jsx("dd",{children:z.quota.maxConcurrency})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Rate limit"}),o.jsxs("dd",{children:[z.quota.maxRequestsPerMinute,"/min · ",z.quota.maxRequestsPerDay,"/day"]})]})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:z.detail}),o.jsx("div",{className:"mt-2",children:o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>f(u===z.name?null:z.name),children:u===z.name?"Cancel":z.state==="ready"?z.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),u===z.name&&o.jsx(w$,{providerName:z.name,keyUrl:z.keyUrl,modelHint:z.modelHint,onSaved:()=>{f(null)}})]},z.name)),o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),o.jsx("h2",{children:"Search Console OAuth"})]}),o.jsx(lt,{tone:s.google.state==="ready"?"positive":"caution",children:s.google.state==="ready"?"Ready":"Needs config"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Auth model"}),o.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Storage"}),o.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:s.google.detail}),o.jsx("div",{className:"mt-2",children:o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>p(!m),children:m?"Cancel":s.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),m&&o.jsx(N$,{onSaved:()=>{p(!1)}})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),o.jsx("h2",{children:"Webmaster Tools"})]}),o.jsx(lt,{tone:s.bing.state==="ready"?"positive":"caution",children:s.bing.state==="ready"?"Ready":"Needs config"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Auth model"}),o.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Storage"}),o.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:s.bing.detail}),o.jsx("div",{className:"mt-2",children:o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!v),children:v?"Cancel":s.bing.state==="ready"?"Update API key":"Configure Bing"})}),v&&o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),o.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]}),o.jsx("input",{id:"bing-api-key",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:x,onChange:z=>b(z.target.value)})]}),o.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",o.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),C&&o.jsx("p",{className:"text-xs text-rose-400",children:C}),A&&o.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),o.jsx(oe,{type:"button",size:"sm",disabled:!x.trim()||N,onClick:async()=>{if(x.trim()){S(!0),k(null),R(!1);try{await L2(x.trim()),b(""),R(!0),y(!1),Ke({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(z){k(z instanceof Error?z.message:"Failed to update Bing API key")}finally{S(!1)}}},children:N?"Saving...":"Save Bing API key"})]})]}),o.jsx(C$,{}),o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),o.jsx("h2",{children:"API and worker"})]})}),o.jsxs("div",{className:"compact-stack",children:[o.jsxs("div",{className:"health-row",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:"API"}),o.jsx("p",{className:"supporting-copy",children:c.apiStatus.detail})]}),o.jsx(lt,{tone:Ru(c.apiStatus),children:c.apiStatus.state==="ok"?"Healthy":"Attention"})]}),o.jsxs("div",{className:"health-row",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:"Worker"}),o.jsx("p",{className:"supporting-copy",children:c.workerStatus.detail})]}),o.jsx(lt,{tone:Ru(c.workerStatus),children:c.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),o.jsx("section",{className:"page-section",children:o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),o.jsx("h2",{children:"Operational guidance"})]})}),o.jsx("ul",{className:"detail-list",children:s.selfHostNotes.map(z=>o.jsx("li",{children:z},z))}),o.jsx("p",{className:"supporting-copy",children:s.bootstrapNote})]})})]}):null}const _$=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Key phrases",description:"Add key phrases to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function E$({current:e,labels:t}){return o.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((s,a)=>{const r=a<e,c=a===e;return o.jsxs("div",{className:`setup-step ${r?"setup-step-done":""} ${c?"setup-step-active":""}`,role:"listitem","aria-current":c?"step":void 0,children:[o.jsx("span",{className:"setup-step-number",children:r?"✓":a+1}),o.jsx("span",{className:"setup-step-label",children:s.label})]},s.label)})})}function R$(){const e=pl(),{dashboard:t,isLoading:s,refetch:a}=Oa(),r=t??e?.dashboard;if(!r||s)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-24"}),o.jsx("div",{className:"skeleton-text-sm w-80"})]}),o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-32"}),o.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(ce=>o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1 flex-1",children:[o.jsx("div",{className:"skeleton-text w-24"}),o.jsx("div",{className:"skeleton-text-sm w-48"})]}),o.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},ce))})]})]});const c=r.settings,m=ad(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},p=A4(r.setup,m,c),v=Ii(),[y,x]=w.useState(0),[b,N]=w.useState(""),[S,C]=w.useState(""),[k,A]=w.useState(""),[R,z]=w.useState("US"),[O,M]=w.useState("en"),[E,L]=w.useState(null),[U,X]=w.useState(null),[Q,ee]=w.useState(null),[ue,ze]=w.useState(!1),[je,K]=w.useState(""),[ae,me]=w.useState(!1),[V,H]=w.useState(null),[T,B]=w.useState(!1),se=c.providerStatuses.filter(ce=>ce.state==="ready"),[le,J]=w.useState(se[0]?.name??""),[fe,ye]=w.useState(5),[_e,ge]=w.useState(!1),[Ze,et]=w.useState(null),[de,Ve]=w.useState(""),[at,Zt]=w.useState(!1),[$t,Dn]=w.useState(null),[nn,_t]=w.useState(!1),[re,Ge]=w.useState(!1),[gt,Vt]=w.useState(!1),Qe=qN(),De=b.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Ye=je.split(`
239
239
  `).map(ce=>ce.trim()).filter(Boolean),Nt=de.split(`