@ainyc/canonry 4.92.0 → 4.93.0

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.
Files changed (25) hide show
  1. package/assets/agent-workspace/skills/canonry/references/google-business-profile.md +6 -0
  2. package/assets/assets/{BacklinksPage-D3JpcWtH.js → BacklinksPage-nkgAbbjk.js} +1 -1
  3. package/assets/assets/{ChartPrimitives-DdwqEX5v.js → ChartPrimitives-kdfylr1f.js} +1 -1
  4. package/assets/assets/ProjectPage-BQYmq7FP.js +6 -0
  5. package/assets/assets/{RunRow-c_2jd8iz.js → RunRow-P-n5OkiY.js} +1 -1
  6. package/assets/assets/{RunsPage-D6eM_5tB.js → RunsPage-DfBb4WCS.js} +1 -1
  7. package/assets/assets/{SettingsPage-DaMc8nxK.js → SettingsPage-CRGuFgeK.js} +1 -1
  8. package/assets/assets/{TrafficPage-Dw16dcSc.js → TrafficPage-CMqP0AGZ.js} +1 -1
  9. package/assets/assets/{TrafficSourceDetailPage-Dy9D80dz.js → TrafficSourceDetailPage-XRGzkKWk.js} +1 -1
  10. package/assets/assets/{arrow-left-D8UaBG9a.js → arrow-left-BCR55g4n.js} +1 -1
  11. package/assets/assets/{extract-error-message-CfxCIMNJ.js → extract-error-message-BG1AlucT.js} +1 -1
  12. package/assets/assets/{index-BA-lh2pG.js → index-BPjIZIDO.js} +73 -73
  13. package/assets/assets/{index-fLUYE9Z5.css → index-DiykVUPr.css} +1 -1
  14. package/assets/assets/{trash-2-j1tX1-Kq.js → trash-2-Cme1gNjU.js} +1 -1
  15. package/assets/index.html +2 -2
  16. package/dist/{chunk-QYC2N23P.js → chunk-ADTLQHJY.js} +69 -5
  17. package/dist/{chunk-VJPVFCZW.js → chunk-AUQNKEHV.js} +18 -0
  18. package/dist/{chunk-IFUHXONX.js → chunk-KBDQ5OE4.js} +166 -56
  19. package/dist/{chunk-HW4GVIQD.js → chunk-PK46TKGM.js} +33 -1
  20. package/dist/cli.js +36 -4
  21. package/dist/index.js +4 -4
  22. package/dist/{intelligence-service-24HCX4SJ.js → intelligence-service-4ATCJITP.js} +2 -2
  23. package/dist/mcp.js +2 -2
  24. package/package.json +9 -9
  25. package/assets/assets/ProjectPage-BPLf4U3A.js +0 -6
@@ -1,19 +1,19 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProjectPage-BPLf4U3A.js","./vendor-tanstack-Dq7p98wZ.js","./RunRow-c_2jd8iz.js","./ChartPrimitives-DdwqEX5v.js","./extract-error-message-CfxCIMNJ.js","./vendor-recharts-ClRVR6aX.js","./trash-2-j1tX1-Kq.js","./vendor-radix-B57xfQbP.js","./vendor-markdown-DK7fbRNb.js","./RunsPage-D6eM_5tB.js","./SettingsPage-DaMc8nxK.js","./BacklinksPage-D3JpcWtH.js","./TrafficPage-Dw16dcSc.js","./arrow-left-D8UaBG9a.js","./TrafficSourceDetailPage-Dy9D80dz.js"])))=>i.map(i=>d[i]);
2
- import{c as jw,d as Nw,Q as kw,M as Aw,r as U,q as Ee,j as f,L as rt,a as _w,e as _s,u as dn,f as Cw,h as hc,k as zw,l as Tw,m as uv,O as bf,n as Ja,o as zi,p as Ew,s as Ct,t as dv,v as Gs,x as Ow,y as Dw,z as Rw}from"./vendor-tanstack-Dq7p98wZ.js";import{S as Mw,O as Vf,P as fv,C as Pf,a as pv,T as Gf,D as mv,R as hv}from"./vendor-radix-B57xfQbP.js";import{c as gv}from"./vendor-recharts-ClRVR6aX.js";import{M as Bw}from"./vendor-markdown-DK7fbRNb.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var Fd={exports:{}},Jr={},Wd={exports:{}},ef={};var qy;function Lw(){return qy||(qy=1,(function(e){function n(B,J){var fe=B.length;B.push(J);e:for(;0<fe;){var Se=fe-1>>>1,re=B[Se];if(0<l(re,J))B[Se]=J,B[fe]=re,fe=Se;else break e}}function i(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var J=B[0],fe=B.pop();if(fe!==J){B[0]=fe;e:for(var Se=0,re=B.length,Ze=re>>>1;Se<Ze;){var W=2*(Se+1)-1,ue=B[W],te=W+1,de=B[te];if(0>l(ue,fe))te<re&&0>l(de,ue)?(B[Se]=de,B[te]=fe,Se=te):(B[Se]=ue,B[W]=fe,Se=W);else if(te<re&&0>l(de,fe))B[Se]=de,B[te]=fe,Se=te;else break e}}return J}function l(B,J){var fe=B.sortIndex-J.sortIndex;return fe!==0?fe:B.id-J.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();e.unstable_now=function(){return d.now()-h}}var g=[],b=[],S=1,x=null,N=3,_=!1,T=!1,k=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function Z(B){for(var J=i(b);J!==null;){if(J.callback===null)r(b);else if(J.startTime<=B)r(b),J.sortIndex=J.expirationTime,n(g,J);else break;J=i(b)}}function X(B){if(k=!1,Z(B),!T)if(i(g)!==null)T=!0,F||(F=!0,be());else{var J=i(b);J!==null&&ee(X,J.startTime-B)}}var F=!1,O=-1,M=5,le=-1;function ke(){return E?!0:!(e.unstable_now()-le<M)}function _e(){if(E=!1,F){var B=e.unstable_now();le=B;var J=!0;try{e:{T=!1,k&&(k=!1,V(O),O=-1),_=!0;var fe=N;try{t:{for(Z(B),x=i(g);x!==null&&!(x.expirationTime>B&&ke());){var Se=x.callback;if(typeof Se=="function"){x.callback=null,N=x.priorityLevel;var re=Se(x.expirationTime<=B);if(B=e.unstable_now(),typeof re=="function"){x.callback=re,Z(B),J=!0;break t}x===i(g)&&r(g),Z(B)}else r(g);x=i(g)}if(x!==null)J=!0;else{var Ze=i(b);Ze!==null&&ee(X,Ze.startTime-B),J=!1}}break e}finally{x=null,N=fe,_=!1}J=void 0}}finally{J?be():F=!1}}}var be;if(typeof G=="function")be=function(){G(_e)};else if(typeof MessageChannel<"u"){var tt=new MessageChannel,Ke=tt.port2;tt.port1.onmessage=_e,be=function(){Ke.postMessage(null)}}else be=function(){R(_e,0)};function ee(B,J){O=R(function(){B(e.unstable_now())},J)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return N},e.unstable_next=function(B){switch(N){case 1:case 2:case 3:var J=3;break;default:J=N}var fe=N;N=J;try{return B()}finally{N=fe}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(B,J){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var fe=N;N=B;try{return J()}finally{N=fe}},e.unstable_scheduleCallback=function(B,J,fe){var Se=e.unstable_now();switch(typeof fe=="object"&&fe!==null?(fe=fe.delay,fe=typeof fe=="number"&&0<fe?Se+fe:Se):fe=Se,B){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=fe+re,B={id:S++,callback:J,priorityLevel:B,startTime:fe,expirationTime:re,sortIndex:-1},fe>Se?(B.sortIndex=fe,n(b,B),i(g)===null&&B===i(b)&&(k?(V(O),O=-1):k=!0,ee(X,fe-Se))):(B.sortIndex=re,n(g,B),T||_||(T=!0,F||(F=!0,be()))),B},e.unstable_shouldYield=ke,e.unstable_wrapCallback=function(B){var J=N;return function(){var fe=N;N=J;try{return B.apply(this,arguments)}finally{N=fe}}}})(ef)),ef}var Uy;function qw(){return Uy||(Uy=1,Wd.exports=Lw()),Wd.exports}var $y;function Uw(){if($y)return Jr;$y=1;var e=qw(),n=jw(),i=Nw();function r(t){var a="https://react.dev/errors/"+t;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var a=t,s=t;if(t.alternate)for(;a.return;)a=a.return;else{t=a;do a=t,(a.flags&4098)!==0&&(s=a.return),t=a.return;while(t)}return a.tag===3?s:null}function d(t){if(t.tag===13){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function h(t){if(t.tag===31){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(r(188))}function b(t){var a=t.alternate;if(!a){if(a=c(t),a===null)throw Error(r(188));return a!==t?null:t}for(var s=t,o=a;;){var u=s.return;if(u===null)break;var m=u.alternate;if(m===null){if(o=u.return,o!==null){s=o;continue}break}if(u.child===m.child){for(m=u.child;m;){if(m===s)return g(u),t;if(m===o)return g(u),a;m=m.sibling}throw Error(r(188))}if(s.return!==o.return)s=u,o=m;else{for(var y=!1,w=u.child;w;){if(w===s){y=!0,s=u,o=m;break}if(w===o){y=!0,o=u,s=m;break}w=w.sibling}if(!y){for(w=m.child;w;){if(w===s){y=!0,s=m,o=u;break}if(w===o){y=!0,o=m,s=u;break}w=w.sibling}if(!y)throw Error(r(189))}}if(s.alternate!==o)throw Error(r(190))}if(s.tag!==3)throw Error(r(188));return s.stateNode.current===s?t:a}function S(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=S(t),a!==null)return a;t=t.sibling}return null}var x=Object.assign,N=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),G=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),ke=Symbol.for("react.memo_cache_sentinel"),_e=Symbol.iterator;function be(t){return t===null||typeof t!="object"?null:(t=_e&&t[_e]||t["@@iterator"],typeof t=="function"?t:null)}var tt=Symbol.for("react.client.reference");function Ke(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===tt?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case k:return"Fragment";case R:return"Profiler";case E:return"StrictMode";case X:return"Suspense";case F:return"SuspenseList";case le:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case T:return"Portal";case G:return t.displayName||"Context";case V:return(t._context.displayName||"Context")+".Consumer";case Z:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case O:return a=t.displayName||null,a!==null?a:Ke(t.type)||"Memo";case M:a=t._payload,t=t._init;try{return Ke(t(a))}catch{}}return null}var ee=Array.isArray,B=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},Se=[],re=-1;function Ze(t){return{current:t}}function W(t){0>re||(t.current=Se[re],Se[re]=null,re--)}function ue(t,a){re++,Se[re]=t.current,t.current=a}var te=Ze(null),de=Ze(null),ae=Ze(null),je=Ze(null);function nt(t,a){switch(ue(ae,a),ue(de,t),ue(te,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?oy(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=oy(a),t=ly(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}W(te),ue(te,t)}function xe(){W(te),W(de),W(ae)}function Ue(t){t.memoizedState!==null&&ue(je,t);var a=te.current,s=ly(a,t.type);a!==s&&(ue(de,t),ue(te,s))}function Ge(t){de.current===t&&(W(te),W(de)),je.current===t&&(W(je),Kr._currentValue=fe)}var Et,zn;function Ot(t){if(Et===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);Et=a&&a[1]||"",zn=-1<s.stack.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProjectPage-BQYmq7FP.js","./vendor-tanstack-Dq7p98wZ.js","./RunRow-P-n5OkiY.js","./ChartPrimitives-kdfylr1f.js","./extract-error-message-BG1AlucT.js","./vendor-recharts-ClRVR6aX.js","./trash-2-Cme1gNjU.js","./vendor-radix-B57xfQbP.js","./vendor-markdown-DK7fbRNb.js","./RunsPage-DfBb4WCS.js","./SettingsPage-CRGuFgeK.js","./BacklinksPage-nkgAbbjk.js","./TrafficPage-CMqP0AGZ.js","./arrow-left-BCR55g4n.js","./TrafficSourceDetailPage-XRGzkKWk.js"])))=>i.map(i=>d[i]);
2
+ import{c as jw,d as Nw,Q as kw,M as Aw,r as U,q as Te,j as f,L as rt,a as _w,e as _s,u as dn,f as Cw,h as hc,k as zw,l as Tw,m as dv,O as bf,n as Ja,o as zi,p as Ew,s as Ct,t as fv,v as Gs,x as Ow,y as Dw,z as Rw}from"./vendor-tanstack-Dq7p98wZ.js";import{S as Mw,O as Vf,P as pv,C as Pf,a as mv,T as Gf,D as hv,R as gv}from"./vendor-radix-B57xfQbP.js";import{c as yv}from"./vendor-recharts-ClRVR6aX.js";import{M as Bw}from"./vendor-markdown-DK7fbRNb.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var Fd={exports:{}},Jr={},Wd={exports:{}},ef={};var Uy;function Lw(){return Uy||(Uy=1,(function(e){function n(B,J){var fe=B.length;B.push(J);e:for(;0<fe;){var Se=fe-1>>>1,re=B[Se];if(0<l(re,J))B[Se]=J,B[fe]=re,fe=Se;else break e}}function i(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var J=B[0],fe=B.pop();if(fe!==J){B[0]=fe;e:for(var Se=0,re=B.length,Ze=re>>>1;Se<Ze;){var W=2*(Se+1)-1,ue=B[W],te=W+1,de=B[te];if(0>l(ue,fe))te<re&&0>l(de,ue)?(B[Se]=de,B[te]=fe,Se=te):(B[Se]=ue,B[W]=fe,Se=W);else if(te<re&&0>l(de,fe))B[Se]=de,B[te]=fe,Se=te;else break e}}return J}function l(B,J){var fe=B.sortIndex-J.sortIndex;return fe!==0?fe:B.id-J.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();e.unstable_now=function(){return d.now()-h}}var g=[],v=[],S=1,x=null,N=3,_=!1,T=!1,k=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function Z(B){for(var J=i(v);J!==null;){if(J.callback===null)r(v);else if(J.startTime<=B)r(v),J.sortIndex=J.expirationTime,n(g,J);else break;J=i(v)}}function X(B){if(k=!1,Z(B),!T)if(i(g)!==null)T=!0,F||(F=!0,be());else{var J=i(v);J!==null&&ee(X,J.startTime-B)}}var F=!1,O=-1,M=5,le=-1;function ke(){return E?!0:!(e.unstable_now()-le<M)}function Ce(){if(E=!1,F){var B=e.unstable_now();le=B;var J=!0;try{e:{T=!1,k&&(k=!1,V(O),O=-1),_=!0;var fe=N;try{t:{for(Z(B),x=i(g);x!==null&&!(x.expirationTime>B&&ke());){var Se=x.callback;if(typeof Se=="function"){x.callback=null,N=x.priorityLevel;var re=Se(x.expirationTime<=B);if(B=e.unstable_now(),typeof re=="function"){x.callback=re,Z(B),J=!0;break t}x===i(g)&&r(g),Z(B)}else r(g);x=i(g)}if(x!==null)J=!0;else{var Ze=i(v);Ze!==null&&ee(X,Ze.startTime-B),J=!1}}break e}finally{x=null,N=fe,_=!1}J=void 0}}finally{J?be():F=!1}}}var be;if(typeof G=="function")be=function(){G(Ce)};else if(typeof MessageChannel<"u"){var tt=new MessageChannel,Ke=tt.port2;tt.port1.onmessage=Ce,be=function(){Ke.postMessage(null)}}else be=function(){R(Ce,0)};function ee(B,J){O=R(function(){B(e.unstable_now())},J)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return N},e.unstable_next=function(B){switch(N){case 1:case 2:case 3:var J=3;break;default:J=N}var fe=N;N=J;try{return B()}finally{N=fe}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(B,J){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var fe=N;N=B;try{return J()}finally{N=fe}},e.unstable_scheduleCallback=function(B,J,fe){var Se=e.unstable_now();switch(typeof fe=="object"&&fe!==null?(fe=fe.delay,fe=typeof fe=="number"&&0<fe?Se+fe:Se):fe=Se,B){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=fe+re,B={id:S++,callback:J,priorityLevel:B,startTime:fe,expirationTime:re,sortIndex:-1},fe>Se?(B.sortIndex=fe,n(v,B),i(g)===null&&B===i(v)&&(k?(V(O),O=-1):k=!0,ee(X,fe-Se))):(B.sortIndex=re,n(g,B),T||_||(T=!0,F||(F=!0,be()))),B},e.unstable_shouldYield=ke,e.unstable_wrapCallback=function(B){var J=N;return function(){var fe=N;N=J;try{return B.apply(this,arguments)}finally{N=fe}}}})(ef)),ef}var $y;function qw(){return $y||($y=1,Wd.exports=Lw()),Wd.exports}var Iy;function Uw(){if(Iy)return Jr;Iy=1;var e=qw(),n=jw(),i=Nw();function r(t){var a="https://react.dev/errors/"+t;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var a=t,s=t;if(t.alternate)for(;a.return;)a=a.return;else{t=a;do a=t,(a.flags&4098)!==0&&(s=a.return),t=a.return;while(t)}return a.tag===3?s:null}function d(t){if(t.tag===13){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function h(t){if(t.tag===31){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(r(188))}function v(t){var a=t.alternate;if(!a){if(a=c(t),a===null)throw Error(r(188));return a!==t?null:t}for(var s=t,o=a;;){var u=s.return;if(u===null)break;var m=u.alternate;if(m===null){if(o=u.return,o!==null){s=o;continue}break}if(u.child===m.child){for(m=u.child;m;){if(m===s)return g(u),t;if(m===o)return g(u),a;m=m.sibling}throw Error(r(188))}if(s.return!==o.return)s=u,o=m;else{for(var y=!1,j=u.child;j;){if(j===s){y=!0,s=u,o=m;break}if(j===o){y=!0,o=u,s=m;break}j=j.sibling}if(!y){for(j=m.child;j;){if(j===s){y=!0,s=m,o=u;break}if(j===o){y=!0,o=m,s=u;break}j=j.sibling}if(!y)throw Error(r(189))}}if(s.alternate!==o)throw Error(r(190))}if(s.tag!==3)throw Error(r(188));return s.stateNode.current===s?t:a}function S(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=S(t),a!==null)return a;t=t.sibling}return null}var x=Object.assign,N=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),G=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),le=Symbol.for("react.activity"),ke=Symbol.for("react.memo_cache_sentinel"),Ce=Symbol.iterator;function be(t){return t===null||typeof t!="object"?null:(t=Ce&&t[Ce]||t["@@iterator"],typeof t=="function"?t:null)}var tt=Symbol.for("react.client.reference");function Ke(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===tt?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case k:return"Fragment";case R:return"Profiler";case E:return"StrictMode";case X:return"Suspense";case F:return"SuspenseList";case le:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case T:return"Portal";case G:return t.displayName||"Context";case V:return(t._context.displayName||"Context")+".Consumer";case Z:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case O:return a=t.displayName||null,a!==null?a:Ke(t.type)||"Memo";case M:a=t._payload,t=t._init;try{return Ke(t(a))}catch{}}return null}var ee=Array.isArray,B=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},Se=[],re=-1;function Ze(t){return{current:t}}function W(t){0>re||(t.current=Se[re],Se[re]=null,re--)}function ue(t,a){re++,Se[re]=t.current,t.current=a}var te=Ze(null),de=Ze(null),ae=Ze(null),je=Ze(null);function nt(t,a){switch(ue(ae,a),ue(de,t),ue(te,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?ly(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=ly(a),t=cy(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}W(te),ue(te,t)}function xe(){W(te),W(de),W(ae)}function Ue(t){t.memoizedState!==null&&ue(je,t);var a=te.current,s=cy(a,t.type);a!==s&&(ue(de,t),ue(te,s))}function Ge(t){de.current===t&&(W(te),W(de)),je.current===t&&(W(je),Kr._currentValue=fe)}var Et,zn;function Ot(t){if(Et===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);Et=a&&a[1]||"",zn=-1<s.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
4
- `+Et+t+zn}var nr=!1;function Di(t,a){if(!t||nr)return"";nr=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(a){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(I){var $=I}Reflect.construct(t,[],Y)}else{try{Y.call()}catch(I){$=I}t.call(Y.prototype)}}else{try{throw Error()}catch(I){$=I}(Y=t())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(I){if(I&&$&&typeof I.stack=="string")return[I.stack,$.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=o.DetermineComponentFrameRoot(),y=m[0],w=m[1];if(y&&w){var C=y.split(`
5
- `),q=w.split(`
4
+ `+Et+t+zn}var nr=!1;function Di(t,a){if(!t||nr)return"";nr=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(a){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(I){var $=I}Reflect.construct(t,[],Y)}else{try{Y.call()}catch(I){$=I}t.call(Y.prototype)}}else{try{throw Error()}catch(I){$=I}(Y=t())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(I){if(I&&$&&typeof I.stack=="string")return[I.stack,$.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=o.DetermineComponentFrameRoot(),y=m[0],j=m[1];if(y&&j){var C=y.split(`
5
+ `),q=j.split(`
6
6
  `);for(u=o=0;o<C.length&&!C[o].includes("DetermineComponentFrameRoot");)o++;for(;u<q.length&&!q[u].includes("DetermineComponentFrameRoot");)u++;if(o===C.length||u===q.length)for(o=C.length-1,u=q.length-1;1<=o&&0<=u&&C[o]!==q[u];)u--;for(;1<=o&&0<=u;o--,u--)if(C[o]!==q[u]){if(o!==1||u!==1)do if(o--,u--,0>u||C[o]!==q[u]){var P=`
7
7
  `+C[o].replace(" at new "," at ");return t.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",t.displayName)),P}while(1<=o&&0<=u);break}}}finally{nr=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Ot(s):""}function Uc(t,a){switch(t.tag){case 26:case 27:case 5:return Ot(t.type);case 16:return Ot("Lazy");case 13:return t.child!==a&&a!==null?Ot("Suspense Fallback"):Ot("Suspense");case 19:return Ot("SuspenseList");case 0:case 15:return Di(t.type,!1);case 11:return Di(t.type.render,!1);case 1:return Di(t.type,!0);case 31:return Ot("Activity");default:return""}}function ar(t){try{var a="",s=null;do a+=Uc(t,s),s=t,t=t.return;while(t);return a}catch(o){return`
8
8
  Error generating stack: `+o.message+`
9
- `+o.stack}}var Ri=Object.prototype.hasOwnProperty,Mi=e.unstable_scheduleCallback,Bi=e.unstable_cancelCallback,xo=e.unstable_shouldYield,$c=e.unstable_requestPaint,Ut=e.unstable_now,wo=e.unstable_getCurrentPriorityLevel,ir=e.unstable_ImmediatePriority,jo=e.unstable_UserBlockingPriority,Li=e.unstable_NormalPriority,Ic=e.unstable_LowPriority,qi=e.unstable_IdlePriority,No=e.log,sr=e.unstable_setDisableYieldValue,va=null,$t=null;function Tn(t){if(typeof No=="function"&&sr(t),$t&&typeof $t.setStrictMode=="function")try{$t.setStrictMode(va,t)}catch{}}var ht=Math.clz32?Math.clz32:Vc,$n=Math.log,ti=Math.LN2;function Vc(t){return t>>>=0,t===0?32:31-($n(t)/ti|0)|0}var Ui=256,$i=262144,Ii=4194304;function Zn(t){var a=t&42;if(a!==0)return a;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Vi(t,a,s){var o=t.pendingLanes;if(o===0)return 0;var u=0,m=t.suspendedLanes,y=t.pingedLanes;t=t.warmLanes;var w=o&134217727;return w!==0?(o=w&~m,o!==0?u=Zn(o):(y&=w,y!==0?u=Zn(y):s||(s=w&~t,s!==0&&(u=Zn(s))))):(w=o&~m,w!==0?u=Zn(w):y!==0?u=Zn(y):s||(s=o&~t,s!==0&&(u=Zn(s)))),u===0?0:a!==0&&a!==u&&(a&m)===0&&(m=u&-u,s=a&-a,m>=s||m===32&&(s&4194048)!==0)?a:u}function ni(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function Yn(t,a){switch(t){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 ko(){var t=Ii;return Ii<<=1,(Ii&62914560)===0&&(Ii=4194304),t}function ne(t){for(var a=[],s=0;31>s;s++)a.push(t);return a}function Fe(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ai(t,a,s,o,u,m){var y=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var w=t.entanglements,C=t.expirationTimes,q=t.hiddenUpdates;for(s=y&~s;0<s;){var P=31-ht(s),Y=1<<P;w[P]=0,C[P]=-1;var $=q[P];if($!==null)for(q[P]=null,P=0;P<$.length;P++){var I=$[P];I!==null&&(I.lane&=-536870913)}s&=~Y}o!==0&&Ao(t,o,0),m!==0&&u===0&&t.tag!==0&&(t.suspendedLanes|=m&~(y&~a))}function Ao(t,a,s){t.pendingLanes|=a,t.suspendedLanes&=~a;var o=31-ht(a);t.entangledLanes|=a,t.entanglements[o]=t.entanglements[o]|1073741824|s&261930}function _o(t,a){var s=t.entangledLanes|=a;for(t=t.entanglements;s;){var o=31-ht(s),u=1<<o;u&a|t[o]&a&&(t[o]|=a),s&=~u}}function rr(t,a){var s=a&-a;return s=(s&42)!==0?1:or(s),(s&(t.suspendedLanes|a))!==0?0:s}function or(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function En(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Qp(){var t=J.p;return t!==0?t:(t=window.event,t===void 0?32:Ey(t.type))}function Kp(t,a){var s=J.p;try{return J.p=t,a()}finally{J.p=s}}var Sa=Math.random().toString(36).slice(2),Dt="__reactFiber$"+Sa,Kt="__reactProps$"+Sa,Pi="__reactContainer$"+Sa,Pc="__reactEvents$"+Sa,f1="__reactListeners$"+Sa,p1="__reactHandles$"+Sa,Zp="__reactResources$"+Sa,lr="__reactMarker$"+Sa;function Gc(t){delete t[Dt],delete t[Kt],delete t[Pc],delete t[f1],delete t[p1]}function Gi(t){var a=t[Dt];if(a)return a;for(var s=t.parentNode;s;){if(a=s[Pi]||s[Dt]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(t=hy(t);t!==null;){if(s=t[Dt])return s;t=hy(t)}return a}t=s,s=t.parentNode}return null}function Hi(t){if(t=t[Dt]||t[Pi]){var a=t.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return t}return null}function cr(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t.stateNode;throw Error(r(33))}function Qi(t){var a=t[Zp];return a||(a=t[Zp]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function zt(t){t[lr]=!0}var Yp=new Set,Xp={};function ii(t,a){Ki(t,a),Ki(t+"Capture",a)}function Ki(t,a){for(Xp[t]=a,t=0;t<a.length;t++)Yp.add(a[t])}var m1=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]*$"),Jp={},Fp={};function h1(t){return Ri.call(Fp,t)?!0:Ri.call(Jp,t)?!1:m1.test(t)?Fp[t]=!0:(Jp[t]=!0,!1)}function Co(t,a,s){if(h1(a))if(s===null)t.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(a);return;case"boolean":var o=a.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(a);return}}t.setAttribute(a,""+s)}}function zo(t,a,s){if(s===null)t.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttribute(a,""+s)}}function Xn(t,a,s,o){if(o===null)t.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(a,s,""+o)}}function fn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Wp(t){var a=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function g1(t,a,s){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,a);if(!t.hasOwnProperty(a)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,m=o.set;return Object.defineProperty(t,a,{configurable:!0,get:function(){return u.call(this)},set:function(y){s=""+y,m.call(this,y)}}),Object.defineProperty(t,a,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(y){s=""+y},stopTracking:function(){t._valueTracker=null,delete t[a]}}}}function Hc(t){if(!t._valueTracker){var a=Wp(t)?"checked":"value";t._valueTracker=g1(t,a,""+t[a])}}function em(t){if(!t)return!1;var a=t._valueTracker;if(!a)return!0;var s=a.getValue(),o="";return t&&(o=Wp(t)?t.checked?"true":"false":t.value),t=o,t!==s?(a.setValue(t),!0):!1}function To(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var y1=/[\n"\\]/g;function pn(t){return t.replace(y1,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Qc(t,a,s,o,u,m,y,w){t.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?t.type=y:t.removeAttribute("type"),a!=null?y==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+fn(a)):t.value!==""+fn(a)&&(t.value=""+fn(a)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),a!=null?Kc(t,y,fn(a)):s!=null?Kc(t,y,fn(s)):o!=null&&t.removeAttribute("value"),u==null&&m!=null&&(t.defaultChecked=!!m),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.name=""+fn(w):t.removeAttribute("name")}function tm(t,a,s,o,u,m,y,w){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),a!=null||s!=null){if(!(m!=="submit"&&m!=="reset"||a!=null)){Hc(t);return}s=s!=null?""+fn(s):"",a=a!=null?""+fn(a):s,w||a===t.value||(t.value=a),t.defaultValue=a}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=w?t.checked:!!o,t.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),Hc(t)}function Kc(t,a,s){a==="number"&&To(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function Zi(t,a,s,o){if(t=t.options,a){a={};for(var u=0;u<s.length;u++)a["$"+s[u]]=!0;for(s=0;s<t.length;s++)u=a.hasOwnProperty("$"+t[s].value),t[s].selected!==u&&(t[s].selected=u),u&&o&&(t[s].defaultSelected=!0)}else{for(s=""+fn(s),a=null,u=0;u<t.length;u++){if(t[u].value===s){t[u].selected=!0,o&&(t[u].defaultSelected=!0);return}a!==null||t[u].disabled||(a=t[u])}a!==null&&(a.selected=!0)}}function nm(t,a,s){if(a!=null&&(a=""+fn(a),a!==t.value&&(t.value=a),s==null)){t.defaultValue!==a&&(t.defaultValue=a);return}t.defaultValue=s!=null?""+fn(s):""}function am(t,a,s,o){if(a==null){if(o!=null){if(s!=null)throw Error(r(92));if(ee(o)){if(1<o.length)throw Error(r(93));o=o[0]}s=o}s==null&&(s=""),a=s}s=fn(a),t.defaultValue=s,o=t.textContent,o===s&&o!==""&&o!==null&&(t.value=o),Hc(t)}function Yi(t,a){if(a){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=a;return}}t.textContent=a}var b1=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 im(t,a,s){var o=a.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="":o?t.setProperty(a,s):typeof s!="number"||s===0||b1.has(a)?a==="float"?t.cssFloat=s:t[a]=(""+s).trim():t[a]=s+"px"}function sm(t,a,s){if(a!=null&&typeof a!="object")throw Error(r(62));if(t=t.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||a!=null&&a.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var u in a)o=a[u],a.hasOwnProperty(u)&&s[u]!==o&&im(t,u,o)}else for(var m in a)a.hasOwnProperty(m)&&im(t,m,a[m])}function Zc(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var v1=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"]]),S1=/^[\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 Eo(t){return S1.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Jn(){}var Yc=null;function Xc(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Xi=null,Ji=null;function rm(t){var a=Hi(t);if(a&&(t=a.stateNode)){var s=t[Kt]||null;e:switch(t=a.stateNode,a.type){case"input":if(Qc(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),a=s.name,s.type==="radio"&&a!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+pn(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var o=s[a];if(o!==t&&o.form===t.form){var u=o[Kt]||null;if(!u)throw Error(r(90));Qc(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(a=0;a<s.length;a++)o=s[a],o.form===t.form&&em(o)}break e;case"textarea":nm(t,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&Zi(t,!!s.multiple,a,!1)}}}var Jc=!1;function om(t,a,s){if(Jc)return t(a,s);Jc=!0;try{var o=t(a);return o}finally{if(Jc=!1,(Xi!==null||Ji!==null)&&(bl(),Xi&&(a=Xi,t=Ji,Ji=Xi=null,rm(a),t)))for(a=0;a<t.length;a++)rm(t[a])}}function ur(t,a){var s=t.stateNode;if(s===null)return null;var o=s[Kt]||null;if(o===null)return null;s=o[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(r(231,a,typeof s));return s}var Fn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fc=!1;if(Fn)try{var dr={};Object.defineProperty(dr,"passive",{get:function(){Fc=!0}}),window.addEventListener("test",dr,dr),window.removeEventListener("test",dr,dr)}catch{Fc=!1}var xa=null,Wc=null,Oo=null;function lm(){if(Oo)return Oo;var t,a=Wc,s=a.length,o,u="value"in xa?xa.value:xa.textContent,m=u.length;for(t=0;t<s&&a[t]===u[t];t++);var y=s-t;for(o=1;o<=y&&a[s-o]===u[m-o];o++);return Oo=u.slice(t,1<o?1-o:void 0)}function Do(t){var a=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&a===13&&(t=13)):t=a,t===10&&(t=13),32<=t||t===13?t:0}function Ro(){return!0}function cm(){return!1}function Zt(t){function a(s,o,u,m,y){this._reactName=s,this._targetInst=u,this.type=o,this.nativeEvent=m,this.target=y,this.currentTarget=null;for(var w in t)t.hasOwnProperty(w)&&(s=t[w],this[w]=s?s(m):m[w]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Ro:cm,this.isPropagationStopped=cm,this}return x(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Ro)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ro)},persist:function(){},isPersistent:Ro}),a}var si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mo=Zt(si),fr=x({},si,{view:0,detail:0}),x1=Zt(fr),eu,tu,pr,Bo=x({},fr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:au,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==pr&&(pr&&t.type==="mousemove"?(eu=t.screenX-pr.screenX,tu=t.screenY-pr.screenY):tu=eu=0,pr=t),eu)},movementY:function(t){return"movementY"in t?t.movementY:tu}}),um=Zt(Bo),w1=x({},Bo,{dataTransfer:0}),j1=Zt(w1),N1=x({},fr,{relatedTarget:0}),nu=Zt(N1),k1=x({},si,{animationName:0,elapsedTime:0,pseudoElement:0}),A1=Zt(k1),_1=x({},si,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),C1=Zt(_1),z1=x({},si,{data:0}),dm=Zt(z1),T1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},E1={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"},O1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function D1(t){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(t):(t=O1[t])?!!a[t]:!1}function au(){return D1}var R1=x({},fr,{key:function(t){if(t.key){var a=T1[t.key]||t.key;if(a!=="Unidentified")return a}return t.type==="keypress"?(t=Do(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?E1[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:au,charCode:function(t){return t.type==="keypress"?Do(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Do(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),M1=Zt(R1),B1=x({},Bo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fm=Zt(B1),L1=x({},fr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:au}),q1=Zt(L1),U1=x({},si,{propertyName:0,elapsedTime:0,pseudoElement:0}),$1=Zt(U1),I1=x({},Bo,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),V1=Zt(I1),P1=x({},si,{newState:0,oldState:0}),G1=Zt(P1),H1=[9,13,27,32],iu=Fn&&"CompositionEvent"in window,mr=null;Fn&&"documentMode"in document&&(mr=document.documentMode);var Q1=Fn&&"TextEvent"in window&&!mr,pm=Fn&&(!iu||mr&&8<mr&&11>=mr),mm=" ",hm=!1;function gm(t,a){switch(t){case"keyup":return H1.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ym(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Fi=!1;function K1(t,a){switch(t){case"compositionend":return ym(a);case"keypress":return a.which!==32?null:(hm=!0,mm);case"textInput":return t=a.data,t===mm&&hm?null:t;default:return null}}function Z1(t,a){if(Fi)return t==="compositionend"||!iu&&gm(t,a)?(t=lm(),Oo=Wc=xa=null,Fi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return pm&&a.locale!=="ko"?null:a.data;default:return null}}var Y1={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 bm(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a==="input"?!!Y1[t.type]:a==="textarea"}function vm(t,a,s,o){Xi?Ji?Ji.push(o):Ji=[o]:Xi=o,a=kl(a,"onChange"),0<a.length&&(s=new Mo("onChange","change",null,s,o),t.push({event:s,listeners:a}))}var hr=null,gr=null;function X1(t){ty(t,0)}function Lo(t){var a=cr(t);if(em(a))return t}function Sm(t,a){if(t==="change")return a}var xm=!1;if(Fn){var su;if(Fn){var ru="oninput"in document;if(!ru){var wm=document.createElement("div");wm.setAttribute("oninput","return;"),ru=typeof wm.oninput=="function"}su=ru}else su=!1;xm=su&&(!document.documentMode||9<document.documentMode)}function jm(){hr&&(hr.detachEvent("onpropertychange",Nm),gr=hr=null)}function Nm(t){if(t.propertyName==="value"&&Lo(gr)){var a=[];vm(a,gr,t,Xc(t)),om(X1,a)}}function J1(t,a,s){t==="focusin"?(jm(),hr=a,gr=s,hr.attachEvent("onpropertychange",Nm)):t==="focusout"&&jm()}function F1(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Lo(gr)}function W1(t,a){if(t==="click")return Lo(a)}function ex(t,a){if(t==="input"||t==="change")return Lo(a)}function tx(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}var an=typeof Object.is=="function"?Object.is:tx;function yr(t,a){if(an(t,a))return!0;if(typeof t!="object"||t===null||typeof a!="object"||a===null)return!1;var s=Object.keys(t),o=Object.keys(a);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var u=s[o];if(!Ri.call(a,u)||!an(t[u],a[u]))return!1}return!0}function km(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Am(t,a){var s=km(t);t=0;for(var o;s;){if(s.nodeType===3){if(o=t+s.textContent.length,t<=a&&o>=a)return{node:s,offset:a-t};t=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=km(s)}}function _m(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?_m(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function Cm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=To(t.document);a instanceof t.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)t=a.contentWindow;else break;a=To(t.document)}return a}function ou(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a&&(a==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||a==="textarea"||t.contentEditable==="true")}var nx=Fn&&"documentMode"in document&&11>=document.documentMode,Wi=null,lu=null,br=null,cu=!1;function zm(t,a,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;cu||Wi==null||Wi!==To(o)||(o=Wi,"selectionStart"in o&&ou(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),br&&yr(br,o)||(br=o,o=kl(lu,"onSelect"),0<o.length&&(a=new Mo("onSelect","select",null,a,s),t.push({event:a,listeners:o}),a.target=Wi)))}function ri(t,a){var s={};return s[t.toLowerCase()]=a.toLowerCase(),s["Webkit"+t]="webkit"+a,s["Moz"+t]="moz"+a,s}var es={animationend:ri("Animation","AnimationEnd"),animationiteration:ri("Animation","AnimationIteration"),animationstart:ri("Animation","AnimationStart"),transitionrun:ri("Transition","TransitionRun"),transitionstart:ri("Transition","TransitionStart"),transitioncancel:ri("Transition","TransitionCancel"),transitionend:ri("Transition","TransitionEnd")},uu={},Tm={};Fn&&(Tm=document.createElement("div").style,"AnimationEvent"in window||(delete es.animationend.animation,delete es.animationiteration.animation,delete es.animationstart.animation),"TransitionEvent"in window||delete es.transitionend.transition);function oi(t){if(uu[t])return uu[t];if(!es[t])return t;var a=es[t],s;for(s in a)if(a.hasOwnProperty(s)&&s in Tm)return uu[t]=a[s];return t}var Em=oi("animationend"),Om=oi("animationiteration"),Dm=oi("animationstart"),ax=oi("transitionrun"),ix=oi("transitionstart"),sx=oi("transitioncancel"),Rm=oi("transitionend"),Mm=new Map,du="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(" ");du.push("scrollEnd");function On(t,a){Mm.set(t,a),ii(a,[t])}var qo=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},mn=[],ts=0,fu=0;function Uo(){for(var t=ts,a=fu=ts=0;a<t;){var s=mn[a];mn[a++]=null;var o=mn[a];mn[a++]=null;var u=mn[a];mn[a++]=null;var m=mn[a];if(mn[a++]=null,o!==null&&u!==null){var y=o.pending;y===null?u.next=u:(u.next=y.next,y.next=u),o.pending=u}m!==0&&Bm(s,u,m)}}function $o(t,a,s,o){mn[ts++]=t,mn[ts++]=a,mn[ts++]=s,mn[ts++]=o,fu|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function pu(t,a,s,o){return $o(t,a,s,o),Io(t)}function li(t,a){return $o(t,null,null,a),Io(t)}function Bm(t,a,s){t.lanes|=s;var o=t.alternate;o!==null&&(o.lanes|=s);for(var u=!1,m=t.return;m!==null;)m.childLanes|=s,o=m.alternate,o!==null&&(o.childLanes|=s),m.tag===22&&(t=m.stateNode,t===null||t._visibility&1||(u=!0)),t=m,m=m.return;return t.tag===3?(m=t.stateNode,u&&a!==null&&(u=31-ht(s),t=m.hiddenUpdates,o=t[u],o===null?t[u]=[a]:o.push(a),a.lane=s|536870912),m):null}function Io(t){if(50<$r)throw $r=0,wd=null,Error(r(185));for(var a=t.return;a!==null;)t=a,a=t.return;return t.tag===3?t.stateNode:null}var ns={};function rx(t,a,s,o){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sn(t,a,s,o){return new rx(t,a,s,o)}function mu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Wn(t,a){var s=t.alternate;return s===null?(s=sn(t.tag,a,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=a,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,a=t.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function Lm(t,a){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=a,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,a=s.dependencies,t.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),t}function Vo(t,a,s,o,u,m){var y=0;if(o=t,typeof t=="function")mu(t)&&(y=1);else if(typeof t=="string")y=dw(t,s,te.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case le:return t=sn(31,s,a,u),t.elementType=le,t.lanes=m,t;case k:return ci(s.children,u,m,a);case E:y=8,u|=24;break;case R:return t=sn(12,s,a,u|2),t.elementType=R,t.lanes=m,t;case X:return t=sn(13,s,a,u),t.elementType=X,t.lanes=m,t;case F:return t=sn(19,s,a,u),t.elementType=F,t.lanes=m,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case G:y=10;break e;case V:y=9;break e;case Z:y=11;break e;case O:y=14;break e;case M:y=16,o=null;break e}y=29,s=Error(r(130,t===null?"null":typeof t,"")),o=null}return a=sn(y,s,a,u),a.elementType=t,a.type=o,a.lanes=m,a}function ci(t,a,s,o){return t=sn(7,t,o,a),t.lanes=s,t}function hu(t,a,s){return t=sn(6,t,null,a),t.lanes=s,t}function qm(t){var a=sn(18,null,null,0);return a.stateNode=t,a}function gu(t,a,s){return a=sn(4,t.children!==null?t.children:[],t.key,a),a.lanes=s,a.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},a}var Um=new WeakMap;function hn(t,a){if(typeof t=="object"&&t!==null){var s=Um.get(t);return s!==void 0?s:(a={value:t,source:a,stack:ar(a)},Um.set(t,a),a)}return{value:t,source:a,stack:ar(a)}}var as=[],is=0,Po=null,vr=0,gn=[],yn=0,wa=null,In=1,Vn="";function ea(t,a){as[is++]=vr,as[is++]=Po,Po=t,vr=a}function $m(t,a,s){gn[yn++]=In,gn[yn++]=Vn,gn[yn++]=wa,wa=t;var o=In;t=Vn;var u=32-ht(o)-1;o&=~(1<<u),s+=1;var m=32-ht(a)+u;if(30<m){var y=u-u%5;m=(o&(1<<y)-1).toString(32),o>>=y,u-=y,In=1<<32-ht(a)+u|s<<u|o,Vn=m+t}else In=1<<m|s<<u|o,Vn=t}function yu(t){t.return!==null&&(ea(t,1),$m(t,1,0))}function bu(t){for(;t===Po;)Po=as[--is],as[is]=null,vr=as[--is],as[is]=null;for(;t===wa;)wa=gn[--yn],gn[yn]=null,Vn=gn[--yn],gn[yn]=null,In=gn[--yn],gn[yn]=null}function Im(t,a){gn[yn++]=In,gn[yn++]=Vn,gn[yn++]=wa,In=a.id,Vn=a.overflow,wa=t}var Rt=null,it=null,Le=!1,ja=null,bn=!1,vu=Error(r(519));function Na(t){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Sr(hn(a,t)),vu}function Vm(t){var a=t.stateNode,s=t.type,o=t.memoizedProps;switch(a[Dt]=t,a[Kt]=o,s){case"dialog":Re("cancel",a),Re("close",a);break;case"iframe":case"object":case"embed":Re("load",a);break;case"video":case"audio":for(s=0;s<Vr.length;s++)Re(Vr[s],a);break;case"source":Re("error",a);break;case"img":case"image":case"link":Re("error",a),Re("load",a);break;case"details":Re("toggle",a);break;case"input":Re("invalid",a),tm(a,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Re("invalid",a);break;case"textarea":Re("invalid",a),am(a,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||a.textContent===""+s||o.suppressHydrationWarning===!0||sy(a.textContent,s)?(o.popover!=null&&(Re("beforetoggle",a),Re("toggle",a)),o.onScroll!=null&&Re("scroll",a),o.onScrollEnd!=null&&Re("scrollend",a),o.onClick!=null&&(a.onclick=Jn),a=!0):a=!1,a||Na(t,!0)}function Pm(t){for(Rt=t.return;Rt;)switch(Rt.tag){case 5:case 31:case 13:bn=!1;return;case 27:case 3:bn=!0;return;default:Rt=Rt.return}}function ss(t){if(t!==Rt)return!1;if(!Le)return Pm(t),Le=!0,!1;var a=t.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||Ld(t.type,t.memoizedProps)),s=!s),s&&it&&Na(t),Pm(t),a===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));it=my(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));it=my(t)}else a===27?(a=it,qa(t.type)?(t=Vd,Vd=null,it=t):it=a):it=Rt?Sn(t.stateNode.nextSibling):null;return!0}function ui(){it=Rt=null,Le=!1}function Su(){var t=ja;return t!==null&&(Ft===null?Ft=t:Ft.push.apply(Ft,t),ja=null),t}function Sr(t){ja===null?ja=[t]:ja.push(t)}var xu=Ze(null),di=null,ta=null;function ka(t,a,s){ue(xu,a._currentValue),a._currentValue=s}function na(t){t._currentValue=xu.current,W(xu)}function wu(t,a,s){for(;t!==null;){var o=t.alternate;if((t.childLanes&a)!==a?(t.childLanes|=a,o!==null&&(o.childLanes|=a)):o!==null&&(o.childLanes&a)!==a&&(o.childLanes|=a),t===s)break;t=t.return}}function ju(t,a,s,o){var u=t.child;for(u!==null&&(u.return=t);u!==null;){var m=u.dependencies;if(m!==null){var y=u.child;m=m.firstContext;e:for(;m!==null;){var w=m;m=u;for(var C=0;C<a.length;C++)if(w.context===a[C]){m.lanes|=s,w=m.alternate,w!==null&&(w.lanes|=s),wu(m.return,s,t),o||(y=null);break e}m=w.next}}else if(u.tag===18){if(y=u.return,y===null)throw Error(r(341));y.lanes|=s,m=y.alternate,m!==null&&(m.lanes|=s),wu(y,s,t),y=null}else y=u.child;if(y!==null)y.return=u;else for(y=u;y!==null;){if(y===t){y=null;break}if(u=y.sibling,u!==null){u.return=y.return,y=u;break}y=y.return}u=y}}function rs(t,a,s,o){t=null;for(var u=a,m=!1;u!==null;){if(!m){if((u.flags&524288)!==0)m=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var y=u.alternate;if(y===null)throw Error(r(387));if(y=y.memoizedProps,y!==null){var w=u.type;an(u.pendingProps.value,y.value)||(t!==null?t.push(w):t=[w])}}else if(u===je.current){if(y=u.alternate,y===null)throw Error(r(387));y.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(t!==null?t.push(Kr):t=[Kr])}u=u.return}t!==null&&ju(a,t,s,o),a.flags|=262144}function Go(t){for(t=t.firstContext;t!==null;){if(!an(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function fi(t){di=t,ta=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Mt(t){return Gm(di,t)}function Ho(t,a){return di===null&&fi(t),Gm(t,a)}function Gm(t,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},ta===null){if(t===null)throw Error(r(308));ta=a,t.dependencies={lanes:0,firstContext:a},t.flags|=524288}else ta=ta.next=a;return s}var ox=typeof AbortController<"u"?AbortController:function(){var t=[],a=this.signal={aborted:!1,addEventListener:function(s,o){t.push(o)}};this.abort=function(){a.aborted=!0,t.forEach(function(s){return s()})}},lx=e.unstable_scheduleCallback,cx=e.unstable_NormalPriority,xt={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Nu(){return{controller:new ox,data:new Map,refCount:0}}function xr(t){t.refCount--,t.refCount===0&&lx(cx,function(){t.controller.abort()})}var wr=null,ku=0,os=0,ls=null;function ux(t,a){if(wr===null){var s=wr=[];ku=0,os=Cd(),ls={status:"pending",value:void 0,then:function(o){s.push(o)}}}return ku++,a.then(Hm,Hm),a}function Hm(){if(--ku===0&&wr!==null){ls!==null&&(ls.status="fulfilled");var t=wr;wr=null,os=0,ls=null;for(var a=0;a<t.length;a++)(0,t[a])()}}function dx(t,a){var s=[],o={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return t.then(function(){o.status="fulfilled",o.value=a;for(var u=0;u<s.length;u++)(0,s[u])(a)},function(u){for(o.status="rejected",o.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),o}var Qm=B.S;B.S=function(t,a){zg=Ut(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&ux(t,a),Qm!==null&&Qm(t,a)};var pi=Ze(null);function Au(){var t=pi.current;return t!==null?t:We.pooledCache}function Qo(t,a){a===null?ue(pi,pi.current):ue(pi,a.pool)}function Km(){var t=Au();return t===null?null:{parent:xt._currentValue,pool:t}}var cs=Error(r(460)),_u=Error(r(474)),Ko=Error(r(542)),Zo={then:function(){}};function Zm(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Ym(t,a,s){switch(s=t[s],s===void 0?t.push(a):s!==a&&(a.then(Jn,Jn),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Jm(t),t;default:if(typeof a.status=="string")a.then(Jn,Jn);else{if(t=We,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=a,t.status="pending",t.then(function(o){if(a.status==="pending"){var u=a;u.status="fulfilled",u.value=o}},function(o){if(a.status==="pending"){var u=a;u.status="rejected",u.reason=o}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Jm(t),t}throw hi=a,cs}}function mi(t){try{var a=t._init;return a(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(hi=s,cs):s}}var hi=null;function Xm(){if(hi===null)throw Error(r(459));var t=hi;return hi=null,t}function Jm(t){if(t===cs||t===Ko)throw Error(r(483))}var us=null,jr=0;function Yo(t){var a=jr;return jr+=1,us===null&&(us=[]),Ym(us,t,a)}function Nr(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function Xo(t,a){throw a.$$typeof===N?Error(r(525)):(t=Object.prototype.toString.call(a),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":t)))}function Fm(t){function a(D,z){if(t){var L=D.deletions;L===null?(D.deletions=[z],D.flags|=16):L.push(z)}}function s(D,z){if(!t)return null;for(;z!==null;)a(D,z),z=z.sibling;return null}function o(D){for(var z=new Map;D!==null;)D.key!==null?z.set(D.key,D):z.set(D.index,D),D=D.sibling;return z}function u(D,z){return D=Wn(D,z),D.index=0,D.sibling=null,D}function m(D,z,L){return D.index=L,t?(L=D.alternate,L!==null?(L=L.index,L<z?(D.flags|=67108866,z):L):(D.flags|=67108866,z)):(D.flags|=1048576,z)}function y(D){return t&&D.alternate===null&&(D.flags|=67108866),D}function w(D,z,L,Q){return z===null||z.tag!==6?(z=hu(L,D.mode,Q),z.return=D,z):(z=u(z,L),z.return=D,z)}function C(D,z,L,Q){var ve=L.type;return ve===k?P(D,z,L.props.children,Q,L.key):z!==null&&(z.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===M&&mi(ve)===z.type)?(z=u(z,L.props),Nr(z,L),z.return=D,z):(z=Vo(L.type,L.key,L.props,null,D.mode,Q),Nr(z,L),z.return=D,z)}function q(D,z,L,Q){return z===null||z.tag!==4||z.stateNode.containerInfo!==L.containerInfo||z.stateNode.implementation!==L.implementation?(z=gu(L,D.mode,Q),z.return=D,z):(z=u(z,L.children||[]),z.return=D,z)}function P(D,z,L,Q,ve){return z===null||z.tag!==7?(z=ci(L,D.mode,Q,ve),z.return=D,z):(z=u(z,L),z.return=D,z)}function Y(D,z,L){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=hu(""+z,D.mode,L),z.return=D,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case _:return L=Vo(z.type,z.key,z.props,null,D.mode,L),Nr(L,z),L.return=D,L;case T:return z=gu(z,D.mode,L),z.return=D,z;case M:return z=mi(z),Y(D,z,L)}if(ee(z)||be(z))return z=ci(z,D.mode,L,null),z.return=D,z;if(typeof z.then=="function")return Y(D,Yo(z),L);if(z.$$typeof===G)return Y(D,Ho(D,z),L);Xo(D,z)}return null}function $(D,z,L,Q){var ve=z!==null?z.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return ve!==null?null:w(D,z,""+L,Q);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case _:return L.key===ve?C(D,z,L,Q):null;case T:return L.key===ve?q(D,z,L,Q):null;case M:return L=mi(L),$(D,z,L,Q)}if(ee(L)||be(L))return ve!==null?null:P(D,z,L,Q,null);if(typeof L.then=="function")return $(D,z,Yo(L),Q);if(L.$$typeof===G)return $(D,z,Ho(D,L),Q);Xo(D,L)}return null}function I(D,z,L,Q,ve){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return D=D.get(L)||null,w(z,D,""+Q,ve);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case _:return D=D.get(Q.key===null?L:Q.key)||null,C(z,D,Q,ve);case T:return D=D.get(Q.key===null?L:Q.key)||null,q(z,D,Q,ve);case M:return Q=mi(Q),I(D,z,L,Q,ve)}if(ee(Q)||be(Q))return D=D.get(L)||null,P(z,D,Q,ve,null);if(typeof Q.then=="function")return I(D,z,L,Yo(Q),ve);if(Q.$$typeof===G)return I(D,z,L,Ho(z,Q),ve);Xo(z,Q)}return null}function pe(D,z,L,Q){for(var ve=null,$e=null,ge=z,ze=z=0,Be=null;ge!==null&&ze<L.length;ze++){ge.index>ze?(Be=ge,ge=null):Be=ge.sibling;var Ie=$(D,ge,L[ze],Q);if(Ie===null){ge===null&&(ge=Be);break}t&&ge&&Ie.alternate===null&&a(D,ge),z=m(Ie,z,ze),$e===null?ve=Ie:$e.sibling=Ie,$e=Ie,ge=Be}if(ze===L.length)return s(D,ge),Le&&ea(D,ze),ve;if(ge===null){for(;ze<L.length;ze++)ge=Y(D,L[ze],Q),ge!==null&&(z=m(ge,z,ze),$e===null?ve=ge:$e.sibling=ge,$e=ge);return Le&&ea(D,ze),ve}for(ge=o(ge);ze<L.length;ze++)Be=I(ge,D,ze,L[ze],Q),Be!==null&&(t&&Be.alternate!==null&&ge.delete(Be.key===null?ze:Be.key),z=m(Be,z,ze),$e===null?ve=Be:$e.sibling=Be,$e=Be);return t&&ge.forEach(function(Pa){return a(D,Pa)}),Le&&ea(D,ze),ve}function we(D,z,L,Q){if(L==null)throw Error(r(151));for(var ve=null,$e=null,ge=z,ze=z=0,Be=null,Ie=L.next();ge!==null&&!Ie.done;ze++,Ie=L.next()){ge.index>ze?(Be=ge,ge=null):Be=ge.sibling;var Pa=$(D,ge,Ie.value,Q);if(Pa===null){ge===null&&(ge=Be);break}t&&ge&&Pa.alternate===null&&a(D,ge),z=m(Pa,z,ze),$e===null?ve=Pa:$e.sibling=Pa,$e=Pa,ge=Be}if(Ie.done)return s(D,ge),Le&&ea(D,ze),ve;if(ge===null){for(;!Ie.done;ze++,Ie=L.next())Ie=Y(D,Ie.value,Q),Ie!==null&&(z=m(Ie,z,ze),$e===null?ve=Ie:$e.sibling=Ie,$e=Ie);return Le&&ea(D,ze),ve}for(ge=o(ge);!Ie.done;ze++,Ie=L.next())Ie=I(ge,D,ze,Ie.value,Q),Ie!==null&&(t&&Ie.alternate!==null&&ge.delete(Ie.key===null?ze:Ie.key),z=m(Ie,z,ze),$e===null?ve=Ie:$e.sibling=Ie,$e=Ie);return t&&ge.forEach(function(ww){return a(D,ww)}),Le&&ea(D,ze),ve}function Je(D,z,L,Q){if(typeof L=="object"&&L!==null&&L.type===k&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case _:e:{for(var ve=L.key;z!==null;){if(z.key===ve){if(ve=L.type,ve===k){if(z.tag===7){s(D,z.sibling),Q=u(z,L.props.children),Q.return=D,D=Q;break e}}else if(z.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===M&&mi(ve)===z.type){s(D,z.sibling),Q=u(z,L.props),Nr(Q,L),Q.return=D,D=Q;break e}s(D,z);break}else a(D,z);z=z.sibling}L.type===k?(Q=ci(L.props.children,D.mode,Q,L.key),Q.return=D,D=Q):(Q=Vo(L.type,L.key,L.props,null,D.mode,Q),Nr(Q,L),Q.return=D,D=Q)}return y(D);case T:e:{for(ve=L.key;z!==null;){if(z.key===ve)if(z.tag===4&&z.stateNode.containerInfo===L.containerInfo&&z.stateNode.implementation===L.implementation){s(D,z.sibling),Q=u(z,L.children||[]),Q.return=D,D=Q;break e}else{s(D,z);break}else a(D,z);z=z.sibling}Q=gu(L,D.mode,Q),Q.return=D,D=Q}return y(D);case M:return L=mi(L),Je(D,z,L,Q)}if(ee(L))return pe(D,z,L,Q);if(be(L)){if(ve=be(L),typeof ve!="function")throw Error(r(150));return L=ve.call(L),we(D,z,L,Q)}if(typeof L.then=="function")return Je(D,z,Yo(L),Q);if(L.$$typeof===G)return Je(D,z,Ho(D,L),Q);Xo(D,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,z!==null&&z.tag===6?(s(D,z.sibling),Q=u(z,L),Q.return=D,D=Q):(s(D,z),Q=hu(L,D.mode,Q),Q.return=D,D=Q),y(D)):s(D,z)}return function(D,z,L,Q){try{jr=0;var ve=Je(D,z,L,Q);return us=null,ve}catch(ge){if(ge===cs||ge===Ko)throw ge;var $e=sn(29,ge,null,D.mode);return $e.lanes=Q,$e.return=D,$e}}}var gi=Fm(!0),Wm=Fm(!1),Aa=!1;function Cu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zu(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function _a(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ca(t,a,s){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(Ve&2)!==0){var u=o.pending;return u===null?a.next=a:(a.next=u.next,u.next=a),o.pending=a,a=Io(t),Bm(t,null,s),a}return $o(t,o,a,s),Io(t)}function kr(t,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var o=a.lanes;o&=t.pendingLanes,s|=o,a.lanes=s,_o(t,s)}}function Tu(t,a){var s=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var u=null,m=null;if(s=s.firstBaseUpdate,s!==null){do{var y={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};m===null?u=m=y:m=m.next=y,s=s.next}while(s!==null);m===null?u=m=a:m=m.next=a}else u=m=a;s={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:m,shared:o.shared,callbacks:o.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=a:t.next=a,s.lastBaseUpdate=a}var Eu=!1;function Ar(){if(Eu){var t=ls;if(t!==null)throw t}}function _r(t,a,s,o){Eu=!1;var u=t.updateQueue;Aa=!1;var m=u.firstBaseUpdate,y=u.lastBaseUpdate,w=u.shared.pending;if(w!==null){u.shared.pending=null;var C=w,q=C.next;C.next=null,y===null?m=q:y.next=q,y=C;var P=t.alternate;P!==null&&(P=P.updateQueue,w=P.lastBaseUpdate,w!==y&&(w===null?P.firstBaseUpdate=q:w.next=q,P.lastBaseUpdate=C))}if(m!==null){var Y=u.baseState;y=0,P=q=C=null,w=m;do{var $=w.lane&-536870913,I=$!==w.lane;if(I?(Me&$)===$:(o&$)===$){$!==0&&$===os&&(Eu=!0),P!==null&&(P=P.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var pe=t,we=w;$=a;var Je=s;switch(we.tag){case 1:if(pe=we.payload,typeof pe=="function"){Y=pe.call(Je,Y,$);break e}Y=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=we.payload,$=typeof pe=="function"?pe.call(Je,Y,$):pe,$==null)break e;Y=x({},Y,$);break e;case 2:Aa=!0}}$=w.callback,$!==null&&(t.flags|=64,I&&(t.flags|=8192),I=u.callbacks,I===null?u.callbacks=[$]:I.push($))}else I={lane:$,tag:w.tag,payload:w.payload,callback:w.callback,next:null},P===null?(q=P=I,C=Y):P=P.next=I,y|=$;if(w=w.next,w===null){if(w=u.shared.pending,w===null)break;I=w,w=I.next,I.next=null,u.lastBaseUpdate=I,u.shared.pending=null}}while(!0);P===null&&(C=Y),u.baseState=C,u.firstBaseUpdate=q,u.lastBaseUpdate=P,m===null&&(u.shared.lanes=0),Da|=y,t.lanes=y,t.memoizedState=Y}}function eh(t,a){if(typeof t!="function")throw Error(r(191,t));t.call(a)}function th(t,a){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)eh(s[t],a)}var ds=Ze(null),Jo=Ze(0);function nh(t,a){t=da,ue(Jo,t),ue(ds,a),da=t|a.baseLanes}function Ou(){ue(Jo,da),ue(ds,ds.current)}function Du(){da=Jo.current,W(ds),W(Jo)}var rn=Ze(null),vn=null;function za(t){var a=t.alternate;ue(gt,gt.current&1),ue(rn,t),vn===null&&(a===null||ds.current!==null||a.memoizedState!==null)&&(vn=t)}function Ru(t){ue(gt,gt.current),ue(rn,t),vn===null&&(vn=t)}function ah(t){t.tag===22?(ue(gt,gt.current),ue(rn,t),vn===null&&(vn=t)):Ta()}function Ta(){ue(gt,gt.current),ue(rn,rn.current)}function on(t){W(rn),vn===t&&(vn=null),W(gt)}var gt=Ze(0);function Fo(t){for(var a=t;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||$d(s)||Id(s)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var aa=0,Ce=null,Ye=null,wt=null,Wo=!1,fs=!1,yi=!1,el=0,Cr=0,ps=null,fx=0;function pt(){throw Error(r(321))}function Mu(t,a){if(a===null)return!1;for(var s=0;s<a.length&&s<t.length;s++)if(!an(t[s],a[s]))return!1;return!0}function Bu(t,a,s,o,u,m){return aa=m,Ce=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,B.H=t===null||t.memoizedState===null?$h:Ju,yi=!1,m=s(o,u),yi=!1,fs&&(m=sh(a,s,o,u)),ih(t),m}function ih(t){B.H=Er;var a=Ye!==null&&Ye.next!==null;if(aa=0,wt=Ye=Ce=null,Wo=!1,Cr=0,ps=null,a)throw Error(r(300));t===null||jt||(t=t.dependencies,t!==null&&Go(t)&&(jt=!0))}function sh(t,a,s,o){Ce=t;var u=0;do{if(fs&&(ps=null),Cr=0,fs=!1,25<=u)throw Error(r(301));if(u+=1,wt=Ye=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}B.H=Ih,m=a(s,o)}while(fs);return m}function px(){var t=B.H,a=t.useState()[0];return a=typeof a.then=="function"?zr(a):a,t=t.useState()[0],(Ye!==null?Ye.memoizedState:null)!==t&&(Ce.flags|=1024),a}function Lu(){var t=el!==0;return el=0,t}function qu(t,a,s){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~s}function Uu(t){if(Wo){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}Wo=!1}aa=0,wt=Ye=Ce=null,fs=!1,Cr=el=0,ps=null}function Vt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wt===null?Ce.memoizedState=wt=t:wt=wt.next=t,wt}function yt(){if(Ye===null){var t=Ce.alternate;t=t!==null?t.memoizedState:null}else t=Ye.next;var a=wt===null?Ce.memoizedState:wt.next;if(a!==null)wt=a,Ye=t;else{if(t===null)throw Ce.alternate===null?Error(r(467)):Error(r(310));Ye=t,t={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},wt===null?Ce.memoizedState=wt=t:wt=wt.next=t}return wt}function tl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zr(t){var a=Cr;return Cr+=1,ps===null&&(ps=[]),t=Ym(ps,t,a),a=Ce,(wt===null?a.memoizedState:wt.next)===null&&(a=a.alternate,B.H=a===null||a.memoizedState===null?$h:Ju),t}function nl(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return zr(t);if(t.$$typeof===G)return Mt(t)}throw Error(r(438,String(t)))}function $u(t){var a=null,s=Ce.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var o=Ce.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(a={data:o.data.map(function(u){return u.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),s===null&&(s=tl(),Ce.updateQueue=s),s.memoCache=a,s=a.data[a.index],s===void 0)for(s=a.data[a.index]=Array(t),o=0;o<t;o++)s[o]=ke;return a.index++,s}function ia(t,a){return typeof a=="function"?a(t):a}function al(t){var a=yt();return Iu(a,Ye,t)}function Iu(t,a,s){var o=t.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=s;var u=t.baseQueue,m=o.pending;if(m!==null){if(u!==null){var y=u.next;u.next=m.next,m.next=y}a.baseQueue=u=m,o.pending=null}if(m=t.baseState,u===null)t.memoizedState=m;else{a=u.next;var w=y=null,C=null,q=a,P=!1;do{var Y=q.lane&-536870913;if(Y!==q.lane?(Me&Y)===Y:(aa&Y)===Y){var $=q.revertLane;if($===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),Y===os&&(P=!0);else if((aa&$)===$){q=q.next,$===os&&(P=!0);continue}else Y={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},C===null?(w=C=Y,y=m):C=C.next=Y,Ce.lanes|=$,Da|=$;Y=q.action,yi&&s(m,Y),m=q.hasEagerState?q.eagerState:s(m,Y)}else $={lane:Y,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},C===null?(w=C=$,y=m):C=C.next=$,Ce.lanes|=Y,Da|=Y;q=q.next}while(q!==null&&q!==a);if(C===null?y=m:C.next=w,!an(m,t.memoizedState)&&(jt=!0,P&&(s=ls,s!==null)))throw s;t.memoizedState=m,t.baseState=y,t.baseQueue=C,o.lastRenderedState=m}return u===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Vu(t){var a=yt(),s=a.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=t;var o=s.dispatch,u=s.pending,m=a.memoizedState;if(u!==null){s.pending=null;var y=u=u.next;do m=t(m,y.action),y=y.next;while(y!==u);an(m,a.memoizedState)||(jt=!0),a.memoizedState=m,a.baseQueue===null&&(a.baseState=m),s.lastRenderedState=m}return[m,o]}function rh(t,a,s){var o=Ce,u=yt(),m=Le;if(m){if(s===void 0)throw Error(r(407));s=s()}else s=a();var y=!an((Ye||u).memoizedState,s);if(y&&(u.memoizedState=s,jt=!0),u=u.queue,Hu(ch.bind(null,o,u,t),[t]),u.getSnapshot!==a||y||wt!==null&&wt.memoizedState.tag&1){if(o.flags|=2048,ms(9,{destroy:void 0},lh.bind(null,o,u,s,a),null),We===null)throw Error(r(349));m||(aa&127)!==0||oh(o,a,s)}return s}function oh(t,a,s){t.flags|=16384,t={getSnapshot:a,value:s},a=Ce.updateQueue,a===null?(a=tl(),Ce.updateQueue=a,a.stores=[t]):(s=a.stores,s===null?a.stores=[t]:s.push(t))}function lh(t,a,s,o){a.value=s,a.getSnapshot=o,uh(a)&&dh(t)}function ch(t,a,s){return s(function(){uh(a)&&dh(t)})}function uh(t){var a=t.getSnapshot;t=t.value;try{var s=a();return!an(t,s)}catch{return!0}}function dh(t){var a=li(t,2);a!==null&&Wt(a,t,2)}function Pu(t){var a=Vt();if(typeof t=="function"){var s=t;if(t=s(),yi){Tn(!0);try{s()}finally{Tn(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:t},a}function fh(t,a,s,o){return t.baseState=s,Iu(t,Ye,typeof o=="function"?o:ia)}function mx(t,a,s,o,u){if(rl(t))throw Error(r(485));if(t=a.action,t!==null){var m={payload:u,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){m.listeners.push(y)}};B.T!==null?s(!0):m.isTransition=!1,o(m),s=a.pending,s===null?(m.next=a.pending=m,ph(a,m)):(m.next=s.next,a.pending=s.next=m)}}function ph(t,a){var s=a.action,o=a.payload,u=t.state;if(a.isTransition){var m=B.T,y={};B.T=y;try{var w=s(u,o),C=B.S;C!==null&&C(y,w),mh(t,a,w)}catch(q){Gu(t,a,q)}finally{m!==null&&y.types!==null&&(m.types=y.types),B.T=m}}else try{m=s(u,o),mh(t,a,m)}catch(q){Gu(t,a,q)}}function mh(t,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){hh(t,a,o)},function(o){return Gu(t,a,o)}):hh(t,a,s)}function hh(t,a,s){a.status="fulfilled",a.value=s,gh(a),t.state=s,a=t.pending,a!==null&&(s=a.next,s===a?t.pending=null:(s=s.next,a.next=s,ph(t,s)))}function Gu(t,a,s){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do a.status="rejected",a.reason=s,gh(a),a=a.next;while(a!==o)}t.action=null}function gh(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function yh(t,a){return a}function bh(t,a){if(Le){var s=We.formState;if(s!==null){e:{var o=Ce;if(Le){if(it){t:{for(var u=it,m=bn;u.nodeType!==8;){if(!m){u=null;break t}if(u=Sn(u.nextSibling),u===null){u=null;break t}}m=u.data,u=m==="F!"||m==="F"?u:null}if(u){it=Sn(u.nextSibling),o=u.data==="F!";break e}}Na(o)}o=!1}o&&(a=s[0])}}return s=Vt(),s.memoizedState=s.baseState=a,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:yh,lastRenderedState:a},s.queue=o,s=Lh.bind(null,Ce,o),o.dispatch=s,o=Pu(!1),m=Xu.bind(null,Ce,!1,o.queue),o=Vt(),u={state:a,dispatch:null,action:t,pending:null},o.queue=u,s=mx.bind(null,Ce,u,m,s),u.dispatch=s,o.memoizedState=t,[a,s,!1]}function vh(t){var a=yt();return Sh(a,Ye,t)}function Sh(t,a,s){if(a=Iu(t,a,yh)[0],t=al(ia)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var o=zr(a)}catch(y){throw y===cs?Ko:y}else o=a;a=yt();var u=a.queue,m=u.dispatch;return s!==a.memoizedState&&(Ce.flags|=2048,ms(9,{destroy:void 0},hx.bind(null,u,s),null)),[o,m,t]}function hx(t,a){t.action=a}function xh(t){var a=yt(),s=Ye;if(s!==null)return Sh(a,s,t);yt(),a=a.memoizedState,s=yt();var o=s.queue.dispatch;return s.memoizedState=t,[a,o,!1]}function ms(t,a,s,o){return t={tag:t,create:s,deps:o,inst:a,next:null},a=Ce.updateQueue,a===null&&(a=tl(),Ce.updateQueue=a),s=a.lastEffect,s===null?a.lastEffect=t.next=t:(o=s.next,s.next=t,t.next=o,a.lastEffect=t),t}function wh(){return yt().memoizedState}function il(t,a,s,o){var u=Vt();Ce.flags|=t,u.memoizedState=ms(1|a,{destroy:void 0},s,o===void 0?null:o)}function sl(t,a,s,o){var u=yt();o=o===void 0?null:o;var m=u.memoizedState.inst;Ye!==null&&o!==null&&Mu(o,Ye.memoizedState.deps)?u.memoizedState=ms(a,m,s,o):(Ce.flags|=t,u.memoizedState=ms(1|a,m,s,o))}function jh(t,a){il(8390656,8,t,a)}function Hu(t,a){sl(2048,8,t,a)}function gx(t){Ce.flags|=4;var a=Ce.updateQueue;if(a===null)a=tl(),Ce.updateQueue=a,a.events=[t];else{var s=a.events;s===null?a.events=[t]:s.push(t)}}function Nh(t){var a=yt().memoizedState;return gx({ref:a,nextImpl:t}),function(){if((Ve&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function kh(t,a){return sl(4,2,t,a)}function Ah(t,a){return sl(4,4,t,a)}function _h(t,a){if(typeof a=="function"){t=t();var s=a(t);return function(){typeof s=="function"?s():a(null)}}if(a!=null)return t=t(),a.current=t,function(){a.current=null}}function Ch(t,a,s){s=s!=null?s.concat([t]):null,sl(4,4,_h.bind(null,a,t),s)}function Qu(){}function zh(t,a){var s=yt();a=a===void 0?null:a;var o=s.memoizedState;return a!==null&&Mu(a,o[1])?o[0]:(s.memoizedState=[t,a],t)}function Th(t,a){var s=yt();a=a===void 0?null:a;var o=s.memoizedState;if(a!==null&&Mu(a,o[1]))return o[0];if(o=t(),yi){Tn(!0);try{t()}finally{Tn(!1)}}return s.memoizedState=[o,a],o}function Ku(t,a,s){return s===void 0||(aa&1073741824)!==0&&(Me&261930)===0?t.memoizedState=a:(t.memoizedState=s,t=Eg(),Ce.lanes|=t,Da|=t,s)}function Eh(t,a,s,o){return an(s,a)?s:ds.current!==null?(t=Ku(t,s,o),an(t,a)||(jt=!0),t):(aa&42)===0||(aa&1073741824)!==0&&(Me&261930)===0?(jt=!0,t.memoizedState=s):(t=Eg(),Ce.lanes|=t,Da|=t,a)}function Oh(t,a,s,o,u){var m=J.p;J.p=m!==0&&8>m?m:8;var y=B.T,w={};B.T=w,Xu(t,!1,a,s);try{var C=u(),q=B.S;if(q!==null&&q(w,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var P=dx(C,o);Tr(t,a,P,un(t))}else Tr(t,a,o,un(t))}catch(Y){Tr(t,a,{then:function(){},status:"rejected",reason:Y},un())}finally{J.p=m,y!==null&&w.types!==null&&(y.types=w.types),B.T=y}}function yx(){}function Zu(t,a,s,o){if(t.tag!==5)throw Error(r(476));var u=Dh(t).queue;Oh(t,u,a,fe,s===null?yx:function(){return Rh(t),s(o)})}function Dh(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:fe},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:s},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function Rh(t){var a=Dh(t);a.next===null&&(a=t.alternate.memoizedState),Tr(t,a.next.queue,{},un())}function Yu(){return Mt(Kr)}function Mh(){return yt().memoizedState}function Bh(){return yt().memoizedState}function bx(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var s=un();t=_a(s);var o=Ca(a,t,s);o!==null&&(Wt(o,a,s),kr(o,a,s)),a={cache:Nu()},t.payload=a;return}a=a.return}}function vx(t,a,s){var o=un();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},rl(t)?qh(a,s):(s=pu(t,a,s,o),s!==null&&(Wt(s,t,o),Uh(s,a,o)))}function Lh(t,a,s){var o=un();Tr(t,a,s,o)}function Tr(t,a,s,o){var u={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(rl(t))qh(a,u);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=a.lastRenderedReducer,m!==null))try{var y=a.lastRenderedState,w=m(y,s);if(u.hasEagerState=!0,u.eagerState=w,an(w,y))return $o(t,a,u,0),We===null&&Uo(),!1}catch{}if(s=pu(t,a,u,o),s!==null)return Wt(s,t,o),Uh(s,a,o),!0}return!1}function Xu(t,a,s,o){if(o={lane:2,revertLane:Cd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},rl(t)){if(a)throw Error(r(479))}else a=pu(t,s,o,2),a!==null&&Wt(a,t,2)}function rl(t){var a=t.alternate;return t===Ce||a!==null&&a===Ce}function qh(t,a){fs=Wo=!0;var s=t.pending;s===null?a.next=a:(a.next=s.next,s.next=a),t.pending=a}function Uh(t,a,s){if((s&4194048)!==0){var o=a.lanes;o&=t.pendingLanes,s|=o,a.lanes=s,_o(t,s)}}var Er={readContext:Mt,use:nl,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useLayoutEffect:pt,useInsertionEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useSyncExternalStore:pt,useId:pt,useHostTransitionStatus:pt,useFormState:pt,useActionState:pt,useOptimistic:pt,useMemoCache:pt,useCacheRefresh:pt};Er.useEffectEvent=pt;var $h={readContext:Mt,use:nl,useCallback:function(t,a){return Vt().memoizedState=[t,a===void 0?null:a],t},useContext:Mt,useEffect:jh,useImperativeHandle:function(t,a,s){s=s!=null?s.concat([t]):null,il(4194308,4,_h.bind(null,a,t),s)},useLayoutEffect:function(t,a){return il(4194308,4,t,a)},useInsertionEffect:function(t,a){il(4,2,t,a)},useMemo:function(t,a){var s=Vt();a=a===void 0?null:a;var o=t();if(yi){Tn(!0);try{t()}finally{Tn(!1)}}return s.memoizedState=[o,a],o},useReducer:function(t,a,s){var o=Vt();if(s!==void 0){var u=s(a);if(yi){Tn(!0);try{s(a)}finally{Tn(!1)}}}else u=a;return o.memoizedState=o.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},o.queue=t,t=t.dispatch=vx.bind(null,Ce,t),[o.memoizedState,t]},useRef:function(t){var a=Vt();return t={current:t},a.memoizedState=t},useState:function(t){t=Pu(t);var a=t.queue,s=Lh.bind(null,Ce,a);return a.dispatch=s,[t.memoizedState,s]},useDebugValue:Qu,useDeferredValue:function(t,a){var s=Vt();return Ku(s,t,a)},useTransition:function(){var t=Pu(!1);return t=Oh.bind(null,Ce,t.queue,!0,!1),Vt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,s){var o=Ce,u=Vt();if(Le){if(s===void 0)throw Error(r(407));s=s()}else{if(s=a(),We===null)throw Error(r(349));(Me&127)!==0||oh(o,a,s)}u.memoizedState=s;var m={value:s,getSnapshot:a};return u.queue=m,jh(ch.bind(null,o,m,t),[t]),o.flags|=2048,ms(9,{destroy:void 0},lh.bind(null,o,m,s,a),null),s},useId:function(){var t=Vt(),a=We.identifierPrefix;if(Le){var s=Vn,o=In;s=(o&~(1<<32-ht(o)-1)).toString(32)+s,a="_"+a+"R_"+s,s=el++,0<s&&(a+="H"+s.toString(32)),a+="_"}else s=fx++,a="_"+a+"r_"+s.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:Yu,useFormState:bh,useActionState:bh,useOptimistic:function(t){var a=Vt();a.memoizedState=a.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=Xu.bind(null,Ce,!0,s),s.dispatch=a,[t,a]},useMemoCache:$u,useCacheRefresh:function(){return Vt().memoizedState=bx.bind(null,Ce)},useEffectEvent:function(t){var a=Vt(),s={impl:t};return a.memoizedState=s,function(){if((Ve&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}},Ju={readContext:Mt,use:nl,useCallback:zh,useContext:Mt,useEffect:Hu,useImperativeHandle:Ch,useInsertionEffect:kh,useLayoutEffect:Ah,useMemo:Th,useReducer:al,useRef:wh,useState:function(){return al(ia)},useDebugValue:Qu,useDeferredValue:function(t,a){var s=yt();return Eh(s,Ye.memoizedState,t,a)},useTransition:function(){var t=al(ia)[0],a=yt().memoizedState;return[typeof t=="boolean"?t:zr(t),a]},useSyncExternalStore:rh,useId:Mh,useHostTransitionStatus:Yu,useFormState:vh,useActionState:vh,useOptimistic:function(t,a){var s=yt();return fh(s,Ye,t,a)},useMemoCache:$u,useCacheRefresh:Bh};Ju.useEffectEvent=Nh;var Ih={readContext:Mt,use:nl,useCallback:zh,useContext:Mt,useEffect:Hu,useImperativeHandle:Ch,useInsertionEffect:kh,useLayoutEffect:Ah,useMemo:Th,useReducer:Vu,useRef:wh,useState:function(){return Vu(ia)},useDebugValue:Qu,useDeferredValue:function(t,a){var s=yt();return Ye===null?Ku(s,t,a):Eh(s,Ye.memoizedState,t,a)},useTransition:function(){var t=Vu(ia)[0],a=yt().memoizedState;return[typeof t=="boolean"?t:zr(t),a]},useSyncExternalStore:rh,useId:Mh,useHostTransitionStatus:Yu,useFormState:xh,useActionState:xh,useOptimistic:function(t,a){var s=yt();return Ye!==null?fh(s,Ye,t,a):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:$u,useCacheRefresh:Bh};Ih.useEffectEvent=Nh;function Fu(t,a,s,o){a=t.memoizedState,s=s(o,a),s=s==null?a:x({},a,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Wu={enqueueSetState:function(t,a,s){t=t._reactInternals;var o=un(),u=_a(o);u.payload=a,s!=null&&(u.callback=s),a=Ca(t,u,o),a!==null&&(Wt(a,t,o),kr(a,t,o))},enqueueReplaceState:function(t,a,s){t=t._reactInternals;var o=un(),u=_a(o);u.tag=1,u.payload=a,s!=null&&(u.callback=s),a=Ca(t,u,o),a!==null&&(Wt(a,t,o),kr(a,t,o))},enqueueForceUpdate:function(t,a){t=t._reactInternals;var s=un(),o=_a(s);o.tag=2,a!=null&&(o.callback=a),a=Ca(t,o,s),a!==null&&(Wt(a,t,s),kr(a,t,s))}};function Vh(t,a,s,o,u,m,y){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,m,y):a.prototype&&a.prototype.isPureReactComponent?!yr(s,o)||!yr(u,m):!0}function Ph(t,a,s,o){t=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(s,o),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(s,o),a.state!==t&&Wu.enqueueReplaceState(a,a.state,null)}function bi(t,a){var s=a;if("ref"in a){s={};for(var o in a)o!=="ref"&&(s[o]=a[o])}if(t=t.defaultProps){s===a&&(s=x({},s));for(var u in t)s[u]===void 0&&(s[u]=t[u])}return s}function Gh(t){qo(t)}function Hh(t){console.error(t)}function Qh(t){qo(t)}function ol(t,a){try{var s=t.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(o){setTimeout(function(){throw o})}}function Kh(t,a,s){try{var o=t.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function ed(t,a,s){return s=_a(s),s.tag=3,s.payload={element:null},s.callback=function(){ol(t,a)},s}function Zh(t){return t=_a(t),t.tag=3,t}function Yh(t,a,s,o){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var m=o.value;t.payload=function(){return u(m)},t.callback=function(){Kh(a,s,o)}}var y=s.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(t.callback=function(){Kh(a,s,o),typeof u!="function"&&(Ra===null?Ra=new Set([this]):Ra.add(this));var w=o.stack;this.componentDidCatch(o.value,{componentStack:w!==null?w:""})})}function Sx(t,a,s,o,u){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(a=s.alternate,a!==null&&rs(a,s,u,!0),s=rn.current,s!==null){switch(s.tag){case 31:case 13:return vn===null?vl():s.alternate===null&&mt===0&&(mt=3),s.flags&=-257,s.flags|=65536,s.lanes=u,o===Zo?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([o]):a.add(o),kd(t,o,u)),!1;case 22:return s.flags|=65536,o===Zo?s.flags|=16384:(a=s.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=a):(s=a.retryQueue,s===null?a.retryQueue=new Set([o]):s.add(o)),kd(t,o,u)),!1}throw Error(r(435,s.tag))}return kd(t,o,u),vl(),!1}if(Le)return a=rn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=u,o!==vu&&(t=Error(r(422),{cause:o}),Sr(hn(t,s)))):(o!==vu&&(a=Error(r(423),{cause:o}),Sr(hn(a,s))),t=t.current.alternate,t.flags|=65536,u&=-u,t.lanes|=u,o=hn(o,s),u=ed(t.stateNode,o,u),Tu(t,u),mt!==4&&(mt=2)),!1;var m=Error(r(520),{cause:o});if(m=hn(m,s),Ur===null?Ur=[m]:Ur.push(m),mt!==4&&(mt=2),a===null)return!0;o=hn(o,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,t=u&-u,s.lanes|=t,t=ed(s.stateNode,o,t),Tu(s,t),!1;case 1:if(a=s.type,m=s.stateNode,(s.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Ra===null||!Ra.has(m))))return s.flags|=65536,u&=-u,s.lanes|=u,u=Zh(u),Yh(u,t,s,o),Tu(s,u),!1}s=s.return}while(s!==null);return!1}var td=Error(r(461)),jt=!1;function Bt(t,a,s,o){a.child=t===null?Wm(a,null,s,o):gi(a,t.child,s,o)}function Xh(t,a,s,o,u){s=s.render;var m=a.ref;if("ref"in o){var y={};for(var w in o)w!=="ref"&&(y[w]=o[w])}else y=o;return fi(a),o=Bu(t,a,s,y,m,u),w=Lu(),t!==null&&!jt?(qu(t,a,u),sa(t,a,u)):(Le&&w&&yu(a),a.flags|=1,Bt(t,a,o,u),a.child)}function Jh(t,a,s,o,u){if(t===null){var m=s.type;return typeof m=="function"&&!mu(m)&&m.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=m,Fh(t,a,m,o,u)):(t=Vo(s.type,null,o,a,a.mode,u),t.ref=a.ref,t.return=a,a.child=t)}if(m=t.child,!cd(t,u)){var y=m.memoizedProps;if(s=s.compare,s=s!==null?s:yr,s(y,o)&&t.ref===a.ref)return sa(t,a,u)}return a.flags|=1,t=Wn(m,o),t.ref=a.ref,t.return=a,a.child=t}function Fh(t,a,s,o,u){if(t!==null){var m=t.memoizedProps;if(yr(m,o)&&t.ref===a.ref)if(jt=!1,a.pendingProps=o=m,cd(t,u))(t.flags&131072)!==0&&(jt=!0);else return a.lanes=t.lanes,sa(t,a,u)}return nd(t,a,s,o,u)}function Wh(t,a,s,o){var u=o.children,m=t!==null?t.memoizedState:null;if(t===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((a.flags&128)!==0){if(m=m!==null?m.baseLanes|s:s,t!==null){for(o=a.child=t.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~m}else o=0,a.child=null;return eg(t,a,m,s,o)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&Qo(a,m!==null?m.cachePool:null),m!==null?nh(a,m):Ou(),ah(a);else return o=a.lanes=536870912,eg(t,a,m!==null?m.baseLanes|s:s,s,o)}else m!==null?(Qo(a,m.cachePool),nh(a,m),Ta(),a.memoizedState=null):(t!==null&&Qo(a,null),Ou(),Ta());return Bt(t,a,u,s),a.child}function Or(t,a){return t!==null&&t.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function eg(t,a,s,o,u){var m=Au();return m=m===null?null:{parent:xt._currentValue,pool:m},a.memoizedState={baseLanes:s,cachePool:m},t!==null&&Qo(a,null),Ou(),ah(a),t!==null&&rs(t,a,o,!0),a.childLanes=u,null}function ll(t,a){return a=ul({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function tg(t,a,s){return gi(a,t.child,null,s),t=ll(a,a.pendingProps),t.flags|=2,on(a),a.memoizedState=null,t}function xx(t,a,s){var o=a.pendingProps,u=(a.flags&128)!==0;if(a.flags&=-129,t===null){if(Le){if(o.mode==="hidden")return t=ll(a,o),a.lanes=536870912,Or(null,t);if(Ru(a),(t=it)?(t=py(t,bn),t=t!==null&&t.data==="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:wa!==null?{id:In,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},s=qm(t),s.return=a,a.child=s,Rt=a,it=null)):t=null,t===null)throw Na(a);return a.lanes=536870912,null}return ll(a,o)}var m=t.memoizedState;if(m!==null){var y=m.dehydrated;if(Ru(a),u)if(a.flags&256)a.flags&=-257,a=tg(t,a,s);else if(a.memoizedState!==null)a.child=t.child,a.flags|=128,a=null;else throw Error(r(558));else if(jt||rs(t,a,s,!1),u=(s&t.childLanes)!==0,jt||u){if(o=We,o!==null&&(y=rr(o,s),y!==0&&y!==m.retryLane))throw m.retryLane=y,li(t,y),Wt(o,t,y),td;vl(),a=tg(t,a,s)}else t=m.treeContext,it=Sn(y.nextSibling),Rt=a,Le=!0,ja=null,bn=!1,t!==null&&Im(a,t),a=ll(a,o),a.flags|=4096;return a}return t=Wn(t.child,{mode:o.mode,children:o.children}),t.ref=a.ref,a.child=t,t.return=a,t}function cl(t,a){var s=a.ref;if(s===null)t!==null&&t.ref!==null&&(a.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(r(284));(t===null||t.ref!==s)&&(a.flags|=4194816)}}function nd(t,a,s,o,u){return fi(a),s=Bu(t,a,s,o,void 0,u),o=Lu(),t!==null&&!jt?(qu(t,a,u),sa(t,a,u)):(Le&&o&&yu(a),a.flags|=1,Bt(t,a,s,u),a.child)}function ng(t,a,s,o,u,m){return fi(a),a.updateQueue=null,s=sh(a,o,s,u),ih(t),o=Lu(),t!==null&&!jt?(qu(t,a,m),sa(t,a,m)):(Le&&o&&yu(a),a.flags|=1,Bt(t,a,s,m),a.child)}function ag(t,a,s,o,u){if(fi(a),a.stateNode===null){var m=ns,y=s.contextType;typeof y=="object"&&y!==null&&(m=Mt(y)),m=new s(o,m),a.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Wu,a.stateNode=m,m._reactInternals=a,m=a.stateNode,m.props=o,m.state=a.memoizedState,m.refs={},Cu(a),y=s.contextType,m.context=typeof y=="object"&&y!==null?Mt(y):ns,m.state=a.memoizedState,y=s.getDerivedStateFromProps,typeof y=="function"&&(Fu(a,s,y,o),m.state=a.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(y=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),y!==m.state&&Wu.enqueueReplaceState(m,m.state,null),_r(a,o,m,u),Ar(),m.state=a.memoizedState),typeof m.componentDidMount=="function"&&(a.flags|=4194308),o=!0}else if(t===null){m=a.stateNode;var w=a.memoizedProps,C=bi(s,w);m.props=C;var q=m.context,P=s.contextType;y=ns,typeof P=="object"&&P!==null&&(y=Mt(P));var Y=s.getDerivedStateFromProps;P=typeof Y=="function"||typeof m.getSnapshotBeforeUpdate=="function",w=a.pendingProps!==w,P||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(w||q!==y)&&Ph(a,m,o,y),Aa=!1;var $=a.memoizedState;m.state=$,_r(a,o,m,u),Ar(),q=a.memoizedState,w||$!==q||Aa?(typeof Y=="function"&&(Fu(a,s,Y,o),q=a.memoizedState),(C=Aa||Vh(a,s,C,o,$,q,y))?(P||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(a.flags|=4194308)):(typeof m.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=o,a.memoizedState=q),m.props=o,m.state=q,m.context=y,o=C):(typeof m.componentDidMount=="function"&&(a.flags|=4194308),o=!1)}else{m=a.stateNode,zu(t,a),y=a.memoizedProps,P=bi(s,y),m.props=P,Y=a.pendingProps,$=m.context,q=s.contextType,C=ns,typeof q=="object"&&q!==null&&(C=Mt(q)),w=s.getDerivedStateFromProps,(q=typeof w=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(y!==Y||$!==C)&&Ph(a,m,o,C),Aa=!1,$=a.memoizedState,m.state=$,_r(a,o,m,u),Ar();var I=a.memoizedState;y!==Y||$!==I||Aa||t!==null&&t.dependencies!==null&&Go(t.dependencies)?(typeof w=="function"&&(Fu(a,s,w,o),I=a.memoizedState),(P=Aa||Vh(a,s,P,o,$,I,C)||t!==null&&t.dependencies!==null&&Go(t.dependencies))?(q||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(o,I,C),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(o,I,C)),typeof m.componentDidUpdate=="function"&&(a.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof m.componentDidUpdate!="function"||y===t.memoizedProps&&$===t.memoizedState||(a.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&$===t.memoizedState||(a.flags|=1024),a.memoizedProps=o,a.memoizedState=I),m.props=o,m.state=I,m.context=C,o=P):(typeof m.componentDidUpdate!="function"||y===t.memoizedProps&&$===t.memoizedState||(a.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&$===t.memoizedState||(a.flags|=1024),o=!1)}return m=o,cl(t,a),o=(a.flags&128)!==0,m||o?(m=a.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:m.render(),a.flags|=1,t!==null&&o?(a.child=gi(a,t.child,null,u),a.child=gi(a,null,s,u)):Bt(t,a,s,u),a.memoizedState=m.state,t=a.child):t=sa(t,a,u),t}function ig(t,a,s,o){return ui(),a.flags|=256,Bt(t,a,s,o),a.child}var ad={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function id(t){return{baseLanes:t,cachePool:Km()}}function sd(t,a,s){return t=t!==null?t.childLanes&~s:0,a&&(t|=cn),t}function sg(t,a,s){var o=a.pendingProps,u=!1,m=(a.flags&128)!==0,y;if((y=m)||(y=t!==null&&t.memoizedState===null?!1:(gt.current&2)!==0),y&&(u=!0,a.flags&=-129),y=(a.flags&32)!==0,a.flags&=-33,t===null){if(Le){if(u?za(a):Ta(),(t=it)?(t=py(t,bn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:wa!==null?{id:In,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},s=qm(t),s.return=a,a.child=s,Rt=a,it=null)):t=null,t===null)throw Na(a);return Id(t)?a.lanes=32:a.lanes=536870912,null}var w=o.children;return o=o.fallback,u?(Ta(),u=a.mode,w=ul({mode:"hidden",children:w},u),o=ci(o,u,s,null),w.return=a,o.return=a,w.sibling=o,a.child=w,o=a.child,o.memoizedState=id(s),o.childLanes=sd(t,y,s),a.memoizedState=ad,Or(null,o)):(za(a),rd(a,w))}var C=t.memoizedState;if(C!==null&&(w=C.dehydrated,w!==null)){if(m)a.flags&256?(za(a),a.flags&=-257,a=od(t,a,s)):a.memoizedState!==null?(Ta(),a.child=t.child,a.flags|=128,a=null):(Ta(),w=o.fallback,u=a.mode,o=ul({mode:"visible",children:o.children},u),w=ci(w,u,s,null),w.flags|=2,o.return=a,w.return=a,o.sibling=w,a.child=o,gi(a,t.child,null,s),o=a.child,o.memoizedState=id(s),o.childLanes=sd(t,y,s),a.memoizedState=ad,a=Or(null,o));else if(za(a),Id(w)){if(y=w.nextSibling&&w.nextSibling.dataset,y)var q=y.dgst;y=q,o=Error(r(419)),o.stack="",o.digest=y,Sr({value:o,source:null,stack:null}),a=od(t,a,s)}else if(jt||rs(t,a,s,!1),y=(s&t.childLanes)!==0,jt||y){if(y=We,y!==null&&(o=rr(y,s),o!==0&&o!==C.retryLane))throw C.retryLane=o,li(t,o),Wt(y,t,o),td;$d(w)||vl(),a=od(t,a,s)}else $d(w)?(a.flags|=192,a.child=t.child,a=null):(t=C.treeContext,it=Sn(w.nextSibling),Rt=a,Le=!0,ja=null,bn=!1,t!==null&&Im(a,t),a=rd(a,o.children),a.flags|=4096);return a}return u?(Ta(),w=o.fallback,u=a.mode,C=t.child,q=C.sibling,o=Wn(C,{mode:"hidden",children:o.children}),o.subtreeFlags=C.subtreeFlags&65011712,q!==null?w=Wn(q,w):(w=ci(w,u,s,null),w.flags|=2),w.return=a,o.return=a,o.sibling=w,a.child=o,Or(null,o),o=a.child,w=t.child.memoizedState,w===null?w=id(s):(u=w.cachePool,u!==null?(C=xt._currentValue,u=u.parent!==C?{parent:C,pool:C}:u):u=Km(),w={baseLanes:w.baseLanes|s,cachePool:u}),o.memoizedState=w,o.childLanes=sd(t,y,s),a.memoizedState=ad,Or(t.child,o)):(za(a),s=t.child,t=s.sibling,s=Wn(s,{mode:"visible",children:o.children}),s.return=a,s.sibling=null,t!==null&&(y=a.deletions,y===null?(a.deletions=[t],a.flags|=16):y.push(t)),a.child=s,a.memoizedState=null,s)}function rd(t,a){return a=ul({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function ul(t,a){return t=sn(22,t,null,a),t.lanes=0,t}function od(t,a,s){return gi(a,t.child,null,s),t=rd(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function rg(t,a,s){t.lanes|=a;var o=t.alternate;o!==null&&(o.lanes|=a),wu(t.return,a,s)}function ld(t,a,s,o,u,m){var y=t.memoizedState;y===null?t.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:u,treeForkCount:m}:(y.isBackwards=a,y.rendering=null,y.renderingStartTime=0,y.last=o,y.tail=s,y.tailMode=u,y.treeForkCount=m)}function og(t,a,s){var o=a.pendingProps,u=o.revealOrder,m=o.tail;o=o.children;var y=gt.current,w=(y&2)!==0;if(w?(y=y&1|2,a.flags|=128):y&=1,ue(gt,y),Bt(t,a,o,s),o=Le?vr:0,!w&&t!==null&&(t.flags&128)!==0)e:for(t=a.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&rg(t,s,a);else if(t.tag===19)rg(t,s,a);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===a)break e;for(;t.sibling===null;){if(t.return===null||t.return===a)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(u){case"forwards":for(s=a.child,u=null;s!==null;)t=s.alternate,t!==null&&Fo(t)===null&&(u=s),s=s.sibling;s=u,s===null?(u=a.child,a.child=null):(u=s.sibling,s.sibling=null),ld(a,!1,u,s,m,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,u=a.child,a.child=null;u!==null;){if(t=u.alternate,t!==null&&Fo(t)===null){a.child=u;break}t=u.sibling,u.sibling=s,s=u,u=t}ld(a,!0,s,null,m,o);break;case"together":ld(a,!1,null,null,void 0,o);break;default:a.memoizedState=null}return a.child}function sa(t,a,s){if(t!==null&&(a.dependencies=t.dependencies),Da|=a.lanes,(s&a.childLanes)===0)if(t!==null){if(rs(t,a,s,!1),(s&a.childLanes)===0)return null}else return null;if(t!==null&&a.child!==t.child)throw Error(r(153));if(a.child!==null){for(t=a.child,s=Wn(t,t.pendingProps),a.child=s,s.return=a;t.sibling!==null;)t=t.sibling,s=s.sibling=Wn(t,t.pendingProps),s.return=a;s.sibling=null}return a.child}function cd(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&Go(t)))}function wx(t,a,s){switch(a.tag){case 3:nt(a,a.stateNode.containerInfo),ka(a,xt,t.memoizedState.cache),ui();break;case 27:case 5:Ue(a);break;case 4:nt(a,a.stateNode.containerInfo);break;case 10:ka(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Ru(a),null;break;case 13:var o=a.memoizedState;if(o!==null)return o.dehydrated!==null?(za(a),a.flags|=128,null):(s&a.child.childLanes)!==0?sg(t,a,s):(za(a),t=sa(t,a,s),t!==null?t.sibling:null);za(a);break;case 19:var u=(t.flags&128)!==0;if(o=(s&a.childLanes)!==0,o||(rs(t,a,s,!1),o=(s&a.childLanes)!==0),u){if(o)return og(t,a,s);a.flags|=128}if(u=a.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ue(gt,gt.current),o)break;return null;case 22:return a.lanes=0,Wh(t,a,s,a.pendingProps);case 24:ka(a,xt,t.memoizedState.cache)}return sa(t,a,s)}function lg(t,a,s){if(t!==null)if(t.memoizedProps!==a.pendingProps)jt=!0;else{if(!cd(t,s)&&(a.flags&128)===0)return jt=!1,wx(t,a,s);jt=(t.flags&131072)!==0}else jt=!1,Le&&(a.flags&1048576)!==0&&$m(a,vr,a.index);switch(a.lanes=0,a.tag){case 16:e:{var o=a.pendingProps;if(t=mi(a.elementType),a.type=t,typeof t=="function")mu(t)?(o=bi(t,o),a.tag=1,a=ag(null,a,t,o,s)):(a.tag=0,a=nd(null,a,t,o,s));else{if(t!=null){var u=t.$$typeof;if(u===Z){a.tag=11,a=Xh(null,a,t,o,s);break e}else if(u===O){a.tag=14,a=Jh(null,a,t,o,s);break e}}throw a=Ke(t)||t,Error(r(306,a,""))}}return a;case 0:return nd(t,a,a.type,a.pendingProps,s);case 1:return o=a.type,u=bi(o,a.pendingProps),ag(t,a,o,u,s);case 3:e:{if(nt(a,a.stateNode.containerInfo),t===null)throw Error(r(387));o=a.pendingProps;var m=a.memoizedState;u=m.element,zu(t,a),_r(a,o,null,s);var y=a.memoizedState;if(o=y.cache,ka(a,xt,o),o!==m.cache&&ju(a,[xt],s,!0),Ar(),o=y.element,m.isDehydrated)if(m={element:o,isDehydrated:!1,cache:y.cache},a.updateQueue.baseState=m,a.memoizedState=m,a.flags&256){a=ig(t,a,o,s);break e}else if(o!==u){u=hn(Error(r(424)),a),Sr(u),a=ig(t,a,o,s);break e}else for(t=a.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,it=Sn(t.firstChild),Rt=a,Le=!0,ja=null,bn=!0,s=Wm(a,null,o,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(ui(),o===u){a=sa(t,a,s);break e}Bt(t,a,o,s)}a=a.child}return a;case 26:return cl(t,a),t===null?(s=vy(a.type,null,a.pendingProps,null))?a.memoizedState=s:Le||(s=a.type,t=a.pendingProps,o=Al(ae.current).createElement(s),o[Dt]=a,o[Kt]=t,Lt(o,s,t),zt(o),a.stateNode=o):a.memoizedState=vy(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:return Ue(a),t===null&&Le&&(o=a.stateNode=gy(a.type,a.pendingProps,ae.current),Rt=a,bn=!0,u=it,qa(a.type)?(Vd=u,it=Sn(o.firstChild)):it=u),Bt(t,a,a.pendingProps.children,s),cl(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&&Le&&((u=o=it)&&(o=Fx(o,a.type,a.pendingProps,bn),o!==null?(a.stateNode=o,Rt=a,it=Sn(o.firstChild),bn=!1,u=!0):u=!1),u||Na(a)),Ue(a),u=a.type,m=a.pendingProps,y=t!==null?t.memoizedProps:null,o=m.children,Ld(u,m)?o=null:y!==null&&Ld(u,y)&&(a.flags|=32),a.memoizedState!==null&&(u=Bu(t,a,px,null,null,s),Kr._currentValue=u),cl(t,a),Bt(t,a,o,s),a.child;case 6:return t===null&&Le&&((t=s=it)&&(s=Wx(s,a.pendingProps,bn),s!==null?(a.stateNode=s,Rt=a,it=null,t=!0):t=!1),t||Na(a)),null;case 13:return sg(t,a,s);case 4:return nt(a,a.stateNode.containerInfo),o=a.pendingProps,t===null?a.child=gi(a,null,o,s):Bt(t,a,o,s),a.child;case 11:return Xh(t,a,a.type,a.pendingProps,s);case 7:return Bt(t,a,a.pendingProps,s),a.child;case 8:return Bt(t,a,a.pendingProps.children,s),a.child;case 12:return Bt(t,a,a.pendingProps.children,s),a.child;case 10:return o=a.pendingProps,ka(a,a.type,o.value),Bt(t,a,o.children,s),a.child;case 9:return u=a.type._context,o=a.pendingProps.children,fi(a),u=Mt(u),o=o(u),a.flags|=1,Bt(t,a,o,s),a.child;case 14:return Jh(t,a,a.type,a.pendingProps,s);case 15:return Fh(t,a,a.type,a.pendingProps,s);case 19:return og(t,a,s);case 31:return xx(t,a,s);case 22:return Wh(t,a,s,a.pendingProps);case 24:return fi(a),o=Mt(xt),t===null?(u=Au(),u===null&&(u=We,m=Nu(),u.pooledCache=m,m.refCount++,m!==null&&(u.pooledCacheLanes|=s),u=m),a.memoizedState={parent:o,cache:u},Cu(a),ka(a,xt,u)):((t.lanes&s)!==0&&(zu(t,a),_r(a,null,null,s),Ar()),u=t.memoizedState,m=a.memoizedState,u.parent!==o?(u={parent:o,cache:o},a.memoizedState=u,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=u),ka(a,xt,o)):(o=m.cache,ka(a,xt,o),o!==u.cache&&ju(a,[xt],s,!0))),Bt(t,a,a.pendingProps.children,s),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function ra(t){t.flags|=4}function ud(t,a,s,o,u){if((a=(t.mode&32)!==0)&&(a=!1),a){if(t.flags|=16777216,(u&335544128)===u)if(t.stateNode.complete)t.flags|=8192;else if(Mg())t.flags|=8192;else throw hi=Zo,_u}else t.flags&=-16777217}function cg(t,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Ny(a))if(Mg())t.flags|=8192;else throw hi=Zo,_u}function dl(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?ko():536870912,t.lanes|=a,bs|=a)}function Dr(t,a){if(!Le)switch(t.tailMode){case"hidden":a=t.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?a||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function st(t){var a=t.alternate!==null&&t.alternate.child===t.child,s=0,o=0;if(a)for(var u=t.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags&65011712,o|=u.flags&65011712,u.return=t,u=u.sibling;else for(u=t.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=t,u=u.sibling;return t.subtreeFlags|=o,t.childLanes=s,a}function jx(t,a,s){var o=a.pendingProps;switch(bu(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(a),null;case 1:return st(a),null;case 3:return s=a.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),a.memoizedState.cache!==o&&(a.flags|=2048),na(xt),xe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(ss(a)?ra(a):t===null||t.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Su())),st(a),null;case 26:var u=a.type,m=a.memoizedState;return t===null?(ra(a),m!==null?(st(a),cg(a,m)):(st(a),ud(a,u,null,o,s))):m?m!==t.memoizedState?(ra(a),st(a),cg(a,m)):(st(a),a.flags&=-16777217):(t=t.memoizedProps,t!==o&&ra(a),st(a),ud(a,u,t,o,s)),null;case 27:if(Ge(a),s=ae.current,u=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==o&&ra(a);else{if(!o){if(a.stateNode===null)throw Error(r(166));return st(a),null}t=te.current,ss(a)?Vm(a):(t=gy(u,o,s),a.stateNode=t,ra(a))}return st(a),null;case 5:if(Ge(a),u=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==o&&ra(a);else{if(!o){if(a.stateNode===null)throw Error(r(166));return st(a),null}if(m=te.current,ss(a))Vm(a);else{var y=Al(ae.current);switch(m){case 1:m=y.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:m=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":m=y.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":m=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":m=y.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof o.is=="string"?y.createElement("select",{is:o.is}):y.createElement("select"),o.multiple?m.multiple=!0:o.size&&(m.size=o.size);break;default:m=typeof o.is=="string"?y.createElement(u,{is:o.is}):y.createElement(u)}}m[Dt]=a,m[Kt]=o;e:for(y=a.child;y!==null;){if(y.tag===5||y.tag===6)m.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===a)break e;for(;y.sibling===null;){if(y.return===null||y.return===a)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}a.stateNode=m;e:switch(Lt(m,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ra(a)}}return st(a),ud(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,s),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==o&&ra(a);else{if(typeof o!="string"&&a.stateNode===null)throw Error(r(166));if(t=ae.current,ss(a)){if(t=a.stateNode,s=a.memoizedProps,o=null,u=Rt,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}t[Dt]=a,t=!!(t.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||sy(t.nodeValue,s)),t||Na(a,!0)}else t=Al(t).createTextNode(o),t[Dt]=a,a.stateNode=t}return st(a),null;case 31:if(s=a.memoizedState,t===null||t.memoizedState!==null){if(o=ss(a),s!==null){if(t===null){if(!o)throw Error(r(318));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[Dt]=a}else ui(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;st(a),t=!1}else s=Su(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return a.flags&256?(on(a),a):(on(a),null);if((a.flags&128)!==0)throw Error(r(558))}return st(a),null;case 13:if(o=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=ss(a),o!==null&&o.dehydrated!==null){if(t===null){if(!u)throw Error(r(318));if(u=a.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));u[Dt]=a}else ui(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;st(a),u=!1}else u=Su(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return a.flags&256?(on(a),a):(on(a),null)}return on(a),(a.flags&128)!==0?(a.lanes=s,a):(s=o!==null,t=t!==null&&t.memoizedState!==null,s&&(o=a.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),m=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),m!==u&&(o.flags|=2048)),s!==t&&s&&(a.child.flags|=8192),dl(a,a.updateQueue),st(a),null);case 4:return xe(),t===null&&Od(a.stateNode.containerInfo),st(a),null;case 10:return na(a.type),st(a),null;case 19:if(W(gt),o=a.memoizedState,o===null)return st(a),null;if(u=(a.flags&128)!==0,m=o.rendering,m===null)if(u)Dr(o,!1);else{if(mt!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(m=Fo(t),m!==null){for(a.flags|=128,Dr(o,!1),t=m.updateQueue,a.updateQueue=t,dl(a,t),a.subtreeFlags=0,t=s,s=a.child;s!==null;)Lm(s,t),s=s.sibling;return ue(gt,gt.current&1|2),Le&&ea(a,o.treeForkCount),a.child}t=t.sibling}o.tail!==null&&Ut()>gl&&(a.flags|=128,u=!0,Dr(o,!1),a.lanes=4194304)}else{if(!u)if(t=Fo(m),t!==null){if(a.flags|=128,u=!0,t=t.updateQueue,a.updateQueue=t,dl(a,t),Dr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!m.alternate&&!Le)return st(a),null}else 2*Ut()-o.renderingStartTime>gl&&s!==536870912&&(a.flags|=128,u=!0,Dr(o,!1),a.lanes=4194304);o.isBackwards?(m.sibling=a.child,a.child=m):(t=o.last,t!==null?t.sibling=m:a.child=m,o.last=m)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ut(),t.sibling=null,s=gt.current,ue(gt,u?s&1|2:s&1),Le&&ea(a,o.treeForkCount),t):(st(a),null);case 22:case 23:return on(a),Du(),o=a.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(a.flags|=8192):o&&(a.flags|=8192),o?(s&536870912)!==0&&(a.flags&128)===0&&(st(a),a.subtreeFlags&6&&(a.flags|=8192)):st(a),s=a.updateQueue,s!==null&&dl(a,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),o=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),o!==s&&(a.flags|=2048),t!==null&&W(pi),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),na(xt),st(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function Nx(t,a){switch(bu(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return na(xt),xe(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return Ge(a),null;case 31:if(a.memoizedState!==null){if(on(a),a.alternate===null)throw Error(r(340));ui()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(on(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(r(340));ui()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return W(gt),null;case 4:return xe(),null;case 10:return na(a.type),null;case 22:case 23:return on(a),Du(),t!==null&&W(pi),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return na(xt),null;case 25:return null;default:return null}}function ug(t,a){switch(bu(a),a.tag){case 3:na(xt),xe();break;case 26:case 27:case 5:Ge(a);break;case 4:xe();break;case 31:a.memoizedState!==null&&on(a);break;case 13:on(a);break;case 19:W(gt);break;case 10:na(a.type);break;case 22:case 23:on(a),Du(),t!==null&&W(pi);break;case 24:na(xt)}}function Rr(t,a){try{var s=a.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var u=o.next;s=u;do{if((s.tag&t)===t){o=void 0;var m=s.create,y=s.inst;o=m(),y.destroy=o}s=s.next}while(s!==u)}}catch(w){Qe(a,a.return,w)}}function Ea(t,a,s){try{var o=a.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var m=u.next;o=m;do{if((o.tag&t)===t){var y=o.inst,w=y.destroy;if(w!==void 0){y.destroy=void 0,u=a;var C=s,q=w;try{q()}catch(P){Qe(u,C,P)}}}o=o.next}while(o!==m)}}catch(P){Qe(a,a.return,P)}}function dg(t){var a=t.updateQueue;if(a!==null){var s=t.stateNode;try{th(a,s)}catch(o){Qe(t,t.return,o)}}}function fg(t,a,s){s.props=bi(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(o){Qe(t,a,o)}}function Mr(t,a){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof s=="function"?t.refCleanup=s(o):s.current=o}}catch(u){Qe(t,a,u)}}function Pn(t,a){var s=t.ref,o=t.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(u){Qe(t,a,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){Qe(t,a,u)}else s.current=null}function pg(t){var a=t.type,s=t.memoizedProps,o=t.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(u){Qe(t,t.return,u)}}function dd(t,a,s){try{var o=t.stateNode;Qx(o,t.type,s,a),o[Kt]=a}catch(u){Qe(t,t.return,u)}}function mg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&qa(t.type)||t.tag===4}function fd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||mg(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&qa(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function pd(t,a,s){var o=t.tag;if(o===5||o===6)t=t.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(t),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=Jn));else if(o!==4&&(o===27&&qa(t.type)&&(s=t.stateNode,a=null),t=t.child,t!==null))for(pd(t,a,s),t=t.sibling;t!==null;)pd(t,a,s),t=t.sibling}function fl(t,a,s){var o=t.tag;if(o===5||o===6)t=t.stateNode,a?s.insertBefore(t,a):s.appendChild(t);else if(o!==4&&(o===27&&qa(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(fl(t,a,s),t=t.sibling;t!==null;)fl(t,a,s),t=t.sibling}function hg(t){var a=t.stateNode,s=t.memoizedProps;try{for(var o=t.type,u=a.attributes;u.length;)a.removeAttributeNode(u[0]);Lt(a,o,s),a[Dt]=t,a[Kt]=s}catch(m){Qe(t,t.return,m)}}var oa=!1,Nt=!1,md=!1,gg=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function kx(t,a){if(t=t.containerInfo,Md=Dl,t=Cm(t),ou(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var u=o.anchorOffset,m=o.focusNode;o=o.focusOffset;try{s.nodeType,m.nodeType}catch{s=null;break e}var y=0,w=-1,C=-1,q=0,P=0,Y=t,$=null;t:for(;;){for(var I;Y!==s||u!==0&&Y.nodeType!==3||(w=y+u),Y!==m||o!==0&&Y.nodeType!==3||(C=y+o),Y.nodeType===3&&(y+=Y.nodeValue.length),(I=Y.firstChild)!==null;)$=Y,Y=I;for(;;){if(Y===t)break t;if($===s&&++q===u&&(w=y),$===m&&++P===o&&(C=y),(I=Y.nextSibling)!==null)break;Y=$,$=Y.parentNode}Y=I}s=w===-1||C===-1?null:{start:w,end:C}}else s=null}s=s||{start:0,end:0}}else s=null;for(Bd={focusedElem:t,selectionRange:s},Dl=!1,Tt=a;Tt!==null;)if(a=Tt,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,Tt=t;else for(;Tt!==null;){switch(a=Tt,m=a.alternate,t=a.flags,a.tag){case 0:if((t&4)!==0&&(t=a.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)u=t[s],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&m!==null){t=void 0,s=a,u=m.memoizedProps,m=m.memoizedState,o=s.stateNode;try{var pe=bi(s.type,u);t=o.getSnapshotBeforeUpdate(pe,m),o.__reactInternalSnapshotBeforeUpdate=t}catch(we){Qe(s,s.return,we)}}break;case 3:if((t&1024)!==0){if(t=a.stateNode.containerInfo,s=t.nodeType,s===9)Ud(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ud(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(r(163))}if(t=a.sibling,t!==null){t.return=a.return,Tt=t;break}Tt=a.return}}function yg(t,a,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:ca(t,s),o&4&&Rr(5,s);break;case 1:if(ca(t,s),o&4)if(t=s.stateNode,a===null)try{t.componentDidMount()}catch(y){Qe(s,s.return,y)}else{var u=bi(s.type,a.memoizedProps);a=a.memoizedState;try{t.componentDidUpdate(u,a,t.__reactInternalSnapshotBeforeUpdate)}catch(y){Qe(s,s.return,y)}}o&64&&dg(s),o&512&&Mr(s,s.return);break;case 3:if(ca(t,s),o&64&&(t=s.updateQueue,t!==null)){if(a=null,s.child!==null)switch(s.child.tag){case 27:case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}try{th(t,a)}catch(y){Qe(s,s.return,y)}}break;case 27:a===null&&o&4&&hg(s);case 26:case 5:ca(t,s),a===null&&o&4&&pg(s),o&512&&Mr(s,s.return);break;case 12:ca(t,s);break;case 31:ca(t,s),o&4&&Sg(t,s);break;case 13:ca(t,s),o&4&&xg(t,s),o&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=Rx.bind(null,s),ew(t,s))));break;case 22:if(o=s.memoizedState!==null||oa,!o){a=a!==null&&a.memoizedState!==null||Nt,u=oa;var m=Nt;oa=o,(Nt=a)&&!m?ua(t,s,(s.subtreeFlags&8772)!==0):ca(t,s),oa=u,Nt=m}break;case 30:break;default:ca(t,s)}}function bg(t){var a=t.alternate;a!==null&&(t.alternate=null,bg(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&Gc(a)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var ot=null,Yt=!1;function la(t,a,s){for(s=s.child;s!==null;)vg(t,a,s),s=s.sibling}function vg(t,a,s){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(va,s)}catch{}switch(s.tag){case 26:Nt||Pn(s,a),la(t,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Nt||Pn(s,a);var o=ot,u=Yt;qa(s.type)&&(ot=s.stateNode,Yt=!1),la(t,a,s),Gr(s.stateNode),ot=o,Yt=u;break;case 5:Nt||Pn(s,a);case 6:if(o=ot,u=Yt,ot=null,la(t,a,s),ot=o,Yt=u,ot!==null)if(Yt)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(s.stateNode)}catch(m){Qe(s,a,m)}else try{ot.removeChild(s.stateNode)}catch(m){Qe(s,a,m)}break;case 18:ot!==null&&(Yt?(t=ot,dy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),As(t)):dy(ot,s.stateNode));break;case 4:o=ot,u=Yt,ot=s.stateNode.containerInfo,Yt=!0,la(t,a,s),ot=o,Yt=u;break;case 0:case 11:case 14:case 15:Ea(2,s,a),Nt||Ea(4,s,a),la(t,a,s);break;case 1:Nt||(Pn(s,a),o=s.stateNode,typeof o.componentWillUnmount=="function"&&fg(s,a,o)),la(t,a,s);break;case 21:la(t,a,s);break;case 22:Nt=(o=Nt)||s.memoizedState!==null,la(t,a,s),Nt=o;break;default:la(t,a,s)}}function Sg(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{As(t)}catch(s){Qe(a,a.return,s)}}}function xg(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{As(t)}catch(s){Qe(a,a.return,s)}}function Ax(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new gg),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new gg),a;default:throw Error(r(435,t.tag))}}function pl(t,a){var s=Ax(t);a.forEach(function(o){if(!s.has(o)){s.add(o);var u=Mx.bind(null,t,o);o.then(u,u)}})}function Xt(t,a){var s=a.deletions;if(s!==null)for(var o=0;o<s.length;o++){var u=s[o],m=t,y=a,w=y;e:for(;w!==null;){switch(w.tag){case 27:if(qa(w.type)){ot=w.stateNode,Yt=!1;break e}break;case 5:ot=w.stateNode,Yt=!1;break e;case 3:case 4:ot=w.stateNode.containerInfo,Yt=!0;break e}w=w.return}if(ot===null)throw Error(r(160));vg(m,y,u),ot=null,Yt=!1,m=u.alternate,m!==null&&(m.return=null),u.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)wg(a,t),a=a.sibling}var Dn=null;function wg(t,a){var s=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Xt(a,t),Jt(t),o&4&&(Ea(3,t,t.return),Rr(3,t),Ea(5,t,t.return));break;case 1:Xt(a,t),Jt(t),o&512&&(Nt||s===null||Pn(s,s.return)),o&64&&oa&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var u=Dn;if(Xt(a,t),Jt(t),o&512&&(Nt||s===null||Pn(s,s.return)),o&4){var m=s!==null?s.memoizedState:null;if(o=t.memoizedState,s===null)if(o===null)if(t.stateNode===null){e:{o=t.type,s=t.memoizedProps,u=u.ownerDocument||u;t:switch(o){case"title":m=u.getElementsByTagName("title")[0],(!m||m[lr]||m[Dt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=u.createElement(o),u.head.insertBefore(m,u.querySelector("head > title"))),Lt(m,o,s),m[Dt]=t,zt(m),o=m;break e;case"link":var y=wy("link","href",u).get(o+(s.href||""));if(y){for(var w=0;w<y.length;w++)if(m=y[w],m.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&m.getAttribute("rel")===(s.rel==null?null:s.rel)&&m.getAttribute("title")===(s.title==null?null:s.title)&&m.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){y.splice(w,1);break t}}m=u.createElement(o),Lt(m,o,s),u.head.appendChild(m);break;case"meta":if(y=wy("meta","content",u).get(o+(s.content||""))){for(w=0;w<y.length;w++)if(m=y[w],m.getAttribute("content")===(s.content==null?null:""+s.content)&&m.getAttribute("name")===(s.name==null?null:s.name)&&m.getAttribute("property")===(s.property==null?null:s.property)&&m.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&m.getAttribute("charset")===(s.charSet==null?null:s.charSet)){y.splice(w,1);break t}}m=u.createElement(o),Lt(m,o,s),u.head.appendChild(m);break;default:throw Error(r(468,o))}m[Dt]=t,zt(m),o=m}t.stateNode=o}else jy(u,t.type,t.stateNode);else t.stateNode=xy(u,o,t.memoizedProps);else m!==o?(m===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):m.count--,o===null?jy(u,t.type,t.stateNode):xy(u,o,t.memoizedProps)):o===null&&t.stateNode!==null&&dd(t,t.memoizedProps,s.memoizedProps)}break;case 27:Xt(a,t),Jt(t),o&512&&(Nt||s===null||Pn(s,s.return)),s!==null&&o&4&&dd(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Xt(a,t),Jt(t),o&512&&(Nt||s===null||Pn(s,s.return)),t.flags&32){u=t.stateNode;try{Yi(u,"")}catch(pe){Qe(t,t.return,pe)}}o&4&&t.stateNode!=null&&(u=t.memoizedProps,dd(t,u,s!==null?s.memoizedProps:u)),o&1024&&(md=!0);break;case 6:if(Xt(a,t),Jt(t),o&4){if(t.stateNode===null)throw Error(r(162));o=t.memoizedProps,s=t.stateNode;try{s.nodeValue=o}catch(pe){Qe(t,t.return,pe)}}break;case 3:if(zl=null,u=Dn,Dn=_l(a.containerInfo),Xt(a,t),Dn=u,Jt(t),o&4&&s!==null&&s.memoizedState.isDehydrated)try{As(a.containerInfo)}catch(pe){Qe(t,t.return,pe)}md&&(md=!1,jg(t));break;case 4:o=Dn,Dn=_l(t.stateNode.containerInfo),Xt(a,t),Jt(t),Dn=o;break;case 12:Xt(a,t),Jt(t);break;case 31:Xt(a,t),Jt(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,pl(t,o)));break;case 13:Xt(a,t),Jt(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(hl=Ut()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,pl(t,o)));break;case 22:u=t.memoizedState!==null;var C=s!==null&&s.memoizedState!==null,q=oa,P=Nt;if(oa=q||u,Nt=P||C,Xt(a,t),Nt=P,oa=q,Jt(t),o&8192)e:for(a=t.stateNode,a._visibility=u?a._visibility&-2:a._visibility|1,u&&(s===null||C||oa||Nt||vi(t)),s=null,a=t;;){if(a.tag===5||a.tag===26){if(s===null){C=s=a;try{if(m=C.stateNode,u)y=m.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{w=C.stateNode;var Y=C.memoizedProps.style,$=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;w.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(pe){Qe(C,C.return,pe)}}}else if(a.tag===6){if(s===null){C=a;try{C.stateNode.nodeValue=u?"":C.memoizedProps}catch(pe){Qe(C,C.return,pe)}}}else if(a.tag===18){if(s===null){C=a;try{var I=C.stateNode;u?fy(I,!0):fy(C.stateNode,!1)}catch(pe){Qe(C,C.return,pe)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===t)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;s===a&&(s=null),a=a.return}s===a&&(s=null),a.sibling.return=a.return,a=a.sibling}o&4&&(o=t.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,pl(t,s))));break;case 19:Xt(a,t),Jt(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,pl(t,o)));break;case 30:break;case 21:break;default:Xt(a,t),Jt(t)}}function Jt(t){var a=t.flags;if(a&2){try{for(var s,o=t.return;o!==null;){if(mg(o)){s=o;break}o=o.return}if(s==null)throw Error(r(160));switch(s.tag){case 27:var u=s.stateNode,m=fd(t);fl(t,m,u);break;case 5:var y=s.stateNode;s.flags&32&&(Yi(y,""),s.flags&=-33);var w=fd(t);fl(t,w,y);break;case 3:case 4:var C=s.stateNode.containerInfo,q=fd(t);pd(t,q,C);break;default:throw Error(r(161))}}catch(P){Qe(t,t.return,P)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function jg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;jg(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),t=t.sibling}}function ca(t,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)yg(t,a.alternate,a),a=a.sibling}function vi(t){for(t=t.child;t!==null;){var a=t;switch(a.tag){case 0:case 11:case 14:case 15:Ea(4,a,a.return),vi(a);break;case 1:Pn(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&fg(a,a.return,s),vi(a);break;case 27:Gr(a.stateNode);case 26:case 5:Pn(a,a.return),vi(a);break;case 22:a.memoizedState===null&&vi(a);break;case 30:vi(a);break;default:vi(a)}t=t.sibling}}function ua(t,a,s){for(s=s&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var o=a.alternate,u=t,m=a,y=m.flags;switch(m.tag){case 0:case 11:case 15:ua(u,m,s),Rr(4,m);break;case 1:if(ua(u,m,s),o=m,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(q){Qe(o,o.return,q)}if(o=m,u=o.updateQueue,u!==null){var w=o.stateNode;try{var C=u.shared.hiddenCallbacks;if(C!==null)for(u.shared.hiddenCallbacks=null,u=0;u<C.length;u++)eh(C[u],w)}catch(q){Qe(o,o.return,q)}}s&&y&64&&dg(m),Mr(m,m.return);break;case 27:hg(m);case 26:case 5:ua(u,m,s),s&&o===null&&y&4&&pg(m),Mr(m,m.return);break;case 12:ua(u,m,s);break;case 31:ua(u,m,s),s&&y&4&&Sg(u,m);break;case 13:ua(u,m,s),s&&y&4&&xg(u,m);break;case 22:m.memoizedState===null&&ua(u,m,s),Mr(m,m.return);break;case 30:break;default:ua(u,m,s)}a=a.sibling}}function hd(t,a){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(t=a.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&xr(s))}function gd(t,a){t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&xr(t))}function Rn(t,a,s,o){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Ng(t,a,s,o),a=a.sibling}function Ng(t,a,s,o){var u=a.flags;switch(a.tag){case 0:case 11:case 15:Rn(t,a,s,o),u&2048&&Rr(9,a);break;case 1:Rn(t,a,s,o);break;case 3:Rn(t,a,s,o),u&2048&&(t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&xr(t)));break;case 12:if(u&2048){Rn(t,a,s,o),t=a.stateNode;try{var m=a.memoizedProps,y=m.id,w=m.onPostCommit;typeof w=="function"&&w(y,a.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(C){Qe(a,a.return,C)}}else Rn(t,a,s,o);break;case 31:Rn(t,a,s,o);break;case 13:Rn(t,a,s,o);break;case 23:break;case 22:m=a.stateNode,y=a.alternate,a.memoizedState!==null?m._visibility&2?Rn(t,a,s,o):Br(t,a):m._visibility&2?Rn(t,a,s,o):(m._visibility|=2,hs(t,a,s,o,(a.subtreeFlags&10256)!==0||!1)),u&2048&&hd(y,a);break;case 24:Rn(t,a,s,o),u&2048&&gd(a.alternate,a);break;default:Rn(t,a,s,o)}}function hs(t,a,s,o,u){for(u=u&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var m=t,y=a,w=s,C=o,q=y.flags;switch(y.tag){case 0:case 11:case 15:hs(m,y,w,C,u),Rr(8,y);break;case 23:break;case 22:var P=y.stateNode;y.memoizedState!==null?P._visibility&2?hs(m,y,w,C,u):Br(m,y):(P._visibility|=2,hs(m,y,w,C,u)),u&&q&2048&&hd(y.alternate,y);break;case 24:hs(m,y,w,C,u),u&&q&2048&&gd(y.alternate,y);break;default:hs(m,y,w,C,u)}a=a.sibling}}function Br(t,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var s=t,o=a,u=o.flags;switch(o.tag){case 22:Br(s,o),u&2048&&hd(o.alternate,o);break;case 24:Br(s,o),u&2048&&gd(o.alternate,o);break;default:Br(s,o)}a=a.sibling}}var Lr=8192;function gs(t,a,s){if(t.subtreeFlags&Lr)for(t=t.child;t!==null;)kg(t,a,s),t=t.sibling}function kg(t,a,s){switch(t.tag){case 26:gs(t,a,s),t.flags&Lr&&t.memoizedState!==null&&fw(s,Dn,t.memoizedState,t.memoizedProps);break;case 5:gs(t,a,s);break;case 3:case 4:var o=Dn;Dn=_l(t.stateNode.containerInfo),gs(t,a,s),Dn=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Lr,Lr=16777216,gs(t,a,s),Lr=o):gs(t,a,s));break;default:gs(t,a,s)}}function Ag(t){var a=t.alternate;if(a!==null&&(t=a.child,t!==null)){a.child=null;do a=t.sibling,t.sibling=null,t=a;while(t!==null)}}function qr(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var o=a[s];Tt=o,Cg(o,t)}Ag(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)_g(t),t=t.sibling}function _g(t){switch(t.tag){case 0:case 11:case 15:qr(t),t.flags&2048&&Ea(9,t,t.return);break;case 3:qr(t);break;case 12:qr(t);break;case 22:var a=t.stateNode;t.memoizedState!==null&&a._visibility&2&&(t.return===null||t.return.tag!==13)?(a._visibility&=-3,ml(t)):qr(t);break;default:qr(t)}}function ml(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var o=a[s];Tt=o,Cg(o,t)}Ag(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:Ea(8,a,a.return),ml(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,ml(a));break;default:ml(a)}t=t.sibling}}function Cg(t,a){for(;Tt!==null;){var s=Tt;switch(s.tag){case 0:case 11:case 15:Ea(8,s,a);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:xr(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,Tt=o;else e:for(s=t;Tt!==null;){o=Tt;var u=o.sibling,m=o.return;if(bg(o),o===s){Tt=null;break e}if(u!==null){u.return=m,Tt=u;break e}Tt=m}}}var _x={getCacheForType:function(t){var a=Mt(xt),s=a.data.get(t);return s===void 0&&(s=t(),a.data.set(t,s)),s},cacheSignal:function(){return Mt(xt).controller.signal}},Cx=typeof WeakMap=="function"?WeakMap:Map,Ve=0,We=null,De=null,Me=0,He=0,ln=null,Oa=!1,ys=!1,yd=!1,da=0,mt=0,Da=0,Si=0,bd=0,cn=0,bs=0,Ur=null,Ft=null,vd=!1,hl=0,zg=0,gl=1/0,yl=null,Ra=null,At=0,Ma=null,vs=null,fa=0,Sd=0,xd=null,Tg=null,$r=0,wd=null;function un(){return(Ve&2)!==0&&Me!==0?Me&-Me:B.T!==null?Cd():Qp()}function Eg(){if(cn===0)if((Me&536870912)===0||Le){var t=$i;$i<<=1,($i&3932160)===0&&($i=262144),cn=t}else cn=536870912;return t=rn.current,t!==null&&(t.flags|=32),cn}function Wt(t,a,s){(t===We&&(He===2||He===9)||t.cancelPendingCommit!==null)&&(Ss(t,0),Ba(t,Me,cn,!1)),Fe(t,s),((Ve&2)===0||t!==We)&&(t===We&&((Ve&2)===0&&(Si|=s),mt===4&&Ba(t,Me,cn,!1)),Gn(t))}function Og(t,a,s){if((Ve&6)!==0)throw Error(r(327));var o=!s&&(a&127)===0&&(a&t.expiredLanes)===0||ni(t,a),u=o?Ex(t,a):Nd(t,a,!0),m=o;do{if(u===0){ys&&!o&&Ba(t,a,0,!1);break}else{if(s=t.current.alternate,m&&!zx(s)){u=Nd(t,a,!1),m=!1;continue}if(u===2){if(m=a,t.errorRecoveryDisabledLanes&m)var y=0;else y=t.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){a=y;e:{var w=t;u=Ur;var C=w.current.memoizedState.isDehydrated;if(C&&(Ss(w,y).flags|=256),y=Nd(w,y,!1),y!==2){if(yd&&!C){w.errorRecoveryDisabledLanes|=m,Si|=m,u=4;break e}m=Ft,Ft=u,m!==null&&(Ft===null?Ft=m:Ft.push.apply(Ft,m))}u=y}if(m=!1,u!==2)continue}}if(u===1){Ss(t,0),Ba(t,a,0,!0);break}e:{switch(o=t,m=u,m){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:Ba(o,a,cn,!Oa);break e;case 2:Ft=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(u=hl+300-Ut(),10<u)){if(Ba(o,a,cn,!Oa),Vi(o,0,!0)!==0)break e;fa=a,o.timeoutHandle=cy(Dg.bind(null,o,s,Ft,yl,vd,a,cn,Si,bs,Oa,m,"Throttled",-0,0),u);break e}Dg(o,s,Ft,yl,vd,a,cn,Si,bs,Oa,m,null,-0,0)}}break}while(!0);Gn(t)}function Dg(t,a,s,o,u,m,y,w,C,q,P,Y,$,I){if(t.timeoutHandle=-1,Y=a.subtreeFlags,Y&8192||(Y&16785408)===16785408){Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jn},kg(a,m,Y);var pe=(m&62914560)===m?hl-Ut():(m&4194048)===m?zg-Ut():0;if(pe=pw(Y,pe),pe!==null){fa=m,t.cancelPendingCommit=pe(Ig.bind(null,t,a,m,s,o,u,y,w,C,P,Y,null,$,I)),Ba(t,m,y,!q);return}}Ig(t,a,m,s,o,u,y,w,C)}function zx(t){for(var a=t;;){var s=a.tag;if((s===0||s===11||s===15)&&a.flags&16384&&(s=a.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var u=s[o],m=u.getSnapshot;u=u.value;try{if(!an(m(),u))return!1}catch{return!1}}if(s=a.child,a.subtreeFlags&16384&&s!==null)s.return=a,a=s;else{if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Ba(t,a,s,o){a&=~bd,a&=~Si,t.suspendedLanes|=a,t.pingedLanes&=~a,o&&(t.warmLanes|=a),o=t.expirationTimes;for(var u=a;0<u;){var m=31-ht(u),y=1<<m;o[m]=-1,u&=~y}s!==0&&Ao(t,s,a)}function bl(){return(Ve&6)===0?(Ir(0),!1):!0}function jd(){if(De!==null){if(He===0)var t=De.return;else t=De,ta=di=null,Uu(t),us=null,jr=0,t=De;for(;t!==null;)ug(t.alternate,t),t=t.return;De=null}}function Ss(t,a){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,Yx(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),fa=0,jd(),We=t,De=s=Wn(t.current,null),Me=a,He=0,ln=null,Oa=!1,ys=ni(t,a),yd=!1,bs=cn=bd=Si=Da=mt=0,Ft=Ur=null,vd=!1,(a&8)!==0&&(a|=a&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=a;0<o;){var u=31-ht(o),m=1<<u;a|=t[u],o&=~m}return da=a,Uo(),s}function Rg(t,a){Ce=null,B.H=Er,a===cs||a===Ko?(a=Xm(),He=3):a===_u?(a=Xm(),He=4):He=a===td?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,ln=a,De===null&&(mt=1,ol(t,hn(a,t.current)))}function Mg(){var t=rn.current;return t===null?!0:(Me&4194048)===Me?vn===null:(Me&62914560)===Me||(Me&536870912)!==0?t===vn:!1}function Bg(){var t=B.H;return B.H=Er,t===null?Er:t}function Lg(){var t=B.A;return B.A=_x,t}function vl(){mt=4,Oa||(Me&4194048)!==Me&&rn.current!==null||(ys=!0),(Da&134217727)===0&&(Si&134217727)===0||We===null||Ba(We,Me,cn,!1)}function Nd(t,a,s){var o=Ve;Ve|=2;var u=Bg(),m=Lg();(We!==t||Me!==a)&&(yl=null,Ss(t,a)),a=!1;var y=mt;e:do try{if(He!==0&&De!==null){var w=De,C=ln;switch(He){case 8:jd(),y=6;break e;case 3:case 2:case 9:case 6:rn.current===null&&(a=!0);var q=He;if(He=0,ln=null,xs(t,w,C,q),s&&ys){y=0;break e}break;default:q=He,He=0,ln=null,xs(t,w,C,q)}}Tx(),y=mt;break}catch(P){Rg(t,P)}while(!0);return a&&t.shellSuspendCounter++,ta=di=null,Ve=o,B.H=u,B.A=m,De===null&&(We=null,Me=0,Uo()),y}function Tx(){for(;De!==null;)qg(De)}function Ex(t,a){var s=Ve;Ve|=2;var o=Bg(),u=Lg();We!==t||Me!==a?(yl=null,gl=Ut()+500,Ss(t,a)):ys=ni(t,a);e:do try{if(He!==0&&De!==null){a=De;var m=ln;t:switch(He){case 1:He=0,ln=null,xs(t,a,m,1);break;case 2:case 9:if(Zm(m)){He=0,ln=null,Ug(a);break}a=function(){He!==2&&He!==9||We!==t||(He=7),Gn(t)},m.then(a,a);break e;case 3:He=7;break e;case 4:He=5;break e;case 7:Zm(m)?(He=0,ln=null,Ug(a)):(He=0,ln=null,xs(t,a,m,7));break;case 5:var y=null;switch(De.tag){case 26:y=De.memoizedState;case 5:case 27:var w=De;if(y?Ny(y):w.stateNode.complete){He=0,ln=null;var C=w.sibling;if(C!==null)De=C;else{var q=w.return;q!==null?(De=q,Sl(q)):De=null}break t}}He=0,ln=null,xs(t,a,m,5);break;case 6:He=0,ln=null,xs(t,a,m,6);break;case 8:jd(),mt=6;break e;default:throw Error(r(462))}}Ox();break}catch(P){Rg(t,P)}while(!0);return ta=di=null,B.H=o,B.A=u,Ve=s,De!==null?0:(We=null,Me=0,Uo(),mt)}function Ox(){for(;De!==null&&!xo();)qg(De)}function qg(t){var a=lg(t.alternate,t,da);t.memoizedProps=t.pendingProps,a===null?Sl(t):De=a}function Ug(t){var a=t,s=a.alternate;switch(a.tag){case 15:case 0:a=ng(s,a,a.pendingProps,a.type,void 0,Me);break;case 11:a=ng(s,a,a.pendingProps,a.type.render,a.ref,Me);break;case 5:Uu(a);default:ug(s,a),a=De=Lm(a,da),a=lg(s,a,da)}t.memoizedProps=t.pendingProps,a===null?Sl(t):De=a}function xs(t,a,s,o){ta=di=null,Uu(a),us=null,jr=0;var u=a.return;try{if(Sx(t,u,a,s,Me)){mt=1,ol(t,hn(s,t.current)),De=null;return}}catch(m){if(u!==null)throw De=u,m;mt=1,ol(t,hn(s,t.current)),De=null;return}a.flags&32768?(Le||o===1?t=!0:ys||(Me&536870912)!==0?t=!1:(Oa=t=!0,(o===2||o===9||o===3||o===6)&&(o=rn.current,o!==null&&o.tag===13&&(o.flags|=16384))),$g(a,t)):Sl(a)}function Sl(t){var a=t;do{if((a.flags&32768)!==0){$g(a,Oa);return}t=a.return;var s=jx(a.alternate,a,da);if(s!==null){De=s;return}if(a=a.sibling,a!==null){De=a;return}De=a=t}while(a!==null);mt===0&&(mt=5)}function $g(t,a){do{var s=Nx(t.alternate,t);if(s!==null){s.flags&=32767,De=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(t=t.sibling,t!==null)){De=t;return}De=t=s}while(t!==null);mt=6,De=null}function Ig(t,a,s,o,u,m,y,w,C){t.cancelPendingCommit=null;do xl();while(At!==0);if((Ve&6)!==0)throw Error(r(327));if(a!==null){if(a===t.current)throw Error(r(177));if(m=a.lanes|a.childLanes,m|=fu,ai(t,s,m,y,w,C),t===We&&(De=We=null,Me=0),vs=a,Ma=t,fa=s,Sd=m,xd=u,Tg=o,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Bx(Li,function(){return Qg(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||o){o=B.T,B.T=null,u=J.p,J.p=2,y=Ve,Ve|=4;try{kx(t,a,s)}finally{Ve=y,J.p=u,B.T=o}}At=1,Vg(),Pg(),Gg()}}function Vg(){if(At===1){At=0;var t=Ma,a=vs,s=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||s){s=B.T,B.T=null;var o=J.p;J.p=2;var u=Ve;Ve|=4;try{wg(a,t);var m=Bd,y=Cm(t.containerInfo),w=m.focusedElem,C=m.selectionRange;if(y!==w&&w&&w.ownerDocument&&_m(w.ownerDocument.documentElement,w)){if(C!==null&&ou(w)){var q=C.start,P=C.end;if(P===void 0&&(P=q),"selectionStart"in w)w.selectionStart=q,w.selectionEnd=Math.min(P,w.value.length);else{var Y=w.ownerDocument||document,$=Y&&Y.defaultView||window;if($.getSelection){var I=$.getSelection(),pe=w.textContent.length,we=Math.min(C.start,pe),Je=C.end===void 0?we:Math.min(C.end,pe);!I.extend&&we>Je&&(y=Je,Je=we,we=y);var D=Am(w,we),z=Am(w,Je);if(D&&z&&(I.rangeCount!==1||I.anchorNode!==D.node||I.anchorOffset!==D.offset||I.focusNode!==z.node||I.focusOffset!==z.offset)){var L=Y.createRange();L.setStart(D.node,D.offset),I.removeAllRanges(),we>Je?(I.addRange(L),I.extend(z.node,z.offset)):(L.setEnd(z.node,z.offset),I.addRange(L))}}}}for(Y=[],I=w;I=I.parentNode;)I.nodeType===1&&Y.push({element:I,left:I.scrollLeft,top:I.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<Y.length;w++){var Q=Y[w];Q.element.scrollLeft=Q.left,Q.element.scrollTop=Q.top}}Dl=!!Md,Bd=Md=null}finally{Ve=u,J.p=o,B.T=s}}t.current=a,At=2}}function Pg(){if(At===2){At=0;var t=Ma,a=vs,s=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||s){s=B.T,B.T=null;var o=J.p;J.p=2;var u=Ve;Ve|=4;try{yg(t,a.alternate,a)}finally{Ve=u,J.p=o,B.T=s}}At=3}}function Gg(){if(At===4||At===3){At=0,$c();var t=Ma,a=vs,s=fa,o=Tg;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?At=5:(At=0,vs=Ma=null,Hg(t,t.pendingLanes));var u=t.pendingLanes;if(u===0&&(Ra=null),En(s),a=a.stateNode,$t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(va,a,void 0,(a.current.flags&128)===128)}catch{}if(o!==null){a=B.T,u=J.p,J.p=2,B.T=null;try{for(var m=t.onRecoverableError,y=0;y<o.length;y++){var w=o[y];m(w.value,{componentStack:w.stack})}}finally{B.T=a,J.p=u}}(fa&3)!==0&&xl(),Gn(t),u=t.pendingLanes,(s&261930)!==0&&(u&42)!==0?t===wd?$r++:($r=0,wd=t):$r=0,Ir(0)}}function Hg(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,xr(a)))}function xl(){return Vg(),Pg(),Gg(),Qg()}function Qg(){if(At!==5)return!1;var t=Ma,a=Sd;Sd=0;var s=En(fa),o=B.T,u=J.p;try{J.p=32>s?32:s,B.T=null,s=xd,xd=null;var m=Ma,y=fa;if(At=0,vs=Ma=null,fa=0,(Ve&6)!==0)throw Error(r(331));var w=Ve;if(Ve|=4,_g(m.current),Ng(m,m.current,y,s),Ve=w,Ir(0,!1),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(va,m)}catch{}return!0}finally{J.p=u,B.T=o,Hg(t,a)}}function Kg(t,a,s){a=hn(s,a),a=ed(t.stateNode,a,2),t=Ca(t,a,2),t!==null&&(Fe(t,2),Gn(t))}function Qe(t,a,s){if(t.tag===3)Kg(t,t,s);else for(;a!==null;){if(a.tag===3){Kg(a,t,s);break}else if(a.tag===1){var o=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ra===null||!Ra.has(o))){t=hn(s,t),s=Zh(2),o=Ca(a,s,2),o!==null&&(Yh(s,o,a,t),Fe(o,2),Gn(o));break}}a=a.return}}function kd(t,a,s){var o=t.pingCache;if(o===null){o=t.pingCache=new Cx;var u=new Set;o.set(a,u)}else u=o.get(a),u===void 0&&(u=new Set,o.set(a,u));u.has(s)||(yd=!0,u.add(s),t=Dx.bind(null,t,a,s),a.then(t,t))}function Dx(t,a,s){var o=t.pingCache;o!==null&&o.delete(a),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,We===t&&(Me&s)===s&&(mt===4||mt===3&&(Me&62914560)===Me&&300>Ut()-hl?(Ve&2)===0&&Ss(t,0):bd|=s,bs===Me&&(bs=0)),Gn(t)}function Zg(t,a){a===0&&(a=ko()),t=li(t,a),t!==null&&(Fe(t,a),Gn(t))}function Rx(t){var a=t.memoizedState,s=0;a!==null&&(s=a.retryLane),Zg(t,s)}function Mx(t,a){var s=0;switch(t.tag){case 31:case 13:var o=t.stateNode,u=t.memoizedState;u!==null&&(s=u.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(r(314))}o!==null&&o.delete(a),Zg(t,s)}function Bx(t,a){return Mi(t,a)}var wl=null,ws=null,Ad=!1,jl=!1,_d=!1,La=0;function Gn(t){t!==ws&&t.next===null&&(ws===null?wl=ws=t:ws=ws.next=t),jl=!0,Ad||(Ad=!0,qx())}function Ir(t,a){if(!_d&&jl){_d=!0;do for(var s=!1,o=wl;o!==null;){if(t!==0){var u=o.pendingLanes;if(u===0)var m=0;else{var y=o.suspendedLanes,w=o.pingedLanes;m=(1<<31-ht(42|t)+1)-1,m&=u&~(y&~w),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(s=!0,Fg(o,m))}else m=Me,m=Vi(o,o===We?m:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(m&3)===0||ni(o,m)||(s=!0,Fg(o,m));o=o.next}while(s);_d=!1}}function Lx(){Yg()}function Yg(){jl=Ad=!1;var t=0;La!==0&&Zx()&&(t=La);for(var a=Ut(),s=null,o=wl;o!==null;){var u=o.next,m=Xg(o,a);m===0?(o.next=null,s===null?wl=u:s.next=u,u===null&&(ws=s)):(s=o,(t!==0||(m&3)!==0)&&(jl=!0)),o=u}At!==0&&At!==5||Ir(t),La!==0&&(La=0)}function Xg(t,a){for(var s=t.suspendedLanes,o=t.pingedLanes,u=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var y=31-ht(m),w=1<<y,C=u[y];C===-1?((w&s)===0||(w&o)!==0)&&(u[y]=Yn(w,a)):C<=a&&(t.expiredLanes|=w),m&=~w}if(a=We,s=Me,s=Vi(t,t===a?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,s===0||t===a&&(He===2||He===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&Bi(o),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||ni(t,s)){if(a=s&-s,a===t.callbackPriority)return a;switch(o!==null&&Bi(o),En(s)){case 2:case 8:s=jo;break;case 32:s=Li;break;case 268435456:s=qi;break;default:s=Li}return o=Jg.bind(null,t),s=Mi(s,o),t.callbackPriority=a,t.callbackNode=s,a}return o!==null&&o!==null&&Bi(o),t.callbackPriority=2,t.callbackNode=null,2}function Jg(t,a){if(At!==0&&At!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(xl()&&t.callbackNode!==s)return null;var o=Me;return o=Vi(t,t===We?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(Og(t,o,a),Xg(t,Ut()),t.callbackNode!=null&&t.callbackNode===s?Jg.bind(null,t):null)}function Fg(t,a){if(xl())return null;Og(t,a,!0)}function qx(){Xx(function(){(Ve&6)!==0?Mi(ir,Lx):Yg()})}function Cd(){if(La===0){var t=os;t===0&&(t=Ui,Ui<<=1,(Ui&261888)===0&&(Ui=256)),La=t}return La}function Wg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Eo(""+t)}function ey(t,a){var s=a.ownerDocument.createElement("input");return s.name=a.name,s.value=a.value,t.id&&s.setAttribute("form",t.id),a.parentNode.insertBefore(s,a),t=new FormData(t),s.parentNode.removeChild(s),t}function Ux(t,a,s,o,u){if(a==="submit"&&s&&s.stateNode===u){var m=Wg((u[Kt]||null).action),y=o.submitter;y&&(a=(a=y[Kt]||null)?Wg(a.formAction):y.getAttribute("formAction"),a!==null&&(m=a,y=null));var w=new Mo("action","action",null,o,u);t.push({event:w,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(La!==0){var C=y?ey(u,y):new FormData(u);Zu(s,{pending:!0,data:C,method:u.method,action:m},null,C)}}else typeof m=="function"&&(w.preventDefault(),C=y?ey(u,y):new FormData(u),Zu(s,{pending:!0,data:C,method:u.method,action:m},m,C))},currentTarget:u}]})}}for(var zd=0;zd<du.length;zd++){var Td=du[zd],$x=Td.toLowerCase(),Ix=Td[0].toUpperCase()+Td.slice(1);On($x,"on"+Ix)}On(Em,"onAnimationEnd"),On(Om,"onAnimationIteration"),On(Dm,"onAnimationStart"),On("dblclick","onDoubleClick"),On("focusin","onFocus"),On("focusout","onBlur"),On(ax,"onTransitionRun"),On(ix,"onTransitionStart"),On(sx,"onTransitionCancel"),On(Rm,"onTransitionEnd"),Ki("onMouseEnter",["mouseout","mouseover"]),Ki("onMouseLeave",["mouseout","mouseover"]),Ki("onPointerEnter",["pointerout","pointerover"]),Ki("onPointerLeave",["pointerout","pointerover"]),ii("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ii("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ii("onBeforeInput",["compositionend","keypress","textInput","paste"]),ii("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vr="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(" "),Vx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vr));function ty(t,a){a=(a&4)!==0;for(var s=0;s<t.length;s++){var o=t[s],u=o.event;o=o.listeners;e:{var m=void 0;if(a)for(var y=o.length-1;0<=y;y--){var w=o[y],C=w.instance,q=w.currentTarget;if(w=w.listener,C!==m&&u.isPropagationStopped())break e;m=w,u.currentTarget=q;try{m(u)}catch(P){qo(P)}u.currentTarget=null,m=C}else for(y=0;y<o.length;y++){if(w=o[y],C=w.instance,q=w.currentTarget,w=w.listener,C!==m&&u.isPropagationStopped())break e;m=w,u.currentTarget=q;try{m(u)}catch(P){qo(P)}u.currentTarget=null,m=C}}}}function Re(t,a){var s=a[Pc];s===void 0&&(s=a[Pc]=new Set);var o=t+"__bubble";s.has(o)||(ny(a,t,2,!1),s.add(o))}function Ed(t,a,s){var o=0;a&&(o|=4),ny(s,t,o,a)}var Nl="_reactListening"+Math.random().toString(36).slice(2);function Od(t){if(!t[Nl]){t[Nl]=!0,Yp.forEach(function(s){s!=="selectionchange"&&(Vx.has(s)||Ed(s,!1,t),Ed(s,!0,t))});var a=t.nodeType===9?t:t.ownerDocument;a===null||a[Nl]||(a[Nl]=!0,Ed("selectionchange",!1,a))}}function ny(t,a,s,o){switch(Ey(a)){case 2:var u=gw;break;case 8:u=yw;break;default:u=Kd}s=u.bind(null,a,s,t),u=void 0,!Fc||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(u=!0),o?u!==void 0?t.addEventListener(a,s,{capture:!0,passive:u}):t.addEventListener(a,s,!0):u!==void 0?t.addEventListener(a,s,{passive:u}):t.addEventListener(a,s,!1)}function Dd(t,a,s,o,u){var m=o;if((a&1)===0&&(a&2)===0&&o!==null)e:for(;;){if(o===null)return;var y=o.tag;if(y===3||y===4){var w=o.stateNode.containerInfo;if(w===u)break;if(y===4)for(y=o.return;y!==null;){var C=y.tag;if((C===3||C===4)&&y.stateNode.containerInfo===u)return;y=y.return}for(;w!==null;){if(y=Gi(w),y===null)return;if(C=y.tag,C===5||C===6||C===26||C===27){o=m=y;continue e}w=w.parentNode}}o=o.return}om(function(){var q=m,P=Xc(s),Y=[];e:{var $=Mm.get(t);if($!==void 0){var I=Mo,pe=t;switch(t){case"keypress":if(Do(s)===0)break e;case"keydown":case"keyup":I=M1;break;case"focusin":pe="focus",I=nu;break;case"focusout":pe="blur",I=nu;break;case"beforeblur":case"afterblur":I=nu;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":I=um;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":I=j1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":I=q1;break;case Em:case Om:case Dm:I=A1;break;case Rm:I=$1;break;case"scroll":case"scrollend":I=x1;break;case"wheel":I=V1;break;case"copy":case"cut":case"paste":I=C1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":I=fm;break;case"toggle":case"beforetoggle":I=G1}var we=(a&4)!==0,Je=!we&&(t==="scroll"||t==="scrollend"),D=we?$!==null?$+"Capture":null:$;we=[];for(var z=q,L;z!==null;){var Q=z;if(L=Q.stateNode,Q=Q.tag,Q!==5&&Q!==26&&Q!==27||L===null||D===null||(Q=ur(z,D),Q!=null&&we.push(Pr(z,Q,L))),Je)break;z=z.return}0<we.length&&($=new I($,pe,null,s,P),Y.push({event:$,listeners:we}))}}if((a&7)===0){e:{if($=t==="mouseover"||t==="pointerover",I=t==="mouseout"||t==="pointerout",$&&s!==Yc&&(pe=s.relatedTarget||s.fromElement)&&(Gi(pe)||pe[Pi]))break e;if((I||$)&&($=P.window===P?P:($=P.ownerDocument)?$.defaultView||$.parentWindow:window,I?(pe=s.relatedTarget||s.toElement,I=q,pe=pe?Gi(pe):null,pe!==null&&(Je=c(pe),we=pe.tag,pe!==Je||we!==5&&we!==27&&we!==6)&&(pe=null)):(I=null,pe=q),I!==pe)){if(we=um,Q="onMouseLeave",D="onMouseEnter",z="mouse",(t==="pointerout"||t==="pointerover")&&(we=fm,Q="onPointerLeave",D="onPointerEnter",z="pointer"),Je=I==null?$:cr(I),L=pe==null?$:cr(pe),$=new we(Q,z+"leave",I,s,P),$.target=Je,$.relatedTarget=L,Q=null,Gi(P)===q&&(we=new we(D,z+"enter",pe,s,P),we.target=L,we.relatedTarget=Je,Q=we),Je=Q,I&&pe)t:{for(we=Px,D=I,z=pe,L=0,Q=D;Q;Q=we(Q))L++;Q=0;for(var ve=z;ve;ve=we(ve))Q++;for(;0<L-Q;)D=we(D),L--;for(;0<Q-L;)z=we(z),Q--;for(;L--;){if(D===z||z!==null&&D===z.alternate){we=D;break t}D=we(D),z=we(z)}we=null}else we=null;I!==null&&ay(Y,$,I,we,!1),pe!==null&&Je!==null&&ay(Y,Je,pe,we,!0)}}e:{if($=q?cr(q):window,I=$.nodeName&&$.nodeName.toLowerCase(),I==="select"||I==="input"&&$.type==="file")var $e=Sm;else if(bm($))if(xm)$e=ex;else{$e=F1;var ge=J1}else I=$.nodeName,!I||I.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?q&&Zc(q.elementType)&&($e=Sm):$e=W1;if($e&&($e=$e(t,q))){vm(Y,$e,s,P);break e}ge&&ge(t,$,q),t==="focusout"&&q&&$.type==="number"&&q.memoizedProps.value!=null&&Kc($,"number",$.value)}switch(ge=q?cr(q):window,t){case"focusin":(bm(ge)||ge.contentEditable==="true")&&(Wi=ge,lu=q,br=null);break;case"focusout":br=lu=Wi=null;break;case"mousedown":cu=!0;break;case"contextmenu":case"mouseup":case"dragend":cu=!1,zm(Y,s,P);break;case"selectionchange":if(nx)break;case"keydown":case"keyup":zm(Y,s,P)}var ze;if(iu)e:{switch(t){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else Fi?gm(t,s)&&(Be="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(Be="onCompositionStart");Be&&(pm&&s.locale!=="ko"&&(Fi||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&Fi&&(ze=lm()):(xa=P,Wc="value"in xa?xa.value:xa.textContent,Fi=!0)),ge=kl(q,Be),0<ge.length&&(Be=new dm(Be,t,null,s,P),Y.push({event:Be,listeners:ge}),ze?Be.data=ze:(ze=ym(s),ze!==null&&(Be.data=ze)))),(ze=Q1?K1(t,s):Z1(t,s))&&(Be=kl(q,"onBeforeInput"),0<Be.length&&(ge=new dm("onBeforeInput","beforeinput",null,s,P),Y.push({event:ge,listeners:Be}),ge.data=ze)),Ux(Y,t,q,s,P)}ty(Y,a)})}function Pr(t,a,s){return{instance:t,listener:a,currentTarget:s}}function kl(t,a){for(var s=a+"Capture",o=[];t!==null;){var u=t,m=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||m===null||(u=ur(t,s),u!=null&&o.unshift(Pr(t,u,m)),u=ur(t,a),u!=null&&o.push(Pr(t,u,m))),t.tag===3)return o;t=t.return}return[]}function Px(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function ay(t,a,s,o,u){for(var m=a._reactName,y=[];s!==null&&s!==o;){var w=s,C=w.alternate,q=w.stateNode;if(w=w.tag,C!==null&&C===o)break;w!==5&&w!==26&&w!==27||q===null||(C=q,u?(q=ur(s,m),q!=null&&y.unshift(Pr(s,q,C))):u||(q=ur(s,m),q!=null&&y.push(Pr(s,q,C)))),s=s.return}y.length!==0&&t.push({event:a,listeners:y})}var Gx=/\r\n?/g,Hx=/\u0000|\uFFFD/g;function iy(t){return(typeof t=="string"?t:""+t).replace(Gx,`
10
- `).replace(Hx,"")}function sy(t,a){return a=iy(a),iy(t)===a}function Xe(t,a,s,o,u,m){switch(s){case"children":typeof o=="string"?a==="body"||a==="textarea"&&o===""||Yi(t,o):(typeof o=="number"||typeof o=="bigint")&&a!=="body"&&Yi(t,""+o);break;case"className":zo(t,"class",o);break;case"tabIndex":zo(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":zo(t,s,o);break;case"style":sm(t,o,m);break;case"data":if(a!=="object"){zo(t,"data",o);break}case"src":case"href":if(o===""&&(a!=="a"||s!=="href")){t.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=Eo(""+o),t.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(s,"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 m=="function"&&(s==="formAction"?(a!=="input"&&Xe(t,a,"name",u.name,u,null),Xe(t,a,"formEncType",u.formEncType,u,null),Xe(t,a,"formMethod",u.formMethod,u,null),Xe(t,a,"formTarget",u.formTarget,u,null)):(Xe(t,a,"encType",u.encType,u,null),Xe(t,a,"method",u.method,u,null),Xe(t,a,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=Eo(""+o),t.setAttribute(s,o);break;case"onClick":o!=null&&(t.onclick=Jn);break;case"onScroll":o!=null&&Re("scroll",t);break;case"onScrollEnd":o!=null&&Re("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(r(60));t.innerHTML=s}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}s=Eo(""+o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,""+o):t.removeAttribute(s);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":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":o===!0?t.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,o):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(s,o):t.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(s):t.setAttribute(s,o);break;case"popover":Re("beforetoggle",t),Re("toggle",t),Co(t,"popover",o);break;case"xlinkActuate":Xn(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Xn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Xn(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Xn(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Xn(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Xn(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Xn(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Xn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Xn(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Co(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=v1.get(s)||s,Co(t,s,o))}}function Rd(t,a,s,o,u,m){switch(s){case"style":sm(t,o,m);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(r(60));t.innerHTML=s}}break;case"children":typeof o=="string"?Yi(t,o):(typeof o=="number"||typeof o=="bigint")&&Yi(t,""+o);break;case"onScroll":o!=null&&Re("scroll",t);break;case"onScrollEnd":o!=null&&Re("scrollend",t);break;case"onClick":o!=null&&(t.onclick=Jn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Xp.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),a=s.slice(2,u?s.length-7:void 0),m=t[Kt]||null,m=m!=null?m[s]:null,typeof m=="function"&&t.removeEventListener(a,m,u),typeof o=="function")){typeof m!="function"&&m!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(a,o,u);break e}s in t?t[s]=o:o===!0?t.setAttribute(s,""):Co(t,s,o)}}}function Lt(t,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Re("error",t),Re("load",t);var o=!1,u=!1,m;for(m in s)if(s.hasOwnProperty(m)){var y=s[m];if(y!=null)switch(m){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Xe(t,a,m,y,s,null)}}u&&Xe(t,a,"srcSet",s.srcSet,s,null),o&&Xe(t,a,"src",s.src,s,null);return;case"input":Re("invalid",t);var w=m=y=u=null,C=null,q=null;for(o in s)if(s.hasOwnProperty(o)){var P=s[o];if(P!=null)switch(o){case"name":u=P;break;case"type":y=P;break;case"checked":C=P;break;case"defaultChecked":q=P;break;case"value":m=P;break;case"defaultValue":w=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(r(137,a));break;default:Xe(t,a,o,P,s,null)}}tm(t,m,w,C,q,y,u,!1);return;case"select":Re("invalid",t),o=y=m=null;for(u in s)if(s.hasOwnProperty(u)&&(w=s[u],w!=null))switch(u){case"value":m=w;break;case"defaultValue":y=w;break;case"multiple":o=w;default:Xe(t,a,u,w,s,null)}a=m,s=y,t.multiple=!!o,a!=null?Zi(t,!!o,a,!1):s!=null&&Zi(t,!!o,s,!0);return;case"textarea":Re("invalid",t),m=u=o=null;for(y in s)if(s.hasOwnProperty(y)&&(w=s[y],w!=null))switch(y){case"value":o=w;break;case"defaultValue":u=w;break;case"children":m=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(91));break;default:Xe(t,a,y,w,s,null)}am(t,o,u,m);return;case"option":for(C in s)s.hasOwnProperty(C)&&(o=s[C],o!=null)&&(C==="selected"?t.selected=o&&typeof o!="function"&&typeof o!="symbol":Xe(t,a,C,o,s,null));return;case"dialog":Re("beforetoggle",t),Re("toggle",t),Re("cancel",t),Re("close",t);break;case"iframe":case"object":Re("load",t);break;case"video":case"audio":for(o=0;o<Vr.length;o++)Re(Vr[o],t);break;case"image":Re("error",t),Re("load",t);break;case"details":Re("toggle",t);break;case"embed":case"source":case"link":Re("error",t),Re("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(q in s)if(s.hasOwnProperty(q)&&(o=s[q],o!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Xe(t,a,q,o,s,null)}return;default:if(Zc(a)){for(P in s)s.hasOwnProperty(P)&&(o=s[P],o!==void 0&&Rd(t,a,P,o,s,void 0));return}}for(w in s)s.hasOwnProperty(w)&&(o=s[w],o!=null&&Xe(t,a,w,o,s,null))}function Qx(t,a,s,o){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,m=null,y=null,w=null,C=null,q=null,P=null;for(I in s){var Y=s[I];if(s.hasOwnProperty(I)&&Y!=null)switch(I){case"checked":break;case"value":break;case"defaultValue":C=Y;default:o.hasOwnProperty(I)||Xe(t,a,I,null,o,Y)}}for(var $ in o){var I=o[$];if(Y=s[$],o.hasOwnProperty($)&&(I!=null||Y!=null))switch($){case"type":m=I;break;case"name":u=I;break;case"checked":q=I;break;case"defaultChecked":P=I;break;case"value":y=I;break;case"defaultValue":w=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(r(137,a));break;default:I!==Y&&Xe(t,a,$,I,o,Y)}}Qc(t,y,w,C,q,P,m,u);return;case"select":I=y=w=$=null;for(m in s)if(C=s[m],s.hasOwnProperty(m)&&C!=null)switch(m){case"value":break;case"multiple":I=C;default:o.hasOwnProperty(m)||Xe(t,a,m,null,o,C)}for(u in o)if(m=o[u],C=s[u],o.hasOwnProperty(u)&&(m!=null||C!=null))switch(u){case"value":$=m;break;case"defaultValue":w=m;break;case"multiple":y=m;default:m!==C&&Xe(t,a,u,m,o,C)}a=w,s=y,o=I,$!=null?Zi(t,!!s,$,!1):!!o!=!!s&&(a!=null?Zi(t,!!s,a,!0):Zi(t,!!s,s?[]:"",!1));return;case"textarea":I=$=null;for(w in s)if(u=s[w],s.hasOwnProperty(w)&&u!=null&&!o.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Xe(t,a,w,null,o,u)}for(y in o)if(u=o[y],m=s[y],o.hasOwnProperty(y)&&(u!=null||m!=null))switch(y){case"value":$=u;break;case"defaultValue":I=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(r(91));break;default:u!==m&&Xe(t,a,y,u,o,m)}nm(t,$,I);return;case"option":for(var pe in s)$=s[pe],s.hasOwnProperty(pe)&&$!=null&&!o.hasOwnProperty(pe)&&(pe==="selected"?t.selected=!1:Xe(t,a,pe,null,o,$));for(C in o)$=o[C],I=s[C],o.hasOwnProperty(C)&&$!==I&&($!=null||I!=null)&&(C==="selected"?t.selected=$&&typeof $!="function"&&typeof $!="symbol":Xe(t,a,C,$,o,I));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 we in s)$=s[we],s.hasOwnProperty(we)&&$!=null&&!o.hasOwnProperty(we)&&Xe(t,a,we,null,o,$);for(q in o)if($=o[q],I=s[q],o.hasOwnProperty(q)&&$!==I&&($!=null||I!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(r(137,a));break;default:Xe(t,a,q,$,o,I)}return;default:if(Zc(a)){for(var Je in s)$=s[Je],s.hasOwnProperty(Je)&&$!==void 0&&!o.hasOwnProperty(Je)&&Rd(t,a,Je,void 0,o,$);for(P in o)$=o[P],I=s[P],!o.hasOwnProperty(P)||$===I||$===void 0&&I===void 0||Rd(t,a,P,$,o,I);return}}for(var D in s)$=s[D],s.hasOwnProperty(D)&&$!=null&&!o.hasOwnProperty(D)&&Xe(t,a,D,null,o,$);for(Y in o)$=o[Y],I=s[Y],!o.hasOwnProperty(Y)||$===I||$==null&&I==null||Xe(t,a,Y,$,o,I)}function ry(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Kx(){if(typeof performance.getEntriesByType=="function"){for(var t=0,a=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var u=s[o],m=u.transferSize,y=u.initiatorType,w=u.duration;if(m&&w&&ry(y)){for(y=0,w=u.responseEnd,o+=1;o<s.length;o++){var C=s[o],q=C.startTime;if(q>w)break;var P=C.transferSize,Y=C.initiatorType;P&&ry(Y)&&(C=C.responseEnd,y+=P*(C<w?1:(w-q)/(C-q)))}if(--o,a+=8*(m+y)/(u.duration/1e3),t++,10<t)break}}if(0<t)return a/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Md=null,Bd=null;function Al(t){return t.nodeType===9?t:t.ownerDocument}function oy(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ly(t,a){if(t===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&a==="foreignObject"?0:t}function Ld(t,a){return t==="textarea"||t==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var qd=null;function Zx(){var t=window.event;return t&&t.type==="popstate"?t===qd?!1:(qd=t,!0):(qd=null,!1)}var cy=typeof setTimeout=="function"?setTimeout:void 0,Yx=typeof clearTimeout=="function"?clearTimeout:void 0,uy=typeof Promise=="function"?Promise:void 0,Xx=typeof queueMicrotask=="function"?queueMicrotask:typeof uy<"u"?function(t){return uy.resolve(null).then(t).catch(Jx)}:cy;function Jx(t){setTimeout(function(){throw t})}function qa(t){return t==="head"}function dy(t,a){var s=a,o=0;do{var u=s.nextSibling;if(t.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(o===0){t.removeChild(u),As(a);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")Gr(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,Gr(s);for(var m=s.firstChild;m;){var y=m.nextSibling,w=m.nodeName;m[lr]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&m.rel.toLowerCase()==="stylesheet"||s.removeChild(m),m=y}}else s==="body"&&Gr(t.ownerDocument.body);s=u}while(s);As(a)}function fy(t,a){var s=t;t=0;do{var o=s.nextSibling;if(s.nodeType===1?a?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(a?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=o}while(s)}function Ud(t){var a=t.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var s=a;switch(a=a.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Ud(s),Gc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function Fx(t,a,s,o){for(;t.nodeType===1;){var u=s;if(t.nodeName.toLowerCase()!==a.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[lr])switch(a){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(m=t.getAttribute("rel"),m==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(m!==u.rel||t.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||t.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||t.getAttribute("title")!==(u.title==null?null:u.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(m=t.getAttribute("src"),(m!==(u.src==null?null:u.src)||t.getAttribute("type")!==(u.type==null?null:u.type)||t.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&m&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(a==="input"&&t.type==="hidden"){var m=u.name==null?null:""+u.name;if(u.type==="hidden"&&t.getAttribute("name")===m)return t}else return t;if(t=Sn(t.nextSibling),t===null)break}return null}function Wx(t,a,s){if(a==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=Sn(t.nextSibling),t===null))return null;return t}function py(t,a){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Sn(t.nextSibling),t===null))return null;return t}function $d(t){return t.data==="$?"||t.data==="$~"}function Id(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function ew(t,a){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=a;else if(t.data!=="$?"||s.readyState!=="loading")a();else{var o=function(){a(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function Sn(t){for(;t!=null;t=t.nextSibling){var a=t.nodeType;if(a===1||a===3)break;if(a===8){if(a=t.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return t}var Vd=null;function my(t){t=t.nextSibling;for(var a=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(a===0)return Sn(t.nextSibling);a--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||a++}t=t.nextSibling}return null}function hy(t){t=t.previousSibling;for(var a=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(a===0)return t;a--}else s!=="/$"&&s!=="/&"||a++}t=t.previousSibling}return null}function gy(t,a,s){switch(a=Al(s),t){case"html":if(t=a.documentElement,!t)throw Error(r(452));return t;case"head":if(t=a.head,!t)throw Error(r(453));return t;case"body":if(t=a.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function Gr(t){for(var a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Gc(t)}var xn=new Map,yy=new Set;function _l(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var pa=J.d;J.d={f:tw,r:nw,D:aw,C:iw,L:sw,m:rw,X:lw,S:ow,M:cw};function tw(){var t=pa.f(),a=bl();return t||a}function nw(t){var a=Hi(t);a!==null&&a.tag===5&&a.type==="form"?Rh(a):pa.r(t)}var js=typeof document>"u"?null:document;function by(t,a,s){var o=js;if(o&&typeof a=="string"&&a){var u=pn(a);u='link[rel="'+t+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),yy.has(u)||(yy.add(u),t={rel:t,crossOrigin:s,href:a},o.querySelector(u)===null&&(a=o.createElement("link"),Lt(a,"link",t),zt(a),o.head.appendChild(a)))}}function aw(t){pa.D(t),by("dns-prefetch",t,null)}function iw(t,a){pa.C(t,a),by("preconnect",t,a)}function sw(t,a,s){pa.L(t,a,s);var o=js;if(o&&t&&a){var u='link[rel="preload"][as="'+pn(a)+'"]';a==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+pn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+pn(s.imageSizes)+'"]')):u+='[href="'+pn(t)+'"]';var m=u;switch(a){case"style":m=Ns(t);break;case"script":m=ks(t)}xn.has(m)||(t=x({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:t,as:a},s),xn.set(m,t),o.querySelector(u)!==null||a==="style"&&o.querySelector(Hr(m))||a==="script"&&o.querySelector(Qr(m))||(a=o.createElement("link"),Lt(a,"link",t),zt(a),o.head.appendChild(a)))}}function rw(t,a){pa.m(t,a);var s=js;if(s&&t){var o=a&&typeof a.as=="string"?a.as:"script",u='link[rel="modulepreload"][as="'+pn(o)+'"][href="'+pn(t)+'"]',m=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=ks(t)}if(!xn.has(m)&&(t=x({rel:"modulepreload",href:t},a),xn.set(m,t),s.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Qr(m)))return}o=s.createElement("link"),Lt(o,"link",t),zt(o),s.head.appendChild(o)}}}function ow(t,a,s){pa.S(t,a,s);var o=js;if(o&&t){var u=Qi(o).hoistableStyles,m=Ns(t);a=a||"default";var y=u.get(m);if(!y){var w={loading:0,preload:null};if(y=o.querySelector(Hr(m)))w.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":a},s),(s=xn.get(m))&&Pd(t,s);var C=y=o.createElement("link");zt(C),Lt(C,"link",t),C._p=new Promise(function(q,P){C.onload=q,C.onerror=P}),C.addEventListener("load",function(){w.loading|=1}),C.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Cl(y,a,o)}y={type:"stylesheet",instance:y,count:1,state:w},u.set(m,y)}}}function lw(t,a){pa.X(t,a);var s=js;if(s&&t){var o=Qi(s).hoistableScripts,u=ks(t),m=o.get(u);m||(m=s.querySelector(Qr(u)),m||(t=x({src:t,async:!0},a),(a=xn.get(u))&&Gd(t,a),m=s.createElement("script"),zt(m),Lt(m,"link",t),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},o.set(u,m))}}function cw(t,a){pa.M(t,a);var s=js;if(s&&t){var o=Qi(s).hoistableScripts,u=ks(t),m=o.get(u);m||(m=s.querySelector(Qr(u)),m||(t=x({src:t,async:!0,type:"module"},a),(a=xn.get(u))&&Gd(t,a),m=s.createElement("script"),zt(m),Lt(m,"link",t),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},o.set(u,m))}}function vy(t,a,s,o){var u=(u=ae.current)?_l(u):null;if(!u)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=Ns(s.href),s=Qi(u).hoistableStyles,o=s.get(a),o||(o={type:"style",instance:null,count:0,state:null},s.set(a,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Ns(s.href);var m=Qi(u).hoistableStyles,y=m.get(t);if(y||(u=u.ownerDocument||u,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,y),(m=u.querySelector(Hr(t)))&&!m._p&&(y.instance=m,y.state.loading=5),xn.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},xn.set(t,s),m||uw(u,t,s,y.state))),a&&o===null)throw Error(r(528,""));return y}if(a&&o!==null)throw Error(r(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=ks(s),s=Qi(u).hoistableScripts,o=s.get(a),o||(o={type:"script",instance:null,count:0,state:null},s.set(a,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function Ns(t){return'href="'+pn(t)+'"'}function Hr(t){return'link[rel="stylesheet"]['+t+"]"}function Sy(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function uw(t,a,s,o){t.querySelector('link[rel="preload"][as="style"]['+a+"]")?o.loading=1:(a=t.createElement("link"),o.preload=a,a.addEventListener("load",function(){return o.loading|=1}),a.addEventListener("error",function(){return o.loading|=2}),Lt(a,"link",s),zt(a),t.head.appendChild(a))}function ks(t){return'[src="'+pn(t)+'"]'}function Qr(t){return"script[async]"+t}function xy(t,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var o=t.querySelector('style[data-href~="'+pn(s.href)+'"]');if(o)return a.instance=o,zt(o),o;var u=x({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),zt(o),Lt(o,"style",u),Cl(o,s.precedence,t),a.instance=o;case"stylesheet":u=Ns(s.href);var m=t.querySelector(Hr(u));if(m)return a.state.loading|=4,a.instance=m,zt(m),m;o=Sy(s),(u=xn.get(u))&&Pd(o,u),m=(t.ownerDocument||t).createElement("link"),zt(m);var y=m;return y._p=new Promise(function(w,C){y.onload=w,y.onerror=C}),Lt(m,"link",o),a.state.loading|=4,Cl(m,s.precedence,t),a.instance=m;case"script":return m=ks(s.src),(u=t.querySelector(Qr(m)))?(a.instance=u,zt(u),u):(o=s,(u=xn.get(m))&&(o=x({},s),Gd(o,u)),t=t.ownerDocument||t,u=t.createElement("script"),zt(u),Lt(u,"link",o),t.head.appendChild(u),a.instance=u);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(o=a.instance,a.state.loading|=4,Cl(o,s.precedence,t));return a.instance}function Cl(t,a,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,m=u,y=0;y<o.length;y++){var w=o[y];if(w.dataset.precedence===a)m=w;else if(m!==u)break}m?m.parentNode.insertBefore(t,m.nextSibling):(a=s.nodeType===9?s.head:s,a.insertBefore(t,a.firstChild))}function Pd(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.title==null&&(t.title=a.title)}function Gd(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.integrity==null&&(t.integrity=a.integrity)}var zl=null;function wy(t,a,s){if(zl===null){var o=new Map,u=zl=new Map;u.set(s,o)}else u=zl,o=u.get(s),o||(o=new Map,u.set(s,o));if(o.has(t))return o;for(o.set(t,null),s=s.getElementsByTagName(t),u=0;u<s.length;u++){var m=s[u];if(!(m[lr]||m[Dt]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var y=m.getAttribute(a)||"";y=t+y;var w=o.get(y);w?w.push(m):o.set(y,[m])}}return o}function jy(t,a,s){t=t.ownerDocument||t,t.head.insertBefore(s,a==="title"?t.querySelector("head > title"):null)}function dw(t,a,s){if(s===1||a.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(t=a.disabled,typeof a.precedence=="string"&&t==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function Ny(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function fw(t,a,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=Ns(o.href),m=a.querySelector(Hr(u));if(m){a=m._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=Tl.bind(t),a.then(t,t)),s.state.loading|=4,s.instance=m,zt(m);return}m=a.ownerDocument||a,o=Sy(o),(u=xn.get(u))&&Pd(o,u),m=m.createElement("link"),zt(m);var y=m;y._p=new Promise(function(w,C){y.onload=w,y.onerror=C}),Lt(m,"link",o),s.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=Tl.bind(t),a.addEventListener("load",s),a.addEventListener("error",s))}}var Hd=0;function pw(t,a){return t.stylesheets&&t.count===0&&Ol(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var o=setTimeout(function(){if(t.stylesheets&&Ol(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+a);0<t.imgBytes&&Hd===0&&(Hd=62500*Kx());var u=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ol(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>Hd?50:800)+a);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function Tl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ol(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var El=null;function Ol(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,El=new Map,a.forEach(mw,t),El=null,Tl.call(t))}function mw(t,a){if(!(a.state.loading&4)){var s=El.get(t);if(s)var o=s.get(null);else{s=new Map,El.set(t,s);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<u.length;m++){var y=u[m];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(s.set(y.dataset.precedence,y),o=y)}o&&s.set(null,o)}u=a.instance,y=u.getAttribute("data-precedence"),m=s.get(y)||o,m===o&&s.set(null,u),s.set(y,u),this.count++,o=Tl.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),m?m.parentNode.insertBefore(u,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(u,t.firstChild)),a.state.loading|=4}}var Kr={$$typeof:G,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function hw(t,a,s,o,u,m,y,w,C){this.tag=1,this.containerInfo=t,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=ne(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ne(0),this.hiddenUpdates=ne(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=m,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function ky(t,a,s,o,u,m,y,w,C,q,P,Y){return t=new hw(t,a,s,y,C,q,P,Y,w),a=1,m===!0&&(a|=24),m=sn(3,null,null,a),t.current=m,m.stateNode=t,a=Nu(),a.refCount++,t.pooledCache=a,a.refCount++,m.memoizedState={element:o,isDehydrated:s,cache:a},Cu(m),t}function Ay(t){return t?(t=ns,t):ns}function _y(t,a,s,o,u,m){u=Ay(u),o.context===null?o.context=u:o.pendingContext=u,o=_a(a),o.payload={element:s},m=m===void 0?null:m,m!==null&&(o.callback=m),s=Ca(t,o,a),s!==null&&(Wt(s,t,a),kr(s,t,a))}function Cy(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<a?s:a}}function Qd(t,a){Cy(t,a),(t=t.alternate)&&Cy(t,a)}function zy(t){if(t.tag===13||t.tag===31){var a=li(t,67108864);a!==null&&Wt(a,t,67108864),Qd(t,67108864)}}function Ty(t){if(t.tag===13||t.tag===31){var a=un();a=or(a);var s=li(t,a);s!==null&&Wt(s,t,a),Qd(t,a)}}var Dl=!0;function gw(t,a,s,o){var u=B.T;B.T=null;var m=J.p;try{J.p=2,Kd(t,a,s,o)}finally{J.p=m,B.T=u}}function yw(t,a,s,o){var u=B.T;B.T=null;var m=J.p;try{J.p=8,Kd(t,a,s,o)}finally{J.p=m,B.T=u}}function Kd(t,a,s,o){if(Dl){var u=Zd(o);if(u===null)Dd(t,a,o,Rl,s),Oy(t,o);else if(vw(u,t,a,s,o))o.stopPropagation();else if(Oy(t,o),a&4&&-1<bw.indexOf(t)){for(;u!==null;){var m=Hi(u);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var y=Zn(m.pendingLanes);if(y!==0){var w=m;for(w.pendingLanes|=2,w.entangledLanes|=2;y;){var C=1<<31-ht(y);w.entanglements[1]|=C,y&=~C}Gn(m),(Ve&6)===0&&(gl=Ut()+500,Ir(0))}}break;case 31:case 13:w=li(m,2),w!==null&&Wt(w,m,2),bl(),Qd(m,2)}if(m=Zd(o),m===null&&Dd(t,a,o,Rl,s),m===u)break;u=m}u!==null&&o.stopPropagation()}else Dd(t,a,o,null,s)}}function Zd(t){return t=Xc(t),Yd(t)}var Rl=null;function Yd(t){if(Rl=null,t=Gi(t),t!==null){var a=c(t);if(a===null)t=null;else{var s=a.tag;if(s===13){if(t=d(a),t!==null)return t;t=null}else if(s===31){if(t=h(a),t!==null)return t;t=null}else if(s===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;t=null}else a!==t&&(t=null)}}return Rl=t,null}function Ey(t){switch(t){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(wo()){case ir:return 2;case jo:return 8;case Li:case Ic:return 32;case qi:return 268435456;default:return 32}default:return 32}}var Xd=!1,Ua=null,$a=null,Ia=null,Zr=new Map,Yr=new Map,Va=[],bw="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 Oy(t,a){switch(t){case"focusin":case"focusout":Ua=null;break;case"dragenter":case"dragleave":$a=null;break;case"mouseover":case"mouseout":Ia=null;break;case"pointerover":case"pointerout":Zr.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yr.delete(a.pointerId)}}function Xr(t,a,s,o,u,m){return t===null||t.nativeEvent!==m?(t={blockedOn:a,domEventName:s,eventSystemFlags:o,nativeEvent:m,targetContainers:[u]},a!==null&&(a=Hi(a),a!==null&&zy(a)),t):(t.eventSystemFlags|=o,a=t.targetContainers,u!==null&&a.indexOf(u)===-1&&a.push(u),t)}function vw(t,a,s,o,u){switch(a){case"focusin":return Ua=Xr(Ua,t,a,s,o,u),!0;case"dragenter":return $a=Xr($a,t,a,s,o,u),!0;case"mouseover":return Ia=Xr(Ia,t,a,s,o,u),!0;case"pointerover":var m=u.pointerId;return Zr.set(m,Xr(Zr.get(m)||null,t,a,s,o,u)),!0;case"gotpointercapture":return m=u.pointerId,Yr.set(m,Xr(Yr.get(m)||null,t,a,s,o,u)),!0}return!1}function Dy(t){var a=Gi(t.target);if(a!==null){var s=c(a);if(s!==null){if(a=s.tag,a===13){if(a=d(s),a!==null){t.blockedOn=a,Kp(t.priority,function(){Ty(s)});return}}else if(a===31){if(a=h(s),a!==null){t.blockedOn=a,Kp(t.priority,function(){Ty(s)});return}}else if(a===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Ml(t){if(t.blockedOn!==null)return!1;for(var a=t.targetContainers;0<a.length;){var s=Zd(t.nativeEvent);if(s===null){s=t.nativeEvent;var o=new s.constructor(s.type,s);Yc=o,s.target.dispatchEvent(o),Yc=null}else return a=Hi(s),a!==null&&zy(a),t.blockedOn=s,!1;a.shift()}return!0}function Ry(t,a,s){Ml(t)&&s.delete(a)}function Sw(){Xd=!1,Ua!==null&&Ml(Ua)&&(Ua=null),$a!==null&&Ml($a)&&($a=null),Ia!==null&&Ml(Ia)&&(Ia=null),Zr.forEach(Ry),Yr.forEach(Ry)}function Bl(t,a){t.blockedOn===a&&(t.blockedOn=null,Xd||(Xd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Sw)))}var Ll=null;function My(t){Ll!==t&&(Ll=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ll===t&&(Ll=null);for(var a=0;a<t.length;a+=3){var s=t[a],o=t[a+1],u=t[a+2];if(typeof o!="function"){if(Yd(o||s)===null)continue;break}var m=Hi(s);m!==null&&(t.splice(a,3),a-=3,Zu(m,{pending:!0,data:u,method:s.method,action:o},o,u))}}))}function As(t){function a(C){return Bl(C,t)}Ua!==null&&Bl(Ua,t),$a!==null&&Bl($a,t),Ia!==null&&Bl(Ia,t),Zr.forEach(a),Yr.forEach(a);for(var s=0;s<Va.length;s++){var o=Va[s];o.blockedOn===t&&(o.blockedOn=null)}for(;0<Va.length&&(s=Va[0],s.blockedOn===null);)Dy(s),s.blockedOn===null&&Va.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var u=s[o],m=s[o+1],y=u[Kt]||null;if(typeof m=="function")y||My(s);else if(y){var w=null;if(m&&m.hasAttribute("formAction")){if(u=m,y=m[Kt]||null)w=y.formAction;else if(Yd(u)!==null)continue}else w=y.action;typeof w=="function"?s[o+1]=w:(s.splice(o,3),o-=3),My(s)}}}function By(){function t(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(y){return u=y})},focusReset:"manual",scroll:"manual"})}function a(){u!==null&&(u(),u=null),o||setTimeout(s,20)}function s(){if(!o&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),u!==null&&(u(),u=null)}}}function Jd(t){this._internalRoot=t}ql.prototype.render=Jd.prototype.render=function(t){var a=this._internalRoot;if(a===null)throw Error(r(409));var s=a.current,o=un();_y(s,o,t,a,null,null)},ql.prototype.unmount=Jd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var a=t.containerInfo;_y(t.current,2,null,t,null,null),bl(),a[Pi]=null}};function ql(t){this._internalRoot=t}ql.prototype.unstable_scheduleHydration=function(t){if(t){var a=Qp();t={blockedOn:null,target:t,priority:a};for(var s=0;s<Va.length&&a!==0&&a<Va[s].priority;s++);Va.splice(s,0,t),s===0&&Dy(t)}};var Ly=n.version;if(Ly!=="19.2.4")throw Error(r(527,Ly,"19.2.4"));J.findDOMNode=function(t){var a=t._reactInternals;if(a===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=b(a),t=t!==null?S(t):null,t=t===null?null:t.stateNode,t};var xw={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ul=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ul.isDisabled&&Ul.supportsFiber)try{va=Ul.inject(xw),$t=Ul}catch{}}return Jr.createRoot=function(t,a){if(!l(t))throw Error(r(299));var s=!1,o="",u=Gh,m=Hh,y=Qh;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(o=a.identifierPrefix),a.onUncaughtError!==void 0&&(u=a.onUncaughtError),a.onCaughtError!==void 0&&(m=a.onCaughtError),a.onRecoverableError!==void 0&&(y=a.onRecoverableError)),a=ky(t,1,!1,null,null,s,o,null,u,m,y,By),t[Pi]=a.current,Od(t),new Jd(a)},Jr.hydrateRoot=function(t,a,s){if(!l(t))throw Error(r(299));var o=!1,u="",m=Gh,y=Hh,w=Qh,C=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(m=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(w=s.onRecoverableError),s.formState!==void 0&&(C=s.formState)),a=ky(t,1,!0,a,s??null,o,u,C,m,y,w,By),a.context=Ay(null),s=a.current,o=un(),o=or(o),u=_a(o),u.callback=null,Ca(s,u,o),s=o,a.current.lanes=s,Fe(a,s),Gn(a),t[Pi]=a.current,Od(t),new ql(a)},Jr.version="19.2.4",Jr}var Iy;function $w(){if(Iy)return Fd.exports;Iy=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(n){console.error(n)}}return e(),Fd.exports=Uw(),Fd.exports}var Iw=$w();const Vw={bodySerializer:e=>JSON.stringify(e,(n,i)=>typeof i=="bigint"?i.toString():i)},Pw=({onRequest:e,onSseError:n,onSseEvent:i,responseTransformer:r,responseValidator:l,sseDefaultRetryDelay:c,sseMaxRetryAttempts:d,sseMaxRetryDelay:h,sseSleepFn:g,url:b,...S})=>{let x;const N=g??(k=>new Promise(E=>setTimeout(E,k)));return{stream:async function*(){let k=c??3e3,E=0;const R=S.signal??new AbortController().signal;for(;!R.aborted;){E++;const V=S.headers instanceof Headers?S.headers:new Headers(S.headers);x!==void 0&&V.set("Last-Event-ID",x);try{const G={redirect:"follow",...S,body:S.serializedBody,headers:V,signal:R};let Z=new Request(b,G);e&&(Z=await e(b,G));const F=await(S.fetch??globalThis.fetch)(Z);if(!F.ok)throw new Error(`SSE failed: ${F.status} ${F.statusText}`);if(!F.body)throw new Error("No body in SSE response");const O=F.body.pipeThrough(new TextDecoderStream).getReader();let M="";const le=()=>{try{O.cancel()}catch{}};R.addEventListener("abort",le);try{for(;;){const{done:ke,value:_e}=await O.read();if(ke)break;M+=_e;const be=M.split(`
9
+ `+o.stack}}var Ri=Object.prototype.hasOwnProperty,Mi=e.unstable_scheduleCallback,Bi=e.unstable_cancelCallback,xo=e.unstable_shouldYield,$c=e.unstable_requestPaint,Ut=e.unstable_now,wo=e.unstable_getCurrentPriorityLevel,ir=e.unstable_ImmediatePriority,jo=e.unstable_UserBlockingPriority,Li=e.unstable_NormalPriority,Ic=e.unstable_LowPriority,qi=e.unstable_IdlePriority,No=e.log,sr=e.unstable_setDisableYieldValue,va=null,$t=null;function Tn(t){if(typeof No=="function"&&sr(t),$t&&typeof $t.setStrictMode=="function")try{$t.setStrictMode(va,t)}catch{}}var ht=Math.clz32?Math.clz32:Vc,$n=Math.log,ti=Math.LN2;function Vc(t){return t>>>=0,t===0?32:31-($n(t)/ti|0)|0}var Ui=256,$i=262144,Ii=4194304;function Zn(t){var a=t&42;if(a!==0)return a;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Vi(t,a,s){var o=t.pendingLanes;if(o===0)return 0;var u=0,m=t.suspendedLanes,y=t.pingedLanes;t=t.warmLanes;var j=o&134217727;return j!==0?(o=j&~m,o!==0?u=Zn(o):(y&=j,y!==0?u=Zn(y):s||(s=j&~t,s!==0&&(u=Zn(s))))):(j=o&~m,j!==0?u=Zn(j):y!==0?u=Zn(y):s||(s=o&~t,s!==0&&(u=Zn(s)))),u===0?0:a!==0&&a!==u&&(a&m)===0&&(m=u&-u,s=a&-a,m>=s||m===32&&(s&4194048)!==0)?a:u}function ni(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function Yn(t,a){switch(t){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 ko(){var t=Ii;return Ii<<=1,(Ii&62914560)===0&&(Ii=4194304),t}function ne(t){for(var a=[],s=0;31>s;s++)a.push(t);return a}function Fe(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ai(t,a,s,o,u,m){var y=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var j=t.entanglements,C=t.expirationTimes,q=t.hiddenUpdates;for(s=y&~s;0<s;){var P=31-ht(s),Y=1<<P;j[P]=0,C[P]=-1;var $=q[P];if($!==null)for(q[P]=null,P=0;P<$.length;P++){var I=$[P];I!==null&&(I.lane&=-536870913)}s&=~Y}o!==0&&Ao(t,o,0),m!==0&&u===0&&t.tag!==0&&(t.suspendedLanes|=m&~(y&~a))}function Ao(t,a,s){t.pendingLanes|=a,t.suspendedLanes&=~a;var o=31-ht(a);t.entangledLanes|=a,t.entanglements[o]=t.entanglements[o]|1073741824|s&261930}function _o(t,a){var s=t.entangledLanes|=a;for(t=t.entanglements;s;){var o=31-ht(s),u=1<<o;u&a|t[o]&a&&(t[o]|=a),s&=~u}}function rr(t,a){var s=a&-a;return s=(s&42)!==0?1:or(s),(s&(t.suspendedLanes|a))!==0?0:s}function or(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function En(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Kp(){var t=J.p;return t!==0?t:(t=window.event,t===void 0?32:Oy(t.type))}function Zp(t,a){var s=J.p;try{return J.p=t,a()}finally{J.p=s}}var Sa=Math.random().toString(36).slice(2),Dt="__reactFiber$"+Sa,Kt="__reactProps$"+Sa,Pi="__reactContainer$"+Sa,Pc="__reactEvents$"+Sa,f1="__reactListeners$"+Sa,p1="__reactHandles$"+Sa,Yp="__reactResources$"+Sa,lr="__reactMarker$"+Sa;function Gc(t){delete t[Dt],delete t[Kt],delete t[Pc],delete t[f1],delete t[p1]}function Gi(t){var a=t[Dt];if(a)return a;for(var s=t.parentNode;s;){if(a=s[Pi]||s[Dt]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(t=gy(t);t!==null;){if(s=t[Dt])return s;t=gy(t)}return a}t=s,s=t.parentNode}return null}function Hi(t){if(t=t[Dt]||t[Pi]){var a=t.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return t}return null}function cr(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t.stateNode;throw Error(r(33))}function Qi(t){var a=t[Yp];return a||(a=t[Yp]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function zt(t){t[lr]=!0}var Xp=new Set,Jp={};function ii(t,a){Ki(t,a),Ki(t+"Capture",a)}function Ki(t,a){for(Jp[t]=a,t=0;t<a.length;t++)Xp.add(a[t])}var m1=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]*$"),Fp={},Wp={};function h1(t){return Ri.call(Wp,t)?!0:Ri.call(Fp,t)?!1:m1.test(t)?Wp[t]=!0:(Fp[t]=!0,!1)}function Co(t,a,s){if(h1(a))if(s===null)t.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(a);return;case"boolean":var o=a.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(a);return}}t.setAttribute(a,""+s)}}function zo(t,a,s){if(s===null)t.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttribute(a,""+s)}}function Xn(t,a,s,o){if(o===null)t.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(a,s,""+o)}}function fn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function em(t){var a=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function g1(t,a,s){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,a);if(!t.hasOwnProperty(a)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,m=o.set;return Object.defineProperty(t,a,{configurable:!0,get:function(){return u.call(this)},set:function(y){s=""+y,m.call(this,y)}}),Object.defineProperty(t,a,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(y){s=""+y},stopTracking:function(){t._valueTracker=null,delete t[a]}}}}function Hc(t){if(!t._valueTracker){var a=em(t)?"checked":"value";t._valueTracker=g1(t,a,""+t[a])}}function tm(t){if(!t)return!1;var a=t._valueTracker;if(!a)return!0;var s=a.getValue(),o="";return t&&(o=em(t)?t.checked?"true":"false":t.value),t=o,t!==s?(a.setValue(t),!0):!1}function To(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var y1=/[\n"\\]/g;function pn(t){return t.replace(y1,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Qc(t,a,s,o,u,m,y,j){t.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?t.type=y:t.removeAttribute("type"),a!=null?y==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+fn(a)):t.value!==""+fn(a)&&(t.value=""+fn(a)):y!=="submit"&&y!=="reset"||t.removeAttribute("value"),a!=null?Kc(t,y,fn(a)):s!=null?Kc(t,y,fn(s)):o!=null&&t.removeAttribute("value"),u==null&&m!=null&&(t.defaultChecked=!!m),u!=null&&(t.checked=u&&typeof u!="function"&&typeof u!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?t.name=""+fn(j):t.removeAttribute("name")}function nm(t,a,s,o,u,m,y,j){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),a!=null||s!=null){if(!(m!=="submit"&&m!=="reset"||a!=null)){Hc(t);return}s=s!=null?""+fn(s):"",a=a!=null?""+fn(a):s,j||a===t.value||(t.value=a),t.defaultValue=a}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=j?t.checked:!!o,t.defaultChecked=!!o,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.name=y),Hc(t)}function Kc(t,a,s){a==="number"&&To(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function Zi(t,a,s,o){if(t=t.options,a){a={};for(var u=0;u<s.length;u++)a["$"+s[u]]=!0;for(s=0;s<t.length;s++)u=a.hasOwnProperty("$"+t[s].value),t[s].selected!==u&&(t[s].selected=u),u&&o&&(t[s].defaultSelected=!0)}else{for(s=""+fn(s),a=null,u=0;u<t.length;u++){if(t[u].value===s){t[u].selected=!0,o&&(t[u].defaultSelected=!0);return}a!==null||t[u].disabled||(a=t[u])}a!==null&&(a.selected=!0)}}function am(t,a,s){if(a!=null&&(a=""+fn(a),a!==t.value&&(t.value=a),s==null)){t.defaultValue!==a&&(t.defaultValue=a);return}t.defaultValue=s!=null?""+fn(s):""}function im(t,a,s,o){if(a==null){if(o!=null){if(s!=null)throw Error(r(92));if(ee(o)){if(1<o.length)throw Error(r(93));o=o[0]}s=o}s==null&&(s=""),a=s}s=fn(a),t.defaultValue=s,o=t.textContent,o===s&&o!==""&&o!==null&&(t.value=o),Hc(t)}function Yi(t,a){if(a){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=a;return}}t.textContent=a}var b1=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 sm(t,a,s){var o=a.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="":o?t.setProperty(a,s):typeof s!="number"||s===0||b1.has(a)?a==="float"?t.cssFloat=s:t[a]=(""+s).trim():t[a]=s+"px"}function rm(t,a,s){if(a!=null&&typeof a!="object")throw Error(r(62));if(t=t.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||a!=null&&a.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var u in a)o=a[u],a.hasOwnProperty(u)&&s[u]!==o&&sm(t,u,o)}else for(var m in a)a.hasOwnProperty(m)&&sm(t,m,a[m])}function Zc(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var v1=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"]]),S1=/^[\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 Eo(t){return S1.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Jn(){}var Yc=null;function Xc(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Xi=null,Ji=null;function om(t){var a=Hi(t);if(a&&(t=a.stateNode)){var s=t[Kt]||null;e:switch(t=a.stateNode,a.type){case"input":if(Qc(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),a=s.name,s.type==="radio"&&a!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+pn(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var o=s[a];if(o!==t&&o.form===t.form){var u=o[Kt]||null;if(!u)throw Error(r(90));Qc(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(a=0;a<s.length;a++)o=s[a],o.form===t.form&&tm(o)}break e;case"textarea":am(t,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&Zi(t,!!s.multiple,a,!1)}}}var Jc=!1;function lm(t,a,s){if(Jc)return t(a,s);Jc=!0;try{var o=t(a);return o}finally{if(Jc=!1,(Xi!==null||Ji!==null)&&(bl(),Xi&&(a=Xi,t=Ji,Ji=Xi=null,om(a),t)))for(a=0;a<t.length;a++)om(t[a])}}function ur(t,a){var s=t.stateNode;if(s===null)return null;var o=s[Kt]||null;if(o===null)return null;s=o[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(r(231,a,typeof s));return s}var Fn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fc=!1;if(Fn)try{var dr={};Object.defineProperty(dr,"passive",{get:function(){Fc=!0}}),window.addEventListener("test",dr,dr),window.removeEventListener("test",dr,dr)}catch{Fc=!1}var xa=null,Wc=null,Oo=null;function cm(){if(Oo)return Oo;var t,a=Wc,s=a.length,o,u="value"in xa?xa.value:xa.textContent,m=u.length;for(t=0;t<s&&a[t]===u[t];t++);var y=s-t;for(o=1;o<=y&&a[s-o]===u[m-o];o++);return Oo=u.slice(t,1<o?1-o:void 0)}function Do(t){var a=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&a===13&&(t=13)):t=a,t===10&&(t=13),32<=t||t===13?t:0}function Ro(){return!0}function um(){return!1}function Zt(t){function a(s,o,u,m,y){this._reactName=s,this._targetInst=u,this.type=o,this.nativeEvent=m,this.target=y,this.currentTarget=null;for(var j in t)t.hasOwnProperty(j)&&(s=t[j],this[j]=s?s(m):m[j]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Ro:um,this.isPropagationStopped=um,this}return x(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Ro)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ro)},persist:function(){},isPersistent:Ro}),a}var si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mo=Zt(si),fr=x({},si,{view:0,detail:0}),x1=Zt(fr),eu,tu,pr,Bo=x({},fr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:au,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==pr&&(pr&&t.type==="mousemove"?(eu=t.screenX-pr.screenX,tu=t.screenY-pr.screenY):tu=eu=0,pr=t),eu)},movementY:function(t){return"movementY"in t?t.movementY:tu}}),dm=Zt(Bo),w1=x({},Bo,{dataTransfer:0}),j1=Zt(w1),N1=x({},fr,{relatedTarget:0}),nu=Zt(N1),k1=x({},si,{animationName:0,elapsedTime:0,pseudoElement:0}),A1=Zt(k1),_1=x({},si,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),C1=Zt(_1),z1=x({},si,{data:0}),fm=Zt(z1),T1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},E1={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"},O1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function D1(t){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(t):(t=O1[t])?!!a[t]:!1}function au(){return D1}var R1=x({},fr,{key:function(t){if(t.key){var a=T1[t.key]||t.key;if(a!=="Unidentified")return a}return t.type==="keypress"?(t=Do(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?E1[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:au,charCode:function(t){return t.type==="keypress"?Do(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Do(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),M1=Zt(R1),B1=x({},Bo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pm=Zt(B1),L1=x({},fr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:au}),q1=Zt(L1),U1=x({},si,{propertyName:0,elapsedTime:0,pseudoElement:0}),$1=Zt(U1),I1=x({},Bo,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),V1=Zt(I1),P1=x({},si,{newState:0,oldState:0}),G1=Zt(P1),H1=[9,13,27,32],iu=Fn&&"CompositionEvent"in window,mr=null;Fn&&"documentMode"in document&&(mr=document.documentMode);var Q1=Fn&&"TextEvent"in window&&!mr,mm=Fn&&(!iu||mr&&8<mr&&11>=mr),hm=" ",gm=!1;function ym(t,a){switch(t){case"keyup":return H1.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Fi=!1;function K1(t,a){switch(t){case"compositionend":return bm(a);case"keypress":return a.which!==32?null:(gm=!0,hm);case"textInput":return t=a.data,t===hm&&gm?null:t;default:return null}}function Z1(t,a){if(Fi)return t==="compositionend"||!iu&&ym(t,a)?(t=cm(),Oo=Wc=xa=null,Fi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return mm&&a.locale!=="ko"?null:a.data;default:return null}}var Y1={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 vm(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a==="input"?!!Y1[t.type]:a==="textarea"}function Sm(t,a,s,o){Xi?Ji?Ji.push(o):Ji=[o]:Xi=o,a=kl(a,"onChange"),0<a.length&&(s=new Mo("onChange","change",null,s,o),t.push({event:s,listeners:a}))}var hr=null,gr=null;function X1(t){ny(t,0)}function Lo(t){var a=cr(t);if(tm(a))return t}function xm(t,a){if(t==="change")return a}var wm=!1;if(Fn){var su;if(Fn){var ru="oninput"in document;if(!ru){var jm=document.createElement("div");jm.setAttribute("oninput","return;"),ru=typeof jm.oninput=="function"}su=ru}else su=!1;wm=su&&(!document.documentMode||9<document.documentMode)}function Nm(){hr&&(hr.detachEvent("onpropertychange",km),gr=hr=null)}function km(t){if(t.propertyName==="value"&&Lo(gr)){var a=[];Sm(a,gr,t,Xc(t)),lm(X1,a)}}function J1(t,a,s){t==="focusin"?(Nm(),hr=a,gr=s,hr.attachEvent("onpropertychange",km)):t==="focusout"&&Nm()}function F1(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Lo(gr)}function W1(t,a){if(t==="click")return Lo(a)}function ex(t,a){if(t==="input"||t==="change")return Lo(a)}function tx(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}var an=typeof Object.is=="function"?Object.is:tx;function yr(t,a){if(an(t,a))return!0;if(typeof t!="object"||t===null||typeof a!="object"||a===null)return!1;var s=Object.keys(t),o=Object.keys(a);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var u=s[o];if(!Ri.call(a,u)||!an(t[u],a[u]))return!1}return!0}function Am(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function _m(t,a){var s=Am(t);t=0;for(var o;s;){if(s.nodeType===3){if(o=t+s.textContent.length,t<=a&&o>=a)return{node:s,offset:a-t};t=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Am(s)}}function Cm(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?Cm(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function zm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=To(t.document);a instanceof t.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)t=a.contentWindow;else break;a=To(t.document)}return a}function ou(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a&&(a==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||a==="textarea"||t.contentEditable==="true")}var nx=Fn&&"documentMode"in document&&11>=document.documentMode,Wi=null,lu=null,br=null,cu=!1;function Tm(t,a,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;cu||Wi==null||Wi!==To(o)||(o=Wi,"selectionStart"in o&&ou(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),br&&yr(br,o)||(br=o,o=kl(lu,"onSelect"),0<o.length&&(a=new Mo("onSelect","select",null,a,s),t.push({event:a,listeners:o}),a.target=Wi)))}function ri(t,a){var s={};return s[t.toLowerCase()]=a.toLowerCase(),s["Webkit"+t]="webkit"+a,s["Moz"+t]="moz"+a,s}var es={animationend:ri("Animation","AnimationEnd"),animationiteration:ri("Animation","AnimationIteration"),animationstart:ri("Animation","AnimationStart"),transitionrun:ri("Transition","TransitionRun"),transitionstart:ri("Transition","TransitionStart"),transitioncancel:ri("Transition","TransitionCancel"),transitionend:ri("Transition","TransitionEnd")},uu={},Em={};Fn&&(Em=document.createElement("div").style,"AnimationEvent"in window||(delete es.animationend.animation,delete es.animationiteration.animation,delete es.animationstart.animation),"TransitionEvent"in window||delete es.transitionend.transition);function oi(t){if(uu[t])return uu[t];if(!es[t])return t;var a=es[t],s;for(s in a)if(a.hasOwnProperty(s)&&s in Em)return uu[t]=a[s];return t}var Om=oi("animationend"),Dm=oi("animationiteration"),Rm=oi("animationstart"),ax=oi("transitionrun"),ix=oi("transitionstart"),sx=oi("transitioncancel"),Mm=oi("transitionend"),Bm=new Map,du="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(" ");du.push("scrollEnd");function On(t,a){Bm.set(t,a),ii(a,[t])}var qo=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},mn=[],ts=0,fu=0;function Uo(){for(var t=ts,a=fu=ts=0;a<t;){var s=mn[a];mn[a++]=null;var o=mn[a];mn[a++]=null;var u=mn[a];mn[a++]=null;var m=mn[a];if(mn[a++]=null,o!==null&&u!==null){var y=o.pending;y===null?u.next=u:(u.next=y.next,y.next=u),o.pending=u}m!==0&&Lm(s,u,m)}}function $o(t,a,s,o){mn[ts++]=t,mn[ts++]=a,mn[ts++]=s,mn[ts++]=o,fu|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function pu(t,a,s,o){return $o(t,a,s,o),Io(t)}function li(t,a){return $o(t,null,null,a),Io(t)}function Lm(t,a,s){t.lanes|=s;var o=t.alternate;o!==null&&(o.lanes|=s);for(var u=!1,m=t.return;m!==null;)m.childLanes|=s,o=m.alternate,o!==null&&(o.childLanes|=s),m.tag===22&&(t=m.stateNode,t===null||t._visibility&1||(u=!0)),t=m,m=m.return;return t.tag===3?(m=t.stateNode,u&&a!==null&&(u=31-ht(s),t=m.hiddenUpdates,o=t[u],o===null?t[u]=[a]:o.push(a),a.lane=s|536870912),m):null}function Io(t){if(50<$r)throw $r=0,wd=null,Error(r(185));for(var a=t.return;a!==null;)t=a,a=t.return;return t.tag===3?t.stateNode:null}var ns={};function rx(t,a,s,o){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sn(t,a,s,o){return new rx(t,a,s,o)}function mu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Wn(t,a){var s=t.alternate;return s===null?(s=sn(t.tag,a,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=a,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,a=t.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function qm(t,a){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=a,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,a=s.dependencies,t.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),t}function Vo(t,a,s,o,u,m){var y=0;if(o=t,typeof t=="function")mu(t)&&(y=1);else if(typeof t=="string")y=dw(t,s,te.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case le:return t=sn(31,s,a,u),t.elementType=le,t.lanes=m,t;case k:return ci(s.children,u,m,a);case E:y=8,u|=24;break;case R:return t=sn(12,s,a,u|2),t.elementType=R,t.lanes=m,t;case X:return t=sn(13,s,a,u),t.elementType=X,t.lanes=m,t;case F:return t=sn(19,s,a,u),t.elementType=F,t.lanes=m,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case G:y=10;break e;case V:y=9;break e;case Z:y=11;break e;case O:y=14;break e;case M:y=16,o=null;break e}y=29,s=Error(r(130,t===null?"null":typeof t,"")),o=null}return a=sn(y,s,a,u),a.elementType=t,a.type=o,a.lanes=m,a}function ci(t,a,s,o){return t=sn(7,t,o,a),t.lanes=s,t}function hu(t,a,s){return t=sn(6,t,null,a),t.lanes=s,t}function Um(t){var a=sn(18,null,null,0);return a.stateNode=t,a}function gu(t,a,s){return a=sn(4,t.children!==null?t.children:[],t.key,a),a.lanes=s,a.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},a}var $m=new WeakMap;function hn(t,a){if(typeof t=="object"&&t!==null){var s=$m.get(t);return s!==void 0?s:(a={value:t,source:a,stack:ar(a)},$m.set(t,a),a)}return{value:t,source:a,stack:ar(a)}}var as=[],is=0,Po=null,vr=0,gn=[],yn=0,wa=null,In=1,Vn="";function ea(t,a){as[is++]=vr,as[is++]=Po,Po=t,vr=a}function Im(t,a,s){gn[yn++]=In,gn[yn++]=Vn,gn[yn++]=wa,wa=t;var o=In;t=Vn;var u=32-ht(o)-1;o&=~(1<<u),s+=1;var m=32-ht(a)+u;if(30<m){var y=u-u%5;m=(o&(1<<y)-1).toString(32),o>>=y,u-=y,In=1<<32-ht(a)+u|s<<u|o,Vn=m+t}else In=1<<m|s<<u|o,Vn=t}function yu(t){t.return!==null&&(ea(t,1),Im(t,1,0))}function bu(t){for(;t===Po;)Po=as[--is],as[is]=null,vr=as[--is],as[is]=null;for(;t===wa;)wa=gn[--yn],gn[yn]=null,Vn=gn[--yn],gn[yn]=null,In=gn[--yn],gn[yn]=null}function Vm(t,a){gn[yn++]=In,gn[yn++]=Vn,gn[yn++]=wa,In=a.id,Vn=a.overflow,wa=t}var Rt=null,it=null,Le=!1,ja=null,bn=!1,vu=Error(r(519));function Na(t){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Sr(hn(a,t)),vu}function Pm(t){var a=t.stateNode,s=t.type,o=t.memoizedProps;switch(a[Dt]=t,a[Kt]=o,s){case"dialog":Re("cancel",a),Re("close",a);break;case"iframe":case"object":case"embed":Re("load",a);break;case"video":case"audio":for(s=0;s<Vr.length;s++)Re(Vr[s],a);break;case"source":Re("error",a);break;case"img":case"image":case"link":Re("error",a),Re("load",a);break;case"details":Re("toggle",a);break;case"input":Re("invalid",a),nm(a,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Re("invalid",a);break;case"textarea":Re("invalid",a),im(a,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||a.textContent===""+s||o.suppressHydrationWarning===!0||ry(a.textContent,s)?(o.popover!=null&&(Re("beforetoggle",a),Re("toggle",a)),o.onScroll!=null&&Re("scroll",a),o.onScrollEnd!=null&&Re("scrollend",a),o.onClick!=null&&(a.onclick=Jn),a=!0):a=!1,a||Na(t,!0)}function Gm(t){for(Rt=t.return;Rt;)switch(Rt.tag){case 5:case 31:case 13:bn=!1;return;case 27:case 3:bn=!0;return;default:Rt=Rt.return}}function ss(t){if(t!==Rt)return!1;if(!Le)return Gm(t),Le=!0,!1;var a=t.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||Ld(t.type,t.memoizedProps)),s=!s),s&&it&&Na(t),Gm(t),a===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));it=hy(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));it=hy(t)}else a===27?(a=it,qa(t.type)?(t=Vd,Vd=null,it=t):it=a):it=Rt?Sn(t.stateNode.nextSibling):null;return!0}function ui(){it=Rt=null,Le=!1}function Su(){var t=ja;return t!==null&&(Ft===null?Ft=t:Ft.push.apply(Ft,t),ja=null),t}function Sr(t){ja===null?ja=[t]:ja.push(t)}var xu=Ze(null),di=null,ta=null;function ka(t,a,s){ue(xu,a._currentValue),a._currentValue=s}function na(t){t._currentValue=xu.current,W(xu)}function wu(t,a,s){for(;t!==null;){var o=t.alternate;if((t.childLanes&a)!==a?(t.childLanes|=a,o!==null&&(o.childLanes|=a)):o!==null&&(o.childLanes&a)!==a&&(o.childLanes|=a),t===s)break;t=t.return}}function ju(t,a,s,o){var u=t.child;for(u!==null&&(u.return=t);u!==null;){var m=u.dependencies;if(m!==null){var y=u.child;m=m.firstContext;e:for(;m!==null;){var j=m;m=u;for(var C=0;C<a.length;C++)if(j.context===a[C]){m.lanes|=s,j=m.alternate,j!==null&&(j.lanes|=s),wu(m.return,s,t),o||(y=null);break e}m=j.next}}else if(u.tag===18){if(y=u.return,y===null)throw Error(r(341));y.lanes|=s,m=y.alternate,m!==null&&(m.lanes|=s),wu(y,s,t),y=null}else y=u.child;if(y!==null)y.return=u;else for(y=u;y!==null;){if(y===t){y=null;break}if(u=y.sibling,u!==null){u.return=y.return,y=u;break}y=y.return}u=y}}function rs(t,a,s,o){t=null;for(var u=a,m=!1;u!==null;){if(!m){if((u.flags&524288)!==0)m=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var y=u.alternate;if(y===null)throw Error(r(387));if(y=y.memoizedProps,y!==null){var j=u.type;an(u.pendingProps.value,y.value)||(t!==null?t.push(j):t=[j])}}else if(u===je.current){if(y=u.alternate,y===null)throw Error(r(387));y.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(t!==null?t.push(Kr):t=[Kr])}u=u.return}t!==null&&ju(a,t,s,o),a.flags|=262144}function Go(t){for(t=t.firstContext;t!==null;){if(!an(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function fi(t){di=t,ta=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Mt(t){return Hm(di,t)}function Ho(t,a){return di===null&&fi(t),Hm(t,a)}function Hm(t,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},ta===null){if(t===null)throw Error(r(308));ta=a,t.dependencies={lanes:0,firstContext:a},t.flags|=524288}else ta=ta.next=a;return s}var ox=typeof AbortController<"u"?AbortController:function(){var t=[],a=this.signal={aborted:!1,addEventListener:function(s,o){t.push(o)}};this.abort=function(){a.aborted=!0,t.forEach(function(s){return s()})}},lx=e.unstable_scheduleCallback,cx=e.unstable_NormalPriority,xt={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Nu(){return{controller:new ox,data:new Map,refCount:0}}function xr(t){t.refCount--,t.refCount===0&&lx(cx,function(){t.controller.abort()})}var wr=null,ku=0,os=0,ls=null;function ux(t,a){if(wr===null){var s=wr=[];ku=0,os=Cd(),ls={status:"pending",value:void 0,then:function(o){s.push(o)}}}return ku++,a.then(Qm,Qm),a}function Qm(){if(--ku===0&&wr!==null){ls!==null&&(ls.status="fulfilled");var t=wr;wr=null,os=0,ls=null;for(var a=0;a<t.length;a++)(0,t[a])()}}function dx(t,a){var s=[],o={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return t.then(function(){o.status="fulfilled",o.value=a;for(var u=0;u<s.length;u++)(0,s[u])(a)},function(u){for(o.status="rejected",o.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),o}var Km=B.S;B.S=function(t,a){Tg=Ut(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&ux(t,a),Km!==null&&Km(t,a)};var pi=Ze(null);function Au(){var t=pi.current;return t!==null?t:We.pooledCache}function Qo(t,a){a===null?ue(pi,pi.current):ue(pi,a.pool)}function Zm(){var t=Au();return t===null?null:{parent:xt._currentValue,pool:t}}var cs=Error(r(460)),_u=Error(r(474)),Ko=Error(r(542)),Zo={then:function(){}};function Ym(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Xm(t,a,s){switch(s=t[s],s===void 0?t.push(a):s!==a&&(a.then(Jn,Jn),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Fm(t),t;default:if(typeof a.status=="string")a.then(Jn,Jn);else{if(t=We,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=a,t.status="pending",t.then(function(o){if(a.status==="pending"){var u=a;u.status="fulfilled",u.value=o}},function(o){if(a.status==="pending"){var u=a;u.status="rejected",u.reason=o}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Fm(t),t}throw hi=a,cs}}function mi(t){try{var a=t._init;return a(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(hi=s,cs):s}}var hi=null;function Jm(){if(hi===null)throw Error(r(459));var t=hi;return hi=null,t}function Fm(t){if(t===cs||t===Ko)throw Error(r(483))}var us=null,jr=0;function Yo(t){var a=jr;return jr+=1,us===null&&(us=[]),Xm(us,t,a)}function Nr(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function Xo(t,a){throw a.$$typeof===N?Error(r(525)):(t=Object.prototype.toString.call(a),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":t)))}function Wm(t){function a(D,z){if(t){var L=D.deletions;L===null?(D.deletions=[z],D.flags|=16):L.push(z)}}function s(D,z){if(!t)return null;for(;z!==null;)a(D,z),z=z.sibling;return null}function o(D){for(var z=new Map;D!==null;)D.key!==null?z.set(D.key,D):z.set(D.index,D),D=D.sibling;return z}function u(D,z){return D=Wn(D,z),D.index=0,D.sibling=null,D}function m(D,z,L){return D.index=L,t?(L=D.alternate,L!==null?(L=L.index,L<z?(D.flags|=67108866,z):L):(D.flags|=67108866,z)):(D.flags|=1048576,z)}function y(D){return t&&D.alternate===null&&(D.flags|=67108866),D}function j(D,z,L,K){return z===null||z.tag!==6?(z=hu(L,D.mode,K),z.return=D,z):(z=u(z,L),z.return=D,z)}function C(D,z,L,K){var ve=L.type;return ve===k?P(D,z,L.props.children,K,L.key):z!==null&&(z.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===M&&mi(ve)===z.type)?(z=u(z,L.props),Nr(z,L),z.return=D,z):(z=Vo(L.type,L.key,L.props,null,D.mode,K),Nr(z,L),z.return=D,z)}function q(D,z,L,K){return z===null||z.tag!==4||z.stateNode.containerInfo!==L.containerInfo||z.stateNode.implementation!==L.implementation?(z=gu(L,D.mode,K),z.return=D,z):(z=u(z,L.children||[]),z.return=D,z)}function P(D,z,L,K,ve){return z===null||z.tag!==7?(z=ci(L,D.mode,K,ve),z.return=D,z):(z=u(z,L),z.return=D,z)}function Y(D,z,L){if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return z=hu(""+z,D.mode,L),z.return=D,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case _:return L=Vo(z.type,z.key,z.props,null,D.mode,L),Nr(L,z),L.return=D,L;case T:return z=gu(z,D.mode,L),z.return=D,z;case M:return z=mi(z),Y(D,z,L)}if(ee(z)||be(z))return z=ci(z,D.mode,L,null),z.return=D,z;if(typeof z.then=="function")return Y(D,Yo(z),L);if(z.$$typeof===G)return Y(D,Ho(D,z),L);Xo(D,z)}return null}function $(D,z,L,K){var ve=z!==null?z.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return ve!==null?null:j(D,z,""+L,K);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case _:return L.key===ve?C(D,z,L,K):null;case T:return L.key===ve?q(D,z,L,K):null;case M:return L=mi(L),$(D,z,L,K)}if(ee(L)||be(L))return ve!==null?null:P(D,z,L,K,null);if(typeof L.then=="function")return $(D,z,Yo(L),K);if(L.$$typeof===G)return $(D,z,Ho(D,L),K);Xo(D,L)}return null}function I(D,z,L,K,ve){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return D=D.get(L)||null,j(z,D,""+K,ve);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case _:return D=D.get(K.key===null?L:K.key)||null,C(z,D,K,ve);case T:return D=D.get(K.key===null?L:K.key)||null,q(z,D,K,ve);case M:return K=mi(K),I(D,z,L,K,ve)}if(ee(K)||be(K))return D=D.get(L)||null,P(z,D,K,ve,null);if(typeof K.then=="function")return I(D,z,L,Yo(K),ve);if(K.$$typeof===G)return I(D,z,L,Ho(z,K),ve);Xo(z,K)}return null}function pe(D,z,L,K){for(var ve=null,$e=null,ge=z,Ee=z=0,Be=null;ge!==null&&Ee<L.length;Ee++){ge.index>Ee?(Be=ge,ge=null):Be=ge.sibling;var Ie=$(D,ge,L[Ee],K);if(Ie===null){ge===null&&(ge=Be);break}t&&ge&&Ie.alternate===null&&a(D,ge),z=m(Ie,z,Ee),$e===null?ve=Ie:$e.sibling=Ie,$e=Ie,ge=Be}if(Ee===L.length)return s(D,ge),Le&&ea(D,Ee),ve;if(ge===null){for(;Ee<L.length;Ee++)ge=Y(D,L[Ee],K),ge!==null&&(z=m(ge,z,Ee),$e===null?ve=ge:$e.sibling=ge,$e=ge);return Le&&ea(D,Ee),ve}for(ge=o(ge);Ee<L.length;Ee++)Be=I(ge,D,Ee,L[Ee],K),Be!==null&&(t&&Be.alternate!==null&&ge.delete(Be.key===null?Ee:Be.key),z=m(Be,z,Ee),$e===null?ve=Be:$e.sibling=Be,$e=Be);return t&&ge.forEach(function(Pa){return a(D,Pa)}),Le&&ea(D,Ee),ve}function we(D,z,L,K){if(L==null)throw Error(r(151));for(var ve=null,$e=null,ge=z,Ee=z=0,Be=null,Ie=L.next();ge!==null&&!Ie.done;Ee++,Ie=L.next()){ge.index>Ee?(Be=ge,ge=null):Be=ge.sibling;var Pa=$(D,ge,Ie.value,K);if(Pa===null){ge===null&&(ge=Be);break}t&&ge&&Pa.alternate===null&&a(D,ge),z=m(Pa,z,Ee),$e===null?ve=Pa:$e.sibling=Pa,$e=Pa,ge=Be}if(Ie.done)return s(D,ge),Le&&ea(D,Ee),ve;if(ge===null){for(;!Ie.done;Ee++,Ie=L.next())Ie=Y(D,Ie.value,K),Ie!==null&&(z=m(Ie,z,Ee),$e===null?ve=Ie:$e.sibling=Ie,$e=Ie);return Le&&ea(D,Ee),ve}for(ge=o(ge);!Ie.done;Ee++,Ie=L.next())Ie=I(ge,D,Ee,Ie.value,K),Ie!==null&&(t&&Ie.alternate!==null&&ge.delete(Ie.key===null?Ee:Ie.key),z=m(Ie,z,Ee),$e===null?ve=Ie:$e.sibling=Ie,$e=Ie);return t&&ge.forEach(function(ww){return a(D,ww)}),Le&&ea(D,Ee),ve}function Je(D,z,L,K){if(typeof L=="object"&&L!==null&&L.type===k&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case _:e:{for(var ve=L.key;z!==null;){if(z.key===ve){if(ve=L.type,ve===k){if(z.tag===7){s(D,z.sibling),K=u(z,L.props.children),K.return=D,D=K;break e}}else if(z.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===M&&mi(ve)===z.type){s(D,z.sibling),K=u(z,L.props),Nr(K,L),K.return=D,D=K;break e}s(D,z);break}else a(D,z);z=z.sibling}L.type===k?(K=ci(L.props.children,D.mode,K,L.key),K.return=D,D=K):(K=Vo(L.type,L.key,L.props,null,D.mode,K),Nr(K,L),K.return=D,D=K)}return y(D);case T:e:{for(ve=L.key;z!==null;){if(z.key===ve)if(z.tag===4&&z.stateNode.containerInfo===L.containerInfo&&z.stateNode.implementation===L.implementation){s(D,z.sibling),K=u(z,L.children||[]),K.return=D,D=K;break e}else{s(D,z);break}else a(D,z);z=z.sibling}K=gu(L,D.mode,K),K.return=D,D=K}return y(D);case M:return L=mi(L),Je(D,z,L,K)}if(ee(L))return pe(D,z,L,K);if(be(L)){if(ve=be(L),typeof ve!="function")throw Error(r(150));return L=ve.call(L),we(D,z,L,K)}if(typeof L.then=="function")return Je(D,z,Yo(L),K);if(L.$$typeof===G)return Je(D,z,Ho(D,L),K);Xo(D,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,z!==null&&z.tag===6?(s(D,z.sibling),K=u(z,L),K.return=D,D=K):(s(D,z),K=hu(L,D.mode,K),K.return=D,D=K),y(D)):s(D,z)}return function(D,z,L,K){try{jr=0;var ve=Je(D,z,L,K);return us=null,ve}catch(ge){if(ge===cs||ge===Ko)throw ge;var $e=sn(29,ge,null,D.mode);return $e.lanes=K,$e.return=D,$e}}}var gi=Wm(!0),eh=Wm(!1),Aa=!1;function Cu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zu(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function _a(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ca(t,a,s){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(Ve&2)!==0){var u=o.pending;return u===null?a.next=a:(a.next=u.next,u.next=a),o.pending=a,a=Io(t),Lm(t,null,s),a}return $o(t,o,a,s),Io(t)}function kr(t,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var o=a.lanes;o&=t.pendingLanes,s|=o,a.lanes=s,_o(t,s)}}function Tu(t,a){var s=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var u=null,m=null;if(s=s.firstBaseUpdate,s!==null){do{var y={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};m===null?u=m=y:m=m.next=y,s=s.next}while(s!==null);m===null?u=m=a:m=m.next=a}else u=m=a;s={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:m,shared:o.shared,callbacks:o.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=a:t.next=a,s.lastBaseUpdate=a}var Eu=!1;function Ar(){if(Eu){var t=ls;if(t!==null)throw t}}function _r(t,a,s,o){Eu=!1;var u=t.updateQueue;Aa=!1;var m=u.firstBaseUpdate,y=u.lastBaseUpdate,j=u.shared.pending;if(j!==null){u.shared.pending=null;var C=j,q=C.next;C.next=null,y===null?m=q:y.next=q,y=C;var P=t.alternate;P!==null&&(P=P.updateQueue,j=P.lastBaseUpdate,j!==y&&(j===null?P.firstBaseUpdate=q:j.next=q,P.lastBaseUpdate=C))}if(m!==null){var Y=u.baseState;y=0,P=q=C=null,j=m;do{var $=j.lane&-536870913,I=$!==j.lane;if(I?(Me&$)===$:(o&$)===$){$!==0&&$===os&&(Eu=!0),P!==null&&(P=P.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var pe=t,we=j;$=a;var Je=s;switch(we.tag){case 1:if(pe=we.payload,typeof pe=="function"){Y=pe.call(Je,Y,$);break e}Y=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=we.payload,$=typeof pe=="function"?pe.call(Je,Y,$):pe,$==null)break e;Y=x({},Y,$);break e;case 2:Aa=!0}}$=j.callback,$!==null&&(t.flags|=64,I&&(t.flags|=8192),I=u.callbacks,I===null?u.callbacks=[$]:I.push($))}else I={lane:$,tag:j.tag,payload:j.payload,callback:j.callback,next:null},P===null?(q=P=I,C=Y):P=P.next=I,y|=$;if(j=j.next,j===null){if(j=u.shared.pending,j===null)break;I=j,j=I.next,I.next=null,u.lastBaseUpdate=I,u.shared.pending=null}}while(!0);P===null&&(C=Y),u.baseState=C,u.firstBaseUpdate=q,u.lastBaseUpdate=P,m===null&&(u.shared.lanes=0),Da|=y,t.lanes=y,t.memoizedState=Y}}function th(t,a){if(typeof t!="function")throw Error(r(191,t));t.call(a)}function nh(t,a){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)th(s[t],a)}var ds=Ze(null),Jo=Ze(0);function ah(t,a){t=da,ue(Jo,t),ue(ds,a),da=t|a.baseLanes}function Ou(){ue(Jo,da),ue(ds,ds.current)}function Du(){da=Jo.current,W(ds),W(Jo)}var rn=Ze(null),vn=null;function za(t){var a=t.alternate;ue(gt,gt.current&1),ue(rn,t),vn===null&&(a===null||ds.current!==null||a.memoizedState!==null)&&(vn=t)}function Ru(t){ue(gt,gt.current),ue(rn,t),vn===null&&(vn=t)}function ih(t){t.tag===22?(ue(gt,gt.current),ue(rn,t),vn===null&&(vn=t)):Ta()}function Ta(){ue(gt,gt.current),ue(rn,rn.current)}function on(t){W(rn),vn===t&&(vn=null),W(gt)}var gt=Ze(0);function Fo(t){for(var a=t;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||$d(s)||Id(s)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var aa=0,ze=null,Ye=null,wt=null,Wo=!1,fs=!1,yi=!1,el=0,Cr=0,ps=null,fx=0;function pt(){throw Error(r(321))}function Mu(t,a){if(a===null)return!1;for(var s=0;s<a.length&&s<t.length;s++)if(!an(t[s],a[s]))return!1;return!0}function Bu(t,a,s,o,u,m){return aa=m,ze=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,B.H=t===null||t.memoizedState===null?Ih:Ju,yi=!1,m=s(o,u),yi=!1,fs&&(m=rh(a,s,o,u)),sh(t),m}function sh(t){B.H=Er;var a=Ye!==null&&Ye.next!==null;if(aa=0,wt=Ye=ze=null,Wo=!1,Cr=0,ps=null,a)throw Error(r(300));t===null||jt||(t=t.dependencies,t!==null&&Go(t)&&(jt=!0))}function rh(t,a,s,o){ze=t;var u=0;do{if(fs&&(ps=null),Cr=0,fs=!1,25<=u)throw Error(r(301));if(u+=1,wt=Ye=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}B.H=Vh,m=a(s,o)}while(fs);return m}function px(){var t=B.H,a=t.useState()[0];return a=typeof a.then=="function"?zr(a):a,t=t.useState()[0],(Ye!==null?Ye.memoizedState:null)!==t&&(ze.flags|=1024),a}function Lu(){var t=el!==0;return el=0,t}function qu(t,a,s){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~s}function Uu(t){if(Wo){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}Wo=!1}aa=0,wt=Ye=ze=null,fs=!1,Cr=el=0,ps=null}function Vt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wt===null?ze.memoizedState=wt=t:wt=wt.next=t,wt}function yt(){if(Ye===null){var t=ze.alternate;t=t!==null?t.memoizedState:null}else t=Ye.next;var a=wt===null?ze.memoizedState:wt.next;if(a!==null)wt=a,Ye=t;else{if(t===null)throw ze.alternate===null?Error(r(467)):Error(r(310));Ye=t,t={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},wt===null?ze.memoizedState=wt=t:wt=wt.next=t}return wt}function tl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zr(t){var a=Cr;return Cr+=1,ps===null&&(ps=[]),t=Xm(ps,t,a),a=ze,(wt===null?a.memoizedState:wt.next)===null&&(a=a.alternate,B.H=a===null||a.memoizedState===null?Ih:Ju),t}function nl(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return zr(t);if(t.$$typeof===G)return Mt(t)}throw Error(r(438,String(t)))}function $u(t){var a=null,s=ze.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var o=ze.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(a={data:o.data.map(function(u){return u.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),s===null&&(s=tl(),ze.updateQueue=s),s.memoCache=a,s=a.data[a.index],s===void 0)for(s=a.data[a.index]=Array(t),o=0;o<t;o++)s[o]=ke;return a.index++,s}function ia(t,a){return typeof a=="function"?a(t):a}function al(t){var a=yt();return Iu(a,Ye,t)}function Iu(t,a,s){var o=t.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=s;var u=t.baseQueue,m=o.pending;if(m!==null){if(u!==null){var y=u.next;u.next=m.next,m.next=y}a.baseQueue=u=m,o.pending=null}if(m=t.baseState,u===null)t.memoizedState=m;else{a=u.next;var j=y=null,C=null,q=a,P=!1;do{var Y=q.lane&-536870913;if(Y!==q.lane?(Me&Y)===Y:(aa&Y)===Y){var $=q.revertLane;if($===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),Y===os&&(P=!0);else if((aa&$)===$){q=q.next,$===os&&(P=!0);continue}else Y={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},C===null?(j=C=Y,y=m):C=C.next=Y,ze.lanes|=$,Da|=$;Y=q.action,yi&&s(m,Y),m=q.hasEagerState?q.eagerState:s(m,Y)}else $={lane:Y,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},C===null?(j=C=$,y=m):C=C.next=$,ze.lanes|=Y,Da|=Y;q=q.next}while(q!==null&&q!==a);if(C===null?y=m:C.next=j,!an(m,t.memoizedState)&&(jt=!0,P&&(s=ls,s!==null)))throw s;t.memoizedState=m,t.baseState=y,t.baseQueue=C,o.lastRenderedState=m}return u===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Vu(t){var a=yt(),s=a.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=t;var o=s.dispatch,u=s.pending,m=a.memoizedState;if(u!==null){s.pending=null;var y=u=u.next;do m=t(m,y.action),y=y.next;while(y!==u);an(m,a.memoizedState)||(jt=!0),a.memoizedState=m,a.baseQueue===null&&(a.baseState=m),s.lastRenderedState=m}return[m,o]}function oh(t,a,s){var o=ze,u=yt(),m=Le;if(m){if(s===void 0)throw Error(r(407));s=s()}else s=a();var y=!an((Ye||u).memoizedState,s);if(y&&(u.memoizedState=s,jt=!0),u=u.queue,Hu(uh.bind(null,o,u,t),[t]),u.getSnapshot!==a||y||wt!==null&&wt.memoizedState.tag&1){if(o.flags|=2048,ms(9,{destroy:void 0},ch.bind(null,o,u,s,a),null),We===null)throw Error(r(349));m||(aa&127)!==0||lh(o,a,s)}return s}function lh(t,a,s){t.flags|=16384,t={getSnapshot:a,value:s},a=ze.updateQueue,a===null?(a=tl(),ze.updateQueue=a,a.stores=[t]):(s=a.stores,s===null?a.stores=[t]:s.push(t))}function ch(t,a,s,o){a.value=s,a.getSnapshot=o,dh(a)&&fh(t)}function uh(t,a,s){return s(function(){dh(a)&&fh(t)})}function dh(t){var a=t.getSnapshot;t=t.value;try{var s=a();return!an(t,s)}catch{return!0}}function fh(t){var a=li(t,2);a!==null&&Wt(a,t,2)}function Pu(t){var a=Vt();if(typeof t=="function"){var s=t;if(t=s(),yi){Tn(!0);try{s()}finally{Tn(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:t},a}function ph(t,a,s,o){return t.baseState=s,Iu(t,Ye,typeof o=="function"?o:ia)}function mx(t,a,s,o,u){if(rl(t))throw Error(r(485));if(t=a.action,t!==null){var m={payload:u,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){m.listeners.push(y)}};B.T!==null?s(!0):m.isTransition=!1,o(m),s=a.pending,s===null?(m.next=a.pending=m,mh(a,m)):(m.next=s.next,a.pending=s.next=m)}}function mh(t,a){var s=a.action,o=a.payload,u=t.state;if(a.isTransition){var m=B.T,y={};B.T=y;try{var j=s(u,o),C=B.S;C!==null&&C(y,j),hh(t,a,j)}catch(q){Gu(t,a,q)}finally{m!==null&&y.types!==null&&(m.types=y.types),B.T=m}}else try{m=s(u,o),hh(t,a,m)}catch(q){Gu(t,a,q)}}function hh(t,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){gh(t,a,o)},function(o){return Gu(t,a,o)}):gh(t,a,s)}function gh(t,a,s){a.status="fulfilled",a.value=s,yh(a),t.state=s,a=t.pending,a!==null&&(s=a.next,s===a?t.pending=null:(s=s.next,a.next=s,mh(t,s)))}function Gu(t,a,s){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do a.status="rejected",a.reason=s,yh(a),a=a.next;while(a!==o)}t.action=null}function yh(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function bh(t,a){return a}function vh(t,a){if(Le){var s=We.formState;if(s!==null){e:{var o=ze;if(Le){if(it){t:{for(var u=it,m=bn;u.nodeType!==8;){if(!m){u=null;break t}if(u=Sn(u.nextSibling),u===null){u=null;break t}}m=u.data,u=m==="F!"||m==="F"?u:null}if(u){it=Sn(u.nextSibling),o=u.data==="F!";break e}}Na(o)}o=!1}o&&(a=s[0])}}return s=Vt(),s.memoizedState=s.baseState=a,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bh,lastRenderedState:a},s.queue=o,s=qh.bind(null,ze,o),o.dispatch=s,o=Pu(!1),m=Xu.bind(null,ze,!1,o.queue),o=Vt(),u={state:a,dispatch:null,action:t,pending:null},o.queue=u,s=mx.bind(null,ze,u,m,s),u.dispatch=s,o.memoizedState=t,[a,s,!1]}function Sh(t){var a=yt();return xh(a,Ye,t)}function xh(t,a,s){if(a=Iu(t,a,bh)[0],t=al(ia)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var o=zr(a)}catch(y){throw y===cs?Ko:y}else o=a;a=yt();var u=a.queue,m=u.dispatch;return s!==a.memoizedState&&(ze.flags|=2048,ms(9,{destroy:void 0},hx.bind(null,u,s),null)),[o,m,t]}function hx(t,a){t.action=a}function wh(t){var a=yt(),s=Ye;if(s!==null)return xh(a,s,t);yt(),a=a.memoizedState,s=yt();var o=s.queue.dispatch;return s.memoizedState=t,[a,o,!1]}function ms(t,a,s,o){return t={tag:t,create:s,deps:o,inst:a,next:null},a=ze.updateQueue,a===null&&(a=tl(),ze.updateQueue=a),s=a.lastEffect,s===null?a.lastEffect=t.next=t:(o=s.next,s.next=t,t.next=o,a.lastEffect=t),t}function jh(){return yt().memoizedState}function il(t,a,s,o){var u=Vt();ze.flags|=t,u.memoizedState=ms(1|a,{destroy:void 0},s,o===void 0?null:o)}function sl(t,a,s,o){var u=yt();o=o===void 0?null:o;var m=u.memoizedState.inst;Ye!==null&&o!==null&&Mu(o,Ye.memoizedState.deps)?u.memoizedState=ms(a,m,s,o):(ze.flags|=t,u.memoizedState=ms(1|a,m,s,o))}function Nh(t,a){il(8390656,8,t,a)}function Hu(t,a){sl(2048,8,t,a)}function gx(t){ze.flags|=4;var a=ze.updateQueue;if(a===null)a=tl(),ze.updateQueue=a,a.events=[t];else{var s=a.events;s===null?a.events=[t]:s.push(t)}}function kh(t){var a=yt().memoizedState;return gx({ref:a,nextImpl:t}),function(){if((Ve&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function Ah(t,a){return sl(4,2,t,a)}function _h(t,a){return sl(4,4,t,a)}function Ch(t,a){if(typeof a=="function"){t=t();var s=a(t);return function(){typeof s=="function"?s():a(null)}}if(a!=null)return t=t(),a.current=t,function(){a.current=null}}function zh(t,a,s){s=s!=null?s.concat([t]):null,sl(4,4,Ch.bind(null,a,t),s)}function Qu(){}function Th(t,a){var s=yt();a=a===void 0?null:a;var o=s.memoizedState;return a!==null&&Mu(a,o[1])?o[0]:(s.memoizedState=[t,a],t)}function Eh(t,a){var s=yt();a=a===void 0?null:a;var o=s.memoizedState;if(a!==null&&Mu(a,o[1]))return o[0];if(o=t(),yi){Tn(!0);try{t()}finally{Tn(!1)}}return s.memoizedState=[o,a],o}function Ku(t,a,s){return s===void 0||(aa&1073741824)!==0&&(Me&261930)===0?t.memoizedState=a:(t.memoizedState=s,t=Og(),ze.lanes|=t,Da|=t,s)}function Oh(t,a,s,o){return an(s,a)?s:ds.current!==null?(t=Ku(t,s,o),an(t,a)||(jt=!0),t):(aa&42)===0||(aa&1073741824)!==0&&(Me&261930)===0?(jt=!0,t.memoizedState=s):(t=Og(),ze.lanes|=t,Da|=t,a)}function Dh(t,a,s,o,u){var m=J.p;J.p=m!==0&&8>m?m:8;var y=B.T,j={};B.T=j,Xu(t,!1,a,s);try{var C=u(),q=B.S;if(q!==null&&q(j,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var P=dx(C,o);Tr(t,a,P,un(t))}else Tr(t,a,o,un(t))}catch(Y){Tr(t,a,{then:function(){},status:"rejected",reason:Y},un())}finally{J.p=m,y!==null&&j.types!==null&&(y.types=j.types),B.T=y}}function yx(){}function Zu(t,a,s,o){if(t.tag!==5)throw Error(r(476));var u=Rh(t).queue;Dh(t,u,a,fe,s===null?yx:function(){return Mh(t),s(o)})}function Rh(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:fe},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:s},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function Mh(t){var a=Rh(t);a.next===null&&(a=t.alternate.memoizedState),Tr(t,a.next.queue,{},un())}function Yu(){return Mt(Kr)}function Bh(){return yt().memoizedState}function Lh(){return yt().memoizedState}function bx(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var s=un();t=_a(s);var o=Ca(a,t,s);o!==null&&(Wt(o,a,s),kr(o,a,s)),a={cache:Nu()},t.payload=a;return}a=a.return}}function vx(t,a,s){var o=un();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},rl(t)?Uh(a,s):(s=pu(t,a,s,o),s!==null&&(Wt(s,t,o),$h(s,a,o)))}function qh(t,a,s){var o=un();Tr(t,a,s,o)}function Tr(t,a,s,o){var u={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(rl(t))Uh(a,u);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=a.lastRenderedReducer,m!==null))try{var y=a.lastRenderedState,j=m(y,s);if(u.hasEagerState=!0,u.eagerState=j,an(j,y))return $o(t,a,u,0),We===null&&Uo(),!1}catch{}if(s=pu(t,a,u,o),s!==null)return Wt(s,t,o),$h(s,a,o),!0}return!1}function Xu(t,a,s,o){if(o={lane:2,revertLane:Cd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},rl(t)){if(a)throw Error(r(479))}else a=pu(t,s,o,2),a!==null&&Wt(a,t,2)}function rl(t){var a=t.alternate;return t===ze||a!==null&&a===ze}function Uh(t,a){fs=Wo=!0;var s=t.pending;s===null?a.next=a:(a.next=s.next,s.next=a),t.pending=a}function $h(t,a,s){if((s&4194048)!==0){var o=a.lanes;o&=t.pendingLanes,s|=o,a.lanes=s,_o(t,s)}}var Er={readContext:Mt,use:nl,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useLayoutEffect:pt,useInsertionEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useSyncExternalStore:pt,useId:pt,useHostTransitionStatus:pt,useFormState:pt,useActionState:pt,useOptimistic:pt,useMemoCache:pt,useCacheRefresh:pt};Er.useEffectEvent=pt;var Ih={readContext:Mt,use:nl,useCallback:function(t,a){return Vt().memoizedState=[t,a===void 0?null:a],t},useContext:Mt,useEffect:Nh,useImperativeHandle:function(t,a,s){s=s!=null?s.concat([t]):null,il(4194308,4,Ch.bind(null,a,t),s)},useLayoutEffect:function(t,a){return il(4194308,4,t,a)},useInsertionEffect:function(t,a){il(4,2,t,a)},useMemo:function(t,a){var s=Vt();a=a===void 0?null:a;var o=t();if(yi){Tn(!0);try{t()}finally{Tn(!1)}}return s.memoizedState=[o,a],o},useReducer:function(t,a,s){var o=Vt();if(s!==void 0){var u=s(a);if(yi){Tn(!0);try{s(a)}finally{Tn(!1)}}}else u=a;return o.memoizedState=o.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},o.queue=t,t=t.dispatch=vx.bind(null,ze,t),[o.memoizedState,t]},useRef:function(t){var a=Vt();return t={current:t},a.memoizedState=t},useState:function(t){t=Pu(t);var a=t.queue,s=qh.bind(null,ze,a);return a.dispatch=s,[t.memoizedState,s]},useDebugValue:Qu,useDeferredValue:function(t,a){var s=Vt();return Ku(s,t,a)},useTransition:function(){var t=Pu(!1);return t=Dh.bind(null,ze,t.queue,!0,!1),Vt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,s){var o=ze,u=Vt();if(Le){if(s===void 0)throw Error(r(407));s=s()}else{if(s=a(),We===null)throw Error(r(349));(Me&127)!==0||lh(o,a,s)}u.memoizedState=s;var m={value:s,getSnapshot:a};return u.queue=m,Nh(uh.bind(null,o,m,t),[t]),o.flags|=2048,ms(9,{destroy:void 0},ch.bind(null,o,m,s,a),null),s},useId:function(){var t=Vt(),a=We.identifierPrefix;if(Le){var s=Vn,o=In;s=(o&~(1<<32-ht(o)-1)).toString(32)+s,a="_"+a+"R_"+s,s=el++,0<s&&(a+="H"+s.toString(32)),a+="_"}else s=fx++,a="_"+a+"r_"+s.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:Yu,useFormState:vh,useActionState:vh,useOptimistic:function(t){var a=Vt();a.memoizedState=a.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=Xu.bind(null,ze,!0,s),s.dispatch=a,[t,a]},useMemoCache:$u,useCacheRefresh:function(){return Vt().memoizedState=bx.bind(null,ze)},useEffectEvent:function(t){var a=Vt(),s={impl:t};return a.memoizedState=s,function(){if((Ve&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}},Ju={readContext:Mt,use:nl,useCallback:Th,useContext:Mt,useEffect:Hu,useImperativeHandle:zh,useInsertionEffect:Ah,useLayoutEffect:_h,useMemo:Eh,useReducer:al,useRef:jh,useState:function(){return al(ia)},useDebugValue:Qu,useDeferredValue:function(t,a){var s=yt();return Oh(s,Ye.memoizedState,t,a)},useTransition:function(){var t=al(ia)[0],a=yt().memoizedState;return[typeof t=="boolean"?t:zr(t),a]},useSyncExternalStore:oh,useId:Bh,useHostTransitionStatus:Yu,useFormState:Sh,useActionState:Sh,useOptimistic:function(t,a){var s=yt();return ph(s,Ye,t,a)},useMemoCache:$u,useCacheRefresh:Lh};Ju.useEffectEvent=kh;var Vh={readContext:Mt,use:nl,useCallback:Th,useContext:Mt,useEffect:Hu,useImperativeHandle:zh,useInsertionEffect:Ah,useLayoutEffect:_h,useMemo:Eh,useReducer:Vu,useRef:jh,useState:function(){return Vu(ia)},useDebugValue:Qu,useDeferredValue:function(t,a){var s=yt();return Ye===null?Ku(s,t,a):Oh(s,Ye.memoizedState,t,a)},useTransition:function(){var t=Vu(ia)[0],a=yt().memoizedState;return[typeof t=="boolean"?t:zr(t),a]},useSyncExternalStore:oh,useId:Bh,useHostTransitionStatus:Yu,useFormState:wh,useActionState:wh,useOptimistic:function(t,a){var s=yt();return Ye!==null?ph(s,Ye,t,a):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:$u,useCacheRefresh:Lh};Vh.useEffectEvent=kh;function Fu(t,a,s,o){a=t.memoizedState,s=s(o,a),s=s==null?a:x({},a,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Wu={enqueueSetState:function(t,a,s){t=t._reactInternals;var o=un(),u=_a(o);u.payload=a,s!=null&&(u.callback=s),a=Ca(t,u,o),a!==null&&(Wt(a,t,o),kr(a,t,o))},enqueueReplaceState:function(t,a,s){t=t._reactInternals;var o=un(),u=_a(o);u.tag=1,u.payload=a,s!=null&&(u.callback=s),a=Ca(t,u,o),a!==null&&(Wt(a,t,o),kr(a,t,o))},enqueueForceUpdate:function(t,a){t=t._reactInternals;var s=un(),o=_a(s);o.tag=2,a!=null&&(o.callback=a),a=Ca(t,o,s),a!==null&&(Wt(a,t,s),kr(a,t,s))}};function Ph(t,a,s,o,u,m,y){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,m,y):a.prototype&&a.prototype.isPureReactComponent?!yr(s,o)||!yr(u,m):!0}function Gh(t,a,s,o){t=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(s,o),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(s,o),a.state!==t&&Wu.enqueueReplaceState(a,a.state,null)}function bi(t,a){var s=a;if("ref"in a){s={};for(var o in a)o!=="ref"&&(s[o]=a[o])}if(t=t.defaultProps){s===a&&(s=x({},s));for(var u in t)s[u]===void 0&&(s[u]=t[u])}return s}function Hh(t){qo(t)}function Qh(t){console.error(t)}function Kh(t){qo(t)}function ol(t,a){try{var s=t.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(o){setTimeout(function(){throw o})}}function Zh(t,a,s){try{var o=t.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function ed(t,a,s){return s=_a(s),s.tag=3,s.payload={element:null},s.callback=function(){ol(t,a)},s}function Yh(t){return t=_a(t),t.tag=3,t}function Xh(t,a,s,o){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var m=o.value;t.payload=function(){return u(m)},t.callback=function(){Zh(a,s,o)}}var y=s.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(t.callback=function(){Zh(a,s,o),typeof u!="function"&&(Ra===null?Ra=new Set([this]):Ra.add(this));var j=o.stack;this.componentDidCatch(o.value,{componentStack:j!==null?j:""})})}function Sx(t,a,s,o,u){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(a=s.alternate,a!==null&&rs(a,s,u,!0),s=rn.current,s!==null){switch(s.tag){case 31:case 13:return vn===null?vl():s.alternate===null&&mt===0&&(mt=3),s.flags&=-257,s.flags|=65536,s.lanes=u,o===Zo?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([o]):a.add(o),kd(t,o,u)),!1;case 22:return s.flags|=65536,o===Zo?s.flags|=16384:(a=s.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=a):(s=a.retryQueue,s===null?a.retryQueue=new Set([o]):s.add(o)),kd(t,o,u)),!1}throw Error(r(435,s.tag))}return kd(t,o,u),vl(),!1}if(Le)return a=rn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=u,o!==vu&&(t=Error(r(422),{cause:o}),Sr(hn(t,s)))):(o!==vu&&(a=Error(r(423),{cause:o}),Sr(hn(a,s))),t=t.current.alternate,t.flags|=65536,u&=-u,t.lanes|=u,o=hn(o,s),u=ed(t.stateNode,o,u),Tu(t,u),mt!==4&&(mt=2)),!1;var m=Error(r(520),{cause:o});if(m=hn(m,s),Ur===null?Ur=[m]:Ur.push(m),mt!==4&&(mt=2),a===null)return!0;o=hn(o,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,t=u&-u,s.lanes|=t,t=ed(s.stateNode,o,t),Tu(s,t),!1;case 1:if(a=s.type,m=s.stateNode,(s.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Ra===null||!Ra.has(m))))return s.flags|=65536,u&=-u,s.lanes|=u,u=Yh(u),Xh(u,t,s,o),Tu(s,u),!1}s=s.return}while(s!==null);return!1}var td=Error(r(461)),jt=!1;function Bt(t,a,s,o){a.child=t===null?eh(a,null,s,o):gi(a,t.child,s,o)}function Jh(t,a,s,o,u){s=s.render;var m=a.ref;if("ref"in o){var y={};for(var j in o)j!=="ref"&&(y[j]=o[j])}else y=o;return fi(a),o=Bu(t,a,s,y,m,u),j=Lu(),t!==null&&!jt?(qu(t,a,u),sa(t,a,u)):(Le&&j&&yu(a),a.flags|=1,Bt(t,a,o,u),a.child)}function Fh(t,a,s,o,u){if(t===null){var m=s.type;return typeof m=="function"&&!mu(m)&&m.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=m,Wh(t,a,m,o,u)):(t=Vo(s.type,null,o,a,a.mode,u),t.ref=a.ref,t.return=a,a.child=t)}if(m=t.child,!cd(t,u)){var y=m.memoizedProps;if(s=s.compare,s=s!==null?s:yr,s(y,o)&&t.ref===a.ref)return sa(t,a,u)}return a.flags|=1,t=Wn(m,o),t.ref=a.ref,t.return=a,a.child=t}function Wh(t,a,s,o,u){if(t!==null){var m=t.memoizedProps;if(yr(m,o)&&t.ref===a.ref)if(jt=!1,a.pendingProps=o=m,cd(t,u))(t.flags&131072)!==0&&(jt=!0);else return a.lanes=t.lanes,sa(t,a,u)}return nd(t,a,s,o,u)}function eg(t,a,s,o){var u=o.children,m=t!==null?t.memoizedState:null;if(t===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((a.flags&128)!==0){if(m=m!==null?m.baseLanes|s:s,t!==null){for(o=a.child=t.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~m}else o=0,a.child=null;return tg(t,a,m,s,o)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&Qo(a,m!==null?m.cachePool:null),m!==null?ah(a,m):Ou(),ih(a);else return o=a.lanes=536870912,tg(t,a,m!==null?m.baseLanes|s:s,s,o)}else m!==null?(Qo(a,m.cachePool),ah(a,m),Ta(),a.memoizedState=null):(t!==null&&Qo(a,null),Ou(),Ta());return Bt(t,a,u,s),a.child}function Or(t,a){return t!==null&&t.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function tg(t,a,s,o,u){var m=Au();return m=m===null?null:{parent:xt._currentValue,pool:m},a.memoizedState={baseLanes:s,cachePool:m},t!==null&&Qo(a,null),Ou(),ih(a),t!==null&&rs(t,a,o,!0),a.childLanes=u,null}function ll(t,a){return a=ul({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function ng(t,a,s){return gi(a,t.child,null,s),t=ll(a,a.pendingProps),t.flags|=2,on(a),a.memoizedState=null,t}function xx(t,a,s){var o=a.pendingProps,u=(a.flags&128)!==0;if(a.flags&=-129,t===null){if(Le){if(o.mode==="hidden")return t=ll(a,o),a.lanes=536870912,Or(null,t);if(Ru(a),(t=it)?(t=my(t,bn),t=t!==null&&t.data==="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:wa!==null?{id:In,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},s=Um(t),s.return=a,a.child=s,Rt=a,it=null)):t=null,t===null)throw Na(a);return a.lanes=536870912,null}return ll(a,o)}var m=t.memoizedState;if(m!==null){var y=m.dehydrated;if(Ru(a),u)if(a.flags&256)a.flags&=-257,a=ng(t,a,s);else if(a.memoizedState!==null)a.child=t.child,a.flags|=128,a=null;else throw Error(r(558));else if(jt||rs(t,a,s,!1),u=(s&t.childLanes)!==0,jt||u){if(o=We,o!==null&&(y=rr(o,s),y!==0&&y!==m.retryLane))throw m.retryLane=y,li(t,y),Wt(o,t,y),td;vl(),a=ng(t,a,s)}else t=m.treeContext,it=Sn(y.nextSibling),Rt=a,Le=!0,ja=null,bn=!1,t!==null&&Vm(a,t),a=ll(a,o),a.flags|=4096;return a}return t=Wn(t.child,{mode:o.mode,children:o.children}),t.ref=a.ref,a.child=t,t.return=a,t}function cl(t,a){var s=a.ref;if(s===null)t!==null&&t.ref!==null&&(a.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(r(284));(t===null||t.ref!==s)&&(a.flags|=4194816)}}function nd(t,a,s,o,u){return fi(a),s=Bu(t,a,s,o,void 0,u),o=Lu(),t!==null&&!jt?(qu(t,a,u),sa(t,a,u)):(Le&&o&&yu(a),a.flags|=1,Bt(t,a,s,u),a.child)}function ag(t,a,s,o,u,m){return fi(a),a.updateQueue=null,s=rh(a,o,s,u),sh(t),o=Lu(),t!==null&&!jt?(qu(t,a,m),sa(t,a,m)):(Le&&o&&yu(a),a.flags|=1,Bt(t,a,s,m),a.child)}function ig(t,a,s,o,u){if(fi(a),a.stateNode===null){var m=ns,y=s.contextType;typeof y=="object"&&y!==null&&(m=Mt(y)),m=new s(o,m),a.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Wu,a.stateNode=m,m._reactInternals=a,m=a.stateNode,m.props=o,m.state=a.memoizedState,m.refs={},Cu(a),y=s.contextType,m.context=typeof y=="object"&&y!==null?Mt(y):ns,m.state=a.memoizedState,y=s.getDerivedStateFromProps,typeof y=="function"&&(Fu(a,s,y,o),m.state=a.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(y=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),y!==m.state&&Wu.enqueueReplaceState(m,m.state,null),_r(a,o,m,u),Ar(),m.state=a.memoizedState),typeof m.componentDidMount=="function"&&(a.flags|=4194308),o=!0}else if(t===null){m=a.stateNode;var j=a.memoizedProps,C=bi(s,j);m.props=C;var q=m.context,P=s.contextType;y=ns,typeof P=="object"&&P!==null&&(y=Mt(P));var Y=s.getDerivedStateFromProps;P=typeof Y=="function"||typeof m.getSnapshotBeforeUpdate=="function",j=a.pendingProps!==j,P||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(j||q!==y)&&Gh(a,m,o,y),Aa=!1;var $=a.memoizedState;m.state=$,_r(a,o,m,u),Ar(),q=a.memoizedState,j||$!==q||Aa?(typeof Y=="function"&&(Fu(a,s,Y,o),q=a.memoizedState),(C=Aa||Ph(a,s,C,o,$,q,y))?(P||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(a.flags|=4194308)):(typeof m.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=o,a.memoizedState=q),m.props=o,m.state=q,m.context=y,o=C):(typeof m.componentDidMount=="function"&&(a.flags|=4194308),o=!1)}else{m=a.stateNode,zu(t,a),y=a.memoizedProps,P=bi(s,y),m.props=P,Y=a.pendingProps,$=m.context,q=s.contextType,C=ns,typeof q=="object"&&q!==null&&(C=Mt(q)),j=s.getDerivedStateFromProps,(q=typeof j=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(y!==Y||$!==C)&&Gh(a,m,o,C),Aa=!1,$=a.memoizedState,m.state=$,_r(a,o,m,u),Ar();var I=a.memoizedState;y!==Y||$!==I||Aa||t!==null&&t.dependencies!==null&&Go(t.dependencies)?(typeof j=="function"&&(Fu(a,s,j,o),I=a.memoizedState),(P=Aa||Ph(a,s,P,o,$,I,C)||t!==null&&t.dependencies!==null&&Go(t.dependencies))?(q||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(o,I,C),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(o,I,C)),typeof m.componentDidUpdate=="function"&&(a.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof m.componentDidUpdate!="function"||y===t.memoizedProps&&$===t.memoizedState||(a.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&$===t.memoizedState||(a.flags|=1024),a.memoizedProps=o,a.memoizedState=I),m.props=o,m.state=I,m.context=C,o=P):(typeof m.componentDidUpdate!="function"||y===t.memoizedProps&&$===t.memoizedState||(a.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||y===t.memoizedProps&&$===t.memoizedState||(a.flags|=1024),o=!1)}return m=o,cl(t,a),o=(a.flags&128)!==0,m||o?(m=a.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:m.render(),a.flags|=1,t!==null&&o?(a.child=gi(a,t.child,null,u),a.child=gi(a,null,s,u)):Bt(t,a,s,u),a.memoizedState=m.state,t=a.child):t=sa(t,a,u),t}function sg(t,a,s,o){return ui(),a.flags|=256,Bt(t,a,s,o),a.child}var ad={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function id(t){return{baseLanes:t,cachePool:Zm()}}function sd(t,a,s){return t=t!==null?t.childLanes&~s:0,a&&(t|=cn),t}function rg(t,a,s){var o=a.pendingProps,u=!1,m=(a.flags&128)!==0,y;if((y=m)||(y=t!==null&&t.memoizedState===null?!1:(gt.current&2)!==0),y&&(u=!0,a.flags&=-129),y=(a.flags&32)!==0,a.flags&=-33,t===null){if(Le){if(u?za(a):Ta(),(t=it)?(t=my(t,bn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:wa!==null?{id:In,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},s=Um(t),s.return=a,a.child=s,Rt=a,it=null)):t=null,t===null)throw Na(a);return Id(t)?a.lanes=32:a.lanes=536870912,null}var j=o.children;return o=o.fallback,u?(Ta(),u=a.mode,j=ul({mode:"hidden",children:j},u),o=ci(o,u,s,null),j.return=a,o.return=a,j.sibling=o,a.child=j,o=a.child,o.memoizedState=id(s),o.childLanes=sd(t,y,s),a.memoizedState=ad,Or(null,o)):(za(a),rd(a,j))}var C=t.memoizedState;if(C!==null&&(j=C.dehydrated,j!==null)){if(m)a.flags&256?(za(a),a.flags&=-257,a=od(t,a,s)):a.memoizedState!==null?(Ta(),a.child=t.child,a.flags|=128,a=null):(Ta(),j=o.fallback,u=a.mode,o=ul({mode:"visible",children:o.children},u),j=ci(j,u,s,null),j.flags|=2,o.return=a,j.return=a,o.sibling=j,a.child=o,gi(a,t.child,null,s),o=a.child,o.memoizedState=id(s),o.childLanes=sd(t,y,s),a.memoizedState=ad,a=Or(null,o));else if(za(a),Id(j)){if(y=j.nextSibling&&j.nextSibling.dataset,y)var q=y.dgst;y=q,o=Error(r(419)),o.stack="",o.digest=y,Sr({value:o,source:null,stack:null}),a=od(t,a,s)}else if(jt||rs(t,a,s,!1),y=(s&t.childLanes)!==0,jt||y){if(y=We,y!==null&&(o=rr(y,s),o!==0&&o!==C.retryLane))throw C.retryLane=o,li(t,o),Wt(y,t,o),td;$d(j)||vl(),a=od(t,a,s)}else $d(j)?(a.flags|=192,a.child=t.child,a=null):(t=C.treeContext,it=Sn(j.nextSibling),Rt=a,Le=!0,ja=null,bn=!1,t!==null&&Vm(a,t),a=rd(a,o.children),a.flags|=4096);return a}return u?(Ta(),j=o.fallback,u=a.mode,C=t.child,q=C.sibling,o=Wn(C,{mode:"hidden",children:o.children}),o.subtreeFlags=C.subtreeFlags&65011712,q!==null?j=Wn(q,j):(j=ci(j,u,s,null),j.flags|=2),j.return=a,o.return=a,o.sibling=j,a.child=o,Or(null,o),o=a.child,j=t.child.memoizedState,j===null?j=id(s):(u=j.cachePool,u!==null?(C=xt._currentValue,u=u.parent!==C?{parent:C,pool:C}:u):u=Zm(),j={baseLanes:j.baseLanes|s,cachePool:u}),o.memoizedState=j,o.childLanes=sd(t,y,s),a.memoizedState=ad,Or(t.child,o)):(za(a),s=t.child,t=s.sibling,s=Wn(s,{mode:"visible",children:o.children}),s.return=a,s.sibling=null,t!==null&&(y=a.deletions,y===null?(a.deletions=[t],a.flags|=16):y.push(t)),a.child=s,a.memoizedState=null,s)}function rd(t,a){return a=ul({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function ul(t,a){return t=sn(22,t,null,a),t.lanes=0,t}function od(t,a,s){return gi(a,t.child,null,s),t=rd(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function og(t,a,s){t.lanes|=a;var o=t.alternate;o!==null&&(o.lanes|=a),wu(t.return,a,s)}function ld(t,a,s,o,u,m){var y=t.memoizedState;y===null?t.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:u,treeForkCount:m}:(y.isBackwards=a,y.rendering=null,y.renderingStartTime=0,y.last=o,y.tail=s,y.tailMode=u,y.treeForkCount=m)}function lg(t,a,s){var o=a.pendingProps,u=o.revealOrder,m=o.tail;o=o.children;var y=gt.current,j=(y&2)!==0;if(j?(y=y&1|2,a.flags|=128):y&=1,ue(gt,y),Bt(t,a,o,s),o=Le?vr:0,!j&&t!==null&&(t.flags&128)!==0)e:for(t=a.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&og(t,s,a);else if(t.tag===19)og(t,s,a);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===a)break e;for(;t.sibling===null;){if(t.return===null||t.return===a)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(u){case"forwards":for(s=a.child,u=null;s!==null;)t=s.alternate,t!==null&&Fo(t)===null&&(u=s),s=s.sibling;s=u,s===null?(u=a.child,a.child=null):(u=s.sibling,s.sibling=null),ld(a,!1,u,s,m,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,u=a.child,a.child=null;u!==null;){if(t=u.alternate,t!==null&&Fo(t)===null){a.child=u;break}t=u.sibling,u.sibling=s,s=u,u=t}ld(a,!0,s,null,m,o);break;case"together":ld(a,!1,null,null,void 0,o);break;default:a.memoizedState=null}return a.child}function sa(t,a,s){if(t!==null&&(a.dependencies=t.dependencies),Da|=a.lanes,(s&a.childLanes)===0)if(t!==null){if(rs(t,a,s,!1),(s&a.childLanes)===0)return null}else return null;if(t!==null&&a.child!==t.child)throw Error(r(153));if(a.child!==null){for(t=a.child,s=Wn(t,t.pendingProps),a.child=s,s.return=a;t.sibling!==null;)t=t.sibling,s=s.sibling=Wn(t,t.pendingProps),s.return=a;s.sibling=null}return a.child}function cd(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&Go(t)))}function wx(t,a,s){switch(a.tag){case 3:nt(a,a.stateNode.containerInfo),ka(a,xt,t.memoizedState.cache),ui();break;case 27:case 5:Ue(a);break;case 4:nt(a,a.stateNode.containerInfo);break;case 10:ka(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Ru(a),null;break;case 13:var o=a.memoizedState;if(o!==null)return o.dehydrated!==null?(za(a),a.flags|=128,null):(s&a.child.childLanes)!==0?rg(t,a,s):(za(a),t=sa(t,a,s),t!==null?t.sibling:null);za(a);break;case 19:var u=(t.flags&128)!==0;if(o=(s&a.childLanes)!==0,o||(rs(t,a,s,!1),o=(s&a.childLanes)!==0),u){if(o)return lg(t,a,s);a.flags|=128}if(u=a.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ue(gt,gt.current),o)break;return null;case 22:return a.lanes=0,eg(t,a,s,a.pendingProps);case 24:ka(a,xt,t.memoizedState.cache)}return sa(t,a,s)}function cg(t,a,s){if(t!==null)if(t.memoizedProps!==a.pendingProps)jt=!0;else{if(!cd(t,s)&&(a.flags&128)===0)return jt=!1,wx(t,a,s);jt=(t.flags&131072)!==0}else jt=!1,Le&&(a.flags&1048576)!==0&&Im(a,vr,a.index);switch(a.lanes=0,a.tag){case 16:e:{var o=a.pendingProps;if(t=mi(a.elementType),a.type=t,typeof t=="function")mu(t)?(o=bi(t,o),a.tag=1,a=ig(null,a,t,o,s)):(a.tag=0,a=nd(null,a,t,o,s));else{if(t!=null){var u=t.$$typeof;if(u===Z){a.tag=11,a=Jh(null,a,t,o,s);break e}else if(u===O){a.tag=14,a=Fh(null,a,t,o,s);break e}}throw a=Ke(t)||t,Error(r(306,a,""))}}return a;case 0:return nd(t,a,a.type,a.pendingProps,s);case 1:return o=a.type,u=bi(o,a.pendingProps),ig(t,a,o,u,s);case 3:e:{if(nt(a,a.stateNode.containerInfo),t===null)throw Error(r(387));o=a.pendingProps;var m=a.memoizedState;u=m.element,zu(t,a),_r(a,o,null,s);var y=a.memoizedState;if(o=y.cache,ka(a,xt,o),o!==m.cache&&ju(a,[xt],s,!0),Ar(),o=y.element,m.isDehydrated)if(m={element:o,isDehydrated:!1,cache:y.cache},a.updateQueue.baseState=m,a.memoizedState=m,a.flags&256){a=sg(t,a,o,s);break e}else if(o!==u){u=hn(Error(r(424)),a),Sr(u),a=sg(t,a,o,s);break e}else for(t=a.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,it=Sn(t.firstChild),Rt=a,Le=!0,ja=null,bn=!0,s=eh(a,null,o,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(ui(),o===u){a=sa(t,a,s);break e}Bt(t,a,o,s)}a=a.child}return a;case 26:return cl(t,a),t===null?(s=Sy(a.type,null,a.pendingProps,null))?a.memoizedState=s:Le||(s=a.type,t=a.pendingProps,o=Al(ae.current).createElement(s),o[Dt]=a,o[Kt]=t,Lt(o,s,t),zt(o),a.stateNode=o):a.memoizedState=Sy(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:return Ue(a),t===null&&Le&&(o=a.stateNode=yy(a.type,a.pendingProps,ae.current),Rt=a,bn=!0,u=it,qa(a.type)?(Vd=u,it=Sn(o.firstChild)):it=u),Bt(t,a,a.pendingProps.children,s),cl(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&&Le&&((u=o=it)&&(o=Fx(o,a.type,a.pendingProps,bn),o!==null?(a.stateNode=o,Rt=a,it=Sn(o.firstChild),bn=!1,u=!0):u=!1),u||Na(a)),Ue(a),u=a.type,m=a.pendingProps,y=t!==null?t.memoizedProps:null,o=m.children,Ld(u,m)?o=null:y!==null&&Ld(u,y)&&(a.flags|=32),a.memoizedState!==null&&(u=Bu(t,a,px,null,null,s),Kr._currentValue=u),cl(t,a),Bt(t,a,o,s),a.child;case 6:return t===null&&Le&&((t=s=it)&&(s=Wx(s,a.pendingProps,bn),s!==null?(a.stateNode=s,Rt=a,it=null,t=!0):t=!1),t||Na(a)),null;case 13:return rg(t,a,s);case 4:return nt(a,a.stateNode.containerInfo),o=a.pendingProps,t===null?a.child=gi(a,null,o,s):Bt(t,a,o,s),a.child;case 11:return Jh(t,a,a.type,a.pendingProps,s);case 7:return Bt(t,a,a.pendingProps,s),a.child;case 8:return Bt(t,a,a.pendingProps.children,s),a.child;case 12:return Bt(t,a,a.pendingProps.children,s),a.child;case 10:return o=a.pendingProps,ka(a,a.type,o.value),Bt(t,a,o.children,s),a.child;case 9:return u=a.type._context,o=a.pendingProps.children,fi(a),u=Mt(u),o=o(u),a.flags|=1,Bt(t,a,o,s),a.child;case 14:return Fh(t,a,a.type,a.pendingProps,s);case 15:return Wh(t,a,a.type,a.pendingProps,s);case 19:return lg(t,a,s);case 31:return xx(t,a,s);case 22:return eg(t,a,s,a.pendingProps);case 24:return fi(a),o=Mt(xt),t===null?(u=Au(),u===null&&(u=We,m=Nu(),u.pooledCache=m,m.refCount++,m!==null&&(u.pooledCacheLanes|=s),u=m),a.memoizedState={parent:o,cache:u},Cu(a),ka(a,xt,u)):((t.lanes&s)!==0&&(zu(t,a),_r(a,null,null,s),Ar()),u=t.memoizedState,m=a.memoizedState,u.parent!==o?(u={parent:o,cache:o},a.memoizedState=u,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=u),ka(a,xt,o)):(o=m.cache,ka(a,xt,o),o!==u.cache&&ju(a,[xt],s,!0))),Bt(t,a,a.pendingProps.children,s),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function ra(t){t.flags|=4}function ud(t,a,s,o,u){if((a=(t.mode&32)!==0)&&(a=!1),a){if(t.flags|=16777216,(u&335544128)===u)if(t.stateNode.complete)t.flags|=8192;else if(Bg())t.flags|=8192;else throw hi=Zo,_u}else t.flags&=-16777217}function ug(t,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!ky(a))if(Bg())t.flags|=8192;else throw hi=Zo,_u}function dl(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?ko():536870912,t.lanes|=a,bs|=a)}function Dr(t,a){if(!Le)switch(t.tailMode){case"hidden":a=t.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?a||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function st(t){var a=t.alternate!==null&&t.alternate.child===t.child,s=0,o=0;if(a)for(var u=t.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags&65011712,o|=u.flags&65011712,u.return=t,u=u.sibling;else for(u=t.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=t,u=u.sibling;return t.subtreeFlags|=o,t.childLanes=s,a}function jx(t,a,s){var o=a.pendingProps;switch(bu(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(a),null;case 1:return st(a),null;case 3:return s=a.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),a.memoizedState.cache!==o&&(a.flags|=2048),na(xt),xe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(ss(a)?ra(a):t===null||t.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Su())),st(a),null;case 26:var u=a.type,m=a.memoizedState;return t===null?(ra(a),m!==null?(st(a),ug(a,m)):(st(a),ud(a,u,null,o,s))):m?m!==t.memoizedState?(ra(a),st(a),ug(a,m)):(st(a),a.flags&=-16777217):(t=t.memoizedProps,t!==o&&ra(a),st(a),ud(a,u,t,o,s)),null;case 27:if(Ge(a),s=ae.current,u=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==o&&ra(a);else{if(!o){if(a.stateNode===null)throw Error(r(166));return st(a),null}t=te.current,ss(a)?Pm(a):(t=yy(u,o,s),a.stateNode=t,ra(a))}return st(a),null;case 5:if(Ge(a),u=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==o&&ra(a);else{if(!o){if(a.stateNode===null)throw Error(r(166));return st(a),null}if(m=te.current,ss(a))Pm(a);else{var y=Al(ae.current);switch(m){case 1:m=y.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:m=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":m=y.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":m=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":m=y.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof o.is=="string"?y.createElement("select",{is:o.is}):y.createElement("select"),o.multiple?m.multiple=!0:o.size&&(m.size=o.size);break;default:m=typeof o.is=="string"?y.createElement(u,{is:o.is}):y.createElement(u)}}m[Dt]=a,m[Kt]=o;e:for(y=a.child;y!==null;){if(y.tag===5||y.tag===6)m.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===a)break e;for(;y.sibling===null;){if(y.return===null||y.return===a)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}a.stateNode=m;e:switch(Lt(m,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ra(a)}}return st(a),ud(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,s),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==o&&ra(a);else{if(typeof o!="string"&&a.stateNode===null)throw Error(r(166));if(t=ae.current,ss(a)){if(t=a.stateNode,s=a.memoizedProps,o=null,u=Rt,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}t[Dt]=a,t=!!(t.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||ry(t.nodeValue,s)),t||Na(a,!0)}else t=Al(t).createTextNode(o),t[Dt]=a,a.stateNode=t}return st(a),null;case 31:if(s=a.memoizedState,t===null||t.memoizedState!==null){if(o=ss(a),s!==null){if(t===null){if(!o)throw Error(r(318));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[Dt]=a}else ui(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;st(a),t=!1}else s=Su(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return a.flags&256?(on(a),a):(on(a),null);if((a.flags&128)!==0)throw Error(r(558))}return st(a),null;case 13:if(o=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=ss(a),o!==null&&o.dehydrated!==null){if(t===null){if(!u)throw Error(r(318));if(u=a.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));u[Dt]=a}else ui(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;st(a),u=!1}else u=Su(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return a.flags&256?(on(a),a):(on(a),null)}return on(a),(a.flags&128)!==0?(a.lanes=s,a):(s=o!==null,t=t!==null&&t.memoizedState!==null,s&&(o=a.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),m=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),m!==u&&(o.flags|=2048)),s!==t&&s&&(a.child.flags|=8192),dl(a,a.updateQueue),st(a),null);case 4:return xe(),t===null&&Od(a.stateNode.containerInfo),st(a),null;case 10:return na(a.type),st(a),null;case 19:if(W(gt),o=a.memoizedState,o===null)return st(a),null;if(u=(a.flags&128)!==0,m=o.rendering,m===null)if(u)Dr(o,!1);else{if(mt!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(m=Fo(t),m!==null){for(a.flags|=128,Dr(o,!1),t=m.updateQueue,a.updateQueue=t,dl(a,t),a.subtreeFlags=0,t=s,s=a.child;s!==null;)qm(s,t),s=s.sibling;return ue(gt,gt.current&1|2),Le&&ea(a,o.treeForkCount),a.child}t=t.sibling}o.tail!==null&&Ut()>gl&&(a.flags|=128,u=!0,Dr(o,!1),a.lanes=4194304)}else{if(!u)if(t=Fo(m),t!==null){if(a.flags|=128,u=!0,t=t.updateQueue,a.updateQueue=t,dl(a,t),Dr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!m.alternate&&!Le)return st(a),null}else 2*Ut()-o.renderingStartTime>gl&&s!==536870912&&(a.flags|=128,u=!0,Dr(o,!1),a.lanes=4194304);o.isBackwards?(m.sibling=a.child,a.child=m):(t=o.last,t!==null?t.sibling=m:a.child=m,o.last=m)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ut(),t.sibling=null,s=gt.current,ue(gt,u?s&1|2:s&1),Le&&ea(a,o.treeForkCount),t):(st(a),null);case 22:case 23:return on(a),Du(),o=a.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(a.flags|=8192):o&&(a.flags|=8192),o?(s&536870912)!==0&&(a.flags&128)===0&&(st(a),a.subtreeFlags&6&&(a.flags|=8192)):st(a),s=a.updateQueue,s!==null&&dl(a,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),o=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),o!==s&&(a.flags|=2048),t!==null&&W(pi),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),na(xt),st(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function Nx(t,a){switch(bu(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return na(xt),xe(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return Ge(a),null;case 31:if(a.memoizedState!==null){if(on(a),a.alternate===null)throw Error(r(340));ui()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(on(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(r(340));ui()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return W(gt),null;case 4:return xe(),null;case 10:return na(a.type),null;case 22:case 23:return on(a),Du(),t!==null&&W(pi),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return na(xt),null;case 25:return null;default:return null}}function dg(t,a){switch(bu(a),a.tag){case 3:na(xt),xe();break;case 26:case 27:case 5:Ge(a);break;case 4:xe();break;case 31:a.memoizedState!==null&&on(a);break;case 13:on(a);break;case 19:W(gt);break;case 10:na(a.type);break;case 22:case 23:on(a),Du(),t!==null&&W(pi);break;case 24:na(xt)}}function Rr(t,a){try{var s=a.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var u=o.next;s=u;do{if((s.tag&t)===t){o=void 0;var m=s.create,y=s.inst;o=m(),y.destroy=o}s=s.next}while(s!==u)}}catch(j){Qe(a,a.return,j)}}function Ea(t,a,s){try{var o=a.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var m=u.next;o=m;do{if((o.tag&t)===t){var y=o.inst,j=y.destroy;if(j!==void 0){y.destroy=void 0,u=a;var C=s,q=j;try{q()}catch(P){Qe(u,C,P)}}}o=o.next}while(o!==m)}}catch(P){Qe(a,a.return,P)}}function fg(t){var a=t.updateQueue;if(a!==null){var s=t.stateNode;try{nh(a,s)}catch(o){Qe(t,t.return,o)}}}function pg(t,a,s){s.props=bi(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(o){Qe(t,a,o)}}function Mr(t,a){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof s=="function"?t.refCleanup=s(o):s.current=o}}catch(u){Qe(t,a,u)}}function Pn(t,a){var s=t.ref,o=t.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(u){Qe(t,a,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){Qe(t,a,u)}else s.current=null}function mg(t){var a=t.type,s=t.memoizedProps,o=t.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(u){Qe(t,t.return,u)}}function dd(t,a,s){try{var o=t.stateNode;Qx(o,t.type,s,a),o[Kt]=a}catch(u){Qe(t,t.return,u)}}function hg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&qa(t.type)||t.tag===4}function fd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||hg(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&qa(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function pd(t,a,s){var o=t.tag;if(o===5||o===6)t=t.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(t),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=Jn));else if(o!==4&&(o===27&&qa(t.type)&&(s=t.stateNode,a=null),t=t.child,t!==null))for(pd(t,a,s),t=t.sibling;t!==null;)pd(t,a,s),t=t.sibling}function fl(t,a,s){var o=t.tag;if(o===5||o===6)t=t.stateNode,a?s.insertBefore(t,a):s.appendChild(t);else if(o!==4&&(o===27&&qa(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(fl(t,a,s),t=t.sibling;t!==null;)fl(t,a,s),t=t.sibling}function gg(t){var a=t.stateNode,s=t.memoizedProps;try{for(var o=t.type,u=a.attributes;u.length;)a.removeAttributeNode(u[0]);Lt(a,o,s),a[Dt]=t,a[Kt]=s}catch(m){Qe(t,t.return,m)}}var oa=!1,Nt=!1,md=!1,yg=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function kx(t,a){if(t=t.containerInfo,Md=Dl,t=zm(t),ou(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var u=o.anchorOffset,m=o.focusNode;o=o.focusOffset;try{s.nodeType,m.nodeType}catch{s=null;break e}var y=0,j=-1,C=-1,q=0,P=0,Y=t,$=null;t:for(;;){for(var I;Y!==s||u!==0&&Y.nodeType!==3||(j=y+u),Y!==m||o!==0&&Y.nodeType!==3||(C=y+o),Y.nodeType===3&&(y+=Y.nodeValue.length),(I=Y.firstChild)!==null;)$=Y,Y=I;for(;;){if(Y===t)break t;if($===s&&++q===u&&(j=y),$===m&&++P===o&&(C=y),(I=Y.nextSibling)!==null)break;Y=$,$=Y.parentNode}Y=I}s=j===-1||C===-1?null:{start:j,end:C}}else s=null}s=s||{start:0,end:0}}else s=null;for(Bd={focusedElem:t,selectionRange:s},Dl=!1,Tt=a;Tt!==null;)if(a=Tt,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,Tt=t;else for(;Tt!==null;){switch(a=Tt,m=a.alternate,t=a.flags,a.tag){case 0:if((t&4)!==0&&(t=a.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)u=t[s],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&m!==null){t=void 0,s=a,u=m.memoizedProps,m=m.memoizedState,o=s.stateNode;try{var pe=bi(s.type,u);t=o.getSnapshotBeforeUpdate(pe,m),o.__reactInternalSnapshotBeforeUpdate=t}catch(we){Qe(s,s.return,we)}}break;case 3:if((t&1024)!==0){if(t=a.stateNode.containerInfo,s=t.nodeType,s===9)Ud(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ud(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(r(163))}if(t=a.sibling,t!==null){t.return=a.return,Tt=t;break}Tt=a.return}}function bg(t,a,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:ca(t,s),o&4&&Rr(5,s);break;case 1:if(ca(t,s),o&4)if(t=s.stateNode,a===null)try{t.componentDidMount()}catch(y){Qe(s,s.return,y)}else{var u=bi(s.type,a.memoizedProps);a=a.memoizedState;try{t.componentDidUpdate(u,a,t.__reactInternalSnapshotBeforeUpdate)}catch(y){Qe(s,s.return,y)}}o&64&&fg(s),o&512&&Mr(s,s.return);break;case 3:if(ca(t,s),o&64&&(t=s.updateQueue,t!==null)){if(a=null,s.child!==null)switch(s.child.tag){case 27:case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}try{nh(t,a)}catch(y){Qe(s,s.return,y)}}break;case 27:a===null&&o&4&&gg(s);case 26:case 5:ca(t,s),a===null&&o&4&&mg(s),o&512&&Mr(s,s.return);break;case 12:ca(t,s);break;case 31:ca(t,s),o&4&&xg(t,s);break;case 13:ca(t,s),o&4&&wg(t,s),o&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=Rx.bind(null,s),ew(t,s))));break;case 22:if(o=s.memoizedState!==null||oa,!o){a=a!==null&&a.memoizedState!==null||Nt,u=oa;var m=Nt;oa=o,(Nt=a)&&!m?ua(t,s,(s.subtreeFlags&8772)!==0):ca(t,s),oa=u,Nt=m}break;case 30:break;default:ca(t,s)}}function vg(t){var a=t.alternate;a!==null&&(t.alternate=null,vg(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&Gc(a)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var ot=null,Yt=!1;function la(t,a,s){for(s=s.child;s!==null;)Sg(t,a,s),s=s.sibling}function Sg(t,a,s){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(va,s)}catch{}switch(s.tag){case 26:Nt||Pn(s,a),la(t,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Nt||Pn(s,a);var o=ot,u=Yt;qa(s.type)&&(ot=s.stateNode,Yt=!1),la(t,a,s),Gr(s.stateNode),ot=o,Yt=u;break;case 5:Nt||Pn(s,a);case 6:if(o=ot,u=Yt,ot=null,la(t,a,s),ot=o,Yt=u,ot!==null)if(Yt)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(s.stateNode)}catch(m){Qe(s,a,m)}else try{ot.removeChild(s.stateNode)}catch(m){Qe(s,a,m)}break;case 18:ot!==null&&(Yt?(t=ot,fy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),As(t)):fy(ot,s.stateNode));break;case 4:o=ot,u=Yt,ot=s.stateNode.containerInfo,Yt=!0,la(t,a,s),ot=o,Yt=u;break;case 0:case 11:case 14:case 15:Ea(2,s,a),Nt||Ea(4,s,a),la(t,a,s);break;case 1:Nt||(Pn(s,a),o=s.stateNode,typeof o.componentWillUnmount=="function"&&pg(s,a,o)),la(t,a,s);break;case 21:la(t,a,s);break;case 22:Nt=(o=Nt)||s.memoizedState!==null,la(t,a,s),Nt=o;break;default:la(t,a,s)}}function xg(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{As(t)}catch(s){Qe(a,a.return,s)}}}function wg(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{As(t)}catch(s){Qe(a,a.return,s)}}function Ax(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new yg),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new yg),a;default:throw Error(r(435,t.tag))}}function pl(t,a){var s=Ax(t);a.forEach(function(o){if(!s.has(o)){s.add(o);var u=Mx.bind(null,t,o);o.then(u,u)}})}function Xt(t,a){var s=a.deletions;if(s!==null)for(var o=0;o<s.length;o++){var u=s[o],m=t,y=a,j=y;e:for(;j!==null;){switch(j.tag){case 27:if(qa(j.type)){ot=j.stateNode,Yt=!1;break e}break;case 5:ot=j.stateNode,Yt=!1;break e;case 3:case 4:ot=j.stateNode.containerInfo,Yt=!0;break e}j=j.return}if(ot===null)throw Error(r(160));Sg(m,y,u),ot=null,Yt=!1,m=u.alternate,m!==null&&(m.return=null),u.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)jg(a,t),a=a.sibling}var Dn=null;function jg(t,a){var s=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Xt(a,t),Jt(t),o&4&&(Ea(3,t,t.return),Rr(3,t),Ea(5,t,t.return));break;case 1:Xt(a,t),Jt(t),o&512&&(Nt||s===null||Pn(s,s.return)),o&64&&oa&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var u=Dn;if(Xt(a,t),Jt(t),o&512&&(Nt||s===null||Pn(s,s.return)),o&4){var m=s!==null?s.memoizedState:null;if(o=t.memoizedState,s===null)if(o===null)if(t.stateNode===null){e:{o=t.type,s=t.memoizedProps,u=u.ownerDocument||u;t:switch(o){case"title":m=u.getElementsByTagName("title")[0],(!m||m[lr]||m[Dt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=u.createElement(o),u.head.insertBefore(m,u.querySelector("head > title"))),Lt(m,o,s),m[Dt]=t,zt(m),o=m;break e;case"link":var y=jy("link","href",u).get(o+(s.href||""));if(y){for(var j=0;j<y.length;j++)if(m=y[j],m.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&m.getAttribute("rel")===(s.rel==null?null:s.rel)&&m.getAttribute("title")===(s.title==null?null:s.title)&&m.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){y.splice(j,1);break t}}m=u.createElement(o),Lt(m,o,s),u.head.appendChild(m);break;case"meta":if(y=jy("meta","content",u).get(o+(s.content||""))){for(j=0;j<y.length;j++)if(m=y[j],m.getAttribute("content")===(s.content==null?null:""+s.content)&&m.getAttribute("name")===(s.name==null?null:s.name)&&m.getAttribute("property")===(s.property==null?null:s.property)&&m.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&m.getAttribute("charset")===(s.charSet==null?null:s.charSet)){y.splice(j,1);break t}}m=u.createElement(o),Lt(m,o,s),u.head.appendChild(m);break;default:throw Error(r(468,o))}m[Dt]=t,zt(m),o=m}t.stateNode=o}else Ny(u,t.type,t.stateNode);else t.stateNode=wy(u,o,t.memoizedProps);else m!==o?(m===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):m.count--,o===null?Ny(u,t.type,t.stateNode):wy(u,o,t.memoizedProps)):o===null&&t.stateNode!==null&&dd(t,t.memoizedProps,s.memoizedProps)}break;case 27:Xt(a,t),Jt(t),o&512&&(Nt||s===null||Pn(s,s.return)),s!==null&&o&4&&dd(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Xt(a,t),Jt(t),o&512&&(Nt||s===null||Pn(s,s.return)),t.flags&32){u=t.stateNode;try{Yi(u,"")}catch(pe){Qe(t,t.return,pe)}}o&4&&t.stateNode!=null&&(u=t.memoizedProps,dd(t,u,s!==null?s.memoizedProps:u)),o&1024&&(md=!0);break;case 6:if(Xt(a,t),Jt(t),o&4){if(t.stateNode===null)throw Error(r(162));o=t.memoizedProps,s=t.stateNode;try{s.nodeValue=o}catch(pe){Qe(t,t.return,pe)}}break;case 3:if(zl=null,u=Dn,Dn=_l(a.containerInfo),Xt(a,t),Dn=u,Jt(t),o&4&&s!==null&&s.memoizedState.isDehydrated)try{As(a.containerInfo)}catch(pe){Qe(t,t.return,pe)}md&&(md=!1,Ng(t));break;case 4:o=Dn,Dn=_l(t.stateNode.containerInfo),Xt(a,t),Jt(t),Dn=o;break;case 12:Xt(a,t),Jt(t);break;case 31:Xt(a,t),Jt(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,pl(t,o)));break;case 13:Xt(a,t),Jt(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(hl=Ut()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,pl(t,o)));break;case 22:u=t.memoizedState!==null;var C=s!==null&&s.memoizedState!==null,q=oa,P=Nt;if(oa=q||u,Nt=P||C,Xt(a,t),Nt=P,oa=q,Jt(t),o&8192)e:for(a=t.stateNode,a._visibility=u?a._visibility&-2:a._visibility|1,u&&(s===null||C||oa||Nt||vi(t)),s=null,a=t;;){if(a.tag===5||a.tag===26){if(s===null){C=s=a;try{if(m=C.stateNode,u)y=m.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{j=C.stateNode;var Y=C.memoizedProps.style,$=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;j.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(pe){Qe(C,C.return,pe)}}}else if(a.tag===6){if(s===null){C=a;try{C.stateNode.nodeValue=u?"":C.memoizedProps}catch(pe){Qe(C,C.return,pe)}}}else if(a.tag===18){if(s===null){C=a;try{var I=C.stateNode;u?py(I,!0):py(C.stateNode,!1)}catch(pe){Qe(C,C.return,pe)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===t)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;s===a&&(s=null),a=a.return}s===a&&(s=null),a.sibling.return=a.return,a=a.sibling}o&4&&(o=t.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,pl(t,s))));break;case 19:Xt(a,t),Jt(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,pl(t,o)));break;case 30:break;case 21:break;default:Xt(a,t),Jt(t)}}function Jt(t){var a=t.flags;if(a&2){try{for(var s,o=t.return;o!==null;){if(hg(o)){s=o;break}o=o.return}if(s==null)throw Error(r(160));switch(s.tag){case 27:var u=s.stateNode,m=fd(t);fl(t,m,u);break;case 5:var y=s.stateNode;s.flags&32&&(Yi(y,""),s.flags&=-33);var j=fd(t);fl(t,j,y);break;case 3:case 4:var C=s.stateNode.containerInfo,q=fd(t);pd(t,q,C);break;default:throw Error(r(161))}}catch(P){Qe(t,t.return,P)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function Ng(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;Ng(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),t=t.sibling}}function ca(t,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)bg(t,a.alternate,a),a=a.sibling}function vi(t){for(t=t.child;t!==null;){var a=t;switch(a.tag){case 0:case 11:case 14:case 15:Ea(4,a,a.return),vi(a);break;case 1:Pn(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&pg(a,a.return,s),vi(a);break;case 27:Gr(a.stateNode);case 26:case 5:Pn(a,a.return),vi(a);break;case 22:a.memoizedState===null&&vi(a);break;case 30:vi(a);break;default:vi(a)}t=t.sibling}}function ua(t,a,s){for(s=s&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var o=a.alternate,u=t,m=a,y=m.flags;switch(m.tag){case 0:case 11:case 15:ua(u,m,s),Rr(4,m);break;case 1:if(ua(u,m,s),o=m,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(q){Qe(o,o.return,q)}if(o=m,u=o.updateQueue,u!==null){var j=o.stateNode;try{var C=u.shared.hiddenCallbacks;if(C!==null)for(u.shared.hiddenCallbacks=null,u=0;u<C.length;u++)th(C[u],j)}catch(q){Qe(o,o.return,q)}}s&&y&64&&fg(m),Mr(m,m.return);break;case 27:gg(m);case 26:case 5:ua(u,m,s),s&&o===null&&y&4&&mg(m),Mr(m,m.return);break;case 12:ua(u,m,s);break;case 31:ua(u,m,s),s&&y&4&&xg(u,m);break;case 13:ua(u,m,s),s&&y&4&&wg(u,m);break;case 22:m.memoizedState===null&&ua(u,m,s),Mr(m,m.return);break;case 30:break;default:ua(u,m,s)}a=a.sibling}}function hd(t,a){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(t=a.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&xr(s))}function gd(t,a){t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&xr(t))}function Rn(t,a,s,o){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)kg(t,a,s,o),a=a.sibling}function kg(t,a,s,o){var u=a.flags;switch(a.tag){case 0:case 11:case 15:Rn(t,a,s,o),u&2048&&Rr(9,a);break;case 1:Rn(t,a,s,o);break;case 3:Rn(t,a,s,o),u&2048&&(t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&xr(t)));break;case 12:if(u&2048){Rn(t,a,s,o),t=a.stateNode;try{var m=a.memoizedProps,y=m.id,j=m.onPostCommit;typeof j=="function"&&j(y,a.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(C){Qe(a,a.return,C)}}else Rn(t,a,s,o);break;case 31:Rn(t,a,s,o);break;case 13:Rn(t,a,s,o);break;case 23:break;case 22:m=a.stateNode,y=a.alternate,a.memoizedState!==null?m._visibility&2?Rn(t,a,s,o):Br(t,a):m._visibility&2?Rn(t,a,s,o):(m._visibility|=2,hs(t,a,s,o,(a.subtreeFlags&10256)!==0||!1)),u&2048&&hd(y,a);break;case 24:Rn(t,a,s,o),u&2048&&gd(a.alternate,a);break;default:Rn(t,a,s,o)}}function hs(t,a,s,o,u){for(u=u&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var m=t,y=a,j=s,C=o,q=y.flags;switch(y.tag){case 0:case 11:case 15:hs(m,y,j,C,u),Rr(8,y);break;case 23:break;case 22:var P=y.stateNode;y.memoizedState!==null?P._visibility&2?hs(m,y,j,C,u):Br(m,y):(P._visibility|=2,hs(m,y,j,C,u)),u&&q&2048&&hd(y.alternate,y);break;case 24:hs(m,y,j,C,u),u&&q&2048&&gd(y.alternate,y);break;default:hs(m,y,j,C,u)}a=a.sibling}}function Br(t,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var s=t,o=a,u=o.flags;switch(o.tag){case 22:Br(s,o),u&2048&&hd(o.alternate,o);break;case 24:Br(s,o),u&2048&&gd(o.alternate,o);break;default:Br(s,o)}a=a.sibling}}var Lr=8192;function gs(t,a,s){if(t.subtreeFlags&Lr)for(t=t.child;t!==null;)Ag(t,a,s),t=t.sibling}function Ag(t,a,s){switch(t.tag){case 26:gs(t,a,s),t.flags&Lr&&t.memoizedState!==null&&fw(s,Dn,t.memoizedState,t.memoizedProps);break;case 5:gs(t,a,s);break;case 3:case 4:var o=Dn;Dn=_l(t.stateNode.containerInfo),gs(t,a,s),Dn=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Lr,Lr=16777216,gs(t,a,s),Lr=o):gs(t,a,s));break;default:gs(t,a,s)}}function _g(t){var a=t.alternate;if(a!==null&&(t=a.child,t!==null)){a.child=null;do a=t.sibling,t.sibling=null,t=a;while(t!==null)}}function qr(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var o=a[s];Tt=o,zg(o,t)}_g(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Cg(t),t=t.sibling}function Cg(t){switch(t.tag){case 0:case 11:case 15:qr(t),t.flags&2048&&Ea(9,t,t.return);break;case 3:qr(t);break;case 12:qr(t);break;case 22:var a=t.stateNode;t.memoizedState!==null&&a._visibility&2&&(t.return===null||t.return.tag!==13)?(a._visibility&=-3,ml(t)):qr(t);break;default:qr(t)}}function ml(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var o=a[s];Tt=o,zg(o,t)}_g(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:Ea(8,a,a.return),ml(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,ml(a));break;default:ml(a)}t=t.sibling}}function zg(t,a){for(;Tt!==null;){var s=Tt;switch(s.tag){case 0:case 11:case 15:Ea(8,s,a);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:xr(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,Tt=o;else e:for(s=t;Tt!==null;){o=Tt;var u=o.sibling,m=o.return;if(vg(o),o===s){Tt=null;break e}if(u!==null){u.return=m,Tt=u;break e}Tt=m}}}var _x={getCacheForType:function(t){var a=Mt(xt),s=a.data.get(t);return s===void 0&&(s=t(),a.data.set(t,s)),s},cacheSignal:function(){return Mt(xt).controller.signal}},Cx=typeof WeakMap=="function"?WeakMap:Map,Ve=0,We=null,De=null,Me=0,He=0,ln=null,Oa=!1,ys=!1,yd=!1,da=0,mt=0,Da=0,Si=0,bd=0,cn=0,bs=0,Ur=null,Ft=null,vd=!1,hl=0,Tg=0,gl=1/0,yl=null,Ra=null,At=0,Ma=null,vs=null,fa=0,Sd=0,xd=null,Eg=null,$r=0,wd=null;function un(){return(Ve&2)!==0&&Me!==0?Me&-Me:B.T!==null?Cd():Kp()}function Og(){if(cn===0)if((Me&536870912)===0||Le){var t=$i;$i<<=1,($i&3932160)===0&&($i=262144),cn=t}else cn=536870912;return t=rn.current,t!==null&&(t.flags|=32),cn}function Wt(t,a,s){(t===We&&(He===2||He===9)||t.cancelPendingCommit!==null)&&(Ss(t,0),Ba(t,Me,cn,!1)),Fe(t,s),((Ve&2)===0||t!==We)&&(t===We&&((Ve&2)===0&&(Si|=s),mt===4&&Ba(t,Me,cn,!1)),Gn(t))}function Dg(t,a,s){if((Ve&6)!==0)throw Error(r(327));var o=!s&&(a&127)===0&&(a&t.expiredLanes)===0||ni(t,a),u=o?Ex(t,a):Nd(t,a,!0),m=o;do{if(u===0){ys&&!o&&Ba(t,a,0,!1);break}else{if(s=t.current.alternate,m&&!zx(s)){u=Nd(t,a,!1),m=!1;continue}if(u===2){if(m=a,t.errorRecoveryDisabledLanes&m)var y=0;else y=t.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){a=y;e:{var j=t;u=Ur;var C=j.current.memoizedState.isDehydrated;if(C&&(Ss(j,y).flags|=256),y=Nd(j,y,!1),y!==2){if(yd&&!C){j.errorRecoveryDisabledLanes|=m,Si|=m,u=4;break e}m=Ft,Ft=u,m!==null&&(Ft===null?Ft=m:Ft.push.apply(Ft,m))}u=y}if(m=!1,u!==2)continue}}if(u===1){Ss(t,0),Ba(t,a,0,!0);break}e:{switch(o=t,m=u,m){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:Ba(o,a,cn,!Oa);break e;case 2:Ft=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(u=hl+300-Ut(),10<u)){if(Ba(o,a,cn,!Oa),Vi(o,0,!0)!==0)break e;fa=a,o.timeoutHandle=uy(Rg.bind(null,o,s,Ft,yl,vd,a,cn,Si,bs,Oa,m,"Throttled",-0,0),u);break e}Rg(o,s,Ft,yl,vd,a,cn,Si,bs,Oa,m,null,-0,0)}}break}while(!0);Gn(t)}function Rg(t,a,s,o,u,m,y,j,C,q,P,Y,$,I){if(t.timeoutHandle=-1,Y=a.subtreeFlags,Y&8192||(Y&16785408)===16785408){Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jn},Ag(a,m,Y);var pe=(m&62914560)===m?hl-Ut():(m&4194048)===m?Tg-Ut():0;if(pe=pw(Y,pe),pe!==null){fa=m,t.cancelPendingCommit=pe(Vg.bind(null,t,a,m,s,o,u,y,j,C,P,Y,null,$,I)),Ba(t,m,y,!q);return}}Vg(t,a,m,s,o,u,y,j,C)}function zx(t){for(var a=t;;){var s=a.tag;if((s===0||s===11||s===15)&&a.flags&16384&&(s=a.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var u=s[o],m=u.getSnapshot;u=u.value;try{if(!an(m(),u))return!1}catch{return!1}}if(s=a.child,a.subtreeFlags&16384&&s!==null)s.return=a,a=s;else{if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Ba(t,a,s,o){a&=~bd,a&=~Si,t.suspendedLanes|=a,t.pingedLanes&=~a,o&&(t.warmLanes|=a),o=t.expirationTimes;for(var u=a;0<u;){var m=31-ht(u),y=1<<m;o[m]=-1,u&=~y}s!==0&&Ao(t,s,a)}function bl(){return(Ve&6)===0?(Ir(0),!1):!0}function jd(){if(De!==null){if(He===0)var t=De.return;else t=De,ta=di=null,Uu(t),us=null,jr=0,t=De;for(;t!==null;)dg(t.alternate,t),t=t.return;De=null}}function Ss(t,a){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,Yx(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),fa=0,jd(),We=t,De=s=Wn(t.current,null),Me=a,He=0,ln=null,Oa=!1,ys=ni(t,a),yd=!1,bs=cn=bd=Si=Da=mt=0,Ft=Ur=null,vd=!1,(a&8)!==0&&(a|=a&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=a;0<o;){var u=31-ht(o),m=1<<u;a|=t[u],o&=~m}return da=a,Uo(),s}function Mg(t,a){ze=null,B.H=Er,a===cs||a===Ko?(a=Jm(),He=3):a===_u?(a=Jm(),He=4):He=a===td?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,ln=a,De===null&&(mt=1,ol(t,hn(a,t.current)))}function Bg(){var t=rn.current;return t===null?!0:(Me&4194048)===Me?vn===null:(Me&62914560)===Me||(Me&536870912)!==0?t===vn:!1}function Lg(){var t=B.H;return B.H=Er,t===null?Er:t}function qg(){var t=B.A;return B.A=_x,t}function vl(){mt=4,Oa||(Me&4194048)!==Me&&rn.current!==null||(ys=!0),(Da&134217727)===0&&(Si&134217727)===0||We===null||Ba(We,Me,cn,!1)}function Nd(t,a,s){var o=Ve;Ve|=2;var u=Lg(),m=qg();(We!==t||Me!==a)&&(yl=null,Ss(t,a)),a=!1;var y=mt;e:do try{if(He!==0&&De!==null){var j=De,C=ln;switch(He){case 8:jd(),y=6;break e;case 3:case 2:case 9:case 6:rn.current===null&&(a=!0);var q=He;if(He=0,ln=null,xs(t,j,C,q),s&&ys){y=0;break e}break;default:q=He,He=0,ln=null,xs(t,j,C,q)}}Tx(),y=mt;break}catch(P){Mg(t,P)}while(!0);return a&&t.shellSuspendCounter++,ta=di=null,Ve=o,B.H=u,B.A=m,De===null&&(We=null,Me=0,Uo()),y}function Tx(){for(;De!==null;)Ug(De)}function Ex(t,a){var s=Ve;Ve|=2;var o=Lg(),u=qg();We!==t||Me!==a?(yl=null,gl=Ut()+500,Ss(t,a)):ys=ni(t,a);e:do try{if(He!==0&&De!==null){a=De;var m=ln;t:switch(He){case 1:He=0,ln=null,xs(t,a,m,1);break;case 2:case 9:if(Ym(m)){He=0,ln=null,$g(a);break}a=function(){He!==2&&He!==9||We!==t||(He=7),Gn(t)},m.then(a,a);break e;case 3:He=7;break e;case 4:He=5;break e;case 7:Ym(m)?(He=0,ln=null,$g(a)):(He=0,ln=null,xs(t,a,m,7));break;case 5:var y=null;switch(De.tag){case 26:y=De.memoizedState;case 5:case 27:var j=De;if(y?ky(y):j.stateNode.complete){He=0,ln=null;var C=j.sibling;if(C!==null)De=C;else{var q=j.return;q!==null?(De=q,Sl(q)):De=null}break t}}He=0,ln=null,xs(t,a,m,5);break;case 6:He=0,ln=null,xs(t,a,m,6);break;case 8:jd(),mt=6;break e;default:throw Error(r(462))}}Ox();break}catch(P){Mg(t,P)}while(!0);return ta=di=null,B.H=o,B.A=u,Ve=s,De!==null?0:(We=null,Me=0,Uo(),mt)}function Ox(){for(;De!==null&&!xo();)Ug(De)}function Ug(t){var a=cg(t.alternate,t,da);t.memoizedProps=t.pendingProps,a===null?Sl(t):De=a}function $g(t){var a=t,s=a.alternate;switch(a.tag){case 15:case 0:a=ag(s,a,a.pendingProps,a.type,void 0,Me);break;case 11:a=ag(s,a,a.pendingProps,a.type.render,a.ref,Me);break;case 5:Uu(a);default:dg(s,a),a=De=qm(a,da),a=cg(s,a,da)}t.memoizedProps=t.pendingProps,a===null?Sl(t):De=a}function xs(t,a,s,o){ta=di=null,Uu(a),us=null,jr=0;var u=a.return;try{if(Sx(t,u,a,s,Me)){mt=1,ol(t,hn(s,t.current)),De=null;return}}catch(m){if(u!==null)throw De=u,m;mt=1,ol(t,hn(s,t.current)),De=null;return}a.flags&32768?(Le||o===1?t=!0:ys||(Me&536870912)!==0?t=!1:(Oa=t=!0,(o===2||o===9||o===3||o===6)&&(o=rn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Ig(a,t)):Sl(a)}function Sl(t){var a=t;do{if((a.flags&32768)!==0){Ig(a,Oa);return}t=a.return;var s=jx(a.alternate,a,da);if(s!==null){De=s;return}if(a=a.sibling,a!==null){De=a;return}De=a=t}while(a!==null);mt===0&&(mt=5)}function Ig(t,a){do{var s=Nx(t.alternate,t);if(s!==null){s.flags&=32767,De=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(t=t.sibling,t!==null)){De=t;return}De=t=s}while(t!==null);mt=6,De=null}function Vg(t,a,s,o,u,m,y,j,C){t.cancelPendingCommit=null;do xl();while(At!==0);if((Ve&6)!==0)throw Error(r(327));if(a!==null){if(a===t.current)throw Error(r(177));if(m=a.lanes|a.childLanes,m|=fu,ai(t,s,m,y,j,C),t===We&&(De=We=null,Me=0),vs=a,Ma=t,fa=s,Sd=m,xd=u,Eg=o,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Bx(Li,function(){return Kg(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||o){o=B.T,B.T=null,u=J.p,J.p=2,y=Ve,Ve|=4;try{kx(t,a,s)}finally{Ve=y,J.p=u,B.T=o}}At=1,Pg(),Gg(),Hg()}}function Pg(){if(At===1){At=0;var t=Ma,a=vs,s=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||s){s=B.T,B.T=null;var o=J.p;J.p=2;var u=Ve;Ve|=4;try{jg(a,t);var m=Bd,y=zm(t.containerInfo),j=m.focusedElem,C=m.selectionRange;if(y!==j&&j&&j.ownerDocument&&Cm(j.ownerDocument.documentElement,j)){if(C!==null&&ou(j)){var q=C.start,P=C.end;if(P===void 0&&(P=q),"selectionStart"in j)j.selectionStart=q,j.selectionEnd=Math.min(P,j.value.length);else{var Y=j.ownerDocument||document,$=Y&&Y.defaultView||window;if($.getSelection){var I=$.getSelection(),pe=j.textContent.length,we=Math.min(C.start,pe),Je=C.end===void 0?we:Math.min(C.end,pe);!I.extend&&we>Je&&(y=Je,Je=we,we=y);var D=_m(j,we),z=_m(j,Je);if(D&&z&&(I.rangeCount!==1||I.anchorNode!==D.node||I.anchorOffset!==D.offset||I.focusNode!==z.node||I.focusOffset!==z.offset)){var L=Y.createRange();L.setStart(D.node,D.offset),I.removeAllRanges(),we>Je?(I.addRange(L),I.extend(z.node,z.offset)):(L.setEnd(z.node,z.offset),I.addRange(L))}}}}for(Y=[],I=j;I=I.parentNode;)I.nodeType===1&&Y.push({element:I,left:I.scrollLeft,top:I.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<Y.length;j++){var K=Y[j];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}Dl=!!Md,Bd=Md=null}finally{Ve=u,J.p=o,B.T=s}}t.current=a,At=2}}function Gg(){if(At===2){At=0;var t=Ma,a=vs,s=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||s){s=B.T,B.T=null;var o=J.p;J.p=2;var u=Ve;Ve|=4;try{bg(t,a.alternate,a)}finally{Ve=u,J.p=o,B.T=s}}At=3}}function Hg(){if(At===4||At===3){At=0,$c();var t=Ma,a=vs,s=fa,o=Eg;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?At=5:(At=0,vs=Ma=null,Qg(t,t.pendingLanes));var u=t.pendingLanes;if(u===0&&(Ra=null),En(s),a=a.stateNode,$t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(va,a,void 0,(a.current.flags&128)===128)}catch{}if(o!==null){a=B.T,u=J.p,J.p=2,B.T=null;try{for(var m=t.onRecoverableError,y=0;y<o.length;y++){var j=o[y];m(j.value,{componentStack:j.stack})}}finally{B.T=a,J.p=u}}(fa&3)!==0&&xl(),Gn(t),u=t.pendingLanes,(s&261930)!==0&&(u&42)!==0?t===wd?$r++:($r=0,wd=t):$r=0,Ir(0)}}function Qg(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,xr(a)))}function xl(){return Pg(),Gg(),Hg(),Kg()}function Kg(){if(At!==5)return!1;var t=Ma,a=Sd;Sd=0;var s=En(fa),o=B.T,u=J.p;try{J.p=32>s?32:s,B.T=null,s=xd,xd=null;var m=Ma,y=fa;if(At=0,vs=Ma=null,fa=0,(Ve&6)!==0)throw Error(r(331));var j=Ve;if(Ve|=4,Cg(m.current),kg(m,m.current,y,s),Ve=j,Ir(0,!1),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(va,m)}catch{}return!0}finally{J.p=u,B.T=o,Qg(t,a)}}function Zg(t,a,s){a=hn(s,a),a=ed(t.stateNode,a,2),t=Ca(t,a,2),t!==null&&(Fe(t,2),Gn(t))}function Qe(t,a,s){if(t.tag===3)Zg(t,t,s);else for(;a!==null;){if(a.tag===3){Zg(a,t,s);break}else if(a.tag===1){var o=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ra===null||!Ra.has(o))){t=hn(s,t),s=Yh(2),o=Ca(a,s,2),o!==null&&(Xh(s,o,a,t),Fe(o,2),Gn(o));break}}a=a.return}}function kd(t,a,s){var o=t.pingCache;if(o===null){o=t.pingCache=new Cx;var u=new Set;o.set(a,u)}else u=o.get(a),u===void 0&&(u=new Set,o.set(a,u));u.has(s)||(yd=!0,u.add(s),t=Dx.bind(null,t,a,s),a.then(t,t))}function Dx(t,a,s){var o=t.pingCache;o!==null&&o.delete(a),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,We===t&&(Me&s)===s&&(mt===4||mt===3&&(Me&62914560)===Me&&300>Ut()-hl?(Ve&2)===0&&Ss(t,0):bd|=s,bs===Me&&(bs=0)),Gn(t)}function Yg(t,a){a===0&&(a=ko()),t=li(t,a),t!==null&&(Fe(t,a),Gn(t))}function Rx(t){var a=t.memoizedState,s=0;a!==null&&(s=a.retryLane),Yg(t,s)}function Mx(t,a){var s=0;switch(t.tag){case 31:case 13:var o=t.stateNode,u=t.memoizedState;u!==null&&(s=u.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(r(314))}o!==null&&o.delete(a),Yg(t,s)}function Bx(t,a){return Mi(t,a)}var wl=null,ws=null,Ad=!1,jl=!1,_d=!1,La=0;function Gn(t){t!==ws&&t.next===null&&(ws===null?wl=ws=t:ws=ws.next=t),jl=!0,Ad||(Ad=!0,qx())}function Ir(t,a){if(!_d&&jl){_d=!0;do for(var s=!1,o=wl;o!==null;){if(t!==0){var u=o.pendingLanes;if(u===0)var m=0;else{var y=o.suspendedLanes,j=o.pingedLanes;m=(1<<31-ht(42|t)+1)-1,m&=u&~(y&~j),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(s=!0,Wg(o,m))}else m=Me,m=Vi(o,o===We?m:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(m&3)===0||ni(o,m)||(s=!0,Wg(o,m));o=o.next}while(s);_d=!1}}function Lx(){Xg()}function Xg(){jl=Ad=!1;var t=0;La!==0&&Zx()&&(t=La);for(var a=Ut(),s=null,o=wl;o!==null;){var u=o.next,m=Jg(o,a);m===0?(o.next=null,s===null?wl=u:s.next=u,u===null&&(ws=s)):(s=o,(t!==0||(m&3)!==0)&&(jl=!0)),o=u}At!==0&&At!==5||Ir(t),La!==0&&(La=0)}function Jg(t,a){for(var s=t.suspendedLanes,o=t.pingedLanes,u=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var y=31-ht(m),j=1<<y,C=u[y];C===-1?((j&s)===0||(j&o)!==0)&&(u[y]=Yn(j,a)):C<=a&&(t.expiredLanes|=j),m&=~j}if(a=We,s=Me,s=Vi(t,t===a?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,s===0||t===a&&(He===2||He===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&Bi(o),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||ni(t,s)){if(a=s&-s,a===t.callbackPriority)return a;switch(o!==null&&Bi(o),En(s)){case 2:case 8:s=jo;break;case 32:s=Li;break;case 268435456:s=qi;break;default:s=Li}return o=Fg.bind(null,t),s=Mi(s,o),t.callbackPriority=a,t.callbackNode=s,a}return o!==null&&o!==null&&Bi(o),t.callbackPriority=2,t.callbackNode=null,2}function Fg(t,a){if(At!==0&&At!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(xl()&&t.callbackNode!==s)return null;var o=Me;return o=Vi(t,t===We?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(Dg(t,o,a),Jg(t,Ut()),t.callbackNode!=null&&t.callbackNode===s?Fg.bind(null,t):null)}function Wg(t,a){if(xl())return null;Dg(t,a,!0)}function qx(){Xx(function(){(Ve&6)!==0?Mi(ir,Lx):Xg()})}function Cd(){if(La===0){var t=os;t===0&&(t=Ui,Ui<<=1,(Ui&261888)===0&&(Ui=256)),La=t}return La}function ey(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Eo(""+t)}function ty(t,a){var s=a.ownerDocument.createElement("input");return s.name=a.name,s.value=a.value,t.id&&s.setAttribute("form",t.id),a.parentNode.insertBefore(s,a),t=new FormData(t),s.parentNode.removeChild(s),t}function Ux(t,a,s,o,u){if(a==="submit"&&s&&s.stateNode===u){var m=ey((u[Kt]||null).action),y=o.submitter;y&&(a=(a=y[Kt]||null)?ey(a.formAction):y.getAttribute("formAction"),a!==null&&(m=a,y=null));var j=new Mo("action","action",null,o,u);t.push({event:j,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(La!==0){var C=y?ty(u,y):new FormData(u);Zu(s,{pending:!0,data:C,method:u.method,action:m},null,C)}}else typeof m=="function"&&(j.preventDefault(),C=y?ty(u,y):new FormData(u),Zu(s,{pending:!0,data:C,method:u.method,action:m},m,C))},currentTarget:u}]})}}for(var zd=0;zd<du.length;zd++){var Td=du[zd],$x=Td.toLowerCase(),Ix=Td[0].toUpperCase()+Td.slice(1);On($x,"on"+Ix)}On(Om,"onAnimationEnd"),On(Dm,"onAnimationIteration"),On(Rm,"onAnimationStart"),On("dblclick","onDoubleClick"),On("focusin","onFocus"),On("focusout","onBlur"),On(ax,"onTransitionRun"),On(ix,"onTransitionStart"),On(sx,"onTransitionCancel"),On(Mm,"onTransitionEnd"),Ki("onMouseEnter",["mouseout","mouseover"]),Ki("onMouseLeave",["mouseout","mouseover"]),Ki("onPointerEnter",["pointerout","pointerover"]),Ki("onPointerLeave",["pointerout","pointerover"]),ii("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ii("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ii("onBeforeInput",["compositionend","keypress","textInput","paste"]),ii("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vr="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(" "),Vx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Vr));function ny(t,a){a=(a&4)!==0;for(var s=0;s<t.length;s++){var o=t[s],u=o.event;o=o.listeners;e:{var m=void 0;if(a)for(var y=o.length-1;0<=y;y--){var j=o[y],C=j.instance,q=j.currentTarget;if(j=j.listener,C!==m&&u.isPropagationStopped())break e;m=j,u.currentTarget=q;try{m(u)}catch(P){qo(P)}u.currentTarget=null,m=C}else for(y=0;y<o.length;y++){if(j=o[y],C=j.instance,q=j.currentTarget,j=j.listener,C!==m&&u.isPropagationStopped())break e;m=j,u.currentTarget=q;try{m(u)}catch(P){qo(P)}u.currentTarget=null,m=C}}}}function Re(t,a){var s=a[Pc];s===void 0&&(s=a[Pc]=new Set);var o=t+"__bubble";s.has(o)||(ay(a,t,2,!1),s.add(o))}function Ed(t,a,s){var o=0;a&&(o|=4),ay(s,t,o,a)}var Nl="_reactListening"+Math.random().toString(36).slice(2);function Od(t){if(!t[Nl]){t[Nl]=!0,Xp.forEach(function(s){s!=="selectionchange"&&(Vx.has(s)||Ed(s,!1,t),Ed(s,!0,t))});var a=t.nodeType===9?t:t.ownerDocument;a===null||a[Nl]||(a[Nl]=!0,Ed("selectionchange",!1,a))}}function ay(t,a,s,o){switch(Oy(a)){case 2:var u=gw;break;case 8:u=yw;break;default:u=Kd}s=u.bind(null,a,s,t),u=void 0,!Fc||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(u=!0),o?u!==void 0?t.addEventListener(a,s,{capture:!0,passive:u}):t.addEventListener(a,s,!0):u!==void 0?t.addEventListener(a,s,{passive:u}):t.addEventListener(a,s,!1)}function Dd(t,a,s,o,u){var m=o;if((a&1)===0&&(a&2)===0&&o!==null)e:for(;;){if(o===null)return;var y=o.tag;if(y===3||y===4){var j=o.stateNode.containerInfo;if(j===u)break;if(y===4)for(y=o.return;y!==null;){var C=y.tag;if((C===3||C===4)&&y.stateNode.containerInfo===u)return;y=y.return}for(;j!==null;){if(y=Gi(j),y===null)return;if(C=y.tag,C===5||C===6||C===26||C===27){o=m=y;continue e}j=j.parentNode}}o=o.return}lm(function(){var q=m,P=Xc(s),Y=[];e:{var $=Bm.get(t);if($!==void 0){var I=Mo,pe=t;switch(t){case"keypress":if(Do(s)===0)break e;case"keydown":case"keyup":I=M1;break;case"focusin":pe="focus",I=nu;break;case"focusout":pe="blur",I=nu;break;case"beforeblur":case"afterblur":I=nu;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":I=dm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":I=j1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":I=q1;break;case Om:case Dm:case Rm:I=A1;break;case Mm:I=$1;break;case"scroll":case"scrollend":I=x1;break;case"wheel":I=V1;break;case"copy":case"cut":case"paste":I=C1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":I=pm;break;case"toggle":case"beforetoggle":I=G1}var we=(a&4)!==0,Je=!we&&(t==="scroll"||t==="scrollend"),D=we?$!==null?$+"Capture":null:$;we=[];for(var z=q,L;z!==null;){var K=z;if(L=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||L===null||D===null||(K=ur(z,D),K!=null&&we.push(Pr(z,K,L))),Je)break;z=z.return}0<we.length&&($=new I($,pe,null,s,P),Y.push({event:$,listeners:we}))}}if((a&7)===0){e:{if($=t==="mouseover"||t==="pointerover",I=t==="mouseout"||t==="pointerout",$&&s!==Yc&&(pe=s.relatedTarget||s.fromElement)&&(Gi(pe)||pe[Pi]))break e;if((I||$)&&($=P.window===P?P:($=P.ownerDocument)?$.defaultView||$.parentWindow:window,I?(pe=s.relatedTarget||s.toElement,I=q,pe=pe?Gi(pe):null,pe!==null&&(Je=c(pe),we=pe.tag,pe!==Je||we!==5&&we!==27&&we!==6)&&(pe=null)):(I=null,pe=q),I!==pe)){if(we=dm,K="onMouseLeave",D="onMouseEnter",z="mouse",(t==="pointerout"||t==="pointerover")&&(we=pm,K="onPointerLeave",D="onPointerEnter",z="pointer"),Je=I==null?$:cr(I),L=pe==null?$:cr(pe),$=new we(K,z+"leave",I,s,P),$.target=Je,$.relatedTarget=L,K=null,Gi(P)===q&&(we=new we(D,z+"enter",pe,s,P),we.target=L,we.relatedTarget=Je,K=we),Je=K,I&&pe)t:{for(we=Px,D=I,z=pe,L=0,K=D;K;K=we(K))L++;K=0;for(var ve=z;ve;ve=we(ve))K++;for(;0<L-K;)D=we(D),L--;for(;0<K-L;)z=we(z),K--;for(;L--;){if(D===z||z!==null&&D===z.alternate){we=D;break t}D=we(D),z=we(z)}we=null}else we=null;I!==null&&iy(Y,$,I,we,!1),pe!==null&&Je!==null&&iy(Y,Je,pe,we,!0)}}e:{if($=q?cr(q):window,I=$.nodeName&&$.nodeName.toLowerCase(),I==="select"||I==="input"&&$.type==="file")var $e=xm;else if(vm($))if(wm)$e=ex;else{$e=F1;var ge=J1}else I=$.nodeName,!I||I.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?q&&Zc(q.elementType)&&($e=xm):$e=W1;if($e&&($e=$e(t,q))){Sm(Y,$e,s,P);break e}ge&&ge(t,$,q),t==="focusout"&&q&&$.type==="number"&&q.memoizedProps.value!=null&&Kc($,"number",$.value)}switch(ge=q?cr(q):window,t){case"focusin":(vm(ge)||ge.contentEditable==="true")&&(Wi=ge,lu=q,br=null);break;case"focusout":br=lu=Wi=null;break;case"mousedown":cu=!0;break;case"contextmenu":case"mouseup":case"dragend":cu=!1,Tm(Y,s,P);break;case"selectionchange":if(nx)break;case"keydown":case"keyup":Tm(Y,s,P)}var Ee;if(iu)e:{switch(t){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else Fi?ym(t,s)&&(Be="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(Be="onCompositionStart");Be&&(mm&&s.locale!=="ko"&&(Fi||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&Fi&&(Ee=cm()):(xa=P,Wc="value"in xa?xa.value:xa.textContent,Fi=!0)),ge=kl(q,Be),0<ge.length&&(Be=new fm(Be,t,null,s,P),Y.push({event:Be,listeners:ge}),Ee?Be.data=Ee:(Ee=bm(s),Ee!==null&&(Be.data=Ee)))),(Ee=Q1?K1(t,s):Z1(t,s))&&(Be=kl(q,"onBeforeInput"),0<Be.length&&(ge=new fm("onBeforeInput","beforeinput",null,s,P),Y.push({event:ge,listeners:Be}),ge.data=Ee)),Ux(Y,t,q,s,P)}ny(Y,a)})}function Pr(t,a,s){return{instance:t,listener:a,currentTarget:s}}function kl(t,a){for(var s=a+"Capture",o=[];t!==null;){var u=t,m=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||m===null||(u=ur(t,s),u!=null&&o.unshift(Pr(t,u,m)),u=ur(t,a),u!=null&&o.push(Pr(t,u,m))),t.tag===3)return o;t=t.return}return[]}function Px(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function iy(t,a,s,o,u){for(var m=a._reactName,y=[];s!==null&&s!==o;){var j=s,C=j.alternate,q=j.stateNode;if(j=j.tag,C!==null&&C===o)break;j!==5&&j!==26&&j!==27||q===null||(C=q,u?(q=ur(s,m),q!=null&&y.unshift(Pr(s,q,C))):u||(q=ur(s,m),q!=null&&y.push(Pr(s,q,C)))),s=s.return}y.length!==0&&t.push({event:a,listeners:y})}var Gx=/\r\n?/g,Hx=/\u0000|\uFFFD/g;function sy(t){return(typeof t=="string"?t:""+t).replace(Gx,`
10
+ `).replace(Hx,"")}function ry(t,a){return a=sy(a),sy(t)===a}function Xe(t,a,s,o,u,m){switch(s){case"children":typeof o=="string"?a==="body"||a==="textarea"&&o===""||Yi(t,o):(typeof o=="number"||typeof o=="bigint")&&a!=="body"&&Yi(t,""+o);break;case"className":zo(t,"class",o);break;case"tabIndex":zo(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":zo(t,s,o);break;case"style":rm(t,o,m);break;case"data":if(a!=="object"){zo(t,"data",o);break}case"src":case"href":if(o===""&&(a!=="a"||s!=="href")){t.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=Eo(""+o),t.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(s,"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 m=="function"&&(s==="formAction"?(a!=="input"&&Xe(t,a,"name",u.name,u,null),Xe(t,a,"formEncType",u.formEncType,u,null),Xe(t,a,"formMethod",u.formMethod,u,null),Xe(t,a,"formTarget",u.formTarget,u,null)):(Xe(t,a,"encType",u.encType,u,null),Xe(t,a,"method",u.method,u,null),Xe(t,a,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=Eo(""+o),t.setAttribute(s,o);break;case"onClick":o!=null&&(t.onclick=Jn);break;case"onScroll":o!=null&&Re("scroll",t);break;case"onScrollEnd":o!=null&&Re("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(r(60));t.innerHTML=s}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}s=Eo(""+o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,""+o):t.removeAttribute(s);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":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":o===!0?t.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,o):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(s,o):t.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(s):t.setAttribute(s,o);break;case"popover":Re("beforetoggle",t),Re("toggle",t),Co(t,"popover",o);break;case"xlinkActuate":Xn(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Xn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Xn(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Xn(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Xn(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Xn(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Xn(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Xn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Xn(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Co(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=v1.get(s)||s,Co(t,s,o))}}function Rd(t,a,s,o,u,m){switch(s){case"style":rm(t,o,m);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(r(60));t.innerHTML=s}}break;case"children":typeof o=="string"?Yi(t,o):(typeof o=="number"||typeof o=="bigint")&&Yi(t,""+o);break;case"onScroll":o!=null&&Re("scroll",t);break;case"onScrollEnd":o!=null&&Re("scrollend",t);break;case"onClick":o!=null&&(t.onclick=Jn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jp.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),a=s.slice(2,u?s.length-7:void 0),m=t[Kt]||null,m=m!=null?m[s]:null,typeof m=="function"&&t.removeEventListener(a,m,u),typeof o=="function")){typeof m!="function"&&m!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(a,o,u);break e}s in t?t[s]=o:o===!0?t.setAttribute(s,""):Co(t,s,o)}}}function Lt(t,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Re("error",t),Re("load",t);var o=!1,u=!1,m;for(m in s)if(s.hasOwnProperty(m)){var y=s[m];if(y!=null)switch(m){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Xe(t,a,m,y,s,null)}}u&&Xe(t,a,"srcSet",s.srcSet,s,null),o&&Xe(t,a,"src",s.src,s,null);return;case"input":Re("invalid",t);var j=m=y=u=null,C=null,q=null;for(o in s)if(s.hasOwnProperty(o)){var P=s[o];if(P!=null)switch(o){case"name":u=P;break;case"type":y=P;break;case"checked":C=P;break;case"defaultChecked":q=P;break;case"value":m=P;break;case"defaultValue":j=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(r(137,a));break;default:Xe(t,a,o,P,s,null)}}nm(t,m,j,C,q,y,u,!1);return;case"select":Re("invalid",t),o=y=m=null;for(u in s)if(s.hasOwnProperty(u)&&(j=s[u],j!=null))switch(u){case"value":m=j;break;case"defaultValue":y=j;break;case"multiple":o=j;default:Xe(t,a,u,j,s,null)}a=m,s=y,t.multiple=!!o,a!=null?Zi(t,!!o,a,!1):s!=null&&Zi(t,!!o,s,!0);return;case"textarea":Re("invalid",t),m=u=o=null;for(y in s)if(s.hasOwnProperty(y)&&(j=s[y],j!=null))switch(y){case"value":o=j;break;case"defaultValue":u=j;break;case"children":m=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(r(91));break;default:Xe(t,a,y,j,s,null)}im(t,o,u,m);return;case"option":for(C in s)s.hasOwnProperty(C)&&(o=s[C],o!=null)&&(C==="selected"?t.selected=o&&typeof o!="function"&&typeof o!="symbol":Xe(t,a,C,o,s,null));return;case"dialog":Re("beforetoggle",t),Re("toggle",t),Re("cancel",t),Re("close",t);break;case"iframe":case"object":Re("load",t);break;case"video":case"audio":for(o=0;o<Vr.length;o++)Re(Vr[o],t);break;case"image":Re("error",t),Re("load",t);break;case"details":Re("toggle",t);break;case"embed":case"source":case"link":Re("error",t),Re("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(q in s)if(s.hasOwnProperty(q)&&(o=s[q],o!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Xe(t,a,q,o,s,null)}return;default:if(Zc(a)){for(P in s)s.hasOwnProperty(P)&&(o=s[P],o!==void 0&&Rd(t,a,P,o,s,void 0));return}}for(j in s)s.hasOwnProperty(j)&&(o=s[j],o!=null&&Xe(t,a,j,o,s,null))}function Qx(t,a,s,o){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,m=null,y=null,j=null,C=null,q=null,P=null;for(I in s){var Y=s[I];if(s.hasOwnProperty(I)&&Y!=null)switch(I){case"checked":break;case"value":break;case"defaultValue":C=Y;default:o.hasOwnProperty(I)||Xe(t,a,I,null,o,Y)}}for(var $ in o){var I=o[$];if(Y=s[$],o.hasOwnProperty($)&&(I!=null||Y!=null))switch($){case"type":m=I;break;case"name":u=I;break;case"checked":q=I;break;case"defaultChecked":P=I;break;case"value":y=I;break;case"defaultValue":j=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(r(137,a));break;default:I!==Y&&Xe(t,a,$,I,o,Y)}}Qc(t,y,j,C,q,P,m,u);return;case"select":I=y=j=$=null;for(m in s)if(C=s[m],s.hasOwnProperty(m)&&C!=null)switch(m){case"value":break;case"multiple":I=C;default:o.hasOwnProperty(m)||Xe(t,a,m,null,o,C)}for(u in o)if(m=o[u],C=s[u],o.hasOwnProperty(u)&&(m!=null||C!=null))switch(u){case"value":$=m;break;case"defaultValue":j=m;break;case"multiple":y=m;default:m!==C&&Xe(t,a,u,m,o,C)}a=j,s=y,o=I,$!=null?Zi(t,!!s,$,!1):!!o!=!!s&&(a!=null?Zi(t,!!s,a,!0):Zi(t,!!s,s?[]:"",!1));return;case"textarea":I=$=null;for(j in s)if(u=s[j],s.hasOwnProperty(j)&&u!=null&&!o.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Xe(t,a,j,null,o,u)}for(y in o)if(u=o[y],m=s[y],o.hasOwnProperty(y)&&(u!=null||m!=null))switch(y){case"value":$=u;break;case"defaultValue":I=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(r(91));break;default:u!==m&&Xe(t,a,y,u,o,m)}am(t,$,I);return;case"option":for(var pe in s)$=s[pe],s.hasOwnProperty(pe)&&$!=null&&!o.hasOwnProperty(pe)&&(pe==="selected"?t.selected=!1:Xe(t,a,pe,null,o,$));for(C in o)$=o[C],I=s[C],o.hasOwnProperty(C)&&$!==I&&($!=null||I!=null)&&(C==="selected"?t.selected=$&&typeof $!="function"&&typeof $!="symbol":Xe(t,a,C,$,o,I));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 we in s)$=s[we],s.hasOwnProperty(we)&&$!=null&&!o.hasOwnProperty(we)&&Xe(t,a,we,null,o,$);for(q in o)if($=o[q],I=s[q],o.hasOwnProperty(q)&&$!==I&&($!=null||I!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(r(137,a));break;default:Xe(t,a,q,$,o,I)}return;default:if(Zc(a)){for(var Je in s)$=s[Je],s.hasOwnProperty(Je)&&$!==void 0&&!o.hasOwnProperty(Je)&&Rd(t,a,Je,void 0,o,$);for(P in o)$=o[P],I=s[P],!o.hasOwnProperty(P)||$===I||$===void 0&&I===void 0||Rd(t,a,P,$,o,I);return}}for(var D in s)$=s[D],s.hasOwnProperty(D)&&$!=null&&!o.hasOwnProperty(D)&&Xe(t,a,D,null,o,$);for(Y in o)$=o[Y],I=s[Y],!o.hasOwnProperty(Y)||$===I||$==null&&I==null||Xe(t,a,Y,$,o,I)}function oy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Kx(){if(typeof performance.getEntriesByType=="function"){for(var t=0,a=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var u=s[o],m=u.transferSize,y=u.initiatorType,j=u.duration;if(m&&j&&oy(y)){for(y=0,j=u.responseEnd,o+=1;o<s.length;o++){var C=s[o],q=C.startTime;if(q>j)break;var P=C.transferSize,Y=C.initiatorType;P&&oy(Y)&&(C=C.responseEnd,y+=P*(C<j?1:(j-q)/(C-q)))}if(--o,a+=8*(m+y)/(u.duration/1e3),t++,10<t)break}}if(0<t)return a/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Md=null,Bd=null;function Al(t){return t.nodeType===9?t:t.ownerDocument}function ly(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function cy(t,a){if(t===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&a==="foreignObject"?0:t}function Ld(t,a){return t==="textarea"||t==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var qd=null;function Zx(){var t=window.event;return t&&t.type==="popstate"?t===qd?!1:(qd=t,!0):(qd=null,!1)}var uy=typeof setTimeout=="function"?setTimeout:void 0,Yx=typeof clearTimeout=="function"?clearTimeout:void 0,dy=typeof Promise=="function"?Promise:void 0,Xx=typeof queueMicrotask=="function"?queueMicrotask:typeof dy<"u"?function(t){return dy.resolve(null).then(t).catch(Jx)}:uy;function Jx(t){setTimeout(function(){throw t})}function qa(t){return t==="head"}function fy(t,a){var s=a,o=0;do{var u=s.nextSibling;if(t.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(o===0){t.removeChild(u),As(a);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")Gr(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,Gr(s);for(var m=s.firstChild;m;){var y=m.nextSibling,j=m.nodeName;m[lr]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&m.rel.toLowerCase()==="stylesheet"||s.removeChild(m),m=y}}else s==="body"&&Gr(t.ownerDocument.body);s=u}while(s);As(a)}function py(t,a){var s=t;t=0;do{var o=s.nextSibling;if(s.nodeType===1?a?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(a?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=o}while(s)}function Ud(t){var a=t.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var s=a;switch(a=a.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Ud(s),Gc(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function Fx(t,a,s,o){for(;t.nodeType===1;){var u=s;if(t.nodeName.toLowerCase()!==a.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[lr])switch(a){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(m=t.getAttribute("rel"),m==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(m!==u.rel||t.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||t.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||t.getAttribute("title")!==(u.title==null?null:u.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(m=t.getAttribute("src"),(m!==(u.src==null?null:u.src)||t.getAttribute("type")!==(u.type==null?null:u.type)||t.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&m&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(a==="input"&&t.type==="hidden"){var m=u.name==null?null:""+u.name;if(u.type==="hidden"&&t.getAttribute("name")===m)return t}else return t;if(t=Sn(t.nextSibling),t===null)break}return null}function Wx(t,a,s){if(a==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=Sn(t.nextSibling),t===null))return null;return t}function my(t,a){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Sn(t.nextSibling),t===null))return null;return t}function $d(t){return t.data==="$?"||t.data==="$~"}function Id(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function ew(t,a){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=a;else if(t.data!=="$?"||s.readyState!=="loading")a();else{var o=function(){a(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function Sn(t){for(;t!=null;t=t.nextSibling){var a=t.nodeType;if(a===1||a===3)break;if(a===8){if(a=t.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return t}var Vd=null;function hy(t){t=t.nextSibling;for(var a=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(a===0)return Sn(t.nextSibling);a--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||a++}t=t.nextSibling}return null}function gy(t){t=t.previousSibling;for(var a=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(a===0)return t;a--}else s!=="/$"&&s!=="/&"||a++}t=t.previousSibling}return null}function yy(t,a,s){switch(a=Al(s),t){case"html":if(t=a.documentElement,!t)throw Error(r(452));return t;case"head":if(t=a.head,!t)throw Error(r(453));return t;case"body":if(t=a.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function Gr(t){for(var a=t.attributes;a.length;)t.removeAttributeNode(a[0]);Gc(t)}var xn=new Map,by=new Set;function _l(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var pa=J.d;J.d={f:tw,r:nw,D:aw,C:iw,L:sw,m:rw,X:lw,S:ow,M:cw};function tw(){var t=pa.f(),a=bl();return t||a}function nw(t){var a=Hi(t);a!==null&&a.tag===5&&a.type==="form"?Mh(a):pa.r(t)}var js=typeof document>"u"?null:document;function vy(t,a,s){var o=js;if(o&&typeof a=="string"&&a){var u=pn(a);u='link[rel="'+t+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),by.has(u)||(by.add(u),t={rel:t,crossOrigin:s,href:a},o.querySelector(u)===null&&(a=o.createElement("link"),Lt(a,"link",t),zt(a),o.head.appendChild(a)))}}function aw(t){pa.D(t),vy("dns-prefetch",t,null)}function iw(t,a){pa.C(t,a),vy("preconnect",t,a)}function sw(t,a,s){pa.L(t,a,s);var o=js;if(o&&t&&a){var u='link[rel="preload"][as="'+pn(a)+'"]';a==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+pn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+pn(s.imageSizes)+'"]')):u+='[href="'+pn(t)+'"]';var m=u;switch(a){case"style":m=Ns(t);break;case"script":m=ks(t)}xn.has(m)||(t=x({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:t,as:a},s),xn.set(m,t),o.querySelector(u)!==null||a==="style"&&o.querySelector(Hr(m))||a==="script"&&o.querySelector(Qr(m))||(a=o.createElement("link"),Lt(a,"link",t),zt(a),o.head.appendChild(a)))}}function rw(t,a){pa.m(t,a);var s=js;if(s&&t){var o=a&&typeof a.as=="string"?a.as:"script",u='link[rel="modulepreload"][as="'+pn(o)+'"][href="'+pn(t)+'"]',m=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=ks(t)}if(!xn.has(m)&&(t=x({rel:"modulepreload",href:t},a),xn.set(m,t),s.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Qr(m)))return}o=s.createElement("link"),Lt(o,"link",t),zt(o),s.head.appendChild(o)}}}function ow(t,a,s){pa.S(t,a,s);var o=js;if(o&&t){var u=Qi(o).hoistableStyles,m=Ns(t);a=a||"default";var y=u.get(m);if(!y){var j={loading:0,preload:null};if(y=o.querySelector(Hr(m)))j.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":a},s),(s=xn.get(m))&&Pd(t,s);var C=y=o.createElement("link");zt(C),Lt(C,"link",t),C._p=new Promise(function(q,P){C.onload=q,C.onerror=P}),C.addEventListener("load",function(){j.loading|=1}),C.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Cl(y,a,o)}y={type:"stylesheet",instance:y,count:1,state:j},u.set(m,y)}}}function lw(t,a){pa.X(t,a);var s=js;if(s&&t){var o=Qi(s).hoistableScripts,u=ks(t),m=o.get(u);m||(m=s.querySelector(Qr(u)),m||(t=x({src:t,async:!0},a),(a=xn.get(u))&&Gd(t,a),m=s.createElement("script"),zt(m),Lt(m,"link",t),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},o.set(u,m))}}function cw(t,a){pa.M(t,a);var s=js;if(s&&t){var o=Qi(s).hoistableScripts,u=ks(t),m=o.get(u);m||(m=s.querySelector(Qr(u)),m||(t=x({src:t,async:!0,type:"module"},a),(a=xn.get(u))&&Gd(t,a),m=s.createElement("script"),zt(m),Lt(m,"link",t),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},o.set(u,m))}}function Sy(t,a,s,o){var u=(u=ae.current)?_l(u):null;if(!u)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=Ns(s.href),s=Qi(u).hoistableStyles,o=s.get(a),o||(o={type:"style",instance:null,count:0,state:null},s.set(a,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Ns(s.href);var m=Qi(u).hoistableStyles,y=m.get(t);if(y||(u=u.ownerDocument||u,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,y),(m=u.querySelector(Hr(t)))&&!m._p&&(y.instance=m,y.state.loading=5),xn.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},xn.set(t,s),m||uw(u,t,s,y.state))),a&&o===null)throw Error(r(528,""));return y}if(a&&o!==null)throw Error(r(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=ks(s),s=Qi(u).hoistableScripts,o=s.get(a),o||(o={type:"script",instance:null,count:0,state:null},s.set(a,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function Ns(t){return'href="'+pn(t)+'"'}function Hr(t){return'link[rel="stylesheet"]['+t+"]"}function xy(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function uw(t,a,s,o){t.querySelector('link[rel="preload"][as="style"]['+a+"]")?o.loading=1:(a=t.createElement("link"),o.preload=a,a.addEventListener("load",function(){return o.loading|=1}),a.addEventListener("error",function(){return o.loading|=2}),Lt(a,"link",s),zt(a),t.head.appendChild(a))}function ks(t){return'[src="'+pn(t)+'"]'}function Qr(t){return"script[async]"+t}function wy(t,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var o=t.querySelector('style[data-href~="'+pn(s.href)+'"]');if(o)return a.instance=o,zt(o),o;var u=x({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),zt(o),Lt(o,"style",u),Cl(o,s.precedence,t),a.instance=o;case"stylesheet":u=Ns(s.href);var m=t.querySelector(Hr(u));if(m)return a.state.loading|=4,a.instance=m,zt(m),m;o=xy(s),(u=xn.get(u))&&Pd(o,u),m=(t.ownerDocument||t).createElement("link"),zt(m);var y=m;return y._p=new Promise(function(j,C){y.onload=j,y.onerror=C}),Lt(m,"link",o),a.state.loading|=4,Cl(m,s.precedence,t),a.instance=m;case"script":return m=ks(s.src),(u=t.querySelector(Qr(m)))?(a.instance=u,zt(u),u):(o=s,(u=xn.get(m))&&(o=x({},s),Gd(o,u)),t=t.ownerDocument||t,u=t.createElement("script"),zt(u),Lt(u,"link",o),t.head.appendChild(u),a.instance=u);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(o=a.instance,a.state.loading|=4,Cl(o,s.precedence,t));return a.instance}function Cl(t,a,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,m=u,y=0;y<o.length;y++){var j=o[y];if(j.dataset.precedence===a)m=j;else if(m!==u)break}m?m.parentNode.insertBefore(t,m.nextSibling):(a=s.nodeType===9?s.head:s,a.insertBefore(t,a.firstChild))}function Pd(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.title==null&&(t.title=a.title)}function Gd(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.integrity==null&&(t.integrity=a.integrity)}var zl=null;function jy(t,a,s){if(zl===null){var o=new Map,u=zl=new Map;u.set(s,o)}else u=zl,o=u.get(s),o||(o=new Map,u.set(s,o));if(o.has(t))return o;for(o.set(t,null),s=s.getElementsByTagName(t),u=0;u<s.length;u++){var m=s[u];if(!(m[lr]||m[Dt]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var y=m.getAttribute(a)||"";y=t+y;var j=o.get(y);j?j.push(m):o.set(y,[m])}}return o}function Ny(t,a,s){t=t.ownerDocument||t,t.head.insertBefore(s,a==="title"?t.querySelector("head > title"):null)}function dw(t,a,s){if(s===1||a.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(t=a.disabled,typeof a.precedence=="string"&&t==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function ky(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function fw(t,a,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=Ns(o.href),m=a.querySelector(Hr(u));if(m){a=m._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=Tl.bind(t),a.then(t,t)),s.state.loading|=4,s.instance=m,zt(m);return}m=a.ownerDocument||a,o=xy(o),(u=xn.get(u))&&Pd(o,u),m=m.createElement("link"),zt(m);var y=m;y._p=new Promise(function(j,C){y.onload=j,y.onerror=C}),Lt(m,"link",o),s.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=Tl.bind(t),a.addEventListener("load",s),a.addEventListener("error",s))}}var Hd=0;function pw(t,a){return t.stylesheets&&t.count===0&&Ol(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var o=setTimeout(function(){if(t.stylesheets&&Ol(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+a);0<t.imgBytes&&Hd===0&&(Hd=62500*Kx());var u=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ol(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>Hd?50:800)+a);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function Tl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ol(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var El=null;function Ol(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,El=new Map,a.forEach(mw,t),El=null,Tl.call(t))}function mw(t,a){if(!(a.state.loading&4)){var s=El.get(t);if(s)var o=s.get(null);else{s=new Map,El.set(t,s);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<u.length;m++){var y=u[m];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(s.set(y.dataset.precedence,y),o=y)}o&&s.set(null,o)}u=a.instance,y=u.getAttribute("data-precedence"),m=s.get(y)||o,m===o&&s.set(null,u),s.set(y,u),this.count++,o=Tl.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),m?m.parentNode.insertBefore(u,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(u,t.firstChild)),a.state.loading|=4}}var Kr={$$typeof:G,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function hw(t,a,s,o,u,m,y,j,C){this.tag=1,this.containerInfo=t,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=ne(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ne(0),this.hiddenUpdates=ne(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=m,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function Ay(t,a,s,o,u,m,y,j,C,q,P,Y){return t=new hw(t,a,s,y,C,q,P,Y,j),a=1,m===!0&&(a|=24),m=sn(3,null,null,a),t.current=m,m.stateNode=t,a=Nu(),a.refCount++,t.pooledCache=a,a.refCount++,m.memoizedState={element:o,isDehydrated:s,cache:a},Cu(m),t}function _y(t){return t?(t=ns,t):ns}function Cy(t,a,s,o,u,m){u=_y(u),o.context===null?o.context=u:o.pendingContext=u,o=_a(a),o.payload={element:s},m=m===void 0?null:m,m!==null&&(o.callback=m),s=Ca(t,o,a),s!==null&&(Wt(s,t,a),kr(s,t,a))}function zy(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<a?s:a}}function Qd(t,a){zy(t,a),(t=t.alternate)&&zy(t,a)}function Ty(t){if(t.tag===13||t.tag===31){var a=li(t,67108864);a!==null&&Wt(a,t,67108864),Qd(t,67108864)}}function Ey(t){if(t.tag===13||t.tag===31){var a=un();a=or(a);var s=li(t,a);s!==null&&Wt(s,t,a),Qd(t,a)}}var Dl=!0;function gw(t,a,s,o){var u=B.T;B.T=null;var m=J.p;try{J.p=2,Kd(t,a,s,o)}finally{J.p=m,B.T=u}}function yw(t,a,s,o){var u=B.T;B.T=null;var m=J.p;try{J.p=8,Kd(t,a,s,o)}finally{J.p=m,B.T=u}}function Kd(t,a,s,o){if(Dl){var u=Zd(o);if(u===null)Dd(t,a,o,Rl,s),Dy(t,o);else if(vw(u,t,a,s,o))o.stopPropagation();else if(Dy(t,o),a&4&&-1<bw.indexOf(t)){for(;u!==null;){var m=Hi(u);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var y=Zn(m.pendingLanes);if(y!==0){var j=m;for(j.pendingLanes|=2,j.entangledLanes|=2;y;){var C=1<<31-ht(y);j.entanglements[1]|=C,y&=~C}Gn(m),(Ve&6)===0&&(gl=Ut()+500,Ir(0))}}break;case 31:case 13:j=li(m,2),j!==null&&Wt(j,m,2),bl(),Qd(m,2)}if(m=Zd(o),m===null&&Dd(t,a,o,Rl,s),m===u)break;u=m}u!==null&&o.stopPropagation()}else Dd(t,a,o,null,s)}}function Zd(t){return t=Xc(t),Yd(t)}var Rl=null;function Yd(t){if(Rl=null,t=Gi(t),t!==null){var a=c(t);if(a===null)t=null;else{var s=a.tag;if(s===13){if(t=d(a),t!==null)return t;t=null}else if(s===31){if(t=h(a),t!==null)return t;t=null}else if(s===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;t=null}else a!==t&&(t=null)}}return Rl=t,null}function Oy(t){switch(t){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(wo()){case ir:return 2;case jo:return 8;case Li:case Ic:return 32;case qi:return 268435456;default:return 32}default:return 32}}var Xd=!1,Ua=null,$a=null,Ia=null,Zr=new Map,Yr=new Map,Va=[],bw="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 Dy(t,a){switch(t){case"focusin":case"focusout":Ua=null;break;case"dragenter":case"dragleave":$a=null;break;case"mouseover":case"mouseout":Ia=null;break;case"pointerover":case"pointerout":Zr.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yr.delete(a.pointerId)}}function Xr(t,a,s,o,u,m){return t===null||t.nativeEvent!==m?(t={blockedOn:a,domEventName:s,eventSystemFlags:o,nativeEvent:m,targetContainers:[u]},a!==null&&(a=Hi(a),a!==null&&Ty(a)),t):(t.eventSystemFlags|=o,a=t.targetContainers,u!==null&&a.indexOf(u)===-1&&a.push(u),t)}function vw(t,a,s,o,u){switch(a){case"focusin":return Ua=Xr(Ua,t,a,s,o,u),!0;case"dragenter":return $a=Xr($a,t,a,s,o,u),!0;case"mouseover":return Ia=Xr(Ia,t,a,s,o,u),!0;case"pointerover":var m=u.pointerId;return Zr.set(m,Xr(Zr.get(m)||null,t,a,s,o,u)),!0;case"gotpointercapture":return m=u.pointerId,Yr.set(m,Xr(Yr.get(m)||null,t,a,s,o,u)),!0}return!1}function Ry(t){var a=Gi(t.target);if(a!==null){var s=c(a);if(s!==null){if(a=s.tag,a===13){if(a=d(s),a!==null){t.blockedOn=a,Zp(t.priority,function(){Ey(s)});return}}else if(a===31){if(a=h(s),a!==null){t.blockedOn=a,Zp(t.priority,function(){Ey(s)});return}}else if(a===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Ml(t){if(t.blockedOn!==null)return!1;for(var a=t.targetContainers;0<a.length;){var s=Zd(t.nativeEvent);if(s===null){s=t.nativeEvent;var o=new s.constructor(s.type,s);Yc=o,s.target.dispatchEvent(o),Yc=null}else return a=Hi(s),a!==null&&Ty(a),t.blockedOn=s,!1;a.shift()}return!0}function My(t,a,s){Ml(t)&&s.delete(a)}function Sw(){Xd=!1,Ua!==null&&Ml(Ua)&&(Ua=null),$a!==null&&Ml($a)&&($a=null),Ia!==null&&Ml(Ia)&&(Ia=null),Zr.forEach(My),Yr.forEach(My)}function Bl(t,a){t.blockedOn===a&&(t.blockedOn=null,Xd||(Xd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Sw)))}var Ll=null;function By(t){Ll!==t&&(Ll=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Ll===t&&(Ll=null);for(var a=0;a<t.length;a+=3){var s=t[a],o=t[a+1],u=t[a+2];if(typeof o!="function"){if(Yd(o||s)===null)continue;break}var m=Hi(s);m!==null&&(t.splice(a,3),a-=3,Zu(m,{pending:!0,data:u,method:s.method,action:o},o,u))}}))}function As(t){function a(C){return Bl(C,t)}Ua!==null&&Bl(Ua,t),$a!==null&&Bl($a,t),Ia!==null&&Bl(Ia,t),Zr.forEach(a),Yr.forEach(a);for(var s=0;s<Va.length;s++){var o=Va[s];o.blockedOn===t&&(o.blockedOn=null)}for(;0<Va.length&&(s=Va[0],s.blockedOn===null);)Ry(s),s.blockedOn===null&&Va.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var u=s[o],m=s[o+1],y=u[Kt]||null;if(typeof m=="function")y||By(s);else if(y){var j=null;if(m&&m.hasAttribute("formAction")){if(u=m,y=m[Kt]||null)j=y.formAction;else if(Yd(u)!==null)continue}else j=y.action;typeof j=="function"?s[o+1]=j:(s.splice(o,3),o-=3),By(s)}}}function Ly(){function t(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(y){return u=y})},focusReset:"manual",scroll:"manual"})}function a(){u!==null&&(u(),u=null),o||setTimeout(s,20)}function s(){if(!o&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),u!==null&&(u(),u=null)}}}function Jd(t){this._internalRoot=t}ql.prototype.render=Jd.prototype.render=function(t){var a=this._internalRoot;if(a===null)throw Error(r(409));var s=a.current,o=un();Cy(s,o,t,a,null,null)},ql.prototype.unmount=Jd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var a=t.containerInfo;Cy(t.current,2,null,t,null,null),bl(),a[Pi]=null}};function ql(t){this._internalRoot=t}ql.prototype.unstable_scheduleHydration=function(t){if(t){var a=Kp();t={blockedOn:null,target:t,priority:a};for(var s=0;s<Va.length&&a!==0&&a<Va[s].priority;s++);Va.splice(s,0,t),s===0&&Ry(t)}};var qy=n.version;if(qy!=="19.2.4")throw Error(r(527,qy,"19.2.4"));J.findDOMNode=function(t){var a=t._reactInternals;if(a===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=v(a),t=t!==null?S(t):null,t=t===null?null:t.stateNode,t};var xw={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ul=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ul.isDisabled&&Ul.supportsFiber)try{va=Ul.inject(xw),$t=Ul}catch{}}return Jr.createRoot=function(t,a){if(!l(t))throw Error(r(299));var s=!1,o="",u=Hh,m=Qh,y=Kh;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(o=a.identifierPrefix),a.onUncaughtError!==void 0&&(u=a.onUncaughtError),a.onCaughtError!==void 0&&(m=a.onCaughtError),a.onRecoverableError!==void 0&&(y=a.onRecoverableError)),a=Ay(t,1,!1,null,null,s,o,null,u,m,y,Ly),t[Pi]=a.current,Od(t),new Jd(a)},Jr.hydrateRoot=function(t,a,s){if(!l(t))throw Error(r(299));var o=!1,u="",m=Hh,y=Qh,j=Kh,C=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(m=s.onUncaughtError),s.onCaughtError!==void 0&&(y=s.onCaughtError),s.onRecoverableError!==void 0&&(j=s.onRecoverableError),s.formState!==void 0&&(C=s.formState)),a=Ay(t,1,!0,a,s??null,o,u,C,m,y,j,Ly),a.context=_y(null),s=a.current,o=un(),o=or(o),u=_a(o),u.callback=null,Ca(s,u,o),s=o,a.current.lanes=s,Fe(a,s),Gn(a),t[Pi]=a.current,Od(t),new ql(a)},Jr.version="19.2.4",Jr}var Vy;function $w(){if(Vy)return Fd.exports;Vy=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(n){console.error(n)}}return e(),Fd.exports=Uw(),Fd.exports}var Iw=$w();const Vw={bodySerializer:e=>JSON.stringify(e,(n,i)=>typeof i=="bigint"?i.toString():i)},Pw=({onRequest:e,onSseError:n,onSseEvent:i,responseTransformer:r,responseValidator:l,sseDefaultRetryDelay:c,sseMaxRetryAttempts:d,sseMaxRetryDelay:h,sseSleepFn:g,url:v,...S})=>{let x;const N=g??(k=>new Promise(E=>setTimeout(E,k)));return{stream:async function*(){let k=c??3e3,E=0;const R=S.signal??new AbortController().signal;for(;!R.aborted;){E++;const V=S.headers instanceof Headers?S.headers:new Headers(S.headers);x!==void 0&&V.set("Last-Event-ID",x);try{const G={redirect:"follow",...S,body:S.serializedBody,headers:V,signal:R};let Z=new Request(v,G);e&&(Z=await e(v,G));const F=await(S.fetch??globalThis.fetch)(Z);if(!F.ok)throw new Error(`SSE failed: ${F.status} ${F.statusText}`);if(!F.body)throw new Error("No body in SSE response");const O=F.body.pipeThrough(new TextDecoderStream).getReader();let M="";const le=()=>{try{O.cancel()}catch{}};R.addEventListener("abort",le);try{for(;;){const{done:ke,value:Ce}=await O.read();if(ke)break;M+=Ce;const be=M.split(`
11
11
 
12
12
  `);M=be.pop()??"";for(const tt of be){const Ke=tt.split(`
13
13
  `),ee=[];let B;for(const Se of Ke)if(Se.startsWith("data:"))ee.push(Se.replace(/^data:\s*/,""));else if(Se.startsWith("event:"))B=Se.replace(/^event:\s*/,"");else if(Se.startsWith("id:"))x=Se.replace(/^id:\s*/,"");else if(Se.startsWith("retry:")){const re=Number.parseInt(Se.replace(/^retry:\s*/,""),10);Number.isNaN(re)||(k=re)}let J,fe=!1;if(ee.length){const Se=ee.join(`
14
- `);try{J=JSON.parse(Se),fe=!0}catch{J=Se}}fe&&(l&&await l(J),r&&(J=await r(J))),i?.({data:J,event:B,id:x,retry:k}),ee.length&&(yield J)}}}finally{R.removeEventListener("abort",le),O.releaseLock()}break}catch(G){if(n?.(G),d!==void 0&&E>=d)break;const Z=Math.min(k*2**(E-1),h??3e4);await N(Z)}}}()}},Gw=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Hw=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},Qw=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},yv=({allowReserved:e,explode:n,name:i,style:r,value:l})=>{if(!n){const h=(e?l:l.map(g=>encodeURIComponent(g))).join(Hw(r));switch(r){case"label":return`.${h}`;case"matrix":return`;${i}=${h}`;case"simple":return h;default:return`${i}=${h}`}}const c=Gw(r),d=l.map(h=>r==="label"||r==="simple"?e?h:encodeURIComponent(h):gc({allowReserved:e,name:i,value:h})).join(c);return r==="label"||r==="matrix"?c+d:d},gc=({allowReserved:e,name:n,value:i})=>{if(i==null)return"";if(typeof i=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${n}=${e?i:encodeURIComponent(i)}`},bv=({allowReserved:e,explode:n,name:i,style:r,value:l,valueOnly:c})=>{if(l instanceof Date)return c?l.toISOString():`${i}=${l.toISOString()}`;if(r!=="deepObject"&&!n){let g=[];Object.entries(l).forEach(([S,x])=>{g=[...g,S,e?x:encodeURIComponent(x)]});const b=g.join(",");switch(r){case"form":return`${i}=${b}`;case"label":return`.${b}`;case"matrix":return`;${i}=${b}`;default:return b}}const d=Qw(r),h=Object.entries(l).map(([g,b])=>gc({allowReserved:e,name:r==="deepObject"?`${i}[${g}]`:g,value:b})).join(d);return r==="label"||r==="matrix"?d+h:h},Kw=/\{[^{}]+\}/g,Zw=({path:e,url:n})=>{let i=n;const r=n.match(Kw);if(r)for(const l of r){let c=!1,d=l.substring(1,l.length-1),h="simple";d.endsWith("*")&&(c=!0,d=d.substring(0,d.length-1)),d.startsWith(".")?(d=d.substring(1),h="label"):d.startsWith(";")&&(d=d.substring(1),h="matrix");const g=e[d];if(g==null)continue;if(Array.isArray(g)){i=i.replace(l,yv({explode:c,name:d,style:h,value:g}));continue}if(typeof g=="object"){i=i.replace(l,bv({explode:c,name:d,style:h,value:g,valueOnly:!0}));continue}if(h==="matrix"){i=i.replace(l,`;${gc({name:d,value:g})}`);continue}const b=encodeURIComponent(h==="label"?`.${g}`:g);i=i.replace(l,b)}return i},Yw=({baseUrl:e,path:n,query:i,querySerializer:r,url:l})=>{const c=l.startsWith("/")?l:`/${l}`;let d=(e??"")+c;n&&(d=Zw({path:n,url:d}));let h=i?r(i):"";return h.startsWith("?")&&(h=h.substring(1)),h&&(d+=`?${h}`),d};function Xw(e){const n=e.body!==void 0;if(n&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(n)return e.body}const Jw=async(e,n)=>{const i=typeof n=="function"?await n(e):n;if(i)return e.scheme==="bearer"?`Bearer ${i}`:e.scheme==="basic"?`Basic ${btoa(i)}`:i},vv=({allowReserved:e,array:n,object:i}={})=>l=>{const c=[];if(l&&typeof l=="object")for(const d in l){const h=l[d];if(h!=null)if(Array.isArray(h)){const g=yv({allowReserved:e,explode:!0,name:d,style:"form",value:h,...n});g&&c.push(g)}else if(typeof h=="object"){const g=bv({allowReserved:e,explode:!0,name:d,style:"deepObject",value:h,...i});g&&c.push(g)}else{const g=gc({allowReserved:e,name:d,value:h});g&&c.push(g)}}return c.join("&")},Fw=e=>{if(!e)return"stream";const n=e.split(";")[0]?.trim();if(n){if(n.startsWith("application/json")||n.endsWith("+json"))return"json";if(n==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(i=>n.startsWith(i)))return"blob";if(n.startsWith("text/"))return"text"}},Ww=(e,n)=>n?!!(e.headers.has(n)||e.query?.[n]||e.headers.get("Cookie")?.includes(`${n}=`)):!1,ej=async({security:e,...n})=>{for(const i of e){if(Ww(n,i.name))continue;const r=await Jw(i,n.auth);if(!r)continue;const l=i.name??"Authorization";switch(i.in){case"query":n.query||(n.query={}),n.query[l]=r;break;case"cookie":n.headers.append("Cookie",`${l}=${r}`);break;default:n.headers.set(l,r);break}}},Vy=e=>Yw({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:vv(e.querySerializer),url:e.url}),Py=(e,n)=>{const i={...e,...n};return i.baseUrl?.endsWith("/")&&(i.baseUrl=i.baseUrl.substring(0,i.baseUrl.length-1)),i.headers=Sv(e.headers,n.headers),i},tj=e=>{const n=[];return e.forEach((i,r)=>{n.push([r,i])}),n},Sv=(...e)=>{const n=new Headers;for(const i of e){if(!i)continue;const r=i instanceof Headers?tj(i):Object.entries(i);for(const[l,c]of r)if(c===null)n.delete(l);else if(Array.isArray(c))for(const d of c)n.append(l,d);else c!==void 0&&n.set(l,typeof c=="object"?JSON.stringify(c):c)}return n};class tf{fns=[];clear(){this.fns=[]}eject(n){const i=this.getInterceptorIndex(n);this.fns[i]&&(this.fns[i]=null)}exists(n){const i=this.getInterceptorIndex(n);return!!this.fns[i]}getInterceptorIndex(n){return typeof n=="number"?this.fns[n]?n:-1:this.fns.indexOf(n)}update(n,i){const r=this.getInterceptorIndex(n);return this.fns[r]?(this.fns[r]=i,n):!1}use(n){return this.fns.push(n),this.fns.length-1}}const nj=()=>({error:new tf,request:new tf,response:new tf}),aj=vv({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),ij={"Content-Type":"application/json"},xv=(e={})=>({...Vw,headers:ij,parseAs:"auto",querySerializer:aj,...e}),wv=(e={})=>{let n=Py(xv(),e);const i=()=>({...n}),r=b=>(n=Py(n,b),i()),l=nj(),c=async b=>{const S={...n,...b,fetch:b.fetch??n.fetch??globalThis.fetch,headers:Sv(n.headers,b.headers),serializedBody:void 0};S.security&&await ej({...S,security:S.security}),S.requestValidator&&await S.requestValidator(S),S.body!==void 0&&S.bodySerializer&&(S.serializedBody=S.bodySerializer(S.body)),(S.body===void 0||S.serializedBody==="")&&S.headers.delete("Content-Type");const x=Vy(S);return{opts:S,url:x}},d=async b=>{const{opts:S,url:x}=await c(b),N={redirect:"follow",...S,body:Xw(S)};let _=new Request(x,N);for(const X of l.request.fns)X&&(_=await X(_,S));const T=S.fetch;let k=await T(_);for(const X of l.response.fns)X&&(k=await X(k,_,S));const E={request:_,response:k};if(k.ok){const X=(S.parseAs==="auto"?Fw(k.headers.get("Content-Type")):S.parseAs)??"json";if(k.status===204||k.headers.get("Content-Length")==="0"){let O;switch(X){case"arrayBuffer":case"blob":case"text":O=await k[X]();break;case"formData":O=new FormData;break;case"stream":O=k.body;break;default:O={};break}return S.responseStyle==="data"?O:{data:O,...E}}let F;switch(X){case"arrayBuffer":case"blob":case"formData":case"json":case"text":F=await k[X]();break;case"stream":return S.responseStyle==="data"?k.body:{data:k.body,...E}}return X==="json"&&(S.responseValidator&&await S.responseValidator(F),S.responseTransformer&&(F=await S.responseTransformer(F))),S.responseStyle==="data"?F:{data:F,...E}}const R=await k.text();let V;try{V=JSON.parse(R)}catch{}const G=V??R;let Z=G;for(const X of l.error.fns)X&&(Z=await X(G,k,_,S));if(Z=Z||{},S.throwOnError)throw Z;return S.responseStyle==="data"?void 0:{error:Z,...E}},h=b=>S=>d({...S,method:b}),g=b=>async S=>{const{opts:x,url:N}=await c(S);return Pw({...x,body:x.body,headers:x.headers,method:b,onRequest:async(_,T)=>{let k=new Request(_,T);for(const E of l.request.fns)E&&(k=await E(k,x));return k},url:N})};return{buildUrl:Vy,connect:h("CONNECT"),delete:h("DELETE"),get:h("GET"),getConfig:i,head:h("HEAD"),interceptors:l,options:h("OPTIONS"),patch:h("PATCH"),post:h("POST"),put:h("PUT"),request:d,setConfig:r,sse:{connect:g("CONNECT"),delete:g("DELETE"),get:g("GET"),head:g("HEAD"),options:g("OPTIONS"),patch:g("PATCH"),post:g("POST"),put:g("PUT"),trace:g("TRACE")},trace:h("TRACE")}},K=wv(xv()),sj=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),jv=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),rj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),oj=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects",...e}),lj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations",...e,headers:{"Content-Type":"application/json",...e.headers}}),cj=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations/{label}",...e}),uj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations/default",...e,headers:{"Content-Type":"application/json",...e.headers}}),dj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/export",...e}),fj=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),pj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e}),mj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),hj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),gj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries/generate",...e,headers:{"Content-Type":"application/json",...e.headers}}),yj=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e,headers:{"Content-Type":"application/json",...e.headers}}),bj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e}),vj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e,headers:{"Content-Type":"application/json",...e.headers}}),Sj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e}),xj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e,headers:{"Content-Type":"application/json",...e.headers}}),wj=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e}),jj=e=>(e?.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),Nv=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs/{id}",...e}),Nj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/apply",...e,headers:{"Content-Type":"application/json",...e.headers}}),kj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/timeline",...e}),Aj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/analytics/metrics",...e}),kv=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings",...e}),_j=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/providers/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Cj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/google",...e,headers:{"Content-Type":"application/json",...e.headers}}),zj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/bing",...e,headers:{"Content-Type":"application/json",...e.headers}}),Tj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/cdp",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ej=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),Oj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),Dj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e,headers:{"Content-Type":"application/json",...e.headers}}),Rj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e}),Mj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e,headers:{"Content-Type":"application/json",...e.headers}}),Bj=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}",...e}),Lj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}/test",...e}),qj=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/cdp/status",...e}),Uj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections",...e}),$j=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ij=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}",...e}),Vj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/properties",...e}),Pj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}/property",...e,headers:{"Content-Type":"application/json",...e.headers}}),Gj=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}/sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),Hj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),Qj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance",...e}),Kj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance/daily",...e}),Zj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspect",...e,headers:{"Content-Type":"application/json",...e.headers}}),Yj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspections",...e}),Xj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/deindexed",...e}),Av=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage",...e}),Jj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage/history",...e}),Fj=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/sitemaps",...e}),Wj=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/discover-sitemaps",...e}),eN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspect-sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),tN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/indexing/request",...e,headers:{"Content-Type":"application/json",...e.headers}}),nN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/locations",...e}),aN=e=>(e.client??K).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/locations/{locationName}/selection",...e,headers:{"Content-Type":"application/json",...e.headers}}),iN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),sN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/keywords",...e}),rN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/places",...e}),oN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/summary",...e}),lN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),cN=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/disconnect",...e}),uN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/status",...e}),dN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/sites",...e}),fN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/set-site",...e,headers:{"Content-Type":"application/json",...e.headers}}),_v=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/coverage",...e}),pN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspections",...e}),mN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspect-url",...e,headers:{"Content-Type":"application/json",...e.headers}}),hN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspect-sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),gN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/request-indexing",...e,headers:{"Content-Type":"application/json",...e.headers}}),yN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/performance",...e}),bN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),vN=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/disconnect",...e}),SN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/status",...e}),xN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),wN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/traffic",...e}),jN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/ai-referral-history",...e}),NN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/social-referral-history",...e}),kN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/session-history",...e}),AN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/insights",...e}),_N=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/report",...e}),CN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/citations/visibility",...e}),zN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/content/dismissals",...e,headers:{"Content-Type":"application/json",...e.headers}}),TN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/overview",...e}),EN=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/status",...e}),ON=e=>(e?.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/install",...e}),DN=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e}),RN=e=>(e?.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),MN=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs/latest",...e}),BN=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/releases",...e}),LN=e=>(e?.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/latest-release",...e}),qN=e=>(e.client??K).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/cache/{release}",...e}),UN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/extract",...e,headers:{"Content-Type":"application/json",...e.headers}}),$N=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/summary",...e}),IN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/domains",...e}),VN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/history",...e}),PN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/sources",...e}),GN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/bing-sync",...e}),HN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/cloud-run",...e,headers:{"Content-Type":"application/json",...e.headers}}),QN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/wordpress",...e,headers:{"Content-Type":"application/json",...e.headers}}),KN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/vercel",...e,headers:{"Content-Type":"application/json",...e.headers}}),ZN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),YN=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}/backfill",...e,headers:{"Content-Type":"application/json",...e.headers}}),XN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources",...e}),JN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/status",...e}),FN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}",...e}),WN=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/events",...e}),ek=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/run",...e,headers:{"Content-Type":"application/json",...e.headers}}),tk=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions",...e}),nk=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}",...e}),ak=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}/promote",...e}),ik=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}/promote",...e,headers:{"Content-Type":"application/json",...e.headers}}),sk=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo",...e}),rk=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/pages",...e}),ok=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/trend",...e}),lk=e=>(e.client??K).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/runs",...e,headers:{"Content-Type":"application/json",...e.headers}}),ck=e=>(e.client??K).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/agent/providers",...e});function uk(e){const n={baseUrl:e.baseUrl,fetch:e.fetch,headers:{...e.headers??{}}};return wv(n)}class Hn extends Error{code;statusCode;details;constructor(n,i,r,l){super(n),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=i,this.details=l}}function dk(){if(typeof window>"u")return null;const e=window.__CANONRY_CONFIG__?.embed;return e?.enabled?e:null}function fk(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Cv=fk();function pk(){const e=typeof window<"u"&&window.location?window.location.origin:"";return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?e+window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):e}function mk(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function hk(e){return`${mk()}${e}`}function gk(e,n){if(n===404)return"Health endpoint returned 404. Check basePath or reverse-proxy configuration and make sure the dashboard reaches /health instead of an API-prefixed route."}function yk(){return""}function nf(){return!!yk()}let zv=null;function Gy(e){zv=e}function Hf(){zv?.()}const se=uk({baseUrl:pk()});se.interceptors.response.use((e,n)=>(e.status===401&&!n.url.includes("/api/v1/session")&&Hf(),e));async function ce(e){const n=await e();if(n.error!==void 0&&n.error!==null){const i=n.response.status;let r=`API ${i}: ${n.response.statusText}`,l,c;if(typeof n.error=="object"&&n.error!==null){const d=n.error.error;if(typeof d=="string")r=d;else if(d&&typeof d=="object"){const h=d;h.message&&(r=h.message),h.code&&(l=h.code),h.details&&(c=h.details)}else{const h=n.error;h.message&&(r=h.message),h.code&&(l=h.code),h.details&&(c=h.details)}}else typeof n.error=="string"&&(r=n.error);throw new Hn(r,i,l,c)}if(n.response.status!==204)return n.data}async function Qf(e,n){const i=n?.body!=null,r=await fetch(`${Cv}${e}`,{...n,credentials:n?.credentials??"same-origin",headers:{...i?{"Content-Type":"application/json"}:{},...n?.headers}});if(!r.ok){const l=await r.text();let c=`API ${r.status}: ${r.statusText}`,d,h;if(l)try{const g=JSON.parse(l);typeof g.error=="string"?c=g.error:g.error?.message?(c=g.error.message,d=g.error.code,h=g.error.details):g.message&&(c=g.message)}catch{c=l}throw r.status===401&&!e.startsWith("/session")&&Hf(),new Hn(c,r.status,d,h)}if(r.status!==204)return r.json()}function Kf(e){return ce(()=>jv({client:se,path:{name:e}}))}function sB(e){return ce(()=>Sj({client:se,path:{name:e}}))}function nc(e){return ce(()=>Nv({client:se,path:{id:e}}))}function bk(e){return ce(()=>pj({client:se,path:{name:e}}))}function vk(e){return ce(()=>bj({client:se,path:{name:e}}))}function Sk(e,n){return ce(()=>kj({client:se,path:{name:e},query:{location:n}}))}function Tv(e,n){return ce(()=>TN({client:se,path:{name:e},query:{location:n?.location,since:n?.since}}))}function ho(e,n){return ce(()=>rj({client:se,path:{name:e},body:n}))}function xk(e,n){return ce(()=>hj({client:se,path:{name:e},body:{queries:n}}))}function wk(e,n){return ce(()=>mj({client:se,path:{name:e},body:{queries:n}}))}function rB(e,n){return ce(()=>fj({client:se,path:{name:e},body:{queries:n}}))}function jk(e,n){return ce(()=>zN({client:se,path:{name:e},body:n}))}function Nk(e,n){return ce(()=>vj({client:se,path:{name:e},body:{competitors:n}}))}function oB(e,n){return ce(()=>yj({client:se,path:{name:e},body:{competitors:n}}))}async function lB(e,n){const i=await Kf(e);return ho(e,{displayName:i.displayName??i.name,canonicalDomain:i.canonicalDomain,ownedDomains:n,aliases:i.aliases,country:i.country,language:i.language,tags:i.tags,labels:i.labels,providers:i.providers,locations:i.locations,defaultLocation:i.defaultLocation})}async function cB(e,n){const i=await Kf(e);return ho(e,{displayName:i.displayName??i.name,canonicalDomain:i.canonicalDomain,ownedDomains:i.ownedDomains,aliases:n,country:i.country,language:i.language,tags:i.tags,labels:i.labels,providers:i.providers,locations:i.locations,defaultLocation:i.defaultLocation})}async function uB(e,n){const i=await Kf(e);return ho(e,{displayName:n.displayName??i.displayName??i.name,canonicalDomain:n.canonicalDomain??i.canonicalDomain,ownedDomains:n.ownedDomains??i.ownedDomains,aliases:n.aliases??i.aliases,country:n.country??i.country,language:n.language??i.language,tags:i.tags,labels:i.labels,providers:i.providers,locations:n.locations??i.locations,defaultLocation:n.defaultLocation!==void 0?n.defaultLocation:i.defaultLocation})}function kk(e,n){const i={};return n?.location&&(i.location=n.location),n?.allLocations&&(i.allLocations=!0),n?.noLocation&&(i.noLocation=!0),ce(()=>xj({client:se,path:{name:e},body:i}))}function dB(e,n){return ce(()=>lj({client:se,path:{name:e},body:n}))}async function fB(e,n){await ce(()=>cj({client:se,path:{name:e,label:n}}))}function pB(e,n){return ce(()=>uj({client:se,path:{name:e},body:{label:n}}))}async function mB(e){await ce(()=>sj({client:se,path:{name:e}}))}function hB(e){return ce(()=>dj({client:se,path:{name:e}}))}function gB(){return ce(()=>kv({client:se}))}function Hy(){return Qf("/session")}function Ak(e){return Qf("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function _k(e){return Qf("/session",{method:"POST",body:JSON.stringify({password:e})})}function Ck(e,n){return ce(()=>_j({client:se,path:{name:e},body:n}))}function yB(e){return ce(()=>Cj({client:se,body:e}))}async function bB(e){try{return await ce(()=>Oj({client:se,path:{name:e}}))}catch(n){if(n instanceof Hn&&n.statusCode===404)return null;throw n}}function vB(e,n){return ce(()=>Dj({client:se,path:{name:e},body:n}))}async function SB(e){await ce(()=>Ej({client:se,path:{name:e}}))}function xB(e){return ce(()=>Rj({client:se,path:{name:e}}))}function wB(e,n){return ce(()=>Mj({client:se,path:{name:e},body:n}))}async function jB(e,n){await ce(()=>Bj({client:se,path:{name:e,id:n}}))}function NB(e,n){return ce(()=>Lj({client:se,path:{name:e,id:n}}))}function zk(e,n,i){return ce(()=>gj({client:se,path:{name:e},body:{provider:n,count:i}}))}function Tk(e){return ce(()=>Nj({client:se,body:e}))}function Ek(e){return ce(()=>jj({client:se,body:e??{}}))}function kB(e,n){return ce(()=>$j({client:se,path:{name:e},body:{type:n}}))}function AB(e,n){return ce(()=>Ij({client:se,path:{name:e,type:n}}))}function _B(e,n,i){return ce(()=>Pj({client:se,path:{name:e,type:n},body:{propertyId:i}}))}function CB(e,n,i){return ce(()=>Gj({client:se,path:{name:e,type:n},body:{sitemapUrl:i}}))}function Ok(e,n){return ce(()=>Hj({client:se,path:{name:e},body:n??{}}))}function zB(e,n){const i={};return n&&n!=="all"&&(i.window=n),ce(()=>Aj({client:se,path:{name:e},query:i}))}function TB(e,n){return ce(()=>Zj({client:se,path:{name:e},body:{url:n}}))}function Dk(e){return ce(()=>Av({client:se,path:{name:e}}))}function Rk(e,n){return ce(()=>eN({client:se,path:{name:e},body:n??{}}))}function EB(e){return ce(()=>Fj({client:se,path:{name:e}}))}function Mk(e){return ce(()=>Wj({client:se,path:{name:e}}))}function OB(e,n){return ce(()=>lk({client:se,path:{name:e},body:{}}))}function DB(e,n){return ce(()=>ek({client:se,path:{name:e},body:n??{}}))}function RB(e,n,i){return ce(()=>ik({client:se,path:{name:e,id:n},body:i??{}}))}function MB(){return ce(()=>qj({client:se}))}function BB(e,n){return ce(()=>Tj({client:se,body:{host:e,port:n}}))}function LB(e,n){return ce(()=>tN({client:se,path:{name:e},body:n}))}function qB(e,n){return ce(()=>lN({client:se,path:{name:e},body:{apiKey:n}}))}function UB(e){return ce(()=>cN({client:se,path:{name:e}}))}function $B(e,n){return ce(()=>fN({client:se,path:{name:e},body:{siteUrl:n}}))}function Bk(e){return ce(()=>_v({client:se,path:{name:e}}))}function IB(e,n){return ce(()=>mN({client:se,path:{name:e},body:{url:n}}))}function VB(e,n){return ce(()=>hN({client:se,path:{name:e},body:{}}))}function PB(e,n){return ce(()=>gN({client:se,path:{name:e},body:n}))}function GB(e){return ce(()=>zj({client:se,body:{apiKey:e}}))}function Lk(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function HB(e,n="agency"){const i=new URLSearchParams({audience:n}),r=await fetch(`${Cv}/projects/${encodeURIComponent(e)}/report.html?${i.toString()}`,{credentials:"same-origin",headers:{}});if(!r.ok)throw new Hn(`Failed to download report: ${r.status}`,r.status);const l=await r.blob(),c=URL.createObjectURL(l),d=Lk(r.headers.get("Content-Disposition"))??`canonry-report-${e}.html`,h=document.createElement("a");h.href=c,h.download=d,document.body.appendChild(h),h.click(),document.body.removeChild(h),URL.revokeObjectURL(c)}function QB(e,n){return ce(()=>xN({client:se,path:{name:e},body:{}}))}function KB(e,n){return ce(()=>bN({client:se,path:{name:e},body:n}))}function ZB(e){return ce(()=>vN({client:se,path:{name:e}}))}function YB(e,n){return ce(()=>HN({client:se,path:{name:e},body:n}))}function XB(e,n){return ce(()=>QN({client:se,path:{name:e},body:n}))}function JB(e,n){return ce(()=>KN({client:se,path:{name:e},body:n}))}function FB(e,n,i){return ce(()=>ZN({client:se,path:{name:e,id:n},body:i??{}}))}function WB(e,n,i){return ce(()=>YN({client:se,path:{name:e,id:n},body:{}}))}function qk(e,n){return ce(()=>AN({client:se,path:{name:e},query:{runId:n}}))}function Uk(e){if(!e||typeof e!="object")return;const n=e;if(!(typeof n.current!="string"||typeof n.latest!="string"||typeof n.url!="string"||typeof n.upgradeCommand!="string"))return{current:n.current,latest:n.latest,url:n.url,upgradeCommand:n.upgradeCommand}}async function $k(e,n){const i=hk(e);try{const r=await fetch(i,{credentials:"same-origin"});if(!r.ok)return{label:n,state:"error",detail:`${n} ${r.status}: ${r.statusText}`,statusCode:r.status,hint:gk(e,r.status)};const l=await r.json(),c=typeof l.version=="string"?l.version:"unknown",d=typeof l.databaseUrlConfigured=="boolean"?l.databaseUrlConfigured:void 0,h=typeof l.lastHeartbeatAt=="string"?l.lastHeartbeatAt:void 0,g=Uk(l.updateAvailable),b=[c,d===!1?"database not configured":"database configured",h?`heartbeat ${h}`:void 0].filter(Boolean).join(" · ");return{label:n,state:"ok",detail:b,version:c,databaseConfigured:d,lastHeartbeatAt:h,...g?{updateAvailable:g}:{}}}catch(r){return{label:n,state:"error",detail:r instanceof Error?r.message:"unreachable",hint:e==="/health"?`Request failed while checking ${i}. If this instance is served behind a sub-path, verify the dashboard basePath and reverse-proxy rewrites.`:void 0}}}function eL(){return ce(()=>EN({client:se}))}function tL(){return ce(()=>ON({client:se}))}function nL(){return ce(()=>MN({client:se}))}function aL(){return ce(()=>DN({client:se}))}function iL(e){return ce(()=>RN({client:se,body:e?{release:e}:{}}))}function sL(){return ce(()=>BN({client:se}))}function rL(){return ce(()=>LN({client:se}))}function oL(e){return ce(()=>qN({client:se,path:{release:e}}))}function lL(e,n={}){return ce(()=>$N({client:se,path:{name:e},query:{release:n.release,excludeCrawlers:n.excludeCrawlers?"1":void 0,source:n.source}}))}function cL(e,n={}){return ce(()=>IN({client:se,path:{name:e},query:{limit:n.limit!==void 0?String(n.limit):void 0,offset:n.offset!==void 0?String(n.offset):void 0,release:n.release,excludeCrawlers:n.excludeCrawlers?"1":void 0,source:n.source}}))}function uL(e,n={}){return ce(()=>VN({client:se,path:{name:e},query:{source:n.source}}))}function dL(e,n={}){return ce(()=>PN({client:se,path:{name:e},query:{excludeCrawlers:n.excludeCrawlers?"1":void 0}}))}function fL(e,n){return ce(()=>UN({client:se,path:{name:e},body:{release:void 0}}))}function pL(e){return ce(()=>GN({client:se,path:{name:e}}))}function wn(e){return(...n)=>{e(...n)}}const Ik=6e3,Vk=5,Pk=180;let It=[],Gk=0;const vf=new Set,Sf=new Map,xf=new Map;function ac(){const e=[...It];for(const n of vf)n(e)}function Zf(e){const n=Sf.get(e);n&&(clearTimeout(n),Sf.delete(e));const i=xf.get(e);i&&(clearTimeout(i),xf.delete(e))}function Ev(e){Zf(e);const n=It.length;It=It.filter(i=>i.id!==e),It.length!==n&&ac()}function Qy(e){Zf(e.id),Sf.set(e.id,setTimeout(()=>{wf(e.id)},e.durationMs))}function Hk(e,n,i){return typeof e=="string"?{title:e,tone:n,durationMs:i}:e}function en(e,n="negative",i=Ik){const r=Hk(e,n,i),l={id:String(++Gk),title:r.title,detail:r.detail,tone:r.tone??n,durationMs:r.durationMs??i,dedupeKey:r.dedupeKey,cta:r.cta,state:"open"};if(r.dedupeKey){const c=It.find(d=>d.dedupeKey===r.dedupeKey);if(c){if((r.dedupeMode??"drop")==="drop")return c.id;const d={...c,title:l.title,detail:l.detail,tone:l.tone,durationMs:l.durationMs,cta:l.cta,state:"open"};return It=It.map(h=>h.id===c.id?d:h),ac(),Qy(d),c.id}}return It.length>=Vk&&Ev(It[0].id),It=[...It,l],ac(),Qy(l),l.id}function wf(e){const n=It.find(i=>i.id===e);!n||n.state==="closing"||(Zf(e),It=It.map(i=>i.id===e?{...i,state:"closing"}:i),ac(),xf.set(e,setTimeout(()=>{Ev(e)},Pk)))}function Qk(e){return vf.add(e),()=>{vf.delete(e)}}function Ky(){return It}const Kk=5*6e4,jf=30*6e4,mL=3e4,hL=6e4,lo=3e4,Zk=2e3,Yk=5e3;function Xk(){return new kw({defaultOptions:{queries:{staleTime:Kk,retry:1,refetchOnWindowFocus:!1}},mutationCache:new Aw({onError:(e,n,i,r)=>{r.meta?.skipGlobalErrorToast||en({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const Jk="modulepreload",Fk=function(e,n){return new URL(e,n).href},Zy={},Hs=function(n,i,r){let l=Promise.resolve();if(i&&i.length>0){let b=function(S){return Promise.all(S.map(x=>Promise.resolve(x).then(N=>({status:"fulfilled",value:N}),N=>({status:"rejected",reason:N}))))};const d=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),g=h?.nonce||h?.getAttribute("nonce");l=b(i.map(S=>{if(S=Fk(S,r),S in Zy)return;Zy[S]=!0;const x=S.endsWith(".css"),N=x?'[rel="stylesheet"]':"";if(r)for(let T=d.length-1;T>=0;T--){const k=d[T];if(k.href===S&&(!x||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${S}"]${N}`))return;const _=document.createElement("link");if(_.rel=x?"stylesheet":Jk,x||(_.as="script"),_.crossOrigin="",_.href=S,g&&_.setAttribute("nonce",g),document.head.appendChild(_),x)return new Promise((T,k)=>{_.addEventListener("load",T),_.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${S}`)))})}))}function c(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return l.then(d=>{for(const h of d||[])h.status==="rejected"&&c(h.reason);return n().catch(c)})};const Wk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),eA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,r)=>r?r.toUpperCase():i.toLowerCase()),Yy=e=>{const n=eA(e);return n.charAt(0).toUpperCase()+n.slice(1)},Ov=(...e)=>e.filter((n,i,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===i).join(" ").trim(),tA=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var nA={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 aA=U.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:r,className:l="",children:c,iconNode:d,...h},g)=>U.createElement("svg",{ref:g,...nA,width:n,height:n,stroke:e,strokeWidth:r?Number(i)*24/Number(n):i,className:Ov("lucide",l),...!c&&!tA(h)&&{"aria-hidden":"true"},...h},[...d.map(([b,S])=>U.createElement(b,S)),...Array.isArray(c)?c:[c]]));const et=(e,n)=>{const i=U.forwardRef(({className:r,...l},c)=>U.createElement(aA,{ref:c,iconNode:n,className:Ov(`lucide-${Wk(Yy(e))}`,`lucide-${e}`,r),...l}));return i.displayName=Yy(e),i};const iA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],sA=et("arrow-right",iA);const rA=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],oA=et("arrow-up",rA);const lA=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],cA=et("book-open",lA);const uA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Dv=et("check",uA);const dA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],fA=et("chevron-down",dA);const pA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Yf=et("chevron-right",pA);const mA=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],hA=et("copy",mA);const gA=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],yA=et("file-text",gA);const bA=[["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"}]],vA=et("github",bA);const SA=[["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"}]],xA=et("globe",SA);const wA=[["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"}]],jA=et("layout-dashboard",wA);const NA=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],kA=et("link-2",NA);const AA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],_A=et("loader-circle",AA);const CA=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],zA=et("maximize-2",CA);const TA=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],EA=et("menu",TA);const OA=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],DA=et("minimize-2",OA);const RA=[["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"}]],MA=et("play",RA);const BA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Xy=et("plus",BA);const LA=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],qA=et("radar",LA);const UA=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Jy=et("radio",UA);const $A=[["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"}]],IA=et("rocket",$A);const VA=[["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"}]],Rv=et("rotate-ccw",VA);const PA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],GA=et("search",PA);const HA=[["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"}]],QA=et("settings",HA);const KA=[["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"}]],Mv=et("triangle-alert",KA);const ZA=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],YA=et("wrench",ZA);const XA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qs=et("x",XA);function H(e,n,i){function r(h,g){if(h._zod||Object.defineProperty(h,"_zod",{value:{def:g,constr:d,traits:new Set},enumerable:!1}),h._zod.traits.has(e))return;h._zod.traits.add(e),n(h,g);const b=d.prototype,S=Object.keys(b);for(let x=0;x<S.length;x++){const N=S[x];N in h||(h[N]=b[N].bind(h))}}const l=i?.Parent??Object;class c extends l{}Object.defineProperty(c,"name",{value:e});function d(h){var g;const b=i?.Parent?new c:this;r(b,h),(g=b._zod).deferred??(g.deferred=[]);for(const S of b._zod.deferred)S();return b}return Object.defineProperty(d,"init",{value:r}),Object.defineProperty(d,Symbol.hasInstance,{value:h=>i?.Parent&&h instanceof i.Parent?!0:h?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class Ms extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Bv extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const Lv={};function Ya(e){return Lv}function qv(e){const n=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,l])=>n.indexOf(+r)===-1).map(([r,l])=>l)}function Nf(e,n){return typeof n=="bigint"?n.toString():n}function yc(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function Xf(e){return e==null}function Jf(e){const n=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(n,i)}function JA(e,n){const i=(e.toString().split(".")[1]||"").length,r=n.toString();let l=(r.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(r)){const g=r.match(/\d?e-(\d?)/);g?.[1]&&(l=Number.parseInt(g[1]))}const c=i>l?i:l,d=Number.parseInt(e.toFixed(c).replace(".","")),h=Number.parseInt(n.toFixed(c).replace(".",""));return d%h/10**c}const Fy=Symbol("evaluating");function Pe(e,n,i){let r;Object.defineProperty(e,n,{get(){if(r!==Fy)return r===void 0&&(r=Fy,r=i()),r},set(l){Object.defineProperty(e,n,{value:l})},configurable:!0})}function Ti(e,n,i){Object.defineProperty(e,n,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Fa(...e){const n={};for(const i of e){const r=Object.getOwnPropertyDescriptors(i);Object.assign(n,r)}return Object.defineProperties({},n)}function Wy(e){return JSON.stringify(e)}function FA(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Uv="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function co(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const WA=yc(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Us(e){if(co(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const i=n.prototype;return!(co(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function $v(e){return Us(e)?{...e}:Array.isArray(e)?[...e]:e}const e2=new Set(["string","number","symbol"]);function $s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wa(e,n,i){const r=new e._zod.constr(n??e._zod.def);return(!n||i?.parent)&&(r._zod.parent=e),r}function ye(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function t2(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const n2={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function a2(e,n){const i=e._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=Fa(e._zod.def,{get shape(){const d={};for(const h in n){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(d[h]=i.shape[h])}return Ti(this,"shape",d),d},checks:[]});return Wa(e,c)}function i2(e,n){const i=e._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=Fa(e._zod.def,{get shape(){const d={...e._zod.def.shape};for(const h in n){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);n[h]&&delete d[h]}return Ti(this,"shape",d),d},checks:[]});return Wa(e,c)}function s2(e,n){if(!Us(n))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0){const c=e._zod.def.shape;for(const d in n)if(Object.getOwnPropertyDescriptor(c,d)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=Fa(e._zod.def,{get shape(){const c={...e._zod.def.shape,...n};return Ti(this,"shape",c),c}});return Wa(e,l)}function r2(e,n){if(!Us(n))throw new Error("Invalid input to safeExtend: expected a plain object");const i=Fa(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n};return Ti(this,"shape",r),r}});return Wa(e,i)}function o2(e,n){const i=Fa(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n._zod.def.shape};return Ti(this,"shape",r),r},get catchall(){return n._zod.def.catchall},checks:[]});return Wa(e,i)}function l2(e,n,i){const l=n._zod.def.checks;if(l&&l.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const d=Fa(n._zod.def,{get shape(){const h=n._zod.def.shape,g={...h};if(i)for(const b in i){if(!(b in h))throw new Error(`Unrecognized key: "${b}"`);i[b]&&(g[b]=e?new e({type:"optional",innerType:h[b]}):h[b])}else for(const b in h)g[b]=e?new e({type:"optional",innerType:h[b]}):h[b];return Ti(this,"shape",g),g},checks:[]});return Wa(n,d)}function c2(e,n,i){const r=Fa(n._zod.def,{get shape(){const l=n._zod.def.shape,c={...l};if(i)for(const d in i){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);i[d]&&(c[d]=new e({type:"nonoptional",innerType:l[d]}))}else for(const d in l)c[d]=new e({type:"nonoptional",innerType:l[d]});return Ti(this,"shape",c),c}});return Wa(n,r)}function Ts(e,n=0){if(e.aborted===!0)return!0;for(let i=n;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function Es(e,n){return n.map(i=>{var r;return(r=i).path??(r.path=[]),i.path.unshift(e),i})}function $l(e){return typeof e=="string"?e:e?.message}function Xa(e,n,i){const r={...e,path:e.path??[]};if(!e.message){const l=$l(e.inst?._zod.def?.error?.(e))??$l(n?.error?.(e))??$l(i.customError?.(e))??$l(i.localeError?.(e))??"Invalid input";r.message=l}return delete r.inst,delete r.continue,n?.reportInput||delete r.input,r}function Ff(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function uo(...e){const[n,i,r]=e;return typeof n=="string"?{message:n,code:"custom",input:i,inst:r}:{...n}}const Iv=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,Nf,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Vv=H("$ZodError",Iv),Pv=H("$ZodError",Iv,{Parent:Error});function u2(e,n=i=>i.message){const i={},r=[];for(const l of e.issues)l.path.length>0?(i[l.path[0]]=i[l.path[0]]||[],i[l.path[0]].push(n(l))):r.push(n(l));return{formErrors:r,fieldErrors:i}}function d2(e,n=i=>i.message){const i={_errors:[]},r=l=>{for(const c of l.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>r({issues:d}));else if(c.code==="invalid_key")r({issues:c.issues});else if(c.code==="invalid_element")r({issues:c.issues});else if(c.path.length===0)i._errors.push(n(c));else{let d=i,h=0;for(;h<c.path.length;){const g=c.path[h];h===c.path.length-1?(d[g]=d[g]||{_errors:[]},d[g]._errors.push(n(c))):d[g]=d[g]||{_errors:[]},d=d[g],h++}}};return r(e),i}const Wf=e=>(n,i,r,l)=>{const c=r?Object.assign(r,{async:!1}):{async:!1},d=n._zod.run({value:i,issues:[]},c);if(d instanceof Promise)throw new Ms;if(d.issues.length){const h=new(l?.Err??e)(d.issues.map(g=>Xa(g,c,Ya())));throw Uv(h,l?.callee),h}return d.value},ep=e=>async(n,i,r,l)=>{const c=r?Object.assign(r,{async:!0}):{async:!0};let d=n._zod.run({value:i,issues:[]},c);if(d instanceof Promise&&(d=await d),d.issues.length){const h=new(l?.Err??e)(d.issues.map(g=>Xa(g,c,Ya())));throw Uv(h,l?.callee),h}return d.value},bc=e=>(n,i,r)=>{const l=r?{...r,async:!1}:{async:!1},c=n._zod.run({value:i,issues:[]},l);if(c instanceof Promise)throw new Ms;return c.issues.length?{success:!1,error:new(e??Vv)(c.issues.map(d=>Xa(d,l,Ya())))}:{success:!0,data:c.value}},f2=bc(Pv),vc=e=>async(n,i,r)=>{const l=r?Object.assign(r,{async:!0}):{async:!0};let c=n._zod.run({value:i,issues:[]},l);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(d=>Xa(d,l,Ya())))}:{success:!0,data:c.value}},p2=vc(Pv),m2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Wf(e)(n,i,l)},h2=e=>(n,i,r)=>Wf(e)(n,i,r),g2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ep(e)(n,i,l)},y2=e=>async(n,i,r)=>ep(e)(n,i,r),b2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return bc(e)(n,i,l)},v2=e=>(n,i,r)=>bc(e)(n,i,r),S2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return vc(e)(n,i,l)},x2=e=>async(n,i,r)=>vc(e)(n,i,r),w2=/^[cC][^\s-]{8,}$/,j2=/^[0-9a-z]+$/,N2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,k2=/^[0-9a-vA-V]{20}$/,A2=/^[A-Za-z0-9]{27}$/,_2=/^[a-zA-Z0-9_-]{21}$/,C2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,z2=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,eb=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,T2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,E2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function O2(){return new RegExp(E2,"u")}const D2=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,R2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,M2=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,B2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,L2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Gv=/^[A-Za-z0-9_-]*$/,q2=/^\+[1-9]\d{6,14}$/,Hv="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",U2=new RegExp(`^${Hv}$`);function Qv(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function $2(e){return new RegExp(`^${Qv(e)}$`)}function I2(e){const n=Qv({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${n}(?:${i.join("|")})`;return new RegExp(`^${Hv}T(?:${r})$`)}const V2=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},P2=/^-?\d+$/,Kv=/^-?\d+(?:\.\d+)?$/,G2=/^(?:true|false)$/i,H2=/^[^A-Z]*$/,Q2=/^[^a-z]*$/,nn=H("$ZodCheck",(e,n)=>{var i;e._zod??(e._zod={}),e._zod.def=n,(i=e._zod).onattach??(i.onattach=[])}),Zv={number:"number",bigint:"bigint",object:"date"},Yv=H("$ZodCheckLessThan",(e,n)=>{nn.init(e,n);const i=Zv[typeof n.value];e._zod.onattach.push(r=>{const l=r._zod.bag,c=(n.inclusive?l.maximum:l.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<c&&(n.inclusive?l.maximum=n.value:l.exclusiveMaximum=n.value)}),e._zod.check=r=>{(n.inclusive?r.value<=n.value:r.value<n.value)||r.issues.push({origin:i,code:"too_big",maximum:typeof n.value=="object"?n.value.getTime():n.value,input:r.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Xv=H("$ZodCheckGreaterThan",(e,n)=>{nn.init(e,n);const i=Zv[typeof n.value];e._zod.onattach.push(r=>{const l=r._zod.bag,c=(n.inclusive?l.minimum:l.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>c&&(n.inclusive?l.minimum=n.value:l.exclusiveMinimum=n.value)}),e._zod.check=r=>{(n.inclusive?r.value>=n.value:r.value>n.value)||r.issues.push({origin:i,code:"too_small",minimum:typeof n.value=="object"?n.value.getTime():n.value,input:r.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),K2=H("$ZodCheckMultipleOf",(e,n)=>{nn.init(e,n),e._zod.onattach.push(i=>{var r;(r=i._zod.bag).multipleOf??(r.multipleOf=n.value)}),e._zod.check=i=>{if(typeof i.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%n.value===BigInt(0):JA(i.value,n.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:n.value,input:i.value,inst:e,continue:!n.abort})}}),Z2=H("$ZodCheckNumberFormat",(e,n)=>{nn.init(e,n),n.format=n.format||"float64";const i=n.format?.includes("int"),r=i?"int":"number",[l,c]=n2[n.format];e._zod.onattach.push(d=>{const h=d._zod.bag;h.format=n.format,h.minimum=l,h.maximum=c,i&&(h.pattern=P2)}),e._zod.check=d=>{const h=d.value;if(i){if(!Number.isInteger(h)){d.issues.push({expected:r,format:n.format,code:"invalid_type",continue:!1,input:h,inst:e});return}if(!Number.isSafeInteger(h)){h>0?d.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!n.abort}):d.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!n.abort});return}}h<l&&d.issues.push({origin:"number",input:h,code:"too_small",minimum:l,inclusive:!0,inst:e,continue:!n.abort}),h>c&&d.issues.push({origin:"number",input:h,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!n.abort})}}),Y2=H("$ZodCheckMaxLength",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Xf(l)&&l.length!==void 0}),e._zod.onattach.push(r=>{const l=r._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<l&&(r._zod.bag.maximum=n.maximum)}),e._zod.check=r=>{const l=r.value;if(l.length<=n.maximum)return;const d=Ff(l);r.issues.push({origin:d,code:"too_big",maximum:n.maximum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),X2=H("$ZodCheckMinLength",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Xf(l)&&l.length!==void 0}),e._zod.onattach.push(r=>{const l=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>l&&(r._zod.bag.minimum=n.minimum)}),e._zod.check=r=>{const l=r.value;if(l.length>=n.minimum)return;const d=Ff(l);r.issues.push({origin:d,code:"too_small",minimum:n.minimum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),J2=H("$ZodCheckLengthEquals",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Xf(l)&&l.length!==void 0}),e._zod.onattach.push(r=>{const l=r._zod.bag;l.minimum=n.length,l.maximum=n.length,l.length=n.length}),e._zod.check=r=>{const l=r.value,c=l.length;if(c===n.length)return;const d=Ff(l),h=c>n.length;r.issues.push({origin:d,...h?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!n.abort})}}),Sc=H("$ZodCheckStringFormat",(e,n)=>{var i,r;nn.init(e,n),e._zod.onattach.push(l=>{const c=l._zod.bag;c.format=n.format,n.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(n.pattern))}),n.pattern?(i=e._zod).check??(i.check=l=>{n.pattern.lastIndex=0,!n.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:n.format,input:l.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(r=e._zod).check??(r.check=()=>{})}),F2=H("$ZodCheckRegex",(e,n)=>{Sc.init(e,n),e._zod.check=i=>{n.pattern.lastIndex=0,!n.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),W2=H("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=H2),Sc.init(e,n)}),e_=H("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=Q2),Sc.init(e,n)}),t_=H("$ZodCheckIncludes",(e,n)=>{nn.init(e,n);const i=$s(n.includes),r=new RegExp(typeof n.position=="number"?`^.{${n.position}}${i}`:i);n.pattern=r,e._zod.onattach.push(l=>{const c=l._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(r)}),e._zod.check=l=>{l.value.includes(n.includes,n.position)||l.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:l.value,inst:e,continue:!n.abort})}}),n_=H("$ZodCheckStartsWith",(e,n)=>{nn.init(e,n);const i=new RegExp(`^${$s(n.prefix)}.*`);n.pattern??(n.pattern=i),e._zod.onattach.push(r=>{const l=r._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(i)}),e._zod.check=r=>{r.value.startsWith(n.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:r.value,inst:e,continue:!n.abort})}}),a_=H("$ZodCheckEndsWith",(e,n)=>{nn.init(e,n);const i=new RegExp(`.*${$s(n.suffix)}$`);n.pattern??(n.pattern=i),e._zod.onattach.push(r=>{const l=r._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(i)}),e._zod.check=r=>{r.value.endsWith(n.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:r.value,inst:e,continue:!n.abort})}}),i_=H("$ZodCheckOverwrite",(e,n)=>{nn.init(e,n),e._zod.check=i=>{i.value=n.tx(i.value)}});class s_{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const r=n.split(`
14
+ `);try{J=JSON.parse(Se),fe=!0}catch{J=Se}}fe&&(l&&await l(J),r&&(J=await r(J))),i?.({data:J,event:B,id:x,retry:k}),ee.length&&(yield J)}}}finally{R.removeEventListener("abort",le),O.releaseLock()}break}catch(G){if(n?.(G),d!==void 0&&E>=d)break;const Z=Math.min(k*2**(E-1),h??3e4);await N(Z)}}}()}},Gw=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Hw=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},Qw=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},bv=({allowReserved:e,explode:n,name:i,style:r,value:l})=>{if(!n){const h=(e?l:l.map(g=>encodeURIComponent(g))).join(Hw(r));switch(r){case"label":return`.${h}`;case"matrix":return`;${i}=${h}`;case"simple":return h;default:return`${i}=${h}`}}const c=Gw(r),d=l.map(h=>r==="label"||r==="simple"?e?h:encodeURIComponent(h):gc({allowReserved:e,name:i,value:h})).join(c);return r==="label"||r==="matrix"?c+d:d},gc=({allowReserved:e,name:n,value:i})=>{if(i==null)return"";if(typeof i=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${n}=${e?i:encodeURIComponent(i)}`},vv=({allowReserved:e,explode:n,name:i,style:r,value:l,valueOnly:c})=>{if(l instanceof Date)return c?l.toISOString():`${i}=${l.toISOString()}`;if(r!=="deepObject"&&!n){let g=[];Object.entries(l).forEach(([S,x])=>{g=[...g,S,e?x:encodeURIComponent(x)]});const v=g.join(",");switch(r){case"form":return`${i}=${v}`;case"label":return`.${v}`;case"matrix":return`;${i}=${v}`;default:return v}}const d=Qw(r),h=Object.entries(l).map(([g,v])=>gc({allowReserved:e,name:r==="deepObject"?`${i}[${g}]`:g,value:v})).join(d);return r==="label"||r==="matrix"?d+h:h},Kw=/\{[^{}]+\}/g,Zw=({path:e,url:n})=>{let i=n;const r=n.match(Kw);if(r)for(const l of r){let c=!1,d=l.substring(1,l.length-1),h="simple";d.endsWith("*")&&(c=!0,d=d.substring(0,d.length-1)),d.startsWith(".")?(d=d.substring(1),h="label"):d.startsWith(";")&&(d=d.substring(1),h="matrix");const g=e[d];if(g==null)continue;if(Array.isArray(g)){i=i.replace(l,bv({explode:c,name:d,style:h,value:g}));continue}if(typeof g=="object"){i=i.replace(l,vv({explode:c,name:d,style:h,value:g,valueOnly:!0}));continue}if(h==="matrix"){i=i.replace(l,`;${gc({name:d,value:g})}`);continue}const v=encodeURIComponent(h==="label"?`.${g}`:g);i=i.replace(l,v)}return i},Yw=({baseUrl:e,path:n,query:i,querySerializer:r,url:l})=>{const c=l.startsWith("/")?l:`/${l}`;let d=(e??"")+c;n&&(d=Zw({path:n,url:d}));let h=i?r(i):"";return h.startsWith("?")&&(h=h.substring(1)),h&&(d+=`?${h}`),d};function Xw(e){const n=e.body!==void 0;if(n&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(n)return e.body}const Jw=async(e,n)=>{const i=typeof n=="function"?await n(e):n;if(i)return e.scheme==="bearer"?`Bearer ${i}`:e.scheme==="basic"?`Basic ${btoa(i)}`:i},Sv=({allowReserved:e,array:n,object:i}={})=>l=>{const c=[];if(l&&typeof l=="object")for(const d in l){const h=l[d];if(h!=null)if(Array.isArray(h)){const g=bv({allowReserved:e,explode:!0,name:d,style:"form",value:h,...n});g&&c.push(g)}else if(typeof h=="object"){const g=vv({allowReserved:e,explode:!0,name:d,style:"deepObject",value:h,...i});g&&c.push(g)}else{const g=gc({allowReserved:e,name:d,value:h});g&&c.push(g)}}return c.join("&")},Fw=e=>{if(!e)return"stream";const n=e.split(";")[0]?.trim();if(n){if(n.startsWith("application/json")||n.endsWith("+json"))return"json";if(n==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(i=>n.startsWith(i)))return"blob";if(n.startsWith("text/"))return"text"}},Ww=(e,n)=>n?!!(e.headers.has(n)||e.query?.[n]||e.headers.get("Cookie")?.includes(`${n}=`)):!1,ej=async({security:e,...n})=>{for(const i of e){if(Ww(n,i.name))continue;const r=await Jw(i,n.auth);if(!r)continue;const l=i.name??"Authorization";switch(i.in){case"query":n.query||(n.query={}),n.query[l]=r;break;case"cookie":n.headers.append("Cookie",`${l}=${r}`);break;default:n.headers.set(l,r);break}}},Py=e=>Yw({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:Sv(e.querySerializer),url:e.url}),Gy=(e,n)=>{const i={...e,...n};return i.baseUrl?.endsWith("/")&&(i.baseUrl=i.baseUrl.substring(0,i.baseUrl.length-1)),i.headers=xv(e.headers,n.headers),i},tj=e=>{const n=[];return e.forEach((i,r)=>{n.push([r,i])}),n},xv=(...e)=>{const n=new Headers;for(const i of e){if(!i)continue;const r=i instanceof Headers?tj(i):Object.entries(i);for(const[l,c]of r)if(c===null)n.delete(l);else if(Array.isArray(c))for(const d of c)n.append(l,d);else c!==void 0&&n.set(l,typeof c=="object"?JSON.stringify(c):c)}return n};class tf{fns=[];clear(){this.fns=[]}eject(n){const i=this.getInterceptorIndex(n);this.fns[i]&&(this.fns[i]=null)}exists(n){const i=this.getInterceptorIndex(n);return!!this.fns[i]}getInterceptorIndex(n){return typeof n=="number"?this.fns[n]?n:-1:this.fns.indexOf(n)}update(n,i){const r=this.getInterceptorIndex(n);return this.fns[r]?(this.fns[r]=i,n):!1}use(n){return this.fns.push(n),this.fns.length-1}}const nj=()=>({error:new tf,request:new tf,response:new tf}),aj=Sv({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),ij={"Content-Type":"application/json"},wv=(e={})=>({...Vw,headers:ij,parseAs:"auto",querySerializer:aj,...e}),jv=(e={})=>{let n=Gy(wv(),e);const i=()=>({...n}),r=v=>(n=Gy(n,v),i()),l=nj(),c=async v=>{const S={...n,...v,fetch:v.fetch??n.fetch??globalThis.fetch,headers:xv(n.headers,v.headers),serializedBody:void 0};S.security&&await ej({...S,security:S.security}),S.requestValidator&&await S.requestValidator(S),S.body!==void 0&&S.bodySerializer&&(S.serializedBody=S.bodySerializer(S.body)),(S.body===void 0||S.serializedBody==="")&&S.headers.delete("Content-Type");const x=Py(S);return{opts:S,url:x}},d=async v=>{const{opts:S,url:x}=await c(v),N={redirect:"follow",...S,body:Xw(S)};let _=new Request(x,N);for(const X of l.request.fns)X&&(_=await X(_,S));const T=S.fetch;let k=await T(_);for(const X of l.response.fns)X&&(k=await X(k,_,S));const E={request:_,response:k};if(k.ok){const X=(S.parseAs==="auto"?Fw(k.headers.get("Content-Type")):S.parseAs)??"json";if(k.status===204||k.headers.get("Content-Length")==="0"){let O;switch(X){case"arrayBuffer":case"blob":case"text":O=await k[X]();break;case"formData":O=new FormData;break;case"stream":O=k.body;break;default:O={};break}return S.responseStyle==="data"?O:{data:O,...E}}let F;switch(X){case"arrayBuffer":case"blob":case"formData":case"json":case"text":F=await k[X]();break;case"stream":return S.responseStyle==="data"?k.body:{data:k.body,...E}}return X==="json"&&(S.responseValidator&&await S.responseValidator(F),S.responseTransformer&&(F=await S.responseTransformer(F))),S.responseStyle==="data"?F:{data:F,...E}}const R=await k.text();let V;try{V=JSON.parse(R)}catch{}const G=V??R;let Z=G;for(const X of l.error.fns)X&&(Z=await X(G,k,_,S));if(Z=Z||{},S.throwOnError)throw Z;return S.responseStyle==="data"?void 0:{error:Z,...E}},h=v=>S=>d({...S,method:v}),g=v=>async S=>{const{opts:x,url:N}=await c(S);return Pw({...x,body:x.body,headers:x.headers,method:v,onRequest:async(_,T)=>{let k=new Request(_,T);for(const E of l.request.fns)E&&(k=await E(k,x));return k},url:N})};return{buildUrl:Py,connect:h("CONNECT"),delete:h("DELETE"),get:h("GET"),getConfig:i,head:h("HEAD"),interceptors:l,options:h("OPTIONS"),patch:h("PATCH"),post:h("POST"),put:h("PUT"),request:d,setConfig:r,sse:{connect:g("CONNECT"),delete:g("DELETE"),get:g("GET"),head:g("HEAD"),options:g("OPTIONS"),patch:g("PATCH"),post:g("POST"),put:g("PUT"),trace:g("TRACE")},trace:h("TRACE")}},H=jv(wv()),sj=e=>(e.client??H).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),Nv=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),rj=e=>(e.client??H).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),oj=e=>(e?.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects",...e}),lj=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations",...e,headers:{"Content-Type":"application/json",...e.headers}}),cj=e=>(e.client??H).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations/{label}",...e}),uj=e=>(e.client??H).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations/default",...e,headers:{"Content-Type":"application/json",...e.headers}}),dj=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/export",...e}),fj=e=>(e.client??H).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),pj=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e}),mj=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),hj=e=>(e.client??H).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),gj=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries/generate",...e,headers:{"Content-Type":"application/json",...e.headers}}),yj=e=>(e.client??H).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e,headers:{"Content-Type":"application/json",...e.headers}}),bj=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e}),vj=e=>(e.client??H).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e,headers:{"Content-Type":"application/json",...e.headers}}),Sj=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e}),xj=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e,headers:{"Content-Type":"application/json",...e.headers}}),wj=e=>(e?.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e}),jj=e=>(e?.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),kv=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs/{id}",...e}),Nj=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/apply",...e,headers:{"Content-Type":"application/json",...e.headers}}),kj=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/timeline",...e}),Aj=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/analytics/metrics",...e}),Av=e=>(e?.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings",...e}),_j=e=>(e.client??H).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/providers/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Cj=e=>(e.client??H).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/google",...e,headers:{"Content-Type":"application/json",...e.headers}}),zj=e=>(e.client??H).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/bing",...e,headers:{"Content-Type":"application/json",...e.headers}}),Tj=e=>(e.client??H).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/cdp",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ej=e=>(e.client??H).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),Oj=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),Dj=e=>(e.client??H).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e,headers:{"Content-Type":"application/json",...e.headers}}),Rj=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e}),Mj=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e,headers:{"Content-Type":"application/json",...e.headers}}),Bj=e=>(e.client??H).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}",...e}),Lj=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}/test",...e}),qj=e=>(e?.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/cdp/status",...e}),Uj=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections",...e}),$j=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ij=e=>(e.client??H).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}",...e}),Vj=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/properties",...e}),Pj=e=>(e.client??H).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}/property",...e,headers:{"Content-Type":"application/json",...e.headers}}),Gj=e=>(e.client??H).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}/sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),Hj=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),Qj=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance",...e}),Kj=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance/daily",...e}),Zj=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspect",...e,headers:{"Content-Type":"application/json",...e.headers}}),Yj=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspections",...e}),Xj=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/deindexed",...e}),_v=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage",...e}),Jj=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage/history",...e}),Fj=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/sitemaps",...e}),Wj=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/discover-sitemaps",...e}),eN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspect-sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),tN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/indexing/request",...e,headers:{"Content-Type":"application/json",...e.headers}}),nN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/locations",...e}),aN=e=>(e.client??H).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/locations/{locationName}/selection",...e,headers:{"Content-Type":"application/json",...e.headers}}),iN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),sN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/keywords",...e}),rN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/place-actions",...e}),oN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/lodging",...e}),lN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/places",...e}),cN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/summary",...e}),uN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),dN=e=>(e.client??H).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/disconnect",...e}),fN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/status",...e}),pN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/sites",...e}),mN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/set-site",...e,headers:{"Content-Type":"application/json",...e.headers}}),Cv=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/coverage",...e}),hN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspections",...e}),gN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspect-url",...e,headers:{"Content-Type":"application/json",...e.headers}}),yN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspect-sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),bN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/request-indexing",...e,headers:{"Content-Type":"application/json",...e.headers}}),vN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/performance",...e}),SN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),xN=e=>(e.client??H).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/disconnect",...e}),wN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/status",...e}),jN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),NN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/traffic",...e}),kN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/ai-referral-history",...e}),AN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/social-referral-history",...e}),_N=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/session-history",...e}),CN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/insights",...e}),zN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/report",...e}),TN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/citations/visibility",...e}),EN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/content/dismissals",...e,headers:{"Content-Type":"application/json",...e.headers}}),ON=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/overview",...e}),DN=e=>(e?.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/status",...e}),RN=e=>(e?.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/install",...e}),MN=e=>(e?.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e}),BN=e=>(e?.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),LN=e=>(e?.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs/latest",...e}),qN=e=>(e?.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/releases",...e}),UN=e=>(e?.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/latest-release",...e}),$N=e=>(e.client??H).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/cache/{release}",...e}),IN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/extract",...e,headers:{"Content-Type":"application/json",...e.headers}}),VN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/summary",...e}),PN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/domains",...e}),GN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/history",...e}),HN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/sources",...e}),QN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/bing-sync",...e}),KN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/cloud-run",...e,headers:{"Content-Type":"application/json",...e.headers}}),ZN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/wordpress",...e,headers:{"Content-Type":"application/json",...e.headers}}),YN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/vercel",...e,headers:{"Content-Type":"application/json",...e.headers}}),XN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),JN=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}/backfill",...e,headers:{"Content-Type":"application/json",...e.headers}}),FN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources",...e}),WN=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/status",...e}),ek=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}",...e}),tk=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/events",...e}),nk=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/run",...e,headers:{"Content-Type":"application/json",...e.headers}}),ak=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions",...e}),ik=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}",...e}),sk=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}/promote",...e}),rk=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}/promote",...e,headers:{"Content-Type":"application/json",...e.headers}}),ok=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo",...e}),lk=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/pages",...e}),ck=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/trend",...e}),uk=e=>(e.client??H).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/runs",...e,headers:{"Content-Type":"application/json",...e.headers}}),dk=e=>(e.client??H).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/agent/providers",...e});function fk(e){const n={baseUrl:e.baseUrl,fetch:e.fetch,headers:{...e.headers??{}}};return jv(n)}class Hn extends Error{code;statusCode;details;constructor(n,i,r,l){super(n),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=i,this.details=l}}function pk(){if(typeof window>"u")return null;const e=window.__CANONRY_CONFIG__?.embed;return e?.enabled?e:null}function mk(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const zv=mk();function hk(){const e=typeof window<"u"&&window.location?window.location.origin:"";return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?e+window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):e}function gk(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function yk(e){return`${gk()}${e}`}function bk(e,n){if(n===404)return"Health endpoint returned 404. Check basePath or reverse-proxy configuration and make sure the dashboard reaches /health instead of an API-prefixed route."}function vk(){return""}function nf(){return!!vk()}let Tv=null;function Hy(e){Tv=e}function Hf(){Tv?.()}const se=fk({baseUrl:hk()});se.interceptors.response.use((e,n)=>(e.status===401&&!n.url.includes("/api/v1/session")&&Hf(),e));async function ce(e){const n=await e();if(n.error!==void 0&&n.error!==null){const i=n.response.status;let r=`API ${i}: ${n.response.statusText}`,l,c;if(typeof n.error=="object"&&n.error!==null){const d=n.error.error;if(typeof d=="string")r=d;else if(d&&typeof d=="object"){const h=d;h.message&&(r=h.message),h.code&&(l=h.code),h.details&&(c=h.details)}else{const h=n.error;h.message&&(r=h.message),h.code&&(l=h.code),h.details&&(c=h.details)}}else typeof n.error=="string"&&(r=n.error);throw new Hn(r,i,l,c)}if(n.response.status!==204)return n.data}async function Qf(e,n){const i=n?.body!=null,r=await fetch(`${zv}${e}`,{...n,credentials:n?.credentials??"same-origin",headers:{...i?{"Content-Type":"application/json"}:{},...n?.headers}});if(!r.ok){const l=await r.text();let c=`API ${r.status}: ${r.statusText}`,d,h;if(l)try{const g=JSON.parse(l);typeof g.error=="string"?c=g.error:g.error?.message?(c=g.error.message,d=g.error.code,h=g.error.details):g.message&&(c=g.message)}catch{c=l}throw r.status===401&&!e.startsWith("/session")&&Hf(),new Hn(c,r.status,d,h)}if(r.status!==204)return r.json()}function Kf(e){return ce(()=>Nv({client:se,path:{name:e}}))}function d5(e){return ce(()=>Sj({client:se,path:{name:e}}))}function nc(e){return ce(()=>kv({client:se,path:{id:e}}))}function Sk(e){return ce(()=>pj({client:se,path:{name:e}}))}function xk(e){return ce(()=>bj({client:se,path:{name:e}}))}function wk(e,n){return ce(()=>kj({client:se,path:{name:e},query:{location:n}}))}function Ev(e,n){return ce(()=>ON({client:se,path:{name:e},query:{location:n?.location,since:n?.since}}))}function ho(e,n){return ce(()=>rj({client:se,path:{name:e},body:n}))}function jk(e,n){return ce(()=>hj({client:se,path:{name:e},body:{queries:n}}))}function Nk(e,n){return ce(()=>mj({client:se,path:{name:e},body:{queries:n}}))}function f5(e,n){return ce(()=>fj({client:se,path:{name:e},body:{queries:n}}))}function kk(e,n){return ce(()=>EN({client:se,path:{name:e},body:n}))}function Ak(e,n){return ce(()=>vj({client:se,path:{name:e},body:{competitors:n}}))}function p5(e,n){return ce(()=>yj({client:se,path:{name:e},body:{competitors:n}}))}async function m5(e,n){const i=await Kf(e);return ho(e,{displayName:i.displayName??i.name,canonicalDomain:i.canonicalDomain,ownedDomains:n,aliases:i.aliases,country:i.country,language:i.language,tags:i.tags,labels:i.labels,providers:i.providers,locations:i.locations,defaultLocation:i.defaultLocation})}async function h5(e,n){const i=await Kf(e);return ho(e,{displayName:i.displayName??i.name,canonicalDomain:i.canonicalDomain,ownedDomains:i.ownedDomains,aliases:n,country:i.country,language:i.language,tags:i.tags,labels:i.labels,providers:i.providers,locations:i.locations,defaultLocation:i.defaultLocation})}async function g5(e,n){const i=await Kf(e);return ho(e,{displayName:n.displayName??i.displayName??i.name,canonicalDomain:n.canonicalDomain??i.canonicalDomain,ownedDomains:n.ownedDomains??i.ownedDomains,aliases:n.aliases??i.aliases,country:n.country??i.country,language:n.language??i.language,tags:i.tags,labels:i.labels,providers:i.providers,locations:n.locations??i.locations,defaultLocation:n.defaultLocation!==void 0?n.defaultLocation:i.defaultLocation})}function _k(e,n){const i={};return n?.location&&(i.location=n.location),n?.allLocations&&(i.allLocations=!0),n?.noLocation&&(i.noLocation=!0),ce(()=>xj({client:se,path:{name:e},body:i}))}function y5(e,n){return ce(()=>lj({client:se,path:{name:e},body:n}))}async function b5(e,n){await ce(()=>cj({client:se,path:{name:e,label:n}}))}function v5(e,n){return ce(()=>uj({client:se,path:{name:e},body:{label:n}}))}async function S5(e){await ce(()=>sj({client:se,path:{name:e}}))}function x5(e){return ce(()=>dj({client:se,path:{name:e}}))}function w5(){return ce(()=>Av({client:se}))}function Qy(){return Qf("/session")}function Ck(e){return Qf("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function zk(e){return Qf("/session",{method:"POST",body:JSON.stringify({password:e})})}function Tk(e,n){return ce(()=>_j({client:se,path:{name:e},body:n}))}function j5(e){return ce(()=>Cj({client:se,body:e}))}async function N5(e){try{return await ce(()=>Oj({client:se,path:{name:e}}))}catch(n){if(n instanceof Hn&&n.statusCode===404)return null;throw n}}function k5(e,n){return ce(()=>Dj({client:se,path:{name:e},body:n}))}async function A5(e){await ce(()=>Ej({client:se,path:{name:e}}))}function _5(e){return ce(()=>Rj({client:se,path:{name:e}}))}function C5(e,n){return ce(()=>Mj({client:se,path:{name:e},body:n}))}async function z5(e,n){await ce(()=>Bj({client:se,path:{name:e,id:n}}))}function T5(e,n){return ce(()=>Lj({client:se,path:{name:e,id:n}}))}function Ek(e,n,i){return ce(()=>gj({client:se,path:{name:e},body:{provider:n,count:i}}))}function Ok(e){return ce(()=>Nj({client:se,body:e}))}function Dk(e){return ce(()=>jj({client:se,body:e??{}}))}function E5(e,n){return ce(()=>$j({client:se,path:{name:e},body:{type:n}}))}function O5(e,n){return ce(()=>Ij({client:se,path:{name:e,type:n}}))}function D5(e,n,i){return ce(()=>Pj({client:se,path:{name:e,type:n},body:{propertyId:i}}))}function R5(e,n,i){return ce(()=>Gj({client:se,path:{name:e,type:n},body:{sitemapUrl:i}}))}function Rk(e,n){return ce(()=>Hj({client:se,path:{name:e},body:n??{}}))}function M5(e,n){const i={};return n&&n!=="all"&&(i.window=n),ce(()=>Aj({client:se,path:{name:e},query:i}))}function B5(e,n){return ce(()=>Zj({client:se,path:{name:e},body:{url:n}}))}function Mk(e){return ce(()=>_v({client:se,path:{name:e}}))}function Bk(e,n){return ce(()=>eN({client:se,path:{name:e},body:n??{}}))}function L5(e){return ce(()=>Fj({client:se,path:{name:e}}))}function Lk(e){return ce(()=>Wj({client:se,path:{name:e}}))}function q5(e,n){return ce(()=>uk({client:se,path:{name:e},body:{}}))}function U5(e,n){return ce(()=>nk({client:se,path:{name:e},body:n??{}}))}function $5(e,n,i){return ce(()=>rk({client:se,path:{name:e,id:n},body:i??{}}))}function I5(){return ce(()=>qj({client:se}))}function V5(e,n){return ce(()=>Tj({client:se,body:{host:e,port:n}}))}function P5(e,n){return ce(()=>tN({client:se,path:{name:e},body:n}))}function G5(e,n){return ce(()=>uN({client:se,path:{name:e},body:{apiKey:n}}))}function H5(e){return ce(()=>dN({client:se,path:{name:e}}))}function Q5(e,n){return ce(()=>mN({client:se,path:{name:e},body:{siteUrl:n}}))}function qk(e){return ce(()=>Cv({client:se,path:{name:e}}))}function K5(e,n){return ce(()=>gN({client:se,path:{name:e},body:{url:n}}))}function Z5(e,n){return ce(()=>yN({client:se,path:{name:e},body:{}}))}function Y5(e,n){return ce(()=>bN({client:se,path:{name:e},body:n}))}function X5(e){return ce(()=>zj({client:se,body:{apiKey:e}}))}function Uk(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function J5(e,n="agency"){const i=new URLSearchParams({audience:n}),r=await fetch(`${zv}/projects/${encodeURIComponent(e)}/report.html?${i.toString()}`,{credentials:"same-origin",headers:{}});if(!r.ok)throw new Hn(`Failed to download report: ${r.status}`,r.status);const l=await r.blob(),c=URL.createObjectURL(l),d=Uk(r.headers.get("Content-Disposition"))??`canonry-report-${e}.html`,h=document.createElement("a");h.href=c,h.download=d,document.body.appendChild(h),h.click(),document.body.removeChild(h),URL.revokeObjectURL(c)}function F5(e,n){return ce(()=>jN({client:se,path:{name:e},body:{}}))}function W5(e,n){return ce(()=>SN({client:se,path:{name:e},body:n}))}function eL(e){return ce(()=>xN({client:se,path:{name:e}}))}function tL(e,n){return ce(()=>KN({client:se,path:{name:e},body:n}))}function nL(e,n){return ce(()=>ZN({client:se,path:{name:e},body:n}))}function aL(e,n){return ce(()=>YN({client:se,path:{name:e},body:n}))}function iL(e,n,i){return ce(()=>XN({client:se,path:{name:e,id:n},body:i??{}}))}function sL(e,n,i){return ce(()=>JN({client:se,path:{name:e,id:n},body:{}}))}function $k(e,n){return ce(()=>CN({client:se,path:{name:e},query:{runId:n}}))}function Ik(e){if(!e||typeof e!="object")return;const n=e;if(!(typeof n.current!="string"||typeof n.latest!="string"||typeof n.url!="string"||typeof n.upgradeCommand!="string"))return{current:n.current,latest:n.latest,url:n.url,upgradeCommand:n.upgradeCommand}}async function Vk(e,n){const i=yk(e);try{const r=await fetch(i,{credentials:"same-origin"});if(!r.ok)return{label:n,state:"error",detail:`${n} ${r.status}: ${r.statusText}`,statusCode:r.status,hint:bk(e,r.status)};const l=await r.json(),c=typeof l.version=="string"?l.version:"unknown",d=typeof l.databaseUrlConfigured=="boolean"?l.databaseUrlConfigured:void 0,h=typeof l.lastHeartbeatAt=="string"?l.lastHeartbeatAt:void 0,g=Ik(l.updateAvailable),v=[c,d===!1?"database not configured":"database configured",h?`heartbeat ${h}`:void 0].filter(Boolean).join(" · ");return{label:n,state:"ok",detail:v,version:c,databaseConfigured:d,lastHeartbeatAt:h,...g?{updateAvailable:g}:{}}}catch(r){return{label:n,state:"error",detail:r instanceof Error?r.message:"unreachable",hint:e==="/health"?`Request failed while checking ${i}. If this instance is served behind a sub-path, verify the dashboard basePath and reverse-proxy rewrites.`:void 0}}}function rL(){return ce(()=>DN({client:se}))}function oL(){return ce(()=>RN({client:se}))}function lL(){return ce(()=>LN({client:se}))}function cL(){return ce(()=>MN({client:se}))}function uL(e){return ce(()=>BN({client:se,body:e?{release:e}:{}}))}function dL(){return ce(()=>qN({client:se}))}function fL(){return ce(()=>UN({client:se}))}function pL(e){return ce(()=>$N({client:se,path:{release:e}}))}function mL(e,n={}){return ce(()=>VN({client:se,path:{name:e},query:{release:n.release,excludeCrawlers:n.excludeCrawlers?"1":void 0,source:n.source}}))}function hL(e,n={}){return ce(()=>PN({client:se,path:{name:e},query:{limit:n.limit!==void 0?String(n.limit):void 0,offset:n.offset!==void 0?String(n.offset):void 0,release:n.release,excludeCrawlers:n.excludeCrawlers?"1":void 0,source:n.source}}))}function gL(e,n={}){return ce(()=>GN({client:se,path:{name:e},query:{source:n.source}}))}function yL(e,n={}){return ce(()=>HN({client:se,path:{name:e},query:{excludeCrawlers:n.excludeCrawlers?"1":void 0}}))}function bL(e,n){return ce(()=>IN({client:se,path:{name:e},body:{release:void 0}}))}function vL(e){return ce(()=>QN({client:se,path:{name:e}}))}function wn(e){return(...n)=>{e(...n)}}const Pk=6e3,Gk=5,Hk=180;let It=[],Qk=0;const vf=new Set,Sf=new Map,xf=new Map;function ac(){const e=[...It];for(const n of vf)n(e)}function Zf(e){const n=Sf.get(e);n&&(clearTimeout(n),Sf.delete(e));const i=xf.get(e);i&&(clearTimeout(i),xf.delete(e))}function Ov(e){Zf(e);const n=It.length;It=It.filter(i=>i.id!==e),It.length!==n&&ac()}function Ky(e){Zf(e.id),Sf.set(e.id,setTimeout(()=>{wf(e.id)},e.durationMs))}function Kk(e,n,i){return typeof e=="string"?{title:e,tone:n,durationMs:i}:e}function en(e,n="negative",i=Pk){const r=Kk(e,n,i),l={id:String(++Qk),title:r.title,detail:r.detail,tone:r.tone??n,durationMs:r.durationMs??i,dedupeKey:r.dedupeKey,cta:r.cta,state:"open"};if(r.dedupeKey){const c=It.find(d=>d.dedupeKey===r.dedupeKey);if(c){if((r.dedupeMode??"drop")==="drop")return c.id;const d={...c,title:l.title,detail:l.detail,tone:l.tone,durationMs:l.durationMs,cta:l.cta,state:"open"};return It=It.map(h=>h.id===c.id?d:h),ac(),Ky(d),c.id}}return It.length>=Gk&&Ov(It[0].id),It=[...It,l],ac(),Ky(l),l.id}function wf(e){const n=It.find(i=>i.id===e);!n||n.state==="closing"||(Zf(e),It=It.map(i=>i.id===e?{...i,state:"closing"}:i),ac(),xf.set(e,setTimeout(()=>{Ov(e)},Hk)))}function Zk(e){return vf.add(e),()=>{vf.delete(e)}}function Zy(){return It}const Yk=5*6e4,jf=30*6e4,SL=3e4,xL=6e4,lo=3e4,Xk=2e3,Jk=5e3;function Fk(){return new kw({defaultOptions:{queries:{staleTime:Yk,retry:1,refetchOnWindowFocus:!1}},mutationCache:new Aw({onError:(e,n,i,r)=>{r.meta?.skipGlobalErrorToast||en({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const Wk="modulepreload",eA=function(e,n){return new URL(e,n).href},Yy={},Hs=function(n,i,r){let l=Promise.resolve();if(i&&i.length>0){let v=function(S){return Promise.all(S.map(x=>Promise.resolve(x).then(N=>({status:"fulfilled",value:N}),N=>({status:"rejected",reason:N}))))};const d=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),g=h?.nonce||h?.getAttribute("nonce");l=v(i.map(S=>{if(S=eA(S,r),S in Yy)return;Yy[S]=!0;const x=S.endsWith(".css"),N=x?'[rel="stylesheet"]':"";if(r)for(let T=d.length-1;T>=0;T--){const k=d[T];if(k.href===S&&(!x||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${S}"]${N}`))return;const _=document.createElement("link");if(_.rel=x?"stylesheet":Wk,x||(_.as="script"),_.crossOrigin="",_.href=S,g&&_.setAttribute("nonce",g),document.head.appendChild(_),x)return new Promise((T,k)=>{_.addEventListener("load",T),_.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${S}`)))})}))}function c(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return l.then(d=>{for(const h of d||[])h.status==="rejected"&&c(h.reason);return n().catch(c)})};const tA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),nA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,r)=>r?r.toUpperCase():i.toLowerCase()),Xy=e=>{const n=nA(e);return n.charAt(0).toUpperCase()+n.slice(1)},Dv=(...e)=>e.filter((n,i,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===i).join(" ").trim(),aA=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var iA={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 sA=U.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:r,className:l="",children:c,iconNode:d,...h},g)=>U.createElement("svg",{ref:g,...iA,width:n,height:n,stroke:e,strokeWidth:r?Number(i)*24/Number(n):i,className:Dv("lucide",l),...!c&&!aA(h)&&{"aria-hidden":"true"},...h},[...d.map(([v,S])=>U.createElement(v,S)),...Array.isArray(c)?c:[c]]));const et=(e,n)=>{const i=U.forwardRef(({className:r,...l},c)=>U.createElement(sA,{ref:c,iconNode:n,className:Dv(`lucide-${tA(Xy(e))}`,`lucide-${e}`,r),...l}));return i.displayName=Xy(e),i};const rA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],oA=et("arrow-right",rA);const lA=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],cA=et("arrow-up",lA);const uA=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],dA=et("book-open",uA);const fA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Rv=et("check",fA);const pA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],mA=et("chevron-down",pA);const hA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Yf=et("chevron-right",hA);const gA=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],yA=et("copy",gA);const bA=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],vA=et("file-text",bA);const SA=[["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"}]],xA=et("github",SA);const wA=[["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"}]],jA=et("globe",wA);const NA=[["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"}]],kA=et("layout-dashboard",NA);const AA=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],_A=et("link-2",AA);const CA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],zA=et("loader-circle",CA);const TA=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],EA=et("maximize-2",TA);const OA=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],DA=et("menu",OA);const RA=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],MA=et("minimize-2",RA);const BA=[["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"}]],LA=et("play",BA);const qA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Jy=et("plus",qA);const UA=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],$A=et("radar",UA);const IA=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Fy=et("radio",IA);const VA=[["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"}]],PA=et("rocket",VA);const GA=[["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"}]],Mv=et("rotate-ccw",GA);const HA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],QA=et("search",HA);const KA=[["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"}]],ZA=et("settings",KA);const YA=[["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"}]],Bv=et("triangle-alert",YA);const XA=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],JA=et("wrench",XA);const FA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Qs=et("x",FA);function Q(e,n,i){function r(h,g){if(h._zod||Object.defineProperty(h,"_zod",{value:{def:g,constr:d,traits:new Set},enumerable:!1}),h._zod.traits.has(e))return;h._zod.traits.add(e),n(h,g);const v=d.prototype,S=Object.keys(v);for(let x=0;x<S.length;x++){const N=S[x];N in h||(h[N]=v[N].bind(h))}}const l=i?.Parent??Object;class c extends l{}Object.defineProperty(c,"name",{value:e});function d(h){var g;const v=i?.Parent?new c:this;r(v,h),(g=v._zod).deferred??(g.deferred=[]);for(const S of v._zod.deferred)S();return v}return Object.defineProperty(d,"init",{value:r}),Object.defineProperty(d,Symbol.hasInstance,{value:h=>i?.Parent&&h instanceof i.Parent?!0:h?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class Ms extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Lv extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const qv={};function Ya(e){return qv}function Uv(e){const n=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,l])=>n.indexOf(+r)===-1).map(([r,l])=>l)}function Nf(e,n){return typeof n=="bigint"?n.toString():n}function yc(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function Xf(e){return e==null}function Jf(e){const n=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(n,i)}function WA(e,n){const i=(e.toString().split(".")[1]||"").length,r=n.toString();let l=(r.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(r)){const g=r.match(/\d?e-(\d?)/);g?.[1]&&(l=Number.parseInt(g[1]))}const c=i>l?i:l,d=Number.parseInt(e.toFixed(c).replace(".","")),h=Number.parseInt(n.toFixed(c).replace(".",""));return d%h/10**c}const Wy=Symbol("evaluating");function Pe(e,n,i){let r;Object.defineProperty(e,n,{get(){if(r!==Wy)return r===void 0&&(r=Wy,r=i()),r},set(l){Object.defineProperty(e,n,{value:l})},configurable:!0})}function Ti(e,n,i){Object.defineProperty(e,n,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Fa(...e){const n={};for(const i of e){const r=Object.getOwnPropertyDescriptors(i);Object.assign(n,r)}return Object.defineProperties({},n)}function eb(e){return JSON.stringify(e)}function e2(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const $v="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function co(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const t2=yc(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Us(e){if(co(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const i=n.prototype;return!(co(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Iv(e){return Us(e)?{...e}:Array.isArray(e)?[...e]:e}const n2=new Set(["string","number","symbol"]);function $s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wa(e,n,i){const r=new e._zod.constr(n??e._zod.def);return(!n||i?.parent)&&(r._zod.parent=e),r}function ye(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function a2(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const i2={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function s2(e,n){const i=e._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=Fa(e._zod.def,{get shape(){const d={};for(const h in n){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(d[h]=i.shape[h])}return Ti(this,"shape",d),d},checks:[]});return Wa(e,c)}function r2(e,n){const i=e._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=Fa(e._zod.def,{get shape(){const d={...e._zod.def.shape};for(const h in n){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);n[h]&&delete d[h]}return Ti(this,"shape",d),d},checks:[]});return Wa(e,c)}function o2(e,n){if(!Us(n))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0){const c=e._zod.def.shape;for(const d in n)if(Object.getOwnPropertyDescriptor(c,d)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=Fa(e._zod.def,{get shape(){const c={...e._zod.def.shape,...n};return Ti(this,"shape",c),c}});return Wa(e,l)}function l2(e,n){if(!Us(n))throw new Error("Invalid input to safeExtend: expected a plain object");const i=Fa(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n};return Ti(this,"shape",r),r}});return Wa(e,i)}function c2(e,n){const i=Fa(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n._zod.def.shape};return Ti(this,"shape",r),r},get catchall(){return n._zod.def.catchall},checks:[]});return Wa(e,i)}function u2(e,n,i){const l=n._zod.def.checks;if(l&&l.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const d=Fa(n._zod.def,{get shape(){const h=n._zod.def.shape,g={...h};if(i)for(const v in i){if(!(v in h))throw new Error(`Unrecognized key: "${v}"`);i[v]&&(g[v]=e?new e({type:"optional",innerType:h[v]}):h[v])}else for(const v in h)g[v]=e?new e({type:"optional",innerType:h[v]}):h[v];return Ti(this,"shape",g),g},checks:[]});return Wa(n,d)}function d2(e,n,i){const r=Fa(n._zod.def,{get shape(){const l=n._zod.def.shape,c={...l};if(i)for(const d in i){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);i[d]&&(c[d]=new e({type:"nonoptional",innerType:l[d]}))}else for(const d in l)c[d]=new e({type:"nonoptional",innerType:l[d]});return Ti(this,"shape",c),c}});return Wa(n,r)}function Ts(e,n=0){if(e.aborted===!0)return!0;for(let i=n;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function Es(e,n){return n.map(i=>{var r;return(r=i).path??(r.path=[]),i.path.unshift(e),i})}function $l(e){return typeof e=="string"?e:e?.message}function Xa(e,n,i){const r={...e,path:e.path??[]};if(!e.message){const l=$l(e.inst?._zod.def?.error?.(e))??$l(n?.error?.(e))??$l(i.customError?.(e))??$l(i.localeError?.(e))??"Invalid input";r.message=l}return delete r.inst,delete r.continue,n?.reportInput||delete r.input,r}function Ff(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function uo(...e){const[n,i,r]=e;return typeof n=="string"?{message:n,code:"custom",input:i,inst:r}:{...n}}const Vv=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,Nf,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Pv=Q("$ZodError",Vv),Gv=Q("$ZodError",Vv,{Parent:Error});function f2(e,n=i=>i.message){const i={},r=[];for(const l of e.issues)l.path.length>0?(i[l.path[0]]=i[l.path[0]]||[],i[l.path[0]].push(n(l))):r.push(n(l));return{formErrors:r,fieldErrors:i}}function p2(e,n=i=>i.message){const i={_errors:[]},r=l=>{for(const c of l.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>r({issues:d}));else if(c.code==="invalid_key")r({issues:c.issues});else if(c.code==="invalid_element")r({issues:c.issues});else if(c.path.length===0)i._errors.push(n(c));else{let d=i,h=0;for(;h<c.path.length;){const g=c.path[h];h===c.path.length-1?(d[g]=d[g]||{_errors:[]},d[g]._errors.push(n(c))):d[g]=d[g]||{_errors:[]},d=d[g],h++}}};return r(e),i}const Wf=e=>(n,i,r,l)=>{const c=r?Object.assign(r,{async:!1}):{async:!1},d=n._zod.run({value:i,issues:[]},c);if(d instanceof Promise)throw new Ms;if(d.issues.length){const h=new(l?.Err??e)(d.issues.map(g=>Xa(g,c,Ya())));throw $v(h,l?.callee),h}return d.value},ep=e=>async(n,i,r,l)=>{const c=r?Object.assign(r,{async:!0}):{async:!0};let d=n._zod.run({value:i,issues:[]},c);if(d instanceof Promise&&(d=await d),d.issues.length){const h=new(l?.Err??e)(d.issues.map(g=>Xa(g,c,Ya())));throw $v(h,l?.callee),h}return d.value},bc=e=>(n,i,r)=>{const l=r?{...r,async:!1}:{async:!1},c=n._zod.run({value:i,issues:[]},l);if(c instanceof Promise)throw new Ms;return c.issues.length?{success:!1,error:new(e??Pv)(c.issues.map(d=>Xa(d,l,Ya())))}:{success:!0,data:c.value}},m2=bc(Gv),vc=e=>async(n,i,r)=>{const l=r?Object.assign(r,{async:!0}):{async:!0};let c=n._zod.run({value:i,issues:[]},l);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(d=>Xa(d,l,Ya())))}:{success:!0,data:c.value}},h2=vc(Gv),g2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Wf(e)(n,i,l)},y2=e=>(n,i,r)=>Wf(e)(n,i,r),b2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ep(e)(n,i,l)},v2=e=>async(n,i,r)=>ep(e)(n,i,r),S2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return bc(e)(n,i,l)},x2=e=>(n,i,r)=>bc(e)(n,i,r),w2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return vc(e)(n,i,l)},j2=e=>async(n,i,r)=>vc(e)(n,i,r),N2=/^[cC][^\s-]{8,}$/,k2=/^[0-9a-z]+$/,A2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,_2=/^[0-9a-vA-V]{20}$/,C2=/^[A-Za-z0-9]{27}$/,z2=/^[a-zA-Z0-9_-]{21}$/,T2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,E2=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,tb=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,O2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,D2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function R2(){return new RegExp(D2,"u")}const M2=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,B2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,L2=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,q2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,U2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Hv=/^[A-Za-z0-9_-]*$/,$2=/^\+[1-9]\d{6,14}$/,Qv="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",I2=new RegExp(`^${Qv}$`);function Kv(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function V2(e){return new RegExp(`^${Kv(e)}$`)}function P2(e){const n=Kv({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${n}(?:${i.join("|")})`;return new RegExp(`^${Qv}T(?:${r})$`)}const G2=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},H2=/^-?\d+$/,Zv=/^-?\d+(?:\.\d+)?$/,Q2=/^(?:true|false)$/i,K2=/^[^A-Z]*$/,Z2=/^[^a-z]*$/,nn=Q("$ZodCheck",(e,n)=>{var i;e._zod??(e._zod={}),e._zod.def=n,(i=e._zod).onattach??(i.onattach=[])}),Yv={number:"number",bigint:"bigint",object:"date"},Xv=Q("$ZodCheckLessThan",(e,n)=>{nn.init(e,n);const i=Yv[typeof n.value];e._zod.onattach.push(r=>{const l=r._zod.bag,c=(n.inclusive?l.maximum:l.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<c&&(n.inclusive?l.maximum=n.value:l.exclusiveMaximum=n.value)}),e._zod.check=r=>{(n.inclusive?r.value<=n.value:r.value<n.value)||r.issues.push({origin:i,code:"too_big",maximum:typeof n.value=="object"?n.value.getTime():n.value,input:r.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Jv=Q("$ZodCheckGreaterThan",(e,n)=>{nn.init(e,n);const i=Yv[typeof n.value];e._zod.onattach.push(r=>{const l=r._zod.bag,c=(n.inclusive?l.minimum:l.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>c&&(n.inclusive?l.minimum=n.value:l.exclusiveMinimum=n.value)}),e._zod.check=r=>{(n.inclusive?r.value>=n.value:r.value>n.value)||r.issues.push({origin:i,code:"too_small",minimum:typeof n.value=="object"?n.value.getTime():n.value,input:r.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Y2=Q("$ZodCheckMultipleOf",(e,n)=>{nn.init(e,n),e._zod.onattach.push(i=>{var r;(r=i._zod.bag).multipleOf??(r.multipleOf=n.value)}),e._zod.check=i=>{if(typeof i.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%n.value===BigInt(0):WA(i.value,n.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:n.value,input:i.value,inst:e,continue:!n.abort})}}),X2=Q("$ZodCheckNumberFormat",(e,n)=>{nn.init(e,n),n.format=n.format||"float64";const i=n.format?.includes("int"),r=i?"int":"number",[l,c]=i2[n.format];e._zod.onattach.push(d=>{const h=d._zod.bag;h.format=n.format,h.minimum=l,h.maximum=c,i&&(h.pattern=H2)}),e._zod.check=d=>{const h=d.value;if(i){if(!Number.isInteger(h)){d.issues.push({expected:r,format:n.format,code:"invalid_type",continue:!1,input:h,inst:e});return}if(!Number.isSafeInteger(h)){h>0?d.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!n.abort}):d.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!n.abort});return}}h<l&&d.issues.push({origin:"number",input:h,code:"too_small",minimum:l,inclusive:!0,inst:e,continue:!n.abort}),h>c&&d.issues.push({origin:"number",input:h,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!n.abort})}}),J2=Q("$ZodCheckMaxLength",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Xf(l)&&l.length!==void 0}),e._zod.onattach.push(r=>{const l=r._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<l&&(r._zod.bag.maximum=n.maximum)}),e._zod.check=r=>{const l=r.value;if(l.length<=n.maximum)return;const d=Ff(l);r.issues.push({origin:d,code:"too_big",maximum:n.maximum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),F2=Q("$ZodCheckMinLength",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Xf(l)&&l.length!==void 0}),e._zod.onattach.push(r=>{const l=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>l&&(r._zod.bag.minimum=n.minimum)}),e._zod.check=r=>{const l=r.value;if(l.length>=n.minimum)return;const d=Ff(l);r.issues.push({origin:d,code:"too_small",minimum:n.minimum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),W2=Q("$ZodCheckLengthEquals",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Xf(l)&&l.length!==void 0}),e._zod.onattach.push(r=>{const l=r._zod.bag;l.minimum=n.length,l.maximum=n.length,l.length=n.length}),e._zod.check=r=>{const l=r.value,c=l.length;if(c===n.length)return;const d=Ff(l),h=c>n.length;r.issues.push({origin:d,...h?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!n.abort})}}),Sc=Q("$ZodCheckStringFormat",(e,n)=>{var i,r;nn.init(e,n),e._zod.onattach.push(l=>{const c=l._zod.bag;c.format=n.format,n.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(n.pattern))}),n.pattern?(i=e._zod).check??(i.check=l=>{n.pattern.lastIndex=0,!n.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:n.format,input:l.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(r=e._zod).check??(r.check=()=>{})}),e_=Q("$ZodCheckRegex",(e,n)=>{Sc.init(e,n),e._zod.check=i=>{n.pattern.lastIndex=0,!n.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),t_=Q("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=K2),Sc.init(e,n)}),n_=Q("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=Z2),Sc.init(e,n)}),a_=Q("$ZodCheckIncludes",(e,n)=>{nn.init(e,n);const i=$s(n.includes),r=new RegExp(typeof n.position=="number"?`^.{${n.position}}${i}`:i);n.pattern=r,e._zod.onattach.push(l=>{const c=l._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(r)}),e._zod.check=l=>{l.value.includes(n.includes,n.position)||l.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:l.value,inst:e,continue:!n.abort})}}),i_=Q("$ZodCheckStartsWith",(e,n)=>{nn.init(e,n);const i=new RegExp(`^${$s(n.prefix)}.*`);n.pattern??(n.pattern=i),e._zod.onattach.push(r=>{const l=r._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(i)}),e._zod.check=r=>{r.value.startsWith(n.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:r.value,inst:e,continue:!n.abort})}}),s_=Q("$ZodCheckEndsWith",(e,n)=>{nn.init(e,n);const i=new RegExp(`.*${$s(n.suffix)}$`);n.pattern??(n.pattern=i),e._zod.onattach.push(r=>{const l=r._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(i)}),e._zod.check=r=>{r.value.endsWith(n.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:r.value,inst:e,continue:!n.abort})}}),r_=Q("$ZodCheckOverwrite",(e,n)=>{nn.init(e,n),e._zod.check=i=>{i.value=n.tx(i.value)}});class o_{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const r=n.split(`
15
15
  `).filter(d=>d),l=Math.min(...r.map(d=>d.length-d.trimStart().length)),c=r.map(d=>d.slice(l)).map(d=>" ".repeat(this.indent*2)+d);for(const d of c)this.content.push(d)}compile(){const n=Function,i=this?.args,l=[...(this?.content??[""]).map(c=>` ${c}`)];return new n(...i,l.join(`
16
- `))}}const r_={major:4,minor:3,patch:6},ut=H("$ZodType",(e,n)=>{var i;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=r_;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const l of r)for(const c of l._zod.onattach)c(e);if(r.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const l=(d,h,g)=>{let b=Ts(d),S;for(const x of h){if(x._zod.def.when){if(!x._zod.def.when(d))continue}else if(b)continue;const N=d.issues.length,_=x._zod.check(d);if(_ instanceof Promise&&g?.async===!1)throw new Ms;if(S||_ instanceof Promise)S=(S??Promise.resolve()).then(async()=>{await _,d.issues.length!==N&&(b||(b=Ts(d,N)))});else{if(d.issues.length===N)continue;b||(b=Ts(d,N))}}return S?S.then(()=>d):d},c=(d,h,g)=>{if(Ts(d))return d.aborted=!0,d;const b=l(h,r,g);if(b instanceof Promise){if(g.async===!1)throw new Ms;return b.then(S=>e._zod.parse(S,g))}return e._zod.parse(b,g)};e._zod.run=(d,h)=>{if(h.skipChecks)return e._zod.parse(d,h);if(h.direction==="backward"){const b=e._zod.parse({value:d.value,issues:[]},{...h,skipChecks:!0});return b instanceof Promise?b.then(S=>c(S,d,h)):c(b,d,h)}const g=e._zod.parse(d,h);if(g instanceof Promise){if(h.async===!1)throw new Ms;return g.then(b=>l(b,r,h))}return l(g,r,h)}}Pe(e,"~standard",()=>({validate:l=>{try{const c=f2(e,l);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return p2(e,l).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),tp=H("$ZodString",(e,n)=>{ut.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??V2(e._zod.bag),e._zod.parse=(i,r)=>{if(n.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),ct=H("$ZodStringFormat",(e,n)=>{Sc.init(e,n),tp.init(e,n)}),o_=H("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=z2),ct.init(e,n)}),l_=H("$ZodUUID",(e,n)=>{if(n.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(r===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=eb(r))}else n.pattern??(n.pattern=eb());ct.init(e,n)}),c_=H("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=T2),ct.init(e,n)}),u_=H("$ZodURL",(e,n)=>{ct.init(e,n),e._zod.check=i=>{try{const r=i.value.trim(),l=new URL(r);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(l.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:i.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:i.value,inst:e,continue:!n.abort})),n.normalize?i.value=l.href:i.value=r;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!n.abort})}}}),d_=H("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=O2()),ct.init(e,n)}),f_=H("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=_2),ct.init(e,n)}),p_=H("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=w2),ct.init(e,n)}),m_=H("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=j2),ct.init(e,n)}),h_=H("$ZodULID",(e,n)=>{n.pattern??(n.pattern=N2),ct.init(e,n)}),g_=H("$ZodXID",(e,n)=>{n.pattern??(n.pattern=k2),ct.init(e,n)}),y_=H("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=A2),ct.init(e,n)}),b_=H("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=I2(n)),ct.init(e,n)}),v_=H("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=U2),ct.init(e,n)}),S_=H("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=$2(n)),ct.init(e,n)}),x_=H("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=C2),ct.init(e,n)}),w_=H("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=D2),ct.init(e,n),e._zod.bag.format="ipv4"}),j_=H("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=R2),ct.init(e,n),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!n.abort})}}}),N_=H("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=M2),ct.init(e,n)}),k_=H("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=B2),ct.init(e,n),e._zod.check=i=>{const r=i.value.split("/");try{if(r.length!==2)throw new Error;const[l,c]=r;if(!c)throw new Error;const d=Number(c);if(`${d}`!==c)throw new Error;if(d<0||d>128)throw new Error;new URL(`http://[${l}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!n.abort})}}});function Jv(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const A_=H("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=L2),ct.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{Jv(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!n.abort})}});function __(e){if(!Gv.test(e))return!1;const n=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),i=n.padEnd(Math.ceil(n.length/4)*4,"=");return Jv(i)}const C_=H("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=Gv),ct.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{__(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!n.abort})}}),z_=H("$ZodE164",(e,n)=>{n.pattern??(n.pattern=q2),ct.init(e,n)});function T_(e,n=null){try{const i=e.split(".");if(i.length!==3)return!1;const[r]=i;if(!r)return!1;const l=JSON.parse(atob(r));return!("typ"in l&&l?.typ!=="JWT"||!l.alg||n&&(!("alg"in l)||l.alg!==n))}catch{return!1}}const E_=H("$ZodJWT",(e,n)=>{ct.init(e,n),e._zod.check=i=>{T_(i.value,n.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!n.abort})}}),Fv=H("$ZodNumber",(e,n)=>{ut.init(e,n),e._zod.pattern=e._zod.bag.pattern??Kv,e._zod.parse=(i,r)=>{if(n.coerce)try{i.value=Number(i.value)}catch{}const l=i.value;if(typeof l=="number"&&!Number.isNaN(l)&&Number.isFinite(l))return i;const c=typeof l=="number"?Number.isNaN(l)?"NaN":Number.isFinite(l)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:l,inst:e,...c?{received:c}:{}}),i}}),O_=H("$ZodNumberFormat",(e,n)=>{Z2.init(e,n),Fv.init(e,n)}),D_=H("$ZodBoolean",(e,n)=>{ut.init(e,n),e._zod.pattern=G2,e._zod.parse=(i,r)=>{if(n.coerce)try{i.value=!!i.value}catch{}const l=i.value;return typeof l=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:l,inst:e}),i}}),R_=H("$ZodUnknown",(e,n)=>{ut.init(e,n),e._zod.parse=i=>i}),M_=H("$ZodNever",(e,n)=>{ut.init(e,n),e._zod.parse=(i,r)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function tb(e,n,i){e.issues.length&&n.issues.push(...Es(i,e.issues)),n.value[i]=e.value}const B_=H("$ZodArray",(e,n)=>{ut.init(e,n),e._zod.parse=(i,r)=>{const l=i.value;if(!Array.isArray(l))return i.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),i;i.value=Array(l.length);const c=[];for(let d=0;d<l.length;d++){const h=l[d],g=n.element._zod.run({value:h,issues:[]},r);g instanceof Promise?c.push(g.then(b=>tb(b,i,d))):tb(g,i,d)}return c.length?Promise.all(c).then(()=>i):i}});function ic(e,n,i,r,l){if(e.issues.length){if(l&&!(i in r))return;n.issues.push(...Es(i,e.issues))}e.value===void 0?i in r&&(n.value[i]=void 0):n.value[i]=e.value}function Wv(e){const n=Object.keys(e.shape);for(const r of n)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const i=t2(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(i)}}function e0(e,n,i,r,l,c){const d=[],h=l.keySet,g=l.catchall._zod,b=g.def.type,S=g.optout==="optional";for(const x in n){if(h.has(x))continue;if(b==="never"){d.push(x);continue}const N=g.run({value:n[x],issues:[]},r);N instanceof Promise?e.push(N.then(_=>ic(_,i,x,n,S))):ic(N,i,x,n,S)}return d.length&&i.issues.push({code:"unrecognized_keys",keys:d,input:n,inst:c}),e.length?Promise.all(e).then(()=>i):i}const L_=H("$ZodObject",(e,n)=>{if(ut.init(e,n),!Object.getOwnPropertyDescriptor(n,"shape")?.get){const h=n.shape;Object.defineProperty(n,"shape",{get:()=>{const g={...h};return Object.defineProperty(n,"shape",{value:g}),g}})}const r=yc(()=>Wv(n));Pe(e._zod,"propValues",()=>{const h=n.shape,g={};for(const b in h){const S=h[b]._zod;if(S.values){g[b]??(g[b]=new Set);for(const x of S.values)g[b].add(x)}}return g});const l=co,c=n.catchall;let d;e._zod.parse=(h,g)=>{d??(d=r.value);const b=h.value;if(!l(b))return h.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),h;h.value={};const S=[],x=d.shape;for(const N of d.keys){const _=x[N],T=_._zod.optout==="optional",k=_._zod.run({value:b[N],issues:[]},g);k instanceof Promise?S.push(k.then(E=>ic(E,h,N,b,T))):ic(k,h,N,b,T)}return c?e0(S,b,h,g,r.value,e):S.length?Promise.all(S).then(()=>h):h}}),q_=H("$ZodObjectJIT",(e,n)=>{L_.init(e,n);const i=e._zod.parse,r=yc(()=>Wv(n)),l=N=>{const _=new s_(["shape","payload","ctx"]),T=r.value,k=G=>{const Z=Wy(G);return`shape[${Z}]._zod.run({ value: input[${Z}], issues: [] }, ctx)`};_.write("const input = payload.value;");const E=Object.create(null);let R=0;for(const G of T.keys)E[G]=`key_${R++}`;_.write("const newResult = {};");for(const G of T.keys){const Z=E[G],X=Wy(G),O=N[G]?._zod?.optout==="optional";_.write(`const ${Z} = ${k(G)};`),O?_.write(`
16
+ `))}}const l_={major:4,minor:3,patch:6},ut=Q("$ZodType",(e,n)=>{var i;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=l_;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const l of r)for(const c of l._zod.onattach)c(e);if(r.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const l=(d,h,g)=>{let v=Ts(d),S;for(const x of h){if(x._zod.def.when){if(!x._zod.def.when(d))continue}else if(v)continue;const N=d.issues.length,_=x._zod.check(d);if(_ instanceof Promise&&g?.async===!1)throw new Ms;if(S||_ instanceof Promise)S=(S??Promise.resolve()).then(async()=>{await _,d.issues.length!==N&&(v||(v=Ts(d,N)))});else{if(d.issues.length===N)continue;v||(v=Ts(d,N))}}return S?S.then(()=>d):d},c=(d,h,g)=>{if(Ts(d))return d.aborted=!0,d;const v=l(h,r,g);if(v instanceof Promise){if(g.async===!1)throw new Ms;return v.then(S=>e._zod.parse(S,g))}return e._zod.parse(v,g)};e._zod.run=(d,h)=>{if(h.skipChecks)return e._zod.parse(d,h);if(h.direction==="backward"){const v=e._zod.parse({value:d.value,issues:[]},{...h,skipChecks:!0});return v instanceof Promise?v.then(S=>c(S,d,h)):c(v,d,h)}const g=e._zod.parse(d,h);if(g instanceof Promise){if(h.async===!1)throw new Ms;return g.then(v=>l(v,r,h))}return l(g,r,h)}}Pe(e,"~standard",()=>({validate:l=>{try{const c=m2(e,l);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return h2(e,l).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),tp=Q("$ZodString",(e,n)=>{ut.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??G2(e._zod.bag),e._zod.parse=(i,r)=>{if(n.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),ct=Q("$ZodStringFormat",(e,n)=>{Sc.init(e,n),tp.init(e,n)}),c_=Q("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=E2),ct.init(e,n)}),u_=Q("$ZodUUID",(e,n)=>{if(n.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(r===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=tb(r))}else n.pattern??(n.pattern=tb());ct.init(e,n)}),d_=Q("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=O2),ct.init(e,n)}),f_=Q("$ZodURL",(e,n)=>{ct.init(e,n),e._zod.check=i=>{try{const r=i.value.trim(),l=new URL(r);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(l.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:i.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:i.value,inst:e,continue:!n.abort})),n.normalize?i.value=l.href:i.value=r;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!n.abort})}}}),p_=Q("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=R2()),ct.init(e,n)}),m_=Q("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=z2),ct.init(e,n)}),h_=Q("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=N2),ct.init(e,n)}),g_=Q("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=k2),ct.init(e,n)}),y_=Q("$ZodULID",(e,n)=>{n.pattern??(n.pattern=A2),ct.init(e,n)}),b_=Q("$ZodXID",(e,n)=>{n.pattern??(n.pattern=_2),ct.init(e,n)}),v_=Q("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=C2),ct.init(e,n)}),S_=Q("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=P2(n)),ct.init(e,n)}),x_=Q("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=I2),ct.init(e,n)}),w_=Q("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=V2(n)),ct.init(e,n)}),j_=Q("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=T2),ct.init(e,n)}),N_=Q("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=M2),ct.init(e,n),e._zod.bag.format="ipv4"}),k_=Q("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=B2),ct.init(e,n),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!n.abort})}}}),A_=Q("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=L2),ct.init(e,n)}),__=Q("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=q2),ct.init(e,n),e._zod.check=i=>{const r=i.value.split("/");try{if(r.length!==2)throw new Error;const[l,c]=r;if(!c)throw new Error;const d=Number(c);if(`${d}`!==c)throw new Error;if(d<0||d>128)throw new Error;new URL(`http://[${l}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!n.abort})}}});function Fv(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const C_=Q("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=U2),ct.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{Fv(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!n.abort})}});function z_(e){if(!Hv.test(e))return!1;const n=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),i=n.padEnd(Math.ceil(n.length/4)*4,"=");return Fv(i)}const T_=Q("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=Hv),ct.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{z_(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!n.abort})}}),E_=Q("$ZodE164",(e,n)=>{n.pattern??(n.pattern=$2),ct.init(e,n)});function O_(e,n=null){try{const i=e.split(".");if(i.length!==3)return!1;const[r]=i;if(!r)return!1;const l=JSON.parse(atob(r));return!("typ"in l&&l?.typ!=="JWT"||!l.alg||n&&(!("alg"in l)||l.alg!==n))}catch{return!1}}const D_=Q("$ZodJWT",(e,n)=>{ct.init(e,n),e._zod.check=i=>{O_(i.value,n.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!n.abort})}}),Wv=Q("$ZodNumber",(e,n)=>{ut.init(e,n),e._zod.pattern=e._zod.bag.pattern??Zv,e._zod.parse=(i,r)=>{if(n.coerce)try{i.value=Number(i.value)}catch{}const l=i.value;if(typeof l=="number"&&!Number.isNaN(l)&&Number.isFinite(l))return i;const c=typeof l=="number"?Number.isNaN(l)?"NaN":Number.isFinite(l)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:l,inst:e,...c?{received:c}:{}}),i}}),R_=Q("$ZodNumberFormat",(e,n)=>{X2.init(e,n),Wv.init(e,n)}),M_=Q("$ZodBoolean",(e,n)=>{ut.init(e,n),e._zod.pattern=Q2,e._zod.parse=(i,r)=>{if(n.coerce)try{i.value=!!i.value}catch{}const l=i.value;return typeof l=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:l,inst:e}),i}}),B_=Q("$ZodUnknown",(e,n)=>{ut.init(e,n),e._zod.parse=i=>i}),L_=Q("$ZodNever",(e,n)=>{ut.init(e,n),e._zod.parse=(i,r)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function nb(e,n,i){e.issues.length&&n.issues.push(...Es(i,e.issues)),n.value[i]=e.value}const q_=Q("$ZodArray",(e,n)=>{ut.init(e,n),e._zod.parse=(i,r)=>{const l=i.value;if(!Array.isArray(l))return i.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),i;i.value=Array(l.length);const c=[];for(let d=0;d<l.length;d++){const h=l[d],g=n.element._zod.run({value:h,issues:[]},r);g instanceof Promise?c.push(g.then(v=>nb(v,i,d))):nb(g,i,d)}return c.length?Promise.all(c).then(()=>i):i}});function ic(e,n,i,r,l){if(e.issues.length){if(l&&!(i in r))return;n.issues.push(...Es(i,e.issues))}e.value===void 0?i in r&&(n.value[i]=void 0):n.value[i]=e.value}function e0(e){const n=Object.keys(e.shape);for(const r of n)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const i=a2(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(i)}}function t0(e,n,i,r,l,c){const d=[],h=l.keySet,g=l.catchall._zod,v=g.def.type,S=g.optout==="optional";for(const x in n){if(h.has(x))continue;if(v==="never"){d.push(x);continue}const N=g.run({value:n[x],issues:[]},r);N instanceof Promise?e.push(N.then(_=>ic(_,i,x,n,S))):ic(N,i,x,n,S)}return d.length&&i.issues.push({code:"unrecognized_keys",keys:d,input:n,inst:c}),e.length?Promise.all(e).then(()=>i):i}const U_=Q("$ZodObject",(e,n)=>{if(ut.init(e,n),!Object.getOwnPropertyDescriptor(n,"shape")?.get){const h=n.shape;Object.defineProperty(n,"shape",{get:()=>{const g={...h};return Object.defineProperty(n,"shape",{value:g}),g}})}const r=yc(()=>e0(n));Pe(e._zod,"propValues",()=>{const h=n.shape,g={};for(const v in h){const S=h[v]._zod;if(S.values){g[v]??(g[v]=new Set);for(const x of S.values)g[v].add(x)}}return g});const l=co,c=n.catchall;let d;e._zod.parse=(h,g)=>{d??(d=r.value);const v=h.value;if(!l(v))return h.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),h;h.value={};const S=[],x=d.shape;for(const N of d.keys){const _=x[N],T=_._zod.optout==="optional",k=_._zod.run({value:v[N],issues:[]},g);k instanceof Promise?S.push(k.then(E=>ic(E,h,N,v,T))):ic(k,h,N,v,T)}return c?t0(S,v,h,g,r.value,e):S.length?Promise.all(S).then(()=>h):h}}),$_=Q("$ZodObjectJIT",(e,n)=>{U_.init(e,n);const i=e._zod.parse,r=yc(()=>e0(n)),l=N=>{const _=new o_(["shape","payload","ctx"]),T=r.value,k=G=>{const Z=eb(G);return`shape[${Z}]._zod.run({ value: input[${Z}], issues: [] }, ctx)`};_.write("const input = payload.value;");const E=Object.create(null);let R=0;for(const G of T.keys)E[G]=`key_${R++}`;_.write("const newResult = {};");for(const G of T.keys){const Z=E[G],X=eb(G),O=N[G]?._zod?.optout==="optional";_.write(`const ${Z} = ${k(G)};`),O?_.write(`
17
17
  if (${Z}.issues.length) {
18
18
  if (${X} in input) {
19
19
  payload.issues = payload.issues.concat(${Z}.issues.map(iss => ({
@@ -47,32 +47,32 @@ Error generating stack: `+o.message+`
47
47
  newResult[${X}] = ${Z}.value;
48
48
  }
49
49
 
50
- `)}_.write("payload.value = newResult;"),_.write("return payload;");const V=_.compile();return(G,Z)=>V(N,G,Z)};let c;const d=co,h=!Lv.jitless,b=h&&WA.value,S=n.catchall;let x;e._zod.parse=(N,_)=>{x??(x=r.value);const T=N.value;return d(T)?h&&b&&_?.async===!1&&_.jitless!==!0?(c||(c=l(n.shape)),N=c(N,_),S?e0([],T,N,_,x,e):N):i(N,_):(N.issues.push({expected:"object",code:"invalid_type",input:T,inst:e}),N)}});function nb(e,n,i,r){for(const c of e)if(c.issues.length===0)return n.value=c.value,n;const l=e.filter(c=>!Ts(c));return l.length===1?(n.value=l[0].value,l[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:i,errors:e.map(c=>c.issues.map(d=>Xa(d,r,Ya())))}),n)}const t0=H("$ZodUnion",(e,n)=>{ut.init(e,n),Pe(e._zod,"optin",()=>n.options.some(l=>l._zod.optin==="optional")?"optional":void 0),Pe(e._zod,"optout",()=>n.options.some(l=>l._zod.optout==="optional")?"optional":void 0),Pe(e._zod,"values",()=>{if(n.options.every(l=>l._zod.values))return new Set(n.options.flatMap(l=>Array.from(l._zod.values)))}),Pe(e._zod,"pattern",()=>{if(n.options.every(l=>l._zod.pattern)){const l=n.options.map(c=>c._zod.pattern);return new RegExp(`^(${l.map(c=>Jf(c.source)).join("|")})$`)}});const i=n.options.length===1,r=n.options[0]._zod.run;e._zod.parse=(l,c)=>{if(i)return r(l,c);let d=!1;const h=[];for(const g of n.options){const b=g._zod.run({value:l.value,issues:[]},c);if(b instanceof Promise)h.push(b),d=!0;else{if(b.issues.length===0)return b;h.push(b)}}return d?Promise.all(h).then(g=>nb(g,l,e,c)):nb(h,l,e,c)}}),U_=H("$ZodDiscriminatedUnion",(e,n)=>{n.inclusive=!1,t0.init(e,n);const i=e._zod.parse;Pe(e._zod,"propValues",()=>{const l={};for(const c of n.options){const d=c._zod.propValues;if(!d||Object.keys(d).length===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(c)}"`);for(const[h,g]of Object.entries(d)){l[h]||(l[h]=new Set);for(const b of g)l[h].add(b)}}return l});const r=yc(()=>{const l=n.options,c=new Map;for(const d of l){const h=d._zod.propValues?.[n.discriminator];if(!h||h.size===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(d)}"`);for(const g of h){if(c.has(g))throw new Error(`Duplicate discriminator value "${String(g)}"`);c.set(g,d)}}return c});e._zod.parse=(l,c)=>{const d=l.value;if(!co(d))return l.issues.push({code:"invalid_type",expected:"object",input:d,inst:e}),l;const h=r.value.get(d?.[n.discriminator]);return h?h._zod.run(l,c):n.unionFallback?i(l,c):(l.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:n.discriminator,input:d,path:[n.discriminator],inst:e}),l)}}),$_=H("$ZodIntersection",(e,n)=>{ut.init(e,n),e._zod.parse=(i,r)=>{const l=i.value,c=n.left._zod.run({value:l,issues:[]},r),d=n.right._zod.run({value:l,issues:[]},r);return c instanceof Promise||d instanceof Promise?Promise.all([c,d]).then(([g,b])=>ab(i,g,b)):ab(i,c,d)}});function kf(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(Us(e)&&Us(n)){const i=Object.keys(n),r=Object.keys(e).filter(c=>i.indexOf(c)!==-1),l={...e,...n};for(const c of r){const d=kf(e[c],n[c]);if(!d.valid)return{valid:!1,mergeErrorPath:[c,...d.mergeErrorPath]};l[c]=d.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let r=0;r<e.length;r++){const l=e[r],c=n[r],d=kf(l,c);if(!d.valid)return{valid:!1,mergeErrorPath:[r,...d.mergeErrorPath]};i.push(d.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function ab(e,n,i){const r=new Map;let l;for(const h of n.issues)if(h.code==="unrecognized_keys"){l??(l=h);for(const g of h.keys)r.has(g)||r.set(g,{}),r.get(g).l=!0}else e.issues.push(h);for(const h of i.issues)if(h.code==="unrecognized_keys")for(const g of h.keys)r.has(g)||r.set(g,{}),r.get(g).r=!0;else e.issues.push(h);const c=[...r].filter(([,h])=>h.l&&h.r).map(([h])=>h);if(c.length&&l&&e.issues.push({...l,keys:c}),Ts(e))return e;const d=kf(n.value,i.value);if(!d.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(d.mergeErrorPath)}`);return e.value=d.data,e}const I_=H("$ZodRecord",(e,n)=>{ut.init(e,n),e._zod.parse=(i,r)=>{const l=i.value;if(!Us(l))return i.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),i;const c=[],d=n.keyType._zod.values;if(d){i.value={};const h=new Set;for(const b of d)if(typeof b=="string"||typeof b=="number"||typeof b=="symbol"){h.add(typeof b=="number"?b.toString():b);const S=n.valueType._zod.run({value:l[b],issues:[]},r);S instanceof Promise?c.push(S.then(x=>{x.issues.length&&i.issues.push(...Es(b,x.issues)),i.value[b]=x.value})):(S.issues.length&&i.issues.push(...Es(b,S.issues)),i.value[b]=S.value)}let g;for(const b in l)h.has(b)||(g=g??[],g.push(b));g&&g.length>0&&i.issues.push({code:"unrecognized_keys",input:l,inst:e,keys:g})}else{i.value={};for(const h of Reflect.ownKeys(l)){if(h==="__proto__")continue;let g=n.keyType._zod.run({value:h,issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof h=="string"&&Kv.test(h)&&g.issues.length){const x=n.keyType._zod.run({value:Number(h),issues:[]},r);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");x.issues.length===0&&(g=x)}if(g.issues.length){n.mode==="loose"?i.value[h]=l[h]:i.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(x=>Xa(x,r,Ya())),input:h,path:[h],inst:e});continue}const S=n.valueType._zod.run({value:l[h],issues:[]},r);S instanceof Promise?c.push(S.then(x=>{x.issues.length&&i.issues.push(...Es(h,x.issues)),i.value[g.value]=x.value})):(S.issues.length&&i.issues.push(...Es(h,S.issues)),i.value[g.value]=S.value)}}return c.length?Promise.all(c).then(()=>i):i}}),V_=H("$ZodEnum",(e,n)=>{ut.init(e,n);const i=qv(n.entries),r=new Set(i);e._zod.values=r,e._zod.pattern=new RegExp(`^(${i.filter(l=>e2.has(typeof l)).map(l=>typeof l=="string"?$s(l):l.toString()).join("|")})$`),e._zod.parse=(l,c)=>{const d=l.value;return r.has(d)||l.issues.push({code:"invalid_value",values:i,input:d,inst:e}),l}}),P_=H("$ZodLiteral",(e,n)=>{if(ut.init(e,n),n.values.length===0)throw new Error("Cannot create literal schema with no valid values");const i=new Set(n.values);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.values.map(r=>typeof r=="string"?$s(r):r?$s(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,l)=>{const c=r.value;return i.has(c)||r.issues.push({code:"invalid_value",values:n.values,input:c,inst:e}),r}}),G_=H("$ZodTransform",(e,n)=>{ut.init(e,n),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new Bv(e.constructor.name);const l=n.transform(i.value,i);if(r.async)return(l instanceof Promise?l:Promise.resolve(l)).then(d=>(i.value=d,i));if(l instanceof Promise)throw new Ms;return i.value=l,i}});function ib(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const n0=H("$ZodOptional",(e,n)=>{ut.init(e,n),e._zod.optin="optional",e._zod.optout="optional",Pe(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),Pe(e._zod,"pattern",()=>{const i=n.innerType._zod.pattern;return i?new RegExp(`^(${Jf(i.source)})?$`):void 0}),e._zod.parse=(i,r)=>{if(n.innerType._zod.optin==="optional"){const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(c=>ib(c,i.value)):ib(l,i.value)}return i.value===void 0?i:n.innerType._zod.run(i,r)}}),H_=H("$ZodExactOptional",(e,n)=>{n0.init(e,n),Pe(e._zod,"values",()=>n.innerType._zod.values),Pe(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(i,r)=>n.innerType._zod.run(i,r)}),Q_=H("$ZodNullable",(e,n)=>{ut.init(e,n),Pe(e._zod,"optin",()=>n.innerType._zod.optin),Pe(e._zod,"optout",()=>n.innerType._zod.optout),Pe(e._zod,"pattern",()=>{const i=n.innerType._zod.pattern;return i?new RegExp(`^(${Jf(i.source)}|null)$`):void 0}),Pe(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(i,r)=>i.value===null?i:n.innerType._zod.run(i,r)}),K_=H("$ZodDefault",(e,n)=>{ut.init(e,n),e._zod.optin="optional",Pe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return n.innerType._zod.run(i,r);if(i.value===void 0)return i.value=n.defaultValue,i;const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(c=>sb(c,n)):sb(l,n)}});function sb(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const Z_=H("$ZodPrefault",(e,n)=>{ut.init(e,n),e._zod.optin="optional",Pe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(i,r)=>(r.direction==="backward"||i.value===void 0&&(i.value=n.defaultValue),n.innerType._zod.run(i,r))}),Y_=H("$ZodNonOptional",(e,n)=>{ut.init(e,n),Pe(e._zod,"values",()=>{const i=n.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),e._zod.parse=(i,r)=>{const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(c=>rb(c,e)):rb(l,e)}});function rb(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const X_=H("$ZodCatch",(e,n)=>{ut.init(e,n),Pe(e._zod,"optin",()=>n.innerType._zod.optin),Pe(e._zod,"optout",()=>n.innerType._zod.optout),Pe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return n.innerType._zod.run(i,r);const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(c=>(i.value=c.value,c.issues.length&&(i.value=n.catchValue({...i,error:{issues:c.issues.map(d=>Xa(d,r,Ya()))},input:i.value}),i.issues=[]),i)):(i.value=l.value,l.issues.length&&(i.value=n.catchValue({...i,error:{issues:l.issues.map(c=>Xa(c,r,Ya()))},input:i.value}),i.issues=[]),i)}}),J_=H("$ZodPipe",(e,n)=>{ut.init(e,n),Pe(e._zod,"values",()=>n.in._zod.values),Pe(e._zod,"optin",()=>n.in._zod.optin),Pe(e._zod,"optout",()=>n.out._zod.optout),Pe(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(i,r)=>{if(r.direction==="backward"){const c=n.out._zod.run(i,r);return c instanceof Promise?c.then(d=>Il(d,n.in,r)):Il(c,n.in,r)}const l=n.in._zod.run(i,r);return l instanceof Promise?l.then(c=>Il(c,n.out,r)):Il(l,n.out,r)}});function Il(e,n,i){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},i)}const F_=H("$ZodReadonly",(e,n)=>{ut.init(e,n),Pe(e._zod,"propValues",()=>n.innerType._zod.propValues),Pe(e._zod,"values",()=>n.innerType._zod.values),Pe(e._zod,"optin",()=>n.innerType?._zod?.optin),Pe(e._zod,"optout",()=>n.innerType?._zod?.optout),e._zod.parse=(i,r)=>{if(r.direction==="backward")return n.innerType._zod.run(i,r);const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(ob):ob(l)}});function ob(e){return e.value=Object.freeze(e.value),e}const W_=H("$ZodCustom",(e,n)=>{nn.init(e,n),ut.init(e,n),e._zod.parse=(i,r)=>i,e._zod.check=i=>{const r=i.value,l=n.fn(r);if(l instanceof Promise)return l.then(c=>lb(c,i,r,e));lb(l,i,r,e)}});function lb(e,n,i,r){if(!e){const l={code:"custom",input:i,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(l.params=r._zod.def.params),n.issues.push(uo(l))}}var cb;class eC{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...i){const r=i[0];return this._map.set(n,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const i=this._map.get(n);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(n),this}get(n){const i=n._zod.parent;if(i){const r={...this.get(i)??{}};delete r.id;const l={...r,...this._map.get(n)};return Object.keys(l).length?l:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function tC(){return new eC}(cb=globalThis).__zod_globalRegistry??(cb.__zod_globalRegistry=tC());const io=globalThis.__zod_globalRegistry;function nC(e,n){return new e({type:"string",...ye(n)})}function aC(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ye(n)})}function ub(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ye(n)})}function iC(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ye(n)})}function sC(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ye(n)})}function rC(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ye(n)})}function oC(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ye(n)})}function lC(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ye(n)})}function cC(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ye(n)})}function uC(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ye(n)})}function dC(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ye(n)})}function fC(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ye(n)})}function pC(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ye(n)})}function mC(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ye(n)})}function hC(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ye(n)})}function gC(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ye(n)})}function yC(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ye(n)})}function bC(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ye(n)})}function vC(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ye(n)})}function SC(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ye(n)})}function xC(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ye(n)})}function wC(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ye(n)})}function jC(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ye(n)})}function NC(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ye(n)})}function kC(e,n){return new e({type:"string",format:"date",check:"string_format",...ye(n)})}function AC(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...ye(n)})}function _C(e,n){return new e({type:"string",format:"duration",check:"string_format",...ye(n)})}function CC(e,n){return new e({type:"number",checks:[],...ye(n)})}function zC(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ye(n)})}function TC(e,n){return new e({type:"boolean",...ye(n)})}function EC(e){return new e({type:"unknown"})}function OC(e,n){return new e({type:"never",...ye(n)})}function db(e,n){return new Yv({check:"less_than",...ye(n),value:e,inclusive:!1})}function af(e,n){return new Yv({check:"less_than",...ye(n),value:e,inclusive:!0})}function fb(e,n){return new Xv({check:"greater_than",...ye(n),value:e,inclusive:!1})}function sf(e,n){return new Xv({check:"greater_than",...ye(n),value:e,inclusive:!0})}function pb(e,n){return new K2({check:"multiple_of",...ye(n),value:e})}function a0(e,n){return new Y2({check:"max_length",...ye(n),maximum:e})}function sc(e,n){return new X2({check:"min_length",...ye(n),minimum:e})}function i0(e,n){return new J2({check:"length_equals",...ye(n),length:e})}function DC(e,n){return new F2({check:"string_format",format:"regex",...ye(n),pattern:e})}function RC(e){return new W2({check:"string_format",format:"lowercase",...ye(e)})}function MC(e){return new e_({check:"string_format",format:"uppercase",...ye(e)})}function BC(e,n){return new t_({check:"string_format",format:"includes",...ye(n),includes:e})}function LC(e,n){return new n_({check:"string_format",format:"starts_with",...ye(n),prefix:e})}function qC(e,n){return new a_({check:"string_format",format:"ends_with",...ye(n),suffix:e})}function Ks(e){return new i_({check:"overwrite",tx:e})}function UC(e){return Ks(n=>n.normalize(e))}function $C(){return Ks(e=>e.trim())}function IC(){return Ks(e=>e.toLowerCase())}function VC(){return Ks(e=>e.toUpperCase())}function PC(){return Ks(e=>FA(e))}function GC(e,n,i){return new e({type:"array",element:n,...ye(i)})}function HC(e,n,i){return new e({type:"custom",check:"custom",fn:n,...ye(i)})}function QC(e){const n=KC(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(uo(r,i.value,n._zod.def));else{const l=r;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=i.value),l.inst??(l.inst=n),l.continue??(l.continue=!n._zod.def.abort),i.issues.push(uo(l))}},e(i.value,i)));return n}function KC(e,n){const i=new nn({check:"custom",...ye(n)});return i._zod.check=e,i}function s0(e){let n=e?.target??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??io,target:n,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 kt(e,n,i={path:[],schemaPath:[]}){var r;const l=e._zod.def,c=n.seen.get(e);if(c)return c.count++,i.schemaPath.includes(e)&&(c.cycle=i.path),c.schema;const d={schema:{},count:1,cycle:void 0,path:i.path};n.seen.set(e,d);const h=e._zod.toJSONSchema?.();if(h)d.schema=h;else{const S={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,d.schema,S);else{const N=d.schema,_=n.processors[l.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);_(e,n,N,S)}const x=e._zod.parent;x&&(d.ref||(d.ref=x),kt(x,n,S),n.seen.get(x).isParent=!0)}const g=n.metadataRegistry.get(e);return g&&Object.assign(d.schema,g),n.io==="input"&&Pt(e)&&(delete d.schema.examples,delete d.schema.default),n.io==="input"&&d.schema._prefault&&((r=d.schema).default??(r.default=d.schema._prefault)),delete d.schema._prefault,n.seen.get(e).schema}function r0(e,n){const i=e.seen.get(n);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const d of e.seen.entries()){const h=e.metadataRegistry.get(d[0])?.id;if(h){const g=r.get(h);if(g&&g!==d[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(h,d[0])}}const l=d=>{const h=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const x=e.external.registry.get(d[0])?.id,N=e.external.uri??(T=>T);if(x)return{ref:N(x)};const _=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=_,{defId:_,ref:`${N("__shared")}#/${h}/${_}`}}if(d[1]===i)return{ref:"#"};const b=`#/${h}/`,S=d[1].schema.id??`__schema${e.counter++}`;return{defId:S,ref:b+S}},c=d=>{if(d[1].schema.$ref)return;const h=d[1],{ref:g,defId:b}=l(d);h.def={...h.schema},b&&(h.defId=b);const S=h.schema;for(const x in S)delete S[x];S.$ref=g};if(e.cycles==="throw")for(const d of e.seen.entries()){const h=d[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/<root>
50
+ `)}_.write("payload.value = newResult;"),_.write("return payload;");const V=_.compile();return(G,Z)=>V(N,G,Z)};let c;const d=co,h=!qv.jitless,v=h&&t2.value,S=n.catchall;let x;e._zod.parse=(N,_)=>{x??(x=r.value);const T=N.value;return d(T)?h&&v&&_?.async===!1&&_.jitless!==!0?(c||(c=l(n.shape)),N=c(N,_),S?t0([],T,N,_,x,e):N):i(N,_):(N.issues.push({expected:"object",code:"invalid_type",input:T,inst:e}),N)}});function ab(e,n,i,r){for(const c of e)if(c.issues.length===0)return n.value=c.value,n;const l=e.filter(c=>!Ts(c));return l.length===1?(n.value=l[0].value,l[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:i,errors:e.map(c=>c.issues.map(d=>Xa(d,r,Ya())))}),n)}const n0=Q("$ZodUnion",(e,n)=>{ut.init(e,n),Pe(e._zod,"optin",()=>n.options.some(l=>l._zod.optin==="optional")?"optional":void 0),Pe(e._zod,"optout",()=>n.options.some(l=>l._zod.optout==="optional")?"optional":void 0),Pe(e._zod,"values",()=>{if(n.options.every(l=>l._zod.values))return new Set(n.options.flatMap(l=>Array.from(l._zod.values)))}),Pe(e._zod,"pattern",()=>{if(n.options.every(l=>l._zod.pattern)){const l=n.options.map(c=>c._zod.pattern);return new RegExp(`^(${l.map(c=>Jf(c.source)).join("|")})$`)}});const i=n.options.length===1,r=n.options[0]._zod.run;e._zod.parse=(l,c)=>{if(i)return r(l,c);let d=!1;const h=[];for(const g of n.options){const v=g._zod.run({value:l.value,issues:[]},c);if(v instanceof Promise)h.push(v),d=!0;else{if(v.issues.length===0)return v;h.push(v)}}return d?Promise.all(h).then(g=>ab(g,l,e,c)):ab(h,l,e,c)}}),I_=Q("$ZodDiscriminatedUnion",(e,n)=>{n.inclusive=!1,n0.init(e,n);const i=e._zod.parse;Pe(e._zod,"propValues",()=>{const l={};for(const c of n.options){const d=c._zod.propValues;if(!d||Object.keys(d).length===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(c)}"`);for(const[h,g]of Object.entries(d)){l[h]||(l[h]=new Set);for(const v of g)l[h].add(v)}}return l});const r=yc(()=>{const l=n.options,c=new Map;for(const d of l){const h=d._zod.propValues?.[n.discriminator];if(!h||h.size===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(d)}"`);for(const g of h){if(c.has(g))throw new Error(`Duplicate discriminator value "${String(g)}"`);c.set(g,d)}}return c});e._zod.parse=(l,c)=>{const d=l.value;if(!co(d))return l.issues.push({code:"invalid_type",expected:"object",input:d,inst:e}),l;const h=r.value.get(d?.[n.discriminator]);return h?h._zod.run(l,c):n.unionFallback?i(l,c):(l.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:n.discriminator,input:d,path:[n.discriminator],inst:e}),l)}}),V_=Q("$ZodIntersection",(e,n)=>{ut.init(e,n),e._zod.parse=(i,r)=>{const l=i.value,c=n.left._zod.run({value:l,issues:[]},r),d=n.right._zod.run({value:l,issues:[]},r);return c instanceof Promise||d instanceof Promise?Promise.all([c,d]).then(([g,v])=>ib(i,g,v)):ib(i,c,d)}});function kf(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(Us(e)&&Us(n)){const i=Object.keys(n),r=Object.keys(e).filter(c=>i.indexOf(c)!==-1),l={...e,...n};for(const c of r){const d=kf(e[c],n[c]);if(!d.valid)return{valid:!1,mergeErrorPath:[c,...d.mergeErrorPath]};l[c]=d.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let r=0;r<e.length;r++){const l=e[r],c=n[r],d=kf(l,c);if(!d.valid)return{valid:!1,mergeErrorPath:[r,...d.mergeErrorPath]};i.push(d.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function ib(e,n,i){const r=new Map;let l;for(const h of n.issues)if(h.code==="unrecognized_keys"){l??(l=h);for(const g of h.keys)r.has(g)||r.set(g,{}),r.get(g).l=!0}else e.issues.push(h);for(const h of i.issues)if(h.code==="unrecognized_keys")for(const g of h.keys)r.has(g)||r.set(g,{}),r.get(g).r=!0;else e.issues.push(h);const c=[...r].filter(([,h])=>h.l&&h.r).map(([h])=>h);if(c.length&&l&&e.issues.push({...l,keys:c}),Ts(e))return e;const d=kf(n.value,i.value);if(!d.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(d.mergeErrorPath)}`);return e.value=d.data,e}const P_=Q("$ZodRecord",(e,n)=>{ut.init(e,n),e._zod.parse=(i,r)=>{const l=i.value;if(!Us(l))return i.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),i;const c=[],d=n.keyType._zod.values;if(d){i.value={};const h=new Set;for(const v of d)if(typeof v=="string"||typeof v=="number"||typeof v=="symbol"){h.add(typeof v=="number"?v.toString():v);const S=n.valueType._zod.run({value:l[v],issues:[]},r);S instanceof Promise?c.push(S.then(x=>{x.issues.length&&i.issues.push(...Es(v,x.issues)),i.value[v]=x.value})):(S.issues.length&&i.issues.push(...Es(v,S.issues)),i.value[v]=S.value)}let g;for(const v in l)h.has(v)||(g=g??[],g.push(v));g&&g.length>0&&i.issues.push({code:"unrecognized_keys",input:l,inst:e,keys:g})}else{i.value={};for(const h of Reflect.ownKeys(l)){if(h==="__proto__")continue;let g=n.keyType._zod.run({value:h,issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof h=="string"&&Zv.test(h)&&g.issues.length){const x=n.keyType._zod.run({value:Number(h),issues:[]},r);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");x.issues.length===0&&(g=x)}if(g.issues.length){n.mode==="loose"?i.value[h]=l[h]:i.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(x=>Xa(x,r,Ya())),input:h,path:[h],inst:e});continue}const S=n.valueType._zod.run({value:l[h],issues:[]},r);S instanceof Promise?c.push(S.then(x=>{x.issues.length&&i.issues.push(...Es(h,x.issues)),i.value[g.value]=x.value})):(S.issues.length&&i.issues.push(...Es(h,S.issues)),i.value[g.value]=S.value)}}return c.length?Promise.all(c).then(()=>i):i}}),G_=Q("$ZodEnum",(e,n)=>{ut.init(e,n);const i=Uv(n.entries),r=new Set(i);e._zod.values=r,e._zod.pattern=new RegExp(`^(${i.filter(l=>n2.has(typeof l)).map(l=>typeof l=="string"?$s(l):l.toString()).join("|")})$`),e._zod.parse=(l,c)=>{const d=l.value;return r.has(d)||l.issues.push({code:"invalid_value",values:i,input:d,inst:e}),l}}),H_=Q("$ZodLiteral",(e,n)=>{if(ut.init(e,n),n.values.length===0)throw new Error("Cannot create literal schema with no valid values");const i=new Set(n.values);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.values.map(r=>typeof r=="string"?$s(r):r?$s(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,l)=>{const c=r.value;return i.has(c)||r.issues.push({code:"invalid_value",values:n.values,input:c,inst:e}),r}}),Q_=Q("$ZodTransform",(e,n)=>{ut.init(e,n),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new Lv(e.constructor.name);const l=n.transform(i.value,i);if(r.async)return(l instanceof Promise?l:Promise.resolve(l)).then(d=>(i.value=d,i));if(l instanceof Promise)throw new Ms;return i.value=l,i}});function sb(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const a0=Q("$ZodOptional",(e,n)=>{ut.init(e,n),e._zod.optin="optional",e._zod.optout="optional",Pe(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),Pe(e._zod,"pattern",()=>{const i=n.innerType._zod.pattern;return i?new RegExp(`^(${Jf(i.source)})?$`):void 0}),e._zod.parse=(i,r)=>{if(n.innerType._zod.optin==="optional"){const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(c=>sb(c,i.value)):sb(l,i.value)}return i.value===void 0?i:n.innerType._zod.run(i,r)}}),K_=Q("$ZodExactOptional",(e,n)=>{a0.init(e,n),Pe(e._zod,"values",()=>n.innerType._zod.values),Pe(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(i,r)=>n.innerType._zod.run(i,r)}),Z_=Q("$ZodNullable",(e,n)=>{ut.init(e,n),Pe(e._zod,"optin",()=>n.innerType._zod.optin),Pe(e._zod,"optout",()=>n.innerType._zod.optout),Pe(e._zod,"pattern",()=>{const i=n.innerType._zod.pattern;return i?new RegExp(`^(${Jf(i.source)}|null)$`):void 0}),Pe(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(i,r)=>i.value===null?i:n.innerType._zod.run(i,r)}),Y_=Q("$ZodDefault",(e,n)=>{ut.init(e,n),e._zod.optin="optional",Pe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return n.innerType._zod.run(i,r);if(i.value===void 0)return i.value=n.defaultValue,i;const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(c=>rb(c,n)):rb(l,n)}});function rb(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const X_=Q("$ZodPrefault",(e,n)=>{ut.init(e,n),e._zod.optin="optional",Pe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(i,r)=>(r.direction==="backward"||i.value===void 0&&(i.value=n.defaultValue),n.innerType._zod.run(i,r))}),J_=Q("$ZodNonOptional",(e,n)=>{ut.init(e,n),Pe(e._zod,"values",()=>{const i=n.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),e._zod.parse=(i,r)=>{const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(c=>ob(c,e)):ob(l,e)}});function ob(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const F_=Q("$ZodCatch",(e,n)=>{ut.init(e,n),Pe(e._zod,"optin",()=>n.innerType._zod.optin),Pe(e._zod,"optout",()=>n.innerType._zod.optout),Pe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return n.innerType._zod.run(i,r);const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(c=>(i.value=c.value,c.issues.length&&(i.value=n.catchValue({...i,error:{issues:c.issues.map(d=>Xa(d,r,Ya()))},input:i.value}),i.issues=[]),i)):(i.value=l.value,l.issues.length&&(i.value=n.catchValue({...i,error:{issues:l.issues.map(c=>Xa(c,r,Ya()))},input:i.value}),i.issues=[]),i)}}),W_=Q("$ZodPipe",(e,n)=>{ut.init(e,n),Pe(e._zod,"values",()=>n.in._zod.values),Pe(e._zod,"optin",()=>n.in._zod.optin),Pe(e._zod,"optout",()=>n.out._zod.optout),Pe(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(i,r)=>{if(r.direction==="backward"){const c=n.out._zod.run(i,r);return c instanceof Promise?c.then(d=>Il(d,n.in,r)):Il(c,n.in,r)}const l=n.in._zod.run(i,r);return l instanceof Promise?l.then(c=>Il(c,n.out,r)):Il(l,n.out,r)}});function Il(e,n,i){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},i)}const eC=Q("$ZodReadonly",(e,n)=>{ut.init(e,n),Pe(e._zod,"propValues",()=>n.innerType._zod.propValues),Pe(e._zod,"values",()=>n.innerType._zod.values),Pe(e._zod,"optin",()=>n.innerType?._zod?.optin),Pe(e._zod,"optout",()=>n.innerType?._zod?.optout),e._zod.parse=(i,r)=>{if(r.direction==="backward")return n.innerType._zod.run(i,r);const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(lb):lb(l)}});function lb(e){return e.value=Object.freeze(e.value),e}const tC=Q("$ZodCustom",(e,n)=>{nn.init(e,n),ut.init(e,n),e._zod.parse=(i,r)=>i,e._zod.check=i=>{const r=i.value,l=n.fn(r);if(l instanceof Promise)return l.then(c=>cb(c,i,r,e));cb(l,i,r,e)}});function cb(e,n,i,r){if(!e){const l={code:"custom",input:i,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(l.params=r._zod.def.params),n.issues.push(uo(l))}}var ub;class nC{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...i){const r=i[0];return this._map.set(n,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const i=this._map.get(n);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(n),this}get(n){const i=n._zod.parent;if(i){const r={...this.get(i)??{}};delete r.id;const l={...r,...this._map.get(n)};return Object.keys(l).length?l:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function aC(){return new nC}(ub=globalThis).__zod_globalRegistry??(ub.__zod_globalRegistry=aC());const io=globalThis.__zod_globalRegistry;function iC(e,n){return new e({type:"string",...ye(n)})}function sC(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ye(n)})}function db(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ye(n)})}function rC(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ye(n)})}function oC(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ye(n)})}function lC(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ye(n)})}function cC(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ye(n)})}function uC(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ye(n)})}function dC(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ye(n)})}function fC(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ye(n)})}function pC(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ye(n)})}function mC(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ye(n)})}function hC(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ye(n)})}function gC(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ye(n)})}function yC(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ye(n)})}function bC(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ye(n)})}function vC(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ye(n)})}function SC(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ye(n)})}function xC(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ye(n)})}function wC(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ye(n)})}function jC(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ye(n)})}function NC(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ye(n)})}function kC(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ye(n)})}function AC(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ye(n)})}function _C(e,n){return new e({type:"string",format:"date",check:"string_format",...ye(n)})}function CC(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...ye(n)})}function zC(e,n){return new e({type:"string",format:"duration",check:"string_format",...ye(n)})}function TC(e,n){return new e({type:"number",checks:[],...ye(n)})}function EC(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ye(n)})}function OC(e,n){return new e({type:"boolean",...ye(n)})}function DC(e){return new e({type:"unknown"})}function RC(e,n){return new e({type:"never",...ye(n)})}function fb(e,n){return new Xv({check:"less_than",...ye(n),value:e,inclusive:!1})}function af(e,n){return new Xv({check:"less_than",...ye(n),value:e,inclusive:!0})}function pb(e,n){return new Jv({check:"greater_than",...ye(n),value:e,inclusive:!1})}function sf(e,n){return new Jv({check:"greater_than",...ye(n),value:e,inclusive:!0})}function mb(e,n){return new Y2({check:"multiple_of",...ye(n),value:e})}function i0(e,n){return new J2({check:"max_length",...ye(n),maximum:e})}function sc(e,n){return new F2({check:"min_length",...ye(n),minimum:e})}function s0(e,n){return new W2({check:"length_equals",...ye(n),length:e})}function MC(e,n){return new e_({check:"string_format",format:"regex",...ye(n),pattern:e})}function BC(e){return new t_({check:"string_format",format:"lowercase",...ye(e)})}function LC(e){return new n_({check:"string_format",format:"uppercase",...ye(e)})}function qC(e,n){return new a_({check:"string_format",format:"includes",...ye(n),includes:e})}function UC(e,n){return new i_({check:"string_format",format:"starts_with",...ye(n),prefix:e})}function $C(e,n){return new s_({check:"string_format",format:"ends_with",...ye(n),suffix:e})}function Ks(e){return new r_({check:"overwrite",tx:e})}function IC(e){return Ks(n=>n.normalize(e))}function VC(){return Ks(e=>e.trim())}function PC(){return Ks(e=>e.toLowerCase())}function GC(){return Ks(e=>e.toUpperCase())}function HC(){return Ks(e=>e2(e))}function QC(e,n,i){return new e({type:"array",element:n,...ye(i)})}function KC(e,n,i){return new e({type:"custom",check:"custom",fn:n,...ye(i)})}function ZC(e){const n=YC(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(uo(r,i.value,n._zod.def));else{const l=r;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=i.value),l.inst??(l.inst=n),l.continue??(l.continue=!n._zod.def.abort),i.issues.push(uo(l))}},e(i.value,i)));return n}function YC(e,n){const i=new nn({check:"custom",...ye(n)});return i._zod.check=e,i}function r0(e){let n=e?.target??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??io,target:n,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 kt(e,n,i={path:[],schemaPath:[]}){var r;const l=e._zod.def,c=n.seen.get(e);if(c)return c.count++,i.schemaPath.includes(e)&&(c.cycle=i.path),c.schema;const d={schema:{},count:1,cycle:void 0,path:i.path};n.seen.set(e,d);const h=e._zod.toJSONSchema?.();if(h)d.schema=h;else{const S={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,d.schema,S);else{const N=d.schema,_=n.processors[l.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);_(e,n,N,S)}const x=e._zod.parent;x&&(d.ref||(d.ref=x),kt(x,n,S),n.seen.get(x).isParent=!0)}const g=n.metadataRegistry.get(e);return g&&Object.assign(d.schema,g),n.io==="input"&&Pt(e)&&(delete d.schema.examples,delete d.schema.default),n.io==="input"&&d.schema._prefault&&((r=d.schema).default??(r.default=d.schema._prefault)),delete d.schema._prefault,n.seen.get(e).schema}function o0(e,n){const i=e.seen.get(n);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const d of e.seen.entries()){const h=e.metadataRegistry.get(d[0])?.id;if(h){const g=r.get(h);if(g&&g!==d[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(h,d[0])}}const l=d=>{const h=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const x=e.external.registry.get(d[0])?.id,N=e.external.uri??(T=>T);if(x)return{ref:N(x)};const _=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=_,{defId:_,ref:`${N("__shared")}#/${h}/${_}`}}if(d[1]===i)return{ref:"#"};const v=`#/${h}/`,S=d[1].schema.id??`__schema${e.counter++}`;return{defId:S,ref:v+S}},c=d=>{if(d[1].schema.$ref)return;const h=d[1],{ref:g,defId:v}=l(d);h.def={...h.schema},v&&(h.defId=v);const S=h.schema;for(const x in S)delete S[x];S.$ref=g};if(e.cycles==="throw")for(const d of e.seen.entries()){const h=d[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/<root>
51
51
 
52
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const h=d[1];if(n===d[0]){c(d);continue}if(e.external){const b=e.external.registry.get(d[0])?.id;if(n!==d[0]&&b){c(d);continue}}if(e.metadataRegistry.get(d[0])?.id){c(d);continue}if(h.cycle){c(d);continue}if(h.count>1&&e.reused==="ref"){c(d);continue}}}function o0(e,n){const i=e.seen.get(n);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=d=>{const h=e.seen.get(d);if(h.ref===null)return;const g=h.def??h.schema,b={...g},S=h.ref;if(h.ref=null,S){r(S);const N=e.seen.get(S),_=N.schema;if(_.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(_)):Object.assign(g,_),Object.assign(g,b),d._zod.parent===S)for(const k in g)k==="$ref"||k==="allOf"||k in b||delete g[k];if(_.$ref&&N.def)for(const k in g)k==="$ref"||k==="allOf"||k in N.def&&JSON.stringify(g[k])===JSON.stringify(N.def[k])&&delete g[k]}const x=d._zod.parent;if(x&&x!==S){r(x);const N=e.seen.get(x);if(N?.schema.$ref&&(g.$ref=N.schema.$ref,N.def))for(const _ in g)_==="$ref"||_==="allOf"||_ in N.def&&JSON.stringify(g[_])===JSON.stringify(N.def[_])&&delete g[_]}e.override({zodSchema:d,jsonSchema:g,path:h.path??[]})};for(const d of[...e.seen.entries()].reverse())r(d[0]);const l={};if(e.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?l.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?l.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(n)?.id;if(!d)throw new Error("Schema is missing an `id` property");l.$id=e.external.uri(d)}Object.assign(l,i.def??i.schema);const c=e.external?.defs??{};for(const d of e.seen.entries()){const h=d[1];h.def&&h.defId&&(c[h.defId]=h.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?l.$defs=c:l.definitions=c);try{const d=JSON.parse(JSON.stringify(l));return Object.defineProperty(d,"~standard",{value:{...n["~standard"],jsonSchema:{input:rc(n,"input",e.processors),output:rc(n,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function Pt(e,n){const i=n??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Pt(r.element,i);if(r.type==="set")return Pt(r.valueType,i);if(r.type==="lazy")return Pt(r.getter(),i);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Pt(r.innerType,i);if(r.type==="intersection")return Pt(r.left,i)||Pt(r.right,i);if(r.type==="record"||r.type==="map")return Pt(r.keyType,i)||Pt(r.valueType,i);if(r.type==="pipe")return Pt(r.in,i)||Pt(r.out,i);if(r.type==="object"){for(const l in r.shape)if(Pt(r.shape[l],i))return!0;return!1}if(r.type==="union"){for(const l of r.options)if(Pt(l,i))return!0;return!1}if(r.type==="tuple"){for(const l of r.items)if(Pt(l,i))return!0;return!!(r.rest&&Pt(r.rest,i))}return!1}const ZC=(e,n={})=>i=>{const r=s0({...i,processors:n});return kt(e,r),r0(r,e),o0(r,e)},rc=(e,n,i={})=>r=>{const{libraryOptions:l,target:c}=r??{},d=s0({...l??{},target:c,io:n,processors:i});return kt(e,d),r0(d,e),o0(d,e)},YC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},XC=(e,n,i,r)=>{const l=i;l.type="string";const{minimum:c,maximum:d,format:h,patterns:g,contentEncoding:b}=e._zod.bag;if(typeof c=="number"&&(l.minLength=c),typeof d=="number"&&(l.maxLength=d),h&&(l.format=YC[h]??h,l.format===""&&delete l.format,h==="time"&&delete l.format),b&&(l.contentEncoding=b),g&&g.size>0){const S=[...g];S.length===1?l.pattern=S[0].source:S.length>1&&(l.allOf=[...S.map(x=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},JC=(e,n,i,r)=>{const l=i,{minimum:c,maximum:d,format:h,multipleOf:g,exclusiveMaximum:b,exclusiveMinimum:S}=e._zod.bag;typeof h=="string"&&h.includes("int")?l.type="integer":l.type="number",typeof S=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(l.minimum=S,l.exclusiveMinimum=!0):l.exclusiveMinimum=S),typeof c=="number"&&(l.minimum=c,typeof S=="number"&&n.target!=="draft-04"&&(S>=c?delete l.minimum:delete l.exclusiveMinimum)),typeof b=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(l.maximum=b,l.exclusiveMaximum=!0):l.exclusiveMaximum=b),typeof d=="number"&&(l.maximum=d,typeof b=="number"&&n.target!=="draft-04"&&(b<=d?delete l.maximum:delete l.exclusiveMaximum)),typeof g=="number"&&(l.multipleOf=g)},FC=(e,n,i,r)=>{i.type="boolean"},WC=(e,n,i,r)=>{i.not={}},ez=(e,n,i,r)=>{},tz=(e,n,i,r)=>{const l=e._zod.def,c=qv(l.entries);c.every(d=>typeof d=="number")&&(i.type="number"),c.every(d=>typeof d=="string")&&(i.type="string"),i.enum=c},nz=(e,n,i,r)=>{const l=e._zod.def,c=[];for(const d of l.values)if(d===void 0){if(n.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof d=="bigint"){if(n.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(d))}else c.push(d);if(c.length!==0)if(c.length===1){const d=c[0];i.type=d===null?"null":typeof d,n.target==="draft-04"||n.target==="openapi-3.0"?i.enum=[d]:i.const=d}else c.every(d=>typeof d=="number")&&(i.type="number"),c.every(d=>typeof d=="string")&&(i.type="string"),c.every(d=>typeof d=="boolean")&&(i.type="boolean"),c.every(d=>d===null)&&(i.type="null"),i.enum=c},az=(e,n,i,r)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},iz=(e,n,i,r)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},sz=(e,n,i,r)=>{const l=i,c=e._zod.def,{minimum:d,maximum:h}=e._zod.bag;typeof d=="number"&&(l.minItems=d),typeof h=="number"&&(l.maxItems=h),l.type="array",l.items=kt(c.element,n,{...r,path:[...r.path,"items"]})},rz=(e,n,i,r)=>{const l=i,c=e._zod.def;l.type="object",l.properties={};const d=c.shape;for(const b in d)l.properties[b]=kt(d[b],n,{...r,path:[...r.path,"properties",b]});const h=new Set(Object.keys(d)),g=new Set([...h].filter(b=>{const S=c.shape[b]._zod;return n.io==="input"?S.optin===void 0:S.optout===void 0}));g.size>0&&(l.required=Array.from(g)),c.catchall?._zod.def.type==="never"?l.additionalProperties=!1:c.catchall?c.catchall&&(l.additionalProperties=kt(c.catchall,n,{...r,path:[...r.path,"additionalProperties"]})):n.io==="output"&&(l.additionalProperties=!1)},oz=(e,n,i,r)=>{const l=e._zod.def,c=l.inclusive===!1,d=l.options.map((h,g)=>kt(h,n,{...r,path:[...r.path,c?"oneOf":"anyOf",g]}));c?i.oneOf=d:i.anyOf=d},lz=(e,n,i,r)=>{const l=e._zod.def,c=kt(l.left,n,{...r,path:[...r.path,"allOf",0]}),d=kt(l.right,n,{...r,path:[...r.path,"allOf",1]}),h=b=>"allOf"in b&&Object.keys(b).length===1,g=[...h(c)?c.allOf:[c],...h(d)?d.allOf:[d]];i.allOf=g},cz=(e,n,i,r)=>{const l=i,c=e._zod.def;l.type="object";const d=c.keyType,g=d._zod.bag?.patterns;if(c.mode==="loose"&&g&&g.size>0){const S=kt(c.valueType,n,{...r,path:[...r.path,"patternProperties","*"]});l.patternProperties={};for(const x of g)l.patternProperties[x.source]=S}else(n.target==="draft-07"||n.target==="draft-2020-12")&&(l.propertyNames=kt(c.keyType,n,{...r,path:[...r.path,"propertyNames"]})),l.additionalProperties=kt(c.valueType,n,{...r,path:[...r.path,"additionalProperties"]});const b=d._zod.values;if(b){const S=[...b].filter(x=>typeof x=="string"||typeof x=="number");S.length>0&&(l.required=S)}},uz=(e,n,i,r)=>{const l=e._zod.def,c=kt(l.innerType,n,r),d=n.seen.get(e);n.target==="openapi-3.0"?(d.ref=l.innerType,i.nullable=!0):i.anyOf=[c,{type:"null"}]},dz=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType},fz=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType,i.default=JSON.parse(JSON.stringify(l.defaultValue))},pz=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType,n.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(l.defaultValue)))},mz=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType;let d;try{d=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=d},hz=(e,n,i,r)=>{const l=e._zod.def,c=n.io==="input"?l.in._zod.def.type==="transform"?l.out:l.in:l.out;kt(c,n,r);const d=n.seen.get(e);d.ref=c},gz=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType,i.readOnly=!0},l0=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType},yz=H("ZodISODateTime",(e,n)=>{b_.init(e,n),ft.init(e,n)});function bz(e){return NC(yz,e)}const vz=H("ZodISODate",(e,n)=>{v_.init(e,n),ft.init(e,n)});function Sz(e){return kC(vz,e)}const xz=H("ZodISOTime",(e,n)=>{S_.init(e,n),ft.init(e,n)});function wz(e){return AC(xz,e)}const jz=H("ZodISODuration",(e,n)=>{x_.init(e,n),ft.init(e,n)});function Nz(e){return _C(jz,e)}const kz=(e,n)=>{Vv.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>d2(e,i)},flatten:{value:i=>u2(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,Nf,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,Nf,2)}},isEmpty:{get(){return e.issues.length===0}}})},_n=H("ZodError",kz,{Parent:Error}),Az=Wf(_n),_z=ep(_n),Cz=bc(_n),zz=vc(_n),Tz=m2(_n),Ez=h2(_n),Oz=g2(_n),Dz=y2(_n),Rz=b2(_n),Mz=v2(_n),Bz=S2(_n),Lz=x2(_n),dt=H("ZodType",(e,n)=>(ut.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:rc(e,"input"),output:rc(e,"output")}}),e.toJSONSchema=ZC(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...i)=>e.clone(Fa(n,{checks:[...n.checks??[],...i.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(i,r)=>Wa(e,i,r),e.brand=()=>e,e.register=((i,r)=>(i.add(e,r),e)),e.parse=(i,r)=>Az(e,i,r,{callee:e.parse}),e.safeParse=(i,r)=>Cz(e,i,r),e.parseAsync=async(i,r)=>_z(e,i,r,{callee:e.parseAsync}),e.safeParseAsync=async(i,r)=>zz(e,i,r),e.spa=e.safeParseAsync,e.encode=(i,r)=>Tz(e,i,r),e.decode=(i,r)=>Ez(e,i,r),e.encodeAsync=async(i,r)=>Oz(e,i,r),e.decodeAsync=async(i,r)=>Dz(e,i,r),e.safeEncode=(i,r)=>Rz(e,i,r),e.safeDecode=(i,r)=>Mz(e,i,r),e.safeEncodeAsync=async(i,r)=>Bz(e,i,r),e.safeDecodeAsync=async(i,r)=>Lz(e,i,r),e.refine=(i,r)=>e.check(TT(i,r)),e.superRefine=i=>e.check(ET(i)),e.overwrite=i=>e.check(Ks(i)),e.optional=()=>gb(e),e.exactOptional=()=>yT(e),e.nullable=()=>yb(e),e.nullish=()=>gb(yb(e)),e.nonoptional=i=>jT(e,i),e.array=()=>A(e),e.or=i=>f0([e,i]),e.and=i=>dT(e,i),e.transform=i=>bb(e,hT(i)),e.default=i=>ST(e,i),e.prefault=i=>wT(e,i),e.catch=i=>kT(e,i),e.pipe=i=>bb(e,i),e.readonly=()=>CT(e),e.describe=i=>{const r=e.clone();return io.add(r,{description:i}),r},Object.defineProperty(e,"description",{get(){return io.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return io.get(e);const r=e.clone();return io.add(r,i[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),c0=H("_ZodString",(e,n)=>{tp.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(r,l,c)=>XC(e,r,l);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...r)=>e.check(DC(...r)),e.includes=(...r)=>e.check(BC(...r)),e.startsWith=(...r)=>e.check(LC(...r)),e.endsWith=(...r)=>e.check(qC(...r)),e.min=(...r)=>e.check(sc(...r)),e.max=(...r)=>e.check(a0(...r)),e.length=(...r)=>e.check(i0(...r)),e.nonempty=(...r)=>e.check(sc(1,...r)),e.lowercase=r=>e.check(RC(r)),e.uppercase=r=>e.check(MC(r)),e.trim=()=>e.check($C()),e.normalize=(...r)=>e.check(UC(...r)),e.toLowerCase=()=>e.check(IC()),e.toUpperCase=()=>e.check(VC()),e.slugify=()=>e.check(PC())}),qz=H("ZodString",(e,n)=>{tp.init(e,n),c0.init(e,n),e.email=i=>e.check(aC(Uz,i)),e.url=i=>e.check(lC($z,i)),e.jwt=i=>e.check(jC(tT,i)),e.emoji=i=>e.check(cC(Iz,i)),e.guid=i=>e.check(ub(mb,i)),e.uuid=i=>e.check(iC(Vl,i)),e.uuidv4=i=>e.check(sC(Vl,i)),e.uuidv6=i=>e.check(rC(Vl,i)),e.uuidv7=i=>e.check(oC(Vl,i)),e.nanoid=i=>e.check(uC(Vz,i)),e.guid=i=>e.check(ub(mb,i)),e.cuid=i=>e.check(dC(Pz,i)),e.cuid2=i=>e.check(fC(Gz,i)),e.ulid=i=>e.check(pC(Hz,i)),e.base64=i=>e.check(SC(Fz,i)),e.base64url=i=>e.check(xC(Wz,i)),e.xid=i=>e.check(mC(Qz,i)),e.ksuid=i=>e.check(hC(Kz,i)),e.ipv4=i=>e.check(gC(Zz,i)),e.ipv6=i=>e.check(yC(Yz,i)),e.cidrv4=i=>e.check(bC(Xz,i)),e.cidrv6=i=>e.check(vC(Jz,i)),e.e164=i=>e.check(wC(eT,i)),e.datetime=i=>e.check(bz(i)),e.date=i=>e.check(Sz(i)),e.time=i=>e.check(wz(i)),e.duration=i=>e.check(Nz(i))});function p(e){return nC(qz,e)}const ft=H("ZodStringFormat",(e,n)=>{ct.init(e,n),c0.init(e,n)}),Uz=H("ZodEmail",(e,n)=>{c_.init(e,n),ft.init(e,n)}),mb=H("ZodGUID",(e,n)=>{o_.init(e,n),ft.init(e,n)}),Vl=H("ZodUUID",(e,n)=>{l_.init(e,n),ft.init(e,n)}),$z=H("ZodURL",(e,n)=>{u_.init(e,n),ft.init(e,n)}),Iz=H("ZodEmoji",(e,n)=>{d_.init(e,n),ft.init(e,n)}),Vz=H("ZodNanoID",(e,n)=>{f_.init(e,n),ft.init(e,n)}),Pz=H("ZodCUID",(e,n)=>{p_.init(e,n),ft.init(e,n)}),Gz=H("ZodCUID2",(e,n)=>{m_.init(e,n),ft.init(e,n)}),Hz=H("ZodULID",(e,n)=>{h_.init(e,n),ft.init(e,n)}),Qz=H("ZodXID",(e,n)=>{g_.init(e,n),ft.init(e,n)}),Kz=H("ZodKSUID",(e,n)=>{y_.init(e,n),ft.init(e,n)}),Zz=H("ZodIPv4",(e,n)=>{w_.init(e,n),ft.init(e,n)}),Yz=H("ZodIPv6",(e,n)=>{j_.init(e,n),ft.init(e,n)}),Xz=H("ZodCIDRv4",(e,n)=>{N_.init(e,n),ft.init(e,n)}),Jz=H("ZodCIDRv6",(e,n)=>{k_.init(e,n),ft.init(e,n)}),Fz=H("ZodBase64",(e,n)=>{A_.init(e,n),ft.init(e,n)}),Wz=H("ZodBase64URL",(e,n)=>{C_.init(e,n),ft.init(e,n)}),eT=H("ZodE164",(e,n)=>{z_.init(e,n),ft.init(e,n)}),tT=H("ZodJWT",(e,n)=>{E_.init(e,n),ft.init(e,n)}),u0=H("ZodNumber",(e,n)=>{Fv.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(r,l,c)=>JC(e,r,l),e.gt=(r,l)=>e.check(fb(r,l)),e.gte=(r,l)=>e.check(sf(r,l)),e.min=(r,l)=>e.check(sf(r,l)),e.lt=(r,l)=>e.check(db(r,l)),e.lte=(r,l)=>e.check(af(r,l)),e.max=(r,l)=>e.check(af(r,l)),e.int=r=>e.check(hb(r)),e.safe=r=>e.check(hb(r)),e.positive=r=>e.check(fb(0,r)),e.nonnegative=r=>e.check(sf(0,r)),e.negative=r=>e.check(db(0,r)),e.nonpositive=r=>e.check(af(0,r)),e.multipleOf=(r,l)=>e.check(pb(r,l)),e.step=(r,l)=>e.check(pb(r,l)),e.finite=()=>e;const i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function v(e){return CC(u0,e)}const nT=H("ZodNumberFormat",(e,n)=>{O_.init(e,n),u0.init(e,n)});function hb(e){return zC(nT,e)}const aT=H("ZodBoolean",(e,n)=>{D_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>FC(e,i,r)});function oe(e){return TC(aT,e)}const iT=H("ZodUnknown",(e,n)=>{R_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>ez()});function qn(){return EC(iT)}const sT=H("ZodNever",(e,n)=>{M_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>WC(e,i,r)});function rT(e){return OC(sT,e)}const oT=H("ZodArray",(e,n)=>{B_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>sz(e,i,r,l),e.element=n.element,e.min=(i,r)=>e.check(sc(i,r)),e.nonempty=i=>e.check(sc(1,i)),e.max=(i,r)=>e.check(a0(i,r)),e.length=(i,r)=>e.check(i0(i,r)),e.unwrap=()=>e.element});function A(e,n){return GC(oT,e,n)}const lT=H("ZodObject",(e,n)=>{q_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>rz(e,i,r,l),Pe(e,"shape",()=>n.shape),e.keyof=()=>ie(Object.keys(e._zod.def.shape)),e.catchall=i=>e.clone({...e._zod.def,catchall:i}),e.passthrough=()=>e.clone({...e._zod.def,catchall:qn()}),e.loose=()=>e.clone({...e._zod.def,catchall:qn()}),e.strict=()=>e.clone({...e._zod.def,catchall:rT()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=i=>s2(e,i),e.safeExtend=i=>r2(e,i),e.merge=i=>o2(e,i),e.pick=i=>a2(e,i),e.omit=i=>i2(e,i),e.partial=(...i)=>l2(m0,e,i[0]),e.required=(...i)=>c2(h0,e,i[0])});function j(e,n){const i={type:"object",shape:e??{},...ye(n)};return new lT(i)}const d0=H("ZodUnion",(e,n)=>{t0.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>oz(e,i,r,l),e.options=n.options});function f0(e,n){return new d0({type:"union",options:e,...ye(n)})}const cT=H("ZodDiscriminatedUnion",(e,n)=>{d0.init(e,n),U_.init(e,n)});function p0(e,n,i){return new cT({type:"union",options:n,discriminator:e,...ye(i)})}const uT=H("ZodIntersection",(e,n)=>{$_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>lz(e,i,r,l)});function dT(e,n){return new uT({type:"intersection",left:e,right:n})}const fT=H("ZodRecord",(e,n)=>{I_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>cz(e,i,r,l),e.keyType=n.keyType,e.valueType=n.valueType});function lt(e,n,i){return new fT({type:"record",keyType:e,valueType:n,...ye(i)})}const Af=H("ZodEnum",(e,n)=>{V_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(r,l,c)=>tz(e,r,l),e.enum=n.entries,e.options=Object.values(n.entries);const i=new Set(Object.keys(n.entries));e.extract=(r,l)=>{const c={};for(const d of r)if(i.has(d))c[d]=n.entries[d];else throw new Error(`Key ${d} not found in enum`);return new Af({...n,checks:[],...ye(l),entries:c})},e.exclude=(r,l)=>{const c={...n.entries};for(const d of r)if(i.has(d))delete c[d];else throw new Error(`Key ${d} not found in enum`);return new Af({...n,checks:[],...ye(l),entries:c})}});function ie(e,n){const i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Af({type:"enum",entries:i,...ye(n)})}const pT=H("ZodLiteral",(e,n)=>{P_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>nz(e,i,r),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function qt(e,n){return new pT({type:"literal",values:Array.isArray(e)?e:[e],...ye(n)})}const mT=H("ZodTransform",(e,n)=>{G_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>iz(e,i),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new Bv(e.constructor.name);i.addIssue=c=>{if(typeof c=="string")i.issues.push(uo(c,i.value,n));else{const d=c;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=i.value),d.inst??(d.inst=e),i.issues.push(uo(d))}};const l=n.transform(i.value,i);return l instanceof Promise?l.then(c=>(i.value=c,i)):(i.value=l,i)}});function hT(e){return new mT({type:"transform",transform:e})}const m0=H("ZodOptional",(e,n)=>{n0.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>l0(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function gb(e){return new m0({type:"optional",innerType:e})}const gT=H("ZodExactOptional",(e,n)=>{H_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>l0(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function yT(e){return new gT({type:"optional",innerType:e})}const bT=H("ZodNullable",(e,n)=>{Q_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>uz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function yb(e){return new bT({type:"nullable",innerType:e})}const vT=H("ZodDefault",(e,n)=>{K_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>fz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ST(e,n){return new vT({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():$v(n)}})}const xT=H("ZodPrefault",(e,n)=>{Z_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>pz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function wT(e,n){return new xT({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():$v(n)}})}const h0=H("ZodNonOptional",(e,n)=>{Y_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>dz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function jT(e,n){return new h0({type:"nonoptional",innerType:e,...ye(n)})}const NT=H("ZodCatch",(e,n)=>{X_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>mz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function kT(e,n){return new NT({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const AT=H("ZodPipe",(e,n)=>{J_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>hz(e,i,r,l),e.in=n.in,e.out=n.out});function bb(e,n){return new AT({type:"pipe",in:e,out:n})}const _T=H("ZodReadonly",(e,n)=>{F_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>gz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function CT(e){return new _T({type:"readonly",innerType:e})}const zT=H("ZodCustom",(e,n)=>{W_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>az(e,i)});function TT(e,n={}){return HC(zT,e,n)}function ET(e){return QC(e)}const g0=j({id:p(),name:p(),keyPrefix:p(),scopes:A(p()),readOnly:oe(),createdAt:p(),lastUsedAt:p().nullable(),revokedAt:p().nullable()});j({keys:A(g0)});j({name:p().min(1).max(100),scopes:A(p()).min(1).optional()});g0.extend({key:p()});const OT=j({maxConcurrency:v().int().positive(),maxRequestsPerMinute:v().int().positive(),maxRequestsPerDay:v().int().positive()}),ya=p().min(1);p().min(1);const np=j({label:p().min(1),city:p().min(1),region:p().min(1),country:p().length(2),timezone:p().optional()}),ap=ie(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);j({id:p(),projectId:p(),channel:qt("webhook"),url:p().url(),urlDisplay:p(),urlHost:p(),events:A(ap),enabled:oe().default(!0),source:p().optional(),webhookSecret:p().optional(),createdAt:p(),updatedAt:p()});j({channel:qt("webhook"),url:p().url(),events:A(ap).min(1),source:p().optional()});const y0=ie(["cli","api","config-file"]);function DT(e){const n=new Set,i=new Set;for(const r of e){if(n.has(r.label)){i.add(r.label);continue}n.add(r.label)}return[...i]}function RT(e,n){return n?e.some(i=>i.label===n):!0}j({displayName:p().min(1),canonicalDomain:p().min(1),ownedDomains:A(p().min(1)).optional(),aliases:A(p()).optional(),country:p().length(2),language:p().min(2),tags:A(p()).optional(),labels:lt(p(),p()).optional(),providers:A(ya).optional(),locations:A(np).optional(),defaultLocation:p().nullable().optional(),autoExtractBacklinks:oe().optional(),configSource:y0.optional()});const MT=j({id:p(),name:p(),displayName:p().optional(),canonicalDomain:p(),ownedDomains:A(p()).default([]),aliases:A(p()).default([]),country:p().length(2),language:p().min(2),tags:A(p()).default([]),labels:lt(p(),p()).default({}),providers:A(p()).default([]),locations:A(np).default([]),defaultLocation:p().nullable().optional(),autoExtractBacklinks:oe().default(!1),configSource:y0.default("cli"),configRevision:v().int().positive().default(1),createdAt:p().optional(),updatedAt:p().optional()});j({id:p(),query:p(),createdAt:p()});j({id:p(),keyword:p(),createdAt:p()});j({queries:A(p().trim().min(1)).min(1)});j({keywords:A(p().trim().min(1)).min(1)});j({provider:ya,count:v().int().min(1).max(20).optional()});j({id:p(),domain:p(),createdAt:p()});j({competitors:A(p().trim().min(1)).min(1)});function oc(e){let n=e.trim().toLowerCase();try{n.includes("://")&&(n=new URL(n).hostname.toLowerCase())}catch{}return n.replace(/^www\./,"")}const BT=new Set(["ac.uk","co.id","co.il","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.au","com.br","com.cn","com.mx","com.ph","com.sg","com.tr","edu.au","edu.sg","gov.au","gov.uk","me.uk","ne.jp","net.au","net.br","net.cn","net.in","net.tr","or.jp","or.kr","org.au","org.br","org.in","org.nz","org.tr","org.uk","org.za"]);function LT(e){const n=oc(e);if(!n)return"";const i=n.split("/")[0]?.split(":")[0]??"";if(!i)return"";const r=i.split(".").filter(Boolean);if(r.length<2)return"";if(r.length===2)return r.join(".");const l=r.slice(-2).join(".");return BT.has(l)?r.length>=3?r.slice(-3).join("."):"":r.slice(-2).join(".")}function qT(e){const n=LT(e);return n?n.split(".")[0]??"":""}function UT(e){const n=[e.canonicalDomain,...e.ownedDomains??[]],i=new Set,r=[];for(const l of n){const c=l.trim();if(!c)continue;const d=oc(c);i.has(d)||(i.add(d),r.push(c))}return r}const $T=j({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:lt(p(),p()).optional().default({})}),IT=j({preset:p().optional(),cron:p().optional(),timezone:p().optional().default("UTC"),providers:A(ya).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),VT=j({channel:qt("webhook"),url:p().url(),events:A(ap).min(1)}),PT=j({gsc:j({propertyUrl:p()}).optional(),syncSchedule:j({preset:p().optional(),cron:p().optional()}).optional()}).optional(),vb=A(p().min(1)),GT=j({displayName:p().min(1),canonicalDomain:p().min(1),ownedDomains:A(p().min(1)).optional().default([]),aliases:A(p().min(1)).optional().default([]),country:p().length(2),language:p().min(2),queries:vb.optional(),keywords:vb.optional(),competitors:A(p().min(1)).optional().default([]),providers:A(ya).optional().default([]),locations:A(np).optional().default([]),defaultLocation:p().optional(),schedule:IT,notifications:A(VT).optional().default([]),google:PT,autoExtractBacklinks:oe().optional().default(!1)}).superRefine((e,n)=>{e.queries!==void 0&&e.keywords!==void 0&&n.addIssue({code:"custom",message:"Use spec.queries; spec.keywords is accepted only as a legacy alias when spec.queries is omitted",path:["keywords"]});const i=DT(e.locations);i.length>0&&n.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${i.join(", ")}`,path:["locations"]}),RT(e.locations,e.defaultLocation)||n.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});j({apiVersion:qt("canonry/v1"),kind:qt("Project"),metadata:$T,spec:GT});const HT=ie(["gsc","ga4","gbp"]);j({id:p(),domain:p(),connectionType:HT,propertyId:p().nullable().optional(),sitemapUrl:p().nullable().optional(),scopes:A(p()).default([]),createdAt:p(),updatedAt:p()});j({date:p(),query:p(),page:p(),country:p().nullable().optional(),device:p().nullable().optional(),clicks:v(),impressions:v(),ctr:v(),position:v()});const QT=j({date:p(),clicks:v(),impressions:v(),ctr:v()});j({totals:j({clicks:v(),impressions:v(),ctr:v(),days:v()}),daily:A(QT)});const _f=j({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:oe().nullable().optional(),richResults:A(p()).default([]),referringUrls:A(p()).default([]),inspectedAt:p()});ie(["stable","reindexed","deindexed","still-missing","new"]);const KT=j({url:p(),previousState:p().nullable(),currentState:p().nullable(),transitionDate:p()}),ZT=j({reason:p(),count:v(),urls:A(_f).default([])});j({summary:j({total:v(),indexed:v(),notIndexed:v(),deindexed:v(),percentage:v()}),lastInspectedAt:p().nullable(),lastSyncedAt:p().nullable(),indexed:A(_f).default([]),notIndexed:A(_f).default([]),deindexed:A(KT).default([]),reasonGroups:A(ZT).default([])});j({url:p(),type:ie(["URL_UPDATED","URL_DELETED"]),notifiedAt:p()});const YT=j({url:p(),type:ie(["URL_UPDATED","URL_DELETED"]),notifiedAt:p(),status:ie(["success","error"]),error:p().optional()});j({summary:j({total:v().int().nonnegative(),succeeded:v().int().nonnegative(),failed:v().int().nonnegative()}),results:A(YT).default([])});j({date:p(),indexed:v(),notIndexed:v(),reasonBreakdown:lt(p(),v()).default({})});const XT=j({siteUrl:p(),permissionLevel:p()});j({sites:A(XT).default([])});const JT=j({type:p(),submitted:p(),indexed:p()}),FT=j({path:p(),lastSubmitted:p().optional(),isPending:oe().optional(),isSitemapsIndex:oe().optional(),type:p().optional(),lastDownloaded:p().optional(),warnings:p().optional(),errors:p().optional(),contents:A(JT).optional()});j({sitemaps:A(FT).default([])});const WT=j({name:p(),accountName:p().nullable(),type:p().nullable(),role:p().nullable()});j({accounts:A(WT),total:v().int().nonnegative()});const eE=j({id:p(),projectId:p(),accountName:p(),locationName:p(),displayName:p(),primaryCategoryDisplayName:p().nullable(),storefrontAddress:p().nullable(),websiteUri:p().nullable(),placeId:p().nullable(),mapsUri:p().nullable(),additionalCategories:A(p()),description:p().nullable(),serviceArea:lt(p(),qn()).nullable(),regularHours:lt(p(),qn()).nullable(),primaryPhone:p().nullable(),openStatus:p().nullable(),openingDate:p().nullable(),selected:oe(),syncedAt:p().nullable(),createdAt:p(),updatedAt:p()});j({locations:A(eE),totalDiscovered:v().int().nonnegative(),totalSelected:v().int().nonnegative()});j({selectAllNew:oe().default(!0),accountName:p().optional(),switchAccount:oe().default(!1)});j({selected:oe()});j({locationNames:A(p()).optional(),daysOfMetrics:v().int().positive().max(540).optional(),monthsOfKeywords:v().int().positive().max(18).optional()});j({runId:p(),status:p()});const tE=j({locationName:p(),date:p(),metric:p(),value:v().int()});j({metrics:A(tE),total:v().int().nonnegative()});const nE=j({locationName:p(),periodStart:p(),periodEnd:p(),keyword:p(),valueCount:v().int().nullable(),valueThreshold:v().int().nullable()});j({keywords:A(nE),total:v().int().nonnegative(),thresholdedPct:v().int().min(0).max(100)});const aE=j({locationName:p(),placeActionLinkName:p(),placeActionType:p(),uri:p().nullable(),isPreferred:oe(),providerType:p().nullable()});j({placeActions:A(aE),total:v().int().nonnegative()});const iE=j({locationName:p(),populatedGroupCount:v().int().nonnegative(),syncedAt:p(),attributes:lt(p(),qn())});j({lodging:A(iE),total:v().int().nonnegative()});const sE=j({locationName:p(),placeId:p(),tier:p(),amenities:A(p()),syncedAt:p(),place:lt(p(),qn())});j({places:A(sE),total:v().int().nonnegative()});j({scope:j({locationName:p().nullable(),locationCount:v().int().nonnegative()}),performance:j({totals:lt(p(),v()),recent7d:lt(p(),v()),prior7d:lt(p(),v()),deltaPct:lt(p(),v().nullable())}),freshness:j({dataThroughDate:p().nullable(),latestStoredDate:p().nullable(),pendingDays:v().int().nonnegative()}),timeseries:A(j({date:p(),pending:oe(),metrics:lt(p(),v())})),keywords:j({total:v().int().nonnegative(),thresholdedCount:v().int().nonnegative(),thresholdedPct:v().int().min(0).max(100)}),placeActions:j({total:v().int().nonnegative(),hasReservationCta:oe(),hasBookingCta:oe(),hasDirectMerchantCta:oe()}),lodging:j({lodgingLocationCount:v().int().nonnegative(),populatedLodgingCount:v().int().nonnegative(),emptyLodgingCount:v().int().nonnegative()}),profileCompleteness:j({locationCount:v().int().nonnegative(),withSecondaryCategories:v().int().nonnegative(),secondaryCategoryTotal:v().int().nonnegative(),withDescription:v().int().nonnegative(),withServiceArea:v().int().nonnegative(),withHours:v().int().nonnegative(),withPrimaryPhone:v().int().nonnegative(),permanentlyClosed:v().int().nonnegative(),temporarilyClosed:v().int().nonnegative()})});const rE={BUSINESS_DIRECTION_REQUESTS:"Direction requests",WEBSITE_CLICKS:"Website clicks",CALL_CLICKS:"Call clicks",BUSINESS_BOOKINGS:"Bookings",BUSINESS_CONVERSATIONS:"Conversations",BUSINESS_FOOD_ORDERS:"Food orders",BUSINESS_FOOD_MENU_CLICKS:"Food menu clicks",BUSINESS_IMPRESSIONS_DESKTOP_SEARCH:"Search impressions (desktop)",BUSINESS_IMPRESSIONS_MOBILE_SEARCH:"Search impressions (mobile)",BUSINESS_IMPRESSIONS_DESKTOP_MAPS:"Maps impressions (desktop)",BUSINESS_IMPRESSIONS_MOBILE_MAPS:"Maps impressions (mobile)"};function oE(e){const n=e.replace(/^BUSINESS_/,"").split("_").filter(Boolean).map(r=>r.toLowerCase());if(n.length===0)return e;const i=n.join(" ");return i.charAt(0).toUpperCase()+i.slice(1)}function gL(e){return rE[e]??oE(e)}const lE=["BUSINESS_DIRECTION_REQUESTS","WEBSITE_CLICKS","CALL_CLICKS"],cE=["BUSINESS_IMPRESSIONS_DESKTOP_SEARCH","BUSINESS_IMPRESSIONS_MOBILE_SEARCH","BUSINESS_IMPRESSIONS_DESKTOP_MAPS","BUSINESS_IMPRESSIONS_MOBILE_MAPS"];function yL(e){return lE.includes(e)?"conversion":cE.includes(e)?"reach":"other"}j({id:p(),domain:p(),siteUrl:p().nullable().optional(),createdAt:p(),updatedAt:p()});const rf=j({id:p(),url:p(),httpCode:v().nullable().optional(),inIndex:oe().nullable().optional(),lastCrawledDate:p().nullable().optional(),inIndexDate:p().nullable().optional(),inspectedAt:p(),documentSize:v().nullable().optional(),anchorCount:v().nullable().optional(),discoveryDate:p().nullable().optional()});j({summary:j({total:v(),indexed:v(),notIndexed:v(),unknown:v().optional(),percentage:v()}),lastInspectedAt:p().nullable(),indexed:A(rf).default([]),notIndexed:A(rf).default([]),unknown:A(rf).default([]).optional()});j({query:p(),impressions:v(),clicks:v(),ctr:v(),averagePosition:v()});j({date:p(),indexed:v(),notIndexed:v(),unknown:v()});const uE=j({url:p(),status:ie(["success","error"]),submittedAt:p(),error:p().optional()});j({summary:j({total:v().int().nonnegative(),succeeded:v().int().nonnegative(),failed:v().int().nonnegative()}),results:A(uE).default([])});const b0=j({url:p(),verified:oe()});j({sites:A(b0).default([])});j({connected:oe(),domain:p(),siteUrl:p().nullable(),createdAt:p().nullable(),updatedAt:p().nullable()});j({connected:oe(),domain:p(),siteUrl:p().nullable(),availableSites:A(b0).default([])});j({siteUrl:p()});const dE=j({name:p(),alive:oe(),lastUsed:p().nullable()});j({connected:oe(),endpoint:p(),version:p().optional(),browserVersion:p().optional(),targets:A(dE).default([])});const Zs=ie(["live","staging"]);j({projectName:p(),url:p(),stagingUrl:p().optional(),username:p(),defaultEnv:Zs,createdAt:p(),updatedAt:p()});const Sb=j({url:p(),reachable:oe(),pageCount:v().nullable().optional(),version:p().nullable().optional(),error:p().nullable().optional(),plugins:A(p()).optional(),authenticatedUser:j({id:v(),slug:p()}).nullable().optional()});j({connected:oe(),projectName:p(),defaultEnv:Zs,live:Sb.nullable(),staging:Sb.nullable(),adminUrl:p().nullable().optional()});const fE=j({id:v(),slug:p(),title:p(),status:p(),modifiedAt:p().nullable().optional(),link:p().nullable().optional()}),v0=j({title:p().nullable(),description:p().nullable(),noindex:oe().nullable(),writable:oe().default(!1),writeTargets:A(p()).default([])}),pE=j({type:p(),json:lt(p(),qn())}),mE=fE.extend({env:Zs,content:p(),seo:v0,schemaBlocks:A(pE).default([])}),xb=mE.extend({contentHash:p(),contentSnippet:p()}),S0=j({manualRequired:qt(!0),targetUrl:p(),adminUrl:p().nullable().optional(),content:p(),nextSteps:A(p()).default([])}),hE=j({slug:p(),severity:ie(["high","medium","low"]),code:ie(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:p()});j({slug:p(),title:p(),status:p(),wordCount:v(),seo:v0,schemaPresent:oe(),issues:A(hE).default([])});const gE=j({slug:p(),status:ie(["applied","skipped","manual"]),error:p().optional(),manualAssist:S0.optional()});j({env:Zs,strategy:ie(["plugin","manual"]),results:A(gE)});const yE=j({slug:p(),status:ie(["deployed","stripped","skipped","failed"]),schemasInjected:A(p()).optional(),manualAssist:S0.optional(),error:p().optional()});j({env:Zs,results:A(yE)});const bE=j({slug:p(),title:p(),canonrySchemas:A(p()),thirdPartySchemas:A(p()),hasCanonrySchema:oe()});j({env:Zs,pages:A(bE)});const vE=j({name:p(),status:ie(["completed","skipped","failed"]),summary:p().optional(),error:p().optional()});j({projectName:p(),steps:A(vE)});j({slug:p(),live:xb,staging:xb,hasDifferences:oe(),differences:j({title:oe(),slug:oe(),content:oe(),seoTitle:oe(),seoDescription:oe(),noindex:oe(),schema:oe()})});const SE=j({name:p(),displayName:p().optional(),keyUrl:p().optional(),modelHint:p().optional(),model:p().optional(),defaultModel:p().optional(),configured:oe(),quota:OT.optional(),vertexConfigured:oe().optional()}),wb=j({configured:oe()});j({providers:A(SE).default([]),google:wb,bing:wb});const Ys=ie(["queued","running","completed","partial","failed","cancelled"]),Ht=Ys.enum,x0=ie(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","bing-inspect-sitemap","backlink-extract","traffic-sync","aeo-discover-seed","aeo-discover-probe","gbp-sync","ads-sync"]),Ne=x0.enum,w0=ie(["manual","scheduled","config-apply","backfill","probe"]),Bs=w0.enum,Ai=ie(["cited","not-cited"]),lc=Ai.enum,cc=ie(["visible","not-visible"]);cc.enum;const uc=ie(["mentioned","not-mentioned"]);uc.enum;const j0=ie(["new","cited","lost","emerging","not-cited"]);j0.enum;const xE=ie(["new","mentioned","lost","emerging","not-mentioned"]);xE.enum;const wE=ie([Bs.manual,Bs.probe]);j({kind:qt(Ne["answer-visibility"]).optional(),trigger:wE.optional(),providers:A(ya).optional(),queries:A(p().min(1)).min(1).optional(),location:p().min(1).optional(),allLocations:oe().optional(),noLocation:oe().optional()}).refine(e=>+!!e.location+ +!!e.allLocations+ +!!e.noLocation<=1,{message:'Only one of "location", "allLocations", or "noLocation" may be provided'});const jE=j({message:p(),raw:qn().optional()}),NE=j({message:p().optional(),providers:lt(p(),jE).optional()}),kE=j({id:p(),projectId:p(),kind:x0,status:Ys,trigger:w0.default("manual"),location:p().nullable().optional(),queries:A(p()).nullable().optional(),startedAt:p().nullable().optional(),finishedAt:p().nullable().optional(),error:NE.nullable().optional(),createdAt:p()});function ip(e){if(e.providers){const n=Object.entries(e.providers);if(n.length===1){const[i,r]=n[0];return`${i}: ${r.message}`}if(n.length>1)return n.map(([i,r])=>`${i}: ${r.message}`).join(" • ")}return e.message??"Run failed."}const N0=j({uri:p(),title:p()}),k0=j({id:p(),runId:p(),queryId:p(),query:p().optional(),provider:ya,citationState:Ai,answerMentioned:oe().optional(),visibilityState:cc.optional(),mentionState:uc.optional(),transition:j0.optional(),answerText:p().nullable().optional(),citedDomains:A(p()).default([]),competitorOverlap:A(p()).default([]),recommendedCompetitors:A(p()).default([]),matchedTerms:A(p()).default([]),groundingSources:A(N0).default([]),searchQueries:A(p()).default([]),model:p().nullable().optional(),location:p().nullable().optional(),createdAt:p()});j({snapshots:A(k0),total:v().int().nonnegative()});const AE=j({queryId:p().nullable(),query:p().nullable(),run1State:Ai.nullable(),run2State:Ai.nullable(),run1AnswerMentioned:oe().nullable(),run2AnswerMentioned:oe().nullable(),run1VisibilityState:cc.nullable(),run2VisibilityState:cc.nullable(),run1MentionState:uc.nullable().optional(),run2MentionState:uc.nullable().optional(),changed:oe(),visibilityChanged:oe()});j({run1:p(),run2:p(),diff:A(AE)});const _E=kE.extend({snapshots:A(k0).optional()}),CE=j({totalRuns:v().int().nonnegative(),run:_E.nullable()});j({id:p(),projectId:p().nullable().optional(),actor:p(),action:p(),entityType:p(),entityId:p().nullable().optional(),diff:qn().optional(),createdAt:p()});const zE=ie(["yes","no","unknown","not-mentioned"]),jb=A(p().min(1));j({companyName:p().min(1),domain:p().min(1),queries:jb.optional(),phrases:jb.optional(),competitors:A(p().min(1)).optional().default([])}).superRefine((e,n)=>{e.queries!==void 0&&e.phrases!==void 0&&n.addIssue({code:"custom",message:"Use queries; phrases is accepted only as a legacy alias when queries is omitted",path:["phrases"]})});const TE=j({name:p(),count:v().int().nonnegative()}),EE=j({id:p(),name:p(),weight:v(),score:v(),findings:A(j({type:p(),message:p()})).default([]),recommendations:A(p()).default([])}),OE=j({url:p(),finalUrl:p(),auditedAt:p(),overallScore:v(),summary:p(),factors:A(EE).default([])}),DE=j({industry:p(),summary:p(),services:A(p()).default([]),categoryTerms:A(p()).default([])}),RE=j({provider:p(),displayName:p(),model:p().nullable().optional(),mentioned:oe(),cited:oe(),describedAccurately:zE,accuracyNotes:p().nullable().optional(),incorrectClaims:A(p()).default([]),recommendedCompetitors:A(p()).default([]),citedDomains:A(p()).default([]),groundingSources:A(N0).default([]),searchQueries:A(p()).default([]),answerText:p(),error:p().nullable().optional()}),ME=j({query:p(),providerResults:A(RE).default([])}),BE=j({totalQueries:v().int().nonnegative(),totalProviders:v().int().nonnegative(),totalComparisons:v().int().nonnegative(),mentionCount:v().int().nonnegative(),citationCount:v().int().nonnegative(),topCompetitors:A(TE).default([]),visibilityGap:p(),whatThisMeans:A(p()).default([]),recommendedActions:A(p()).default([])});j({companyName:p(),domain:p(),homepageUrl:p(),generatedAt:p(),queries:A(p()).default([]),competitors:A(p()).default([]),profile:DE,audit:OE,queryResults:A(ME).default([]),summary:BE});const A0=ie(["pass","partial","fail"]);A0.enum;const _0=ie(["up","down","flat"]);_0.enum;const LE=j({id:p(),name:p(),weight:v(),avgScore:v(),status:A0,pagesPassing:v().int().nonnegative(),pagesPartial:v().int().nonnegative(),pagesFailing:v().int().nonnegative()}),qE=j({factorId:p(),factorName:p(),avgScore:v(),affectedPages:v().int().nonnegative(),totalPages:v().int().nonnegative(),affectedPct:v().int().nonnegative(),topRecommendations:A(p()).default([])});j({project:p(),hasData:oe(),runId:p().nullable(),runStatus:Ys.nullable(),sitemapUrl:p().nullable(),auditedAt:p().nullable(),aggregateScore:v(),pagesDiscovered:v().int().nonnegative(),pagesAudited:v().int().nonnegative(),pagesSkipped:v().int().nonnegative(),pagesErrored:v().int().nonnegative(),deltaScore:v().nullable(),trend:_0.nullable(),previousScore:v().nullable(),previousAuditedAt:p().nullable(),factors:A(LE).default([]),crossCuttingIssues:A(qE).default([]),prioritizedFixes:A(p()).default([])});const UE=j({id:p(),name:p(),weight:v(),score:v()}),$E=j({url:p(),overallScore:v(),status:ie(["success","error"]),error:p().nullable().optional(),factors:A(UE).default([])});j({project:p(),runId:p().nullable(),auditedAt:p().nullable(),total:v().int().nonnegative(),pages:A($E).default([])});const IE=j({runId:p(),auditedAt:p(),aggregateScore:v(),pagesAudited:v().int().nonnegative()});j({project:p(),points:A(IE).default([])});j({sitemapUrl:p().url().optional(),limit:v().int().positive().max(2e3).optional()});j({runId:p(),status:Ys});const sp=ie(["answer-visibility","traffic-sync","gbp-sync","data-refresh","backlinks-sync","site-audit","ads-sync"]);sp.enum;j({id:p(),projectId:p(),kind:sp,cronExpr:p(),preset:p().nullable().optional(),timezone:p().default("UTC"),enabled:oe().default(!0),providers:A(ya).default([]),sourceId:p().nullable().optional(),lastRunAt:p().nullable().optional(),nextRunAt:p().nullable().optional(),createdAt:p(),updatedAt:p()});j({kind:sp.optional(),preset:p().optional(),cron:p().optional(),timezone:p().optional().default("UTC"),enabled:oe().optional().default(!0),providers:A(ya).optional().default([]),sourceId:p().optional()}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const rp=ie(["competitor","directory","social","forum","news","reference","blog","ecommerce","video","academic","other"]);rp.enum;const op=ie(["cited","aspirational","wasted-surface"]),Nb=op.enum;Nb.cited,Nb.aspirational;const xc=ie(["direct-competitor","ota-aggregator","editorial-media","other","unknown"]),VE=xc.enum;VE["direct-competitor"];const wc=ie(["queued","seeding","probing","completed","failed"]);wc.enum;const C0=j({domain:p().min(1),hits:v().int().positive(),competitorType:xc.default("unknown")}),PE=j({id:p(),sessionId:p(),projectId:p(),query:p(),bucket:op.nullable().default(null),citationState:Ai,citedDomains:A(p()).default([]),answerMentioned:oe().nullable().default(null),createdAt:p()}),GE=j({id:p(),projectId:p(),status:wc,icpDescription:p().nullable().optional(),seedProvider:p().nullable().optional(),seedCountRaw:v().int().nullable().optional(),seedCount:v().int().nullable().optional(),dedupThreshold:v().nullable().optional(),probeCount:v().int().nullable().optional(),citedCount:v().int().nullable().default(null),aspirationalCount:v().int().nullable().default(null),wastedCount:v().int().nullable().default(null),competitorMap:A(C0).default([]),warning:p().nullable().optional(),error:p().nullable().optional(),startedAt:p().nullable().optional(),finishedAt:p().nullable().optional(),createdAt:p()});GE.extend({probes:A(PE).default([])});const HE=500;j({icpDescription:p().min(1).optional(),dedupThreshold:v().min(0).max(1).optional(),maxProbes:v().int().positive().max(HE).optional(),locations:A(p().min(1)).optional()});j({buckets:A(op).min(1).optional(),includeCompetitors:oe().optional(),competitorTypes:A(xc).min(1).optional()});j({sessionId:p(),projectId:p(),status:wc,queriesByBucket:j({cited:A(p()),aspirational:A(p()),"wasted-surface":A(p())}),suggestedCompetitors:A(C0)});j({sessionId:p(),projectId:p(),promoted:j({queries:A(p()),competitors:A(p())}),skipped:j({queries:A(p()),competitors:A(p())})});f0([qt("cli"),p().regex(/^discovery:.+$/)]);const QE=j({query:p().min(1),probeHits:v().int().positive()}),KE=j({rawCandidates:v().int().nonnegative(),admitted:v().int().nonnegative(),rejected:j({belowFloor:v().int().nonnegative(),length:v().int().nonnegative(),navigational:v().int().nonnegative(),duplicate:v().int().nonnegative(),offAnchor:v().int().nonnegative(),semanticDuplicate:v().int().nonnegative()})});j({sessionId:p(),projectId:p(),provider:p(),status:wc,minProbeHits:v().int().positive(),anchorApplied:oe(),semanticNoveltyApplied:oe(),candidates:A(QE),stats:KE});const lp=ie(["own","direct-competitor","ota-aggregator","editorial-media","other"]);lp.enum;const z0=ie(["7d","30d","90d","all"]),kb=ie(["improving","declining","stable"]),ZE=ie(["mentioned","cited"]);ZE.enum;const Cf=j({citationRate:v(),cited:v().int(),total:v().int(),mentionRate:v(),mentionedCount:v().int()}),YE=j({startDate:p(),endDate:p(),citationRate:v(),cited:v().int(),total:v().int(),queryCount:v().int(),mentionRate:v(),mentionedCount:v().int(),byProvider:lt(p(),Cf)}),XE=j({date:p(),delta:v().int(),label:p()});j({window:z0,buckets:A(YE),overall:Cf,byProvider:lt(p(),Cf),trend:kb,mentionTrend:kb,queryChanges:A(XE)});const Ab=j({category:rp,label:p(),count:v().int(),percentage:v(),topDomains:A(j({domain:p(),count:v().int()}))}),JE=j({domain:p(),count:v().int(),percentage:v(),category:rp,label:p(),surfaceClass:lp}),FE=j({surfaceClass:lp,label:p(),count:v().int(),percentage:v(),domainCount:v().int()}),_b=j({totalCitedSlots:v().int(),domainTotal:v().int(),entries:A(JE),truncatedDomainCount:v().int(),truncatedCitedSlots:v().int(),bySurfaceClass:A(FE)});j({overall:A(Ab),byQuery:lt(p(),A(Ab)),ranked:_b,byProvider:lt(p(),_b),runId:p(),window:z0,limit:v().int().nullable()});const cp=j({total:v().int(),checked:v().int(),mentioned:v().int(),cited:v().int(),mentionRate:v().nullable(),citedRate:v().nullable()}),T0=cp.extend({provider:p(),firstObserved:p(),lastObserved:p()}),WE=cp.extend({queryId:p().nullable(),query:p(),firstObserved:p(),lastObserved:p(),providers:A(T0).optional()}),eO=j({since:p().nullable(),until:p().nullable(),lastRuns:v().int().nullable(),runCount:v().int()}),tO=ie(["provider"]);j({project:p(),groupBy:tO.optional(),window:eO,totals:cp,byProvider:A(T0).optional(),queries:A(WE)});j({id:p(),projectId:p(),propertyId:p(),clientEmail:p(),connected:oe(),createdAt:p(),updatedAt:p()});j({date:p(),landingPage:p(),sessions:v(),organicSessions:v(),users:v()});const up=ie(["session","first_user","manual_utm"]),nO=j({source:p(),medium:p(),sessions:v(),users:v(),sourceDimension:up}),aO=j({source:p(),medium:p(),sourceDimension:up,landingPage:p(),sessions:v(),users:v()}),iO=j({source:p(),medium:p(),sessions:v(),users:v(),channelGroup:p()}),Fr=j({sessions:v(),sharePct:v(),sharePctDisplay:p()}),sO=j({organic:Fr,social:Fr,direct:Fr,ai:Fr,other:Fr});j({totalSessions:v(),totalOrganicSessions:v(),totalDirectSessions:v(),totalUsers:v(),topPages:A(j({landingPage:p(),sessions:v(),organicSessions:v(),directSessions:v(),users:v()})),aiReferrals:A(nO),aiReferralLandingPages:A(aO),aiSessionsDeduped:v(),aiUsersDeduped:v(),aiSessionsBySession:v(),aiUsersBySession:v(),socialReferrals:A(iO),socialSessions:v(),socialUsers:v(),channelBreakdown:sO,organicSharePct:v(),aiSharePct:v(),aiSharePctBySession:v(),directSharePct:v(),socialSharePct:v(),organicSharePctDisplay:p(),aiSharePctDisplay:p(),aiSharePctBySessionDisplay:p(),directSharePctDisplay:p(),socialSharePctDisplay:p(),otherSessions:v(),otherSharePct:v(),otherSharePctDisplay:p(),lastSyncedAt:p().nullable()});j({connected:oe(),propertyId:p().nullable(),clientEmail:p().nullable(),authMethod:ie(["service-account","oauth"]).nullable(),lastSyncedAt:p().nullable(),createdAt:p().nullable().optional(),updatedAt:p().nullable().optional()});j({synced:oe(),rowCount:v().int().nonnegative(),aiReferralCount:v().int().nonnegative(),socialReferralCount:v().int().nonnegative(),days:v().int().nonnegative(),syncedAt:p(),syncedComponents:A(p()).optional()});j({date:p(),source:p(),medium:p(),landingPage:p(),sessions:v(),users:v(),sourceDimension:up});j({date:p(),source:p(),medium:p(),sessions:v(),users:v(),channelGroup:p()});j({date:p(),sessions:v(),organicSessions:v(),users:v()});function dc(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const E0=ie(["claude","openai","gemini","zai"]),rO=j({id:E0,label:p(),defaultModel:p(),configured:oe(),keySource:ie(["config","env"]).nullable()});j({providers:A(rO).default([]),defaultProvider:E0.nullable()});const oO=ie(["aero","user","compaction"]);oO.enum;const O0=128;j({key:p().min(1).max(O0),value:p().min(1)});j({key:p().min(1).max(O0)});const Xs=ie(["commoncrawl","bing-webmaster"]);Xs.enum;const dp=ie(["queued","downloading","querying","ready","failed"]);dp.enum;j({id:p(),release:p(),status:dp,phaseDetail:p().nullable().optional(),vertexPath:p().nullable().optional(),edgesPath:p().nullable().optional(),vertexSha256:p().nullable().optional(),edgesSha256:p().nullable().optional(),vertexBytes:v().int().nullable().optional(),edgesBytes:v().int().nullable().optional(),projectsProcessed:v().int().nullable().optional(),domainsDiscovered:v().int().nullable().optional(),downloadStartedAt:p().nullable().optional(),downloadFinishedAt:p().nullable().optional(),queryStartedAt:p().nullable().optional(),queryFinishedAt:p().nullable().optional(),error:p().nullable().optional(),createdAt:p(),updatedAt:p()});const lO=j({linkingDomain:p(),numHosts:v().int(),source:Xs}),cO=j({projectId:p(),release:p(),targetDomain:p(),totalLinkingDomains:v().int(),totalHosts:v().int(),top10HostsShare:p(),queriedAt:p(),source:Xs,excludedLinkingDomains:v().int().optional(),excludedHosts:v().int().optional()});j({source:Xs,summary:cO.nullable(),total:v().int(),rows:A(lO)});j({release:p(),totalLinkingDomains:v().int(),totalHosts:v().int(),top10HostsShare:p(),queriedAt:p(),source:Xs});const uO=j({source:Xs,connected:oe(),hasData:oe(),latestRelease:p().nullable(),totalLinkingDomains:v().int(),lastSyncedAt:p().nullable()});j({projectId:p(),targetDomain:p(),sources:A(uO),anyConnected:oe(),anyData:oe()});j({duckdbInstalled:oe(),duckdbVersion:p().nullable().optional(),duckdbSpec:p(),pluginDir:p()});j({installed:oe(),version:p(),path:p(),alreadyPresent:oe()});j({release:p(),vertexUrl:p(),edgesUrl:p(),vertexBytes:v().int().nullable(),edgesBytes:v().int().nullable(),lastModified:p().nullable()});j({release:p(),syncStatus:dp.nullable(),bytes:v().int(),lastUsedAt:p().nullable()});const fp=ie(["positive","caution","negative","neutral"]),Qa=j({label:p(),value:p(),delta:p(),tone:fp,description:p(),tooltip:p().optional(),trend:A(v()),progress:v().optional(),providerCoverage:p().optional()}),dO=Qa.extend({breakdown:j({projectMentionSnapshots:v().int().nonnegative(),competitorMentionSnapshots:v().int().nonnegative(),perCompetitor:A(j({domain:p(),mentionSnapshots:v().int().nonnegative(),shareOfCompetitiveTotal:v()})),snapshotsWithAnswerText:v().int().nonnegative(),snapshotsTotal:v().int().nonnegative()})}),of=j({gained:v().int().nonnegative(),lost:v().int().nonnegative(),tone:fp,hasPreviousRun:oe(),gainedQueries:A(p()).optional(),lostQueries:A(p()).optional()}),fO=j({hasPreviousRun:oe(),comparable:oe(),querySetChanged:oe(),previousRunAt:p().nullable(),currentQueryCount:v().int().nonnegative(),previousQueryCount:v().int().nonnegative(),comparableQueryCount:v().int().nonnegative(),addedQueryCount:v().int().nonnegative(),removedQueryCount:v().int().nonnegative(),addedQueries:A(p()),removedQueries:A(p())}),pO=j({id:p(),projectId:p(),runId:p().nullable(),type:ie(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost","gbp-lodging-gap","gbp-listing-discrepancy","gbp-cta-gap","gbp-description-missing","gbp-metric-drop","gbp-keyword-drop"]),severity:ie(["critical","high","medium","low"]),title:p(),query:p(),provider:p(),recommendation:j({action:p(),target:p().optional(),reason:p()}).optional(),cause:j({cause:p(),competitorDomain:p().optional(),details:p().optional()}).optional(),dismissed:oe(),createdAt:p()}),mO=j({id:p(),projectId:p(),runId:p().nullable(),overallCitedRate:v(),overallMentionRate:v(),totalPairs:v().int().nonnegative(),citedPairs:v().int().nonnegative(),mentionedPairs:v().int().nonnegative(),providerBreakdown:lt(p(),j({citedRate:v(),mentionRate:v(),cited:v().int().nonnegative(),mentioned:v().int().nonnegative(),total:v().int().nonnegative()})),createdAt:p(),status:ie(["ready","no-data"]),reason:qt("no-runs-yet").optional()});j({project:MT,latestRun:CE,health:mO.nullable(),topInsights:A(pO),queryCounts:j({totalQueries:v().int().nonnegative(),citedQueries:v().int().nonnegative(),notCitedQueries:v().int().nonnegative(),citedRate:v(),mentionedQueries:v().int().nonnegative(),notMentionedQueries:v().int().nonnegative(),mentionRate:v()}),providers:A(j({provider:p(),citedRate:v(),cited:v().int().nonnegative(),total:v().int().nonnegative()})),transitions:j({since:p().nullable(),gained:v().int().nonnegative(),lost:v().int().nonnegative(),emerging:v().int().nonnegative()}),scores:j({mention:Qa,visibility:Qa,mentionShare:dO,gapQueries:Qa,mentionGaps:Qa,indexCoverage:Qa,competitorPressure:Qa,runStatus:Qa}),movementSummary:of,citationMovement:of,mentionMovement:of,movementComparison:fO,competitors:A(j({id:p(),domain:p(),citationCount:v().int().nonnegative(),totalQueries:v().int().nonnegative(),pressureLabel:ie(["None","Low","Moderate","High"]),citedQueries:A(p())})),providerScores:A(j({provider:p(),model:p().nullable(),score:v(),cited:v().int().nonnegative(),total:v().int().nonnegative(),trend:A(v()).optional()})),attentionItems:A(j({id:p(),tone:fp,title:p(),detail:p(),actionLabel:p(),href:p()})),runHistory:A(j({runId:p(),createdAt:p(),citedCount:v().int().nonnegative(),totalCount:v().int().nonnegative(),citationRate:v(),mentionedCount:v().int().nonnegative(),mentionRate:v(),status:p()})),suggestedQueries:j({rows:A(j({query:p(),impressions:v(),clicks:v(),avgPosition:v(),reason:p()})),totalCandidates:v().int().nonnegative(),skippedAlreadyTracked:v().int().nonnegative()}),dateRangeLabel:p(),contextLabel:p()});ie(["snapshot","insight"]);const hO=j({kind:qt("snapshot"),id:p(),runId:p(),query:p(),provider:p(),model:p().nullable(),citationState:Ai,matchedField:ie(["answerText","citedDomains","searchQueries","query"]),snippet:p(),createdAt:p()}),gO=j({kind:qt("insight"),id:p(),runId:p().nullable(),type:ie(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost","gbp-lodging-gap","gbp-listing-discrepancy","gbp-cta-gap","gbp-description-missing","gbp-metric-drop","gbp-keyword-drop"]),severity:ie(["critical","high","medium","low"]),title:p(),query:p(),provider:p(),matchedField:ie(["title","query","recommendation","cause"]),snippet:p(),dismissed:oe(),createdAt:p()}),yO=p0("kind",[hO,gO]);j({query:p(),totalHits:v().int().nonnegative(),truncated:oe(),hits:A(yO)});const D0=ie(["create","expand","refresh","add-schema"]);D0.enum;function bL(e){switch(e){case"create":return"Create";case"expand":return"Expand";case"refresh":return"Refresh";case"add-schema":return"Add schema"}}const R0=ie(["gsc","competitor-evidence","both"]);R0.enum;const M0=ie(["high","medium","low"]);M0.enum;const bO=ie(["blog-post","comparison","listicle","how-to","guide","glossary"]);bO.enum;const B0=ie(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);B0.enum;const pp=ie(["ownable","ceded"]);pp.enum;const vO=j({url:p(),gscImpressions:v().nonnegative(),gscClicks:v().nonnegative(),gscAvgPosition:v().nonnegative().nullable(),organicSessions:v().nonnegative()}),SO=j({domain:p(),url:p(),title:p(),citationCount:v().int().nonnegative()}),xO=j({demand:v(),competitor:v(),absence:v(),gapSeverity:v()}),wO=j({actionId:p(),state:B0,lastUpdated:p()}),L0=j({targetRef:p(),query:p(),action:D0,ourBestPage:vO.nullable(),winningCompetitor:SO.nullable(),score:v(),scoreBreakdown:xO,drivers:A(p()),demandSource:R0,actionConfidence:M0,existingAction:wO.nullable(),winnabilityClass:pp,winnability:v().min(0).max(1).nullable()});j({targets:A(L0),contextMetrics:j({totalAiReferralSessions:v().int().nonnegative(),latestRunId:p(),runTimestamp:p()})});const jO=j({targetRef:p(),addressedUrl:p().nullable(),note:p().nullable(),dismissedAt:p()});j({dismissals:A(jO)});j({targetRef:p().min(1),addressedUrl:p().url().optional(),note:p().max(500).optional()});j({targetRef:p(),promptVersion:p(),provider:p(),model:p(),responseText:p(),costMillicents:v().int().nonnegative(),generatedAt:p()});j({provider:p().optional(),model:p().optional(),forceRefresh:oe().optional()});const NO=j({targetQuery:p().trim().min(1),winnabilityClass:pp,angle:p().trim().min(1),whyWinnable:p().trim().min(1),schemaHookup:p().trim().min(1),controllableSurfaceRationale:p().trim().min(1)});j({targetRef:p(),promptVersion:p(),provider:p(),model:p(),brief:NO,costMillicents:v().int().nonnegative(),generatedAt:p()});const kO=j({domain:p(),competitorType:xc,hits:v().int().nonnegative(),updatedAt:p()});j({classifications:A(kO)});const AO=j({uri:p(),title:p(),domain:p(),isOurDomain:oe(),isCompetitor:oe(),citationCount:v().int().nonnegative(),providers:A(ya)}),q0=j({query:p(),groundingSources:A(AO)});j({sources:A(q0),latestRunId:p()});const U0=j({query:p(),competitorDomains:A(p()),competitorCount:v().int().nonnegative(),missRate:v().min(0).max(1),lastSeenInRunId:p()});j({gaps:A(U0),latestRunId:p()});const $0=ie(["ok","warn","fail","skipped"]);$0.enum;const mp=ie(["global","project"]);mp.enum;const I0=ie(["auth","config","providers","integrations","database","schedules","agent"]);I0.enum;const _O=j({id:p(),category:I0,scope:mp,title:p(),status:$0,code:p().describe('Stable machine-readable code (e.g. "google.token.refresh-failed"). Use this for filtering and remediation logic.'),summary:p(),remediation:p().nullable().optional().describe('Operator-facing next step. Null when status is "ok" or no specific remediation applies.'),details:lt(p(),qn()).optional().describe("Structured context — principal email, redirect URI, missing scopes, etc. Stable per check id."),durationMs:v().int().nonnegative().describe("How long the check took to execute.")});j({scope:mp,project:p().nullable().describe('Project name when scope is "project", null otherwise.'),generatedAt:p().describe("ISO-8601 timestamp when this doctor run started."),durationMs:v().int().nonnegative(),summary:j({total:v().int().nonnegative(),ok:v().int().nonnegative(),warn:v().int().nonnegative(),fail:v().int().nonnegative(),skipped:v().int().nonnegative()}),checks:A(_O)});const CO=j({provider:p(),citationState:Ai,cited:oe(),mentioned:oe(),runId:p(),runCreatedAt:p()}),zO=j({queryId:p(),query:p(),providers:A(CO),citedCount:v().int().nonnegative(),mentionedCount:v().int().nonnegative(),totalProviders:v().int().nonnegative()}),TO=j({queryId:p(),query:p(),provider:p(),citingCompetitors:A(p()),runId:p(),runCreatedAt:p()}),EO=j({providersConfigured:v().int().nonnegative(),providersCiting:v().int().nonnegative(),providersMentioning:v().int().nonnegative(),totalQueries:v().int().nonnegative(),queriesCitedAndMentioned:v().int().nonnegative(),queriesCitedOnly:v().int().nonnegative(),queriesMentionedOnly:v().int().nonnegative(),queriesInvisible:v().int().nonnegative(),latestRunId:p().nullable(),latestRunAt:p().nullable()});j({summary:EO,byQuery:A(zO),competitorGaps:A(TO),status:ie(["ready","no-data"]),reason:ie(["no-runs-yet","no-queries"]).optional()});const OO=ie(["prompt","request-param","browser-geo","ignored"]),DO=j({label:p(),city:p(),region:p(),country:p(),otherConfiguredLabels:A(p())}),RO=j({provider:p(),treatment:OO,description:p()}),MO=j({generatedAt:p(),project:j({id:p(),name:p(),displayName:p(),canonicalDomain:p(),country:p(),language:p()}),location:DO.nullable(),providerLocationHandling:A(RO),periodStart:p().nullable(),periodEnd:p().nullable()}),BO=j({citationRate:v(),citedQueryCount:v(),totalQueryCount:v(),mentionRate:v(),mentionedQueryCount:v(),trend:ie(["up","down","flat","unknown"]),queryCount:v(),competitorCount:v(),providerCount:v(),gsc:j({clicks:v(),impressions:v(),ctr:v(),avgPosition:v(),periodStart:p(),periodEnd:p()}).nullable(),ga:j({sessions:v(),users:v(),periodStart:p(),periodEnd:p()}).nullable(),findings:A(j({title:p(),detail:p(),tone:ie(["positive","caution","negative","neutral"])}))}),LO=j({citationState:ie(["cited","not-cited","pending"]),answerMentioned:oe().nullable(),model:p().nullable()}),qO=j({queries:A(p()),providers:A(p()),matrix:A(A(LO.nullable())),providerRates:A(j({provider:p(),citedCount:v(),totalCount:v(),citationRate:v()}))}),UO=j({domain:p(),citationCount:v(),totalCount:v(),pressureLabel:ie(["High","Moderate","Low","None"]),citedQueries:A(p()),sharePct:v(),theirCitedPages:A(j({url:p(),citedFor:A(p())}))}),$O=j({projectCitationCount:v(),competitors:A(UO)}),IO=j({domain:p(),mentionCount:v(),totalCount:v(),pressureLabel:ie(["High","Moderate","Low","None"]),mentionedQueries:A(p()),sharePct:v()}),VO=j({projectMentionCount:v(),totalAnswerSnapshots:v(),competitors:A(IO)}),PO=j({category:p(),label:p(),count:v(),sharePct:v()}),GO=j({categories:A(PO),topDomains:A(j({domain:p(),count:v(),isCompetitor:oe()}))}),HO=j({query:p(),clicks:v(),impressions:v(),ctr:v(),avgPosition:v(),category:ie(["brand","lead-gen","industry","other"])}),QO=j({periodStart:p(),periodEnd:p(),totalClicks:v(),totalImpressions:v(),ctr:v(),avgPosition:v(),topQueries:A(HO),categoryBreakdown:A(j({category:ie(["brand","lead-gen","industry","other"]),clicks:v(),impressions:v(),sharePct:v()})),trend:A(j({date:p(),clicks:v(),impressions:v()})),trackedButNoGsc:A(p()),gscButNotTracked:A(p())}),KO=j({totalSessions:v(),totalUsers:v(),totalOrganicSessions:v(),periodStart:p(),periodEnd:p(),topLandingPages:A(j({page:p(),sessions:v(),users:v(),organicSessions:v()})),channelBreakdown:A(j({channel:p(),sessions:v(),sharePct:v()}))}),ZO=j({totalSessions:v(),organicSessions:v(),paidSessions:v(),channels:A(j({channelGroup:p(),sessions:v(),sharePct:v()})),topCampaigns:A(j({source:p(),medium:p(),sessions:v()}))}),YO=j({totalSessions:v(),totalUsers:v(),bySource:A(j({source:p(),sessions:v(),users:v(),sharePct:v()})),trend:A(j({date:p(),sessions:v()})),topLandingPages:A(j({page:p(),sessions:v(),users:v()}))}),XO=j({windowStart:p(),windowEnd:p(),hasData:oe(),verifiedCrawlerHits:j({current:v(),prior:v(),deltaPct:v().nullable()}),unverifiedCrawlerHits:j({current:v(),prior:v(),deltaPct:v().nullable()}),aiUserFetchHits:j({current:v(),prior:v(),deltaPct:v().nullable()}),referralArrivals:j({current:v(),prior:v(),deltaPct:v().nullable()}),byOperator:A(j({operator:p(),verifiedHits:v(),unverifiedHits:v(),userFetchHits:v(),referralArrivals:v(),deltaPct:v().nullable()})),topCrawledPaths:A(j({path:p(),verifiedHits:v(),distinctOperators:v()})),referralProducts:A(j({product:p(),arrivals:v(),distinctLandingPaths:v()})),dailyTrend:A(j({date:p(),verifiedCrawlerHits:v(),userFetchHits:v(),referralArrivals:v()})),topReferralLandingPaths:A(j({path:p(),arrivals:v(),distinctProducts:v()}))}),JO=j({provider:ie(["google","bing"]).nullable(),total:v(),indexed:v(),notIndexed:v(),deindexed:v(),unknown:v(),indexedPct:v()}),FO=j({runId:p(),date:p(),citationRate:v(),citedQueryCount:v(),totalQueryCount:v(),mentionRate:v(),mentionedQueryCount:v(),providerRates:A(j({provider:p(),citationRate:v()}))}),zf=j({id:p(),type:ie(["regression","gain","opportunity"]),severity:ie(["critical","high","medium","low"]),title:p(),query:p(),provider:p(),recommendation:p().nullable(),createdAt:p(),instanceCount:v()}),WO=j({horizon:ie(["immediate","short-term","medium-term"]),title:p(),rationale:p()}),Wr=j({current:v(),prior:v(),deltaAbs:v(),direction:ie(["up","down","flat"]),window:v().optional()}),e4=j({provider:p(),current:v(),prior:v(),deltaAbs:v(),direction:ie(["up","down","flat"])}),t4=j({enoughHistory:oe(),headline:p(),citationRate:Wr.nullable(),mentionRate:Wr.nullable(),citedQueryCount:Wr.nullable(),gscClicksDelta:Wr.nullable(),aiReferralsDelta:Wr.nullable(),providerMovements:A(e4),wins:A(zf),regressions:A(zf)});ie(["agency","client"]);const n4=ie(["agency","client","both"]),a4=ie(["immediate","short-term","medium-term"]),i4=ie(["high","medium","low"]);ie(["positive","caution","negative","neutral"]);const s4=ie(["content","competitors","provider","search-demand","indexing","location","monitoring"]),hp=j({audience:n4,priority:v(),horizon:a4,category:s4,title:p(),action:p(),why:A(p()),evidence:A(p()),successMetric:p(),confidence:i4,targetRef:p().optional()}),r4=j({headline:p(),overview:p(),actionItems:A(hp),confidenceNotes:A(p())}),o4=j({title:p(),detail:p(),severity:ie(["positive","caution","negative","neutral"]),evidence:A(p())}),l4=j({priorities:A(hp),diagnostics:A(o4)});function vL(e){return e.horizon==="immediate"?"negative":e.confidence==="high"?"caution":e.confidence==="low"?"neutral":"caution"}function SL(e){switch(e){case"critical":return"Critical";case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}function xL(e){switch(e){case"immediate":return"Immediate";case"short-term":return"Short term";case"medium-term":return"Medium term"}}function wL(e){switch(e){case"content":return"Content";case"competitors":return"Competitors";case"provider":return"Provider";case"search-demand":return"Search demand";case"indexing":return"Indexing";case"location":return"Location";case"monitoring":return"Monitoring"}}function jL(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}j({meta:MO,executiveSummary:BO,citationScorecard:qO,competitorLandscape:$O,mentionLandscape:VO,aiSourceOrigin:GO,gsc:QO.nullable(),ga:KO.nullable(),socialReferrals:ZO.nullable(),aiReferrals:YO.nullable(),serverActivity:XO.nullable(),indexingHealth:JO.nullable(),citationsTrend:A(FO),whatsChanged:t4,insights:A(zf),recommendedNextSteps:A(WO),actionPlan:A(hp),clientSummary:r4,agencyDiagnostics:l4,contentOpportunities:A(L0),contentGaps:A(U0),groundingSources:A(q0)});const c4=ie(["claude","codex"]);c4.enum;const u4=ie(["claude","codex","all"]);u4.enum;const V0=j({content:v().int().nonnegative(),sitemap:v().int().nonnegative(),robots:v().int().nonnegative(),asset:v().int().nonnegative(),other:v().int().nonnegative()}),d4=ie(["content","sitemap","robots","asset","other"]),gp=ie(["cloud-run","wordpress","cloudflare","vercel","generic-log"]);gp.enum;const f4=ie(["raw-request-events","aggregate-request-metrics","request-url","status-code","user-agent","remote-ip","referer","cursor-pull"]);f4.enum;const p4=ie(["raw-request","aggregate-bucket"]),m4=p4.enum,h4=ie(["observed","provider-aggregated","inferred"]),g4=h4.enum,y4=j({type:p().nullable(),labels:lt(p(),p())}),b4=j({sourceType:gp,evidenceKind:qt(m4["raw-request"]),confidence:qt(g4.observed),eventId:p().min(1),observedAt:p().min(1),method:p().nullable(),requestUrl:p().nullable(),host:p().nullable(),path:p().min(1),queryString:p().nullable(),status:v().int().nullable(),userAgent:p().nullable(),remoteIp:p().nullable(),referer:p().nullable(),latencyMs:v().nullable(),requestSizeBytes:v().int().nullable(),responseSizeBytes:v().int().nullable(),providerResource:y4,providerLabels:lt(p(),p())});j({events:A(b4),rawEntryCount:v().int().nonnegative(),skippedEntryCount:v().int().nonnegative(),nextPageToken:p().optional(),filter:p()});const P0=ie(["connected","paused","error","archived"]),NL=P0.enum,G0=ie(["oauth","service-account"]);G0.enum;const v4=ie(["verified","claimed_unverified","unknown_ai_like"]),kL=v4.enum;j({gcpProjectId:p().min(1),serviceName:p().nullable().optional(),location:p().nullable().optional(),authMode:G0});j({baseUrl:p().url(),username:p().min(1)});const yp=ie(["production","preview"]);yp.enum;j({projectId:p().min(1),teamId:p().min(1),environment:yp});const H0=j({id:p(),projectId:p(),sourceType:gp,displayName:p(),status:P0,lastSyncedAt:p().nullable(),lastCursor:p().nullable(),lastError:p().nullable(),archivedAt:p().nullable(),config:lt(p(),qn()),createdAt:p(),updatedAt:p()});j({gcpProjectId:p().min(1),serviceName:p().min(1).optional(),location:p().min(1).optional(),displayName:p().min(1).optional(),keyJson:p().optional()});j({baseUrl:p().url(),username:p().min(1),applicationPassword:p().min(1),displayName:p().min(1).optional()});j({projectId:p().min(1),teamId:p().min(1),token:p().min(1),environment:yp.optional(),displayName:p().min(1).optional()});j({sourceId:p(),runId:p(),syncedAt:p(),pulledEvents:v().int().nonnegative(),selfTrafficExcluded:v().int().nonnegative(),crawlerHits:v().int().nonnegative(),aiUserFetchHits:v().int().nonnegative(),aiReferralHits:v().int().nonnegative(),unknownHits:v().int().nonnegative(),crawlerBucketRows:v().int().nonnegative(),aiUserFetchBucketRows:v().int().nonnegative(),aiReferralBucketRows:v().int().nonnegative(),sampleRows:v().int().nonnegative(),windowStart:p(),windowEnd:p()});j({days:v().int().positive().optional()});j({advanceToNow:qt(!0)});j({sourceId:p(),runId:p(),status:Ys,windowStart:p(),windowEnd:p(),daysRequested:v().int().positive(),daysApplied:v().int().positive()});const S4=j({crawlerHits:v().int().nonnegative(),crawlerContentHits:v().int().nonnegative(),crawlerInfraHits:v().int().nonnegative(),crawlerSegments:V0,aiUserFetchHits:v().int().nonnegative(),aiReferralHits:v().int().nonnegative(),sampleCount:v().int().nonnegative()});j({sources:A(H0)});const x4=H0.extend({totals24h:S4,latestRun:j({runId:p(),status:Ys,startedAt:p().nullable(),finishedAt:p().nullable(),error:p().nullable()}).nullable()});j({sources:A(x4)});const w4=ie(["crawler","ai-user-fetch","ai-referral"]),bp=w4.enum,j4=j({kind:qt(bp.crawler),sourceId:p(),tsHour:p(),botId:p(),operator:p(),verificationStatus:p(),pathNormalized:p(),pathClass:d4,status:v().int(),hits:v().int().nonnegative()}),N4=j({kind:qt(bp["ai-user-fetch"]),sourceId:p(),tsHour:p(),botId:p(),operator:p(),verificationStatus:p(),pathNormalized:p(),status:v().int(),hits:v().int().nonnegative()}),k4=j({kind:qt(bp["ai-referral"]),sourceId:p(),tsHour:p(),product:p(),operator:p(),sourceDomain:p(),evidenceType:p(),landingPathNormalized:p(),status:v().int(),hits:v().int().nonnegative()}),A4=p0("kind",[j4,N4,k4]);j({windowStart:p(),windowEnd:p(),totals:j({crawlerHits:v().int().nonnegative(),crawlerContentHits:v().int().nonnegative(),crawlerInfraHits:v().int().nonnegative(),crawlerSegments:V0,aiUserFetchHits:v().int().nonnegative(),aiReferralHits:v().int().nonnegative()}),events:A(A4)});j({apiKey:p().min(1)});j({connected:oe(),adAccountId:p().nullable().optional(),displayName:p().nullable().optional(),currencyCode:p().nullable().optional(),timezone:p().nullable().optional(),status:p().nullable().optional(),lastSyncedAt:p().nullable().optional()});j({disconnected:oe()});j({runId:p(),status:p()});const _4=j({type:p().nullable().optional(),title:p().nullable().optional(),body:p().nullable().optional(),targetUrl:p().nullable().optional()}),C4=j({id:p(),adGroupId:p(),name:p(),status:p(),reviewStatus:p().nullable().optional(),creative:_4.nullable().optional()}),z4=j({id:p(),campaignId:p(),name:p(),status:p(),billingEventType:p().nullable().optional(),maxBidMicros:v().int().nullable().optional(),contextHints:A(p()).default([]),ads:A(C4).default([])}),T4=j({id:p(),name:p(),status:p(),biddingType:p().nullable().optional(),dailySpendLimitMicros:v().int().nullable().optional(),lifetimeSpendLimitMicros:v().int().nullable().optional(),adGroups:A(z4).default([])});j({campaigns:A(T4)});const Q0=ie(["campaign","ad_group"]);Q0.enum;const E4=j({level:Q0,entityId:p(),date:p(),impressions:v().int(),clicks:v().int(),spendMicros:v().int(),ctr:v().nullable(),cpcMicros:v().int().nullable()});j({rows:A(E4),currencyCode:p().nullable().optional()});const O4=j({impressions:v().int(),clicks:v().int(),spendMicros:v().int(),ctr:v().nullable(),cpcMicros:v().int().nullable()});j({connected:oe(),displayName:p().nullable().optional(),currencyCode:p().nullable().optional(),lastSyncedAt:p().nullable().optional(),campaignCount:v().int(),adGroupCount:v().int(),adCount:v().int(),window:j({from:p().nullable(),to:p().nullable()}),totals:O4});var D4=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(D4||{});const AL={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},_L={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},CL=ip;function R4(e){const n=[];if(e.message&&n.push(e.message),e.providers)for(const[i,r]of Object.entries(e.providers)){const l=`[${i}] ${r.message}`;r.raw!==void 0?n.push(`${l}
52
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const h=d[1];if(n===d[0]){c(d);continue}if(e.external){const v=e.external.registry.get(d[0])?.id;if(n!==d[0]&&v){c(d);continue}}if(e.metadataRegistry.get(d[0])?.id){c(d);continue}if(h.cycle){c(d);continue}if(h.count>1&&e.reused==="ref"){c(d);continue}}}function l0(e,n){const i=e.seen.get(n);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=d=>{const h=e.seen.get(d);if(h.ref===null)return;const g=h.def??h.schema,v={...g},S=h.ref;if(h.ref=null,S){r(S);const N=e.seen.get(S),_=N.schema;if(_.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(_)):Object.assign(g,_),Object.assign(g,v),d._zod.parent===S)for(const k in g)k==="$ref"||k==="allOf"||k in v||delete g[k];if(_.$ref&&N.def)for(const k in g)k==="$ref"||k==="allOf"||k in N.def&&JSON.stringify(g[k])===JSON.stringify(N.def[k])&&delete g[k]}const x=d._zod.parent;if(x&&x!==S){r(x);const N=e.seen.get(x);if(N?.schema.$ref&&(g.$ref=N.schema.$ref,N.def))for(const _ in g)_==="$ref"||_==="allOf"||_ in N.def&&JSON.stringify(g[_])===JSON.stringify(N.def[_])&&delete g[_]}e.override({zodSchema:d,jsonSchema:g,path:h.path??[]})};for(const d of[...e.seen.entries()].reverse())r(d[0]);const l={};if(e.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?l.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?l.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(n)?.id;if(!d)throw new Error("Schema is missing an `id` property");l.$id=e.external.uri(d)}Object.assign(l,i.def??i.schema);const c=e.external?.defs??{};for(const d of e.seen.entries()){const h=d[1];h.def&&h.defId&&(c[h.defId]=h.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?l.$defs=c:l.definitions=c);try{const d=JSON.parse(JSON.stringify(l));return Object.defineProperty(d,"~standard",{value:{...n["~standard"],jsonSchema:{input:rc(n,"input",e.processors),output:rc(n,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function Pt(e,n){const i=n??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Pt(r.element,i);if(r.type==="set")return Pt(r.valueType,i);if(r.type==="lazy")return Pt(r.getter(),i);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Pt(r.innerType,i);if(r.type==="intersection")return Pt(r.left,i)||Pt(r.right,i);if(r.type==="record"||r.type==="map")return Pt(r.keyType,i)||Pt(r.valueType,i);if(r.type==="pipe")return Pt(r.in,i)||Pt(r.out,i);if(r.type==="object"){for(const l in r.shape)if(Pt(r.shape[l],i))return!0;return!1}if(r.type==="union"){for(const l of r.options)if(Pt(l,i))return!0;return!1}if(r.type==="tuple"){for(const l of r.items)if(Pt(l,i))return!0;return!!(r.rest&&Pt(r.rest,i))}return!1}const XC=(e,n={})=>i=>{const r=r0({...i,processors:n});return kt(e,r),o0(r,e),l0(r,e)},rc=(e,n,i={})=>r=>{const{libraryOptions:l,target:c}=r??{},d=r0({...l??{},target:c,io:n,processors:i});return kt(e,d),o0(d,e),l0(d,e)},JC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},FC=(e,n,i,r)=>{const l=i;l.type="string";const{minimum:c,maximum:d,format:h,patterns:g,contentEncoding:v}=e._zod.bag;if(typeof c=="number"&&(l.minLength=c),typeof d=="number"&&(l.maxLength=d),h&&(l.format=JC[h]??h,l.format===""&&delete l.format,h==="time"&&delete l.format),v&&(l.contentEncoding=v),g&&g.size>0){const S=[...g];S.length===1?l.pattern=S[0].source:S.length>1&&(l.allOf=[...S.map(x=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},WC=(e,n,i,r)=>{const l=i,{minimum:c,maximum:d,format:h,multipleOf:g,exclusiveMaximum:v,exclusiveMinimum:S}=e._zod.bag;typeof h=="string"&&h.includes("int")?l.type="integer":l.type="number",typeof S=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(l.minimum=S,l.exclusiveMinimum=!0):l.exclusiveMinimum=S),typeof c=="number"&&(l.minimum=c,typeof S=="number"&&n.target!=="draft-04"&&(S>=c?delete l.minimum:delete l.exclusiveMinimum)),typeof v=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(l.maximum=v,l.exclusiveMaximum=!0):l.exclusiveMaximum=v),typeof d=="number"&&(l.maximum=d,typeof v=="number"&&n.target!=="draft-04"&&(v<=d?delete l.maximum:delete l.exclusiveMaximum)),typeof g=="number"&&(l.multipleOf=g)},ez=(e,n,i,r)=>{i.type="boolean"},tz=(e,n,i,r)=>{i.not={}},nz=(e,n,i,r)=>{},az=(e,n,i,r)=>{const l=e._zod.def,c=Uv(l.entries);c.every(d=>typeof d=="number")&&(i.type="number"),c.every(d=>typeof d=="string")&&(i.type="string"),i.enum=c},iz=(e,n,i,r)=>{const l=e._zod.def,c=[];for(const d of l.values)if(d===void 0){if(n.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof d=="bigint"){if(n.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(d))}else c.push(d);if(c.length!==0)if(c.length===1){const d=c[0];i.type=d===null?"null":typeof d,n.target==="draft-04"||n.target==="openapi-3.0"?i.enum=[d]:i.const=d}else c.every(d=>typeof d=="number")&&(i.type="number"),c.every(d=>typeof d=="string")&&(i.type="string"),c.every(d=>typeof d=="boolean")&&(i.type="boolean"),c.every(d=>d===null)&&(i.type="null"),i.enum=c},sz=(e,n,i,r)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},rz=(e,n,i,r)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},oz=(e,n,i,r)=>{const l=i,c=e._zod.def,{minimum:d,maximum:h}=e._zod.bag;typeof d=="number"&&(l.minItems=d),typeof h=="number"&&(l.maxItems=h),l.type="array",l.items=kt(c.element,n,{...r,path:[...r.path,"items"]})},lz=(e,n,i,r)=>{const l=i,c=e._zod.def;l.type="object",l.properties={};const d=c.shape;for(const v in d)l.properties[v]=kt(d[v],n,{...r,path:[...r.path,"properties",v]});const h=new Set(Object.keys(d)),g=new Set([...h].filter(v=>{const S=c.shape[v]._zod;return n.io==="input"?S.optin===void 0:S.optout===void 0}));g.size>0&&(l.required=Array.from(g)),c.catchall?._zod.def.type==="never"?l.additionalProperties=!1:c.catchall?c.catchall&&(l.additionalProperties=kt(c.catchall,n,{...r,path:[...r.path,"additionalProperties"]})):n.io==="output"&&(l.additionalProperties=!1)},cz=(e,n,i,r)=>{const l=e._zod.def,c=l.inclusive===!1,d=l.options.map((h,g)=>kt(h,n,{...r,path:[...r.path,c?"oneOf":"anyOf",g]}));c?i.oneOf=d:i.anyOf=d},uz=(e,n,i,r)=>{const l=e._zod.def,c=kt(l.left,n,{...r,path:[...r.path,"allOf",0]}),d=kt(l.right,n,{...r,path:[...r.path,"allOf",1]}),h=v=>"allOf"in v&&Object.keys(v).length===1,g=[...h(c)?c.allOf:[c],...h(d)?d.allOf:[d]];i.allOf=g},dz=(e,n,i,r)=>{const l=i,c=e._zod.def;l.type="object";const d=c.keyType,g=d._zod.bag?.patterns;if(c.mode==="loose"&&g&&g.size>0){const S=kt(c.valueType,n,{...r,path:[...r.path,"patternProperties","*"]});l.patternProperties={};for(const x of g)l.patternProperties[x.source]=S}else(n.target==="draft-07"||n.target==="draft-2020-12")&&(l.propertyNames=kt(c.keyType,n,{...r,path:[...r.path,"propertyNames"]})),l.additionalProperties=kt(c.valueType,n,{...r,path:[...r.path,"additionalProperties"]});const v=d._zod.values;if(v){const S=[...v].filter(x=>typeof x=="string"||typeof x=="number");S.length>0&&(l.required=S)}},fz=(e,n,i,r)=>{const l=e._zod.def,c=kt(l.innerType,n,r),d=n.seen.get(e);n.target==="openapi-3.0"?(d.ref=l.innerType,i.nullable=!0):i.anyOf=[c,{type:"null"}]},pz=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType},mz=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType,i.default=JSON.parse(JSON.stringify(l.defaultValue))},hz=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType,n.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(l.defaultValue)))},gz=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType;let d;try{d=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=d},yz=(e,n,i,r)=>{const l=e._zod.def,c=n.io==="input"?l.in._zod.def.type==="transform"?l.out:l.in:l.out;kt(c,n,r);const d=n.seen.get(e);d.ref=c},bz=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType,i.readOnly=!0},c0=(e,n,i,r)=>{const l=e._zod.def;kt(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType},vz=Q("ZodISODateTime",(e,n)=>{S_.init(e,n),ft.init(e,n)});function Sz(e){return AC(vz,e)}const xz=Q("ZodISODate",(e,n)=>{x_.init(e,n),ft.init(e,n)});function wz(e){return _C(xz,e)}const jz=Q("ZodISOTime",(e,n)=>{w_.init(e,n),ft.init(e,n)});function Nz(e){return CC(jz,e)}const kz=Q("ZodISODuration",(e,n)=>{j_.init(e,n),ft.init(e,n)});function Az(e){return zC(kz,e)}const _z=(e,n)=>{Pv.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>p2(e,i)},flatten:{value:i=>f2(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,Nf,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,Nf,2)}},isEmpty:{get(){return e.issues.length===0}}})},_n=Q("ZodError",_z,{Parent:Error}),Cz=Wf(_n),zz=ep(_n),Tz=bc(_n),Ez=vc(_n),Oz=g2(_n),Dz=y2(_n),Rz=b2(_n),Mz=v2(_n),Bz=S2(_n),Lz=x2(_n),qz=w2(_n),Uz=j2(_n),dt=Q("ZodType",(e,n)=>(ut.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:rc(e,"input"),output:rc(e,"output")}}),e.toJSONSchema=XC(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...i)=>e.clone(Fa(n,{checks:[...n.checks??[],...i.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(i,r)=>Wa(e,i,r),e.brand=()=>e,e.register=((i,r)=>(i.add(e,r),e)),e.parse=(i,r)=>Cz(e,i,r,{callee:e.parse}),e.safeParse=(i,r)=>Tz(e,i,r),e.parseAsync=async(i,r)=>zz(e,i,r,{callee:e.parseAsync}),e.safeParseAsync=async(i,r)=>Ez(e,i,r),e.spa=e.safeParseAsync,e.encode=(i,r)=>Oz(e,i,r),e.decode=(i,r)=>Dz(e,i,r),e.encodeAsync=async(i,r)=>Rz(e,i,r),e.decodeAsync=async(i,r)=>Mz(e,i,r),e.safeEncode=(i,r)=>Bz(e,i,r),e.safeDecode=(i,r)=>Lz(e,i,r),e.safeEncodeAsync=async(i,r)=>qz(e,i,r),e.safeDecodeAsync=async(i,r)=>Uz(e,i,r),e.refine=(i,r)=>e.check(OT(i,r)),e.superRefine=i=>e.check(DT(i)),e.overwrite=i=>e.check(Ks(i)),e.optional=()=>yb(e),e.exactOptional=()=>vT(e),e.nullable=()=>bb(e),e.nullish=()=>yb(bb(e)),e.nonoptional=i=>kT(e,i),e.array=()=>A(e),e.or=i=>np([e,i]),e.and=i=>pT(e,i),e.transform=i=>vb(e,yT(i)),e.default=i=>wT(e,i),e.prefault=i=>NT(e,i),e.catch=i=>_T(e,i),e.pipe=i=>vb(e,i),e.readonly=()=>TT(e),e.describe=i=>{const r=e.clone();return io.add(r,{description:i}),r},Object.defineProperty(e,"description",{get(){return io.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return io.get(e);const r=e.clone();return io.add(r,i[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),u0=Q("_ZodString",(e,n)=>{tp.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(r,l,c)=>FC(e,r,l);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...r)=>e.check(MC(...r)),e.includes=(...r)=>e.check(qC(...r)),e.startsWith=(...r)=>e.check(UC(...r)),e.endsWith=(...r)=>e.check($C(...r)),e.min=(...r)=>e.check(sc(...r)),e.max=(...r)=>e.check(i0(...r)),e.length=(...r)=>e.check(s0(...r)),e.nonempty=(...r)=>e.check(sc(1,...r)),e.lowercase=r=>e.check(BC(r)),e.uppercase=r=>e.check(LC(r)),e.trim=()=>e.check(VC()),e.normalize=(...r)=>e.check(IC(...r)),e.toLowerCase=()=>e.check(PC()),e.toUpperCase=()=>e.check(GC()),e.slugify=()=>e.check(HC())}),$z=Q("ZodString",(e,n)=>{tp.init(e,n),u0.init(e,n),e.email=i=>e.check(sC(Iz,i)),e.url=i=>e.check(uC(Vz,i)),e.jwt=i=>e.check(kC(aT,i)),e.emoji=i=>e.check(dC(Pz,i)),e.guid=i=>e.check(db(hb,i)),e.uuid=i=>e.check(rC(Vl,i)),e.uuidv4=i=>e.check(oC(Vl,i)),e.uuidv6=i=>e.check(lC(Vl,i)),e.uuidv7=i=>e.check(cC(Vl,i)),e.nanoid=i=>e.check(fC(Gz,i)),e.guid=i=>e.check(db(hb,i)),e.cuid=i=>e.check(pC(Hz,i)),e.cuid2=i=>e.check(mC(Qz,i)),e.ulid=i=>e.check(hC(Kz,i)),e.base64=i=>e.check(wC(eT,i)),e.base64url=i=>e.check(jC(tT,i)),e.xid=i=>e.check(gC(Zz,i)),e.ksuid=i=>e.check(yC(Yz,i)),e.ipv4=i=>e.check(bC(Xz,i)),e.ipv6=i=>e.check(vC(Jz,i)),e.cidrv4=i=>e.check(SC(Fz,i)),e.cidrv6=i=>e.check(xC(Wz,i)),e.e164=i=>e.check(NC(nT,i)),e.datetime=i=>e.check(Sz(i)),e.date=i=>e.check(wz(i)),e.time=i=>e.check(Nz(i)),e.duration=i=>e.check(Az(i))});function p(e){return iC($z,e)}const ft=Q("ZodStringFormat",(e,n)=>{ct.init(e,n),u0.init(e,n)}),Iz=Q("ZodEmail",(e,n)=>{d_.init(e,n),ft.init(e,n)}),hb=Q("ZodGUID",(e,n)=>{c_.init(e,n),ft.init(e,n)}),Vl=Q("ZodUUID",(e,n)=>{u_.init(e,n),ft.init(e,n)}),Vz=Q("ZodURL",(e,n)=>{f_.init(e,n),ft.init(e,n)}),Pz=Q("ZodEmoji",(e,n)=>{p_.init(e,n),ft.init(e,n)}),Gz=Q("ZodNanoID",(e,n)=>{m_.init(e,n),ft.init(e,n)}),Hz=Q("ZodCUID",(e,n)=>{h_.init(e,n),ft.init(e,n)}),Qz=Q("ZodCUID2",(e,n)=>{g_.init(e,n),ft.init(e,n)}),Kz=Q("ZodULID",(e,n)=>{y_.init(e,n),ft.init(e,n)}),Zz=Q("ZodXID",(e,n)=>{b_.init(e,n),ft.init(e,n)}),Yz=Q("ZodKSUID",(e,n)=>{v_.init(e,n),ft.init(e,n)}),Xz=Q("ZodIPv4",(e,n)=>{N_.init(e,n),ft.init(e,n)}),Jz=Q("ZodIPv6",(e,n)=>{k_.init(e,n),ft.init(e,n)}),Fz=Q("ZodCIDRv4",(e,n)=>{A_.init(e,n),ft.init(e,n)}),Wz=Q("ZodCIDRv6",(e,n)=>{__.init(e,n),ft.init(e,n)}),eT=Q("ZodBase64",(e,n)=>{C_.init(e,n),ft.init(e,n)}),tT=Q("ZodBase64URL",(e,n)=>{T_.init(e,n),ft.init(e,n)}),nT=Q("ZodE164",(e,n)=>{E_.init(e,n),ft.init(e,n)}),aT=Q("ZodJWT",(e,n)=>{D_.init(e,n),ft.init(e,n)}),d0=Q("ZodNumber",(e,n)=>{Wv.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(r,l,c)=>WC(e,r,l),e.gt=(r,l)=>e.check(pb(r,l)),e.gte=(r,l)=>e.check(sf(r,l)),e.min=(r,l)=>e.check(sf(r,l)),e.lt=(r,l)=>e.check(fb(r,l)),e.lte=(r,l)=>e.check(af(r,l)),e.max=(r,l)=>e.check(af(r,l)),e.int=r=>e.check(gb(r)),e.safe=r=>e.check(gb(r)),e.positive=r=>e.check(pb(0,r)),e.nonnegative=r=>e.check(sf(0,r)),e.negative=r=>e.check(fb(0,r)),e.nonpositive=r=>e.check(af(0,r)),e.multipleOf=(r,l)=>e.check(mb(r,l)),e.step=(r,l)=>e.check(mb(r,l)),e.finite=()=>e;const i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function b(e){return TC(d0,e)}const iT=Q("ZodNumberFormat",(e,n)=>{R_.init(e,n),d0.init(e,n)});function gb(e){return EC(iT,e)}const sT=Q("ZodBoolean",(e,n)=>{M_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>ez(e,i,r)});function oe(e){return OC(sT,e)}const rT=Q("ZodUnknown",(e,n)=>{B_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>nz()});function qn(){return DC(rT)}const oT=Q("ZodNever",(e,n)=>{L_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>tz(e,i,r)});function lT(e){return RC(oT,e)}const cT=Q("ZodArray",(e,n)=>{q_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>oz(e,i,r,l),e.element=n.element,e.min=(i,r)=>e.check(sc(i,r)),e.nonempty=i=>e.check(sc(1,i)),e.max=(i,r)=>e.check(i0(i,r)),e.length=(i,r)=>e.check(s0(i,r)),e.unwrap=()=>e.element});function A(e,n){return QC(cT,e,n)}const uT=Q("ZodObject",(e,n)=>{$_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>lz(e,i,r,l),Pe(e,"shape",()=>n.shape),e.keyof=()=>ie(Object.keys(e._zod.def.shape)),e.catchall=i=>e.clone({...e._zod.def,catchall:i}),e.passthrough=()=>e.clone({...e._zod.def,catchall:qn()}),e.loose=()=>e.clone({...e._zod.def,catchall:qn()}),e.strict=()=>e.clone({...e._zod.def,catchall:lT()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=i=>o2(e,i),e.safeExtend=i=>l2(e,i),e.merge=i=>c2(e,i),e.pick=i=>s2(e,i),e.omit=i=>r2(e,i),e.partial=(...i)=>u2(m0,e,i[0]),e.required=(...i)=>d2(h0,e,i[0])});function w(e,n){const i={type:"object",shape:e??{},...ye(n)};return new uT(i)}const f0=Q("ZodUnion",(e,n)=>{n0.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>cz(e,i,r,l),e.options=n.options});function np(e,n){return new f0({type:"union",options:e,...ye(n)})}const dT=Q("ZodDiscriminatedUnion",(e,n)=>{f0.init(e,n),I_.init(e,n)});function p0(e,n,i){return new dT({type:"union",options:n,discriminator:e,...ye(i)})}const fT=Q("ZodIntersection",(e,n)=>{V_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>uz(e,i,r,l)});function pT(e,n){return new fT({type:"intersection",left:e,right:n})}const mT=Q("ZodRecord",(e,n)=>{P_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>dz(e,i,r,l),e.keyType=n.keyType,e.valueType=n.valueType});function lt(e,n,i){return new mT({type:"record",keyType:e,valueType:n,...ye(i)})}const Af=Q("ZodEnum",(e,n)=>{G_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(r,l,c)=>az(e,r,l),e.enum=n.entries,e.options=Object.values(n.entries);const i=new Set(Object.keys(n.entries));e.extract=(r,l)=>{const c={};for(const d of r)if(i.has(d))c[d]=n.entries[d];else throw new Error(`Key ${d} not found in enum`);return new Af({...n,checks:[],...ye(l),entries:c})},e.exclude=(r,l)=>{const c={...n.entries};for(const d of r)if(i.has(d))delete c[d];else throw new Error(`Key ${d} not found in enum`);return new Af({...n,checks:[],...ye(l),entries:c})}});function ie(e,n){const i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Af({type:"enum",entries:i,...ye(n)})}const hT=Q("ZodLiteral",(e,n)=>{H_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>iz(e,i,r),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function qt(e,n){return new hT({type:"literal",values:Array.isArray(e)?e:[e],...ye(n)})}const gT=Q("ZodTransform",(e,n)=>{Q_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>rz(e,i),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new Lv(e.constructor.name);i.addIssue=c=>{if(typeof c=="string")i.issues.push(uo(c,i.value,n));else{const d=c;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=i.value),d.inst??(d.inst=e),i.issues.push(uo(d))}};const l=n.transform(i.value,i);return l instanceof Promise?l.then(c=>(i.value=c,i)):(i.value=l,i)}});function yT(e){return new gT({type:"transform",transform:e})}const m0=Q("ZodOptional",(e,n)=>{a0.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>c0(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function yb(e){return new m0({type:"optional",innerType:e})}const bT=Q("ZodExactOptional",(e,n)=>{K_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>c0(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function vT(e){return new bT({type:"optional",innerType:e})}const ST=Q("ZodNullable",(e,n)=>{Z_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>fz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function bb(e){return new ST({type:"nullable",innerType:e})}const xT=Q("ZodDefault",(e,n)=>{Y_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>mz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function wT(e,n){return new xT({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():Iv(n)}})}const jT=Q("ZodPrefault",(e,n)=>{X_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>hz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function NT(e,n){return new jT({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():Iv(n)}})}const h0=Q("ZodNonOptional",(e,n)=>{J_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>pz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function kT(e,n){return new h0({type:"nonoptional",innerType:e,...ye(n)})}const AT=Q("ZodCatch",(e,n)=>{F_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>gz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function _T(e,n){return new AT({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const CT=Q("ZodPipe",(e,n)=>{W_.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>yz(e,i,r,l),e.in=n.in,e.out=n.out});function vb(e,n){return new CT({type:"pipe",in:e,out:n})}const zT=Q("ZodReadonly",(e,n)=>{eC.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>bz(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function TT(e){return new zT({type:"readonly",innerType:e})}const ET=Q("ZodCustom",(e,n)=>{tC.init(e,n),dt.init(e,n),e._zod.processJSONSchema=(i,r,l)=>sz(e,i)});function OT(e,n={}){return KC(ET,e,n)}function DT(e){return ZC(e)}const g0=w({id:p(),name:p(),keyPrefix:p(),scopes:A(p()),readOnly:oe(),createdAt:p(),lastUsedAt:p().nullable(),revokedAt:p().nullable()});w({keys:A(g0)});w({name:p().min(1).max(100),scopes:A(p()).min(1).optional()});g0.extend({key:p()});const RT=w({maxConcurrency:b().int().positive(),maxRequestsPerMinute:b().int().positive(),maxRequestsPerDay:b().int().positive()}),ya=p().min(1);p().min(1);const ap=w({label:p().min(1),city:p().min(1),region:p().min(1),country:p().length(2),timezone:p().optional()}),ip=ie(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);w({id:p(),projectId:p(),channel:qt("webhook"),url:p().url(),urlDisplay:p(),urlHost:p(),events:A(ip),enabled:oe().default(!0),source:p().optional(),webhookSecret:p().optional(),createdAt:p(),updatedAt:p()});w({channel:qt("webhook"),url:p().url(),events:A(ip).min(1),source:p().optional()});const y0=ie(["cli","api","config-file"]);function MT(e){const n=new Set,i=new Set;for(const r of e){if(n.has(r.label)){i.add(r.label);continue}n.add(r.label)}return[...i]}function BT(e,n){return n?e.some(i=>i.label===n):!0}w({displayName:p().min(1),canonicalDomain:p().min(1),ownedDomains:A(p().min(1)).optional(),aliases:A(p()).optional(),country:p().length(2),language:p().min(2),tags:A(p()).optional(),labels:lt(p(),p()).optional(),providers:A(ya).optional(),locations:A(ap).optional(),defaultLocation:p().nullable().optional(),autoExtractBacklinks:oe().optional(),configSource:y0.optional()});const LT=w({id:p(),name:p(),displayName:p().optional(),canonicalDomain:p(),ownedDomains:A(p()).default([]),aliases:A(p()).default([]),country:p().length(2),language:p().min(2),tags:A(p()).default([]),labels:lt(p(),p()).default({}),providers:A(p()).default([]),locations:A(ap).default([]),defaultLocation:p().nullable().optional(),autoExtractBacklinks:oe().default(!1),configSource:y0.default("cli"),configRevision:b().int().positive().default(1),createdAt:p().optional(),updatedAt:p().optional()});w({id:p(),query:p(),createdAt:p()});w({id:p(),keyword:p(),createdAt:p()});w({queries:A(p().trim().min(1)).min(1)});w({keywords:A(p().trim().min(1)).min(1)});w({provider:ya,count:b().int().min(1).max(20).optional()});w({id:p(),domain:p(),createdAt:p()});w({competitors:A(p().trim().min(1)).min(1)});function oc(e){let n=e.trim().toLowerCase();try{n.includes("://")&&(n=new URL(n).hostname.toLowerCase())}catch{}return n.replace(/^www\./,"")}const qT=new Set(["ac.uk","co.id","co.il","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.au","com.br","com.cn","com.mx","com.ph","com.sg","com.tr","edu.au","edu.sg","gov.au","gov.uk","me.uk","ne.jp","net.au","net.br","net.cn","net.in","net.tr","or.jp","or.kr","org.au","org.br","org.in","org.nz","org.tr","org.uk","org.za"]);function UT(e){const n=oc(e);if(!n)return"";const i=n.split("/")[0]?.split(":")[0]??"";if(!i)return"";const r=i.split(".").filter(Boolean);if(r.length<2)return"";if(r.length===2)return r.join(".");const l=r.slice(-2).join(".");return qT.has(l)?r.length>=3?r.slice(-3).join("."):"":r.slice(-2).join(".")}function $T(e){const n=UT(e);return n?n.split(".")[0]??"":""}function IT(e){const n=[e.canonicalDomain,...e.ownedDomains??[]],i=new Set,r=[];for(const l of n){const c=l.trim();if(!c)continue;const d=oc(c);i.has(d)||(i.add(d),r.push(c))}return r}const VT=w({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:lt(p(),p()).optional().default({})}),PT=w({preset:p().optional(),cron:p().optional(),timezone:p().optional().default("UTC"),providers:A(ya).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),GT=w({channel:qt("webhook"),url:p().url(),events:A(ip).min(1)}),HT=w({gsc:w({propertyUrl:p()}).optional(),syncSchedule:w({preset:p().optional(),cron:p().optional()}).optional()}).optional(),Sb=A(p().min(1)),QT=w({displayName:p().min(1),canonicalDomain:p().min(1),ownedDomains:A(p().min(1)).optional().default([]),aliases:A(p().min(1)).optional().default([]),country:p().length(2),language:p().min(2),queries:Sb.optional(),keywords:Sb.optional(),competitors:A(p().min(1)).optional().default([]),providers:A(ya).optional().default([]),locations:A(ap).optional().default([]),defaultLocation:p().optional(),schedule:PT,notifications:A(GT).optional().default([]),google:HT,autoExtractBacklinks:oe().optional().default(!1)}).superRefine((e,n)=>{e.queries!==void 0&&e.keywords!==void 0&&n.addIssue({code:"custom",message:"Use spec.queries; spec.keywords is accepted only as a legacy alias when spec.queries is omitted",path:["keywords"]});const i=MT(e.locations);i.length>0&&n.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${i.join(", ")}`,path:["locations"]}),BT(e.locations,e.defaultLocation)||n.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});w({apiVersion:qt("canonry/v1"),kind:qt("Project"),metadata:VT,spec:QT});const KT=ie(["gsc","ga4","gbp"]);w({id:p(),domain:p(),connectionType:KT,propertyId:p().nullable().optional(),sitemapUrl:p().nullable().optional(),scopes:A(p()).default([]),createdAt:p(),updatedAt:p()});w({date:p(),query:p(),page:p(),country:p().nullable().optional(),device:p().nullable().optional(),clicks:b(),impressions:b(),ctr:b(),position:b()});const ZT=w({date:p(),clicks:b(),impressions:b(),ctr:b()});w({totals:w({clicks:b(),impressions:b(),ctr:b(),days:b()}),daily:A(ZT)});const _f=w({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:oe().nullable().optional(),richResults:A(p()).default([]),referringUrls:A(p()).default([]),inspectedAt:p()});ie(["stable","reindexed","deindexed","still-missing","new"]);const YT=w({url:p(),previousState:p().nullable(),currentState:p().nullable(),transitionDate:p()}),XT=w({reason:p(),count:b(),urls:A(_f).default([])});w({summary:w({total:b(),indexed:b(),notIndexed:b(),deindexed:b(),percentage:b()}),lastInspectedAt:p().nullable(),lastSyncedAt:p().nullable(),indexed:A(_f).default([]),notIndexed:A(_f).default([]),deindexed:A(YT).default([]),reasonGroups:A(XT).default([])});w({url:p(),type:ie(["URL_UPDATED","URL_DELETED"]),notifiedAt:p()});const JT=w({url:p(),type:ie(["URL_UPDATED","URL_DELETED"]),notifiedAt:p(),status:ie(["success","error"]),error:p().optional()});w({summary:w({total:b().int().nonnegative(),succeeded:b().int().nonnegative(),failed:b().int().nonnegative()}),results:A(JT).default([])});w({date:p(),indexed:b(),notIndexed:b(),reasonBreakdown:lt(p(),b()).default({})});const FT=w({siteUrl:p(),permissionLevel:p()});w({sites:A(FT).default([])});const WT=w({type:p(),submitted:p(),indexed:p()}),eE=w({path:p(),lastSubmitted:p().optional(),isPending:oe().optional(),isSitemapsIndex:oe().optional(),type:p().optional(),lastDownloaded:p().optional(),warnings:p().optional(),errors:p().optional(),contents:A(WT).optional()});w({sitemaps:A(eE).default([])});const tE=w({name:p(),accountName:p().nullable(),type:p().nullable(),role:p().nullable()});w({accounts:A(tE),total:b().int().nonnegative()});const nE=w({id:p(),projectId:p(),accountName:p(),locationName:p(),displayName:p(),primaryCategoryDisplayName:p().nullable(),storefrontAddress:p().nullable(),websiteUri:p().nullable(),placeId:p().nullable(),mapsUri:p().nullable(),additionalCategories:A(p()),description:p().nullable(),serviceArea:lt(p(),qn()).nullable(),regularHours:lt(p(),qn()).nullable(),primaryPhone:p().nullable(),openStatus:p().nullable(),openingDate:p().nullable(),selected:oe(),syncedAt:p().nullable(),createdAt:p(),updatedAt:p()});w({locations:A(nE),totalDiscovered:b().int().nonnegative(),totalSelected:b().int().nonnegative()});w({selectAllNew:oe().default(!0),accountName:p().optional(),switchAccount:oe().default(!1)});w({selected:oe()});w({locationNames:A(p()).optional(),daysOfMetrics:b().int().positive().max(540).optional(),monthsOfKeywords:b().int().positive().max(18).optional()});w({runId:p(),status:p()});const aE=w({locationName:p(),date:p(),metric:p(),value:b().int()});w({metrics:A(aE),total:b().int().nonnegative()});const iE=w({locationName:p(),periodStart:p(),periodEnd:p(),keyword:p(),valueCount:b().int().nullable(),valueThreshold:b().int().nullable()});w({keywords:A(iE),total:b().int().nonnegative(),thresholdedPct:b().int().min(0).max(100)});const sE=w({locationName:p(),placeActionLinkName:p(),placeActionType:p(),uri:p().nullable(),isPreferred:oe(),providerType:p().nullable()});w({placeActions:A(sE),total:b().int().nonnegative()});const rE=w({locationName:p(),populatedGroupCount:b().int().nonnegative(),syncedAt:p(),attributes:lt(p(),qn())});w({lodging:A(rE),total:b().int().nonnegative()});const oE=w({name:p(),valueType:p(),values:A(np([oe(),p()])),uris:A(p())}),lE=w({locationName:p(),attributeCount:b().int().nonnegative(),syncedAt:p(),attributes:A(oE)});w({attributes:A(lE),total:b().int().nonnegative()});const cE=w({locationName:p(),placeId:p(),tier:p(),amenities:A(p()),syncedAt:p(),place:lt(p(),qn())});w({places:A(cE),total:b().int().nonnegative()});w({scope:w({locationName:p().nullable(),locationCount:b().int().nonnegative()}),performance:w({totals:lt(p(),b()),recent7d:lt(p(),b()),prior7d:lt(p(),b()),deltaPct:lt(p(),b().nullable())}),freshness:w({dataThroughDate:p().nullable(),latestStoredDate:p().nullable(),pendingDays:b().int().nonnegative()}),timeseries:A(w({date:p(),pending:oe(),metrics:lt(p(),b())})),keywords:w({total:b().int().nonnegative(),thresholdedCount:b().int().nonnegative(),thresholdedPct:b().int().min(0).max(100)}),placeActions:w({total:b().int().nonnegative(),hasReservationCta:oe(),hasBookingCta:oe(),hasDirectMerchantCta:oe()}),lodging:w({lodgingLocationCount:b().int().nonnegative(),populatedLodgingCount:b().int().nonnegative(),emptyLodgingCount:b().int().nonnegative()}),profileCompleteness:w({locationCount:b().int().nonnegative(),withSecondaryCategories:b().int().nonnegative(),secondaryCategoryTotal:b().int().nonnegative(),withDescription:b().int().nonnegative(),withServiceArea:b().int().nonnegative(),withHours:b().int().nonnegative(),withPrimaryPhone:b().int().nonnegative(),permanentlyClosed:b().int().nonnegative(),temporarilyClosed:b().int().nonnegative()})});const uE={BUSINESS_DIRECTION_REQUESTS:"Direction requests",WEBSITE_CLICKS:"Website clicks",CALL_CLICKS:"Call clicks",BUSINESS_BOOKINGS:"Bookings",BUSINESS_CONVERSATIONS:"Conversations",BUSINESS_FOOD_ORDERS:"Food orders",BUSINESS_FOOD_MENU_CLICKS:"Food menu clicks",BUSINESS_IMPRESSIONS_DESKTOP_SEARCH:"Search impressions (desktop)",BUSINESS_IMPRESSIONS_MOBILE_SEARCH:"Search impressions (mobile)",BUSINESS_IMPRESSIONS_DESKTOP_MAPS:"Maps impressions (desktop)",BUSINESS_IMPRESSIONS_MOBILE_MAPS:"Maps impressions (mobile)"};function dE(e){const n=e.replace(/^BUSINESS_/,"").split("_").filter(Boolean).map(r=>r.toLowerCase());if(n.length===0)return e;const i=n.join(" ");return i.charAt(0).toUpperCase()+i.slice(1)}function wL(e){return uE[e]??dE(e)}const fE=["BUSINESS_DIRECTION_REQUESTS","WEBSITE_CLICKS","CALL_CLICKS"],pE=["BUSINESS_IMPRESSIONS_DESKTOP_SEARCH","BUSINESS_IMPRESSIONS_MOBILE_SEARCH","BUSINESS_IMPRESSIONS_DESKTOP_MAPS","BUSINESS_IMPRESSIONS_MOBILE_MAPS"];function jL(e){return fE.includes(e)?"conversion":pE.includes(e)?"reach":"other"}w({id:p(),domain:p(),siteUrl:p().nullable().optional(),createdAt:p(),updatedAt:p()});const rf=w({id:p(),url:p(),httpCode:b().nullable().optional(),inIndex:oe().nullable().optional(),lastCrawledDate:p().nullable().optional(),inIndexDate:p().nullable().optional(),inspectedAt:p(),documentSize:b().nullable().optional(),anchorCount:b().nullable().optional(),discoveryDate:p().nullable().optional()});w({summary:w({total:b(),indexed:b(),notIndexed:b(),unknown:b().optional(),percentage:b()}),lastInspectedAt:p().nullable(),indexed:A(rf).default([]),notIndexed:A(rf).default([]),unknown:A(rf).default([]).optional()});w({query:p(),impressions:b(),clicks:b(),ctr:b(),averagePosition:b()});w({date:p(),indexed:b(),notIndexed:b(),unknown:b()});const mE=w({url:p(),status:ie(["success","error"]),submittedAt:p(),error:p().optional()});w({summary:w({total:b().int().nonnegative(),succeeded:b().int().nonnegative(),failed:b().int().nonnegative()}),results:A(mE).default([])});const b0=w({url:p(),verified:oe()});w({sites:A(b0).default([])});w({connected:oe(),domain:p(),siteUrl:p().nullable(),createdAt:p().nullable(),updatedAt:p().nullable()});w({connected:oe(),domain:p(),siteUrl:p().nullable(),availableSites:A(b0).default([])});w({siteUrl:p()});const hE=w({name:p(),alive:oe(),lastUsed:p().nullable()});w({connected:oe(),endpoint:p(),version:p().optional(),browserVersion:p().optional(),targets:A(hE).default([])});const Zs=ie(["live","staging"]);w({projectName:p(),url:p(),stagingUrl:p().optional(),username:p(),defaultEnv:Zs,createdAt:p(),updatedAt:p()});const xb=w({url:p(),reachable:oe(),pageCount:b().nullable().optional(),version:p().nullable().optional(),error:p().nullable().optional(),plugins:A(p()).optional(),authenticatedUser:w({id:b(),slug:p()}).nullable().optional()});w({connected:oe(),projectName:p(),defaultEnv:Zs,live:xb.nullable(),staging:xb.nullable(),adminUrl:p().nullable().optional()});const gE=w({id:b(),slug:p(),title:p(),status:p(),modifiedAt:p().nullable().optional(),link:p().nullable().optional()}),v0=w({title:p().nullable(),description:p().nullable(),noindex:oe().nullable(),writable:oe().default(!1),writeTargets:A(p()).default([])}),yE=w({type:p(),json:lt(p(),qn())}),bE=gE.extend({env:Zs,content:p(),seo:v0,schemaBlocks:A(yE).default([])}),wb=bE.extend({contentHash:p(),contentSnippet:p()}),S0=w({manualRequired:qt(!0),targetUrl:p(),adminUrl:p().nullable().optional(),content:p(),nextSteps:A(p()).default([])}),vE=w({slug:p(),severity:ie(["high","medium","low"]),code:ie(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:p()});w({slug:p(),title:p(),status:p(),wordCount:b(),seo:v0,schemaPresent:oe(),issues:A(vE).default([])});const SE=w({slug:p(),status:ie(["applied","skipped","manual"]),error:p().optional(),manualAssist:S0.optional()});w({env:Zs,strategy:ie(["plugin","manual"]),results:A(SE)});const xE=w({slug:p(),status:ie(["deployed","stripped","skipped","failed"]),schemasInjected:A(p()).optional(),manualAssist:S0.optional(),error:p().optional()});w({env:Zs,results:A(xE)});const wE=w({slug:p(),title:p(),canonrySchemas:A(p()),thirdPartySchemas:A(p()),hasCanonrySchema:oe()});w({env:Zs,pages:A(wE)});const jE=w({name:p(),status:ie(["completed","skipped","failed"]),summary:p().optional(),error:p().optional()});w({projectName:p(),steps:A(jE)});w({slug:p(),live:wb,staging:wb,hasDifferences:oe(),differences:w({title:oe(),slug:oe(),content:oe(),seoTitle:oe(),seoDescription:oe(),noindex:oe(),schema:oe()})});const NE=w({name:p(),displayName:p().optional(),keyUrl:p().optional(),modelHint:p().optional(),model:p().optional(),defaultModel:p().optional(),configured:oe(),quota:RT.optional(),vertexConfigured:oe().optional()}),jb=w({configured:oe()});w({providers:A(NE).default([]),google:jb,bing:jb});const Ys=ie(["queued","running","completed","partial","failed","cancelled"]),Ht=Ys.enum,x0=ie(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","bing-inspect-sitemap","backlink-extract","traffic-sync","aeo-discover-seed","aeo-discover-probe","gbp-sync","ads-sync"]),Ne=x0.enum,w0=ie(["manual","scheduled","config-apply","backfill","probe"]),Bs=w0.enum,Ai=ie(["cited","not-cited"]),lc=Ai.enum,cc=ie(["visible","not-visible"]);cc.enum;const uc=ie(["mentioned","not-mentioned"]);uc.enum;const j0=ie(["new","cited","lost","emerging","not-cited"]);j0.enum;const kE=ie(["new","mentioned","lost","emerging","not-mentioned"]);kE.enum;const AE=ie([Bs.manual,Bs.probe]);w({kind:qt(Ne["answer-visibility"]).optional(),trigger:AE.optional(),providers:A(ya).optional(),queries:A(p().min(1)).min(1).optional(),location:p().min(1).optional(),allLocations:oe().optional(),noLocation:oe().optional()}).refine(e=>+!!e.location+ +!!e.allLocations+ +!!e.noLocation<=1,{message:'Only one of "location", "allLocations", or "noLocation" may be provided'});const _E=w({message:p(),raw:qn().optional()}),CE=w({message:p().optional(),providers:lt(p(),_E).optional()}),zE=w({id:p(),projectId:p(),kind:x0,status:Ys,trigger:w0.default("manual"),location:p().nullable().optional(),queries:A(p()).nullable().optional(),startedAt:p().nullable().optional(),finishedAt:p().nullable().optional(),error:CE.nullable().optional(),createdAt:p()});function sp(e){if(e.providers){const n=Object.entries(e.providers);if(n.length===1){const[i,r]=n[0];return`${i}: ${r.message}`}if(n.length>1)return n.map(([i,r])=>`${i}: ${r.message}`).join(" • ")}return e.message??"Run failed."}const N0=w({uri:p(),title:p()}),k0=w({id:p(),runId:p(),queryId:p(),query:p().optional(),provider:ya,citationState:Ai,answerMentioned:oe().optional(),visibilityState:cc.optional(),mentionState:uc.optional(),transition:j0.optional(),answerText:p().nullable().optional(),citedDomains:A(p()).default([]),competitorOverlap:A(p()).default([]),recommendedCompetitors:A(p()).default([]),matchedTerms:A(p()).default([]),groundingSources:A(N0).default([]),searchQueries:A(p()).default([]),model:p().nullable().optional(),location:p().nullable().optional(),createdAt:p()});w({snapshots:A(k0),total:b().int().nonnegative()});const TE=w({queryId:p().nullable(),query:p().nullable(),run1State:Ai.nullable(),run2State:Ai.nullable(),run1AnswerMentioned:oe().nullable(),run2AnswerMentioned:oe().nullable(),run1VisibilityState:cc.nullable(),run2VisibilityState:cc.nullable(),run1MentionState:uc.nullable().optional(),run2MentionState:uc.nullable().optional(),changed:oe(),visibilityChanged:oe()});w({run1:p(),run2:p(),diff:A(TE)});const EE=zE.extend({snapshots:A(k0).optional()}),OE=w({totalRuns:b().int().nonnegative(),run:EE.nullable()});w({id:p(),projectId:p().nullable().optional(),actor:p(),action:p(),entityType:p(),entityId:p().nullable().optional(),diff:qn().optional(),createdAt:p()});const DE=ie(["yes","no","unknown","not-mentioned"]),Nb=A(p().min(1));w({companyName:p().min(1),domain:p().min(1),queries:Nb.optional(),phrases:Nb.optional(),competitors:A(p().min(1)).optional().default([])}).superRefine((e,n)=>{e.queries!==void 0&&e.phrases!==void 0&&n.addIssue({code:"custom",message:"Use queries; phrases is accepted only as a legacy alias when queries is omitted",path:["phrases"]})});const RE=w({name:p(),count:b().int().nonnegative()}),ME=w({id:p(),name:p(),weight:b(),score:b(),findings:A(w({type:p(),message:p()})).default([]),recommendations:A(p()).default([])}),BE=w({url:p(),finalUrl:p(),auditedAt:p(),overallScore:b(),summary:p(),factors:A(ME).default([])}),LE=w({industry:p(),summary:p(),services:A(p()).default([]),categoryTerms:A(p()).default([])}),qE=w({provider:p(),displayName:p(),model:p().nullable().optional(),mentioned:oe(),cited:oe(),describedAccurately:DE,accuracyNotes:p().nullable().optional(),incorrectClaims:A(p()).default([]),recommendedCompetitors:A(p()).default([]),citedDomains:A(p()).default([]),groundingSources:A(N0).default([]),searchQueries:A(p()).default([]),answerText:p(),error:p().nullable().optional()}),UE=w({query:p(),providerResults:A(qE).default([])}),$E=w({totalQueries:b().int().nonnegative(),totalProviders:b().int().nonnegative(),totalComparisons:b().int().nonnegative(),mentionCount:b().int().nonnegative(),citationCount:b().int().nonnegative(),topCompetitors:A(RE).default([]),visibilityGap:p(),whatThisMeans:A(p()).default([]),recommendedActions:A(p()).default([])});w({companyName:p(),domain:p(),homepageUrl:p(),generatedAt:p(),queries:A(p()).default([]),competitors:A(p()).default([]),profile:LE,audit:BE,queryResults:A(UE).default([]),summary:$E});const A0=ie(["pass","partial","fail"]);A0.enum;const _0=ie(["up","down","flat"]);_0.enum;const IE=w({id:p(),name:p(),weight:b(),avgScore:b(),status:A0,pagesPassing:b().int().nonnegative(),pagesPartial:b().int().nonnegative(),pagesFailing:b().int().nonnegative()}),VE=w({factorId:p(),factorName:p(),avgScore:b(),affectedPages:b().int().nonnegative(),totalPages:b().int().nonnegative(),affectedPct:b().int().nonnegative(),topRecommendations:A(p()).default([])});w({project:p(),hasData:oe(),runId:p().nullable(),runStatus:Ys.nullable(),sitemapUrl:p().nullable(),auditedAt:p().nullable(),aggregateScore:b(),pagesDiscovered:b().int().nonnegative(),pagesAudited:b().int().nonnegative(),pagesSkipped:b().int().nonnegative(),pagesErrored:b().int().nonnegative(),deltaScore:b().nullable(),trend:_0.nullable(),previousScore:b().nullable(),previousAuditedAt:p().nullable(),factors:A(IE).default([]),crossCuttingIssues:A(VE).default([]),prioritizedFixes:A(p()).default([])});const PE=w({id:p(),name:p(),weight:b(),score:b()}),GE=w({url:p(),overallScore:b(),status:ie(["success","error"]),error:p().nullable().optional(),factors:A(PE).default([])});w({project:p(),runId:p().nullable(),auditedAt:p().nullable(),total:b().int().nonnegative(),pages:A(GE).default([])});const HE=w({runId:p(),auditedAt:p(),aggregateScore:b(),pagesAudited:b().int().nonnegative()});w({project:p(),points:A(HE).default([])});w({sitemapUrl:p().url().optional(),limit:b().int().positive().max(2e3).optional()});w({runId:p(),status:Ys});const rp=ie(["answer-visibility","traffic-sync","gbp-sync","data-refresh","backlinks-sync","site-audit","ads-sync"]);rp.enum;w({id:p(),projectId:p(),kind:rp,cronExpr:p(),preset:p().nullable().optional(),timezone:p().default("UTC"),enabled:oe().default(!0),providers:A(ya).default([]),sourceId:p().nullable().optional(),lastRunAt:p().nullable().optional(),nextRunAt:p().nullable().optional(),createdAt:p(),updatedAt:p()});w({kind:rp.optional(),preset:p().optional(),cron:p().optional(),timezone:p().optional().default("UTC"),enabled:oe().optional().default(!0),providers:A(ya).optional().default([]),sourceId:p().optional()}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const op=ie(["competitor","directory","social","forum","news","reference","blog","ecommerce","video","academic","other"]);op.enum;const lp=ie(["cited","aspirational","wasted-surface"]),kb=lp.enum;kb.cited,kb.aspirational;const xc=ie(["direct-competitor","ota-aggregator","editorial-media","other","unknown"]),QE=xc.enum;QE["direct-competitor"];const wc=ie(["queued","seeding","probing","completed","failed"]);wc.enum;const C0=w({domain:p().min(1),hits:b().int().positive(),competitorType:xc.default("unknown")}),KE=w({id:p(),sessionId:p(),projectId:p(),query:p(),bucket:lp.nullable().default(null),citationState:Ai,citedDomains:A(p()).default([]),answerMentioned:oe().nullable().default(null),createdAt:p()}),ZE=w({id:p(),projectId:p(),status:wc,icpDescription:p().nullable().optional(),seedProvider:p().nullable().optional(),seedCountRaw:b().int().nullable().optional(),seedCount:b().int().nullable().optional(),dedupThreshold:b().nullable().optional(),probeCount:b().int().nullable().optional(),citedCount:b().int().nullable().default(null),aspirationalCount:b().int().nullable().default(null),wastedCount:b().int().nullable().default(null),competitorMap:A(C0).default([]),warning:p().nullable().optional(),error:p().nullable().optional(),startedAt:p().nullable().optional(),finishedAt:p().nullable().optional(),createdAt:p()});ZE.extend({probes:A(KE).default([])});const YE=500;w({icpDescription:p().min(1).optional(),dedupThreshold:b().min(0).max(1).optional(),maxProbes:b().int().positive().max(YE).optional(),locations:A(p().min(1)).optional()});w({buckets:A(lp).min(1).optional(),includeCompetitors:oe().optional(),competitorTypes:A(xc).min(1).optional()});w({sessionId:p(),projectId:p(),status:wc,queriesByBucket:w({cited:A(p()),aspirational:A(p()),"wasted-surface":A(p())}),suggestedCompetitors:A(C0)});w({sessionId:p(),projectId:p(),promoted:w({queries:A(p()),competitors:A(p())}),skipped:w({queries:A(p()),competitors:A(p())})});np([qt("cli"),p().regex(/^discovery:.+$/)]);const XE=w({query:p().min(1),probeHits:b().int().positive()}),JE=w({rawCandidates:b().int().nonnegative(),admitted:b().int().nonnegative(),rejected:w({belowFloor:b().int().nonnegative(),length:b().int().nonnegative(),navigational:b().int().nonnegative(),duplicate:b().int().nonnegative(),offAnchor:b().int().nonnegative(),semanticDuplicate:b().int().nonnegative()})});w({sessionId:p(),projectId:p(),provider:p(),status:wc,minProbeHits:b().int().positive(),anchorApplied:oe(),semanticNoveltyApplied:oe(),candidates:A(XE),stats:JE});const cp=ie(["own","direct-competitor","ota-aggregator","editorial-media","other"]);cp.enum;const z0=ie(["7d","30d","90d","all"]),Ab=ie(["improving","declining","stable"]),FE=ie(["mentioned","cited"]);FE.enum;const Cf=w({citationRate:b(),cited:b().int(),total:b().int(),mentionRate:b(),mentionedCount:b().int()}),WE=w({startDate:p(),endDate:p(),citationRate:b(),cited:b().int(),total:b().int(),queryCount:b().int(),mentionRate:b(),mentionedCount:b().int(),byProvider:lt(p(),Cf)}),eO=w({date:p(),delta:b().int(),label:p()});w({window:z0,buckets:A(WE),overall:Cf,byProvider:lt(p(),Cf),trend:Ab,mentionTrend:Ab,queryChanges:A(eO)});const _b=w({category:op,label:p(),count:b().int(),percentage:b(),topDomains:A(w({domain:p(),count:b().int()}))}),tO=w({domain:p(),count:b().int(),percentage:b(),category:op,label:p(),surfaceClass:cp}),nO=w({surfaceClass:cp,label:p(),count:b().int(),percentage:b(),domainCount:b().int()}),Cb=w({totalCitedSlots:b().int(),domainTotal:b().int(),entries:A(tO),truncatedDomainCount:b().int(),truncatedCitedSlots:b().int(),bySurfaceClass:A(nO)});w({overall:A(_b),byQuery:lt(p(),A(_b)),ranked:Cb,byProvider:lt(p(),Cb),runId:p(),window:z0,limit:b().int().nullable()});const up=w({total:b().int(),checked:b().int(),mentioned:b().int(),cited:b().int(),mentionRate:b().nullable(),citedRate:b().nullable()}),T0=up.extend({provider:p(),firstObserved:p(),lastObserved:p()}),aO=up.extend({queryId:p().nullable(),query:p(),firstObserved:p(),lastObserved:p(),providers:A(T0).optional()}),iO=w({since:p().nullable(),until:p().nullable(),lastRuns:b().int().nullable(),runCount:b().int()}),sO=ie(["provider"]);w({project:p(),groupBy:sO.optional(),window:iO,totals:up,byProvider:A(T0).optional(),queries:A(aO)});w({id:p(),projectId:p(),propertyId:p(),clientEmail:p(),connected:oe(),createdAt:p(),updatedAt:p()});w({date:p(),landingPage:p(),sessions:b(),organicSessions:b(),users:b()});const dp=ie(["session","first_user","manual_utm"]),rO=w({source:p(),medium:p(),sessions:b(),users:b(),sourceDimension:dp}),oO=w({source:p(),medium:p(),sourceDimension:dp,landingPage:p(),sessions:b(),users:b()}),lO=w({source:p(),medium:p(),sessions:b(),users:b(),channelGroup:p()}),Fr=w({sessions:b(),sharePct:b(),sharePctDisplay:p()}),cO=w({organic:Fr,social:Fr,direct:Fr,ai:Fr,other:Fr});w({totalSessions:b(),totalOrganicSessions:b(),totalDirectSessions:b(),totalUsers:b(),topPages:A(w({landingPage:p(),sessions:b(),organicSessions:b(),directSessions:b(),users:b()})),aiReferrals:A(rO),aiReferralLandingPages:A(oO),aiSessionsDeduped:b(),aiUsersDeduped:b(),aiSessionsBySession:b(),aiUsersBySession:b(),socialReferrals:A(lO),socialSessions:b(),socialUsers:b(),channelBreakdown:cO,organicSharePct:b(),aiSharePct:b(),aiSharePctBySession:b(),directSharePct:b(),socialSharePct:b(),organicSharePctDisplay:p(),aiSharePctDisplay:p(),aiSharePctBySessionDisplay:p(),directSharePctDisplay:p(),socialSharePctDisplay:p(),otherSessions:b(),otherSharePct:b(),otherSharePctDisplay:p(),lastSyncedAt:p().nullable()});w({connected:oe(),propertyId:p().nullable(),clientEmail:p().nullable(),authMethod:ie(["service-account","oauth"]).nullable(),lastSyncedAt:p().nullable(),createdAt:p().nullable().optional(),updatedAt:p().nullable().optional()});w({synced:oe(),rowCount:b().int().nonnegative(),aiReferralCount:b().int().nonnegative(),socialReferralCount:b().int().nonnegative(),days:b().int().nonnegative(),syncedAt:p(),syncedComponents:A(p()).optional()});w({date:p(),source:p(),medium:p(),landingPage:p(),sessions:b(),users:b(),sourceDimension:dp});w({date:p(),source:p(),medium:p(),sessions:b(),users:b(),channelGroup:p()});w({date:p(),sessions:b(),organicSessions:b(),users:b()});function dc(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const E0=ie(["claude","openai","gemini","zai"]),uO=w({id:E0,label:p(),defaultModel:p(),configured:oe(),keySource:ie(["config","env"]).nullable()});w({providers:A(uO).default([]),defaultProvider:E0.nullable()});const dO=ie(["aero","user","compaction"]);dO.enum;const O0=128;w({key:p().min(1).max(O0),value:p().min(1)});w({key:p().min(1).max(O0)});const Xs=ie(["commoncrawl","bing-webmaster"]);Xs.enum;const fp=ie(["queued","downloading","querying","ready","failed"]);fp.enum;w({id:p(),release:p(),status:fp,phaseDetail:p().nullable().optional(),vertexPath:p().nullable().optional(),edgesPath:p().nullable().optional(),vertexSha256:p().nullable().optional(),edgesSha256:p().nullable().optional(),vertexBytes:b().int().nullable().optional(),edgesBytes:b().int().nullable().optional(),projectsProcessed:b().int().nullable().optional(),domainsDiscovered:b().int().nullable().optional(),downloadStartedAt:p().nullable().optional(),downloadFinishedAt:p().nullable().optional(),queryStartedAt:p().nullable().optional(),queryFinishedAt:p().nullable().optional(),error:p().nullable().optional(),createdAt:p(),updatedAt:p()});const fO=w({linkingDomain:p(),numHosts:b().int(),source:Xs}),pO=w({projectId:p(),release:p(),targetDomain:p(),totalLinkingDomains:b().int(),totalHosts:b().int(),top10HostsShare:p(),queriedAt:p(),source:Xs,excludedLinkingDomains:b().int().optional(),excludedHosts:b().int().optional()});w({source:Xs,summary:pO.nullable(),total:b().int(),rows:A(fO)});w({release:p(),totalLinkingDomains:b().int(),totalHosts:b().int(),top10HostsShare:p(),queriedAt:p(),source:Xs});const mO=w({source:Xs,connected:oe(),hasData:oe(),latestRelease:p().nullable(),totalLinkingDomains:b().int(),lastSyncedAt:p().nullable()});w({projectId:p(),targetDomain:p(),sources:A(mO),anyConnected:oe(),anyData:oe()});w({duckdbInstalled:oe(),duckdbVersion:p().nullable().optional(),duckdbSpec:p(),pluginDir:p()});w({installed:oe(),version:p(),path:p(),alreadyPresent:oe()});w({release:p(),vertexUrl:p(),edgesUrl:p(),vertexBytes:b().int().nullable(),edgesBytes:b().int().nullable(),lastModified:p().nullable()});w({release:p(),syncStatus:fp.nullable(),bytes:b().int(),lastUsedAt:p().nullable()});const pp=ie(["positive","caution","negative","neutral"]),Qa=w({label:p(),value:p(),delta:p(),tone:pp,description:p(),tooltip:p().optional(),trend:A(b()),progress:b().optional(),providerCoverage:p().optional()}),hO=Qa.extend({breakdown:w({projectMentionSnapshots:b().int().nonnegative(),competitorMentionSnapshots:b().int().nonnegative(),perCompetitor:A(w({domain:p(),mentionSnapshots:b().int().nonnegative(),shareOfCompetitiveTotal:b()})),snapshotsWithAnswerText:b().int().nonnegative(),snapshotsTotal:b().int().nonnegative()})}),of=w({gained:b().int().nonnegative(),lost:b().int().nonnegative(),tone:pp,hasPreviousRun:oe(),gainedQueries:A(p()).optional(),lostQueries:A(p()).optional()}),gO=w({hasPreviousRun:oe(),comparable:oe(),querySetChanged:oe(),previousRunAt:p().nullable(),currentQueryCount:b().int().nonnegative(),previousQueryCount:b().int().nonnegative(),comparableQueryCount:b().int().nonnegative(),addedQueryCount:b().int().nonnegative(),removedQueryCount:b().int().nonnegative(),addedQueries:A(p()),removedQueries:A(p())}),yO=w({id:p(),projectId:p(),runId:p().nullable(),type:ie(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost","gbp-lodging-gap","gbp-listing-discrepancy","gbp-cta-gap","gbp-description-missing","gbp-metric-drop","gbp-keyword-drop"]),severity:ie(["critical","high","medium","low"]),title:p(),query:p(),provider:p(),recommendation:w({action:p(),target:p().optional(),reason:p()}).optional(),cause:w({cause:p(),competitorDomain:p().optional(),details:p().optional()}).optional(),dismissed:oe(),createdAt:p()}),bO=w({id:p(),projectId:p(),runId:p().nullable(),overallCitedRate:b(),overallMentionRate:b(),totalPairs:b().int().nonnegative(),citedPairs:b().int().nonnegative(),mentionedPairs:b().int().nonnegative(),providerBreakdown:lt(p(),w({citedRate:b(),mentionRate:b(),cited:b().int().nonnegative(),mentioned:b().int().nonnegative(),total:b().int().nonnegative()})),createdAt:p(),status:ie(["ready","no-data"]),reason:qt("no-runs-yet").optional()});w({project:LT,latestRun:OE,health:bO.nullable(),topInsights:A(yO),queryCounts:w({totalQueries:b().int().nonnegative(),citedQueries:b().int().nonnegative(),notCitedQueries:b().int().nonnegative(),citedRate:b(),mentionedQueries:b().int().nonnegative(),notMentionedQueries:b().int().nonnegative(),mentionRate:b()}),providers:A(w({provider:p(),citedRate:b(),cited:b().int().nonnegative(),total:b().int().nonnegative()})),transitions:w({since:p().nullable(),gained:b().int().nonnegative(),lost:b().int().nonnegative(),emerging:b().int().nonnegative()}),scores:w({mention:Qa,visibility:Qa,mentionShare:hO,gapQueries:Qa,mentionGaps:Qa,indexCoverage:Qa,competitorPressure:Qa,runStatus:Qa}),movementSummary:of,citationMovement:of,mentionMovement:of,movementComparison:gO,competitors:A(w({id:p(),domain:p(),citationCount:b().int().nonnegative(),totalQueries:b().int().nonnegative(),pressureLabel:ie(["None","Low","Moderate","High"]),citedQueries:A(p())})),providerScores:A(w({provider:p(),model:p().nullable(),score:b(),cited:b().int().nonnegative(),total:b().int().nonnegative(),trend:A(b()).optional()})),attentionItems:A(w({id:p(),tone:pp,title:p(),detail:p(),actionLabel:p(),href:p()})),runHistory:A(w({runId:p(),createdAt:p(),citedCount:b().int().nonnegative(),totalCount:b().int().nonnegative(),citationRate:b(),mentionedCount:b().int().nonnegative(),mentionRate:b(),status:p()})),suggestedQueries:w({rows:A(w({query:p(),impressions:b(),clicks:b(),avgPosition:b(),reason:p()})),totalCandidates:b().int().nonnegative(),skippedAlreadyTracked:b().int().nonnegative()}),dateRangeLabel:p(),contextLabel:p()});ie(["snapshot","insight"]);const vO=w({kind:qt("snapshot"),id:p(),runId:p(),query:p(),provider:p(),model:p().nullable(),citationState:Ai,matchedField:ie(["answerText","citedDomains","searchQueries","query"]),snippet:p(),createdAt:p()}),SO=w({kind:qt("insight"),id:p(),runId:p().nullable(),type:ie(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost","gbp-lodging-gap","gbp-listing-discrepancy","gbp-cta-gap","gbp-description-missing","gbp-metric-drop","gbp-keyword-drop"]),severity:ie(["critical","high","medium","low"]),title:p(),query:p(),provider:p(),matchedField:ie(["title","query","recommendation","cause"]),snippet:p(),dismissed:oe(),createdAt:p()}),xO=p0("kind",[vO,SO]);w({query:p(),totalHits:b().int().nonnegative(),truncated:oe(),hits:A(xO)});const D0=ie(["create","expand","refresh","add-schema"]);D0.enum;function NL(e){switch(e){case"create":return"Create";case"expand":return"Expand";case"refresh":return"Refresh";case"add-schema":return"Add schema"}}const R0=ie(["gsc","competitor-evidence","both"]);R0.enum;const M0=ie(["high","medium","low"]);M0.enum;const wO=ie(["blog-post","comparison","listicle","how-to","guide","glossary"]);wO.enum;const B0=ie(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);B0.enum;const mp=ie(["ownable","ceded"]);mp.enum;const jO=w({url:p(),gscImpressions:b().nonnegative(),gscClicks:b().nonnegative(),gscAvgPosition:b().nonnegative().nullable(),organicSessions:b().nonnegative()}),NO=w({domain:p(),url:p(),title:p(),citationCount:b().int().nonnegative()}),kO=w({demand:b(),competitor:b(),absence:b(),gapSeverity:b()}),AO=w({actionId:p(),state:B0,lastUpdated:p()}),L0=w({targetRef:p(),query:p(),action:D0,ourBestPage:jO.nullable(),winningCompetitor:NO.nullable(),score:b(),scoreBreakdown:kO,drivers:A(p()),demandSource:R0,actionConfidence:M0,existingAction:AO.nullable(),winnabilityClass:mp,winnability:b().min(0).max(1).nullable()});w({targets:A(L0),contextMetrics:w({totalAiReferralSessions:b().int().nonnegative(),latestRunId:p(),runTimestamp:p()})});const _O=w({targetRef:p(),addressedUrl:p().nullable(),note:p().nullable(),dismissedAt:p()});w({dismissals:A(_O)});w({targetRef:p().min(1),addressedUrl:p().url().optional(),note:p().max(500).optional()});w({targetRef:p(),promptVersion:p(),provider:p(),model:p(),responseText:p(),costMillicents:b().int().nonnegative(),generatedAt:p()});w({provider:p().optional(),model:p().optional(),forceRefresh:oe().optional()});const CO=w({targetQuery:p().trim().min(1),winnabilityClass:mp,angle:p().trim().min(1),whyWinnable:p().trim().min(1),schemaHookup:p().trim().min(1),controllableSurfaceRationale:p().trim().min(1)});w({targetRef:p(),promptVersion:p(),provider:p(),model:p(),brief:CO,costMillicents:b().int().nonnegative(),generatedAt:p()});const zO=w({domain:p(),competitorType:xc,hits:b().int().nonnegative(),updatedAt:p()});w({classifications:A(zO)});const TO=w({uri:p(),title:p(),domain:p(),isOurDomain:oe(),isCompetitor:oe(),citationCount:b().int().nonnegative(),providers:A(ya)}),q0=w({query:p(),groundingSources:A(TO)});w({sources:A(q0),latestRunId:p()});const U0=w({query:p(),competitorDomains:A(p()),competitorCount:b().int().nonnegative(),missRate:b().min(0).max(1),lastSeenInRunId:p()});w({gaps:A(U0),latestRunId:p()});const $0=ie(["ok","warn","fail","skipped"]);$0.enum;const hp=ie(["global","project"]);hp.enum;const I0=ie(["auth","config","providers","integrations","database","schedules","agent"]);I0.enum;const EO=w({id:p(),category:I0,scope:hp,title:p(),status:$0,code:p().describe('Stable machine-readable code (e.g. "google.token.refresh-failed"). Use this for filtering and remediation logic.'),summary:p(),remediation:p().nullable().optional().describe('Operator-facing next step. Null when status is "ok" or no specific remediation applies.'),details:lt(p(),qn()).optional().describe("Structured context — principal email, redirect URI, missing scopes, etc. Stable per check id."),durationMs:b().int().nonnegative().describe("How long the check took to execute.")});w({scope:hp,project:p().nullable().describe('Project name when scope is "project", null otherwise.'),generatedAt:p().describe("ISO-8601 timestamp when this doctor run started."),durationMs:b().int().nonnegative(),summary:w({total:b().int().nonnegative(),ok:b().int().nonnegative(),warn:b().int().nonnegative(),fail:b().int().nonnegative(),skipped:b().int().nonnegative()}),checks:A(EO)});const OO=w({provider:p(),citationState:Ai,cited:oe(),mentioned:oe(),runId:p(),runCreatedAt:p()}),DO=w({queryId:p(),query:p(),providers:A(OO),citedCount:b().int().nonnegative(),mentionedCount:b().int().nonnegative(),totalProviders:b().int().nonnegative()}),RO=w({queryId:p(),query:p(),provider:p(),citingCompetitors:A(p()),runId:p(),runCreatedAt:p()}),MO=w({providersConfigured:b().int().nonnegative(),providersCiting:b().int().nonnegative(),providersMentioning:b().int().nonnegative(),totalQueries:b().int().nonnegative(),queriesCitedAndMentioned:b().int().nonnegative(),queriesCitedOnly:b().int().nonnegative(),queriesMentionedOnly:b().int().nonnegative(),queriesInvisible:b().int().nonnegative(),latestRunId:p().nullable(),latestRunAt:p().nullable()});w({summary:MO,byQuery:A(DO),competitorGaps:A(RO),status:ie(["ready","no-data"]),reason:ie(["no-runs-yet","no-queries"]).optional()});const BO=ie(["prompt","request-param","browser-geo","ignored"]),LO=w({label:p(),city:p(),region:p(),country:p(),otherConfiguredLabels:A(p())}),qO=w({provider:p(),treatment:BO,description:p()}),UO=w({generatedAt:p(),project:w({id:p(),name:p(),displayName:p(),canonicalDomain:p(),country:p(),language:p()}),location:LO.nullable(),providerLocationHandling:A(qO),periodStart:p().nullable(),periodEnd:p().nullable()}),$O=w({citationRate:b(),citedQueryCount:b(),totalQueryCount:b(),mentionRate:b(),mentionedQueryCount:b(),trend:ie(["up","down","flat","unknown"]),queryCount:b(),competitorCount:b(),providerCount:b(),gsc:w({clicks:b(),impressions:b(),ctr:b(),avgPosition:b(),periodStart:p(),periodEnd:p()}).nullable(),ga:w({sessions:b(),users:b(),periodStart:p(),periodEnd:p()}).nullable(),findings:A(w({title:p(),detail:p(),tone:ie(["positive","caution","negative","neutral"])}))}),IO=w({citationState:ie(["cited","not-cited","pending"]),answerMentioned:oe().nullable(),model:p().nullable()}),VO=w({queries:A(p()),providers:A(p()),matrix:A(A(IO.nullable())),providerRates:A(w({provider:p(),citedCount:b(),totalCount:b(),citationRate:b()}))}),PO=w({domain:p(),citationCount:b(),totalCount:b(),pressureLabel:ie(["High","Moderate","Low","None"]),citedQueries:A(p()),sharePct:b(),theirCitedPages:A(w({url:p(),citedFor:A(p())}))}),GO=w({projectCitationCount:b(),competitors:A(PO)}),HO=w({domain:p(),mentionCount:b(),totalCount:b(),pressureLabel:ie(["High","Moderate","Low","None"]),mentionedQueries:A(p()),sharePct:b()}),QO=w({projectMentionCount:b(),totalAnswerSnapshots:b(),competitors:A(HO)}),KO=w({category:p(),label:p(),count:b(),sharePct:b()}),ZO=w({categories:A(KO),topDomains:A(w({domain:p(),count:b(),isCompetitor:oe()}))}),YO=w({query:p(),clicks:b(),impressions:b(),ctr:b(),avgPosition:b(),category:ie(["brand","lead-gen","industry","other"])}),XO=w({periodStart:p(),periodEnd:p(),totalClicks:b(),totalImpressions:b(),ctr:b(),avgPosition:b(),topQueries:A(YO),categoryBreakdown:A(w({category:ie(["brand","lead-gen","industry","other"]),clicks:b(),impressions:b(),sharePct:b()})),trend:A(w({date:p(),clicks:b(),impressions:b()})),trackedButNoGsc:A(p()),gscButNotTracked:A(p())}),JO=w({totalSessions:b(),totalUsers:b(),totalOrganicSessions:b(),periodStart:p(),periodEnd:p(),topLandingPages:A(w({page:p(),sessions:b(),users:b(),organicSessions:b()})),channelBreakdown:A(w({channel:p(),sessions:b(),sharePct:b()}))}),FO=w({totalSessions:b(),organicSessions:b(),paidSessions:b(),channels:A(w({channelGroup:p(),sessions:b(),sharePct:b()})),topCampaigns:A(w({source:p(),medium:p(),sessions:b()}))}),WO=w({totalSessions:b(),totalUsers:b(),bySource:A(w({source:p(),sessions:b(),users:b(),sharePct:b()})),trend:A(w({date:p(),sessions:b()})),topLandingPages:A(w({page:p(),sessions:b(),users:b()}))}),e4=w({windowStart:p(),windowEnd:p(),hasData:oe(),verifiedCrawlerHits:w({current:b(),prior:b(),deltaPct:b().nullable()}),unverifiedCrawlerHits:w({current:b(),prior:b(),deltaPct:b().nullable()}),aiUserFetchHits:w({current:b(),prior:b(),deltaPct:b().nullable()}),referralArrivals:w({current:b(),prior:b(),deltaPct:b().nullable()}),byOperator:A(w({operator:p(),verifiedHits:b(),unverifiedHits:b(),userFetchHits:b(),referralArrivals:b(),deltaPct:b().nullable()})),topCrawledPaths:A(w({path:p(),verifiedHits:b(),distinctOperators:b()})),referralProducts:A(w({product:p(),arrivals:b(),distinctLandingPaths:b()})),dailyTrend:A(w({date:p(),verifiedCrawlerHits:b(),userFetchHits:b(),referralArrivals:b()})),topReferralLandingPaths:A(w({path:p(),arrivals:b(),distinctProducts:b()}))}),t4=w({provider:ie(["google","bing"]).nullable(),total:b(),indexed:b(),notIndexed:b(),deindexed:b(),unknown:b(),indexedPct:b()}),n4=w({runId:p(),date:p(),citationRate:b(),citedQueryCount:b(),totalQueryCount:b(),mentionRate:b(),mentionedQueryCount:b(),providerRates:A(w({provider:p(),citationRate:b()}))}),zf=w({id:p(),type:ie(["regression","gain","opportunity"]),severity:ie(["critical","high","medium","low"]),title:p(),query:p(),provider:p(),recommendation:p().nullable(),createdAt:p(),instanceCount:b()}),a4=w({horizon:ie(["immediate","short-term","medium-term"]),title:p(),rationale:p()}),Wr=w({current:b(),prior:b(),deltaAbs:b(),direction:ie(["up","down","flat"]),window:b().optional()}),i4=w({provider:p(),current:b(),prior:b(),deltaAbs:b(),direction:ie(["up","down","flat"])}),s4=w({enoughHistory:oe(),headline:p(),citationRate:Wr.nullable(),mentionRate:Wr.nullable(),citedQueryCount:Wr.nullable(),gscClicksDelta:Wr.nullable(),aiReferralsDelta:Wr.nullable(),providerMovements:A(i4),wins:A(zf),regressions:A(zf)});ie(["agency","client"]);const r4=ie(["agency","client","both"]),o4=ie(["immediate","short-term","medium-term"]),l4=ie(["high","medium","low"]);ie(["positive","caution","negative","neutral"]);const c4=ie(["content","competitors","provider","search-demand","indexing","location","monitoring"]),gp=w({audience:r4,priority:b(),horizon:o4,category:c4,title:p(),action:p(),why:A(p()),evidence:A(p()),successMetric:p(),confidence:l4,targetRef:p().optional()}),u4=w({headline:p(),overview:p(),actionItems:A(gp),confidenceNotes:A(p())}),d4=w({title:p(),detail:p(),severity:ie(["positive","caution","negative","neutral"]),evidence:A(p())}),f4=w({priorities:A(gp),diagnostics:A(d4)});function kL(e){return e.horizon==="immediate"?"negative":e.confidence==="high"?"caution":e.confidence==="low"?"neutral":"caution"}function AL(e){switch(e){case"critical":return"Critical";case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}function _L(e){switch(e){case"immediate":return"Immediate";case"short-term":return"Short term";case"medium-term":return"Medium term"}}function CL(e){switch(e){case"content":return"Content";case"competitors":return"Competitors";case"provider":return"Provider";case"search-demand":return"Search demand";case"indexing":return"Indexing";case"location":return"Location";case"monitoring":return"Monitoring"}}function zL(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}w({meta:UO,executiveSummary:$O,citationScorecard:VO,competitorLandscape:GO,mentionLandscape:QO,aiSourceOrigin:ZO,gsc:XO.nullable(),ga:JO.nullable(),socialReferrals:FO.nullable(),aiReferrals:WO.nullable(),serverActivity:e4.nullable(),indexingHealth:t4.nullable(),citationsTrend:A(n4),whatsChanged:s4,insights:A(zf),recommendedNextSteps:A(a4),actionPlan:A(gp),clientSummary:u4,agencyDiagnostics:f4,contentOpportunities:A(L0),contentGaps:A(U0),groundingSources:A(q0)});const p4=ie(["claude","codex"]);p4.enum;const m4=ie(["claude","codex","all"]);m4.enum;const V0=w({content:b().int().nonnegative(),sitemap:b().int().nonnegative(),robots:b().int().nonnegative(),asset:b().int().nonnegative(),other:b().int().nonnegative()}),h4=ie(["content","sitemap","robots","asset","other"]),yp=ie(["cloud-run","wordpress","cloudflare","vercel","generic-log"]);yp.enum;const g4=ie(["raw-request-events","aggregate-request-metrics","request-url","status-code","user-agent","remote-ip","referer","cursor-pull"]);g4.enum;const y4=ie(["raw-request","aggregate-bucket"]),b4=y4.enum,v4=ie(["observed","provider-aggregated","inferred"]),S4=v4.enum,x4=w({type:p().nullable(),labels:lt(p(),p())}),w4=w({sourceType:yp,evidenceKind:qt(b4["raw-request"]),confidence:qt(S4.observed),eventId:p().min(1),observedAt:p().min(1),method:p().nullable(),requestUrl:p().nullable(),host:p().nullable(),path:p().min(1),queryString:p().nullable(),status:b().int().nullable(),userAgent:p().nullable(),remoteIp:p().nullable(),referer:p().nullable(),latencyMs:b().nullable(),requestSizeBytes:b().int().nullable(),responseSizeBytes:b().int().nullable(),providerResource:x4,providerLabels:lt(p(),p())});w({events:A(w4),rawEntryCount:b().int().nonnegative(),skippedEntryCount:b().int().nonnegative(),nextPageToken:p().optional(),filter:p()});const P0=ie(["connected","paused","error","archived"]),TL=P0.enum,G0=ie(["oauth","service-account"]);G0.enum;const j4=ie(["verified","claimed_unverified","unknown_ai_like"]),EL=j4.enum;w({gcpProjectId:p().min(1),serviceName:p().nullable().optional(),location:p().nullable().optional(),authMode:G0});w({baseUrl:p().url(),username:p().min(1)});const bp=ie(["production","preview"]);bp.enum;w({projectId:p().min(1),teamId:p().min(1),environment:bp});const H0=w({id:p(),projectId:p(),sourceType:yp,displayName:p(),status:P0,lastSyncedAt:p().nullable(),lastCursor:p().nullable(),lastError:p().nullable(),archivedAt:p().nullable(),config:lt(p(),qn()),createdAt:p(),updatedAt:p()});w({gcpProjectId:p().min(1),serviceName:p().min(1).optional(),location:p().min(1).optional(),displayName:p().min(1).optional(),keyJson:p().optional()});w({baseUrl:p().url(),username:p().min(1),applicationPassword:p().min(1),displayName:p().min(1).optional()});w({projectId:p().min(1),teamId:p().min(1),token:p().min(1),environment:bp.optional(),displayName:p().min(1).optional()});w({sourceId:p(),runId:p(),syncedAt:p(),pulledEvents:b().int().nonnegative(),selfTrafficExcluded:b().int().nonnegative(),crawlerHits:b().int().nonnegative(),aiUserFetchHits:b().int().nonnegative(),aiReferralHits:b().int().nonnegative(),unknownHits:b().int().nonnegative(),crawlerBucketRows:b().int().nonnegative(),aiUserFetchBucketRows:b().int().nonnegative(),aiReferralBucketRows:b().int().nonnegative(),sampleRows:b().int().nonnegative(),windowStart:p(),windowEnd:p()});w({days:b().int().positive().optional()});w({advanceToNow:qt(!0)});w({sourceId:p(),runId:p(),status:Ys,windowStart:p(),windowEnd:p(),daysRequested:b().int().positive(),daysApplied:b().int().positive()});const N4=w({crawlerHits:b().int().nonnegative(),crawlerContentHits:b().int().nonnegative(),crawlerInfraHits:b().int().nonnegative(),crawlerSegments:V0,aiUserFetchHits:b().int().nonnegative(),aiReferralHits:b().int().nonnegative(),sampleCount:b().int().nonnegative()});w({sources:A(H0)});const k4=H0.extend({totals24h:N4,latestRun:w({runId:p(),status:Ys,startedAt:p().nullable(),finishedAt:p().nullable(),error:p().nullable()}).nullable()});w({sources:A(k4)});const A4=ie(["crawler","ai-user-fetch","ai-referral"]),vp=A4.enum,_4=w({kind:qt(vp.crawler),sourceId:p(),tsHour:p(),botId:p(),operator:p(),verificationStatus:p(),pathNormalized:p(),pathClass:h4,status:b().int(),hits:b().int().nonnegative()}),C4=w({kind:qt(vp["ai-user-fetch"]),sourceId:p(),tsHour:p(),botId:p(),operator:p(),verificationStatus:p(),pathNormalized:p(),status:b().int(),hits:b().int().nonnegative()}),z4=w({kind:qt(vp["ai-referral"]),sourceId:p(),tsHour:p(),product:p(),operator:p(),sourceDomain:p(),evidenceType:p(),landingPathNormalized:p(),status:b().int(),hits:b().int().nonnegative()}),T4=p0("kind",[_4,C4,z4]);w({windowStart:p(),windowEnd:p(),totals:w({crawlerHits:b().int().nonnegative(),crawlerContentHits:b().int().nonnegative(),crawlerInfraHits:b().int().nonnegative(),crawlerSegments:V0,aiUserFetchHits:b().int().nonnegative(),aiReferralHits:b().int().nonnegative()}),events:A(T4)});w({apiKey:p().min(1)});w({connected:oe(),adAccountId:p().nullable().optional(),displayName:p().nullable().optional(),currencyCode:p().nullable().optional(),timezone:p().nullable().optional(),status:p().nullable().optional(),lastSyncedAt:p().nullable().optional()});w({disconnected:oe()});w({runId:p(),status:p()});const E4=w({type:p().nullable().optional(),title:p().nullable().optional(),body:p().nullable().optional(),targetUrl:p().nullable().optional()}),O4=w({id:p(),adGroupId:p(),name:p(),status:p(),reviewStatus:p().nullable().optional(),creative:E4.nullable().optional()}),D4=w({id:p(),campaignId:p(),name:p(),status:p(),billingEventType:p().nullable().optional(),maxBidMicros:b().int().nullable().optional(),contextHints:A(p()).default([]),ads:A(O4).default([])}),R4=w({id:p(),name:p(),status:p(),biddingType:p().nullable().optional(),dailySpendLimitMicros:b().int().nullable().optional(),lifetimeSpendLimitMicros:b().int().nullable().optional(),adGroups:A(D4).default([])});w({campaigns:A(R4)});const Q0=ie(["campaign","ad_group"]);Q0.enum;const M4=w({level:Q0,entityId:p(),date:p(),impressions:b().int(),clicks:b().int(),spendMicros:b().int(),ctr:b().nullable(),cpcMicros:b().int().nullable()});w({rows:A(M4),currencyCode:p().nullable().optional()});const B4=w({impressions:b().int(),clicks:b().int(),spendMicros:b().int(),ctr:b().nullable(),cpcMicros:b().int().nullable()});w({connected:oe(),displayName:p().nullable().optional(),currencyCode:p().nullable().optional(),lastSyncedAt:p().nullable().optional(),campaignCount:b().int(),adGroupCount:b().int(),adCount:b().int(),window:w({from:p().nullable(),to:p().nullable()}),totals:B4});var L4=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(L4||{});const OL={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},DL={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},RL=sp;function q4(e){const n=[];if(e.message&&n.push(e.message),e.providers)for(const[i,r]of Object.entries(e.providers)){const l=`[${i}] ${r.message}`;r.raw!==void 0?n.push(`${l}
53
53
 
54
54
  ${JSON.stringify(r.raw,null,2)}`):n.push(l)}return n.length>0?n.join(`
55
55
 
56
- `):"Run failed."}function M4(e){return e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function zL(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function TL(e){return e===null?"Unknown":e?"Pass":"Fail"}function Cb(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function EL(e,n){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${n}`:`daily@${n}`}function OL(e,n){if(!e)return{freq:"custom",hour:6,customCron:n};if(e==="twice-daily")return{freq:"twice-daily",hour:6,customCron:""};const i=e.match(/^daily(?:@(\d+))?$/);if(i)return{freq:"daily",hour:i[1]?parseInt(i[1]):6,customCron:""};const r=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return r?{freq:r[1],hour:r[2]?parseInt(r[2]):6,customCron:""}:{freq:"custom",hour:6,customCron:n}}function DL(e,n,i){const r=i==="UTC"?"UTC":i.split("/").pop()?.replace(/_/g," ")??i;if(!e)return`Custom: ${n} · ${r}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${r}`;const l=e.match(/^daily(?:@(\d+))?$/);if(l){const d=l[1]?parseInt(l[1]):6;return`Every day at ${Cb(d)} · ${r}`}const c=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(c){const d={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},h=c[2]?parseInt(c[2]):6;return`Every ${d[c[1]]} at ${Cb(h)} · ${r}`}return`${e} · ${r}`}function B4(e,n){return n&&n!==e?`${e} · ${n}`:e}function RL(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Intl.DateTimeFormat("en-US",{timeZoneName:"short"}).formatToParts().find(i=>i.type==="timeZoneName")?.value;return B4(e,n)}function L4(e){const n=e.replace(/\/+$/,"")||"/";return n==="/"?"overview":n==="/projects"?"projects":n.startsWith("/projects/")?"project":n==="/runs"?"runs":n==="/traffic"||n.startsWith("/traffic/")?"traffic":n==="/backlinks"?"backlinks":n==="/settings"?"settings":n==="/setup"?"setup":"other"}const q4={bg:"--canonry-embed-bg",fg:"--canonry-embed-fg"},U4=/^(?:#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|rgba?\([0-9.,%\s/]+\)|hsla?\([0-9.,%\s/a-z]+\))$/i;function $4(e){if(!e)return{};const n={};for(const[i,r]of Object.entries(e)){const l=q4[i];if(!l||typeof r!="string")continue;const c=r.trim();U4.test(c)&&(n[l]=c)}return n}const Te=(e,n,i,r)=>{const l={_id:e,baseUrl:n?.baseUrl||(n?.client??K).getConfig().baseUrl};return n?.body&&(l.body=n.body),n?.headers&&(l.headers=n.headers),n?.path&&(l.path=n.path),n?.query&&(l.query=n.query),[l]},I4=e=>Te("getApiV1ProjectsByName",e),V4=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await jv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:I4(e)}),Js=e=>Te("getApiV1Projects",e),vp=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await oj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Js(e)}),Sp=e=>Te("getApiV1Runs",e),xp=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await wj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Sp(e)}),P4=e=>Te("getApiV1RunsById",e),K0=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Nv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:P4(e)}),G4=e=>Te("getApiV1Settings",e),H4=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await kv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:G4(e)}),Q4=e=>Te("getApiV1ProjectsByNameGoogleConnections",e),ML=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Uj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Q4(e)}),K4=e=>Te("getApiV1ProjectsByNameGoogleProperties",e),BL=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Vj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:K4(e)}),Z4=e=>Te("getApiV1ProjectsByNameGoogleGscPerformance",e),LL=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Qj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Z4(e)}),Y4=e=>Te("getApiV1ProjectsByNameGoogleGscPerformanceDaily",e),qL=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Kj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Y4(e)}),X4=e=>Te("getApiV1ProjectsByNameGoogleGscInspections",e),UL=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Yj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:X4(e)}),J4=e=>Te("getApiV1ProjectsByNameGoogleGscDeindexed",e),$L=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Xj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:J4(e)}),F4=e=>Te("getApiV1ProjectsByNameGoogleGscCoverage",e),IL=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Av({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:F4(e)}),W4=e=>Te("getApiV1ProjectsByNameGoogleGscCoverageHistory",e),VL=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Jj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:W4(e)}),PL=e=>Te("getApiV1ProjectsByNameGoogleGscSitemaps",e),eD=e=>Te("getApiV1ProjectsByNameGbpLocations",e),GL=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await nN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:eD(e)}),HL=e=>({mutationFn:async i=>{const{data:r}=await aN({...e,...i,throwOnError:!0});return r}}),QL=e=>({mutationFn:async i=>{const{data:r}=await iN({...e,...i,throwOnError:!0});return r}}),tD=e=>Te("getApiV1ProjectsByNameGbpKeywords",e),KL=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await sN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:tD(e)}),nD=e=>Te("getApiV1ProjectsByNameGbpPlaces",e),ZL=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await rN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:nD(e)}),aD=e=>Te("getApiV1ProjectsByNameGbpSummary",e),YL=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await oN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:aD(e)}),iD=e=>Te("getApiV1ProjectsByNameBingStatus",e),XL=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await uN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:iD(e)}),sD=e=>Te("getApiV1ProjectsByNameBingSites",e),JL=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await dN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:sD(e)}),rD=e=>Te("getApiV1ProjectsByNameBingCoverage",e),FL=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await _v({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:rD(e)}),oD=e=>Te("getApiV1ProjectsByNameBingInspections",e),WL=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await pN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:oD(e)}),lD=e=>Te("getApiV1ProjectsByNameBingPerformance",e),e6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await yN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:lD(e)}),cD=e=>Te("getApiV1ProjectsByNameGaStatus",e),t6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await SN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:cD(e)}),uD=e=>Te("getApiV1ProjectsByNameGaTraffic",e),n6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await wN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:uD(e)}),dD=e=>Te("getApiV1ProjectsByNameGaAiReferralHistory",e),a6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await jN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:dD(e)}),fD=e=>Te("getApiV1ProjectsByNameGaSocialReferralHistory",e),i6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await NN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:fD(e)}),pD=e=>Te("getApiV1ProjectsByNameGaSessionHistory",e),s6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await kN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:pD(e)}),mD=e=>Te("getApiV1ProjectsByNameReport",e),r6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await _N({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:mD(e)}),hD=e=>Te("getApiV1ProjectsByNameCitationsVisibility",e),o6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await CN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:hD(e)}),gD=e=>Te("getApiV1ProjectsByNameTrafficSources",e),l6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await XN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:gD(e)}),yD=e=>Te("getApiV1ProjectsByNameTrafficStatus",e),c6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await JN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:yD(e)}),bD=e=>Te("getApiV1ProjectsByNameTrafficSourcesById",e),u6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await FN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:bD(e)}),vD=e=>Te("getApiV1ProjectsByNameTrafficEvents",e),d6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await WN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:vD(e)}),SD=e=>Te("getApiV1ProjectsByNameDiscoverSessions",e),f6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await tk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:SD(e)}),xD=e=>Te("getApiV1ProjectsByNameDiscoverSessionsById",e),p6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await nk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:xD(e)}),wD=e=>Te("getApiV1ProjectsByNameDiscoverSessionsByIdPromote",e),m6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await ak({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:wD(e)}),jD=e=>Te("getApiV1ProjectsByNameTechnicalAeo",e),h6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await sk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:jD(e)}),ND=e=>Te("getApiV1ProjectsByNameTechnicalAeoPages",e),g6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await rk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:ND(e)}),kD=e=>Te("getApiV1ProjectsByNameTechnicalAeoTrend",e),y6=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await ok({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:kD(e)}),AD=e=>Te("getApiV1ProjectsByNameAgentProviders",e),_D=e=>Ee({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await ck({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:AD(e)});function zb(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function Z0(e){switch(e){case"completed":return"positive";case"partial":return"caution";case"failed":return"negative";case"cancelled":return"caution";case"queued":case"running":return"neutral";default:return"neutral"}}function b6(e){switch(e){case"cited":return"positive";case"emerging":return"caution";case"not-cited":return"caution";case"lost":return"negative";case"pending":return"neutral";default:return"neutral"}}function v6(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}const S6={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-400"};function CD(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function Is(e){const n=[e.detail,e.hint].filter(Boolean);return n.length>0?n.join(`
57
- `):void 0}function zD(e,n,i){return e.map(r=>{if(r.id==="api")return{...r,tone:zb(n.apiStatus),detail:n.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:n.apiStatus.detail};if(r.id==="worker")return{...r,tone:zb(n.workerStatus),detail:n.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:n.workerStatus.detail};const l=i.providerStatuses.filter(g=>g.state==="ready").length,c=i.providerStatuses.length,d=l>0,h=i.providerStatuses.filter(g=>g.state==="ready").map(g=>CD(g)).join(" · ");return{...r,label:"Providers",tone:d?"positive":"caution",detail:`${l} of ${c} configured`,meta:h||"None configured"}})}function TD(e,n){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(!n.providerStatuses.some(i=>i.state==="ready"))return"Launch is blocked until at least one provider is configured."}function ED(e,n,i){const r=TD(n,i),l=structuredClone(e);return l.healthChecks=l.healthChecks.map(c=>{if(c.id==="api")return{...c,detail:n.apiStatus.detail,state:n.apiStatus.state==="ok"?"ready":"attention"};if(c.id==="worker")return{...c,detail:n.workerStatus.detail,state:n.workerStatus.state==="ok"?"ready":"attention"};const d=i.providerStatuses.some(h=>h.state==="ready");return{...c,detail:d?"At least one provider configured.":"No providers configured.",state:d?"ready":"attention"}}),l.launchState.enabled=r===void 0,l.launchState.blockedReason=r,l.launchState.summary=r??"Queue a visibility sweep first, then follow with a site audit to explain movement.",l}const Y0="canonry.run-tracker",Tf=new Set;let Tb=!1,OD=0,jc={runs:{},batches:{}};function DD(){const e=_i();for(const n of Tf)n(e)}function RD(e){if(!e)return{runs:{},batches:{}};try{const n=JSON.parse(e);return{runs:n.runs??{},batches:n.batches??{}}}catch{return{runs:{},batches:{}}}}function MD(){typeof window>"u"||window.sessionStorage.setItem(Y0,JSON.stringify(jc))}function X0(){Tb||(Tb=!0,!(typeof window>"u")&&(jc=RD(window.sessionStorage.getItem(Y0))))}function Nc(e){jc=e,MD(),DD()}function _i(){return X0(),jc}function BD(e){return X0(),Tf.add(e),()=>{Tf.delete(e)}}function J0(e){const n=_i();Nc({...n,runs:{...n.runs,[e.id]:{runId:e.id,projectId:e.projectId,projectLabel:e.projectLabel,kind:e.kind,sourceAction:e.sourceAction,lastAnnouncedStatus:e.lastAnnouncedStatus??"queued",trackedAt:e.trackedAt??Date.now()}}})}function lf(e){const n=_i();if(!n.runs[e])return;const{[e]:i,...r}=n.runs;Nc({...n,runs:r})}function LD(e){const n=_i(),i=`batch_${Date.now()}_${++OD}`;return Nc({...n,batches:{...n.batches,[i]:{batchId:i,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),i}function qD(e){const n=_i();if(!n.batches[e])return;const{[e]:i,...r}=n.batches;Nc({...n,batches:r})}function UD(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}const $D=10*6e4;function ID(e,n,i,r){return e.filter(l=>!n.has(l.runId)&&i-(l.trackedAt??0)>=r)}function VD(e,n){let i=0,r=0,l=0,c=0,d=0;for(const h of e){const g=n[h]?.status;g==="completed"?i+=1:g==="partial"?r+=1:g==="failed"?l+=1:g==="cancelled"?c+=1:d+=1}return{completed:i,partial:r,failed:l,cancelled:c,pending:d,finished:d===0}}const Eb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ob=gv,F0=(e,n)=>i=>{var r;if(n?.variants==null)return Ob(e,i?.class,i?.className);const{variants:l,defaultVariants:c}=n,d=Object.keys(l).map(b=>{const S=i?.[b],x=c?.[b];if(S===null)return null;const N=Eb(S)||Eb(x);return l[b][N]}),h=i&&Object.entries(i).reduce((b,S)=>{let[x,N]=S;return N===void 0||(b[x]=N),b},{}),g=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((b,S)=>{let{class:x,className:N,..._}=S;return Object.entries(_).every(T=>{let[k,E]=T;return Array.isArray(E)?E.includes({...c,...h}[k]):{...c,...h}[k]===E})?[...b,x,N]:b},[]);return Ob(e,d,g,i?.class,i?.className)},PD=(e,n)=>{const i=new Array(e.length+n.length);for(let r=0;r<e.length;r++)i[r]=e[r];for(let r=0;r<n.length;r++)i[e.length+r]=n[r];return i},GD=(e,n)=>({classGroupId:e,validator:n}),W0=(e=new Map,n=null,i)=>({nextPart:e,validators:n,classGroupId:i}),fc="-",Db=[],HD="arbitrary..",QD=e=>{const n=ZD(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return KD(d);const h=d.split(fc),g=h[0]===""&&h.length>1?1:0;return eS(h,g,n)},getConflictingClassGroupIds:(d,h)=>{if(h){const g=r[d],b=i[d];return g?b?PD(b,g):g:b||Db}return i[d]||Db}}},eS=(e,n,i)=>{if(e.length-n===0)return i.classGroupId;const l=e[n],c=i.nextPart.get(l);if(c){const b=eS(e,n+1,c);if(b)return b}const d=i.validators;if(d===null)return;const h=n===0?e.join(fc):e.slice(n).join(fc),g=d.length;for(let b=0;b<g;b++){const S=d[b];if(S.validator(h))return S.classGroupId}},KD=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),i=n.indexOf(":"),r=n.slice(0,i);return r?HD+r:void 0})(),ZD=e=>{const{theme:n,classGroups:i}=e;return YD(i,n)},YD=(e,n)=>{const i=W0();for(const r in e){const l=e[r];wp(l,i,r,n)}return i},wp=(e,n,i,r)=>{const l=e.length;for(let c=0;c<l;c++){const d=e[c];XD(d,n,i,r)}},XD=(e,n,i,r)=>{if(typeof e=="string"){JD(e,n,i);return}if(typeof e=="function"){FD(e,n,i,r);return}WD(e,n,i,r)},JD=(e,n,i)=>{const r=e===""?n:tS(n,e);r.classGroupId=i},FD=(e,n,i,r)=>{if(e3(e)){wp(e(r),n,i,r);return}n.validators===null&&(n.validators=[]),n.validators.push(GD(i,e))},WD=(e,n,i,r)=>{const l=Object.entries(e),c=l.length;for(let d=0;d<c;d++){const[h,g]=l[d];wp(g,tS(n,h),i,r)}},tS=(e,n)=>{let i=e;const r=n.split(fc),l=r.length;for(let c=0;c<l;c++){const d=r[c];let h=i.nextPart.get(d);h||(h=W0(),i.nextPart.set(d,h)),i=h}return i},e3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,t3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,i=Object.create(null),r=Object.create(null);const l=(c,d)=>{i[c]=d,n++,n>e&&(n=0,r=i,i=Object.create(null))};return{get(c){let d=i[c];if(d!==void 0)return d;if((d=r[c])!==void 0)return l(c,d),d},set(c,d){c in i?i[c]=d:l(c,d)}}},Ef="!",Rb=":",n3=[],Mb=(e,n,i,r,l)=>({modifiers:e,hasImportantModifier:n,baseClassName:i,maybePostfixModifierPosition:r,isExternal:l}),a3=e=>{const{prefix:n,experimentalParseClassName:i}=e;let r=l=>{const c=[];let d=0,h=0,g=0,b;const S=l.length;for(let k=0;k<S;k++){const E=l[k];if(d===0&&h===0){if(E===Rb){c.push(l.slice(g,k)),g=k+1;continue}if(E==="/"){b=k;continue}}E==="["?d++:E==="]"?d--:E==="("?h++:E===")"&&h--}const x=c.length===0?l:l.slice(g);let N=x,_=!1;x.endsWith(Ef)?(N=x.slice(0,-1),_=!0):x.startsWith(Ef)&&(N=x.slice(1),_=!0);const T=b&&b>g?b-g:void 0;return Mb(c,_,N,T)};if(n){const l=n+Rb,c=r;r=d=>d.startsWith(l)?c(d.slice(l.length)):Mb(n3,!1,d,void 0,!0)}if(i){const l=r;r=c=>i({className:c,parseClassName:l})}return r},i3=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((i,r)=>{n.set(i,1e6+r)}),i=>{const r=[];let l=[];for(let c=0;c<i.length;c++){const d=i[c],h=d[0]==="[",g=n.has(d);h||g?(l.length>0&&(l.sort(),r.push(...l),l=[]),r.push(d)):l.push(d)}return l.length>0&&(l.sort(),r.push(...l)),r}},s3=e=>({cache:t3(e.cacheSize),parseClassName:a3(e),sortModifiers:i3(e),...QD(e)}),r3=/\s+/,o3=(e,n)=>{const{parseClassName:i,getClassGroupId:r,getConflictingClassGroupIds:l,sortModifiers:c}=n,d=[],h=e.trim().split(r3);let g="";for(let b=h.length-1;b>=0;b-=1){const S=h[b],{isExternal:x,modifiers:N,hasImportantModifier:_,baseClassName:T,maybePostfixModifierPosition:k}=i(S);if(x){g=S+(g.length>0?" "+g:g);continue}let E=!!k,R=r(E?T.substring(0,k):T);if(!R){if(!E){g=S+(g.length>0?" "+g:g);continue}if(R=r(T),!R){g=S+(g.length>0?" "+g:g);continue}E=!1}const V=N.length===0?"":N.length===1?N[0]:c(N).join(":"),G=_?V+Ef:V,Z=G+R;if(d.indexOf(Z)>-1)continue;d.push(Z);const X=l(R,E);for(let F=0;F<X.length;++F){const O=X[F];d.push(G+O)}g=S+(g.length>0?" "+g:g)}return g},l3=(...e)=>{let n=0,i,r,l="";for(;n<e.length;)(i=e[n++])&&(r=nS(i))&&(l&&(l+=" "),l+=r);return l},nS=e=>{if(typeof e=="string")return e;let n,i="";for(let r=0;r<e.length;r++)e[r]&&(n=nS(e[r]))&&(i&&(i+=" "),i+=n);return i},c3=(e,...n)=>{let i,r,l,c;const d=g=>{const b=n.reduce((S,x)=>x(S),e());return i=s3(b),r=i.cache.get,l=i.cache.set,c=h,h(g)},h=g=>{const b=r(g);if(b)return b;const S=o3(g,i);return l(g,S),S};return c=d,(...g)=>c(l3(...g))},u3=[],_t=e=>{const n=i=>i[e]||u3;return n.isThemeGetter=!0,n},aS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,iS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,d3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,f3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,p3=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,m3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,h3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,g3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ga=e=>d3.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),Ha=e=>!!e&&Number.isInteger(Number(e)),cf=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),ma=e=>f3.test(e),sS=()=>!0,y3=e=>p3.test(e)&&!m3.test(e),jp=()=>!1,b3=e=>h3.test(e),v3=e=>g3.test(e),S3=e=>!me(e)&&!he(e),x3=e=>ei(e,lS,jp),me=e=>aS.test(e),xi=e=>ei(e,cS,y3),Bb=e=>ei(e,z3,Oe),w3=e=>ei(e,dS,sS),j3=e=>ei(e,uS,jp),Lb=e=>ei(e,rS,jp),N3=e=>ei(e,oS,v3),Pl=e=>ei(e,fS,b3),he=e=>iS.test(e),eo=e=>Ei(e,cS),k3=e=>Ei(e,uS),qb=e=>Ei(e,rS),A3=e=>Ei(e,lS),_3=e=>Ei(e,oS),Gl=e=>Ei(e,fS,!0),C3=e=>Ei(e,dS,!0),ei=(e,n,i)=>{const r=aS.exec(e);return r?r[1]?n(r[1]):i(r[2]):!1},Ei=(e,n,i=!1)=>{const r=iS.exec(e);return r?r[1]?n(r[1]):i:!1},rS=e=>e==="position"||e==="percentage",oS=e=>e==="image"||e==="url",lS=e=>e==="length"||e==="size"||e==="bg-size",cS=e=>e==="length",z3=e=>e==="number",uS=e=>e==="family-name",dS=e=>e==="number"||e==="weight",fS=e=>e==="shadow",T3=()=>{const e=_t("color"),n=_t("font"),i=_t("text"),r=_t("font-weight"),l=_t("tracking"),c=_t("leading"),d=_t("breakpoint"),h=_t("container"),g=_t("spacing"),b=_t("radius"),S=_t("shadow"),x=_t("inset-shadow"),N=_t("text-shadow"),_=_t("drop-shadow"),T=_t("blur"),k=_t("perspective"),E=_t("aspect"),R=_t("ease"),V=_t("animate"),G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],X=()=>[...Z(),he,me],F=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],M=()=>[he,me,g],le=()=>[Ga,"full","auto",...M()],ke=()=>[Ha,"none","subgrid",he,me],_e=()=>["auto",{span:["full",Ha,he,me]},Ha,he,me],be=()=>[Ha,"auto",he,me],tt=()=>["auto","min","max","fr",he,me],Ke=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...M()],J=()=>[Ga,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],fe=()=>[Ga,"screen","full","dvw","lvw","svw","min","max","fit",...M()],Se=()=>[Ga,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],re=()=>[e,he,me],Ze=()=>[...Z(),qb,Lb,{position:[he,me]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ue=()=>["auto","cover","contain",A3,x3,{size:[he,me]}],te=()=>[cf,eo,xi],de=()=>["","none","full",b,he,me],ae=()=>["",Oe,eo,xi],je=()=>["solid","dashed","dotted","double"],nt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[Oe,cf,qb,Lb],Ue=()=>["","none",T,he,me],Ge=()=>["none",Oe,he,me],Et=()=>["none",Oe,he,me],zn=()=>[Oe,he,me],Ot=()=>[Ga,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ma],breakpoint:[ma],color:[sS],container:[ma],"drop-shadow":[ma],ease:["in","out","in-out"],font:[S3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ma],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ma],shadow:[ma],spacing:["px",Oe],text:[ma],"text-shadow":[ma],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ga,me,he,E]}],container:["container"],columns:[{columns:[Oe,me,he,h]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:X()}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:le()}],"inset-x":[{"inset-x":le()}],"inset-y":[{"inset-y":le()}],start:[{"inset-s":le(),start:le()}],end:[{"inset-e":le(),end:le()}],"inset-bs":[{"inset-bs":le()}],"inset-be":[{"inset-be":le()}],top:[{top:le()}],right:[{right:le()}],bottom:[{bottom:le()}],left:[{left:le()}],visibility:["visible","invisible","collapse"],z:[{z:[Ha,"auto",he,me]}],basis:[{basis:[Ga,"full","auto",h,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,Ga,"auto","initial","none",me]}],grow:[{grow:["",Oe,he,me]}],shrink:[{shrink:["",Oe,he,me]}],order:[{order:[Ha,"first","last","none",he,me]}],"grid-cols":[{"grid-cols":ke()}],"col-start-end":[{col:_e()}],"col-start":[{"col-start":be()}],"col-end":[{"col-end":be()}],"grid-rows":[{"grid-rows":ke()}],"row-start-end":[{row:_e()}],"row-start":[{"row-start":be()}],"row-end":[{"row-end":be()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":tt()}],"auto-rows":[{"auto-rows":tt()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...Ke(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...Ke()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ke()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],"inline-size":[{inline:["auto",...fe()]}],"min-inline-size":[{"min-inline":["auto",...fe()]}],"max-inline-size":[{"max-inline":["none",...fe()]}],"block-size":[{block:["auto",...Se()]}],"min-block-size":[{"min-block":["auto",...Se()]}],"max-block-size":[{"max-block":["none",...Se()]}],w:[{w:[h,"screen",...J()]}],"min-w":[{"min-w":[h,"screen","none",...J()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[d]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",i,eo,xi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,C3,w3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",cf,me]}],"font-family":[{font:[k3,j3,n]}],"font-features":[{"font-features":[me]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,he,me]}],"line-clamp":[{"line-clamp":[Oe,"none",he,Bb]}],leading:[{leading:[c,...M()]}],"list-image":[{"list-image":["none",he,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:re()}],"text-color":[{text:re()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...je(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",he,xi]}],"text-decoration-color":[{decoration:re()}],"underline-offset":[{"underline-offset":[Oe,"auto",he,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Ze()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ha,he,me],radial:["",he,me],conic:[Ha,he,me]},_3,N3]}],"bg-color":[{bg:re()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:re()}],"gradient-via":[{via:re()}],"gradient-to":[{to:re()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...je(),"hidden","none"]}],"divide-style":[{divide:[...je(),"hidden","none"]}],"border-color":[{border:re()}],"border-color-x":[{"border-x":re()}],"border-color-y":[{"border-y":re()}],"border-color-s":[{"border-s":re()}],"border-color-e":[{"border-e":re()}],"border-color-bs":[{"border-bs":re()}],"border-color-be":[{"border-be":re()}],"border-color-t":[{"border-t":re()}],"border-color-r":[{"border-r":re()}],"border-color-b":[{"border-b":re()}],"border-color-l":[{"border-l":re()}],"divide-color":[{divide:re()}],"outline-style":[{outline:[...je(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,he,me]}],"outline-w":[{outline:["",Oe,eo,xi]}],"outline-color":[{outline:re()}],shadow:[{shadow:["","none",S,Gl,Pl]}],"shadow-color":[{shadow:re()}],"inset-shadow":[{"inset-shadow":["none",x,Gl,Pl]}],"inset-shadow-color":[{"inset-shadow":re()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:re()}],"ring-offset-w":[{"ring-offset":[Oe,xi]}],"ring-offset-color":[{"ring-offset":re()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":re()}],"text-shadow":[{"text-shadow":["none",N,Gl,Pl]}],"text-shadow-color":[{"text-shadow":re()}],opacity:[{opacity:[Oe,he,me]}],"mix-blend":[{"mix-blend":[...nt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":nt()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":re()}],"mask-image-linear-to-color":[{"mask-linear-to":re()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":re()}],"mask-image-t-to-color":[{"mask-t-to":re()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":re()}],"mask-image-r-to-color":[{"mask-r-to":re()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":re()}],"mask-image-b-to-color":[{"mask-b-to":re()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":re()}],"mask-image-l-to-color":[{"mask-l-to":re()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":re()}],"mask-image-x-to-color":[{"mask-x-to":re()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":re()}],"mask-image-y-to-color":[{"mask-y-to":re()}],"mask-image-radial":[{"mask-radial":[he,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":re()}],"mask-image-radial-to-color":[{"mask-radial-to":re()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":Z()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":re()}],"mask-image-conic-to-color":[{"mask-conic-to":re()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ze()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,me]}],filter:[{filter:["","none",he,me]}],blur:[{blur:Ue()}],brightness:[{brightness:[Oe,he,me]}],contrast:[{contrast:[Oe,he,me]}],"drop-shadow":[{"drop-shadow":["","none",_,Gl,Pl]}],"drop-shadow-color":[{"drop-shadow":re()}],grayscale:[{grayscale:["",Oe,he,me]}],"hue-rotate":[{"hue-rotate":[Oe,he,me]}],invert:[{invert:["",Oe,he,me]}],saturate:[{saturate:[Oe,he,me]}],sepia:[{sepia:["",Oe,he,me]}],"backdrop-filter":[{"backdrop-filter":["","none",he,me]}],"backdrop-blur":[{"backdrop-blur":Ue()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,he,me]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,he,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,he,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,he,me]}],"backdrop-invert":[{"backdrop-invert":["",Oe,he,me]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,he,me]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,he,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,he,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",he,me]}],ease:[{ease:["linear","initial",R,he,me]}],delay:[{delay:[Oe,he,me]}],animate:[{animate:["none",V,he,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,he,me]}],"perspective-origin":[{"perspective-origin":X()}],rotate:[{rotate:Ge()}],"rotate-x":[{"rotate-x":Ge()}],"rotate-y":[{"rotate-y":Ge()}],"rotate-z":[{"rotate-z":Ge()}],scale:[{scale:Et()}],"scale-x":[{"scale-x":Et()}],"scale-y":[{"scale-y":Et()}],"scale-z":[{"scale-z":Et()}],"scale-3d":["scale-3d"],skew:[{skew:zn()}],"skew-x":[{"skew-x":zn()}],"skew-y":[{"skew-y":zn()}],transform:[{transform:[he,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:X()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ot()}],"translate-x":[{"translate-x":Ot()}],"translate-y":[{"translate-y":Ot()}],"translate-z":[{"translate-z":Ot()}],"translate-none":["translate-none"],accent:[{accent:re()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:re()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,me]}],fill:[{fill:["none",...re()]}],"stroke-w":[{stroke:[Oe,eo,xi,Bb]}],stroke:[{stroke:["none",...re()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},E3=c3(T3);function Cn(...e){return E3(gv(e))}const O3=F0("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-zinc-50 text-black hover:bg-zinc-200",secondary:"border border-zinc-800 bg-zinc-950 text-zinc-100 hover:bg-zinc-900",ghost:"text-zinc-400 hover:bg-zinc-900 hover:text-zinc-50",outline:"border border-zinc-800 bg-transparent text-zinc-100 hover:bg-zinc-900",destructive:"bg-rose-600 text-white hover:bg-rose-700"},size:{default:"h-10 px-4 md:h-9",sm:"h-9 px-3 text-xs md:h-8",icon:"size-10 md:size-9"}},defaultVariants:{variant:"default",size:"default"}}),qe=U.forwardRef(({className:e,variant:n,size:i,asChild:r=!1,...l},c)=>{const d=r?Mw:"button";return f.jsx(d,{ref:c,className:Cn(O3({variant:n,size:i,className:e})),...l})});qe.displayName="Button";const D3=F0("inline-flex items-center rounded-md border px-2 py-0.5 text-[11px] font-medium tracking-wide",{variants:{variant:{neutral:"border-zinc-800 bg-zinc-950 text-zinc-300",success:"border-emerald-500/25 bg-emerald-500/10 text-emerald-300",warning:"border-amber-500/25 bg-amber-500/10 text-amber-300",destructive:"border-rose-500/25 bg-rose-500/10 text-rose-300"}},defaultVariants:{variant:"neutral"}});function pS({className:e,variant:n,...i}){return f.jsx("div",{className:Cn(D3({variant:n}),e),...i})}const R3=220;function Ub({compact:e=!1,version:n,updateAvailable:i,onDismissUpdate:r}){const l=!e&&n&&n!=="unknown",[c,d]=U.useState(!1),h=!e&&i&&r,g=()=>{d(!0),window.setTimeout(()=>{r?.(),d(!1)},R3)};return e?f.jsxs(rt,{to:"/",className:"brand-lockup brand-lockup-compact","aria-label":"Canonry home",children:[f.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),f.jsx("span",{className:"brand-copy",children:f.jsx("span",{className:"brand-mark",children:"Canonry"})})]}):f.jsxs("div",{className:"brand-lockup brand-lockup-wrapper",children:[f.jsx(rt,{to:"/",className:"brand-icon-link","aria-label":"Canonry home",tabIndex:-1,children:f.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"})}),f.jsxs("div",{className:"brand-copy",children:[f.jsx(rt,{to:"/",className:"brand-mark",children:"Canonry"}),h?f.jsxs("span",{className:`brand-update-bubble ${c?"brand-update-bubble-closing":""}`,role:"status","aria-live":"polite",children:[f.jsxs("a",{className:"brand-update-bubble-link",href:i.url,target:"_blank",rel:"noopener noreferrer",title:`Open release: ${i.upgradeCommand}`,"aria-label":`New version v${i.latest} available — open release page`,children:[f.jsxs("span",{className:"brand-update-bubble-from",children:["v",i.current]}),f.jsx(sA,{className:"brand-update-bubble-arrow size-3","aria-hidden":"true"}),f.jsxs("span",{className:"brand-update-bubble-to",children:["v",i.latest]})]}),f.jsx("button",{type:"button",className:"brand-update-bubble-dismiss",onClick:g,"aria-label":`Dismiss update notification for v${i.latest}`,children:f.jsx(Qs,{className:"size-3","aria-hidden":"true"})})]}):l?f.jsxs("span",{className:"brand-version",children:["v",n]}):null]})]})}function M3({provider:e}){const n={gemini:"border-blue-800/50 bg-blue-950/40 text-blue-300",openai:"border-green-800/50 bg-green-950/40 text-green-300",claude:"border-amber-800/50 bg-amber-950/40 text-amber-300",perplexity:"border-teal-800/50 bg-teal-950/40 text-teal-300",local:"border-purple-800/50 bg-purple-950/40 text-purple-300"};return f.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ${n[e]??"border-zinc-700 bg-zinc-800 text-zinc-300"}`,children:e})}function Ln({tone:e,children:n,...i}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return f.jsx(pS,{variant:r,...i,children:n})}function Np({status:e}){return f.jsx(Ln,{tone:Z0(e),children:M4(e)})}const B3=hv,L3=fv,mS=U.forwardRef(({className:e,...n},i)=>f.jsx(Vf,{ref:i,className:Cn("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...n}));mS.displayName=Vf.displayName;const q3=400,U3=1200,$3=720,hS=U.forwardRef(({className:e,children:n,...i},r)=>{const[l,c]=U.useState($3),d=U.useRef(!1),h=U.useRef(0),g=U.useRef(0),b=U.useCallback(N=>{d.current=!0,h.current=N.clientX,g.current=l,N.target.setPointerCapture(N.pointerId),N.preventDefault()},[l]),S=U.useCallback(N=>{if(!d.current)return;const _=h.current-N.clientX,T=Math.min(U3,Math.max(q3,g.current+_));c(T)},[]),x=U.useCallback(()=>{d.current=!1},[]);return f.jsxs(L3,{children:[f.jsx(mS,{}),f.jsxs(Pf,{ref:r,className:Cn("fixed z-50 flex flex-col bg-zinc-950 px-5 py-4 shadow-2xl overflow-hidden","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88vh] max-md:rounded-t-2xl max-md:border-t","md:inset-y-0 md:right-0 md:h-full md:border-l","border-zinc-800",e),style:{width:`min(${l}px, 100vw)`},...i,children:[f.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-zinc-700/50 active:bg-zinc-600/50 transition-colors max-md:hidden",onPointerDown:b,onPointerMove:S,onPointerUp:x}),n,f.jsxs(pv,{className:"absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-900 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400",children:[f.jsx(Qs,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});hS.displayName=Pf.displayName;const I3=({className:e,...n})=>f.jsx("div",{className:Cn("flex flex-col gap-1.5 pr-10",e),...n}),gS=U.forwardRef(({className:e,...n},i)=>f.jsx(Gf,{ref:i,className:Cn("text-lg font-medium text-zinc-50",e),...n}));gS.displayName=Gf.displayName;const yS=U.forwardRef(({className:e,...n},i)=>f.jsx(mv,{ref:i,className:Cn("text-sm text-zinc-500",e),...n}));yS.displayName=mv.displayName;function V3({title:e,subtitle:n,children:i,open:r,onClose:l}){return f.jsx(B3,{open:r,onOpenChange:c=>c?void 0:l(),children:f.jsxs(hS,{children:[f.jsxs(I3,{className:"drawer-head",children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:n}),f.jsx(gS,{id:"drawer-title",children:e}),f.jsx(yS,{className:"sr-only",children:n})]}),f.jsx("div",{className:"drawer-body",children:i})]})})}function to({text:e}){const[n,i]=U.useState(null),r=U.useRef(null),l=U.useCallback(()=>{if(!r.current)return;const h=r.current.getBoundingClientRect();i({top:h.top,left:h.left+h.width/2})},[]),c=U.useCallback(()=>i(null),[]),d=U.useCallback(()=>{n===null?l():c()},[n,l,c]);return f.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:l,onMouseLeave:c,children:[f.jsx("button",{ref:r,type:"button",className:"info-tooltip-trigger","aria-label":e,"aria-expanded":n!==null,onFocus:l,onBlur:c,onClick:d,onKeyDown:h=>{h.key==="Escape"&&c()},children:f.jsxs("svg",{className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),n!==null&&_w.createPortal(f.jsx("span",{"aria-hidden":"true",style:{position:"fixed",top:n.top,left:n.left,transform:"translateX(-50%) translateY(calc(-100% - 8px))",zIndex:9999,pointerEvents:"none",width:"14rem",padding:"0.5rem 0.75rem",fontSize:"11px",fontWeight:400,textTransform:"none",letterSpacing:"normal",lineHeight:"1rem",color:"#d4d4d8",backgroundColor:"#18181b",border:"1px solid rgba(63, 63, 70, 0.6)",borderRadius:"0.5rem",boxShadow:"0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1)"},children:e}),document.body)]})}const P3=/[\s\-_]+/;function G3(e){const n=e.split(P3).filter(Boolean);return n.length===0?null:n.map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function $b(e,n){const i=H3(n),r=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(b=>b.startsWith("**")&&b.endsWith("**")?{type:"bold",value:b.slice(2,-2)}:{type:"text",value:b}),l=i.flatMap(b=>b.terms).filter(b=>b.trim().length>1);if(l.length===0)return r.map((b,S)=>b.type==="bold"?_s.createElement("strong",{key:`b-${S}`,className:"text-zinc-200 font-semibold"},b.value):b.value).filter(Boolean);const d=[...l].sort((b,S)=>S.length-b.length).map(G3).filter(b=>!!b);if(d.length===0)return r.map((b,S)=>b.type==="bold"?_s.createElement("strong",{key:`b-${S}`,className:"text-zinc-200 font-semibold"},b.value):b.value).filter(Boolean);const h=new RegExp(`(${d.join("|")})`,"gi"),g=new Map;for(const b of i)for(const S of b.terms){const x=dc(S);x&&!g.has(x)&&g.set(x,b.className)}return r.flatMap((b,S)=>b.value.split(h).map((N,_)=>{if(!N)return null;if(_%2===1){const k=g.get(dc(N))??"answer-highlight";return b.type==="bold"?_s.createElement("mark",{key:`hl-${S}-${_}`,className:k},_s.createElement("strong",{className:"text-zinc-200 font-semibold"},N)):_s.createElement("mark",{key:`hl-${S}-${_}`,className:k},N)}return b.type==="bold"?_s.createElement("strong",{key:`b-${S}-${_}`,className:"text-zinc-200 font-semibold"},N):N})).filter(Boolean)}function H3(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Of(e){const n=(e??"").trim();return n&&(n.startsWith("/")||/^https?:\/\//i.test(n)||/^mailto:/i.test(n))?n:null}function uf(e,n){switch(e){case"new":return"First observation";case"emerging":return"First mention";case"lost":return"Lost since last run";default:return n==="mentioned"||n==="visible"?"Mentioned in latest run":n==="pending"?"Awaiting first run":"Not mentioned in latest run"}}function Q3({evidence:e,project:n,onClose:i}){const[r,l]=U.useState(!1),[c,d]=U.useState("mentions"),[h,g]=U.useState(-1),[b,S]=U.useState(null),[x,N]=U.useState(!1),[_,T]=U.useState({}),k=UT(n.project),E=new Set(k.map(oc)),R=e.runHistory,V=R.length>1,[G,Z]=U.useState(null),X=U.useRef(!1);U.useEffect(()=>{if(X.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const te=R.at(-1);te&&(X.current=!0,nc(te.runId).then(de=>{const ae=de.snapshots?.find(je=>je.query===e.query&&je.provider===e.provider);ae&&Z({citationState:ae.citationState,answerMentioned:ae.answerMentioned,visibilityState:ae.visibilityState,visibilityTransition:te.visibilityTransition,provider:ae.provider,model:ae.model??e.model,answerSnippet:ae.answerText??e.answerSnippet,citedDomains:ae.citedDomains??e.citedDomains,competitorDomains:ae.competitorOverlap??e.competitorDomains,recommendedCompetitors:ae.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:ae.matchedTerms??e.matchedTerms??[],groundingSources:ae.groundingSources??e.groundingSources,searchQueries:ae.searchQueries,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,R]);const F=h>=0&&b!==null,O=F?b:G||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:R.at(-1)?.visibilityTransition,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,recommendedCompetitors:e.recommendedCompetitors??[],matchedTerms:e.matchedTerms??[],groundingSources:e.groundingSources,searchQueries:e.searchQueries??[],evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},M=O.visibilityState==="pending"||O.citationState==="pending",le=M?!1:O.visibilityState!=null?O.visibilityState==="visible":O.answerMentioned!=null?O.answerMentioned:O.citationState===lc.cited||O.citationState==="emerging",ke=O.answerMentioned!=null||O.visibilityState!=null||O.recommendedCompetitors.length>0,_e=O.citedDomains.length>0||O.groundingSources.length>0||O.evidenceUrls.length>0,be=n.project.displayName||n.project.name,tt=[...k.map(oc),be,be.split(" ").slice(0,2).join(" "),...O.matchedTerms].filter(te=>te.trim().length>2),Ke=[...O.competitorDomains.flatMap(te=>{const de=qT(te);return de.length>=4?[de]:[]}),...O.recommendedCompetitors].filter(te=>te.trim().length>2),ee=[{terms:tt,className:"answer-highlight-brand"},...Ke.length>0?[{terms:Ke,className:"answer-highlight-competitor"}]:[]],B=M?"pending":O.visibilityTransition==="lost"?"lost":le?"mentioned":"not-mentioned",J=U.useRef(0),fe=U.useCallback(async te=>{const de=++J.current;if(te===-1||te===R.length-1){g(-1),S(null),l(!1);return}g(te),l(!1);const ae=R[te],je=`${ae.runId}::${e.query}::${e.provider}`;if(_[je]){S(_[je]);return}N(!0);try{const nt=await nc(ae.runId);if(de!==J.current)return;const xe=nt.snapshots?.find(Ge=>Ge.query===e.query&&Ge.provider===e.provider)??nt.snapshots?.find(Ge=>Ge.query===e.query),Ue=xe?{citationState:xe.citationState,answerMentioned:xe.answerMentioned,visibilityState:xe.visibilityState,visibilityTransition:ae.visibilityTransition,provider:xe.provider,model:xe.model??null,answerSnippet:xe.answerText??"",citedDomains:xe.citedDomains,competitorDomains:xe.competitorOverlap,recommendedCompetitors:xe.recommendedCompetitors??[],matchedTerms:xe.matchedTerms??[],groundingSources:xe.groundingSources,searchQueries:xe.searchQueries,evidenceUrls:[],changeLabel:uf(ae.mentionTransition??ae.visibilityTransition,ae.mentionState??ae.visibilityState),summary:""}:{citationState:ae.citationState,answerMentioned:ae.answerMentioned,visibilityState:ae.visibilityState,visibilityTransition:ae.visibilityTransition,provider:e.provider,model:ae.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],searchQueries:[],evidenceUrls:[],changeLabel:uf(ae.mentionTransition??ae.visibilityTransition,ae.mentionState??ae.visibilityState),summary:"Snapshot data not available for this run."};T(Ge=>({...Ge,[je]:Ue})),S(Ue)}catch{if(de!==J.current)return;S({citationState:ae.citationState,answerMentioned:ae.answerMentioned,visibilityState:ae.visibilityState,visibilityTransition:ae.visibilityTransition,provider:e.provider,model:ae.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],searchQueries:[],evidenceUrls:[],changeLabel:uf(ae.mentionTransition??ae.visibilityTransition,ae.mentionState??ae.visibilityState),summary:"Failed to load historical run data."})}finally{de===J.current&&N(!1)}},[R,e.query,e.provider,_]),re=(F||e.historyScope!=="provider")&&O.model?`${O.provider} (${O.model}) · ${O.changeLabel.toLowerCase()}`:`${O.provider} · ${O.changeLabel.toLowerCase()}`,Ze=!F&&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(" · "):"",W=le?{label:"Mentioned in answer",title:"Your brand or domain is mentioned in this answer",meta:re}:O.visibilityTransition==="lost"?{label:"Mention lost",title:"Your brand no longer appears in this answer",meta:re}:M?{label:"Pending",title:"Awaiting first run",meta:"No provider data yet"}:{label:"Not mentioned in answer",title:"Your brand or domain was not mentioned in this answer",meta:re},ue=()=>{if(!O.answerSnippet)return null;const te=O.answerSnippet.split(`
58
- `),de=[];let ae=[],je=0;const nt=()=>{if(ae.length===0)return;const xe=ae.join(" ").trim();xe&&de.push(f.jsx("p",{className:de.length>0?"mt-2.5":"",children:$b(xe,ee)},je++)),ae=[]};for(const xe of te){const Ue=xe.trim();if(/^[-\u2013\u2014]{3,}$/.test(Ue)){nt(),de.push(f.jsx("hr",{className:"border-zinc-800/60 my-3"},je++));continue}const Ge=Ue.match(/^(#{1,3})\s+(\S.*)$/);if(Ge){nt();const Et=Ge[1].length,zn=Ge[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s]+/u,"").trim()||Ge[2],Ot=Et===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":Et===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";de.push(f.jsx("p",{className:Ot,children:$b(zn,ee)},je++));continue}if(Ue===""){nt();continue}ae.push(Ue)}return nt(),de};return f.jsx(hv,{open:!0,onOpenChange:te=>{te||i()},children:f.jsxs(fv,{children:[f.jsx(Vf,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),f.jsxs(Pf,{className:"evidence-modal","aria-describedby":void 0,children:[f.jsxs("div",{className:"evidence-modal-header",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("p",{className:"eyebrow eyebrow-soft",children:[n.project.name," ","·"," ",O.provider||"All providers"]}),f.jsx(Gf,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),f.jsxs(pv,{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:[f.jsx(Qs,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]}),V&&f.jsxs("div",{className:"evidence-modal-timeline",children:[f.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),f.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:R.map((te,de)=>{const ae=h===-1&&de===R.length-1||h===de,je=te.visibilityState??(te.answerMentioned?"visible":"not-visible"),nt=te.visibilityTransition??je,xe=je==="visible"?"bg-emerald-400":nt==="emerging"?"bg-amber-400":nt==="lost"?"bg-rose-400":"bg-zinc-600",Ge=new Date(te.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Et=!!(te.model&&de>0&&R[de-1]?.model&&R[de-1].model!==te.model);return f.jsxs("button",{type:"button",className:`evidence-run-dot ${ae?"evidence-run-dot--selected":""}`,onClick:()=>{fe(de===R.length-1?-1:de)},"aria-label":[`Run ${Ge}: ${je}`,te.model?`model ${te.model}`:null,Et?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ae,children:[f.jsx("span",{className:`size-2 rounded-full ${xe} ${Et?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),f.jsx("span",{className:"text-[10px] text-zinc-500",children:Ge})]},de)})}),h>=0&&h<R.length&&f.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(R[h].createdAt).toLocaleString()," ","—"," ",f.jsx("span",{className:"capitalize",children:R[h].visibilityState??(R[h].answerMentioned?"visible":"not-visible")}),f.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>{fe(-1)},children:["←"," Back to latest"]})]}),!F&&(e.modelTransitions?.length??0)>0&&f.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(te=>f.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:`${te.fromModel??"unknown"} -> ${te.toModel??"unknown"} on ${new Date(te.createdAt).toLocaleDateString()}`},`${te.runId}:${te.toModel??"unknown"}`))})]}),f.jsxs("div",{className:"evidence-modal-body",children:[x&&f.jsxs("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:["Loading historical run data","…"]}),!x&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"evidence-modal-main",children:[f.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${B}`,children:[f.jsx("p",{className:`evidence-position-label evidence-position-label--${B}`,children:W.label}),f.jsx("p",{className:`evidence-position-title evidence-position-title--${B}`,children:W.title}),f.jsx("p",{className:"evidence-position-meta",children:W.meta}),Ze&&f.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:Ze})]}),O.answerSnippet&&f.jsxs("div",{children:[f.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),f.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:ue()}),O.answerSnippet.length>280&&f.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>l(!r),children:r?"↑ Collapse":"↓ Show full answer"})]}),!O.answerSnippet&&!x&&f.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"}),O.searchQueries.length>0&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Web searches the model ran"}),f.jsx(to,{text:"The search queries this AI model issued while researching your prompt. They reveal how the model reformulated the question — the phrasings worth optimizing your content for. Distinct from grounding sources (what it found) and citations (what it linked)."})]}),f.jsx("ul",{className:"grid gap-1",children:O.searchQueries.map((te,de)=>f.jsxs("li",{className:"flex items-start gap-2 text-sm text-zinc-300",children:[f.jsx(GA,{className:"size-3.5 mt-0.5 shrink-0 text-zinc-600","aria-hidden":"true"}),f.jsx("span",{className:"break-words",children:te})]},`${de}-${te}`))})]}),!F&&e.relatedTechnicalSignals.length>0&&f.jsxs("div",{children:[f.jsx("p",{className:"drawer-section-label",children:le?"Why you're visible":"What to fix"}),f.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((te,de)=>f.jsxs("div",{className:"action-item",children:[f.jsx("svg",{className:`action-item-icon ${le?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:le?f.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):f.jsxs(f.Fragment,{children:[f.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),f.jsx("span",{className:"action-item-text",children:te})]},de))})]}),O.summary&&f.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:O.summary})]}),f.jsxs("div",{className:"evidence-modal-sidebar",children:[(ke||_e)&&f.jsxs("div",{className:"sidebar-tabs",children:[f.jsx("button",{className:`sidebar-tab ${c==="mentions"?"sidebar-tab--active":""}`,onClick:()=>d("mentions"),type:"button",title:"Canonry's answer-level visibility assessment and any company names extracted from the answer text.",children:"Mentions"}),f.jsx("button",{className:`sidebar-tab ${c==="sources"?"sidebar-tab--active":""}`,onClick:()=>d("sources"),type:"button",title:"Grounding links the model used to build the answer. These are supporting sources, not the primary visibility signal.",children:"Sources"})]}),c==="mentions"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Mention in answer"}),f.jsx(to,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),f.jsxs("div",{className:`mention-status mention-status--${le?"mentioned":"not-mentioned"}`,children:[f.jsx("span",{className:"mention-status-icon",children:M?"…":le?"✓":"—"}),f.jsx("span",{className:"mention-status-label",children:M?"Pending":le?"Mentioned":"Not mentioned"})]}),O.matchedTerms.length>0&&f.jsxs("div",{className:"mt-2",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Matched in answer"}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:O.matchedTerms.map(te=>f.jsx("span",{className:"mention-chip mention-chip--brand",children:te},te))})]}),!M&&!le&&O.matchedTerms.length===0&&f.jsxs("div",{className:"mt-2",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Searched for"}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:tt.map(te=>f.jsx("span",{className:"mention-chip mention-chip--muted",children:te},te))}),f.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(O.recommendedCompetitors.length>0||O.competitorDomains.length>0)&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Competitors in answer"}),f.jsx(to,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const te=O.competitorDomains.map(je=>je.replace(/^www\./,"")),de=new Set(te.map(je=>dc(je.replace(/\.[^.]+$/,""))));return[...O.recommendedCompetitors.filter(je=>!de.has(dc(je))),...te].map(je=>f.jsx("span",{className:"mention-chip mention-chip--competitor",children:je},je))})()})]})]}),c==="sources"&&f.jsxs(f.Fragment,{children:[O.citedDomains.length>0&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Domains from source links"}),f.jsx(to,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),f.jsx("div",{className:"citation-leaderboard",children:O.citedDomains.map((te,de)=>{const ae=te.toLowerCase().replace(/^www\./,""),je=E.has(ae),nt=!je&&O.competitorDomains.some(Ue=>Ue.toLowerCase().replace(/^www\./,"")===ae),xe=je?"you":nt?"competitor":"other";return f.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${xe}`,children:[f.jsxs("span",{className:"citation-leaderboard-rank",children:["#",de+1]}),f.jsx("span",{className:"citation-leaderboard-domain",children:te}),je&&f.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),nt&&f.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},te)})})]}),O.groundingSources.length>0&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsxs("span",{children:["Grounding source links (",O.groundingSources.length,")"]}),f.jsx(to,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),f.jsx("ul",{className:"grid gap-0.5",children:O.groundingSources.map((te,de)=>{const ae=Of(te.uri),je=te.title||te.uri;return f.jsx("li",{className:"truncate text-sm",children:ae?f.jsx("a",{href:ae,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:je}):f.jsx("span",{className:"text-zinc-400",children:je})},de)})})]}),O.evidenceUrls.length>0&&f.jsxs("div",{children:[f.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),f.jsx("ul",{className:"grid gap-1",children:O.evidenceUrls.map(te=>{const de=Of(te);return f.jsx("li",{className:"truncate text-sm",children:de?f.jsx("a",{href:de,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:te}):f.jsx("span",{className:"text-zinc-400",children:te})},te)})})]}),O.citedDomains.length===0&&O.groundingSources.length===0&&O.evidenceUrls.length===0&&f.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",F?"for this run":"yet"]})]}),!ke&&!_e&&f.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",F?"for this run":"yet"]})]})]})]})]})]})})}function Bn(e){const n=new Date("2026-02-20");return e.map((i,r)=>({runId:`run_mock_${r+1}`,citationState:i,createdAt:new Date(n.getTime()+r*2*24*60*60*1e3).toISOString()}))}const df=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],aliases:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},providers:[],locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1},{id:"project_harbor",name:"Harbor Legal Group",canonicalDomain:"harborlegal.com",ownedDomains:[],aliases:[],country:"US",language:"en",tags:["lead gen"],labels:{},providers:[],locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1},{id:"project_northstar",name:"Northstar Orthopedics",canonicalDomain:"northstarortho.com",ownedDomains:[],aliases:[],country:"US",language:"en",tags:["multi-location"],labels:{},providers:[],locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1}];function kc(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 K3=kc({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"}),Z3=kc({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"}),Y3=kc({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"}),X3=kc({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"}),J3=[{id:"evidence_citypoint_emergency_gemini",query:"emergency dentist brooklyn",provider:"gemini",model:"gemini-2.5-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:Bn(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",query:"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:Bn(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",query:"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:Bn(["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",query:"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:Bn(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",query:"best invisalign dentist downtown brooklyn",provider:"gemini",model:"gemini-2.5-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:Bn(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",query:"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:Bn(["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",query:"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:Bn(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",query:"pediatric dentist brooklyn heights",provider:"gemini",model:"gemini-2.5-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:Bn(["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",query:"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:Bn(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];df[0],Math.round(1/9*100),Math.round(2/9*100),df[1],Bn(["cited","cited","cited","cited","cited"]),df[2],Math.round(2/7*100),Math.round(3/7*100),Bn(["not-cited","not-cited","not-cited","cited"]);function F3(e,n){return e.runs.find(i=>i.id===n)}function W3(e,n){for(const i of e.projects){const r=i.visibilityEvidence.find(l=>l.id===n);if(r)return{project:i,evidence:r}}}function eR(e,n,i){if(e){const r=e.visibilityEvidence.find(l=>l.id===i);if(r)return{project:e,evidence:r}}if(n)return W3(n,i)}const tR={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral","gbp-lodging-gap":"negative","gbp-listing-discrepancy":"negative","gbp-cta-gap":"caution","gbp-description-missing":"caution","gbp-metric-drop":"negative","gbp-keyword-drop":"negative"},nR={opportunity:"write","persistent-gap":"write","competitor-gained":"write","competitor-lost":"write",regression:"investigate",gain:"monitor","first-citation":"monitor","provider-pickup":"monitor","gbp-lodging-gap":"write","gbp-listing-discrepancy":"write","gbp-cta-gap":"write","gbp-description-missing":"write","gbp-metric-drop":"investigate","gbp-keyword-drop":"investigate"},aR={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited","gbp-lodging-gap":"not-cited","gbp-listing-discrepancy":"not-cited","gbp-cta-gap":"not-cited","gbp-description-missing":"not-cited","gbp-metric-drop":"lost","gbp-keyword-drop":"lost"},iR={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor","gbp-lodging-gap":"Lodging gap","gbp-listing-discrepancy":"Listing gap","gbp-cta-gap":"Booking CTA","gbp-description-missing":"Description gap","gbp-metric-drop":"Metric drop","gbp-keyword-drop":"Keyword drop"};function sR(e){return{id:e.id,tone:tR[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??iR[e.type],actionGroup:nR[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:aR[e.type]}]}}function rR(e){return e.filter(n=>!n.dismissed).map(sR)}function bS(e){return{id:e.id,name:e.name,displayName:e.displayName,canonicalDomain:e.canonicalDomain,ownedDomains:e.ownedDomains??[],aliases:e.aliases??[],country:e.country,language:e.language,tags:e.tags,labels:e.labels,providers:e.providers??[],locations:e.locations??[],defaultLocation:e.defaultLocation??null,autoExtractBacklinks:e.autoExtractBacklinks??!1,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function Ib(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function oR(e,n){if(!e)return"Waiting";if(!n)return"Running";const i=new Date(n).getTime()-new Date(e).getTime();if(i<1e3)return"<1s";const r=Math.floor(i/1e3);if(r<60)return`${r}s`;const l=Math.floor(r/60),c=r%60;return`${l}m ${c}s`}function vS(e){switch(e){case Ne["answer-visibility"]:return"Answer visibility sweep";case Ne["gsc-sync"]:return"GSC sync";case Ne["inspect-sitemap"]:return"Sitemap inspection";case Ne["ga-sync"]:return"GA sync";case Ne["traffic-sync"]:return"Traffic sync";case Ne["bing-inspect"]:return"Bing URL inspection";case Ne["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Ne["site-audit"]:return"Site audit";case Ne["backlink-extract"]:return"Backlink extract";case Ne["aeo-discover-seed"]:return"Discovery (seed phase)";case Ne["aeo-discover-probe"]:return"Discovery (probe phase)";case Ne["gbp-sync"]:return"Business Profile sync";case Ne["ads-sync"]:return"ChatGPT ads sync"}}function lR(e){return e===Bs.manual?"Manual":e===Bs.scheduled?"Scheduled":e===Bs["config-apply"]?"Config apply":e}function kp(e,n){return{id:e.id,projectId:e.projectId,projectName:n,kind:e.kind,kindLabel:vS(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?Ib(e.startedAt):Ib(e.createdAt),duration:oR(e.startedAt??null,e.finishedAt??null),statusDetail:e.error?SS(e.error):cR(e),summary:uR(e),triggerLabel:lR(e.trigger)}}function SS(e){const n=ip(e);return n.length>200?n.slice(0,200)+"…":n}function cR(e){switch(e.status){case Ht.queued:return"Waiting for execution slot.";case Ht.running:return"Provider queries in progress.";case Ht.completed:return"All queries checked.";case Ht.partial:return"Run completed with some queries skipped.";case Ht.failed:return e.error?SS(e.error):"Run failed.";case Ht.cancelled:return"Run was cancelled.";default:return""}}function uR(e){const n=vS(e.kind);switch(e.status){case Ht.queued:return`${n} queued`;case Ht.running:return`${n} in progress`;case Ht.completed:return`${n} completed`;case Ht.partial:return`${n} partially completed`;case Ht.failed:return`${n} failed`;case Ht.cancelled:return`${n} cancelled`;default:return e.status}}function dR(e,n,i,r){const l=[];let c=0;const d=new Set;if(i.length>0){const h=i.flatMap(T=>T.snapshots??[]),g=new Map;for(const T of h)if(T.query){const k=`${T.query}::${T.provider}::${T.location??""}`;g.set(k,T)}const b=new Set(h.map(T=>T.location??null));b.size===0&&b.add(null);const S=new Set(h.map(T=>T.provider)),x=new Set(n.flatMap(T=>Object.keys(T.providerRuns??{}))),N=[...new Set([...S,...x])].sort(),_=N.length>0?N:["gemini"];for(const T of n){if(T.runs.length===0)continue;d.add(T.query);const k=T.runs.at(-1),E=k?.transition??"not-cited";for(const R of _){const V=[...b].filter(X=>g.has(`${T.query}::${R}::${X??""}`)),G=(T.providerRuns?.[R]?.length??0)>0,Z=V.length>0?V:G?[null]:[];for(const X of Z){const F=X??"",O=g.get(`${T.query}::${R}::${F}`),M=O?.model??null,le=M?`${R}:${M}`:null,ke=T.providerRuns?.[R],_e=le?T.modelRuns?.[le]:void 0,be=Ue=>Ue?.filter(Ge=>(Ge.location??null)===X),tt=V.length>0?be(ke):ke,Ke=V.length>0?be(_e):_e,ee=(tt?.length?tt:null)??(Ke?.length?Ke:null),B=tt?.length?"provider":Ke?.length?"model":"query",J=ee?ee.at(-1).transition:E,fe=ee?ee.at(-1).visibilityTransition??(ee.at(-1).visibilityState==="visible"?"visible":"not-visible"):k?.visibilityTransition??(k?.visibilityState==="visible"?"visible":"not-visible"),Se=ee?.at(-1)?.citationState,re=ee?.at(-1)?.visibilityState,Ze=O?J==="lost"?"lost":J==="emerging"?"emerging":O.citationState===lc.cited?"cited":"not-cited":Se===lc.cited?"cited":"not-cited",W=O?.visibilityState??(re==="visible"?"visible":re==="pending"?"pending":"not-visible"),ue=Vb(ee||T.runs),te=Pb(ee||T.runs),de=fR(T,R),ae=(ee??T.runs).map(Ue=>({runId:Ue.runId,citationState:Ue.citationState,createdAt:Ue.createdAt,model:de.get(Ue.runId)??null,answerMentioned:Ue.answerMentioned,visibilityState:Ue.visibilityState,visibilityTransition:Ue.visibilityTransition,mentionState:Ue.mentionState,mentionTransition:Ue.mentionTransition})),je=pR(ae),nt=B==="provider"&&je.length<=1?"model":B,xe=mR(ae);l.push({id:`evidence_${e}_${c++}`,query:T.query,provider:O?.provider??R,model:O?.model??null,location:O?.location??X,citationState:Ze,answerMentioned:O?.answerMentioned,visibilityState:W,visibilityChangeLabel:Gb(fe,te,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:Gb(J,ue),answerSnippet:O?.answerText??"",citedDomains:O?.citedDomains??[],evidenceUrls:[],competitorDomains:O?.competitorOverlap??[],recommendedCompetitors:O?.recommendedCompetitors??[],matchedTerms:O?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:O?.groundingSources??[],searchQueries:O?.searchQueries??[],summary:hR(W,fe,T.query),runHistory:ae,historyScope:nt,modelsSeen:je,modelTransitions:xe})}}}}for(const h of r)d.has(h.query)||l.push({id:`evidence_${e}_${c++}`,query:h.query,provider:"",model:null,location:null,citationState:"pending",visibilityState:"pending",visibilityChangeLabel:"Awaiting first run",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],relatedTechnicalSignals:[],groundingSources:[],searchQueries:[],summary:`"${h.query}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"query",modelsSeen:[],modelTransitions:[]});return l}function fR(e,n){const i=new Map,r=`${n}:`;for(const[l,c]of Object.entries(e.modelRuns??{})){if(!l.startsWith(r))continue;const d=l.slice(r.length),h=d==="unknown"?null:d;for(const g of c)i.set(g.runId,h)}return i}function pR(e){const n=new Set;for(const i of e)i.model&&n.add(i.model);return[...n]}function mR(e){const n=[];let i=null;for(const r of e){const l=r.model??null;l!==i&&i!==null&&n.push({runId:r.runId,createdAt:r.createdAt,fromModel:i,toModel:l}),i=l}return n}function Vb(e){if(e.length===0)return 0;const n=e[e.length-1].citationState;let i=0;for(let r=e.length-1;r>=0&&e[r].citationState===n;r--)i++;return i}function Pb(e){if(e.length===0)return 0;const n=e[e.length-1].visibilityState??"not-visible";let i=0;for(let r=e.length-1;r>=0&&(e[r].visibilityState??"not-visible")===n;r--)i++;return i}function Gb(e,n,i){const r={positive:i?.positive??"cited",negative:i?.negative??"not cited",first:i?.first??"first citation"};switch(e){case"new":return"First observation";case"cited":case"visible":return n<=1?`${no(r.positive)} in latest run`:`${no(r.positive)} for ${n} runs`;case"lost":return"Lost since last run";case"emerging":return no(r.first);case"not-cited":case"not-visible":return n<=1?`${no(r.negative)} in latest run`:`${no(r.negative)} across ${n} runs`;default:return e}}function no(e){return e.charAt(0).toUpperCase()+e.slice(1)}function hR(e,n,i){switch(n){case"lost":return`Mention was lost for "${i}". Your brand no longer appeared in the latest answer.`;case"emerging":return`Your brand started appearing in AI answers for "${i}".`}switch(e){case"visible":return`Your brand or domain is mentioned in AI answers for "${i}".`;case"pending":return`"${i}" has been added but no run has been triggered yet.`;default:return`Your brand or domain was not mentioned in AI answers for "${i}".`}}function xS(e){const n=bS(e.project),i=dR(n.name,e.timeline,e.latestRunDetails,e.queries),l=[...e.runs].sort((c,d)=>d.createdAt.localeCompare(c.createdAt)).map(c=>kp(c,e.project.displayName||e.project.name));return e.overview?gR(n,e.overview,i,l):yR(n,i,l)}function gR(e,n,i,r){const l=rR(n.topInsights);for(const c of n.attentionItems)c.id.startsWith("insight_")||l.push({id:c.id,tone:c.tone,title:c.title,detail:c.detail,actionLabel:c.actionLabel,actionGroup:"investigate",affectedPhrases:[]});return{project:e,dateRangeLabel:n.dateRangeLabel,contextLabel:n.contextLabel,mentionSummary:n.scores.mention,visibilitySummary:n.scores.visibility,mentionShareSummary:n.scores.mentionShare,queryCounts:{cited:n.queryCounts.citedQueries,total:n.queryCounts.totalQueries},gapQueries:n.scores.gapQueries,mentionGaps:n.scores.mentionGaps,indexCoverage:n.scores.indexCoverage,providerScores:n.providerScores,competitorPressure:n.scores.competitorPressure,runStatus:n.scores.runStatus,citationMovement:n.citationMovement,mentionMovement:n.mentionMovement,movementComparison:n.movementComparison,insights:l,visibilityEvidence:i,competitors:n.competitors.map(c=>({id:c.id,domain:c.domain,citationCount:c.citationCount,totalQueries:c.totalQueries,pressureLabel:c.pressureLabel,citedQueries:c.citedQueries,movement:"",notes:""})),recentRuns:r.slice(0,5),suggestedQueries:n.suggestedQueries}}function yR(e,n,i){const r={label:"",value:"No data",delta:"Loading…",tone:"neutral",description:"",tooltip:"",trend:[]};return{project:e,dateRangeLabel:"All time",contextLabel:`${e.country} / ${e.language.toUpperCase()}`,mentionSummary:{...r,label:"Mention Coverage"},visibilitySummary:{...r,label:"Citation Coverage"},mentionShareSummary:{...r,label:"Mention Share",breakdown:{projectMentionSnapshots:0,competitorMentionSnapshots:0,perCompetitor:[],snapshotsWithAnswerText:0,snapshotsTotal:0}},queryCounts:{cited:0,total:0},gapQueries:{...r,label:"Citation Gaps"},mentionGaps:{...r,label:"Mention Gaps"},indexCoverage:{...r,label:"Index Coverage"},providerScores:[],competitorPressure:{...r,label:"Competitor Pressure"},runStatus:{...r,label:"Run Status"},citationMovement:{gained:0,lost:0,tone:"neutral",hasPreviousRun:!1},mentionMovement:{gained:0,lost:0,tone:"neutral",hasPreviousRun:!1},movementComparison:{hasPreviousRun:!1,comparable:!1,querySetChanged:!1,previousRunAt:null,currentQueryCount:0,previousQueryCount:0,comparableQueryCount:0,addedQueryCount:0,removedQueryCount:0,addedQueries:[],removedQueries:[]},insights:[],visibilityEvidence:n,competitors:[],recentRuns:i.slice(0,5),suggestedQueries:{rows:[],totalCandidates:0,skippedAlreadyTracked:0}}}function bR(e){const n=bS(e.project),i=[...e.runs].sort((N,_)=>_.createdAt.localeCompare(N.createdAt)),r=i.find(N=>N.kind===Ne["answer-visibility"])??i[0],l=e.project.displayName||e.project.name,c=r?kp(r,l):vR(e.project.id,l),d=e.overview;if(!d)return{project:n,mentionScore:0,mentionDelta:"No data",mentionTone:"neutral",lastRun:c,insight:"No runs completed yet.",trend:[],competitorPressureLabel:"None"};const h=d.scores.mention,g=h.progress??0,b=d.queryCounts.mentionedQueries,S=d.queryCounts.totalQueries,x=d.providers.length;return{project:n,mentionScore:g,mentionDelta:S>0?`${b} of ${S} queries`:"No data",mentionTone:h.tone,providerCoverage:h.providerCoverage,lastRun:c,insight:S>0?`${b} of ${S} queries mentioned across ${x} provider${x===1?"":"s"}.`:"No runs completed yet.",trend:h.trend??[],competitorPressureLabel:d.scores.competitorPressure.value}}function vR(e,n){return{id:"none",projectId:e,projectName:n,kind:Ne["answer-visibility"],kindLabel:"No runs yet",status:Ht.queued,trigger:Bs.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function SR(e,n){const i=[],r=[],l=[];for(const d of e){r.push(xS(d)),l.push(bR(d));const h=[...d.runs].sort((g,b)=>b.createdAt.localeCompare(g.createdAt));for(const g of h)i.push(kp(g,d.project.displayName||d.project.name))}i.sort((d,h)=>h.createdAt.localeCompare(d.createdAt));const c=e.length>0;return{portfolioOverview:{projects:l,attentionItems:c?xR(r):[{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:i.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 query set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:r,runs:i,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"},queryImportState:{mode:"paste",queryCount: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:(n?.providers??[]).map(d=>({name:d.name,displayName:d.displayName,keyUrl:d.keyUrl,modelHint:d.modelHint,model:d.model,defaultModel:d.defaultModel,state:d.configured?"ready":"needs-config",detail:d.configured?"Provider is configured.":"API key is missing.",quota:d.quota})),google:{state:n?.google?.configured?"ready":"needs-config",detail:n?.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:n?.bing?.configured?"ready":"needs-config",detail:n?.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 xR(e){const n=[];for(const i of e){const r=i.visibilityEvidence.filter(c=>c.citationState==="lost");r.length>0&&n.push({id:`attention_${i.project.id}_lost`,tone:"negative",title:`${i.project.displayName||i.project.name} lost citations`,detail:`${r.length} quer${r.length>1?"ies":"y"} lost citation.`,actionLabel:"Open project",href:`/projects/${i.project.id}`});const l=i.recentRuns.filter(c=>c.status===Ht.running||c.status===Ht.queued);l.length>0&&n.push({id:`attention_${i.project.id}_active`,tone:"neutral",title:`${i.project.displayName||i.project.name} has active runs`,detail:`${l.length} run${l.length>1?"s":""} in progress.`,actionLabel:"View runs",href:"/runs"})}return n.length===0&&n.push({id:"attention_stable",tone:"positive",title:"All projects stable",detail:"No citation losses or active runs to flag."}),n}const wS=U.createContext(null);wS.Provider;function go(){return U.useContext(wS)}function Ac(e){const i=go()?.dashboard??null,r=dn({...vp({client:se}),enabled:!i,refetchInterval:Zk}),l=dn({...xp({client:se,query:{kind:"answer-visibility"}}),enabled:!i,staleTime:lo,refetchInterval:T=>T.state.data?.some(R=>R.status==="running"||R.status==="queued")?3e3:lo}),c=dn({...H4({client:se}),enabled:!i}),d=r.data??[],h=l.data??[],g=Cw({queries:d.map(T=>{const k=h.filter(V=>V.projectId===T.id),E=k.filter(V=>(V.status==="completed"||V.status==="partial")&&V.kind==="answer-visibility"&&V.trigger!=="probe").sort((V,G)=>G.createdAt.localeCompare(V.createdAt)),R=E.length>0?E[0].id:"no-run";return{queryKey:["project-overview-slim",T.id,R],queryFn:async()=>{const V=await Tv(T.name).catch(()=>null);return{project:T,runs:k,queries:[],competitors:[],timeline:[],latestRunDetails:[],previousRunDetails:[],gscCoverage:null,bingCoverage:null,dbInsights:null,overview:V}},enabled:!i&&r.isSuccess&&l.isSuccess,staleTime:jf}})}),b=g.every(T=>T.isSuccess),S=U.useMemo(()=>{if(i)return i;if(!r.data||!l.data||d.length>0&&!b)return null;const T=g.map(k=>k.data?{...k.data,runs:h.filter(E=>E.projectId===k.data.project.id)}:null).filter(k=>k!=null);return SR(T,c.data??null)},[i,r.data,l.data,c.data,b,g,d.length,h]),x=!i&&(r.isError||l.isError),N=!i&&!S&&!x,_=U.useCallback(async()=>{await Promise.all([r.refetch(),l.refetch(),c.refetch()])},[r.refetch,l.refetch,c.refetch]);return{dashboard:S,isLoading:N,isError:x,refetch:_}}function wR(e){const n=go(),i=U.useMemo(()=>!n||!e?null:n.dashboard.projects.find(T=>T.project.name===e)??null,[n,e]),r=dn({...V4({client:se,path:{name:e??""}}),enabled:!!e&&!i,staleTime:jf,refetchOnWindowFocus:"always"}),l=dn({...xp({client:se,query:{kind:"answer-visibility"}}),enabled:!!e,staleTime:lo,refetchOnWindowFocus:"always",refetchInterval:T=>T.state.data?.some(R=>R.projectId===r.data?.id&&(R.status==="running"||R.status==="queued"))?3e3:lo}),c=r.data??null,d=U.useMemo(()=>c?(l.data??[]).filter(T=>T.projectId===c.id):[],[c,l.data]),{latestRunIds:h,previousRunIds:g,latestRunIdsKey:b}=U.useMemo(()=>{const T=d.filter(G=>(G.status==="completed"||G.status==="partial")&&G.kind==="answer-visibility"&&G.trigger!=="probe").sort((G,Z)=>Z.createdAt.localeCompare(G.createdAt)),k=T[0]?.createdAt??null,E=k?T.filter(G=>G.createdAt===k).map(G=>G.id):[],R=T.find(G=>G.createdAt!==k)?.createdAt??null,V=R?T.filter(G=>G.createdAt===R).map(G=>G.id):[];return{latestRunIds:E,previousRunIds:V,latestRunIdsKey:[...E].sort().join(",")}},[d]),S=dn({queryKey:["project-dashboard-full",c?.id??null,b||"none"],queryFn:async()=>{if(!c||!e)return null;const[T,k,E,R,V,G,Z,X,F]=await Promise.all([bk(e).catch(()=>[]),vk(e).catch(()=>[]),Sk(e).catch(()=>[]),h.length?Promise.all(h.map(O=>nc(O).catch(()=>null))).then(O=>O.filter(M=>M!=null)):Promise.resolve([]),g.length?Promise.all(g.map(O=>nc(O).catch(()=>null))).then(O=>O.filter(M=>M!=null)):Promise.resolve([]),Dk(e).catch(()=>null),Bk(e).catch(()=>null),qk(e).catch(()=>null),Tv(e).catch(()=>null)]);return{project:c,runs:d,queries:T,competitors:k,timeline:E,latestRunDetails:R,previousRunDetails:V,gscCoverage:G,bingCoverage:Z,dbInsights:X,overview:F}},enabled:!!c&&!!e&&l.isSuccess,staleTime:jf,refetchOnWindowFocus:"always",refetchInterval:Yk}),x=U.useMemo(()=>S.data?xS({...S.data,runs:d}):i||null,[S.data,d,i]),N=U.useCallback(async()=>{await Promise.all([r.refetch(),l.refetch(),S.refetch()])},[r.refetch,l.refetch,S.refetch]),_=!x&&(r.isLoading||l.isLoading||S.isLoading);return{commandCenter:x,project:c,isLoading:_,isError:r.isError||l.isError||S.isError,refetch:N}}const jR=["health"];async function NR(){const e=await $k("/health","API"),n=e.state==="ok"?{label:"Worker",state:"ok",detail:"In-process job runner"}:{label:"Worker",state:e.state,detail:`Depends on API health check · ${e.detail}`,statusCode:e.statusCode,hint:e.hint?`Worker status is inferred from API health in this deployment mode. ${e.hint}`:"Worker status is inferred from API health in this deployment mode."};return{apiStatus:e,workerStatus:n}}function Ap(e,n){return dn({queryKey:jR,queryFn:NR,enabled:e,refetchInterval:15e3,initialData:n})}function kR(e){return dn({...K0({client:se,path:{id:e??""}}),enabled:!!e,refetchInterval:n=>{const i=n.state.data?.status;return i==="running"||i==="queued"?3e3:!1}})}function _p(){const e=hc(),n=zw({strict:!1}),i=Tw({select:g=>g.location.pathname}),r=n.runId??null,l=n.evidenceId??null;return{runId:r,evidenceId:l,openRun:g=>{e({to:i,from:tn.to,search:b=>({...b,runId:g,evidenceId:void 0})})},openEvidence:g=>{e({to:i,from:tn.to,search:b=>({...b,evidenceId:g,runId:void 0})})},closeDrawer:()=>{e({to:i,from:tn.to,search:g=>({...g,runId:void 0,evidenceId:void 0})})}}}const AR={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function _R(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function CR(){const e=U.useSyncExternalStore(Qk,Ky,Ky),n=hc(),{openRun:i}=_p(),r=U.useCallback(c=>{wf(c)},[]),l=U.useCallback(c=>{c.cta&&(c.cta.intent==="open-run-drawer"?i(c.cta.runId):n({to:"/runs"}),wf(c.id))},[n,i]);return e.length===0?null:f.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(c=>f.jsxs("section",{role:c.tone==="negative"?"alert":"status","aria-live":c.tone==="negative"?"assertive":"polite","data-state":c.state,className:`toast-card ${AR[c.tone]}`,children:[f.jsxs("div",{className:"toast-copy",children:[f.jsx("p",{className:"toast-title",children:c.title}),c.detail?f.jsx("p",{className:"toast-detail",children:c.detail}):null,c.cta?f.jsx("button",{type:"button",className:"toast-action",onClick:()=>l(c),"aria-label":_R(c),children:c.cta.label}):null]}),f.jsx("button",{type:"button",onClick:()=>r(c.id),className:"toast-dismiss","aria-label":"Dismiss",children:f.jsx(Qs,{className:"size-3.5"})})]},c.id))})}function zR(e,n={}){const{threshold:i=80}=n,r=U.useRef(null),l=U.useRef({scrollHeight:0,wasAtEnd:!0});function c(g){return g.scrollHeight-g.scrollTop-g.clientHeight}function d(){const g=r.current;return g?c(g)<=i:!0}function h(){const g=r.current;g&&(g.scrollTop=g.scrollHeight,l.current.wasAtEnd=!0,l.current.scrollHeight=g.scrollHeight)}return U.useEffect(()=>{const g=r.current;if(!g)return;const b=()=>{l.current.wasAtEnd=c(g)<=i};return g.addEventListener("scroll",b,{passive:!0}),()=>g.removeEventListener("scroll",b)},[i]),U.useLayoutEffect(()=>{const g=r.current;if(!g)return;const b=g.scrollHeight;b>l.current.scrollHeight&&l.current.wasAtEnd&&(g.scrollTop=b),l.current.scrollHeight=b},e),U.useEffect(()=>{const g=r.current;if(!g||typeof ResizeObserver>"u")return;const b=new ResizeObserver(()=>{const S=g.scrollHeight;S>l.current.scrollHeight&&l.current.wasAtEnd&&(g.scrollTop=S),l.current.scrollHeight=S});return b.observe(g),g.firstElementChild&&b.observe(g.firstElementChild),()=>b.disconnect()},[]),{ref:r,scrollToEnd:h,isAtEnd:d}}async function Cp(e){try{return await e.json()}catch{return{}}}function TR(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const zp=TR();function Tp(e){e===401&&Hf()}async function Hb(e){const n=await fetch(`${zp}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!n.ok){Tp(n.status);const i=await Cp(n);throw new Hn(i.error?.message??`transcript fetch failed: ${n.status}`,n.status,i.error?.code)}return await n.json()}async function ER(e){const n=await fetch(`${zp}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!n.ok){Tp(n.status);const i=await Cp(n);throw new Hn(i.error?.message??`reset failed: ${n.status}`,n.status,i.error?.code)}}async function OR({project:e,prompt:n,provider:i,modelId:r,scope:l,signal:c,onEvent:d}){const h={prompt:n};i&&(h.provider=i),r&&(h.modelId=r),l&&(h.scope=l);const g=await fetch(`${zp}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(h),signal:c});if(!g.ok||!g.body){Tp(g.status);const _=await Cp(g);throw new Hn(_.error?.message??`prompt failed: ${g.status}`,g.status,_.error?.code)}const b=g.body.getReader(),S=new TextDecoder;let x="";const N=()=>{b.cancel().catch(()=>{})};c?.addEventListener("abort",N,{once:!0});try{for(;;){const{value:_,done:T}=await b.read();if(T)break;x+=S.decode(_,{stream:!0});let k=x.indexOf(`
56
+ `):"Run failed."}function U4(e){return e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function ML(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function BL(e){return e===null?"Unknown":e?"Pass":"Fail"}function zb(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function LL(e,n){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${n}`:`daily@${n}`}function qL(e,n){if(!e)return{freq:"custom",hour:6,customCron:n};if(e==="twice-daily")return{freq:"twice-daily",hour:6,customCron:""};const i=e.match(/^daily(?:@(\d+))?$/);if(i)return{freq:"daily",hour:i[1]?parseInt(i[1]):6,customCron:""};const r=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return r?{freq:r[1],hour:r[2]?parseInt(r[2]):6,customCron:""}:{freq:"custom",hour:6,customCron:n}}function UL(e,n,i){const r=i==="UTC"?"UTC":i.split("/").pop()?.replace(/_/g," ")??i;if(!e)return`Custom: ${n} · ${r}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${r}`;const l=e.match(/^daily(?:@(\d+))?$/);if(l){const d=l[1]?parseInt(l[1]):6;return`Every day at ${zb(d)} · ${r}`}const c=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(c){const d={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},h=c[2]?parseInt(c[2]):6;return`Every ${d[c[1]]} at ${zb(h)} · ${r}`}return`${e} · ${r}`}function $4(e,n){return n&&n!==e?`${e} · ${n}`:e}function $L(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Intl.DateTimeFormat("en-US",{timeZoneName:"short"}).formatToParts().find(i=>i.type==="timeZoneName")?.value;return $4(e,n)}function I4(e){const n=e.replace(/\/+$/,"")||"/";return n==="/"?"overview":n==="/projects"?"projects":n.startsWith("/projects/")?"project":n==="/runs"?"runs":n==="/traffic"||n.startsWith("/traffic/")?"traffic":n==="/backlinks"?"backlinks":n==="/settings"?"settings":n==="/setup"?"setup":"other"}const V4={bg:"--canonry-embed-bg",fg:"--canonry-embed-fg"},P4=/^(?:#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|rgba?\([0-9.,%\s/]+\)|hsla?\([0-9.,%\s/a-z]+\))$/i;function G4(e){if(!e)return{};const n={};for(const[i,r]of Object.entries(e)){const l=V4[i];if(!l||typeof r!="string")continue;const c=r.trim();P4.test(c)&&(n[l]=c)}return n}const _e=(e,n,i,r)=>{const l={_id:e,baseUrl:n?.baseUrl||(n?.client??H).getConfig().baseUrl};return n?.body&&(l.body=n.body),n?.headers&&(l.headers=n.headers),n?.path&&(l.path=n.path),n?.query&&(l.query=n.query),[l]},H4=e=>_e("getApiV1ProjectsByName",e),Q4=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Nv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:H4(e)}),Js=e=>_e("getApiV1Projects",e),Sp=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await oj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Js(e)}),xp=e=>_e("getApiV1Runs",e),wp=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await wj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:xp(e)}),K4=e=>_e("getApiV1RunsById",e),K0=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await kv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:K4(e)}),Z4=e=>_e("getApiV1Settings",e),Y4=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Av({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Z4(e)}),X4=e=>_e("getApiV1ProjectsByNameGoogleConnections",e),IL=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Uj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:X4(e)}),J4=e=>_e("getApiV1ProjectsByNameGoogleProperties",e),VL=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Vj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:J4(e)}),F4=e=>_e("getApiV1ProjectsByNameGoogleGscPerformance",e),PL=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Qj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:F4(e)}),W4=e=>_e("getApiV1ProjectsByNameGoogleGscPerformanceDaily",e),GL=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Kj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:W4(e)}),eD=e=>_e("getApiV1ProjectsByNameGoogleGscInspections",e),HL=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Yj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:eD(e)}),tD=e=>_e("getApiV1ProjectsByNameGoogleGscDeindexed",e),QL=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Xj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:tD(e)}),nD=e=>_e("getApiV1ProjectsByNameGoogleGscCoverage",e),KL=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await _v({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:nD(e)}),aD=e=>_e("getApiV1ProjectsByNameGoogleGscCoverageHistory",e),ZL=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Jj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:aD(e)}),YL=e=>_e("getApiV1ProjectsByNameGoogleGscSitemaps",e),iD=e=>_e("getApiV1ProjectsByNameGbpLocations",e),XL=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await nN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:iD(e)}),JL=e=>({mutationFn:async i=>{const{data:r}=await aN({...e,...i,throwOnError:!0});return r}}),FL=e=>({mutationFn:async i=>{const{data:r}=await iN({...e,...i,throwOnError:!0});return r}}),sD=e=>_e("getApiV1ProjectsByNameGbpKeywords",e),WL=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await sN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:sD(e)}),rD=e=>_e("getApiV1ProjectsByNameGbpPlaceActions",e),e6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await rN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:rD(e)}),oD=e=>_e("getApiV1ProjectsByNameGbpLodging",e),t6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await oN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:oD(e)}),lD=e=>_e("getApiV1ProjectsByNameGbpPlaces",e),n6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await lN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:lD(e)}),cD=e=>_e("getApiV1ProjectsByNameGbpSummary",e),a6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await cN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:cD(e)}),uD=e=>_e("getApiV1ProjectsByNameBingStatus",e),i6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await fN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:uD(e)}),dD=e=>_e("getApiV1ProjectsByNameBingSites",e),s6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await pN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:dD(e)}),fD=e=>_e("getApiV1ProjectsByNameBingCoverage",e),r6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Cv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:fD(e)}),pD=e=>_e("getApiV1ProjectsByNameBingInspections",e),o6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await hN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:pD(e)}),mD=e=>_e("getApiV1ProjectsByNameBingPerformance",e),l6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await vN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:mD(e)}),hD=e=>_e("getApiV1ProjectsByNameGaStatus",e),c6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await wN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:hD(e)}),gD=e=>_e("getApiV1ProjectsByNameGaTraffic",e),u6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await NN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:gD(e)}),yD=e=>_e("getApiV1ProjectsByNameGaAiReferralHistory",e),d6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await kN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:yD(e)}),bD=e=>_e("getApiV1ProjectsByNameGaSocialReferralHistory",e),f6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await AN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:bD(e)}),vD=e=>_e("getApiV1ProjectsByNameGaSessionHistory",e),p6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await _N({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:vD(e)}),SD=e=>_e("getApiV1ProjectsByNameReport",e),m6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await zN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:SD(e)}),xD=e=>_e("getApiV1ProjectsByNameCitationsVisibility",e),h6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await TN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:xD(e)}),wD=e=>_e("getApiV1ProjectsByNameTrafficSources",e),g6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await FN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:wD(e)}),jD=e=>_e("getApiV1ProjectsByNameTrafficStatus",e),y6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await WN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:jD(e)}),ND=e=>_e("getApiV1ProjectsByNameTrafficSourcesById",e),b6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await ek({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:ND(e)}),kD=e=>_e("getApiV1ProjectsByNameTrafficEvents",e),v6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await tk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:kD(e)}),AD=e=>_e("getApiV1ProjectsByNameDiscoverSessions",e),S6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await ak({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:AD(e)}),_D=e=>_e("getApiV1ProjectsByNameDiscoverSessionsById",e),x6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await ik({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:_D(e)}),CD=e=>_e("getApiV1ProjectsByNameDiscoverSessionsByIdPromote",e),w6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await sk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:CD(e)}),zD=e=>_e("getApiV1ProjectsByNameTechnicalAeo",e),j6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await ok({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:zD(e)}),TD=e=>_e("getApiV1ProjectsByNameTechnicalAeoPages",e),N6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await lk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:TD(e)}),ED=e=>_e("getApiV1ProjectsByNameTechnicalAeoTrend",e),k6=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await ck({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:ED(e)}),OD=e=>_e("getApiV1ProjectsByNameAgentProviders",e),DD=e=>Te({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await dk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:OD(e)});function Tb(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function Z0(e){switch(e){case"completed":return"positive";case"partial":return"caution";case"failed":return"negative";case"cancelled":return"caution";case"queued":case"running":return"neutral";default:return"neutral"}}function A6(e){switch(e){case"cited":return"positive";case"emerging":return"caution";case"not-cited":return"caution";case"lost":return"negative";case"pending":return"neutral";default:return"neutral"}}function _6(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}const C6={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-400"};function RD(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function Is(e){const n=[e.detail,e.hint].filter(Boolean);return n.length>0?n.join(`
57
+ `):void 0}function MD(e,n,i){return e.map(r=>{if(r.id==="api")return{...r,tone:Tb(n.apiStatus),detail:n.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:n.apiStatus.detail};if(r.id==="worker")return{...r,tone:Tb(n.workerStatus),detail:n.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:n.workerStatus.detail};const l=i.providerStatuses.filter(g=>g.state==="ready").length,c=i.providerStatuses.length,d=l>0,h=i.providerStatuses.filter(g=>g.state==="ready").map(g=>RD(g)).join(" · ");return{...r,label:"Providers",tone:d?"positive":"caution",detail:`${l} of ${c} configured`,meta:h||"None configured"}})}function BD(e,n){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(!n.providerStatuses.some(i=>i.state==="ready"))return"Launch is blocked until at least one provider is configured."}function LD(e,n,i){const r=BD(n,i),l=structuredClone(e);return l.healthChecks=l.healthChecks.map(c=>{if(c.id==="api")return{...c,detail:n.apiStatus.detail,state:n.apiStatus.state==="ok"?"ready":"attention"};if(c.id==="worker")return{...c,detail:n.workerStatus.detail,state:n.workerStatus.state==="ok"?"ready":"attention"};const d=i.providerStatuses.some(h=>h.state==="ready");return{...c,detail:d?"At least one provider configured.":"No providers configured.",state:d?"ready":"attention"}}),l.launchState.enabled=r===void 0,l.launchState.blockedReason=r,l.launchState.summary=r??"Queue a visibility sweep first, then follow with a site audit to explain movement.",l}const Y0="canonry.run-tracker",Tf=new Set;let Eb=!1,qD=0,jc={runs:{},batches:{}};function UD(){const e=_i();for(const n of Tf)n(e)}function $D(e){if(!e)return{runs:{},batches:{}};try{const n=JSON.parse(e);return{runs:n.runs??{},batches:n.batches??{}}}catch{return{runs:{},batches:{}}}}function ID(){typeof window>"u"||window.sessionStorage.setItem(Y0,JSON.stringify(jc))}function X0(){Eb||(Eb=!0,!(typeof window>"u")&&(jc=$D(window.sessionStorage.getItem(Y0))))}function Nc(e){jc=e,ID(),UD()}function _i(){return X0(),jc}function VD(e){return X0(),Tf.add(e),()=>{Tf.delete(e)}}function J0(e){const n=_i();Nc({...n,runs:{...n.runs,[e.id]:{runId:e.id,projectId:e.projectId,projectLabel:e.projectLabel,kind:e.kind,sourceAction:e.sourceAction,lastAnnouncedStatus:e.lastAnnouncedStatus??"queued",trackedAt:e.trackedAt??Date.now()}}})}function lf(e){const n=_i();if(!n.runs[e])return;const{[e]:i,...r}=n.runs;Nc({...n,runs:r})}function PD(e){const n=_i(),i=`batch_${Date.now()}_${++qD}`;return Nc({...n,batches:{...n.batches,[i]:{batchId:i,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),i}function GD(e){const n=_i();if(!n.batches[e])return;const{[e]:i,...r}=n.batches;Nc({...n,batches:r})}function HD(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}const QD=10*6e4;function KD(e,n,i,r){return e.filter(l=>!n.has(l.runId)&&i-(l.trackedAt??0)>=r)}function ZD(e,n){let i=0,r=0,l=0,c=0,d=0;for(const h of e){const g=n[h]?.status;g==="completed"?i+=1:g==="partial"?r+=1:g==="failed"?l+=1:g==="cancelled"?c+=1:d+=1}return{completed:i,partial:r,failed:l,cancelled:c,pending:d,finished:d===0}}const Ob=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Db=yv,F0=(e,n)=>i=>{var r;if(n?.variants==null)return Db(e,i?.class,i?.className);const{variants:l,defaultVariants:c}=n,d=Object.keys(l).map(v=>{const S=i?.[v],x=c?.[v];if(S===null)return null;const N=Ob(S)||Ob(x);return l[v][N]}),h=i&&Object.entries(i).reduce((v,S)=>{let[x,N]=S;return N===void 0||(v[x]=N),v},{}),g=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((v,S)=>{let{class:x,className:N,..._}=S;return Object.entries(_).every(T=>{let[k,E]=T;return Array.isArray(E)?E.includes({...c,...h}[k]):{...c,...h}[k]===E})?[...v,x,N]:v},[]);return Db(e,d,g,i?.class,i?.className)},YD=(e,n)=>{const i=new Array(e.length+n.length);for(let r=0;r<e.length;r++)i[r]=e[r];for(let r=0;r<n.length;r++)i[e.length+r]=n[r];return i},XD=(e,n)=>({classGroupId:e,validator:n}),W0=(e=new Map,n=null,i)=>({nextPart:e,validators:n,classGroupId:i}),fc="-",Rb=[],JD="arbitrary..",FD=e=>{const n=e3(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return WD(d);const h=d.split(fc),g=h[0]===""&&h.length>1?1:0;return eS(h,g,n)},getConflictingClassGroupIds:(d,h)=>{if(h){const g=r[d],v=i[d];return g?v?YD(v,g):g:v||Rb}return i[d]||Rb}}},eS=(e,n,i)=>{if(e.length-n===0)return i.classGroupId;const l=e[n],c=i.nextPart.get(l);if(c){const v=eS(e,n+1,c);if(v)return v}const d=i.validators;if(d===null)return;const h=n===0?e.join(fc):e.slice(n).join(fc),g=d.length;for(let v=0;v<g;v++){const S=d[v];if(S.validator(h))return S.classGroupId}},WD=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),i=n.indexOf(":"),r=n.slice(0,i);return r?JD+r:void 0})(),e3=e=>{const{theme:n,classGroups:i}=e;return t3(i,n)},t3=(e,n)=>{const i=W0();for(const r in e){const l=e[r];jp(l,i,r,n)}return i},jp=(e,n,i,r)=>{const l=e.length;for(let c=0;c<l;c++){const d=e[c];n3(d,n,i,r)}},n3=(e,n,i,r)=>{if(typeof e=="string"){a3(e,n,i);return}if(typeof e=="function"){i3(e,n,i,r);return}s3(e,n,i,r)},a3=(e,n,i)=>{const r=e===""?n:tS(n,e);r.classGroupId=i},i3=(e,n,i,r)=>{if(r3(e)){jp(e(r),n,i,r);return}n.validators===null&&(n.validators=[]),n.validators.push(XD(i,e))},s3=(e,n,i,r)=>{const l=Object.entries(e),c=l.length;for(let d=0;d<c;d++){const[h,g]=l[d];jp(g,tS(n,h),i,r)}},tS=(e,n)=>{let i=e;const r=n.split(fc),l=r.length;for(let c=0;c<l;c++){const d=r[c];let h=i.nextPart.get(d);h||(h=W0(),i.nextPart.set(d,h)),i=h}return i},r3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,o3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,i=Object.create(null),r=Object.create(null);const l=(c,d)=>{i[c]=d,n++,n>e&&(n=0,r=i,i=Object.create(null))};return{get(c){let d=i[c];if(d!==void 0)return d;if((d=r[c])!==void 0)return l(c,d),d},set(c,d){c in i?i[c]=d:l(c,d)}}},Ef="!",Mb=":",l3=[],Bb=(e,n,i,r,l)=>({modifiers:e,hasImportantModifier:n,baseClassName:i,maybePostfixModifierPosition:r,isExternal:l}),c3=e=>{const{prefix:n,experimentalParseClassName:i}=e;let r=l=>{const c=[];let d=0,h=0,g=0,v;const S=l.length;for(let k=0;k<S;k++){const E=l[k];if(d===0&&h===0){if(E===Mb){c.push(l.slice(g,k)),g=k+1;continue}if(E==="/"){v=k;continue}}E==="["?d++:E==="]"?d--:E==="("?h++:E===")"&&h--}const x=c.length===0?l:l.slice(g);let N=x,_=!1;x.endsWith(Ef)?(N=x.slice(0,-1),_=!0):x.startsWith(Ef)&&(N=x.slice(1),_=!0);const T=v&&v>g?v-g:void 0;return Bb(c,_,N,T)};if(n){const l=n+Mb,c=r;r=d=>d.startsWith(l)?c(d.slice(l.length)):Bb(l3,!1,d,void 0,!0)}if(i){const l=r;r=c=>i({className:c,parseClassName:l})}return r},u3=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((i,r)=>{n.set(i,1e6+r)}),i=>{const r=[];let l=[];for(let c=0;c<i.length;c++){const d=i[c],h=d[0]==="[",g=n.has(d);h||g?(l.length>0&&(l.sort(),r.push(...l),l=[]),r.push(d)):l.push(d)}return l.length>0&&(l.sort(),r.push(...l)),r}},d3=e=>({cache:o3(e.cacheSize),parseClassName:c3(e),sortModifiers:u3(e),...FD(e)}),f3=/\s+/,p3=(e,n)=>{const{parseClassName:i,getClassGroupId:r,getConflictingClassGroupIds:l,sortModifiers:c}=n,d=[],h=e.trim().split(f3);let g="";for(let v=h.length-1;v>=0;v-=1){const S=h[v],{isExternal:x,modifiers:N,hasImportantModifier:_,baseClassName:T,maybePostfixModifierPosition:k}=i(S);if(x){g=S+(g.length>0?" "+g:g);continue}let E=!!k,R=r(E?T.substring(0,k):T);if(!R){if(!E){g=S+(g.length>0?" "+g:g);continue}if(R=r(T),!R){g=S+(g.length>0?" "+g:g);continue}E=!1}const V=N.length===0?"":N.length===1?N[0]:c(N).join(":"),G=_?V+Ef:V,Z=G+R;if(d.indexOf(Z)>-1)continue;d.push(Z);const X=l(R,E);for(let F=0;F<X.length;++F){const O=X[F];d.push(G+O)}g=S+(g.length>0?" "+g:g)}return g},m3=(...e)=>{let n=0,i,r,l="";for(;n<e.length;)(i=e[n++])&&(r=nS(i))&&(l&&(l+=" "),l+=r);return l},nS=e=>{if(typeof e=="string")return e;let n,i="";for(let r=0;r<e.length;r++)e[r]&&(n=nS(e[r]))&&(i&&(i+=" "),i+=n);return i},h3=(e,...n)=>{let i,r,l,c;const d=g=>{const v=n.reduce((S,x)=>x(S),e());return i=d3(v),r=i.cache.get,l=i.cache.set,c=h,h(g)},h=g=>{const v=r(g);if(v)return v;const S=p3(g,i);return l(g,S),S};return c=d,(...g)=>c(m3(...g))},g3=[],_t=e=>{const n=i=>i[e]||g3;return n.isThemeGetter=!0,n},aS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,iS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,y3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,b3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,v3=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,S3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,x3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,w3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ga=e=>y3.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),Ha=e=>!!e&&Number.isInteger(Number(e)),cf=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),ma=e=>b3.test(e),sS=()=>!0,j3=e=>v3.test(e)&&!S3.test(e),Np=()=>!1,N3=e=>x3.test(e),k3=e=>w3.test(e),A3=e=>!me(e)&&!he(e),_3=e=>ei(e,lS,Np),me=e=>aS.test(e),xi=e=>ei(e,cS,j3),Lb=e=>ei(e,M3,Oe),C3=e=>ei(e,dS,sS),z3=e=>ei(e,uS,Np),qb=e=>ei(e,rS,Np),T3=e=>ei(e,oS,k3),Pl=e=>ei(e,fS,N3),he=e=>iS.test(e),eo=e=>Ei(e,cS),E3=e=>Ei(e,uS),Ub=e=>Ei(e,rS),O3=e=>Ei(e,lS),D3=e=>Ei(e,oS),Gl=e=>Ei(e,fS,!0),R3=e=>Ei(e,dS,!0),ei=(e,n,i)=>{const r=aS.exec(e);return r?r[1]?n(r[1]):i(r[2]):!1},Ei=(e,n,i=!1)=>{const r=iS.exec(e);return r?r[1]?n(r[1]):i:!1},rS=e=>e==="position"||e==="percentage",oS=e=>e==="image"||e==="url",lS=e=>e==="length"||e==="size"||e==="bg-size",cS=e=>e==="length",M3=e=>e==="number",uS=e=>e==="family-name",dS=e=>e==="number"||e==="weight",fS=e=>e==="shadow",B3=()=>{const e=_t("color"),n=_t("font"),i=_t("text"),r=_t("font-weight"),l=_t("tracking"),c=_t("leading"),d=_t("breakpoint"),h=_t("container"),g=_t("spacing"),v=_t("radius"),S=_t("shadow"),x=_t("inset-shadow"),N=_t("text-shadow"),_=_t("drop-shadow"),T=_t("blur"),k=_t("perspective"),E=_t("aspect"),R=_t("ease"),V=_t("animate"),G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],X=()=>[...Z(),he,me],F=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],M=()=>[he,me,g],le=()=>[Ga,"full","auto",...M()],ke=()=>[Ha,"none","subgrid",he,me],Ce=()=>["auto",{span:["full",Ha,he,me]},Ha,he,me],be=()=>[Ha,"auto",he,me],tt=()=>["auto","min","max","fr",he,me],Ke=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...M()],J=()=>[Ga,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],fe=()=>[Ga,"screen","full","dvw","lvw","svw","min","max","fit",...M()],Se=()=>[Ga,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],re=()=>[e,he,me],Ze=()=>[...Z(),Ub,qb,{position:[he,me]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ue=()=>["auto","cover","contain",O3,_3,{size:[he,me]}],te=()=>[cf,eo,xi],de=()=>["","none","full",v,he,me],ae=()=>["",Oe,eo,xi],je=()=>["solid","dashed","dotted","double"],nt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[Oe,cf,Ub,qb],Ue=()=>["","none",T,he,me],Ge=()=>["none",Oe,he,me],Et=()=>["none",Oe,he,me],zn=()=>[Oe,he,me],Ot=()=>[Ga,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ma],breakpoint:[ma],color:[sS],container:[ma],"drop-shadow":[ma],ease:["in","out","in-out"],font:[A3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ma],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ma],shadow:[ma],spacing:["px",Oe],text:[ma],"text-shadow":[ma],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ga,me,he,E]}],container:["container"],columns:[{columns:[Oe,me,he,h]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:X()}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:le()}],"inset-x":[{"inset-x":le()}],"inset-y":[{"inset-y":le()}],start:[{"inset-s":le(),start:le()}],end:[{"inset-e":le(),end:le()}],"inset-bs":[{"inset-bs":le()}],"inset-be":[{"inset-be":le()}],top:[{top:le()}],right:[{right:le()}],bottom:[{bottom:le()}],left:[{left:le()}],visibility:["visible","invisible","collapse"],z:[{z:[Ha,"auto",he,me]}],basis:[{basis:[Ga,"full","auto",h,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,Ga,"auto","initial","none",me]}],grow:[{grow:["",Oe,he,me]}],shrink:[{shrink:["",Oe,he,me]}],order:[{order:[Ha,"first","last","none",he,me]}],"grid-cols":[{"grid-cols":ke()}],"col-start-end":[{col:Ce()}],"col-start":[{"col-start":be()}],"col-end":[{"col-end":be()}],"grid-rows":[{"grid-rows":ke()}],"row-start-end":[{row:Ce()}],"row-start":[{"row-start":be()}],"row-end":[{"row-end":be()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":tt()}],"auto-rows":[{"auto-rows":tt()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...Ke(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...Ke()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ke()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],"inline-size":[{inline:["auto",...fe()]}],"min-inline-size":[{"min-inline":["auto",...fe()]}],"max-inline-size":[{"max-inline":["none",...fe()]}],"block-size":[{block:["auto",...Se()]}],"min-block-size":[{"min-block":["auto",...Se()]}],"max-block-size":[{"max-block":["none",...Se()]}],w:[{w:[h,"screen",...J()]}],"min-w":[{"min-w":[h,"screen","none",...J()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[d]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",i,eo,xi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,R3,C3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",cf,me]}],"font-family":[{font:[E3,z3,n]}],"font-features":[{"font-features":[me]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,he,me]}],"line-clamp":[{"line-clamp":[Oe,"none",he,Lb]}],leading:[{leading:[c,...M()]}],"list-image":[{"list-image":["none",he,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:re()}],"text-color":[{text:re()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...je(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",he,xi]}],"text-decoration-color":[{decoration:re()}],"underline-offset":[{"underline-offset":[Oe,"auto",he,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Ze()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ha,he,me],radial:["",he,me],conic:[Ha,he,me]},D3,T3]}],"bg-color":[{bg:re()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:re()}],"gradient-via":[{via:re()}],"gradient-to":[{to:re()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...je(),"hidden","none"]}],"divide-style":[{divide:[...je(),"hidden","none"]}],"border-color":[{border:re()}],"border-color-x":[{"border-x":re()}],"border-color-y":[{"border-y":re()}],"border-color-s":[{"border-s":re()}],"border-color-e":[{"border-e":re()}],"border-color-bs":[{"border-bs":re()}],"border-color-be":[{"border-be":re()}],"border-color-t":[{"border-t":re()}],"border-color-r":[{"border-r":re()}],"border-color-b":[{"border-b":re()}],"border-color-l":[{"border-l":re()}],"divide-color":[{divide:re()}],"outline-style":[{outline:[...je(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,he,me]}],"outline-w":[{outline:["",Oe,eo,xi]}],"outline-color":[{outline:re()}],shadow:[{shadow:["","none",S,Gl,Pl]}],"shadow-color":[{shadow:re()}],"inset-shadow":[{"inset-shadow":["none",x,Gl,Pl]}],"inset-shadow-color":[{"inset-shadow":re()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:re()}],"ring-offset-w":[{"ring-offset":[Oe,xi]}],"ring-offset-color":[{"ring-offset":re()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":re()}],"text-shadow":[{"text-shadow":["none",N,Gl,Pl]}],"text-shadow-color":[{"text-shadow":re()}],opacity:[{opacity:[Oe,he,me]}],"mix-blend":[{"mix-blend":[...nt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":nt()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":re()}],"mask-image-linear-to-color":[{"mask-linear-to":re()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":re()}],"mask-image-t-to-color":[{"mask-t-to":re()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":re()}],"mask-image-r-to-color":[{"mask-r-to":re()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":re()}],"mask-image-b-to-color":[{"mask-b-to":re()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":re()}],"mask-image-l-to-color":[{"mask-l-to":re()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":re()}],"mask-image-x-to-color":[{"mask-x-to":re()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":re()}],"mask-image-y-to-color":[{"mask-y-to":re()}],"mask-image-radial":[{"mask-radial":[he,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":re()}],"mask-image-radial-to-color":[{"mask-radial-to":re()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":Z()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":re()}],"mask-image-conic-to-color":[{"mask-conic-to":re()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ze()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,me]}],filter:[{filter:["","none",he,me]}],blur:[{blur:Ue()}],brightness:[{brightness:[Oe,he,me]}],contrast:[{contrast:[Oe,he,me]}],"drop-shadow":[{"drop-shadow":["","none",_,Gl,Pl]}],"drop-shadow-color":[{"drop-shadow":re()}],grayscale:[{grayscale:["",Oe,he,me]}],"hue-rotate":[{"hue-rotate":[Oe,he,me]}],invert:[{invert:["",Oe,he,me]}],saturate:[{saturate:[Oe,he,me]}],sepia:[{sepia:["",Oe,he,me]}],"backdrop-filter":[{"backdrop-filter":["","none",he,me]}],"backdrop-blur":[{"backdrop-blur":Ue()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,he,me]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,he,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,he,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,he,me]}],"backdrop-invert":[{"backdrop-invert":["",Oe,he,me]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,he,me]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,he,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,he,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",he,me]}],ease:[{ease:["linear","initial",R,he,me]}],delay:[{delay:[Oe,he,me]}],animate:[{animate:["none",V,he,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,he,me]}],"perspective-origin":[{"perspective-origin":X()}],rotate:[{rotate:Ge()}],"rotate-x":[{"rotate-x":Ge()}],"rotate-y":[{"rotate-y":Ge()}],"rotate-z":[{"rotate-z":Ge()}],scale:[{scale:Et()}],"scale-x":[{"scale-x":Et()}],"scale-y":[{"scale-y":Et()}],"scale-z":[{"scale-z":Et()}],"scale-3d":["scale-3d"],skew:[{skew:zn()}],"skew-x":[{"skew-x":zn()}],"skew-y":[{"skew-y":zn()}],transform:[{transform:[he,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:X()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ot()}],"translate-x":[{"translate-x":Ot()}],"translate-y":[{"translate-y":Ot()}],"translate-z":[{"translate-z":Ot()}],"translate-none":["translate-none"],accent:[{accent:re()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:re()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,me]}],fill:[{fill:["none",...re()]}],"stroke-w":[{stroke:[Oe,eo,xi,Lb]}],stroke:[{stroke:["none",...re()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},L3=h3(B3);function Cn(...e){return L3(yv(e))}const q3=F0("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-zinc-50 text-black hover:bg-zinc-200",secondary:"border border-zinc-800 bg-zinc-950 text-zinc-100 hover:bg-zinc-900",ghost:"text-zinc-400 hover:bg-zinc-900 hover:text-zinc-50",outline:"border border-zinc-800 bg-transparent text-zinc-100 hover:bg-zinc-900",destructive:"bg-rose-600 text-white hover:bg-rose-700"},size:{default:"h-10 px-4 md:h-9",sm:"h-9 px-3 text-xs md:h-8",icon:"size-10 md:size-9"}},defaultVariants:{variant:"default",size:"default"}}),qe=U.forwardRef(({className:e,variant:n,size:i,asChild:r=!1,...l},c)=>{const d=r?Mw:"button";return f.jsx(d,{ref:c,className:Cn(q3({variant:n,size:i,className:e})),...l})});qe.displayName="Button";const U3=F0("inline-flex items-center rounded-md border px-2 py-0.5 text-[11px] font-medium tracking-wide",{variants:{variant:{neutral:"border-zinc-800 bg-zinc-950 text-zinc-300",success:"border-emerald-500/25 bg-emerald-500/10 text-emerald-300",warning:"border-amber-500/25 bg-amber-500/10 text-amber-300",destructive:"border-rose-500/25 bg-rose-500/10 text-rose-300"}},defaultVariants:{variant:"neutral"}});function pS({className:e,variant:n,...i}){return f.jsx("div",{className:Cn(U3({variant:n}),e),...i})}const $3=220;function $b({compact:e=!1,version:n,updateAvailable:i,onDismissUpdate:r}){const l=!e&&n&&n!=="unknown",[c,d]=U.useState(!1),h=!e&&i&&r,g=()=>{d(!0),window.setTimeout(()=>{r?.(),d(!1)},$3)};return e?f.jsxs(rt,{to:"/",className:"brand-lockup brand-lockup-compact","aria-label":"Canonry home",children:[f.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),f.jsx("span",{className:"brand-copy",children:f.jsx("span",{className:"brand-mark",children:"Canonry"})})]}):f.jsxs("div",{className:"brand-lockup brand-lockup-wrapper",children:[f.jsx(rt,{to:"/",className:"brand-icon-link","aria-label":"Canonry home",tabIndex:-1,children:f.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"})}),f.jsxs("div",{className:"brand-copy",children:[f.jsx(rt,{to:"/",className:"brand-mark",children:"Canonry"}),h?f.jsxs("span",{className:`brand-update-bubble ${c?"brand-update-bubble-closing":""}`,role:"status","aria-live":"polite",children:[f.jsxs("a",{className:"brand-update-bubble-link",href:i.url,target:"_blank",rel:"noopener noreferrer",title:`Open release: ${i.upgradeCommand}`,"aria-label":`New version v${i.latest} available — open release page`,children:[f.jsxs("span",{className:"brand-update-bubble-from",children:["v",i.current]}),f.jsx(oA,{className:"brand-update-bubble-arrow size-3","aria-hidden":"true"}),f.jsxs("span",{className:"brand-update-bubble-to",children:["v",i.latest]})]}),f.jsx("button",{type:"button",className:"brand-update-bubble-dismiss",onClick:g,"aria-label":`Dismiss update notification for v${i.latest}`,children:f.jsx(Qs,{className:"size-3","aria-hidden":"true"})})]}):l?f.jsxs("span",{className:"brand-version",children:["v",n]}):null]})]})}function I3({provider:e}){const n={gemini:"border-blue-800/50 bg-blue-950/40 text-blue-300",openai:"border-green-800/50 bg-green-950/40 text-green-300",claude:"border-amber-800/50 bg-amber-950/40 text-amber-300",perplexity:"border-teal-800/50 bg-teal-950/40 text-teal-300",local:"border-purple-800/50 bg-purple-950/40 text-purple-300"};return f.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ${n[e]??"border-zinc-700 bg-zinc-800 text-zinc-300"}`,children:e})}function Ln({tone:e,children:n,...i}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return f.jsx(pS,{variant:r,...i,children:n})}function kp({status:e}){return f.jsx(Ln,{tone:Z0(e),children:U4(e)})}const V3=gv,P3=pv,mS=U.forwardRef(({className:e,...n},i)=>f.jsx(Vf,{ref:i,className:Cn("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...n}));mS.displayName=Vf.displayName;const G3=400,H3=1200,Q3=720,hS=U.forwardRef(({className:e,children:n,...i},r)=>{const[l,c]=U.useState(Q3),d=U.useRef(!1),h=U.useRef(0),g=U.useRef(0),v=U.useCallback(N=>{d.current=!0,h.current=N.clientX,g.current=l,N.target.setPointerCapture(N.pointerId),N.preventDefault()},[l]),S=U.useCallback(N=>{if(!d.current)return;const _=h.current-N.clientX,T=Math.min(H3,Math.max(G3,g.current+_));c(T)},[]),x=U.useCallback(()=>{d.current=!1},[]);return f.jsxs(P3,{children:[f.jsx(mS,{}),f.jsxs(Pf,{ref:r,className:Cn("fixed z-50 flex flex-col bg-zinc-950 px-5 py-4 shadow-2xl overflow-hidden","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88vh] max-md:rounded-t-2xl max-md:border-t","md:inset-y-0 md:right-0 md:h-full md:border-l","border-zinc-800",e),style:{width:`min(${l}px, 100vw)`},...i,children:[f.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-zinc-700/50 active:bg-zinc-600/50 transition-colors max-md:hidden",onPointerDown:v,onPointerMove:S,onPointerUp:x}),n,f.jsxs(mv,{className:"absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-900 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400",children:[f.jsx(Qs,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});hS.displayName=Pf.displayName;const K3=({className:e,...n})=>f.jsx("div",{className:Cn("flex flex-col gap-1.5 pr-10",e),...n}),gS=U.forwardRef(({className:e,...n},i)=>f.jsx(Gf,{ref:i,className:Cn("text-lg font-medium text-zinc-50",e),...n}));gS.displayName=Gf.displayName;const yS=U.forwardRef(({className:e,...n},i)=>f.jsx(hv,{ref:i,className:Cn("text-sm text-zinc-500",e),...n}));yS.displayName=hv.displayName;function Z3({title:e,subtitle:n,children:i,open:r,onClose:l}){return f.jsx(V3,{open:r,onOpenChange:c=>c?void 0:l(),children:f.jsxs(hS,{children:[f.jsxs(K3,{className:"drawer-head",children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:n}),f.jsx(gS,{id:"drawer-title",children:e}),f.jsx(yS,{className:"sr-only",children:n})]}),f.jsx("div",{className:"drawer-body",children:i})]})})}function to({text:e}){const[n,i]=U.useState(null),r=U.useRef(null),l=U.useCallback(()=>{if(!r.current)return;const h=r.current.getBoundingClientRect();i({top:h.top,left:h.left+h.width/2})},[]),c=U.useCallback(()=>i(null),[]),d=U.useCallback(()=>{n===null?l():c()},[n,l,c]);return f.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:l,onMouseLeave:c,children:[f.jsx("button",{ref:r,type:"button",className:"info-tooltip-trigger","aria-label":e,"aria-expanded":n!==null,onFocus:l,onBlur:c,onClick:d,onKeyDown:h=>{h.key==="Escape"&&c()},children:f.jsxs("svg",{className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),n!==null&&_w.createPortal(f.jsx("span",{"aria-hidden":"true",style:{position:"fixed",top:n.top,left:n.left,transform:"translateX(-50%) translateY(calc(-100% - 8px))",zIndex:9999,pointerEvents:"none",width:"14rem",padding:"0.5rem 0.75rem",fontSize:"11px",fontWeight:400,textTransform:"none",letterSpacing:"normal",lineHeight:"1rem",color:"#d4d4d8",backgroundColor:"#18181b",border:"1px solid rgba(63, 63, 70, 0.6)",borderRadius:"0.5rem",boxShadow:"0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1)"},children:e}),document.body)]})}const Y3=/[\s\-_]+/;function X3(e){const n=e.split(Y3).filter(Boolean);return n.length===0?null:n.map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function Ib(e,n){const i=J3(n),r=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(v=>v.startsWith("**")&&v.endsWith("**")?{type:"bold",value:v.slice(2,-2)}:{type:"text",value:v}),l=i.flatMap(v=>v.terms).filter(v=>v.trim().length>1);if(l.length===0)return r.map((v,S)=>v.type==="bold"?_s.createElement("strong",{key:`b-${S}`,className:"text-zinc-200 font-semibold"},v.value):v.value).filter(Boolean);const d=[...l].sort((v,S)=>S.length-v.length).map(X3).filter(v=>!!v);if(d.length===0)return r.map((v,S)=>v.type==="bold"?_s.createElement("strong",{key:`b-${S}`,className:"text-zinc-200 font-semibold"},v.value):v.value).filter(Boolean);const h=new RegExp(`(${d.join("|")})`,"gi"),g=new Map;for(const v of i)for(const S of v.terms){const x=dc(S);x&&!g.has(x)&&g.set(x,v.className)}return r.flatMap((v,S)=>v.value.split(h).map((N,_)=>{if(!N)return null;if(_%2===1){const k=g.get(dc(N))??"answer-highlight";return v.type==="bold"?_s.createElement("mark",{key:`hl-${S}-${_}`,className:k},_s.createElement("strong",{className:"text-zinc-200 font-semibold"},N)):_s.createElement("mark",{key:`hl-${S}-${_}`,className:k},N)}return v.type==="bold"?_s.createElement("strong",{key:`b-${S}-${_}`,className:"text-zinc-200 font-semibold"},N):N})).filter(Boolean)}function J3(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Of(e){const n=(e??"").trim();return n&&(n.startsWith("/")||/^https?:\/\//i.test(n)||/^mailto:/i.test(n))?n:null}function uf(e,n){switch(e){case"new":return"First observation";case"emerging":return"First mention";case"lost":return"Lost since last run";default:return n==="mentioned"||n==="visible"?"Mentioned in latest run":n==="pending"?"Awaiting first run":"Not mentioned in latest run"}}function F3({evidence:e,project:n,onClose:i}){const[r,l]=U.useState(!1),[c,d]=U.useState("mentions"),[h,g]=U.useState(-1),[v,S]=U.useState(null),[x,N]=U.useState(!1),[_,T]=U.useState({}),k=IT(n.project),E=new Set(k.map(oc)),R=e.runHistory,V=R.length>1,[G,Z]=U.useState(null),X=U.useRef(!1);U.useEffect(()=>{if(X.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const te=R.at(-1);te&&(X.current=!0,nc(te.runId).then(de=>{const ae=de.snapshots?.find(je=>je.query===e.query&&je.provider===e.provider);ae&&Z({citationState:ae.citationState,answerMentioned:ae.answerMentioned,visibilityState:ae.visibilityState,visibilityTransition:te.visibilityTransition,provider:ae.provider,model:ae.model??e.model,answerSnippet:ae.answerText??e.answerSnippet,citedDomains:ae.citedDomains??e.citedDomains,competitorDomains:ae.competitorOverlap??e.competitorDomains,recommendedCompetitors:ae.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:ae.matchedTerms??e.matchedTerms??[],groundingSources:ae.groundingSources??e.groundingSources,searchQueries:ae.searchQueries,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,R]);const F=h>=0&&v!==null,O=F?v:G||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:R.at(-1)?.visibilityTransition,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,recommendedCompetitors:e.recommendedCompetitors??[],matchedTerms:e.matchedTerms??[],groundingSources:e.groundingSources,searchQueries:e.searchQueries??[],evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},M=O.visibilityState==="pending"||O.citationState==="pending",le=M?!1:O.visibilityState!=null?O.visibilityState==="visible":O.answerMentioned!=null?O.answerMentioned:O.citationState===lc.cited||O.citationState==="emerging",ke=O.answerMentioned!=null||O.visibilityState!=null||O.recommendedCompetitors.length>0,Ce=O.citedDomains.length>0||O.groundingSources.length>0||O.evidenceUrls.length>0,be=n.project.displayName||n.project.name,tt=[...k.map(oc),be,be.split(" ").slice(0,2).join(" "),...O.matchedTerms].filter(te=>te.trim().length>2),Ke=[...O.competitorDomains.flatMap(te=>{const de=$T(te);return de.length>=4?[de]:[]}),...O.recommendedCompetitors].filter(te=>te.trim().length>2),ee=[{terms:tt,className:"answer-highlight-brand"},...Ke.length>0?[{terms:Ke,className:"answer-highlight-competitor"}]:[]],B=M?"pending":O.visibilityTransition==="lost"?"lost":le?"mentioned":"not-mentioned",J=U.useRef(0),fe=U.useCallback(async te=>{const de=++J.current;if(te===-1||te===R.length-1){g(-1),S(null),l(!1);return}g(te),l(!1);const ae=R[te],je=`${ae.runId}::${e.query}::${e.provider}`;if(_[je]){S(_[je]);return}N(!0);try{const nt=await nc(ae.runId);if(de!==J.current)return;const xe=nt.snapshots?.find(Ge=>Ge.query===e.query&&Ge.provider===e.provider)??nt.snapshots?.find(Ge=>Ge.query===e.query),Ue=xe?{citationState:xe.citationState,answerMentioned:xe.answerMentioned,visibilityState:xe.visibilityState,visibilityTransition:ae.visibilityTransition,provider:xe.provider,model:xe.model??null,answerSnippet:xe.answerText??"",citedDomains:xe.citedDomains,competitorDomains:xe.competitorOverlap,recommendedCompetitors:xe.recommendedCompetitors??[],matchedTerms:xe.matchedTerms??[],groundingSources:xe.groundingSources,searchQueries:xe.searchQueries,evidenceUrls:[],changeLabel:uf(ae.mentionTransition??ae.visibilityTransition,ae.mentionState??ae.visibilityState),summary:""}:{citationState:ae.citationState,answerMentioned:ae.answerMentioned,visibilityState:ae.visibilityState,visibilityTransition:ae.visibilityTransition,provider:e.provider,model:ae.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],searchQueries:[],evidenceUrls:[],changeLabel:uf(ae.mentionTransition??ae.visibilityTransition,ae.mentionState??ae.visibilityState),summary:"Snapshot data not available for this run."};T(Ge=>({...Ge,[je]:Ue})),S(Ue)}catch{if(de!==J.current)return;S({citationState:ae.citationState,answerMentioned:ae.answerMentioned,visibilityState:ae.visibilityState,visibilityTransition:ae.visibilityTransition,provider:e.provider,model:ae.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],searchQueries:[],evidenceUrls:[],changeLabel:uf(ae.mentionTransition??ae.visibilityTransition,ae.mentionState??ae.visibilityState),summary:"Failed to load historical run data."})}finally{de===J.current&&N(!1)}},[R,e.query,e.provider,_]),re=(F||e.historyScope!=="provider")&&O.model?`${O.provider} (${O.model}) · ${O.changeLabel.toLowerCase()}`:`${O.provider} · ${O.changeLabel.toLowerCase()}`,Ze=!F&&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(" · "):"",W=le?{label:"Mentioned in answer",title:"Your brand or domain is mentioned in this answer",meta:re}:O.visibilityTransition==="lost"?{label:"Mention lost",title:"Your brand no longer appears in this answer",meta:re}:M?{label:"Pending",title:"Awaiting first run",meta:"No provider data yet"}:{label:"Not mentioned in answer",title:"Your brand or domain was not mentioned in this answer",meta:re},ue=()=>{if(!O.answerSnippet)return null;const te=O.answerSnippet.split(`
58
+ `),de=[];let ae=[],je=0;const nt=()=>{if(ae.length===0)return;const xe=ae.join(" ").trim();xe&&de.push(f.jsx("p",{className:de.length>0?"mt-2.5":"",children:Ib(xe,ee)},je++)),ae=[]};for(const xe of te){const Ue=xe.trim();if(/^[-\u2013\u2014]{3,}$/.test(Ue)){nt(),de.push(f.jsx("hr",{className:"border-zinc-800/60 my-3"},je++));continue}const Ge=Ue.match(/^(#{1,3})\s+(\S.*)$/);if(Ge){nt();const Et=Ge[1].length,zn=Ge[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s]+/u,"").trim()||Ge[2],Ot=Et===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":Et===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";de.push(f.jsx("p",{className:Ot,children:Ib(zn,ee)},je++));continue}if(Ue===""){nt();continue}ae.push(Ue)}return nt(),de};return f.jsx(gv,{open:!0,onOpenChange:te=>{te||i()},children:f.jsxs(pv,{children:[f.jsx(Vf,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),f.jsxs(Pf,{className:"evidence-modal","aria-describedby":void 0,children:[f.jsxs("div",{className:"evidence-modal-header",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("p",{className:"eyebrow eyebrow-soft",children:[n.project.name," ","·"," ",O.provider||"All providers"]}),f.jsx(Gf,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),f.jsxs(mv,{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:[f.jsx(Qs,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]}),V&&f.jsxs("div",{className:"evidence-modal-timeline",children:[f.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),f.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:R.map((te,de)=>{const ae=h===-1&&de===R.length-1||h===de,je=te.visibilityState??(te.answerMentioned?"visible":"not-visible"),nt=te.visibilityTransition??je,xe=je==="visible"?"bg-emerald-400":nt==="emerging"?"bg-amber-400":nt==="lost"?"bg-rose-400":"bg-zinc-600",Ge=new Date(te.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Et=!!(te.model&&de>0&&R[de-1]?.model&&R[de-1].model!==te.model);return f.jsxs("button",{type:"button",className:`evidence-run-dot ${ae?"evidence-run-dot--selected":""}`,onClick:()=>{fe(de===R.length-1?-1:de)},"aria-label":[`Run ${Ge}: ${je}`,te.model?`model ${te.model}`:null,Et?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ae,children:[f.jsx("span",{className:`size-2 rounded-full ${xe} ${Et?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),f.jsx("span",{className:"text-[10px] text-zinc-500",children:Ge})]},de)})}),h>=0&&h<R.length&&f.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(R[h].createdAt).toLocaleString()," ","—"," ",f.jsx("span",{className:"capitalize",children:R[h].visibilityState??(R[h].answerMentioned?"visible":"not-visible")}),f.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>{fe(-1)},children:["←"," Back to latest"]})]}),!F&&(e.modelTransitions?.length??0)>0&&f.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(te=>f.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:`${te.fromModel??"unknown"} -> ${te.toModel??"unknown"} on ${new Date(te.createdAt).toLocaleDateString()}`},`${te.runId}:${te.toModel??"unknown"}`))})]}),f.jsxs("div",{className:"evidence-modal-body",children:[x&&f.jsxs("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:["Loading historical run data","…"]}),!x&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"evidence-modal-main",children:[f.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${B}`,children:[f.jsx("p",{className:`evidence-position-label evidence-position-label--${B}`,children:W.label}),f.jsx("p",{className:`evidence-position-title evidence-position-title--${B}`,children:W.title}),f.jsx("p",{className:"evidence-position-meta",children:W.meta}),Ze&&f.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:Ze})]}),O.answerSnippet&&f.jsxs("div",{children:[f.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),f.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:ue()}),O.answerSnippet.length>280&&f.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>l(!r),children:r?"↑ Collapse":"↓ Show full answer"})]}),!O.answerSnippet&&!x&&f.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"}),O.searchQueries.length>0&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Web searches the model ran"}),f.jsx(to,{text:"The search queries this AI model issued while researching your prompt. They reveal how the model reformulated the question — the phrasings worth optimizing your content for. Distinct from grounding sources (what it found) and citations (what it linked)."})]}),f.jsx("ul",{className:"grid gap-1",children:O.searchQueries.map((te,de)=>f.jsxs("li",{className:"flex items-start gap-2 text-sm text-zinc-300",children:[f.jsx(QA,{className:"size-3.5 mt-0.5 shrink-0 text-zinc-600","aria-hidden":"true"}),f.jsx("span",{className:"break-words",children:te})]},`${de}-${te}`))})]}),!F&&e.relatedTechnicalSignals.length>0&&f.jsxs("div",{children:[f.jsx("p",{className:"drawer-section-label",children:le?"Why you're visible":"What to fix"}),f.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((te,de)=>f.jsxs("div",{className:"action-item",children:[f.jsx("svg",{className:`action-item-icon ${le?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:le?f.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):f.jsxs(f.Fragment,{children:[f.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),f.jsx("span",{className:"action-item-text",children:te})]},de))})]}),O.summary&&f.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:O.summary})]}),f.jsxs("div",{className:"evidence-modal-sidebar",children:[(ke||Ce)&&f.jsxs("div",{className:"sidebar-tabs",children:[f.jsx("button",{className:`sidebar-tab ${c==="mentions"?"sidebar-tab--active":""}`,onClick:()=>d("mentions"),type:"button",title:"Canonry's answer-level visibility assessment and any company names extracted from the answer text.",children:"Mentions"}),f.jsx("button",{className:`sidebar-tab ${c==="sources"?"sidebar-tab--active":""}`,onClick:()=>d("sources"),type:"button",title:"Grounding links the model used to build the answer. These are supporting sources, not the primary visibility signal.",children:"Sources"})]}),c==="mentions"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Mention in answer"}),f.jsx(to,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),f.jsxs("div",{className:`mention-status mention-status--${le?"mentioned":"not-mentioned"}`,children:[f.jsx("span",{className:"mention-status-icon",children:M?"…":le?"✓":"—"}),f.jsx("span",{className:"mention-status-label",children:M?"Pending":le?"Mentioned":"Not mentioned"})]}),O.matchedTerms.length>0&&f.jsxs("div",{className:"mt-2",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Matched in answer"}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:O.matchedTerms.map(te=>f.jsx("span",{className:"mention-chip mention-chip--brand",children:te},te))})]}),!M&&!le&&O.matchedTerms.length===0&&f.jsxs("div",{className:"mt-2",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Searched for"}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:tt.map(te=>f.jsx("span",{className:"mention-chip mention-chip--muted",children:te},te))}),f.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(O.recommendedCompetitors.length>0||O.competitorDomains.length>0)&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Competitors in answer"}),f.jsx(to,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const te=O.competitorDomains.map(je=>je.replace(/^www\./,"")),de=new Set(te.map(je=>dc(je.replace(/\.[^.]+$/,""))));return[...O.recommendedCompetitors.filter(je=>!de.has(dc(je))),...te].map(je=>f.jsx("span",{className:"mention-chip mention-chip--competitor",children:je},je))})()})]})]}),c==="sources"&&f.jsxs(f.Fragment,{children:[O.citedDomains.length>0&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Domains from source links"}),f.jsx(to,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),f.jsx("div",{className:"citation-leaderboard",children:O.citedDomains.map((te,de)=>{const ae=te.toLowerCase().replace(/^www\./,""),je=E.has(ae),nt=!je&&O.competitorDomains.some(Ue=>Ue.toLowerCase().replace(/^www\./,"")===ae),xe=je?"you":nt?"competitor":"other";return f.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${xe}`,children:[f.jsxs("span",{className:"citation-leaderboard-rank",children:["#",de+1]}),f.jsx("span",{className:"citation-leaderboard-domain",children:te}),je&&f.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),nt&&f.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},te)})})]}),O.groundingSources.length>0&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsxs("span",{children:["Grounding source links (",O.groundingSources.length,")"]}),f.jsx(to,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),f.jsx("ul",{className:"grid gap-0.5",children:O.groundingSources.map((te,de)=>{const ae=Of(te.uri),je=te.title||te.uri;return f.jsx("li",{className:"truncate text-sm",children:ae?f.jsx("a",{href:ae,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:je}):f.jsx("span",{className:"text-zinc-400",children:je})},de)})})]}),O.evidenceUrls.length>0&&f.jsxs("div",{children:[f.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),f.jsx("ul",{className:"grid gap-1",children:O.evidenceUrls.map(te=>{const de=Of(te);return f.jsx("li",{className:"truncate text-sm",children:de?f.jsx("a",{href:de,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:te}):f.jsx("span",{className:"text-zinc-400",children:te})},te)})})]}),O.citedDomains.length===0&&O.groundingSources.length===0&&O.evidenceUrls.length===0&&f.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",F?"for this run":"yet"]})]}),!ke&&!Ce&&f.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",F?"for this run":"yet"]})]})]})]})]})]})})}function Bn(e){const n=new Date("2026-02-20");return e.map((i,r)=>({runId:`run_mock_${r+1}`,citationState:i,createdAt:new Date(n.getTime()+r*2*24*60*60*1e3).toISOString()}))}const df=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],aliases:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},providers:[],locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1},{id:"project_harbor",name:"Harbor Legal Group",canonicalDomain:"harborlegal.com",ownedDomains:[],aliases:[],country:"US",language:"en",tags:["lead gen"],labels:{},providers:[],locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1},{id:"project_northstar",name:"Northstar Orthopedics",canonicalDomain:"northstarortho.com",ownedDomains:[],aliases:[],country:"US",language:"en",tags:["multi-location"],labels:{},providers:[],locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1}];function kc(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 W3=kc({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"}),eR=kc({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"}),tR=kc({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"}),nR=kc({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"}),aR=[{id:"evidence_citypoint_emergency_gemini",query:"emergency dentist brooklyn",provider:"gemini",model:"gemini-2.5-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:Bn(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",query:"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:Bn(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",query:"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:Bn(["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",query:"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:Bn(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",query:"best invisalign dentist downtown brooklyn",provider:"gemini",model:"gemini-2.5-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:Bn(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",query:"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:Bn(["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",query:"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:Bn(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",query:"pediatric dentist brooklyn heights",provider:"gemini",model:"gemini-2.5-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:Bn(["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",query:"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:Bn(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];df[0],Math.round(1/9*100),Math.round(2/9*100),df[1],Bn(["cited","cited","cited","cited","cited"]),df[2],Math.round(2/7*100),Math.round(3/7*100),Bn(["not-cited","not-cited","not-cited","cited"]);function iR(e,n){return e.runs.find(i=>i.id===n)}function sR(e,n){for(const i of e.projects){const r=i.visibilityEvidence.find(l=>l.id===n);if(r)return{project:i,evidence:r}}}function rR(e,n,i){if(e){const r=e.visibilityEvidence.find(l=>l.id===i);if(r)return{project:e,evidence:r}}if(n)return sR(n,i)}const oR={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral","gbp-lodging-gap":"negative","gbp-listing-discrepancy":"negative","gbp-cta-gap":"caution","gbp-description-missing":"caution","gbp-metric-drop":"negative","gbp-keyword-drop":"negative"},lR={opportunity:"write","persistent-gap":"write","competitor-gained":"write","competitor-lost":"write",regression:"investigate",gain:"monitor","first-citation":"monitor","provider-pickup":"monitor","gbp-lodging-gap":"write","gbp-listing-discrepancy":"write","gbp-cta-gap":"write","gbp-description-missing":"write","gbp-metric-drop":"investigate","gbp-keyword-drop":"investigate"},cR={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited","gbp-lodging-gap":"not-cited","gbp-listing-discrepancy":"not-cited","gbp-cta-gap":"not-cited","gbp-description-missing":"not-cited","gbp-metric-drop":"lost","gbp-keyword-drop":"lost"},uR={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor","gbp-lodging-gap":"Lodging gap","gbp-listing-discrepancy":"Listing gap","gbp-cta-gap":"Booking CTA","gbp-description-missing":"Description gap","gbp-metric-drop":"Metric drop","gbp-keyword-drop":"Keyword drop"};function dR(e){return{id:e.id,tone:oR[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??uR[e.type],actionGroup:lR[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:cR[e.type]}]}}function fR(e){return e.filter(n=>!n.dismissed).map(dR)}function bS(e){return{id:e.id,name:e.name,displayName:e.displayName,canonicalDomain:e.canonicalDomain,ownedDomains:e.ownedDomains??[],aliases:e.aliases??[],country:e.country,language:e.language,tags:e.tags,labels:e.labels,providers:e.providers??[],locations:e.locations??[],defaultLocation:e.defaultLocation??null,autoExtractBacklinks:e.autoExtractBacklinks??!1,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 pR(e,n){if(!e)return"Waiting";if(!n)return"Running";const i=new Date(n).getTime()-new Date(e).getTime();if(i<1e3)return"<1s";const r=Math.floor(i/1e3);if(r<60)return`${r}s`;const l=Math.floor(r/60),c=r%60;return`${l}m ${c}s`}function vS(e){switch(e){case Ne["answer-visibility"]:return"Answer visibility sweep";case Ne["gsc-sync"]:return"GSC sync";case Ne["inspect-sitemap"]:return"Sitemap inspection";case Ne["ga-sync"]:return"GA sync";case Ne["traffic-sync"]:return"Traffic sync";case Ne["bing-inspect"]:return"Bing URL inspection";case Ne["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Ne["site-audit"]:return"Site audit";case Ne["backlink-extract"]:return"Backlink extract";case Ne["aeo-discover-seed"]:return"Discovery (seed phase)";case Ne["aeo-discover-probe"]:return"Discovery (probe phase)";case Ne["gbp-sync"]:return"Business Profile sync";case Ne["ads-sync"]:return"ChatGPT ads sync"}}function mR(e){return e===Bs.manual?"Manual":e===Bs.scheduled?"Scheduled":e===Bs["config-apply"]?"Config apply":e}function Ap(e,n){return{id:e.id,projectId:e.projectId,projectName:n,kind:e.kind,kindLabel:vS(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:pR(e.startedAt??null,e.finishedAt??null),statusDetail:e.error?SS(e.error):hR(e),summary:gR(e),triggerLabel:mR(e.trigger)}}function SS(e){const n=sp(e);return n.length>200?n.slice(0,200)+"…":n}function hR(e){switch(e.status){case Ht.queued:return"Waiting for execution slot.";case Ht.running:return"Provider queries in progress.";case Ht.completed:return"All queries checked.";case Ht.partial:return"Run completed with some queries skipped.";case Ht.failed:return e.error?SS(e.error):"Run failed.";case Ht.cancelled:return"Run was cancelled.";default:return""}}function gR(e){const n=vS(e.kind);switch(e.status){case Ht.queued:return`${n} queued`;case Ht.running:return`${n} in progress`;case Ht.completed:return`${n} completed`;case Ht.partial:return`${n} partially completed`;case Ht.failed:return`${n} failed`;case Ht.cancelled:return`${n} cancelled`;default:return e.status}}function yR(e,n,i,r){const l=[];let c=0;const d=new Set;if(i.length>0){const h=i.flatMap(T=>T.snapshots??[]),g=new Map;for(const T of h)if(T.query){const k=`${T.query}::${T.provider}::${T.location??""}`;g.set(k,T)}const v=new Set(h.map(T=>T.location??null));v.size===0&&v.add(null);const S=new Set(h.map(T=>T.provider)),x=new Set(n.flatMap(T=>Object.keys(T.providerRuns??{}))),N=[...new Set([...S,...x])].sort(),_=N.length>0?N:["gemini"];for(const T of n){if(T.runs.length===0)continue;d.add(T.query);const k=T.runs.at(-1),E=k?.transition??"not-cited";for(const R of _){const V=[...v].filter(X=>g.has(`${T.query}::${R}::${X??""}`)),G=(T.providerRuns?.[R]?.length??0)>0,Z=V.length>0?V:G?[null]:[];for(const X of Z){const F=X??"",O=g.get(`${T.query}::${R}::${F}`),M=O?.model??null,le=M?`${R}:${M}`:null,ke=T.providerRuns?.[R],Ce=le?T.modelRuns?.[le]:void 0,be=Ue=>Ue?.filter(Ge=>(Ge.location??null)===X),tt=V.length>0?be(ke):ke,Ke=V.length>0?be(Ce):Ce,ee=(tt?.length?tt:null)??(Ke?.length?Ke:null),B=tt?.length?"provider":Ke?.length?"model":"query",J=ee?ee.at(-1).transition:E,fe=ee?ee.at(-1).visibilityTransition??(ee.at(-1).visibilityState==="visible"?"visible":"not-visible"):k?.visibilityTransition??(k?.visibilityState==="visible"?"visible":"not-visible"),Se=ee?.at(-1)?.citationState,re=ee?.at(-1)?.visibilityState,Ze=O?J==="lost"?"lost":J==="emerging"?"emerging":O.citationState===lc.cited?"cited":"not-cited":Se===lc.cited?"cited":"not-cited",W=O?.visibilityState??(re==="visible"?"visible":re==="pending"?"pending":"not-visible"),ue=Pb(ee||T.runs),te=Gb(ee||T.runs),de=bR(T,R),ae=(ee??T.runs).map(Ue=>({runId:Ue.runId,citationState:Ue.citationState,createdAt:Ue.createdAt,model:de.get(Ue.runId)??null,answerMentioned:Ue.answerMentioned,visibilityState:Ue.visibilityState,visibilityTransition:Ue.visibilityTransition,mentionState:Ue.mentionState,mentionTransition:Ue.mentionTransition})),je=vR(ae),nt=B==="provider"&&je.length<=1?"model":B,xe=SR(ae);l.push({id:`evidence_${e}_${c++}`,query:T.query,provider:O?.provider??R,model:O?.model??null,location:O?.location??X,citationState:Ze,answerMentioned:O?.answerMentioned,visibilityState:W,visibilityChangeLabel:Hb(fe,te,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:Hb(J,ue),answerSnippet:O?.answerText??"",citedDomains:O?.citedDomains??[],evidenceUrls:[],competitorDomains:O?.competitorOverlap??[],recommendedCompetitors:O?.recommendedCompetitors??[],matchedTerms:O?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:O?.groundingSources??[],searchQueries:O?.searchQueries??[],summary:xR(W,fe,T.query),runHistory:ae,historyScope:nt,modelsSeen:je,modelTransitions:xe})}}}}for(const h of r)d.has(h.query)||l.push({id:`evidence_${e}_${c++}`,query:h.query,provider:"",model:null,location:null,citationState:"pending",visibilityState:"pending",visibilityChangeLabel:"Awaiting first run",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],relatedTechnicalSignals:[],groundingSources:[],searchQueries:[],summary:`"${h.query}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"query",modelsSeen:[],modelTransitions:[]});return l}function bR(e,n){const i=new Map,r=`${n}:`;for(const[l,c]of Object.entries(e.modelRuns??{})){if(!l.startsWith(r))continue;const d=l.slice(r.length),h=d==="unknown"?null:d;for(const g of c)i.set(g.runId,h)}return i}function vR(e){const n=new Set;for(const i of e)i.model&&n.add(i.model);return[...n]}function SR(e){const n=[];let i=null;for(const r of e){const l=r.model??null;l!==i&&i!==null&&n.push({runId:r.runId,createdAt:r.createdAt,fromModel:i,toModel:l}),i=l}return n}function Pb(e){if(e.length===0)return 0;const n=e[e.length-1].citationState;let i=0;for(let r=e.length-1;r>=0&&e[r].citationState===n;r--)i++;return i}function Gb(e){if(e.length===0)return 0;const n=e[e.length-1].visibilityState??"not-visible";let i=0;for(let r=e.length-1;r>=0&&(e[r].visibilityState??"not-visible")===n;r--)i++;return i}function Hb(e,n,i){const r={positive:i?.positive??"cited",negative:i?.negative??"not cited",first:i?.first??"first citation"};switch(e){case"new":return"First observation";case"cited":case"visible":return n<=1?`${no(r.positive)} in latest run`:`${no(r.positive)} for ${n} runs`;case"lost":return"Lost since last run";case"emerging":return no(r.first);case"not-cited":case"not-visible":return n<=1?`${no(r.negative)} in latest run`:`${no(r.negative)} across ${n} runs`;default:return e}}function no(e){return e.charAt(0).toUpperCase()+e.slice(1)}function xR(e,n,i){switch(n){case"lost":return`Mention was lost for "${i}". Your brand no longer appeared in the latest answer.`;case"emerging":return`Your brand started appearing in AI answers for "${i}".`}switch(e){case"visible":return`Your brand or domain is mentioned in AI answers for "${i}".`;case"pending":return`"${i}" has been added but no run has been triggered yet.`;default:return`Your brand or domain was not mentioned in AI answers for "${i}".`}}function xS(e){const n=bS(e.project),i=yR(n.name,e.timeline,e.latestRunDetails,e.queries),l=[...e.runs].sort((c,d)=>d.createdAt.localeCompare(c.createdAt)).map(c=>Ap(c,e.project.displayName||e.project.name));return e.overview?wR(n,e.overview,i,l):jR(n,i,l)}function wR(e,n,i,r){const l=fR(n.topInsights);for(const c of n.attentionItems)c.id.startsWith("insight_")||l.push({id:c.id,tone:c.tone,title:c.title,detail:c.detail,actionLabel:c.actionLabel,actionGroup:"investigate",affectedPhrases:[]});return{project:e,dateRangeLabel:n.dateRangeLabel,contextLabel:n.contextLabel,mentionSummary:n.scores.mention,visibilitySummary:n.scores.visibility,mentionShareSummary:n.scores.mentionShare,queryCounts:{cited:n.queryCounts.citedQueries,total:n.queryCounts.totalQueries},gapQueries:n.scores.gapQueries,mentionGaps:n.scores.mentionGaps,indexCoverage:n.scores.indexCoverage,providerScores:n.providerScores,competitorPressure:n.scores.competitorPressure,runStatus:n.scores.runStatus,citationMovement:n.citationMovement,mentionMovement:n.mentionMovement,movementComparison:n.movementComparison,insights:l,visibilityEvidence:i,competitors:n.competitors.map(c=>({id:c.id,domain:c.domain,citationCount:c.citationCount,totalQueries:c.totalQueries,pressureLabel:c.pressureLabel,citedQueries:c.citedQueries,movement:"",notes:""})),recentRuns:r.slice(0,5),suggestedQueries:n.suggestedQueries}}function jR(e,n,i){const r={label:"",value:"No data",delta:"Loading…",tone:"neutral",description:"",tooltip:"",trend:[]};return{project:e,dateRangeLabel:"All time",contextLabel:`${e.country} / ${e.language.toUpperCase()}`,mentionSummary:{...r,label:"Mention Coverage"},visibilitySummary:{...r,label:"Citation Coverage"},mentionShareSummary:{...r,label:"Mention Share",breakdown:{projectMentionSnapshots:0,competitorMentionSnapshots:0,perCompetitor:[],snapshotsWithAnswerText:0,snapshotsTotal:0}},queryCounts:{cited:0,total:0},gapQueries:{...r,label:"Citation Gaps"},mentionGaps:{...r,label:"Mention Gaps"},indexCoverage:{...r,label:"Index Coverage"},providerScores:[],competitorPressure:{...r,label:"Competitor Pressure"},runStatus:{...r,label:"Run Status"},citationMovement:{gained:0,lost:0,tone:"neutral",hasPreviousRun:!1},mentionMovement:{gained:0,lost:0,tone:"neutral",hasPreviousRun:!1},movementComparison:{hasPreviousRun:!1,comparable:!1,querySetChanged:!1,previousRunAt:null,currentQueryCount:0,previousQueryCount:0,comparableQueryCount:0,addedQueryCount:0,removedQueryCount:0,addedQueries:[],removedQueries:[]},insights:[],visibilityEvidence:n,competitors:[],recentRuns:i.slice(0,5),suggestedQueries:{rows:[],totalCandidates:0,skippedAlreadyTracked:0}}}function NR(e){const n=bS(e.project),i=[...e.runs].sort((N,_)=>_.createdAt.localeCompare(N.createdAt)),r=i.find(N=>N.kind===Ne["answer-visibility"])??i[0],l=e.project.displayName||e.project.name,c=r?Ap(r,l):kR(e.project.id,l),d=e.overview;if(!d)return{project:n,mentionScore:0,mentionDelta:"No data",mentionTone:"neutral",lastRun:c,insight:"No runs completed yet.",trend:[],competitorPressureLabel:"None"};const h=d.scores.mention,g=h.progress??0,v=d.queryCounts.mentionedQueries,S=d.queryCounts.totalQueries,x=d.providers.length;return{project:n,mentionScore:g,mentionDelta:S>0?`${v} of ${S} queries`:"No data",mentionTone:h.tone,providerCoverage:h.providerCoverage,lastRun:c,insight:S>0?`${v} of ${S} queries mentioned across ${x} provider${x===1?"":"s"}.`:"No runs completed yet.",trend:h.trend??[],competitorPressureLabel:d.scores.competitorPressure.value}}function kR(e,n){return{id:"none",projectId:e,projectName:n,kind:Ne["answer-visibility"],kindLabel:"No runs yet",status:Ht.queued,trigger:Bs.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function AR(e,n){const i=[],r=[],l=[];for(const d of e){r.push(xS(d)),l.push(NR(d));const h=[...d.runs].sort((g,v)=>v.createdAt.localeCompare(g.createdAt));for(const g of h)i.push(Ap(g,d.project.displayName||d.project.name))}i.sort((d,h)=>h.createdAt.localeCompare(d.createdAt));const c=e.length>0;return{portfolioOverview:{projects:l,attentionItems:c?_R(r):[{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:i.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 query set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:r,runs:i,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"},queryImportState:{mode:"paste",queryCount: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:(n?.providers??[]).map(d=>({name:d.name,displayName:d.displayName,keyUrl:d.keyUrl,modelHint:d.modelHint,model:d.model,defaultModel:d.defaultModel,state:d.configured?"ready":"needs-config",detail:d.configured?"Provider is configured.":"API key is missing.",quota:d.quota})),google:{state:n?.google?.configured?"ready":"needs-config",detail:n?.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:n?.bing?.configured?"ready":"needs-config",detail:n?.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 _R(e){const n=[];for(const i of e){const r=i.visibilityEvidence.filter(c=>c.citationState==="lost");r.length>0&&n.push({id:`attention_${i.project.id}_lost`,tone:"negative",title:`${i.project.displayName||i.project.name} lost citations`,detail:`${r.length} quer${r.length>1?"ies":"y"} lost citation.`,actionLabel:"Open project",href:`/projects/${i.project.id}`});const l=i.recentRuns.filter(c=>c.status===Ht.running||c.status===Ht.queued);l.length>0&&n.push({id:`attention_${i.project.id}_active`,tone:"neutral",title:`${i.project.displayName||i.project.name} has active runs`,detail:`${l.length} run${l.length>1?"s":""} in progress.`,actionLabel:"View runs",href:"/runs"})}return n.length===0&&n.push({id:"attention_stable",tone:"positive",title:"All projects stable",detail:"No citation losses or active runs to flag."}),n}const wS=U.createContext(null);wS.Provider;function go(){return U.useContext(wS)}function Ac(e){const i=go()?.dashboard??null,r=dn({...Sp({client:se}),enabled:!i,refetchInterval:Xk}),l=dn({...wp({client:se,query:{kind:"answer-visibility"}}),enabled:!i,staleTime:lo,refetchInterval:T=>T.state.data?.some(R=>R.status==="running"||R.status==="queued")?3e3:lo}),c=dn({...Y4({client:se}),enabled:!i}),d=r.data??[],h=l.data??[],g=Cw({queries:d.map(T=>{const k=h.filter(V=>V.projectId===T.id),E=k.filter(V=>(V.status==="completed"||V.status==="partial")&&V.kind==="answer-visibility"&&V.trigger!=="probe").sort((V,G)=>G.createdAt.localeCompare(V.createdAt)),R=E.length>0?E[0].id:"no-run";return{queryKey:["project-overview-slim",T.id,R],queryFn:async()=>{const V=await Ev(T.name).catch(()=>null);return{project:T,runs:k,queries:[],competitors:[],timeline:[],latestRunDetails:[],previousRunDetails:[],gscCoverage:null,bingCoverage:null,dbInsights:null,overview:V}},enabled:!i&&r.isSuccess&&l.isSuccess,staleTime:jf}})}),v=g.every(T=>T.isSuccess),S=U.useMemo(()=>{if(i)return i;if(!r.data||!l.data||d.length>0&&!v)return null;const T=g.map(k=>k.data?{...k.data,runs:h.filter(E=>E.projectId===k.data.project.id)}:null).filter(k=>k!=null);return AR(T,c.data??null)},[i,r.data,l.data,c.data,v,g,d.length,h]),x=!i&&(r.isError||l.isError),N=!i&&!S&&!x,_=U.useCallback(async()=>{await Promise.all([r.refetch(),l.refetch(),c.refetch()])},[r.refetch,l.refetch,c.refetch]);return{dashboard:S,isLoading:N,isError:x,refetch:_}}function CR(e){const n=go(),i=U.useMemo(()=>!n||!e?null:n.dashboard.projects.find(T=>T.project.name===e)??null,[n,e]),r=dn({...Q4({client:se,path:{name:e??""}}),enabled:!!e&&!i,staleTime:jf,refetchOnWindowFocus:"always"}),l=dn({...wp({client:se,query:{kind:"answer-visibility"}}),enabled:!!e,staleTime:lo,refetchOnWindowFocus:"always",refetchInterval:T=>T.state.data?.some(R=>R.projectId===r.data?.id&&(R.status==="running"||R.status==="queued"))?3e3:lo}),c=r.data??null,d=U.useMemo(()=>c?(l.data??[]).filter(T=>T.projectId===c.id):[],[c,l.data]),{latestRunIds:h,previousRunIds:g,latestRunIdsKey:v}=U.useMemo(()=>{const T=d.filter(G=>(G.status==="completed"||G.status==="partial")&&G.kind==="answer-visibility"&&G.trigger!=="probe").sort((G,Z)=>Z.createdAt.localeCompare(G.createdAt)),k=T[0]?.createdAt??null,E=k?T.filter(G=>G.createdAt===k).map(G=>G.id):[],R=T.find(G=>G.createdAt!==k)?.createdAt??null,V=R?T.filter(G=>G.createdAt===R).map(G=>G.id):[];return{latestRunIds:E,previousRunIds:V,latestRunIdsKey:[...E].sort().join(",")}},[d]),S=dn({queryKey:["project-dashboard-full",c?.id??null,v||"none"],queryFn:async()=>{if(!c||!e)return null;const[T,k,E,R,V,G,Z,X,F]=await Promise.all([Sk(e).catch(()=>[]),xk(e).catch(()=>[]),wk(e).catch(()=>[]),h.length?Promise.all(h.map(O=>nc(O).catch(()=>null))).then(O=>O.filter(M=>M!=null)):Promise.resolve([]),g.length?Promise.all(g.map(O=>nc(O).catch(()=>null))).then(O=>O.filter(M=>M!=null)):Promise.resolve([]),Mk(e).catch(()=>null),qk(e).catch(()=>null),$k(e).catch(()=>null),Ev(e).catch(()=>null)]);return{project:c,runs:d,queries:T,competitors:k,timeline:E,latestRunDetails:R,previousRunDetails:V,gscCoverage:G,bingCoverage:Z,dbInsights:X,overview:F}},enabled:!!c&&!!e&&l.isSuccess,staleTime:jf,refetchOnWindowFocus:"always",refetchInterval:Jk}),x=U.useMemo(()=>S.data?xS({...S.data,runs:d}):i||null,[S.data,d,i]),N=U.useCallback(async()=>{await Promise.all([r.refetch(),l.refetch(),S.refetch()])},[r.refetch,l.refetch,S.refetch]),_=!x&&(r.isLoading||l.isLoading||S.isLoading);return{commandCenter:x,project:c,isLoading:_,isError:r.isError||l.isError||S.isError,refetch:N}}const zR=["health"];async function TR(){const e=await Vk("/health","API"),n=e.state==="ok"?{label:"Worker",state:"ok",detail:"In-process job runner"}:{label:"Worker",state:e.state,detail:`Depends on API health check · ${e.detail}`,statusCode:e.statusCode,hint:e.hint?`Worker status is inferred from API health in this deployment mode. ${e.hint}`:"Worker status is inferred from API health in this deployment mode."};return{apiStatus:e,workerStatus:n}}function _p(e,n){return dn({queryKey:zR,queryFn:TR,enabled:e,refetchInterval:15e3,initialData:n})}function ER(e){return dn({...K0({client:se,path:{id:e??""}}),enabled:!!e,refetchInterval:n=>{const i=n.state.data?.status;return i==="running"||i==="queued"?3e3:!1}})}function Cp(){const e=hc(),n=zw({strict:!1}),i=Tw({select:g=>g.location.pathname}),r=n.runId??null,l=n.evidenceId??null;return{runId:r,evidenceId:l,openRun:g=>{e({to:i,from:tn.to,search:v=>({...v,runId:g,evidenceId:void 0})})},openEvidence:g=>{e({to:i,from:tn.to,search:v=>({...v,evidenceId:g,runId:void 0})})},closeDrawer:()=>{e({to:i,from:tn.to,search:g=>({...g,runId:void 0,evidenceId:void 0})})}}}const OR={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function DR(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function RR(){const e=U.useSyncExternalStore(Zk,Zy,Zy),n=hc(),{openRun:i}=Cp(),r=U.useCallback(c=>{wf(c)},[]),l=U.useCallback(c=>{c.cta&&(c.cta.intent==="open-run-drawer"?i(c.cta.runId):n({to:"/runs"}),wf(c.id))},[n,i]);return e.length===0?null:f.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(c=>f.jsxs("section",{role:c.tone==="negative"?"alert":"status","aria-live":c.tone==="negative"?"assertive":"polite","data-state":c.state,className:`toast-card ${OR[c.tone]}`,children:[f.jsxs("div",{className:"toast-copy",children:[f.jsx("p",{className:"toast-title",children:c.title}),c.detail?f.jsx("p",{className:"toast-detail",children:c.detail}):null,c.cta?f.jsx("button",{type:"button",className:"toast-action",onClick:()=>l(c),"aria-label":DR(c),children:c.cta.label}):null]}),f.jsx("button",{type:"button",onClick:()=>r(c.id),className:"toast-dismiss","aria-label":"Dismiss",children:f.jsx(Qs,{className:"size-3.5"})})]},c.id))})}function MR(e,n={}){const{threshold:i=80}=n,r=U.useRef(null),l=U.useRef({scrollHeight:0,wasAtEnd:!0});function c(g){return g.scrollHeight-g.scrollTop-g.clientHeight}function d(){const g=r.current;return g?c(g)<=i:!0}function h(){const g=r.current;g&&(g.scrollTop=g.scrollHeight,l.current.wasAtEnd=!0,l.current.scrollHeight=g.scrollHeight)}return U.useEffect(()=>{const g=r.current;if(!g)return;const v=()=>{l.current.wasAtEnd=c(g)<=i};return g.addEventListener("scroll",v,{passive:!0}),()=>g.removeEventListener("scroll",v)},[i]),U.useLayoutEffect(()=>{const g=r.current;if(!g)return;const v=g.scrollHeight;v>l.current.scrollHeight&&l.current.wasAtEnd&&(g.scrollTop=v),l.current.scrollHeight=v},e),U.useEffect(()=>{const g=r.current;if(!g||typeof ResizeObserver>"u")return;const v=new ResizeObserver(()=>{const S=g.scrollHeight;S>l.current.scrollHeight&&l.current.wasAtEnd&&(g.scrollTop=S),l.current.scrollHeight=S});return v.observe(g),g.firstElementChild&&v.observe(g.firstElementChild),()=>v.disconnect()},[]),{ref:r,scrollToEnd:h,isAtEnd:d}}async function zp(e){try{return await e.json()}catch{return{}}}function BR(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Tp=BR();function Ep(e){e===401&&Hf()}async function Qb(e){const n=await fetch(`${Tp}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!n.ok){Ep(n.status);const i=await zp(n);throw new Hn(i.error?.message??`transcript fetch failed: ${n.status}`,n.status,i.error?.code)}return await n.json()}async function LR(e){const n=await fetch(`${Tp}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!n.ok){Ep(n.status);const i=await zp(n);throw new Hn(i.error?.message??`reset failed: ${n.status}`,n.status,i.error?.code)}}async function qR({project:e,prompt:n,provider:i,modelId:r,scope:l,signal:c,onEvent:d}){const h={prompt:n};i&&(h.provider=i),r&&(h.modelId=r),l&&(h.scope=l);const g=await fetch(`${Tp}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(h),signal:c});if(!g.ok||!g.body){Ep(g.status);const _=await zp(g);throw new Hn(_.error?.message??`prompt failed: ${g.status}`,g.status,_.error?.code)}const v=g.body.getReader(),S=new TextDecoder;let x="";const N=()=>{v.cancel().catch(()=>{})};c?.addEventListener("abort",N,{once:!0});try{for(;;){const{value:_,done:T}=await v.read();if(T)break;x+=S.decode(_,{stream:!0});let k=x.indexOf(`
59
59
 
60
60
  `);for(;k!==-1;){const E=x.slice(0,k);x=x.slice(k+2);for(const R of E.split(`
61
61
  `)){if(!R.startsWith("data:"))continue;const V=R.slice(5).trim();if(V)try{d(JSON.parse(V))}catch{}}k=x.indexOf(`
62
62
 
63
- `)}}}finally{c?.removeEventListener("abort",N);try{b.releaseLock()}catch{}}}function jS(e){return!e||e.role!=="assistant"?"":e.content.filter(n=>n.type==="text").map(n=>n.text).join("")}const DR=[{label:"Status",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{label:"Top insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{label:"Last failed run",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{label:"Schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"}],RR=[{command:"/status",label:"Status",hint:"Latest runs, health, anything unusual",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{command:"/insights",label:"Top insights",hint:"Walk through the most severe active insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{command:"/last-run",label:"Last run",hint:"Summarize the latest sweep",prompt:"Summarize the latest run for this project — provider mix, visibility changes, and anything that moved."},{command:"/last-failed",label:"Last failed run",hint:"Diagnose the most recent failure",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{command:"/run-sweep",label:"Run sweep now",hint:"Trigger a new visibility sweep",prompt:"Run a new answer-visibility sweep for this project now and tell me when it lands."},{command:"/schedule",label:"Schedule",hint:"Review the sweep schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"},{command:"/queries",label:"Queries",hint:"List tracked queries",prompt:"List the tracked queries for this project and flag any that are obvious duplicates or underperformers."},{command:"/competitors",label:"Competitors",hint:"List tracked competitors",prompt:"List this project's tracked competitors and call out which ones are showing up in answer citations."},{command:"/clear",label:"Clear conversation",hint:"Wipe transcript and start fresh",action:"clear"}],Hl=e=>`canonry:aero:provider:${e}`,Qb=e=>`canonry:aero:scope:${e}`;function MR({projectName:e}){const[n,i]=U.useState(!1),[r,l]=U.useState(!1),[c,d]=U.useState([]),[h,g]=U.useState(""),[b,S]=U.useState(!1),[x,N]=U.useState([]),[_,T]=U.useState(""),[k,E]=U.useState(null),[R,V]=U.useState(()=>typeof window>"u"?null:window.localStorage.getItem(Hl(e))??null),[G,Z]=U.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(Qb(e))==="all"?"all":"read-only"),X=U.useRef(null),{ref:F}=zR([c,_,x]),O=U.useRef(null),[M,le]=U.useState(0),ke=U.useMemo(()=>{const W=h.trimStart();if(!W.startsWith("/"))return[];if(/\s/.test(W))return[];const ue=W.toLowerCase();return RR.filter(te=>te.command.startsWith(ue)||te.label.toLowerCase().includes(ue.slice(1)))},[h]);U.useEffect(()=>{le(W=>ke.length===0?0:Math.min(W,ke.length-1))},[ke.length]);const _e=dn({..._D({client:se,path:{name:e}}),enabled:n,staleTime:6e4}),be=U.useMemo(()=>{const W=_e.data?.providers??[];if(R){const te=W.find(de=>de.id===R&&de.configured);if(te)return te}const ue=_e.data?.defaultProvider;return ue?W.find(te=>te.id===ue)??null:null},[R,_e.data]);U.useEffect(()=>{if(!_e.data||!R)return;_e.data.providers.find(ue=>ue.id===R&&ue.configured)||(V(null),window.localStorage.removeItem(Hl(e)))},[_e.data,R,e]);const tt=U.useCallback(W=>{V(W),!(typeof window>"u")&&(W?window.localStorage.setItem(Hl(e),W):window.localStorage.removeItem(Hl(e)))},[e]),Ke=U.useCallback(()=>{Z(W=>{const ue=W==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(Qb(e),ue),ue})},[e]);U.useEffect(()=>{if(!n)return;const W=ue=>{ue.key==="Escape"&&(r?l(!1):i(!1))};return window.addEventListener("keydown",W),()=>window.removeEventListener("keydown",W)},[n,r]),U.useEffect(()=>{if(!n)return;let W=!1;E(null);const ue=()=>{W||b||Hb(e).then(ae=>{W||d(ae.messages)}).catch(ae=>{W||E(ae instanceof Error?ae.message:"Failed to load transcript")})};ue();const de=window.setInterval(ue,15e3);return()=>{W=!0,window.clearInterval(de)}},[n,e,b]),U.useEffect(()=>()=>{X.current?.abort()},[e]);async function ee(W){const ue=W.trim();if(!ue||b)return;E(null),g(""),S(!0),T(""),N([]);const te={role:"user",content:ue,timestamp:Date.now()};d(ae=>[...ae,te]);const de=new AbortController;X.current=de;try{await OR({project:e,prompt:ue,provider:R??void 0,scope:G,signal:de.signal,onEvent:B});const ae=await Hb(e);d(ae.messages)}catch(ae){ae.name!=="AbortError"&&E(ae instanceof Error?ae.message:"Prompt failed")}finally{S(!1),T(""),X.current=null}}function B(W){switch(W.type){case"message_update":T(jS(W.message));break;case"message_end":W.message.role==="assistant"&&T("");break;case"tool_execution_start":N(ue=>[...ue,{id:W.toolCallId,name:W.toolName,args:W.args,startedAt:Date.now()}]);break;case"tool_execution_end":N(ue=>ue.map(te=>te.id===W.toolCallId?{...te,endedAt:Date.now(),isError:W.isError,result:W.result}:te));break;case"error":E(W.message);break}}async function J(){X.current?.abort();try{await ER(e),d([]),E(null)}catch(W){E(W instanceof Error?W.message:"Reset failed")}}const fe=c.length===0,Se=n&&r?"pointer-events-auto fixed inset-0 z-40 flex items-stretch justify-center bg-zinc-950/70 p-4 sm:p-8 backdrop-blur-sm":"pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center p-3",re=r?"pointer-events-auto flex h-full w-full max-w-5xl flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-2xl":"pointer-events-auto w-full max-w-3xl",Ze=r?"flex-1 overflow-y-auto px-6 py-5 text-sm text-zinc-200":"max-h-[40vh] min-h-[120px] overflow-y-auto px-4 py-3 text-sm text-zinc-200";return f.jsx("div",{className:Se,onClick:W=>{r&&W.target===W.currentTarget&&l(!1)},children:f.jsx("div",{className:re,children:n?f.jsxs("div",{className:r?"flex h-full flex-col":"flex flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-xl backdrop-blur",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-zinc-800/70 px-4 py-2.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Jy,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),f.jsx("span",{className:"text-sm font-medium text-zinc-100",children:"Aero"}),f.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:b?"working…":e})]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(BR,{providers:_e.data?.providers??[],active:be,override:R,onPick:tt,disabled:b}),f.jsx("button",{type:"button",onClick:wn(J),className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Reset conversation",title:"Reset conversation",children:f.jsx(Rv,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),f.jsx("button",{type:"button",onClick:()=>l(W=>!W),className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":r?"Collapse":"Expand",title:r?"Collapse":"Expand",children:r?f.jsx(DA,{className:"h-3.5 w-3.5","aria-hidden":"true"}):f.jsx(zA,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),f.jsx("button",{type:"button",onClick:()=>{l(!1),i(!1)},className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Close Aero",children:f.jsx(Qs,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),f.jsxs("div",{ref:F,className:Ze,children:[k&&f.jsx("div",{className:"mb-2 rounded-md border border-rose-700/40 bg-rose-950/40 px-3 py-2 text-xs text-rose-200",children:k}),fe&&!b&&f.jsxs("div",{className:"flex flex-col gap-3 py-2",children:[f.jsxs("p",{className:"text-xs text-zinc-500",children:["Ask anything about ",f.jsx("span",{className:"text-zinc-300",children:e}),", or start with:"]}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:DR.map(W=>f.jsx("button",{type:"button",onClick:()=>{ee(W.prompt)},className:"rounded-full border border-zinc-800 bg-zinc-900/70 px-3 py-1 text-xs text-zinc-300 transition hover:border-zinc-700 hover:bg-zinc-800/70 hover:text-zinc-100",children:W.label},W.label))})]}),IR(c,e,R,G),x.length>0&&f.jsx("div",{className:"mt-3 space-y-1.5",children:x.map(W=>f.jsx(NS,{trail:W},W.id))}),b&&_&&f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),f.jsx(kS,{content:_})]}),b&&!_&&x.every(W=>W.endedAt!==void 0)&&f.jsx(HR,{})]}),f.jsx(LR,{projectName:e,activeProvider:be,scope:G,onToggleScope:Ke,disabled:b}),f.jsxs("div",{className:"relative",children:[ke.length>0&&f.jsx(qR,{matches:ke,selectedIndex:M,onHover:le,onPick:W=>{g(""),O.current?.focus(),W.action==="clear"?J():ee(W.prompt)}}),f.jsxs("form",{className:"flex items-end gap-2 border-t border-zinc-800/70 bg-zinc-950/80 px-3 py-2.5",onSubmit:W=>{if(W.preventDefault(),ke.length>0){const ue=ke[M];g(""),ue.action==="clear"?J():ee(ue.prompt);return}ee(h)},children:[f.jsx("textarea",{ref:O,value:h,onChange:W=>g(W.target.value),onKeyDown:W=>{if(ke.length>0){if(W.key==="ArrowDown"){W.preventDefault(),le(ue=>(ue+1)%ke.length);return}if(W.key==="ArrowUp"){W.preventDefault(),le(ue=>(ue-1+ke.length)%ke.length);return}if(W.key==="Tab"){W.preventDefault();const ue=ke[M];g(`${ue.command} `);return}if(W.key==="Escape"){W.preventDefault(),g("");return}}if(W.key==="Enter"&&!W.shiftKey)if(W.preventDefault(),ke.length>0){const ue=ke[M];g(""),ue.action==="clear"?J():ee(ue.prompt)}else ee(h)},placeholder:"Ask Aero, or / for commands…",disabled:b,rows:r?3:1,className:"flex-1 resize-none bg-transparent text-sm text-zinc-100 placeholder:text-zinc-600 focus:outline-none disabled:opacity-60"}),f.jsx("button",{type:"submit",disabled:b||!h.trim(),className:"inline-flex h-7 w-7 items-center justify-center rounded-md bg-emerald-500 text-zinc-950 transition hover:bg-emerald-400 disabled:opacity-40","aria-label":"Send",children:f.jsx(oA,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}):f.jsxs("button",{type:"button",onClick:()=>i(!0),className:"flex w-full items-center justify-between rounded-full border border-zinc-800/80 bg-zinc-950/95 px-4 py-2 text-left text-sm text-zinc-400 shadow-lg backdrop-blur transition hover:border-zinc-700 hover:bg-zinc-900/90 hover:text-zinc-200",children:[f.jsxs("span",{className:"flex items-center gap-2",children:[f.jsx(Jy,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),"Ask Aero about ",e,"…"]}),f.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-600",children:"Enter"})]})})})}function BR({providers:e,active:n,override:i,onPick:r,disabled:l}){const[c,d]=U.useState(!1),h=U.useRef(null);if(U.useEffect(()=>{if(!c)return;const S=N=>{h.current?.contains(N.target)||d(!1)},x=N=>{N.key==="Escape"&&d(!1)};return window.addEventListener("mousedown",S),window.addEventListener("keydown",x),()=>{window.removeEventListener("mousedown",S),window.removeEventListener("keydown",x)}},[c]),e.length===0)return null;const g=n?.label.replace(/\s+\(.+\)$/,"")??"No provider",b=n?.defaultModel;return f.jsxs("div",{ref:h,className:"relative",children:[f.jsxs("button",{type:"button",onClick:()=>d(S=>!S),disabled:l,className:"flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-zinc-400 transition hover:bg-zinc-800/60 hover:text-zinc-200 disabled:opacity-50","aria-label":"Switch agent model","aria-haspopup":"listbox","aria-expanded":c,title:n?`${n.label} · ${n.defaultModel}`:"Pick a provider",children:[f.jsx("span",{className:"font-medium text-zinc-200",children:g}),b&&f.jsx("span",{className:"hidden font-mono text-[10px] text-zinc-500 sm:inline",children:b}),f.jsx(fA,{className:"h-3 w-3","aria-hidden":"true"})]}),c&&f.jsxs("div",{role:"listbox",className:"absolute right-0 top-full z-50 mt-1 w-64 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950 shadow-xl",children:[f.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-2 text-[10px] uppercase tracking-wider text-zinc-500",children:"Aero provider"}),f.jsx("ul",{className:"max-h-72 overflow-y-auto py-1",children:e.map(S=>{const x=n?.id===S.id,N=i===S.id;return f.jsx("li",{children:f.jsxs("button",{type:"button",role:"option","aria-selected":x,disabled:!S.configured,onClick:()=>{S.configured&&(r(N?null:S.id),d(!1))},className:"flex w-full items-start gap-2 px-3 py-2 text-left text-xs transition enabled:hover:bg-zinc-900 disabled:cursor-not-allowed disabled:opacity-50",children:[f.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:x?f.jsx(Dv,{className:"h-3 w-3 text-emerald-400","aria-hidden":"true"}):null}),f.jsxs("span",{className:"flex-1",children:[f.jsxs("span",{className:"flex items-center gap-1.5",children:[f.jsx("span",{className:"font-medium text-zinc-100",children:S.label}),N&&f.jsx("span",{className:"rounded-full border border-emerald-800/60 bg-emerald-950/60 px-1.5 text-[9px] uppercase tracking-wider text-emerald-300",children:"Pinned"}),!S.configured&&f.jsx("span",{className:"rounded-full border border-zinc-800 px-1.5 text-[9px] uppercase tracking-wider text-zinc-500",children:"Key missing"})]}),f.jsx("span",{className:"mt-0.5 block font-mono text-[10px] text-zinc-500",children:S.defaultModel}),S.keySource==="env"&&f.jsx("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:"via env var"}),!S.configured&&f.jsxs("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:["Add key in config.yaml or export"," ",f.jsx("code",{className:"font-mono text-zinc-400",children:UR(S.id)})]})]})]})},S.id)})}),i&&f.jsx("button",{type:"button",onClick:()=>{r(null),d(!1)},className:"w-full border-t border-zinc-800/60 px-3 py-2 text-left text-[11px] text-zinc-400 transition hover:bg-zinc-900 hover:text-zinc-100",children:"Reset to auto-detected default"})]})]})}function LR({projectName:e,activeProvider:n,scope:i,onToggleScope:r,disabled:l}){const c=n?.label.replace(/\s+\(.+\)$/,"")??null,d=i==="all";return f.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-t border-zinc-800/70 bg-zinc-950/80 px-3 pt-2",children:[f.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[f.jsx("span",{className:"text-zinc-600",children:"project"}),f.jsx("span",{className:"font-medium text-zinc-200",children:e})]}),c&&f.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[f.jsx("span",{className:"text-zinc-600",children:"model"}),f.jsx("span",{className:"font-medium text-zinc-200",children:c})]}),f.jsxs("button",{type:"button",onClick:r,disabled:l,className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] transition disabled:opacity-50 ${d?"border-amber-800/60 bg-amber-950/40 text-amber-300 hover:border-amber-700 hover:text-amber-200":"border-zinc-800 bg-zinc-900/70 text-zinc-400 hover:border-zinc-700 hover:text-zinc-200"}`,title:d?"Aero can invoke write tools (run sweep, dismiss insight, etc). Click to restrict.":"Aero is restricted to read-only tools. Click to allow writes.",children:[f.jsx("span",{className:d?"text-amber-500":"text-zinc-600",children:"scope"}),f.jsx("span",{className:"font-medium",children:d?"all tools":"read-only"})]})]})}function qR({matches:e,selectedIndex:n,onHover:i,onPick:r}){return f.jsxs("div",{className:"absolute inset-x-3 bottom-full mb-2 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950/98 shadow-2xl",children:[f.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-1.5 text-[10px] uppercase tracking-wider text-zinc-500",children:"Commands"}),f.jsx("ul",{role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:e.map((l,c)=>{const d=c===n;return f.jsx("li",{children:f.jsxs("button",{type:"button",role:"option","aria-selected":d,onMouseEnter:()=>i(c),onClick:()=>r(l),className:`flex w-full items-center gap-3 px-3 py-1.5 text-left text-xs transition ${d?"bg-zinc-900 text-zinc-100":"text-zinc-300 hover:bg-zinc-900/60"}`,children:[f.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:l.command}),f.jsx("span",{className:"font-medium",children:l.label}),f.jsx("span",{className:"ml-auto text-[10px] text-zinc-500",children:l.hint})]})},l.command)})}),f.jsxs("div",{className:"border-t border-zinc-800/60 px-3 py-1.5 text-[10px] text-zinc-600",children:[f.jsx("span",{className:"mr-3",children:"↑↓ to select"}),f.jsx("span",{className:"mr-3",children:"Enter to run"}),f.jsx("span",{children:"Tab to autocomplete"})]})]})}function UR(e){switch(e){case"claude":return"ANTHROPIC_API_KEY";case"openai":return"OPENAI_API_KEY";case"gemini":return"GOOGLE_API_KEY";case"zai":return"ZAI_API_KEY"}}function $R(e,n){const i=e.timestamp??0;return`${e.role}:${i}:${n}`}function IR(e,n,i,r){const l=[];for(let c=0;c<e.length;c++){const d=e[c],h=$R(d,c);if(d.role==="user"){const g=typeof d.content=="string"?d.content:JSON.stringify(d.content);if(g.startsWith("[system]"))continue;l.push(f.jsx(VR,{text:g,projectName:n,providerOverride:i,scope:r},h));continue}if(d.role==="assistant"){const g=new Map;let b=c+1;for(;b<e.length&&e[b].role==="toolResult";){const N=e[b];g.set(N.toolCallId,N),b++}const S=GR(d,g,d.timestamp??0),x=jS(d);l.push(f.jsxs(U.Fragment,{children:[S.length>0&&f.jsx("div",{className:"mt-3 space-y-1.5",children:S.map(N=>f.jsx(NS,{trail:N},N.id))}),x.trim()&&f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),f.jsx(kS,{content:x})]})]},h)),c=b-1;continue}}return l}function VR({text:e,projectName:n,providerOverride:i,scope:r}){const[l,c]=U.useState(!1),d=U.useMemo(()=>PR(n,e,i,r),[n,e,i,r]);async function h(){try{await navigator.clipboard.writeText(d),c(!0),window.setTimeout(()=>c(!1),1500)}catch{}}return f.jsxs("div",{className:"group relative mt-3 rounded-md bg-zinc-900/60 px-3 py-2 text-zinc-200",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsx("div",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"You"}),f.jsx("button",{type:"button",onClick:wn(h),className:"inline-flex items-center gap-1 rounded border border-zinc-800/70 bg-zinc-950/60 px-1.5 py-0.5 text-[10px] text-zinc-400 opacity-0 transition hover:border-zinc-700 hover:text-zinc-100 group-hover:opacity-100 focus:opacity-100","aria-label":"Copy as CLI command",title:d,children:l?f.jsxs(f.Fragment,{children:[f.jsx(Dv,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):f.jsxs(f.Fragment,{children:[f.jsx(hA,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),f.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function PR(e,n,i,r){const l=["canonry","agent","ask",Kb(e),Kb(n)];return i&&l.push("--provider",i),r==="read-only"&&l.push("--scope","read-only"),l.join(" ")}function Kb(e){return`'${e.replace(/'/g,"'\\''")}'`}function GR(e,n,i){const r=[];for(const l of e.content){if(l.type!=="toolCall")continue;const c=l,d=n.get(c.id);r.push({id:c.id,name:c.name,args:c.arguments,startedAt:i,endedAt:d?.timestamp,isError:d?.isError,result:d?.content})}return r}function NS({trail:e}){const[n,i]=U.useState(!1),r=e.endedAt===void 0,l=!r&&e.isError===!0,c=e.endedAt!=null?e.endedAt-e.startedAt:null,d=c==null||c<0?null:c<1e3?`${c}ms`:`${(c/1e3).toFixed(1)}s`,h=l?"border-rose-800/50":r?"border-emerald-800/50":"border-zinc-800/70",g=l?"bg-rose-950/20":r?"bg-emerald-950/20":"bg-zinc-900/40";return f.jsxs("div",{className:`rounded-md border ${h} ${g} font-mono`,children:[f.jsxs("button",{type:"button",onClick:()=>i(b=>!b),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left","aria-expanded":n,children:[f.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:r?f.jsx(_A,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):l?f.jsx(Mv,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):f.jsx(YA,{className:"h-3 w-3 text-zinc-500","aria-hidden":"true"})}),f.jsx("span",{className:"text-[11px] font-semibold text-zinc-100",children:e.name}),f.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px] text-zinc-500",children:[r?f.jsx("span",{className:"text-emerald-400",children:"running…"}):f.jsxs(f.Fragment,{children:[f.jsx("span",{children:l?"failed":"ok"}),d&&f.jsx("span",{children:d})]}),f.jsx(Yf,{className:`h-3 w-3 transition-transform ${n?"rotate-90":""}`,"aria-hidden":"true"})]})]}),n&&f.jsxs("div",{className:"border-t border-zinc-800/60 px-2.5 py-2 text-[11px] text-zinc-400",children:[f.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:"Args"}),f.jsx("pre",{className:"mb-2 overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:Zb(e.args)}),!r&&e.result!==void 0&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:l?"Error":"Result"}),f.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:Zb(e.result)})]})]})]})}function Zb(e){try{const n=typeof e=="string"?e:JSON.stringify(e,null,2);return n.length>2e3?`${n.slice(0,2e3)}
64
- … (${n.length-2e3} more chars)`:n}catch{return String(e)}}function kS({content:e}){return f.jsx("div",{className:"aero-markdown text-zinc-100",children:f.jsx(Bw,{components:{h1:n=>f.jsx("h1",{...n,className:"mt-3 mb-2 text-base font-semibold text-zinc-50"}),h2:n=>f.jsx("h2",{...n,className:"mt-3 mb-2 text-sm font-semibold text-zinc-50"}),h3:n=>f.jsx("h3",{...n,className:"mt-3 mb-1.5 text-sm font-semibold text-zinc-100"}),h4:n=>f.jsx("h4",{...n,className:"mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-zinc-300"}),p:n=>f.jsx("p",{...n,className:"mb-2 leading-relaxed"}),ul:n=>f.jsx("ul",{...n,className:"mb-2 ml-4 list-disc space-y-1"}),ol:n=>f.jsx("ol",{...n,className:"mb-2 ml-4 list-decimal space-y-1"}),li:n=>f.jsx("li",{...n,className:"marker:text-zinc-600"}),strong:n=>f.jsx("strong",{...n,className:"font-semibold text-zinc-50"}),em:n=>f.jsx("em",{...n,className:"text-zinc-200"}),code:({children:n,...i})=>f.jsx("code",{...i,className:"rounded bg-zinc-800/70 px-1 py-0.5 font-mono text-[12px] text-emerald-200",children:n}),pre:n=>f.jsx("pre",{...n,className:"mb-2 overflow-x-auto rounded-md border border-zinc-800 bg-zinc-900/70 p-3 font-mono text-xs text-zinc-200"}),a:n=>f.jsx("a",{...n,className:"text-emerald-400 underline decoration-emerald-700 hover:decoration-emerald-400",target:"_blank",rel:"noopener noreferrer"}),table:n=>f.jsx("div",{className:"mb-2 overflow-x-auto",children:f.jsx("table",{...n,className:"w-full border-collapse text-xs"})}),thead:n=>f.jsx("thead",{...n,className:"border-b border-zinc-800"}),th:n=>f.jsx("th",{...n,className:"px-2 py-1 text-left font-semibold text-zinc-300"}),tr:n=>f.jsx("tr",{...n,className:"border-b border-zinc-900"}),td:n=>f.jsx("td",{...n,className:"px-2 py-1 text-zinc-200"}),blockquote:n=>f.jsx("blockquote",{...n,className:"mb-2 border-l-2 border-zinc-700 pl-3 italic text-zinc-400"}),hr:()=>f.jsx("hr",{className:"my-3 border-zinc-800"})},children:e})})}function HR(){return f.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[f.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),f.jsxs("div",{className:"flex items-center gap-1","aria-label":"Aero is thinking",children:[f.jsx("span",{className:"aero-dot h-1.5 w-1.5 rounded-full bg-emerald-400/80"}),f.jsx("span",{className:"aero-dot aero-dot-2 h-1.5 w-1.5 rounded-full bg-emerald-400/60"}),f.jsx("span",{className:"aero-dot aero-dot-3 h-1.5 w-1.5 rounded-full bg-emerald-400/40"})]})]})}function QR(){const e=uv(),n=/^\/projects\/([^/]+)/.exec(e.pathname),i=n?decodeURIComponent(n[1]):null,r=dn({...vp({client:se}),enabled:i!==null,staleTime:6e4});if(!i)return null;const l=r.data??[],c=l.find(d=>d.id===i)??l.find(d=>d.name===i);return c?f.jsx(MR,{projectName:c.name},c.name):null}function wi(e,n){e.invalidateQueries({predicate:i=>{const r=i.queryKey[0];return typeof r?._id=="string"&&r._id.startsWith(n)}})}function fo(e,n,i){switch(e.invalidateQueries({queryKey:Sp({client:se})}),e.invalidateQueries({queryKey:Js({client:se})}),n){case Ne["answer-visibility"]:case Ne["site-audit"]:case Ne["backlink-extract"]:return;case Ne["gsc-sync"]:case Ne["inspect-sitemap"]:wi(e,"getApiV1ProjectsByNameGoogleGsc");return;case Ne["ga-sync"]:wi(e,"getApiV1ProjectsByNameGa");return;case Ne["traffic-sync"]:wi(e,"getApiV1ProjectsByNameGa"),wi(e,"getApiV1ProjectsByNameTraffic");return;case Ne["bing-inspect"]:case Ne["bing-inspect-sitemap"]:wi(e,"getApiV1ProjectsByNameBing");return;case Ne["aeo-discover-seed"]:case Ne["aeo-discover-probe"]:return;case Ne["gbp-sync"]:wi(e,"getApiV1ProjectsByNameGbp");return;case Ne["ads-sync"]:wi(e,"getApiV1ProjectsByNameAds");return;default:return n}}const Yb=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:vA},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:cA},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:yA}],Xb=e=>({label:e,state:"checking",detail:"Checking service health"}),KR={apiStatus:Xb("API"),workerStatus:Xb("Worker")};function AS(e){switch(e){case Ne["answer-visibility"]:return"Visibility sweep";case Ne["gsc-sync"]:return"GSC sync";case Ne["inspect-sitemap"]:return"Sitemap inspection";case Ne["ga-sync"]:return"GA sync";case Ne["traffic-sync"]:return"Traffic sync";case Ne["bing-inspect"]:return"Bing URL inspection";case Ne["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Ne["site-audit"]:return"Site audit";case Ne["backlink-extract"]:return"Backlink extract";case Ne["aeo-discover-seed"]:return"Discovery (seed phase)";case Ne["aeo-discover-probe"]:return"Discovery (probe phase)";case Ne["gbp-sync"]:return"Business Profile sync";case Ne["ads-sync"]:return"ChatGPT ads sync"}}function ZR(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function YR(e){const n=AS(e.kind);return e.status==="completed"?`${n} completed`:e.status==="partial"?`${n} completed with partial results`:e.status==="cancelled"?`${n} cancelled`:`${n} failed`}function XR(e,n){return e.error?`${n}: ${ip(e.error)}`:e.location?`${n} · ${e.location}`:n}function Jb(e,n,i){if(n)return n;const r=i.find(l=>l.id===e);return r?.displayName||r?.name||e}function JR(e,n){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,n>0?`${n} skipped at queue time`:null].filter(Boolean).join(", ")}function FR(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function WR(){const e=Ja(),n=U.useSyncExternalStore(BD,_i,_i),i=Object.keys(n.runs).length>0||Object.keys(n.batches).length>0,r=dn({...xp({client:se}),enabled:i,staleTime:lo,refetchInterval:3e3}),l=dn({...vp({client:se}),enabled:i}),c=U.useRef({}),d=U.useCallback(()=>{r.refetch()},[r.refetch]);return U.useEffect(()=>{i&&d()},[i,d]),U.useEffect(()=>{if(!i||typeof window>"u")return;const h=()=>{document.visibilityState==="visible"&&d()};return window.addEventListener("focus",d),document.addEventListener("visibilitychange",h),()=>{window.removeEventListener("focus",d),document.removeEventListener("visibilitychange",h)}},[i,d]),U.useEffect(()=>{const h=r.data??[],g=l.data??[],b=Object.fromEntries(h.map(x=>[x.id,x])),S=Object.fromEntries(h.map(x=>[x.id,x.status]));for(const x of Object.values(n.runs)){const N=b[x.runId];if(!N||!UD(N.status)||(c.current[N.id]??x.lastAnnouncedStatus)===N.status)continue;const T=g.find(E=>E.id===N.projectId);if(T&&fo(e,N.kind,T.name),x.sourceAction==="run-all"){lf(N.id);continue}const k=Jb(N.projectId,x.projectLabel,g);en({title:YR(N),detail:XR(N,k),tone:ZR(N.status),dedupeKey:`run:${N.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:N.id}}),lf(N.id)}if(r.data!==void 0){const x=new Set(h.map(_=>_.id)),N=ID(Object.values(n.runs),x,Date.now(),$D);for(const _ of N){const T=g.find(k=>k.id===_.projectId);T&&fo(e,_.kind,T.name),_.sourceAction!=="run-all"&&en({title:`${AS(_.kind)} status unavailable`,detail:Jb(_.projectId,_.projectLabel,g),tone:"neutral",dedupeKey:`run-stale:${_.runId}`,dedupeMode:"replace"}),lf(_.runId)}}for(const x of Object.values(n.batches)){const N=VD(x.runIds,b);N.finished&&(en({title:"Run-all batch finished",detail:JR(N,x.skippedCount),tone:FR(N),dedupeKey:`batch:${x.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),qD(x.batchId))}c.current=S},[l.data,r.data,n,e]),null}function eM(){const e=go(),{dashboard:n,isLoading:i,refetch:r}=Ac(),d=Ap(!e,e?.health).data??e?.health??KR,h=uv(),{runId:g,evidenceId:b,closeDrawer:S}=_p(),[x,N]=U.useState(!1),[_,T]=U.useState(()=>{if(typeof window>"u")return null;try{return window.localStorage.getItem("canonry:dismissedUpdateVersion")}catch{return null}}),[k]=U.useState(()=>typeof window>"u"?null:new URLSearchParams(window.location.search).get("force-update")),E=k?{current:d.apiStatus.version??"0.0.0",latest:k,url:"https://www.npmjs.com/package/@ainyc/canonry",upgradeCommand:"npm install -g @ainyc/canonry"}:d.apiStatus.updateAvailable,R=E&&E.latest!==_,V=()=>{if(E){try{window.localStorage.setItem("canonry:dismissedUpdateVersion",E.latest)}catch{}T(E.latest)}},G=kR(g),Z=G.data??null,X=G.isLoading;U.useEffect(()=>{Z&&Z.status!=="running"&&Z.status!=="queued"&&r()},[Z?.status,r]),U.useEffect(()=>{N(!1)},[h.pathname]),U.useEffect(()=>{if(typeof window>"u"||!g&&!b)return;const ee=B=>{B.key==="Escape"&&S()};return window.addEventListener("keydown",ee),()=>{window.removeEventListener("keydown",ee)}},[g,b,S]);const F=n??e?.dashboard??null,O=h.pathname==="/setup"&&F!==null&&F.portfolioOverview.projects.length===0,M=g&&F?F3(F,g):void 0,le=U.useMemo(()=>h.pathname.match(/^\/projects\/([^/]+)/)?.[1]??null,[h.pathname]),ke=U.useMemo(()=>!le||!F?null:F.projects.find(ee=>ee.project.id===le)?.project.name??null,[le,F]),{commandCenter:_e}=wR(ke),be=U.useMemo(()=>{if(b)return eR(_e,F,b)},[b,_e,F]),tt=(()=>{const ee=h.pathname;if(ee==="/")return"Portfolio";if(ee==="/projects")return"Projects";if(ee==="/runs")return"Runs";if(ee==="/settings")return"Settings";if(ee==="/setup")return"Setup";if(ee==="/backlinks")return"Backlinks";if(ee==="/traffic"||ee.startsWith("/traffic/"))return"Server traffic";if(ee.startsWith("/projects/")){const J=ee.split("/").filter(Boolean)[1];if(J&&F){const fe=F.projects.find(Se=>Se.project.id===J);if(fe)return fe.project.name}return"Project"}return"Not found"})(),Ke=U.useMemo(()=>dk(),[]);if(Ke){const ee=!Ke.views||Ke.views.includes(L4(h.pathname));return f.jsxs("div",{className:"app-shell app-shell-embed",style:$4(Ke.theme),children:[f.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),f.jsx("main",{id:"content",className:"page-shell",children:ee?f.jsx(bf,{}):f.jsx("div",{className:"embed-view-unavailable",role:"status",children:"This view is not available in embed mode."})})]})}return f.jsxs("div",{className:`app-shell ${O?"app-shell-focus":""}`,children:[f.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),!O&&f.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[f.jsx("div",{className:"sidebar-brand",children:f.jsx(Ub,{version:d.apiStatus.version,updateAvailable:R?E:null,onDismissUpdate:V})}),f.jsxs("nav",{className:"sidebar-nav",children:[f.jsxs(rt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(jA,{className:"sidebar-icon"}),f.jsx("span",{children:"Overview"})]}),f.jsxs(rt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[f.jsx(xA,{className:"sidebar-icon"}),f.jsx("span",{children:"Projects"})]}),f.jsxs(rt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(MA,{className:"sidebar-icon"}),f.jsx("span",{children:"Runs"})]}),f.jsxs(rt,{to:"/traffic",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[f.jsx(qA,{className:"sidebar-icon"}),f.jsx("span",{children:"Server traffic"})]}),f.jsxs(rt,{to:"/backlinks",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(kA,{className:"sidebar-icon"}),f.jsx("span",{children:"Backlinks"})]}),f.jsxs(rt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(QA,{className:"sidebar-icon"}),f.jsx("span",{children:"Settings"})]}),i?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(ee=>f.jsxs("div",{className:"sidebar-skeleton-item",children:[f.jsx("span",{className:"skeleton-circle size-2"}),f.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+ee*15}%`}})]},ee))]}):F&&F.projects.length>0?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Projects"}),F.projects.map(ee=>{const B=ee.visibilitySummary.tone;return f.jsxs(rt,{to:"/projects/$projectId",params:{projectId:ee.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[f.jsx("span",{className:`sidebar-dot sidebar-dot-${B}`}),f.jsx("span",{children:ee.project.displayName||ee.project.name})]},ee.project.id)})]}):i?null:f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Resources"}),f.jsxs(rt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(IA,{className:"sidebar-icon"}),f.jsx("span",{children:"Setup"})]})]})]}),f.jsx("div",{className:"sidebar-footer",children:Yb.map(({label:ee,href:B,Icon:J})=>f.jsx("a",{className:"sidebar-footer-icon",href:B,target:"_blank",rel:"noopener noreferrer",title:ee,"aria-label":ee,children:f.jsx(J,{className:"size-4"})},B))})]}),f.jsxs("div",{className:"main-area",children:[f.jsxs("header",{className:"topbar",children:[f.jsxs("div",{className:"topbar-left",children:[f.jsx("div",{className:"topbar-brand-mobile",children:f.jsx(Ub,{compact:!0})}),f.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[f.jsx(rt,{to:"/",children:"Home"}),f.jsx(Yf,{className:"breadcrumb-sep size-3"}),f.jsx("span",{className:"breadcrumb-current",children:tt})]})]}),f.jsxs("div",{className:"topbar-actions",children:[f.jsxs("div",{className:"health-pill-row",children:[f.jsxs("span",{className:`health-pill health-pill-${d.apiStatus.state}`,title:Is(d.apiStatus),children:["API ",d.apiStatus.state==="ok"?"ok":d.apiStatus.state]}),f.jsxs("span",{className:`health-pill health-pill-${d.workerStatus.state}`,title:Is(d.workerStatus),children:["Worker ",d.workerStatus.state==="ok"?"ok":d.workerStatus.state]})]}),f.jsxs(qe,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":x,"aria-controls":"mobile-nav",onClick:()=>N(ee=>!ee),children:[f.jsx(EA,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),f.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${x?"mobile-nav-open":""}`,children:[f.jsxs(qe,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>N(!1),children:[f.jsx(Qs,{className:"size-5"}),f.jsx("span",{className:"sr-only",children:"Close navigation"})]}),f.jsx(rt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),f.jsx(rt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),f.jsx(rt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),f.jsx(rt,{to:"/traffic",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Server traffic"}),f.jsx(rt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),F&&F.projects.length>0?f.jsxs("div",{className:"mobile-nav-section",children:[f.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),F.projects.map(ee=>f.jsx(rt,{to:"/projects/$projectId",params:{projectId:ee.project.id},className:"mobile-nav-link",children:ee.project.name},ee.project.id))]}):null]}),f.jsx("main",{id:"content",className:"page-shell",children:i&&!e?f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-40"}),f.jsx("div",{className:"skeleton-text-sm w-72"})]}),f.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(ee=>f.jsxs("div",{className:"page-skeleton-card",children:[f.jsx("div",{className:"skeleton-text w-24"}),f.jsx("div",{className:"skeleton-text w-full"}),f.jsx("div",{className:"skeleton-text-sm w-3/4"})]},ee))}),f.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(ee=>f.jsxs("div",{className:"page-skeleton-card",children:[f.jsx("div",{className:"skeleton-text w-20"}),f.jsx("div",{className:"space-y-2",children:[1,2,3].map(B=>f.jsx("div",{className:"skeleton-text-sm w-full"},B))})]},ee))})]}):f.jsx(bf,{})}),f.jsxs("footer",{className:"footer",children:[f.jsxs("span",{className:"footer-brand",children:[f.jsx("span",{children:f.jsx("a",{href:"https://canonry.ai",children:"Canonry"})}),d.apiStatus.version&&d.apiStatus.version!=="unknown"?f.jsxs("span",{className:"footer-version",children:["v",d.apiStatus.version]}):null]}),f.jsx("div",{className:"footer-links",children:Yb.map(({label:ee,href:B,Icon:J})=>f.jsx("a",{href:B,target:"_blank",rel:"noopener noreferrer",title:ee,"aria-label":ee,className:"footer-icon",children:f.jsx(J,{className:"size-3.5"})},B))})]})]}),M?f.jsxs(V3,{open:!0,title:M.summary,subtitle:`${M.projectName} · ${M.kindLabel}`,onClose:S,children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[f.jsx(Np,{status:M.status}),f.jsx("span",{className:"text-zinc-400",children:M.startedAt}),f.jsx("span",{className:"text-zinc-500",children:M.duration}),f.jsx("span",{className:"text-zinc-600",children:M.triggerLabel})]}),M.status==="failed"&&M.statusDetail&&f.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:M.statusDetail}),f.jsxs("div",{className:"mt-4",children:[f.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),X?f.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):Z?.snapshots&&Z.snapshots.length>0?f.jsxs("div",{className:"space-y-2",children:[Z.snapshots.map(ee=>f.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[f.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:ee.query??"Unknown query"}),f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx(M3,{provider:ee.provider}),f.jsx(pS,{variant:ee.citationState===lc.cited?"success":"neutral",children:ee.citationState})]})]}),ee.model&&f.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:ee.model}),ee.citedDomains.length>0&&f.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[f.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",ee.citedDomains.join(", ")]}),ee.competitorOverlap.length>0&&f.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",ee.competitorOverlap.join(", ")]}),ee.groundingSources&&ee.groundingSources.length>0&&f.jsxs("details",{className:"mt-2",children:[f.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[ee.groundingSources.length," grounding source",ee.groundingSources.length!==1?"s":""]}),f.jsx("ul",{className:"mt-1 space-y-0.5",children:ee.groundingSources.map((B,J)=>{const fe=Of(B.uri),Se=B.title||B.uri;return f.jsx("li",{className:"text-xs text-zinc-500 truncate",children:fe?f.jsx("a",{href:fe,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:Se}):f.jsx("span",{children:Se})},J)})})]}),ee.answerText&&f.jsxs("details",{className:"mt-1",children:[f.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),f.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:ee.answerText})]})]},ee.id)),Z.status==="running"&&f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[f.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Running remaining queries..."]})]}):Z&&Z.status==="running"?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[f.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first query result..."]}):Z&&Z.status==="queued"?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[f.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):Z&&Z.error?f.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[f.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),f.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:R4(Z.error)})]}):f.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,be?f.jsx(Q3,{evidence:be.evidence,project:be.project,onClose:S}):null,f.jsx(WR,{}),f.jsx(CR,{}),f.jsx(QR,{})]})}class tM extends U.Component{state={error:null};static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,i){console.error("[ErrorBoundary]",n,i.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?f.jsx("div",{className:"page-container",children:f.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[f.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:f.jsx(Mv,{className:"size-6 text-rose-400"})}),f.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),f.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),f.jsxs("div",{className:"flex gap-3 mt-2",children:[f.jsxs(qe,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[f.jsx(Rv,{className:"size-3.5 mr-1.5"}),"Try again"]}),f.jsx(qe,{variant:"secondary",size:"sm",onClick:()=>{const n=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=n||"/"},children:"Go home"})]})]})}):this.props.children}}const jn=U.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Cn("rounded-xl border border-zinc-800 bg-zinc-950/75 shadow-[0_0_0_1px_rgba(255,255,255,0.01)]",e),...n}));jn.displayName="Card";const Df=U.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Cn("flex flex-col gap-1.5 p-5",e),...n}));Df.displayName="CardHeader";const Rf=U.forwardRef(({className:e,...n},i)=>f.jsx("h3",{ref:i,className:Cn("font-medium tracking-tight text-zinc-50",e),...n}));Rf.displayName="CardTitle";const Mf=U.forwardRef(({className:e,...n},i)=>f.jsx("p",{ref:i,className:Cn("text-sm text-zinc-500",e),...n}));Mf.displayName="CardDescription";const Fl=U.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Cn("p-5 pt-0",e),...n}));Fl.displayName="CardContent";function nM({points:e,tone:n}){const i=U.useId();if(e.length===0)return null;const r=42,l=132,c=5,d=Math.min(...e),g=Math.max(...e)-d||1,b=l-c*2,S=r-c*2,x=e.map((N,_)=>{const T=c+_/Math.max(e.length-1,1)*b,k=c+(1-(N-d)/g)*S;return`${T},${k}`}).join(" ");return f.jsxs("svg",{className:`sparkline sparkline-${n}`,viewBox:`0 0 ${l} ${r}`,"aria-hidden":"true",children:[f.jsx("defs",{children:f.jsx("clipPath",{id:i,children:f.jsx("rect",{x:c,y:c,width:b,height:S,rx:"8"})})}),f.jsx("line",{className:"sparkline-guide",x1:c,x2:l-c,y1:r-c,y2:r-c}),f.jsx("polyline",{clipPath:`url(#${i})`,points:x,vectorEffect:"non-scaling-stroke"})]})}function aM({project:e}){return f.jsxs(rt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[f.jsx("div",{className:"project-row-chart",children:f.jsx(nM,{points:e.trend,tone:Z0(e.lastRun.status)})}),f.jsxs("div",{className:"project-row-primary",children:[f.jsxs("div",{children:[f.jsx("p",{className:"project-name",children:e.project.name}),f.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),f.jsx("p",{className:"project-insight",children:e.insight})]}),f.jsx("div",{className:"project-row-stat",children:f.jsxs("div",{className:"metric-inline-block",children:[f.jsx("p",{className:"metric-inline-label",children:"Mentioned"}),f.jsx("p",{className:`metric-inline-value ${e.mentionTone==="caution"?"text-amber-400":""}`,children:e.mentionScore}),f.jsx("p",{className:"metric-inline-delta",children:e.mentionDelta}),e.providerCoverage&&f.jsx("p",{className:"text-[10px] font-medium text-amber-400/80",children:e.providerCoverage})]})}),f.jsx("div",{className:"project-row-stat",children:f.jsxs("div",{className:"metric-inline-block",children:[f.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),f.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel})]})}),f.jsx("span",{className:"project-row-link",children:f.jsx(Yf,{className:"h-4 w-4 text-zinc-500"})})]})}function iM(){const e=go(),{dashboard:n,isLoading:i}=Ac(),r=n??e?.dashboard;if(!r||i)return f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-32"}),f.jsx("div",{className:"skeleton-text-sm w-64"})]}),f.jsx("div",{className:"space-y-3",children:[1,2,3].map(S=>f.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[f.jsxs("div",{className:"flex-1 space-y-2",children:[f.jsx("div",{className:"skeleton-text w-36"}),f.jsx("div",{className:"skeleton-text-sm w-48"})]}),f.jsx("div",{className:"skeleton-text w-16"}),f.jsx("div",{className:"skeleton-text w-16"}),f.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},S))})]});const l=r.portfolioOverview,h=Ap(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},g=zD(l.systemHealth,h,r.settings),{openRun:b}=_p();return f.jsxs("div",{className:"page-container",children:[f.jsxs("div",{className:"page-header",children:[f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Portfolio"}),f.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),f.jsx("div",{className:"page-header-right",children:f.jsx("p",{className:"text-[11px] text-zinc-600",children:l.lastUpdatedAt})})]}),l.projects.length>0?f.jsx("div",{className:"project-list project-list-scrollable",children:l.projects.map(S=>f.jsx(aM,{project:S},S.project.id))}):f.jsxs(jn,{className:"surface-card empty-card",children:[f.jsx("h3",{children:l.emptyState?.title??"No projects yet"}),f.jsx("p",{className:"supporting-copy",children:l.emptyState?.detail}),f.jsx(qe,{size:"sm",asChild:!0,children:f.jsx(rt,{to:l.emptyState?.ctaHref==="/setup"||!l.emptyState?.ctaHref?"/setup":"/",children:l.emptyState?.ctaLabel??"Launch setup"})})]}),f.jsxs("div",{className:"overview-secondary-grid",children:[l.attentionItems.length>0&&f.jsxs("section",{className:"overview-secondary-section",children:[f.jsx("div",{className:"section-head section-head-inline",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),f.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),f.jsx("div",{className:"attention-list attention-list-scrollable",children:l.attentionItems.map(S=>S.href?f.jsxs(rt,{to:S.href,className:`attention-item attention-item-${S.tone}`,children:[f.jsxs("div",{children:[f.jsx("p",{className:"attention-title",children:S.title}),f.jsx("p",{className:"attention-detail",children:S.detail})]}),S.actionLabel&&f.jsx("span",{className:"attention-action",children:S.actionLabel})]},S.id):f.jsxs("div",{className:`attention-item attention-item-static attention-item-${S.tone}`,children:[f.jsxs("div",{children:[f.jsx("p",{className:"attention-title",children:S.title}),f.jsx("p",{className:"attention-detail",children:S.detail})]}),S.actionLabel&&f.jsx("span",{className:"attention-action",children:S.actionLabel})]},S.id))})]}),f.jsxs("section",{className:"overview-secondary-section",children:[f.jsx("div",{className:"section-head section-head-inline",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),f.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),f.jsx("div",{className:"compact-stack compact-stack-scrollable",children:l.recentRuns.length>0?l.recentRuns.map(S=>f.jsxs("button",{className:"compact-run",type:"button",onClick:()=>b(S.id),children:[f.jsxs("div",{children:[f.jsx("p",{className:"compact-run-title",children:S.projectName}),f.jsx("p",{className:"compact-run-detail",children:S.summary})]}),f.jsx(Np,{status:S.status})]},S.id)):f.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),f.jsxs("section",{className:"page-section",children:[f.jsx("div",{className:"section-head section-head-inline",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),f.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),f.jsx("div",{className:"health-grid",children:g.map(S=>f.jsxs(jn,{className:"surface-card compact-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:S.label}),f.jsx("h3",{children:S.detail})]}),f.jsx(Ln,{tone:S.tone,title:S.id==="api"?Is(h.apiStatus):S.id==="worker"?Is(h.workerStatus):void 0,children:S.label})]}),f.jsx("p",{className:"supporting-copy",children:S.meta})]},S.id))})]})]})}const Ep=Symbol.for("yaml.alias"),Bf=Symbol.for("yaml.document"),Za=Symbol.for("yaml.map"),_S=Symbol.for("yaml.pair"),Qn=Symbol.for("yaml.scalar"),Fs=Symbol.for("yaml.seq"),An=Symbol.for("yaml.node.type"),Oi=e=>!!e&&typeof e=="object"&&e[An]===Ep,_c=e=>!!e&&typeof e=="object"&&e[An]===Bf,yo=e=>!!e&&typeof e=="object"&&e[An]===Za,St=e=>!!e&&typeof e=="object"&&e[An]===_S,at=e=>!!e&&typeof e=="object"&&e[An]===Qn,bo=e=>!!e&&typeof e=="object"&&e[An]===Fs;function bt(e){if(e&&typeof e=="object")switch(e[An]){case Za:case Fs:return!0}return!1}function vt(e){if(e&&typeof e=="object")switch(e[An]){case Ep:case Za:case Qn:case Fs:return!0}return!1}const CS=e=>(at(e)||bt(e))&&!!e.anchor,ji=Symbol("break visit"),sM=Symbol("skip children"),ro=Symbol("remove node");function Ws(e,n){const i=rM(n);_c(e)?Os(null,e.contents,i,Object.freeze([e]))===ro&&(e.contents=null):Os(null,e,i,Object.freeze([]))}Ws.BREAK=ji;Ws.SKIP=sM;Ws.REMOVE=ro;function Os(e,n,i,r){const l=oM(e,n,i,r);if(vt(l)||St(l))return lM(e,r,l),Os(e,l,i,r);if(typeof l!="symbol"){if(bt(n)){r=Object.freeze(r.concat(n));for(let c=0;c<n.items.length;++c){const d=Os(c,n.items[c],i,r);if(typeof d=="number")c=d-1;else{if(d===ji)return ji;d===ro&&(n.items.splice(c,1),c-=1)}}}else if(St(n)){r=Object.freeze(r.concat(n));const c=Os("key",n.key,i,r);if(c===ji)return ji;c===ro&&(n.key=null);const d=Os("value",n.value,i,r);if(d===ji)return ji;d===ro&&(n.value=null)}}return l}function rM(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 oM(e,n,i,r){if(typeof i=="function")return i(e,n,r);if(yo(n))return i.Map?.(e,n,r);if(bo(n))return i.Seq?.(e,n,r);if(St(n))return i.Pair?.(e,n,r);if(at(n))return i.Scalar?.(e,n,r);if(Oi(n))return i.Alias?.(e,n,r)}function lM(e,n,i){const r=n[n.length-1];if(bt(r))r.items[e]=i;else if(St(r))e==="key"?r.key=i:r.value=i;else if(_c(r))r.contents=i;else{const l=Oi(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${l} parent`)}}const cM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},uM=e=>e.replace(/[!,[\]{}]/g,n=>cM[n]);class Gt{constructor(n,i){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Gt.defaultYaml,n),this.tags=Object.assign({},Gt.defaultTags,i)}clone(){const n=new Gt(this.yaml,this.tags);return n.docStart=this.docStart,n}atDocument(){const n=new Gt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Gt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Gt.defaultTags);break}return n}add(n,i){this.atNextDocument&&(this.yaml={explicit:Gt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Gt.defaultTags),this.atNextDocument=!1);const r=n.trim().split(/[ \t]+/),l=r.shift();switch(l){case"%TAG":{if(r.length!==2&&(i(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[c,d]=r;return this.tags[c]=d,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return i(0,"%YAML directive should contain exactly one part"),!1;const[c]=r;if(c==="1.1"||c==="1.2")return this.yaml.version=c,!0;{const d=/^\d+\.\d+$/.test(c);return i(6,`Unsupported YAML version ${c}`,d),!1}}default:return i(0,`Unknown directive ${l}`,!0),!1}}tagName(n,i){if(n==="!")return"!";if(n[0]!=="!")return i(`Not a valid tag: ${n}`),null;if(n[1]==="<"){const d=n.slice(2,-1);return d==="!"||d==="!!"?(i(`Verbatim tags aren't resolved, so ${n} is invalid.`),null):(n[n.length-1]!==">"&&i("Verbatim tags must end with a >"),d)}const[,r,l]=n.match(/^(.*!)([^!]*)$/s);l||i(`The ${n} tag has no suffix`);const c=this.tags[r];if(c)try{return c+decodeURIComponent(l)}catch(d){return i(String(d)),null}return r==="!"?n:(i(`Could not resolve tag: ${n}`),null)}tagString(n){for(const[i,r]of Object.entries(this.tags))if(n.startsWith(r))return i+uM(n.substring(r.length));return n[0]==="!"?n:`!<${n}>`}toString(n){const i=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let l;if(n&&r.length>0&&vt(n.contents)){const c={};Ws(n.contents,(d,h)=>{vt(h)&&h.tag&&(c[h.tag]=!0)}),l=Object.keys(c)}else l=[];for(const[c,d]of r)c==="!!"&&d==="tag:yaml.org,2002:"||(!n||l.some(h=>h.startsWith(d)))&&i.push(`%TAG ${c} ${d}`);return i.join(`
65
- `)}}Gt.defaultYaml={explicit:!1,version:"1.2"};Gt.defaultTags={"!!":"tag:yaml.org,2002:"};function zS(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const i=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(i)}return!0}function TS(e){const n=new Set;return Ws(e,{Value(i,r){r.anchor&&n.add(r.anchor)}}),n}function ES(e,n){for(let i=1;;++i){const r=`${e}${i}`;if(!n.has(r))return r}}function dM(e,n){const i=[],r=new Map;let l=null;return{onAnchor:c=>{i.push(c),l??(l=TS(e));const d=ES(n,l);return l.add(d),d},setAnchors:()=>{for(const c of i){const d=r.get(c);if(typeof d=="object"&&d.anchor&&(at(d.node)||bt(d.node)))d.node.anchor=d.anchor;else{const h=new Error("Failed to resolve repeated object (this should not happen)");throw h.source=c,h}}},sourceObjects:r}}function Ds(e,n,i,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let l=0,c=r.length;l<c;++l){const d=r[l],h=Ds(e,r,String(l),d);h===void 0?delete r[l]:h!==d&&(r[l]=h)}else if(r instanceof Map)for(const l of Array.from(r.keys())){const c=r.get(l),d=Ds(e,r,l,c);d===void 0?r.delete(l):d!==c&&r.set(l,d)}else if(r instanceof Set)for(const l of Array.from(r)){const c=Ds(e,r,l,l);c===void 0?r.delete(l):c!==l&&(r.delete(l),r.add(c))}else for(const[l,c]of Object.entries(r)){const d=Ds(e,r,l,c);d===void 0?delete r[l]:d!==c&&(r[l]=d)}return e.call(n,i,r)}function kn(e,n,i){if(Array.isArray(e))return e.map((r,l)=>kn(r,String(l),i));if(e&&typeof e.toJSON=="function"){if(!i||!CS(e))return e.toJSON(n,i);const r={aliasCount:0,count:1,res:void 0};i.anchors.set(e,r),i.onCreate=c=>{r.res=c,delete i.onCreate};const l=e.toJSON(n,i);return i.onCreate&&i.onCreate(l),l}return typeof e=="bigint"&&!i?.keep?Number(e):e}class Op{constructor(n){Object.defineProperty(this,An,{value:n})}clone(){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(n.range=this.range.slice()),n}toJS(n,{mapAsMap:i,maxAliasCount:r,onAnchor:l,reviver:c}={}){if(!_c(n))throw new TypeError("A document argument is required");const d={anchors:new Map,doc:n,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},h=kn(this,"",d);if(typeof l=="function")for(const{count:g,res:b}of d.anchors.values())l(b,g);return typeof c=="function"?Ds(c,{"":h},"",h):h}}class Dp extends Op{constructor(n){super(Ep),this.source=n,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(n,i){let r;i?.aliasResolveCache?r=i.aliasResolveCache:(r=[],Ws(n,{Node:(c,d)=>{(Oi(d)||CS(d))&&r.push(d)}}),i&&(i.aliasResolveCache=r));let l;for(const c of r){if(c===this)break;c.anchor===this.source&&(l=c)}return l}toJSON(n,i){if(!i)return{source:this.source};const{anchors:r,doc:l,maxAliasCount:c}=i,d=this.resolve(l,i);if(!d){const g=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(g)}let h=r.get(d);if(h||(kn(d,null,i),h=r.get(d)),h?.res===void 0){const g="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(g)}if(c>=0&&(h.count+=1,h.aliasCount===0&&(h.aliasCount=Wl(l,d,r)),h.count*h.aliasCount>c)){const g="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(g)}return h.res}toString(n,i,r){const l=`*${this.source}`;if(n){if(zS(this.source),n.options.verifyAliasOrder&&!n.anchors.has(this.source)){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(c)}if(n.implicitKey)return`${l} `}return l}}function Wl(e,n,i){if(Oi(n)){const r=n.resolve(e),l=i&&r&&i.get(r);return l?l.count*l.aliasCount:0}else if(bt(n)){let r=0;for(const l of n.items){const c=Wl(e,l,i);c>r&&(r=c)}return r}else if(St(n)){const r=Wl(e,n.key,i),l=Wl(e,n.value,i);return Math.max(r,l)}return 1}const OS=e=>!e||typeof e!="function"&&typeof e!="object";class Ae extends Op{constructor(n){super(Qn),this.value=n}toJSON(n,i){return i?.keep?this.value:kn(this.value,n,i)}toString(){return String(this.value)}}Ae.BLOCK_FOLDED="BLOCK_FOLDED";Ae.BLOCK_LITERAL="BLOCK_LITERAL";Ae.PLAIN="PLAIN";Ae.QUOTE_DOUBLE="QUOTE_DOUBLE";Ae.QUOTE_SINGLE="QUOTE_SINGLE";const fM="tag:yaml.org,2002:";function pM(e,n,i){if(n){const r=i.filter(c=>c.tag===n),l=r.find(c=>!c.format)??r[0];if(!l)throw new Error(`Tag ${n} not found`);return l}return i.find(r=>r.identify?.(e)&&!r.format)}function po(e,n,i){if(_c(e)&&(e=e.contents),vt(e))return e;if(St(e)){const x=i.schema[Za].createNode?.(i.schema,null,i);return x.items.push(e),x}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:l,onTagObj:c,schema:d,sourceObjects:h}=i;let g;if(r&&e&&typeof e=="object"){if(g=h.get(e),g)return g.anchor??(g.anchor=l(e)),new Dp(g.anchor);g={anchor:null,node:null},h.set(e,g)}n?.startsWith("!!")&&(n=fM+n.slice(2));let b=pM(e,n,d.tags);if(!b){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const x=new Ae(e);return g&&(g.node=x),x}b=e instanceof Map?d[Za]:Symbol.iterator in Object(e)?d[Fs]:d[Za]}c&&(c(b),delete i.onTagObj);const S=b?.createNode?b.createNode(i.schema,e,i):typeof b?.nodeClass?.from=="function"?b.nodeClass.from(i.schema,e,i):new Ae(e);return n?S.tag=n:b.default||(S.tag=b.tag),g&&(g.node=S),S}function pc(e,n,i){let r=i;for(let l=n.length-1;l>=0;--l){const c=n[l];if(typeof c=="number"&&Number.isInteger(c)&&c>=0){const d=[];d[c]=r,r=d}else r=new Map([[c,r]])}return po(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const so=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class DS extends Op{constructor(n,i){super(n),Object.defineProperty(this,"schema",{value:i,configurable:!0,enumerable:!1,writable:!0})}clone(n){const i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return n&&(i.schema=n),i.items=i.items.map(r=>vt(r)||St(r)?r.clone(n):r),this.range&&(i.range=this.range.slice()),i}addIn(n,i){if(so(n))this.add(i);else{const[r,...l]=n,c=this.get(r,!0);if(bt(c))c.addIn(l,i);else if(c===void 0&&this.schema)this.set(r,pc(this.schema,l,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${l}`)}}deleteIn(n){const[i,...r]=n;if(r.length===0)return this.delete(i);const l=this.get(i,!0);if(bt(l))return l.deleteIn(r);throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}getIn(n,i){const[r,...l]=n,c=this.get(r,!0);return l.length===0?!i&&at(c)?c.value:c:bt(c)?c.getIn(l,i):void 0}hasAllNullValues(n){return this.items.every(i=>{if(!St(i))return!1;const r=i.value;return r==null||n&&at(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(n){const[i,...r]=n;if(r.length===0)return this.has(i);const l=this.get(i,!0);return bt(l)?l.hasIn(r):!1}setIn(n,i){const[r,...l]=n;if(l.length===0)this.set(r,i);else{const c=this.get(r,!0);if(bt(c))c.setIn(l,i);else if(c===void 0&&this.schema)this.set(r,pc(this.schema,l,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${l}`)}}}const mM=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ha(e,n){return/^\n+$/.test(e)?e.substring(1):n?e.replace(/^(?! *$)/gm,n):e}const Ni=(e,n,i)=>e.endsWith(`
63
+ `)}}}finally{c?.removeEventListener("abort",N);try{v.releaseLock()}catch{}}}function jS(e){return!e||e.role!=="assistant"?"":e.content.filter(n=>n.type==="text").map(n=>n.text).join("")}const UR=[{label:"Status",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{label:"Top insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{label:"Last failed run",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{label:"Schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"}],$R=[{command:"/status",label:"Status",hint:"Latest runs, health, anything unusual",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{command:"/insights",label:"Top insights",hint:"Walk through the most severe active insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{command:"/last-run",label:"Last run",hint:"Summarize the latest sweep",prompt:"Summarize the latest run for this project — provider mix, visibility changes, and anything that moved."},{command:"/last-failed",label:"Last failed run",hint:"Diagnose the most recent failure",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{command:"/run-sweep",label:"Run sweep now",hint:"Trigger a new visibility sweep",prompt:"Run a new answer-visibility sweep for this project now and tell me when it lands."},{command:"/schedule",label:"Schedule",hint:"Review the sweep schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"},{command:"/queries",label:"Queries",hint:"List tracked queries",prompt:"List the tracked queries for this project and flag any that are obvious duplicates or underperformers."},{command:"/competitors",label:"Competitors",hint:"List tracked competitors",prompt:"List this project's tracked competitors and call out which ones are showing up in answer citations."},{command:"/clear",label:"Clear conversation",hint:"Wipe transcript and start fresh",action:"clear"}],Hl=e=>`canonry:aero:provider:${e}`,Kb=e=>`canonry:aero:scope:${e}`;function IR({projectName:e}){const[n,i]=U.useState(!1),[r,l]=U.useState(!1),[c,d]=U.useState([]),[h,g]=U.useState(""),[v,S]=U.useState(!1),[x,N]=U.useState([]),[_,T]=U.useState(""),[k,E]=U.useState(null),[R,V]=U.useState(()=>typeof window>"u"?null:window.localStorage.getItem(Hl(e))??null),[G,Z]=U.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(Kb(e))==="all"?"all":"read-only"),X=U.useRef(null),{ref:F}=MR([c,_,x]),O=U.useRef(null),[M,le]=U.useState(0),ke=U.useMemo(()=>{const W=h.trimStart();if(!W.startsWith("/"))return[];if(/\s/.test(W))return[];const ue=W.toLowerCase();return $R.filter(te=>te.command.startsWith(ue)||te.label.toLowerCase().includes(ue.slice(1)))},[h]);U.useEffect(()=>{le(W=>ke.length===0?0:Math.min(W,ke.length-1))},[ke.length]);const Ce=dn({...DD({client:se,path:{name:e}}),enabled:n,staleTime:6e4}),be=U.useMemo(()=>{const W=Ce.data?.providers??[];if(R){const te=W.find(de=>de.id===R&&de.configured);if(te)return te}const ue=Ce.data?.defaultProvider;return ue?W.find(te=>te.id===ue)??null:null},[R,Ce.data]);U.useEffect(()=>{if(!Ce.data||!R)return;Ce.data.providers.find(ue=>ue.id===R&&ue.configured)||(V(null),window.localStorage.removeItem(Hl(e)))},[Ce.data,R,e]);const tt=U.useCallback(W=>{V(W),!(typeof window>"u")&&(W?window.localStorage.setItem(Hl(e),W):window.localStorage.removeItem(Hl(e)))},[e]),Ke=U.useCallback(()=>{Z(W=>{const ue=W==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(Kb(e),ue),ue})},[e]);U.useEffect(()=>{if(!n)return;const W=ue=>{ue.key==="Escape"&&(r?l(!1):i(!1))};return window.addEventListener("keydown",W),()=>window.removeEventListener("keydown",W)},[n,r]),U.useEffect(()=>{if(!n)return;let W=!1;E(null);const ue=()=>{W||v||Qb(e).then(ae=>{W||d(ae.messages)}).catch(ae=>{W||E(ae instanceof Error?ae.message:"Failed to load transcript")})};ue();const de=window.setInterval(ue,15e3);return()=>{W=!0,window.clearInterval(de)}},[n,e,v]),U.useEffect(()=>()=>{X.current?.abort()},[e]);async function ee(W){const ue=W.trim();if(!ue||v)return;E(null),g(""),S(!0),T(""),N([]);const te={role:"user",content:ue,timestamp:Date.now()};d(ae=>[...ae,te]);const de=new AbortController;X.current=de;try{await qR({project:e,prompt:ue,provider:R??void 0,scope:G,signal:de.signal,onEvent:B});const ae=await Qb(e);d(ae.messages)}catch(ae){ae.name!=="AbortError"&&E(ae instanceof Error?ae.message:"Prompt failed")}finally{S(!1),T(""),X.current=null}}function B(W){switch(W.type){case"message_update":T(jS(W.message));break;case"message_end":W.message.role==="assistant"&&T("");break;case"tool_execution_start":N(ue=>[...ue,{id:W.toolCallId,name:W.toolName,args:W.args,startedAt:Date.now()}]);break;case"tool_execution_end":N(ue=>ue.map(te=>te.id===W.toolCallId?{...te,endedAt:Date.now(),isError:W.isError,result:W.result}:te));break;case"error":E(W.message);break}}async function J(){X.current?.abort();try{await LR(e),d([]),E(null)}catch(W){E(W instanceof Error?W.message:"Reset failed")}}const fe=c.length===0,Se=n&&r?"pointer-events-auto fixed inset-0 z-40 flex items-stretch justify-center bg-zinc-950/70 p-4 sm:p-8 backdrop-blur-sm":"pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center p-3",re=r?"pointer-events-auto flex h-full w-full max-w-5xl flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-2xl":"pointer-events-auto w-full max-w-3xl",Ze=r?"flex-1 overflow-y-auto px-6 py-5 text-sm text-zinc-200":"max-h-[40vh] min-h-[120px] overflow-y-auto px-4 py-3 text-sm text-zinc-200";return f.jsx("div",{className:Se,onClick:W=>{r&&W.target===W.currentTarget&&l(!1)},children:f.jsx("div",{className:re,children:n?f.jsxs("div",{className:r?"flex h-full flex-col":"flex flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-xl backdrop-blur",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-zinc-800/70 px-4 py-2.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Fy,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),f.jsx("span",{className:"text-sm font-medium text-zinc-100",children:"Aero"}),f.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:v?"working…":e})]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(VR,{providers:Ce.data?.providers??[],active:be,override:R,onPick:tt,disabled:v}),f.jsx("button",{type:"button",onClick:wn(J),className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Reset conversation",title:"Reset conversation",children:f.jsx(Mv,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),f.jsx("button",{type:"button",onClick:()=>l(W=>!W),className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":r?"Collapse":"Expand",title:r?"Collapse":"Expand",children:r?f.jsx(MA,{className:"h-3.5 w-3.5","aria-hidden":"true"}):f.jsx(EA,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),f.jsx("button",{type:"button",onClick:()=>{l(!1),i(!1)},className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Close Aero",children:f.jsx(Qs,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),f.jsxs("div",{ref:F,className:Ze,children:[k&&f.jsx("div",{className:"mb-2 rounded-md border border-rose-700/40 bg-rose-950/40 px-3 py-2 text-xs text-rose-200",children:k}),fe&&!v&&f.jsxs("div",{className:"flex flex-col gap-3 py-2",children:[f.jsxs("p",{className:"text-xs text-zinc-500",children:["Ask anything about ",f.jsx("span",{className:"text-zinc-300",children:e}),", or start with:"]}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:UR.map(W=>f.jsx("button",{type:"button",onClick:()=>{ee(W.prompt)},className:"rounded-full border border-zinc-800 bg-zinc-900/70 px-3 py-1 text-xs text-zinc-300 transition hover:border-zinc-700 hover:bg-zinc-800/70 hover:text-zinc-100",children:W.label},W.label))})]}),KR(c,e,R,G),x.length>0&&f.jsx("div",{className:"mt-3 space-y-1.5",children:x.map(W=>f.jsx(NS,{trail:W},W.id))}),v&&_&&f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),f.jsx(kS,{content:_})]}),v&&!_&&x.every(W=>W.endedAt!==void 0)&&f.jsx(JR,{})]}),f.jsx(PR,{projectName:e,activeProvider:be,scope:G,onToggleScope:Ke,disabled:v}),f.jsxs("div",{className:"relative",children:[ke.length>0&&f.jsx(GR,{matches:ke,selectedIndex:M,onHover:le,onPick:W=>{g(""),O.current?.focus(),W.action==="clear"?J():ee(W.prompt)}}),f.jsxs("form",{className:"flex items-end gap-2 border-t border-zinc-800/70 bg-zinc-950/80 px-3 py-2.5",onSubmit:W=>{if(W.preventDefault(),ke.length>0){const ue=ke[M];g(""),ue.action==="clear"?J():ee(ue.prompt);return}ee(h)},children:[f.jsx("textarea",{ref:O,value:h,onChange:W=>g(W.target.value),onKeyDown:W=>{if(ke.length>0){if(W.key==="ArrowDown"){W.preventDefault(),le(ue=>(ue+1)%ke.length);return}if(W.key==="ArrowUp"){W.preventDefault(),le(ue=>(ue-1+ke.length)%ke.length);return}if(W.key==="Tab"){W.preventDefault();const ue=ke[M];g(`${ue.command} `);return}if(W.key==="Escape"){W.preventDefault(),g("");return}}if(W.key==="Enter"&&!W.shiftKey)if(W.preventDefault(),ke.length>0){const ue=ke[M];g(""),ue.action==="clear"?J():ee(ue.prompt)}else ee(h)},placeholder:"Ask Aero, or / for commands…",disabled:v,rows:r?3:1,className:"flex-1 resize-none bg-transparent text-sm text-zinc-100 placeholder:text-zinc-600 focus:outline-none disabled:opacity-60"}),f.jsx("button",{type:"submit",disabled:v||!h.trim(),className:"inline-flex h-7 w-7 items-center justify-center rounded-md bg-emerald-500 text-zinc-950 transition hover:bg-emerald-400 disabled:opacity-40","aria-label":"Send",children:f.jsx(cA,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}):f.jsxs("button",{type:"button",onClick:()=>i(!0),className:"flex w-full items-center justify-between rounded-full border border-zinc-800/80 bg-zinc-950/95 px-4 py-2 text-left text-sm text-zinc-400 shadow-lg backdrop-blur transition hover:border-zinc-700 hover:bg-zinc-900/90 hover:text-zinc-200",children:[f.jsxs("span",{className:"flex items-center gap-2",children:[f.jsx(Fy,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),"Ask Aero about ",e,"…"]}),f.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-600",children:"Enter"})]})})})}function VR({providers:e,active:n,override:i,onPick:r,disabled:l}){const[c,d]=U.useState(!1),h=U.useRef(null);if(U.useEffect(()=>{if(!c)return;const S=N=>{h.current?.contains(N.target)||d(!1)},x=N=>{N.key==="Escape"&&d(!1)};return window.addEventListener("mousedown",S),window.addEventListener("keydown",x),()=>{window.removeEventListener("mousedown",S),window.removeEventListener("keydown",x)}},[c]),e.length===0)return null;const g=n?.label.replace(/\s+\(.+\)$/,"")??"No provider",v=n?.defaultModel;return f.jsxs("div",{ref:h,className:"relative",children:[f.jsxs("button",{type:"button",onClick:()=>d(S=>!S),disabled:l,className:"flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-zinc-400 transition hover:bg-zinc-800/60 hover:text-zinc-200 disabled:opacity-50","aria-label":"Switch agent model","aria-haspopup":"listbox","aria-expanded":c,title:n?`${n.label} · ${n.defaultModel}`:"Pick a provider",children:[f.jsx("span",{className:"font-medium text-zinc-200",children:g}),v&&f.jsx("span",{className:"hidden font-mono text-[10px] text-zinc-500 sm:inline",children:v}),f.jsx(mA,{className:"h-3 w-3","aria-hidden":"true"})]}),c&&f.jsxs("div",{role:"listbox",className:"absolute right-0 top-full z-50 mt-1 w-64 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950 shadow-xl",children:[f.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-2 text-[10px] uppercase tracking-wider text-zinc-500",children:"Aero provider"}),f.jsx("ul",{className:"max-h-72 overflow-y-auto py-1",children:e.map(S=>{const x=n?.id===S.id,N=i===S.id;return f.jsx("li",{children:f.jsxs("button",{type:"button",role:"option","aria-selected":x,disabled:!S.configured,onClick:()=>{S.configured&&(r(N?null:S.id),d(!1))},className:"flex w-full items-start gap-2 px-3 py-2 text-left text-xs transition enabled:hover:bg-zinc-900 disabled:cursor-not-allowed disabled:opacity-50",children:[f.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:x?f.jsx(Rv,{className:"h-3 w-3 text-emerald-400","aria-hidden":"true"}):null}),f.jsxs("span",{className:"flex-1",children:[f.jsxs("span",{className:"flex items-center gap-1.5",children:[f.jsx("span",{className:"font-medium text-zinc-100",children:S.label}),N&&f.jsx("span",{className:"rounded-full border border-emerald-800/60 bg-emerald-950/60 px-1.5 text-[9px] uppercase tracking-wider text-emerald-300",children:"Pinned"}),!S.configured&&f.jsx("span",{className:"rounded-full border border-zinc-800 px-1.5 text-[9px] uppercase tracking-wider text-zinc-500",children:"Key missing"})]}),f.jsx("span",{className:"mt-0.5 block font-mono text-[10px] text-zinc-500",children:S.defaultModel}),S.keySource==="env"&&f.jsx("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:"via env var"}),!S.configured&&f.jsxs("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:["Add key in config.yaml or export"," ",f.jsx("code",{className:"font-mono text-zinc-400",children:HR(S.id)})]})]})]})},S.id)})}),i&&f.jsx("button",{type:"button",onClick:()=>{r(null),d(!1)},className:"w-full border-t border-zinc-800/60 px-3 py-2 text-left text-[11px] text-zinc-400 transition hover:bg-zinc-900 hover:text-zinc-100",children:"Reset to auto-detected default"})]})]})}function PR({projectName:e,activeProvider:n,scope:i,onToggleScope:r,disabled:l}){const c=n?.label.replace(/\s+\(.+\)$/,"")??null,d=i==="all";return f.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-t border-zinc-800/70 bg-zinc-950/80 px-3 pt-2",children:[f.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[f.jsx("span",{className:"text-zinc-600",children:"project"}),f.jsx("span",{className:"font-medium text-zinc-200",children:e})]}),c&&f.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[f.jsx("span",{className:"text-zinc-600",children:"model"}),f.jsx("span",{className:"font-medium text-zinc-200",children:c})]}),f.jsxs("button",{type:"button",onClick:r,disabled:l,className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] transition disabled:opacity-50 ${d?"border-amber-800/60 bg-amber-950/40 text-amber-300 hover:border-amber-700 hover:text-amber-200":"border-zinc-800 bg-zinc-900/70 text-zinc-400 hover:border-zinc-700 hover:text-zinc-200"}`,title:d?"Aero can invoke write tools (run sweep, dismiss insight, etc). Click to restrict.":"Aero is restricted to read-only tools. Click to allow writes.",children:[f.jsx("span",{className:d?"text-amber-500":"text-zinc-600",children:"scope"}),f.jsx("span",{className:"font-medium",children:d?"all tools":"read-only"})]})]})}function GR({matches:e,selectedIndex:n,onHover:i,onPick:r}){return f.jsxs("div",{className:"absolute inset-x-3 bottom-full mb-2 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950/98 shadow-2xl",children:[f.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-1.5 text-[10px] uppercase tracking-wider text-zinc-500",children:"Commands"}),f.jsx("ul",{role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:e.map((l,c)=>{const d=c===n;return f.jsx("li",{children:f.jsxs("button",{type:"button",role:"option","aria-selected":d,onMouseEnter:()=>i(c),onClick:()=>r(l),className:`flex w-full items-center gap-3 px-3 py-1.5 text-left text-xs transition ${d?"bg-zinc-900 text-zinc-100":"text-zinc-300 hover:bg-zinc-900/60"}`,children:[f.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:l.command}),f.jsx("span",{className:"font-medium",children:l.label}),f.jsx("span",{className:"ml-auto text-[10px] text-zinc-500",children:l.hint})]})},l.command)})}),f.jsxs("div",{className:"border-t border-zinc-800/60 px-3 py-1.5 text-[10px] text-zinc-600",children:[f.jsx("span",{className:"mr-3",children:"↑↓ to select"}),f.jsx("span",{className:"mr-3",children:"Enter to run"}),f.jsx("span",{children:"Tab to autocomplete"})]})]})}function HR(e){switch(e){case"claude":return"ANTHROPIC_API_KEY";case"openai":return"OPENAI_API_KEY";case"gemini":return"GOOGLE_API_KEY";case"zai":return"ZAI_API_KEY"}}function QR(e,n){const i=e.timestamp??0;return`${e.role}:${i}:${n}`}function KR(e,n,i,r){const l=[];for(let c=0;c<e.length;c++){const d=e[c],h=QR(d,c);if(d.role==="user"){const g=typeof d.content=="string"?d.content:JSON.stringify(d.content);if(g.startsWith("[system]"))continue;l.push(f.jsx(ZR,{text:g,projectName:n,providerOverride:i,scope:r},h));continue}if(d.role==="assistant"){const g=new Map;let v=c+1;for(;v<e.length&&e[v].role==="toolResult";){const N=e[v];g.set(N.toolCallId,N),v++}const S=XR(d,g,d.timestamp??0),x=jS(d);l.push(f.jsxs(U.Fragment,{children:[S.length>0&&f.jsx("div",{className:"mt-3 space-y-1.5",children:S.map(N=>f.jsx(NS,{trail:N},N.id))}),x.trim()&&f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),f.jsx(kS,{content:x})]})]},h)),c=v-1;continue}}return l}function ZR({text:e,projectName:n,providerOverride:i,scope:r}){const[l,c]=U.useState(!1),d=U.useMemo(()=>YR(n,e,i,r),[n,e,i,r]);async function h(){try{await navigator.clipboard.writeText(d),c(!0),window.setTimeout(()=>c(!1),1500)}catch{}}return f.jsxs("div",{className:"group relative mt-3 rounded-md bg-zinc-900/60 px-3 py-2 text-zinc-200",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsx("div",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"You"}),f.jsx("button",{type:"button",onClick:wn(h),className:"inline-flex items-center gap-1 rounded border border-zinc-800/70 bg-zinc-950/60 px-1.5 py-0.5 text-[10px] text-zinc-400 opacity-0 transition hover:border-zinc-700 hover:text-zinc-100 group-hover:opacity-100 focus:opacity-100","aria-label":"Copy as CLI command",title:d,children:l?f.jsxs(f.Fragment,{children:[f.jsx(Rv,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):f.jsxs(f.Fragment,{children:[f.jsx(yA,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),f.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function YR(e,n,i,r){const l=["canonry","agent","ask",Zb(e),Zb(n)];return i&&l.push("--provider",i),r==="read-only"&&l.push("--scope","read-only"),l.join(" ")}function Zb(e){return`'${e.replace(/'/g,"'\\''")}'`}function XR(e,n,i){const r=[];for(const l of e.content){if(l.type!=="toolCall")continue;const c=l,d=n.get(c.id);r.push({id:c.id,name:c.name,args:c.arguments,startedAt:i,endedAt:d?.timestamp,isError:d?.isError,result:d?.content})}return r}function NS({trail:e}){const[n,i]=U.useState(!1),r=e.endedAt===void 0,l=!r&&e.isError===!0,c=e.endedAt!=null?e.endedAt-e.startedAt:null,d=c==null||c<0?null:c<1e3?`${c}ms`:`${(c/1e3).toFixed(1)}s`,h=l?"border-rose-800/50":r?"border-emerald-800/50":"border-zinc-800/70",g=l?"bg-rose-950/20":r?"bg-emerald-950/20":"bg-zinc-900/40";return f.jsxs("div",{className:`rounded-md border ${h} ${g} font-mono`,children:[f.jsxs("button",{type:"button",onClick:()=>i(v=>!v),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left","aria-expanded":n,children:[f.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:r?f.jsx(zA,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):l?f.jsx(Bv,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):f.jsx(JA,{className:"h-3 w-3 text-zinc-500","aria-hidden":"true"})}),f.jsx("span",{className:"text-[11px] font-semibold text-zinc-100",children:e.name}),f.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px] text-zinc-500",children:[r?f.jsx("span",{className:"text-emerald-400",children:"running…"}):f.jsxs(f.Fragment,{children:[f.jsx("span",{children:l?"failed":"ok"}),d&&f.jsx("span",{children:d})]}),f.jsx(Yf,{className:`h-3 w-3 transition-transform ${n?"rotate-90":""}`,"aria-hidden":"true"})]})]}),n&&f.jsxs("div",{className:"border-t border-zinc-800/60 px-2.5 py-2 text-[11px] text-zinc-400",children:[f.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:"Args"}),f.jsx("pre",{className:"mb-2 overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:Yb(e.args)}),!r&&e.result!==void 0&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:l?"Error":"Result"}),f.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:Yb(e.result)})]})]})]})}function Yb(e){try{const n=typeof e=="string"?e:JSON.stringify(e,null,2);return n.length>2e3?`${n.slice(0,2e3)}
64
+ … (${n.length-2e3} more chars)`:n}catch{return String(e)}}function kS({content:e}){return f.jsx("div",{className:"aero-markdown text-zinc-100",children:f.jsx(Bw,{components:{h1:n=>f.jsx("h1",{...n,className:"mt-3 mb-2 text-base font-semibold text-zinc-50"}),h2:n=>f.jsx("h2",{...n,className:"mt-3 mb-2 text-sm font-semibold text-zinc-50"}),h3:n=>f.jsx("h3",{...n,className:"mt-3 mb-1.5 text-sm font-semibold text-zinc-100"}),h4:n=>f.jsx("h4",{...n,className:"mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-zinc-300"}),p:n=>f.jsx("p",{...n,className:"mb-2 leading-relaxed"}),ul:n=>f.jsx("ul",{...n,className:"mb-2 ml-4 list-disc space-y-1"}),ol:n=>f.jsx("ol",{...n,className:"mb-2 ml-4 list-decimal space-y-1"}),li:n=>f.jsx("li",{...n,className:"marker:text-zinc-600"}),strong:n=>f.jsx("strong",{...n,className:"font-semibold text-zinc-50"}),em:n=>f.jsx("em",{...n,className:"text-zinc-200"}),code:({children:n,...i})=>f.jsx("code",{...i,className:"rounded bg-zinc-800/70 px-1 py-0.5 font-mono text-[12px] text-emerald-200",children:n}),pre:n=>f.jsx("pre",{...n,className:"mb-2 overflow-x-auto rounded-md border border-zinc-800 bg-zinc-900/70 p-3 font-mono text-xs text-zinc-200"}),a:n=>f.jsx("a",{...n,className:"text-emerald-400 underline decoration-emerald-700 hover:decoration-emerald-400",target:"_blank",rel:"noopener noreferrer"}),table:n=>f.jsx("div",{className:"mb-2 overflow-x-auto",children:f.jsx("table",{...n,className:"w-full border-collapse text-xs"})}),thead:n=>f.jsx("thead",{...n,className:"border-b border-zinc-800"}),th:n=>f.jsx("th",{...n,className:"px-2 py-1 text-left font-semibold text-zinc-300"}),tr:n=>f.jsx("tr",{...n,className:"border-b border-zinc-900"}),td:n=>f.jsx("td",{...n,className:"px-2 py-1 text-zinc-200"}),blockquote:n=>f.jsx("blockquote",{...n,className:"mb-2 border-l-2 border-zinc-700 pl-3 italic text-zinc-400"}),hr:()=>f.jsx("hr",{className:"my-3 border-zinc-800"})},children:e})})}function JR(){return f.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[f.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),f.jsxs("div",{className:"flex items-center gap-1","aria-label":"Aero is thinking",children:[f.jsx("span",{className:"aero-dot h-1.5 w-1.5 rounded-full bg-emerald-400/80"}),f.jsx("span",{className:"aero-dot aero-dot-2 h-1.5 w-1.5 rounded-full bg-emerald-400/60"}),f.jsx("span",{className:"aero-dot aero-dot-3 h-1.5 w-1.5 rounded-full bg-emerald-400/40"})]})]})}function FR(){const e=dv(),n=/^\/projects\/([^/]+)/.exec(e.pathname),i=n?decodeURIComponent(n[1]):null,r=dn({...Sp({client:se}),enabled:i!==null,staleTime:6e4});if(!i)return null;const l=r.data??[],c=l.find(d=>d.id===i)??l.find(d=>d.name===i);return c?f.jsx(IR,{projectName:c.name},c.name):null}function wi(e,n){e.invalidateQueries({predicate:i=>{const r=i.queryKey[0];return typeof r?._id=="string"&&r._id.startsWith(n)}})}function fo(e,n,i){switch(e.invalidateQueries({queryKey:xp({client:se})}),e.invalidateQueries({queryKey:Js({client:se})}),n){case Ne["answer-visibility"]:case Ne["site-audit"]:case Ne["backlink-extract"]:return;case Ne["gsc-sync"]:case Ne["inspect-sitemap"]:wi(e,"getApiV1ProjectsByNameGoogleGsc");return;case Ne["ga-sync"]:wi(e,"getApiV1ProjectsByNameGa");return;case Ne["traffic-sync"]:wi(e,"getApiV1ProjectsByNameGa"),wi(e,"getApiV1ProjectsByNameTraffic");return;case Ne["bing-inspect"]:case Ne["bing-inspect-sitemap"]:wi(e,"getApiV1ProjectsByNameBing");return;case Ne["aeo-discover-seed"]:case Ne["aeo-discover-probe"]:return;case Ne["gbp-sync"]:wi(e,"getApiV1ProjectsByNameGbp");return;case Ne["ads-sync"]:wi(e,"getApiV1ProjectsByNameAds");return;default:return n}}const Xb=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:xA},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:dA},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:vA}],Jb=e=>({label:e,state:"checking",detail:"Checking service health"}),WR={apiStatus:Jb("API"),workerStatus:Jb("Worker")};function AS(e){switch(e){case Ne["answer-visibility"]:return"Visibility sweep";case Ne["gsc-sync"]:return"GSC sync";case Ne["inspect-sitemap"]:return"Sitemap inspection";case Ne["ga-sync"]:return"GA sync";case Ne["traffic-sync"]:return"Traffic sync";case Ne["bing-inspect"]:return"Bing URL inspection";case Ne["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Ne["site-audit"]:return"Site audit";case Ne["backlink-extract"]:return"Backlink extract";case Ne["aeo-discover-seed"]:return"Discovery (seed phase)";case Ne["aeo-discover-probe"]:return"Discovery (probe phase)";case Ne["gbp-sync"]:return"Business Profile sync";case Ne["ads-sync"]:return"ChatGPT ads sync"}}function eM(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function tM(e){const n=AS(e.kind);return e.status==="completed"?`${n} completed`:e.status==="partial"?`${n} completed with partial results`:e.status==="cancelled"?`${n} cancelled`:`${n} failed`}function nM(e,n){return e.error?`${n}: ${sp(e.error)}`:e.location?`${n} · ${e.location}`:n}function Fb(e,n,i){if(n)return n;const r=i.find(l=>l.id===e);return r?.displayName||r?.name||e}function aM(e,n){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,n>0?`${n} skipped at queue time`:null].filter(Boolean).join(", ")}function iM(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function sM(){const e=Ja(),n=U.useSyncExternalStore(VD,_i,_i),i=Object.keys(n.runs).length>0||Object.keys(n.batches).length>0,r=dn({...wp({client:se}),enabled:i,staleTime:lo,refetchInterval:3e3}),l=dn({...Sp({client:se}),enabled:i}),c=U.useRef({}),d=U.useCallback(()=>{r.refetch()},[r.refetch]);return U.useEffect(()=>{i&&d()},[i,d]),U.useEffect(()=>{if(!i||typeof window>"u")return;const h=()=>{document.visibilityState==="visible"&&d()};return window.addEventListener("focus",d),document.addEventListener("visibilitychange",h),()=>{window.removeEventListener("focus",d),document.removeEventListener("visibilitychange",h)}},[i,d]),U.useEffect(()=>{const h=r.data??[],g=l.data??[],v=Object.fromEntries(h.map(x=>[x.id,x])),S=Object.fromEntries(h.map(x=>[x.id,x.status]));for(const x of Object.values(n.runs)){const N=v[x.runId];if(!N||!HD(N.status)||(c.current[N.id]??x.lastAnnouncedStatus)===N.status)continue;const T=g.find(E=>E.id===N.projectId);if(T&&fo(e,N.kind,T.name),x.sourceAction==="run-all"){lf(N.id);continue}const k=Fb(N.projectId,x.projectLabel,g);en({title:tM(N),detail:nM(N,k),tone:eM(N.status),dedupeKey:`run:${N.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:N.id}}),lf(N.id)}if(r.data!==void 0){const x=new Set(h.map(_=>_.id)),N=KD(Object.values(n.runs),x,Date.now(),QD);for(const _ of N){const T=g.find(k=>k.id===_.projectId);T&&fo(e,_.kind,T.name),_.sourceAction!=="run-all"&&en({title:`${AS(_.kind)} status unavailable`,detail:Fb(_.projectId,_.projectLabel,g),tone:"neutral",dedupeKey:`run-stale:${_.runId}`,dedupeMode:"replace"}),lf(_.runId)}}for(const x of Object.values(n.batches)){const N=ZD(x.runIds,v);N.finished&&(en({title:"Run-all batch finished",detail:aM(N,x.skippedCount),tone:iM(N),dedupeKey:`batch:${x.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),GD(x.batchId))}c.current=S},[l.data,r.data,n,e]),null}function rM(){const e=go(),{dashboard:n,isLoading:i,refetch:r}=Ac(),d=_p(!e,e?.health).data??e?.health??WR,h=dv(),{runId:g,evidenceId:v,closeDrawer:S}=Cp(),[x,N]=U.useState(!1),[_,T]=U.useState(()=>{if(typeof window>"u")return null;try{return window.localStorage.getItem("canonry:dismissedUpdateVersion")}catch{return null}}),[k]=U.useState(()=>typeof window>"u"?null:new URLSearchParams(window.location.search).get("force-update")),E=k?{current:d.apiStatus.version??"0.0.0",latest:k,url:"https://www.npmjs.com/package/@ainyc/canonry",upgradeCommand:"npm install -g @ainyc/canonry"}:d.apiStatus.updateAvailable,R=E&&E.latest!==_,V=()=>{if(E){try{window.localStorage.setItem("canonry:dismissedUpdateVersion",E.latest)}catch{}T(E.latest)}},G=ER(g),Z=G.data??null,X=G.isLoading;U.useEffect(()=>{Z&&Z.status!=="running"&&Z.status!=="queued"&&r()},[Z?.status,r]),U.useEffect(()=>{N(!1)},[h.pathname]),U.useEffect(()=>{if(typeof window>"u"||!g&&!v)return;const ee=B=>{B.key==="Escape"&&S()};return window.addEventListener("keydown",ee),()=>{window.removeEventListener("keydown",ee)}},[g,v,S]);const F=n??e?.dashboard??null,O=h.pathname==="/setup"&&F!==null&&F.portfolioOverview.projects.length===0,M=g&&F?iR(F,g):void 0,le=U.useMemo(()=>h.pathname.match(/^\/projects\/([^/]+)/)?.[1]??null,[h.pathname]),ke=U.useMemo(()=>!le||!F?null:F.projects.find(ee=>ee.project.id===le)?.project.name??null,[le,F]),{commandCenter:Ce}=CR(ke),be=U.useMemo(()=>{if(v)return rR(Ce,F,v)},[v,Ce,F]),tt=(()=>{const ee=h.pathname;if(ee==="/")return"Portfolio";if(ee==="/projects")return"Projects";if(ee==="/runs")return"Runs";if(ee==="/settings")return"Settings";if(ee==="/setup")return"Setup";if(ee==="/backlinks")return"Backlinks";if(ee==="/traffic"||ee.startsWith("/traffic/"))return"Server traffic";if(ee.startsWith("/projects/")){const J=ee.split("/").filter(Boolean)[1];if(J&&F){const fe=F.projects.find(Se=>Se.project.id===J);if(fe)return fe.project.name}return"Project"}return"Not found"})(),Ke=U.useMemo(()=>pk(),[]);if(Ke){const ee=!Ke.views||Ke.views.includes(I4(h.pathname));return f.jsxs("div",{className:"app-shell app-shell-embed",style:G4(Ke.theme),children:[f.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),f.jsx("main",{id:"content",className:"page-shell",children:ee?f.jsx(bf,{}):f.jsx("div",{className:"embed-view-unavailable",role:"status",children:"This view is not available in embed mode."})})]})}return f.jsxs("div",{className:`app-shell ${O?"app-shell-focus":""}`,children:[f.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),!O&&f.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[f.jsx("div",{className:"sidebar-brand",children:f.jsx($b,{version:d.apiStatus.version,updateAvailable:R?E:null,onDismissUpdate:V})}),f.jsxs("nav",{className:"sidebar-nav",children:[f.jsxs(rt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(kA,{className:"sidebar-icon"}),f.jsx("span",{children:"Overview"})]}),f.jsxs(rt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[f.jsx(jA,{className:"sidebar-icon"}),f.jsx("span",{children:"Projects"})]}),f.jsxs(rt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(LA,{className:"sidebar-icon"}),f.jsx("span",{children:"Runs"})]}),f.jsxs(rt,{to:"/traffic",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[f.jsx($A,{className:"sidebar-icon"}),f.jsx("span",{children:"Server traffic"})]}),f.jsxs(rt,{to:"/backlinks",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(_A,{className:"sidebar-icon"}),f.jsx("span",{children:"Backlinks"})]}),f.jsxs(rt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(ZA,{className:"sidebar-icon"}),f.jsx("span",{children:"Settings"})]}),i?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(ee=>f.jsxs("div",{className:"sidebar-skeleton-item",children:[f.jsx("span",{className:"skeleton-circle size-2"}),f.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+ee*15}%`}})]},ee))]}):F&&F.projects.length>0?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Projects"}),F.projects.map(ee=>{const B=ee.visibilitySummary.tone;return f.jsxs(rt,{to:"/projects/$projectId",params:{projectId:ee.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[f.jsx("span",{className:`sidebar-dot sidebar-dot-${B}`}),f.jsx("span",{children:ee.project.displayName||ee.project.name})]},ee.project.id)})]}):i?null:f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Resources"}),f.jsxs(rt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(PA,{className:"sidebar-icon"}),f.jsx("span",{children:"Setup"})]})]})]}),f.jsx("div",{className:"sidebar-footer",children:Xb.map(({label:ee,href:B,Icon:J})=>f.jsx("a",{className:"sidebar-footer-icon",href:B,target:"_blank",rel:"noopener noreferrer",title:ee,"aria-label":ee,children:f.jsx(J,{className:"size-4"})},B))})]}),f.jsxs("div",{className:"main-area",children:[f.jsxs("header",{className:"topbar",children:[f.jsxs("div",{className:"topbar-left",children:[f.jsx("div",{className:"topbar-brand-mobile",children:f.jsx($b,{compact:!0})}),f.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[f.jsx(rt,{to:"/",children:"Home"}),f.jsx(Yf,{className:"breadcrumb-sep size-3"}),f.jsx("span",{className:"breadcrumb-current",children:tt})]})]}),f.jsxs("div",{className:"topbar-actions",children:[f.jsxs("div",{className:"health-pill-row",children:[f.jsxs("span",{className:`health-pill health-pill-${d.apiStatus.state}`,title:Is(d.apiStatus),children:["API ",d.apiStatus.state==="ok"?"ok":d.apiStatus.state]}),f.jsxs("span",{className:`health-pill health-pill-${d.workerStatus.state}`,title:Is(d.workerStatus),children:["Worker ",d.workerStatus.state==="ok"?"ok":d.workerStatus.state]})]}),f.jsxs(qe,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":x,"aria-controls":"mobile-nav",onClick:()=>N(ee=>!ee),children:[f.jsx(DA,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),f.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${x?"mobile-nav-open":""}`,children:[f.jsxs(qe,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>N(!1),children:[f.jsx(Qs,{className:"size-5"}),f.jsx("span",{className:"sr-only",children:"Close navigation"})]}),f.jsx(rt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),f.jsx(rt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),f.jsx(rt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),f.jsx(rt,{to:"/traffic",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Server traffic"}),f.jsx(rt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),F&&F.projects.length>0?f.jsxs("div",{className:"mobile-nav-section",children:[f.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),F.projects.map(ee=>f.jsx(rt,{to:"/projects/$projectId",params:{projectId:ee.project.id},className:"mobile-nav-link",children:ee.project.name},ee.project.id))]}):null]}),f.jsx("main",{id:"content",className:"page-shell",children:i&&!e?f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-40"}),f.jsx("div",{className:"skeleton-text-sm w-72"})]}),f.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(ee=>f.jsxs("div",{className:"page-skeleton-card",children:[f.jsx("div",{className:"skeleton-text w-24"}),f.jsx("div",{className:"skeleton-text w-full"}),f.jsx("div",{className:"skeleton-text-sm w-3/4"})]},ee))}),f.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(ee=>f.jsxs("div",{className:"page-skeleton-card",children:[f.jsx("div",{className:"skeleton-text w-20"}),f.jsx("div",{className:"space-y-2",children:[1,2,3].map(B=>f.jsx("div",{className:"skeleton-text-sm w-full"},B))})]},ee))})]}):f.jsx(bf,{})}),f.jsxs("footer",{className:"footer",children:[f.jsxs("span",{className:"footer-brand",children:[f.jsx("span",{children:f.jsx("a",{href:"https://canonry.ai",children:"Canonry"})}),d.apiStatus.version&&d.apiStatus.version!=="unknown"?f.jsxs("span",{className:"footer-version",children:["v",d.apiStatus.version]}):null]}),f.jsx("div",{className:"footer-links",children:Xb.map(({label:ee,href:B,Icon:J})=>f.jsx("a",{href:B,target:"_blank",rel:"noopener noreferrer",title:ee,"aria-label":ee,className:"footer-icon",children:f.jsx(J,{className:"size-3.5"})},B))})]})]}),M?f.jsxs(Z3,{open:!0,title:M.summary,subtitle:`${M.projectName} · ${M.kindLabel}`,onClose:S,children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[f.jsx(kp,{status:M.status}),f.jsx("span",{className:"text-zinc-400",children:M.startedAt}),f.jsx("span",{className:"text-zinc-500",children:M.duration}),f.jsx("span",{className:"text-zinc-600",children:M.triggerLabel})]}),M.status==="failed"&&M.statusDetail&&f.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:M.statusDetail}),f.jsxs("div",{className:"mt-4",children:[f.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),X?f.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):Z?.snapshots&&Z.snapshots.length>0?f.jsxs("div",{className:"space-y-2",children:[Z.snapshots.map(ee=>f.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[f.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:ee.query??"Unknown query"}),f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx(I3,{provider:ee.provider}),f.jsx(pS,{variant:ee.citationState===lc.cited?"success":"neutral",children:ee.citationState})]})]}),ee.model&&f.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:ee.model}),ee.citedDomains.length>0&&f.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[f.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",ee.citedDomains.join(", ")]}),ee.competitorOverlap.length>0&&f.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",ee.competitorOverlap.join(", ")]}),ee.groundingSources&&ee.groundingSources.length>0&&f.jsxs("details",{className:"mt-2",children:[f.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[ee.groundingSources.length," grounding source",ee.groundingSources.length!==1?"s":""]}),f.jsx("ul",{className:"mt-1 space-y-0.5",children:ee.groundingSources.map((B,J)=>{const fe=Of(B.uri),Se=B.title||B.uri;return f.jsx("li",{className:"text-xs text-zinc-500 truncate",children:fe?f.jsx("a",{href:fe,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:Se}):f.jsx("span",{children:Se})},J)})})]}),ee.answerText&&f.jsxs("details",{className:"mt-1",children:[f.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),f.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:ee.answerText})]})]},ee.id)),Z.status==="running"&&f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[f.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Running remaining queries..."]})]}):Z&&Z.status==="running"?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[f.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first query result..."]}):Z&&Z.status==="queued"?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[f.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):Z&&Z.error?f.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[f.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),f.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:q4(Z.error)})]}):f.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,be?f.jsx(F3,{evidence:be.evidence,project:be.project,onClose:S}):null,f.jsx(sM,{}),f.jsx(RR,{}),f.jsx(FR,{})]})}class oM extends U.Component{state={error:null};static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,i){console.error("[ErrorBoundary]",n,i.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?f.jsx("div",{className:"page-container",children:f.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[f.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:f.jsx(Bv,{className:"size-6 text-rose-400"})}),f.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),f.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),f.jsxs("div",{className:"flex gap-3 mt-2",children:[f.jsxs(qe,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[f.jsx(Mv,{className:"size-3.5 mr-1.5"}),"Try again"]}),f.jsx(qe,{variant:"secondary",size:"sm",onClick:()=>{const n=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=n||"/"},children:"Go home"})]})]})}):this.props.children}}const jn=U.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Cn("rounded-xl border border-zinc-800 bg-zinc-950/75 shadow-[0_0_0_1px_rgba(255,255,255,0.01)]",e),...n}));jn.displayName="Card";const Df=U.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Cn("flex flex-col gap-1.5 p-5",e),...n}));Df.displayName="CardHeader";const Rf=U.forwardRef(({className:e,...n},i)=>f.jsx("h3",{ref:i,className:Cn("font-medium tracking-tight text-zinc-50",e),...n}));Rf.displayName="CardTitle";const Mf=U.forwardRef(({className:e,...n},i)=>f.jsx("p",{ref:i,className:Cn("text-sm text-zinc-500",e),...n}));Mf.displayName="CardDescription";const Fl=U.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Cn("p-5 pt-0",e),...n}));Fl.displayName="CardContent";function lM({points:e,tone:n}){const i=U.useId();if(e.length===0)return null;const r=42,l=132,c=5,d=Math.min(...e),g=Math.max(...e)-d||1,v=l-c*2,S=r-c*2,x=e.map((N,_)=>{const T=c+_/Math.max(e.length-1,1)*v,k=c+(1-(N-d)/g)*S;return`${T},${k}`}).join(" ");return f.jsxs("svg",{className:`sparkline sparkline-${n}`,viewBox:`0 0 ${l} ${r}`,"aria-hidden":"true",children:[f.jsx("defs",{children:f.jsx("clipPath",{id:i,children:f.jsx("rect",{x:c,y:c,width:v,height:S,rx:"8"})})}),f.jsx("line",{className:"sparkline-guide",x1:c,x2:l-c,y1:r-c,y2:r-c}),f.jsx("polyline",{clipPath:`url(#${i})`,points:x,vectorEffect:"non-scaling-stroke"})]})}function cM({project:e}){return f.jsxs(rt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[f.jsx("div",{className:"project-row-chart",children:f.jsx(lM,{points:e.trend,tone:Z0(e.lastRun.status)})}),f.jsxs("div",{className:"project-row-primary",children:[f.jsxs("div",{children:[f.jsx("p",{className:"project-name",children:e.project.name}),f.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),f.jsx("p",{className:"project-insight",children:e.insight})]}),f.jsx("div",{className:"project-row-stat",children:f.jsxs("div",{className:"metric-inline-block",children:[f.jsx("p",{className:"metric-inline-label",children:"Mentioned"}),f.jsx("p",{className:`metric-inline-value ${e.mentionTone==="caution"?"text-amber-400":""}`,children:e.mentionScore}),f.jsx("p",{className:"metric-inline-delta",children:e.mentionDelta}),e.providerCoverage&&f.jsx("p",{className:"text-[10px] font-medium text-amber-400/80",children:e.providerCoverage})]})}),f.jsx("div",{className:"project-row-stat",children:f.jsxs("div",{className:"metric-inline-block",children:[f.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),f.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel})]})}),f.jsx("span",{className:"project-row-link",children:f.jsx(Yf,{className:"h-4 w-4 text-zinc-500"})})]})}function uM(){const e=go(),{dashboard:n,isLoading:i}=Ac(),r=n??e?.dashboard;if(!r||i)return f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-32"}),f.jsx("div",{className:"skeleton-text-sm w-64"})]}),f.jsx("div",{className:"space-y-3",children:[1,2,3].map(S=>f.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[f.jsxs("div",{className:"flex-1 space-y-2",children:[f.jsx("div",{className:"skeleton-text w-36"}),f.jsx("div",{className:"skeleton-text-sm w-48"})]}),f.jsx("div",{className:"skeleton-text w-16"}),f.jsx("div",{className:"skeleton-text w-16"}),f.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},S))})]});const l=r.portfolioOverview,h=_p(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},g=MD(l.systemHealth,h,r.settings),{openRun:v}=Cp();return f.jsxs("div",{className:"page-container",children:[f.jsxs("div",{className:"page-header",children:[f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Portfolio"}),f.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),f.jsx("div",{className:"page-header-right",children:f.jsx("p",{className:"text-[11px] text-zinc-600",children:l.lastUpdatedAt})})]}),l.projects.length>0?f.jsx("div",{className:"project-list project-list-scrollable",children:l.projects.map(S=>f.jsx(cM,{project:S},S.project.id))}):f.jsxs(jn,{className:"surface-card empty-card",children:[f.jsx("h3",{children:l.emptyState?.title??"No projects yet"}),f.jsx("p",{className:"supporting-copy",children:l.emptyState?.detail}),f.jsx(qe,{size:"sm",asChild:!0,children:f.jsx(rt,{to:l.emptyState?.ctaHref==="/setup"||!l.emptyState?.ctaHref?"/setup":"/",children:l.emptyState?.ctaLabel??"Launch setup"})})]}),f.jsxs("div",{className:"overview-secondary-grid",children:[l.attentionItems.length>0&&f.jsxs("section",{className:"overview-secondary-section",children:[f.jsx("div",{className:"section-head section-head-inline",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),f.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),f.jsx("div",{className:"attention-list attention-list-scrollable",children:l.attentionItems.map(S=>S.href?f.jsxs(rt,{to:S.href,className:`attention-item attention-item-${S.tone}`,children:[f.jsxs("div",{children:[f.jsx("p",{className:"attention-title",children:S.title}),f.jsx("p",{className:"attention-detail",children:S.detail})]}),S.actionLabel&&f.jsx("span",{className:"attention-action",children:S.actionLabel})]},S.id):f.jsxs("div",{className:`attention-item attention-item-static attention-item-${S.tone}`,children:[f.jsxs("div",{children:[f.jsx("p",{className:"attention-title",children:S.title}),f.jsx("p",{className:"attention-detail",children:S.detail})]}),S.actionLabel&&f.jsx("span",{className:"attention-action",children:S.actionLabel})]},S.id))})]}),f.jsxs("section",{className:"overview-secondary-section",children:[f.jsx("div",{className:"section-head section-head-inline",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),f.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),f.jsx("div",{className:"compact-stack compact-stack-scrollable",children:l.recentRuns.length>0?l.recentRuns.map(S=>f.jsxs("button",{className:"compact-run",type:"button",onClick:()=>v(S.id),children:[f.jsxs("div",{children:[f.jsx("p",{className:"compact-run-title",children:S.projectName}),f.jsx("p",{className:"compact-run-detail",children:S.summary})]}),f.jsx(kp,{status:S.status})]},S.id)):f.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),f.jsxs("section",{className:"page-section",children:[f.jsx("div",{className:"section-head section-head-inline",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),f.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),f.jsx("div",{className:"health-grid",children:g.map(S=>f.jsxs(jn,{className:"surface-card compact-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:S.label}),f.jsx("h3",{children:S.detail})]}),f.jsx(Ln,{tone:S.tone,title:S.id==="api"?Is(h.apiStatus):S.id==="worker"?Is(h.workerStatus):void 0,children:S.label})]}),f.jsx("p",{className:"supporting-copy",children:S.meta})]},S.id))})]})]})}const Op=Symbol.for("yaml.alias"),Bf=Symbol.for("yaml.document"),Za=Symbol.for("yaml.map"),_S=Symbol.for("yaml.pair"),Qn=Symbol.for("yaml.scalar"),Fs=Symbol.for("yaml.seq"),An=Symbol.for("yaml.node.type"),Oi=e=>!!e&&typeof e=="object"&&e[An]===Op,_c=e=>!!e&&typeof e=="object"&&e[An]===Bf,yo=e=>!!e&&typeof e=="object"&&e[An]===Za,St=e=>!!e&&typeof e=="object"&&e[An]===_S,at=e=>!!e&&typeof e=="object"&&e[An]===Qn,bo=e=>!!e&&typeof e=="object"&&e[An]===Fs;function bt(e){if(e&&typeof e=="object")switch(e[An]){case Za:case Fs:return!0}return!1}function vt(e){if(e&&typeof e=="object")switch(e[An]){case Op:case Za:case Qn:case Fs:return!0}return!1}const CS=e=>(at(e)||bt(e))&&!!e.anchor,ji=Symbol("break visit"),dM=Symbol("skip children"),ro=Symbol("remove node");function Ws(e,n){const i=fM(n);_c(e)?Os(null,e.contents,i,Object.freeze([e]))===ro&&(e.contents=null):Os(null,e,i,Object.freeze([]))}Ws.BREAK=ji;Ws.SKIP=dM;Ws.REMOVE=ro;function Os(e,n,i,r){const l=pM(e,n,i,r);if(vt(l)||St(l))return mM(e,r,l),Os(e,l,i,r);if(typeof l!="symbol"){if(bt(n)){r=Object.freeze(r.concat(n));for(let c=0;c<n.items.length;++c){const d=Os(c,n.items[c],i,r);if(typeof d=="number")c=d-1;else{if(d===ji)return ji;d===ro&&(n.items.splice(c,1),c-=1)}}}else if(St(n)){r=Object.freeze(r.concat(n));const c=Os("key",n.key,i,r);if(c===ji)return ji;c===ro&&(n.key=null);const d=Os("value",n.value,i,r);if(d===ji)return ji;d===ro&&(n.value=null)}}return l}function fM(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 pM(e,n,i,r){if(typeof i=="function")return i(e,n,r);if(yo(n))return i.Map?.(e,n,r);if(bo(n))return i.Seq?.(e,n,r);if(St(n))return i.Pair?.(e,n,r);if(at(n))return i.Scalar?.(e,n,r);if(Oi(n))return i.Alias?.(e,n,r)}function mM(e,n,i){const r=n[n.length-1];if(bt(r))r.items[e]=i;else if(St(r))e==="key"?r.key=i:r.value=i;else if(_c(r))r.contents=i;else{const l=Oi(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${l} parent`)}}const hM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},gM=e=>e.replace(/[!,[\]{}]/g,n=>hM[n]);class Gt{constructor(n,i){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Gt.defaultYaml,n),this.tags=Object.assign({},Gt.defaultTags,i)}clone(){const n=new Gt(this.yaml,this.tags);return n.docStart=this.docStart,n}atDocument(){const n=new Gt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Gt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Gt.defaultTags);break}return n}add(n,i){this.atNextDocument&&(this.yaml={explicit:Gt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Gt.defaultTags),this.atNextDocument=!1);const r=n.trim().split(/[ \t]+/),l=r.shift();switch(l){case"%TAG":{if(r.length!==2&&(i(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[c,d]=r;return this.tags[c]=d,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return i(0,"%YAML directive should contain exactly one part"),!1;const[c]=r;if(c==="1.1"||c==="1.2")return this.yaml.version=c,!0;{const d=/^\d+\.\d+$/.test(c);return i(6,`Unsupported YAML version ${c}`,d),!1}}default:return i(0,`Unknown directive ${l}`,!0),!1}}tagName(n,i){if(n==="!")return"!";if(n[0]!=="!")return i(`Not a valid tag: ${n}`),null;if(n[1]==="<"){const d=n.slice(2,-1);return d==="!"||d==="!!"?(i(`Verbatim tags aren't resolved, so ${n} is invalid.`),null):(n[n.length-1]!==">"&&i("Verbatim tags must end with a >"),d)}const[,r,l]=n.match(/^(.*!)([^!]*)$/s);l||i(`The ${n} tag has no suffix`);const c=this.tags[r];if(c)try{return c+decodeURIComponent(l)}catch(d){return i(String(d)),null}return r==="!"?n:(i(`Could not resolve tag: ${n}`),null)}tagString(n){for(const[i,r]of Object.entries(this.tags))if(n.startsWith(r))return i+gM(n.substring(r.length));return n[0]==="!"?n:`!<${n}>`}toString(n){const i=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let l;if(n&&r.length>0&&vt(n.contents)){const c={};Ws(n.contents,(d,h)=>{vt(h)&&h.tag&&(c[h.tag]=!0)}),l=Object.keys(c)}else l=[];for(const[c,d]of r)c==="!!"&&d==="tag:yaml.org,2002:"||(!n||l.some(h=>h.startsWith(d)))&&i.push(`%TAG ${c} ${d}`);return i.join(`
65
+ `)}}Gt.defaultYaml={explicit:!1,version:"1.2"};Gt.defaultTags={"!!":"tag:yaml.org,2002:"};function zS(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const i=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(i)}return!0}function TS(e){const n=new Set;return Ws(e,{Value(i,r){r.anchor&&n.add(r.anchor)}}),n}function ES(e,n){for(let i=1;;++i){const r=`${e}${i}`;if(!n.has(r))return r}}function yM(e,n){const i=[],r=new Map;let l=null;return{onAnchor:c=>{i.push(c),l??(l=TS(e));const d=ES(n,l);return l.add(d),d},setAnchors:()=>{for(const c of i){const d=r.get(c);if(typeof d=="object"&&d.anchor&&(at(d.node)||bt(d.node)))d.node.anchor=d.anchor;else{const h=new Error("Failed to resolve repeated object (this should not happen)");throw h.source=c,h}}},sourceObjects:r}}function Ds(e,n,i,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let l=0,c=r.length;l<c;++l){const d=r[l],h=Ds(e,r,String(l),d);h===void 0?delete r[l]:h!==d&&(r[l]=h)}else if(r instanceof Map)for(const l of Array.from(r.keys())){const c=r.get(l),d=Ds(e,r,l,c);d===void 0?r.delete(l):d!==c&&r.set(l,d)}else if(r instanceof Set)for(const l of Array.from(r)){const c=Ds(e,r,l,l);c===void 0?r.delete(l):c!==l&&(r.delete(l),r.add(c))}else for(const[l,c]of Object.entries(r)){const d=Ds(e,r,l,c);d===void 0?delete r[l]:d!==c&&(r[l]=d)}return e.call(n,i,r)}function kn(e,n,i){if(Array.isArray(e))return e.map((r,l)=>kn(r,String(l),i));if(e&&typeof e.toJSON=="function"){if(!i||!CS(e))return e.toJSON(n,i);const r={aliasCount:0,count:1,res:void 0};i.anchors.set(e,r),i.onCreate=c=>{r.res=c,delete i.onCreate};const l=e.toJSON(n,i);return i.onCreate&&i.onCreate(l),l}return typeof e=="bigint"&&!i?.keep?Number(e):e}class Dp{constructor(n){Object.defineProperty(this,An,{value:n})}clone(){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(n.range=this.range.slice()),n}toJS(n,{mapAsMap:i,maxAliasCount:r,onAnchor:l,reviver:c}={}){if(!_c(n))throw new TypeError("A document argument is required");const d={anchors:new Map,doc:n,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},h=kn(this,"",d);if(typeof l=="function")for(const{count:g,res:v}of d.anchors.values())l(v,g);return typeof c=="function"?Ds(c,{"":h},"",h):h}}class Rp extends Dp{constructor(n){super(Op),this.source=n,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(n,i){let r;i?.aliasResolveCache?r=i.aliasResolveCache:(r=[],Ws(n,{Node:(c,d)=>{(Oi(d)||CS(d))&&r.push(d)}}),i&&(i.aliasResolveCache=r));let l;for(const c of r){if(c===this)break;c.anchor===this.source&&(l=c)}return l}toJSON(n,i){if(!i)return{source:this.source};const{anchors:r,doc:l,maxAliasCount:c}=i,d=this.resolve(l,i);if(!d){const g=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(g)}let h=r.get(d);if(h||(kn(d,null,i),h=r.get(d)),h?.res===void 0){const g="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(g)}if(c>=0&&(h.count+=1,h.aliasCount===0&&(h.aliasCount=Wl(l,d,r)),h.count*h.aliasCount>c)){const g="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(g)}return h.res}toString(n,i,r){const l=`*${this.source}`;if(n){if(zS(this.source),n.options.verifyAliasOrder&&!n.anchors.has(this.source)){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(c)}if(n.implicitKey)return`${l} `}return l}}function Wl(e,n,i){if(Oi(n)){const r=n.resolve(e),l=i&&r&&i.get(r);return l?l.count*l.aliasCount:0}else if(bt(n)){let r=0;for(const l of n.items){const c=Wl(e,l,i);c>r&&(r=c)}return r}else if(St(n)){const r=Wl(e,n.key,i),l=Wl(e,n.value,i);return Math.max(r,l)}return 1}const OS=e=>!e||typeof e!="function"&&typeof e!="object";class Ae extends Dp{constructor(n){super(Qn),this.value=n}toJSON(n,i){return i?.keep?this.value:kn(this.value,n,i)}toString(){return String(this.value)}}Ae.BLOCK_FOLDED="BLOCK_FOLDED";Ae.BLOCK_LITERAL="BLOCK_LITERAL";Ae.PLAIN="PLAIN";Ae.QUOTE_DOUBLE="QUOTE_DOUBLE";Ae.QUOTE_SINGLE="QUOTE_SINGLE";const bM="tag:yaml.org,2002:";function vM(e,n,i){if(n){const r=i.filter(c=>c.tag===n),l=r.find(c=>!c.format)??r[0];if(!l)throw new Error(`Tag ${n} not found`);return l}return i.find(r=>r.identify?.(e)&&!r.format)}function po(e,n,i){if(_c(e)&&(e=e.contents),vt(e))return e;if(St(e)){const x=i.schema[Za].createNode?.(i.schema,null,i);return x.items.push(e),x}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:l,onTagObj:c,schema:d,sourceObjects:h}=i;let g;if(r&&e&&typeof e=="object"){if(g=h.get(e),g)return g.anchor??(g.anchor=l(e)),new Rp(g.anchor);g={anchor:null,node:null},h.set(e,g)}n?.startsWith("!!")&&(n=bM+n.slice(2));let v=vM(e,n,d.tags);if(!v){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const x=new Ae(e);return g&&(g.node=x),x}v=e instanceof Map?d[Za]:Symbol.iterator in Object(e)?d[Fs]:d[Za]}c&&(c(v),delete i.onTagObj);const S=v?.createNode?v.createNode(i.schema,e,i):typeof v?.nodeClass?.from=="function"?v.nodeClass.from(i.schema,e,i):new Ae(e);return n?S.tag=n:v.default||(S.tag=v.tag),g&&(g.node=S),S}function pc(e,n,i){let r=i;for(let l=n.length-1;l>=0;--l){const c=n[l];if(typeof c=="number"&&Number.isInteger(c)&&c>=0){const d=[];d[c]=r,r=d}else r=new Map([[c,r]])}return po(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const so=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class DS extends Dp{constructor(n,i){super(n),Object.defineProperty(this,"schema",{value:i,configurable:!0,enumerable:!1,writable:!0})}clone(n){const i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return n&&(i.schema=n),i.items=i.items.map(r=>vt(r)||St(r)?r.clone(n):r),this.range&&(i.range=this.range.slice()),i}addIn(n,i){if(so(n))this.add(i);else{const[r,...l]=n,c=this.get(r,!0);if(bt(c))c.addIn(l,i);else if(c===void 0&&this.schema)this.set(r,pc(this.schema,l,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${l}`)}}deleteIn(n){const[i,...r]=n;if(r.length===0)return this.delete(i);const l=this.get(i,!0);if(bt(l))return l.deleteIn(r);throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}getIn(n,i){const[r,...l]=n,c=this.get(r,!0);return l.length===0?!i&&at(c)?c.value:c:bt(c)?c.getIn(l,i):void 0}hasAllNullValues(n){return this.items.every(i=>{if(!St(i))return!1;const r=i.value;return r==null||n&&at(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(n){const[i,...r]=n;if(r.length===0)return this.has(i);const l=this.get(i,!0);return bt(l)?l.hasIn(r):!1}setIn(n,i){const[r,...l]=n;if(l.length===0)this.set(r,i);else{const c=this.get(r,!0);if(bt(c))c.setIn(l,i);else if(c===void 0&&this.schema)this.set(r,pc(this.schema,l,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${l}`)}}}const SM=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ha(e,n){return/^\n+$/.test(e)?e.substring(1):n?e.replace(/^(?! *$)/gm,n):e}const Ni=(e,n,i)=>e.endsWith(`
66
66
  `)?ha(i,n):i.includes(`
67
67
  `)?`
68
- `+ha(i,n):(e.endsWith(" ")?"":" ")+i,RS="flow",Lf="block",ec="quoted";function Cc(e,n,i="flow",{indentAtStart:r,lineWidth:l=80,minContentWidth:c=20,onFold:d,onOverflow:h}={}){if(!l||l<0)return e;l<c&&(c=0);const g=Math.max(1+c,1+l-n.length);if(e.length<=g)return e;const b=[],S={};let x=l-n.length;typeof r=="number"&&(r>l-Math.max(2,c)?b.push(0):x=l-r);let N,_,T=!1,k=-1,E=-1,R=-1;i===Lf&&(k=Fb(e,k,n.length),k!==-1&&(x=k+g));for(let G;G=e[k+=1];){if(i===ec&&G==="\\"){switch(E=k,e[k+1]){case"x":k+=3;break;case"u":k+=5;break;case"U":k+=9;break;default:k+=1}R=k}if(G===`
69
- `)i===Lf&&(k=Fb(e,k,n.length)),x=k+n.length+g,N=void 0;else{if(G===" "&&_&&_!==" "&&_!==`
68
+ `+ha(i,n):(e.endsWith(" ")?"":" ")+i,RS="flow",Lf="block",ec="quoted";function Cc(e,n,i="flow",{indentAtStart:r,lineWidth:l=80,minContentWidth:c=20,onFold:d,onOverflow:h}={}){if(!l||l<0)return e;l<c&&(c=0);const g=Math.max(1+c,1+l-n.length);if(e.length<=g)return e;const v=[],S={};let x=l-n.length;typeof r=="number"&&(r>l-Math.max(2,c)?v.push(0):x=l-r);let N,_,T=!1,k=-1,E=-1,R=-1;i===Lf&&(k=Wb(e,k,n.length),k!==-1&&(x=k+g));for(let G;G=e[k+=1];){if(i===ec&&G==="\\"){switch(E=k,e[k+1]){case"x":k+=3;break;case"u":k+=5;break;case"U":k+=9;break;default:k+=1}R=k}if(G===`
69
+ `)i===Lf&&(k=Wb(e,k,n.length)),x=k+n.length+g,N=void 0;else{if(G===" "&&_&&_!==" "&&_!==`
70
70
  `&&_!==" "){const Z=e[k+1];Z&&Z!==" "&&Z!==`
71
- `&&Z!==" "&&(N=k)}if(k>=x)if(N)b.push(N),x=N+g,N=void 0;else if(i===ec){for(;_===" "||_===" ";)_=G,G=e[k+=1],T=!0;const Z=k>R+1?k-2:E-1;if(S[Z])return e;b.push(Z),S[Z]=!0,x=Z+g,N=void 0}else T=!0}_=G}if(T&&h&&h(),b.length===0)return e;d&&d();let V=e.slice(0,b[0]);for(let G=0;G<b.length;++G){const Z=b[G],X=b[G+1]||e.length;Z===0?V=`
71
+ `&&Z!==" "&&(N=k)}if(k>=x)if(N)v.push(N),x=N+g,N=void 0;else if(i===ec){for(;_===" "||_===" ";)_=G,G=e[k+=1],T=!0;const Z=k>R+1?k-2:E-1;if(S[Z])return e;v.push(Z),S[Z]=!0,x=Z+g,N=void 0}else T=!0}_=G}if(T&&h&&h(),v.length===0)return e;d&&d();let V=e.slice(0,v[0]);for(let G=0;G<v.length;++G){const Z=v[G],X=v[G+1]||e.length;Z===0?V=`
72
72
  ${n}${e.slice(0,X)}`:(i===ec&&S[Z]&&(V+=`${e[Z]}\\`),V+=`
73
- ${n}${e.slice(Z+1,X)}`)}return V}function Fb(e,n,i){let r=n,l=n+1,c=e[l];for(;c===" "||c===" ";)if(n<l+i)c=e[++n];else{do c=e[++n];while(c&&c!==`
74
- `);r=n,l=n+1,c=e[l]}return r}const zc=(e,n)=>({indentAtStart:n?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Tc=e=>/^(%|---|\.\.\.)/m.test(e);function hM(e,n,i){if(!n||n<0)return!1;const r=n-i,l=e.length;if(l<=r)return!1;for(let c=0,d=0;c<l;++c)if(e[c]===`
75
- `){if(c-d>r)return!0;if(d=c+1,l-d<=r)return!1}return!0}function oo(e,n){const i=JSON.stringify(e);if(n.options.doubleQuotedAsJSON)return i;const{implicitKey:r}=n,l=n.options.doubleQuotedMinMultiLineLength,c=n.indent||(Tc(e)?" ":"");let d="",h=0;for(let g=0,b=i[g];b;b=i[++g])if(b===" "&&i[g+1]==="\\"&&i[g+2]==="n"&&(d+=i.slice(h,g)+"\\ ",g+=1,h=g,b="\\"),b==="\\")switch(i[g+1]){case"u":{d+=i.slice(h,g);const S=i.substr(g+2,4);switch(S){case"0000":d+="\\0";break;case"0007":d+="\\a";break;case"000b":d+="\\v";break;case"001b":d+="\\e";break;case"0085":d+="\\N";break;case"00a0":d+="\\_";break;case"2028":d+="\\L";break;case"2029":d+="\\P";break;default:S.substr(0,2)==="00"?d+="\\x"+S.substr(2):d+=i.substr(g,6)}g+=5,h=g+1}break;case"n":if(r||i[g+2]==='"'||i.length<l)g+=1;else{for(d+=i.slice(h,g)+`
73
+ ${n}${e.slice(Z+1,X)}`)}return V}function Wb(e,n,i){let r=n,l=n+1,c=e[l];for(;c===" "||c===" ";)if(n<l+i)c=e[++n];else{do c=e[++n];while(c&&c!==`
74
+ `);r=n,l=n+1,c=e[l]}return r}const zc=(e,n)=>({indentAtStart:n?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Tc=e=>/^(%|---|\.\.\.)/m.test(e);function xM(e,n,i){if(!n||n<0)return!1;const r=n-i,l=e.length;if(l<=r)return!1;for(let c=0,d=0;c<l;++c)if(e[c]===`
75
+ `){if(c-d>r)return!0;if(d=c+1,l-d<=r)return!1}return!0}function oo(e,n){const i=JSON.stringify(e);if(n.options.doubleQuotedAsJSON)return i;const{implicitKey:r}=n,l=n.options.doubleQuotedMinMultiLineLength,c=n.indent||(Tc(e)?" ":"");let d="",h=0;for(let g=0,v=i[g];v;v=i[++g])if(v===" "&&i[g+1]==="\\"&&i[g+2]==="n"&&(d+=i.slice(h,g)+"\\ ",g+=1,h=g,v="\\"),v==="\\")switch(i[g+1]){case"u":{d+=i.slice(h,g);const S=i.substr(g+2,4);switch(S){case"0000":d+="\\0";break;case"0007":d+="\\a";break;case"000b":d+="\\v";break;case"001b":d+="\\e";break;case"0085":d+="\\N";break;case"00a0":d+="\\_";break;case"2028":d+="\\L";break;case"2029":d+="\\P";break;default:S.substr(0,2)==="00"?d+="\\x"+S.substr(2):d+=i.substr(g,6)}g+=5,h=g+1}break;case"n":if(r||i[g+2]==='"'||i.length<l)g+=1;else{for(d+=i.slice(h,g)+`
76
76
 
77
77
  `;i[g+2]==="\\"&&i[g+3]==="n"&&i[g+4]!=='"';)d+=`
78
78
  `,g+=2;d+=c,i[g+2]===" "&&(d+="\\"),g+=1,h=g+1}break;default:g+=1}return d=h?d+i.slice(h):i,r?d:Cc(d,c,ec,zc(n,!1))}function qf(e,n){if(n.options.singleQuote===!1||n.implicitKey&&e.includes(`
@@ -80,58 +80,58 @@ ${n}${e.slice(Z+1,X)}`)}return V}function Fb(e,n,i){let r=n,l=n+1,c=e[l];for(;c=
80
80
  ${i}`)+"'";return n.implicitKey?r:Cc(r,i,RS,zc(n,!1))}function Rs(e,n){const{singleQuote:i}=n.options;let r;if(i===!1)r=oo;else{const l=e.includes('"'),c=e.includes("'");l&&!c?r=qf:c&&!l?r=oo:r=i?qf:oo}return r(e,n)}let Uf;try{Uf=new RegExp(`(^|(?<!
81
81
  ))
82
82
  +(?!
83
- |$)`,"g")}catch{Uf=/\n+(?!\n|$)/g}function tc({comment:e,type:n,value:i},r,l,c){const{blockQuote:d,commentString:h,lineWidth:g}=r.options;if(!d||/\n[\t ]+$/.test(i))return Rs(i,r);const b=r.indent||(r.forceBlockIndent||Tc(i)?" ":""),S=d==="literal"?!0:d==="folded"||n===Ae.BLOCK_FOLDED?!1:n===Ae.BLOCK_LITERAL?!0:!hM(i,g,b.length);if(!i)return S?`|
83
+ |$)`,"g")}catch{Uf=/\n+(?!\n|$)/g}function tc({comment:e,type:n,value:i},r,l,c){const{blockQuote:d,commentString:h,lineWidth:g}=r.options;if(!d||/\n[\t ]+$/.test(i))return Rs(i,r);const v=r.indent||(r.forceBlockIndent||Tc(i)?" ":""),S=d==="literal"?!0:d==="folded"||n===Ae.BLOCK_FOLDED?!1:n===Ae.BLOCK_LITERAL?!0:!xM(i,g,v.length);if(!i)return S?`|
84
84
  `:`>
85
85
  `;let x,N;for(N=i.length;N>0;--N){const X=i[N-1];if(X!==`
86
86
  `&&X!==" "&&X!==" ")break}let _=i.substring(N);const T=_.indexOf(`
87
87
  `);T===-1?x="-":i===_||T!==_.length-1?(x="+",c&&c()):x="",_&&(i=i.slice(0,-_.length),_[_.length-1]===`
88
- `&&(_=_.slice(0,-1)),_=_.replace(Uf,`$&${b}`));let k=!1,E,R=-1;for(E=0;E<i.length;++E){const X=i[E];if(X===" ")k=!0;else if(X===`
89
- `)R=E;else break}let V=i.substring(0,R<E?R+1:E);V&&(i=i.substring(V.length),V=V.replace(/\n+/g,`$&${b}`));let Z=(k?b?"2":"1":"")+x;if(e&&(Z+=" "+h(e.replace(/ ?[\r\n]+/g," ")),l&&l()),!S){const X=i.replace(/\n+/g,`
90
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${b}`);let F=!1;const O=zc(r,!0);d!=="folded"&&n!==Ae.BLOCK_FOLDED&&(O.onOverflow=()=>{F=!0});const M=Cc(`${V}${X}${_}`,b,Lf,O);if(!F)return`>${Z}
91
- ${b}${M}`}return i=i.replace(/\n+/g,`$&${b}`),`|${Z}
92
- ${b}${V}${i}${_}`}function gM(e,n,i,r){const{type:l,value:c}=e,{actualString:d,implicitKey:h,indent:g,indentStep:b,inFlow:S}=n;if(h&&c.includes(`
88
+ `&&(_=_.slice(0,-1)),_=_.replace(Uf,`$&${v}`));let k=!1,E,R=-1;for(E=0;E<i.length;++E){const X=i[E];if(X===" ")k=!0;else if(X===`
89
+ `)R=E;else break}let V=i.substring(0,R<E?R+1:E);V&&(i=i.substring(V.length),V=V.replace(/\n+/g,`$&${v}`));let Z=(k?v?"2":"1":"")+x;if(e&&(Z+=" "+h(e.replace(/ ?[\r\n]+/g," ")),l&&l()),!S){const X=i.replace(/\n+/g,`
90
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${v}`);let F=!1;const O=zc(r,!0);d!=="folded"&&n!==Ae.BLOCK_FOLDED&&(O.onOverflow=()=>{F=!0});const M=Cc(`${V}${X}${_}`,v,Lf,O);if(!F)return`>${Z}
91
+ ${v}${M}`}return i=i.replace(/\n+/g,`$&${v}`),`|${Z}
92
+ ${v}${V}${i}${_}`}function wM(e,n,i,r){const{type:l,value:c}=e,{actualString:d,implicitKey:h,indent:g,indentStep:v,inFlow:S}=n;if(h&&c.includes(`
93
93
  `)||S&&/[[\]{},]/.test(c))return Rs(c,n);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return h||S||!c.includes(`
94
94
  `)?Rs(c,n):tc(e,n,i,r);if(!h&&!S&&l!==Ae.PLAIN&&c.includes(`
95
- `))return tc(e,n,i,r);if(Tc(c)){if(g==="")return n.forceBlockIndent=!0,tc(e,n,i,r);if(h&&g===b)return Rs(c,n)}const x=c.replace(/\n+/g,`$&
96
- ${g}`);if(d){const N=k=>k.default&&k.tag!=="tag:yaml.org,2002:str"&&k.test?.test(x),{compat:_,tags:T}=n.doc.schema;if(T.some(N)||_?.some(N))return Rs(c,n)}return h?x:Cc(x,g,RS,zc(n,!1))}function Rp(e,n,i,r){const{implicitKey:l,inFlow:c}=n,d=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:h}=e;h!==Ae.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(h=Ae.QUOTE_DOUBLE);const g=S=>{switch(S){case Ae.BLOCK_FOLDED:case Ae.BLOCK_LITERAL:return l||c?Rs(d.value,n):tc(d,n,i,r);case Ae.QUOTE_DOUBLE:return oo(d.value,n);case Ae.QUOTE_SINGLE:return qf(d.value,n);case Ae.PLAIN:return gM(d,n,i,r);default:return null}};let b=g(h);if(b===null){const{defaultKeyType:S,defaultStringType:x}=n.options,N=l&&S||x;if(b=g(N),b===null)throw new Error(`Unsupported default string type ${N}`)}return b}function MS(e,n){const i=Object.assign({blockQuote:!0,commentString:mM,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,n);let r;switch(i.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:i.flowCollectionPadding?" ":"",indent:"",indentStep:typeof i.indent=="number"?" ".repeat(i.indent):" ",inFlow:r,options:i}}function yM(e,n){if(n.tag){const l=e.filter(c=>c.tag===n.tag);if(l.length>0)return l.find(c=>c.format===n.format)??l[0]}let i,r;if(at(n)){r=n.value;let l=e.filter(c=>c.identify?.(r));if(l.length>1){const c=l.filter(d=>d.test);c.length>0&&(l=c)}i=l.find(c=>c.format===n.format)??l.find(c=>!c.format)}else r=n,i=e.find(l=>l.nodeClass&&r instanceof l.nodeClass);if(!i){const l=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${l} value`)}return i}function bM(e,n,{anchors:i,doc:r}){if(!r.directives)return"";const l=[],c=(at(e)||bt(e))&&e.anchor;c&&zS(c)&&(i.add(c),l.push(`&${c}`));const d=e.tag??(n.default?null:n.tag);return d&&l.push(r.directives.tagString(d)),l.join(" ")}function Vs(e,n,i,r){if(St(e))return e.toString(n,i,r);if(Oi(e)){if(n.doc.directives)return e.toString(n);if(n.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");n.resolvedAliases?n.resolvedAliases.add(e):n.resolvedAliases=new Set([e]),e=e.resolve(n.doc)}let l;const c=vt(e)?e:n.doc.createNode(e,{onTagObj:g=>l=g});l??(l=yM(n.doc.schema.tags,c));const d=bM(c,l,n);d.length>0&&(n.indentAtStart=(n.indentAtStart??0)+d.length+1);const h=typeof l.stringify=="function"?l.stringify(c,n,i,r):at(c)?Rp(c,n,i,r):c.toString(n,i,r);return d?at(c)||h[0]==="{"||h[0]==="["?`${d} ${h}`:`${d}
97
- ${n.indent}${h}`:h}function vM({key:e,value:n},i,r,l){const{allNullValues:c,doc:d,indent:h,indentStep:g,options:{commentString:b,indentSeq:S,simpleKeys:x}}=i;let N=vt(e)&&e.comment||null;if(x){if(N)throw new Error("With simple keys, key nodes cannot have comments");if(bt(e)||!vt(e)&&typeof e=="object"){const O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let _=!x&&(!e||N&&n==null&&!i.inFlow||bt(e)||(at(e)?e.type===Ae.BLOCK_FOLDED||e.type===Ae.BLOCK_LITERAL:typeof e=="object"));i=Object.assign({},i,{allNullValues:!1,implicitKey:!_&&(x||!c),indent:h+g});let T=!1,k=!1,E=Vs(e,i,()=>T=!0,()=>k=!0);if(!_&&!i.inFlow&&E.length>1024){if(x)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");_=!0}if(i.inFlow){if(c||n==null)return T&&r&&r(),E===""?"?":_?`? ${E}`:E}else if(c&&!x||n==null&&_)return E=`? ${E}`,N&&!T?E+=Ni(E,i.indent,b(N)):k&&l&&l(),E;T&&(N=null),_?(N&&(E+=Ni(E,i.indent,b(N))),E=`? ${E}
98
- ${h}:`):(E=`${E}:`,N&&(E+=Ni(E,i.indent,b(N))));let R,V,G;vt(n)?(R=!!n.spaceBefore,V=n.commentBefore,G=n.comment):(R=!1,V=null,G=null,n&&typeof n=="object"&&(n=d.createNode(n))),i.implicitKey=!1,!_&&!N&&at(n)&&(i.indentAtStart=E.length+1),k=!1,!S&&g.length>=2&&!i.inFlow&&!_&&bo(n)&&!n.flow&&!n.tag&&!n.anchor&&(i.indent=i.indent.substring(2));let Z=!1;const X=Vs(n,i,()=>Z=!0,()=>k=!0);let F=" ";if(N||R||V){if(F=R?`
99
- `:"",V){const O=b(V);F+=`
95
+ `))return tc(e,n,i,r);if(Tc(c)){if(g==="")return n.forceBlockIndent=!0,tc(e,n,i,r);if(h&&g===v)return Rs(c,n)}const x=c.replace(/\n+/g,`$&
96
+ ${g}`);if(d){const N=k=>k.default&&k.tag!=="tag:yaml.org,2002:str"&&k.test?.test(x),{compat:_,tags:T}=n.doc.schema;if(T.some(N)||_?.some(N))return Rs(c,n)}return h?x:Cc(x,g,RS,zc(n,!1))}function Mp(e,n,i,r){const{implicitKey:l,inFlow:c}=n,d=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:h}=e;h!==Ae.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(h=Ae.QUOTE_DOUBLE);const g=S=>{switch(S){case Ae.BLOCK_FOLDED:case Ae.BLOCK_LITERAL:return l||c?Rs(d.value,n):tc(d,n,i,r);case Ae.QUOTE_DOUBLE:return oo(d.value,n);case Ae.QUOTE_SINGLE:return qf(d.value,n);case Ae.PLAIN:return wM(d,n,i,r);default:return null}};let v=g(h);if(v===null){const{defaultKeyType:S,defaultStringType:x}=n.options,N=l&&S||x;if(v=g(N),v===null)throw new Error(`Unsupported default string type ${N}`)}return v}function MS(e,n){const i=Object.assign({blockQuote:!0,commentString:SM,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,n);let r;switch(i.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:i.flowCollectionPadding?" ":"",indent:"",indentStep:typeof i.indent=="number"?" ".repeat(i.indent):" ",inFlow:r,options:i}}function jM(e,n){if(n.tag){const l=e.filter(c=>c.tag===n.tag);if(l.length>0)return l.find(c=>c.format===n.format)??l[0]}let i,r;if(at(n)){r=n.value;let l=e.filter(c=>c.identify?.(r));if(l.length>1){const c=l.filter(d=>d.test);c.length>0&&(l=c)}i=l.find(c=>c.format===n.format)??l.find(c=>!c.format)}else r=n,i=e.find(l=>l.nodeClass&&r instanceof l.nodeClass);if(!i){const l=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${l} value`)}return i}function NM(e,n,{anchors:i,doc:r}){if(!r.directives)return"";const l=[],c=(at(e)||bt(e))&&e.anchor;c&&zS(c)&&(i.add(c),l.push(`&${c}`));const d=e.tag??(n.default?null:n.tag);return d&&l.push(r.directives.tagString(d)),l.join(" ")}function Vs(e,n,i,r){if(St(e))return e.toString(n,i,r);if(Oi(e)){if(n.doc.directives)return e.toString(n);if(n.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");n.resolvedAliases?n.resolvedAliases.add(e):n.resolvedAliases=new Set([e]),e=e.resolve(n.doc)}let l;const c=vt(e)?e:n.doc.createNode(e,{onTagObj:g=>l=g});l??(l=jM(n.doc.schema.tags,c));const d=NM(c,l,n);d.length>0&&(n.indentAtStart=(n.indentAtStart??0)+d.length+1);const h=typeof l.stringify=="function"?l.stringify(c,n,i,r):at(c)?Mp(c,n,i,r):c.toString(n,i,r);return d?at(c)||h[0]==="{"||h[0]==="["?`${d} ${h}`:`${d}
97
+ ${n.indent}${h}`:h}function kM({key:e,value:n},i,r,l){const{allNullValues:c,doc:d,indent:h,indentStep:g,options:{commentString:v,indentSeq:S,simpleKeys:x}}=i;let N=vt(e)&&e.comment||null;if(x){if(N)throw new Error("With simple keys, key nodes cannot have comments");if(bt(e)||!vt(e)&&typeof e=="object"){const O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let _=!x&&(!e||N&&n==null&&!i.inFlow||bt(e)||(at(e)?e.type===Ae.BLOCK_FOLDED||e.type===Ae.BLOCK_LITERAL:typeof e=="object"));i=Object.assign({},i,{allNullValues:!1,implicitKey:!_&&(x||!c),indent:h+g});let T=!1,k=!1,E=Vs(e,i,()=>T=!0,()=>k=!0);if(!_&&!i.inFlow&&E.length>1024){if(x)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");_=!0}if(i.inFlow){if(c||n==null)return T&&r&&r(),E===""?"?":_?`? ${E}`:E}else if(c&&!x||n==null&&_)return E=`? ${E}`,N&&!T?E+=Ni(E,i.indent,v(N)):k&&l&&l(),E;T&&(N=null),_?(N&&(E+=Ni(E,i.indent,v(N))),E=`? ${E}
98
+ ${h}:`):(E=`${E}:`,N&&(E+=Ni(E,i.indent,v(N))));let R,V,G;vt(n)?(R=!!n.spaceBefore,V=n.commentBefore,G=n.comment):(R=!1,V=null,G=null,n&&typeof n=="object"&&(n=d.createNode(n))),i.implicitKey=!1,!_&&!N&&at(n)&&(i.indentAtStart=E.length+1),k=!1,!S&&g.length>=2&&!i.inFlow&&!_&&bo(n)&&!n.flow&&!n.tag&&!n.anchor&&(i.indent=i.indent.substring(2));let Z=!1;const X=Vs(n,i,()=>Z=!0,()=>k=!0);let F=" ";if(N||R||V){if(F=R?`
99
+ `:"",V){const O=v(V);F+=`
100
100
  ${ha(O,i.indent)}`}X===""&&!i.inFlow?F===`
101
101
  `&&G&&(F=`
102
102
 
103
103
  `):F+=`
104
104
  ${i.indent}`}else if(!_&&bt(n)){const O=X[0],M=X.indexOf(`
105
- `),le=M!==-1,ke=i.inFlow??n.flow??n.items.length===0;if(le||!ke){let _e=!1;if(le&&(O==="&"||O==="!")){let be=X.indexOf(" ");O==="&"&&be!==-1&&be<M&&X[be+1]==="!"&&(be=X.indexOf(" ",be+1)),(be===-1||M<be)&&(_e=!0)}_e||(F=`
105
+ `),le=M!==-1,ke=i.inFlow??n.flow??n.items.length===0;if(le||!ke){let Ce=!1;if(le&&(O==="&"||O==="!")){let be=X.indexOf(" ");O==="&"&&be!==-1&&be<M&&X[be+1]==="!"&&(be=X.indexOf(" ",be+1)),(be===-1||M<be)&&(Ce=!0)}Ce||(F=`
106
106
  ${i.indent}`)}}else(X===""||X[0]===`
107
- `)&&(F="");return E+=F+X,i.inFlow?Z&&r&&r():G&&!Z?E+=Ni(E,i.indent,b(G)):k&&l&&l(),E}function SM(e,n){(e==="debug"||e==="warn")&&console.warn(n)}const Ql="<<",ga={identify:e=>e===Ql||typeof e=="symbol"&&e.description===Ql,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ae(Symbol(Ql)),{addToJSMap:BS}),stringify:()=>Ql},xM=(e,n)=>(ga.identify(n)||at(n)&&(!n.type||n.type===Ae.PLAIN)&&ga.identify(n.value))&&e?.doc.schema.tags.some(i=>i.tag===ga.tag&&i.default);function BS(e,n,i){if(i=e&&Oi(i)?i.resolve(e.doc):i,bo(i))for(const r of i.items)ff(e,n,r);else if(Array.isArray(i))for(const r of i)ff(e,n,r);else ff(e,n,i)}function ff(e,n,i){const r=e&&Oi(i)?i.resolve(e.doc):i;if(!yo(r))throw new Error("Merge sources must be maps or map aliases");const l=r.toJSON(null,e,Map);for(const[c,d]of l)n instanceof Map?n.has(c)||n.set(c,d):n instanceof Set?n.add(c):Object.prototype.hasOwnProperty.call(n,c)||Object.defineProperty(n,c,{value:d,writable:!0,enumerable:!0,configurable:!0});return n}function LS(e,n,{key:i,value:r}){if(vt(i)&&i.addToJSMap)i.addToJSMap(e,n,r);else if(xM(e,i))BS(e,n,r);else{const l=kn(i,"",e);if(n instanceof Map)n.set(l,kn(r,l,e));else if(n instanceof Set)n.add(l);else{const c=wM(i,l,e),d=kn(r,c,e);c in n?Object.defineProperty(n,c,{value:d,writable:!0,enumerable:!0,configurable:!0}):n[c]=d}}return n}function wM(e,n,i){if(n===null)return"";if(typeof n!="object")return String(n);if(vt(e)&&i?.doc){const r=MS(i.doc,{});r.anchors=new Set;for(const c of i.anchors.keys())r.anchors.add(c.anchor);r.inFlow=!0,r.inStringifyKey=!0;const l=e.toString(r);if(!i.mapKeyWarned){let c=JSON.stringify(l);c.length>40&&(c=c.substring(0,36)+'..."'),SM(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${c}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=!0}return l}return JSON.stringify(n)}function Mp(e,n,i){const r=po(e,void 0,i),l=po(n,void 0,i);return new Qt(r,l)}class Qt{constructor(n,i=null){Object.defineProperty(this,An,{value:_S}),this.key=n,this.value=i}clone(n){let{key:i,value:r}=this;return vt(i)&&(i=i.clone(n)),vt(r)&&(r=r.clone(n)),new Qt(i,r)}toJSON(n,i){const r=i?.mapAsMap?new Map:{};return LS(i,r,this)}toString(n,i,r){return n?.doc?vM(this,n,i,r):JSON.stringify(this)}}function qS(e,n,i){return(n.inFlow??e.flow?NM:jM)(e,n,i)}function jM({comment:e,items:n},i,{blockItemPrefix:r,flowChars:l,itemIndent:c,onChompKeep:d,onComment:h}){const{indent:g,options:{commentString:b}}=i,S=Object.assign({},i,{indent:c,type:null});let x=!1;const N=[];for(let T=0;T<n.length;++T){const k=n[T];let E=null;if(vt(k))!x&&k.spaceBefore&&N.push(""),mc(i,N,k.commentBefore,x),k.comment&&(E=k.comment);else if(St(k)){const V=vt(k.key)?k.key:null;V&&(!x&&V.spaceBefore&&N.push(""),mc(i,N,V.commentBefore,x))}x=!1;let R=Vs(k,S,()=>E=null,()=>x=!0);E&&(R+=Ni(R,c,b(E))),x&&E&&(x=!1),N.push(r+R)}let _;if(N.length===0)_=l.start+l.end;else{_=N[0];for(let T=1;T<N.length;++T){const k=N[T];_+=k?`
107
+ `)&&(F="");return E+=F+X,i.inFlow?Z&&r&&r():G&&!Z?E+=Ni(E,i.indent,v(G)):k&&l&&l(),E}function AM(e,n){(e==="debug"||e==="warn")&&console.warn(n)}const Ql="<<",ga={identify:e=>e===Ql||typeof e=="symbol"&&e.description===Ql,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ae(Symbol(Ql)),{addToJSMap:BS}),stringify:()=>Ql},_M=(e,n)=>(ga.identify(n)||at(n)&&(!n.type||n.type===Ae.PLAIN)&&ga.identify(n.value))&&e?.doc.schema.tags.some(i=>i.tag===ga.tag&&i.default);function BS(e,n,i){if(i=e&&Oi(i)?i.resolve(e.doc):i,bo(i))for(const r of i.items)ff(e,n,r);else if(Array.isArray(i))for(const r of i)ff(e,n,r);else ff(e,n,i)}function ff(e,n,i){const r=e&&Oi(i)?i.resolve(e.doc):i;if(!yo(r))throw new Error("Merge sources must be maps or map aliases");const l=r.toJSON(null,e,Map);for(const[c,d]of l)n instanceof Map?n.has(c)||n.set(c,d):n instanceof Set?n.add(c):Object.prototype.hasOwnProperty.call(n,c)||Object.defineProperty(n,c,{value:d,writable:!0,enumerable:!0,configurable:!0});return n}function LS(e,n,{key:i,value:r}){if(vt(i)&&i.addToJSMap)i.addToJSMap(e,n,r);else if(_M(e,i))BS(e,n,r);else{const l=kn(i,"",e);if(n instanceof Map)n.set(l,kn(r,l,e));else if(n instanceof Set)n.add(l);else{const c=CM(i,l,e),d=kn(r,c,e);c in n?Object.defineProperty(n,c,{value:d,writable:!0,enumerable:!0,configurable:!0}):n[c]=d}}return n}function CM(e,n,i){if(n===null)return"";if(typeof n!="object")return String(n);if(vt(e)&&i?.doc){const r=MS(i.doc,{});r.anchors=new Set;for(const c of i.anchors.keys())r.anchors.add(c.anchor);r.inFlow=!0,r.inStringifyKey=!0;const l=e.toString(r);if(!i.mapKeyWarned){let c=JSON.stringify(l);c.length>40&&(c=c.substring(0,36)+'..."'),AM(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${c}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=!0}return l}return JSON.stringify(n)}function Bp(e,n,i){const r=po(e,void 0,i),l=po(n,void 0,i);return new Qt(r,l)}class Qt{constructor(n,i=null){Object.defineProperty(this,An,{value:_S}),this.key=n,this.value=i}clone(n){let{key:i,value:r}=this;return vt(i)&&(i=i.clone(n)),vt(r)&&(r=r.clone(n)),new Qt(i,r)}toJSON(n,i){const r=i?.mapAsMap?new Map:{};return LS(i,r,this)}toString(n,i,r){return n?.doc?kM(this,n,i,r):JSON.stringify(this)}}function qS(e,n,i){return(n.inFlow??e.flow?TM:zM)(e,n,i)}function zM({comment:e,items:n},i,{blockItemPrefix:r,flowChars:l,itemIndent:c,onChompKeep:d,onComment:h}){const{indent:g,options:{commentString:v}}=i,S=Object.assign({},i,{indent:c,type:null});let x=!1;const N=[];for(let T=0;T<n.length;++T){const k=n[T];let E=null;if(vt(k))!x&&k.spaceBefore&&N.push(""),mc(i,N,k.commentBefore,x),k.comment&&(E=k.comment);else if(St(k)){const V=vt(k.key)?k.key:null;V&&(!x&&V.spaceBefore&&N.push(""),mc(i,N,V.commentBefore,x))}x=!1;let R=Vs(k,S,()=>E=null,()=>x=!0);E&&(R+=Ni(R,c,v(E))),x&&E&&(x=!1),N.push(r+R)}let _;if(N.length===0)_=l.start+l.end;else{_=N[0];for(let T=1;T<N.length;++T){const k=N[T];_+=k?`
108
108
  ${g}${k}`:`
109
109
  `}}return e?(_+=`
110
- `+ha(b(e),g),h&&h()):x&&d&&d(),_}function NM({items:e},n,{flowChars:i,itemIndent:r}){const{indent:l,indentStep:c,flowCollectionPadding:d,options:{commentString:h}}=n;r+=c;const g=Object.assign({},n,{indent:r,inFlow:!0,type:null});let b=!1,S=0;const x=[];for(let T=0;T<e.length;++T){const k=e[T];let E=null;if(vt(k))k.spaceBefore&&x.push(""),mc(n,x,k.commentBefore,!1),k.comment&&(E=k.comment);else if(St(k)){const V=vt(k.key)?k.key:null;V&&(V.spaceBefore&&x.push(""),mc(n,x,V.commentBefore,!1),V.comment&&(b=!0));const G=vt(k.value)?k.value:null;G?(G.comment&&(E=G.comment),G.commentBefore&&(b=!0)):k.value==null&&V?.comment&&(E=V.comment)}E&&(b=!0);let R=Vs(k,g,()=>E=null);T<e.length-1&&(R+=","),E&&(R+=Ni(R,r,h(E))),!b&&(x.length>S||R.includes(`
111
- `))&&(b=!0),x.push(R),S=x.length}const{start:N,end:_}=i;if(x.length===0)return N+_;if(!b){const T=x.reduce((k,E)=>k+E.length+2,2);b=n.options.lineWidth>0&&T>n.options.lineWidth}if(b){let T=N;for(const k of x)T+=k?`
110
+ `+ha(v(e),g),h&&h()):x&&d&&d(),_}function TM({items:e},n,{flowChars:i,itemIndent:r}){const{indent:l,indentStep:c,flowCollectionPadding:d,options:{commentString:h}}=n;r+=c;const g=Object.assign({},n,{indent:r,inFlow:!0,type:null});let v=!1,S=0;const x=[];for(let T=0;T<e.length;++T){const k=e[T];let E=null;if(vt(k))k.spaceBefore&&x.push(""),mc(n,x,k.commentBefore,!1),k.comment&&(E=k.comment);else if(St(k)){const V=vt(k.key)?k.key:null;V&&(V.spaceBefore&&x.push(""),mc(n,x,V.commentBefore,!1),V.comment&&(v=!0));const G=vt(k.value)?k.value:null;G?(G.comment&&(E=G.comment),G.commentBefore&&(v=!0)):k.value==null&&V?.comment&&(E=V.comment)}E&&(v=!0);let R=Vs(k,g,()=>E=null);T<e.length-1&&(R+=","),E&&(R+=Ni(R,r,h(E))),!v&&(x.length>S||R.includes(`
111
+ `))&&(v=!0),x.push(R),S=x.length}const{start:N,end:_}=i;if(x.length===0)return N+_;if(!v){const T=x.reduce((k,E)=>k+E.length+2,2);v=n.options.lineWidth>0&&T>n.options.lineWidth}if(v){let T=N;for(const k of x)T+=k?`
112
112
  ${c}${l}${k}`:`
113
113
  `;return`${T}
114
- ${l}${_}`}else return`${N}${d}${x.join(" ")}${d}${_}`}function mc({indent:e,options:{commentString:n}},i,r,l){if(r&&l&&(r=r.replace(/^\n+/,"")),r){const c=ha(n(r),e);i.push(c.trimStart())}}function ki(e,n){const i=at(n)?n.value:n;for(const r of e)if(St(r)&&(r.key===n||r.key===i||at(r.key)&&r.key.value===i))return r}class Nn extends DS{static get tagName(){return"tag:yaml.org,2002:map"}constructor(n){super(Za,n),this.items=[]}static from(n,i,r){const{keepUndefined:l,replacer:c}=r,d=new this(n),h=(g,b)=>{if(typeof c=="function")b=c.call(i,g,b);else if(Array.isArray(c)&&!c.includes(g))return;(b!==void 0||l)&&d.items.push(Mp(g,b,r))};if(i instanceof Map)for(const[g,b]of i)h(g,b);else if(i&&typeof i=="object")for(const g of Object.keys(i))h(g,i[g]);return typeof n.sortMapEntries=="function"&&d.items.sort(n.sortMapEntries),d}add(n,i){let r;St(n)?r=n:!n||typeof n!="object"||!("key"in n)?r=new Qt(n,n?.value):r=new Qt(n.key,n.value);const l=ki(this.items,r.key),c=this.schema?.sortMapEntries;if(l){if(!i)throw new Error(`Key ${r.key} already set`);at(l.value)&&OS(r.value)?l.value.value=r.value:l.value=r.value}else if(c){const d=this.items.findIndex(h=>c(r,h)<0);d===-1?this.items.push(r):this.items.splice(d,0,r)}else this.items.push(r)}delete(n){const i=ki(this.items,n);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(n,i){const l=ki(this.items,n)?.value;return(!i&&at(l)?l.value:l)??void 0}has(n){return!!ki(this.items,n)}set(n,i){this.add(new Qt(n,i),!0)}toJSON(n,i,r){const l=r?new r:i?.mapAsMap?new Map:{};i?.onCreate&&i.onCreate(l);for(const c of this.items)LS(i,l,c);return l}toString(n,i,r){if(!n)return JSON.stringify(this);for(const l of this.items)if(!St(l))throw new Error(`Map items must all be pairs; found ${JSON.stringify(l)} instead`);return!n.allNullValues&&this.hasAllNullValues(!1)&&(n=Object.assign({},n,{allNullValues:!0})),qS(this,n,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:n.indent||"",onChompKeep:r,onComment:i})}}const er={collection:"map",default:!0,nodeClass:Nn,tag:"tag:yaml.org,2002:map",resolve(e,n){return yo(e)||n("Expected a mapping for this tag"),e},createNode:(e,n,i)=>Nn.from(e,n,i)};class Ci extends DS{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(n){super(Fs,n),this.items=[]}add(n){this.items.push(n)}delete(n){const i=Kl(n);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(n,i){const r=Kl(n);if(typeof r!="number")return;const l=this.items[r];return!i&&at(l)?l.value:l}has(n){const i=Kl(n);return typeof i=="number"&&i<this.items.length}set(n,i){const r=Kl(n);if(typeof r!="number")throw new Error(`Expected a valid index, not ${n}.`);const l=this.items[r];at(l)&&OS(i)?l.value=i:this.items[r]=i}toJSON(n,i){const r=[];i?.onCreate&&i.onCreate(r);let l=0;for(const c of this.items)r.push(kn(c,String(l++),i));return r}toString(n,i,r){return n?qS(this,n,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(n.indent||"")+" ",onChompKeep:r,onComment:i}):JSON.stringify(this)}static from(n,i,r){const{replacer:l}=r,c=new this(n);if(i&&Symbol.iterator in Object(i)){let d=0;for(let h of i){if(typeof l=="function"){const g=i instanceof Set?h:String(d++);h=l.call(i,g,h)}c.items.push(po(h,void 0,r))}}return c}}function Kl(e){let n=at(e)?e.value:e;return n&&typeof n=="string"&&(n=Number(n)),typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}const tr={collection:"seq",default:!0,nodeClass:Ci,tag:"tag:yaml.org,2002:seq",resolve(e,n){return bo(e)||n("Expected a sequence for this tag"),e},createNode:(e,n,i)=>Ci.from(e,n,i)},Ec={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,n,i,r){return n=Object.assign({actualString:!0},n),Rp(e,n,i,r)}},Oc={identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ae(null),stringify:({source:e},n)=>typeof e=="string"&&Oc.test.test(e)?e:n.options.nullStr},Bp={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Ae(e[0]==="t"||e[0]==="T"),stringify({source:e,value:n},i){if(e&&Bp.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(n===r)return e}return n?i.options.trueStr:i.options.falseStr}};function Un({format:e,minFractionDigits:n,tag:i,value:r}){if(typeof r=="bigint")return String(r);const l=typeof r=="number"?r:Number(r);if(!isFinite(l))return isNaN(l)?".nan":l<0?"-.inf":".inf";let c=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&n&&(!i||i==="tag:yaml.org,2002:float")&&/^\d/.test(c)){let d=c.indexOf(".");d<0&&(d=c.length,c+=".");let h=n-(c.length-d-1);for(;h-- >0;)c+="0"}return c}const US={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Un},$S={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():Un(e)}},IS={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const n=new Ae(parseFloat(e)),i=e.indexOf(".");return i!==-1&&e[e.length-1]==="0"&&(n.minFractionDigits=e.length-i-1),n},stringify:Un},Dc=e=>typeof e=="bigint"||Number.isInteger(e),Lp=(e,n,i,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(n),i);function VS(e,n,i){const{value:r}=e;return Dc(r)&&r>=0?i+r.toString(n):Un(e)}const PS={identify:e=>Dc(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,n,i)=>Lp(e,2,8,i),stringify:e=>VS(e,8,"0o")},GS={identify:Dc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,n,i)=>Lp(e,0,10,i),stringify:Un},HS={identify:e=>Dc(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,n,i)=>Lp(e,2,16,i),stringify:e=>VS(e,16,"0x")},kM=[er,tr,Ec,Oc,Bp,PS,GS,HS,US,$S,IS];function Wb(e){return typeof e=="bigint"||Number.isInteger(e)}const Zl=({value:e})=>JSON.stringify(e),AM=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Zl},{identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Zl},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Zl},{identify:Wb,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e,10),stringify:({value:e})=>Wb(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Zl}],_M={default:!0,tag:"",test:/^/,resolve(e,n){return n(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},CM=[er,tr].concat(AM,_M),qp={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,n){if(typeof atob=="function"){const i=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(i.length);for(let l=0;l<i.length;++l)r[l]=i.charCodeAt(l);return r}else return n("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:n,value:i},r,l,c){if(!i)return"";const d=i;let h;if(typeof btoa=="function"){let g="";for(let b=0;b<d.length;++b)g+=String.fromCharCode(d[b]);h=btoa(g)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(n??(n=Ae.BLOCK_LITERAL),n!==Ae.QUOTE_DOUBLE){const g=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),b=Math.ceil(h.length/g),S=new Array(b);for(let x=0,N=0;x<b;++x,N+=g)S[x]=h.substr(N,g);h=S.join(n===Ae.BLOCK_LITERAL?`
115
- `:" ")}return Rp({comment:e,type:n,value:h},r,l,c)}};function QS(e,n){if(bo(e))for(let i=0;i<e.items.length;++i){let r=e.items[i];if(!St(r)){if(yo(r)){r.items.length>1&&n("Each pair must have its own sequence indicator");const l=r.items[0]||new Qt(new Ae(null));if(r.commentBefore&&(l.key.commentBefore=l.key.commentBefore?`${r.commentBefore}
114
+ ${l}${_}`}else return`${N}${d}${x.join(" ")}${d}${_}`}function mc({indent:e,options:{commentString:n}},i,r,l){if(r&&l&&(r=r.replace(/^\n+/,"")),r){const c=ha(n(r),e);i.push(c.trimStart())}}function ki(e,n){const i=at(n)?n.value:n;for(const r of e)if(St(r)&&(r.key===n||r.key===i||at(r.key)&&r.key.value===i))return r}class Nn extends DS{static get tagName(){return"tag:yaml.org,2002:map"}constructor(n){super(Za,n),this.items=[]}static from(n,i,r){const{keepUndefined:l,replacer:c}=r,d=new this(n),h=(g,v)=>{if(typeof c=="function")v=c.call(i,g,v);else if(Array.isArray(c)&&!c.includes(g))return;(v!==void 0||l)&&d.items.push(Bp(g,v,r))};if(i instanceof Map)for(const[g,v]of i)h(g,v);else if(i&&typeof i=="object")for(const g of Object.keys(i))h(g,i[g]);return typeof n.sortMapEntries=="function"&&d.items.sort(n.sortMapEntries),d}add(n,i){let r;St(n)?r=n:!n||typeof n!="object"||!("key"in n)?r=new Qt(n,n?.value):r=new Qt(n.key,n.value);const l=ki(this.items,r.key),c=this.schema?.sortMapEntries;if(l){if(!i)throw new Error(`Key ${r.key} already set`);at(l.value)&&OS(r.value)?l.value.value=r.value:l.value=r.value}else if(c){const d=this.items.findIndex(h=>c(r,h)<0);d===-1?this.items.push(r):this.items.splice(d,0,r)}else this.items.push(r)}delete(n){const i=ki(this.items,n);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(n,i){const l=ki(this.items,n)?.value;return(!i&&at(l)?l.value:l)??void 0}has(n){return!!ki(this.items,n)}set(n,i){this.add(new Qt(n,i),!0)}toJSON(n,i,r){const l=r?new r:i?.mapAsMap?new Map:{};i?.onCreate&&i.onCreate(l);for(const c of this.items)LS(i,l,c);return l}toString(n,i,r){if(!n)return JSON.stringify(this);for(const l of this.items)if(!St(l))throw new Error(`Map items must all be pairs; found ${JSON.stringify(l)} instead`);return!n.allNullValues&&this.hasAllNullValues(!1)&&(n=Object.assign({},n,{allNullValues:!0})),qS(this,n,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:n.indent||"",onChompKeep:r,onComment:i})}}const er={collection:"map",default:!0,nodeClass:Nn,tag:"tag:yaml.org,2002:map",resolve(e,n){return yo(e)||n("Expected a mapping for this tag"),e},createNode:(e,n,i)=>Nn.from(e,n,i)};class Ci extends DS{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(n){super(Fs,n),this.items=[]}add(n){this.items.push(n)}delete(n){const i=Kl(n);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(n,i){const r=Kl(n);if(typeof r!="number")return;const l=this.items[r];return!i&&at(l)?l.value:l}has(n){const i=Kl(n);return typeof i=="number"&&i<this.items.length}set(n,i){const r=Kl(n);if(typeof r!="number")throw new Error(`Expected a valid index, not ${n}.`);const l=this.items[r];at(l)&&OS(i)?l.value=i:this.items[r]=i}toJSON(n,i){const r=[];i?.onCreate&&i.onCreate(r);let l=0;for(const c of this.items)r.push(kn(c,String(l++),i));return r}toString(n,i,r){return n?qS(this,n,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(n.indent||"")+" ",onChompKeep:r,onComment:i}):JSON.stringify(this)}static from(n,i,r){const{replacer:l}=r,c=new this(n);if(i&&Symbol.iterator in Object(i)){let d=0;for(let h of i){if(typeof l=="function"){const g=i instanceof Set?h:String(d++);h=l.call(i,g,h)}c.items.push(po(h,void 0,r))}}return c}}function Kl(e){let n=at(e)?e.value:e;return n&&typeof n=="string"&&(n=Number(n)),typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}const tr={collection:"seq",default:!0,nodeClass:Ci,tag:"tag:yaml.org,2002:seq",resolve(e,n){return bo(e)||n("Expected a sequence for this tag"),e},createNode:(e,n,i)=>Ci.from(e,n,i)},Ec={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,n,i,r){return n=Object.assign({actualString:!0},n),Mp(e,n,i,r)}},Oc={identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ae(null),stringify:({source:e},n)=>typeof e=="string"&&Oc.test.test(e)?e:n.options.nullStr},Lp={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Ae(e[0]==="t"||e[0]==="T"),stringify({source:e,value:n},i){if(e&&Lp.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(n===r)return e}return n?i.options.trueStr:i.options.falseStr}};function Un({format:e,minFractionDigits:n,tag:i,value:r}){if(typeof r=="bigint")return String(r);const l=typeof r=="number"?r:Number(r);if(!isFinite(l))return isNaN(l)?".nan":l<0?"-.inf":".inf";let c=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&n&&(!i||i==="tag:yaml.org,2002:float")&&/^\d/.test(c)){let d=c.indexOf(".");d<0&&(d=c.length,c+=".");let h=n-(c.length-d-1);for(;h-- >0;)c+="0"}return c}const US={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Un},$S={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():Un(e)}},IS={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const n=new Ae(parseFloat(e)),i=e.indexOf(".");return i!==-1&&e[e.length-1]==="0"&&(n.minFractionDigits=e.length-i-1),n},stringify:Un},Dc=e=>typeof e=="bigint"||Number.isInteger(e),qp=(e,n,i,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(n),i);function VS(e,n,i){const{value:r}=e;return Dc(r)&&r>=0?i+r.toString(n):Un(e)}const PS={identify:e=>Dc(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,n,i)=>qp(e,2,8,i),stringify:e=>VS(e,8,"0o")},GS={identify:Dc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,n,i)=>qp(e,0,10,i),stringify:Un},HS={identify:e=>Dc(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,n,i)=>qp(e,2,16,i),stringify:e=>VS(e,16,"0x")},EM=[er,tr,Ec,Oc,Lp,PS,GS,HS,US,$S,IS];function ev(e){return typeof e=="bigint"||Number.isInteger(e)}const Zl=({value:e})=>JSON.stringify(e),OM=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Zl},{identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Zl},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Zl},{identify:ev,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e,10),stringify:({value:e})=>ev(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Zl}],DM={default:!0,tag:"",test:/^/,resolve(e,n){return n(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},RM=[er,tr].concat(OM,DM),Up={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,n){if(typeof atob=="function"){const i=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(i.length);for(let l=0;l<i.length;++l)r[l]=i.charCodeAt(l);return r}else return n("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:n,value:i},r,l,c){if(!i)return"";const d=i;let h;if(typeof btoa=="function"){let g="";for(let v=0;v<d.length;++v)g+=String.fromCharCode(d[v]);h=btoa(g)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(n??(n=Ae.BLOCK_LITERAL),n!==Ae.QUOTE_DOUBLE){const g=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),v=Math.ceil(h.length/g),S=new Array(v);for(let x=0,N=0;x<v;++x,N+=g)S[x]=h.substr(N,g);h=S.join(n===Ae.BLOCK_LITERAL?`
115
+ `:" ")}return Mp({comment:e,type:n,value:h},r,l,c)}};function QS(e,n){if(bo(e))for(let i=0;i<e.items.length;++i){let r=e.items[i];if(!St(r)){if(yo(r)){r.items.length>1&&n("Each pair must have its own sequence indicator");const l=r.items[0]||new Qt(new Ae(null));if(r.commentBefore&&(l.key.commentBefore=l.key.commentBefore?`${r.commentBefore}
116
116
  ${l.key.commentBefore}`:r.commentBefore),r.comment){const c=l.value??l.key;c.comment=c.comment?`${r.comment}
117
- ${c.comment}`:r.comment}r=l}e.items[i]=St(r)?r:new Qt(r)}}else n("Expected a sequence for this tag");return e}function KS(e,n,i){const{replacer:r}=i,l=new Ci(e);l.tag="tag:yaml.org,2002:pairs";let c=0;if(n&&Symbol.iterator in Object(n))for(let d of n){typeof r=="function"&&(d=r.call(n,String(c++),d));let h,g;if(Array.isArray(d))if(d.length===2)h=d[0],g=d[1];else throw new TypeError(`Expected [key, value] tuple: ${d}`);else if(d&&d instanceof Object){const b=Object.keys(d);if(b.length===1)h=b[0],g=d[h];else throw new TypeError(`Expected tuple with one key, not ${b.length} keys`)}else h=d;l.items.push(Mp(h,g,i))}return l}const Up={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:QS,createNode:KS};class Ls extends Ci{constructor(){super(),this.add=Nn.prototype.add.bind(this),this.delete=Nn.prototype.delete.bind(this),this.get=Nn.prototype.get.bind(this),this.has=Nn.prototype.has.bind(this),this.set=Nn.prototype.set.bind(this),this.tag=Ls.tag}toJSON(n,i){if(!i)return super.toJSON(n);const r=new Map;i?.onCreate&&i.onCreate(r);for(const l of this.items){let c,d;if(St(l)?(c=kn(l.key,"",i),d=kn(l.value,c,i)):c=kn(l,"",i),r.has(c))throw new Error("Ordered maps must not include duplicate keys");r.set(c,d)}return r}static from(n,i,r){const l=KS(n,i,r),c=new this;return c.items=l.items,c}}Ls.tag="tag:yaml.org,2002:omap";const $p={collection:"seq",identify:e=>e instanceof Map,nodeClass:Ls,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,n){const i=QS(e,n),r=[];for(const{key:l}of i.items)at(l)&&(r.includes(l.value)?n(`Ordered maps must not include duplicate keys: ${l.value}`):r.push(l.value));return Object.assign(new Ls,i)},createNode:(e,n,i)=>Ls.from(e,n,i)};function ZS({value:e,source:n},i){return n&&(e?YS:XS).test.test(n)?n:e?i.options.trueStr:i.options.falseStr}const YS={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ae(!0),stringify:ZS},XS={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ae(!1),stringify:ZS},zM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Un},TM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():Un(e)}},EM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const n=new Ae(parseFloat(e.replace(/_/g,""))),i=e.indexOf(".");if(i!==-1){const r=e.substring(i+1).replace(/_/g,"");r[r.length-1]==="0"&&(n.minFractionDigits=r.length)}return n},stringify:Un},vo=e=>typeof e=="bigint"||Number.isInteger(e);function Rc(e,n,i,{intAsBigInt:r}){const l=e[0];if((l==="-"||l==="+")&&(n+=1),e=e.substring(n).replace(/_/g,""),r){switch(i){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const d=BigInt(e);return l==="-"?BigInt(-1)*d:d}const c=parseInt(e,i);return l==="-"?-1*c:c}function Ip(e,n,i){const{value:r}=e;if(vo(r)){const l=r.toString(n);return r<0?"-"+i+l.substr(1):i+l}return Un(e)}const OM={identify:vo,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,n,i)=>Rc(e,2,2,i),stringify:e=>Ip(e,2,"0b")},DM={identify:vo,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,n,i)=>Rc(e,1,8,i),stringify:e=>Ip(e,8,"0")},RM={identify:vo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,n,i)=>Rc(e,0,10,i),stringify:Un},MM={identify:vo,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,n,i)=>Rc(e,2,16,i),stringify:e=>Ip(e,16,"0x")};class qs extends Nn{constructor(n){super(n),this.tag=qs.tag}add(n){let i;St(n)?i=n:n&&typeof n=="object"&&"key"in n&&"value"in n&&n.value===null?i=new Qt(n.key,null):i=new Qt(n,null),ki(this.items,i.key)||this.items.push(i)}get(n,i){const r=ki(this.items,n);return!i&&St(r)?at(r.key)?r.key.value:r.key:r}set(n,i){if(typeof i!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof i}`);const r=ki(this.items,n);r&&!i?this.items.splice(this.items.indexOf(r),1):!r&&i&&this.items.push(new Qt(n))}toJSON(n,i){return super.toJSON(n,i,Set)}toString(n,i,r){if(!n)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},n,{allNullValues:!0}),i,r);throw new Error("Set items must all have null values")}static from(n,i,r){const{replacer:l}=r,c=new this(n);if(i&&Symbol.iterator in Object(i))for(let d of i)typeof l=="function"&&(d=l.call(i,d,d)),c.items.push(Mp(d,null,r));return c}}qs.tag="tag:yaml.org,2002:set";const Vp={collection:"map",identify:e=>e instanceof Set,nodeClass:qs,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,n,i)=>qs.from(e,n,i),resolve(e,n){if(yo(e)){if(e.hasAllNullValues(!0))return Object.assign(new qs,e);n("Set items must all have null values")}else n("Expected a mapping for this tag");return e}};function Pp(e,n){const i=e[0],r=i==="-"||i==="+"?e.substring(1):e,l=d=>n?BigInt(d):Number(d),c=r.replace(/_/g,"").split(":").reduce((d,h)=>d*l(60)+l(h),l(0));return i==="-"?l(-1)*c:c}function JS(e){let{value:n}=e,i=d=>d;if(typeof n=="bigint")i=d=>BigInt(d);else if(isNaN(n)||!isFinite(n))return Un(e);let r="";n<0&&(r="-",n*=i(-1));const l=i(60),c=[n%l];return n<60?c.unshift(0):(n=(n-c[0])/l,c.unshift(n%l),n>=60&&(n=(n-c[0])/l,c.unshift(n))),r+c.map(d=>String(d).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const FS={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,n,{intAsBigInt:i})=>Pp(e,i),stringify:JS},WS={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Pp(e,!1),stringify:JS},Mc={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const n=e.match(Mc.test);if(!n)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,i,r,l,c,d,h]=n.map(Number),g=n[7]?Number((n[7]+"00").substr(1,3)):0;let b=Date.UTC(i,r-1,l,c||0,d||0,h||0,g);const S=n[8];if(S&&S!=="Z"){let x=Pp(S,!1);Math.abs(x)<30&&(x*=60),b-=6e4*x}return new Date(b)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},ev=[er,tr,Ec,Oc,YS,XS,OM,DM,RM,MM,zM,TM,EM,qp,ga,$p,Up,Vp,FS,WS,Mc],tv=new Map([["core",kM],["failsafe",[er,tr,Ec]],["json",CM],["yaml11",ev],["yaml-1.1",ev]]),nv={binary:qp,bool:Bp,float:IS,floatExp:$S,floatNaN:US,floatTime:WS,int:GS,intHex:HS,intOct:PS,intTime:FS,map:er,merge:ga,null:Oc,omap:$p,pairs:Up,seq:tr,set:Vp,timestamp:Mc},BM={"tag:yaml.org,2002:binary":qp,"tag:yaml.org,2002:merge":ga,"tag:yaml.org,2002:omap":$p,"tag:yaml.org,2002:pairs":Up,"tag:yaml.org,2002:set":Vp,"tag:yaml.org,2002:timestamp":Mc};function pf(e,n,i){const r=tv.get(n);if(r&&!e)return i&&!r.includes(ga)?r.concat(ga):r.slice();let l=r;if(!l)if(Array.isArray(e))l=[];else{const c=Array.from(tv.keys()).filter(d=>d!=="yaml11").map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown schema "${n}"; use one of ${c} or define customTags array`)}if(Array.isArray(e))for(const c of e)l=l.concat(c);else typeof e=="function"&&(l=e(l.slice()));return i&&(l=l.concat(ga)),l.reduce((c,d)=>{const h=typeof d=="string"?nv[d]:d;if(!h){const g=JSON.stringify(d),b=Object.keys(nv).map(S=>JSON.stringify(S)).join(", ");throw new Error(`Unknown custom tag ${g}; use one of ${b}`)}return c.includes(h)||c.push(h),c},[])}const LM=(e,n)=>e.key<n.key?-1:e.key>n.key?1:0;class Gp{constructor({compat:n,customTags:i,merge:r,resolveKnownTags:l,schema:c,sortMapEntries:d,toStringDefaults:h}){this.compat=Array.isArray(n)?pf(n,"compat"):n?pf(null,n):null,this.name=typeof c=="string"&&c||"core",this.knownTags=l?BM:{},this.tags=pf(i,this.name,r),this.toStringOptions=h??null,Object.defineProperty(this,Za,{value:er}),Object.defineProperty(this,Qn,{value:Ec}),Object.defineProperty(this,Fs,{value:tr}),this.sortMapEntries=typeof d=="function"?d:d===!0?LM:null}clone(){const n=Object.create(Gp.prototype,Object.getOwnPropertyDescriptors(this));return n.tags=this.tags.slice(),n}}function qM(e,n){const i=[];let r=n.directives===!0;if(n.directives!==!1&&e.directives){const g=e.directives.toString(e);g?(i.push(g),r=!0):e.directives.docStart&&(r=!0)}r&&i.push("---");const l=MS(e,n),{commentString:c}=l.options;if(e.commentBefore){i.length!==1&&i.unshift("");const g=c(e.commentBefore);i.unshift(ha(g,""))}let d=!1,h=null;if(e.contents){if(vt(e.contents)){if(e.contents.spaceBefore&&r&&i.push(""),e.contents.commentBefore){const S=c(e.contents.commentBefore);i.push(ha(S,""))}l.forceBlockIndent=!!e.comment,h=e.contents.comment}const g=h?void 0:()=>d=!0;let b=Vs(e.contents,l,()=>h=null,g);h&&(b+=Ni(b,"",c(h))),(b[0]==="|"||b[0]===">")&&i[i.length-1]==="---"?i[i.length-1]=`--- ${b}`:i.push(b)}else i.push(Vs(e.contents,l));if(e.directives?.docEnd)if(e.comment){const g=c(e.comment);g.includes(`
117
+ ${c.comment}`:r.comment}r=l}e.items[i]=St(r)?r:new Qt(r)}}else n("Expected a sequence for this tag");return e}function KS(e,n,i){const{replacer:r}=i,l=new Ci(e);l.tag="tag:yaml.org,2002:pairs";let c=0;if(n&&Symbol.iterator in Object(n))for(let d of n){typeof r=="function"&&(d=r.call(n,String(c++),d));let h,g;if(Array.isArray(d))if(d.length===2)h=d[0],g=d[1];else throw new TypeError(`Expected [key, value] tuple: ${d}`);else if(d&&d instanceof Object){const v=Object.keys(d);if(v.length===1)h=v[0],g=d[h];else throw new TypeError(`Expected tuple with one key, not ${v.length} keys`)}else h=d;l.items.push(Bp(h,g,i))}return l}const $p={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:QS,createNode:KS};class Ls extends Ci{constructor(){super(),this.add=Nn.prototype.add.bind(this),this.delete=Nn.prototype.delete.bind(this),this.get=Nn.prototype.get.bind(this),this.has=Nn.prototype.has.bind(this),this.set=Nn.prototype.set.bind(this),this.tag=Ls.tag}toJSON(n,i){if(!i)return super.toJSON(n);const r=new Map;i?.onCreate&&i.onCreate(r);for(const l of this.items){let c,d;if(St(l)?(c=kn(l.key,"",i),d=kn(l.value,c,i)):c=kn(l,"",i),r.has(c))throw new Error("Ordered maps must not include duplicate keys");r.set(c,d)}return r}static from(n,i,r){const l=KS(n,i,r),c=new this;return c.items=l.items,c}}Ls.tag="tag:yaml.org,2002:omap";const Ip={collection:"seq",identify:e=>e instanceof Map,nodeClass:Ls,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,n){const i=QS(e,n),r=[];for(const{key:l}of i.items)at(l)&&(r.includes(l.value)?n(`Ordered maps must not include duplicate keys: ${l.value}`):r.push(l.value));return Object.assign(new Ls,i)},createNode:(e,n,i)=>Ls.from(e,n,i)};function ZS({value:e,source:n},i){return n&&(e?YS:XS).test.test(n)?n:e?i.options.trueStr:i.options.falseStr}const YS={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ae(!0),stringify:ZS},XS={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ae(!1),stringify:ZS},MM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Un},BM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():Un(e)}},LM={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const n=new Ae(parseFloat(e.replace(/_/g,""))),i=e.indexOf(".");if(i!==-1){const r=e.substring(i+1).replace(/_/g,"");r[r.length-1]==="0"&&(n.minFractionDigits=r.length)}return n},stringify:Un},vo=e=>typeof e=="bigint"||Number.isInteger(e);function Rc(e,n,i,{intAsBigInt:r}){const l=e[0];if((l==="-"||l==="+")&&(n+=1),e=e.substring(n).replace(/_/g,""),r){switch(i){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const d=BigInt(e);return l==="-"?BigInt(-1)*d:d}const c=parseInt(e,i);return l==="-"?-1*c:c}function Vp(e,n,i){const{value:r}=e;if(vo(r)){const l=r.toString(n);return r<0?"-"+i+l.substr(1):i+l}return Un(e)}const qM={identify:vo,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,n,i)=>Rc(e,2,2,i),stringify:e=>Vp(e,2,"0b")},UM={identify:vo,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,n,i)=>Rc(e,1,8,i),stringify:e=>Vp(e,8,"0")},$M={identify:vo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,n,i)=>Rc(e,0,10,i),stringify:Un},IM={identify:vo,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,n,i)=>Rc(e,2,16,i),stringify:e=>Vp(e,16,"0x")};class qs extends Nn{constructor(n){super(n),this.tag=qs.tag}add(n){let i;St(n)?i=n:n&&typeof n=="object"&&"key"in n&&"value"in n&&n.value===null?i=new Qt(n.key,null):i=new Qt(n,null),ki(this.items,i.key)||this.items.push(i)}get(n,i){const r=ki(this.items,n);return!i&&St(r)?at(r.key)?r.key.value:r.key:r}set(n,i){if(typeof i!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof i}`);const r=ki(this.items,n);r&&!i?this.items.splice(this.items.indexOf(r),1):!r&&i&&this.items.push(new Qt(n))}toJSON(n,i){return super.toJSON(n,i,Set)}toString(n,i,r){if(!n)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},n,{allNullValues:!0}),i,r);throw new Error("Set items must all have null values")}static from(n,i,r){const{replacer:l}=r,c=new this(n);if(i&&Symbol.iterator in Object(i))for(let d of i)typeof l=="function"&&(d=l.call(i,d,d)),c.items.push(Bp(d,null,r));return c}}qs.tag="tag:yaml.org,2002:set";const Pp={collection:"map",identify:e=>e instanceof Set,nodeClass:qs,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,n,i)=>qs.from(e,n,i),resolve(e,n){if(yo(e)){if(e.hasAllNullValues(!0))return Object.assign(new qs,e);n("Set items must all have null values")}else n("Expected a mapping for this tag");return e}};function Gp(e,n){const i=e[0],r=i==="-"||i==="+"?e.substring(1):e,l=d=>n?BigInt(d):Number(d),c=r.replace(/_/g,"").split(":").reduce((d,h)=>d*l(60)+l(h),l(0));return i==="-"?l(-1)*c:c}function JS(e){let{value:n}=e,i=d=>d;if(typeof n=="bigint")i=d=>BigInt(d);else if(isNaN(n)||!isFinite(n))return Un(e);let r="";n<0&&(r="-",n*=i(-1));const l=i(60),c=[n%l];return n<60?c.unshift(0):(n=(n-c[0])/l,c.unshift(n%l),n>=60&&(n=(n-c[0])/l,c.unshift(n))),r+c.map(d=>String(d).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const FS={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,n,{intAsBigInt:i})=>Gp(e,i),stringify:JS},WS={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Gp(e,!1),stringify:JS},Mc={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const n=e.match(Mc.test);if(!n)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,i,r,l,c,d,h]=n.map(Number),g=n[7]?Number((n[7]+"00").substr(1,3)):0;let v=Date.UTC(i,r-1,l,c||0,d||0,h||0,g);const S=n[8];if(S&&S!=="Z"){let x=Gp(S,!1);Math.abs(x)<30&&(x*=60),v-=6e4*x}return new Date(v)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},tv=[er,tr,Ec,Oc,YS,XS,qM,UM,$M,IM,MM,BM,LM,Up,ga,Ip,$p,Pp,FS,WS,Mc],nv=new Map([["core",EM],["failsafe",[er,tr,Ec]],["json",RM],["yaml11",tv],["yaml-1.1",tv]]),av={binary:Up,bool:Lp,float:IS,floatExp:$S,floatNaN:US,floatTime:WS,int:GS,intHex:HS,intOct:PS,intTime:FS,map:er,merge:ga,null:Oc,omap:Ip,pairs:$p,seq:tr,set:Pp,timestamp:Mc},VM={"tag:yaml.org,2002:binary":Up,"tag:yaml.org,2002:merge":ga,"tag:yaml.org,2002:omap":Ip,"tag:yaml.org,2002:pairs":$p,"tag:yaml.org,2002:set":Pp,"tag:yaml.org,2002:timestamp":Mc};function pf(e,n,i){const r=nv.get(n);if(r&&!e)return i&&!r.includes(ga)?r.concat(ga):r.slice();let l=r;if(!l)if(Array.isArray(e))l=[];else{const c=Array.from(nv.keys()).filter(d=>d!=="yaml11").map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown schema "${n}"; use one of ${c} or define customTags array`)}if(Array.isArray(e))for(const c of e)l=l.concat(c);else typeof e=="function"&&(l=e(l.slice()));return i&&(l=l.concat(ga)),l.reduce((c,d)=>{const h=typeof d=="string"?av[d]:d;if(!h){const g=JSON.stringify(d),v=Object.keys(av).map(S=>JSON.stringify(S)).join(", ");throw new Error(`Unknown custom tag ${g}; use one of ${v}`)}return c.includes(h)||c.push(h),c},[])}const PM=(e,n)=>e.key<n.key?-1:e.key>n.key?1:0;class Hp{constructor({compat:n,customTags:i,merge:r,resolveKnownTags:l,schema:c,sortMapEntries:d,toStringDefaults:h}){this.compat=Array.isArray(n)?pf(n,"compat"):n?pf(null,n):null,this.name=typeof c=="string"&&c||"core",this.knownTags=l?VM:{},this.tags=pf(i,this.name,r),this.toStringOptions=h??null,Object.defineProperty(this,Za,{value:er}),Object.defineProperty(this,Qn,{value:Ec}),Object.defineProperty(this,Fs,{value:tr}),this.sortMapEntries=typeof d=="function"?d:d===!0?PM:null}clone(){const n=Object.create(Hp.prototype,Object.getOwnPropertyDescriptors(this));return n.tags=this.tags.slice(),n}}function GM(e,n){const i=[];let r=n.directives===!0;if(n.directives!==!1&&e.directives){const g=e.directives.toString(e);g?(i.push(g),r=!0):e.directives.docStart&&(r=!0)}r&&i.push("---");const l=MS(e,n),{commentString:c}=l.options;if(e.commentBefore){i.length!==1&&i.unshift("");const g=c(e.commentBefore);i.unshift(ha(g,""))}let d=!1,h=null;if(e.contents){if(vt(e.contents)){if(e.contents.spaceBefore&&r&&i.push(""),e.contents.commentBefore){const S=c(e.contents.commentBefore);i.push(ha(S,""))}l.forceBlockIndent=!!e.comment,h=e.contents.comment}const g=h?void 0:()=>d=!0;let v=Vs(e.contents,l,()=>h=null,g);h&&(v+=Ni(v,"",c(h))),(v[0]==="|"||v[0]===">")&&i[i.length-1]==="---"?i[i.length-1]=`--- ${v}`:i.push(v)}else i.push(Vs(e.contents,l));if(e.directives?.docEnd)if(e.comment){const g=c(e.comment);g.includes(`
118
118
  `)?(i.push("..."),i.push(ha(g,""))):i.push(`... ${g}`)}else i.push("...");else{let g=e.comment;g&&d&&(g=g.replace(/^\n+/,"")),g&&((!d||h)&&i[i.length-1]!==""&&i.push(""),i.push(ha(c(g),"")))}return i.join(`
119
119
  `)+`
120
- `}class Bc{constructor(n,i,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,An,{value:Bf});let l=null;typeof i=="function"||Array.isArray(i)?l=i:r===void 0&&i&&(r=i,i=void 0);const c=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=c;let{version:d}=c;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(d=this.directives.yaml.version)):this.directives=new Gt({version:d}),this.setSchema(d,r),this.contents=n===void 0?null:this.createNode(n,l,r)}clone(){const n=Object.create(Bc.prototype,{[An]:{value:Bf}});return n.commentBefore=this.commentBefore,n.comment=this.comment,n.errors=this.errors.slice(),n.warnings=this.warnings.slice(),n.options=Object.assign({},this.options),this.directives&&(n.directives=this.directives.clone()),n.schema=this.schema.clone(),n.contents=vt(this.contents)?this.contents.clone(n.schema):this.contents,this.range&&(n.range=this.range.slice()),n}add(n){Cs(this.contents)&&this.contents.add(n)}addIn(n,i){Cs(this.contents)&&this.contents.addIn(n,i)}createAlias(n,i){if(!n.anchor){const r=TS(this);n.anchor=!i||r.has(i)?ES(i||"a",r):i}return new Dp(n.anchor)}createNode(n,i,r){let l;if(typeof i=="function")n=i.call({"":n},"",n),l=i;else if(Array.isArray(i)){const E=V=>typeof V=="number"||V instanceof String||V instanceof Number,R=i.filter(E).map(String);R.length>0&&(i=i.concat(R)),l=i}else r===void 0&&i&&(r=i,i=void 0);const{aliasDuplicateObjects:c,anchorPrefix:d,flow:h,keepUndefined:g,onTagObj:b,tag:S}=r??{},{onAnchor:x,setAnchors:N,sourceObjects:_}=dM(this,d||"a"),T={aliasDuplicateObjects:c??!0,keepUndefined:g??!1,onAnchor:x,onTagObj:b,replacer:l,schema:this.schema,sourceObjects:_},k=po(n,S,T);return h&&bt(k)&&(k.flow=!0),N(),k}createPair(n,i,r={}){const l=this.createNode(n,null,r),c=this.createNode(i,null,r);return new Qt(l,c)}delete(n){return Cs(this.contents)?this.contents.delete(n):!1}deleteIn(n){return so(n)?this.contents==null?!1:(this.contents=null,!0):Cs(this.contents)?this.contents.deleteIn(n):!1}get(n,i){return bt(this.contents)?this.contents.get(n,i):void 0}getIn(n,i){return so(n)?!i&&at(this.contents)?this.contents.value:this.contents:bt(this.contents)?this.contents.getIn(n,i):void 0}has(n){return bt(this.contents)?this.contents.has(n):!1}hasIn(n){return so(n)?this.contents!==void 0:bt(this.contents)?this.contents.hasIn(n):!1}set(n,i){this.contents==null?this.contents=pc(this.schema,[n],i):Cs(this.contents)&&this.contents.set(n,i)}setIn(n,i){so(n)?this.contents=i:this.contents==null?this.contents=pc(this.schema,Array.from(n),i):Cs(this.contents)&&this.contents.setIn(n,i)}setSchema(n,i={}){typeof n=="number"&&(n=String(n));let r;switch(n){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Gt({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=n:this.directives=new Gt({version:n}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const l=JSON.stringify(n);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${l}`)}}if(i.schema instanceof Object)this.schema=i.schema;else if(r)this.schema=new Gp(Object.assign(r,i));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:n,jsonArg:i,mapAsMap:r,maxAliasCount:l,onAnchor:c,reviver:d}={}){const h={anchors:new Map,doc:this,keep:!n,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof l=="number"?l:100},g=kn(this.contents,i??"",h);if(typeof c=="function")for(const{count:b,res:S}of h.anchors.values())c(S,b);return typeof d=="function"?Ds(d,{"":g},"",g):g}toJSON(n,i){return this.toJS({json:!0,jsonArg:n,mapAsMap:!1,onAnchor:i})}toString(n={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in n&&(!Number.isInteger(n.indent)||Number(n.indent)<=0)){const i=JSON.stringify(n.indent);throw new Error(`"indent" option must be a positive integer, not ${i}`)}return qM(this,n)}}function Cs(e){if(bt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class e1 extends Error{constructor(n,i,r,l){super(),this.name=n,this.code=r,this.message=l,this.pos=i}}class Yl extends e1{constructor(n,i,r){super("YAMLParseError",n,i,r)}}class UM extends e1{constructor(n,i,r){super("YAMLWarning",n,i,r)}}const av=(e,n)=>i=>{if(i.pos[0]===-1)return;i.linePos=i.pos.map(h=>n.linePos(h));const{line:r,col:l}=i.linePos[0];i.message+=` at line ${r}, column ${l}`;let c=l-1,d=e.substring(n.lineStarts[r-1],n.lineStarts[r]).replace(/[\n\r]+$/,"");if(c>=60&&d.length>80){const h=Math.min(c-39,d.length-79);d="…"+d.substring(h),c-=h-1}if(d.length>80&&(d=d.substring(0,79)+"…"),r>1&&/^ *$/.test(d.substring(0,c))){let h=e.substring(n.lineStarts[r-2],n.lineStarts[r-1]);h.length>80&&(h=h.substring(0,79)+`…
121
- `),d=h+d}if(/[^ ]/.test(d)){let h=1;const g=i.linePos[1];g?.line===r&&g.col>l&&(h=Math.max(1,Math.min(g.col-l,80-c)));const b=" ".repeat(c)+"^".repeat(h);i.message+=`:
120
+ `}class Bc{constructor(n,i,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,An,{value:Bf});let l=null;typeof i=="function"||Array.isArray(i)?l=i:r===void 0&&i&&(r=i,i=void 0);const c=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=c;let{version:d}=c;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(d=this.directives.yaml.version)):this.directives=new Gt({version:d}),this.setSchema(d,r),this.contents=n===void 0?null:this.createNode(n,l,r)}clone(){const n=Object.create(Bc.prototype,{[An]:{value:Bf}});return n.commentBefore=this.commentBefore,n.comment=this.comment,n.errors=this.errors.slice(),n.warnings=this.warnings.slice(),n.options=Object.assign({},this.options),this.directives&&(n.directives=this.directives.clone()),n.schema=this.schema.clone(),n.contents=vt(this.contents)?this.contents.clone(n.schema):this.contents,this.range&&(n.range=this.range.slice()),n}add(n){Cs(this.contents)&&this.contents.add(n)}addIn(n,i){Cs(this.contents)&&this.contents.addIn(n,i)}createAlias(n,i){if(!n.anchor){const r=TS(this);n.anchor=!i||r.has(i)?ES(i||"a",r):i}return new Rp(n.anchor)}createNode(n,i,r){let l;if(typeof i=="function")n=i.call({"":n},"",n),l=i;else if(Array.isArray(i)){const E=V=>typeof V=="number"||V instanceof String||V instanceof Number,R=i.filter(E).map(String);R.length>0&&(i=i.concat(R)),l=i}else r===void 0&&i&&(r=i,i=void 0);const{aliasDuplicateObjects:c,anchorPrefix:d,flow:h,keepUndefined:g,onTagObj:v,tag:S}=r??{},{onAnchor:x,setAnchors:N,sourceObjects:_}=yM(this,d||"a"),T={aliasDuplicateObjects:c??!0,keepUndefined:g??!1,onAnchor:x,onTagObj:v,replacer:l,schema:this.schema,sourceObjects:_},k=po(n,S,T);return h&&bt(k)&&(k.flow=!0),N(),k}createPair(n,i,r={}){const l=this.createNode(n,null,r),c=this.createNode(i,null,r);return new Qt(l,c)}delete(n){return Cs(this.contents)?this.contents.delete(n):!1}deleteIn(n){return so(n)?this.contents==null?!1:(this.contents=null,!0):Cs(this.contents)?this.contents.deleteIn(n):!1}get(n,i){return bt(this.contents)?this.contents.get(n,i):void 0}getIn(n,i){return so(n)?!i&&at(this.contents)?this.contents.value:this.contents:bt(this.contents)?this.contents.getIn(n,i):void 0}has(n){return bt(this.contents)?this.contents.has(n):!1}hasIn(n){return so(n)?this.contents!==void 0:bt(this.contents)?this.contents.hasIn(n):!1}set(n,i){this.contents==null?this.contents=pc(this.schema,[n],i):Cs(this.contents)&&this.contents.set(n,i)}setIn(n,i){so(n)?this.contents=i:this.contents==null?this.contents=pc(this.schema,Array.from(n),i):Cs(this.contents)&&this.contents.setIn(n,i)}setSchema(n,i={}){typeof n=="number"&&(n=String(n));let r;switch(n){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Gt({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=n:this.directives=new Gt({version:n}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const l=JSON.stringify(n);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${l}`)}}if(i.schema instanceof Object)this.schema=i.schema;else if(r)this.schema=new Hp(Object.assign(r,i));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:n,jsonArg:i,mapAsMap:r,maxAliasCount:l,onAnchor:c,reviver:d}={}){const h={anchors:new Map,doc:this,keep:!n,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof l=="number"?l:100},g=kn(this.contents,i??"",h);if(typeof c=="function")for(const{count:v,res:S}of h.anchors.values())c(S,v);return typeof d=="function"?Ds(d,{"":g},"",g):g}toJSON(n,i){return this.toJS({json:!0,jsonArg:n,mapAsMap:!1,onAnchor:i})}toString(n={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in n&&(!Number.isInteger(n.indent)||Number(n.indent)<=0)){const i=JSON.stringify(n.indent);throw new Error(`"indent" option must be a positive integer, not ${i}`)}return GM(this,n)}}function Cs(e){if(bt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class e1 extends Error{constructor(n,i,r,l){super(),this.name=n,this.code=r,this.message=l,this.pos=i}}class Yl extends e1{constructor(n,i,r){super("YAMLParseError",n,i,r)}}class HM extends e1{constructor(n,i,r){super("YAMLWarning",n,i,r)}}const iv=(e,n)=>i=>{if(i.pos[0]===-1)return;i.linePos=i.pos.map(h=>n.linePos(h));const{line:r,col:l}=i.linePos[0];i.message+=` at line ${r}, column ${l}`;let c=l-1,d=e.substring(n.lineStarts[r-1],n.lineStarts[r]).replace(/[\n\r]+$/,"");if(c>=60&&d.length>80){const h=Math.min(c-39,d.length-79);d="…"+d.substring(h),c-=h-1}if(d.length>80&&(d=d.substring(0,79)+"…"),r>1&&/^ *$/.test(d.substring(0,c))){let h=e.substring(n.lineStarts[r-2],n.lineStarts[r-1]);h.length>80&&(h=h.substring(0,79)+`…
121
+ `),d=h+d}if(/[^ ]/.test(d)){let h=1;const g=i.linePos[1];g?.line===r&&g.col>l&&(h=Math.max(1,Math.min(g.col-l,80-c)));const v=" ".repeat(c)+"^".repeat(h);i.message+=`:
122
122
 
123
123
  ${d}
124
- ${b}
125
- `}};function Ps(e,{flow:n,indicator:i,next:r,offset:l,onError:c,parentIndent:d,startOnNewline:h}){let g=!1,b=h,S=h,x="",N="",_=!1,T=!1,k=null,E=null,R=null,V=null,G=null,Z=null,X=null;for(const M of e)switch(T&&(M.type!=="space"&&M.type!=="newline"&&M.type!=="comma"&&c(M.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),T=!1),k&&(b&&M.type!=="comment"&&M.type!=="newline"&&c(k,"TAB_AS_INDENT","Tabs are not allowed as indentation"),k=null),M.type){case"space":!n&&(i!=="doc-start"||r?.type!=="flow-collection")&&M.source.includes(" ")&&(k=M),S=!0;break;case"comment":{S||c(M,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const le=M.source.substring(1)||" ";x?x+=N+le:x=le,N="",b=!1;break}case"newline":b?x?x+=M.source:(!Z||i!=="seq-item-ind")&&(g=!0):N+=M.source,b=!0,_=!0,(E||R)&&(V=M),S=!0;break;case"anchor":E&&c(M,"MULTIPLE_ANCHORS","A node can have at most one anchor"),M.source.endsWith(":")&&c(M.offset+M.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),E=M,X??(X=M.offset),b=!1,S=!1,T=!0;break;case"tag":{R&&c(M,"MULTIPLE_TAGS","A node can have at most one tag"),R=M,X??(X=M.offset),b=!1,S=!1,T=!0;break}case i:(E||R)&&c(M,"BAD_PROP_ORDER",`Anchors and tags must be after the ${M.source} indicator`),Z&&c(M,"UNEXPECTED_TOKEN",`Unexpected ${M.source} in ${n??"collection"}`),Z=M,b=i==="seq-item-ind"||i==="explicit-key-ind",S=!1;break;case"comma":if(n){G&&c(M,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`),G=M,b=!1,S=!1;break}default:c(M,"UNEXPECTED_TOKEN",`Unexpected ${M.type} token`),b=!1,S=!1}const F=e[e.length-1],O=F?F.offset+F.source.length:l;return T&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&c(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),k&&(b&&k.indent<=d||r?.type==="block-map"||r?.type==="block-seq")&&c(k,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:G,found:Z,spaceBefore:g,comment:x,hasNewline:_,anchor:E,tag:R,newlineAfterProp:V,end:O,start:X??O}}function mo(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
126
- `))return!0;if(e.end){for(const n of e.end)if(n.type==="newline")return!0}return!1;case"flow-collection":for(const n of e.items){for(const i of n.start)if(i.type==="newline")return!0;if(n.sep){for(const i of n.sep)if(i.type==="newline")return!0}if(mo(n.key)||mo(n.value))return!0}return!1;default:return!0}}function $f(e,n,i){if(n?.type==="flow-collection"){const r=n.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&mo(n)&&i(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function t1(e,n,i){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const l=typeof r=="function"?r:(c,d)=>c===d||at(c)&&at(d)&&c.value===d.value;return n.some(c=>l(c.key,i))}const iv="All mapping items must start at the same column";function $M({composeNode:e,composeEmptyNode:n},i,r,l,c){const d=c?.nodeClass??Nn,h=new d(i.schema);i.atRoot&&(i.atRoot=!1);let g=r.offset,b=null;for(const S of r.items){const{start:x,key:N,sep:_,value:T}=S,k=Ps(x,{indicator:"explicit-key-ind",next:N??_?.[0],offset:g,onError:l,parentIndent:r.indent,startOnNewline:!0}),E=!k.found;if(E){if(N&&(N.type==="block-seq"?l(g,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in N&&N.indent!==r.indent&&l(g,"BAD_INDENT",iv)),!k.anchor&&!k.tag&&!_){b=k.end,k.comment&&(h.comment?h.comment+=`
127
- `+k.comment:h.comment=k.comment);continue}(k.newlineAfterProp||mo(N))&&l(N??x[x.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else k.found?.indent!==r.indent&&l(g,"BAD_INDENT",iv);i.atKey=!0;const R=k.end,V=N?e(i,N,k,l):n(i,R,x,null,k,l);i.schema.compat&&$f(r.indent,N,l),i.atKey=!1,t1(i,h.items,V)&&l(R,"DUPLICATE_KEY","Map keys must be unique");const G=Ps(_??[],{indicator:"map-value-ind",next:T,offset:V.range[2],onError:l,parentIndent:r.indent,startOnNewline:!N||N.type==="block-scalar"});if(g=G.end,G.found){E&&(T?.type==="block-map"&&!G.hasNewline&&l(g,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),i.options.strict&&k.start<G.found.offset-1024&&l(V.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const Z=T?e(i,T,G,l):n(i,g,_,null,G,l);i.schema.compat&&$f(r.indent,T,l),g=Z.range[2];const X=new Qt(V,Z);i.options.keepSourceTokens&&(X.srcToken=S),h.items.push(X)}else{E&&l(V.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),G.comment&&(V.comment?V.comment+=`
128
- `+G.comment:V.comment=G.comment);const Z=new Qt(V);i.options.keepSourceTokens&&(Z.srcToken=S),h.items.push(Z)}}return b&&b<g&&l(b,"IMPOSSIBLE","Map comment with trailing content"),h.range=[r.offset,g,b??g],h}function IM({composeNode:e,composeEmptyNode:n},i,r,l,c){const d=c?.nodeClass??Ci,h=new d(i.schema);i.atRoot&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let g=r.offset,b=null;for(const{start:S,value:x}of r.items){const N=Ps(S,{indicator:"seq-item-ind",next:x,offset:g,onError:l,parentIndent:r.indent,startOnNewline:!0});if(!N.found)if(N.anchor||N.tag||x)x?.type==="block-seq"?l(N.end,"BAD_INDENT","All sequence items must start at the same column"):l(g,"MISSING_CHAR","Sequence item without - indicator");else{b=N.end,N.comment&&(h.comment=N.comment);continue}const _=x?e(i,x,N,l):n(i,N.end,S,null,N,l);i.schema.compat&&$f(r.indent,x,l),g=_.range[2],h.items.push(_)}return h.range=[r.offset,g,b??g],h}function So(e,n,i,r){let l="";if(e){let c=!1,d="";for(const h of e){const{source:g,type:b}=h;switch(b){case"space":c=!0;break;case"comment":{i&&!c&&r(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const S=g.substring(1)||" ";l?l+=d+S:l=S,d="";break}case"newline":l&&(d+=g),c=!0;break;default:r(h,"UNEXPECTED_TOKEN",`Unexpected ${b} at node end`)}n+=g.length}}return{comment:l,offset:n}}const mf="Block collections are not allowed within flow collections",hf=e=>e&&(e.type==="block-map"||e.type==="block-seq");function VM({composeNode:e,composeEmptyNode:n},i,r,l,c){const d=r.start.source==="{",h=d?"flow map":"flow sequence",g=c?.nodeClass??(d?Nn:Ci),b=new g(i.schema);b.flow=!0;const S=i.atRoot;S&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let x=r.offset+r.start.source.length;for(let E=0;E<r.items.length;++E){const R=r.items[E],{start:V,key:G,sep:Z,value:X}=R,F=Ps(V,{flow:h,indicator:"explicit-key-ind",next:G??Z?.[0],offset:x,onError:l,parentIndent:r.indent,startOnNewline:!1});if(!F.found){if(!F.anchor&&!F.tag&&!Z&&!X){E===0&&F.comma?l(F.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${h}`):E<r.items.length-1&&l(F.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${h}`),F.comment&&(b.comment?b.comment+=`
129
- `+F.comment:b.comment=F.comment),x=F.end;continue}!d&&i.options.strict&&mo(G)&&l(G,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(E===0)F.comma&&l(F.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${h}`);else if(F.comma||l(F.start,"MISSING_CHAR",`Missing , between ${h} items`),F.comment){let O="";e:for(const M of V)switch(M.type){case"comma":case"space":break;case"comment":O=M.source.substring(1);break e;default:break e}if(O){let M=b.items[b.items.length-1];St(M)&&(M=M.value??M.key),M.comment?M.comment+=`
130
- `+O:M.comment=O,F.comment=F.comment.substring(O.length+1)}}if(!d&&!Z&&!F.found){const O=X?e(i,X,F,l):n(i,F.end,Z,null,F,l);b.items.push(O),x=O.range[2],hf(X)&&l(O.range,"BLOCK_IN_FLOW",mf)}else{i.atKey=!0;const O=F.end,M=G?e(i,G,F,l):n(i,O,V,null,F,l);hf(G)&&l(M.range,"BLOCK_IN_FLOW",mf),i.atKey=!1;const le=Ps(Z??[],{flow:h,indicator:"map-value-ind",next:X,offset:M.range[2],onError:l,parentIndent:r.indent,startOnNewline:!1});if(le.found){if(!d&&!F.found&&i.options.strict){if(Z)for(const be of Z){if(be===le.found)break;if(be.type==="newline"){l(be,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}F.start<le.found.offset-1024&&l(le.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else X&&("source"in X&&X.source?.[0]===":"?l(X,"MISSING_CHAR",`Missing space after : in ${h}`):l(le.start,"MISSING_CHAR",`Missing , or : between ${h} items`));const ke=X?e(i,X,le,l):le.found?n(i,le.end,Z,null,le,l):null;ke?hf(X)&&l(ke.range,"BLOCK_IN_FLOW",mf):le.comment&&(M.comment?M.comment+=`
131
- `+le.comment:M.comment=le.comment);const _e=new Qt(M,ke);if(i.options.keepSourceTokens&&(_e.srcToken=R),d){const be=b;t1(i,be.items,M)&&l(O,"DUPLICATE_KEY","Map keys must be unique"),be.items.push(_e)}else{const be=new Nn(i.schema);be.flow=!0,be.items.push(_e);const tt=(ke??M).range;be.range=[M.range[0],tt[1],tt[2]],b.items.push(be)}x=ke?ke.range[2]:le.end}}const N=d?"}":"]",[_,...T]=r.end;let k=x;if(_?.source===N)k=_.offset+_.source.length;else{const E=h[0].toUpperCase()+h.substring(1),R=S?`${E} must end with a ${N}`:`${E} in block collection must be sufficiently indented and end with a ${N}`;l(x,S?"MISSING_CHAR":"BAD_INDENT",R),_&&_.source.length!==1&&T.unshift(_)}if(T.length>0){const E=So(T,k,i.options.strict,l);E.comment&&(b.comment?b.comment+=`
132
- `+E.comment:b.comment=E.comment),b.range=[r.offset,k,E.offset]}else b.range=[r.offset,k,k];return b}function gf(e,n,i,r,l,c){const d=i.type==="block-map"?$M(e,n,i,r,c):i.type==="block-seq"?IM(e,n,i,r,c):VM(e,n,i,r,c),h=d.constructor;return l==="!"||l===h.tagName?(d.tag=h.tagName,d):(l&&(d.tag=l),d)}function PM(e,n,i,r,l){const c=r.tag,d=c?n.directives.tagName(c.source,N=>l(c,"TAG_RESOLVE_FAILED",N)):null;if(i.type==="block-seq"){const{anchor:N,newlineAfterProp:_}=r,T=N&&c?N.offset>c.offset?N:c:N??c;T&&(!_||_.offset<T.offset)&&l(T,"MISSING_CHAR","Missing newline after block sequence props")}const h=i.type==="block-map"?"map":i.type==="block-seq"?"seq":i.start.source==="{"?"map":"seq";if(!c||!d||d==="!"||d===Nn.tagName&&h==="map"||d===Ci.tagName&&h==="seq")return gf(e,n,i,l,d);let g=n.schema.tags.find(N=>N.tag===d&&N.collection===h);if(!g){const N=n.schema.knownTags[d];if(N?.collection===h)n.schema.tags.push(Object.assign({},N,{default:!1})),g=N;else return N?l(c,"BAD_COLLECTION_TYPE",`${N.tag} used for ${h} collection, but expects ${N.collection??"scalar"}`,!0):l(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${d}`,!0),gf(e,n,i,l,d)}const b=gf(e,n,i,l,d,g),S=g.resolve?.(b,N=>l(c,"TAG_RESOLVE_FAILED",N),n.options)??b,x=vt(S)?S:new Ae(S);return x.range=b.range,x.tag=d,g?.format&&(x.format=g.format),x}function GM(e,n,i){const r=n.offset,l=HM(n,e.options.strict,i);if(!l)return{value:"",type:null,comment:"",range:[r,r,r]};const c=l.mode===">"?Ae.BLOCK_FOLDED:Ae.BLOCK_LITERAL,d=n.source?QM(n.source):[];let h=d.length;for(let k=d.length-1;k>=0;--k){const E=d[k][1];if(E===""||E==="\r")h=k;else break}if(h===0){const k=l.chomp==="+"&&d.length>0?`
133
- `.repeat(Math.max(1,d.length-1)):"";let E=r+l.length;return n.source&&(E+=n.source.length),{value:k,type:c,comment:l.comment,range:[r,E,E]}}let g=n.indent+l.indent,b=n.offset+l.length,S=0;for(let k=0;k<h;++k){const[E,R]=d[k];if(R===""||R==="\r")l.indent===0&&E.length>g&&(g=E.length);else{E.length<g&&i(b+E.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),l.indent===0&&(g=E.length),S=k,g===0&&!e.atRoot&&i(b,"BAD_INDENT","Block scalar values in collections must be indented");break}b+=E.length+R.length+1}for(let k=d.length-1;k>=h;--k)d[k][0].length>g&&(h=k+1);let x="",N="",_=!1;for(let k=0;k<S;++k)x+=d[k][0].slice(g)+`
134
- `;for(let k=S;k<h;++k){let[E,R]=d[k];b+=E.length+R.length+1;const V=R[R.length-1]==="\r";if(V&&(R=R.slice(0,-1)),R&&E.length<g){const Z=`Block scalar lines must not be less indented than their ${l.indent?"explicit indentation indicator":"first line"}`;i(b-R.length-(V?2:1),"BAD_INDENT",Z),E=""}c===Ae.BLOCK_LITERAL?(x+=N+E.slice(g)+R,N=`
124
+ ${v}
125
+ `}};function Ps(e,{flow:n,indicator:i,next:r,offset:l,onError:c,parentIndent:d,startOnNewline:h}){let g=!1,v=h,S=h,x="",N="",_=!1,T=!1,k=null,E=null,R=null,V=null,G=null,Z=null,X=null;for(const M of e)switch(T&&(M.type!=="space"&&M.type!=="newline"&&M.type!=="comma"&&c(M.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),T=!1),k&&(v&&M.type!=="comment"&&M.type!=="newline"&&c(k,"TAB_AS_INDENT","Tabs are not allowed as indentation"),k=null),M.type){case"space":!n&&(i!=="doc-start"||r?.type!=="flow-collection")&&M.source.includes(" ")&&(k=M),S=!0;break;case"comment":{S||c(M,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const le=M.source.substring(1)||" ";x?x+=N+le:x=le,N="",v=!1;break}case"newline":v?x?x+=M.source:(!Z||i!=="seq-item-ind")&&(g=!0):N+=M.source,v=!0,_=!0,(E||R)&&(V=M),S=!0;break;case"anchor":E&&c(M,"MULTIPLE_ANCHORS","A node can have at most one anchor"),M.source.endsWith(":")&&c(M.offset+M.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),E=M,X??(X=M.offset),v=!1,S=!1,T=!0;break;case"tag":{R&&c(M,"MULTIPLE_TAGS","A node can have at most one tag"),R=M,X??(X=M.offset),v=!1,S=!1,T=!0;break}case i:(E||R)&&c(M,"BAD_PROP_ORDER",`Anchors and tags must be after the ${M.source} indicator`),Z&&c(M,"UNEXPECTED_TOKEN",`Unexpected ${M.source} in ${n??"collection"}`),Z=M,v=i==="seq-item-ind"||i==="explicit-key-ind",S=!1;break;case"comma":if(n){G&&c(M,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`),G=M,v=!1,S=!1;break}default:c(M,"UNEXPECTED_TOKEN",`Unexpected ${M.type} token`),v=!1,S=!1}const F=e[e.length-1],O=F?F.offset+F.source.length:l;return T&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&c(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),k&&(v&&k.indent<=d||r?.type==="block-map"||r?.type==="block-seq")&&c(k,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:G,found:Z,spaceBefore:g,comment:x,hasNewline:_,anchor:E,tag:R,newlineAfterProp:V,end:O,start:X??O}}function mo(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
126
+ `))return!0;if(e.end){for(const n of e.end)if(n.type==="newline")return!0}return!1;case"flow-collection":for(const n of e.items){for(const i of n.start)if(i.type==="newline")return!0;if(n.sep){for(const i of n.sep)if(i.type==="newline")return!0}if(mo(n.key)||mo(n.value))return!0}return!1;default:return!0}}function $f(e,n,i){if(n?.type==="flow-collection"){const r=n.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&mo(n)&&i(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function t1(e,n,i){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const l=typeof r=="function"?r:(c,d)=>c===d||at(c)&&at(d)&&c.value===d.value;return n.some(c=>l(c.key,i))}const sv="All mapping items must start at the same column";function QM({composeNode:e,composeEmptyNode:n},i,r,l,c){const d=c?.nodeClass??Nn,h=new d(i.schema);i.atRoot&&(i.atRoot=!1);let g=r.offset,v=null;for(const S of r.items){const{start:x,key:N,sep:_,value:T}=S,k=Ps(x,{indicator:"explicit-key-ind",next:N??_?.[0],offset:g,onError:l,parentIndent:r.indent,startOnNewline:!0}),E=!k.found;if(E){if(N&&(N.type==="block-seq"?l(g,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in N&&N.indent!==r.indent&&l(g,"BAD_INDENT",sv)),!k.anchor&&!k.tag&&!_){v=k.end,k.comment&&(h.comment?h.comment+=`
127
+ `+k.comment:h.comment=k.comment);continue}(k.newlineAfterProp||mo(N))&&l(N??x[x.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else k.found?.indent!==r.indent&&l(g,"BAD_INDENT",sv);i.atKey=!0;const R=k.end,V=N?e(i,N,k,l):n(i,R,x,null,k,l);i.schema.compat&&$f(r.indent,N,l),i.atKey=!1,t1(i,h.items,V)&&l(R,"DUPLICATE_KEY","Map keys must be unique");const G=Ps(_??[],{indicator:"map-value-ind",next:T,offset:V.range[2],onError:l,parentIndent:r.indent,startOnNewline:!N||N.type==="block-scalar"});if(g=G.end,G.found){E&&(T?.type==="block-map"&&!G.hasNewline&&l(g,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),i.options.strict&&k.start<G.found.offset-1024&&l(V.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const Z=T?e(i,T,G,l):n(i,g,_,null,G,l);i.schema.compat&&$f(r.indent,T,l),g=Z.range[2];const X=new Qt(V,Z);i.options.keepSourceTokens&&(X.srcToken=S),h.items.push(X)}else{E&&l(V.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),G.comment&&(V.comment?V.comment+=`
128
+ `+G.comment:V.comment=G.comment);const Z=new Qt(V);i.options.keepSourceTokens&&(Z.srcToken=S),h.items.push(Z)}}return v&&v<g&&l(v,"IMPOSSIBLE","Map comment with trailing content"),h.range=[r.offset,g,v??g],h}function KM({composeNode:e,composeEmptyNode:n},i,r,l,c){const d=c?.nodeClass??Ci,h=new d(i.schema);i.atRoot&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let g=r.offset,v=null;for(const{start:S,value:x}of r.items){const N=Ps(S,{indicator:"seq-item-ind",next:x,offset:g,onError:l,parentIndent:r.indent,startOnNewline:!0});if(!N.found)if(N.anchor||N.tag||x)x?.type==="block-seq"?l(N.end,"BAD_INDENT","All sequence items must start at the same column"):l(g,"MISSING_CHAR","Sequence item without - indicator");else{v=N.end,N.comment&&(h.comment=N.comment);continue}const _=x?e(i,x,N,l):n(i,N.end,S,null,N,l);i.schema.compat&&$f(r.indent,x,l),g=_.range[2],h.items.push(_)}return h.range=[r.offset,g,v??g],h}function So(e,n,i,r){let l="";if(e){let c=!1,d="";for(const h of e){const{source:g,type:v}=h;switch(v){case"space":c=!0;break;case"comment":{i&&!c&&r(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const S=g.substring(1)||" ";l?l+=d+S:l=S,d="";break}case"newline":l&&(d+=g),c=!0;break;default:r(h,"UNEXPECTED_TOKEN",`Unexpected ${v} at node end`)}n+=g.length}}return{comment:l,offset:n}}const mf="Block collections are not allowed within flow collections",hf=e=>e&&(e.type==="block-map"||e.type==="block-seq");function ZM({composeNode:e,composeEmptyNode:n},i,r,l,c){const d=r.start.source==="{",h=d?"flow map":"flow sequence",g=c?.nodeClass??(d?Nn:Ci),v=new g(i.schema);v.flow=!0;const S=i.atRoot;S&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let x=r.offset+r.start.source.length;for(let E=0;E<r.items.length;++E){const R=r.items[E],{start:V,key:G,sep:Z,value:X}=R,F=Ps(V,{flow:h,indicator:"explicit-key-ind",next:G??Z?.[0],offset:x,onError:l,parentIndent:r.indent,startOnNewline:!1});if(!F.found){if(!F.anchor&&!F.tag&&!Z&&!X){E===0&&F.comma?l(F.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${h}`):E<r.items.length-1&&l(F.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${h}`),F.comment&&(v.comment?v.comment+=`
129
+ `+F.comment:v.comment=F.comment),x=F.end;continue}!d&&i.options.strict&&mo(G)&&l(G,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(E===0)F.comma&&l(F.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${h}`);else if(F.comma||l(F.start,"MISSING_CHAR",`Missing , between ${h} items`),F.comment){let O="";e:for(const M of V)switch(M.type){case"comma":case"space":break;case"comment":O=M.source.substring(1);break e;default:break e}if(O){let M=v.items[v.items.length-1];St(M)&&(M=M.value??M.key),M.comment?M.comment+=`
130
+ `+O:M.comment=O,F.comment=F.comment.substring(O.length+1)}}if(!d&&!Z&&!F.found){const O=X?e(i,X,F,l):n(i,F.end,Z,null,F,l);v.items.push(O),x=O.range[2],hf(X)&&l(O.range,"BLOCK_IN_FLOW",mf)}else{i.atKey=!0;const O=F.end,M=G?e(i,G,F,l):n(i,O,V,null,F,l);hf(G)&&l(M.range,"BLOCK_IN_FLOW",mf),i.atKey=!1;const le=Ps(Z??[],{flow:h,indicator:"map-value-ind",next:X,offset:M.range[2],onError:l,parentIndent:r.indent,startOnNewline:!1});if(le.found){if(!d&&!F.found&&i.options.strict){if(Z)for(const be of Z){if(be===le.found)break;if(be.type==="newline"){l(be,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}F.start<le.found.offset-1024&&l(le.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else X&&("source"in X&&X.source?.[0]===":"?l(X,"MISSING_CHAR",`Missing space after : in ${h}`):l(le.start,"MISSING_CHAR",`Missing , or : between ${h} items`));const ke=X?e(i,X,le,l):le.found?n(i,le.end,Z,null,le,l):null;ke?hf(X)&&l(ke.range,"BLOCK_IN_FLOW",mf):le.comment&&(M.comment?M.comment+=`
131
+ `+le.comment:M.comment=le.comment);const Ce=new Qt(M,ke);if(i.options.keepSourceTokens&&(Ce.srcToken=R),d){const be=v;t1(i,be.items,M)&&l(O,"DUPLICATE_KEY","Map keys must be unique"),be.items.push(Ce)}else{const be=new Nn(i.schema);be.flow=!0,be.items.push(Ce);const tt=(ke??M).range;be.range=[M.range[0],tt[1],tt[2]],v.items.push(be)}x=ke?ke.range[2]:le.end}}const N=d?"}":"]",[_,...T]=r.end;let k=x;if(_?.source===N)k=_.offset+_.source.length;else{const E=h[0].toUpperCase()+h.substring(1),R=S?`${E} must end with a ${N}`:`${E} in block collection must be sufficiently indented and end with a ${N}`;l(x,S?"MISSING_CHAR":"BAD_INDENT",R),_&&_.source.length!==1&&T.unshift(_)}if(T.length>0){const E=So(T,k,i.options.strict,l);E.comment&&(v.comment?v.comment+=`
132
+ `+E.comment:v.comment=E.comment),v.range=[r.offset,k,E.offset]}else v.range=[r.offset,k,k];return v}function gf(e,n,i,r,l,c){const d=i.type==="block-map"?QM(e,n,i,r,c):i.type==="block-seq"?KM(e,n,i,r,c):ZM(e,n,i,r,c),h=d.constructor;return l==="!"||l===h.tagName?(d.tag=h.tagName,d):(l&&(d.tag=l),d)}function YM(e,n,i,r,l){const c=r.tag,d=c?n.directives.tagName(c.source,N=>l(c,"TAG_RESOLVE_FAILED",N)):null;if(i.type==="block-seq"){const{anchor:N,newlineAfterProp:_}=r,T=N&&c?N.offset>c.offset?N:c:N??c;T&&(!_||_.offset<T.offset)&&l(T,"MISSING_CHAR","Missing newline after block sequence props")}const h=i.type==="block-map"?"map":i.type==="block-seq"?"seq":i.start.source==="{"?"map":"seq";if(!c||!d||d==="!"||d===Nn.tagName&&h==="map"||d===Ci.tagName&&h==="seq")return gf(e,n,i,l,d);let g=n.schema.tags.find(N=>N.tag===d&&N.collection===h);if(!g){const N=n.schema.knownTags[d];if(N?.collection===h)n.schema.tags.push(Object.assign({},N,{default:!1})),g=N;else return N?l(c,"BAD_COLLECTION_TYPE",`${N.tag} used for ${h} collection, but expects ${N.collection??"scalar"}`,!0):l(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${d}`,!0),gf(e,n,i,l,d)}const v=gf(e,n,i,l,d,g),S=g.resolve?.(v,N=>l(c,"TAG_RESOLVE_FAILED",N),n.options)??v,x=vt(S)?S:new Ae(S);return x.range=v.range,x.tag=d,g?.format&&(x.format=g.format),x}function XM(e,n,i){const r=n.offset,l=JM(n,e.options.strict,i);if(!l)return{value:"",type:null,comment:"",range:[r,r,r]};const c=l.mode===">"?Ae.BLOCK_FOLDED:Ae.BLOCK_LITERAL,d=n.source?FM(n.source):[];let h=d.length;for(let k=d.length-1;k>=0;--k){const E=d[k][1];if(E===""||E==="\r")h=k;else break}if(h===0){const k=l.chomp==="+"&&d.length>0?`
133
+ `.repeat(Math.max(1,d.length-1)):"";let E=r+l.length;return n.source&&(E+=n.source.length),{value:k,type:c,comment:l.comment,range:[r,E,E]}}let g=n.indent+l.indent,v=n.offset+l.length,S=0;for(let k=0;k<h;++k){const[E,R]=d[k];if(R===""||R==="\r")l.indent===0&&E.length>g&&(g=E.length);else{E.length<g&&i(v+E.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),l.indent===0&&(g=E.length),S=k,g===0&&!e.atRoot&&i(v,"BAD_INDENT","Block scalar values in collections must be indented");break}v+=E.length+R.length+1}for(let k=d.length-1;k>=h;--k)d[k][0].length>g&&(h=k+1);let x="",N="",_=!1;for(let k=0;k<S;++k)x+=d[k][0].slice(g)+`
134
+ `;for(let k=S;k<h;++k){let[E,R]=d[k];v+=E.length+R.length+1;const V=R[R.length-1]==="\r";if(V&&(R=R.slice(0,-1)),R&&E.length<g){const Z=`Block scalar lines must not be less indented than their ${l.indent?"explicit indentation indicator":"first line"}`;i(v-R.length-(V?2:1),"BAD_INDENT",Z),E=""}c===Ae.BLOCK_LITERAL?(x+=N+E.slice(g)+R,N=`
135
135
  `):E.length>g||R[0]===" "?(N===" "?N=`
136
136
  `:!_&&N===`
137
137
  `&&(N=`
@@ -144,33 +144,33 @@ ${b}
144
144
  `+d[k][0].slice(g);x[x.length-1]!==`
145
145
  `&&(x+=`
146
146
  `);break;default:x+=`
147
- `}const T=r+l.length+n.source.length;return{value:x,type:c,comment:l.comment,range:[r,T,T]}}function HM({offset:e,props:n},i,r){if(n[0].type!=="block-scalar-header")return r(n[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:l}=n[0],c=l[0];let d=0,h="",g=-1;for(let N=1;N<l.length;++N){const _=l[N];if(!h&&(_==="-"||_==="+"))h=_;else{const T=Number(_);!d&&T?d=T:g===-1&&(g=e+N)}}g!==-1&&r(g,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${l}`);let b=!1,S="",x=l.length;for(let N=1;N<n.length;++N){const _=n[N];switch(_.type){case"space":b=!0;case"newline":x+=_.source.length;break;case"comment":i&&!b&&r(_,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),x+=_.source.length,S=_.source.substring(1);break;case"error":r(_,"UNEXPECTED_TOKEN",_.message),x+=_.source.length;break;default:{const T=`Unexpected token in block scalar header: ${_.type}`;r(_,"UNEXPECTED_TOKEN",T);const k=_.source;k&&typeof k=="string"&&(x+=k.length)}}}return{mode:c,indent:d,chomp:h,comment:S,length:x}}function QM(e){const n=e.split(/\n( *)/),i=n[0],r=i.match(/^( *)/),c=[r?.[1]?[r[1],i.slice(r[1].length)]:["",i]];for(let d=1;d<n.length;d+=2)c.push([n[d],n[d+1]]);return c}function KM(e,n,i){const{offset:r,type:l,source:c,end:d}=e;let h,g;const b=(N,_,T)=>i(r+N,_,T);switch(l){case"scalar":h=Ae.PLAIN,g=ZM(c,b);break;case"single-quoted-scalar":h=Ae.QUOTE_SINGLE,g=YM(c,b);break;case"double-quoted-scalar":h=Ae.QUOTE_DOUBLE,g=XM(c,b);break;default:return i(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${l}`),{value:"",type:null,comment:"",range:[r,r+c.length,r+c.length]}}const S=r+c.length,x=So(d,S,n,i);return{value:g,type:h,comment:x.comment,range:[r,S,x.offset]}}function ZM(e,n){let i="";switch(e[0]){case" ":i="a tab character";break;case",":i="flow indicator character ,";break;case"%":i="directive indicator character %";break;case"|":case">":{i=`block scalar indicator ${e[0]}`;break}case"@":case"`":{i=`reserved character ${e[0]}`;break}}return i&&n(0,"BAD_SCALAR_START",`Plain value cannot start with ${i}`),n1(e)}function YM(e,n){return(e[e.length-1]!=="'"||e.length===1)&&n(e.length,"MISSING_CHAR","Missing closing 'quote"),n1(e.slice(1,-1)).replace(/''/g,"'")}function n1(e){let n,i;try{n=new RegExp(`(.*?)(?<![ ])[ ]*\r?
147
+ `}const T=r+l.length+n.source.length;return{value:x,type:c,comment:l.comment,range:[r,T,T]}}function JM({offset:e,props:n},i,r){if(n[0].type!=="block-scalar-header")return r(n[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:l}=n[0],c=l[0];let d=0,h="",g=-1;for(let N=1;N<l.length;++N){const _=l[N];if(!h&&(_==="-"||_==="+"))h=_;else{const T=Number(_);!d&&T?d=T:g===-1&&(g=e+N)}}g!==-1&&r(g,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${l}`);let v=!1,S="",x=l.length;for(let N=1;N<n.length;++N){const _=n[N];switch(_.type){case"space":v=!0;case"newline":x+=_.source.length;break;case"comment":i&&!v&&r(_,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),x+=_.source.length,S=_.source.substring(1);break;case"error":r(_,"UNEXPECTED_TOKEN",_.message),x+=_.source.length;break;default:{const T=`Unexpected token in block scalar header: ${_.type}`;r(_,"UNEXPECTED_TOKEN",T);const k=_.source;k&&typeof k=="string"&&(x+=k.length)}}}return{mode:c,indent:d,chomp:h,comment:S,length:x}}function FM(e){const n=e.split(/\n( *)/),i=n[0],r=i.match(/^( *)/),c=[r?.[1]?[r[1],i.slice(r[1].length)]:["",i]];for(let d=1;d<n.length;d+=2)c.push([n[d],n[d+1]]);return c}function WM(e,n,i){const{offset:r,type:l,source:c,end:d}=e;let h,g;const v=(N,_,T)=>i(r+N,_,T);switch(l){case"scalar":h=Ae.PLAIN,g=eB(c,v);break;case"single-quoted-scalar":h=Ae.QUOTE_SINGLE,g=tB(c,v);break;case"double-quoted-scalar":h=Ae.QUOTE_DOUBLE,g=nB(c,v);break;default:return i(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${l}`),{value:"",type:null,comment:"",range:[r,r+c.length,r+c.length]}}const S=r+c.length,x=So(d,S,n,i);return{value:g,type:h,comment:x.comment,range:[r,S,x.offset]}}function eB(e,n){let i="";switch(e[0]){case" ":i="a tab character";break;case",":i="flow indicator character ,";break;case"%":i="directive indicator character %";break;case"|":case">":{i=`block scalar indicator ${e[0]}`;break}case"@":case"`":{i=`reserved character ${e[0]}`;break}}return i&&n(0,"BAD_SCALAR_START",`Plain value cannot start with ${i}`),n1(e)}function tB(e,n){return(e[e.length-1]!=="'"||e.length===1)&&n(e.length,"MISSING_CHAR","Missing closing 'quote"),n1(e.slice(1,-1)).replace(/''/g,"'")}function n1(e){let n,i;try{n=new RegExp(`(.*?)(?<![ ])[ ]*\r?
148
148
  `,"sy"),i=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
149
149
  `,"sy")}catch{n=/(.*?)[ \t]*\r?\n/sy,i=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=n.exec(e);if(!r)return e;let l=r[1],c=" ",d=n.lastIndex;for(i.lastIndex=d;r=i.exec(e);)r[1]===""?c===`
150
150
  `?l+=c:c=`
151
- `:(l+=c+r[1],c=" "),d=i.lastIndex;const h=/[ \t]*(.*)/sy;return h.lastIndex=d,r=h.exec(e),l+c+(r?.[1]??"")}function XM(e,n){let i="";for(let r=1;r<e.length-1;++r){const l=e[r];if(!(l==="\r"&&e[r+1]===`
151
+ `:(l+=c+r[1],c=" "),d=i.lastIndex;const h=/[ \t]*(.*)/sy;return h.lastIndex=d,r=h.exec(e),l+c+(r?.[1]??"")}function nB(e,n){let i="";for(let r=1;r<e.length-1;++r){const l=e[r];if(!(l==="\r"&&e[r+1]===`
152
152
  `))if(l===`
153
- `){const{fold:c,offset:d}=JM(e,r);i+=c,r=d}else if(l==="\\"){let c=e[++r];const d=FM[c];if(d)i+=d;else if(c===`
153
+ `){const{fold:c,offset:d}=aB(e,r);i+=c,r=d}else if(l==="\\"){let c=e[++r];const d=iB[c];if(d)i+=d;else if(c===`
154
154
  `)for(c=e[r+1];c===" "||c===" ";)c=e[++r+1];else if(c==="\r"&&e[r+1]===`
155
- `)for(c=e[++r+1];c===" "||c===" ";)c=e[++r+1];else if(c==="x"||c==="u"||c==="U"){const h={x:2,u:4,U:8}[c];i+=WM(e,r+1,h,n),r+=h}else{const h=e.substr(r-1,2);n(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${h}`),i+=h}}else if(l===" "||l===" "){const c=r;let d=e[r+1];for(;d===" "||d===" ";)d=e[++r+1];d!==`
155
+ `)for(c=e[++r+1];c===" "||c===" ";)c=e[++r+1];else if(c==="x"||c==="u"||c==="U"){const h={x:2,u:4,U:8}[c];i+=sB(e,r+1,h,n),r+=h}else{const h=e.substr(r-1,2);n(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${h}`),i+=h}}else if(l===" "||l===" "){const c=r;let d=e[r+1];for(;d===" "||d===" ";)d=e[++r+1];d!==`
156
156
  `&&!(d==="\r"&&e[r+2]===`
157
- `)&&(i+=r>c?e.slice(c,r+1):l)}else i+=l}return(e[e.length-1]!=='"'||e.length===1)&&n(e.length,"MISSING_CHAR",'Missing closing "quote'),i}function JM(e,n){let i="",r=e[n+1];for(;(r===" "||r===" "||r===`
157
+ `)&&(i+=r>c?e.slice(c,r+1):l)}else i+=l}return(e[e.length-1]!=='"'||e.length===1)&&n(e.length,"MISSING_CHAR",'Missing closing "quote'),i}function aB(e,n){let i="",r=e[n+1];for(;(r===" "||r===" "||r===`
158
158
  `||r==="\r")&&!(r==="\r"&&e[n+2]!==`
159
159
  `);)r===`
160
160
  `&&(i+=`
161
- `),n+=1,r=e[n+1];return i||(i=" "),{fold:i,offset:n}}const FM={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
162
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function WM(e,n,i,r){const l=e.substr(n,i),d=l.length===i&&/^[0-9a-fA-F]+$/.test(l)?parseInt(l,16):NaN;if(isNaN(d)){const h=e.substr(n-2,i+2);return r(n-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${h}`),h}return String.fromCodePoint(d)}function a1(e,n,i,r){const{value:l,type:c,comment:d,range:h}=n.type==="block-scalar"?GM(e,n,r):KM(n,e.options.strict,r),g=i?e.directives.tagName(i.source,x=>r(i,"TAG_RESOLVE_FAILED",x)):null;let b;e.options.stringKeys&&e.atKey?b=e.schema[Qn]:g?b=e5(e.schema,l,g,i,r):n.type==="scalar"?b=t5(e,l,n,r):b=e.schema[Qn];let S;try{const x=b.resolve(l,N=>r(i??n,"TAG_RESOLVE_FAILED",N),e.options);S=at(x)?x:new Ae(x)}catch(x){const N=x instanceof Error?x.message:String(x);r(i??n,"TAG_RESOLVE_FAILED",N),S=new Ae(l)}return S.range=h,S.source=l,c&&(S.type=c),g&&(S.tag=g),b.format&&(S.format=b.format),d&&(S.comment=d),S}function e5(e,n,i,r,l){if(i==="!")return e[Qn];const c=[];for(const h of e.tags)if(!h.collection&&h.tag===i)if(h.default&&h.test)c.push(h);else return h;for(const h of c)if(h.test?.test(n))return h;const d=e.knownTags[i];return d&&!d.collection?(e.tags.push(Object.assign({},d,{default:!1,test:void 0})),d):(l(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${i}`,i!=="tag:yaml.org,2002:str"),e[Qn])}function t5({atKey:e,directives:n,schema:i},r,l,c){const d=i.tags.find(h=>(h.default===!0||e&&h.default==="key")&&h.test?.test(r))||i[Qn];if(i.compat){const h=i.compat.find(g=>g.default&&g.test?.test(r))??i[Qn];if(d.tag!==h.tag){const g=n.tagString(d.tag),b=n.tagString(h.tag),S=`Value may be parsed as either ${g} or ${b}`;c(l,"TAG_RESOLVE_FAILED",S,!0)}}return d}function n5(e,n,i){if(n){i??(i=n.length);for(let r=i-1;r>=0;--r){let l=n[r];switch(l.type){case"space":case"comment":case"newline":e-=l.source.length;continue}for(l=n[++r];l?.type==="space";)e+=l.source.length,l=n[++r];break}}return e}const a5={composeNode:i1,composeEmptyNode:Hp};function i1(e,n,i,r){const l=e.atKey,{spaceBefore:c,comment:d,anchor:h,tag:g}=i;let b,S=!0;switch(n.type){case"alias":b=i5(e,n,r),(h||g)&&r(n,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":b=a1(e,n,g,r),h&&(b.anchor=h.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":b=PM(a5,e,n,i,r),h&&(b.anchor=h.source.substring(1));break;default:{const x=n.type==="error"?n.message:`Unsupported token (type: ${n.type})`;r(n,"UNEXPECTED_TOKEN",x),b=Hp(e,n.offset,void 0,null,i,r),S=!1}}return h&&b.anchor===""&&r(h,"BAD_ALIAS","Anchor cannot be an empty string"),l&&e.options.stringKeys&&(!at(b)||typeof b.value!="string"||b.tag&&b.tag!=="tag:yaml.org,2002:str")&&r(g??n,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(b.spaceBefore=!0),d&&(n.type==="scalar"&&n.source===""?b.comment=d:b.commentBefore=d),e.options.keepSourceTokens&&S&&(b.srcToken=n),b}function Hp(e,n,i,r,{spaceBefore:l,comment:c,anchor:d,tag:h,end:g},b){const S={type:"scalar",offset:n5(n,i,r),indent:-1,source:""},x=a1(e,S,h,b);return d&&(x.anchor=d.source.substring(1),x.anchor===""&&b(d,"BAD_ALIAS","Anchor cannot be an empty string")),l&&(x.spaceBefore=!0),c&&(x.comment=c,x.range[2]=g),x}function i5({options:e},{offset:n,source:i,end:r},l){const c=new Dp(i.substring(1));c.source===""&&l(n,"BAD_ALIAS","Alias cannot be an empty string"),c.source.endsWith(":")&&l(n+i.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const d=n+i.length,h=So(r,d,e.strict,l);return c.range=[n,d,h.offset],h.comment&&(c.comment=h.comment),c}function s5(e,n,{offset:i,start:r,value:l,end:c},d){const h=Object.assign({_directives:n},e),g=new Bc(void 0,h),b={atKey:!1,atRoot:!0,directives:g.directives,options:g.options,schema:g.schema},S=Ps(r,{indicator:"doc-start",next:l??c?.[0],offset:i,onError:d,parentIndent:0,startOnNewline:!0});S.found&&(g.directives.docStart=!0,l&&(l.type==="block-map"||l.type==="block-seq")&&!S.hasNewline&&d(S.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),g.contents=l?i1(b,l,S,d):Hp(b,S.end,r,null,S,d);const x=g.contents.range[2],N=So(c,x,!1,d);return N.comment&&(g.comment=N.comment),g.range=[i,x,N.offset],g}function ao(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:n,source:i}=e;return[n,n+(typeof i=="string"?i.length:1)]}function sv(e){let n="",i=!1,r=!1;for(let l=0;l<e.length;++l){const c=e[l];switch(c[0]){case"#":n+=(n===""?"":r?`
161
+ `),n+=1,r=e[n+1];return i||(i=" "),{fold:i,offset:n}}const iB={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
162
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function sB(e,n,i,r){const l=e.substr(n,i),d=l.length===i&&/^[0-9a-fA-F]+$/.test(l)?parseInt(l,16):NaN;if(isNaN(d)){const h=e.substr(n-2,i+2);return r(n-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${h}`),h}return String.fromCodePoint(d)}function a1(e,n,i,r){const{value:l,type:c,comment:d,range:h}=n.type==="block-scalar"?XM(e,n,r):WM(n,e.options.strict,r),g=i?e.directives.tagName(i.source,x=>r(i,"TAG_RESOLVE_FAILED",x)):null;let v;e.options.stringKeys&&e.atKey?v=e.schema[Qn]:g?v=rB(e.schema,l,g,i,r):n.type==="scalar"?v=oB(e,l,n,r):v=e.schema[Qn];let S;try{const x=v.resolve(l,N=>r(i??n,"TAG_RESOLVE_FAILED",N),e.options);S=at(x)?x:new Ae(x)}catch(x){const N=x instanceof Error?x.message:String(x);r(i??n,"TAG_RESOLVE_FAILED",N),S=new Ae(l)}return S.range=h,S.source=l,c&&(S.type=c),g&&(S.tag=g),v.format&&(S.format=v.format),d&&(S.comment=d),S}function rB(e,n,i,r,l){if(i==="!")return e[Qn];const c=[];for(const h of e.tags)if(!h.collection&&h.tag===i)if(h.default&&h.test)c.push(h);else return h;for(const h of c)if(h.test?.test(n))return h;const d=e.knownTags[i];return d&&!d.collection?(e.tags.push(Object.assign({},d,{default:!1,test:void 0})),d):(l(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${i}`,i!=="tag:yaml.org,2002:str"),e[Qn])}function oB({atKey:e,directives:n,schema:i},r,l,c){const d=i.tags.find(h=>(h.default===!0||e&&h.default==="key")&&h.test?.test(r))||i[Qn];if(i.compat){const h=i.compat.find(g=>g.default&&g.test?.test(r))??i[Qn];if(d.tag!==h.tag){const g=n.tagString(d.tag),v=n.tagString(h.tag),S=`Value may be parsed as either ${g} or ${v}`;c(l,"TAG_RESOLVE_FAILED",S,!0)}}return d}function lB(e,n,i){if(n){i??(i=n.length);for(let r=i-1;r>=0;--r){let l=n[r];switch(l.type){case"space":case"comment":case"newline":e-=l.source.length;continue}for(l=n[++r];l?.type==="space";)e+=l.source.length,l=n[++r];break}}return e}const cB={composeNode:i1,composeEmptyNode:Qp};function i1(e,n,i,r){const l=e.atKey,{spaceBefore:c,comment:d,anchor:h,tag:g}=i;let v,S=!0;switch(n.type){case"alias":v=uB(e,n,r),(h||g)&&r(n,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":v=a1(e,n,g,r),h&&(v.anchor=h.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":v=YM(cB,e,n,i,r),h&&(v.anchor=h.source.substring(1));break;default:{const x=n.type==="error"?n.message:`Unsupported token (type: ${n.type})`;r(n,"UNEXPECTED_TOKEN",x),v=Qp(e,n.offset,void 0,null,i,r),S=!1}}return h&&v.anchor===""&&r(h,"BAD_ALIAS","Anchor cannot be an empty string"),l&&e.options.stringKeys&&(!at(v)||typeof v.value!="string"||v.tag&&v.tag!=="tag:yaml.org,2002:str")&&r(g??n,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(v.spaceBefore=!0),d&&(n.type==="scalar"&&n.source===""?v.comment=d:v.commentBefore=d),e.options.keepSourceTokens&&S&&(v.srcToken=n),v}function Qp(e,n,i,r,{spaceBefore:l,comment:c,anchor:d,tag:h,end:g},v){const S={type:"scalar",offset:lB(n,i,r),indent:-1,source:""},x=a1(e,S,h,v);return d&&(x.anchor=d.source.substring(1),x.anchor===""&&v(d,"BAD_ALIAS","Anchor cannot be an empty string")),l&&(x.spaceBefore=!0),c&&(x.comment=c,x.range[2]=g),x}function uB({options:e},{offset:n,source:i,end:r},l){const c=new Rp(i.substring(1));c.source===""&&l(n,"BAD_ALIAS","Alias cannot be an empty string"),c.source.endsWith(":")&&l(n+i.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const d=n+i.length,h=So(r,d,e.strict,l);return c.range=[n,d,h.offset],h.comment&&(c.comment=h.comment),c}function dB(e,n,{offset:i,start:r,value:l,end:c},d){const h=Object.assign({_directives:n},e),g=new Bc(void 0,h),v={atKey:!1,atRoot:!0,directives:g.directives,options:g.options,schema:g.schema},S=Ps(r,{indicator:"doc-start",next:l??c?.[0],offset:i,onError:d,parentIndent:0,startOnNewline:!0});S.found&&(g.directives.docStart=!0,l&&(l.type==="block-map"||l.type==="block-seq")&&!S.hasNewline&&d(S.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),g.contents=l?i1(v,l,S,d):Qp(v,S.end,r,null,S,d);const x=g.contents.range[2],N=So(c,x,!1,d);return N.comment&&(g.comment=N.comment),g.range=[i,x,N.offset],g}function ao(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:n,source:i}=e;return[n,n+(typeof i=="string"?i.length:1)]}function rv(e){let n="",i=!1,r=!1;for(let l=0;l<e.length;++l){const c=e[l];switch(c[0]){case"#":n+=(n===""?"":r?`
163
163
 
164
164
  `:`
165
- `)+(c.substring(1)||" "),i=!0,r=!1;break;case"%":e[l+1]?.[0]!=="#"&&(l+=1),i=!1;break;default:i||(r=!0),i=!1}}return{comment:n,afterEmptyLine:r}}class r5{constructor(n={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(i,r,l,c)=>{const d=ao(i);c?this.warnings.push(new UM(d,r,l)):this.errors.push(new Yl(d,r,l))},this.directives=new Gt({version:n.version||"1.2"}),this.options=n}decorate(n,i){const{comment:r,afterEmptyLine:l}=sv(this.prelude);if(r){const c=n.contents;if(i)n.comment=n.comment?`${n.comment}
165
+ `)+(c.substring(1)||" "),i=!0,r=!1;break;case"%":e[l+1]?.[0]!=="#"&&(l+=1),i=!1;break;default:i||(r=!0),i=!1}}return{comment:n,afterEmptyLine:r}}class fB{constructor(n={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(i,r,l,c)=>{const d=ao(i);c?this.warnings.push(new HM(d,r,l)):this.errors.push(new Yl(d,r,l))},this.directives=new Gt({version:n.version||"1.2"}),this.options=n}decorate(n,i){const{comment:r,afterEmptyLine:l}=rv(this.prelude);if(r){const c=n.contents;if(i)n.comment=n.comment?`${n.comment}
166
166
  ${r}`:r;else if(l||n.directives.docStart||!c)n.commentBefore=r;else if(bt(c)&&!c.flow&&c.items.length>0){let d=c.items[0];St(d)&&(d=d.key);const h=d.commentBefore;d.commentBefore=h?`${r}
167
167
  ${h}`:r}else{const d=c.commentBefore;c.commentBefore=d?`${r}
168
- ${d}`:r}}i?(Array.prototype.push.apply(n.errors,this.errors),Array.prototype.push.apply(n.warnings,this.warnings)):(n.errors=this.errors,n.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:sv(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(n,i=!1,r=-1){for(const l of n)yield*this.next(l);yield*this.end(i,r)}*next(n){switch(n.type){case"directive":this.directives.add(n.source,(i,r,l)=>{const c=ao(n);c[0]+=i,this.onError(c,"BAD_DIRECTIVE",r,l)}),this.prelude.push(n.source),this.atDirectives=!0;break;case"document":{const i=s5(this.options,this.directives,n,this.onError);this.atDirectives&&!i.directives.docStart&&this.onError(n,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(i,!1),this.doc&&(yield this.doc),this.doc=i,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(n.source);break;case"error":{const i=n.source?`${n.message}: ${JSON.stringify(n.source)}`:n.message,r=new Yl(ao(n),"UNEXPECTED_TOKEN",i);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new Yl(ao(n),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const i=So(n.end,n.offset+n.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),i.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
169
- ${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.push(new Yl(ao(n),"UNEXPECTED_TOKEN",`Unsupported token ${n.type}`))}}*end(n=!1,i=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(n){const r=Object.assign({_directives:this.directives},this.options),l=new Bc(void 0,r);this.atDirectives&&this.onError(i,"MISSING_CHAR","Missing directives-end indicator line"),l.range=[0,i,i],this.decorate(l,!1),yield l}}}const s1="\uFEFF",r1="",o1="",If="";function o5(e){switch(e){case s1:return"byte-order-mark";case r1:return"doc-mode";case o1:return"flow-error-end";case If:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
168
+ ${d}`:r}}i?(Array.prototype.push.apply(n.errors,this.errors),Array.prototype.push.apply(n.warnings,this.warnings)):(n.errors=this.errors,n.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:rv(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(n,i=!1,r=-1){for(const l of n)yield*this.next(l);yield*this.end(i,r)}*next(n){switch(n.type){case"directive":this.directives.add(n.source,(i,r,l)=>{const c=ao(n);c[0]+=i,this.onError(c,"BAD_DIRECTIVE",r,l)}),this.prelude.push(n.source),this.atDirectives=!0;break;case"document":{const i=dB(this.options,this.directives,n,this.onError);this.atDirectives&&!i.directives.docStart&&this.onError(n,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(i,!1),this.doc&&(yield this.doc),this.doc=i,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(n.source);break;case"error":{const i=n.source?`${n.message}: ${JSON.stringify(n.source)}`:n.message,r=new Yl(ao(n),"UNEXPECTED_TOKEN",i);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new Yl(ao(n),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const i=So(n.end,n.offset+n.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),i.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
169
+ ${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.push(new Yl(ao(n),"UNEXPECTED_TOKEN",`Unsupported token ${n.type}`))}}*end(n=!1,i=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(n){const r=Object.assign({_directives:this.directives},this.options),l=new Bc(void 0,r);this.atDirectives&&this.onError(i,"MISSING_CHAR","Missing directives-end indicator line"),l.range=[0,i,i],this.decorate(l,!1),yield l}}}const s1="\uFEFF",r1="",o1="",If="";function pB(e){switch(e){case s1:return"byte-order-mark";case r1:return"doc-mode";case o1:return"flow-error-end";case If:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
170
170
  `:case`\r
171
171
  `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Mn(e){switch(e){case void 0:case" ":case`
172
- `:case"\r":case" ":return!0;default:return!1}}const rv=new Set("0123456789ABCDEFabcdef"),l5=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Xl=new Set(",[]{}"),c5=new Set(` ,[]{}
173
- \r `),yf=e=>!e||c5.has(e);class u5{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(n,i=!1){if(n){if(typeof n!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+n:n,this.lineEndPos=null}this.atEnd=!i;let r=this.next??"stream";for(;r&&(i||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let n=this.pos,i=this.buffer[n];for(;i===" "||i===" ";)i=this.buffer[++n];return!i||i==="#"||i===`
172
+ `:case"\r":case" ":return!0;default:return!1}}const ov=new Set("0123456789ABCDEFabcdef"),mB=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Xl=new Set(",[]{}"),hB=new Set(` ,[]{}
173
+ \r `),yf=e=>!e||hB.has(e);class gB{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(n,i=!1){if(n){if(typeof n!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+n:n,this.lineEndPos=null}this.atEnd=!i;let r=this.next??"stream";for(;r&&(i||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let n=this.pos,i=this.buffer[n];for(;i===" "||i===" ";)i=this.buffer[++n];return!i||i==="#"||i===`
174
174
  `?!0:i==="\r"?this.buffer[n+1]===`
175
175
  `:!1}charAt(n){return this.buffer[this.pos+n]}continueScalar(n){let i=this.buffer[n];if(this.indentNext>0){let r=0;for(;i===" ";)i=this.buffer[++r+n];if(i==="\r"){const l=this.buffer[r+n+1];if(l===`
176
176
  `||!l&&!this.atEnd)return n+r+1}return i===`
@@ -185,13 +185,13 @@ ${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.pus
185
185
  `&&c>=this.pos&&c+1+i>h)n=c;else break}while(!0);return yield If,yield*this.pushToIndex(n+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const n=this.flowLevel>0;let i=this.pos-1,r=this.pos-1,l;for(;l=this.buffer[++r];)if(l===":"){const c=this.buffer[r+1];if(Mn(c)||n&&Xl.has(c))break;i=r}else if(Mn(l)){let c=this.buffer[r+1];if(l==="\r"&&(c===`
186
186
  `?(r+=1,l=`
187
187
  `,c=this.buffer[r+1]):i=r),c==="#"||n&&Xl.has(c))break;if(l===`
188
- `){const d=this.continueScalar(r+1);if(d===-1)break;r=Math.max(r,d-2)}}else{if(n&&Xl.has(l))break;i=r}return!l&&!this.atEnd?this.setNext("plain-scalar"):(yield If,yield*this.pushToIndex(i+1,!0),n?"flow":"doc")}*pushCount(n){return n>0?(yield this.buffer.substr(this.pos,n),this.pos+=n,n):0}*pushToIndex(n,i){const r=this.buffer.slice(this.pos,n);return r?(yield r,this.pos+=r.length,r.length):(i&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(yf))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(Mn(i)||n&&Xl.has(i))return n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let n=this.pos+2,i=this.buffer[n];for(;!Mn(i)&&i!==">";)i=this.buffer[++n];return yield*this.pushToIndex(i===">"?n+1:n,!1)}else{let n=this.pos+1,i=this.buffer[n];for(;i;)if(l5.has(i))i=this.buffer[++n];else if(i==="%"&&rv.has(this.buffer[n+1])&&rv.has(this.buffer[n+2]))i=this.buffer[n+=3];else break;return yield*this.pushToIndex(n,!1)}}*pushNewline(){const n=this.buffer[this.pos];return n===`
188
+ `){const d=this.continueScalar(r+1);if(d===-1)break;r=Math.max(r,d-2)}}else{if(n&&Xl.has(l))break;i=r}return!l&&!this.atEnd?this.setNext("plain-scalar"):(yield If,yield*this.pushToIndex(i+1,!0),n?"flow":"doc")}*pushCount(n){return n>0?(yield this.buffer.substr(this.pos,n),this.pos+=n,n):0}*pushToIndex(n,i){const r=this.buffer.slice(this.pos,n);return r?(yield r,this.pos+=r.length,r.length):(i&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(yf))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(Mn(i)||n&&Xl.has(i))return n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let n=this.pos+2,i=this.buffer[n];for(;!Mn(i)&&i!==">";)i=this.buffer[++n];return yield*this.pushToIndex(i===">"?n+1:n,!1)}else{let n=this.pos+1,i=this.buffer[n];for(;i;)if(mB.has(i))i=this.buffer[++n];else if(i==="%"&&ov.has(this.buffer[n+1])&&ov.has(this.buffer[n+2]))i=this.buffer[n+=3];else break;return yield*this.pushToIndex(n,!1)}}*pushNewline(){const n=this.buffer[this.pos];return n===`
189
189
  `?yield*this.pushCount(1):n==="\r"&&this.charAt(1)===`
190
- `?yield*this.pushCount(2):0}*pushSpaces(n){let i=this.pos-1,r;do r=this.buffer[++i];while(r===" "||n&&r===" ");const l=i-this.pos;return l>0&&(yield this.buffer.substr(this.pos,l),this.pos=i),l}*pushUntil(n){let i=this.pos,r=this.buffer[i];for(;!n(r);)r=this.buffer[++i];return yield*this.pushToIndex(i,!1)}}class d5{constructor(){this.lineStarts=[],this.addNewLine=n=>this.lineStarts.push(n),this.linePos=n=>{let i=0,r=this.lineStarts.length;for(;i<r;){const c=i+r>>1;this.lineStarts[c]<n?i=c+1:r=c}if(this.lineStarts[i]===n)return{line:i+1,col:1};if(i===0)return{line:0,col:n};const l=this.lineStarts[i-1];return{line:i,col:n-l+1}}}}function Ka(e,n){for(let i=0;i<e.length;++i)if(e[i].type===n)return!0;return!1}function ov(e){for(let n=0;n<e.length;++n)switch(e[n].type){case"space":case"comment":case"newline":break;default:return n}return-1}function l1(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Jl(e){switch(e.type){case"document":return e.start;case"block-map":{const n=e.items[e.items.length-1];return n.sep??n.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function zs(e){if(e.length===0)return[];let n=e.length;e:for(;--n>=0;)switch(e[n].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++n]?.type==="space";);return e.splice(n,e.length)}function lv(e){if(e.start.type==="flow-seq-start")for(const n of e.items)n.sep&&!n.value&&!Ka(n.start,"explicit-key-ind")&&!Ka(n.sep,"map-value-ind")&&(n.key&&(n.value=n.key),delete n.key,l1(n.value)?n.value.end?Array.prototype.push.apply(n.value.end,n.sep):n.value.end=n.sep:Array.prototype.push.apply(n.start,n.sep),delete n.sep)}class f5{constructor(n){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new u5,this.onNewLine=n}*parse(n,i=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(n,i))yield*this.next(r);i||(yield*this.end())}*next(n){if(this.source=n,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=n.length;return}const i=o5(n);if(i)if(i==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=i,yield*this.step(),i){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+n.length);break;case"space":this.atNewLine&&n[0]===" "&&(this.indent+=n.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=n.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=n.length}else{const r=`Not a YAML token: ${n}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:n}),this.offset+=n.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const n=this.peek(1);if(this.type==="doc-end"&&n?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!n)return yield*this.stream();switch(n.type){case"document":return yield*this.document(n);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(n);case"block-scalar":return yield*this.blockScalar(n);case"block-map":return yield*this.blockMap(n);case"block-seq":return yield*this.blockSequence(n);case"flow-collection":return yield*this.flowCollection(n);case"doc-end":return yield*this.documentEnd(n)}yield*this.pop()}peek(n){return this.stack[this.stack.length-n]}*pop(n){const i=n??this.stack.pop();if(!i)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield i;else{const r=this.peek(1);switch(i.type==="block-scalar"?i.indent="indent"in r?r.indent:0:i.type==="flow-collection"&&r.type==="document"&&(i.indent=0),i.type==="flow-collection"&&lv(i),r.type){case"document":r.value=i;break;case"block-scalar":r.props.push(i);break;case"block-map":{const l=r.items[r.items.length-1];if(l.value){r.items.push({start:[],key:i,sep:[]}),this.onKeyLine=!0;return}else if(l.sep)l.value=i;else{Object.assign(l,{key:i,sep:[]}),this.onKeyLine=!l.explicitKey;return}break}case"block-seq":{const l=r.items[r.items.length-1];l.value?r.items.push({start:[],value:i}):l.value=i;break}case"flow-collection":{const l=r.items[r.items.length-1];!l||l.value?r.items.push({start:[],key:i,sep:[]}):l.sep?l.value=i:Object.assign(l,{key:i,sep:[]});return}default:yield*this.pop(),yield*this.pop(i)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(i.type==="block-map"||i.type==="block-seq")){const l=i.items[i.items.length-1];l&&!l.sep&&!l.value&&l.start.length>0&&ov(l.start)===-1&&(i.indent===0||l.start.every(c=>c.type!=="comment"||c.indent<i.indent))&&(r.type==="document"?r.end=l.start:r.items.push({start:l.start}),i.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const n={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&n.start.push(this.sourceToken),this.stack.push(n);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(n){if(n.value)return yield*this.lineEnd(n);switch(this.type){case"doc-start":{ov(n.start)!==-1?(yield*this.pop(),yield*this.step()):n.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":n.start.push(this.sourceToken);return}const i=this.startBlockValue(n);i?this.stack.push(i):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(n){if(this.type==="map-value-ind"){const i=Jl(this.peek(2)),r=zs(i);let l;n.end?(l=n.end,l.push(this.sourceToken),delete n.end):l=[this.sourceToken];const c={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:r,key:n,sep:l}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(n)}*blockScalar(n){switch(this.type){case"space":case"comment":case"newline":n.props.push(this.sourceToken);return;case"scalar":if(n.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let i=this.source.indexOf(`
190
+ `?yield*this.pushCount(2):0}*pushSpaces(n){let i=this.pos-1,r;do r=this.buffer[++i];while(r===" "||n&&r===" ");const l=i-this.pos;return l>0&&(yield this.buffer.substr(this.pos,l),this.pos=i),l}*pushUntil(n){let i=this.pos,r=this.buffer[i];for(;!n(r);)r=this.buffer[++i];return yield*this.pushToIndex(i,!1)}}class yB{constructor(){this.lineStarts=[],this.addNewLine=n=>this.lineStarts.push(n),this.linePos=n=>{let i=0,r=this.lineStarts.length;for(;i<r;){const c=i+r>>1;this.lineStarts[c]<n?i=c+1:r=c}if(this.lineStarts[i]===n)return{line:i+1,col:1};if(i===0)return{line:0,col:n};const l=this.lineStarts[i-1];return{line:i,col:n-l+1}}}}function Ka(e,n){for(let i=0;i<e.length;++i)if(e[i].type===n)return!0;return!1}function lv(e){for(let n=0;n<e.length;++n)switch(e[n].type){case"space":case"comment":case"newline":break;default:return n}return-1}function l1(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Jl(e){switch(e.type){case"document":return e.start;case"block-map":{const n=e.items[e.items.length-1];return n.sep??n.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function zs(e){if(e.length===0)return[];let n=e.length;e:for(;--n>=0;)switch(e[n].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++n]?.type==="space";);return e.splice(n,e.length)}function cv(e){if(e.start.type==="flow-seq-start")for(const n of e.items)n.sep&&!n.value&&!Ka(n.start,"explicit-key-ind")&&!Ka(n.sep,"map-value-ind")&&(n.key&&(n.value=n.key),delete n.key,l1(n.value)?n.value.end?Array.prototype.push.apply(n.value.end,n.sep):n.value.end=n.sep:Array.prototype.push.apply(n.start,n.sep),delete n.sep)}class bB{constructor(n){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new gB,this.onNewLine=n}*parse(n,i=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(n,i))yield*this.next(r);i||(yield*this.end())}*next(n){if(this.source=n,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=n.length;return}const i=pB(n);if(i)if(i==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=i,yield*this.step(),i){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+n.length);break;case"space":this.atNewLine&&n[0]===" "&&(this.indent+=n.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=n.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=n.length}else{const r=`Not a YAML token: ${n}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:n}),this.offset+=n.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const n=this.peek(1);if(this.type==="doc-end"&&n?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!n)return yield*this.stream();switch(n.type){case"document":return yield*this.document(n);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(n);case"block-scalar":return yield*this.blockScalar(n);case"block-map":return yield*this.blockMap(n);case"block-seq":return yield*this.blockSequence(n);case"flow-collection":return yield*this.flowCollection(n);case"doc-end":return yield*this.documentEnd(n)}yield*this.pop()}peek(n){return this.stack[this.stack.length-n]}*pop(n){const i=n??this.stack.pop();if(!i)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield i;else{const r=this.peek(1);switch(i.type==="block-scalar"?i.indent="indent"in r?r.indent:0:i.type==="flow-collection"&&r.type==="document"&&(i.indent=0),i.type==="flow-collection"&&cv(i),r.type){case"document":r.value=i;break;case"block-scalar":r.props.push(i);break;case"block-map":{const l=r.items[r.items.length-1];if(l.value){r.items.push({start:[],key:i,sep:[]}),this.onKeyLine=!0;return}else if(l.sep)l.value=i;else{Object.assign(l,{key:i,sep:[]}),this.onKeyLine=!l.explicitKey;return}break}case"block-seq":{const l=r.items[r.items.length-1];l.value?r.items.push({start:[],value:i}):l.value=i;break}case"flow-collection":{const l=r.items[r.items.length-1];!l||l.value?r.items.push({start:[],key:i,sep:[]}):l.sep?l.value=i:Object.assign(l,{key:i,sep:[]});return}default:yield*this.pop(),yield*this.pop(i)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(i.type==="block-map"||i.type==="block-seq")){const l=i.items[i.items.length-1];l&&!l.sep&&!l.value&&l.start.length>0&&lv(l.start)===-1&&(i.indent===0||l.start.every(c=>c.type!=="comment"||c.indent<i.indent))&&(r.type==="document"?r.end=l.start:r.items.push({start:l.start}),i.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const n={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&n.start.push(this.sourceToken),this.stack.push(n);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(n){if(n.value)return yield*this.lineEnd(n);switch(this.type){case"doc-start":{lv(n.start)!==-1?(yield*this.pop(),yield*this.step()):n.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":n.start.push(this.sourceToken);return}const i=this.startBlockValue(n);i?this.stack.push(i):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(n){if(this.type==="map-value-ind"){const i=Jl(this.peek(2)),r=zs(i);let l;n.end?(l=n.end,l.push(this.sourceToken),delete n.end):l=[this.sourceToken];const c={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:r,key:n,sep:l}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(n)}*blockScalar(n){switch(this.type){case"space":case"comment":case"newline":n.props.push(this.sourceToken);return;case"scalar":if(n.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let i=this.source.indexOf(`
191
191
  `)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
192
- `,i)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(n){const i=n.items[n.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,i.value){const r="end"in i.value?i.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):n.items.push({start:[this.sourceToken]})}else i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)n.items.push({start:[this.sourceToken]});else if(i.sep)i.sep.push(this.sourceToken);else{if(this.atIndentedComment(i.start,n.indent)){const l=n.items[n.items.length-2]?.value?.end;if(Array.isArray(l)){Array.prototype.push.apply(l,i.start),l.push(this.sourceToken),n.items.pop();return}}i.start.push(this.sourceToken)}return}if(this.indent>=n.indent){const r=!this.onKeyLine&&this.indent===n.indent,l=r&&(i.sep||i.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(l&&i.sep&&!i.value){const d=[];for(let h=0;h<i.sep.length;++h){const g=i.sep[h];switch(g.type){case"newline":d.push(h);break;case"space":break;case"comment":g.indent>n.indent&&(d.length=0);break;default:d.length=0}}d.length>=2&&(c=i.sep.splice(d[1]))}switch(this.type){case"anchor":case"tag":l||i.value?(c.push(this.sourceToken),n.items.push({start:c}),this.onKeyLine=!0):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"explicit-key-ind":!i.sep&&!i.explicitKey?(i.start.push(this.sourceToken),i.explicitKey=!0):l||i.value?(c.push(this.sourceToken),n.items.push({start:c,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(i.explicitKey)if(i.sep)if(i.value)n.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ka(i.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]});else if(l1(i.key)&&!Ka(i.sep,"newline")){const d=zs(i.start),h=i.key,g=i.sep;g.push(this.sourceToken),delete i.key,delete i.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:h,sep:g}]})}else c.length>0?i.sep=i.sep.concat(c,this.sourceToken):i.sep.push(this.sourceToken);else if(Ka(i.start,"newline"))Object.assign(i,{key:null,sep:[this.sourceToken]});else{const d=zs(i.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:null,sep:[this.sourceToken]}]})}else i.sep?i.value||l?n.items.push({start:c,key:null,sep:[this.sourceToken]}):Ka(i.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const d=this.flowScalar(this.type);l||i.value?(n.items.push({start:c,key:d,sep:[]}),this.onKeyLine=!0):i.sep?this.stack.push(d):(Object.assign(i,{key:d,sep:[]}),this.onKeyLine=!0);return}default:{const d=this.startBlockValue(n);if(d){if(d.type==="block-seq"){if(!i.explicitKey&&i.sep&&!Ka(i.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&n.items.push({start:c});this.stack.push(d);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(n){const i=n.items[n.items.length-1];switch(this.type){case"newline":if(i.value){const r="end"in i.value?i.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):n.items.push({start:[this.sourceToken]})}else i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)n.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(i.start,n.indent)){const l=n.items[n.items.length-2]?.value?.end;if(Array.isArray(l)){Array.prototype.push.apply(l,i.start),l.push(this.sourceToken),n.items.pop();return}}i.start.push(this.sourceToken)}return;case"anchor":case"tag":if(i.value||this.indent<=n.indent)break;i.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==n.indent)break;i.value||Ka(i.start,"seq-item-ind")?n.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return}if(this.indent>n.indent){const r=this.startBlockValue(n);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(n){const i=n.items[n.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(n.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!i||i.sep?n.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return;case"map-value-ind":!i||i.value?n.items.push({start:[],key:null,sep:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!i||i.value?n.items.push({start:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);!i||i.value?n.items.push({start:[],key:l,sep:[]}):i.sep?this.stack.push(l):Object.assign(i,{key:l,sep:[]});return}case"flow-map-end":case"flow-seq-end":n.end.push(this.sourceToken);return}const r=this.startBlockValue(n);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===n.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const l=Jl(r),c=zs(l);lv(n);const d=n.end.splice(1,n.end.length);d.push(this.sourceToken);const h={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:c,key:n,sep:d}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=h}else yield*this.lineEnd(n)}}flowScalar(n){if(this.onNewLine){let i=this.source.indexOf(`
192
+ `,i)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(n){const i=n.items[n.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,i.value){const r="end"in i.value?i.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):n.items.push({start:[this.sourceToken]})}else i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)n.items.push({start:[this.sourceToken]});else if(i.sep)i.sep.push(this.sourceToken);else{if(this.atIndentedComment(i.start,n.indent)){const l=n.items[n.items.length-2]?.value?.end;if(Array.isArray(l)){Array.prototype.push.apply(l,i.start),l.push(this.sourceToken),n.items.pop();return}}i.start.push(this.sourceToken)}return}if(this.indent>=n.indent){const r=!this.onKeyLine&&this.indent===n.indent,l=r&&(i.sep||i.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(l&&i.sep&&!i.value){const d=[];for(let h=0;h<i.sep.length;++h){const g=i.sep[h];switch(g.type){case"newline":d.push(h);break;case"space":break;case"comment":g.indent>n.indent&&(d.length=0);break;default:d.length=0}}d.length>=2&&(c=i.sep.splice(d[1]))}switch(this.type){case"anchor":case"tag":l||i.value?(c.push(this.sourceToken),n.items.push({start:c}),this.onKeyLine=!0):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"explicit-key-ind":!i.sep&&!i.explicitKey?(i.start.push(this.sourceToken),i.explicitKey=!0):l||i.value?(c.push(this.sourceToken),n.items.push({start:c,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(i.explicitKey)if(i.sep)if(i.value)n.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ka(i.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]});else if(l1(i.key)&&!Ka(i.sep,"newline")){const d=zs(i.start),h=i.key,g=i.sep;g.push(this.sourceToken),delete i.key,delete i.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:h,sep:g}]})}else c.length>0?i.sep=i.sep.concat(c,this.sourceToken):i.sep.push(this.sourceToken);else if(Ka(i.start,"newline"))Object.assign(i,{key:null,sep:[this.sourceToken]});else{const d=zs(i.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:null,sep:[this.sourceToken]}]})}else i.sep?i.value||l?n.items.push({start:c,key:null,sep:[this.sourceToken]}):Ka(i.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const d=this.flowScalar(this.type);l||i.value?(n.items.push({start:c,key:d,sep:[]}),this.onKeyLine=!0):i.sep?this.stack.push(d):(Object.assign(i,{key:d,sep:[]}),this.onKeyLine=!0);return}default:{const d=this.startBlockValue(n);if(d){if(d.type==="block-seq"){if(!i.explicitKey&&i.sep&&!Ka(i.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&n.items.push({start:c});this.stack.push(d);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(n){const i=n.items[n.items.length-1];switch(this.type){case"newline":if(i.value){const r="end"in i.value?i.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):n.items.push({start:[this.sourceToken]})}else i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)n.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(i.start,n.indent)){const l=n.items[n.items.length-2]?.value?.end;if(Array.isArray(l)){Array.prototype.push.apply(l,i.start),l.push(this.sourceToken),n.items.pop();return}}i.start.push(this.sourceToken)}return;case"anchor":case"tag":if(i.value||this.indent<=n.indent)break;i.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==n.indent)break;i.value||Ka(i.start,"seq-item-ind")?n.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return}if(this.indent>n.indent){const r=this.startBlockValue(n);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(n){const i=n.items[n.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(n.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!i||i.sep?n.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return;case"map-value-ind":!i||i.value?n.items.push({start:[],key:null,sep:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!i||i.value?n.items.push({start:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);!i||i.value?n.items.push({start:[],key:l,sep:[]}):i.sep?this.stack.push(l):Object.assign(i,{key:l,sep:[]});return}case"flow-map-end":case"flow-seq-end":n.end.push(this.sourceToken);return}const r=this.startBlockValue(n);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===n.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const l=Jl(r),c=zs(l);cv(n);const d=n.end.splice(1,n.end.length);d.push(this.sourceToken);const h={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:c,key:n,sep:d}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=h}else yield*this.lineEnd(n)}}flowScalar(n){if(this.onNewLine){let i=this.source.indexOf(`
193
193
  `)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
194
- `,i)+1}return{type:n,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(n){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const i=Jl(n),r=zs(i);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const i=Jl(n),r=zs(i);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(n,i){return this.type!=="comment"||this.indent<=i?!1:n.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(n){this.type!=="doc-mode"&&(n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(n){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function p5(e){const n=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||n&&new d5||null,prettyErrors:n}}function m5(e,n={}){const{lineCounter:i,prettyErrors:r}=p5(n),l=new f5(i?.addNewLine),c=new r5(n),d=Array.from(c.compose(l.parse(e)));if(r&&i)for(const h of d)h.errors.forEach(av(e,i)),h.warnings.forEach(av(e,i));return d.length>0?d:Object.assign([],{empty:!0},c.streamInfo())}function h5({onApplied:e}){const[n,i]=U.useState(""),[r,l]=U.useState(!1),[c,d]=U.useState([]),[h,g]=U.useState([]),b=async()=>{if(!n.trim())return;l(!0),d([]),g([]);const S=m5(n),x=[],N=[];for(let _=0;_<S.length;_++){const T=S[_];if(T.errors.length>0){x.push(`Document ${_+1}: ${T.errors[0]?.message}`);continue}const k=T.toJSON();if(!(!k||typeof k!="object"))try{const E=await Tk(k);N.push(`Applied "${E.displayName||E.name}" (revision ${E.configRevision})`)}catch(E){x.push(`Document ${_+1}: ${E instanceof Error?E.message:String(E)}`)}}d(N),g(x),l(!1),N.length>0&&(en({title:"YAML applied",detail:`Applied ${N.length} document${N.length===1?"":"s"} successfully.`,tone:x.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return f.jsxs("section",{className:"mt-8",children:[f.jsx("div",{className:"page-section-divider"}),f.jsx("div",{className:"section-head mt-6",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),f.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),f.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",f.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",f.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),f.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
194
+ `,i)+1}return{type:n,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(n){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const i=Jl(n),r=zs(i);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const i=Jl(n),r=zs(i);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(n,i){return this.type!=="comment"||this.indent<=i?!1:n.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(n){this.type!=="doc-mode"&&(n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(n){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function vB(e){const n=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||n&&new yB||null,prettyErrors:n}}function SB(e,n={}){const{lineCounter:i,prettyErrors:r}=vB(n),l=new bB(i?.addNewLine),c=new fB(n),d=Array.from(c.compose(l.parse(e)));if(r&&i)for(const h of d)h.errors.forEach(iv(e,i)),h.warnings.forEach(iv(e,i));return d.length>0?d:Object.assign([],{empty:!0},c.streamInfo())}function xB({onApplied:e}){const[n,i]=U.useState(""),[r,l]=U.useState(!1),[c,d]=U.useState([]),[h,g]=U.useState([]),v=async()=>{if(!n.trim())return;l(!0),d([]),g([]);const S=SB(n),x=[],N=[];for(let _=0;_<S.length;_++){const T=S[_];if(T.errors.length>0){x.push(`Document ${_+1}: ${T.errors[0]?.message}`);continue}const k=T.toJSON();if(!(!k||typeof k!="object"))try{const E=await Ok(k);N.push(`Applied "${E.displayName||E.name}" (revision ${E.configRevision})`)}catch(E){x.push(`Document ${_+1}: ${E instanceof Error?E.message:String(E)}`)}}d(N),g(x),l(!1),N.length>0&&(en({title:"YAML applied",detail:`Applied ${N.length} document${N.length===1?"":"s"} successfully.`,tone:x.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return f.jsxs("section",{className:"mt-8",children:[f.jsx("div",{className:"page-section-divider"}),f.jsx("div",{className:"section-head mt-6",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),f.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),f.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",f.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",f.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),f.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
195
195
  kind: Project
196
196
  metadata:
197
197
  name: my-project
@@ -199,12 +199,12 @@ spec:
199
199
  canonicalDomain: example.com
200
200
  country: US
201
201
  language: en
202
- queries: []`,value:n,onChange:S=>i(S.target.value)}),c.length>0&&f.jsx("ul",{className:"mt-2 space-y-1",children:c.map((S,x)=>f.jsx("li",{className:"text-emerald-400 text-sm",children:S},x))}),h.length>0&&f.jsx("ul",{className:"mt-2 space-y-1",children:h.map((S,x)=>f.jsx("li",{className:"text-rose-400 text-sm",children:S},x))}),f.jsx("div",{className:"mt-3",children:f.jsx(qe,{type:"button",disabled:!n.trim()||r,onClick:wn(b),children:r?"Applying...":"Apply"})})]})}function g5(){const{dashboard:e,isLoading:n,refetch:i}=Ac();if(!e||n)return f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-28"}),f.jsx("div",{className:"skeleton-text-sm w-40"})]}),f.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[f.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Mentions","Last run","Country"].map(O=>f.jsx("div",{className:"skeleton-text-sm w-16"},O))}),[1,2,3].map(O=>f.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[f.jsxs("div",{className:"flex-1 space-y-1",children:[f.jsx("div",{className:"skeleton-text w-28"}),f.jsx("div",{className:"skeleton-text-sm w-16"})]}),f.jsx("div",{className:"skeleton-text w-24"}),f.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),f.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),f.jsx("div",{className:"skeleton-text-sm w-8"})]},O))]})]});const r=e.projects,l=hc(),[c,d]=U.useState(!1),[h,g]=U.useState(""),[b,S]=U.useState(""),[x,N]=U.useState(""),[_,T]=U.useState("US"),[k,E]=U.useState("en"),[R,V]=U.useState(!1),[G,Z]=U.useState(null),X=h.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),F=async()=>{if(!(!X||!x)){V(!0),Z(null);try{const O=await ho(X,{displayName:b||h,canonicalDomain:x,country:_,language:k});en({title:"Project created",detail:`${O.displayName||O.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${O.name}`,dedupeMode:"drop"}),i(),g(""),S(""),N(""),T("US"),E("en"),d(!1),l({to:"/projects/$projectId",params:{projectId:O.id}})}catch(O){Z(O instanceof Error?O.message:"Failed to create project")}finally{V(!1)}}};return f.jsxs("div",{className:"page-container",children:[f.jsxs("div",{className:"page-header",children:[f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Projects"}),f.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),f.jsx("div",{className:"page-header-right",children:f.jsxs(qe,{type:"button",onClick:()=>d(O=>!O),children:[f.jsx(Xy,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?f.jsxs(jn,{className:"surface-card mb-6",children:[f.jsx("div",{className:"section-head",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),f.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),f.jsxs("div",{className:"compact-stack mt-4",children:[f.jsxs("div",{className:"setup-field-row",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),f.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:h,onChange:O=>g(O.target.value)}),X&&X!==h?f.jsxs("p",{className:"supporting-copy",children:["Slug: ",X]}):null]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),f.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:b,onChange:O=>S(O.target.value)})]})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),f.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:x,onChange:O=>N(O.target.value)})]}),f.jsxs("div",{className:"setup-field-row",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),f.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:_,onChange:O=>T(O.target.value.toUpperCase())})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),f.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:k,onChange:O=>E(O.target.value.toLowerCase())})]})]})]}),G?f.jsx("p",{className:"text-rose-400 text-sm mt-3",children:G}):null,f.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[f.jsx(qe,{type:"button",disabled:!X||!x||R,onClick:wn(F),children:R?"Creating...":"Create project"}),f.jsx(qe,{type:"button",variant:"ghost",onClick:()=>d(!1),children:"Cancel"})]})]}):null,r.length>0?f.jsx("div",{className:"data-table-wrapper",children:f.jsxs("table",{className:"data-table",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:"Name"}),f.jsx("th",{children:"Domain"}),f.jsx("th",{children:"Mentions"}),f.jsx("th",{children:"Last run"}),f.jsx("th",{className:"text-right",children:"Country"})]})}),f.jsx("tbody",{children:r.map(O=>{const M=O.recentRuns[0];return f.jsxs("tr",{className:"cursor-pointer",onClick:()=>{l({to:"/projects/$projectId",params:{projectId:O.project.id}})},children:[f.jsxs("td",{children:[f.jsx(rt,{to:"/projects/$projectId",params:{projectId:O.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:le=>le.stopPropagation(),children:O.project.displayName||O.project.name}),f.jsx("p",{className:"text-[11px] text-zinc-500",children:O.project.name})]}),f.jsx("td",{className:"text-zinc-400",children:O.project.canonicalDomain}),f.jsx("td",{children:f.jsx(Ln,{tone:O.mentionSummary.tone,children:O.mentionSummary.value})}),f.jsx("td",{className:"text-zinc-500 text-sm",children:M?f.jsx(Np,{status:M.status}):f.jsx("span",{className:"text-zinc-600",children:"No runs"})}),f.jsx("td",{className:"text-right text-zinc-500",children:O.project.country})]},O.project.id)})})]})}):c?null:f.jsxs(jn,{className:"surface-card empty-card",children:[f.jsx("h3",{children:"No projects yet"}),f.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),f.jsxs(qe,{type:"button",onClick:()=>d(!0),children:[f.jsx(Xy,{className:"size-4 mr-1.5"}),"Add project"]})]}),f.jsx(h5,{onApplied:()=>{i()}})]})}function c1(e){e.invalidateQueries({queryKey:Sp({client:se})}),e.invalidateQueries({queryKey:Js({client:se})})}function y5(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function b5(e,n){const i=e??"Project";return n==="gsc-sync"?`${i} will refresh after the sync completes.`:n==="inspect-sitemap"?`${i} will notify you when sitemap inspection finishes.`:`${i} will notify you when the run finishes.`}function Lc(e,n){J0({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:n.projectLabel,sourceAction:n.sourceAction,lastAnnouncedStatus:"queued"}),en({title:y5(e.kind),detail:b5(n.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function v5(e){const n=e.filter(l=>l.status!=="conflict"),i=e.filter(l=>l.status==="conflict");if(n.length===0){en({title:"No runs queued",detail:i.length>0?`${i.length} project${i.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 l of n)J0({id:l.id,projectId:l.projectId,kind:l.kind,projectLabel:l.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=LD({runIds:n.map(l=>l.id),queuedCount:n.length,skippedCount:i.length});en({title:"Run-all batch queued",detail:i.length>0?`${n.length} project${n.length===1?"":"s"} queued, ${i.length} skipped because a run is already active.`:`${n.length} project${n.length===1?"":"s"} queued.`,tone:i.length>0?"caution":"neutral",dedupeKey:`batch:${r}`,dedupeMode:"replace"})}function qc(e,n){if(e instanceof Hn&&e.code==="RUN_IN_PROGRESS"){en({title:"Run already in progress",detail:n?.projectLabel?`${n.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:${n?.projectKey??"project"}:${n?.sourceAction??"run"}`,dedupeMode:"replace"});return}en({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function S5(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>kk(n,i),onSuccess:(n,i)=>{c1(e),Lc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})},onError:(n,i)=>{qc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})}})}function x6(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:n=>Ek(n),onSuccess:n=>{c1(e),v5(n)},onError:n=>{en({title:n instanceof Error?n.message:"Failed to queue runs",tone:"negative"})}})}function w6(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>Ok(n,i),onSuccess:(n,i)=>{fo(e,Ne["gsc-sync"],i.projectName),Lc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})},onError:(n,i)=>{qc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})}})}function j6(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n})=>Mk(n),onSuccess:(n,i)=>{fo(e,n.run.kind,i.projectName),Lc(n.run,{projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})},onError:(n,i)=>{qc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})}})}function N6(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>Rk(n,i),onSuccess:(n,i)=>{fo(e,Ne["inspect-sitemap"],i.projectName),Lc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})},onError:(n,i)=>{qc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})}})}function u1(e){if(!Array.isArray(e.queryKey)||e.queryKey.length<=1)return!1;const n=e.queryKey[0];return n==="projects"||n==="project-dashboard-full"}function k6(){const e=Ja();return zi({mutationFn:({projectName:n,queries:i})=>wk(n,i),onSuccess:()=>{e.invalidateQueries({queryKey:Js({client:se})}),e.invalidateQueries({predicate:u1})}})}function A6(){const e=Ja();return zi({mutationFn:({projectName:n,body:i})=>jk(n,i),onSuccess:()=>{e.invalidateQueries({predicate:n=>Array.isArray(n.queryKey)&&typeof n.queryKey[0]=="object"&&n.queryKey[0]!==null&&"_id"in n.queryKey[0]&&typeof n.queryKey[0]._id=="string"&&n.queryKey[0]._id.startsWith("getApiV1ProjectsByName")}),e.invalidateQueries({predicate:u1})}})}const x5=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Queries",description:"Add queries to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function w5({current:e,labels:n}){return f.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:n.map((i,r)=>{const l=r<e,c=r===e;return f.jsxs("div",{className:`setup-step ${l?"setup-step-done":""} ${c?"setup-step-active":""}`,role:"listitem","aria-current":c?"step":void 0,children:[f.jsx("span",{className:"setup-step-number",children:l?"✓":r+1}),f.jsx("span",{className:"setup-step-label",children:i.label})]},i.label)})})}function j5(){const e=go(),{dashboard:n,isLoading:i,refetch:r}=Ac(),l=n??e?.dashboard;if(!l||i)return f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-24"}),f.jsx("div",{className:"skeleton-text-sm w-80"})]}),f.jsxs("div",{className:"page-skeleton-card",children:[f.jsx("div",{className:"skeleton-text w-32"}),f.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(ne=>f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"space-y-1 flex-1",children:[f.jsx("div",{className:"skeleton-text w-24"}),f.jsx("div",{className:"skeleton-text-sm w-48"})]}),f.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},ne))})]})]});const c=l.settings,g=Ap(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},b=ED(l.setup,g,c),S=hc(),[x,N]=U.useState(0),[_,T]=U.useState(""),[k,E]=U.useState(""),[R,V]=U.useState(""),[G,Z]=U.useState("US"),[X,F]=U.useState("en"),[O,M]=U.useState(!1),[le,ke]=U.useState(null),[_e,be]=U.useState(null),[tt,Ke]=U.useState(null),[ee,B]=U.useState(!1),[J,fe]=U.useState(""),[Se,re]=U.useState(!1),[Ze,W]=U.useState(null),[ue,te]=U.useState(!1),de=c.providerStatuses.filter(ne=>ne.state==="ready"),[ae,je]=U.useState(de[0]?.name??""),[nt,xe]=U.useState(5),[Ue,Ge]=U.useState(!1),[Et,zn]=U.useState(null),[Ot,nr]=U.useState(""),[Di,Uc]=U.useState(!1),[ar,Ri]=U.useState(null),[Mi,Bi]=U.useState(!1),[xo,$c]=U.useState(!1),[Ut,wo]=U.useState(!1),[ir,jo]=U.useState(null),Li=S5(),Ic=dn({...K0({client:se,path:{id:ir??""}}),enabled:!!ir,refetchInterval:({state:ne})=>{const Fe=ne.data?.status;return Fe==="completed"||Fe==="partial"||Fe==="failed"||Fe==="cancelled"?!1:2e3},refetchIntervalInBackground:!0}),[qi,No]=U.useState(""),[sr,va]=U.useState(!1),[$t,Tn]=U.useState(null),ht=_.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),$n=J.split(`
202
+ queries: []`,value:n,onChange:S=>i(S.target.value)}),c.length>0&&f.jsx("ul",{className:"mt-2 space-y-1",children:c.map((S,x)=>f.jsx("li",{className:"text-emerald-400 text-sm",children:S},x))}),h.length>0&&f.jsx("ul",{className:"mt-2 space-y-1",children:h.map((S,x)=>f.jsx("li",{className:"text-rose-400 text-sm",children:S},x))}),f.jsx("div",{className:"mt-3",children:f.jsx(qe,{type:"button",disabled:!n.trim()||r,onClick:wn(v),children:r?"Applying...":"Apply"})})]})}function wB(){const{dashboard:e,isLoading:n,refetch:i}=Ac();if(!e||n)return f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-28"}),f.jsx("div",{className:"skeleton-text-sm w-40"})]}),f.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[f.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Mentions","Last run","Country"].map(O=>f.jsx("div",{className:"skeleton-text-sm w-16"},O))}),[1,2,3].map(O=>f.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[f.jsxs("div",{className:"flex-1 space-y-1",children:[f.jsx("div",{className:"skeleton-text w-28"}),f.jsx("div",{className:"skeleton-text-sm w-16"})]}),f.jsx("div",{className:"skeleton-text w-24"}),f.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),f.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),f.jsx("div",{className:"skeleton-text-sm w-8"})]},O))]})]});const r=e.projects,l=hc(),[c,d]=U.useState(!1),[h,g]=U.useState(""),[v,S]=U.useState(""),[x,N]=U.useState(""),[_,T]=U.useState("US"),[k,E]=U.useState("en"),[R,V]=U.useState(!1),[G,Z]=U.useState(null),X=h.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),F=async()=>{if(!(!X||!x)){V(!0),Z(null);try{const O=await ho(X,{displayName:v||h,canonicalDomain:x,country:_,language:k});en({title:"Project created",detail:`${O.displayName||O.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${O.name}`,dedupeMode:"drop"}),i(),g(""),S(""),N(""),T("US"),E("en"),d(!1),l({to:"/projects/$projectId",params:{projectId:O.id}})}catch(O){Z(O instanceof Error?O.message:"Failed to create project")}finally{V(!1)}}};return f.jsxs("div",{className:"page-container",children:[f.jsxs("div",{className:"page-header",children:[f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Projects"}),f.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),f.jsx("div",{className:"page-header-right",children:f.jsxs(qe,{type:"button",onClick:()=>d(O=>!O),children:[f.jsx(Jy,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?f.jsxs(jn,{className:"surface-card mb-6",children:[f.jsx("div",{className:"section-head",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),f.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),f.jsxs("div",{className:"compact-stack mt-4",children:[f.jsxs("div",{className:"setup-field-row",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),f.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:h,onChange:O=>g(O.target.value)}),X&&X!==h?f.jsxs("p",{className:"supporting-copy",children:["Slug: ",X]}):null]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),f.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:v,onChange:O=>S(O.target.value)})]})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),f.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:x,onChange:O=>N(O.target.value)})]}),f.jsxs("div",{className:"setup-field-row",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),f.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:_,onChange:O=>T(O.target.value.toUpperCase())})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),f.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:k,onChange:O=>E(O.target.value.toLowerCase())})]})]})]}),G?f.jsx("p",{className:"text-rose-400 text-sm mt-3",children:G}):null,f.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[f.jsx(qe,{type:"button",disabled:!X||!x||R,onClick:wn(F),children:R?"Creating...":"Create project"}),f.jsx(qe,{type:"button",variant:"ghost",onClick:()=>d(!1),children:"Cancel"})]})]}):null,r.length>0?f.jsx("div",{className:"data-table-wrapper",children:f.jsxs("table",{className:"data-table",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:"Name"}),f.jsx("th",{children:"Domain"}),f.jsx("th",{children:"Mentions"}),f.jsx("th",{children:"Last run"}),f.jsx("th",{className:"text-right",children:"Country"})]})}),f.jsx("tbody",{children:r.map(O=>{const M=O.recentRuns[0];return f.jsxs("tr",{className:"cursor-pointer",onClick:()=>{l({to:"/projects/$projectId",params:{projectId:O.project.id}})},children:[f.jsxs("td",{children:[f.jsx(rt,{to:"/projects/$projectId",params:{projectId:O.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:le=>le.stopPropagation(),children:O.project.displayName||O.project.name}),f.jsx("p",{className:"text-[11px] text-zinc-500",children:O.project.name})]}),f.jsx("td",{className:"text-zinc-400",children:O.project.canonicalDomain}),f.jsx("td",{children:f.jsx(Ln,{tone:O.mentionSummary.tone,children:O.mentionSummary.value})}),f.jsx("td",{className:"text-zinc-500 text-sm",children:M?f.jsx(kp,{status:M.status}):f.jsx("span",{className:"text-zinc-600",children:"No runs"})}),f.jsx("td",{className:"text-right text-zinc-500",children:O.project.country})]},O.project.id)})})]})}):c?null:f.jsxs(jn,{className:"surface-card empty-card",children:[f.jsx("h3",{children:"No projects yet"}),f.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),f.jsxs(qe,{type:"button",onClick:()=>d(!0),children:[f.jsx(Jy,{className:"size-4 mr-1.5"}),"Add project"]})]}),f.jsx(xB,{onApplied:()=>{i()}})]})}function c1(e){e.invalidateQueries({queryKey:xp({client:se})}),e.invalidateQueries({queryKey:Js({client:se})})}function jB(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function NB(e,n){const i=e??"Project";return n==="gsc-sync"?`${i} will refresh after the sync completes.`:n==="inspect-sitemap"?`${i} will notify you when sitemap inspection finishes.`:`${i} will notify you when the run finishes.`}function Lc(e,n){J0({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:n.projectLabel,sourceAction:n.sourceAction,lastAnnouncedStatus:"queued"}),en({title:jB(e.kind),detail:NB(n.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function kB(e){const n=e.filter(l=>l.status!=="conflict"),i=e.filter(l=>l.status==="conflict");if(n.length===0){en({title:"No runs queued",detail:i.length>0?`${i.length} project${i.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 l of n)J0({id:l.id,projectId:l.projectId,kind:l.kind,projectLabel:l.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=PD({runIds:n.map(l=>l.id),queuedCount:n.length,skippedCount:i.length});en({title:"Run-all batch queued",detail:i.length>0?`${n.length} project${n.length===1?"":"s"} queued, ${i.length} skipped because a run is already active.`:`${n.length} project${n.length===1?"":"s"} queued.`,tone:i.length>0?"caution":"neutral",dedupeKey:`batch:${r}`,dedupeMode:"replace"})}function qc(e,n){if(e instanceof Hn&&e.code==="RUN_IN_PROGRESS"){en({title:"Run already in progress",detail:n?.projectLabel?`${n.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:${n?.projectKey??"project"}:${n?.sourceAction??"run"}`,dedupeMode:"replace"});return}en({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function AB(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>_k(n,i),onSuccess:(n,i)=>{c1(e),Lc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})},onError:(n,i)=>{qc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})}})}function z6(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:n=>Dk(n),onSuccess:n=>{c1(e),kB(n)},onError:n=>{en({title:n instanceof Error?n.message:"Failed to queue runs",tone:"negative"})}})}function T6(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>Rk(n,i),onSuccess:(n,i)=>{fo(e,Ne["gsc-sync"],i.projectName),Lc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})},onError:(n,i)=>{qc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})}})}function E6(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n})=>Lk(n),onSuccess:(n,i)=>{fo(e,n.run.kind,i.projectName),Lc(n.run,{projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})},onError:(n,i)=>{qc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})}})}function O6(){const e=Ja();return zi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>Bk(n,i),onSuccess:(n,i)=>{fo(e,Ne["inspect-sitemap"],i.projectName),Lc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})},onError:(n,i)=>{qc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})}})}function u1(e){if(!Array.isArray(e.queryKey)||e.queryKey.length<=1)return!1;const n=e.queryKey[0];return n==="projects"||n==="project-dashboard-full"}function D6(){const e=Ja();return zi({mutationFn:({projectName:n,queries:i})=>Nk(n,i),onSuccess:()=>{e.invalidateQueries({queryKey:Js({client:se})}),e.invalidateQueries({predicate:u1})}})}function R6(){const e=Ja();return zi({mutationFn:({projectName:n,body:i})=>kk(n,i),onSuccess:()=>{e.invalidateQueries({predicate:n=>Array.isArray(n.queryKey)&&typeof n.queryKey[0]=="object"&&n.queryKey[0]!==null&&"_id"in n.queryKey[0]&&typeof n.queryKey[0]._id=="string"&&n.queryKey[0]._id.startsWith("getApiV1ProjectsByName")}),e.invalidateQueries({predicate:u1})}})}const _B=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Queries",description:"Add queries to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function CB({current:e,labels:n}){return f.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:n.map((i,r)=>{const l=r<e,c=r===e;return f.jsxs("div",{className:`setup-step ${l?"setup-step-done":""} ${c?"setup-step-active":""}`,role:"listitem","aria-current":c?"step":void 0,children:[f.jsx("span",{className:"setup-step-number",children:l?"✓":r+1}),f.jsx("span",{className:"setup-step-label",children:i.label})]},i.label)})})}function zB(){const e=go(),{dashboard:n,isLoading:i,refetch:r}=Ac(),l=n??e?.dashboard;if(!l||i)return f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-24"}),f.jsx("div",{className:"skeleton-text-sm w-80"})]}),f.jsxs("div",{className:"page-skeleton-card",children:[f.jsx("div",{className:"skeleton-text w-32"}),f.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(ne=>f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"space-y-1 flex-1",children:[f.jsx("div",{className:"skeleton-text w-24"}),f.jsx("div",{className:"skeleton-text-sm w-48"})]}),f.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},ne))})]})]});const c=l.settings,g=_p(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},v=LD(l.setup,g,c),S=hc(),[x,N]=U.useState(0),[_,T]=U.useState(""),[k,E]=U.useState(""),[R,V]=U.useState(""),[G,Z]=U.useState("US"),[X,F]=U.useState("en"),[O,M]=U.useState(!1),[le,ke]=U.useState(null),[Ce,be]=U.useState(null),[tt,Ke]=U.useState(null),[ee,B]=U.useState(!1),[J,fe]=U.useState(""),[Se,re]=U.useState(!1),[Ze,W]=U.useState(null),[ue,te]=U.useState(!1),de=c.providerStatuses.filter(ne=>ne.state==="ready"),[ae,je]=U.useState(de[0]?.name??""),[nt,xe]=U.useState(5),[Ue,Ge]=U.useState(!1),[Et,zn]=U.useState(null),[Ot,nr]=U.useState(""),[Di,Uc]=U.useState(!1),[ar,Ri]=U.useState(null),[Mi,Bi]=U.useState(!1),[xo,$c]=U.useState(!1),[Ut,wo]=U.useState(!1),[ir,jo]=U.useState(null),Li=AB(),Ic=dn({...K0({client:se,path:{id:ir??""}}),enabled:!!ir,refetchInterval:({state:ne})=>{const Fe=ne.data?.status;return Fe==="completed"||Fe==="partial"||Fe==="failed"||Fe==="cancelled"?!1:2e3},refetchIntervalInBackground:!0}),[qi,No]=U.useState(""),[sr,va]=U.useState(!1),[$t,Tn]=U.useState(null),ht=_.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),$n=J.split(`
203
203
  `).map(ne=>ne.trim()).filter(Boolean),ti=Ot.split(`
204
- `).map(ne=>ne.trim()).filter(Boolean),Vc=b.healthChecks.some(ne=>ne.id==="api"&&ne.state==="ready"),Ui=async()=>{if(!(!ht||!R)){B(!0),Ke(null);try{const ne=await ho(ht,{displayName:k||_,canonicalDomain:R,country:G,language:X,autoExtractBacklinks:O});ke(ht),be(ne.id),en({title:"Project created",detail:`${ne.displayName||ne.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${ne.name}`,dedupeMode:"drop"}),await r(),N(2)}catch(ne){Ke(ne instanceof Error?ne.message:"Failed to create project")}finally{B(!1)}}},$i=async()=>{if(!le)return;const ne=$n;if(ne.length!==0){te(!0),W(null);try{await xk(le,ne),re(!0),await r(),N(3)}catch(Fe){W(Fe instanceof Error?Fe.message:"Failed to save queries")}finally{te(!1)}}},Ii=async()=>{if(!(!le||!ae)){Ge(!0),zn(null);try{const ne=await zk(le,ae,nt);if(ne.queries.length>0){const Fe=J?J.trimEnd()+`
204
+ `).map(ne=>ne.trim()).filter(Boolean),Vc=v.healthChecks.some(ne=>ne.id==="api"&&ne.state==="ready"),Ui=async()=>{if(!(!ht||!R)){B(!0),Ke(null);try{const ne=await ho(ht,{displayName:k||_,canonicalDomain:R,country:G,language:X,autoExtractBacklinks:O});ke(ht),be(ne.id),en({title:"Project created",detail:`${ne.displayName||ne.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${ne.name}`,dedupeMode:"drop"}),await r(),N(2)}catch(ne){Ke(ne instanceof Error?ne.message:"Failed to create project")}finally{B(!1)}}},$i=async()=>{if(!le)return;const ne=$n;if(ne.length!==0){te(!0),W(null);try{await jk(le,ne),re(!0),await r(),N(3)}catch(Fe){W(Fe instanceof Error?Fe.message:"Failed to save queries")}finally{te(!1)}}},Ii=async()=>{if(!(!le||!ae)){Ge(!0),zn(null);try{const ne=await Ek(le,ae,nt);if(ne.queries.length>0){const Fe=J?J.trimEnd()+`
205
205
  `+ne.queries.join(`
206
206
  `):ne.queries.join(`
207
- `);fe(Fe)}}catch(ne){zn(ne instanceof Error?ne.message:"Failed to generate queries")}finally{Ge(!1)}}},Zn=async()=>{if(!le)return;const ne=ti;if(ne.length!==0){Bi(!0),Ri(null);try{await Nk(le,ne),Uc(!0),await r(),N(4)}catch(Fe){Ri(Fe instanceof Error?Fe.message:"Failed to save competitors")}finally{Bi(!1)}}},Vi=async()=>{const ne=qi.trim();if(ne){va(!0),Tn(null);try{await Ck("gemini",{apiKey:ne}),en({title:"Gemini configured",detail:"Provider is ready — continuing setup.",tone:"positive",dedupeKey:"setup:gemini:configured",dedupeMode:"drop"}),No(""),await r()}catch(Fe){Tn(Fe instanceof Error?Fe.message:"Failed to save Gemini key")}finally{va(!1)}}},ni=async()=>{if(le){wo(!0);try{const ne=await Li.mutateAsync({projectName:le,projectLabel:k||_||le,sourceAction:"setup-launch"});jo(ne.id),$c(!0),await r()}catch{}finally{wo(!1)}}},Yn=()=>N(ne=>Math.max(0,ne-1)),ko=(()=>{switch(x){case 0:return f.jsxs(jn,{className:"surface-card step-card",children:[f.jsx("div",{className:"section-head",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),f.jsx("h2",{children:"System ready"})]})}),f.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),f.jsx("div",{className:"compact-stack",children:b.healthChecks.map(ne=>f.jsxs("div",{className:"health-check-row",children:[f.jsxs("div",{children:[f.jsx("p",{className:"run-row-title",children:ne.label}),f.jsx("p",{className:"supporting-copy",children:ne.detail}),ne.id==="provider"&&ne.state!=="ready"&&f.jsxs("div",{className:"mt-3 rounded-md border border-zinc-800/60 bg-zinc-900/40 p-3 space-y-2",children:[f.jsxs("p",{className:"text-xs text-zinc-400",children:["Paste a Gemini key to enable visibility checks (free at"," ",f.jsx("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noreferrer",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"aistudio.google.com"}),")."]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{type:"password",value:qi,onChange:Fe=>No(Fe.target.value),placeholder:"AI... (paste here)",className:"flex-1 rounded-md border border-zinc-800 bg-zinc-950 px-2.5 py-1.5 text-sm text-zinc-100 placeholder:text-zinc-600 focus:border-zinc-600 focus:outline-none font-mono",disabled:sr}),f.jsx(qe,{type:"button",size:"sm",disabled:sr||!qi.trim(),onClick:wn(Vi),children:sr?"Saving...":"Save"})]}),$t&&f.jsx("p",{className:"text-xs text-rose-400",children:$t}),f.jsxs("p",{className:"text-[11px] text-zinc-600",children:["Other providers (OpenAI, Claude, Perplexity) configurable later via"," ",f.jsx(rt,{to:"/settings",className:"text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"/settings"}),"."]})]})]}),f.jsx(Ln,{tone:ne.state==="ready"?"positive":"caution",title:ne.id==="api"?Is(g.apiStatus):ne.id==="worker"?Is(g.workerStatus):ne.detail,children:ne.state==="ready"?"Ready":"Attention"})]},ne.id))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(qe,{type:"button",disabled:!Vc,onClick:()=>N(1),children:"Continue"})]})]});case 1:return f.jsxs(jn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),f.jsx("h2",{children:"Create project"})]}),le?f.jsx(Ln,{tone:"positive",children:"Created"}):null]}),le?f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"text-zinc-300",children:["Project ",f.jsx("span",{className:"text-zinc-100 font-medium",children:le})," created successfully."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(qe,{type:"button",variant:"outline",onClick:Yn,children:"Back"}),f.jsx(qe,{type:"button",onClick:()=>N(2),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),f.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:_,onChange:ne=>T(ne.target.value)}),ht&&ht!==_?f.jsxs("p",{className:"supporting-copy",children:["Slug: ",ht]}):null]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),f.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:k,onChange:ne=>E(ne.target.value)})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),f.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:R,onChange:ne=>V(ne.target.value)})]}),f.jsxs("div",{className:"setup-field-row",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),f.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:G,onChange:ne=>Z(ne.target.value.toUpperCase())})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),f.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:X,onChange:ne=>F(ne.target.value.toLowerCase())})]})]}),f.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 cursor-pointer hover:border-zinc-700",children:[f.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-zinc-700 bg-zinc-950",checked:O,onChange:ne=>M(ne.target.checked)}),f.jsxs("span",{className:"flex-1",children:[f.jsx("span",{className:"block text-sm text-zinc-100",children:"Auto-extract backlinks"}),f.jsxs("span",{className:"block text-xs text-zinc-500 mt-0.5",children:["When a new Common Crawl release syncs, automatically extract backlinks for this project."," ",f.jsx(rt,{to:"/backlinks",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"Manage backlinks"})]})]})]}),tt?f.jsx("p",{className:"text-rose-400 text-sm",children:tt}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(qe,{type:"button",variant:"outline",onClick:Yn,children:"Back"}),f.jsx(qe,{type:"button",disabled:!ht||!R||ee,onClick:wn(Ui),children:ee?"Creating...":"Create project"})]})]})]});case 2:return f.jsxs(jn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),f.jsx("h2",{children:"Add queries"})]}),Se?f.jsxs(Ln,{tone:"positive",children:[$n.length," saved"]}):f.jsxs(Ln,{tone:"neutral",children:[$n.length," quer",$n.length!==1?"ies":"y"]})]}),f.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),Se?f.jsxs("div",{className:"compact-stack",children:[f.jsx("ul",{className:"detail-list",children:$n.map(ne=>f.jsx("li",{children:ne},ne))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(qe,{type:"button",variant:"outline",onClick:Yn,children:"Back"}),f.jsx(qe,{type:"button",onClick:()=>N(3),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[de.length>0?f.jsxs("div",{className:"compact-stack",children:[f.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[f.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",f.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),f.jsxs("div",{className:"flex items-end gap-2",children:[f.jsxs("div",{className:"setup-field flex-1",children:[f.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),f.jsx("select",{id:"gen-provider",className:"setup-input",value:ae,onChange:ne=>je(ne.target.value),children:de.map(ne=>f.jsxs("option",{value:ne.name,children:[ne.displayName??ne.name,ne.model?` (${ne.model})`:""]},ne.name))})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),f.jsx("select",{id:"gen-count",className:"setup-input",value:nt,onChange:ne=>xe(Number(ne.target.value)),children:[3,5,10,15,20].map(ne=>f.jsx("option",{value:ne,children:ne},ne))})]}),f.jsx(qe,{type:"button",variant:"outline",disabled:Ue||!ae,onClick:wn(Ii),children:Ue?"Analyzing site...":"Generate"})]}),Et?f.jsx("p",{className:"text-rose-400 text-sm",children:Et}):null]}):null,f.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[f.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",f.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"queries",children:"Queries (one per line)"}),f.jsx("textarea",{id:"queries",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
207
+ `);fe(Fe)}}catch(ne){zn(ne instanceof Error?ne.message:"Failed to generate queries")}finally{Ge(!1)}}},Zn=async()=>{if(!le)return;const ne=ti;if(ne.length!==0){Bi(!0),Ri(null);try{await Ak(le,ne),Uc(!0),await r(),N(4)}catch(Fe){Ri(Fe instanceof Error?Fe.message:"Failed to save competitors")}finally{Bi(!1)}}},Vi=async()=>{const ne=qi.trim();if(ne){va(!0),Tn(null);try{await Tk("gemini",{apiKey:ne}),en({title:"Gemini configured",detail:"Provider is ready — continuing setup.",tone:"positive",dedupeKey:"setup:gemini:configured",dedupeMode:"drop"}),No(""),await r()}catch(Fe){Tn(Fe instanceof Error?Fe.message:"Failed to save Gemini key")}finally{va(!1)}}},ni=async()=>{if(le){wo(!0);try{const ne=await Li.mutateAsync({projectName:le,projectLabel:k||_||le,sourceAction:"setup-launch"});jo(ne.id),$c(!0),await r()}catch{}finally{wo(!1)}}},Yn=()=>N(ne=>Math.max(0,ne-1)),ko=(()=>{switch(x){case 0:return f.jsxs(jn,{className:"surface-card step-card",children:[f.jsx("div",{className:"section-head",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),f.jsx("h2",{children:"System ready"})]})}),f.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),f.jsx("div",{className:"compact-stack",children:v.healthChecks.map(ne=>f.jsxs("div",{className:"health-check-row",children:[f.jsxs("div",{children:[f.jsx("p",{className:"run-row-title",children:ne.label}),f.jsx("p",{className:"supporting-copy",children:ne.detail}),ne.id==="provider"&&ne.state!=="ready"&&f.jsxs("div",{className:"mt-3 rounded-md border border-zinc-800/60 bg-zinc-900/40 p-3 space-y-2",children:[f.jsxs("p",{className:"text-xs text-zinc-400",children:["Paste a Gemini key to enable visibility checks (free at"," ",f.jsx("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noreferrer",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"aistudio.google.com"}),")."]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{type:"password",value:qi,onChange:Fe=>No(Fe.target.value),placeholder:"AI... (paste here)",className:"flex-1 rounded-md border border-zinc-800 bg-zinc-950 px-2.5 py-1.5 text-sm text-zinc-100 placeholder:text-zinc-600 focus:border-zinc-600 focus:outline-none font-mono",disabled:sr}),f.jsx(qe,{type:"button",size:"sm",disabled:sr||!qi.trim(),onClick:wn(Vi),children:sr?"Saving...":"Save"})]}),$t&&f.jsx("p",{className:"text-xs text-rose-400",children:$t}),f.jsxs("p",{className:"text-[11px] text-zinc-600",children:["Other providers (OpenAI, Claude, Perplexity) configurable later via"," ",f.jsx(rt,{to:"/settings",className:"text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"/settings"}),"."]})]})]}),f.jsx(Ln,{tone:ne.state==="ready"?"positive":"caution",title:ne.id==="api"?Is(g.apiStatus):ne.id==="worker"?Is(g.workerStatus):ne.detail,children:ne.state==="ready"?"Ready":"Attention"})]},ne.id))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(qe,{type:"button",disabled:!Vc,onClick:()=>N(1),children:"Continue"})]})]});case 1:return f.jsxs(jn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),f.jsx("h2",{children:"Create project"})]}),le?f.jsx(Ln,{tone:"positive",children:"Created"}):null]}),le?f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"text-zinc-300",children:["Project ",f.jsx("span",{className:"text-zinc-100 font-medium",children:le})," created successfully."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(qe,{type:"button",variant:"outline",onClick:Yn,children:"Back"}),f.jsx(qe,{type:"button",onClick:()=>N(2),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),f.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:_,onChange:ne=>T(ne.target.value)}),ht&&ht!==_?f.jsxs("p",{className:"supporting-copy",children:["Slug: ",ht]}):null]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),f.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:k,onChange:ne=>E(ne.target.value)})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),f.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:R,onChange:ne=>V(ne.target.value)})]}),f.jsxs("div",{className:"setup-field-row",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),f.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:G,onChange:ne=>Z(ne.target.value.toUpperCase())})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),f.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:X,onChange:ne=>F(ne.target.value.toLowerCase())})]})]}),f.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 cursor-pointer hover:border-zinc-700",children:[f.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-zinc-700 bg-zinc-950",checked:O,onChange:ne=>M(ne.target.checked)}),f.jsxs("span",{className:"flex-1",children:[f.jsx("span",{className:"block text-sm text-zinc-100",children:"Auto-extract backlinks"}),f.jsxs("span",{className:"block text-xs text-zinc-500 mt-0.5",children:["When a new Common Crawl release syncs, automatically extract backlinks for this project."," ",f.jsx(rt,{to:"/backlinks",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"Manage backlinks"})]})]})]}),tt?f.jsx("p",{className:"text-rose-400 text-sm",children:tt}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(qe,{type:"button",variant:"outline",onClick:Yn,children:"Back"}),f.jsx(qe,{type:"button",disabled:!ht||!R||ee,onClick:wn(Ui),children:ee?"Creating...":"Create project"})]})]})]});case 2:return f.jsxs(jn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),f.jsx("h2",{children:"Add queries"})]}),Se?f.jsxs(Ln,{tone:"positive",children:[$n.length," saved"]}):f.jsxs(Ln,{tone:"neutral",children:[$n.length," quer",$n.length!==1?"ies":"y"]})]}),f.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),Se?f.jsxs("div",{className:"compact-stack",children:[f.jsx("ul",{className:"detail-list",children:$n.map(ne=>f.jsx("li",{children:ne},ne))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(qe,{type:"button",variant:"outline",onClick:Yn,children:"Back"}),f.jsx(qe,{type:"button",onClick:()=>N(3),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[de.length>0?f.jsxs("div",{className:"compact-stack",children:[f.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[f.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",f.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),f.jsxs("div",{className:"flex items-end gap-2",children:[f.jsxs("div",{className:"setup-field flex-1",children:[f.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),f.jsx("select",{id:"gen-provider",className:"setup-input",value:ae,onChange:ne=>je(ne.target.value),children:de.map(ne=>f.jsxs("option",{value:ne.name,children:[ne.displayName??ne.name,ne.model?` (${ne.model})`:""]},ne.name))})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),f.jsx("select",{id:"gen-count",className:"setup-input",value:nt,onChange:ne=>xe(Number(ne.target.value)),children:[3,5,10,15,20].map(ne=>f.jsx("option",{value:ne,children:ne},ne))})]}),f.jsx(qe,{type:"button",variant:"outline",disabled:Ue||!ae,onClick:wn(Ii),children:Ue?"Analyzing site...":"Generate"})]}),Et?f.jsx("p",{className:"text-rose-400 text-sm",children:Et}):null]}):null,f.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[f.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",f.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"queries",children:"Queries (one per line)"}),f.jsx("textarea",{id:"queries",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
208
208
  best invisalign downtown brooklyn
209
209
  pediatric dentist brooklyn heights`,value:J,onChange:ne=>fe(ne.target.value)})]}),Ze?f.jsx("p",{className:"text-rose-400 text-sm",children:Ze}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(qe,{type:"button",variant:"outline",onClick:Yn,children:"Back"}),f.jsx(qe,{type:"button",disabled:$n.length===0||ue,onClick:wn($i),children:ue?"Saving...":`Save ${$n.length} quer${$n.length!==1?"ies":"y"}`})]})]})]});case 3:return f.jsxs(jn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),f.jsx("h2",{children:"Add competitors"})]}),Di?f.jsx(Ln,{tone:"positive",children:"Saved"}):null]}),f.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),Di?f.jsxs("div",{className:"compact-stack",children:[f.jsx("ul",{className:"detail-list",children:ti.map(ne=>f.jsx("li",{children:ne},ne))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(qe,{type:"button",variant:"outline",onClick:Yn,children:"Back"}),f.jsx(qe,{type:"button",onClick:()=>N(4),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),f.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
210
- competitor2.com`,value:Ot,onChange:ne=>nr(ne.target.value)})]}),ar?f.jsx("p",{className:"text-rose-400 text-sm",children:ar}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(qe,{type:"button",variant:"outline",onClick:Yn,children:"Back"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(qe,{type:"button",variant:"outline",onClick:()=>N(4),children:"Skip"}),f.jsx(qe,{type:"button",disabled:ti.length===0||Mi,onClick:wn(Zn),children:Mi?"Saving...":`Save ${ti.length} competitor${ti.length!==1?"s":""}`})]})]})]})]});case 4:{const ne=Ic.data,Fe=ne?.status==="completed"||ne?.status==="partial"||ne?.status==="failed"||ne?.status==="cancelled",ai=ne?.snapshots??[],Ao=ai.filter(En=>En.citationState==="cited").length,_o=ai.filter(En=>En.answerMentioned===!0).length,rr=new Set(ai.map(En=>En.query).filter(En=>!!En)).size,or=xo?Fe&&(ne?.status==="completed"||ne?.status==="partial")?f.jsx(Ln,{tone:"positive",children:"Complete"}):Fe?f.jsx(Ln,{tone:"negative",children:"Failed"}):f.jsx(Ln,{tone:"caution",children:"Running"}):null;return f.jsxs(jn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),f.jsx("h2",{children:"Launch first run"})]}),or]}),xo?Fe?ne?.status==="failed"?f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-rose-400",children:"Sweep failed. Inspect the run on the project page for the provider error and retry from there."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(qe,{type:"button",onClick:()=>{S({to:_e?`/projects/${_e}`:"/"})},children:"Open project"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"text-zinc-300",children:["Sweep complete. Your first answer-visibility snapshot for"," ",f.jsx("span",{className:"text-zinc-100 font-medium",children:le}),":"]}),f.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Mentioned"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[_o,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",rr]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with brand in answer"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Cited"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[Ao,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",rr]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with domain in sources"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Snapshots"}),f.jsx("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:ai.length}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"total (query × provider)"})]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-1",children:"Full evidence, per-provider breakdown, and suggested next queries on the project dashboard."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(qe,{type:"button",onClick:()=>{S({to:_e?`/projects/${_e}`:"/"})},children:"Open project dashboard →"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-zinc-300",children:"Sweep running — typically 30-60s. Polling every 2s…"}),f.jsx("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 text-xs text-zinc-500",children:f.jsxs("p",{children:["Status: ",f.jsx("span",{className:"text-zinc-300",children:ne?.status??"queued"})]})}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(qe,{type:"button",variant:"outline",onClick:()=>{S({to:_e?`/projects/${_e}`:"/"})},children:"Watch on project page"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",f.jsx("span",{className:"text-zinc-100 font-medium",children:le}),"."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(qe,{type:"button",variant:"outline",onClick:Yn,children:"Back"}),f.jsx(qe,{type:"button",disabled:Ut,onClick:wn(ni),children:Ut?"Launching...":"Launch visibility sweep"})]})]})]})}default:return null}})();return f.jsxs("div",{className:"page-container",children:[f.jsx("div",{className:"page-header",children:f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Setup"}),f.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),f.jsx(w5,{current:x,labels:x5}),f.jsx("section",{className:"setup-wizard",children:ko})]})}function N5(){return f.jsx("div",{className:"page-container",children:f.jsx("section",{className:"page-section",children:f.jsxs(jn,{className:"surface-card empty-card",children:[f.jsx("h1",{children:"Route not found"}),f.jsx("p",{children:"The current path does not map to a dashboard view."}),f.jsx(qe,{asChild:!0,children:f.jsx(rt,{to:"/",children:"Return to overview"})})]})})})}const ba=Gs(()=>Hs(()=>import("./ProjectPage-BPLf4U3A.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),"ProjectPage"),k5=Gs(()=>Hs(()=>import("./RunsPage-D6eM_5tB.js"),__vite__mapDeps([9,1,2,7,5,8]),import.meta.url),"RunsPage"),A5=Gs(()=>Hs(()=>import("./SettingsPage-DaMc8nxK.js"),__vite__mapDeps([10,1,7,5,8]),import.meta.url),"SettingsPage"),_5=Gs(()=>Hs(()=>import("./BacklinksPage-D3JpcWtH.js"),__vite__mapDeps([11,1,6,7,5,8]),import.meta.url),"BacklinksPage"),C5=Gs(()=>Hs(()=>import("./TrafficPage-Dw16dcSc.js"),__vite__mapDeps([12,1,4,13,7,5,8]),import.meta.url),"TrafficPage"),z5=Gs(()=>Hs(()=>import("./TrafficSourceDetailPage-Dy9D80dz.js"),__vite__mapDeps([14,1,4,3,5,13,7,8]),import.meta.url),"TrafficSourceDetailPage");function T5(){return f.jsx(tM,{children:f.jsx(eM,{})})}const tn=Ew()({component:T5,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),E5=Ct({getParentRoute:()=>tn,path:"/",component:iM,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Js({client:se}));if(n&&n.length===0)throw dv({to:"/setup"})}}),O5=Ct({getParentRoute:()=>tn,path:"/projects",component:g5}),Kn=Ct({getParentRoute:()=>tn,path:"/projects/$projectId",component:()=>f.jsx(bf,{})}),D5=Ct({getParentRoute:()=>Kn,path:"/",component:()=>f.jsx(ba,{tab:"overview"})}),R5=Ct({getParentRoute:()=>Kn,path:"/search-console",component:()=>f.jsx(ba,{tab:"search-console"})}),M5=Ct({getParentRoute:()=>Kn,path:"/local",component:()=>f.jsx(ba,{tab:"local"})}),B5=Ct({getParentRoute:()=>Kn,path:"/discovery",component:()=>f.jsx(ba,{tab:"discovery"})}),L5=Ct({getParentRoute:()=>Kn,path:"/report",component:()=>f.jsx(ba,{tab:"report"})}),q5=Ct({getParentRoute:()=>Kn,path:"/activity",component:()=>f.jsx(ba,{tab:"activity"})}),U5=Ct({getParentRoute:()=>Kn,path:"/backlinks",component:()=>f.jsx(ba,{tab:"backlinks"})}),$5=Ct({getParentRoute:()=>Kn,path:"/technical-aeo",component:()=>f.jsx(ba,{tab:"technical-aeo"})}),I5=Ct({getParentRoute:()=>Kn,path:"/settings",component:()=>f.jsx(ba,{tab:"settings"})}),V5=Ct({getParentRoute:()=>tn,path:"/runs",component:k5}),P5=Ct({getParentRoute:()=>tn,path:"/settings",component:A5,beforeLoad:({context:e})=>{}}),G5=Ct({getParentRoute:()=>tn,path:"/setup",component:j5,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Js({client:se}));if(n&&n.length>0)throw dv({to:"/"})}}),H5=Ct({getParentRoute:()=>tn,path:"/backlinks",component:_5}),Q5=Ct({getParentRoute:()=>tn,path:"/traffic",component:C5}),K5=Ct({getParentRoute:()=>tn,path:"/traffic/$projectName/$sourceId",component:z5}),Z5=Ct({getParentRoute:()=>tn,path:"*",component:N5}),Y5=tn.addChildren([E5,O5,Kn.addChildren([D5,R5,M5,B5,L5,q5,U5,$5,I5]),V5,P5,G5,H5,Q5,K5,Z5]);function X5(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const cv=X5(),J5=cv==="/"?"":cv.replace(/\/$/,"");function F5(e,n){return Ow({routeTree:Y5,basepath:J5||"/",context:{queryClient:e},...n?.initialEntries})}const W5=6e4;function eB(){const[e,n]=U.useState(nf()?"ready":"checking"),[i,r]=U.useState(""),[l,c]=U.useState(""),[d,h]=U.useState(null),[g,b]=U.useState(!1),[S,x]=U.useState(!1),N=U.useRef(null),_=U.useRef(null),T=()=>{if(!N.current){const R=Xk();_.current=R,N.current=F5(R)}return{queryClient:_.current,router:N.current}};U.useEffect(()=>{if(nf())return;let R=!1;return Hy().then(V=>{R||(V.authenticated?n("ready"):n(V.setupRequired?"setup":"login"))}).catch(V=>{R||(h(V instanceof Error?V.message:"Failed to reach the Canonry API"),n("login"))}),()=>{R=!0}},[]),U.useEffect(()=>{if(e!=="ready"||nf())return;const R=setInterval(()=>{Hy().then(V=>{V.authenticated||(x(!0),n(V.setupRequired?"setup":"login"))}).catch(()=>{})},W5);return Gy(()=>{x(!0),n("login")}),()=>{clearInterval(R),Gy(null)}},[e]);const k=async R=>{if(R.preventDefault(),!i.trim()||i.trim().length<8){h("Password must be at least 8 characters");return}if(i!==l){h("Passwords do not match");return}b(!0),h(null);try{if(!(await Ak(i.trim())).authenticated){h("Setup failed");return}r(""),c(""),x(!1),n("ready")}catch(V){h(V instanceof Hn||V instanceof Error?V.message:"Setup failed")}finally{b(!1)}},E=async R=>{if(R.preventDefault(),!!i.trim()){b(!0),h(null);try{if(!(await _k(i.trim())).authenticated){h("Incorrect password");return}r(""),x(!1),n("ready")}catch(V){h(V instanceof Hn||V instanceof Error?V.message:"Authentication failed")}finally{b(!1)}}};if(e==="ready"){const{queryClient:R,router:V}=T();return f.jsx(Dw,{client:R,children:f.jsx(Rw,{router:V})})}return f.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:f.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:f.jsx(jn,{className:"surface-card w-full",children:e==="checking"?f.jsx(Fl,{className:"py-8",children:f.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?f.jsxs(f.Fragment,{children:[f.jsxs(Df,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),f.jsx(Rf,{children:"Create a dashboard password"}),f.jsx(Mf,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),f.jsx(Fl,{children:f.jsxs("form",{className:"space-y-4",onSubmit:wn(k),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"At least 8 characters"})]}),f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),f.jsx("input",{className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:l,onChange:R=>c(R.target.value),placeholder:"Re-enter password"})]}),d?f.jsx("p",{className:"text-sm text-rose-400",children:d}):null,f.jsx(qe,{type:"submit",disabled:g||!i.trim()||!l.trim(),children:g?"Setting up…":"Create password & open dashboard"})]})})]}):f.jsxs(f.Fragment,{children:[f.jsxs(Df,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),f.jsx(Rf,{children:"Sign in to Canonry"}),f.jsx(Mf,{children:"Enter your dashboard password to continue."})]}),f.jsxs(Fl,{children:[S?f.jsx("p",{className:"mb-4 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-300",children:"Your session expired — please sign in again."}):null,f.jsxs("form",{className:"space-y-4",onSubmit:wn(E),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"Dashboard password"})]}),d?f.jsx("p",{className:"text-sm text-rose-400",children:d}):null,f.jsx(qe,{type:"submit",disabled:g||!i.trim(),children:g?"Signing in…":"Open dashboard"})]})]})]})})})})}const d1=document.getElementById("root");if(!d1)throw new Error("Expected #root element for web app bootstrap.");Iw.createRoot(d1).render(f.jsx(U.StrictMode,{children:f.jsx(eB,{})}));export{YL as $,TL as A,qe as B,lc as C,gB as D,ML as E,LL as F,hL as G,qL as H,to as I,AB as J,kB as K,CB as L,en as M,LB as N,IL as O,M3 as P,VL as Q,TB as R,D4 as S,Ln as T,UL as U,$L as V,BL as W,_B as X,EB as Y,PL as Z,GL as _,b6 as a,vB as a$,KL as a0,ZL as a1,qk as a2,J0 as a3,Ne as a4,QL as a5,BD as a6,_i as a7,HL as a8,lE as a9,RB as aA,Sp as aB,h6 as aC,y6 as aD,g6 as aE,OB as aF,fA as aG,Mv as aH,jD as aI,kD as aJ,ND as aK,r6 as aL,HB as aM,A6 as aN,xL as aO,vL as aP,wL as aQ,jL as aR,bL as aS,SL as aT,pB as aU,fB as aV,dB as aW,bB as aX,DL as aY,Cb as aZ,OL as a_,cE as aa,yL as ab,gL as ac,dL as ad,nL as ae,lL as af,cL as ag,Hn as ah,uL as ai,sB as aj,_A as ak,CL as al,kA as am,MA as an,UD as ao,nc as ap,pL as aq,fL as ar,jf as as,o6 as at,zB as au,f6 as av,p6 as aw,m6 as ax,DB as ay,Js as az,Yf as b,Xy as b$,SB as b0,EL as b1,xB as b2,wB as b3,NB as b4,jB as b5,go as b6,vp as b7,wR as b8,S5 as b9,$B as bA,PB as bB,Ac as bC,x6 as bD,Np as bE,Ck as bF,yB as bG,MB as bH,BB as bI,Ap as bJ,GB as bK,Is as bL,zb as bM,eL as bN,aL as bO,sL as bP,rL as bQ,tL as bR,iL as bS,oL as bT,B3 as bU,hS as bV,I3 as bW,gS as bX,yS as bY,xA as bZ,WB as b_,Ht as ba,Sk as bb,mB as bc,lB as bd,cB as be,hB as bf,S6 as bg,vk as bh,Nk as bi,oB as bj,rB as bk,wk as bl,uB as bm,k6 as bn,H4 as bo,XL as bp,FL as bq,Ok as br,WL as bs,VB as bt,IB as bu,e6 as bv,JL as bw,_L as bx,qB as by,UB as bz,et as c,u6 as c0,NL as c1,kL as c2,bp as c3,RL as c4,Qs as c5,l6 as c6,d6 as c7,FB as c8,XB as c9,JB as ca,YB as cb,c6 as cc,qT as d,v6 as e,zL as f,jn as g,$b as h,wn as i,mL as j,t6 as k,se as l,n6 as m,a6 as n,s6 as o,i6 as p,QB as q,ZB as r,KB as s,M4 as t,_p as u,w6 as v,j6 as w,N6 as x,Of as y,AL as z};
210
+ competitor2.com`,value:Ot,onChange:ne=>nr(ne.target.value)})]}),ar?f.jsx("p",{className:"text-rose-400 text-sm",children:ar}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(qe,{type:"button",variant:"outline",onClick:Yn,children:"Back"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(qe,{type:"button",variant:"outline",onClick:()=>N(4),children:"Skip"}),f.jsx(qe,{type:"button",disabled:ti.length===0||Mi,onClick:wn(Zn),children:Mi?"Saving...":`Save ${ti.length} competitor${ti.length!==1?"s":""}`})]})]})]})]});case 4:{const ne=Ic.data,Fe=ne?.status==="completed"||ne?.status==="partial"||ne?.status==="failed"||ne?.status==="cancelled",ai=ne?.snapshots??[],Ao=ai.filter(En=>En.citationState==="cited").length,_o=ai.filter(En=>En.answerMentioned===!0).length,rr=new Set(ai.map(En=>En.query).filter(En=>!!En)).size,or=xo?Fe&&(ne?.status==="completed"||ne?.status==="partial")?f.jsx(Ln,{tone:"positive",children:"Complete"}):Fe?f.jsx(Ln,{tone:"negative",children:"Failed"}):f.jsx(Ln,{tone:"caution",children:"Running"}):null;return f.jsxs(jn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),f.jsx("h2",{children:"Launch first run"})]}),or]}),xo?Fe?ne?.status==="failed"?f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-rose-400",children:"Sweep failed. Inspect the run on the project page for the provider error and retry from there."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(qe,{type:"button",onClick:()=>{S({to:Ce?`/projects/${Ce}`:"/"})},children:"Open project"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"text-zinc-300",children:["Sweep complete. Your first answer-visibility snapshot for"," ",f.jsx("span",{className:"text-zinc-100 font-medium",children:le}),":"]}),f.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Mentioned"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[_o,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",rr]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with brand in answer"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Cited"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[Ao,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",rr]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with domain in sources"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Snapshots"}),f.jsx("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:ai.length}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"total (query × provider)"})]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-1",children:"Full evidence, per-provider breakdown, and suggested next queries on the project dashboard."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(qe,{type:"button",onClick:()=>{S({to:Ce?`/projects/${Ce}`:"/"})},children:"Open project dashboard →"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-zinc-300",children:"Sweep running — typically 30-60s. Polling every 2s…"}),f.jsx("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 text-xs text-zinc-500",children:f.jsxs("p",{children:["Status: ",f.jsx("span",{className:"text-zinc-300",children:ne?.status??"queued"})]})}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(qe,{type:"button",variant:"outline",onClick:()=>{S({to:Ce?`/projects/${Ce}`:"/"})},children:"Watch on project page"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",f.jsx("span",{className:"text-zinc-100 font-medium",children:le}),"."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(qe,{type:"button",variant:"outline",onClick:Yn,children:"Back"}),f.jsx(qe,{type:"button",disabled:Ut,onClick:wn(ni),children:Ut?"Launching...":"Launch visibility sweep"})]})]})]})}default:return null}})();return f.jsxs("div",{className:"page-container",children:[f.jsx("div",{className:"page-header",children:f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Setup"}),f.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),f.jsx(CB,{current:x,labels:_B}),f.jsx("section",{className:"setup-wizard",children:ko})]})}function TB(){return f.jsx("div",{className:"page-container",children:f.jsx("section",{className:"page-section",children:f.jsxs(jn,{className:"surface-card empty-card",children:[f.jsx("h1",{children:"Route not found"}),f.jsx("p",{children:"The current path does not map to a dashboard view."}),f.jsx(qe,{asChild:!0,children:f.jsx(rt,{to:"/",children:"Return to overview"})})]})})})}const ba=Gs(()=>Hs(()=>import("./ProjectPage-BQYmq7FP.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),"ProjectPage"),EB=Gs(()=>Hs(()=>import("./RunsPage-DfBb4WCS.js"),__vite__mapDeps([9,1,2,7,5,8]),import.meta.url),"RunsPage"),OB=Gs(()=>Hs(()=>import("./SettingsPage-CRGuFgeK.js"),__vite__mapDeps([10,1,7,5,8]),import.meta.url),"SettingsPage"),DB=Gs(()=>Hs(()=>import("./BacklinksPage-nkgAbbjk.js"),__vite__mapDeps([11,1,6,7,5,8]),import.meta.url),"BacklinksPage"),RB=Gs(()=>Hs(()=>import("./TrafficPage-CMqP0AGZ.js"),__vite__mapDeps([12,1,4,13,7,5,8]),import.meta.url),"TrafficPage"),MB=Gs(()=>Hs(()=>import("./TrafficSourceDetailPage-XRGzkKWk.js"),__vite__mapDeps([14,1,4,3,5,13,7,8]),import.meta.url),"TrafficSourceDetailPage");function BB(){return f.jsx(oM,{children:f.jsx(rM,{})})}const tn=Ew()({component:BB,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),LB=Ct({getParentRoute:()=>tn,path:"/",component:uM,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Js({client:se}));if(n&&n.length===0)throw fv({to:"/setup"})}}),qB=Ct({getParentRoute:()=>tn,path:"/projects",component:wB}),Kn=Ct({getParentRoute:()=>tn,path:"/projects/$projectId",component:()=>f.jsx(bf,{})}),UB=Ct({getParentRoute:()=>Kn,path:"/",component:()=>f.jsx(ba,{tab:"overview"})}),$B=Ct({getParentRoute:()=>Kn,path:"/search-console",component:()=>f.jsx(ba,{tab:"search-console"})}),IB=Ct({getParentRoute:()=>Kn,path:"/local",component:()=>f.jsx(ba,{tab:"local"})}),VB=Ct({getParentRoute:()=>Kn,path:"/discovery",component:()=>f.jsx(ba,{tab:"discovery"})}),PB=Ct({getParentRoute:()=>Kn,path:"/report",component:()=>f.jsx(ba,{tab:"report"})}),GB=Ct({getParentRoute:()=>Kn,path:"/activity",component:()=>f.jsx(ba,{tab:"activity"})}),HB=Ct({getParentRoute:()=>Kn,path:"/backlinks",component:()=>f.jsx(ba,{tab:"backlinks"})}),QB=Ct({getParentRoute:()=>Kn,path:"/technical-aeo",component:()=>f.jsx(ba,{tab:"technical-aeo"})}),KB=Ct({getParentRoute:()=>Kn,path:"/settings",component:()=>f.jsx(ba,{tab:"settings"})}),ZB=Ct({getParentRoute:()=>tn,path:"/runs",component:EB}),YB=Ct({getParentRoute:()=>tn,path:"/settings",component:OB,beforeLoad:({context:e})=>{}}),XB=Ct({getParentRoute:()=>tn,path:"/setup",component:zB,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Js({client:se}));if(n&&n.length>0)throw fv({to:"/"})}}),JB=Ct({getParentRoute:()=>tn,path:"/backlinks",component:DB}),FB=Ct({getParentRoute:()=>tn,path:"/traffic",component:RB}),WB=Ct({getParentRoute:()=>tn,path:"/traffic/$projectName/$sourceId",component:MB}),e5=Ct({getParentRoute:()=>tn,path:"*",component:TB}),t5=tn.addChildren([LB,qB,Kn.addChildren([UB,$B,IB,VB,PB,GB,HB,QB,KB]),ZB,YB,XB,JB,FB,WB,e5]);function n5(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const uv=n5(),a5=uv==="/"?"":uv.replace(/\/$/,"");function i5(e,n){return Ow({routeTree:t5,basepath:a5||"/",context:{queryClient:e},...n?.initialEntries})}const s5=6e4;function r5(){const[e,n]=U.useState(nf()?"ready":"checking"),[i,r]=U.useState(""),[l,c]=U.useState(""),[d,h]=U.useState(null),[g,v]=U.useState(!1),[S,x]=U.useState(!1),N=U.useRef(null),_=U.useRef(null),T=()=>{if(!N.current){const R=Fk();_.current=R,N.current=i5(R)}return{queryClient:_.current,router:N.current}};U.useEffect(()=>{if(nf())return;let R=!1;return Qy().then(V=>{R||(V.authenticated?n("ready"):n(V.setupRequired?"setup":"login"))}).catch(V=>{R||(h(V instanceof Error?V.message:"Failed to reach the Canonry API"),n("login"))}),()=>{R=!0}},[]),U.useEffect(()=>{if(e!=="ready"||nf())return;const R=setInterval(()=>{Qy().then(V=>{V.authenticated||(x(!0),n(V.setupRequired?"setup":"login"))}).catch(()=>{})},s5);return Hy(()=>{x(!0),n("login")}),()=>{clearInterval(R),Hy(null)}},[e]);const k=async R=>{if(R.preventDefault(),!i.trim()||i.trim().length<8){h("Password must be at least 8 characters");return}if(i!==l){h("Passwords do not match");return}v(!0),h(null);try{if(!(await Ck(i.trim())).authenticated){h("Setup failed");return}r(""),c(""),x(!1),n("ready")}catch(V){h(V instanceof Hn||V instanceof Error?V.message:"Setup failed")}finally{v(!1)}},E=async R=>{if(R.preventDefault(),!!i.trim()){v(!0),h(null);try{if(!(await zk(i.trim())).authenticated){h("Incorrect password");return}r(""),x(!1),n("ready")}catch(V){h(V instanceof Hn||V instanceof Error?V.message:"Authentication failed")}finally{v(!1)}}};if(e==="ready"){const{queryClient:R,router:V}=T();return f.jsx(Dw,{client:R,children:f.jsx(Rw,{router:V})})}return f.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:f.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:f.jsx(jn,{className:"surface-card w-full",children:e==="checking"?f.jsx(Fl,{className:"py-8",children:f.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?f.jsxs(f.Fragment,{children:[f.jsxs(Df,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),f.jsx(Rf,{children:"Create a dashboard password"}),f.jsx(Mf,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),f.jsx(Fl,{children:f.jsxs("form",{className:"space-y-4",onSubmit:wn(k),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"At least 8 characters"})]}),f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),f.jsx("input",{className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:l,onChange:R=>c(R.target.value),placeholder:"Re-enter password"})]}),d?f.jsx("p",{className:"text-sm text-rose-400",children:d}):null,f.jsx(qe,{type:"submit",disabled:g||!i.trim()||!l.trim(),children:g?"Setting up…":"Create password & open dashboard"})]})})]}):f.jsxs(f.Fragment,{children:[f.jsxs(Df,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),f.jsx(Rf,{children:"Sign in to Canonry"}),f.jsx(Mf,{children:"Enter your dashboard password to continue."})]}),f.jsxs(Fl,{children:[S?f.jsx("p",{className:"mb-4 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-300",children:"Your session expired — please sign in again."}):null,f.jsxs("form",{className:"space-y-4",onSubmit:wn(E),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"Dashboard password"})]}),d?f.jsx("p",{className:"text-sm text-rose-400",children:d}):null,f.jsx(qe,{type:"submit",disabled:g||!i.trim(),children:g?"Signing in…":"Open dashboard"})]})]})]})})})})}const d1=document.getElementById("root");if(!d1)throw new Error("Expected #root element for web app bootstrap.");Iw.createRoot(d1).render(f.jsx(U.StrictMode,{children:f.jsx(r5,{})}));export{a6 as $,BL as A,qe as B,lc as C,w5 as D,IL as E,PL as F,xL as G,GL as H,to as I,O5 as J,E5 as K,R5 as L,en as M,P5 as N,KL as O,I3 as P,ZL as Q,B5 as R,L4 as S,Ln as T,HL as U,QL as V,VL as W,D5 as X,L5 as Y,YL as Z,XL as _,A6 as a,zb as a$,WL as a0,t6 as a1,e6 as a2,n6 as a3,$k as a4,J0 as a5,Ne as a6,FL as a7,VD as a8,_i as a9,U5 as aA,Js as aB,$5 as aC,xp as aD,j6 as aE,k6 as aF,N6 as aG,q5 as aH,mA as aI,Bv as aJ,zD as aK,ED as aL,TD as aM,m6 as aN,J5 as aO,R6 as aP,_L as aQ,kL as aR,CL as aS,zL as aT,NL as aU,AL as aV,v5 as aW,b5 as aX,y5 as aY,N5 as aZ,UL as a_,JL as aa,fE as ab,pE as ac,jL as ad,wL as ae,yL as af,lL as ag,mL as ah,hL as ai,Hn as aj,gL as ak,d5 as al,zA as am,RL as an,_A as ao,LA as ap,HD as aq,nc as ar,vL as as,bL as at,jf as au,h6 as av,M5 as aw,S6 as ax,x6 as ay,w6 as az,Yf as b,jA as b$,qL as b0,k5 as b1,A5 as b2,LL as b3,_5 as b4,C5 as b5,T5 as b6,z5 as b7,go as b8,Sp as b9,G5 as bA,H5 as bB,Q5 as bC,Y5 as bD,Ac as bE,z6 as bF,kp as bG,Tk as bH,j5 as bI,I5 as bJ,V5 as bK,_p as bL,X5 as bM,Is as bN,Tb as bO,rL as bP,cL as bQ,dL as bR,fL as bS,oL as bT,uL as bU,pL as bV,V3 as bW,hS as bX,K3 as bY,gS as bZ,yS as b_,CR as ba,AB as bb,Ht as bc,wk as bd,S5 as be,m5 as bf,h5 as bg,x5 as bh,C6 as bi,xk as bj,Ak as bk,p5 as bl,f5 as bm,Nk as bn,g5 as bo,D6 as bp,Y4 as bq,i6 as br,r6 as bs,Rk as bt,o6 as bu,Z5 as bv,K5 as bw,l6 as bx,s6 as by,DL as bz,et as c,sL as c0,Jy as c1,b6 as c2,TL as c3,EL as c4,vp as c5,$L as c6,Qs as c7,g6 as c8,v6 as c9,iL as ca,nL as cb,aL as cc,tL as cd,y6 as ce,$T as d,_6 as e,ML as f,jn as g,Ib as h,wn as i,SL as j,c6 as k,se as l,u6 as m,d6 as n,p6 as o,f6 as p,F5 as q,eL as r,W5 as s,U4 as t,Cp as u,T6 as v,E6 as w,O6 as x,Of as y,OL as z};