@canonry/canonry 7.68.2 → 7.69.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 (122) hide show
  1. package/assets/assets/{AgentSetupPage-8oLO0OyH.js → AgentSetupPage-CKRlDQZp.js} +1 -1
  2. package/assets/assets/MeasurementPropertyPage-DWwuFP2S.js +4 -0
  3. package/assets/assets/ProjectPage-D7jNMDzn.js +9 -0
  4. package/assets/assets/{RunsPage-BAs6sABy.js → RunsPage-vVs_xnqi.js} +1 -1
  5. package/assets/assets/{SettingsPage-DcSDIWnl.js → SettingsPage-wY4KTSfr.js} +1 -1
  6. package/assets/assets/SiteHealthSection-DEwB7O4i.js +2 -0
  7. package/assets/assets/{TrafficPage-CxFJj1rx.js → TrafficPage-DDpApkaw.js} +4 -4
  8. package/assets/assets/{index-CqNwsqjm.css → index-CIGmRg9U.css} +1 -1
  9. package/assets/assets/index-DPFsoLdC.js +60 -0
  10. package/assets/assets/{react-sigma_core.esm.min-Cd5EDtIB.js → react-sigma_core.esm.min-D2CArzQ5.js} +1 -1
  11. package/assets/assets/{service-CREaLXip.js → service-D57MOMmG.js} +1 -1
  12. package/assets/index.html +2 -2
  13. package/dist/{ads-4NQ5BO2A.js → ads-UTME46NF.js} +3 -3
  14. package/dist/{agent-SR7IUYLK.js → agent-PYDTNLR4.js} +7 -7
  15. package/dist/{agent-ask-F3T4GB33.js → agent-ask-NA4QFFM6.js} +3 -3
  16. package/dist/{agent-conversations-D54I2N5I.js → agent-conversations-3S56EX4U.js} +3 -3
  17. package/dist/{agent-memory-BWUJGV3E.js → agent-memory-D2RT5TVJ.js} +3 -3
  18. package/dist/{agent-providers-WNKOKIZY.js → agent-providers-5C2DRUR3.js} +3 -3
  19. package/dist/{agent-transcript-GM22FSJK.js → agent-transcript-SY5BZPO3.js} +3 -3
  20. package/dist/{analytics-RLLQBQOK.js → analytics-GUENANBB.js} +3 -3
  21. package/dist/{apply-RGJKLQKC.js → apply-R5K6RGEH.js} +3 -3
  22. package/dist/{backfill-GRVBAKFQ.js → backfill-B2EXGQCW.js} +9 -9
  23. package/dist/{backlinks-VE2JOWKE.js → backlinks-X55GUIQL.js} +3 -3
  24. package/dist/{bing-BUSRXSSR.js → bing-5NTEC247.js} +3 -3
  25. package/dist/{bootstrap-5KXIZP4O.js → bootstrap-UDEEVI4Z.js} +10 -10
  26. package/dist/{cdp-RR5HU43T.js → cdp-WWVZ6IBS.js} +7 -7
  27. package/dist/{chunk-4Q64QWKU.js → chunk-3LTLLHCD.js} +4 -4
  28. package/dist/{chunk-535S4WXN.js → chunk-3ZF3T3OG.js} +1 -1
  29. package/dist/{chunk-KXJDLN64.js → chunk-42JQQZZQ.js} +5 -5
  30. package/dist/{chunk-6R76X2XV.js → chunk-6JGQT4OH.js} +25 -2
  31. package/dist/{chunk-D33TZL7S.js → chunk-6RI7JFFI.js} +1 -1
  32. package/dist/{chunk-34GYS64G.js → chunk-7W4KNDAW.js} +2 -2
  33. package/dist/{chunk-CUR2SI66.js → chunk-BGTJTKOJ.js} +2 -2
  34. package/dist/{chunk-JZRCF3IX.js → chunk-BRT5GE3Z.js} +5 -5
  35. package/dist/{chunk-ROCSYWLF.js → chunk-CNSLBHFP.js} +1 -1
  36. package/dist/{chunk-TPZ6RLGX.js → chunk-CSDDKEL6.js} +1 -1
  37. package/dist/{chunk-LX5IQZHL.js → chunk-DW3KF33I.js} +4 -4
  38. package/dist/{chunk-35XANOXF.js → chunk-EIRIZPR6.js} +2 -2
  39. package/dist/{chunk-7PPEX3GD.js → chunk-G6VOLODK.js} +4 -4
  40. package/dist/{chunk-D4TXUHVA.js → chunk-JGO7LGVN.js} +60 -10
  41. package/dist/{chunk-MDJG5NPR.js → chunk-JNRMODJS.js} +1 -1
  42. package/dist/{chunk-YTYOUQQ7.js → chunk-JZ2A55L5.js} +31 -23
  43. package/dist/{chunk-FLCTZSLI.js → chunk-KDV5NQZH.js} +1 -1
  44. package/dist/{chunk-BVEACCUM.js → chunk-MBNXKKOD.js} +2 -2
  45. package/dist/{chunk-T742QYXD.js → chunk-NHF3OGZN.js} +3 -3
  46. package/dist/{chunk-UHDLVX3T.js → chunk-OQR4F7WF.js} +2 -2
  47. package/dist/{chunk-AGHKWDUB.js → chunk-PHHQVV3G.js} +3 -3
  48. package/dist/{chunk-4PDSDRB2.js → chunk-PJYXLC3D.js} +1 -1
  49. package/dist/{chunk-CQVK5RLO.js → chunk-QBR7BWO6.js} +8 -8
  50. package/dist/{chunk-4KVUUBKF.js → chunk-QNSMMQJY.js} +3 -3
  51. package/dist/{chunk-R5YKG2YP.js → chunk-R7RTWOOV.js} +1 -1
  52. package/dist/{chunk-4U3HIUCW.js → chunk-RJSJNR76.js} +3 -3
  53. package/dist/{chunk-XU7GZ544.js → chunk-RPYSCFFA.js} +1 -1
  54. package/dist/{chunk-2M27P4W5.js → chunk-RSK7E53V.js} +1 -1
  55. package/dist/{chunk-HF7ONR3Z.js → chunk-RVEXUQHP.js} +2 -2
  56. package/dist/{chunk-ON2RUGPD.js → chunk-SFMCFMJR.js} +1 -1
  57. package/dist/{chunk-VXBAMLKH.js → chunk-SSNKQTRX.js} +3 -3
  58. package/dist/{chunk-5TCY7FYS.js → chunk-ULUKHNE4.js} +1 -1
  59. package/dist/{chunk-JQGH3D7W.js → chunk-WZZIA3LD.js} +334 -334
  60. package/dist/{chunk-QZUEQP5G.js → chunk-XOCF2U54.js} +1 -1
  61. package/dist/{citations-IYQAT5QA.js → citations-ILU2CNT2.js} +3 -3
  62. package/dist/{cli-catalog-U5ZXWV7J.js → cli-catalog-ZBTUYNJA.js} +3 -3
  63. package/dist/{cli-commands-MMMD7K74.js → cli-commands-YXL7KV5B.js} +7 -7
  64. package/dist/cli.js +13 -13
  65. package/dist/{competitor-RRISAXMS.js → competitor-NXSL3AWD.js} +3 -3
  66. package/dist/{content-NBEVQ7CZ.js → content-TGWYXNBI.js} +3 -3
  67. package/dist/{dashboard-EMHIZOZ4.js → dashboard-IDCQTIYG.js} +6 -6
  68. package/dist/{demo-57LZOEH6.js → demo-6X6IDMPT.js} +1 -1
  69. package/dist/{demo-server-EGKJKILE.js → demo-server-HKJWIYPQ.js} +11 -11
  70. package/dist/{discover-L5EFJ6AD.js → discover-NW7NKL2Z.js} +3 -3
  71. package/dist/{discover-eval-6JJZLKRJ.js → discover-eval-2BVYL62I.js} +3 -3
  72. package/dist/{doctor-QBTFEURQ.js → doctor-6I3LPYM7.js} +3 -3
  73. package/dist/{evidence-I5MK557J.js → evidence-ZTAMPBEP.js} +3 -3
  74. package/dist/{export-cmd-36EZW5ZP.js → export-cmd-4CXUQVYT.js} +3 -3
  75. package/dist/{ga-7GUXDQ3L.js → ga-2YXMDGHQ.js} +3 -3
  76. package/dist/{gbp-W7YHYMB7.js → gbp-LTPPWTUR.js} +3 -3
  77. package/dist/{google-OXQFPJ76.js → google-KTUJ4D3T.js} +4 -4
  78. package/dist/{google-marketing-TKCACXPQ.js → google-marketing-FAKTAI5S.js} +1 -1
  79. package/dist/{health-cmd-PG3ST3S6.js → health-cmd-C75E3NPQ.js} +3 -3
  80. package/dist/{history-NWLOV4HF.js → history-HE734BPT.js} +3 -3
  81. package/dist/index.d.ts +71 -71
  82. package/dist/index.js +24 -24
  83. package/dist/{init-3I6WH2FY.js → init-QWTQCLAK.js} +11 -11
  84. package/dist/{insights-2XU6EXSV.js → insights-4GUVXY2V.js} +3 -3
  85. package/dist/intelligence-service-PAMFRLPE.js +15 -0
  86. package/dist/{journeys-LIZVLLV5.js → journeys-BZCKKFG7.js} +3 -3
  87. package/dist/{keys-M4WPOLHC.js → keys-CMN3FUDW.js} +3 -3
  88. package/dist/{keyword-TETX5PQP.js → keyword-QUM65R7C.js} +3 -3
  89. package/dist/{logs-BI4265UF.js → logs-HH7EP7YK.js} +3 -3
  90. package/dist/{mcp-RA6NUGQM.js → mcp-76T6WX4K.js} +2 -2
  91. package/dist/mcp.js +9 -9
  92. package/dist/{measurement-plan-LM5GXYNS.js → measurement-plan-2D2KQLTW.js} +5 -5
  93. package/dist/{notify-BFKYHACB.js → notify-VP5YYBJO.js} +3 -3
  94. package/dist/{organic-evidence-RUBPJCQ4.js → organic-evidence-EAUZJVET.js} +3 -3
  95. package/dist/{overview-6WOQ7K7F.js → overview-MCX3OHXK.js} +4 -4
  96. package/dist/{project-2DMAPH2U.js → project-HMELPKXT.js} +3 -3
  97. package/dist/{query-SAWKYRSY.js → query-J7UTKCY5.js} +3 -3
  98. package/dist/{research-J4J527SF.js → research-O4FYADRL.js} +3 -3
  99. package/dist/{results-export-SESXZCWZ.js → results-export-4JHIHSWW.js} +3 -3
  100. package/dist/{run-XTG3RSBA.js → run-YJ3Y7FIE.js} +4 -4
  101. package/dist/{schedule-WQUD7BAI.js → schedule-6SXEB245.js} +3 -3
  102. package/dist/{search-QNYEHVCA.js → search-MVL346VH.js} +3 -3
  103. package/dist/{serve-7SCK3TEE.js → serve-4E6LBEHL.js} +25 -25
  104. package/dist/{session-KB3HFDGB.js → session-KFFTQBJU.js} +12 -12
  105. package/dist/{settings-P5E7KIOV.js → settings-UKVP6TDD.js} +3 -3
  106. package/dist/{skills-YQDZ6EOW.js → skills-DF336KFJ.js} +2 -2
  107. package/dist/{snapshot-LMBEQKXR.js → snapshot-YKWGIRTM.js} +3 -3
  108. package/dist/{src-X4GNC6AB.js → src-WDWTA7ON.js} +2 -2
  109. package/dist/{status-4G7OU4RY.js → status-4PDQOFYS.js} +4 -4
  110. package/dist/{technical-aeo-TBCA6DF2.js → technical-aeo-XJRWNW24.js} +3 -3
  111. package/dist/{telemetry-JGUQ6S45.js → telemetry-TXB7NGPP.js} +4 -4
  112. package/dist/{tools-FB7DZH74.js → tools-5DBHZB4K.js} +11 -11
  113. package/dist/{traffic-U6MUCCBI.js → traffic-AP22ENAC.js} +5 -5
  114. package/dist/{users-P7BMJH2I.js → users-44XJB4ZN.js} +3 -3
  115. package/dist/{visibility-stats-3BJR34GR.js → visibility-stats-5DMILJO6.js} +3 -3
  116. package/dist/{wordpress-X5FQOR5K.js → wordpress-P6J44TMN.js} +3 -3
  117. package/package.json +1 -1
  118. package/assets/assets/MeasurementPropertyPage--nWpGvGH.js +0 -4
  119. package/assets/assets/ProjectPage-of9Q7JDS.js +0 -9
  120. package/assets/assets/SiteHealthSection-DS4icWI5.js +0 -2
  121. package/assets/assets/index-XtskVqLa.js +0 -60
  122. package/dist/intelligence-service-VUOMVRAD.js +0 -15
@@ -0,0 +1,60 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SiteHealthSection-DEwB7O4i.js","./rolldown-runtime-XKyaHtl9.js","./vendor-lucide-4KkDquAu.js","./vendor-markdown-9SSeLNHZ.js","./vendor-tanstack-pEsPGDvT.js","./vendor-recharts-qIim36Mt.js","./vendor-radix-BuErWiA2.js","./ToneBadge-B8lm5z8O.js","./account-context-VRNXJv_l.js","./query-client-DyFmy9AJ.js","./react-query-BcEtnzKt.js","./ChartPrimitives-CksxPvHn.js","./InfoTooltip-BbdxCAup.js","./card-CPDjkZ38.js","./ProjectPage-D7jNMDzn.js","./format-helpers-C2il_710.js","./async-handler-Bj3TnIRw.js","./Hint-C0TmIzHX.js","./AuditHistoryPanel-DXXGdrLo.js","./service-D57MOMmG.js","./extract-error-message-Ba5pz5dQ.js","./RunsPage-vVs_xnqi.js","./HistoryPage-DMU_b4kk.js","./SettingsPage-wY4KTSfr.js","./AgentSetupPage-CKRlDQZp.js","./BacklinksPage-CEJPc6fQ.js","./TrafficPage-DDpApkaw.js","./TrafficSourceDetailPage-C2pV1K3V.js","./MeasurementPropertyPage-DWwuFP2S.js"])))=>i.map(i=>d[i]);
2
+ import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{$ as n,A as r,D as i,F as a,G as o,I as s,J as c,K as l,M as u,N as d,O as f,P as p,Q as m,R as h,S as g,T as _,U as v,X as y,Z as b,_ as x,b as S,c as C,et as w,f as T,g as E,h as D,j as O,k as ee,l as te,n as k,o as A,p as ne,q as re,rt as ie,t as ae,w as oe,x as j,y as M,z as se}from"./vendor-lucide-4KkDquAu.js";import{a as ce,c as le,i as ue,n as de,o as fe,r as pe,s as me,t as he,u as ge}from"./vendor-radix-BuErWiA2.js";import{n as N,r as P,t as _e}from"./vendor-markdown-9SSeLNHZ.js";import{E as ve,T as ye,_ as F,a as be,b as I,c as xe,d as Se,f as Ce,h as we,i as Te,l as L,m as Ee,n as De,o as Oe,r as ke,s as Ae,u as R,x as je}from"./vendor-tanstack-pEsPGDvT.js";import{$ as Me,$t as Ne,Ai as Pe,An as Fe,Ar as Ie,Bi as Le,Bn as Re,Br as ze,Cn as Be,Ct as Ve,D as He,Di as Ue,Dt as We,E as Ge,Ei as Ke,En as qe,Fi as Je,Fn as Ye,Gi as Xe,Hi as Ze,In as Qe,J as $e,Jr as et,Jt as tt,K as nt,Kt as rt,Li as it,Ln as at,Mi as ot,Mn as st,Mr as ct,Nn as lt,Ot as ut,Pi as dt,Pn as ft,Q as pt,Qr as mt,Qt as ht,Ri as gt,Rn as _t,Sn as vt,St as yt,T as bt,Ti as xt,Tn as St,Tt as Ct,Ui as wt,Vi as Tt,Vr as Et,W as Dt,Wi as Ot,Wt as kt,X as At,Xt as jt,Y as Mt,Yt as Nt,Z as Pt,Zt as Ft,_n as It,a as Lt,at as Rt,bn as zt,bt as Bt,cn as Vt,d as Ht,di as z,dt as Ut,en as B,et as Wt,fi as V,ft as Gt,gn as Kt,i as qt,it as Jt,j as Yt,jn as Xt,jr as Zt,jt as Qt,kn as $t,kr as en,kt as tn,li as nn,mi as rn,n as an,nn as on,nt as sn,oi as cn,ot as ln,pi as un,pn as dn,pr as fn,pt as H,qt as pn,r as U,rn as mn,rr as hn,rt as gn,si as _n,sn as vn,st as yn,t as bn,tt as xn,u as Sn,ui as Cn,un as wn,v as Tn,vn as En,w as Dn,wi as On,wn as kn,wt as An,xn as jn,xt as Mn,yi as Nn,yn as Pn,ys as Fn,yt as In,z as Ln,zi as Rn,zn,zr as Bn,zt as Vn}from"./ToneBadge-B8lm5z8O.js";import{d as Hn,f as Un,l as Wn,s as Gn,u as Kn,v as qn,y as Jn}from"./format-helpers-C2il_710.js";import{n as Yn,r as Xn,t as Zn}from"./account-context-VRNXJv_l.js";import{t as Qn}from"./async-handler-Bj3TnIRw.js";import{a as $n,c as er,d as tr,f as nr,i as rr,l as ir,m as ar,o as or,p as sr,r as cr}from"./query-client-DyFmy9AJ.js";import{$t as lr,Qt as ur,Sn as dr,Xt as fr,Zt as pr,_t as mr,a as hr,ct as gr,en as _r,gt as vr,lt as yr,nn as br,ot as xr,r as Sr,rn as Cr,st as wr,tn as Tr}from"./react-query-BcEtnzKt.js";import{h as Er}from"./ChartPrimitives-CksxPvHn.js";import{t as Dr}from"./InfoTooltip-BbdxCAup.js";import{a as Or,i as kr,n as Ar,r as jr,t as Mr}from"./card-CPDjkZ38.js";import{t as Nr}from"./vendor-yaml-Y43rmNgW.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Pr=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&k(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&k(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=D,O=function(){te.postMessage(null)}}else O=function(){_(D,0)};function k(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,k(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Fr=t(((e,t)=>{t.exports=Pr()})),Ir=t((e=>{var t=Fr(),n=ie(),r=ge();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}function f(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&f(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function p(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function m(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function h(e){var t=[null,null],n=p(e);return n===null||g(t,e,n.child,{foundSelf:!1}),t}function g(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&g(e,t,n.child,r))return!0;n=n.sibling}return!1}function _(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var v=null,y=null;function b(e,t,n){return e===n||e===t&&(v=e,!0)}function x(e,t,n){return e===n?(y=e,!1):e===t&&(y!==null&&(v=e),!0)}function S(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function C(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var w=Object.assign,T=Symbol.for(`react.element`),E=Symbol.for(`react.transitional.element`),D=Symbol.for(`react.portal`),O=Symbol.for(`react.fragment`),ee=Symbol.for(`react.strict_mode`),te=Symbol.for(`react.profiler`),k=Symbol.for(`react.consumer`),A=Symbol.for(`react.context`),ne=Symbol.for(`react.forward_ref`),re=Symbol.for(`react.suspense`),ae=Symbol.for(`react.suspense_list`),oe=Symbol.for(`react.memo`),j=Symbol.for(`react.lazy`),M=Symbol.for(`react.activity`),se=Symbol.for(`react.legacy_hidden`),ce=Symbol.for(`react.memo_cache_sentinel`),le=Symbol.for(`react.view_transition`),ue=Symbol.for(`react.recoverable`),de=Symbol.iterator;function fe(e){return typeof e!=`object`||!e?null:(e=de&&e[de]||e[`@@iterator`],typeof e==`function`?e:null)}var pe=Symbol.for(`react.client.reference`);function me(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case O:return`Fragment`;case te:return`Profiler`;case ee:return`StrictMode`;case re:return`Suspense`;case ae:return`SuspenseList`;case M:return`Activity`;case le:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case D:return`Portal`;case A:return e.displayName||`Context`;case k:return(e._context.displayName||`Context`)+`.Consumer`;case ne:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case oe:return t=e.displayName||null,t===null?me(e.type)||`Memo`:t;case j:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}var he=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e={pending:!1,data:null,method:null,action:null},ve=[],ye=-1;function F(e){return{current:e}}function be(e){0>ye||(e.current=ve[ye],ve[ye]=null,ye--)}function I(e,t){ye++,ve[ye]=e.current,e.current=t}var xe=F(null),Se=F(null),Ce=F(null),we=F(null);function Te(e,t){switch(I(Ce,t),I(Se,e),I(xe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}be(xe),I(xe,e)}function L(){be(xe),be(Se),be(Ce)}function Ee(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,I(we,e)),t=xe.current;var n=dp(t,e.type);t!==n&&(I(Se,e),I(xe,n))}function De(e){Se.current===e&&(be(xe),be(Se)),we.current===e&&(be(we),sh._currentValue=_e)}var Oe,ke;function Ae(e){if(Oe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Oe=t&&t[1]||``,ke=-1<e.stack.indexOf(`
3
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
+ `+Oe+e+ke}var R=!1;function je(e,t){if(!e||R)return``;R=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
+ `),l=s.split(`
6
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{R=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ae(n):``}function Me(e,t){switch(e.tag){case 26:case 27:case 5:return Ae(e.type);case 16:return Ae(`Lazy`);case 13:return e.child!==t&&t!==null?Ae(`Suspense Fallback`):Ae(`Suspense`);case 19:return Ae(`SuspenseList`);case 0:case 15:return je(e.type,!1);case 11:return je(e.type.render,!1);case 1:return je(e.type,!0);case 31:return Ae(`Activity`);case 30:return Ae(`ViewTransition`);default:return``}}function Ne(e){try{var t=``,n=null;do t+=Me(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
+ Error generating stack: `+e.message+`
9
+ `+e.stack}}var Pe=Object.prototype.hasOwnProperty,Fe=t.unstable_scheduleCallback,Ie=t.unstable_cancelCallback,Le=t.unstable_shouldYield,Re=t.unstable_requestPaint,ze=t.unstable_now,Be=t.unstable_getCurrentPriorityLevel,Ve=t.unstable_ImmediatePriority,He=t.unstable_UserBlockingPriority,Ue=t.unstable_NormalPriority,We=t.unstable_LowPriority,Ge=t.unstable_IdlePriority,Ke=t.log,qe=t.unstable_setDisableYieldValue,Je=null,Ye=null;function Xe(e){if(typeof Ke==`function`&&qe(e),Ye&&typeof Ye.setStrictMode==`function`)try{Ye.setStrictMode(Je,e)}catch{}}var Ze=Math.clz32?Math.clz32:et,Qe=Math.log,$e=Math.LN2;function et(e){return e>>>=0,e===0?32:31-(Qe(e)/$e|0)|0}var tt=256,nt=262144,rt=4194304;function it(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function at(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=it(n))):i=it(o):i=it(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=it(n))):i=it(o)):i=it(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ot(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function st(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Ze(n),i=1<<r;t|=e[r],n&=~i}return t}function ct(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function lt(){var e=rt;return rt<<=1,!(rt&62914560)&&(rt=4194304),e}function ut(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function dt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ft(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ze(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&pt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function pt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ze(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function mt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ze(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ht(e,t){var n=t&-t;return n=n&42?1:gt(n),(n&(e.suspendedLanes|t))===0?n:0}function gt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function _t(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function vt(){var e=P.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function yt(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var bt=Math.random().toString(36).slice(2),xt=`__reactFiber$`+bt,St=`__reactProps$`+bt,Ct=`__reactContainer$`+bt,wt=`__reactEvents$`+bt,Tt=`__reactListeners$`+bt,Et=`__reactHandles$`+bt,Dt=`__reactResources$`+bt,Ot=`__reactMarker$`+bt,kt=`__reactLoad$`+bt;function At(e){delete e[xt],delete e[St],delete e[Tt],delete e[Et]}function jt(e){var t;if(t=e[xt])return t;for(var n=e.parentNode;n;){if(t=n[Ct]||n[xt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[xt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Mt(e){if(e=e[xt]||e[Ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Nt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Pt(e){var t=e[Dt];return t||=e[Dt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ft(e){e[Ot]=!0}function It(e){e[kt]=void 0}var Lt=new Set,Rt={};function zt(e,t){Bt(e,t),Bt(e+`Capture`,t)}function Bt(e,t){for(Rt[e]=t,e=0;e<t.length;e++)Lt.add(t[e])}var Vt=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]*$`),Ht={},z={};function Ut(e){return Pe.call(z,e)?!0:Pe.call(Ht,e)?!1:Vt.test(e)?z[e]=!0:(Ht[e]=!0,!1)}var B=!1;function Wt(){var e=B;return B=!1,e}function V(e,t,n){if(Ut(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Gt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Kt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function qt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Yt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Xt(e){if(!e._valueTracker){var t=Jt(e)?`checked`:`value`;e._valueTracker=Yt(e,t,``+e[t])}}function Zt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Jt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Qt=/[\n"\\]/g;function $t(e){return e.replace(Qt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function en(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+qt(t)):e.value!==``+qt(t)&&(e.value=``+qt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):nn(e,qt(n)):o===`number`&&e.value==t?nn(e,qt(e.value)):nn(e,qt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+qt(s):e.removeAttribute(`name`)}function tn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Xt(e);return}n=n==null?``:``+qt(n),t=t==null?n:``+qt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Xt(e)}function nn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function rn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+qt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function an(e,t,n){t!=null&&(t=``+qt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+qt(n)}function on(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(he(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=qt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Xt(e)}function sn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var cn=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 ln(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||cn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function un(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,B=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(ln(e,a,r),B=!0)}else for(var o in t)t.hasOwnProperty(o)&&ln(e,o,t[o])}function dn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var fn=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`],[`maskType`,`mask-type`],[`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`]]),H=/^[\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 pn(e){return H.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function U(){}var mn=null;function hn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gn=null,_n=null;function vn(e){var t=Mt(e);if(t&&(e=t.stateNode)){var n=e[St]||null;a:switch(e=t.stateNode,t.type){case`input`:if(en(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+$t(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[St]||null;if(!a)throw Error(i(90));en(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Zt(r)}break a;case`textarea`:an(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&rn(e,!!n.multiple,t,!1)}}}var yn=!1;function bn(e,t,n){if(yn)return e(t,n);yn=!0;try{return e(t)}finally{if(yn=!1,(gn!==null||_n!==null)&&(Rd(),gn&&(t=gn,e=_n,_n=gn=null,vn(t),e)))for(t=0;t<e.length;t++)vn(e[t])}}function xn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[St]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Sn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Cn=!1;if(Sn)try{var wn={};Object.defineProperty(wn,"passive",{get:function(){Cn=!0}}),window.addEventListener(`test`,wn,wn),window.removeEventListener(`test`,wn,wn)}catch{Cn=!1}var Tn=null,En=null,Dn=null;function On(){if(Dn)return Dn;var e,t=En,n=t.length,r,i=`value`in Tn?Tn.value:Tn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Dn=i.slice(e,1<r?1-r:void 0)}function kn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function An(){return!0}function jn(){return!1}function Mn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?An:jn,this.isPropagationStopped=jn,this}return w(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=An)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=An)},persist:function(){},isPersistent:An}),t}var Nn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pn=Mn(Nn),Fn=w({},Nn,{view:0,detail:0}),In=Mn(Fn),Ln,Rn,zn,Bn=w({},Fn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==zn&&(zn&&e.type===`mousemove`?(Ln=e.screenX-zn.screenX,Rn=e.screenY-zn.screenY):Rn=Ln=0,zn=e),Ln)},movementY:function(e){return`movementY`in e?e.movementY:Rn}}),Vn=Mn(Bn),Hn=Mn(w({},Bn,{dataTransfer:0})),Un=Mn(w({},Fn,{relatedTarget:0})),Wn=Mn(w({},Nn,{animationName:0,elapsedTime:0,pseudoElement:0})),Gn=Mn(w({},Nn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Kn=Mn(w({},Nn,{data:0})),qn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Jn={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`},Yn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Xn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yn[e])?!!t[e]:!1}function Zn(){return Xn}var Qn=Mn(w({},Fn,{key:function(e){if(e.key){var t=qn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=kn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zn,charCode:function(e){return e.type===`keypress`?kn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?kn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),$n=Mn(w({},Bn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),er=Mn(w({},Nn,{submitter:0})),tr=Mn(w({},Fn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zn})),nr=Mn(w({},Nn,{propertyName:0,elapsedTime:0,pseudoElement:0})),rr=Mn(w({},Bn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),ir=Mn(w({},Nn,{newState:0,oldState:0,source:0})),ar=[9,13,27,32],or=Sn&&`CompositionEvent`in window,sr=null;Sn&&`documentMode`in document&&(sr=document.documentMode);var cr=Sn&&`TextEvent`in window&&!sr,lr=Sn&&(!or||sr&&8<sr&&11>=sr),ur=` `,dr=!1;function fr(e,t){switch(e){case`keyup`:return ar.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function pr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var mr=!1;function hr(e,t){switch(e){case`compositionend`:return pr(t);case`keypress`:return t.which===32?(dr=!0,ur):null;case`textInput`:return e=t.data,e===ur&&dr?null:e;default:return null}}function gr(e,t){if(mr)return e===`compositionend`||!or&&fr(e,t)?(e=On(),Dn=En=Tn=null,mr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return lr&&t.locale!==`ko`?null:t.data;default:return null}}var _r={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 vr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!_r[e.type]:t===`textarea`}function yr(e,t,n,r){gn?_n?_n.push(r):_n=[r]:gn=r,t=Jf(t,`onChange`),0<t.length&&(n=new Pn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var br=null,xr=null;function Sr(e){Vf(e,0)}function Cr(e){if(Zt(Nt(e)))return e}function wr(e,t){if(e===`change`)return t}var Tr=!1;if(Sn){var Er;if(Sn){var Dr=`oninput`in document;if(!Dr){var Or=document.createElement(`div`);Or.setAttribute(`oninput`,`return;`),Dr=typeof Or.oninput==`function`}Er=Dr}else Er=!1;Tr=Er&&(!document.documentMode||9<document.documentMode)}function kr(){br&&(br.detachEvent(`onpropertychange`,Ar),xr=br=null)}function Ar(e){if(e.propertyName===`value`&&Cr(xr)){var t=[];yr(t,xr,e,hn(e)),bn(Sr,t)}}function jr(e,t,n){e===`focusin`?(kr(),br=t,xr=n,br.attachEvent(`onpropertychange`,Ar)):e===`focusout`&&kr()}function Mr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Cr(xr)}function Nr(e,t){if(e===`click`)return Cr(t)}function Pr(e,t){if(e===`input`||e===`change`)return Cr(t)}function Ir(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Lr=typeof Object.is==`function`?Object.is:Ir;function W(e,t){if(Lr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Pe.call(t,i)||!Lr(e[i],t[i]))return!1}return!0}function Rr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function zr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Br(e,t){var n=zr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=zr(n)}}function Vr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rr(e.document)}return t}function G(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ur=Sn&&`documentMode`in document&&11>=document.documentMode,Wr=null,Gr=null,Kr=null,qr=!1;function Jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qr||Wr==null||Wr!==Rr(r)||(r=Wr,`selectionStart`in r&&G(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Kr&&W(Kr,r)||(Kr=r,r=Jf(Gr,`onSelect`),0<r.length&&(t=new Pn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Wr)))}function Yr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Xr={animationend:Yr(`Animation`,`AnimationEnd`),animationiteration:Yr(`Animation`,`AnimationIteration`),animationstart:Yr(`Animation`,`AnimationStart`),transitionrun:Yr(`Transition`,`TransitionRun`),transitionstart:Yr(`Transition`,`TransitionStart`),transitioncancel:Yr(`Transition`,`TransitionCancel`),transitionend:Yr(`Transition`,`TransitionEnd`)},Zr={},Qr={};Sn&&(Qr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Xr.animationend.animation,delete Xr.animationiteration.animation,delete Xr.animationstart.animation),`TransitionEvent`in window||delete Xr.transitionend.transition);function $r(e){if(Zr[e])return Zr[e];if(!Xr[e])return e;var t=Xr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Qr)return Zr[e]=t[n];return e}var ei=$r(`animationend`),ti=$r(`animationiteration`),ni=$r(`animationstart`),ri=$r(`transitionrun`),ii=$r(`transitionstart`),ai=$r(`transitioncancel`),oi=$r(`transitionend`),si=new Map,ci=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);ci.push(`scrollEnd`);function li(e,t){si.set(e,t),zt(t,[e])}var ui=0;function di(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=yd.identifierPrefix;var n=ui++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function fi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Dd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function pi(e,t){return e=fi(e),t=fi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var mi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},hi=[],gi=0,_i=0;function vi(){for(var e=gi,t=_i=gi=0;t<e;){var n=hi[t];hi[t++]=null;var r=hi[t];hi[t++]=null;var i=hi[t];hi[t++]=null;var a=hi[t];if(hi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Si(n,i,a)}}function yi(e,t,n,r){hi[gi++]=e,hi[gi++]=t,hi[gi++]=n,hi[gi++]=r,_i|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function bi(e,t,n,r){return yi(e,t,n,r),Ci(e)}function xi(e,t){return yi(e,null,null,t),Ci(e)}function Si(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ze(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ci(e){if(50<Od)throw Od=0,kd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var wi={};function Ti(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ei(e,t,n,r){return new Ti(e,t,n,r)}function Di(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Oi(e,t){var n=e.alternate;return n===null?(n=Ei(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ki(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ai(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Di(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,xe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case M:return e=Ei(31,n,t,a),e.elementType=M,e.lanes=o,e;case O:return ji(n.children,a,o,t);case ee:s=8,a|=24;break;case te:return e=Ei(12,n,t,a|2),e.elementType=te,e.lanes=o,e;case re:return e=Ei(13,n,t,a),e.elementType=re,e.lanes=o,e;case ae:return e=Ei(19,n,t,a),e.elementType=ae,e.lanes=o,e;case se:case le:return e=a|32,e=Ei(30,n,t,e),e.elementType=le,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case A:s=10;break a;case k:s=9;break a;case ne:s=11;break a;case oe:s=14;break a;case j:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ei(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ji(e,t,n,r){return e=Ei(7,e,r,t),e.lanes=n,e}function Mi(e,t,n){return e=Ei(6,e,null,t),e.lanes=n,e}function Ni(e){var t=Ei(18,null,null,0);return t.stateNode=e,t}function Pi(e,t,n){return t=Ei(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Fi=new WeakMap;function Ii(e,t){if(typeof e==`object`&&e){var n=Fi.get(e);return n===void 0?(t={value:e,source:t,stack:Ne(t)},Fi.set(e,t),t):n}return{value:e,source:t,stack:Ne(t)}}var Li=[],Ri=0,zi=null,Bi=0,Vi=[],Hi=0,Ui=null,Wi=1,Gi=``;function Ki(e,t){Li[Ri++]=Bi,Li[Ri++]=zi,zi=e,Bi=t}function qi(e,t,n){Vi[Hi++]=Wi,Vi[Hi++]=Gi,Vi[Hi++]=Ui,Ui=e;var r=Wi;e=Gi;var i=32-Ze(r)-1;r&=~(1<<i),n+=1;var a=32-Ze(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Wi=1<<32-Ze(t)+i|n<<i|r,Gi=a+e}else Wi=1<<a|n<<i|r,Gi=e}function Ji(e){e.return!==null&&(Ki(e,1),qi(e,1,0))}function Yi(e){for(;e===zi;)zi=Li[--Ri],Li[Ri]=null,Bi=Li[--Ri],Li[Ri]=null;for(;e===Ui;)Ui=Vi[--Hi],Vi[Hi]=null,Gi=Vi[--Hi],Vi[Hi]=null,Wi=Vi[--Hi],Vi[Hi]=null}function Xi(e,t){Vi[Hi++]=Wi,Vi[Hi++]=Gi,Vi[Hi++]=Ui,Wi=t.id,Gi=t.overflow,Ui=e}var Zi=null,Qi=null,K=!1,$i=null,ea=!1,ta=Error(i(519));function na(e){throw ca(Ii(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ta}function ra(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[xt]=e,t[St]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Q(zf[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),tn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),on(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||ep(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=U),t=!0):t=!1,t||na(e,!0)}function ia(e){for(Zi=e.return;Zi;)switch(Zi.tag){case 5:case 31:case 13:ea=!1;return;case 27:case 3:ea=!0;return;default:Zi=Zi.return}}function aa(e){if(e!==Zi)return!1;if(!K)return ia(e),K=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&Qi&&na(e),ia(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Qi=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Qi=dm(e)}else t===27?(t=Qi,Sp(e.type)?(e=um,um=null,Qi=e):Qi=t):Qi=Zi?lm(e.stateNode.nextSibling):null;return!0}function oa(){Qi=Zi=null,K=!1}function sa(){var e=$i;return e!==null&&(dd===null?dd=e:dd.push.apply(dd,e),$i=null),e}function ca(e){$i===null?$i=[e]:$i.push(e)}var la=F(null),ua=null,da=null;function fa(e,t,n){I(la,t._currentValue),t._currentValue=n}function pa(e){e._currentValue=la.current,be(la)}function ma(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ha(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ma(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ma(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ma(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ga(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Lr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===we.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}a=a.return}return e!==null&&ha(t,e,n,r),t.flags|=262144,e!==null}function _a(e){for(e=e.firstContext;e!==null;){if(!Lr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function va(e){ua=e,da=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ya(e){return ba(ua,e)}function q(e,t){return ua===null&&va(e),ba(e,t)}function ba(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},da===null){if(e===null)throw Error(i(308));da=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else da=da.next=t;return n}var xa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Sa=t.unstable_scheduleCallback,Ca=t.unstable_NormalPriority,wa={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ta(){return{controller:new xa,data:new Map,refCount:0}}function Ea(e){e.refCount--,e.refCount===0&&Sa(Ca,function(){e.controller.abort()})}function Da(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Oa=null;function ka(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Aa=null,ja=0,Ma=0,Na=null;function Pa(e,t){if(Aa===null){var n=Aa=[];ja=0,Ma=Pf(),Na={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ja++,t.then(Fa,Fa),t}function Fa(){if(--ja===0&&(Oa=null,Aa!==null)){Na!==null&&(Na.status=`fulfilled`);var e=Aa;Aa=null,Ma=0,Na=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ia(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var La=N.S;N.S=function(e,t){if(md=ze(),typeof t==`object`&&t&&typeof t.then==`function`&&Pa(e,t),Oa!==null)for(var n=bf;n!==null;)Da(n,Oa),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)Da(r,n),r=r.next;if(Ma!==0){r=Oa,r===null&&(r=Oa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}La!==null&&La(e,t)};var Ra=F(null);function za(){var e=Ra.current;return e===null?Zu.pooledCache:e}function Ba(e,t){t===null?I(Ra,Ra.current):I(Ra,t.pool)}function Va(){var e=za();return e===null?null:{parent:wa._currentValue,pool:e}}var Ha=Error(i(460)),Ua=Error(i(474)),Wa=Error(i(542)),Ga={then:function(){}};function Ka(e){return e=e.status,e===`fulfilled`||e===`rejected`}function qa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(U,U),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Za(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(U,U);else{if(e=Zu,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Za(e),e}throw Ya=t,Ha}}function Ja(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ya=e,Ha):e}}var Ya=null;function Xa(){if(Ya===null)throw Error(i(459));var e=Ya;return Ya=null,e}function Za(e){if(e===Ha||e===Wa)throw Error(i(483))}var Qa=null,$a=0;function eo(e){var t=$a;return $a+=1,Qa===null&&(Qa=[]),qa(Qa,e,t)}function to(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function no(e,t){throw t.$$typeof===T?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ro(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Oi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Mi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===O?(e=d(e,t,n.props.children,r,n.key),to(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===j&&Ja(i)===t.type)?(t=a(t,n.props),to(t,n),t.return=e,t):(t=Ai(n.type,n.key,n.props,null,e.mode,r),to(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Pi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ji(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Mi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case E:return n=Ai(t.type,t.key,t.props,null,e.mode,n),to(n,t),n.return=e,n;case D:return t=Pi(t,e.mode,n),t.return=e,t;case j:return t=Ja(t),f(e,t,n)}if(he(t)||fe(t))return t=ji(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,eo(t),n);if(t.$$typeof===A)return f(e,q(e,t),n);no(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case E:return n.key===i?l(e,t,n,r):null;case D:return n.key===i?u(e,t,n,r):null;case j:return n=Ja(n),p(e,t,n,r)}if(he(n)||fe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,eo(n),r);if(n.$$typeof===A)return p(e,t,q(e,n),r);no(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case E:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case D:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case j:return r=Ja(r),m(e,t,n,r,i)}if(he(r)||fe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,eo(r),i);if(r.$$typeof===A)return m(e,t,n,q(t,r),i);no(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),K&&Ki(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return K&&Ki(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),K&&Ki(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),K&&Ki(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return K&&Ki(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),K&&Ki(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===O&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case E:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===O){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),to(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===j&&Ja(l)===r.type){n(e,r.sibling),c=a(r,o.props),to(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===O?(c=ji(o.props.children,e.mode,c,o.key),to(c,o),c.return=e,e=c):(c=Ai(o.type,o.key,o.props,null,e.mode,c),to(c,o),c.return=e,e=c)}return s(e);case D:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Pi(o,e.mode,c),c.return=e,e=c}return s(e);case j:return o=Ja(o),_(e,r,o,c)}if(he(o))return h(e,r,o,c);if(fe(o)){if(l=fe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,eo(o),c);if(o.$$typeof===A)return _(e,r,q(e,o),c);no(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Mi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{$a=0;var i=_(e,t,n,r);return Qa=null,i}catch(t){if(t===Ha||t===Wa)throw t;var a=Ei(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var io=ro(!0),ao=ro(!1),oo=!1;function so(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function co(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function lo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function uo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Xu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ci(e),Si(e,null,n),t}return yi(e,r,t,n),Ci(e)}function fo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,mt(e,n)}}function po(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var mo=!1;function ho(){if(mo){var e=Na;if(e!==null)throw e}}function go(e,t,n,r){mo=!1;var i=e.updateQueue;oo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Z&f)===f:(r&f)===f){f!==0&&f===Ma&&(mo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=w({},d,f);break a;case 2:oo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ad|=o,e.lanes=o,e.memoizedState=d}}function _o(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function vo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)_o(n[e],t)}var yo=F(null),bo=F(0);function xo(e,t){e=rd,I(bo,e),I(yo,t),rd=e|t.baseLanes}function So(){I(bo,rd),I(yo,yo.current)}function Co(){rd=bo.current,be(yo),be(bo)}var wo=F(null),To=null;function Eo(e){var t=e.alternate;I(jo,jo.current&1),I(wo,e),To===null&&(t===null||yo.current!==null||t.memoizedState!==null)&&(To=e)}function Do(e){I(jo,jo.current),I(wo,e),To===null&&(To=e)}function Oo(e){e.tag===22?(I(jo,jo.current),I(wo,e),To===null&&(To=e)):ko()}function ko(){I(jo,jo.current),I(wo,wo.current)}function Ao(e){be(wo),To===e&&(To=null),be(jo)}var jo=F(0);function Mo(e,t){I(wo,wo.current),I(jo,t)}function No(e){be(jo),be(wo),To===e&&(To=null)}function Po(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Fo=0,J=null,Io=null,Lo=null,Ro=!1,zo=!1,Bo=!1,Vo=0,Ho=0,Uo=null,Wo=0;function Go(){throw Error(i(321))}function Ko(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Lr(e[n],t[n]))return!1;return!0}function qo(e,t,n,r,i,a){return Fo=a,J=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?uc:dc,Bo=!1,a=n(r,i),Bo=!1,zo&&(a=Yo(t,n,r,i)),Jo(e),a}function Jo(e){N.H=lc;var t=Io!==null&&Io.next!==null;if(Fo=0,Lo=Io=J=null,Ro=!1,Ho=0,Uo=null,t)throw Error(i(300));e===null||Oc||(e=e.dependencies,e!==null&&_a(e)&&(Oc=!0))}function Yo(e,t,n,r){J=e;var a=0;do{if(zo&&(Uo=null),Ho=0,zo=!1,25<=a)throw Error(i(301));if(a+=1,Lo=Io=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=fc,o=t(n,r)}while(zo);return o}function Xo(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?rs(t):t,e=e.useState()[0],(Io===null?null:Io.memoizedState)!==e&&(J.flags|=1024),t}function Zo(){var e=Vo!==0;return Vo=0,e}function Qo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function $o(e){if(Ro){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ro=!1}Fo=0,Lo=Io=J=null,zo=!1,Ho=Vo=0,Uo=null}function es(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lo===null?J.memoizedState=Lo=e:Lo=Lo.next=e,Lo}function ts(){if(Io===null){var e=J.alternate;e=e===null?null:e.memoizedState}else e=Io.next;var t=Lo===null?J.memoizedState:Lo.next;if(t!==null)Lo=t,Io=e;else{if(e===null)throw J.alternate===null?Error(i(467)):Error(i(310));Io=e,e={memoizedState:Io.memoizedState,baseState:Io.baseState,baseQueue:Io.baseQueue,queue:Io.queue,next:null},Lo===null?J.memoizedState=Lo=e:Lo=Lo.next=e}return Lo}function ns(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function rs(e){var t=Ho;return Ho+=1,Uo===null&&(Uo=[]),e=qa(Uo,e,t),t=J,(Lo===null?t.memoizedState:Lo.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?uc:dc),e}function is(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return rs(e);if(e.$$typeof===ue)return;if(e.$$typeof===A)return ya(e)}throw Error(i(438,String(e)))}function as(e){var t=null,n=J.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=J.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ns(),J.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ce;return t.index++,n}function os(e,t){return typeof t==`function`?t(e):t}function ss(e){return cs(ts(),Io,e)}function cs(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Fo&f)===f:(Z&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ma&&(d=!0);else if((Fo&p)===p){u=u.next,p===Ma&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,J.lanes|=p,ad|=p;f=u.action,Bo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,J.lanes|=f,ad|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Lr(o,e.memoizedState)&&(Oc=!0,d&&(n=Na,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ls(e){var t=ts(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Lr(o,t.memoizedState)||(Oc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function us(e,t,n){var r=J,a=ts(),o=K;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Lr((Io||a).memoizedState,n);if(s&&(a.memoizedState=n,Oc=!0),a=a.queue,Fs(ps.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Lo!==null&&!!(Lo.memoizedState.tag&1),As(e?9:8,{destroy:void 0},fs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Zu===null)throw Error(i(349));o||Fo&127||ds(r,t,n)}return n}function ds(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=J.updateQueue,t===null?(t=ns(),J.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function fs(e,t,n,r){t.value=n,t.getSnapshot=r,ms(t)&&hs(e)}function ps(e,t,n){return n(function(){ms(t)&&hs(e)})}function ms(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lr(e,n)}catch{return!0}}function hs(e){var t=xi(e,2);t!==null&&Nd(t,e,2)}function gs(e){var t=es();if(typeof e==`function`){var n=e;if(e=n(),Bo){Xe(!0);try{n()}finally{Xe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:e},t}function _s(e,t,n,r){return e.baseState=n,cs(e,Io,typeof r==`function`?r:os)}function vs(e,t,n,r,a){if(oc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ys(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ys(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};o.types=a===null?null:a.types,N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),bs(e,t,s)}catch(n){Ss(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),bs(e,t,a)}catch(n){Ss(e,t,n)}}function bs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){xs(e,t,n)},function(n){return Ss(e,t,n)}):xs(e,t,n)}function xs(e,t,n){t.status=`fulfilled`,t.value=n,Cs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ys(e,n)))}function Ss(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Cs(t),t=t.next;while(t!==r)}e.action=null}function Cs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ws(e,t){return t}function Ts(e,t){if(K){var n=Zu.formState;if(n!==null){a:{var r=J;if(K){if(Qi){b:{for(var i=Qi,a=ea;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Qi=lm(i.nextSibling),r=i.data===`F!`;break a}}na(r)}r=!1}r&&(t=n[0])}}return n=es(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ws,lastRenderedState:t},n.queue=r,n=rc.bind(null,J,r),r.dispatch=n,r=gs(!1),a=ac.bind(null,J,!1,r.queue),r=es(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=vs.bind(null,J,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Es(e){return Ds(ts(),Io,e)}function Ds(e,t,n){if(t=cs(e,t,ws)[0],e=ss(os)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=rs(t)}catch(e){throw e===Ha?Wa:e}else r=t;t=ts();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(J.flags|=2048,As(9,{destroy:void 0},Os.bind(null,i,n),null)),[r,a,e]}function Os(e,t){e.action=t}function ks(e){var t=ts(),n=Io;if(n!==null)return Ds(t,n,e);ts(),t=t.memoizedState,n=ts();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function As(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=J.updateQueue,t===null&&(t=ns(),J.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function js(){return ts().memoizedState}function Ms(e,t,n,r){var i=es();J.flags|=e,i.memoizedState=As(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ns(e,t,n,r){var i=ts();r=r===void 0?null:r;var a=i.memoizedState.inst;Io!==null&&r!==null&&Ko(r,Io.memoizedState.deps)?i.memoizedState=As(t,a,n,r):(J.flags|=e,i.memoizedState=As(1|t,a,n,r))}function Ps(e,t){Ms(8390656,8,e,t)}function Fs(e,t){Ns(2048,8,e,t)}function Is(e){J.flags|=4;var t=J.updateQueue;if(t===null)t=ns(),J.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ls(e){var t=ts().memoizedState;return Is({ref:t,nextImpl:e}),function(){if(Xu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Rs(e,t){return Ns(4,2,e,t)}function zs(e,t){return Ns(4,4,e,t)}function Bs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Vs(e,t,n){n=n==null?null:n.concat([e]),Ns(4,4,Bs.bind(null,t,e),n)}function Hs(){}function Us(e,t){var n=ts();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Ko(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ws(e,t){var n=ts();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Ko(t,r[1]))return r[0];if(r=e(),Bo){Xe(!0);try{e()}finally{Xe(!1)}}return n.memoizedState=[r,t],r}function Gs(e,t,n){return n===void 0||Fo&1073741824&&!(Z&261930)?e.memoizedState=t:(e.memoizedState=n,e=jd(),J.lanes|=e,ad|=e,n)}function Ks(e,t,n,r){return Lr(n,t)?n:yo.current===null?!(Fo&106)||Fo&1073741824&&!(Z&261930)?(Oc=!0,e.memoizedState=n):(e=jd(),J.lanes|=e,ad|=e,t):(e=Gs(e,n,r),Lr(e,t)||(Oc=!0),e)}function qs(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};s.types=o===null?null:o.types,N.T=s,ac(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ic(e,t,Ia(c,r),Ad(e)):ic(e,t,r,Ad(e))}catch(n){ic(e,t,{then:function(){},status:`rejected`,reason:n},Ad())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function Js(){}function Ys(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Xs(e).queue;qs(e,a,t,_e,n===null?Js:function(){return Zs(e),n(r)})}function Xs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:_e,baseState:_e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:_e},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:os,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Zs(e){var t=Xs(e);t.next===null&&(t=e.alternate.memoizedState),ic(e,t.next.queue,{},Ad())}function Qs(){return ya(sh)}function $s(){return ts().memoizedState}function ec(){return ts().memoizedState}function tc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ad();e=lo(n);var r=uo(t,e,n);r!==null&&(Nd(r,t,n),fo(r,t,n)),t={cache:Ta()},e.payload=t;return}t=t.return}}function nc(e,t,n){var r=Ad();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},oc(e)?sc(t,n):(n=bi(e,t,n,r),n!==null&&(Nd(n,e,r),cc(n,t,r)))}function rc(e,t,n){ic(e,t,n,Ad())}function ic(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(oc(e))sc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Lr(s,o))return yi(e,t,i,0),Zu===null&&vi(),!1}catch{}if(n=bi(e,t,i,r),n!==null)return Nd(n,e,r),cc(n,t,r),!0}return!1}function ac(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},oc(e)){if(t)throw Error(i(479))}else t=bi(e,n,r,2),t!==null&&Nd(t,e,2)}function oc(e){var t=e.alternate;return e===J||t!==null&&t===J}function sc(e,t){zo=Ro=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,mt(e,n)}}var lc={readContext:ya,use:is,useCallback:Go,useContext:Go,useEffect:Go,useImperativeHandle:Go,useLayoutEffect:Go,useInsertionEffect:Go,useMemo:Go,useReducer:Go,useRef:Go,useState:Go,useDebugValue:Go,useDeferredValue:Go,useTransition:Go,useSyncExternalStore:Go,useId:Go,useHostTransitionStatus:Go,useFormState:Go,useActionState:Go,useOptimistic:Go,useMemoCache:Go,useCacheRefresh:Go,useEffectEvent:Go},uc={readContext:ya,use:is,useCallback:function(e,t){return es().memoizedState=[e,t===void 0?null:t],e},useContext:ya,useEffect:Ps,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ms(4194308,4,Bs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ms(4194308,4,e,t)},useInsertionEffect:function(e,t){Ms(4,2,e,t)},useMemo:function(e,t){var n=es();t=t===void 0?null:t;var r=e();if(Bo){Xe(!0);try{e()}finally{Xe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=es();if(n!==void 0){var i=n(t);if(Bo){Xe(!0);try{n(t)}finally{Xe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=nc.bind(null,J,e),[r.memoizedState,e]},useRef:function(e){var t=es();return e={current:e},t.memoizedState=e},useState:function(e){e=gs(e);var t=e.queue,n=rc.bind(null,J,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Hs,useDeferredValue:function(e,t){return Gs(es(),e,t)},useTransition:function(){var e=gs(!1);return e=qs.bind(null,J,e.queue,!0,!1),es().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=J,a=es();if(K){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Zu===null)throw Error(i(349));Z&127||ds(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ps(ps.bind(null,r,o,e),[e]),r.flags|=2048,As(9,{destroy:void 0},fs.bind(null,r,o,n,t),null),n},useId:function(){var e=es(),t=Zu.identifierPrefix;if(K){var n=Gi,r=Wi;n=(r&~(1<<32-Ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Vo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Wo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Qs,useFormState:Ts,useActionState:Ts,useOptimistic:function(e){var t=es();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ac.bind(null,J,!0,n),n.dispatch=t,[e,t]},useMemoCache:as,useCacheRefresh:function(){return es().memoizedState=tc.bind(null,J)},useEffectEvent:function(e){var t=es(),n={impl:e};return t.memoizedState=n,function(){if(Xu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},dc={readContext:ya,use:is,useCallback:Us,useContext:ya,useEffect:Fs,useImperativeHandle:Vs,useInsertionEffect:Rs,useLayoutEffect:zs,useMemo:Ws,useReducer:ss,useRef:js,useState:function(){return ss(os)},useDebugValue:Hs,useDeferredValue:function(e,t){return Ks(ts(),Io.memoizedState,e,t)},useTransition:function(){var e=ss(os)[0],t=ts().memoizedState;return[typeof e==`boolean`?e:rs(e),t]},useSyncExternalStore:us,useId:$s,useHostTransitionStatus:Qs,useFormState:Es,useActionState:Es,useOptimistic:function(e,t){return _s(ts(),Io,e,t)},useMemoCache:as,useCacheRefresh:ec,useEffectEvent:Ls},fc={readContext:ya,use:is,useCallback:Us,useContext:ya,useEffect:Fs,useImperativeHandle:Vs,useInsertionEffect:Rs,useLayoutEffect:zs,useMemo:Ws,useReducer:ls,useRef:js,useState:function(){return ls(os)},useDebugValue:Hs,useDeferredValue:function(e,t){var n=ts();return Io===null?Gs(n,e,t):Ks(n,Io.memoizedState,e,t)},useTransition:function(){var e=ls(os)[0],t=ts().memoizedState;return[typeof e==`boolean`?e:rs(e),t]},useSyncExternalStore:us,useId:$s,useHostTransitionStatus:Qs,useFormState:ks,useActionState:ks,useOptimistic:function(e,t){var n=ts();return Io===null?(n.baseState=e,[e,n.queue.dispatch]):_s(n,Io,e,t)},useMemoCache:as,useCacheRefresh:ec,useEffectEvent:Ls};function pc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:w({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var mc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=lo(r);i.payload=t,n!=null&&(i.callback=n),t=uo(e,i,r),t!==null&&(Nd(t,e,r),fo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=lo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=uo(e,i,r),t!==null&&(Nd(t,e,r),fo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ad(),r=lo(n);r.tag=2,t!=null&&(r.callback=t),t=uo(e,r,n),t!==null&&(Nd(t,e,n),fo(t,e,n))}};function hc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!W(n,r)||!W(i,a):!0}function gc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&mc.enqueueReplaceState(t,t.state,null)}function _c(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=w({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function vc(e){mi(e)}function yc(e){console.error(e)}function bc(e){mi(e)}function xc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Sc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Cc(e,t,n){return n=lo(n),n.tag=3,n.payload={element:null},n.callback=function(){xc(e,t)},n}function wc(e){return e=lo(e),e.tag=3,e}function Tc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Sc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Sc(t,n,r),typeof i!=`function`&&(_d===null?_d=new Set([this]):_d.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ec(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ga(t,n,a,!0),n=wo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return To===null?Gd():n.alternate===null&&id===0&&(id=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ga?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),mf(e,r,a)),!1;case 22:return n.flags|=65536,r===Ga?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),mf(e,r,a)),!1}throw Error(i(435,n.tag))}return mf(e,r,a),Gd(),!1}if(K)return t=wo.current,t===null?(r!==ta&&(t=Error(i(423),{cause:r}),ca(Ii(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ii(r,n),a=Cc(e.stateNode,r,a),po(e,a),id!==4&&(id=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ta&&(e=Error(i(422),{cause:r}),ca(Ii(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ii(o,n),ud===null?ud=[o]:ud.push(o),id!==4&&(id=2),t===null)return!0;r=Ii(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Cc(n.stateNode,r,e),po(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(_d===null||!_d.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=wc(a),Tc(a,e,n,r),po(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Dc=Error(i(461)),Oc=!1;function kc(e,t,n,r){t.child=e===null?ao(t,null,n,r):io(t,e.child,n,r)}function Ac(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return va(t),r=qo(e,t,n,o,a,i),s=Zo(),e!==null&&!Oc?(Qo(e,t,i),il(e,t,i)):(K&&s&&Ji(t),t.flags|=1,kc(e,t,r,i),t.child)}function jc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Di(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Mc(e,t,a,r,i)):(e=Ai(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!al(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?W:n,n(o,r)&&e.ref===t.ref)return il(e,t,i)}return t.flags|=1,e=Oi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Mc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(W(a,r)&&e.ref===t.ref){if(Oc=!1,t.pendingProps=r=a,al(e,i))e.flags&131072&&(Oc=!0);else return t.lanes=e.lanes,il(e,t,i)}}return Bc(e,t,n,r,i)}function Nc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Fc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ba(t,a===null?null:a.cachePool),a===null?So():xo(t,a),Oo(t);else return r=t.lanes=536870912,Fc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ba(t,null),So(),ko()):(Ba(t,a.cachePool),xo(t,a),ko(),t.memoizedState=null);return kc(e,t,i,n),t.child}function Pc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Fc(e,t,n,r,i){var a=za();return a=a===null?null:{parent:wa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ba(t,null),So(),Oo(t),e!==null&&ga(e,t,r,!0),t.childLanes=i,null}function Ic(e,t){return t=Yc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Lc(e,t,n){return io(t,e.child,null,n),e=Ic(t,t.pendingProps),e.flags|=2,Ao(t),t.memoizedState=null,e}function Rc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(K){if(r.mode===`hidden`)return e=Ic(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Pc(null,e);if(Do(t),(e=Qi)?(e=am(e,ea),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ui===null?null:{id:Wi,overflow:Gi},retryLane:536870912,hydrationErrors:null},n=Ni(e),n.return=t,t.child=n,Zi=t,Qi=null)):e=null,e===null)throw na(t);return t.lanes=536870912,null}return Ic(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Do(t),a){if(t.flags&256)t.flags&=-257,t=Lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Oc||ga(e,t,n,!1),a=(n&e.childLanes)!==0,Oc||a){if(yo.current===null){if(r=Zu,r!==null&&(s=ht(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,xi(e,s),Nd(r,e,s),Dc;Gd()}t=Lc(e,t,n)}else e=o.treeContext,Qi=lm(s.nextSibling),Zi=t,K=!0,$i=null,ea=!1,e!==null&&Xi(t,e),t=Ic(t,r),t.flags|=134221824;return t}return e=Oi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function zc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Bc(e,t,n,r,i){return va(t),n=qo(e,t,n,r,void 0,i),r=Zo(),e!==null&&!Oc?(Qo(e,t,i),il(e,t,i)):(K&&r&&Ji(t),t.flags|=1,kc(e,t,n,i),t.child)}function Vc(e,t,n,r,i,a){return va(t),t.updateQueue=null,n=Yo(t,r,n,i),Jo(e),r=Zo(),e!==null&&!Oc?(Qo(e,t,a),il(e,t,a)):(K&&r&&Ji(t),t.flags|=1,kc(e,t,n,a),t.child)}function Hc(e,t,n,r,i){if(va(t),t.stateNode===null){var a=wi,o=n.contextType;typeof o==`object`&&o&&(a=ya(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=mc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},so(t),o=n.contextType,a.context=typeof o==`object`&&o?ya(o):wi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(pc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&mc.enqueueReplaceState(a,a.state,null),go(t,r,a,i),ho(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=_c(n,s);a.props=c;var l=a.context,u=n.contextType;o=wi,typeof u==`object`&&u&&(o=ya(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&gc(t,a,r,o),oo=!1;var f=t.memoizedState;a.state=f,go(t,r,a,i),ho(),l=t.memoizedState,s||f!==l||oo?(typeof d==`function`&&(pc(t,n,d,r),l=t.memoizedState),(c=oo||hc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,co(e,t),o=t.memoizedProps,u=_c(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=wi,typeof l==`object`&&l&&(c=ya(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&gc(t,a,r,c),oo=!1,f=t.memoizedState,a.state=f,go(t,r,a,i),ho();var p=t.memoizedState;o!==d||f!==p||oo||e!==null&&e.dependencies!==null&&_a(e.dependencies)?(typeof s==`function`&&(pc(t,n,s,r),p=t.memoizedState),(u=oo||hc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&_a(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,zc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=io(t,e.child,null,i),t.child=io(t,null,n,i)):kc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=il(e,t,i),e}function Uc(e,t,n,r){return oa(),t.flags|=256,kc(e,t,n,r),t.child}var Wc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gc(e){return{baseLanes:e,cachePool:Va()}}function Kc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=cd),e}function qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(jo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(K){if(i?Eo(t):ko(),(e=Qi)?(e=am(e,ea),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ui===null?null:{id:Wi,overflow:Gi},retryLane:536870912,hydrationErrors:null},n=Ni(e),n.return=t,t.child=n,Zi=t,Qi=null)):e=null,e===null)throw na(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(ko(),i=t.mode,a=Yc({mode:`hidden`,children:a},i),r=ji(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Gc(n),r.childLanes=Kc(e,o,n),t.memoizedState=Wc,Pc(null,r)):(Eo(t),Jc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Zc(e,t,a,o,r,c,s,n)}return i?(ko(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Oi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=ji(i,a,n,null),i.flags|=2):i=Oi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Pc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Gc(n):(a=i.cachePool,a===null?a=Va():(s=wa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Kc(e,o,n),t.memoizedState=Wc,Pc(e.child,r)):(Eo(t),n=e.child,e=n.sibling,n=Oi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Jc(e,t){return t=Yc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Yc(e,t){return e=Ei(22,e,null,t),e.lanes=0,e}function Xc(e,t,n){return io(t,e.child,null,n),e=Jc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Eo(t),t.flags&=-257,Xc(e,t,c)):t.memoizedState===null?(ko(),o=a.fallback,s=t.mode,a=Yc({mode:`visible`,children:a.children},s),o=ji(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,io(t,e.child,null,c),a=t.child,a.memoizedState=Gc(c),a.childLanes=Kc(e,r,c),t.memoizedState=Wc,Pc(null,a)):(ko(),t.child=e.child,t.flags|=128,null);if(Eo(t),sm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ca({value:a,source:null,stack:null})),Xc(e,t,c)}if(Oc||ga(e,t,c,!1),r=(c&e.childLanes)!==0,Oc||r){if(yo.current!==null)return Xc(e,t,c);if(r=Zu,r!==null&&(a=ht(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,xi(e,a),Nd(r,e,a),Dc;return om(o)||Gd(),Xc(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Qi=lm(o.nextSibling),Zi=t,K=!0,$i=null,ea=!1,e!==null&&Xi(t,e),t=Jc(t,a.children),t.flags|=134221824,t)}function Qc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ma(e.return,t,n)}function $c(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Po(n)===null&&(t=e),e=e.sibling}return t}function el(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function tl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function nl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=jo.current;if(t.flags&128)return Mo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Mo(t,o),i===`backwards`&&e!==null?(tl(e),kc(e,t,r,n),tl(e)):kc(e,t,r,n),r=K?Bi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qc(e,n,t);else if(e.tag===19)Qc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=$c(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,tl(t)),el(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Po(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}el(t,!0,n,null,a,r);break;case`together`:el(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=$c(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),el(t,!1,i,n,a,r)}return t.child}function rl(e,t,n){var r=t.pendingProps;return fa(t,t.type,r.value),kc(e,t,r.children,n),t.child}function il(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ad|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ga(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Oi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Oi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function al(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&_a(e)))}function ol(e,t,n){switch(t.tag){case 3:Te(t,t.stateNode.containerInfo),fa(t,wa,e.memoizedState.cache),oa();break;case 27:case 5:Ee(t);break;case 4:Te(t,t.stateNode.containerInfo);break;case 10:fa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Do(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Eo(t),t.flags|=128,null;r=ga(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?qc(e,t,n):(Eo(t),e=il(e,t,n),e===null?null:e.sibling)}Eo(t);break;case 19:if(t.flags&128)return nl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ga(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return nl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Mo(t,jo.current),r)break;return null;case 22:return t.lanes=0,Nc(e,t,n,t.pendingProps);case 24:fa(t,wa,e.memoizedState.cache)}return il(e,t,n)}function sl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Oc=!0;else{if(!al(e,n)&&!(t.flags&128))return Oc=!1,ol(e,t,n);Oc=!!(e.flags&131072)}}else Oc=!1,K&&t.flags&1048576&&qi(t,Bi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ja(t.elementType),t.type=e,typeof e==`function`)Di(e)?(r=_c(e,r),t.tag=1,t=Hc(null,t,e,r,n)):(t.tag=0,t=Bc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ne){t.tag=11,t=Ac(null,t,e,r,n);break a}if(a===oe){t.tag=14,t=jc(null,t,e,r,n);break a}if(a===A){t.tag=10,t.type=e,t=rl(null,t,n);break a}}throw t=me(e)||e,Error(i(306,t,``))}}return t;case 0:return Bc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=_c(r,t.pendingProps),Hc(e,t,r,a,n);case 3:a:{if(Te(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,co(e,t),go(t,r,null,n);var s=t.memoizedState;if(r=s.cache,fa(t,wa,r),r!==o.cache&&ha(t,[wa],n,!0),ho(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Uc(e,t,r,n);break a}if(r!==a){a=Ii(Error(i(424)),t),ca(a),t=Uc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Qi=lm(e.firstChild),Zi=t,K=!0,$i=null,ea=!0,n=ao(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(oa(),r===a){t=il(e,t,n);break a}kc(e,t,r,n)}t=t.child}return t;case 26:return zc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:K||(t.stateNode=fp(t.type,t.pendingProps,Ce.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ee(t),e===null&&K&&(r=t.stateNode=hm(t.type,t.pendingProps,Ce.current),Zi=t,ea=!0,a=Qi,Sp(t.type)?(um=a,Qi=lm(r.firstChild)):Qi=a),kc(e,t,t.pendingProps.children,n),zc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&K&&((a=r=Qi)&&(r=rm(r,t.type,t.pendingProps,ea),r===null?a=!1:(t.stateNode=r,Zi=t,Qi=lm(r.firstChild),ea=!1,a=!0)),a||na(t)),Ee(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,pp(a,o)?r=null:s!==null&&pp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=qo(e,t,Xo,null,null,n),sh._currentValue=a),zc(e,t),kc(e,t,r,n),t.child;case 6:return e===null&&K&&((e=n=Qi)&&(n=im(n,t.pendingProps,ea),n===null?e=!1:(t.stateNode=n,Zi=t,Qi=null,e=!0)),e||na(t)),null;case 13:return qc(e,t,n);case 4:return Te(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=io(t,null,r,n):kc(e,t,r,n),t.child;case 11:return Ac(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,zc(e,t),kc(e,t,r,n),t.child;case 8:return kc(e,t,t.pendingProps.children,n),t.child;case 12:return kc(e,t,t.pendingProps.children,n),t.child;case 10:return rl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,va(t),a=ya(a),r=r(a),t.flags|=1,kc(e,t,r,n),t.child;case 14:return jc(e,t,t.type,t.pendingProps,n);case 15:return Mc(e,t,t.type,t.pendingProps,n);case 19:return nl(e,t,n);case 31:return Rc(e,t,n);case 22:return Nc(e,t,n,t.pendingProps);case 24:return va(t),r=ya(wa),e===null?(a=za(),a===null&&(a=Zu,o=Ta(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},so(t),fa(t,wa,a)):((e.lanes&n)!==0&&(co(e,t),go(t,null,null,n),ho()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,fa(t,wa,r),r!==a.cache&&ha(t,[wa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),fa(t,wa,r))),kc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:K&&Ji(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:zc(e,t),kc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function cl(e){e.flags|=4}function ll(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Hd())e.flags|=8192;else throw Ya=Ga,Ua}}else e.flags&=-16777217}function ul(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Hd())e.flags|=8192;else throw Ya=Ga,Ua}}function dl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:lt(),e.lanes|=t,ld|=t)}function fl(e,t){if(!K)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function pl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function ml(e,t,n){var r=t.pendingProps;switch(Yi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pl(t),null;case 1:return pl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),pa(wa),L(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(aa(t)?cl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,sa())),pl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(cl(t),o===null?(pl(t),ll(t,a,null,r,n)):(pl(t),ul(t,o))):o?o===e.memoizedState?(pl(t),t.flags&=-16777217):(cl(t),pl(t),ul(t,o)):(e=e.memoizedProps,e!==r&&cl(t),pl(t),ll(t,a,e,r,n)),null;case 27:if(De(t),n=Ce.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return pl(t),t.subtreeFlags&=-33554433,null}e=xe.current,aa(t)?ra(t,e):(e=hm(a,r,n),t.stateNode=e,cl(t))}return pl(t),t.subtreeFlags&=-33554433,null;case 5:if(De(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return pl(t),t.subtreeFlags&=-33554433,null}if(o=xe.current,aa(t))ra(t,o);else{var s=lp(Ce.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[xt]=t,o[St]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(np(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&cl(t)}}return pl(t),t.subtreeFlags&=-33554433,ll(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&cl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ce.current,aa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Zi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[xt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||na(t,!0)}else e=lp(e).createTextNode(r),e[xt]=t,t.stateNode=e}return pl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=aa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[xt]=t}else oa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pl(t),e=!1}else n=sa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ao(t),t):(Ao(t),null);if(t.flags&128)throw Error(i(558))}return pl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=aa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[xt]=t}else oa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pl(t),a=!1}else a=sa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Ao(t),t):(Ao(t),null)}return Ao(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),dl(t,t.updateQueue),pl(t),null);case 4:return L(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,pl(t),null;case 10:return pa(t.type),pl(t),null;case 19:if(No(t),r=t.memoizedState,r===null)return pl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)fl(r,!1);else{if(id!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Po(e),o!==null){for(t.flags|=128,fl(r,!1),e=o.updateQueue,t.updateQueue=e,dl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ki(n,e),n=n.sibling;return Mo(t,jo.current&1|2),K&&Ki(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ze()>hd&&(t.flags|=128,a=!0,fl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Po(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,dl(t,e),fl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!K)return pl(t),null}else 2*ze()-r.renderingStartTime>hd&&n!==536870912&&(t.flags|=128,a=!0,fl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ze(),e.sibling=null,o=jo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||K?Mo(t,o):(n=o,I(wo,t),I(jo,n),To===null&&(To=t)),K&&Ki(t,r.treeForkCount),e}return pl(t),null;case 22:case 23:return Ao(t),Co(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(pl(t),t.subtreeFlags&6&&(t.flags|=8192)):pl(t),n=t.updateQueue,n!==null&&dl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&be(Ra),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),pa(wa),pl(t),null;case 25:return null;case 30:return t.flags|=33554432,pl(t),null}throw Error(i(156,t.tag))}function hl(e,t){switch(Yi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pa(wa),L(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return De(t),null;case 31:if(t.memoizedState!==null){if(Ao(t),t.alternate===null)throw Error(i(340));oa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));oa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return No(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return L(),null;case 10:return pa(t.type),null;case 22:case 23:return Ao(t),Co(),e!==null&&be(Ra),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return pa(wa),null;case 25:return null;default:return null}}function gl(e,t){switch(Yi(t),t.tag){case 3:pa(wa),L();break;case 26:case 27:case 5:De(t);break;case 4:L();break;case 31:t.memoizedState!==null&&Ao(t);break;case 13:Ao(t);break;case 19:No(t);break;case 10:pa(t.type);break;case 22:case 23:Ao(t),Co(),e!==null&&be(Ra);break;case 24:pa(wa)}}function _l(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){pf(t,t.return,e)}}function vl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){pf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){pf(t,t.return,e)}}function yl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{vo(t,n)}catch(t){pf(e,e.return,t)}}}function bl(e,t,n){n.props=_c(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){pf(e,t,n)}}function xl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=di(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);f(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){pf(e,t,n)}}function Sl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){pf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){pf(e,t,n)}else n.current=null}}function Cl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function wl(e){for(var t=e.return;t!==null&&(Dl(t)&&em(e.stateNode,t.stateNode),!El(t));)t=t.return}function Tl(e){for(var t=e.return;t!==null&&(Dl(t)&&tm(e.stateNode,t.stateNode),!El(t));)t=t.return}function El(e){return e.tag===5||e.tag===3||e.tag===27}function Dl(e){return e&&e.tag===7&&e.stateNode!==null}function Ol(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){pf(e,e.return,t)}}function kl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[St]=t}catch(t){pf(e,e.return,t)}}function Al(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function jl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Al(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Y(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=U)),Cl(e,r),B=!0;else if(i!==4&&(i===27&&(Cl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Y(e,t,n,r),e=e.sibling;e!==null;)Y(e,t,n,r),e=e.sibling}function Ml(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Cl(e,r),B=!0;else if(i!==4&&(i===27&&(Cl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ml(e,t,n,r),e=e.sibling;e!==null;)Ml(e,t,n,r),e=e.sibling}function Nl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[xt]=e,t[St]=n}catch(t){pf(e,e.return,t)}}var Pl=!1,Fl=null;function Il(e){(e.tag===30||e.subtreeFlags&33554432)&&(Pl=!0)}var Ll=null;function Rl(){var e=Ll;return Ll=null,e}var zl=0;function Bl(e,t,n,r,i){return zl=0,Vl(e.child,t,n,r,i)}function Vl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Pl=!0,Tp(o,zl===0?t:t+`_`+zl,n),zl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Vl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Hl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Hl(e.child,t)),e=e.sibling}function Ul(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Ul(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=pi(t.default,t.share),t!==`none`&&(Bl(e,n,t,null,!1)||Hl(e.child,!1))}e=e.sibling}}function Wl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=di(r,n),a=pi(r.default,n.paired?r.share:r.enter);a===`none`?Ul(e):Bl(e,i,a,null,!1)?(Ul(e),n.paired||t||Md(e,r.onEnter)):Hl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Wl(e,t),e=e.sibling;else Ul(e)}function Gl(e){if(Fl!==null&&Fl.size!==0){var t=Fl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=pi(n.default,n.share);if(a!==`none`&&(Bl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Md(e,n.onShare)):Hl(e.child,!1)),t.delete(r),t.size===0)break}}}Gl(e)}e=e.sibling}}}function Kl(e){if(e.tag===30){var t=e.memoizedProps,n=di(t,e.stateNode),r=Fl===null?void 0:Fl.get(n),i=pi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Bl(e,n,i,null,!1)?r===void 0?Md(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Fl.delete(n),Md(e,t.onShare)):Hl(e.child,!1)),Fl!==null&&Gl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Kl(e),e=e.sibling;else Fl!==null&&Gl(e)}function ql(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=di(t,e.stateNode);t=pi(t.default,t.update),e.flags&=-5,t!==`none`&&Bl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&ql(e);e=e.sibling}}function Jl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Hl(e.child,!1))}Jl(e)}e=e.sibling}}function Yl(e){if(e.tag===30)e.stateNode.paired=null,Hl(e.child,!1),Jl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e),e=e.sibling;else Jl(e)}function Xl(e){for(e=e.child;e!==null;)e.tag===30?Hl(e.child,!1):e.subtreeFlags&33554432&&Xl(e),e=e.sibling}function Zl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&zl<a.length){var l=a[zl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,zl===0?n:n+`_`+zl,i),s&&e.flags&4||(Ll===null&&(Ll=[]),Ll.push(c,zl===0?r:r+`_`+zl,t.memoizedProps)),zl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Zl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Ql(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=di(n,r),a=pi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;zl=0,i=Zl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Md(e,n.onUpdate))}else e.subtreeFlags&33554432&&Ql(e,t);e=e.sibling}}var $l=!1,eu=!1,tu=!1,nu=!1,ru=typeof WeakSet==`function`?WeakSet:Set,iu=null,au=!1,ou=!1,su=!1,cu=!1;function lu(e,t,n){if(e=e.containerInfo,sp=gh,e=Hr(e),G(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,iu=t,t=n?9270:1024;iu!==null;){if(e=iu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Kl(r[a]);if(e.alternate===null&&e.flags&2)n&&Il(e),uu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Kl(r),uu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Il(e),uu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,iu=r):(n&&ql(e),uu(n))}}Fl=null}function uu(e){for(;iu!==null;){var t=iu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=_c(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){pf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=di(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=pi(a.default,a.update),a!==`none`&&Bl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,iu=r;break}iu=t.return}}function du(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ju(e,n),r&4&&_l(5,n);break;case 1:if(ju(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){pf(n,n.return,e)}else{var i=_c(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){pf(n,n.return,e)}}}r&64&&yl(n),r&512&&xl(n,n.return);break;case 3:if(ju(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{vo(e,t)}catch(e){pf(n,n.return,e)}}break;case 27:t===null&&r&4&&Nl(n);case 26:case 5:ju(e,n),t===null&&r&4&&Ol(n),r&512&&xl(n,n.return);break;case 12:ju(e,n);break;case 31:ju(e,n),r&4&&bu(e,n);break;case 13:ju(e,n),r&4&&xu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||$l,!r){var a=t!==null&&t.memoizedState!==null||eu;t=$l,i=eu,$l=r,(eu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Nu(e,n,r)):ju(e,n),$l=t,eu=i}break;case 30:ju(e,n),r&512&&xl(n,n.return);break;case 7:r&512&&xl(n,n.return);default:ju(e,n)}}function fu(e,t){for(e=e.child;e!==null;)pu(e,t),e=e.sibling}function pu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){pf(e,e.return,t)}mu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,B=!0}catch(t){pf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){pf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&fu(e,t);break;default:fu(e,t)}}function mu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:pu(n,r);break a;case 22:n.memoizedState===null&&mu(n,r);break a;default:mu(n,r)}}e=e.sibling}}function hu(e){var t=e.alternate;t!==null&&(e.alternate=null,hu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&At(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var gu=null,_u=!1;function vu(e,t,n){for(n=n.child;n!==null;)yu(e,t,n),n=n.sibling}function yu(e,t,n){if(Ye&&typeof Ye.onCommitFiberUnmount==`function`)try{Ye.onCommitFiberUnmount(Je,n)}catch{}switch(n.tag){case 26:eu||Sl(n,t),vu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!eu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:eu||Sl(n,t),Tl(n);var r=gu,i=_u;Sp(n.type)&&(gu=n.stateNode,_u=!1),vu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),gu=r,_u=i;break;case 5:eu||Sl(n,t),Tl(n);case 6:if(n.tag===6&&Tl(n),r=gu,i=_u,gu=null,vu(e,t,n),gu=r,_u=i,gu!==null){if(_u)try{(gu.nodeType===9?gu.body:gu.nodeName===`HTML`?gu.ownerDocument.body:gu).removeChild(n.stateNode),B=!0}catch(e){pf(n,t,e)}else try{gu.removeChild(n.stateNode),B=!0}catch(e){pf(n,t,e)}}break;case 18:gu!==null&&(_u?(e=gu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(gu,n.stateNode));break;case 4:r=gu,i=_u,gu=n.stateNode.containerInfo,_u=!0,vu(e,t,n),gu=r,_u=i;break;case 0:case 11:case 14:case 15:vl(2,n,t),eu||vl(4,n,t),vu(e,t,n);break;case 1:eu||(Sl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&bl(n,t,r)),vu(e,t,n);break;case 21:vu(e,t,n);break;case 22:eu=(r=eu)||n.memoizedState!==null,vu(e,t,n),eu=r;break;case 30:Sl(n,t),vu(e,t,n);break;case 7:eu||Sl(n,t),vu(e,t,n);break;default:vu(e,t,n)}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){pf(t,t.return,e)}}}function xu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){pf(t,t.return,e)}}function Su(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ru),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ru),t;default:throw Error(i(435,e.tag))}}function Cu(e,t){var n=Su(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function wu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){gu=l.stateNode,_u=!1;break a}break;case 5:gu=l.stateNode,_u=!1;break a;case 3:case 4:gu=l.stateNode.containerInfo,_u=!0;break a}l=l.return}if(gu===null)throw Error(i(160));yu(s,c,o),gu=null,_u=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Eu(t,e,n),t=t.sibling}var Tu=null;function Eu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}wu(t,e,n),Du(e),a&4&&(vl(3,e,e.return),_l(3,e),vl(5,e,e.return));break;case 1:wu(t,e,n),Du(e),a&512&&(eu||r===null||Sl(r,r.return)),a&64&&$l&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Tu,wu(t,e,n),Du(e),a&512&&(eu||r===null||Sl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if($l)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Ot]||r[xt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),np(r,t,n),r[xt]=e,Ft(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Gm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[xt]=e,Ft(r),t=r}e.stateNode=t}}else $l||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&kl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||eu||t.parentNode.removeChild(t)):a.count--,n===null?$l||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:wu(t,e,n),Du(e),a&512&&(eu||r===null||Sl(r,r.return)),r!==null&&a&4&&kl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=tu,tu=!1,wu(t,e,n),tu=o,Du(e),a&512&&(eu||r===null||Sl(r,r.return)),e.flags&32){t=e.stateNode;try{sn(t,``),B=!0}catch(t){pf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,kl(e,t,r===null?t:r.memoizedProps)),a&1024&&(nu=!0);break;case 6:if(wu(t,e,n),Du(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,B=!0}catch(t){pf(e,e.return,t)}}break;case 3:if(B=!1,Wm=null,o=Tu,Tu=bm(t.containerInfo),wu(t,e,n),Tu=o,Du(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){pf(e,e.return,t)}nu&&(nu=!1,Ou(e)),B=!1;break;case 4:a=tu,tu=$l,r=Wt(),o=Tu,Tu=bm(e.stateNode.containerInfo),wu(t,e,n),Du(e),Tu=o,B&&ou&&(su=!0),B=r,tu=a;break;case 12:wu(t,e,n),Du(e);break;case 31:wu(t,e,n),Du(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 13:wu(t,e,n),Du(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(pd=ze()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=$l,l=eu,u=tu;$l=c||o,tu=u||o,eu=l||s,wu(t,e,n),eu=l,tu=u,$l=c,Du(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||$l||eu||(t=s||eu,n=$l,r=eu,$l=o||$l,eu=t,Mu(e,2),$l=n,eu=r),!o&&tu||fu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Cu(e,n))));break;case 19:wu(t,e,n),Du(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 30:a&512&&(eu||r===null||Sl(r,r.return)),a=Wt(),o=ou,s=(n&335544064)===n,c=e.memoizedProps,ou=s&&pi(c.default,c.update)!==`none`,wu(t,e,n),Du(e),s&&r!==null&&B&&(e.flags|=4),ou=o,B=a;break;case 21:break;case 7:a&512&&(eu||r===null||Sl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:wu(t,e,n),Du(e)}}function Du(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Al(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Dl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(El(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Ml(e,jl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(sn(l,``),n.flags&=-33),Ml(e,jl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Y(e,jl(e),u,s);break;default:throw Error(i(161))}}catch(t){pf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ou(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ou(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function ku(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Au(t,e),t=t.sibling;else Ql(t,!1)}function Au(e,t){var n=e.alternate;if(n===null)Wl(e,!1);else switch(e.tag){case 3:if(cu=au=!1,Rl(),ku(t,e),!au&&!su){if(e=Ll,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),cu=!0}Ll=null;break;case 5:ku(t,e);break;case 4:r=au,au=!1,ku(t,e),au&&(su=!0),au=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?ku(t,e):Wl(e,!1));break;case 30:r=au,i=Rl(),au=!1,ku(t,e),au&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=di(a,o),o=di(n.memoizedProps,o);var s=pi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,zl=0,t=Zl(e,n,t,o,s,a,!0),zl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Md(e,e.memoizedProps.onUpdate),Ll=i):i!==null&&(i.push.apply(i,Ll),Ll=i),au=e.flags&32?!0:r;break;default:ku(t,e)}}function ju(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)du(e,t.alternate,t),t=t.sibling}function Mu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:vl(4,n,n.return),Mu(n,r);break;case 1:Sl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&bl(n,n.return,i),Mu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:Sl(n,n.return),n.tag!==5&&n.tag!==27||Tl(n),Mu(n,r);break;case 6:Tl(n);break;case 26:Sl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||eu||i.parentNode.removeChild(i),Mu(n,r);break;case 22:n.memoizedState===null&&Mu(n,r);break;case 30:Sl(n,n.return),Mu(n,r);break;case 7:Sl(n,n.return);default:Mu(n,r)}e=e.sibling}}function Nu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Nu(i,a,n),_l(4,a);break;case 1:if(Nu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){pf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)_o(l[i],c)}catch(e){pf(r,r.return,e)}}s&&o&64&&yl(a),xl(a,a.return);break;case 27:n&2&&Nl(a);case 5:a.tag!==5&&a.tag!==27||wl(a),Nu(i,a,n),s&&r===null&&o&4&&Ol(a),xl(a,a.return);break;case 6:wl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||$l||Km(bm(c.ownerDocument),a.type,c),Nu(i,a,n),s&&r===null&&o&4&&Ol(a),xl(a,a.return);break;case 12:Nu(i,a,n);break;case 31:Nu(i,a,n),s&&o&4&&bu(i,a);break;case 13:Nu(i,a,n),s&&o&4&&xu(i,a);break;case 22:a.memoizedState===null&&Nu(i,a,n),xl(a,a.return);break;case 30:Nu(i,a,n),xl(a,a.return);break;case 7:xl(a,a.return);default:Nu(i,a,n)}t=t.sibling}}function Pu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ea(n))}function Fu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ea(e))}function Iu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Lu(e,t,n,r),t=t.sibling;else i&&Xl(t)}function Lu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Yl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Iu(e,t,n,r),a&2048&&_l(9,t);break;case 1:Iu(e,t,n,r);break;case 3:Iu(e,t,n,r),i&&cu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ea(a)));break;case 12:if(a&2048){Iu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){pf(t,t.return,e)}}else Iu(e,t,n,r);break;case 31:Iu(e,t,n,r);break;case 13:Iu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Yl(t),o._visibility&2?Iu(e,t,n,r):(o._visibility|=2,Ru(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Yl(s),o._visibility&2?Iu(e,t,n,r):zu(e,t)),a&2048&&Pu(s,t);break;case 24:Iu(e,t,n,r),a&2048&&Fu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Hl(a.child,!0),Hl(t.child,!0))),Iu(e,t,n,r);break;default:Iu(e,t,n,r)}}function Ru(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ru(a,o,s,c,i),_l(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ru(a,o,s,c,i)):u._visibility&2?Ru(a,o,s,c,i):zu(a,o),i&&l&2048&&Pu(o.alternate,o);break;case 24:Ru(a,o,s,c,i),i&&l&2048&&Fu(o.alternate,o);break;default:Ru(a,o,s,c,i)}t=t.sibling}}function zu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:zu(n,r),i&2048&&Pu(r.alternate,r);break;case 24:zu(n,r),i&2048&&Fu(r.alternate,r);break;default:zu(n,r)}t=t.sibling}}var Bu=8192;function Vu(e,t,n){if(e.subtreeFlags&Bu)for(e=e.child;e!==null;)Hu(e,t,n),e=e.sibling}function Hu(e,t,n){switch(e.tag){case 26:Vu(e,t,n),e.flags&Bu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Tu,e.memoizedState,e.memoizedProps));break;case 5:Vu(e,t,n),e.flags&Bu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Tu;Tu=bm(e.stateNode.containerInfo),Vu(e,t,n),Tu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Bu,Bu=16777216,Vu(e,t,n),Bu=r):Vu(e,t,n));break;case 30:if((e.flags&Bu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Fl===null&&(Fl=new Map),Fl.set(r,i)}Vu(e,t,n);break;default:Vu(e,t,n)}}function Uu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Wu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];iu=r,qu(r,e)}Uu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Gu(e),e=e.sibling}function Gu(e){switch(e.tag){case 0:case 11:case 15:Wu(e),e.flags&2048&&vl(9,e,e.return);break;case 3:Wu(e);break;case 12:Wu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ku(e)):Wu(e);break;default:Wu(e)}}function Ku(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];iu=r,qu(r,e)}Uu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:vl(8,t,t.return),Ku(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ku(t));break;default:Ku(t)}e=e.sibling}}function qu(e,t){for(;iu!==null;){var n=iu;switch(n.tag){case 0:case 11:case 15:vl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ea(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,iu=r;else a:for(n=e;iu!==null;){r=iu;var i=r.sibling,a=r.return;if(hu(r),r===n){iu=null;break a}if(i!==null){i.return=a,iu=i;break a}iu=a}}}var Ju={getCacheForType:function(e){var t=ya(wa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ya(wa).controller.signal}},Yu=typeof WeakMap==`function`?WeakMap:Map,Xu=0,Zu=null,X=null,Z=0,Qu=0,$u=null,ed=!1,td=!1,nd=!1,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=null,dd=null,fd=!1,pd=0,md=0,hd=1/0,gd=null,_d=null,vd=0,yd=null,bd=null,xd=0,Sd=0,Cd=null,wd=null,Td=null,Ed=null,Dd=null,Od=0,kd=null;function Ad(){return Xu&2&&Z!==0?Z&-Z:N.T===null?vt():Pf()}function jd(){if(cd===0){if(!(Z&536870912)||K){var e=nt;nt<<=1,!(nt&3932160)&&(nt=262144),cd=e}else cd=536870912}return e=wo.current,e!==null&&(e.flags|=32),cd}function Md(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(di(e.memoizedProps,n))),Ed===null&&(Ed=[]),Ed.push(t.bind(null,r))}}function Nd(e,t,n){(e===Zu&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)&&(Bd(e,0),Ld(e,Z,cd,!1)),dt(e,n),(!(Xu&2)||e!==Zu)&&(e===Zu&&(!(Xu&2)&&(od|=n),id===4&&Ld(e,Z,cd,!1)),Ef(e))}function Pd(e,t,n){if(Xu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ot(e,t),a=r?Jd(e,t):Kd(e,t,!0),o=r;do{if(a===0){td&&!r&&Ld(e,t,0,!1);break}if(n=e.current.alternate,o&&!Id(n))a=Kd(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=ud;var l=c.current.memoizedState.isDehydrated;if(l&&(Bd(c,s).flags|=256),s=Kd(c,s,!1),s!==2&&s!==6){if(nd&&!l){c.errorRecoveryDisabledLanes|=o,od|=o,a=4;break a}o=dd,dd=a,o!==null&&(dd===null?dd=o:dd.push.apply(dd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Bd(e,0),Ld(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ld(r,t,cd,!ed);break a;case 2:dd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=pd+300-ze(),10<a)){if(Ld(r,t,cd,!ed),at(r,0,!0)!==0)break a;xd=t,r.timeoutHandle=gp(Fd.bind(null,r,n,dd,gd,fd,t,cd,od,ld,ed,o,`Throttled`,-0,0),a);break a}Fd(r,n,dd,gd,fd,t,cd,od,ld,ed,o,null,-0,0)}break}}while(1);Ef(e)}function Fd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:U},Fl=null,Hu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?pd-ze():(a&4194048)===a?md-ze():0,m=eh(d,m),m!==null)?(xd=a,e.cancelPendingCommit=m(tf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ld(e,a,o,!l)):tf(e,t,a,n,r,i,o,s,c,l,u,d)}function Id(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Lr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ld(e,t,n,r){t=st(e,t),t&=~sd,t&=~od,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ze(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&pt(e,n,t)}function Rd(){return Xu&6?!0:(Df(0,!1),!1)}function zd(){if(X!==null){if(Qu===0)var e=X.return;else e=X,da=ua=null,$o(e),Qa=null,$a=0,e=X;for(;e!==null;)gl(e.alternate,e),e=e.return;X=null}}function Bd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),xd=0,zd(),Zu=e,X=n=Oi(e.current,null),Z=t,Qu=0,$u=null,ed=!1,td=ot(e,t),nd=!1,ld=cd=sd=od=ad=id=0,dd=ud=null,fd=!1,rd=st(e,t),vi(),n}function Vd(e,t){J=null,N.H=lc,t===Ha||t===Wa?(t=Xa(),Qu=3):t===Ua?(t=Xa(),Qu=4):Qu=t===Dc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,$u=t,X===null&&(id=1,xc(e,Ii(t,e.current)))}function Hd(){var e=wo.current;return e===null?!0:(Z&4194048)===Z?To===null:(Z&62914560)===Z||Z&536870912?e===To:!1}function Ud(){var e=N.H;return N.H=lc,e===null?lc:e}function Wd(){var e=N.A;return N.A=Ju,e}function Gd(){id=4,ed||(Z&4194048)!==Z&&wo.current!==null||(td=!0),!(ad&134217727)&&!(od&134217727)||Zu===null||Ld(Zu,Z,cd,!1)}function Kd(e,t,n){var r=Xu;Xu|=2;var i=Ud(),a=Wd();(Zu!==e||Z!==t)&&(gd=null,Bd(e,t)),t=!1;var o=id;a:do try{if(Qu!==0&&X!==null){var s=X,c=$u;switch(Qu){case 8:zd(),o=6;break a;case 3:case 2:case 9:case 6:wo.current===null&&(t=!0);var l=Qu;if(Qu=0,$u=null,Qd(e,s,c,l),n&&td){o=0;break a}break;default:l=Qu,Qu=0,$u=null,Qd(e,s,c,l)}}qd(),o=id;break}catch(t){Vd(e,t)}while(1);return t&&e.shellSuspendCounter++,da=ua=null,Xu=r,N.H=i,N.A=a,X===null&&(Zu=null,Z=0,vi()),o}function qd(){for(;X!==null;)Xd(X)}function Jd(e,t){var n=Xu;Xu|=2;var r=Ud(),a=Wd();Zu!==e||Z!==t?(gd=null,hd=ze()+500,Bd(e,t)):td=ot(e,t);a:do try{if(Qu!==0&&X!==null){t=X;var o=$u;b:switch(Qu){case 1:Qu=0,$u=null,Qd(e,t,o,1);break;case 2:case 9:if(Ka(o)){Qu=0,$u=null,Zd(t);break}t=function(){Qu!==2&&Qu!==9||Zu!==e||(Qu=7),Ef(e)},o.then(t,t);break a;case 3:Qu=7;break a;case 4:Qu=5;break a;case 7:Ka(o)?(Qu=0,$u=null,Zd(t)):(Qu=0,$u=null,Qd(e,t,o,7));break;case 5:var s=null;switch(X.tag){case 26:s=X.memoizedState;case 5:case 27:var c=X;if(s?Ym(s):c.stateNode.complete){Qu=0,$u=null;var l=c.sibling;if(l!==null)X=l;else{var u=c.return;u===null?X=null:(X=u,$d(u))}break b}}Qu=0,$u=null,Qd(e,t,o,5);break;case 6:Qu=0,$u=null,Qd(e,t,o,6);break;case 8:zd(),id=6;break a;default:throw Error(i(462))}}Yd();break}catch(t){Vd(e,t)}while(1);return da=ua=null,N.H=r,N.A=a,Xu=n,X===null?(Zu=null,Z=0,vi(),id):0}function Yd(){for(;X!==null&&!Le();)Xd(X)}function Xd(e){var t=sl(e.alternate,e,rd);e.memoizedProps=e.pendingProps,t===null?$d(e):X=t}function Zd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Vc(n,t,t.pendingProps,t.type,void 0,Z);break;case 11:t=Vc(n,t,t.pendingProps,t.type.render,t.ref,Z);break;case 5:$o(t);var r=t;r===Zi&&(K?(ia(r),r.tag===5&&r.stateNode!=null&&(Qi=r.stateNode)):(ia(r),K=!0));default:gl(n,t),t=X=ki(t,rd),t=sl(n,t,rd)}e.memoizedProps=e.pendingProps,t===null?$d(e):X=t}function Qd(e,t,n,r){da=ua=null,$o(t),Qa=null,$a=0;var i=t.return;try{if(Ec(e,i,t,n,Z)){id=1,xc(e,Ii(n,e.current)),X=null;return}}catch(t){if(i!==null)throw X=i,t;id=1,xc(e,Ii(n,e.current)),X=null;return}t.flags&32768?(K||r===1?e=!0:td||Z&536870912?e=!1:(ed=e=!0,(r===2||r===9||r===3||r===6)&&(r=wo.current,r!==null&&r.tag===13&&(r.flags|=16384))),ef(t,e)):$d(t)}function $d(e){var t=e;do{if(t.flags&32768){ef(t,ed);return}e=t.return;var n=ml(t.alternate,t,rd);if(n!==null){X=n;return}if(t=t.sibling,t!==null){X=t;return}X=t=e}while(t!==null);id===0&&(id=5)}function ef(e,t){do{var n=hl(e.alternate,e);if(n!==null){n.flags&=32767,X=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){X=e;return}X=e=n}while(e!==null);id=6,X=null}function tf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do uf();while(vd!==0);if(Xu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Zu&&(X=Zu=null,Z=0),bd=t,yd=e,xd=n,Cd=a,wd=r,nf(e,t,n,s,c,l,f)}}function nf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Sd=s,s|=_i,ft(e,n,s,r,i,a),Ed=null,(n&335544064)===n?(Dd=ka(e),r=10262):(Dd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf(Ue,function(){return df(),null})):(e.callbackNode=null,e.callbackPriority=0),Pl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=N.T,N.T=null,i=P.p,P.p=2,a=Xu,Xu|=4;try{lu(e,t,n)}finally{Xu=a,P.p=i,N.T=r}}vd=1,Pl?Td=Mp(o,e.containerInfo,Dd,of,sf,af,cf,df,rf,null,null):(of(),sf(),cf())}function rf(e){if(vd!==0){var t=yd.onRecoverableError;t(e,{componentStack:null})}}function af(){vd===3&&(vd=0,Au(bd,yd),vd=4)}function of(){if(vd===1){vd=0;var e=yd,t=bd,n=xd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=N.T,N.T=null;var i=P.p;P.p=2;var a=Xu;Xu|=4;try{ou=su=!1,Eu(t,e,n),n=cp;var o=Hr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Vr(s.ownerDocument.documentElement,s)){if(c!==null&&G(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Br(s,h),v=Br(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{Xu=a,P.p=i,N.T=r}}e.current=t,vd=2}}function sf(){if(vd===2){vd=0;var e=yd,t=bd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Xu;Xu|=4;try{du(e,t.alternate,t)}finally{Xu=i,P.p=r,N.T=n}}vd=3}}function cf(){if(vd===4||vd===3){vd=0;var e=Td;Td=null,Re();var t=yd,n=bd,r=xd,i=wd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?vd=5:(vd=0,bd=yd=null,lf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(_d=null),_t(r),n=n.stateNode,Ye&&typeof Ye.onCommitFiberRoot==`function`)try{Ye.onCommitFiberRoot(Je,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=N.T,a=P.p,P.p=2,N.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{N.T=n,P.p=a}}if(i=Ed,o=Dd,Dd=null,i!==null&&(Ed=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);xd&3&&uf(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===kd?Od++:(Od=0,kd=t):(Od=0,kd=null),Df(0,!1)}}function lf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ea(t)))}function uf(){return Td!==null&&(Td.skipTransition(),Td=null),of(),sf(),cf(),df()}function df(){if(vd!==5)return!1;var e=yd,t=Sd;Sd=0;var n=_t(xd),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=Cd,Cd=null;var o=yd,s=xd;if(vd=0,bd=yd=null,xd=0,Xu&6)throw Error(i(331));var c=Xu;if(Xu|=4,Gu(o.current),Lu(o,o.current,s,n),Xu=c,Df(0,!1),Ye&&typeof Ye.onPostCommitFiberRoot==`function`)try{Ye.onPostCommitFiberRoot(Je,o)}catch{}return!0}finally{P.p=a,N.T=r,lf(e,t)}}function ff(e,t,n){t=Ii(n,t),t=Cc(e.stateNode,t,2),e=uo(e,t,2),e!==null&&(dt(e,2),Ef(e))}function pf(e,t,n){if(e.tag===3)ff(e,e,n);else for(;t!==null;){if(t.tag===3){ff(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(_d===null||!_d.has(r))){e=Ii(n,e),n=wc(2),r=uo(t,n,2),r!==null&&(Tc(n,r,t,e),dt(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Yu;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(nd=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Zu===e&&(Z&n)===n&&(id===4||id===3&&(Z&62914560)===Z&&300>ze()-pd?Xu&2?sd|=n:Bd(e,0):sd|=n,ld===Z&&(ld=0)),Ef(e)}function gf(e,t){t===0&&(t=lt()),e=xi(e,t),e!==null&&(dt(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),gf(e,n)}function yf(e,t){return Fe(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ze(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=Z,a=at(r,r===Zu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ot(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&hp()&&(e=Tf);for(var t=ze(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}vd!==0&&vd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ze(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ct(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Zu,n=Z,n=at(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Qu===2||Qu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ie(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ot(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ie(r),_t(n)){case 2:case 8:n=He;break;case 32:n=Ue;break;case 268435456:n=Ge;break;default:n=Ue}return r=jf.bind(null,e),n=Fe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ie(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(vd!==0&&vd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(uf()&&e.callbackNode!==n)return null;var r=Z;return r=at(e,e===Zu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Pd(e,r,t),Af(e,ze()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(uf())return null;Pd(e,t,!0)}function Nf(){bp(function(){Xu&6?Fe(Ve,Of):kf()})}function Pf(){if(Tf===0){var e=Ma;e===0&&(e=tt,tt<<=1,!(tt&261888)&&(tt=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:pn(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[St]||null).action),o=r.submitter;o&&(t=(t=o[St]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Pn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==0){var e=new FormData(i,o);Ys(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Ys(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<ci.length;Lf++){var Rf=ci[Lf];li(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}li(ei,`onAnimationEnd`),li(ti,`onAnimationIteration`),li(ni,`onAnimationStart`),li(`dblclick`,`onDoubleClick`),li(`focusin`,`onFocus`),li(`focusout`,`onBlur`),li(ri,`onTransitionRun`),li(ii,`onTransitionStart`),li(ai,`onTransitionCancel`),li(oi,`onTransitionEnd`),Bt(`onMouseEnter`,[`mouseout`,`mouseover`]),Bt(`onMouseLeave`,[`mouseout`,`mouseover`]),Bt(`onPointerEnter`,[`pointerout`,`pointerover`]),Bt(`onPointerLeave`,[`pointerout`,`pointerover`]),zt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),zt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),zt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),zt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),zt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),zt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`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(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){mi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){mi(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[wt];n===void 0&&(n=t[wt]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,Lt.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!Cn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Kf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=jt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}bn(function(){var r=a,i=hn(n),s=[];a:{var c=si.get(e);if(c!==void 0){var l=Pn,u=e;switch(e){case`keypress`:if(kn(n)===0)break a;case`keydown`:case`keyup`:l=Qn;break;case`focusin`:u=`focus`,l=Un;break;case`focusout`:u=`blur`,l=Un;break;case`beforeblur`:case`afterblur`:l=Un;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Vn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Hn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=tr;break;case ei:case ti:case ni:l=Wn;break;case oi:l=nr;break;case`scroll`:case`scrollend`:l=In;break;case`wheel`:l=rr;break;case`copy`:case`cut`:case`paste`:l=Gn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=$n;break;case`submit`:l=er;break;case`toggle`:case`beforetoggle`:l=ir}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=xn(m,p),g!=null&&d.push(qf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==mn&&(u=n.relatedTarget||n.fromElement)&&(jt(u)||u[Ct]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?jt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Vn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=$n,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Nt(c),h=l==null?u:Nt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,jt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?C(c,l,Yf):null,c!==null&&Xf(s,u,c,d,!1),l!==null&&f!==null&&Xf(s,f,l,d,!0)))}a:{if(c=r?Nt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=wr;else if(vr(c)){if(Tr)_=Pr;else{_=Mr;var v=jr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&dn(r.elementType)&&(_=wr):_=Nr;if(_&&=_(e,r)){yr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Nt(r):window,e){case`focusin`:(vr(v)||v.contentEditable===`true`)&&(Wr=v,Gr=r,Kr=null);break;case`focusout`:Kr=Gr=Wr=null;break;case`mousedown`:qr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:qr=!1,Jr(s,n,i);break;case`selectionchange`:if(Ur)break;case`keydown`:case`keyup`:Jr(s,n,i)}var y;if(or)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else mr?fr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(lr&&n.locale!==`ko`&&(mr||b!==`onCompositionStart`?b===`onCompositionEnd`&&mr&&(y=On()):(Tn=i,En=`value`in Tn?Tn.value:Tn.textContent,mr=!0)),v=Jf(r,b),0<v.length&&(b=new Kn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=pr(n),y!==null&&(b.data=y)))),(y=cr?hr(e,n):gr(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new Kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),If(s,e,r,n,i)}Vf(s,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=xn(e,n),i!=null&&r.unshift(qf(e,i,a)),i=xn(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=xn(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=xn(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
10
+ `).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function $(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&sn(e,``+r);else return;break;case`className`:Gt(e,`class`,r);break;case`tabIndex`:Gt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Gt(e,n,r);break;case`style`:un(e,r,o);return;case`data`:if(t!==`object`){Gt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=pn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,a.name,a,null),$(e,t,`formEncType`,a.formEncType,a,null),$(e,t,`formMethod`,a.formMethod,a,null),$(e,t,`formTarget`,a.formTarget,a,null)):($(e,t,`encType`,a.encType,a,null),$(e,t,`method`,a.method,a,null),$(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=pn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=U);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=pn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`: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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),V(e,`popover`,r);break;case`xlinkActuate`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:V(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=fn.get(n)||n,V(e,n,r);else return}B=!0}function tp(e,t,n,r,a,o){switch(n){case`style`:un(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)sn(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=U);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Rt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[St]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}B=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):V(e,n,r)}return}B=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,o,s,n,null)}}a&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:$(e,t,r,d,n,null)}}tn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&rn(e,!!r,n,!0):rn(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:$(e,t,s,c,n,null)}on(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Q(zf[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,u,r,n,null)}return;default:if(dn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(B=!0),o=m;break;case`name`:m!==f&&(B=!0),a=m;break;case`checked`:m!==f&&(B=!0),u=m;break;case`defaultChecked`:m!==f&&(B=!0),d=m;break;case`value`:m!==f&&(B=!0),s=m;break;case`defaultValue`:m!==f&&(B=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}en(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(B=!0),p=o;break;case`defaultValue`:o!==l&&(B=!0),c=o;break;case`multiple`:o!==l&&(B=!0),s=o;default:o!==l&&$(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?rn(e,!!n,n?[]:``,!1):rn(e,!!n,t,!0)):rn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(B=!0),p=a;break;case`defaultValue`:a!==o&&(B=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&$(e,t,s,a,r,o)}an(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(B=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(dn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[xt]=r,n[St]=t,np(n,e,t),Ft(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ot]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:w({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return _(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return _(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=p(this._fragmentFiber);if(t===null)return!0;t=_(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=_(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=p(this._fragmentFiber);e!==null&&(e=_(e),e=lp(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=_(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=_(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=_(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=_(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=p(this._fragmentFiber);return t===null?this:_(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=p(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=_(t);if(n.length===0){if(n=r,m(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=h(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=_(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=_(n[0]),i=_(n[n.length-1]);var a=m(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=jt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=p(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=C(n,a,S),t===null?t=!1:(f(t,!0,b,a,n),a=v,v=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=C(r,a,S),t===null?t=!1:(f(t,!0,x,a,r),a=v,y=v=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=h(this._fragmentFiber);if(r=n?r[1]||r[0]||p(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=_(r),Zp(e,n);return}if(r=_(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=_(a),Zp(a,n)):_(a).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=_(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),At(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Ot])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&$(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===U&&(e.onclick=null),At(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);At(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=P.d;P.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Rd();return e||t}function Cm(e){var t=Mt(e);t!==null&&t.tag===5&&t.type===`form`?Zs(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=$t(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Ft(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+$t(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+$t(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+$t(n.imageSizes)+`"]`)):i+=`[href="`+$t(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=w({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[kt]=!0,o.onload=o.onerror=function(){It(o)}),Ft(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+$t(r)+`"][href="`+$t(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=w({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Ft(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Pt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=w({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Ft(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Pt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=w({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Ft(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Pt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=w({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Ft(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=Ce.current)?bm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Pt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=Pt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Pt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pm(e){return`href="`+$t(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[kt]){r.loading=1;return}}else t=e.createElement(`link`),t[kt]=!0,t.onload=t.onerror=It.bind(null,t),np(t,`link`,n),Ft(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+$t(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+$t(n.href)+`"]`);if(r)return t.instance=r,Ft(r),r;var a=w({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ft(r),np(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,Ft(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),Ft(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,Ft(a),a):(r=n,(a=vm.get(o))&&(r=w({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ft(a),np(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ot]||a[xt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ft(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Ft(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:A,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ut(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ut(0),this.hiddenUpdates=ut(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ei(3,null,null,t),e.current=a,a.stateNode=e,t=Ta(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},so(a),e}function uh(e){return e?(e=wi,e):wi}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=lo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=uo(e,r,t),n!==null&&(Nd(n,e,t),fo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=xi(e,67108864);t!==null&&Nd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=Ad();t=gt(t);var n=xi(e,t);n!==null&&Nd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,yh(e,t,n,r)}finally{P.p=a,N.T=i}}function vh(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,yh(e,t,n,r)}finally{P.p=a,N.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Kf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Mt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=it(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ze(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(Xu&6)&&(hd=ze()+500,Df(0,!1))}}break;case 31:case 13:s=xi(a,2),s!==null&&Nd(s,a,2),Rd(),ph(a,2)}if(a=bh(r),a===null&&Kf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function bh(e){return e=hn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=jt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Be()){case Ve:return 2;case He:return 8;case Ue:case We:return 32;case Ge:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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 Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Mt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=jt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,yt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,yt(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);mn=r,n.target.dispatchEvent(r),mn=null}else return t=Mt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Mt(n);a!==null&&(e.splice(t,3),t-=3,Ys(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[St]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[St]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dh(n,Ad(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Rd(),t[Ct]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=vt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.1`)throw Error(i(527,Kh,`19.3.1`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Je=Jh.inject(qh),Ye=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=vc,s=yc,c=bc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[Ct]=t.current,Wf(e),new Wh(t)}})),Lr=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ir()})),W=e(ie(),1),Rr=Lr();function zr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Br(e){if(e?.some(e=>e.trim().toLowerCase()===`report`))return`The report embed tab has been retired. Remove report from the allowed tabs; explicitly configure overview to display AI Visibility.`}function Vr(e){return e.length<4}function Hr(e){return e!==``&&/^[\w./:@%+=,-]+$/.test(e)?e:`'${e.replace(/'/g,`'\\''`)}'`}var G=P(),Ur=(0,W.createContext)({view:null,publish:()=>()=>{}});function Wr({children:e}){let[t,n]=(0,W.useState)(null),r=(0,W.useCallback)(e=>(n(e),()=>n(t=>t===e?null:t)),[]);return(0,G.jsx)(Ur.Provider,{value:(0,W.useMemo)(()=>({view:t,publish:r}),[t,r]),children:e})}function Gr(e,t){let{publish:n}=(0,W.useContext)(Ur),r=JSON.stringify(t);(0,W.useEffect)(()=>n({project:e,context:JSON.parse(r)}),[n,e,r])}function Kr(e,t){let{view:n}=(0,W.useContext)(Ur);return n?.project===e&&n.context.view===t.view?n.context:t}function qr(e){let t=e.replace(/\/+$/,``)||`/`;return t===`/`?`overview`:t===`/projects`?`projects`:t.startsWith(`/projects/`)?`project`:t===`/runs`?`runs`:t===`/traffic`||t.startsWith(`/traffic/`)?`traffic`:t===`/backlinks`?`backlinks`:t===`/settings`?`settings`:t===`/setup`?`setup`:`other`}function Jr(e,t){return!t||t.includes(e)}var Yr=[`overview`,`search-console`,`seo-data`,`local`,`activity`,`backlinks`,`technical-aeo`,`history`,`settings`],Xr=new Set(Yr);function Zr(e){if(Br(e))return[];let t=[...new Set((e??Yr).filter(e=>Xr.has(e)))];return t.length>0?t:[`overview`]}function Qr(e){return e?Zr(e.projectTabs):void 0}function $r(e,t){return Jr(e,t)||!t?e:t.includes(`overview`)?`overview`:t[0]??`overview`}function ei(e){let t=e?.queries?.limit;return typeof t==`number`&&Number.isInteger(t)&&t>0?t:void 0}function ti(e,t){return e===`client-queries`?ei(t)===void 0?t?$r(`overview`,Qr(t)):`queries`:e:$r(e,Qr(t))}var ni=`canonry:embed-project-tab`;function ri(e){let t=e.replace(/\/+$/,``);return/^\/projects\/[^/]+\/[a-z-]+$/.test(t)?t:null}function ii(e,t){let n=e.replace(/\/+$/,``);return!t||!/^\/projects\/[^/]+$/.test(n)?null:t.startsWith(`${n}/`)&&ri(t)===t?t:null}function ai(){try{return window.sessionStorage.getItem(ni)}catch{return null}}function oi(e){try{e?window.sessionStorage.setItem(ni,e):window.sessionStorage.removeItem(ni)}catch{}}var si={bg:`--canonry-embed-bg`,fg:`--canonry-embed-fg`,accent:`--color-link`},ci=/^(?:#(?:[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 li(e){let t=e?.mode?.trim();return t===`light`||t===`dark`?t:void 0}function ui(e){if(!e)return{};let t={};for(let[n,r]of Object.entries(e)){let e=Object.hasOwn(si,n)?si[n]:void 0;if(!e||typeof r!=`string`)continue;let i=r.trim();ci.test(i)&&(t[e]=i)}return t}function di(e){return e.state===`ok`?`positive`:e.state===`checking`||e.state===`disabled`?`neutral`:`negative`}function fi(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 pi(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`}}var mi={positive:`text-positive-400`,caution:`text-caution-400`,negative:`text-negative-400`,neutral:`text-secondary`};function hi(e){return e>=50?`positive`:e>=25?`caution`:`negative`}function gi(e){return e.state===`ready`&&ct(e)}function _i(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function vi(e){let t=[e.detail,e.hint].filter(Boolean);return t.length>0?t.join(`
11
+ `):void 0}function yi(e,t,n){let r=e.filter(e=>e.id!==`mcp`).map(e=>{if(e.id===`api`)return{...e,tone:di(t.apiStatus),detail:t.apiStatus.state===`ok`?`Healthy`:`Needs attention`,meta:t.apiStatus.detail};if(e.id===`worker`)return{...e,tone:di(t.workerStatus),detail:t.workerStatus.state===`ok`?`Healthy`:t.workerStatus.state===`disabled`?`Disabled`:`Needs attention`,meta:t.workerStatus.detail};let r=n.providerStatuses.filter(e=>e.state===`ready`).length,i=n.providerStatuses.length,a=n.providerStatuses.some(gi),o=n.providerStatuses.filter(e=>e.state===`ready`).map(e=>_i(e)).join(` · `);return{...e,label:`Providers`,tone:a?`positive`:`caution`,detail:`${r} of ${i} configured`,meta:o||`None configured`}}),i=t.apiStatus.mcp,a={id:`mcp`,label:`MCP`,tone:`neutral`,detail:`Unknown`,meta:`MCP status is not available from this server.`};return t.apiStatus.state===`checking`?(a.detail=`Checking`,a.meta=`Checking MCP availability.`):t.apiStatus.state===`ok`&&i&&(i.status===`available`?(a.tone=`positive`,a.detail=`Available`,a.meta=`MCP is available for agent connections. This checks the server transport, not an individual client connection.`):i.status===`unavailable`?(a.tone=`negative`,a.detail=`Unavailable`,a.meta=`The MCP transport is not fully available. Contact your Canonry team.`):(a.detail=`Not enabled`,a.meta=`This server does not provide an MCP endpoint.`)),r.splice(Math.max(0,r.findIndex(e=>e.id===`api`)+1),0,a),r}function bi(e,t){if(e.apiStatus.state!==`ok`)return`Launch is blocked until the API responds cleanly.`;if(e.apiStatus.databaseConfigured===!1)return`Launch is blocked until the API has a database connection configured.`;if(e.workerStatus.state!==`ok`)return`Launch is blocked until the worker is healthy and heartbeats are current.`;if(!t.providerStatuses.some(gi))return`Launch is blocked until at least one provider is configured.`}function xi(e,t,n){let r=bi(t,n),i=structuredClone(e);return i.healthChecks=i.healthChecks.map(e=>{if(e.id===`api`)return{...e,detail:t.apiStatus.detail,state:t.apiStatus.state===`ok`?`ready`:`attention`};if(e.id===`worker`)return{...e,detail:t.workerStatus.detail,state:t.workerStatus.state===`ok`?`ready`:`attention`};let r=n.providerStatuses.some(gi);return{...e,detail:r?`At least one provider configured.`:`No providers configured.`,state:r?`ready`:`attention`}}),i.launchState.enabled=r===void 0,i.launchState.blockedReason=r,i.launchState.summary=r??`Queue an AI Visibility check first, then follow with a Technical AEO audit to explain movement.`,i}var Si=`canonry.run-tracker`,Ci=new Set,wi=!1,Ti=0,Ei={runs:{},batches:{}};function Di(){let e=Mi();for(let t of Ci)t(e)}function Oi(e){if(!e)return{runs:{},batches:{}};try{let t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function ki(){typeof window<`u`&&window.sessionStorage.setItem(Si,JSON.stringify(Ei))}function Ai(){wi||(wi=!0,typeof window<`u`&&(Ei=Oi(window.sessionStorage.getItem(Si))))}function ji(e){Ei=e,ki(),Di()}function Mi(){return Ai(),Ei}function Ni(e){return Ai(),Ci.add(e),()=>{Ci.delete(e)}}function Pi(e){let t=Mi();ji({...t,runs:{...t.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 Fi(e){let t=Mi();if(!t.runs[e])return;let{[e]:n,...r}=t.runs;ji({...t,runs:r})}function Ii(e){let t=Mi(),n=`batch_${Date.now()}_${++Ti}`;return ji({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function Li(e){let t=Mi();if(!t.batches[e])return;let{[e]:n,...r}=t.batches;ji({...t,batches:r})}function Ri(e){return e===`completed`||e===`partial`||e===`failed`||e===`cancelled`}var zi=6e5;function Bi(e,t,n,r){return e.filter(e=>!t.has(e.runId)&&n-(e.trackedAt??0)>=r)}function Vi(e,t){let n=0,r=0,i=0,a=0,o=0;for(let s of e){let e=t[s]?.status;e===`completed`?n+=1:e===`partial`?r+=1:e===`failed`?i+=1:e===`cancelled`?a+=1:o+=1}return{completed:n,partial:r,failed:i,cancelled:a,pending:o,finished:o===0}}var Hi=220;function Ui({compact:e=!1,version:t,updateAvailable:n,onDismissUpdate:r}){let i=!e&&t&&t!==`unknown`,[a,o]=(0,W.useState)(!1),s=!e&&n&&r;return e?(0,G.jsxs)(R,{to:`/`,className:`brand-lockup brand-lockup-compact`,"aria-label":`Canonry home`,children:[(0,G.jsx)(`img`,{className:`brand-icon`,src:`./favicon.svg`,alt:``,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`brand-copy`,children:(0,G.jsx)(`span`,{className:`brand-mark`,children:`Canonry`})})]}):(0,G.jsxs)(`div`,{className:`brand-lockup brand-lockup-wrapper`,children:[(0,G.jsx)(R,{to:`/`,className:`brand-icon-link`,"aria-label":`Canonry home`,tabIndex:-1,children:(0,G.jsx)(`img`,{className:`brand-icon`,src:`./favicon.svg`,alt:``,"aria-hidden":`true`})}),(0,G.jsxs)(`div`,{className:`brand-copy`,children:[(0,G.jsx)(R,{to:`/`,className:`brand-mark`,children:`Canonry`}),!s&&i?(0,G.jsxs)(`span`,{className:`brand-version`,children:[`v`,t]}):null]}),s?(0,G.jsxs)(`span`,{className:`brand-update-bubble ${a?`brand-update-bubble-closing`:``}`,role:`status`,"aria-live":`polite`,children:[(0,G.jsxs)(`a`,{className:`brand-update-bubble-link`,href:n.url,target:`_blank`,rel:`noopener noreferrer`,title:`Open release: ${n.upgradeCommand}`,"aria-label":`New version v${n.latest} available — open release page`,children:[(0,G.jsxs)(`span`,{className:`brand-update-bubble-from`,children:[`v`,n.current]}),(0,G.jsx)(w,{className:`brand-update-bubble-arrow size-3`,"aria-hidden":`true`}),(0,G.jsxs)(`span`,{className:`brand-update-bubble-to`,children:[`v`,n.latest]})]}),(0,G.jsx)(`button`,{type:`button`,className:`brand-update-bubble-dismiss`,onClick:()=>{o(!0),window.setTimeout(()=>{r?.(),o(!1)},Hi)},"aria-label":`Dismiss update notification for v${n.latest}`,children:(0,G.jsx)(ae,{className:`size-3`,"aria-hidden":`true`})})]}):null]})}var Wi=`__cited__`,Gi=`__mentioned__`,Ki=`__mentionShare__`;function qi(e){let t=e,{dataStartDate:n,dataEndDate:r}=t;return typeof n!=`string`||typeof r!=`string`?null:{start:Er(n),end:Er(r),sweepCount:t.sweepCount??1}}function Ji(e,t=new Date){return Kn(e,t)}function Yi(e,t=new Date){let n=qi(e);if(!n)return null;let r=Ji(n.start,t),i=Ji(n.end,t);return r===i?r:`${r} to ${i}`}function Xi(e,t=new Date){let n=qi(e),r=Yi(e,t);return!n||!r?`Check date unavailable`:`${r} · ${n.sweepCount} ${n.sweepCount===1?`check`:`checks`}`}function Zi(e){let t=qi(e);return t?Wn(t.start):``}function Qi(e){return e.trim().toLowerCase()}function K(e,t={}){return e.map(e=>{let n=e.trim().toLowerCase(),r=(t[e]??[]).map(e=>e.trim().toLowerCase()).filter(Boolean).sort();return n&&r.length>0?`${n}=${r.join(`|`)}`:n}).filter(Boolean).sort().join(`
12
+ `)}var $i={claude:`Claude`,openai:`OpenAI`,gemini:`Gemini`,perplexity:`Perplexity`,muse:`Muse`,local:`Local`,openrouter:`OpenRouter`};function ea(e,t){let n=t?.find(t=>t.name===e)?.displayName?.trim();if(n)return n;let r=it(e);return r?`${r} via OpenRouter`:$i[Qi(e)]??e.charAt(0).toUpperCase()+e.slice(1)}function ta(e){return Math.round(e*1e3)/10}function na(e){return e.byProvider??{}}function ra(e,t,n){let r=e.buckets.length>0,i=e.buckets.length===1;if(n===`overall`){let n=t===`cited`?Wi:Gi,a=t===`cited`?`citationRate`:`mentionRate`;return{rows:e.buckets.map(e=>({date:e.startDate,[n]:ta(e[a])})),series:[n],hasData:r,singleBucket:i}}let a=t===`mentioned`?`mentionRate`:`citationRate`,o=[...new Set(e.buckets.flatMap(e=>Object.keys(na(e))))].sort();return{rows:e.buckets.map(e=>{let t={date:e.startDate},n=na(e);for(let e of o){let r=n[e];t[e]=r?ta(r[a]):null}return t}),series:o,hasData:r,singleBucket:i}}function ia(e){let t=e;return Object.hasOwn(t,`modelEvidenceByProvider`)?t.modelEvidenceByProvider??{}:null}function aa(e){let t=e;return Object.hasOwn(t,`modelAttribution`)?t.modelAttribution??{}:null}function oa(e){return e.servedModelAttribution??{}}function sa(e){return e.modelServiceMismatch??{}}function ca(e){return e.modelPointerChanges??{}}function la(e){return e.length<=1?e[0]??``:`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`}function ua(e){switch(e.status){case`known`:return e.model;case`unknown`:return`Unknown model`;case`mixed`:return e.models.length===0?`Unknown model`:`${e.models.join(`, `)}${e.includesUnknown?` and an unknown model`:``}`}}function da(e){return la([...e.models,...e.includesUnknown?[`an unknown model`]:[]])}function fa(e){let t=new Map;for(let[n,r]of Object.entries(e))for(let e of r.events){let r=t.get(e.bucketStartDate)??[];r.push({provider:n,event:e}),t.set(e.bucketStartDate,r)}return[...t.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({bucketStartDate:e,events:[...t].sort((e,t)=>e.provider.localeCompare(t.provider)||e.event.observedAt.localeCompare(t.event.observedAt))}))}function pa(e){let t={},n=[];for(let[r,i]of Object.entries(e)){let e=i.events.filter(e=>!e.fromPreWindowAnchor);for(let e of i.events)e.fromPreWindowAnchor&&n.push({provider:r,event:e});e.length>0&&(t[r]={...i,events:e})}return{buckets:fa(t),beforeWindow:n.sort((e,t)=>e.event.observedAt.localeCompare(t.event.observedAt)||e.provider.localeCompare(t.provider))}}function ma(e){let t=[];for(let[n,r]of Object.entries(e)){let e=r.eventTotal??r.events.length;e>r.events.length&&t.push({provider:n,shown:r.events.length,total:e})}return t.sort((e,t)=>e.provider.localeCompare(t.provider))}function ha(e){let t=e.buckets.map(e=>{let t=e.mentionShare;return{date:e.startDate,[Ki]:t?.rate==null?null:ta(t.rate)}}),n=t.map(e=>e[Ki]).filter(e=>typeof e==`number`&&Number.isFinite(e));return{rows:t,series:[Ki],hasData:n.length>0,singleBucket:n.length===1}}function ga(e,t,n){return t===`mentionShare`?ha(e):ra(e,t,n)}function _a(e,t){if(t===`mentionShare`)return e.buckets.flatMap(e=>{let t=e.mentionShare?.rate;return typeof t==`number`&&Number.isFinite(t)?[t]:[]});let n=t===`cited`?`citationRate`:`mentionRate`;return e.buckets.map(e=>e[n])}function va(e,t){let n=e.windowChange;if(!n)return null;switch(t){case`cited`:return n.citationRate;case`mentioned`:return n.mentionRate;case`mentionShare`:return n.mentionShare}}function ya(e,t,n){let r=n===`mentioned`?`mentionRate`:`citationRate`;for(let n=e.buckets.length-1;n>=0;n--){let i=na(e.buckets[n])[t];if(i)return i[r]}return null}function q(e){return Date.parse(e)}function ba(e,t){let n=qi(e);if(!n)return!1;let r=q(t);return r>=q(n.start)&&r<=q(n.end)}function xa(e){return e.basketChanges??[]}function Sa(e,t){return t.filter(t=>ba(e,t.at)).sort((e,t)=>q(e.at)-q(t.at))}function Ca(e,t){return Qi(e)===`perplexity`&&t.status===`known`&&!t.model.includes(`/`)}function wa(e){return Object.entries(e).filter(([e,t])=>!Ca(e,t.configured)).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({provider:e,mismatch:t}))}function Ta(e){return[...xa(e)].sort((e,t)=>q(t.at)-q(e.at)).map(e=>({at:Er(e.at),added:e.added,removed:e.removed}))}function Ea(e,t){let n=[...e.events].sort((e,t)=>q(e.observedAt)-q(t.observedAt)),r=n[0]?.from??e.latestObservation.state;for(let e of n)q(e.observedAt)<=q(t)&&(r=e.to);return r}function Da(e,t,n,r){return{provider:e,at:Er(t.observedAt),onOrBefore:t.fromPreWindowAnchor===!0,anchorAt:t.anchorObservedAt?Er(t.anchorObservedAt):null,from:t.from,to:t.to,served:n,reroute:r}}function Oa(e,t){let n=[];for(let[r,i]of Object.entries(e)){let e=t[r]?.events??[],a=new Set(i.events.map(e=>e.observedAt));for(let t of i.events){let i=Ca(r,t.to)?e.find(e=>e.observedAt===t.observedAt):void 0;n.push(Da(r,t,i?{from:i.from,to:i.to}:null,!1))}for(let t of e)a.has(t.observedAt)||Ca(r,Ea(i,t.observedAt))&&n.push(Da(r,t,null,!0))}return n.sort((e,t)=>q(t.at)-q(e.at)||e.provider.localeCompare(t.provider))}function ka({latest:e,queryChanges:t,modelRows:n,now:r=new Date}){let i=[...t.map(e=>e.at),...n.map(e=>e.at)];if(i.length===0)return null;let a=t=>e!==void 0&&ba(e,t),o=t.filter(e=>a(e.at)),s=o.reduce((e,t)=>e+t.added.length,0),c=o.reduce((e,t)=>e+t.removed.length,0),l=n.filter(e=>a(e.at)).length,u=e?Yi(e,r):null;if(u===null||s+c+l===0)return`No changes since ${Ji(i.reduce((e,t)=>q(t)>q(e)?t:e),r)}`;let d=[u];return s>0&&d.push(`${s} ${s===1?`query`:`queries`} added`),c>0&&d.push(`${c} ${c===1?`query`:`queries`} removed`),l>0&&d.push(`${l} new ${l===1?`model`:`models`}`),d.join(` · `)}function Aa(e,t,n,r=null){let i=q(e);if(!Number.isFinite(i))return null;let a=t.filter(e=>q(e)<i);if(a.length>0)return Er(a.reduce((e,t)=>q(t)>q(e)?t:e));let o=n.map(e=>qi(e)).filter(e=>e!==null).sort((e,t)=>q(e.start)-q(t.start)),s=o.findIndex(e=>q(e.start)<=i&&i<=q(e.end));if(s===-1)return null;let c=o[s];return q(c.start)===i?s>0?o[s-1].end:r&&q(r)<i?Er(r):null:c.sweepCount===2&&q(c.end)===i?c.start:null}function ja(e){let t=new Map,n=(e,n)=>{let r=t.get(e);r?r.push(n):t.set(e,[n])};for(let t of[...e].sort((e,t)=>e.revision-t.revision)){let e=q(t.at);for(let r of t.removed)n(r,{at:e,member:!1});for(let r of t.added)n(r,{at:e,member:!0})}return new Map([...t].filter(([,e])=>e.at(-1).member))}function Ma(e,t){let n=!e[0].member;for(let r of e)r.at<=t&&(n=r.member);return n}function Na(e,t,n){return e.some(e=>e.at>t&&e.at<=n)}function Pa(e,t){let n=q(t.start),r=q(t.end);return t.sweepCount>2?Na(e,n,r):Ma(e,n)!==Ma(e,r)}function Fa(e,t,n,r){let i=q(t),a=q(n),o={added:[],removed:[],removedAndAddedBack:[],addedAndRemovedAgain:[]},s=new Set;for(let[t,n]of ja(e)){if(!r(n))continue;s.add(t);let e=Ma(n,i),c=Ma(n,a);e===c?(e?o.removedAndAddedBack:o.addedAndRemovedAgain).push(t):(c?o.added:o.removed).push(t)}if(s.size===0)return null;let c=e=>[...e.added,...e.removed].some(e=>s.has(e)),l=e.filter(e=>q(e.at)>i&&q(e.at)<=a&&c(e)).sort((e,t)=>q(e.at)-q(t.at));return{changes:l,keys:[...new Set(l.flatMap(e=>[...e.added,...e.removed]))].filter(e=>s.has(e)),moves:o}}function Ia(e,t){if(e.length<2)return null;let n=e[0],r=e.at(-1),i=qi(n),a=qi(r),o=i?.start??n.startDate,s=a?.end??r.endDate,c=Fa(t,o,s,e=>Ma(e,q(o))!==Ma(e,q(s))||i!==null&&Pa(e,i)||a!==null&&Pa(e,a));return!c&&n.queryCount===r.queryCount?null:{...c??{changes:[],keys:[],moves:{added:[],removed:[],removedAndAddedBack:[],addedAndRemovedAgain:[]}},firstCount:n.queryCount,latestCount:r.queryCount}}function La(e,t){let n=qi(e);if(!n)return null;let r=Fa(t,n.start,n.end,e=>Pa(e,n));return r?{...r,firstCount:e.queryCount,latestCount:e.queryCount}:null}function Ra(e){return`${e} ${e===1?`query`:`queries`}`}function za(e){let t=[],n=e=>t.length===0?Ra(e):String(e);return e.added.length>0&&t.push(`${n(e.added.length)} added`),e.removed.length>0&&t.push(`${n(e.removed.length)} removed`),e.removedAndAddedBack.length>0&&t.push(`${Ra(e.removedAndAddedBack.length)} removed and added back`),e.addedAndRemovedAgain.length>0&&t.push(`${Ra(e.addedAndRemovedAgain.length)} added and removed again`),la(t)}function Ba(e,t,n,r){return e?t!==`mentionShare`||n!==`non-brand`||!r?!1:e.keys.length>0&&e.keys.every(e=>r(e)===`branded`):!0}function Va({provider:e}){let t={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`,muse:`border-indigo-800/50 bg-indigo-950/40 text-indigo-300`,local:`border-purple-800/50 bg-purple-950/40 text-purple-300`},n=Object.hasOwn(t,e)?`provider-badge--${e} ${t[e]}`:`border-zinc-700 bg-zinc-800 text-zinc-300`;return(0,G.jsx)(`span`,{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ${n}`,children:Je(e)?ea(e):e})}function Ha({status:e}){return(0,G.jsx)(bn,{tone:fi(e),children:Jn(e)})}var Ua=he,Wa=fe,Ga=W.forwardRef(({className:e,...t},n)=>(0,G.jsx)(ce,{ref:n,className:qt(`fixed inset-0 z-50 bg-overlay-scrim/70 backdrop-blur-sm`,e),...t}));Ga.displayName=ce.displayName;var Ka=400,qa=1200,Ja=720,Ya=W.forwardRef(({className:e,children:t,...n},r)=>{let[i,a]=W.useState(Ja),o=W.useRef(!1),s=W.useRef(0),c=W.useRef(0),l=W.useCallback(e=>{o.current=!0,s.current=e.clientX,c.current=i,e.target.setPointerCapture(e.pointerId),e.preventDefault()},[i]),u=W.useCallback(e=>{if(!o.current)return;let t=s.current-e.clientX,n=Math.min(qa,Math.max(Ka,c.current+t));a(n)},[]),d=W.useCallback(()=>{o.current=!1},[]);return(0,G.jsxs)(Wa,{children:[(0,G.jsx)(Ga,{}),(0,G.jsxs)(pe,{ref:r,className:qt(`fixed z-50 flex flex-col bg-bg 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-base`,e),style:{width:`min(${i}px, 100vw)`},...n,children:[(0,G.jsx)(`div`,{className:`absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-mono-700/50 active:bg-mono-600/50 transition-colors max-md:hidden`,onPointerDown:l,onPointerMove:u,onPointerUp:d}),t,(0,G.jsxs)(de,{className:`absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-muted transition hover:bg-bg-elevated hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:[(0,G.jsx)(ae,{className:`size-4`}),(0,G.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})});Ya.displayName=pe.displayName;var Xa=({className:e,...t})=>(0,G.jsx)(`div`,{className:qt(`flex flex-col gap-1.5 pr-10`,e),...t}),Za=W.forwardRef(({className:e,...t},n)=>(0,G.jsx)(me,{ref:n,className:qt(`text-lg font-medium text-primary`,e),...t}));Za.displayName=me.displayName;var Qa=W.forwardRef(({className:e,...t},n)=>(0,G.jsx)(ue,{ref:n,className:qt(`text-sm text-muted`,e),...t}));Qa.displayName=ue.displayName;function $a({title:e,subtitle:t,children:n,open:r,onClose:i}){return(0,G.jsx)(Ua,{open:r,onOpenChange:e=>e?void 0:i(),children:(0,G.jsxs)(Ya,{children:[(0,G.jsxs)(Xa,{className:`drawer-head`,children:[(0,G.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:t}),(0,G.jsx)(Za,{id:`drawer-title`,children:e}),(0,G.jsx)(Qa,{className:`sr-only`,children:t})]}),(0,G.jsx)(`div`,{className:`drawer-body`,children:n})]})})}var eo={label:`Different subject`,project:`The answer uses your name, but sentiment found it is about something else, so it does not count as a mention.`,property:`The answer uses this Property’s name, but sentiment found it is about something else, so it does not count as a mention.`};function to(e){let t=(e??``).trim();return t&&(t.startsWith(`/`)||/^https?:\/\//i.test(t)||/^mailto:/i.test(t))?t:null}function no({url:e,title:t}){let n=to(e),r=n&&/^https?:\/\//i.test(n)?n:null;return(0,G.jsxs)(`span`,{className:`block min-w-0 text-sm leading-6 [overflow-wrap:anywhere]`,children:[t&&t!==e?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`mb-1 block font-medium text-heading`,children:t}),` `]}):null,r?(0,G.jsx)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer`,className:`text-link underline underline-offset-2 hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:e}):(0,G.jsx)(`span`,{className:`text-secondary`,children:e})]})}function ro(e){return[...e.mentionedCompetitorTerms??(e.mentionedCompetitorDomains??[]).flatMap(e=>{let t=Ue(e);return t.length>=4?[t]:[]}),...e.recommendedCompetitors??[]].filter(e=>e.trim().length>2)}var io=/[\s\-_]+/;function ao(e){let t=e.split(io).filter(Boolean);return t.length===0?null:t.map(zr).join(`[\\s\\-_]*`)}function oo(e,t){let n=so(t),r=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(e=>e.startsWith(`**`)&&e.endsWith(`**`)?{type:`bold`,value:e.slice(2,-2)}:{type:`text`,value:e}),i=n.flatMap(e=>e.terms).filter(e=>e.trim().length>1);if(i.length===0)return r.map((e,t)=>e.type===`bold`?W.createElement(`strong`,{key:`b-${t}`,className:`text-strong font-semibold`},e.value):e.value).filter(Boolean);let a=[...i].sort((e,t)=>t.length-e.length).map(ao).filter(e=>!!e);if(a.length===0)return r.map((e,t)=>e.type===`bold`?W.createElement(`strong`,{key:`b-${t}`,className:`text-strong font-semibold`},e.value):e.value).filter(Boolean);let o=RegExp(`(${a.join(`|`)})`,`gi`),s=new Map;for(let e of n)for(let t of e.terms){let n=On(t);n&&!s.has(n)&&s.set(n,e.className)}return r.flatMap((e,t)=>e.value.split(o).map((n,r)=>{if(!n)return null;if(r%2==1){let i=s.get(On(n))??`answer-highlight`;return e.type===`bold`?W.createElement(`mark`,{key:`hl-${t}-${r}`,className:i},W.createElement(`strong`,{className:`text-strong font-semibold`},n)):W.createElement(`mark`,{key:`hl-${t}-${r}`,className:i},n)}return e.type===`bold`?W.createElement(`strong`,{key:`b-${t}-${r}`,className:`text-strong font-semibold`},n):n})).filter(Boolean)}function so(e){return e.length===0?[]:typeof e[0]==`string`?[{terms:e,className:`answer-highlight`}]:e}function co(e,t){let n=e.mentionedCompetitorDomains===void 0?t:e,r=n?.mentionedCompetitorTerms;return{citedCompetitorDomains:[...e.citedCompetitorDomains??t?.citedCompetitorDomains??[]],mentionedCompetitorDomains:[...n?.mentionedCompetitorDomains??[]],...r===void 0?{}:{mentionedCompetitorTerms:[...r]}}}function lo(e,t){switch(e){case`new`:return`First observation`;case`emerging`:return`First mention`;case`lost`:return`Lost since last run`;default:return t===`mentioned`||t===`visible`?`Mentioned in latest run`:t===`pending`?`Awaiting first run`:`Not mentioned in latest run`}}function uo({evidence:e,project:t,onClose:n}){let[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(`mentions`),[s,c]=(0,W.useState)(-1),[l,u]=(0,W.useState)(null),[d,f]=(0,W.useState)(!1),[p,m]=(0,W.useState)({}),h=Et(t.project),g=new Set(h.map(Pe)),_=e.runHistory,v=_.length>1,[y,b]=(0,W.useState)(null),x=(0,W.useRef)(!1);(0,W.useEffect)(()=>{if(x.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;let t=_.at(-1);t&&(x.current=!0,$e(t.runId).then(n=>{let r=n.snapshots?.find(t=>t.query===e.query&&t.provider===e.provider);r&&b({citationState:r.citationState,answerMentioned:r.answerMentioned,visibilityState:r.visibilityState,visibilityTransition:t.visibilityTransition,provider:r.provider,model:r.model??e.model,answerSnippet:r.answerText??e.answerSnippet,citedDomains:r.citedDomains??e.citedDomains,...co(r,e),recommendedCompetitors:r.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:r.matchedTerms??e.matchedTerms??[],mentionIdentity:r.mentionIdentity??null,groundingSources:r.groundingSources??e.groundingSources,searchQueries:r.searchQueries,evidenceUrls:r.citedUrls??[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,_]);let S=s>=0&&l!==null,C=S?l:y||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:_.at(-1)?.visibilityTransition,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,...co(e),recommendedCompetitors:e.recommendedCompetitors??[],matchedTerms:e.matchedTerms??[],mentionIdentity:e.mentionIdentity??null,groundingSources:e.groundingSources,searchQueries:e.searchQueries??[],evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},w=C.visibilityState===`pending`||C.citationState===`pending`,T=w?!1:C.visibilityState==null?C.answerMentioned==null?C.citationState===Cn.cited||C.citationState===`emerging`:C.answerMentioned:C.visibilityState===`visible`,E=C.answerMentioned!=null||C.visibilityState!=null||C.mentionedCompetitorDomains.length>0||C.recommendedCompetitors.length>0,D=C.citedDomains.length>0||C.citedCompetitorDomains.length>0||C.groundingSources.length>0||C.evidenceUrls.length>0,O=t.project.displayName||t.project.name,ee=[...h.map(Pe),O,O.split(` `).slice(0,2).join(` `),...C.matchedTerms].filter(e=>e.trim().length>2),te=ro(C),k=[{terms:ee,className:`answer-highlight-brand`},...te.length>0?[{terms:te,className:`answer-highlight-competitor`}]:[]],A=w?`pending`:C.visibilityTransition===`lost`?`lost`:T?`mentioned`:`not-mentioned`,re=(0,W.useRef)(0),ie=(0,W.useCallback)(async t=>{let n=++re.current;if(t===-1||t===_.length-1){c(-1),u(null),i(!1);return}c(t),i(!1);let r=_[t],a=`${r.runId}::${e.query}::${e.provider}`;if(p[a])u(p[a]);else{f(!0);try{let t=await $e(r.runId);if(n!==re.current)return;let i=t.snapshots?.find(t=>t.query===e.query&&t.provider===e.provider)??t.snapshots?.find(t=>t.query===e.query),o=i?{citationState:i.citationState,answerMentioned:i.answerMentioned,visibilityState:i.visibilityState,visibilityTransition:r.visibilityTransition,provider:i.provider,model:i.model??null,answerSnippet:i.answerText??``,citedDomains:i.citedDomains,...co(i),recommendedCompetitors:i.recommendedCompetitors??[],matchedTerms:i.matchedTerms??[],mentionIdentity:i.mentionIdentity??null,groundingSources:i.groundingSources,searchQueries:i.searchQueries,evidenceUrls:i.citedUrls??[],changeLabel:lo(r.mentionTransition??r.visibilityTransition,r.mentionState??r.visibilityState),summary:``}:{citationState:r.citationState,answerMentioned:r.answerMentioned,visibilityState:r.visibilityState,visibilityTransition:r.visibilityTransition,provider:e.provider,model:r.model??null,answerSnippet:``,citedDomains:[],citedCompetitorDomains:[],mentionedCompetitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],searchQueries:[],evidenceUrls:[],changeLabel:lo(r.mentionTransition??r.visibilityTransition,r.mentionState??r.visibilityState),summary:`Snapshot data not available for this run.`};m(e=>({...e,[a]:o})),u(o)}catch{if(n!==re.current)return;u({citationState:r.citationState,answerMentioned:r.answerMentioned,visibilityState:r.visibilityState,visibilityTransition:r.visibilityTransition,provider:e.provider,model:r.model??null,answerSnippet:``,citedDomains:[],citedCompetitorDomains:[],mentionedCompetitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],searchQueries:[],evidenceUrls:[],changeLabel:lo(r.mentionTransition??r.visibilityTransition,r.mentionState??r.visibilityState),summary:`Failed to load historical run data.`})}finally{n===re.current&&f(!1)}}},[_,e.query,e.provider,p]),oe=(S||e.historyScope!==`provider`)&&C.model?`${ea(C.provider)} (${C.model}) \u00b7 ${C.changeLabel.toLowerCase()}`:`${ea(C.provider)} \u00b7 ${C.changeLabel.toLowerCase()}`,j=!S&&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(` · `):``,M=T?{label:`Mentioned in answer`,title:`Your brand or domain is mentioned in this answer`,meta:oe}:!w&&C.mentionIdentity===`wrong-subject`?{label:eo.label,title:eo.project,meta:oe}:C.visibilityTransition===`lost`?{label:`Mention lost`,title:`Your brand no longer appears in this answer`,meta:oe}:w?{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:oe};return(0,G.jsx)(he,{open:!0,onOpenChange:e=>{e||n()},children:(0,G.jsxs)(fe,{children:[(0,G.jsx)(ce,{className:`fixed inset-0 z-50 bg-overlay-scrim/80 backdrop-blur-sm`}),(0,G.jsxs)(pe,{className:`evidence-modal`,"aria-describedby":void 0,children:[(0,G.jsxs)(`div`,{className:`evidence-modal-header`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`p`,{className:`eyebrow eyebrow-soft`,children:[t.project.name,` `,`·`,` `,C.provider||`All providers`]}),(0,G.jsx)(me,{className:`text-lg font-semibold text-primary truncate`,children:e.query})]}),(0,G.jsxs)(de,{className:`inline-flex size-8 items-center justify-center rounded-md text-muted transition hover:bg-mono-800 hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400 shrink-0`,children:[(0,G.jsx)(ae,{className:`size-4`}),(0,G.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]}),v&&(0,G.jsxs)(`div`,{className:`evidence-modal-timeline`,children:[(0,G.jsx)(`p`,{className:`drawer-section-label mb-1.5`,children:`Run history`}),(0,G.jsx)(`div`,{className:`flex items-center gap-1 overflow-x-auto pb-1`,children:_.map((e,t)=>{let n=s===-1&&t===_.length-1||s===t,r=e.visibilityState??(e.answerMentioned?`visible`:`not-visible`),i=e.visibilityTransition??r,a=r===`visible`?`bg-positive-400`:i===`emerging`?`bg-caution-400`:i===`lost`?`bg-negative-400`:`bg-mono-600`,o=new Date(e.createdAt).toLocaleDateString(void 0,{month:`short`,day:`numeric`}),c=!!(e.model&&t>0&&_[t-1]?.model&&_[t-1].model!==e.model);return(0,G.jsxs)(`button`,{type:`button`,className:`evidence-run-dot ${n?`evidence-run-dot--selected`:``}`,onClick:()=>{ie(t===_.length-1?-1:t)},"aria-label":[`Run ${o}: ${r}`,e.model?`model ${e.model}`:null,c?`model changed`:null].filter(Boolean).join(` — `),"aria-pressed":n,children:[(0,G.jsx)(`span`,{className:`size-2 rounded-full ${a} ${c?`ring-1 ring-caution-300/80 ring-offset-2 ring-offset-bg`:``}`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`text-[10px] text-muted`,children:o})]},t)})}),s>=0&&s<_.length&&(0,G.jsxs)(`p`,{className:`text-[11px] text-muted mt-1`,children:[`Viewing run from `,new Date(_[s].createdAt).toLocaleString(),` `,`—`,` `,(0,G.jsx)(`span`,{className:`capitalize`,children:_[s].visibilityState??(_[s].answerMentioned?`visible`:`not-visible`)}),(0,G.jsxs)(`button`,{type:`button`,className:`text-secondary hover:text-strong ml-2`,onClick:()=>{ie(-1)},children:[`←`,` Back to latest`]})]}),!S&&(e.modelTransitions?.length??0)>0&&(0,G.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:e.modelTransitions.map(e=>(0,G.jsx)(`span`,{className:`inline-flex items-center rounded-full border border-caution-400/30 bg-caution-400/10 px-2 py-1 text-[10px] text-caution-100`,children:`${e.fromModel??`unknown`} -> ${e.toModel??`unknown`} on ${new Date(e.createdAt).toLocaleDateString()}`},`${e.runId}:${e.toModel??`unknown`}`))})]}),(0,G.jsxs)(`div`,{className:`evidence-modal-body`,children:[d&&(0,G.jsxs)(`div`,{className:`md:col-span-2 flex items-center justify-center py-12 text-muted text-sm`,children:[`Loading historical run data`,`…`]}),!d&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`evidence-modal-main`,children:[(0,G.jsxs)(`div`,{className:`evidence-position-hero evidence-position-hero--${A}`,children:[(0,G.jsx)(`p`,{className:`evidence-position-label evidence-position-label--${A}`,children:M.label}),(0,G.jsx)(`p`,{className:`evidence-position-title evidence-position-title--${A}`,children:M.title}),(0,G.jsx)(`p`,{className:`evidence-position-meta`,children:M.meta}),j&&(0,G.jsx)(`p`,{className:`mt-1 text-[11px] text-muted`,children:j})]}),C.answerSnippet&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`drawer-section-label`,children:`What the AI said`}),(0,G.jsx)(`div`,{className:`answer-snippet-block ${r?`evidence-answer-expanded`:`evidence-answer-collapsed`}`,children:(()=>{if(!C.answerSnippet)return null;let e=C.answerSnippet.split(`
13
+ `),t=[],n=[],r=0,i=()=>{if(n.length===0)return;let e=n.join(` `).trim();e&&t.push((0,G.jsx)(`p`,{className:t.length>0?`mt-2.5`:``,children:oo(e,k)},r++)),n=[]};for(let a of e){let e=a.trim();if(/^[-\u2013\u2014]{3,}$/.test(e)){i(),t.push((0,G.jsx)(`hr`,{className:`border-default my-3`},r++));continue}let o=e.match(/^(#{1,3})\s+(\S.*)$/);if(o){i();let e=o[1].length,n=o[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s]+/u,``).trim()||o[2],a=e===1?`text-[13px] font-semibold text-heading mt-4 mb-1`:e===2?`text-xs font-semibold text-strong mt-3 mb-0.5`:`text-xs font-medium text-neutral mt-2`;t.push((0,G.jsx)(`p`,{className:a,children:oo(n,k)},r++))}else e===``?i():n.push(e)}return i(),t})()}),C.answerSnippet.length>280&&(0,G.jsx)(`button`,{type:`button`,className:`mt-1.5 text-xs text-muted hover:text-neutral transition-colors`,onClick:()=>i(!r),children:r?`↑ Collapse`:`↓ Show full answer`})]}),!C.answerSnippet&&!d&&(0,G.jsx)(`div`,{className:`rounded-lg border border-subtle bg-surface-subtle px-4 py-8 text-center text-faint text-sm`,children:`No answer text recorded for this run`}),C.searchQueries.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`drawer-section-label flex items-center`,children:[(0,G.jsx)(`span`,{children:`Web searches the model ran`}),(0,G.jsx)(Dr,{text:`The search queries this AI model issued while researching your prompt. They reveal how the model reformulated your query — the phrasings worth optimizing your content for. Distinct from grounding sources (what it found) and citations (what it linked).`})]}),(0,G.jsx)(`ul`,{className:`grid gap-1`,children:C.searchQueries.map((e,t)=>(0,G.jsxs)(`li`,{className:`flex items-start gap-2 text-sm text-neutral`,children:[(0,G.jsx)(ne,{className:`size-3.5 mt-0.5 shrink-0 text-faint`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`break-words`,children:e})]},`${t}-${e}`))})]}),!S&&e.relatedTechnicalSignals.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`drawer-section-label`,children:T?`Why you're visible`:`What to fix`}),(0,G.jsx)(`div`,{className:`action-items-list`,children:e.relatedTechnicalSignals.map((e,t)=>(0,G.jsxs)(`div`,{className:`action-item`,children:[(0,G.jsx)(`svg`,{className:`action-item-icon ${T?`text-positive-400`:`text-caution-400`}`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:T?(0,G.jsx)(`path`,{d:`M3 8l3.5 3.5L13 4.5`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`circle`,{cx:`8`,cy:`8`,r:`7`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,G.jsx)(`path`,{d:`M8 5v3.5M8 10.5v0`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`})]})}),(0,G.jsx)(`span`,{className:`action-item-text`,children:e})]},t))})]}),C.summary&&(0,G.jsx)(`p`,{className:`text-xs text-faint border-t border-subtle pt-3 mt-1`,children:C.summary})]}),(0,G.jsxs)(`div`,{className:`evidence-modal-sidebar`,children:[(E||D)&&(0,G.jsxs)(`div`,{className:`sidebar-tabs`,children:[(0,G.jsx)(`button`,{className:`sidebar-tab ${a===`mentions`?`sidebar-tab--active`:``}`,onClick:()=>o(`mentions`),type:`button`,title:`Canonry's answer-level visibility assessment and any company names extracted from the answer text.`,children:`Mentions`}),(0,G.jsx)(`button`,{className:`sidebar-tab ${a===`sources`?`sidebar-tab--active`:``}`,onClick:()=>o(`sources`),type:`button`,title:`Grounding links the model used to build the answer. These are supporting sources, not the primary visibility signal.`,children:`Sources`})]}),a===`mentions`&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`drawer-section-label flex items-center`,children:[(0,G.jsx)(`span`,{children:`Mention in answer`}),(0,G.jsx)(Dr,{text:`Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources.`})]}),(0,G.jsxs)(`div`,{className:`mention-status mention-status--${T?`mentioned`:`not-mentioned`}`,children:[(0,G.jsx)(`span`,{className:`mention-status-icon`,children:w?`…`:T?`✓`:`—`}),(0,G.jsx)(`span`,{className:`mention-status-label`,children:w?`Pending`:T?`Mentioned`:`Not mentioned`})]}),!w&&!T&&C.mentionIdentity===`wrong-subject`&&(0,G.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1 text-[11px] text-muted`,children:[(0,G.jsx)(`span`,{children:eo.label}),(0,G.jsx)(Dr,{text:eo.project})]}),C.matchedTerms.length>0&&(0,G.jsxs)(`div`,{className:`mt-2`,children:[(0,G.jsx)(`p`,{className:`text-[10px] uppercase tracking-wide text-muted mb-1.5`,children:`Matched in answer`}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:C.matchedTerms.map(e=>(0,G.jsx)(`span`,{className:`mention-chip mention-chip--brand`,children:e},e))})]}),!w&&!T&&C.matchedTerms.length===0&&(0,G.jsxs)(`div`,{className:`mt-2`,children:[(0,G.jsx)(`p`,{className:`text-[10px] uppercase tracking-wide text-muted mb-1.5`,children:`Searched for`}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:ee.map(e=>(0,G.jsx)(`span`,{className:`mention-chip mention-chip--muted`,children:e},e))}),(0,G.jsx)(`p`,{className:`text-[11px] text-faint mt-1.5`,children:`None of these appear in the answer text.`})]})]}),(C.recommendedCompetitors.length>0||C.mentionedCompetitorDomains.length>0)&&(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`drawer-section-label flex items-center`,children:[(0,G.jsx)(`span`,{children:`Competitors in answer`}),(0,G.jsx)(Dr,{text:`Competitors detected in the answer text. Includes tracked competitor brands and names extracted by Canonry; source-link competitors stay in the Sources tab.`})]}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(()=>{let e=C.mentionedCompetitorDomains.map(e=>e.replace(/^www\./,``)),t=new Set(e.map(e=>On(e.replace(/\.[^.]+$/,``))));return[...C.recommendedCompetitors.filter(e=>!t.has(On(e))),...e].map(e=>(0,G.jsx)(`span`,{className:`mention-chip mention-chip--competitor`,children:e},e))})()})]})]}),a===`sources`&&(0,G.jsxs)(G.Fragment,{children:[C.citedDomains.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`drawer-section-label flex items-center`,children:[(0,G.jsx)(`span`,{children:`Domains from source links`}),(0,G.jsx)(Dr,{text:`These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them.`})]}),(0,G.jsx)(`div`,{className:`citation-leaderboard`,children:C.citedDomains.map((e,t)=>{let n=e.toLowerCase().replace(/^www\./,``),r=g.has(n),i=!r&&C.citedCompetitorDomains.some(e=>e.toLowerCase().replace(/^www\./,``)===n);return(0,G.jsxs)(`div`,{className:`citation-leaderboard-item citation-leaderboard-item--${r?`you`:i?`competitor`:`other`}`,children:[(0,G.jsxs)(`span`,{className:`citation-leaderboard-rank`,children:[`#`,t+1]}),(0,G.jsx)(`span`,{className:`citation-leaderboard-domain`,children:e}),r&&(0,G.jsx)(`span`,{className:`citation-leaderboard-tag`,children:`You`}),i&&(0,G.jsx)(`span`,{className:`citation-leaderboard-tag`,children:`Competitor`})]},e)})})]}),C.groundingSources.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`drawer-section-label flex items-center`,children:[(0,G.jsxs)(`span`,{children:[`Grounding source links (`,C.groundingSources.length,`)`]}),(0,G.jsx)(Dr,{text:`Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility.`})]}),(0,G.jsx)(`ul`,{className:`grid min-w-0 gap-3`,children:C.groundingSources.map((e,t)=>(0,G.jsx)(`li`,{className:`min-w-0`,children:(0,G.jsx)(no,{url:e.uri,title:e.title})},t))})]}),C.evidenceUrls.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`drawer-section-label`,children:`Evidence URLs`}),(0,G.jsx)(`ul`,{className:`grid min-w-0 gap-3`,children:C.evidenceUrls.map(e=>(0,G.jsx)(`li`,{className:`min-w-0`,children:(0,G.jsx)(no,{url:e})},e))})]}),C.citedDomains.length===0&&C.groundingSources.length===0&&C.evidenceUrls.length===0&&(0,G.jsxs)(`div`,{className:`flex items-center justify-center h-24 text-faint text-sm`,children:[`No source data `,S?`for this run`:`yet`]})]}),!E&&!D&&(0,G.jsxs)(`div`,{className:`flex items-center justify-center h-24 text-faint text-sm`,children:[`No answer visibility data `,S?`for this run`:`yet`]})]})]})]})]})]})})}function fo(e){let t=e.match(/^\/projects\/([^/]+)/);if(!t)return null;try{return decodeURIComponent(t[1])}catch{return t[1]}}function po(e,t){return e?(t?.projects.find(t=>t.project.name===e||t.project.id===e))?.project.name??e:null}function mo(e,t){return po(fo(e),t)}function ho(e){let t=new Date(`2026-02-20`);return e.map((e,n)=>({runId:`run_mock_${n+1}`,citationState:e,createdAt:new Date(t.getTime()+n*2*24*60*60*1e3).toISOString()}))}var go=[{id:`project_citypoint`,name:`Citypoint Dental NYC`,canonicalDomain:`citypointdental.com`,ownedDomains:[],aliases:[],qualifiedAliases:[],country:`US`,language:`en`,tags:[`local intent`,`priority`],labels:{},providers:[],providerModels:{},providerDispatchModes:{},measurement:xt,locations:[],defaultLocation:null,autoExtractBacklinks:!1,siteAuditMaxPages:null,configSource:`cli`,configRevision:1},{id:`project_harbor`,name:`Harbor Legal Group`,canonicalDomain:`harborlegal.com`,ownedDomains:[],aliases:[],qualifiedAliases:[],country:`US`,language:`en`,tags:[`lead gen`],labels:{},providers:[],providerModels:{},providerDispatchModes:{},measurement:xt,locations:[],defaultLocation:null,autoExtractBacklinks:!1,siteAuditMaxPages:null,configSource:`cli`,configRevision:1},{id:`project_northstar`,name:`Northstar Orthopedics`,canonicalDomain:`northstarortho.com`,ownedDomains:[],aliases:[],qualifiedAliases:[],country:`US`,language:`en`,tags:[`multi-location`],labels:{},providers:[],providerModels:{},providerDispatchModes:{},measurement:xt,locations:[],defaultLocation:null,autoExtractBacklinks:!1,siteAuditMaxPages:null,configSource:`cli`,configRevision:1}];function _o(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,opensSeoWorkspace:!1}}_o({id:`run_citypoint_visibility_20260308`,projectId:`project_citypoint`,projectName:`Citypoint Dental NYC`,kind:`answer-visibility`,kindLabel:`AI Visibility check`,status:`completed`,createdAt:`2026-03-08T12:15:00.000Z`,startedAt:`Mar 8, 12:15 PM`,duration:`6 minutes 12 seconds`,statusDetail:`18 tracked queries checked; 3 citation losses detected on emergency-intent prompts.`,summary:`Citation losses on emergency-intent prompts`,triggerLabel:`Scheduled`}),_o({id:`run_citypoint_queued_20260309`,projectId:`project_citypoint`,projectName:`Citypoint Dental NYC`,kind:`answer-visibility`,kindLabel:`AI Visibility check`,status:`queued`,createdAt:`2026-03-09T08:05:00.000Z`,startedAt:`Mar 9, 8:05 AM`,duration:`Waiting`,statusDetail:`Ready to enqueue after the next provider rate window clears.`,summary:`Queued follow-up after local ranking movement`,triggerLabel:`Manual`}),_o({id:`run_harbor_visibility_20260308`,projectId:`project_harbor`,projectName:`Harbor Legal Group`,kind:`answer-visibility`,kindLabel:`AI Visibility check`,status:`completed`,createdAt:`2026-03-08T11:05:00.000Z`,startedAt:`Mar 8, 11:05 AM`,duration:`5 minutes 7 seconds`,statusDetail:`12 tracked queries checked; local-intent visibility held steady across branded prompts.`,summary:`Branded prompts remain stable`,triggerLabel:`Scheduled`}),_o({id:`run_northstar_visibility_20260308`,projectId:`project_northstar`,projectName:`Northstar Orthopedics`,kind:`answer-visibility`,kindLabel:`AI Visibility check`,status:`running`,createdAt:`2026-03-08T13:40:00.000Z`,startedAt:`Mar 8, 1:40 PM`,duration:`Running`,statusDetail:`Provider responses still in flight for 9 multi-location prompts.`,summary:`Mid-run on treatment-location prompts`,triggerLabel:`Manual`}),ho([`cited`,`cited`,`cited`,`cited`,`cited`,`cited`,`cited`,`not-cited`,`not-cited`]),ho([`not-cited`,`cited`,`cited`,`cited`,`cited`,`cited`,`cited`]),ho([`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`]),ho([`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`cited`]),ho([`cited`,`cited`,`cited`,`cited`,`cited`,`cited`,`cited`,`cited`]),ho([`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`]),ho([`not-cited`,`not-cited`,`not-cited`,`not-cited`]),ho([`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`]),ho([`not-cited`,`not-cited`,`not-cited`,`not-cited`,`not-cited`,`cited`]),go[0],go[1],ho([`cited`,`cited`,`cited`,`cited`,`cited`]),go[2],ho([`not-cited`,`not-cited`,`not-cited`,`cited`]),go[0],go[1],go[2];function vo(e,t){return e.runs.find(e=>e.id===t)}function yo(e,t){for(let n of e.projects){let e=n.visibilityEvidence.find(e=>e.id===t);if(e)return{project:n,evidence:e}}}function bo(e,t,n){if(e){let t=e.visibilityEvidence.find(e=>e.id===n);if(t)return{project:e,evidence:t}}if(t)return yo(t,n)}var xo={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`},So={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`},Co={regression:!0,gain:!0,opportunity:!0,"first-citation":!0,"provider-pickup":!0,"persistent-gap":!0,"competitor-gained":!1,"competitor-lost":!1,"gbp-lodging-gap":!1,"gbp-listing-discrepancy":!1,"gbp-cta-gap":!1,"gbp-description-missing":!1,"gbp-metric-drop":!1,"gbp-keyword-drop":!1},wo={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 To(e){return{id:e.id,tone:xo[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??``,actionLabel:e.recommendation?.action??wo[e.type],actionGroup:fn[e.type],affectedPhrases:[{query:e.query,evidenceId:``,provider:e.provider,citationState:So[e.type],siteCitation:Co[e.type]}]}}function Eo(e){return e.filter(e=>!e.dismissed).map(To)}function Do(e){return{id:e.id,name:e.name,displayName:e.displayName,canonicalDomain:e.canonicalDomain,ownedDomains:e.ownedDomains??[],aliases:e.aliases??[],qualifiedAliases:e.qualifiedAliases,country:e.country,language:e.language,tags:e.tags,labels:e.labels,providers:e.providers??[],providerModels:e.providerModels??{},providerDispatchModes:e.providerDispatchModes??{},measurement:e.measurement,locations:e.locations??[],defaultLocation:e.defaultLocation??null,autoExtractBacklinks:e.autoExtractBacklinks??!1,siteAuditMaxPages:e.siteAuditMaxPages??null,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function Oo(e,t){return`${e} ${t}${e===1?``:`s`}`}function ko(e,t){if(!e)return`Waiting`;if(!t)return`Running`;let n=new Date(t).getTime()-new Date(e).getTime();if(n<1e3)return`under 1 second`;let r=Math.floor(n/1e3),i=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60;return i>0?a>0?`${Oo(i,`hour`)} ${Oo(a,`minute`)}`:Oo(i,`hour`):a>0?o>0?`${Oo(a,`minute`)} ${Oo(o,`second`)}`:Oo(a,`minute`):Oo(o,`second`)}function Ao(e){switch(e){case z[`answer-visibility`]:return`AI Visibility check`;case z[`gsc-sync`]:return`GSC sync`;case z[`inspect-sitemap`]:return`Sitemap inspection`;case z[`ga-sync`]:return`GA sync`;case z[`traffic-sync`]:return`Traffic sync`;case z[`bing-inspect`]:return`Bing URL inspection`;case z[`bing-inspect-sitemap`]:return`Bing sitemap inspection`;case z[`site-audit`]:return`Technical AEO audit`;case z[`backlink-extract`]:return`Backlink extract`;case z[`aeo-discover-seed`]:return`Discovery (seed phase)`;case z[`aeo-discover-probe`]:return`Discovery (probe phase)`;case z[`gbp-sync`]:return`Business Profile sync`;case z[`ads-sync`]:return`ChatGPT ads sync`;case z[`google-ads-sync`]:return`Google Ads sync`;case z[`gtm-sync`]:return`Tag Manager sync`;case z[`seo-sync`]:return`SEO data refresh`;default:return`Unknown job type`}}function jo(e){switch(e){case un.manual:return`Manual`;case un.scheduled:return`Scheduled`;case un[`config-apply`]:return`Config apply`;case un.probe:return`Spot check`;default:return e}}function Mo(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:Ao(e.kind),status:e.status,trigger:e.trigger??`manual`,location:e.location??null,createdAt:e.createdAt,startedAt:Hn(e.startedAt||e.createdAt),duration:ko(e.startedAt??null,e.finishedAt??null),statusDetail:e.error?No(e.error):Po(e),summary:Fo(e),triggerLabel:jo(e.trigger),opensSeoWorkspace:e.kind===z[`seo-sync`]&&!(e.status===V.failed&&!e.startedAt)}}function No(e){let t=rn(e);return t.length>200?t.slice(0,200)+`…`:t}function Po(e){if(e.kind===z[`seo-sync`])return`View the saved scope and task results in SEO.`;switch(e.status){case V.queued:return`Waiting for execution slot.`;case V.running:return`Provider queries in progress.`;case V.completed:return`All queries checked.`;case V.partial:return`Run completed with some queries skipped.`;case V.failed:return e.error?No(e.error):`Run failed.`;case V.cancelled:return`Run was cancelled.`;default:return``}}function Fo(e){let t=Ao(e.kind);switch(e.status){case V.queued:return`${t} queued`;case V.running:return`${t} in progress`;case V.completed:return`${t} completed`;case V.partial:return`${t} partially completed`;case V.failed:return`${t} failed`;case V.cancelled:return`${t} cancelled`;default:return e.status}}function J(e,t,n,r,i){let a=[],o=0,s=new Set;if(n.length>0){let r=n.flatMap(e=>e.snapshots??[]),c=new Map;for(let e of r)if(e.query){let t=`${e.query}::${e.provider}::${e.location??``}`;c.set(t,e)}let l=new Set(r.map(e=>e.location??null));l.size===0&&l.add(null);let u=new Set(r.map(e=>e.provider)),d=new Set(t.flatMap(e=>Object.keys(e.providerRuns??{}))),f=[...new Set([...u,...d])].sort(),p=f.length>0?f:[`gemini`],m=new Set(r.flatMap(e=>e.query?[e.query]:[]));for(let n of t){if(n.runs.length===0&&!m.has(n.query))continue;s.add(n.query);let t=n.runs.at(-1),r=t?.transition??`not-cited`;for(let s of p){let u=[...l].filter(e=>c.has(`${n.query}::${s}::${e??``}`)),d=(n.providerRuns?.[s]?.length??0)>0,f=u.length>0?u:d?[null]:[];for(let l of f){let d=l??``,f=c.get(`${n.query}::${s}::${d}`),p=f?.model??null,m=p?`${s}:${p}`:null,h=n.providerRuns?.[s],g=m?n.modelRuns?.[m]:void 0,_=e=>e?.filter(e=>(e.location??null)===l),v=u.length>0?_(h):h,y=u.length>0?_(g):g,b=(v?.length?v:null)??(y?.length?y:null),x=v?.length?`provider`:y?.length?`model`:`query`,S=f&&b?b.findIndex(e=>e.runId===f.runId):-1,C=f?S>=0?b.slice(0,S+1):null:b,w=f!==void 0&&C===null,T=C?C.at(-1).transition:w?f.citationState===Cn.cited?`cited`:`not-cited`:r,E=C?C.at(-1).visibilityTransition??(C.at(-1).visibilityState===`visible`?`visible`:`not-visible`):w?f.visibilityState===`visible`?`visible`:`not-visible`:t?.visibilityTransition??(t?.visibilityState===`visible`?`visible`:`not-visible`),D=b?.at(-1)?.citationState,O=b?.at(-1)?.visibilityState,ee=f?T===`lost`?`lost`:T===`emerging`?`emerging`:f.citationState===Cn.cited?`cited`:`not-cited`:D===Cn.cited?`cited`:`not-cited`,te=f?.visibilityState??(O===`visible`?`visible`:O===`pending`?`pending`:`not-visible`),k=C?zo(C):w?1:zo(n.runs),A=C?Bo(C):w?1:Bo(n.runs),ne=Io(n,s),re=(b??n.runs).map(e=>({runId:e.runId,citationState:e.citationState,createdAt:e.createdAt,model:ne.get(e.runId)??null,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:e.visibilityTransition,mentionState:e.mentionState,mentionTransition:e.mentionTransition})),ie=Lo(re),ae=x===`provider`&&ie.length<=1?`model`:x,oe=Ro(re),j=f?.citedCompetitorDomains??[],M=f?.mentionedCompetitorDomains??[],se=[...new Set([...j,...M,...f?.competitorOverlap??[]])];a.push({id:`evidence_${e}_${o++}`,query:n.query,queryId:f?.queryId??null,sourceSnapshotId:f?.id??null,sourceRunId:f?.runId??null,queryClass:i?.classify(n.query)??null,provider:f?.provider??s,model:f?.model??null,location:f?.location??l,citationState:ee,answerMentioned:f?.answerMentioned,visibilityState:te,visibilityChangeLabel:Vo(E,A,{positive:`visible`,negative:`not visible`,first:`first visibility`}),changeLabel:Vo(T,k),answerSnippet:f?.answerText??``,citedDomains:f?.citedDomains??[],evidenceUrls:f?.citedUrls??[],citedCompetitorDomains:j,mentionedCompetitorDomains:M,mentionedCompetitorTerms:f?.mentionedCompetitorTerms??[],competitorDomains:se,recommendedCompetitors:f?.recommendedCompetitors??[],matchedTerms:f?.matchedTerms??[],mentionIdentity:f?.mentionIdentity??null,relatedTechnicalSignals:[],groundingSources:f?.groundingSources??[],searchQueries:f?.searchQueries??[],summary:Uo(te,E,n.query),runHistory:re,historyScope:ae,modelsSeen:ie,modelTransitions:oe})}}}}for(let t of r)s.has(t.query)||a.push({id:`evidence_${e}_${o++}`,query:t.query,queryId:t.id,sourceSnapshotId:null,sourceRunId:null,queryClass:i?.classify(t.query)??null,provider:``,model:null,location:null,citationState:`pending`,visibilityState:`pending`,visibilityChangeLabel:`Awaiting first run`,changeLabel:`Awaiting first run`,answerSnippet:``,citedDomains:[],evidenceUrls:[],citedCompetitorDomains:[],mentionedCompetitorDomains:[],mentionedCompetitorTerms:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],relatedTechnicalSignals:[],groundingSources:[],searchQueries:[],summary:`"${t.query}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:`query`,modelsSeen:[],modelTransitions:[]});return a}function Io(e,t){let n=new Map,r=`${t}:`;for(let[t,i]of Object.entries(e.modelRuns??{})){if(!t.startsWith(r))continue;let e=t.slice(r.length),a=e===`unknown`?null:e;for(let e of i)n.set(e.runId,a)}return n}function Lo(e){let t=new Set;for(let n of e)n.model&&t.add(n.model);return[...t]}function Ro(e){let t=[],n=null;for(let r of e){let e=r.model??null;e!==n&&n!==null&&t.push({runId:r.runId,createdAt:r.createdAt,fromModel:n,toModel:e}),n=e}return t}function zo(e){if(e.length===0)return 0;let t=e[e.length-1].citationState,n=0;for(let r=e.length-1;r>=0&&e[r].citationState===t;r--)n++;return n}function Bo(e){if(e.length===0)return 0;let t=e[e.length-1].visibilityState??`not-visible`,n=0;for(let r=e.length-1;r>=0&&(e[r].visibilityState??`not-visible`)===t;r--)n++;return n}function Vo(e,t,n){let r={positive:n?.positive??`cited`,negative:n?.negative??`not cited`,first:n?.first??`first citation`};switch(e){case`new`:return`First observation`;case`cited`:case`visible`:return t<=1?`${Ho(r.positive)} in latest run`:`${Ho(r.positive)} for ${t} runs`;case`lost`:return`Lost since last run`;case`emerging`:return Ho(r.first);case`not-cited`:case`not-visible`:return t<=1?`${Ho(r.negative)} in latest run`:`${Ho(r.negative)} across ${t} runs`;default:return e}}function Ho(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Uo(e,t,n){switch(t){case`lost`:return`Mention was lost for "${n}". Your brand no longer appeared in the latest answer.`;case`emerging`:return`Your brand started appearing in AI answers for "${n}".`}switch(e){case`visible`:return`Your brand or domain is mentioned in AI answers for "${n}".`;case`pending`:return`"${n}" has been added but no run has been triggered yet.`;default:return`Your brand or domain was not mentioned in AI answers for "${n}".`}}function Wo(e){let t=Do(e.project),n=Nn(ze(e.project)),r=J(t.name,e.timeline,e.latestRunDetails,e.queries,n),i=[...e.runs].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)).map(t=>Mo(t,e.project.displayName||e.project.name));return e.overview?Ko(t,e.overview,r,i):Jo(t,r,i)}function Go(e){return e.filter(e=>e.kind===z[`answer-visibility`]&&e.trigger!==un.probe&&(e.status===V.completed||e.status===V.partial))}function Ko(e,t,n,r){let i=Eo(t.topInsights);for(let e of t.attentionItems)e.id.startsWith(`insight_`)||i.push({id:e.id,tone:e.tone,title:e.title,detail:e.detail,actionLabel:e.actionLabel,actionGroup:`investigate`,affectedPhrases:[]});return{project:e,contextLabel:t.contextLabel,mentionSummary:t.scores.mention,visibilitySummary:t.scores.visibility,mentionShareSummary:t.scores.mentionShare,queryCounts:{cited:t.queryCounts.citedQueries,total:t.queryCounts.totalQueries},gapQueries:t.scores.gapQueries,mentionGaps:t.scores.mentionGaps,indexCoverage:t.scores.indexCoverage,providerScores:t.providerScores,competitorPressure:t.scores.competitorPressure,runStatus:t.scores.runStatus,movementComparison:t.movementComparison,insights:i,visibilityEvidence:n,competitors:t.competitors.map(e=>({id:e.id,domain:e.domain,aliases:e.aliases??[],autoAliases:e.autoAliasNames??[],citationCount:e.citationCount,totalQueries:e.totalQueries,pressureLabel:e.pressureLabel,citedQueries:e.citedQueries,movement:``,notes:``})),recentRuns:r.slice(0,5),visibilitySweeps:Go(r),suggestedQueries:t.suggestedQueries}}function qo(){return{projectMentionSnapshots:0,competitorMentionSnapshots:0,combinedMentionSnapshots:0,perCompetitor:[],ranking:[],snapshotsWithAnswerText:0,snapshotsTotal:0,score:null}}function Jo(e,t,n){let r={label:``,value:`No data`,delta:`Loading…`,tone:`neutral`,description:``,tooltip:``,trend:[]};return{project:e,contextLabel:`${e.country} / ${e.language.toUpperCase()}`,mentionSummary:{...r,label:`Mention Coverage`},visibilitySummary:{...r,label:`Citation Coverage`},mentionShareSummary:{...r,label:`Mention Share`,scope:`non-brand`,unavailable:!0,breakdown:qo(),branded:qo()},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`},movementComparison:{hasPreviousRun:!1,comparable:!1,querySetChanged:!1,previousRunAt:null,currentQueryCount:0,previousQueryCount:0,comparableQueryCount:0,addedQueryCount:0,removedQueryCount:0,addedQueries:[],removedQueries:[]},insights:[],visibilityEvidence:t,competitors:[],recentRuns:n.slice(0,5),visibilitySweeps:Go(n),suggestedQueries:{rows:[],totalCandidates:0,skippedAlreadyTracked:0}}}function Yo(e){let t=Do(e.project),n=[...e.runs].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)),r=n.find(e=>e.kind===z[`answer-visibility`])??n[0]??e.overview?.latestRun?.run??void 0,i=e.project.displayName||e.project.name,a=r?Mo(r,i):Xo(e.project.id,i),o=e.overview;if(!o)return{project:t,hasMeasurement:!1,mentionScore:0,mentionDelta:`No data`,mentionTone:`neutral`,lastRun:a,insight:`No runs completed yet.`,trend:[],competitorPressureLabel:`None`};let s=o.scores.mention,c=s.progress??0,l=o.queryCounts.mentionedQueries,u=o.queryCounts.totalQueries,d=o.providers.length;return{project:t,hasMeasurement:u>0&&s.progress!=null,mentionScore:c,mentionDelta:u>0?`${l} of ${u} queries`:`No data`,mentionTone:s.tone,providerCoverage:s.providerCoverage,lastRun:a,insight:u>0?`${l} of ${u} queries mentioned across ${d} provider${d===1?``:`s`}.`:`No runs completed yet.`,trend:s.trend??[],competitorPressureLabel:o.scores.competitorPressure.value,sentiment:o.sentiment}}function Xo(e,t){return{id:`none`,projectId:e,projectName:t,kind:z[`answer-visibility`],kindLabel:`No runs yet`,status:V.queued,trigger:un.manual,createdAt:``,startedAt:``,duration:``,statusDetail:``,summary:`No runs yet`,triggerLabel:``,opensSeoWorkspace:!1}}function Zo(e,t){let n=[],r=[],i=[];for(let t of e){r.push(Wo(t)),i.push(Yo(t));let e=[...t.runs].sort((e,t)=>t.createdAt.localeCompare(e.createdAt));for(let r of e)n.push(Mo(r,t.project.displayName||t.project.name))}n.sort((e,t)=>t.createdAt.localeCompare(e.createdAt));let a=e.length>0;return{portfolioOverview:{projects:i,attentionItems:a?Qo(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:n.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`}],...a?{}:{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:n,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 AI Visibility checks.`}],projectDraft:{name:``,canonicalDomain:``,country:`US`,language:`en`},queryImportState:{mode:`paste`,queryCount:0,preview:[]},competitorDraft:{domains:[],notes:`Use the CLI to add competitors.`},launchState:{enabled:a,ctaLabel:a?`Trigger run`:`Create a project first`,summary:a?`Ready to run.`:`Create a project first to launch a run.`}},settings:{providerStatuses:(t?.providers??[]).map(e=>({name:e.name,displayName:e.displayName,...e.kind?{kind:e.kind}:{},keyUrl:e.keyUrl,modelHint:e.modelHint,model:e.model,defaultModel:e.defaultModel,state:e.configured?`ready`:`needs-config`,detail:e.configured?`Provider is configured.`:e.name.toLowerCase()===`local`?`Base URL is missing.`:`API key is missing.`,quota:e.quota})),google:{state:t?.google?.configured?`ready`:`needs-config`,detail:t?.google?.configured?`Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard.`:`Google OAuth client ID and client secret are not configured yet.`},bing:{state:t?.bing?.configured?`ready`:`needs-config`,detail:t?.bing?.configured?`Bing Webmaster Tools API key is configured. Project-level Bing connections can be created from the dashboard.`:`Bing Webmaster Tools API key is not configured yet.`},selfHostNotes:[`Configuration is stored in ~/.canonry/config.yaml.`,`The local config file is the source of truth for authentication credentials.`,`Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.`,`Database is SQLite at ~/.canonry/data.db.`,`API key was auto-generated during canonry init.`],bootstrapNote:`Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config.`}}}function Qo(e){let t=[];for(let n of e){let e=n.visibilityEvidence.filter(e=>e.citationState===`lost`);e.length>0&&t.push({id:`attention_${n.project.id}_lost`,tone:`negative`,title:`${n.project.displayName||n.project.name} lost citations`,detail:`${e.length} quer${e.length>1?`ies`:`y`} lost citation.`,actionLabel:`Open project`,href:`/projects/${encodeURIComponent(n.project.name)}`});let r=n.recentRuns.filter(e=>e.status===V.running||e.status===V.queued);r.length>0&&t.push({id:`attention_${n.project.id}_active`,tone:`neutral`,title:`${n.project.displayName||n.project.name} has active runs`,detail:`${r.length} run${r.length>1?`s`:``} in progress.`,actionLabel:`View runs`,href:`/runs`})}return t.length===0&&t.push({id:`attention_stable`,tone:`positive`,title:`All projects stable`,detail:`No citation losses or active runs to flag.`}),t}var $o=(0,W.createContext)(null);$o.Provider;function es(){return(0,W.useContext)($o)}function ts(e,t={}){let n=es(),r=e??n?.dashboard??null,i=t.includeSettings??!0,a=t.includeOverviews??!0,o=t.pauseProjectPolling??!1,{isAdmin:s}=Xn(),c=!r&&a&&!Ve(),l=I({...lr({client:H,query:{kind:`answer-visibility`}}),enabled:!r,staleTime:$n,refetchInterval:e=>e.state.data?.some(e=>e.status===`running`||e.status===`queued`)?3e3:$n}),u=I({...lr({client:H,query:{excludeKinds:[z[`bing-inspect`],z[`traffic-sync`]],limit:5}}),enabled:c,staleTime:$n,refetchInterval:e=>e.state.data?.some(e=>e.status===V.running||e.status===V.queued)?3e3:$n}),d=I({...fr({client:H}),enabled:!r,refetchInterval:o?!1:e=>{let t=e.state.data,n=l.data?.some(e=>e.status===`running`||e.status===`queued`);return(t?.length??0)===0||n?rr:cr}}),f=I({...Tr({client:H}),enabled:!r&&i&&s}),p=d.data??[],m=l.data??[],h=je({queries:p.map(e=>{let t=m.filter(t=>t.projectId===e.id),n=t.filter(e=>(e.status===`completed`||e.status===`partial`)&&e.kind===`answer-visibility`&&e.trigger!==`probe`).sort((e,t)=>t.createdAt.localeCompare(e.createdAt)),i=n.length>0?n[0].id:`no-run`;return{queryKey:[`project-overview-slim`,e.id,i],queryFn:async()=>{let n=await Dt(e.name).catch(()=>null);return{project:e,runs:t,queries:[],competitors:[],timeline:[],latestRunDetails:[],previousRunDetails:[],gscCoverage:null,bingCoverage:null,dbInsights:null,overview:n}},enabled:!r&&a&&d.isSuccess&&l.isSuccess,staleTime:or}})}),g=!a||h.every(e=>e.isSuccess),_=(0,W.useMemo)(()=>{if(r)return r;if(!d.data||!l.data||p.length>0&&!g)return null;let e=new Map(p.map(e=>[e.id,e])),t=Zo(a?h.map(t=>{if(!t.data)return null;let n=e.get(t.data.project.id);return n?{...t.data,project:n,runs:m.filter(e=>e.projectId===n.id)}:null}).filter(e=>e!=null):p.map((e,t)=>{let n=h[t]?.data;return{project:e,runs:m.filter(t=>t.projectId===e.id),queries:[],competitors:[],timeline:[],latestRunDetails:[],previousRunDetails:[],gscCoverage:null,bingCoverage:null,dbInsights:null,overview:n?.overview??null}}),f.data??null);return c&&(t.portfolioOverview.recentRuns=(u.data??[]).filter(t=>t.trigger!==un.probe&&e.has(t.projectId)).map(t=>{let n=e.get(t.projectId);return Mo(t,n.displayName||n.name)})),t},[r,d.data,l.data,f.data,a,g,h,p,m,c,u.data]),v=!r&&(d.isError||l.isError),y=!r&&!_&&!v,b=(0,W.useCallback)(async()=>{let e=[d.refetch(),l.refetch(),...c?[u.refetch()]:[],...a?h.map(e=>e.refetch()):[]];i&&s&&e.push(f.refetch()),await Promise.all(e)},[i,s,a,c,u.refetch,h,d.refetch,l.refetch,f.refetch]);return{dashboard:_,isLoading:y,isError:v,activityLoading:c&&u.isPending,activityError:c&&u.isError,refetch:b}}function ns(e){return JSON.stringify(e.filter(e=>e.kind===`answer-visibility`&&e.trigger!==`probe`&&(e.status===`completed`||e.status===`partial`)).map(e=>[e.id,e.status]).sort(([e],[t])=>e.localeCompare(t)))}async function rs(e,t,n=`active`){let r=e=>{let n=e.queryKey[0];return n?._id===`getApiV1ProjectsByNameAnalyticsCompetitors`&&n.path?.name===t};return n===`active`&&await e.cancelQueries({predicate:r}),e.invalidateQueries({predicate:r,refetchType:n})}function is(e,t,n){let r=ve(),i=(0,W.useRef)({projectName:e,revision:t,enabled:n});(0,W.useEffect)(()=>{let a=i.current;i.current={projectName:e,revision:t,enabled:n},n&&a.enabled&&a.projectName===e&&a.revision!==t&&rs(r,e)},[n,e,r,t])}var as=20;function os(e,t={}){let n=ve(),r=es(),i=(0,W.useMemo)(()=>!r||!e?null:r.dashboard.projects.find(t=>t.project.name===e)??null,[r,e]),a=I({...wr({client:H,path:{name:e??``}}),enabled:!!e&&!i,staleTime:or,refetchOnWindowFocus:`always`}),o=I({...vr({client:H,path:{name:e??``},query:{kind:`answer-visibility`}}),enabled:!!e,staleTime:$n,refetchOnWindowFocus:`always`,refetchInterval:e=>e.state.data?.some(e=>e.projectId===a.data?.id&&(e.status===`running`||e.status===`queued`))?3e3:$n}),s=a.data??null,c=(0,W.useMemo)(()=>s?(o.data??[]).filter(e=>e.projectId===s.id):[],[s,o.data]),{latestRunIds:l,latestRunIdsKey:u,latestVisibilityRevision:d}=(0,W.useMemo)(()=>{let e=c.filter(e=>(e.status===`completed`||e.status===`partial`)&&e.kind===`answer-visibility`&&e.trigger!==`probe`).sort((e,t)=>t.createdAt.localeCompare(e.createdAt)),t=e[0]?.createdAt??null,n=t?e.filter(e=>e.createdAt===t).map(e=>e.id):[];return{latestRunIds:n,latestRunIdsKey:[...n].sort().join(`,`),latestVisibilityRevision:t?`${t}:${[...n].sort().join(`,`)}`:`none`}},[c]),f=!!s&&!!e&&o.isSuccess,p=I({queryKey:[`project-dashboard-full`,s?.id??null,u||`none`,`overview`],queryFn:async()=>({project:s,overview:await Dt(e)}),enabled:f&&t.overview===!0,staleTime:or,refetchOnWindowFocus:`always`}),m=I({queryKey:[`project-dashboard-full`,s?.id??null,u||`none`,`evidence`],queryFn:async()=>{let[t,n,r]=await Promise.all([nt(e),gn(e,void 0,as),Promise.all(l.map(e=>$e(e)))]);return{project:s,queries:t,timeline:n,latestRunDetails:r}},enabled:f&&t.evidence===!0,staleTime:or,refetchOnWindowFocus:`always`}),h=(0,W.useMemo)(()=>{if(!s||!o.data)return i;let e=t.evidence?m.data:void 0,n=Wo({project:s,runs:c,queries:e?.queries??[],timeline:e?.timeline??[],latestRunDetails:e?.latestRunDetails??[],previousRunDetails:[],competitors:[],overview:t.overview?p.data?.overview??null:null});return i&&!(t.overview&&p.data)?{...i,project:n.project,recentRuns:n.recentRuns,visibilitySweeps:n.visibilitySweeps,visibilityEvidence:e?n.visibilityEvidence:i.visibilityEvidence}:n},[s,c,m.data,p.data,i,t.evidence,t.overview,o.data]),g=(0,W.useCallback)(async()=>{await Promise.all([a.refetch(),o.refetch(),n.invalidateQueries({queryKey:[`project-dashboard-full`,s?.id??null]})])},[a.refetch,o.refetch,n,s?.id]),_=a.isError||o.isError,v=!i&&(a.isLoading||o.isLoading),y=!!e&&t.overview===!0&&!i&&!_&&p.isPending,b=!!e&&t.evidence===!0&&!i&&!_&&m.isPending;return{commandCenter:h,project:s,isLoading:v,isError:_,overviewLoading:y,overviewError:t.overview===!0&&p.isError&&!p.data,evidenceLoading:b,evidenceError:t.evidence===!0&&m.isError&&!m.data,latestVisibilityRevision:d,competitorHistoryRevision:ns(c),refetch:g}}var ss=[`health`];async function cs(){let e=await Wt(`/health`,`API`);return{apiStatus:e,workerStatus:An()&&e.state===`ok`?{label:`Worker`,state:`disabled`,detail:`Background execution is disabled in this public demo.`}: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.`}}}function ls(e,t){return I({queryKey:ss,queryFn:cs,enabled:e,refetchInterval:15e3,initialData:t})}function us(e){return I({...ur({client:H,path:{id:e??``}}),enabled:!!e,refetchInterval:e=>{let t=e.state.data?.status;return t===`running`||t===`queued`?3e3:!1}})}function ds(){let e=Se(),t=Ce({strict:!1}),n=ke({select:e=>e.location.pathname});return{runId:t.runId??null,evidenceId:t.evidenceId??null,openRun:t=>{e({to:n,from:Zf.to,search:e=>({...e,runId:t,evidenceId:void 0})})},openEvidence:t=>{e({to:n,from:Zf.to,search:e=>({...e,evidenceId:t,runId:void 0})})},closeDrawer:()=>{e({to:n,from:Zf.to,search:e=>({...e,runId:void 0,evidenceId:void 0})})}}}var fs={negative:`toast-card-negative`,caution:`toast-card-caution`,positive:`toast-card-positive`,neutral:`toast-card-neutral`};function ps(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function ms(){let e=(0,W.useSyncExternalStore)(ar,sr,sr),t=Se(),{openRun:n}=ds(),r=(0,W.useCallback)(e=>{nr(e)},[]),i=(0,W.useCallback)(e=>{e.cta&&(e.cta.intent===`open-run-drawer`?n(e.cta.runId):t({to:`/runs`}),nr(e.id))},[t,n]);return e.length===0?null:(0,G.jsx)(`div`,{className:`toast-viewport`,"aria-label":`Notifications`,children:e.map(e=>(0,G.jsxs)(`section`,{role:e.tone===`negative`?`alert`:`status`,"aria-live":e.tone===`negative`?`assertive`:`polite`,"data-state":e.state,className:`toast-card ${fs[e.tone]}`,children:[(0,G.jsxs)(`div`,{className:`toast-copy`,children:[(0,G.jsx)(`p`,{className:`toast-title`,children:e.title}),e.detail?(0,G.jsx)(`p`,{className:`toast-detail`,children:e.detail}):null,e.cta?(0,G.jsx)(`button`,{type:`button`,className:`toast-action`,onClick:()=>i(e),"aria-label":ps(e),children:e.cta.label}):null]}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>r(e.id),className:`toast-dismiss`,"aria-label":`Dismiss`,children:(0,G.jsx)(ae,{className:`size-3.5`})})]},e.id))})}var hs=`https://github.com/Canonry/canonry`,gs=`https://canonry.ai`,_s=`Run it from your agent with the MCP server, API, CLI, and plugins for Claude Code and Codex.`,vs=[{title:`Visibility`,links:[[`AI visibility`,`/projects/summit-roofing`],[`Search engines`,`/projects/summit-roofing/search-console`],[`Traffic & conversions`,`/projects/summit-roofing/conversions`]]},{title:`Portfolio`,links:[[`Properties & markets`,`/projects/harbor-resorts`],[`Queries & research`,`/projects/harbor-resorts/queries`],[`Activity`,`/projects/harbor-resorts/activity`]]},{title:`Website`,links:[[`Site health`,`/projects/summit-roofing/technical-aeo`],[`Local presence`,`/projects/summit-roofing/local`],[`Backlinks`,`/projects/summit-roofing/backlinks`]]}];function ys(){let e=(0,W.useId)();if(!An())return null;let t=yn(),r=`${e}-new-tab`,i={target:`_blank`,rel:`noopener noreferrer`,"aria-describedby":r};return(0,G.jsxs)(`aside`,{className:`demo-banner`,"aria-label":`Public demo`,children:[(0,G.jsx)(`p`,{className:`demo-banner-name`,children:`Canonry demo`}),(0,G.jsx)(`p`,{className:`demo-banner-facts`,children:`View only. Fictional data.`}),(0,G.jsx)(`p`,{className:`demo-banner-agent`,children:_s}),(0,G.jsxs)(`div`,{className:`demo-banner-actions`,children:[(0,G.jsxs)(`a`,{className:`demo-banner-primary`,href:gs,...i,children:[`canonry.ai`,(0,G.jsx)(n,{"aria-hidden":`true`,size:14})]}),(0,G.jsxs)(`a`,{className:`demo-banner-secondary`,href:hs,...i,children:[(0,G.jsx)(se,{"aria-hidden":`true`,size:15}),`GitHub`]}),(0,G.jsxs)(`details`,{onKeyDown:e=>{e.key===`Escape`&&(e.currentTarget.open=!1,e.currentTarget.querySelector(`summary`)?.focus())},children:[(0,G.jsxs)(`summary`,{children:[`Explore `,(0,G.jsx)(o,{"aria-hidden":`true`,size:14})]}),(0,G.jsxs)(`div`,{className:`demo-banner-panel`,children:[(0,G.jsx)(`p`,{className:`demo-banner-panel-agent`,children:_s}),(0,G.jsxs)(`nav`,{className:`demo-banner-examples`,"aria-label":`Demo examples`,children:[(0,G.jsx)(`a`,{href:`${t}/projects/summit-roofing`,children:`Standard business`}),(0,G.jsx)(`a`,{href:`${t}/projects/harbor-resorts`,children:`Property portfolio`})]}),(0,G.jsx)(`nav`,{className:`demo-banner-features`,"aria-label":`Demo feature directory`,children:vs.map(({title:e,links:n})=>(0,G.jsxs)(`section`,{"aria-label":e,children:[(0,G.jsx)(`h2`,{children:e}),(0,G.jsx)(`ul`,{children:n.map(([e,n])=>(0,G.jsx)(`li`,{children:(0,G.jsx)(`a`,{href:`${t}${n}`,children:e})},n))})]},e))})]})]})]}),(0,G.jsx)(`span`,{id:r,hidden:!0,children:`Opens in a new tab`})]})}function bs(e){switch(e){case z[`answer-visibility`]:return`AI Visibility check`;case z[`gsc-sync`]:return`GSC sync`;case z[`inspect-sitemap`]:return`Sitemap inspection`;case z[`ga-sync`]:return`GA sync`;case z[`traffic-sync`]:return`Traffic sync`;case z[`bing-inspect`]:return`Bing URL inspection`;case z[`bing-inspect-sitemap`]:return`Bing sitemap inspection`;case z[`site-audit`]:return`Technical AEO audit`;case z[`backlink-extract`]:return`Backlink extract`;case z[`aeo-discover-seed`]:return`Discovery (seed phase)`;case z[`aeo-discover-probe`]:return`Discovery (probe phase)`;case z[`gbp-sync`]:return`Business Profile sync`;case z[`ads-sync`]:return`ChatGPT ads sync`;case z[`google-ads-sync`]:return`Google Ads sync`;case z[`gtm-sync`]:return`Tag Manager sync`;case z[`seo-sync`]:return`SEO data refresh`}}function xs(e){return e===`running`?`Running`:e===`queued`?`Queued`:e===`partial`?`Partial`:e===`completed`?`Completed`:e===`failed`?`Failed`:e===`cancelled`?`Cancelled`:`Starting`}function Ss(){let e=(0,W.useSyncExternalStore)(Ni,Mi,Mi),t=(0,W.useMemo)(()=>Object.values(e.runs),[e.runs]),n=t.length>0,r=I({...lr({client:H}),enabled:n,staleTime:$n}),i=(0,W.useMemo)(()=>new Map((r.data??[]).map(e=>[e.id,e.status])),[r.data]);if(!n)return null;let a=t.map(e=>({...e,status:i.get(e.runId)??e.lastAnnouncedStatus})),s=a.length===1?bs(a[0].kind):`${a.length} active tasks`;return(0,G.jsxs)(`div`,{className:`task-center`,children:[(0,G.jsxs)(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:[a.length,` active `,a.length===1?`task`:`tasks`,`.`,` `,a.map(e=>`${bs(e.kind)} ${xs(e.status)}`).join(`. `),`.`]}),(0,G.jsxs)(`details`,{className:`task-center-details`,children:[(0,G.jsxs)(`summary`,{className:`task-center-trigger`,children:[(0,G.jsx)(O,{className:`size-3.5 shrink-0 motion-safe:animate-spin`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`task-center-summary`,children:s}),(0,G.jsx)(`span`,{className:`task-center-count`,"aria-hidden":`true`,children:a.length}),(0,G.jsx)(o,{className:`task-center-chevron size-3.5 shrink-0`,"aria-hidden":`true`})]}),(0,G.jsxs)(`div`,{className:`task-center-panel`,children:[(0,G.jsxs)(`div`,{className:`task-center-heading`,children:[(0,G.jsx)(`span`,{children:`Active tasks`}),(0,G.jsx)(`span`,{className:`tabular-nums text-faint`,children:a.length})]}),(0,G.jsx)(`ul`,{className:`task-center-list`,children:a.map(e=>(0,G.jsxs)(`li`,{className:`task-center-item`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`truncate text-[13px] font-medium text-strong`,children:bs(e.kind)}),(0,G.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted`,children:e.projectLabel??e.projectId})]}),(0,G.jsx)(bn,{tone:e.status===`failed`?`negative`:e.status===`partial`?`caution`:`neutral`,children:xs(e.status)})]},e.runId))}),(0,G.jsx)(R,{to:`/runs`,className:`task-center-footer-link`,children:`View all runs`})]})]})]})}var Cs={scope:`all`,queryClass:`all`},ws=[`all`,`non-brand`,`branded`];function Ts(e){return typeof e==`string`&&ws.includes(e)}function Es(e){let t=Ts(e.class)?e.class:Cs.queryClass,n=e.scope;if(typeof n!=`string`||n===`all`||n.length===0)return{scope:`all`,queryClass:t};let r=n.startsWith(`group:`)?n.slice(6):``;return r?{scope:`group`,groupKey:r,queryClass:t}:{scope:`all`,queryClass:t}}function Ds(e,t){return t===null||e===null?!1:e!==t}function Os(e){return{scope:e.scope===`group`&&e.groupKey?`group:${e.groupKey}`:void 0,class:e.queryClass===Cs.queryClass?void 0:e.queryClass}}function ks(e,t){if(!(typeof e!=`string`||e.length>16384||!t))try{let n=JSON.parse(e);if(typeof n!=`object`||!n||Array.isArray(n))return;let r=n,i=e=>typeof e==`string`&&e.trim().length>0,a=e=>e===null||i(e);return r.queryKey!==t||!i(r.provider)||r.queryClass!==`branded`&&r.queryClass!==`non-brand`&&r.queryClass!==`unknown`||!a(r.model)||!a(r.location)||!a(r.runId)||r.revision!==null&&(typeof r.revision!=`number`||!Number.isSafeInteger(r.revision)||r.revision<=0)?void 0:{queryKey:t,queryClass:r.queryClass,provider:r.provider,model:r.model,location:r.location,runId:r.runId,revision:r.revision}}catch{return}}function As(e){let t=t=>typeof e[t]==`string`&&e[t]!==``?e[t]:void 0,n=Es({scope:t(`scope`),class:t(`class`)}),r=t(`measurementScope`)??(n.scope===`group`?`group`:`project`),i=t(`measurementScopeKey`)??(t(`measurementScope`)?void 0:n.groupKey),a=t(`queryClass`)??t(`class`),o={measurementScope:i&&(r===`group`||r===`market`||r===`property`)?r:`project`,queryClass:a===`unknown`||Ts(a)?a:Cs.queryClass};o.measurementScope!==`project`&&(o.measurementScopeKey=i);for(let[e,n]of[[`measurementMarketKey`,`marketKey`],[`measurementProvider`,`provider`],[`measurementModel`,`model`],[`measurementLocation`,`location`],[`measurementFrom`,`from`],[`measurementTo`,`to`],[`measurementRunId`,`measurementRunId`],[`measurementQueryKey`,`queryKey`]]){let r=t(e);r!==void 0&&(o[n]=r)}let s=Number(e.measurementRevision);Number.isSafeInteger(s)&&s>0&&(o.revision=s);let c=ks(e.measurementAnswer,o.queryKey);return c&&(o.answer=c),o}function js(e){return{scope:e.measurementScope,scopeKey:e.measurementScopeKey,marketKey:e.marketKey,queryClass:e.queryClass,provider:e.provider,model:e.model,location:e.location,from:e.from,to:e.to,revision:e.revision,runId:e.measurementRunId,limit:25}}function Ms(e,t){let n={...e,...t};return[`measurementScope`,`measurementScopeKey`,`measurementMarketKey`,`queryClass`,`measurementProvider`,`measurementModel`,`measurementLocation`,`measurementFrom`,`measurementTo`,`measurementRevision`,`measurementRunId`].some(e=>e in t)?(n.measurementQueryKey=t.measurementQueryKey,n.measurementAnswer=t.measurementAnswer):`measurementQueryKey`in t&&!(`measurementAnswer`in t)&&(n.measurementAnswer=void 0),`measurementScope`in t&&(n.scope=void 0,`measurementMarketKey`in t||(n.measurementMarketKey=void 0),n.measurementQueryKey=void 0,t.measurementScope===`project`&&(n.measurementScopeKey=void 0)),`queryClass`in t&&(n.class=void 0),n}function Ns(e){return{...e,onboarding:void 0,manageQueries:void 0,siteHealthRunId:void 0,siteScan:void 0,setupProject:void 0}}function Ps(e,t){let n=/\/properties\/([^/]+)/.exec(e),r=As(t);if(n)return{view:`property`,selection:Bn.parse({scope:`property`,scopeKey:decodeURIComponent(n[1]),queryClass:r.queryClass,limit:10})};if(e.endsWith(`/technical-aeo`))return{view:`site-health`};if(e.endsWith(`/seo-data`)){let e=e=>{let n=t[e];return typeof n==`string`&&n?n:void 0},[n,r,i,a]=[e(`seoProfileId`),e(`seoRunId`),e(`seoRegion`),e(`seoMarket`)];return{view:`seo`,...n?{seoProfileId:n}:{},...r?{seoRunId:r}:{},...i?{seoRegionKey:i}:{},...a?{seoMarketKey:a}:{}}}if(e.endsWith(`/queries`)&&t.queryWorkspace===`research`)return{view:`project`};let i=/^\/projects\/[^/]+\/?$/.test(e);if(i||e.endsWith(`/queries`)){let t=Bn.safeParse(js(e.endsWith(`/queries`)?{measurementScope:r.measurementScope,measurementScopeKey:r.measurementScopeKey,queryClass:r.queryClass}:r));return{view:i?`visibility`:`queries`,...t.success?{selection:t.data}:{unavailableReason:`The current measurement filters are invalid. Correct them before asking Aero about this view.`}}}return{view:`project`}}var Fs=e(ge(),1);function Is(e,t={}){let{threshold:n=80}=t,r=(0,W.useRef)(null),i=(0,W.useRef)({scrollHeight:0,wasAtEnd:!0});function a(e){return e.scrollHeight-e.scrollTop-e.clientHeight}function o(){let e=r.current;return!e||a(e)<=n}function s(){let e=r.current;e&&(e.scrollTop=e.scrollHeight,i.current.wasAtEnd=!0,i.current.scrollHeight=e.scrollHeight)}return(0,W.useEffect)(()=>{let e=r.current;if(!e)return;let t=()=>{i.current.wasAtEnd=a(e)<=n};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[n]),(0,W.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=e.scrollHeight;t>i.current.scrollHeight&&i.current.wasAtEnd&&(e.scrollTop=t),i.current.scrollHeight=t},e),(0,W.useEffect)(()=>{let e=r.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>{let t=e.scrollHeight;t>i.current.scrollHeight&&i.current.wasAtEnd&&(e.scrollTop=t),i.current.scrollHeight=t});return t.observe(e),e.firstElementChild&&t.observe(e.firstElementChild),()=>t.disconnect()},[]),{ref:r,scrollToEnd:s,isAtEnd:o}}var Ls=`AI Visibility checks are run by your Canonry team`,Rs=`Scans are run by your Canonry team`,zs=`Next check unavailable`,Bs=`Check running…`,Vs=`Next check:`;function Hs(e,t){try{return new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`,timeZone:t??`UTC`}).format(new Date(e))}catch{return null}}function Us({projectName:e,kind:t=z[`answer-visibility`],running:n=!1,loadSchedule:r=!0}){let i=t===z[`site-audit`],a=I({...mr({client:H,path:{name:e},query:{kind:t}}),enabled:r&&!!e,retry:!1,refetchInterval:6e4}),o=a.isError?void 0:a.data,s=o?.enabled&&o.nextRunAt?new Date(o.nextRunAt):null,c=s&&Number.isFinite(s.getTime())?i?s.toLocaleString(`en-GB`,{weekday:`long`,day:`numeric`,month:`short`,hour:`2-digit`,minute:`2-digit`,timeZone:`UTC`,hourCycle:`h23`}):Hs(s.toISOString(),o?.timezone):null,l=(a.error instanceof Lt?a.error.code:a.error?.error?.code)===`NOT_FOUND`,u=!c||l||!o?.enabled;return(0,G.jsx)(`p`,{className:`text-sm text-secondary`,role:`status`,children:i?(0,G.jsxs)(G.Fragment,{children:[n&&(0,G.jsx)(`span`,{className:`text-neutral`,children:`Scan running… · `}),c&&s?(0,G.jsxs)(G.Fragment,{children:[`Next scan `,(0,G.jsxs)(`time`,{dateTime:s.toISOString(),children:[c,` UTC`]}),` · managed by your Canonry team`]}):Rs]}):n?Bs:u?zs:c&&s?(0,G.jsxs)(G.Fragment,{children:[Vs,` `,(0,G.jsx)(`time`,{dateTime:s.toISOString(),children:c})]}):zs})}var Ws=300,Gs=400,Ks=900,qs=32,Js=28,Ys=0;function Xs(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Zs(){return new DOMException(`Preview stopped`,`AbortError`)}function Qs(e,t){return t?.aborted?Promise.reject(Zs()):new Promise((n,r)=>{let i=()=>{clearTimeout(a),r(Zs())},a=setTimeout(()=>{t?.removeEventListener(`abort`,i),n()},e);t?.addEventListener(`abort`,i,{once:!0})})}function $s(e){let t=e.match(/\S+\s*|\s+/g)??[];if(t.length<2)return[];let n=Math.ceil(t.length/qs),r=[];for(let e=n;e<t.length;e+=n)r.push(t.slice(0,e).join(``));return r}function ec(e){return typeof e==`string`?e:JSON.stringify(e??null)}async function tc({starter:e,signal:t,onEvent:n,reducedMotion:r=!1}){let i=async e=>{if(t?.aborted)throw Zs();r||await Qs(e,t)},a=Date.now(),o=++Ys;await i(Ws);for(let[t,r]of e.steps.entries()){let{name:a,label:s,arguments:c,result:l,durationMs:u}=r.tool,d=`preview-${e.id}-${o}-${t}`;n({type:`message_end`,message:{role:`assistant`,timestamp:Date.now(),stopReason:`toolUse`,content:[...r.text?[{type:`text`,text:r.text}]:[],{type:`toolCall`,id:d,name:a,arguments:c}]}}),n({type:`tool_execution_start`,toolCallId:d,toolName:a,label:s,args:c}),await i(Math.min(Ks,Math.max(Gs,u))),n({type:`tool_execution_end`,toolCallId:d,toolName:a,result:l,isError:!1}),n({type:`message_end`,message:{role:`toolResult`,toolCallId:d,timestamp:Date.now(),isError:!1,aeroToolLabel:s,aeroDurationMs:u,content:[{type:`text`,text:ec(l)}]}})}if(!r){for(let t of $s(e.answer))await i(Js),n({type:`message_update`,message:{role:`assistant`,content:[{type:`text`,text:t}]},assistantMessageEvent:{}});await i(Js)}n({type:`message_end`,message:{role:`assistant`,timestamp:Date.now(),stopReason:`stop`,content:[{type:`text`,text:e.answer}]}}),n({type:`aero_turn_status`,status:{reason:`completed`,toolCalls:e.steps.length,modelCalls:e.steps.length+1,durationMs:Date.now()-a}})}async function nc(e){try{return await e.json()}catch{return{}}}function rc(){return typeof window<`u`&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,``)+`/api/v1`:`/api/v1`}var ic=rc();function ac(e){e===401&&Ut()}async function oc(e){let t=await fetch(`${ic}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:`include`});if(!t.ok){ac(t.status);let e=await nc(t);throw new Lt(e.error?.message??`transcript fetch failed: ${t.status}`,t.status,e.error?.code)}return await t.json()}async function sc(e){let t=await fetch(`${ic}/projects/${encodeURIComponent(e)}/agent/preview`,{credentials:`include`});if(!t.ok){ac(t.status);let e=await nc(t);throw new Lt(e.error?.message??`preview fetch failed: ${t.status}`,t.status,e.error?.code)}return await t.json()}async function cc(e){let t=await fetch(`${ic}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:`DELETE`,credentials:`include`});if(!t.ok){ac(t.status);let e=await nc(t);throw new Lt(e.error?.message??`reset failed: ${t.status}`,t.status,e.error?.code)}}async function lc({project:e,prompt:t,conversationId:n,provider:r,modelId:i,scope:a,profile:o,context:s,limits:c,signal:l,onEvent:u}){let d={prompt:t};n!==void 0&&(d.conversationId=n),r&&(d.provider=r),i&&(d.modelId=i),a&&(d.scope=a),o&&(d.profile=o),s&&(d.context=s),c&&(d.limits=c);let f=await fetch(`${ic}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify(d),signal:l});if(!f.ok||!f.body){ac(f.status),jn({method:`POST`,route:`/api/v1/projects/{name}/agent/prompt`,status:f.status});let e=await nc(f);throw new Lt(e.error?.message??`prompt failed: ${f.status}`,f.status,e.error?.code)}qe(`aero.send`);let p=!1,m=f.body.getReader(),h=new TextDecoder,g=``,_=()=>{m.cancel().catch(()=>{})};l?.addEventListener(`abort`,_,{once:!0}),l?.aborted&&_();try{for(;;){let{value:e,done:t}=await m.read();if(t)break;g+=h.decode(e,{stream:!0});let n=g.indexOf(`
14
+
15
+ `);for(;n!==-1;){let e=g.slice(0,n);g=g.slice(n+2);for(let t of e.split(`
16
+ `)){if(!t.startsWith(`data:`))continue;let e=t.slice(5).trim();if(!e)continue;let n;try{n=JSON.parse(e)}catch{continue}n.type===`stream_close`&&(p=!0),u(n)}n=g.indexOf(`
17
+
18
+ `)}}if(l?.aborted)throw new DOMException(`Turn stopped`,`AbortError`);if(!p)throw Error(`Connection ended before Aero finished. Review the partial answer before retrying.`)}finally{l?.removeEventListener(`abort`,_);try{m.releaseLock()}catch{}}}function uc(e){return!e||e.role!==`assistant`?``:e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``)}var dc=[{id:`status`,label:`Status`,prompt:`Give me a quick status: the latest check, which engines answered, and anything that needs attention.`},{id:`changes`,label:`What changed`,prompt:`Compare the latest complete check with the one before it. Lead with mentions, then citations. Keep branded and non-brand queries separate if the project splits them, and say which changes are bigger than normal run-to-run noise.`},{id:`gaps`,label:`Biggest gaps`,prompt:`Which tracked queries does no engine mention us on, and who gets named instead? Group them by topic or market.`},{id:`insights`,label:`Top insights`,prompt:`Walk me through the 3 most severe active insights and what to do about each.`}],fc=`https://canonry.ai`,pc=`This demo plays sample answers only. Pick a starting point, or type / to choose one.`,mc=`Stopped. The sample answer so far is kept.`;function hc(e){return{queryKey:[`aero-preview`,e],queryFn:()=>sc(e),staleTime:1/0,gcTime:1/0}}var gc=[{command:`/status`,label:`Status`,prompt:`Give me a quick status: the latest check, which engines answered, and anything that needs attention.`},{command:`/changes`,label:`What changed`,prompt:`Compare the latest complete check with the one before it. Lead with mentions, then citations. Keep branded and non-brand queries separate if the project splits them, and say which changes are bigger than normal run-to-run noise.`},{command:`/gaps`,label:`Biggest gaps`,prompt:`Which tracked queries does no engine mention us on, and who gets named instead? Group them by topic or market.`},{command:`/insights`,label:`Top insights`,prompt:`Walk me through the 3 most severe active insights and what to do about each.`},{command:`/last-run`,label:`Last run`,prompt:`Summarize the latest run for this project: which engines answered, what moved in mentions and citations, and anything that failed.`},{command:`/run-sweep`,label:`Run check now`,prompt:`Run a new AI Visibility check for this project now and tell me when it lands.`},{command:`/queries`,label:`Queries`,prompt:`List the tracked queries for this project and flag any that are obvious duplicates or underperformers.`},{command:`/competitors`,label:`Competitors`,prompt:`Which competitors do engines name most often on queries where we are not named, and on which engines?`},{command:`/new`,label:`New conversation (save current)`,action:`new`}],_c=e=>`canonry:aero:provider:${e}`,vc=(e,t)=>`canonry:aero:model:${e}:${t}`,yc=e=>`canonry:aero:openrouter-model:${e}`;function bc(e){let t={};for(let n of Object.values(en)){let r=Sc(vc(e,n))??(n===en.openrouter?Sc(yc(e)):null);r&&(t[n]=r)}return t}var xc=e=>`canonry:aero:scope:${e}`;function Sc(e){if(typeof window>`u`)return null;try{return window.localStorage.getItem(e)}catch{return null}}function Cc(e,t){if(typeof window<`u`)try{window.localStorage.setItem(e,t)}catch{}}function wc(e){if(typeof window<`u`)try{window.localStorage.removeItem(e)}catch{}}function Tc({projectName:e,context:t,preview:r=Bt()}){let a=yt(),{canWrite:o,account:s}=Xn(),c=ve(),l=s?.role===`viewer`,[u,d]=(0,W.useState)(!1),[f,p]=(0,W.useState)(!1),[h,g]=(0,W.useState)([]),[_,v]=(0,W.useState)(void 0),y=(0,W.useRef)(!1),[b,x]=(0,W.useState)(!1),[S,C]=(0,W.useState)(!1),[w,T]=(0,W.useState)(null),[D,O]=(0,W.useState)(!1),[k,A]=(0,W.useState)(!1),[ne,re]=(0,W.useState)(null),ie=(0,W.useRef)(!1),[oe,se]=(0,W.useState)(``),[ce,le]=(0,W.useState)(!1),[ue,de]=(0,W.useState)(!1),[fe,pe]=(0,W.useState)([]),[me,he]=(0,W.useState)(``),[ge,N]=(0,W.useState)(null),[P,_e]=(0,W.useState)(null),[ye,F]=(0,W.useState)(null),be=(0,W.useRef)(!0),[xe,Se]=(0,W.useState)(()=>Sc(_c(e))??null),Ce=a||l||r?null:xe,[we,Te]=(0,W.useState)(()=>bc(e)),[L,Ee]=(0,W.useState)(null),[De]=(0,W.useState)(()=>Sc(xc(e))===`all`?`all`:`read-only`),Oe=a||l||r?`read-only`:De,ke=(0,W.useRef)(null),Ae=(0,W.useRef)(null),je=(0,W.useRef)(null),Me=(0,W.useRef)(null),{ref:Ne}=Is([h,me,fe]),Pe=(0,W.useRef)(null);(0,W.useLayoutEffect)(()=>{let e=Pe.current;if(!e)return;e.style.height=`auto`;let t=f?Ac:kc;e.scrollHeight>0&&(e.style.height=`${Math.min(e.scrollHeight,t)}px`)},[oe,f,u]);let[Fe,Ie]=(0,W.useState)(0),Le=(0,W.useMemo)(()=>{let e=oe.trimStart();if(!e.startsWith(`/`)||/\s/.test(e))return[];let t=e.toLowerCase();return gc.filter(e=>(!(a||l)||e.command!==`/run-sweep`)&&(!l||e.action!==`new`)&&(!r||dc.some(t=>t.prompt===e.prompt))&&(e.command.startsWith(t)||e.label.toLowerCase().includes(t.slice(1))))},[oe,a,l,r]);(0,W.useEffect)(()=>{Ie(e=>Le.length===0?0:Math.min(e,Le.length-1))},[Le.length]);let Re=I({...hr({client:H,path:{name:e}}),enabled:!l&&!r,staleTime:6e4}),ze=(0,W.useMemo)(()=>{let e=Re.data?.providers??[];if(Ce){let t=e.find(e=>e.id===Ce&&e.configured);if(t)return t}let t=L?e.find(e=>e.id===L.provider&&e.configured):void 0;if(t)return t;let n=Re.data?.defaultProvider;return n?e.find(e=>e.id===n)??null:null},[Ce,Re.data,L]),Be=l||r||ze!==null,Ve=ze?we[ze.id]??``:``,Ue=!Ce&&ze&&L?.provider===ze.id?L.modelId:void 0,We=!a&&!l&&!r&&ze&&Ve.trim()?Ve.trim():void 0,Ge=(We?ze?.id:void 0)??Ce??void 0,Ke=(0,W.useCallback)((t,n)=>{let r=n.trim();Te(e=>({...e,[t]:n})),r?Cc(vc(e,t),r):wc(vc(e,t)),t===en.openrouter&&wc(yc(e))},[e]);I({...hc(e),enabled:r&&u}),(0,W.useEffect)(()=>{Re.data&&Ce&&(Re.data.providers.find(e=>e.id===Ce&&e.configured)||(Se(null),wc(_c(e))))},[Re.data,Ce,e]);let Je=(0,W.useCallback)(t=>{Se(t),t?Cc(_c(e),t):wc(_c(e))},[e]);(0,W.useEffect)(()=>{if(!u)return;let e=e=>{e.key===`Escape`&&(S?C(!1):f?p(!1):d(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u,f,S]);let Ye=(0,W.useRef)(null);(0,W.useEffect)(()=>{u||(Ye.current=null)},[u]),(0,W.useEffect)(()=>{if(!u||!Be||r)return;let t=!1;Ye.current!==e&&(Ye.current=e,N(null));let n=()=>{t||ce||ie.current||oc(e).then(e=>{t||ie.current||(A(e.isStreaming??!1),v(e.conversationId??null),Ee(e.nextTurn??null),!t&&!e.isStreaming&&(Ae.current===null||e.updatedAt&&e.updatedAt!==Ae.current.previous)&&(g(e.messages),ke.current=e.updatedAt,Ae.current=null))}).catch(e=>{t||N(ot(e))})};n();let i=window.setInterval(n,15e3);return()=>{t=!0,window.clearInterval(i)}},[u,e,ce,Be,D,r]),(0,W.useEffect)(()=>(be.current=!0,()=>{be.current=!1,Me.current?.abort()}),[e]);async function Xe(n,i=t){let o=n.trim();if(!o||S||ce||D||ie.current||k||!Be)return;if(r){await Ze(o);return}if(a&&/^\/run-sweep(?:\s|$)/i.test(o)){N(Ls);return}N(null),_e(null),F({prompt:o,context:i}),se(``),le(!0),de(!1),he(``),je.current=null,pe([]),Ae.current={previous:ke.current};let s={role:`user`,content:o,timestamp:Date.now(),aeroContext:i};g(e=>[...e,s]);let c=new AbortController;Me.current=c;try{await lc({project:e,prompt:o,conversationId:_,provider:Ge,modelId:We,scope:Oe,context:i,signal:c.signal,onEvent:Qe});let t=await oc(e);be.current&&!t.isStreaming&&(v(t.conversationId??null),Ee(t.nextTurn??null),g(t.messages),ke.current=t.updatedAt,Ae.current=null)}catch(e){if(!be.current)return;l&&(Ae.current=null);let t=je.current;t&&uc(t).trim()&&g(e=>[...e,t]),c.signal.aborted?_e(`Stopped. Partial response preserved. An action already dispatched may still finish.`):N(ot(e))}finally{be.current&&(le(!1),he(``),pe(e=>e.map(e=>e.endedAt===void 0?{...e,interrupted:!0}:e))),Me.current=null}}async function Ze(t){let n=gc.find(e=>e.command===t.toLowerCase())?.prompt??t,r=dc.find(e=>e.prompt===n)?.id;if(!r){N(null),F(null),_e(pc);return}N(null),_e(null),F({prompt:n}),se(``),le(!0),de(!1),he(``),je.current=null,pe([]),g(e=>[...e,{role:`user`,content:n,timestamp:Date.now()}]);let i=new AbortController;Me.current=i;try{let t=await c.ensureQueryData(hc(e));if(i.signal.aborted)throw new DOMException(`Preview stopped`,`AbortError`);let n=t.starters.find(e=>e.id===r);if(!n)throw Error(`This demo has no sample answer for that starting point.`);await tc({starter:n,signal:i.signal,onEvent:Qe,reducedMotion:Xs()})}catch(e){if(!be.current)return;let t=je.current;t&&uc(t).trim()&&g(e=>[...e,t]),i.signal.aborted?_e(mc):N(ot(e))}finally{be.current&&(le(!1),he(``),pe(e=>e.map(e=>e.endedAt===void 0?{...e,interrupted:!0}:e))),Me.current=null}}function Qe(e){if(be.current)switch(e.type){case`message_update`:e.message.role===`assistant`&&(je.current=e.message),he(uc(e.message));break;case`message_end`:if(e.message.role!==`user`){let t=e.message;g(e=>[...e,t])}e.message.role===`assistant`&&(je.current=null,he(``),e.message.errorMessage&&N(e.message.errorMessage));break;case`aero_turn_status`:de(!0),e.status?.reason===`tool-limit`?_e(`Tool-call limit reached. Partial response preserved.`):e.status?.reason===`time-limit`?_e(`Time limit reached. Partial response preserved.`):e.status?.reason===`completed`?F(null):e.status?.reason===`error`&&N(e=>e??`Aero could not finish this answer. Retry to ask again.`);break;case`agent_end`:de(!0);break;case`tool_execution_start`:pe(t=>[...t,{id:e.toolCallId,name:e.toolName,label:e.label,args:e.args,startedAt:Date.now()}]);break;case`tool_execution_end`:pe(t=>t.map(t=>t.id===e.toolCallId?{...t,endedAt:Date.now(),isError:e.isError,result:e.result}:t));break;case`error`:de(!0),N(e.message)}}async function $e(t,n=!1){if(!(ce||k||ie.current)){ie.current=!0,O(!0),N(null);try{await t();let r=await oc(e);if(!be.current)return;Ae.current=null,ke.current=r.updatedAt,v(r.conversationId??null),Ee(r.nextTurn??null),g(r.messages),pe([]),he(``),_e(null),F(null),re(null),C(n),T(n?await Ct(e):null),Pe.current?.focus()}catch(e){be.current&&N(ot(e))}finally{ie.current=!1,be.current&&O(!1)}}}async function et(){if(r){if(ce)return;g([]),pe([]),he(``),N(null),_e(null),F(null),Pe.current?.focus()}else await $e(()=>l?cc(e):Dn(e,crypto.randomUUID()))}async function tt(t=!1){if(!(ie.current||y.current)){y.current=!0,x(!0),C(!0),N(null);try{let n=await Ct(e,{offset:t?w?.nextOffset??0:0});be.current&&T(e=>t&&e?{...n,conversations:[...e.conversations,...n.conversations]}:n)}catch(e){be.current&&N(ot(e))}finally{y.current=!1,be.current&&x(!1)}}}let nt=h.length===0,rt=!(l||r);if(rt&&Re.isPending)return null;if(rt&&Re.isError)return(0,G.jsx)(`div`,{className:`pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center p-3`,children:(0,G.jsxs)(`div`,{role:`status`,className:`flex w-full max-w-3xl flex-wrap items-center gap-x-2 gap-y-1 rounded-lg border border-base bg-bg/95 px-4 py-2 text-sm shadow-lg`,children:[(0,G.jsx)(M,{className:`h-4 w-4 text-muted`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`font-medium text-strong`,children:`Aero could not check provider availability.`}),(0,G.jsx)(U,{variant:`outline`,size:`sm`,className:`pointer-events-auto ml-auto`,onClick:()=>{Re.refetch()},children:`Try again`})]})});let it=ze&&!ze.configured?ze:null;if(rt&&(!ze||it))return(0,G.jsx)(`div`,{className:`pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center p-3`,children:(0,G.jsxs)(`div`,{role:`status`,className:`flex w-full max-w-3xl flex-wrap items-center gap-x-2 gap-y-1 rounded-lg border border-base bg-bg/95 px-4 py-2 text-sm shadow-lg`,children:[(0,G.jsx)(M,{className:`h-4 w-4 text-muted`,"aria-hidden":`true`}),(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5 font-medium text-strong`,children:[it?`Aero is set to ${it.label.replace(/\s+\(.+\)$/,``)}, which has no API key.`:`Aero needs an answer-engine provider.`,(0,G.jsx)(Dr,{text:it?`Set ${Pc(it.id)} on the server, or providers.${it.id}.apiKey in its config.yaml.`:`Aero is the built-in AEO analyst. It reads your Canonry data with you once a provider is connected.`})]}),it?null:o?(0,G.jsx)(U,{asChild:!0,variant:`outline`,size:`sm`,className:`pointer-events-auto ml-auto`,children:(0,G.jsx)(R,{to:`/settings`,children:`Open Settings`})}):(0,G.jsx)(`span`,{className:`ml-auto text-secondary`,children:`Ask an administrator to configure one.`})]})});let at=u&&f?`pointer-events-auto fixed inset-0 z-40 flex items-stretch justify-center bg-bg/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`,st=f?`pointer-events-auto flex h-full w-full max-w-5xl flex-col overflow-hidden rounded-2xl border border-mono-800/80 bg-bg/95 shadow-2xl`:`pointer-events-auto w-full max-w-3xl`,ct=f?`flex-1 overflow-y-auto px-6 py-5 text-sm text-strong`:`max-h-[40vh] min-h-[120px] overflow-y-auto px-4 py-3 text-sm text-strong`;return(0,G.jsx)(`div`,{className:at,onClick:e=>{f&&e.target===e.currentTarget&&p(!1)},children:(0,G.jsx)(`div`,{className:st,children:u?(0,G.jsxs)(`div`,{"data-aero-panel":!0,className:f?`flex h-full flex-col`:`flex flex-col overflow-hidden rounded-2xl border border-mono-800/80 bg-bg/95 shadow-xl backdrop-blur`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-mono-800/70 px-4 py-2.5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(M,{className:`h-4 w-4 shrink-0 text-positive-400`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`text-sm font-medium text-heading`,children:`Aero`}),(0,G.jsx)(`span`,{className:`hidden min-w-0 truncate text-[10px] uppercase tracking-wider text-muted sm:inline`,children:ce||k?`working…`:e})]}),(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[!a&&!l&&!r&&(0,G.jsx)(Dc,{providers:Re.data?.providers??[],active:ze,override:Ce,onPick:Je,modelId:Ve,fallbackModel:Ue,onModelChange:e=>{ze&&Ke(ze.id,e)},disabled:ce}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`shrink-0 rounded-md p-1.5 text-muted transition hover:bg-surface-inset hover:text-strong`,"aria-label":f?`Collapse`:`Expand`,title:f?`Collapse`:`Expand`,children:f?(0,G.jsx)(i,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}):(0,G.jsx)(ee,{className:`h-3.5 w-3.5`,"aria-hidden":`true`})}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>{p(!1),d(!1)},className:`shrink-0 rounded-md p-1.5 text-muted transition hover:bg-surface-inset hover:text-strong`,"aria-label":`Close Aero`,children:(0,G.jsx)(ae,{className:`h-4 w-4`,"aria-hidden":`true`})})]})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-subtle px-4 py-2`,children:[(0,G.jsxs)(U,{variant:`outline`,size:`sm`,disabled:ce||k||D,onClick:Qn(et),title:l||r?`Clear this conversation and start fresh.`:`Save this conversation and start fresh. Shared project notes are kept.`,children:[(0,G.jsx)(j,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),` New conversation`]}),!l&&!r&&(0,G.jsxs)(U,{variant:`ghost`,size:`sm`,"aria-expanded":S,"aria-controls":`aero-history`,disabled:D,onClick:()=>{S?C(!1):tt()},children:[(0,G.jsx)(E,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),` History`]})]}),S?(0,G.jsxs)(`div`,{id:`aero-history`,className:ct,"aria-label":`Conversation history`,children:[(0,G.jsxs)(`h3`,{className:`mb-2 text-sm font-medium text-heading`,children:[`Conversations in `,e]}),w?w.conversations.length===0?(0,G.jsx)(`p`,{className:`text-sm text-secondary`,children:`No saved conversations yet. Your conversations will appear here.`}):(0,G.jsx)(`ul`,{className:`divide-y divide-default`,children:w.conversations.map(t=>(0,G.jsxs)(`li`,{className:`py-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsxs)(`button`,{className:`min-w-0 flex-1 rounded-md px-2 py-1 text-left hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-positive-500`,disabled:ce||k||D,onClick:()=>{t.active?C(!1):$e(()=>Vn(e,t.id))},children:[(0,G.jsx)(`span`,{className:`block truncate text-sm text-heading`,children:t.title}),(0,G.jsxs)(`span`,{className:`text-xs text-secondary`,children:[t.active?`Current · `:``,new Date(t.updatedAt).toLocaleString()]})]}),(0,G.jsx)(U,{variant:`ghost`,size:`sm`,disabled:ce||k||D,"aria-label":`Delete conversation: ${t.title}`,onClick:()=>re(t.id),children:`Delete`})]}),ne===t.id&&(0,G.jsxs)(`div`,{role:`group`,"aria-label":`Confirm conversation deletion`,className:`mt-2 rounded-md border border-default p-3 text-sm text-secondary`,children:[(0,G.jsx)(`p`,{children:`Delete this conversation permanently? Shared project notes will be kept.`}),(0,G.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,G.jsx)(U,{variant:`destructive`,size:`sm`,disabled:D,onClick:()=>{$e(async()=>{await He(e,t.id)},!0)},children:`Delete conversation`}),(0,G.jsx)(U,{variant:`ghost`,size:`sm`,disabled:D,onClick:()=>re(null),children:`Cancel`})]})]})]},t.id))}):(0,G.jsx)(`p`,{className:`text-sm text-secondary`,children:b?`Loading history…`:`History could not be loaded. Close and reopen History to retry.`}),w?.nextOffset!=null&&(0,G.jsx)(U,{variant:`ghost`,size:`sm`,disabled:b,onClick:()=>{tt(!0)},children:b?`Loading…`:`Load more`})]}):(0,G.jsxs)(`div`,{ref:Ne,className:ct,children:[nt&&!ce&&(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 py-2`,children:[(0,G.jsx)(`p`,{className:`text-sm text-secondary`,children:r?(0,G.jsxs)(G.Fragment,{children:[`See how Aero answers about `,(0,G.jsx)(`span`,{className:`text-strong`,children:e}),`. Choose a starting point.`]}):(0,G.jsxs)(G.Fragment,{children:[`Ask about `,(0,G.jsx)(`span`,{className:`text-strong`,children:e}),` or choose a starting point.`]})}),(0,G.jsx)(Nc,{onPick:e=>{Xe(e)}})]}),Ic(h,e,Ge??null,Oe,fe,ce&&!ue,!!me.trim(),!l&&!r,We),ce&&me.trim()&&(0,G.jsxs)(`div`,{className:`mt-3`,children:[(0,G.jsx)(`div`,{className:`mb-0.5 text-[10px] uppercase tracking-wider text-positive-400`,children:`Aero`}),(0,G.jsx)(nl,{content:me})]}),r&&!nt&&!ce&&(0,G.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2 border-t border-subtle pt-3`,children:[(0,G.jsx)(`p`,{className:`text-xs text-secondary`,children:`Try another starting point.`}),(0,G.jsx)(Nc,{onPick:e=>{Xe(e)}})]})]}),(ge||P)&&(0,G.jsxs)(`div`,{role:ge?`alert`:`status`,className:`mx-3 my-2 flex flex-wrap items-center gap-2 rounded-md border border-base bg-surface px-3 py-2 text-sm text-secondary`,children:[(0,G.jsx)(`span`,{className:`flex-1`,children:ge??P}),ye&&!ce&&(0,G.jsx)(U,{variant:`outline`,size:`sm`,onClick:()=>{Oe===`all`?(se(ye.prompt),Pe.current?.focus()):Xe(ye.prompt,ye.context)},children:Oe===`all`?`Review prompt`:`Retry`})]}),r&&(0,G.jsxs)(`p`,{className:`border-t border-subtle px-4 py-2 text-xs text-secondary`,children:[`Sample answers on demo data.`,` `,(0,G.jsxs)(`a`,{href:fc,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-positive-400 underline decoration-positive-700 hover:decoration-positive-400`,children:[`Aero answers from your own Canonry data.`,(0,G.jsx)(n,{className:`h-3 w-3`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`sr-only`,children:` (opens in a new tab)`})]})]}),(0,G.jsxs)(`div`,{className:`relative`,children:[!S&&Le.length>0&&(0,G.jsx)(Mc,{title:r?`Starting points`:`Commands`,matches:Le,selectedIndex:Fe,onHover:Ie,onPick:e=>{se(``),Pe.current?.focus(),e.action===`new`?et():Xe(e.prompt)}}),(0,G.jsxs)(`form`,{className:`flex items-end gap-2 border-t border-mono-800/70 bg-bg/80 px-3 py-2.5`,onSubmit:e=>{if(e.preventDefault(),Le.length>0){let e=Le[Fe];se(``),e.action===`new`?et():Xe(e.prompt)}else Xe(oe)},children:[(0,G.jsx)(`textarea`,{ref:Pe,value:oe,onChange:e=>se(e.target.value),onKeyDown:e=>{if(Le.length>0){if(e.key===`ArrowDown`){e.preventDefault(),Ie(e=>(e+1)%Le.length);return}if(e.key===`ArrowUp`){e.preventDefault(),Ie(e=>(e-1+Le.length)%Le.length);return}if(e.key===`Tab`){e.preventDefault();let t=Le[Fe];se(`${t.command} `);return}if(e.key===`Escape`){e.preventDefault(),se(``);return}}if(e.key===`Enter`&&!e.shiftKey){if(e.preventDefault(),Le.length>0){let e=Le[Fe];se(``),e.action===`new`?et():Xe(e.prompt)}else Xe(oe)}},disabled:S||D,placeholder:S?`Open a conversation to continue…`:r?`Type / for a starting point`:`Ask Aero, or / for commands…`,"aria-label":`Message Aero`,rows:f?3:1,className:`flex-1 resize-none overflow-y-auto bg-transparent text-sm text-heading placeholder:text-mono-600 focus:outline-none disabled:opacity-60`}),ce?(0,G.jsxs)(U,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>Me.current?.abort(),"aria-label":`Stop Aero`,children:[(0,G.jsx)(te,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),` Stop`]}):(0,G.jsx)(U,{type:`submit`,size:`sm`,disabled:!oe.trim()||S||D||k,"aria-label":`Send`,children:(0,G.jsx)(m,{className:`h-4 w-4`,"aria-hidden":`true`})})]})]})]}):(0,G.jsx)(`button`,{type:`button`,onClick:()=>{d(!0),qe(`aero.open`)},className:`flex w-full items-center justify-between rounded-lg border border-mono-800/80 bg-bg/95 px-4 py-2 text-left text-sm text-secondary shadow-lg transition hover:border-strong hover:bg-bg-elevated/90 hover:text-strong`,children:(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(M,{className:`h-4 w-4 text-positive-400`,"aria-hidden":`true`}),`Ask Aero about `,e,`…`]})})})})}function Ec(e,t){return/\s/.test(t)?`Model IDs have no spaces.`:e===en.openrouter&&!Le.test(t)?`Use publisher/model, for example openai/gpt-6-luna.`:null}function Dc({providers:e,active:t,override:n,onPick:r,modelId:i,fallbackModel:a,onModelChange:s,disabled:c}){let[u,d]=(0,W.useState)(!1),[f,p]=(0,W.useState)(null),[m,h]=(0,W.useState)(!1),[g,_]=(0,W.useState)(``),[v,y]=(0,W.useState)(null),b=(0,W.useRef)(null),x=(0,W.useRef)(null),S=(0,W.useRef)(null),C=(0,W.useId)(),w=(0,W.useId)(),T=(0,W.useId)(),E=(0,W.useCallback)(e=>{d(!1),p(null),h(!1),y(null),e&&b.current?.focus()},[]),D=(0,W.useCallback)(()=>{let e=b.current?.getBoundingClientRect();if(!e)return;let t=window.innerHeight-e.bottom-8,n=e.top-8,r=Math.max(8,window.innerWidth-e.right);p(t>=n?{top:e.bottom+4,right:r,maxHeight:t-4}:{bottom:window.innerHeight-e.top+4,right:r,maxHeight:n-4})},[]);(0,W.useLayoutEffect)(()=>{u&&D()},[u,D]);let O=f!==null;if((0,W.useEffect)(()=>{if(!u||!O)return;let e=Oc(x.current);(e.find(e=>e.getAttribute(`aria-checked`)===`true`&&e.closest(`[data-menu-group="model"]`))??e[0])?.focus()},[u,O]),(0,W.useEffect)(()=>{m&&S.current?.focus()},[m]),(0,W.useEffect)(()=>{if(!u)return;let e=e=>{let t=e.target;b.current?.contains(t)||x.current?.contains(t)||E(!1)},t=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopImmediatePropagation(),E(!0))};return window.addEventListener(`mousedown`,e),window.addEventListener(`keydown`,t,!0),window.addEventListener(`resize`,D),()=>{window.removeEventListener(`mousedown`,e),window.removeEventListener(`keydown`,t,!0),window.removeEventListener(`resize`,D)}},[u,E,D]),e.length===0)return null;let ee=e.filter(e=>e.configured),te=ee.length<e.length,k=t?.configured?t.models??[]:[],A=i.trim()||a||t?.defaultModel||``,ne=k.find(e=>e.id===A)?.displayName??A,re=!!(t?.configured&&A&&!k.some(e=>e.id===A)),ie=t?t.label.replace(/\s+\(.+\)$/,``):`No provider`,ae=e=>{let t=e.target;if(e.key===`Tab`){let n=t.closest(`[data-other-model-form]`),r=t.tagName===`INPUT`;if(n&&(r&&!e.shiftKey||!r&&e.shiftKey))return;e.preventDefault(),E(!0);return}if(!t.matches(`[role^="menuitem"]`))return;let n=Oc(x.current),r=n.indexOf(t),i=e.key===`ArrowDown`?n[(r+1)%n.length]:e.key===`ArrowUp`?n[(r-1+n.length)%n.length]:e.key===`Home`?n[0]:e.key===`End`?n[n.length-1]:void 0;i&&(e.preventDefault(),i.focus())},oe=()=>{if(!t)return;let e=g.trim();if(!e){y(`Enter a model ID.`);return}let n=Ec(t.id,e);n?y(n):(s(e),E(!0))},j=`flex min-h-10 w-full items-center gap-2 px-3 py-2 text-left text-sm text-heading transition outline-none hover:bg-bg-elevated focus-visible:bg-bg-elevated focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-mono-400 disabled:opacity-60`,M=e=>(0,G.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center`,children:e?(0,G.jsx)(l,{className:`h-3.5 w-3.5 text-positive-400`,"aria-hidden":`true`}):null});return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{ref:b,type:`button`,onClick:()=>u?E(!1):d(!0),onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),d(!0))},disabled:c,className:`flex min-h-8 min-w-0 items-center gap-1 rounded-md px-2 py-1 text-sm text-secondary transition hover:bg-surface-inset hover:text-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400 disabled:opacity-50`,"aria-haspopup":`menu`,"aria-expanded":u,"aria-controls":u?C:void 0,title:t?`${t.label} · ${A}`:`Pick a provider`,children:[(0,G.jsx)(`span`,{className:`sr-only`,children:`Aero model: `}),(0,G.jsx)(`span`,{className:`min-w-0 truncate font-medium text-strong`,children:t?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{className:`hidden sm:inline`,children:[ie,` · `]}),ne]}):ie}),(0,G.jsx)(o,{className:`h-3 w-3 shrink-0`,"aria-hidden":`true`})]}),u&&f&&(0,Fs.createPortal)((0,G.jsxs)(`div`,{ref:x,id:C,role:`menu`,"aria-label":`Aero model`,onKeyDown:ae,style:{position:`fixed`,top:f.top,bottom:f.bottom,right:f.right,maxHeight:f.maxHeight},className:`z-50 w-72 max-w-[calc(100vw-1rem)] overflow-y-auto rounded-lg border border-base bg-bg py-1 shadow-xl`,children:[(0,G.jsxs)(`div`,{role:`group`,"aria-labelledby":w,children:[(0,G.jsx)(`div`,{id:w,className:`px-3 pb-1 pt-2 text-sm font-medium text-secondary`,children:`Provider`}),ee.map(e=>{let n=t?.id===e.id;return(0,G.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":n,tabIndex:-1,onClick:()=>{n||r(e.id),E(!0)},className:j,children:[M(n),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label.replace(/\s+\(.+\)$/,``)})]},e.id)}),n&&(0,G.jsxs)(`button`,{type:`button`,role:`menuitem`,tabIndex:-1,onClick:()=>{r(null),E(!0)},className:`${j} text-secondary`,children:[M(!1),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`Use default provider`})]}),te&&(0,G.jsxs)(R,{to:`/settings`,role:`menuitem`,tabIndex:-1,onClick:()=>E(!1),className:`${j} text-secondary`,children:[M(!1),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`Connect another provider`})]})]}),t?.configured&&(0,G.jsxs)(`div`,{role:`group`,"aria-labelledby":T,"data-menu-group":`model`,className:`mt-1 border-t border-default`,children:[(0,G.jsx)(`div`,{id:T,className:`px-3 pb-1 pt-2 text-sm font-medium text-secondary`,children:`Model`}),k.map(e=>{let n=e.id===A,r=e.id===t.defaultModel;return(0,G.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":n,tabIndex:-1,onClick:()=>{s(e.id),E(!0)},className:j,title:e.id,children:[M(n),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.displayName}),r&&(0,G.jsx)(`span`,{className:`shrink-0 text-sm text-secondary`,children:`Default`})]},e.id)}),re&&(0,G.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":!0,tabIndex:-1,onClick:()=>E(!0),className:j,title:A,children:[M(!0),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[13px]`,children:A})]}),(0,G.jsxs)(`button`,{type:`button`,role:`menuitem`,"aria-expanded":m,tabIndex:-1,onClick:()=>{_(re?A:``),y(null),h(e=>!e)},className:`${j} text-secondary`,children:[M(!1),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`Other model…`})]}),m&&(0,G.jsxs)(`form`,{"data-other-model-form":!0,className:`px-3 pb-2 pt-1`,onSubmit:e=>{e.preventDefault(),oe()},children:[(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(`input`,{ref:S,className:`setup-input min-w-0 flex-1`,"aria-label":`Other model ID`,"aria-invalid":v?!0:void 0,"aria-describedby":v?`${C}-other-error`:void 0,value:g,placeholder:t.id===en.openrouter?`publisher/model`:`Model ID`,autoComplete:`off`,spellCheck:!1,onChange:e=>{_(e.target.value),y(null)}}),(0,G.jsx)(U,{type:`submit`,variant:`secondary`,size:`sm`,className:`h-auto self-stretch md:h-auto`,children:`Use`})]}),v&&(0,G.jsx)(`p`,{id:`${C}-other-error`,role:`alert`,className:`mt-1.5 text-sm text-negative-400`,children:v})]}),(0,G.jsx)(`p`,{className:`px-3 pb-2 pt-1 text-sm text-secondary`,children:`Applies to Aero only.`})]})]}),document.body)]})}function Oc(e){return Array.from(e?.querySelectorAll(`[role^="menuitem"]`)??[])}var kc=144,Ac=288,jc=288;function Mc({title:e,matches:t,selectedIndex:n,onHover:r,onPick:i}){let a=(0,W.useRef)(null),o=(0,W.useRef)(null),s=(0,W.useRef)(null),[c,l]=(0,W.useState)(jc);return(0,W.useLayoutEffect)(()=>{let e=a.current,t=e?.closest(`[data-aero-panel]`),n=e?.parentElement;if(!e||!t||!n)return;let r=n.getBoundingClientRect().top-t.getBoundingClientRect().top-16-(o.current?.getBoundingClientRect().height??0);l(r>0?Math.min(jc,Math.floor(r)):jc)},[t.length]),(0,W.useEffect)(()=>{(s.current?.querySelector(`[aria-selected="true"]`))?.scrollIntoView?.({block:`nearest`})},[n]),(0,G.jsxs)(`div`,{ref:a,className:`absolute inset-x-3 bottom-full mb-2 overflow-hidden rounded-lg border border-base bg-bg/98 shadow-2xl`,children:[(0,G.jsx)(`div`,{ref:o,className:`border-b border-default px-3 py-1.5 text-[10px] uppercase tracking-wider text-muted`,children:e}),(0,G.jsx)(`ul`,{ref:s,role:`listbox`,className:`overflow-y-auto py-1`,style:{maxHeight:c},children:t.map((e,t)=>{let a=t===n;return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":a,onMouseEnter:()=>r(t),onClick:()=>i(e),className:`flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition ${a?`bg-bg-elevated text-heading`:`text-neutral hover:bg-bg-elevated/60`}`,children:[(0,G.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,G.jsx)(`span`,{className:`ml-auto font-mono text-[11px] text-secondary`,children:e.command})]})},e.command)})})]})}function Nc({onPick:e}){return(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:dc.map(t=>(0,G.jsx)(`button`,{type:`button`,onClick:()=>e(t.prompt),className:`rounded-md border border-base bg-bg-elevated/70 px-3 py-1.5 text-sm text-neutral transition hover:border-strong hover:bg-mono-800/70 hover:text-heading`,children:t.label},t.label))})}function Pc(e){switch(e){case en.claude:return`ANTHROPIC_API_KEY`;case en.openai:return`OPENAI_API_KEY`;case en.gemini:return`GEMINI_API_KEY`;case en.zai:return`ZAI_API_KEY`;case en.openrouter:return`OPENROUTER_API_KEY`}}function Fc(e,t){let n=e.timestamp??0;return`${e.role}:${n}:${t}`}function Ic(e,t,n,r,i,a,o,s=!0,c){let l=[],u=[],d=e.at(-1),f=d?.role===`assistant`&&d.stopReason===`stop`,p=a&&!o&&!f,m=0;for(let t=e.length-1;t>=0;t--)if(e[t].role===`user`){m=t+1;break}let h=(e=!1)=>{u.length!==0&&(l.push((0,G.jsx)(Qc,{trails:u,betweenSteps:e&&p},`tools:${u[0].id}`)),u=[])};for(let o=0;o<e.length;o++){let d=e[o],f=Fc(d,o);if(d.role===`user`){h();let e=typeof d.content==`string`?d.content:JSON.stringify(d.content);if(e.startsWith(`[system]`))continue;l.push((0,G.jsx)(Lc,{text:e,projectName:t,providerOverride:n,modelOverride:c,scope:r,context:d.aeroContext,cliCopy:s},f))}else if(d.role===`assistant`){let t=new Map,n=o+1;for(;n<e.length&&e[n].role===`toolResult`;){let r=e[n];t.set(r.toolCallId,r),n++}let r=a&&o>=m,s=zc(d,t).map(e=>{let t=i.find(t=>t.id===e.id),n={...e,...t,label:e.label??t?.label};return{...n,interrupted:n.endedAt===void 0&&(!r||n.interrupted)}}),c=uc(d);c.trim()&&(h(),l.push((0,G.jsxs)(`div`,{className:`mt-3`,children:[(0,G.jsx)(`div`,{className:`mb-0.5 text-[10px] uppercase tracking-wider text-positive-400`,children:`Aero`}),(0,G.jsx)(nl,{content:c})]},f))),u.push(...s),o=n-1}}return u.length===0&&p&&l.push((0,G.jsx)(rl,{},`thinking`)),h(!0),l}function Lc({text:e,projectName:t,providerOverride:n,modelOverride:r,scope:i,context:a,cliCopy:o=!0}){let[s,c]=(0,W.useState)(!1),u=(0,W.useMemo)(()=>Rc(t,e,n,i,a,r),[t,e,n,i,a,r]);async function d(){try{await navigator.clipboard.writeText(u),c(!0),window.setTimeout(()=>c(!1),1500)}catch{}}return(0,G.jsxs)(`div`,{className:`group relative mt-3 rounded-md bg-bg-elevated/60 px-3 py-2 text-strong`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-muted`,children:`You`}),o&&(0,G.jsx)(`button`,{type:`button`,onClick:Qn(d),className:`inline-flex items-center gap-1 rounded border border-mono-800/70 bg-bg/60 px-1.5 py-0.5 text-[10px] text-secondary opacity-0 transition hover:border-strong hover:text-heading group-hover:opacity-100 focus:opacity-100`,"aria-label":`Copy as CLI command`,title:u,children:s?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(l,{className:`h-2.5 w-2.5 text-positive-400`,"aria-hidden":`true`}),`Copied`]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(h,{className:`h-2.5 w-2.5`,"aria-hidden":`true`}),`Copy as CLI`]})})]}),(0,G.jsx)(`div`,{className:`whitespace-pre-wrap`,children:e})]})}function Rc(e,t,n,r,i,a){let o=[`canonry`,`agent`,`ask`,Hr(e),Hr(t)];return n&&o.push(`--provider`,n),a&&o.push(`--model`,Hr(a)),r===`read-only`&&o.push(`--scope`,`read-only`),i&&o.push(`--context`,Hr(JSON.stringify(i))),o.join(` `)}function zc(e,t){let n=[];for(let r of e.content){if(r.type!==`toolCall`)continue;let e=r,i=t.get(e.id);n.push({id:e.id,name:e.name,args:e.arguments,label:i?.aeroToolLabel,durationMs:i?.aeroDurationMs,endedAt:i?.timestamp,isError:i?.isError,result:i?.content})}return n}var Bc=new Set([`aero_list_toolkits`,`aero_load_toolkit`]),Vc=new Map([[`Read`,`Reading`],[`List`,`Listing`],[`Get`,`Getting`],[`Load`,`Loading`],[`Find`,`Finding`],[`Check`,`Checking`],[`Compare`,`Comparing`],[`Inspect`,`Inspecting`],[`Preview`,`Previewing`],[`Search`,`Searching`],[`Show`,`Showing`],[`Run`,`Running`]]);function Hc(e){return e.endedAt===void 0&&!e.interrupted}function Uc(e){return e.label??e.name.replace(/^(?:canonry|aero)_/,``).replace(/_/g,` `)}function Wc(e){let t=e.durationMs??(e.endedAt!=null&&e.startedAt!=null?e.endedAt-e.startedAt:null);return t==null||t<0?null:t}function Gc(e){let t=null;for(let n of e){let e=Wc(n);e!=null&&(t=(t??0)+e)}return t}function Kc(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function qc(e){let t=Math.floor(Math.max(0,e)/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function Jc(e,t,n){return`${e} ${e===1?t:n}`}function Yc(e=``){return Vc.get(e.charAt(0).toUpperCase()+e.slice(1))}function Xc(e){let[t,...n]=e.trim().split(/\s+/),r=Yc(t);if(!r)return`Working…`;if(n[0]===`or`||n[0]===`and`){let e=Yc(n[1]);return e?`${[r,n[0],e.toLowerCase(),...n.slice(2)].join(` `)}…`:`Working…`}return`${[r,...n].join(` `)}…`}function Zc(e){let[t,n]=(0,W.useState)(()=>Date.now());return(0,W.useEffect)(()=>{if(!e)return;let t=()=>n(Date.now()),r=window.setTimeout(t,0),i=window.setInterval(t,1e3);return()=>{window.clearTimeout(r),window.clearInterval(i)}},[e]),t}function Qc({trails:e,betweenSteps:t}){let[n,r]=(0,W.useState)(!1),i=(0,W.useId)(),a=e.filter(e=>!Bc.has(e.name)),o=e.filter(e=>Bc.has(e.name)),s=a.filter(Hc),c=s.length>0?s[s.length-1]:void 0,u=o.some(Hc),d=c!==void 0||u||t,f=a.length>0?a:o,p=f.filter(e=>!Hc(e)&&e.isError===!0).length,m=e.some(e=>e.interrupted),h=e.flatMap(e=>e.startedAt===void 0?[]:[e.startedAt]),g=h.length>0?Math.min(...h):void 0,_=Zc(d),y=Gc(f),b=d?c?Xc(Uc(c)):u?`Loading tools…`:a.length>0?`Reviewing results…`:`Preparing next step…`:a.length>0?Jc(a.length,`step`,`steps`):Jc(o.length,`setup step`,`setup steps`),x=new Map;for(let e of a){let t=Uc(e),n=x.get(t);n?n.push(e):x.set(t,[e])}return(0,G.jsxs)(`div`,{className:`mt-3 rounded-md border border-mono-800/70 bg-surface-hover`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left`,"aria-expanded":n,"aria-controls":i,children:[(0,G.jsx)(`span`,{className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center`,children:d?(0,G.jsx)(O,{className:`h-3 w-3 animate-spin text-positive-400 motion-reduce:animate-none`,"aria-hidden":`true`}):p>0?(0,G.jsx)(A,{className:`h-3 w-3 text-negative-400`,"aria-hidden":`true`}):m?(0,G.jsx)(te,{className:`h-3 w-3 text-muted`,"aria-hidden":`true`}):(0,G.jsx)(l,{className:`h-3 w-3 text-muted`,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{role:d?`status`:void 0,className:`min-w-0 truncate text-sm font-medium text-heading`,children:b}),p>0&&(0,G.jsxs)(`span`,{className:`shrink-0 rounded-md border border-negative-800/50 bg-negative-950/20 px-1.5 py-0.5 text-[10px] text-negative-400`,children:[p,` failed`]}),m&&(0,G.jsx)(`span`,{className:`shrink-0 rounded-md border border-mono-800/70 px-1.5 py-0.5 text-[10px] text-muted`,children:`interrupted`}),(0,G.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 text-[10px] text-muted`,children:[d?(0,G.jsxs)(G.Fragment,{children:[c&&(0,G.jsxs)(`span`,{children:[`step `,a.indexOf(c)+1]}),g!==void 0&&(0,G.jsx)(`span`,{className:`tabular-nums`,"aria-hidden":`true`,children:qc(_-g)})]}):y!=null&&(0,G.jsx)(`span`,{className:`tabular-nums`,children:Kc(y)}),(0,G.jsx)(v,{className:`h-3 w-3 transition-transform ${n?`rotate-90`:``}`,"aria-hidden":`true`})]})]}),n&&(0,G.jsxs)(`div`,{id:i,className:`space-y-1.5 border-t border-default px-2.5 py-2`,children:[[...x].map(([e,t])=>(0,G.jsx)($c,{trails:t,title:e},`label:${e}`)),o.length>0&&(0,G.jsx)($c,{trails:o,title:`+ ${Jc(o.length,`setup step`,`setup steps`)}`,muted:!0},`setup`)]})]})}function $c({trails:e,title:t,muted:n=!1}){let[r,i]=(0,W.useState)(!1),a=(0,W.useId)(),o=!n&&e.length===1,s=e.some(Hc),c=e.filter(e=>!Hc(e)&&e.isError===!0).length,l=e.some(e=>e.interrupted),u=Gc(e),d=o?()=>i(!0):void 0;return(0,G.jsxs)(`div`,{className:o?void 0:n?`rounded-md`:`rounded-md border border-mono-800/70 bg-surface-hover`,onFocus:d,onClick:d,children:[!o&&(0,G.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left`,"aria-expanded":r,"aria-controls":a,children:[!n&&(0,G.jsx)(`span`,{className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center`,children:s?(0,G.jsx)(O,{className:`h-3 w-3 animate-spin text-positive-400 motion-reduce:animate-none`,"aria-hidden":`true`}):c>0?(0,G.jsx)(A,{className:`h-3 w-3 text-negative-400`,"aria-hidden":`true`}):(0,G.jsx)(k,{className:`h-3 w-3 text-muted`,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:n?`text-xs text-muted`:`text-sm font-medium text-heading`,children:t}),!n&&(0,G.jsxs)(`span`,{className:`text-[10px] text-muted`,children:[`×`,e.length]}),(0,G.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 text-[10px] text-muted`,children:[s?(0,G.jsx)(`span`,{className:`text-positive-400`,children:`running…`}):(0,G.jsxs)(G.Fragment,{children:[c>0?(0,G.jsxs)(`span`,{className:`text-negative-400`,children:[c,` failed`]}):(0,G.jsx)(`span`,{children:l?`interrupted`:`done`}),u!=null&&(0,G.jsx)(`span`,{className:`tabular-nums`,children:Kc(u)})]}),(0,G.jsx)(v,{className:`h-3 w-3 transition-transform ${r?`rotate-90`:``}`,"aria-hidden":`true`})]})]}),(o||r)&&(0,G.jsx)(`div`,{id:a,className:o?void 0:`space-y-1.5 px-2.5 pb-2`,children:e.map(e=>(0,G.jsx)(el,{trail:e},e.id))})]})}function el({trail:e}){let[t,n]=(0,W.useState)(!1),r=Hc(e),i=!r&&e.isError===!0,a=Wc(e),o=a==null?null:Kc(a);return(0,G.jsxs)(`div`,{className:`rounded-md border ${i?`border-negative-800/50`:r?`border-positive-800/50`:`border-mono-800/70`} ${i?`bg-negative-950/20`:r?`bg-positive-950/20`:`bg-surface-hover`}`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex w-full items-center gap-2 px-2.5 py-1.5 text-left`,"aria-expanded":t,children:[(0,G.jsx)(`span`,{className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center`,children:r?(0,G.jsx)(O,{className:`h-3 w-3 animate-spin text-positive-400`,"aria-hidden":`true`}):i?(0,G.jsx)(A,{className:`h-3 w-3 text-negative-400`,"aria-hidden":`true`}):(0,G.jsx)(k,{className:`h-3 w-3 text-muted`,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`text-sm font-medium text-heading`,children:Uc(e)}),(0,G.jsxs)(`span`,{className:`ml-auto flex items-center gap-2 text-[10px] text-muted`,children:[r?(0,G.jsx)(`span`,{className:`text-positive-400`,children:`running…`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{children:e.interrupted?`interrupted`:i?`failed`:`done`}),o&&(0,G.jsx)(`span`,{children:o})]}),(0,G.jsx)(v,{className:`h-3 w-3 transition-transform ${t?`rotate-90`:``}`,"aria-hidden":`true`})]})]}),t&&(0,G.jsxs)(`div`,{className:`border-t border-default px-2.5 py-2 text-[11px] text-secondary`,children:[(0,G.jsx)(`div`,{className:`mb-2 text-xs text-secondary`,children:e.name}),(0,G.jsx)(`div`,{className:`mb-1 text-xs text-secondary`,children:`Inputs`}),(0,G.jsx)(`pre`,{className:`mb-2 overflow-x-auto whitespace-pre-wrap break-all text-xs text-neutral`,children:tl(e.args)}),!r&&e.result!==void 0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`mb-1 text-[9px] uppercase tracking-wider text-faint`,children:i?`Error`:`Result`}),(0,G.jsx)(`pre`,{className:`overflow-x-auto whitespace-pre-wrap break-all text-xs text-neutral`,children:tl(e.result)})]})]})]})}function tl(e){try{let t=typeof e==`string`?e:JSON.stringify(e,null,2);return t.length>2e3?`${t.slice(0,2e3)}\n… (${t.length-2e3} more chars)`:t}catch{return String(e)}}function nl({content:e}){return(0,G.jsx)(`div`,{className:`text-heading`,children:(0,G.jsx)(N,{remarkPlugins:[_e],components:{h1:e=>(0,G.jsx)(`h1`,{...e,className:`mt-3 mb-2 text-base font-semibold text-primary`}),h2:e=>(0,G.jsx)(`h2`,{...e,className:`mt-3 mb-2 text-sm font-semibold text-primary`}),h3:e=>(0,G.jsx)(`h3`,{...e,className:`mt-3 mb-1.5 text-sm font-semibold text-heading`}),h4:e=>(0,G.jsx)(`h4`,{...e,className:`mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-neutral`}),p:e=>(0,G.jsx)(`p`,{...e,className:`mb-2 leading-relaxed`}),ul:e=>(0,G.jsx)(`ul`,{...e,className:`mb-2 ml-4 list-disc space-y-1`}),ol:e=>(0,G.jsx)(`ol`,{...e,className:`mb-2 ml-4 list-decimal space-y-1`}),li:e=>(0,G.jsx)(`li`,{...e,className:`marker:text-mono-600`}),strong:e=>(0,G.jsx)(`strong`,{...e,className:`font-semibold text-primary`}),em:e=>(0,G.jsx)(`em`,{...e,className:`text-strong`}),code:({children:e,...t})=>(0,G.jsx)(`code`,{...t,className:`rounded bg-mono-800/70 px-1 py-0.5 font-mono text-[12px] text-positive-200`,children:e}),pre:e=>(0,G.jsx)(`pre`,{...e,className:`mb-2 overflow-x-auto rounded-md border border-base bg-bg-elevated/70 p-3 font-mono text-xs text-strong`}),a:e=>(0,G.jsx)(`a`,{...e,className:`text-positive-400 underline decoration-positive-700 hover:decoration-positive-400`,target:`_blank`,rel:`noopener noreferrer`}),table:e=>(0,G.jsx)(`div`,{className:`mb-2 overflow-x-auto`,children:(0,G.jsx)(`table`,{...e,className:`w-full border-collapse text-xs`})}),thead:e=>(0,G.jsx)(`thead`,{...e,className:`border-b border-base`}),th:e=>(0,G.jsx)(`th`,{...e,className:`px-2 py-1 text-left font-semibold text-neutral`}),tr:e=>(0,G.jsx)(`tr`,{...e,className:`border-b border-mono-900`}),td:e=>(0,G.jsx)(`td`,{...e,className:`px-2 py-1 text-strong`}),blockquote:e=>(0,G.jsx)(`blockquote`,{...e,className:`mb-2 border-l-2 border-strong pl-3 italic text-secondary`}),hr:()=>(0,G.jsx)(`hr`,{className:`my-3 border-base`})},children:e})})}function rl(){return(0,G.jsxs)(`div`,{role:`status`,className:`mt-3 flex items-center gap-2 py-1.5 text-sm text-secondary`,children:[(0,G.jsx)(O,{className:`h-3 w-3 shrink-0 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}),`Thinking…`]})}function il({isAdmin:e,account:t}){return e||t?.role===`viewer`&&In()}function al(){let{isAdmin:e,account:t}=Xn(),n=De(),r=/^\/projects\/([^/]+)/.exec(n.pathname),i=r?decodeURIComponent(r[1]):null,a=I({...fr({client:H}),enabled:i!==null,staleTime:6e4}),o=Ps(n.pathname,n.search),s=a.data??[],c=s.find(e=>e.id===i)??s.find(e=>e.name===i),l=Kr(c?.name??i??``,o),u=Bt(),d=u||il({isAdmin:e,account:t});return!i||!d||!c?null:(0,G.jsx)(Tc,{projectName:c.name,context:l,preview:u},c.name)}function ol(e,t,n){switch(e.invalidateQueries({queryKey:_r({client:H})}),e.invalidateQueries({queryKey:pr({client:H})}),ir(e,`runs`),t){case z[`answer-visibility`]:rs(e,n,`none`),ir(e,`visibilityReport`),ir(e,`queryTracking`);return;case z[`backlink-extract`]:return;case z[`seo-sync`]:ir(e,`seo`,{projectName:n});return;case z[`site-audit`]:ir(e,`technicalAeo`);return;case z[`gsc-sync`]:case z[`inspect-sitemap`]:ir(e,`gsc`);return;case z[`ga-sync`]:ir(e,`ga`);return;case z[`traffic-sync`]:ir(e,`ga`),ir(e,`traffic`);return;case z[`bing-inspect`]:case z[`bing-inspect-sitemap`]:ir(e,`bing`);return;case z[`aeo-discover-seed`]:case z[`aeo-discover-probe`]:rs(e,n);return;case z[`gbp-sync`]:ir(e,`gbp`);return;case z[`ads-sync`]:ir(e,`ads`);return;case z[`google-ads-sync`]:ir(e,`googleAds`),ir(e,`conversionTracking`);return;case z[`gtm-sync`]:ir(e,`gtm`),ir(e,`conversionTracking`);return;default:return t}}var sl=[{label:`GitHub`,href:`https://github.com/Canonry/canonry`,Icon:se},{label:`Docs`,href:`https://github.com/Canonry/canonry/tree/main/docs`,Icon:y},{label:`Changelog`,href:`https://github.com/Canonry/canonry/releases`,Icon:a}],cl=e=>({label:e,state:`checking`,detail:`Checking service health`}),ll={apiStatus:cl(`API`),workerStatus:cl(`Worker`)};function ul(e){return e===`completed`?`positive`:e===`partial`?`caution`:`negative`}function dl(e){let t=bs(e.kind);return e.status===`completed`?`${t} completed`:e.status===`partial`?`${t} completed with partial results`:e.status===`cancelled`?`${t} cancelled`:`${t} failed`}function fl(e,t){return e.error?`${t}: ${rn(e.error)}`:e.location?`${t} · ${e.location}`:t}function pl(e,t,n){if(t)return t;let r=n.find(t=>t.id===e);return r?.displayName||r?.name||e}function ml(e,t){return[e.completed>0?`${e.completed} completed`:null,e.partial>0?`${e.partial} partial`:null,e.failed>0?`${e.failed} failed`:null,e.cancelled>0?`${e.cancelled} cancelled`:null,t>0?`${t} skipped at queue time`:null].filter(Boolean).join(`, `)}function hl(e){return e.failed>0||e.cancelled>0?`negative`:e.partial>0?`caution`:`positive`}function gl(){let e=ve(),t=(0,W.useSyncExternalStore)(Ni,Mi,Mi),n=Object.keys(t.runs).length>0||Object.keys(t.batches).length>0,r=I({...lr({client:H}),enabled:n,staleTime:$n,refetchInterval:3e3}),i=I({...fr({client:H}),enabled:n}),a=(0,W.useRef)({}),o=(0,W.useCallback)(()=>{r.refetch()},[r.refetch]);return(0,W.useEffect)(()=>{n&&o()},[n,o]),(0,W.useEffect)(()=>{if(!n||typeof window>`u`)return;let e=()=>{document.visibilityState===`visible`&&o()};return window.addEventListener(`focus`,o),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`focus`,o),document.removeEventListener(`visibilitychange`,e)}},[n,o]),(0,W.useEffect)(()=>{let n=r.data??[],o=i.data??[],s=Object.fromEntries(n.map(e=>[e.id,e])),c=Object.fromEntries(n.map(e=>[e.id,e.status]));for(let n of Object.values(t.runs)){let t=s[n.runId];if(!t||!Ri(t.status)||(a.current[t.id]??n.lastAnnouncedStatus)===t.status)continue;let r=o.find(e=>e.id===t.projectId);if(r&&ol(e,t.kind,r.name),n.sourceAction===`run-all`){Fi(t.id);continue}let i=pl(t.projectId,n.projectLabel,o);tr({title:dl(t),detail:fl(t,i),tone:ul(t.status),dedupeKey:`run:${t.id}`,dedupeMode:`replace`,cta:{label:`View run`,intent:`open-run-drawer`,runId:t.id}}),Fi(t.id)}if(r.data!==void 0){let r=new Set(n.map(e=>e.id)),i=Bi(Object.values(t.runs),r,Date.now(),zi);for(let t of i){let n=o.find(e=>e.id===t.projectId);n&&ol(e,t.kind,n.name),t.sourceAction!==`run-all`&&tr({title:`${bs(t.kind)} status unavailable`,detail:pl(t.projectId,t.projectLabel,o),tone:`neutral`,dedupeKey:`run-stale:${t.runId}`,dedupeMode:`replace`}),Fi(t.runId)}}for(let e of Object.values(t.batches)){let t=Vi(e.runIds,s);t.finished&&(tr({title:`Run-all batch finished`,detail:ml(t,e.skippedCount),tone:hl(t),dedupeKey:`batch:${e.batchId}`,dedupeMode:`replace`,cta:{label:`View runs`,intent:`go-to-runs`}}),Li(e.batchId))}a.current=c},[i.data,r.data,t,e]),null}function _l(){let{account:e,isAdmin:t}=Xn(),n=es(),r=(0,W.useMemo)(()=>Rt(),[]),i=(0,W.useMemo)(Ft,[]),a=(0,W.useMemo)(Nt,[]),o=Bt()||a&&il({isAdmin:t,account:e}),s=(0,W.useMemo)(ht,[]),c=De(),l=Se(),m=(0,W.useRef)(!1);(0,W.useEffect)(()=>{if(r){if(!m.current){m.current=!0;let e=ii(c.pathname,ai());if(e){l({to:e,replace:!0});return}}oi(ri(c.pathname))}},[r,c.pathname,l]);let{dashboard:h,isLoading:y,refetch:b}=ts(void 0,{includeSettings:!r,includeOverviews:!1,pauseProjectPolling:c.pathname===`/setup`}),w=ls(!n,n?.health).data??n?.health??ll,{runId:D,evidenceId:O,closeDrawer:ee}=ds(),[te,k]=(0,W.useState)(!1),[A,ne]=(0,W.useState)(()=>{if(typeof window>`u`)return!1;try{return window.localStorage.getItem(`canonry:sidebarHidden`)===`true`}catch{return!1}}),[re,ie]=(0,W.useState)(()=>{if(typeof window>`u`)return null;try{return window.localStorage.getItem(`canonry:dismissedUpdateVersion`)}catch{return null}}),[j]=(0,W.useState)(()=>typeof window>`u`?null:new URLSearchParams(window.location.search).get(`force-update`)),M=j?{current:w.apiStatus.version??`0.0.0`,latest:j,url:`https://www.npmjs.com/package/@canonry/canonry`,upgradeCommand:`npm install -g @canonry/canonry`}:w.apiStatus.updateAvailable,se=s&&M&&M.latest!==re,ue=()=>{if(M){try{window.localStorage.setItem(`canonry:dismissedUpdateVersion`,M.latest)}catch{}ie(M.latest)}},ge=()=>{let e=!A;try{e?window.localStorage.setItem(`canonry:sidebarHidden`,`true`):window.localStorage.removeItem(`canonry:sidebarHidden`)}catch{}ne(e)},N=us(D),P=N.data??null,_e=N.isLoading;(0,W.useEffect)(()=>{P&&P.status!==`running`&&P.status!==`queued`&&b()},[P?.status,b]),(0,W.useEffect)(()=>{k(!1)},[c.pathname]),(0,W.useEffect)(()=>{if(typeof window>`u`||te||!D&&!O)return;let e=e=>{e.key===`Escape`&&ee()};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[D,O,ee,te]);let ve=h??n?.dashboard??null,ye=c.pathname===`/setup`,F=ye&&ve!==null&&ve.portfolioOverview.projects.length===0,be=ye&&(c.search.onboarding===`site-health`||c.search.onboarding===`first-run`||c.search.onboarding===`complete`),[I,xe]=(0,W.useState)(F);(0,W.useEffect)(()=>{ye?F&&xe(!0):xe(!1)},[F,ye]);let Ce=ye&&(be||F||I||ye&&ve===null),we=Ce?`app-shell-focus`:A?`app-shell-sidebar-hidden`:``,Te=D?(ve?vo(ve,D):void 0)??(P?Mo(P,ve?.projects.find(e=>e.project.id===P.projectId)?.project.displayName??ve?.projects.find(e=>e.project.id===P.projectId)?.project.name??`Unknown project`):void 0):void 0,L=(0,W.useMemo)(()=>mo(c.pathname,ve),[c.pathname,ve]),{commandCenter:Ee,evidenceLoading:ke,evidenceError:Ae,isError:je,refetch:Me}=os(O?L:null,{evidence:!0}),Ne=(0,W.useMemo)(()=>{if(O)return bo(Ee,ve,O)},[O,Ee,ve]),Pe=(()=>{let e=c.pathname;if(e===`/`)return`All projects`;if(e===`/projects`)return`Projects`;if(e===`/runs`)return`Runs`;if(e===`/history`)return`History`;if(e===`/settings`)return`Settings`;if(e===`/setup`)return`Setup`;if(e===`/agent-setup`)return`Agent setup`;if(e===`/backlinks`)return`Backlink data`;if(e===`/traffic`||e.startsWith(`/traffic/`))return`Traffic sources`;if(e.startsWith(`/projects/`)){let e=ve?.projects.find(e=>e.project.name===L);return e?.project.displayName||e?.project.name||L||`Projects`}return`Not found`})();if(r){let e=Br(r.projectTabs),t=!r.views||r.views.includes(qr(c.pathname));return(0,G.jsxs)(`div`,{className:`app-shell app-shell-embed`,"data-theme":li(r.theme),style:ui(r.theme),children:[(0,G.jsx)(`a`,{className:`skip-link`,href:`#content`,children:`Skip to content`}),(0,G.jsx)(`main`,{id:`content`,className:`page-shell`,children:e?(0,G.jsx)(`div`,{className:`embed-view-unavailable`,role:`status`,children:`This embed uses the retired Report tab. Update its allowed tabs to show AI Visibility.`}):t?(0,G.jsx)(Oe,{}):(0,G.jsx)(`div`,{className:`embed-view-unavailable`,role:`status`,children:`This view is not available in embed mode.`})})]})}let Fe=(0,G.jsxs)(`footer`,{className:`footer`,children:[(0,G.jsxs)(`span`,{className:`footer-brand`,children:[(0,G.jsx)(`span`,{children:(0,G.jsx)(`a`,{href:`https://canonry.ai`,children:`Canonry`})}),w.apiStatus.version&&w.apiStatus.version!==`unknown`?(0,G.jsxs)(`span`,{className:`footer-version`,children:[`v`,w.apiStatus.version]}):null]}),i?(0,G.jsx)(`div`,{className:`footer-links`,children:sl.map(({label:e,href:t,Icon:n})=>(0,G.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,title:e,"aria-label":e,className:`footer-icon`,children:(0,G.jsx)(n,{className:`size-3.5`})},t))}):null]});return(0,G.jsxs)(he,{open:te,onOpenChange:k,children:[(0,G.jsx)(`a`,{className:`skip-link`,href:`#content`,children:`Skip to content`}),(0,G.jsx)(ys,{}),(0,G.jsxs)(`div`,{className:`app-shell ${we}${An()?` app-shell-demo`:``}`,children:[!Ce&&!A&&(0,G.jsxs)(`aside`,{id:`desktop-sidebar`,className:`sidebar`,"aria-label":`Primary navigation`,children:[(0,G.jsx)(`div`,{className:`sidebar-brand`,children:(0,G.jsx)(Ui,{version:w.apiStatus.version,updateAvailable:se?M:null,onDismissUpdate:ue})}),(0,G.jsxs)(`nav`,{className:`sidebar-nav`,children:[(0,G.jsxs)(R,{to:`/`,className:`sidebar-link`,activeProps:{className:`sidebar-link sidebar-link-active`},activeOptions:{exact:!0},children:[(0,G.jsx)(d,{className:`sidebar-icon`}),(0,G.jsx)(`span`,{children:`All projects`})]}),(0,G.jsxs)(R,{to:`/projects`,className:`sidebar-link`,activeProps:{className:`sidebar-link sidebar-link-active`},activeOptions:{exact:!1},children:[(0,G.jsx)(p,{className:`sidebar-icon`}),(0,G.jsx)(`span`,{children:`Projects`})]}),(0,G.jsxs)(R,{to:`/runs`,className:`sidebar-link`,activeProps:{className:`sidebar-link sidebar-link-active`},activeOptions:{exact:!0},children:[(0,G.jsx)(g,{className:`sidebar-icon`}),(0,G.jsx)(`span`,{children:`Runs`})]}),(0,G.jsxs)(R,{to:`/history`,className:`sidebar-link`,activeProps:{className:`sidebar-link sidebar-link-active`},activeOptions:{exact:!0},children:[(0,G.jsx)(E,{className:`sidebar-icon`}),(0,G.jsx)(`span`,{children:`History`})]}),(0,G.jsxs)(R,{to:`/traffic`,className:`sidebar-link`,activeProps:{className:`sidebar-link sidebar-link-active`},activeOptions:{exact:!1},children:[(0,G.jsx)(S,{className:`sidebar-icon`}),(0,G.jsx)(`span`,{children:`Traffic sources`})]}),!An()&&(0,G.jsxs)(R,{to:`/backlinks`,className:`sidebar-link`,activeProps:{className:`sidebar-link sidebar-link-active`},activeOptions:{exact:!0},children:[(0,G.jsx)(u,{className:`sidebar-icon`}),(0,G.jsx)(`span`,{children:`Backlink data`})]}),!An()&&(0,G.jsxs)(R,{to:`/agent-setup`,className:`sidebar-link`,activeProps:{className:`sidebar-link sidebar-link-active`},activeOptions:{exact:!0},children:[(0,G.jsx)(C,{className:`sidebar-icon`}),(0,G.jsx)(`span`,{children:`Agent setup`})]}),t&&(0,G.jsxs)(R,{to:`/settings`,className:`sidebar-link`,activeProps:{className:`sidebar-link sidebar-link-active`},activeOptions:{exact:!0},children:[(0,G.jsx)(T,{className:`sidebar-icon`}),(0,G.jsx)(`span`,{children:`Settings`})]}),y?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`sidebar-section-title`,children:`Tracked projects`}),[1,2,3].map(e=>(0,G.jsxs)(`div`,{className:`sidebar-skeleton-item`,children:[(0,G.jsx)(`span`,{className:`skeleton-circle size-2`}),(0,G.jsx)(`span`,{className:`skeleton-text flex-1`,style:{width:`${50+e*15}%`}})]},e))]}):ve&&ve.projects.length>0?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`sidebar-section-title`,children:`Tracked projects`}),ve.projects.map(e=>{let t=e.visibilitySummary.tone;return(0,G.jsxs)(R,{to:`/projects/$projectName`,params:{projectName:e.project.name},className:`sidebar-project`,activeProps:{className:`sidebar-project sidebar-project-active`},children:[(0,G.jsx)(`span`,{className:`sidebar-dot sidebar-dot-${t}`}),(0,G.jsx)(`span`,{children:e.project.displayName||e.project.name})]},e.project.id)})]}):y?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`sidebar-section-title`,children:`Resources`}),t&&(0,G.jsxs)(R,{to:`/setup`,className:`sidebar-link`,activeProps:{className:`sidebar-link sidebar-link-active`},activeOptions:{exact:!0},children:[(0,G.jsx)(x,{className:`sidebar-icon`}),(0,G.jsx)(`span`,{children:`Setup`})]})]})]}),e&&(0,G.jsxs)(`div`,{className:`sidebar-account`,children:[(0,G.jsxs)(`div`,{className:`sidebar-account-identity`,children:[(0,G.jsx)(`span`,{className:`sidebar-account-name`,children:e.name}),e.role===`viewer`?(0,G.jsx)(`span`,{className:`sidebar-account-role`,children:Pn()}):null]}),(0,G.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,onClick:Qn(async()=>{await B(),window.location.reload()}),children:`Sign out`})]}),Fe]}),(0,G.jsxs)(`div`,{className:`main-area ${o&&L?`main-area-agent-bar`:``}`.trim(),children:[(0,G.jsxs)(`header`,{className:`topbar`,children:[(0,G.jsxs)(`div`,{className:`topbar-left`,children:[!Ce&&(0,G.jsx)(U,{className:`sidebar-privacy-toggle`,variant:`ghost`,size:`icon`,type:`button`,"aria-label":A?`Show sidebar`:`Hide sidebar`,"aria-controls":A?void 0:`desktop-sidebar`,"aria-expanded":!A,title:A?`Show sidebar`:`Hide sidebar`,onClick:ge,children:A?(0,G.jsx)(oe,{className:`size-4`}):(0,G.jsx)(_,{className:`size-4`})}),(0,G.jsx)(`div`,{className:`topbar-brand-mobile`,children:(0,G.jsx)(Ui,{compact:!0})}),(0,G.jsxs)(`nav`,{className:`breadcrumb`,"aria-label":`Breadcrumb`,children:[(0,G.jsx)(R,{to:`/`,children:`Home`}),(0,G.jsx)(v,{className:`breadcrumb-sep size-3`}),(0,G.jsx)(`span`,{className:`breadcrumb-current`,children:Pe})]})]}),(0,G.jsxs)(`div`,{className:`topbar-actions`,children:[(0,G.jsx)(Ss,{}),(0,G.jsxs)(`div`,{className:`health-pill-row`,children:[(0,G.jsxs)(`span`,{className:`health-pill health-pill-${w.apiStatus.state}`,title:vi(w.apiStatus),children:[`API `,w.apiStatus.state===`ok`?`ok`:w.apiStatus.state]}),(0,G.jsx)(`span`,{className:`health-pill health-pill-${w.workerStatus.state}`,title:vi(w.workerStatus),children:`Worker ${w.workerStatus.state===`ok`?`ok`:w.workerStatus.state}`})]}),Ce?null:(0,G.jsx)(le,{asChild:!0,children:(0,G.jsxs)(U,{className:`nav-toggle`,variant:`secondary`,size:`icon`,type:`button`,children:[(0,G.jsx)(f,{className:`size-4`}),(0,G.jsx)(`span`,{className:`sr-only`,children:`Open navigation`})]})})]})]}),Ce?null:(0,G.jsxs)(fe,{children:[(0,G.jsx)(ce,{className:`fixed inset-0 z-40`}),(0,G.jsxs)(pe,{className:`mobile-nav mobile-nav-open`,"aria-describedby":void 0,children:[(0,G.jsx)(me,{className:`sr-only`,children:`Navigation`}),(0,G.jsx)(de,{asChild:!0,children:(0,G.jsxs)(U,{className:`mobile-nav-close`,variant:`ghost`,size:`icon`,type:`button`,children:[(0,G.jsx)(ae,{className:`size-5`}),(0,G.jsx)(`span`,{className:`sr-only`,children:`Close navigation`})]})}),(0,G.jsx)(R,{to:`/`,className:`mobile-nav-link`,activeProps:{className:`mobile-nav-link mobile-nav-link-active`},activeOptions:{exact:!0},children:`All projects`}),(0,G.jsx)(R,{to:`/projects`,className:`mobile-nav-link`,activeProps:{className:`mobile-nav-link mobile-nav-link-active`},activeOptions:{exact:!1},children:`Projects`}),(0,G.jsx)(R,{to:`/runs`,className:`mobile-nav-link`,activeProps:{className:`mobile-nav-link mobile-nav-link-active`},activeOptions:{exact:!0},children:`Runs`}),(0,G.jsx)(R,{to:`/history`,className:`mobile-nav-link`,activeProps:{className:`mobile-nav-link mobile-nav-link-active`},activeOptions:{exact:!0},children:`History`}),(0,G.jsx)(R,{to:`/traffic`,className:`mobile-nav-link`,activeProps:{className:`mobile-nav-link mobile-nav-link-active`},activeOptions:{exact:!1},children:`Traffic sources`}),!An()&&(0,G.jsx)(R,{to:`/backlinks`,className:`mobile-nav-link`,activeProps:{className:`mobile-nav-link mobile-nav-link-active`},activeOptions:{exact:!0},children:`Backlink data`}),!An()&&(0,G.jsx)(R,{to:`/agent-setup`,className:`mobile-nav-link`,activeProps:{className:`mobile-nav-link mobile-nav-link-active`},activeOptions:{exact:!0},children:`Agent setup`}),t&&(0,G.jsx)(R,{to:`/settings`,className:`mobile-nav-link`,activeProps:{className:`mobile-nav-link mobile-nav-link-active`},activeOptions:{exact:!0},children:`Settings`}),ve&&ve.projects.length>0?(0,G.jsxs)(`div`,{className:`mobile-nav-section`,children:[(0,G.jsx)(`p`,{className:`mobile-nav-section-title`,children:`Tracked projects`}),ve.projects.map(e=>(0,G.jsx)(R,{to:`/projects/$projectName`,params:{projectName:e.project.name},className:`mobile-nav-link`,children:e.project.name},e.project.id))]}):null,e&&(0,G.jsxs)(`div`,{className:`mobile-nav-section`,children:[(0,G.jsx)(`p`,{className:`mobile-nav-section-title`,children:`Signed in`}),(0,G.jsxs)(`div`,{className:`sidebar-account`,children:[(0,G.jsxs)(`div`,{className:`sidebar-account-identity`,children:[(0,G.jsx)(`span`,{className:`sidebar-account-name`,children:e.name}),e.role===`viewer`?(0,G.jsx)(`span`,{className:`sidebar-account-role`,children:Pn()}):null]}),(0,G.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`mobile-sign-out`,onClick:Qn(async()=>{await B(),window.location.reload()}),children:`Sign out`})]})]}),Fe]})]}),(0,G.jsx)(`main`,{id:`content`,className:`page-shell`,children:y&&!n?(0,G.jsxs)(`div`,{className:`page-skeleton`,children:[(0,G.jsxs)(`div`,{className:`page-skeleton-header`,children:[(0,G.jsx)(`div`,{className:`skeleton-text h-6 w-40`}),(0,G.jsx)(`div`,{className:`skeleton-text-sm w-72`})]}),(0,G.jsx)(`div`,{className:`page-skeleton-grid`,children:[1,2,3].map(e=>(0,G.jsxs)(`div`,{className:`page-skeleton-card`,children:[(0,G.jsx)(`div`,{className:`skeleton-text w-24`}),(0,G.jsx)(`div`,{className:`skeleton-text w-full`}),(0,G.jsx)(`div`,{className:`skeleton-text-sm w-3/4`})]},e))}),(0,G.jsx)(`div`,{className:`page-skeleton-grid`,style:{gridTemplateColumns:`1fr 1fr`},children:[1,2].map(e=>(0,G.jsxs)(`div`,{className:`page-skeleton-card`,children:[(0,G.jsx)(`div`,{className:`skeleton-text w-20`}),(0,G.jsx)(`div`,{className:`space-y-2`,children:[1,2,3].map(e=>(0,G.jsx)(`div`,{className:`skeleton-text-sm w-full`},e))})]},e))})]}):(0,G.jsx)(Oe,{})})]}),D&&!Te&&_e?(0,G.jsx)($a,{open:!0,title:`Loading run details`,subtitle:`Fetching the durable run record`,onClose:ee,children:(0,G.jsx)(`p`,{className:`text-sm text-muted`,role:`status`,children:`Loading run details…`})}):null,D&&!Te&&N.isError?(0,G.jsx)($a,{open:!0,title:`Run unavailable`,subtitle:`The run could not be loaded`,onClose:ee,children:(0,G.jsx)(`p`,{className:`text-sm text-negative`,children:N.error instanceof Error?N.error.message:`Run details are unavailable.`})}):null,Te?(0,G.jsxs)($a,{open:!0,title:Te.summary,subtitle:`${Te.projectName} \u00b7 ${Te.kindLabel}`,onClose:ee,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-1 text-sm`,children:[(0,G.jsx)(Ha,{status:Te.status}),(0,G.jsx)(`span`,{className:`text-secondary`,children:Te.startedAt}),(0,G.jsx)(`span`,{className:`text-muted`,children:Te.duration}),(0,G.jsx)(`span`,{className:`text-faint`,children:Te.triggerLabel})]}),Te.status===`failed`&&Te.statusDetail&&(0,G.jsx)(`p`,{className:`mt-2 text-sm text-negative`,children:Te.statusDetail}),(0,G.jsxs)(`div`,{className:`mt-4`,children:[(0,G.jsx)(`p`,{className:`text-[10px] font-semibold uppercase tracking-wider text-muted mb-2`,children:`Activity Log`}),_e?(0,G.jsx)(`p`,{className:`text-sm text-muted`,children:`Loading run details...`}):P?.snapshots&&P.snapshots.length>0?(0,G.jsxs)(`div`,{className:`space-y-2`,children:[P.snapshots.map(e=>(0,G.jsxs)(`div`,{className:`rounded-lg border border-default bg-surface p-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-1`,children:[(0,G.jsx)(`p`,{className:`text-sm font-medium text-strong truncate`,children:e.query??`Unknown query`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(Va,{provider:e.provider}),(0,G.jsx)(an,{variant:e.citationState===Cn.cited?`success`:`neutral`,children:e.citationState})]})]}),e.model&&(0,G.jsx)(`p`,{className:`text-[11px] text-muted font-mono`,children:e.model}),e.citedDomains.length>0&&(0,G.jsxs)(`p`,{className:`text-xs text-muted mt-1`,children:[(0,G.jsx)(`span`,{className:`text-secondary`,children:`Sources:`}),` `,e.citedDomains.join(`, `)]}),e.citedCompetitorDomains.length>0&&(0,G.jsxs)(`p`,{className:`text-xs text-negative-400/80 mt-0.5`,children:[`Competitor cited: `,e.citedCompetitorDomains.join(`, `)]}),e.mentionedCompetitorDomains.length>0&&(0,G.jsxs)(`p`,{className:`text-xs text-negative-400/80 mt-0.5`,children:[`Competitor mentioned: `,e.mentionedCompetitorDomains.join(`, `)]}),e.groundingSources&&e.groundingSources.length>0&&(0,G.jsxs)(`details`,{className:`mt-2`,children:[(0,G.jsxs)(`summary`,{className:`text-xs text-muted cursor-pointer hover:text-secondary`,children:[e.groundingSources.length,` grounding source`,e.groundingSources.length===1?``:`s`]}),(0,G.jsx)(`ul`,{className:`mt-2 space-y-3`,children:e.groundingSources.map((e,t)=>(0,G.jsx)(`li`,{className:`min-w-0`,children:(0,G.jsx)(no,{url:e.uri,title:e.title})},t))})]}),e.answerText&&(0,G.jsxs)(`details`,{className:`mt-1`,children:[(0,G.jsx)(`summary`,{className:`text-xs text-muted cursor-pointer hover:text-secondary`,children:`Answer preview`}),(0,G.jsx)(`p`,{className:`mt-1 text-xs text-secondary leading-relaxed whitespace-pre-wrap`,children:e.answerText})]})]},e.id)),P.status===`running`&&(0,G.jsxs)(`div`,{className:`flex items-center gap-2 p-3 text-sm text-muted`,children:[(0,G.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-caution-500 animate-pulse`}),`Running remaining queries...`]})]}):P&&P.status===V.running?(0,G.jsxs)(`div`,{className:`flex items-center gap-2 p-3 text-sm text-muted`,children:[(0,G.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-caution-500 animate-pulse`}),P.kind===z[`answer-visibility`]?`Waiting for first query result...`:`Run is in progress...`]}):P&&P.status===V.queued?(0,G.jsxs)(`div`,{className:`flex items-center gap-2 p-3 text-sm text-muted`,children:[(0,G.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-mono-500 animate-pulse`}),`Run queued, waiting for execution slot...`]}):P&&P.error?(0,G.jsxs)(`div`,{className:`rounded-lg border border-negative-800/40 bg-negative-950/20 p-3`,children:[(0,G.jsx)(`p`,{className:`text-sm font-medium text-negative mb-2`,children:`Run failed`}),(0,G.jsx)(`pre`,{className:`max-h-48 overflow-y-auto whitespace-pre-wrap break-words font-mono text-xs leading-5 text-negative`,children:Gn(P.error)})]}):Te.kind===z[`answer-visibility`]?(0,G.jsx)(`p`,{className:`text-sm text-muted`,children:`No snapshot data available.`}):(0,G.jsx)(`p`,{className:`text-sm text-secondary`,children:Te.status===V.completed?`Run completed.`:Te.status===V.partial?`Run completed with partial results.`:Te.status===V.cancelled?`Run cancelled.`:Te.status===V.failed?`Run failed.`:`No run details available.`})]})]}):null,O&&!Ne?(0,G.jsx)($a,{open:!0,title:ke?`Loading answer`:`Answer unavailable`,subtitle:`Query evidence`,onClose:ee,children:ke?(0,G.jsx)(`p`,{role:`status`,className:`text-sm text-secondary`,children:`Loading answer…`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{role:`alert`,className:`text-sm text-secondary`,children:Ae||je?`Could not load this answer.`:`This answer is not in the available query evidence.`}),(0,G.jsx)(U,{type:`button`,variant:`outline`,onClick:()=>{Me()},children:`Retry`})]})}):null,Ne?(0,G.jsx)(uo,{evidence:Ne.evidence,project:Ne.project,onClose:ee}):null,(0,G.jsx)(gl,{}),(0,G.jsx)(ms,{}),o?(0,G.jsx)(al,{}):null]})]})}var vl=class extends W.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`[ErrorBoundary]`,e,t.componentStack),vt({kind:`render`,error:e,component:this.props.name??`root`})}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?(0,G.jsx)(`div`,{className:`page-container`,children:(0,G.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-4 py-20 text-center`,children:[(0,G.jsx)(`div`,{className:`rounded-full bg-negative-950/40 p-3`,children:(0,G.jsx)(A,{className:`size-6 text-negative-400`})}),(0,G.jsx)(`h2`,{className:`text-lg font-semibold text-heading`,children:`Something went wrong`}),(0,G.jsx)(`p`,{className:`text-sm text-secondary max-w-md`,children:this.state.error.message||`An unexpected error occurred while rendering this page.`}),(0,G.jsxs)(`div`,{className:`flex gap-3 mt-2`,children:[(0,G.jsxs)(U,{variant:`secondary`,size:`sm`,onClick:this.handleReset,children:[(0,G.jsx)(D,{className:`size-3.5 mr-1.5`}),`Try again`]}),(0,G.jsx)(U,{variant:`secondary`,size:`sm`,onClick:()=>{let e=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,``)??``;window.location.href=e||`/`},children:`Go home`})]})]})}):this.props.children}};function yl({disabled:e,title:t,...n}){let{canWrite:r}=Xn();return r?(0,G.jsx)(U,{disabled:e,title:t,...n}):(0,G.jsx)(U,{...n,disabled:!0,title:Yn})}function bl({title:e,children:t}){let{isAdmin:n}=Xn();return n?(0,G.jsx)(G.Fragment,{children:t}):(0,G.jsxs)(Mr,{className:`surface-card mx-auto mt-8 max-w-lg`,children:[(0,G.jsxs)(kr,{children:[(0,G.jsxs)(Or,{children:[e,` is for administrators`]}),(0,G.jsx)(jr,{children:`Your account has view-only access. You can read everything this install has measured; changing how it is set up needs an administrator account.`})]}),(0,G.jsx)(Ar,{children:(0,G.jsx)(`p`,{className:`supporting-copy`,children:`If you need to make a change here, ask an administrator on this install.`})})]})}function xl(e,t,n){return{mode:t,scope:e.measurementScope,scopeKey:e.measurementScopeKey,marketKey:e.marketKey,queryClass:e.queryClass===`non-brand`?`non-brand`:`branded`,provider:e.provider,model:e.model,location:e.location,runId:e.measurementRunId,revision:e.revision,evaluationDefinitionId:n}}function Sl(e,t,n){let r=[...new Set(t.filter(e=>!n||e.provider===n).map(e=>e.sourceRunId).filter(e=>!!e))].sort();return{...e,mode:`simple`,scope:`project`,scopeKey:void 0,marketKey:void 0,provider:n||void 0,model:void 0,revision:void 0,runId:r.length===1?r[0]:void 0,runIds:r.length>1?r:void 0}}function Cl(e,t,n,r){return[`sentiment`,e,t,n??null,r??null]}var wl=5e3,Tl=new Set([`pending`,`running`,`waiting-to-retry`]);function El(e){return Tl.has(e.state)}function Dl(e){let t=e?.coverage.counts;return!!(t&&t.pending+t.running+t[`waiting-to-retry`]>0)}function Ol(e,t){return Dl(e)||t?wl:!1}function kl(e,t,n=!0){let r=I({queryKey:Cl(e,`settings`),queryFn:()=>Me(e),retry:!1,staleTime:0,refetchOnWindowFocus:`always`}),i=I({queryKey:Cl(e,`jobs`),queryFn:()=>pt(e),enabled:!!r.data?.actions.configure,retry:!1,refetchOnWindowFocus:`always`,refetchInterval:e=>e.state.data?.jobs.some(El)?wl:!1}),a=!!i.data?.jobs.some(El),o=i=>{let o={...t,queryClass:i};return{queryKey:Cl(e,`summary`,o),queryFn:()=>Mt(e,o),enabled:n&&!!(r.data?.enabled&&r.data.installEnabled),retry:!1,staleTime:0,refetchOnWindowFocus:`always`,refetchInterval:e=>Ol(e.state.data,a)}};return{settings:r,branded:I(o(`branded`)),nonBrand:I(o(`non-brand`)),jobs:i}}var Al={branded:`Branded`,"non-brand":`Non-brand`};function jl(e){return e>=10}var Y={states:{disabled:`Sentiment is off.`,"not-measured":`No ratings yet.`,processing:`Analyzing sentiment…`,canceled:`Analysis canceled.`,partial:`Partial results.`,failed:`Analysis failed.`,complete:`Analysis complete.`,unsupported:`Sentiment unavailable.`},noJudgments:`No ratings available.`,tooFew:`too few`,minRated:`Shown from 10 ratings`,partial:`Partial results`,columns:{favorable:`Favorable`,rated:`With opinion`},title:`Sentiment`,subtitle:`How AI answers describe you in queries that name you`,rated:`Share of answers that give an opinion (favorable, mixed or unfavorable) about who they name`,noAnswers:`No answers yet`,ratedUnavailable:`Unavailable`,details:{ratedAnswers:`Answers with an opinion`,unadmitted:`Checks not yet analyzed`,checksCaption:`Not counted in the favorable share:`,interval:`Likely range (95%)`},nonBrand:{label:`Non-brand queries`,none:`No unfavorable or mixed answers in non-brand queries.`,noneSoFar:`No unfavorable or mixed answers in non-brand queries so far.`,notRated:`Non-brand answers are not rated yet.`,view:`View answers`,evidence:`Non-brand queries, unfavorable and mixed`,rowNone:`No unfavorable or mixed answers`,rowLabel:`Unfavorable or mixed`,help:`A non-brand answer almost always names you to recommend you, so its favorable share is near 100% and says little. Sentiment is measured on branded queries; unfavorable or mixed answers to non-brand queries are listed here when they happen.`},properties:{title:`Most criticized properties`,evidence:`unfavorable and mixed`,viewAll:`View all unfavorable and mixed answers`,allEvidence:`Branded queries, unfavorable and mixed`},overall:`Favorable share of ratings in answers to branded queries. Each saved answer-subject assessment counts once. Answers with no opinion, or where it is unclear who they name, are left out.`,favorable:`The favorable share of favorable, mixed and unfavorable ratings in answers to branded queries. Each rating covers one subject named in an answer; answers with no opinion are left out.`},Ml=`—`,Nl={factual:`Named, no opinion`,"subject-not-mentioned":`Not named in the answer`,"wrong-subject":`Named someone else`,"ambiguous-subject":`Unclear which one was meant`,"ambiguous-judgment":`Opinion unclear`,"subject-not-applicable":`Not applicable`,"unsupported-language":`Not in English`,"missing-source-text":`No answer text`,"input-too-large":`Answer too long to rate`,"invalid-conclusion-evidence":`Rating set aside`,pending:`Waiting to be rated`,running:`Being rated`,"waiting-to-retry":`Retrying`};function Pl(e){return Nl[e]??e.replaceAll(`-`,` `).replace(/^./,e=>e.toUpperCase())}var Fl=[`favorable`,`mixed`,`unfavorable`];function Il(e){return e===`favorable`?`positive`:e===`unfavorable`?`negative`:e===`mixed`?`caution`:`neutral`}var Ll=[`mixed`,`unfavorable`];function Rl(e){return e.interval?`${et(e.interval.low,Ke.fraction)} to ${et(e.interval.high,Ke.fraction)}`:null}var zl={favorable:`progress-fill-info`,mixed:`progress-fill-caution`,unfavorable:`progress-fill-negative`};function Bl(e){return`${e} ${e===1?`rating`:`ratings`}`}function Vl(e){return e.score.favorableRate!==null&&e.coverage.judged>0}function Hl(e){return e.state===`complete`&&!e.provisional&&e.coverage.unadmittedAssessments===0}function Ul(e){return e.state===`complete`?Y.partial:Y.states[e.state]}function Wl(e){return e?Vl(e)&&jl(e.coverage.judged):!1}function Gl({value:e,label:t}){let{counts:n,judged:r}=e.coverage;if(!Vl(e))return(0,G.jsx)(`div`,{className:`sentiment-bar sentiment-bar-track`,"data-sentiment-bar":`empty`,"aria-hidden":`true`});let i=Fl.map(e=>`${n[e]} ${e}`).join(`, `);return Wl(e)?(0,G.jsx)(`div`,{role:`img`,"aria-label":`${t}: ${i}, ${e.score.favorableDisplay} favorable of ${Bl(r)}`,className:`sentiment-bar`,"data-sentiment-bar":`rated`,children:Fl.filter(e=>n[e]>0).map(e=>(0,G.jsx)(`span`,{"data-outcome":e,className:`sentiment-bar-segment ${zl[e]}`,style:{flexGrow:n[e]},title:`${Pl(e)}: ${n[e]} of ${Bl(r)}`},e))}):(0,G.jsx)(`div`,{role:`img`,"aria-label":`${t}: ${i}, ${Bl(r)}, favorable share ${Y.minRated.toLowerCase()}`,className:`sentiment-bar sentiment-bar-track`,"data-sentiment-bar":`too-few`})}function Kl({value:e,label:t}){let{counts:n,judged:r}=e.coverage;return(0,G.jsx)(`div`,{role:`img`,"aria-label":`${t}: ${Fl.map(e=>`${n[e]} ${e}`).join(`, `)}, ${Bl(r)}`,className:`sentiment-property-bar`,children:Fl.filter(e=>n[e]>0).map(e=>(0,G.jsx)(`span`,{"data-outcome":e,className:`sentiment-bar-segment ${zl[e]}`,style:{flexGrow:n[e]}},e))})}function ql(e){let t=new Map(e.breakdowns.filter(e=>e.dimension===`property`).map(e=>[e.key,e]));return(e.criticizedProperties?.keys??[]).flatMap(e=>t.get(e)??[])}function Jl({value:e,label:t}){return(0,G.jsx)(`div`,{role:`group`,"aria-label":`${t} favorable share`,className:`sentiment-class-favorable`,children:Wl(e)?(0,G.jsx)(`span`,{className:`sentiment-class-share`,children:e.score.favorableDisplay}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`sentiment-class-empty`,title:Y.minRated,children:Ml}),(0,G.jsx)(`span`,{className:`sr-only`,children:Y.minRated})]})})}function Yl({ratedAnswers:e=0,eligibleAnswers:t=0}){return`${e} of ${t} ${t===1?`answer`:`answers`} rated`}function Xl(e){let{eligibleAnswers:t}=e;return t===void 0?{display:Ml,detail:Y.ratedUnavailable,empty:!0}:t<=0?{display:Ml,detail:Y.noAnswers,empty:!0}:e.ratedAnswerRate===null||e.ratedAnswerRate===void 0?{display:Ml,detail:Y.states.disabled,empty:!0}:{display:et(e.ratedAnswerRate,Ke.fraction),detail:Yl(e),empty:!1}}function Zl({coverage:e,label:t}){let{display:n,detail:r,empty:i}=Xl(e);return(0,G.jsxs)(`div`,{role:`group`,"aria-label":`${t} share rated`,className:`sentiment-class-ratings`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:i?`sentiment-class-empty`:void 0,title:r,children:n}),(0,G.jsx)(`span`,{className:`sr-only`,children:i?r:`${n}, ${r}`})]})}function Ql({value:e}){return Vl(e)?e.provisional?(0,G.jsx)(`p`,{className:`sentiment-class-note text-caution`,children:Y.partial}):null:(0,G.jsx)(`p`,{className:`sentiment-class-note`,children:e.state===`complete`?Y.noJudgments:Y.states[e.state]})}function $l(e){return!!(e.coverage.selected||e.coverage.eligibleAssessments||e.reason)}function eu({value:e,queryClass:t,open:n,setOpenClass:r}){let i=(0,W.useContext)(ru),a=(0,W.useId)(),s=(0,W.useId)(),c=(0,W.useId)(),l=(0,W.useRef)(null),u=(0,W.useRef)(null),d=(0,W.useCallback)(()=>r(e=>e===t?null:e),[r,t]);(0,W.useEffect)(()=>{if(!n)return;let e=e=>e instanceof Node&&!!(l.current?.contains(e)||u.current?.contains(e)),t=t=>{e(t.target)||d()},r=t=>{e(t.target)||d()},i=e=>{e.key===`Escape`&&(d(),l.current?.focus())};return document.addEventListener(`pointerdown`,t),document.addEventListener(`focusin`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`pointerdown`,t),document.removeEventListener(`focusin`,r),document.removeEventListener(`keydown`,i)}},[n,d]);let{coverage:f,score:p}=e,m=Rl(p),h=f.judged>0&&!jl(f.judged),g=t===`branded`?ql(e):[];return $l(e)?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`button`,{ref:l,type:`button`,className:`sentiment-class-details-toggle`,"aria-label":`${Al[t]} details`,"aria-expanded":n,"aria-controls":a,onClick:()=>r(e=>e===t?null:t),children:(0,G.jsx)(o,{className:`sentiment-class-details-chevron`,"aria-hidden":`true`})}),(0,G.jsxs)(`div`,{ref:u,id:a,role:`group`,"aria-labelledby":s,className:`sentiment-class-details`,hidden:!n,children:[(0,G.jsx)(`p`,{id:s,className:`sentiment-class-details-title`,children:Al[t]}),(0,G.jsxs)(`dl`,{className:`sentiment-details-list`,children:[(f.eligibleAnswers??0)>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:Y.details.ratedAnswers}),(0,G.jsxs)(`dd`,{children:[f.ratedAnswers??0,` of `,f.eligibleAnswers]})]}),h&&Fl.filter(e=>f.counts[e]>0).map(e=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:Pl(e)}),(0,G.jsx)(`dd`,{children:f.counts[e]})]},e)),h&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`Favorable share`}),(0,G.jsx)(`dd`,{children:Y.minRated})]}),m&&(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`dt`,{children:[Y.details.interval,` `,(0,G.jsx)(Dr,{text:p.limitation,placement:`bottom`})]}),(0,G.jsx)(`dd`,{children:m})]})]}),i&&g.length>0&&(0,G.jsxs)(`div`,{className:`sentiment-details-properties`,role:`group`,"aria-labelledby":c,children:[(0,G.jsxs)(`p`,{id:c,className:`sentiment-details-subtitle`,children:[Y.properties.title,e.criticizedProperties&&e.criticizedProperties.total>g.length?(0,G.jsxs)(`span`,{className:`sentiment-details-subtitle-count`,children:[` · `,g.length,` of `,e.criticizedProperties.total]}):null]}),(0,G.jsx)(`ul`,{children:g.map(n=>(0,G.jsxs)(`li`,{className:`sentiment-property`,children:[(0,G.jsx)(`button`,{type:`button`,className:`sentiment-property-name`,"aria-label":`View ${Y.properties.evidence} answers for ${n.label}`,onClick:()=>{if(!l.current)return;let r=iu(i,e);i.openEvidence({...r,queryClass:t,scope:`property`,scopeKey:n.key,marketKey:r.scope===`market`?r.scopeKey:r.marketKey,outcome:Ll},`${n.label}, ${Y.properties.evidence}`,l.current)},children:n.label}),(0,G.jsxs)(`span`,{className:`sentiment-property-count`,children:[n.coverage.counts.favorable,` of `,n.coverage.judged,` favorable`]}),(0,G.jsx)(Kl,{value:n,label:n.label})]},n.key))}),(0,G.jsx)(`button`,{type:`button`,className:`sentiment-property-name sentiment-details-view-all`,onClick:()=>{l.current&&i.openEvidence({...iu(i,e),queryClass:t,outcome:Ll},Y.properties.allEvidence,l.current)},children:Y.properties.viewAll})]}),(f.unadmittedAssessments>0||Object.entries(f.counts).some(([e,t])=>t>0&&!Fl.includes(e)))&&(0,G.jsx)(`p`,{className:`sentiment-details-caption`,children:Y.details.checksCaption}),(0,G.jsxs)(`dl`,{className:`sentiment-details-list`,children:[f.unadmittedAssessments>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:Y.details.unadmitted}),(0,G.jsx)(`dd`,{children:f.unadmittedAssessments})]}),Object.entries(f.counts).filter(([e,t])=>t>0&&![`favorable`,`mixed`,`unfavorable`].includes(e)).map(([e,t])=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:Pl(e)}),(0,G.jsx)(`dd`,{children:t})]},e))]}),e.reason&&(0,G.jsx)(`p`,{className:`sentiment-class-details-reason`,children:e.reason})]})]}):null}function tu(e){return!!(e?.configured&&e.branded.coverage.judged>0&&e.branded.score.favorableRate!==null)&&!Ve()}function nu({value:e}){if(!tu(e))return null;let t=e.branded,n=t.coverage.judged,r=Rl(t.score),i=`${Y.overall} ${n} of ${t.coverage.selected} judged${r?`, 95% interval ${r}`:``}. ${t.provisional?`Provisional. `:``}${Y.states[t.state]}${t.reason?` ${t.reason}`:``}`;return(0,G.jsx)(`div`,{className:`project-row-stat`,"data-sentiment-score":!0,children:(0,G.jsxs)(`div`,{className:`metric-inline-block`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`p`,{className:`metric-inline-label`,children:`Sentiment`}),(0,G.jsx)(`span`,{className:`relative z-10`,children:(0,G.jsx)(Dr,{text:i,placement:`bottom`})})]}),jl(n)?(0,G.jsxs)(`p`,{className:`metric-inline-value`,children:[t.score.favorableDisplay,(0,G.jsx)(`span`,{className:`sr-only`,children:` favorable judgments, branded queries`})]}):(0,G.jsxs)(`p`,{className:`metric-inline-value text-secondary`,children:[Y.tooFew,(0,G.jsxs)(`span`,{className:`sr-only`,children:[` ratings for a favorable share, `,n,` of `,10,` needed, branded queries`]})]}),(0,G.jsx)(`p`,{className:`metric-inline-caption`,"aria-hidden":`true`})]})})}var ru=(0,W.createContext)(null);function iu(e,t){let{selection:n}=t;return{...e.selection,...n,runId:n.runId??void 0,runIds:n.runId?void 0:n.runIds,revision:n.revision??void 0,evaluationDefinitionId:n.evaluationDefinitionId??void 0}}function au(){return(0,W.useContext)(ru)?.configured??!1}function ou({projectName:e,selection:t,runOptions:n=[],waitForResolvedRun:r=!1,evidenceReady:i=!0,hasSourceEvidence:a=!0,children:o}){return(0,G.jsx)(su,{projectName:e,selection:t,runOptions:n,waitForResolvedRun:r,evidenceReady:i,hasSourceEvidence:a,children:o})}function su({projectName:e,selection:t,runOptions:n,waitForResolvedRun:r,evidenceReady:i,hasSourceEvidence:a,children:o}){let s=JSON.stringify([e,t]),[c,l]=(0,W.useState)(null),u=(0,W.useCallback)(e=>l(t=>t?.key===s&&t?.runId===e?.runId&&t?.revision===e?.revision?t:e?{...e,key:s}:null),[s]),d=i&&(!r||c?.key===s),f=r&&d&&c?{...t,runId:c.runId,revision:c.revision}:t,p=JSON.stringify([e,f]),{settings:m,branded:h,nonBrand:g,jobs:_}=kl(e,f,d&&a),[v,y]=(0,W.useState)(!1),[b,x]=(0,W.useState)(null),S=(0,W.useRef)(null);(0,W.useEffect)(()=>{y(!1),x(null)},[p]);let C=d&&!!(m.data?.enabled&&m.data.installEnabled),w=(t.queryClass===`non-brand`?g.data:h.data)?.selection,T={...f,...w?{...w,runId:w.runId??void 0,runIds:w.runId?void 0:w.runIds,revision:w.revision??void 0,evaluationDefinitionId:w.evaluationDefinitionId??void 0}:{}},E=T.runId&&!n.some(e=>e.id===T.runId)?[{id:T.runId,label:`Displayed check`},...n]:n,D=e=>{e.preventDefault(),S.current?.focus()};return(0,G.jsxs)(ru.Provider,{value:{projectName:e,selection:f,resolveSource:u,settings:m,summaries:{branded:h,"non-brand":g},configured:C,hasSourceEvidence:a,openManage:e=>{S.current=e,y(!0)},openEvidence:(e,t,n)=>{S.current=n,x({selection:e,label:t})}},children:[o,(0,G.jsx)(Ua,{open:v&&!!m.data?.actions.configure,onOpenChange:y,children:(0,G.jsxs)(Ya,{onCloseAutoFocus:D,className:`overflow-y-auto`,children:[(0,G.jsxs)(Xa,{children:[(0,G.jsx)(Za,{children:`Manage sentiment`}),(0,G.jsx)(Qa,{children:`Classify saved answers and review the cost before submitting a backfill.`})]}),m.data?.actions.configure&&(0,G.jsx)(Du,{projectName:e,settings:m.data,selection:T,runOptions:E},JSON.stringify([m.data.evaluationDefinitionId,m.data.enabled,m.data.enablementEpoch])),_.data&&(0,G.jsx)(xu,{projectName:e,jobs:_.data.jobs})]})}),(0,G.jsx)(Ua,{open:b!==null,onOpenChange:e=>{e||x(null)},children:(0,G.jsxs)(Ya,{onCloseAutoFocus:D,className:`overflow-y-auto`,children:[(0,G.jsxs)(Xa,{children:[(0,G.jsxs)(Za,{children:[`Sentiment evidence`,b?`: ${b.label}`:``]}),(0,G.jsx)(Qa,{children:`Stored judgments and exact quotations for the selected query and scope.`})]}),b&&(0,G.jsx)(vu,{projectName:e,selection:b.selection},JSON.stringify(b.selection))]})})]})}function cu(e,t){let n=(0,W.useContext)(ru)?.resolveSource;(0,W.useEffect)(()=>{n?.(e?{runId:e,revision:t??void 0}:null)},[n,e,t])}function lu(){let e=(0,W.useContext)(ru);return e?.settings.data?.actions.configure?(0,G.jsx)(yl,{type:`button`,variant:`outline`,size:`sm`,onClick:t=>e.openManage(t.currentTarget),children:e.settings.data.enabled?`Manage sentiment`:`Enable sentiment`}):null}function uu(e,t){return!e?.configured||t===`unknown`||t===`unclassified`?null:[`branded`]}function du({queryClass:e=`all`}){let t=(0,W.useContext)(ru),n=uu(t,e);return!t?.hasSourceEvidence||!n?.some(e=>Wl(t.summaries[e].data))?null:(0,G.jsx)(`ul`,{className:`sentiment-legend`,"aria-hidden":`true`,children:Fl.map(e=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`span`,{className:`sentiment-legend-swatch ${zl[e]}`}),Pl(e)]},e))})}function fu({queryClass:e}){let t=(0,W.useContext)(ru);if(!t?.hasSourceEvidence)return null;let n=t.summaries[`non-brand`],r=n.data,i=e===`non-brand`;if(!r)return i?n.isError?(0,G.jsxs)(`p`,{role:`alert`,className:`sentiment-nonbrand-note`,children:[`Couldn’t load non-brand sentiment. `,(0,G.jsx)(U,{variant:`ghost`,onClick:()=>{n.refetch()},children:`Retry`})]}):(0,G.jsx)(`p`,{role:`status`,className:`sentiment-nonbrand-note`,children:`Loading non-brand sentiment…`}):null;let a=r.coverage.counts;return a.unfavorable===0&&a.mixed===0?i?Hl(r)?(0,G.jsx)(`p`,{className:`sentiment-nonbrand-note`,children:Y.nonBrand.none}):Vl(r)?(0,G.jsx)(`p`,{className:`sentiment-nonbrand-note`,children:Y.nonBrand.noneSoFar}):(0,G.jsx)(`p`,{className:`sentiment-nonbrand-note`,children:r.state===`not-measured`?Y.nonBrand.notRated:`${Y.nonBrand.label}: ${Ul(r)}`}):null:(0,G.jsx)(`div`,{className:`sentiment-nonbrand`,role:`group`,"aria-label":Y.nonBrand.label,children:(0,G.jsxs)(`div`,{className:`sentiment-nonbrand-line`,children:[(0,G.jsxs)(`span`,{className:`sentiment-nonbrand-label`,children:[Y.nonBrand.label,(0,G.jsx)(Dr,{text:Y.nonBrand.help})]}),(0,G.jsxs)(`span`,{className:`sentiment-nonbrand-counts`,children:[Ll.slice().reverse().filter(e=>a[e]>0).map(e=>(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`sentiment-legend-swatch ${zl[e]}`}),a[e],` `,e]},e)),!Hl(r)&&(0,G.jsx)(`span`,{className:`text-caution`,children:Y.partial})]}),(0,G.jsx)(U,{type:`button`,variant:`outline`,size:`sm`,onClick:e=>t.openEvidence({...iu(t,r),queryClass:`non-brand`,outcome:Ll},Y.nonBrand.evidence,e.currentTarget),children:Y.nonBrand.view})]})})}function pu({queryClass:e=`all`,legend:t=!0,manage:n=!1}){let r=(0,W.useContext)(ru),i=uu(r,e),[a,o]=(0,W.useState)(null);if(!r)return null;if(!i){let e=r.settings.data;return!n||!e?.actions.configure?null:(0,G.jsxs)(`div`,{className:`sentiment-headlines-title`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`sentiment-headlines-heading`,children:Y.title}),!(e.enabled&&e.installEnabled)&&(0,G.jsx)(`p`,{className:`sentiment-headlines-subtitle`,children:Y.states.disabled})]}),(0,G.jsx)(lu,{})]})}let s=r.hasSourceEvidence&&i.some(e=>r.summaries[e].data);return(0,G.jsxs)(`div`,{className:`sentiment-headlines`,role:`group`,"aria-label":`Favorable answer scores`,children:[(0,G.jsxs)(`div`,{className:`sentiment-headlines-title`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h3`,{className:`sentiment-headlines-heading`,children:Y.title}),(0,G.jsx)(`p`,{className:`sentiment-headlines-subtitle`,children:Y.subtitle})]}),n&&(0,G.jsx)(lu,{})]}),t&&(0,G.jsx)(du,{queryClass:e}),s&&(0,G.jsxs)(`div`,{className:`sentiment-headlines-columns`,"aria-hidden":`true`,children:[(0,G.jsx)(`span`,{className:`sentiment-headlines-favorable`,children:Y.columns.favorable}),(0,G.jsx)(`span`,{className:`sentiment-headlines-ratings`,title:Y.rated,children:Y.columns.rated})]}),i.map(e=>{let t=r.summaries[e];return(0,G.jsxs)(`div`,{className:`sentiment-class`,"data-query-class":e,children:[(0,G.jsxs)(`div`,{className:`sentiment-class-label`,children:[(0,G.jsx)(`span`,{children:Al[e]}),(0,G.jsx)(Dr,{text:Y.favorable})]}),r.hasSourceEvidence?t.data?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Gl,{value:t.data,label:Al[e]}),(0,G.jsx)(Jl,{value:t.data,label:Al[e]}),(0,G.jsx)(Zl,{coverage:t.data.coverage,label:Al[e]}),(0,G.jsx)(Ql,{value:t.data}),(0,G.jsx)(eu,{value:t.data,queryClass:e,open:a===e,setOpenClass:o})]}):t.isError?(0,G.jsxs)(`p`,{role:`alert`,className:`sentiment-class-status`,children:[`Couldn’t load sentiment. `,(0,G.jsx)(U,{variant:`ghost`,onClick:()=>{t.refetch()},children:`Retry`})]}):(0,G.jsx)(`p`,{role:`status`,className:`sentiment-class-status`,children:`Loading sentiment…`}):(0,G.jsx)(`p`,{className:`sentiment-class-status`,children:`No saved answers.`})]},e)}),e!==`branded`&&(0,G.jsx)(fu,{queryClass:e})]})}function mu({queryId:e,sourceSnapshotIds:t=[],queryClass:n,location:r,showLabel:i=!1}){let a=(0,W.useContext)(ru);if(!a?.configured)return null;let o=n?a.summaries[n]:void 0,s=a.hasSourceEvidence?o?.data:void 0,c=s?.queries.filter(r=>r.queryClass===n&&(e?r.queryId===e:t.length>0)&&t.every(e=>r.sourceSnapshotIds.includes(e)))??[],l=c.length===1?c[0]:void 0,u=r===void 0?l:l?.locations.find(e=>e.location===r);if(!l||!u)return(0,G.jsx)(`span`,{className:`text-sm text-secondary`,children:a.hasSourceEvidence&&o?.isPending&&(e||t.length)?`Loading…`:`Unavailable`});let d={...a.selection,...s.selection,runId:s.selection.runId??void 0,runIds:s.selection.runId?void 0:s.selection.runIds,revision:s.selection.revision??void 0,evaluationDefinitionId:s.selection.evaluationDefinitionId??void 0,queryClass:l.queryClass,queryId:l.queryId,executionNodeKey:l.executionNodeKey??void 0,...r===void 0?{}:{location:r??`none`}};if(l.queryClass===`non-brand`){if(u.state===`unsupported`)return(0,G.jsx)(`span`,{className:`text-sm text-secondary`,children:`Unavailable`});let{unfavorable:e,mixed:t}=u.coverage.counts;if(e===0&&t===0){let e=i&&(0,G.jsx)(`span`,{className:`block text-sm font-normal text-secondary`,children:Y.nonBrand.rowLabel});return Hl(u)?(0,G.jsxs)(`span`,{className:`text-sm text-muted`,children:[e,(0,G.jsx)(`span`,{"aria-hidden":`true`,title:Y.nonBrand.rowNone,children:Ml}),(0,G.jsx)(`span`,{className:`sr-only`,children:Y.nonBrand.rowNone})]}):(0,G.jsxs)(`span`,{className:`text-sm text-secondary`,children:[e,(0,G.jsx)(`span`,{children:Ul(u)})]})}return(0,G.jsxs)(U,{type:`button`,variant:`ghost`,className:`h-auto min-h-11 flex-col items-start gap-0 px-1`,"aria-label":`View unfavorable and mixed answers for ${l.queryText}`,onKeyDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),a.openEvidence({...d,outcome:Ll},`${l.queryText}, unfavorable and mixed`,e.currentTarget)},children:[i&&(0,G.jsx)(`span`,{className:`text-sm font-normal text-secondary`,children:Y.nonBrand.rowLabel}),e>0&&(0,G.jsxs)(`span`,{className:`text-sm text-negative`,children:[e,` unfavorable`]}),t>0&&(0,G.jsxs)(`span`,{className:`text-sm text-caution`,children:[t,` mixed`]}),u.provisional&&(0,G.jsx)(`span`,{className:`text-xs font-normal text-caution`,children:`Provisional`})]})}return(0,G.jsxs)(U,{type:`button`,variant:`ghost`,className:`h-auto min-h-11 flex-col items-start gap-0 px-1`,"aria-label":`View ${Al[l.queryClass]} sentiment evidence for ${l.queryText}`,onKeyDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),a.openEvidence(d,l.queryText,e.currentTarget)},children:[i&&(0,G.jsx)(`span`,{className:`text-sm font-normal text-secondary`,children:`Favorable`}),(0,G.jsx)(`span`,{className:`font-mono text-primary`,children:u.score.favorableDisplay}),(0,G.jsxs)(`span`,{className:`text-sm font-normal text-secondary`,children:[u.coverage.judged,` judged`]}),u.provisional&&(0,G.jsx)(`span`,{className:`text-xs font-normal text-caution`,children:`Provisional`})]})}function hu(e){return e.outcome===`subject-not-mentioned`?`Not mentioned`:e.outcome===`running`?`Classifying`:e.outcome===`waiting-to-retry`?`Retrying`:e.outcome?Pl(e.outcome):e.state===`not-measured`?`Not classified`:e.state===`processing`?`Classifying`:e.state===`failed`?`Failed`:e.state===`canceled`?`Canceled`:`Unavailable`}function gu({queryId:e,sourceSnapshotIds:t,queryClass:n,provider:r,model:i,location:a,showSubjects:o=!1,showLabel:s=!1}){let c=(0,W.useContext)(ru);if(!c?.configured)return null;let l=n?c.summaries[n]:void 0,u=c.hasSourceEvidence?l?.data:void 0,d=u?.queries.filter(r=>r.queryClass===n&&(!e||r.queryId===e)&&t.length>0&&t.every(e=>r.sourceSnapshotIds.includes(e)))??[],f=d.length===1?d[0]:void 0,p=f?.assessments?.filter(e=>t.includes(e.sourceSnapshotId)&&e.provider===r&&e.location===a&&(i===void 0||e.servedModel===i))??[];return(0,G.jsxs)(`div`,{role:`group`,className:`text-sm text-secondary`,"aria-label":`${r||`Saved answer`} sentiment`,children:[s&&(0,G.jsx)(`span`,{className:`block text-sm text-secondary`,children:`Sentiment`}),p.length?p.map(e=>{let t=hu(e),n=Il(e.outcome),r=(0,G.jsxs)(G.Fragment,{children:[o&&(0,G.jsxs)(`span`,{children:[e.subjectLabel,` · `]}),(0,G.jsx)(bn,{tone:n,className:`max-w-full shrink-0 rounded-none border-0 bg-transparent p-0 text-sm font-normal tracking-normal [overflow-wrap:normal]`,children:t})]}),i={...c.selection,...u.selection,runId:u.selection.runId??void 0,runIds:u.selection.runId?void 0:u.selection.runIds,revision:u.selection.revision??void 0,evaluationDefinitionId:u.selection.evaluationDefinitionId??void 0,queryClass:f.queryClass,queryId:f.queryId,executionNodeKey:f.executionNodeKey??void 0,assessmentId:e.assessmentId??void 0};return(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.assessmentId?(0,G.jsx)(U,{type:`button`,variant:`ghost`,className:`h-auto min-h-11 flex-wrap justify-start whitespace-normal px-1 text-left text-sm`,"aria-label":`View ${e.provider} sentiment evidence for ${e.subjectLabel}: ${t}`,onKeyDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),c.openEvidence(i,`${f.queryText} · ${e.provider} · ${e.subjectLabel}`,t.currentTarget)},children:r}):(0,G.jsx)(`span`,{children:r}),e.reason&&(0,G.jsx)(Dr,{text:e.reason})]},JSON.stringify([e.sourceSnapshotId,e.subjectId,e.assessmentId]))}):(0,G.jsx)(`span`,{children:c.hasSourceEvidence&&l?.isPending&&t.length?`Loading…`:`Unavailable`})]})}function _u({item:e}){return(0,G.jsxs)(`article`,{className:`space-y-4 border-b border-default py-5 text-sm text-secondary`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`strong`,{className:`text-primary`,children:e.subject.displayName}),(0,G.jsx)(bn,{tone:Il(e.outcome),children:Pl(e.outcome)}),(0,G.jsx)(`span`,{children:Al[e.context.queryClass]}),(0,G.jsx)(`span`,{children:ea(e.context.provider)}),(0,G.jsx)(`span`,{children:e.context.servedModel??`Source model unavailable`}),(0,G.jsx)(`span`,{children:e.context.location??`No location`})]}),e.reason&&(0,G.jsx)(`p`,{children:e.reason}),(0,G.jsxs)(`section`,{children:[(0,G.jsx)(`h3`,{className:`mb-2 text-heading`,children:`Conclusion evidence`}),e.conclusion.length?e.conclusion.map(e=>(0,G.jsx)(`blockquote`,{className:`mb-2 border-l border-strong pl-3 text-primary`,children:e.text},`${e.id}:${e.start}`)):(0,G.jsx)(`p`,{children:`No valid conclusion evidence is available.`})]}),(0,G.jsxs)(`section`,{children:[(0,G.jsx)(`h3`,{className:`mb-2 text-heading`,children:`Complaint evidence`}),e.complaint?.length?e.complaint.map(e=>(0,G.jsx)(`blockquote`,{className:`mb-2 border-l border-strong pl-3 text-primary`,children:e.text},`${e.id}:${e.start}`)):(0,G.jsx)(`p`,{children:`No complaint was identified.`})]}),(0,G.jsxs)(`details`,{children:[(0,G.jsx)(`summary`,{className:`cursor-pointer`,children:`Original source answer`}),(0,G.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap break-words text-primary`,children:e.sourceText})]}),(0,G.jsxs)(`details`,{children:[(0,G.jsx)(`summary`,{className:`cursor-pointer`,children:`Assessment provenance`}),(0,G.jsxs)(`dl`,{className:`mt-3 space-y-2 break-all`,children:[(0,G.jsx)(`dt`,{children:`Query`}),(0,G.jsx)(`dd`,{children:e.context.queryText}),(0,G.jsx)(`dt`,{children:`Subject`}),(0,G.jsxs)(`dd`,{children:[e.subject.displayName,` (`,e.subject.id,`)`]}),(0,G.jsx)(`dt`,{children:`Run`}),(0,G.jsx)(`dd`,{children:e.runId}),(0,G.jsx)(`dt`,{children:`Revision`}),(0,G.jsx)(`dd`,{children:e.context.revision??`Unavailable`}),(0,G.jsx)(`dt`,{children:`Evaluator`}),(0,G.jsx)(`dd`,{children:e.returnedModel??`Unavailable`}),(0,G.jsx)(`dt`,{children:`Evaluation definition`}),(0,G.jsx)(`dd`,{children:e.evaluationDefinitionId}),(0,G.jsx)(`dt`,{children:`Source snapshot`}),(0,G.jsx)(`dd`,{children:e.sourceSnapshotId}),(0,G.jsx)(`dt`,{children:`Source hash`}),(0,G.jsx)(`dd`,{children:e.sourceTextHash}),e.context.usageEdges.map((e,t)=>(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`Assignment`}),(0,G.jsxs)(`dd`,{children:[`Target `,e.targetId,`; Property `,e.propertyId??`None`,`; market `,e.marketId??`None`,`; `,e.queryClass]})]},t))]})]})]})}function vu({projectName:e,selection:t}){let[n,r]=(0,W.useState)(),i=I({queryKey:Cl(e,`evidence`,t,n),queryFn:()=>At(e,t,n),retry:!1});return i.isPending?(0,G.jsx)(`p`,{role:`status`,className:`mt-4 text-sm text-secondary`,children:`Loading sentiment evidence…`}):i.isError?(0,G.jsxs)(`p`,{role:`alert`,className:`mt-4 text-sm text-secondary`,children:[`Could not load sentiment evidence. `,(0,G.jsx)(U,{variant:`outline`,onClick:()=>{i.refetch()},children:`Retry evidence`})]}):(0,G.jsxs)(G.Fragment,{children:[i.data.items.length?i.data.items.map(e=>(0,G.jsx)(_u,{item:e},e.assessmentId)):(0,G.jsx)(`p`,{className:`mt-4 text-sm text-secondary`,children:`No stored sentiment evidence for this query and scope.`}),(0,G.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[n&&(0,G.jsx)(U,{variant:`outline`,onClick:()=>r(void 0),children:`First evidence page`}),i.data.nextCursor&&(0,G.jsx)(U,{variant:`outline`,onClick:()=>r(i.data.nextCursor??void 0),children:`Next evidence page`})]})]})}function yu({projectName:e,jobId:t}){let[n,r]=(0,W.useState)(),i=I({queryKey:Cl(e,`job:${t}`,void 0,n),queryFn:()=>Pt(e,t,n),retry:!1});return i.isPending?(0,G.jsx)(`p`,{role:`status`,children:`Loading attempts…`}):i.isError?(0,G.jsxs)(`p`,{role:`alert`,children:[`Could not load attempts. `,(0,G.jsx)(U,{variant:`outline`,onClick:()=>{i.refetch()},children:`Retry attempts`})]}):(0,G.jsxs)(G.Fragment,{children:[i.data.attempts.map(e=>(0,G.jsxs)(`p`,{children:[e.errorCode??`Request complete`,`; `,e.usage.kind===`unknown`?`Usage unknown`:`${e.usage.inputTokens??`Unknown`} input tokens (${e.usage.kind})`]},e.id)),(0,G.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[n&&(0,G.jsx)(U,{variant:`outline`,onClick:()=>r(void 0),children:`Newest attempts`}),i.data.nextAttemptCursor&&(0,G.jsx)(U,{variant:`outline`,onClick:()=>r(i.data.nextAttemptCursor??void 0),children:`Older attempts`})]})]})}function bu({projectName:e,job:t}){let[n,r]=(0,W.useState)(!1);return(0,G.jsxs)(`details`,{onToggle:e=>r(e.currentTarget.open),children:[(0,G.jsx)(`summary`,{children:`Job details`}),t.cancellationReason&&(0,G.jsx)(`p`,{children:t.cancellationReason}),Object.entries(t.counts).filter(([,e])=>e>0).map(([e,t])=>(0,G.jsxs)(`p`,{children:[Pl(e),`: `,t]},e)),(0,G.jsxs)(`p`,{children:[`Attempts: `,t.attemptCount]}),n&&t.attemptCount>0&&(0,G.jsx)(yu,{projectName:e,jobId:t.id})]})}function xu({projectName:e,jobs:t}){return(0,G.jsxs)(`details`,{className:`mt-6 text-sm text-secondary`,children:[(0,G.jsx)(`summary`,{className:`cursor-pointer`,children:`Recent sentiment jobs`}),t.length===0?(0,G.jsx)(`p`,{className:`mt-2`,children:`No sentiment jobs have been submitted.`}):(0,G.jsx)(`div`,{className:`data-table-wrapper mt-3`,children:(0,G.jsxs)(`table`,{className:`data-table`,"aria-label":`Sentiment jobs`,children:[(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{children:`Submitted`}),(0,G.jsx)(`th`,{children:`State`}),(0,G.jsx)(`th`,{children:`Selected`}),(0,G.jsx)(`th`,{children:`Details`})]})}),(0,G.jsx)(`tbody`,{children:t.map(t=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{children:Un(t.createdAt)}),(0,G.jsx)(`td`,{children:Pl(t.state)}),(0,G.jsx)(`td`,{children:t.selected}),(0,G.jsx)(`td`,{children:(0,G.jsx)(bu,{projectName:e,job:t})})]},t.id))})]})})]})}var Su={probe:`Probe checks`,"unsupported-run-kind":`Not an AI Visibility check`,"failed-run":`Failed check`,"incomplete-run":`Incomplete check`,"legacy-missing-provenance":`Saved without its frozen query and subject record`,"legacy-missing-language":`Saved before the answer language was recorded`,"excluded-branded":`Branded answers (backfill that class separately)`,"excluded-non-brand":`Non-brand answers (backfill that class separately)`};function Cu(e){return Su[e]??Pl(e)}function wu(e){return[e.provider&&`engine ${e.provider}`,e.model&&`model ${e.model}`,e.location&&(e.location===`none`?`no location`:`location ${e.location}`),e.scope!==`project`&&e.scopeKey&&`${e.scope} ${e.scopeKey}`,e.marketKey&&`market ${e.marketKey}`,e.queryId&&`query ${e.queryId}`,e.revision!==void 0&&`revision ${e.revision}`].filter(e=>!!e)}function Tu(e){let t=wu(e);return[`${Al[e.queryClass]} queries`,...t.length?t:[`whole check`]].join(` · `)}function Eu(e,t,n,r){return r?{...e,queryClass:n,queryId:void 0,runIds:void 0,runId:t}:{mode:`auto`,scope:`project`,queryClass:n,runId:t}}function Du({projectName:e,settings:t,selection:n,runOptions:r}){let i=ve(),[a,o]=(0,W.useState)(t.enabled),[s,c]=(0,W.useState)(n.runId??``),[l,u]=(0,W.useState)(n.queryClass),[d,f]=(0,W.useState)(!1),[p,m]=(0,W.useState)(null),h=(0,W.useRef)(null),g=wu({...n,queryId:void 0}),_=()=>i.invalidateQueries({queryKey:[`sentiment`,e]}),v=()=>{m(null),h.current=null},y=F({mutationFn:async()=>{if(!(await Me(e)).actions.configure)throw Error(`Administrator permission is required to configure sentiment.`);return En(e,{enabled:a})},onSuccess:async()=>{v(),await _(),await i.invalidateQueries({queryKey:[`project-overview-slim`]})},onError:_}),b=F({mutationFn:async()=>{if(!(await Me(e)).actions.backfill)throw Error(`Administrator permission is required to backfill sentiment.`);return tn(e,Eu(n,s,l,d&&g.length>0))},onSuccess:e=>{m(e),h.current=crypto.randomUUID()},onError:_}),x=F({mutationFn:async()=>{if(!p?.previewToken||!h.current)throw Error(`Create and review a backfill preview first.`);if(!(await Me(e)).actions.backfill)throw Error(`Administrator permission is required to backfill sentiment.`);return on(e,p.previewToken,h.current)},onSuccess:async()=>{v(),await _()},onError:_}),S=y.isPending||b.isPending||x.isPending;return(0,G.jsxs)(`div`,{className:`mt-5 space-y-5 text-sm text-secondary`,children:[(0,G.jsx)(`dl`,{className:`definition-list`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`Evaluator`}),(0,G.jsxs)(`dd`,{children:[t.model,` · `,t.provider===`openrouter`?`OpenRouter`:`TypeSafe`]})]})}),(0,G.jsx)(`p`,{children:t.disclosure}),!t.ready&&(0,G.jsx)(`p`,{children:t.readinessReasons.join(`; `)||`An operator must configure sentiment on this installation.`}),(0,G.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),y.mutate()},children:[(0,G.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:a,disabled:S,onChange:e=>{o(e.target.checked),v()}}),`Enable project sentiment`]}),(0,G.jsx)(`p`,{children:`Enabling applies to future completed checks. Past checks require an explicit backfill.`}),(0,G.jsx)(yl,{type:`submit`,disabled:S,children:y.isPending?`Saving…`:`Save sentiment settings`}),y.isError&&(0,G.jsx)(`p`,{role:`alert`,children:ot(y.error)}),y.isSuccess&&(0,G.jsx)(`p`,{role:`status`,children:`Sentiment settings saved.`})]}),t.actions.backfill&&(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsx)(`h3`,{children:`Backfill a saved check`}),(0,G.jsxs)(`label`,{className:`block`,children:[`Saved check`,(0,G.jsxs)(`select`,{className:`mt-1 block w-full rounded-md border border-default bg-bg p-2 text-primary`,value:s,disabled:S,onChange:e=>{c(e.target.value),v()},children:[(0,G.jsx)(`option`,{value:``,children:`Select a saved check`}),r.map(e=>(0,G.jsx)(`option`,{value:e.id,children:e.label},e.id))]})]}),(0,G.jsxs)(`label`,{className:`block`,children:[`Query class`,(0,G.jsxs)(`select`,{className:`mt-1 block w-full rounded-md border border-default bg-bg p-2 text-primary`,value:l,disabled:S,onChange:e=>{u(e.target.value),v()},children:[(0,G.jsx)(`option`,{value:`non-brand`,children:`Non-brand`}),(0,G.jsx)(`option`,{value:`branded`,children:`Branded`})]})]}),(0,G.jsx)(`p`,{children:`The backfill covers every engine, location and query of the chosen check for this query class.`}),g.length>0&&(0,G.jsxs)(`label`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(`input`,{type:`checkbox`,className:`mt-1`,checked:d,disabled:S,onChange:e=>{f(e.target.checked),v()}}),(0,G.jsxs)(`span`,{children:[`Limit to the current view`,(0,G.jsx)(`span`,{className:`block`,children:g.join(` · `)})]})]}),(0,G.jsx)(U,{variant:`outline`,disabled:S||!s||!t.enabled||!t.ready,onClick:()=>{v(),b.mutate()},children:b.isPending?`Preparing preview…`:`Preview sentiment backfill`}),b.isError&&(0,G.jsx)(`p`,{role:`alert`,children:ot(b.error)}),p&&(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsxs)(`dl`,{className:`grid grid-cols-[1fr_auto] gap-2`,children:[(0,G.jsx)(`dt`,{children:`Selection`}),(0,G.jsx)(`dd`,{className:`text-right`,children:Tu(p.selection)}),(0,G.jsx)(`dt`,{children:`Eligible assessments`}),(0,G.jsx)(`dd`,{children:p.eligibleAssessments}),(0,G.jsx)(`dt`,{children:`Already classified`}),(0,G.jsx)(`dd`,{children:p.alreadyClassified}),(0,G.jsx)(`dt`,{children:`Estimated input tokens`}),(0,G.jsx)(`dd`,{children:p.estimatedInputTokens}),(0,G.jsx)(`dt`,{children:`Estimated cost (USD)`}),(0,G.jsx)(`dd`,{children:p.estimatedCostUsd??`Unavailable`})]}),(0,G.jsx)(Dr,{text:p.estimateMethod}),p.eligibleAssessments===0&&(0,G.jsx)(`p`,{children:`No saved answers in this selection can be classified.`}),p.skipped.length>0&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{children:`Not included:`}),(0,G.jsx)(`ul`,{"aria-label":`Skipped assessments`,className:`list-disc pl-5`,children:p.skipped.map(e=>(0,G.jsxs)(`li`,{children:[Cu(e.reason),`: `,e.count]},`${e.runId}:${e.reason}`))})]}),(0,G.jsx)(yl,{disabled:S||!p.previewToken||p.eligibleAssessments===0,onClick:()=>x.mutate(),children:x.isPending?`Submitting…`:`Confirm sentiment backfill`})]}),x.isError&&(0,G.jsxs)(`p`,{role:`alert`,children:[ot(x.error),` Retry uses the same request key.`]}),x.isSuccess&&(0,G.jsx)(`p`,{role:`status`,children:`Backfill submitted. Progress is available in Recent jobs.`})]})]})}var Ou=20;function ku({points:e,tone:t}){let n=(0,W.useId)();if(e.length===0)return null;let r=t=>5+t/Math.max(e.length-1,1)*122,i=Vr(e),a=Math.min(...e),o=Math.max(...e),s=Math.max(o-a,Ou),c=(o+a)/2-s/2,l=e.map((e,t)=>({x:r(t),y:5+(1-(e-c)/s)*26}));return(0,G.jsxs)(`svg`,{className:`sparkline sparkline-${t}${i?` sparkline-provisional`:``}`,viewBox:`0 0 132 42`,"aria-hidden":`true`,children:[(0,G.jsx)(`defs`,{children:(0,G.jsx)(`clipPath`,{id:n,children:(0,G.jsx)(`rect`,{x:5,y:5,width:122,height:32,rx:`8`})})}),(0,G.jsx)(`line`,{className:`sparkline-guide`,x1:5,x2:127,y1:37,y2:37}),l.length===1?(0,G.jsx)(`circle`,{className:`sparkline-point`,cx:l[0].x,cy:l[0].y,r:`3`}):(0,G.jsx)(`polyline`,{clipPath:`url(#${n})`,points:l.map(e=>`${e.x},${e.y}`).join(` `),vectorEffect:`non-scaling-stroke`})]})}function Au({run:e,projectName:t,children:n,className:r,label:i}){let{openRun:a}=ds();return e.kind===z[`seo-sync`]&&e.opensSeoWorkspace!==!1?t?(0,G.jsx)(R,{to:`/projects/$projectName/seo-data`,params:{projectName:t},search:t=>({...t,seoRunId:e.id,seoProfileId:void 0,seoRegion:void 0,seoMarket:void 0,seoShow:void 0,seoSort:void 0,seoQ:void 0,runId:void 0,evidenceId:void 0}),className:r,"aria-label":i,children:n}):(0,G.jsx)(`button`,{type:`button`,disabled:!0,className:r,"aria-label":i,title:`Project unavailable`,children:n}):(0,G.jsx)(`button`,{type:`button`,className:r,"aria-label":i,onClick:()=>a(e.id),children:n})}function ju({project:e,sentimentColumn:t}){return(0,G.jsxs)(`div`,{className:`project-row relative${t?` project-row-with-sentiment`:``}`,children:[(0,G.jsx)(`div`,{className:`project-row-chart`,children:(0,G.jsx)(ku,{points:e.trend,tone:fi(e.lastRun.status)})}),(0,G.jsxs)(`div`,{className:`project-row-primary`,children:[(0,G.jsxs)(R,{to:`/projects/$projectName`,params:{projectName:e.project.name},className:`after:absolute after:inset-0 after:rounded-xl focus-visible:outline-none focus-visible:after:ring-2 focus-visible:after:ring-mono-400`,children:[(0,G.jsx)(`p`,{className:`project-name`,children:e.project.name}),(0,G.jsx)(`p`,{className:`project-domain`,children:e.project.canonicalDomain})]}),(0,G.jsx)(`p`,{className:`project-insight`,children:e.insight})]}),(0,G.jsx)(`div`,{className:`project-row-stat`,children:(0,G.jsxs)(`div`,{className:`metric-inline-block`,children:[(0,G.jsx)(`p`,{className:`metric-inline-label`,children:`Mentioned`}),(0,G.jsx)(`p`,{className:`metric-inline-value ${e.mentionTone===`caution`?`text-caution-400`:``}`,children:e.hasMeasurement===!1?`Not measured`:et(e.mentionScore,Ke.percent)}),(0,G.jsx)(`p`,{className:`metric-inline-caption${e.providerCoverage?` text-caution`:``}`,title:e.providerCoverage,children:e.providerCoverage?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`sr-only`,children:`Partial check: `}),e.providerCoverage]}):e.mentionDelta})]})}),(0,G.jsx)(`div`,{className:`project-row-stat`,children:(0,G.jsxs)(`div`,{className:`metric-inline-block`,children:[(0,G.jsxs)(`p`,{className:`metric-inline-label`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`Pressure`}),(0,G.jsx)(`span`,{className:`sr-only`,children:`Competitor pressure`})]}),(0,G.jsx)(`p`,{className:`metric-inline-value`,children:e.hasMeasurement===!1?`Not measured`:e.competitorPressureLabel}),(0,G.jsx)(`p`,{className:`metric-inline-caption`,"aria-hidden":`true`})]})}),tu(e.sentiment)?(0,G.jsx)(nu,{value:e.sentiment}):t&&(0,G.jsx)(`div`,{className:`project-row-stat`,"aria-hidden":`true`,"data-sentiment-placeholder":!0}),(0,G.jsx)(`span`,{className:`project-row-link`,children:(0,G.jsx)(v,{className:`h-4 w-4 text-muted`})})]})}function Mu(){let{isAdmin:e}=Xn(),t=es(),{dashboard:n,isLoading:r,isError:i,activityLoading:a,activityError:o,refetch:s}=ts(),c=n??t?.dashboard,l=ls(!t,t?.health);if(i&&!c)return(0,G.jsxs)(`div`,{className:`page-container`,children:[(0,G.jsx)(`div`,{className:`page-header`,children:(0,G.jsxs)(`div`,{className:`page-header-left`,children:[(0,G.jsx)(`h1`,{className:`page-title`,children:`All projects unavailable`}),(0,G.jsx)(`p`,{className:`page-subtitle`,children:`Canonry could not load the project list.`})]})}),(0,G.jsxs)(`div`,{className:`max-w-xl rounded-lg border border-negative bg-negative-soft p-4`,role:`alert`,children:[(0,G.jsx)(`p`,{className:`text-sm font-medium text-heading`,children:`Your projects have not been changed.`}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-secondary`,children:`Check the connection or sign in again, then retry.`}),(0,G.jsx)(U,{type:`button`,variant:`secondary`,className:`mt-4`,onClick:()=>{s()},children:`Retry loading projects`})]})]});if(!c||r)return(0,G.jsxs)(`div`,{className:`page-skeleton`,children:[(0,G.jsxs)(`div`,{className:`page-skeleton-header`,children:[(0,G.jsx)(`div`,{className:`skeleton-text h-6 w-32`}),(0,G.jsx)(`div`,{className:`skeleton-text-sm w-64`})]}),(0,G.jsx)(`div`,{className:`space-y-3`,children:[1,2,3].map(e=>(0,G.jsxs)(`div`,{className:`rounded-xl border border-default bg-surface p-4 flex items-center gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,G.jsx)(`div`,{className:`skeleton-text w-36`}),(0,G.jsx)(`div`,{className:`skeleton-text-sm w-48`})]}),(0,G.jsx)(`div`,{className:`skeleton-text w-16`}),(0,G.jsx)(`div`,{className:`skeleton-text w-16`}),(0,G.jsx)(`div`,{className:`skeleton h-8 w-20 rounded`})]},e))})]});let u=c.portfolioOverview,d=u.projects.length>0&&u.projects.every(e=>e.hasMeasurement===!1),f=u.projects.some(e=>tu(e.sentiment)),p=u.attentionItems.map(e=>d&&e.id===`attention_stable`?{...e,tone:`neutral`,title:`Awaiting first measurement`,detail:`Visibility results will appear after the first check.`}:e),m=l.data??t?.health??{apiStatus:{label:`API`,state:`checking`,detail:`Checking service health`},workerStatus:{label:`Worker`,state:`checking`,detail:`Checking service health`}},h=yi(u.systemHealth.filter(t=>e||t.id===`api`||t.id===`worker`),m,c.settings);return(0,G.jsxs)(`div`,{className:`page-container`,children:[(0,G.jsx)(`div`,{className:`page-header`,children:(0,G.jsxs)(`div`,{className:`page-header-left`,children:[(0,G.jsx)(`h1`,{className:`page-title`,children:`All projects`}),(0,G.jsx)(`p`,{className:`page-subtitle`,children:`Visibility across all projects.`})]})}),u.projects.length>0?(0,G.jsx)(`div`,{className:`project-list project-list-scrollable`,children:u.projects.map(e=>(0,G.jsx)(ju,{project:e,sentimentColumn:f},e.project.id))}):(0,G.jsxs)(Mr,{className:`surface-card empty-card`,children:[(0,G.jsx)(`h3`,{children:u.emptyState?.title??`No projects yet`}),(0,G.jsx)(`p`,{className:`supporting-copy`,children:u.emptyState?.detail}),(0,G.jsx)(U,{size:`sm`,asChild:!0,children:(0,G.jsx)(R,{to:u.emptyState?.ctaHref===`/setup`||!u.emptyState?.ctaHref?`/setup`:`/`,children:u.emptyState?.ctaLabel??`Launch setup`})})]}),(0,G.jsxs)(`div`,{className:`overview-secondary-grid`,children:[p.length>0&&(0,G.jsxs)(`section`,{className:`overview-secondary-section`,children:[(0,G.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Needs attention`}),(0,G.jsx)(`h2`,{className:`section-title-sm`,children:`What changed`})]})}),(0,G.jsx)(`div`,{className:`attention-list attention-list-scrollable`,children:p.map(e=>e.href?(0,G.jsxs)(R,{to:e.href,className:`attention-item attention-item-${e.tone}`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`attention-title`,children:e.title}),(0,G.jsx)(`p`,{className:`attention-detail`,children:e.detail})]}),e.actionLabel&&(0,G.jsx)(`span`,{className:`attention-action`,children:e.actionLabel})]},e.id):(0,G.jsxs)(`div`,{className:`attention-item attention-item-static attention-item-${e.tone}`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`attention-title`,children:e.title}),(0,G.jsx)(`p`,{className:`attention-detail`,children:e.detail})]}),e.actionLabel&&(0,G.jsx)(`span`,{className:`attention-action`,children:e.actionLabel})]},e.id))})]}),(0,G.jsxs)(`section`,{className:`overview-secondary-section`,children:[(0,G.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Recent runs`}),(0,G.jsx)(`h2`,{className:`section-title-sm`,children:`Activity`})]})}),(0,G.jsx)(`div`,{className:`compact-stack compact-stack-scrollable`,children:o?(0,G.jsxs)(`div`,{role:`alert`,children:[(0,G.jsx)(`p`,{className:`text-sm text-secondary`,children:`Recent jobs could not be loaded.`}),(0,G.jsx)(U,{type:`button`,variant:`secondary`,className:`mt-3`,onClick:()=>{s()},children:`Retry loading activity`})]}):a?(0,G.jsx)(`p`,{className:`supporting-copy`,role:`status`,children:`Loading recent jobs…`}):u.recentRuns.length>0?u.recentRuns.map(e=>(0,G.jsxs)(Au,{run:e,projectName:u.projects.find(t=>t.project.id===e.projectId)?.project.name,className:`compact-run`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`compact-run-title`,children:e.projectName}),(0,G.jsx)(`p`,{className:`compact-run-detail`,children:e.summary})]}),(0,G.jsx)(Ha,{status:e.status})]},e.id)):(0,G.jsx)(`p`,{className:`supporting-copy`,children:`Run history appears here after the first launch.`})})]})]}),(0,G.jsxs)(`section`,{className:`page-section`,children:[(0,G.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`System health`}),(0,G.jsx)(`h2`,{className:`section-title-sm`,children:`Infrastructure`})]})}),(0,G.jsx)(`div`,{className:`divide-y divide-default border-y border-default`,children:h.map(e=>{let t=e.id===`api`?m.apiStatus:e.id===`worker`?m.workerStatus:void 0,n=t?t.state===`ok`?void 0:vi(t):e.tone===`positive`?void 0:e.meta;return(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`text-sm font-medium text-heading`,children:e.label}),n&&(0,G.jsx)(`p`,{className:`mt-1 text-sm text-secondary`,children:n})]}),(0,G.jsx)(bn,{tone:e.tone,title:t?vi(t):e.meta,children:e.detail})]},e.id)})})]})]})}var Nu=`a, button, input, select, textarea, label, [role="button"], [role="link"], [role="checkbox"], [role="menuitem"]`;function Pu(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return!1;let t=e.target;if(t&&typeof t.closest==`function`&&t.closest(Nu))return!1;let n=typeof window<`u`?window.getSelection():null;return!(n&&!n.isCollapsed&&n.toString().trim()!==``)}function Fu({onApplied:e}){let{canWrite:t}=Xn(),[n,r]=(0,W.useState)(``),[i,a]=(0,W.useState)(!1),[o,s]=(0,W.useState)([]),[c,l]=(0,W.useState)([]);return Ve()||!t?null:(0,G.jsxs)(`section`,{className:`mt-8`,children:[(0,G.jsx)(`div`,{className:`page-section-divider`}),(0,G.jsx)(`div`,{className:`section-head mt-6`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Config as code`}),(0,G.jsx)(`h2`,{className:`text-sm font-medium text-strong`,children:`Apply YAML`})]})}),(0,G.jsxs)(`p`,{className:`text-muted text-sm mb-3`,children:[`Paste a `,(0,G.jsx)(`code`,{className:`text-secondary`,children:`canonry.yaml`}),` config (multi-document YAML with `,(0,G.jsx)(`code`,{className:`text-secondary`,children:`---`}),` separators supported).`]}),(0,G.jsx)(`textarea`,{className:`setup-input w-full font-mono text-xs`,rows:10,placeholder:`apiVersion: canonry/v1
19
+ kind: Project
20
+ metadata:
21
+ name: my-project
22
+ spec:
23
+ canonicalDomain: example.com
24
+ country: US
25
+ language: en
26
+ queries: []`,value:n,onChange:e=>r(e.target.value)}),o.length>0&&(0,G.jsx)(`ul`,{className:`mt-2 space-y-1`,children:o.map((e,t)=>(0,G.jsx)(`li`,{className:`text-positive-400 text-sm`,children:e},t))}),c.length>0&&(0,G.jsx)(`ul`,{className:`mt-2 space-y-1`,children:c.map((e,t)=>(0,G.jsx)(`li`,{className:`text-negative-400 text-sm`,children:e},t))}),(0,G.jsx)(`div`,{className:`mt-3`,children:(0,G.jsx)(U,{type:`button`,disabled:!n.trim()||i,onClick:Qn(async()=>{if(!n.trim())return;a(!0),s([]),l([]);let t=Nr(n),r=[],i=[];for(let e=0;e<t.length;e++){let n=t[e];if(n.errors.length>0){r.push(`Document ${e+1}: ${n.errors[0]?.message}`);continue}let a=n.toJSON();if(a&&typeof a==`object`)try{let e=await Ht(a);i.push(`Applied "${e.displayName||e.name}" (revision ${e.configRevision})`)}catch(t){r.push(`Document ${e+1}: ${ot(t)}`)}}s(i),l(r),a(!1),i.length>0&&(tr({title:`YAML applied`,detail:`Applied ${i.length} document${i.length===1?``:`s`} successfully.`,tone:r.length>0?`caution`:`positive`,dedupeKey:`yaml:apply`,dedupeMode:`replace`}),e())}),children:i?`Applying...`:`Apply`})})]})}function Iu(){let{dashboard:e,isLoading:t,refetch:n}=ts(),{canWrite:r,isAdmin:i}=Xn(),a=Se();if(!e||t)return(0,G.jsxs)(`div`,{className:`page-skeleton`,children:[(0,G.jsxs)(`div`,{className:`page-skeleton-header`,children:[(0,G.jsx)(`div`,{className:`skeleton-text h-6 w-28`}),(0,G.jsx)(`div`,{className:`skeleton-text-sm w-40`})]}),(0,G.jsxs)(`div`,{className:`rounded-xl border border-default bg-surface overflow-hidden`,children:[(0,G.jsx)(`div`,{className:`p-3 border-b border-default flex gap-8`,children:[`Name`,`Domain`,`Mentions`,`Last run`,`Country`].map(e=>(0,G.jsx)(`div`,{className:`skeleton-text-sm w-16`},e))}),[1,2,3].map(e=>(0,G.jsxs)(`div`,{className:`p-3 border-b border-subtle flex gap-8 items-center`,children:[(0,G.jsxs)(`div`,{className:`flex-1 space-y-1`,children:[(0,G.jsx)(`div`,{className:`skeleton-text w-28`}),(0,G.jsx)(`div`,{className:`skeleton-text-sm w-16`})]}),(0,G.jsx)(`div`,{className:`skeleton-text w-24`}),(0,G.jsx)(`div`,{className:`skeleton h-5 w-14 rounded-full`}),(0,G.jsx)(`div`,{className:`skeleton h-5 w-16 rounded-full`}),(0,G.jsx)(`div`,{className:`skeleton-text-sm w-8`})]},e))]})]});let o=e.projects;return(0,G.jsxs)(`div`,{className:`page-container`,children:[(0,G.jsxs)(`div`,{className:`page-header`,children:[(0,G.jsxs)(`div`,{className:`page-header-left`,children:[(0,G.jsx)(`h1`,{className:`page-title`,children:`Projects`}),(0,G.jsxs)(`p`,{className:`page-subtitle`,children:[o.length,` project`,o.length===1?``:`s`,` tracked`]})]}),i?(0,G.jsx)(`div`,{className:`page-header-right`,children:(0,G.jsxs)(U,{type:`button`,onClick:()=>{a({to:`/setup`,search:{experience:`platform`}})},children:[(0,G.jsx)(j,{className:`size-4 mr-1.5`}),o.length===0?`Map a site`:`Add project`]})}):null]}),o.length>0?(0,G.jsx)(`div`,{className:`data-table-wrapper`,children:(0,G.jsxs)(`table`,{className:`data-table`,children:[(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{children:`Name`}),(0,G.jsx)(`th`,{children:`Domain`}),(0,G.jsx)(`th`,{children:`Mentions`}),(0,G.jsx)(`th`,{children:`Last run`}),(0,G.jsx)(`th`,{className:`text-right`,children:`Country`})]})}),(0,G.jsx)(`tbody`,{children:o.map(e=>{let t=e.recentRuns[0];return(0,G.jsxs)(`tr`,{className:`cursor-pointer`,onClick:t=>{Pu(t)&&a({to:`/projects/$projectName`,params:{projectName:e.project.name}})},children:[(0,G.jsxs)(`td`,{children:[(0,G.jsx)(R,{to:`/projects/$projectName`,params:{projectName:e.project.name},className:`text-heading font-medium hover:underline`,children:e.project.displayName||e.project.name}),(0,G.jsx)(`p`,{className:`text-[11px] text-muted`,children:e.project.name})]}),(0,G.jsx)(`td`,{className:`text-secondary`,children:e.project.canonicalDomain}),(0,G.jsx)(`td`,{children:(0,G.jsx)(bn,{tone:e.mentionSummary.tone,children:e.mentionSummary.value})}),(0,G.jsx)(`td`,{className:`text-muted text-sm`,children:t?(0,G.jsx)(Ha,{status:t.status}):(0,G.jsx)(`span`,{className:`text-faint`,children:`No runs`})}),(0,G.jsx)(`td`,{className:`text-right text-muted`,children:e.project.country})]},e.project.id)})})]})}):(0,G.jsxs)(Mr,{className:`surface-card empty-card`,children:[(0,G.jsx)(`h3`,{children:`No projects yet`}),(0,G.jsx)(`p`,{className:`supporting-copy`,children:`Map a public site to capture its Page Health baseline and exact fixes.`}),i?(0,G.jsxs)(U,{type:`button`,onClick:()=>{a({to:`/setup`,search:{experience:`platform`}})},children:[(0,G.jsx)(j,{className:`size-4 mr-1.5`}),`Map a site`]}):null]}),r?(0,G.jsx)(Fu,{onApplied:()=>{n()}}):null]})}var Lu=[`domain`,`projectName`,`displayName`,`country`,`language`,`queriesText`,`competitorsText`];function Ru(e){return`canonry.onboarding-draft.v1:${window.__CANONRY_CONFIG__?.basePath??`/`}:${e}`}function zu(e){try{let t=JSON.parse(window.sessionStorage.getItem(Ru(e))??`{}`);if(!t||typeof t!=`object`)return{};let n={};for(let e of Lu){let r=t[e];typeof r==`string`&&r.length<=5e4&&(n[e]=r)}return n}catch{return{}}}function Bu(e,t){try{let n={};for(let e of Lu){let r=t[e];typeof r==`string`&&r.length<=5e4&&(n[e]=r)}n.domain&&/[?#@]/.test(n.domain)&&delete n.domain,window.sessionStorage.setItem(Ru(e),JSON.stringify(n))}catch{}}function Vu(e){try{window.sessionStorage.removeItem(Ru(e))}catch{}}function Hu(e){try{window.sessionStorage.setItem(Ru(`scan-skipped:${e}`),`true`)}catch{}}function Uu(e){try{return window.sessionStorage.getItem(Ru(`scan-skipped:${e}`))===`true`}catch{return!1}}var Wu=class extends Error{constructor(){super(Yn),this.name=`ViewOnlyError`}};function Gu(e){if(!e.canWrite)throw new Wu}function Ku(){let e=Xn();return()=>{Gu(e)}}function qu(e){return e===`gsc-sync`?`GSC sync queued`:e===`inspect-sitemap`?`Sitemap inspection queued`:`AI Visibility check queued`}function Ju(e,t){let n=e??`Project`;return t===`gsc-sync`?`${n} will refresh after the sync completes.`:t===`inspect-sitemap`?`${n} will notify you when sitemap inspection finishes.`:`${n} will notify you when the run finishes.`}function Yu(e,t){Pi({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:`queued`}),tr({title:qu(e.kind),detail:Ju(t.projectLabel,e.kind),tone:`neutral`,dedupeKey:`run:${e.id}`,dedupeMode:`replace`})}function Xu(e){let t=e.filter(e=>e.status!==`conflict`&&e.status!==`error`),n=e.filter(e=>e.status===`conflict`),r=e.filter(e=>e.status===`error`),i=n.length+r.length;if(t.length===0){let e=[r.length>0?`${r.length} need provider or query setup`:null,n.length>0?`${n.length} already have an active run`:null].filter(e=>e!==null);tr({title:`No runs queued`,detail:e.length>0?`${e.join(`; `)}.`:`No projects were available to queue.`,tone:`caution`,durationMs:8e3,dedupeKey:`run-all:conflict`,dedupeMode:`replace`});return}for(let e of t)Pi({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:e.projectName,sourceAction:`run-all`,lastAnnouncedStatus:`queued`});let a=Ii({runIds:t.map(e=>e.id),queuedCount:t.length,skippedCount:i});tr({title:`Run-all batch queued`,detail:i>0?`${t.length} project${t.length===1?``:`s`} queued; ${i} need attention or already have an active run.`:`${t.length} project${t.length===1?``:`s`} queued.`,tone:i>0?`caution`:`neutral`,dedupeKey:`batch:${a}`,dedupeMode:`replace`})}function Zu(e,t){e instanceof Lt&&e.code===`PROVIDERS_FAILING`?tr({title:`Check not started`,detail:`Every provider keeps failing on its account. The AI Visibility notice says when checks resume.`,tone:`caution`,durationMs:8e3,dedupeKey:`providers-failing:${t?.projectKey??`project`}:${t?.sourceAction??`run`}`,dedupeMode:`replace`}):e instanceof Lt&&e.code===`RUN_IN_PROGRESS`?tr({title:`Run already in progress`,detail:t?.projectLabel?`${t.projectLabel} already has an active run. Wait for it to finish, then retry.`:`This project already has an active run. Wait for it to finish, then retry.`,tone:`caution`,durationMs:8e3,dedupeKey:`run-in-progress:${t?.projectKey??`project`}:${t?.sourceAction??`run`}`,dedupeMode:`replace`}):tr({title:e instanceof Error?e.message:`Failed to queue run`,tone:`negative`})}function X(){let e=Ku();return F({onMutate:e,meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:e,opts:t})=>wn(e,t),onSuccess:(e,t)=>{Yu(e,{projectLabel:t.projectLabel??t.projectName,sourceAction:t.sourceAction})},onError:(e,t)=>{t.sourceAction!==`setup-launch`&&Zu(e,{projectKey:t.projectName,projectLabel:t.projectLabel??t.projectName,sourceAction:t.sourceAction})}})}function Z(){let e=Ku();return F({onMutate:e,meta:{skipGlobalErrorToast:!0},mutationFn:e=>mn(e),onSuccess:e=>{Xu(e)},onError:e=>{tr({title:e instanceof Error?e.message:`Failed to queue runs`,tone:`negative`})}})}function Qu(){let e=Ku();return F({onMutate:e,meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:e,body:t})=>dn(e,t),onSuccess:(e,t)=>{Pi({id:e.runId,projectId:t.projectId,kind:z[`site-audit`],projectLabel:t.projectLabel??t.projectName,sourceAction:`site-audit`,lastAnnouncedStatus:e.status}),tr({title:e.status===`running`?`Site Health scan already running`:`Site Health scan queued`,detail:`${t.projectLabel??t.projectName} will refresh automatically when the scan finishes.`,tone:`neutral`,dedupeKey:`run:${e.runId}`,dedupeMode:`replace`})},onError:(e,t)=>{t.suppressErrorToast||Zu(e,{projectKey:t.projectName,projectLabel:t.projectLabel??t.projectName,sourceAction:`site-audit`})}})}function $u(){let e=Ku();return F({onMutate:e,meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:e,opts:t})=>vn(e,t),onSuccess:(e,t)=>{Yu(e,{projectLabel:t.projectLabel??t.projectName,sourceAction:`gsc-sync`})},onError:(e,t)=>{Zu(e,{projectKey:t.projectName,projectLabel:t.projectLabel??t.projectName,sourceAction:`gsc-sync`})}})}function ed(){let e=Ku();return F({onMutate:e,meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:e,opts:t})=>Vt(e,t),onSuccess:(e,t)=>{Yu(e,{projectLabel:t.projectLabel??t.projectName,sourceAction:`inspect-sitemap`})},onError:(e,t)=>{Zu(e,{projectKey:t.projectName,projectLabel:t.projectLabel??t.projectName,sourceAction:`inspect-sitemap`})}})}function td(e){if(!Array.isArray(e.queryKey)||e.queryKey.length<=1)return!1;let t=e.queryKey[0];return t===`projects`||t===`project-dashboard-full`}function nd(){let e=Ku();return F({onMutate:e,mutationFn:({projectName:e,queries:t})=>Sn(e,t)})}var rd=[{id:`site`,label:`Scan site`,optional:!1},{id:`fixes`,label:`Page health`,optional:!1},{id:`visibility`,label:`AI Visibility`,optional:!0},{id:`done`,label:`Next steps`,optional:!1}],id={skipped:`Skipped`,"not-started":`Not started`,queued:`Queued`,running:`In progress`,partial:`Partial results`,failed:`Failed`,cancelled:`Cancelled`,pending:`In progress`,incomplete:`Didn’t finish`,unknown:null};function ad({current:e,outcomes:t={}}){let n=rd.findIndex(t=>t.id===e);return(0,G.jsx)(`ol`,{"aria-label":`Onboarding progress`,className:`grid border-y border-default sm:grid-cols-4 sm:divide-x sm:divide-default`,children:rd.map((e,r)=>{let i=r<n?t[e.id]:void 0,a=r<n&&i===void 0,o=r===n,s=i?id[i]:null;return(0,G.jsxs)(`li`,{"aria-current":o?`step`:void 0,className:`flex min-h-12 items-center gap-3 py-2 sm:px-3 sm:first:pl-0 sm:last:pr-0`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-6 shrink-0 items-center justify-center rounded-full border text-xs font-semibold tabular-nums ${o?`border-accent bg-accent text-on-inverse`:a?`border-positive bg-positive-soft text-positive`:`border-default bg-surface-subtle text-muted`}`,children:a?`✓`:i===`skipped`||i===`incomplete`?`–`:r+1}),(0,G.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2`,children:[(0,G.jsx)(`span`,{className:`text-sm font-medium ${o||a?`text-heading`:`text-secondary`}`,children:e.label}),s?(0,G.jsx)(`span`,{className:`text-[13px] text-secondary`,children:s}):e.optional&&!i?(0,G.jsx)(`span`,{className:`text-[13px] text-secondary`,children:`Optional`}):null,a?(0,G.jsx)(`span`,{className:`sr-only`,children:`Complete`}):null]})]},e.id)})})}function od(){return[{id:`search-console`,icon:ne,label:`Search Console`,detail:`Compare answer engines with the queries you already rank for.`,action:`Connect`,to:`/projects/$projectName/search-console`},{id:`analytics`,icon:re,label:`Google Analytics`,detail:`See the traffic answer engines actually send you.`,action:`Connect`,to:`/projects/$projectName/activity`},{id:`schedule`,icon:c,label:`Scheduled checks`,detail:`Re-measure on a schedule instead of by hand.`,action:`Set up`,to:`/projects/$projectName/settings`},{id:`notifications`,icon:b,label:`Notifications`,detail:`Send a webhook when a check finishes or a score moves.`,action:`Set up`,to:`/projects/$projectName/settings`},{id:`local`,icon:r,label:`Local presence`,detail:`Track the Google Business Profile behind local answers.`,action:`Open`,to:`/projects/$projectName/local`},{id:`agent`,icon:C,label:`Your agent`,detail:`Read this project from Claude Code, Codex, or any MCP client.`,action:`Set up`,to:`/agent-setup`}]}function sd({projectName:e}){let t=od();return(0,G.jsxs)(`section`,{"aria-labelledby":`next-steps-heading`,className:`mt-6 border-t border-default pt-5`,children:[(0,G.jsx)(`h2`,{id:`next-steps-heading`,className:`text-sm font-medium text-heading`,children:`What else this project can do`}),(0,G.jsx)(`ul`,{className:`mt-3 divide-y divide-default`,children:t.map(({id:t,icon:n,label:r,detail:i,action:a,to:o,href:s})=>(0,G.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 py-3`,children:[(0,G.jsx)(n,{className:`size-4 shrink-0 text-muted`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`min-w-36 text-sm font-medium text-heading`,children:r}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 text-sm text-secondary`,children:i}),o?(0,G.jsxs)(R,{to:o,params:{projectName:e},className:`text-sm font-medium text-link underline-offset-4 hover:underline`,children:[a,(0,G.jsxs)(`span`,{className:`sr-only`,children:[` `,r]})]}):(0,G.jsxs)(`a`,{href:s,target:`_blank`,rel:`noreferrer`,className:`text-sm font-medium text-link underline-offset-4 hover:underline`,children:[a,(0,G.jsxs)(`span`,{className:`sr-only`,children:[` `,r]})]})]},t))})]})}function cd({providerName:e,keyUrl:t,modelHint:n,kind:r,compact:i=!1,offerFreeTier:a=!0,leadingField:o,secondaryActions:s,onSaved:c}){let l=ve(),u=e.toLowerCase()===`local`,d=e.toLowerCase()===`openrouter`,f=d||r===`model-gateway`||r===`answer-service`,p=i&&a&&e.toLowerCase()===`gemini`&&!!t,[m,h]=(0,W.useState)(``),[g,_]=(0,W.useState)(``),[v,y]=(0,W.useState)(``),[b,x]=(0,W.useState)(``),[S,C]=(0,W.useState)(``),[w,T]=(0,W.useState)(``),[E,D]=(0,W.useState)(!1),[O,ee]=(0,W.useState)(null),[te,k]=(0,W.useState)(!1),A=u?g.trim().length>0:m.trim().length>0;async function ne(){if(A){D(!0),ee(null),k(!1);try{let t=e=>{let t=parseInt(e.trim(),10);return Number.isFinite(t)&&t>0?t:void 0},n={},r=t(b);r!==void 0&&(n.maxConcurrency=r);let i=t(S);i!==void 0&&(n.maxRequestsPerMinute=i);let a=t(w);a!==void 0&&(n.maxRequestsPerDay=a),await It(e.toLowerCase(),{...m.trim()?{apiKey:m.trim()}:{},...g.trim()?{baseUrl:g.trim()}:{},...v.trim()?{model:v.trim()}:{},...Object.keys(n).length>0?{quota:n}:{}}),h(``),_(``),y(``),x(``),C(``),T(``),k(!0),ir(l,`runAdmission`),l.invalidateQueries({queryKey:[`settings`]}),tr({title:`Provider updated`,detail:`${e} configuration saved.`,tone:`positive`,dedupeKey:`settings:provider:${e}`,dedupeMode:`replace`}),c()}catch(e){ee(e instanceof Error?e.message:`Failed to update provider`)}finally{D(!1)}}}let re=n??`Use default model`,ie=i?`block text-sm font-medium text-secondary`:`text-sm text-secondary`,ae=i?`setup-input min-h-11 w-full`:`mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-sm text-strong placeholder-mono-600 focus:border-mono-500 focus:outline-none`,oe=(0,G.jsxs)(G.Fragment,{children:[!f&&(0,G.jsxs)(`div`,{className:i?`space-y-1.5`:void 0,children:[(0,G.jsx)(`label`,{className:ie,htmlFor:`model-${e}`,children:`Model (optional)`}),(0,G.jsx)(`input`,{id:`model-${e}`,type:`text`,className:ae,placeholder:re,value:v,onChange:e=>y(e.target.value)})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{className:ie,children:`Quota (optional)`}),(0,G.jsxs)(`div`,{className:`mt-0.5 grid grid-cols-3 gap-1.5`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`input`,{type:`number`,min:`1`,className:i?`setup-input min-h-11 w-full`:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-sm text-strong placeholder-mono-600 focus:border-mono-500 focus:outline-none`,placeholder:`Concurrent`,value:b,onChange:e=>x(e.target.value)}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-secondary`,children:`Max concurrent`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`input`,{type:`number`,min:`1`,className:i?`setup-input min-h-11 w-full`:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-sm text-strong placeholder-mono-600 focus:border-mono-500 focus:outline-none`,placeholder:`/min`,value:S,onChange:e=>C(e.target.value)}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-secondary`,children:`Per minute`})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`input`,{type:`number`,min:`1`,className:i?`setup-input min-h-11 w-full`:`w-full rounded border border-strong bg-transparent px-2 py-1.5 text-sm text-strong placeholder-mono-600 focus:border-mono-500 focus:outline-none`,placeholder:`/day`,value:w,onChange:e=>T(e.target.value)}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-secondary`,children:`Per day`})]})]})]})]}),j=u?(0,G.jsxs)(`div`,{className:i?`space-y-1.5`:void 0,children:[(0,G.jsx)(`label`,{className:ie,htmlFor:`base-url-${e}`,children:`Base URL`}),(0,G.jsx)(`input`,{id:`base-url-${e}`,type:`text`,className:ae,placeholder:`http://localhost:11434/v1`,value:g,onChange:e=>_(e.target.value)}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-secondary`,children:`Use any OpenAI-compatible endpoint, such as Ollama or vLLM.`})]}):null,M=(0,G.jsxs)(`div`,{className:i?`min-w-0 space-y-1.5`:void 0,children:[(0,G.jsxs)(`div`,{className:i?`flex items-center justify-between gap-3`:`flex items-center justify-between`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsxs)(`label`,{className:ie,htmlFor:`api-key-${e}`,children:[`API key`,u?` (optional)`:``]}),d&&(0,G.jsx)(Dr,{text:`OpenRouter bills your account for each answer, including its web search. An AI Visibility check asks every query once per model.`})]}),t&&!p&&(0,G.jsxs)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:`text-sm text-secondary hover:text-neutral underline underline-offset-2`,children:[`Get API key `,`↗`]})]}),(0,G.jsx)(`input`,{id:`api-key-${e}`,type:`password`,autoComplete:`new-password`,autoCapitalize:`none`,spellCheck:!1,className:ae,placeholder:u?`Optional. Most local servers do not need one.`:`Enter ${ea(e)} API key`,value:m,onChange:e=>h(e.target.value)})]}),se=(0,G.jsx)(U,{type:`button`,size:i?`default`:`sm`,className:i?`min-h-11`:void 0,disabled:!A||E,onClick:Qn(ne),children:E?`Saving...`:i?`Save connection`:`Save`});return(0,G.jsxs)(`div`,{className:i?`space-y-3`:`mt-3 rounded-lg border border-base bg-bg-elevated/40 p-3 space-y-2`,children:[p&&(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start gap-x-6 gap-y-3 pb-2`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 basis-72 space-y-1`,children:[(0,G.jsx)(`h3`,{className:`text-base font-semibold text-heading`,children:`Start with Gemini’s free tier`}),(0,G.jsxs)(`p`,{className:`max-w-prose text-sm text-secondary`,children:[`Get a key in Google AI Studio, then paste it below. Free usage has model and rate limits; paid usage is billed by Google.`,` `,(0,G.jsx)(`a`,{href:`https://ai.google.dev/gemini-api/docs/pricing`,target:`_blank`,rel:`noopener noreferrer`,className:`text-link underline underline-offset-2 focus-visible:outline-2 focus-visible:outline-offset-2`,children:`Pricing and limits`})]})]}),(0,G.jsx)(U,{variant:`outline`,className:`min-h-11`,asChild:!0,children:(0,G.jsxs)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,children:[`Get a free Gemini API key `,`↗`]})})]}),i?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:o?`grid items-start gap-3 sm:grid-cols-[minmax(0,0.7fr)_minmax(0,1.3fr)]`:void 0,children:[o,M]}),j]}):(0,G.jsxs)(G.Fragment,{children:[j,M]}),i?(0,G.jsxs)(`details`,{children:[(0,G.jsx)(`summary`,{className:`min-h-11 cursor-pointer text-sm text-secondary py-3`,children:`Advanced provider settings`}),(0,G.jsx)(`div`,{className:`space-y-3 pt-2`,children:oe})]}):oe,O&&(0,G.jsx)(`p`,{role:`alert`,className:`text-sm text-negative-400`,children:O}),te&&(0,G.jsx)(`p`,{className:`text-sm text-positive-400`,children:`Provider updated.`}),i?(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[se,s]}):se]})}var ld=cn,ud=`How many pages one scan may read before it stops. Project default uses your saved budget. Full site checks up to ${ld(mt)}.`,dd=_n(null),fd=dd.charAt(0).toUpperCase()+dd.slice(1),pd=[{value:100,label:`${ld(100)} (quick look)`},{value:500,label:ld(500)},{value:2500,label:ld(2500)},{value:1e4,label:ld(1e4)}];function md(e){return e===null?fd:pd.find(t=>t.value===e)?.label??ld(e)}function hd(e){if(!e)return`Project default`;let t=e.siteAuditMaxPages??null;return t===null?`Default: full site`:`Default: ${ld(t)}`}function gd(e){return e?.siteAuditMaxPages==null?null:{value:mt,label:`Full site`}}var _d=[{label:`OpenAI`,prefixes:[`openai/`]},{label:`Google`,prefixes:[`google/`]},{label:`Anthropic`,prefixes:[`anthropic/`]},{label:`Perplexity`,prefixes:[`perplexity/`]},{label:`xAI`,prefixes:[`x-ai/`]},{label:`DeepSeek`,prefixes:[`deepseek/`]},{label:`Mistral`,prefixes:[`mistralai/`]},{label:`Meta`,prefixes:[`meta/`,`meta-llama/`]}];function vd(e){return`${e} ${e===1?`model`:`models`}`}function yd({catalog:e,selected:t,onAdd:n,disabled:r=!1,inline:i=!1,trigger:a=`button`,triggerLabel:o=`Add models`}){let s=new Map(e.knownModels.map(e=>[e.id,e.displayName])),c=dt.filter(e=>s.has(e.id)),l=e.knownModels.length===0,[u,d]=(0,W.useState)(!1),[f,p]=(0,W.useState)(c.length===0),[m,h]=(0,W.useState)(null),[g,_]=(0,W.useState)(``),[v,y]=(0,W.useState)([]),[b,x]=(0,W.useState)(``),[S,C]=(0,W.useState)(null),[w,T]=(0,W.useState)(!1),E=(0,W.useId)(),D=r||w,O=g.trim().toLowerCase(),ee=_d.filter(t=>e.knownModels.some(e=>t.prefixes.some(t=>e.id.startsWith(t)))),te=_d.find(e=>e.label===m)?.prefixes??[],k=e.knownModels.filter(e=>te.length===0||te.some(t=>e.id.startsWith(t))).filter(e=>`${e.displayName} ${e.id}`.toLowerCase().includes(O)).sort((e,t)=>e.displayName.localeCompare(t.displayName)),A=v.filter(e=>!t.includes(e)),ne=A.map(e=>{let t=it(e)??e;return s.get(t)??t});function re(e,t){y(n=>t?[...new Set([...n,e])]:n.filter(t=>t!==e))}function ie(){let t=b.trim();if(!new RegExp(e.modelValidationPattern.source,e.modelValidationPattern.flags).test(t)){C(e.modelValidationHint);return}let n;try{n=gt(t)}catch(e){C(ot(e));return}y(e=>[...new Set([...e,n])]),x(``),C(null)}function ae(){y([]),i||d(!1)}function oe(){C(null);let e=n(A);e instanceof Promise?(T(!0),e.then(ae,e=>{C(ot(e))}).finally(()=>{T(!1)})):ae()}let j=(e,n,r)=>{let i=gt(e),a=t.includes(i),o=`${E}-${e}`;return(0,G.jsxs)(`label`,{"data-model-id":e,className:`flex min-h-11 items-center gap-3 py-2 text-sm text-secondary`,children:[(0,G.jsx)(`input`,{type:`checkbox`,"aria-label":n,"aria-describedby":o,checked:a||v.includes(i),disabled:a,onChange:e=>re(i,e.target.checked)}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-heading`,children:n}),(0,G.jsx)(`span`,{id:o,className:`shrink-0 truncate text-sm`,children:a?`Added`:r})]},e)},M=(0,G.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,G.jsxs)(`label`,{className:`min-w-0 flex-1 text-sm text-secondary`,children:[`Model ID`,(0,G.jsx)(`input`,{className:`setup-input mt-1 w-full`,value:b,placeholder:`vendor/model`,onChange:e=>x(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),b.trim()&&ie())}})]}),(0,G.jsx)(U,{type:`button`,variant:`outline`,disabled:D||!b.trim(),onClick:ie,children:`Add ID`})]}),se=(0,G.jsxs)(`div`,{id:E,role:`group`,"aria-label":i?`Choose OpenRouter models`:`Add OpenRouter models`,className:i?`space-y-3`:`space-y-3 border-y border-default py-3`,children:[l?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`p`,{className:`text-sm text-secondary`,children:[`Couldn't load OpenRouter's model list. Check the OpenRouter key in`,` `,(0,G.jsx)(R,{to:`/settings`,className:`text-link hover:underline`,...i?{target:`_blank`,rel:`noopener noreferrer`}:{},children:`Settings`}),`, or enter a model ID below.`]}),M]}):(0,G.jsxs)(G.Fragment,{children:[c.length>0&&(0,G.jsxs)(`fieldset`,{disabled:D,className:`divide-y divide-default`,children:[(0,G.jsx)(`legend`,{className:`mb-1 text-sm font-medium text-heading`,children:`Recommended`}),c.map(e=>j(e.id,s.get(e.id)??e.id,`Maker of ${e.engine}`))]}),c.length>0&&(0,G.jsx)(`button`,{type:`button`,className:`text-sm text-secondary underline decoration-border-strong underline-offset-4 hover:text-heading`,"aria-expanded":f,"aria-controls":`${E}-browse`,onClick:()=>p(e=>!e),children:f?`Hide the full list`:`Browse all ${e.knownModels.length} models`}),f&&(0,G.jsxs)(`div`,{id:`${E}-browse`,className:`space-y-3`,children:[ee.length>0&&(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2`,role:`group`,"aria-label":`Filter by vendor`,children:ee.map(e=>{let t=m===e.label;return(0,G.jsx)(`button`,{type:`button`,"aria-pressed":t,disabled:D,onClick:()=>h(t?null:e.label),className:`filter-chip ${t?`filter-chip-active`:``}`,children:e.label},e.label)})}),(0,G.jsxs)(`label`,{className:`block text-sm text-secondary`,children:[`Search OpenRouter models`,(0,G.jsx)(`input`,{className:`setup-input mt-1 w-full`,type:`search`,value:g,onChange:e=>_(e.target.value)})]}),(0,G.jsxs)(`fieldset`,{disabled:D,className:`max-h-64 overflow-y-auto divide-y divide-default`,children:[(0,G.jsx)(`legend`,{className:`sr-only`,children:`OpenRouter models`}),k.map(e=>j(e.id,e.displayName,e.id)),k.length===0&&(0,G.jsx)(`p`,{className:`py-3 text-sm text-secondary`,children:g.trim()?`No models match "${g.trim()}".`:`No ${m??``} models in OpenRouter's list.`})]}),M]})]}),ne.length>0&&(0,G.jsxs)(`p`,{className:`break-words text-sm text-secondary`,children:[`Selected: `,ne.join(`, `)]}),S&&(0,G.jsx)(`p`,{role:`alert`,className:`text-sm text-negative`,children:S}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(U,{type:`button`,disabled:D||A.length===0,onClick:oe,children:i?w?`Saving models…`:A.length>0?`Save ${vd(A.length)}`:`Save models`:A.length>0?`Add ${vd(A.length)}`:`Add selected`}),!i&&(0,G.jsx)(U,{type:`button`,variant:`outline`,onClick:()=>d(!1),children:`Close`})]})]});return i?se:(0,G.jsxs)(`div`,{className:`space-y-3`,children:[a===`link`?(0,G.jsx)(`button`,{type:`button`,className:`block w-fit text-sm text-secondary underline decoration-border-strong underline-offset-4 hover:text-heading disabled:opacity-50`,disabled:r,"aria-expanded":u,"aria-controls":E,onClick:()=>{d(e=>!e),y([]),C(null)},children:o}):(0,G.jsx)(U,{type:`button`,variant:`outline`,disabled:r,"aria-expanded":u,"aria-controls":E,onClick:()=>{d(e=>!e),y([]),C(null)},children:o}),u&&se]})}function bd(e){return Xe(e.flatMap(e=>e.selectionKind===`profile`&&(e.connection??e.name)===e.name&&e.profiles?[{routes:wt(e.name,e.profiles.map(e=>e.id))}]:[]))}function xd(e,t){return Ze(e,t)}function Sd(e,t){return e.kind===Ie[`answer-service`]&&(e.connection??e.name)!==e.name&&(e.workflows??[]).includes(t)}var Cd=Zt[`visibility-sweep`],wd=Zt.research;function Td(e){return{...e??{}}}function Ed(e,t){let n=Object.entries(e).sort(([e],[t])=>e.localeCompare(t)),r=Object.entries(t).sort(([e],[t])=>e.localeCompare(t));return n.length===r.length&&n.every(([e,t],n)=>{let i=r[n];return i?.[0]===e&&i[1]===t})}function Dd({project:e,onSave:t}){let{isAdmin:n}=Xn(),r=I({queryKey:[`settings`],queryFn:sn,staleTime:6e4,enabled:n&&!Ve()}),[i,a]=(0,W.useState)(e.providers.length===0),[o,s]=(0,W.useState)(e.providers),[c,l]=(0,W.useState)(e.providers.filter(Je)),[u,d]=(0,W.useState)(()=>Td(e.providerModels)),[f,p]=(0,W.useState)({providers:e.providers,providerModels:Td(e.providerModels)}),[m,h]=(0,W.useState)(!1),[g,_]=(0,W.useState)(!1),[v,y]=(0,W.useState)(null),b=(0,W.useRef)(null),x=(0,W.useMemo)(()=>r.data?.providerCatalog??[],[r.data]),S=(0,W.useMemo)(()=>bd(x),[x]),C=x.find(e=>e.name===`openrouter`),w=(0,W.useMemo)(()=>new Set((r.data?.providers??[]).filter(e=>e.configured).map(e=>e.name)),[r.data]),T=e=>e.connection??Rn(e.name,S),E=(0,W.useMemo)(()=>[...w].filter(e=>!xd(e,S)),[w,S]),D=(0,W.useMemo)(()=>{let e=new Map(r.data?.providers.map(e=>[e.name,e.model])),t=new Map(x.filter(e=>xd(e.name,S)?!1:Je(e.name)?c.includes(e.name)||o.includes(e.name):e.kind!==`answer-service`||o.includes(e.name)||Sd(e,Cd)&&w.has(e.connection??e.name)).map(t=>[t.name,{...t,defaultModel:e.get(t.name)||t.defaultModel}]));for(let e of[...Object.keys(u),...c,...o])if(!t.has(e)){let n=Ot(e,S)?.selection;t.set(e,{name:e,displayName:ea(e),mode:`api`,modelConfigurable:n===void 0,defaultModel:n??``,knownModels:[],modelValidationPattern:{source:`.`,flags:``},modelValidationHint:`Validate this custom model ID with the server.`})}let n=new Map(x.filter(e=>e.selectionKind===Tt.profile).flatMap(e=>(e.profiles??[]).map((t,n)=>[t.route,{service:e.displayName,index:n}])));return[...t.values()].sort((e,t)=>{let r=n.get(e.name),i=n.get(t.name);return(r?.service??e.displayName).localeCompare(i?.service??t.displayName)||(r?.index??0)-(i?.index??0)||e.displayName.localeCompare(t.displayName)})},[x,u,r.data?.providers,c,o,S,w]),O=!Ed(u,f.providerModels),ee=i?[]:o,te=ee.length!==f.providers.length||ee.some(e=>!f.providers.includes(e))||O,k=ee.filter(e=>Je(e)&&!f.providers.includes(e)).length,ne=!!C&&w.has(`openrouter`);(0,W.useEffect)(()=>{if(m||g)return;let t={providers:e.providers,providerModels:Td(e.providerModels)};p(t),a(t.providers.length===0),s(t.providers),l(t.providers.filter(Je)),d(t.providerModels)},[e]);function re(){_(!0),a(!1),o.length===0&&s(E)}function ie(e,t,n=!1){_(!0),d(r=>{let i={...r};return t===`__inherit__`?delete i[e]:i[e]=t===`__custom__`?n?``:i[e]??``:t,i}),t===`__custom__`&&queueMicrotask(()=>b.current?.focus())}function ae(e,t){_(!0),a(!1),s(n=>t?[...new Set([...n,e])]:n.filter(t=>t!==e))}function oe(){_(!1),a(f.providers.length===0),s(f.providers),l(f.providers.filter(Je)),d(Td(f.providerModels)),y(null)}async function j(){if(!(r.isError||r.isLoading||!i&&o.length===0)){h(!0),y(null);try{let e=Object.fromEntries(Object.entries(u).filter(([e,t])=>t.trim()!==``&&(i||o.includes(e)))),n={providers:i?[]:o,providerModels:e};await t(n),p({providers:[...n.providers],providerModels:Td(n.providerModels)}),_(!1),tr(`Saved for the next check`,`positive`)}catch(e){y(ot(e))}finally{h(!1)}}}if(Ve()||!n)return null;if(r.isLoading)return(0,G.jsx)(`section`,{className:`project-engine-settings`,"aria-busy":`true`,children:(0,G.jsx)(`p`,{role:`status`,className:`text-sm text-secondary`,children:`Loading engine settings…`})});if(r.isError)return(0,G.jsxs)(`section`,{className:`project-engine-settings`,children:[(0,G.jsx)(`h2`,{children:`Answer engines`}),(0,G.jsx)(`p`,{role:`alert`,className:`text-sm text-negative-400`,children:`Could not load the engine catalogue. Saving is disabled until it is available.`}),(0,G.jsx)(U,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void r.refetch(),children:`Retry`})]});if(x.length===0)return(0,G.jsxs)(`section`,{className:`project-engine-settings`,children:[(0,G.jsx)(`h2`,{children:`Answer engines`}),(0,G.jsx)(`p`,{role:`alert`,className:`text-sm text-negative-400`,children:`The engine catalogue is incomplete. Saving is disabled so existing project overrides cannot be cleared.`}),(0,G.jsx)(U,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void r.refetch(),children:`Retry`})]});if(w.size===0)return(0,G.jsxs)(`section`,{className:`project-engine-settings`,children:[(0,G.jsx)(`h2`,{children:`Answer engines`}),(0,G.jsxs)(`p`,{className:`text-sm text-secondary`,children:[`Configure an answer engine in `,(0,G.jsx)(R,{to:`/settings`,className:`text-link`,children:`global Settings`}),` before choosing project engines.`]})]});let M=w.size>0&&E.length===0,se=M&&[...w].every(e=>e===`openrouter`),ce=(r.data?.providers??[]).filter(e=>e.configured).map(e=>e.displayName),le=`${ce.length>1?`${ce.slice(0,-1).join(`, `)} and ${ce.at(-1)}`:ce[0]} connected`,ue=se?`OpenRouter runs only the models you choose here. A direct engine connected later in Settings can run too.`:M?`Search answer services and OpenRouter models run only where you choose them. A direct engine connected later in Settings can run too.`:`All connected engines includes engines connected later in global Settings. Search answer services and OpenRouter models run only where you choose them.`,de=D.filter(e=>o.includes(e.name)||w.has(T(e))),fe=!M||o.length>0||te,pe=new Map(C?.knownModels.map(e=>[e.id,e.displayName])),me=D.some(e=>!w.has(T(e)))?(0,G.jsx)(R,{to:`/settings`,className:`block w-fit text-sm text-secondary underline decoration-border-strong underline-offset-4 hover:text-heading`,children:`Connect another engine`}):null;function he(e){_(!0),a(!1),l(t=>[...new Set([...t,...e])]),s(t=>[...new Set([...i?E:t,...e])])}function ge(e){let t=o.includes(e.name),n=w.has(T(e)),r=Je(e.name),i=t&&!n,a=u[e.name],s=e.knownModels.some(e=>e.id===a),c=a===void 0?`__inherit__`:s?a:`__custom__`;return(0,G.jsxs)(`div`,{className:`project-engine-row`,children:[(0,G.jsxs)(`label`,{className:`project-engine-provider w-full`,children:[(0,G.jsx)(`input`,{type:`checkbox`,"aria-label":r?e.displayName:void 0,checked:t,disabled:!n&&!t,onChange:t=>ae(e.name,t.target.checked)}),` `,(0,G.jsx)(`span`,{title:r?e.defaultModel:void 0,children:r?pe.get(e.defaultModel)??e.displayName.replace(/ via OpenRouter$/,``):e.displayName}),r&&(0,G.jsx)(`span`,{className:`ml-auto text-sm text-secondary`,children:`OpenRouter`}),!r&&!e.modelConfigurable&&(0,G.jsx)(Dr,{text:Od(e)}),i&&(0,G.jsx)(`span`,{className:`text-xs text-caution-400`,children:`Not configured, skipped`})]}),t&&(e.modelConfigurable?(0,G.jsxs)(`div`,{className:`project-engine-model`,children:[(0,G.jsx)(`label`,{htmlFor:`project-model-${e.name}`,children:`Model`}),(0,G.jsxs)(`select`,{id:`project-model-${e.name}`,value:c,onChange:t=>ie(e.name,t.target.value,s),children:[(0,G.jsxs)(`option`,{value:`__inherit__`,children:[`Use instance setting: `,e.defaultModel||`default`]}),e.knownModels.map(e=>(0,G.jsx)(`option`,{value:e.id,children:e.displayName},e.id)),(0,G.jsx)(`option`,{value:`__custom__`,children:`Custom model ID…`})]}),c===`__custom__`&&(0,G.jsx)(`input`,{ref:b,"aria-label":`${e.displayName} custom model ID`,value:a??``,onChange:t=>{_(!0),d(n=>({...n,[e.name]:t.target.value}))},"aria-describedby":`project-model-hint-${e.name}`}),(0,G.jsxs)(`p`,{id:`project-model-hint-${e.name}`,className:`project-engine-help flex items-center gap-1.5`,children:[a?`Project override`:`Instance setting`,` `,(0,G.jsx)(Dr,{text:e.modelValidationHint})]})]}):null)]},e.name)}return(0,G.jsxs)(`section`,{id:`answer-engines`,className:`project-engine-settings scroll-mt-24`,"aria-busy":m,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`h2`,{children:`Answer engines`}),(0,G.jsx)(Dr,{text:ue})]}),M?(0,G.jsxs)(`fieldset`,{disabled:m,className:`project-engine-fieldset`,children:[(0,G.jsx)(`legend`,{className:`sr-only`,children:`Engines to run`}),(0,G.jsx)(`p`,{className:`text-sm text-heading`,children:le}),o.length===0&&(0,G.jsx)(`p`,{className:`text-sm font-medium text-caution-400`,children:se?`No models selected.`:`Nothing selected to run.`}),de.length>0&&(0,G.jsx)(`div`,{className:`project-engine-list`,children:de.map(ge)}),(0,G.jsxs)(`div`,{className:`space-y-2 pb-2`,children:[ne&&C?(0,G.jsx)(yd,{triggerLabel:o.some(Je)?`Add models`:se?`Choose models`:`Choose OpenRouter models`,catalog:C,selected:o,disabled:m,onAdd:he}):null,me]})]}):(0,G.jsxs)(`fieldset`,{disabled:m,className:`project-engine-fieldset`,children:[(0,G.jsx)(`legend`,{className:`sr-only`,children:`Engines to run`}),(0,G.jsxs)(`label`,{children:[(0,G.jsx)(`input`,{type:`radio`,checked:i,onChange:()=>{_(!0),a(!0)}}),` All connected engines`]}),(0,G.jsxs)(`label`,{children:[(0,G.jsx)(`input`,{type:`radio`,checked:!i,onChange:re}),` Choose engines`]}),!i&&(0,G.jsx)(`div`,{className:`project-engine-list`,children:de.map(ge)}),(0,G.jsxs)(`div`,{className:`space-y-2 pb-2`,children:[ne&&C?(0,G.jsx)(yd,{trigger:`link`,triggerLabel:`Add OpenRouter models`,catalog:C,selected:o,disabled:m,onAdd:he}):null,me]})]}),(0,G.jsxs)(`div`,{className:`mt-4 space-y-3 empty:hidden`,children:[!M&&!i&&o.length===0&&(0,G.jsx)(`p`,{role:`alert`,className:`text-sm text-negative-400`,children:`Choose at least one configured engine.`}),v&&(0,G.jsx)(`p`,{role:`alert`,className:`text-sm text-negative-400`,children:v}),k>0&&!m&&(0,G.jsx)(`p`,{role:`status`,className:`text-sm text-secondary`,children:k===1?`1 model added, not saved`:`${k} models added, not saved`}),O&&(0,G.jsxs)(`p`,{className:`flex items-center gap-1.5 text-sm text-caution-400`,children:[(0,G.jsx)(A,{className:`h-4 w-4 shrink-0`,"aria-hidden":`true`}),`Model changed `,(0,G.jsx)(Dr,{text:`Existing history remains visible. If the recorded model changes, month-to-month comparison may exclude that engine.`})]}),fe&&(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(U,{type:`button`,variant:te?`default`:`outline`,onClick:()=>void j(),disabled:m||!i&&o.length===0,children:m?`Saving engines…`:`Save engines`}),(0,G.jsx)(U,{type:`button`,variant:`outline`,onClick:oe,disabled:m,children:`Cancel`})]}),(0,G.jsx)(`p`,{className:`text-sm text-secondary`,children:`Applies on the next check`})]})]})]})}function Od(e){return e.kind===`answer-service`?e.profiles?.[0]?.description??`Search answer service profile.`:Je(e.name)?e.defaultModel:`Model is detected/fixed for this browser engine.`}var kd={heading:`Site Health scans`,help:`Used by every scan that sets no budget, scheduled or manual. Onboarding's first look always checks ${ld(100)}.`,pageBudget:`Page budget`,customOption:`Custom number...`,customLabel:`Custom page budget`,customError:`Enter a whole number from 1 to ${mt.toLocaleString(`en-US`)}.`,save:`Save page budget`,saving:`Saving page budget…`,saved:`Page budget saved.`},Ad=`full`,jd=`custom`;function Md(e){return e===null?{choice:Ad,customText:``}:pd.some(t=>t.value===e)?{choice:String(e),customText:``}:{choice:jd,customText:String(e)}}function Nd({choice:e,customText:t}){if(e===Ad)return null;if(e!==jd)return Number(e);let n=t.trim();if(n===``)return;let r=nn.safeParse(Number(n));return r.success?r.data:void 0}function Pd({project:e,onSave:t}){let{canWrite:n,isAdmin:r}=Xn(),i=n&&!Ve()&&!An()&&(!Mn(z[`site-audit`])||r),a=e.siteAuditMaxPages??null,[o,s]=(0,W.useState)(a),[c,l]=(0,W.useState)(()=>Md(a)),[u,d]=(0,W.useState)(!1),[f,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(!1),[g,_]=(0,W.useState)(null),[v,y]=(0,W.useState)(null),b=(0,W.useRef)(null),x=(0,W.useId)(),S=`${x}-heading`,C=`${x}-page-budget`,w=`${x}-custom-page-budget`,T=`${x}-custom-page-budget-error`;(0,W.useEffect)(()=>{m||f||(s(a),l(Md(a)))},[a]);let E=Nd(c),D=c.choice===jd&&E===void 0&&(u||c.customText.trim()!==``),O=E!==void 0&&E!==o;function ee(e){p(!0),_(null),y(null),l(t=>({...t,choice:e})),e===jd&&(d(!1),queueMicrotask(()=>b.current?.focus()))}function te(e){p(!0),_(null),y(null),d(!0),l(t=>({...t,customText:e}))}function k(){p(!1),l(Md(o)),d(!1),_(null),y(null)}async function A(){if(!(m||E===void 0)){h(!0),_(null),y(null);try{await t(E),s(E),l(Md(E)),d(!1),p(!1),y(kd.saved)}catch(e){_(ot(e))}finally{h(!1)}}}let ne=`h-9 w-full rounded-md border border-base bg-bg px-2 text-sm text-primary outline-none focus:border-strong focus:ring-2 focus:ring-mono-600 disabled:opacity-60`;return(0,G.jsxs)(`section`,{className:`project-engine-settings`,"aria-labelledby":S,"aria-busy":m,children:[(0,G.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(`h2`,{id:S,children:kd.heading}),(0,G.jsx)(Dr,{text:kd.help})]})}),i?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`grid max-w-sm gap-1`,children:[(0,G.jsx)(`label`,{htmlFor:C,className:`text-sm font-medium text-heading`,children:kd.pageBudget}),(0,G.jsxs)(`select`,{id:C,value:c.choice,disabled:m,onChange:e=>ee(e.target.value),className:ne,children:[(0,G.jsx)(`option`,{value:Ad,children:fd}),pd.map(e=>(0,G.jsx)(`option`,{value:String(e.value),children:e.label},e.value)),(0,G.jsx)(`option`,{value:jd,children:kd.customOption})]}),c.choice===jd&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`label`,{htmlFor:w,className:`mt-2 text-sm font-medium text-heading`,children:kd.customLabel}),(0,G.jsx)(`input`,{ref:b,id:w,type:`number`,inputMode:`numeric`,min:1,max:5e4,step:1,value:c.customText,disabled:m,"aria-invalid":D,"aria-describedby":D?T:void 0,onChange:e=>te(e.target.value),className:ne}),D&&(0,G.jsx)(`p`,{id:T,role:`alert`,className:`text-sm text-negative`,children:kd.customError})]})]}),g&&(0,G.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-negative`,children:g}),v&&(0,G.jsx)(`p`,{role:`status`,className:`mt-3 text-sm text-positive`,children:v}),(0,G.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,G.jsx)(U,{type:`button`,onClick:()=>void A(),disabled:m||!O,children:m?kd.saving:kd.save}),(0,G.jsx)(U,{type:`button`,variant:`outline`,onClick:k,disabled:m||!f,children:`Cancel`})]})]}):(0,G.jsxs)(`p`,{className:`text-sm text-secondary`,children:[kd.pageBudget,`: `,(0,G.jsx)(`span`,{className:`text-strong`,children:md(o)})]})]})}function Fd(){let e=(0,W.useRef)(Xt()).current,t=(0,W.useRef)(new Set),n=(0,W.useCallback)((n,r)=>{t.current.has(n)||(t.current.add(n),Qt({...r,flowVersion:1,onboardingSessionId:e,surface:`platform`,eventId:Fe()}))},[e]);return(0,W.useEffect)(()=>{n(`started`,{event:`onboarding.started`,step:`finish`,resumed:!1})},[n]),(0,W.useCallback)(e=>{n(`action:${e}`,{event:`onboarding.step_completed`,step:`finish`,method:`manual`,nextAction:e})},[n])}function Id({projectName:e,skippedVisibility:t=!1}){let n=Fd(),r=Ld(e,z[`site-audit`]),i=r.outcome===`not-started`&&Uu(e)?`skipped`:r.outcome,a=Ld(e,z[`answer-visibility`]),o=a.outcome,s=I({...xr({client:H,path:{name:e}}),enabled:o===`not-started`,retry:!1}),c=I({...gr({client:H,path:{name:e}}),enabled:o===`not-started`,retry:!1}),l=s.data?.answerVisibilityProviderReady===!1?`Connect an engine`:c.isSuccess&&c.data.length===0?`Add queries`:s.data?.answerVisibilityProviderReady===!0&&c.isSuccess?`Start first check`:`Continue setup`,u={...i?{site:i,fixes:i}:{},...Rd(o,t)};return(0,G.jsxs)(`div`,{className:`page-container max-w-4xl py-8 md:py-10`,children:[(0,G.jsx)(ad,{current:`done`,outcomes:u}),(0,G.jsxs)(`div`,{className:`mx-auto mt-8 max-w-2xl`,children:[(0,G.jsxs)(`header`,{children:[(0,G.jsx)(`p`,{className:`break-words text-sm text-secondary`,children:e}),(0,G.jsx)(`h1`,{className:`mt-2 text-3xl font-semibold tracking-tight text-heading`,children:`Project saved`}),(0,G.jsx)(`p`,{className:`mt-3 text-base text-secondary`,role:`status`,children:o===void 0?`Latest AI Visibility check complete.`:o===`partial`?`Latest AI Visibility check has partial results.`:o===`queued`?`AI Visibility check queued.`:o===`running`?`AI Visibility check running.`:o===`failed`?`Latest AI Visibility check failed.`:o===`cancelled`?`Latest AI Visibility check cancelled.`:o===`unknown`?`AI Visibility status unconfirmed.`:`No AI Visibility check yet.`}),a.hasEarlierResults?(0,G.jsx)(`p`,{className:`mt-2 text-sm text-secondary`,children:`Earlier AI results remain available.`}):null,r.hasEarlierResults?(0,G.jsx)(`p`,{className:`mt-2 text-sm text-secondary`,children:`Earlier page health results remain available.`}):null,(0,G.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-3`,children:[(0,G.jsx)(U,{asChild:!0,className:Bd,children:(0,G.jsxs)(R,{to:`/projects/$projectName`,params:{projectName:e},replace:!0,"aria-label":`Open project ${e}`,onClick:()=>n(`open_project`),children:[`Open project `,(0,G.jsx)(w,{className:`size-4`,"aria-hidden":`true`})]})}),o===`not-started`?(0,G.jsx)(U,{asChild:!0,variant:`secondary`,className:Bd,children:(0,G.jsx)(R,{to:`/setup`,search:{experience:`legacy`,onboarding:`first-run`,setupProject:e},children:l})}):null]})]}),(0,G.jsx)(Wd,{projectName:e,onAction:n})]})]})}function Ld(e,t,n=!0){let r=I({...vr({client:H,path:{name:e},query:{kind:t,limit:5e3}}),enabled:n,retry:!1,refetchInterval:e=>{let t=zd(e.state.status===`success`?{isSuccess:!0,data:e.state.data}:{isSuccess:!1});return t===`queued`||t===`running`?5e3:!1}}),i=r.data?.filter(e=>e.trigger!==un.probe)??[];return{outcome:zd(r),hasEarlierResults:i.slice(0,-1).some(e=>e.status===V.completed||e.status===V.partial)}}function Rd(e,t){return e===void 0?{}:t&&e===`not-started`?{visibility:`skipped`}:{visibility:e}}function zd(e){if(!e.isSuccess||!e.data)return`unknown`;let t=e.data.filter(e=>e.trigger!==un.probe).at(-1);if(!t)return`not-started`;if(t.status!==V.completed)return t.status===V.partial?`partial`:t.status===V.queued?`queued`:t.status===V.running?`running`:t.status===V.failed?`failed`:t.status===V.cancelled?`cancelled`:`unknown`}var Bd=`pointer-coarse:min-h-11 max-md:min-h-11`,Vd=`min-h-9 cursor-pointer py-2 text-sm font-medium text-heading pointer-coarse:py-3 max-md:py-3 ${Bd}`,Hd=`flex min-h-9 items-center justify-between gap-3 py-2 text-sm font-medium text-heading ${Bd}`,Ud=[{label:`Search Console`,action:`connect_search_console`,to:`/projects/$projectName/search-console`},{label:`Google Analytics`,action:`connect_analytics`,to:`/projects/$projectName/activity`},{label:`Business Profile`,action:`connect_business_profile`,to:`/projects/$projectName/local`}];function Wd({projectName:e,onAction:t}){let n=`inline-flex min-h-9 items-center text-sm font-medium text-link underline-offset-4 hover:underline ${Bd}`;return(0,G.jsxs)(`section`,{"aria-labelledby":`onb-options-heading`,className:`mt-8`,children:[(0,G.jsx)(`h2`,{id:`onb-options-heading`,className:`mb-2 text-sm font-medium text-secondary`,children:`Optional setup`}),(0,G.jsxs)(`ul`,{className:`divide-y divide-default border-y border-default`,children:[(0,G.jsx)(`li`,{children:(0,G.jsxs)(R,{to:`/agent-setup`,className:Hd,children:[`Connect your agent `,(0,G.jsx)(w,{className:`size-4 text-muted`,"aria-hidden":`true`})]})}),(0,G.jsx)(`li`,{children:(0,G.jsxs)(`details`,{children:[(0,G.jsx)(`summary`,{className:Vd,children:`Connect data sources`}),(0,G.jsxs)(`ul`,{className:`pb-3 pl-4`,children:[(0,G.jsx)(`li`,{children:(0,G.jsx)(R,{to:`/traffic`,className:n,onClick:()=>t(`connect_server_traffic`),children:`Connect server-side traffic`})}),Ud.map(({label:r,action:i,to:a})=>(0,G.jsx)(`li`,{children:(0,G.jsxs)(R,{to:a,params:{projectName:e},className:n,onClick:()=>t(i),children:[`Connect `,r]})},r))]})]})}),(0,G.jsx)(`li`,{children:(0,G.jsxs)(R,{to:`/projects/$projectName/settings`,params:{projectName:e},className:Hd,onClick:()=>t(`set_schedule`),children:[`Set a schedule `,(0,G.jsx)(w,{className:`size-4 text-muted`,"aria-hidden":`true`})]})}),(0,G.jsx)(`li`,{children:(0,G.jsxs)(R,{to:`/projects/$projectName/settings`,params:{projectName:e},className:Hd,onClick:()=>t(`add_notification`),children:[`Add a notification `,(0,G.jsx)(w,{className:`size-4 text-muted`,"aria-hidden":`true`})]})})]}),(0,G.jsx)(R,{to:`/projects/$projectName/technical-aeo`,params:{projectName:e},className:`${n} mt-2`,onClick:()=>t(`review_page_health`),children:`Review page health`})]})}var Gd=`cdp:chatgpt`;function Kd(e){return e.trim().toLowerCase()}function qd({projectProviders:e,configuredApiProviders:t,cdpConfigured:n}){let r=e.map(Kd),i=new Set(r),a=r.length===0||r.some(e=>e!==`cdp:chatgpt`),o=r.length===0||i.has(`cdp:chatgpt`);if(a&&t!==void 0&&t.map(Kd).some(e=>r.length===0||i.has(e))||o&&n===!0)return!0;if(!(a&&t===void 0||o&&n===void 0))return!1}var Jd=`pointer-coarse:min-h-11 max-md:min-h-11`,Yd=[{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 AI Visibility check`}],Xd=[{label:`Queries`},{label:`First check`}];function Zd(e,t){return(e===`completed`||e===`partial`)&&t>0}function Qd(e){return e.launchReady?e.hasProject?e.queryCount===0?2:e.competitorCount===0&&!e.hasRunAttempt?3:4:1:0}function $d(e){return e.queryCounts.total>0}function ef(e,t){return t?e.find(e=>e.project.name===t)??null:e.find(e=>!$d(e))??e.at(0)??null}function tf({current:e,labels:t}){return(0,G.jsx)(`div`,{className:`setup-steps`,role:`list`,"aria-label":`Setup progress`,children:t.map((t,n)=>{let r=n<e,i=n===e;return(0,G.jsxs)(`div`,{className:`setup-step ${r?`setup-step-done`:``} ${i?`setup-step-active`:``}`,role:`listitem`,"aria-current":i?`step`:void 0,children:[(0,G.jsx)(`span`,{className:`setup-step-number`,children:r?`✓`:n+1}),(0,G.jsx)(`span`,{children:t.label})]},t.label)})})}function nf({visibilityProjectName:e,siteHealthOnboarding:t=!1,onboardingFinish:n=t}={}){let{canWrite:r}=Xn();return e&&r?(0,G.jsx)(rf,{visibilityProjectName:e,siteHealthOnboarding:t,onboardingFinish:n}):(0,G.jsx)(bl,{title:e?`Set up AI Visibility`:`Setup`,children:(0,G.jsx)(rf,{visibilityProjectName:e,siteHealthOnboarding:t,onboardingFinish:n})})}function rf({visibilityProjectName:e,siteHealthOnboarding:t,onboardingFinish:n}){let r=es(),{isAdmin:i}=Xn(),{dashboard:a,isLoading:o,refetch:s}=ts(void 0,{pauseProjectPolling:!0,includeSettings:i}),c=a??r?.dashboard,l=Se(),u=(0,W.useCallback)(t=>{t&&e&&t.focus()},[e]);return!c||o?(0,G.jsxs)(`div`,{className:`page-skeleton`,children:[(0,G.jsxs)(`div`,{className:`page-skeleton-header`,children:[(0,G.jsx)(`div`,{className:`skeleton-text h-6 w-24`}),(0,G.jsx)(`div`,{className:`skeleton-text-sm w-80`})]}),(0,G.jsxs)(`div`,{className:`page-skeleton-card`,children:[(0,G.jsx)(`div`,{className:`skeleton-text w-32`}),(0,G.jsx)(`div`,{className:`space-y-3 mt-3`,children:[1,2,3].map(e=>(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsxs)(`div`,{className:`space-y-1 flex-1`,children:[(0,G.jsx)(`div`,{className:`skeleton-text w-24`}),(0,G.jsx)(`div`,{className:`skeleton-text-sm w-48`})]}),(0,G.jsx)(`div`,{className:`skeleton h-6 w-16 rounded-full`})]},e))})]})]}):e&&!c.projects.some(t=>t.project.name===e)?(0,G.jsxs)(`div`,{className:`page-container`,children:[t?(0,G.jsx)(ad,{current:`visibility`,outcomes:{site:`unknown`,fixes:`unknown`}}):null,(0,G.jsxs)(`div`,{className:`page-header`,children:[(0,G.jsxs)(`div`,{className:`page-header-left`,children:[(0,G.jsx)(`h1`,{ref:u,tabIndex:-1,className:`page-title outline-none`,children:`Set up AI Visibility`}),(0,G.jsx)(`p`,{className:`page-subtitle`,children:`Choose what to track, then run your first AI Visibility check.`})]}),t?(0,G.jsx)(`div`,{className:`page-header-right`,children:(0,G.jsx)(U,{type:`button`,variant:`outline`,onClick:()=>{l(e?n?{to:`/setup`,search:{onboarding:`complete`,setupProject:e,skipped:`visibility`},replace:!0}:{to:`/projects/$projectName`,params:{projectName:e},replace:!0}:{to:`/`,replace:!0})},children:`Skip AI Visibility`})}):null]}),(0,G.jsxs)(Mr,{role:`alert`,className:`compact-stack`,children:[(0,G.jsx)(`h2`,{children:`Project not found`}),(0,G.jsx)(`p`,{className:`text-secondary`,children:`Canonry could not find the project handed off from Site Health. Refresh the project list or choose a project to continue.`}),(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,G.jsx)(U,{type:`button`,variant:`outline`,onClick:()=>{s()},children:`Retry`}),(0,G.jsx)(U,{type:`button`,asChild:!0,children:(0,G.jsx)(R,{to:`/projects`,children:`View projects`})})]})]})]}):(0,G.jsx)(af,{dashboard:c,initialHealth:r?.health,enableLiveStatus:!r,refetch:s,visibilityProjectName:e,visibilityHeadingRef:u,siteHealthOnboarding:t,onboardingFinish:n},e??`global`)}function af({dashboard:e,initialHealth:t,enableLiveStatus:n,refetch:r,visibilityProjectName:i,visibilityHeadingRef:a,siteHealthOnboarding:o,onboardingFinish:s}){let c=e.settings,{isAdmin:l}=Xn(),u=ls(n,t).data??t??{apiStatus:{label:`API`,state:`checking`,detail:`Checking service health`},workerStatus:{label:`Worker`,state:`checking`,detail:`Checking service health`}},d=xi(e.setup,u,c),f=c.providerStatuses.some(e=>e.name===`openrouter`&&e.state===`ready`),p=d.launchState.enabled||f&&d.healthChecks.every(e=>e.state===`ready`||e.id===`provider`),m=!!i,h=Se(),g=ve(),_=(0,W.useRef)(Xt()).current,v=(0,W.useRef)(new Set),y=(0,W.useCallback)((e,t)=>{if(t){if(v.current.has(t))return;v.current.add(t)}Qt({surface:`wizard`,...e,eventId:Fe()})},[]),b=ef(e.projects,i),x=b?e.runs.filter(e=>e.projectId===b.project.id).sort((e,t)=>t.createdAt.localeCompare(e.createdAt)):[],S=b?.queryCounts.total??0,C=b?.project.name,w=Ld(C??``,z[`site-audit`],!!(o&&C)),T=w.outcome===`not-started`&&C&&Uu(C)?`skipped`:w.outcome,E=I({queryKey:[`setup`,`resume-queries`,C],queryFn:()=>C?nt(C):Promise.resolve([]),enabled:!!C}),D=E.data??[],O=E.data?.length??S,ee=b?.competitors.map(e=>e.domain)??[],te=x.at(0)??null,k=!!b&&$d(b),A=!!b&&E.isPending,ne=m?2:Qd({launchReady:p,hasProject:!!b,queryCount:O,competitorCount:ee.length,hasRunAttempt:x.length>0||k}),re=Qd({launchReady:!0,hasProject:!!b,queryCount:O,competitorCount:ee.length,hasRunAttempt:x.length>0||k}),[ie]=(0,W.useState)(()=>`wizard:${C??`new`}`),[ae]=(0,W.useState)(()=>zu(ie)),[oe,j]=(0,W.useState)(ne),[M,se]=(0,W.useState)(!A),ce=m&&(A||!M),[le,ue]=(0,W.useState)(b?.project.name??ae.projectName??``),[de,fe]=(0,W.useState)(b?.project.displayName??ae.displayName??``),[pe,me]=(0,W.useState)(b?.project.canonicalDomain??ae.domain??``),[he,ge]=(0,W.useState)(b?.project.country??ae.country??`US`),[N,P]=(0,W.useState)(b?.project.language??ae.language??`en`),[_e,ye]=(0,W.useState)(b?.project.autoExtractBacklinks??!1),[F,be]=(0,W.useState)(b?.project.name??null),[xe,Ce]=(0,W.useState)(b?.project??null),[we,Te]=(0,W.useState)(null),[L,Ee]=(0,W.useState)(!1),De=()=>{h(F?{to:o?`/projects/$projectName/technical-aeo`:`/projects/$projectName`,params:{projectName:F},replace:!!i}:{to:`/`,replace:!!i})},Oe=(e=!1)=>{!s||!F?De():h({to:`/setup`,search:{onboarding:`complete`,setupProject:F,...e?{skipped:`visibility`}:{}},replace:!0})},ke=()=>Oe(!0),[Ae,je]=(0,W.useState)(ae.queriesText??D.map(e=>e.query).join(`
27
+ `)),[Me,Ne]=(0,W.useState)(ae.queriesText===void 0&&O>0),[Pe,Ie]=(0,W.useState)(null),[Le,ze]=(0,W.useState)(!1),[Be,Ve]=(0,W.useState)(!1),He=(xe?.providers??b?.project.providers??[]).map(Kd),Ue=I({queryKey:[`settings`],queryFn:sn,staleTime:6e4,enabled:l&&f&&He.some(Je)}),We=new Map((Ue.data?.providerCatalog??[]).find(e=>e.name===`openrouter`)?.knownModels.map(e=>[e.id,e.displayName])??[]),Ke=e=>{let t=it(e);return t&&We.has(t)?`${We.get(t)} via OpenRouter`:ea(e)},qe=[...c.providerStatuses.filter(e=>e.state===`ready`&&e.name!==`openrouter`&&e.kind!==`answer-service`),...f?He.filter(Je).map(e=>({name:e,displayName:Ke(e),model:it(e),state:`ready`,detail:`OpenRouter model configured.`})):[]],Xe=qe.filter(e=>He.length===0||He.includes(Kd(e.name))),Ze=qe.map(e=>Kd(e.name)),$e=Xe.length>0,et=He.length===0||He.includes(`cdp:chatgpt`),tt=m&&!l,rt=I({...xr({client:H,path:{name:C??``}}),enabled:tt&&!!C,staleTime:0,refetchOnMount:`always`,refetchOnWindowFocus:`always`,retry:!1}),ot=rt.data?.answerVisibilityProviderReady,st=tt&&(rt.isError||rt.isSuccess&&typeof ot!=`boolean`),ct=I({...Sr({client:H}),enabled:!tt&&et&&!$e,staleTime:6e4,retry:!1}),ut=et?ct.isSuccess?typeof ct.data.browserVersion==`string`:!ct.isError&&void 0:!1,dt=tt?rt.isSuccess&&rt.isFetchedAfterMount&&!rt.isFetching?ot:void 0:qd({projectProviders:He,configuredApiProviders:Ze,cdpConfigured:ut}),ft=f&&He.length===0&&dt===!1,pt=dt===!1&&!ft,mt=m&&l&&ft,ht=I({queryKey:[`settings`],queryFn:sn,staleTime:6e4,enabled:mt}),gt=(ht.data?.providerCatalog??[]).find(e=>e.name===`openrouter`),vt=Xe.length+ +(ut===!0),[bt,xt]=(0,W.useState)(Xe[0]?.name??``),[St,Ct]=(0,W.useState)(5),[wt,Tt]=(0,W.useState)(!1),[Et,Dt]=(0,W.useState)(null),[Ot,At]=(0,W.useState)(``),jt=(0,W.useRef)(!1),Mt=(0,W.useCallback)(e=>{e&&jt.current&&(jt.current=!1,e.focus({preventScroll:!0}))},[]),[Nt,Pt]=(0,W.useState)(!1),[Ft,Lt]=(0,W.useState)(!1),[Rt,zt]=(0,W.useState)(!1),Bt=c.providerStatuses.filter(e=>Kd(e.name)!==`cdp:chatgpt`&&e.kind!==`answer-service`&&(He.length===0||He.includes(Kd(e.name))||e.name===`openrouter`&&He.some(Je))),Vt=Bt.find(e=>e.name===Ot)??Bt.find(e=>e.state!==`ready`)??Bt.at(0),Ht=`Help me choose AI Visibility queries for Canonry project ${JSON.stringify(F??le)} (${pe}).
28
+ 1. Read the project, its existing tracked queries, and Site Health findings. Ask about my customers, services, and locations if needed, then propose relevant customer queries.
29
+ 2. Check the configured connection's capabilities, then use Canonry's Research flow to test a small approved batch. Retrieve saved answers and any available sources. Compare brand mentions separately from site citations; unavailable citation evidence is not a "not cited" result. Text-only routes can inform query research but cannot establish an AI Visibility baseline. Research does not add queries to tracking. If more candidates are needed, propose ICP Discovery separately.
30
+ 3. Recommend a short list with reasons. Ask before provider usage. Once I approve, preserve existing queries and return the combined list, one query per line, for me to paste into setup. Do not change tracked queries or launch an AI Visibility check.`,Ut=async()=>{zt(!1);try{await navigator.clipboard.writeText(Ht),Lt(!0)}catch{zt(!0)}},[B,Wt]=(0,W.useState)(ae.competitorsText??ee.join(`
31
+ `)),[V,Gt]=(0,W.useState)(ae.competitorsText===void 0&&ee.length>0),[qt,Yt]=(0,W.useState)(null),[Zt,$t]=(0,W.useState)(!1);(0,W.useEffect)(()=>{if(!M)return;let e=F?`wizard:${F}`:ie;Bu(e,{...F?{}:{projectName:le,displayName:de,domain:pe,country:he,language:N},...!Me&&Ae!==D.map(e=>e.query).join(`
32
+ `)?{queriesText:Ae}:{},...!V&&B!==ee.join(`
33
+ `)?{competitorsText:B}:{}}),e!==ie&&Vu(ie)},[V,B,he,F,de,pe,ie,ee,D,N,le,Me,Ae,M]);let en=()=>{Vu(ie),F&&Vu(`wizard:${F}`),F||(ue(``),fe(``),me(``),ge(`US`),P(`en`)),je(D.map(e=>e.query).join(`
34
+ `)),Ne(O>0),Wt(ee.join(`
35
+ `)),Gt(ee.length>0),Ie(null),Yt(null)},tn=(0,W.useRef)(Re(C)).current?.runId??null,nn=(0,W.useRef)(tn),[rn,an]=(0,W.useState)(!!tn||!!te&&!k),[on,cn]=(0,W.useState)(!1),[ln,un]=(0,W.useState)(null),[dn,fn]=(0,W.useState)(tn??(k?null:te?.id??null)),mn=X(),gn=I({...ur({client:H,path:{id:dn??``}}),enabled:!!dn,refetchInterval:({state:e})=>{let t=e.data?.status;return t===`completed`||t===`partial`||t===`failed`||t===`cancelled`?!1:2e3},refetchIntervalInBackground:!0}),[_n,vn]=(0,W.useState)(``),[yn,xn]=(0,W.useState)(!1),[Sn,Cn]=(0,W.useState)(null),wn=le.toLowerCase().replace(/[^a-z0-9-]/g,`-`).replace(/-+/g,`-`).replace(/^-|-$/g,``),Tn=Ae.split(`
36
+ `).map(e=>e.trim()).filter(Boolean),En=B.split(`
37
+ `).map(e=>e.trim()).filter(Boolean),Dn=Math.max(O,Me?Tn.length:0),On=zn({apiReady:u.apiStatus.state===`ok`,databaseConfigured:u.apiStatus.databaseConfigured,workerReady:u.workerStatus.state===`ok`,providerReady:dt!==!1}),kn=(On&&On!==`no_provider`?d.launchState.blockedReason:st?`Provider readiness could not be checked. Try again.`:dt===void 0?`Checking provider readiness before launch.`:On===`no_provider`?`Launch is blocked until a provider allowed by this project is configured.`:void 0)??(F?Dn===0?`Add at least one query before launching the first check.`:void 0:`Create a project before launching the first check.`);(0,W.useEffect)(()=>{M||A||(m||j(ne),D.length>0&&ae.queriesText===void 0&&(je(D.map(e=>e.query).join(`
38
+ `)),Ne(!0)),se(!0))},[ae.queriesText,D,ne,m,M,A]),(0,W.useEffect)(()=>{Xe.length===0?xt(``):Xe.some(e=>e.name===bt)||xt(Xe[0].name)},[Xe,bt]),(0,W.useEffect)(()=>{M&&(y({flowVersion:1,onboardingSessionId:_,event:`onboarding.started`,step:_t(ne),resumed:!!b},`onboarding.started`),!b&&ne>0&&y({flowVersion:1,onboardingSessionId:_,event:`onboarding.step_completed`,step:`system`,method:`automatic`},`onboarding.step_completed:system`))},[y,ne,_,M,b]),(0,W.useEffect)(()=>{m||lt(u)&&On&&y({flowVersion:1,onboardingSessionId:_,event:`onboarding.blocked`,step:`system`,action:On===`no_provider`?`configure_provider`:`continue`,reasonCode:On},`onboarding.blocked:system:${On}`)},[y,u,m,_,On]);let An=gn.data?.status,jn=gn.data?.snapshots?.length??0;(0,W.useEffect)(()=>{if(!rn||!An)return;let e=nn.current;if(!e||e!==dn)return;if(Zd(An,jn)){y({flowVersion:1,onboardingSessionId:_,event:`onboarding.step_completed`,step:`run`,method:`automatic`,countBucket:hn(jn)},`onboarding.step_completed:run`),Ye(e);return}let t=An===`cancelled`?`run_cancelled`:An===`failed`||(An===`completed`||An===`partial`)&&jn===0?`run_failed`:void 0;t&&(y({flowVersion:1,onboardingSessionId:_,event:`onboarding.blocked`,step:`run`,action:`retry_run`,reasonCode:t},`onboarding.blocked:run:${t}`),Ye(e))},[y,dn,_,An,jn,rn]);let Mn=async()=>{if(wn&&pe){Ee(!0),Te(null);try{let e=await Ge(wn,{displayName:de||le,canonicalDomain:pe,country:he,language:N,autoExtractBacklinks:_e});be(wn),Ce(e),tr({title:`Project created`,detail:`${e.displayName||e.name} is ready for setup.`,tone:`positive`,dedupeKey:`project:create:${e.name}`,dedupeMode:`drop`}),await r(),y({flowVersion:1,onboardingSessionId:_,event:`onboarding.step_completed`,step:`project`,method:`manual`},`onboarding.step_completed:project`),j(2)}catch(e){Te(e instanceof Error?e.message:`Failed to create project`),y({flowVersion:1,onboardingSessionId:_,event:`onboarding.blocked`,step:`project`,action:`save`,reasonCode:`project_create_failed`},`onboarding.blocked:project:project_create_failed`)}finally{Ee(!1)}}},Nn=async()=>{if(!F)return;let e=Tn;if(e.length!==0){ze(!0),Ie(null);try{let t=await pn(F,e);g.setQueryData([`setup`,`resume-queries`,F],t),Ne(!0),m?await Promise.all([g.invalidateQueries({queryKey:yr({client:H,path:{name:F}})}),g.invalidateQueries({predicate:td}),g.invalidateQueries({queryKey:[`setup`,`resume-queries`,F]})]):await r(),y({flowVersion:1,onboardingSessionId:_,event:`onboarding.step_completed`,step:`queries`,method:Be?`generated`:`manual`,countBucket:hn(e.length)},`onboarding.step_completed:queries`),j(m?4:3)}catch(e){Ie(e instanceof Error?e.message:`Failed to save queries`),y({flowVersion:1,onboardingSessionId:_,event:`onboarding.blocked`,step:`queries`,action:`save`,reasonCode:`query_save_failed`},`onboarding.blocked:queries:query_save_failed`)}finally{ze(!1)}}},Pn=async()=>{if(F&&bt){Tt(!0),Dt(null);try{let e=await Jt(F,bt,St);if(e.queries.length>0){let t=Ae?Ae.trimEnd()+`
39
+ `+e.queries.join(`
40
+ `):e.queries.join(`
41
+ `);je(t),Ve(!0)}}catch(e){Dt(e instanceof Error?e.message:`Failed to generate queries`),y({flowVersion:1,onboardingSessionId:_,event:`onboarding.blocked`,step:`queries`,action:`generate_queries`,reasonCode:at(e,`unknown`)},`onboarding.blocked:queries:generate`)}finally{Tt(!1)}}},Fn=async()=>{if(!F)return;let e=En;if(e.length!==0){$t(!0),Yt(null);try{await kt(F,e),Gt(!0),await r(),y({flowVersion:1,onboardingSessionId:_,event:`onboarding.step_completed`,step:`competitors`,method:`manual`,countBucket:hn(e.length)},`onboarding.step_completed:competitors`),j(4)}catch(e){Yt(e instanceof Error?e.message:`Failed to save competitors`),y({flowVersion:1,onboardingSessionId:_,event:`onboarding.blocked`,step:`competitors`,action:`save`,reasonCode:`unknown`},`onboarding.blocked:competitors:save`)}finally{$t(!1)}}},In=async()=>{let e=_n.trim();if(e){xn(!0),Cn(null);try{await It(`gemini`,{apiKey:e}),tr({title:`Gemini configured`,detail:`Provider is ready — continuing setup.`,tone:`positive`,dedupeKey:`setup:gemini:configured`,dedupeMode:`drop`}),vn(``),await r(),xt(c.providerStatuses.find(e=>e.name.toLowerCase()===`gemini`)?.name??`gemini`),y({flowVersion:1,onboardingSessionId:_,event:`onboarding.step_completed`,step:`system`,method:`inline`},`onboarding.step_completed:system`)}catch(e){Cn(e instanceof Error?e.message:`Failed to save Gemini key`),y({flowVersion:1,onboardingSessionId:_,event:`onboarding.blocked`,step:`system`,action:`configure_provider`,reasonCode:`provider_save_failed`},`onboarding.blocked:system:provider_save_failed`)}finally{xn(!1)}}},Ln=async e=>{let t=xe?.name??F;if(!t)throw Error(`Create a project before choosing models.`);let n=await Kt(t,e);Ce(n),await r()},Rn=async()=>{if(!yt()){if(!F||kn){un(kn??`Complete setup before launching the first check.`);let e=On??(F?Dn===0?`no_queries`:`run_rejected`:`unknown`);tt||y({flowVersion:1,onboardingSessionId:_,event:`run.requested`,origin:`dashboard_setup`,result:`rejected`,providerCountBucket:hn(vt),queryCountBucket:hn(Dn),reasonCode:e})}else{cn(!0),un(null);try{let e=await mn.mutateAsync({projectName:F,projectLabel:de||le||F,sourceAction:`setup-launch`});fn(e.id),an(!0),Qe(F,e.id),nn.current=e.id,tt||y({flowVersion:1,onboardingSessionId:_,event:`run.requested`,origin:`dashboard_setup`,result:`queued`,providerCountBucket:hn(vt),queryCountBucket:hn(Dn)}),await r()}catch(e){un(e instanceof Error?e.message:`Failed to queue the AI Visibility check. Retry when the instance is ready.`),tt||y({flowVersion:1,onboardingSessionId:_,event:`run.requested`,origin:`dashboard_setup`,result:`rejected`,providerCountBucket:hn(vt),queryCountBucket:hn(Dn),reasonCode:at(e,`run_rejected`)})}finally{cn(!1)}}}},Bn=()=>j(e=>m?2:Math.max(0,e-1)),Vn=(e,t,n)=>{y({flowVersion:1,onboardingSessionId:_,event:`onboarding.step_completed`,step:e,method:`existing`,...n===void 0?{}:{countBucket:hn(n)}},`onboarding.step_completed:${e}`),j(t)},Hn=()=>{y({flowVersion:1,onboardingSessionId:_,event:`onboarding.step_completed`,step:`queries`,method:`skipped`,countBucket:`0`},`onboarding.step_completed:queries`),m?ke():j(3)},Un=()=>{y({flowVersion:1,onboardingSessionId:_,event:`onboarding.step_completed`,step:`competitors`,method:`skipped`,countBucket:`0`},`onboarding.step_completed:competitors`),j(4)},Wn=m?`section`:Mr,Gn=dt!==!0||ut===!0?(0,G.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,className:Jd,onClick:()=>{r(),et&&ct.refetch(),mt&&ht.refetch()},children:`Check again`}):null,Kn=(pt||Nt)&&!!Vt,Jn=m&&(oe===2||oe===4)?l?(0,G.jsxs)(`section`,{"aria-labelledby":`setup-provider-heading`,className:`space-y-3 border-b border-default pb-6 mb-6`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,G.jsx)(`h2`,{id:`setup-provider-heading`,className:`text-lg font-semibold text-heading`,children:`AI engines`}),(0,G.jsx)(bn,{tone:dt===!0?`positive`:ft?`caution`:`neutral`,children:dt===!0?`Ready`:ft?`Choose models`:pt?`Not connected`:`Checking`}),(0,G.jsx)(Dr,{text:dt===!0?Xe.length>0?`AI Visibility checks and Research use your provider account.`:`ChatGPT in Chrome runs AI Visibility checks. Query Research needs an API provider.`:ft?`OpenRouter is connected. Choose the models your AI Visibility checks ask. You can save queries now.`:pt?`AI Visibility checks need an AI engine. You can save queries now and connect one later.`:`Checking connected AI engines. You can choose queries meanwhile.`})]}),dt===!0&&(Xe.length>0||ut===!0)?(0,G.jsxs)(`ul`,{"aria-label":`Connected AI engines`,className:`divide-y divide-default rounded-lg border border-default`,children:[Xe.map(e=>{let t=Je(e.name),n=e.displayName??e.name;return(0,G.jsxs)(`li`,{className:`flex min-h-11 items-center justify-between gap-3 px-3.5 py-2 text-sm`,title:t?it(e.name):void 0,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate text-heading`,children:t?n.replace(/ via OpenRouter$/,``):n}),(0,G.jsx)(`span`,{className:`shrink-0 text-secondary`,children:t?`OpenRouter`:e.model??``})]},e.name)}),Xe.length===0?(0,G.jsx)(`li`,{className:`flex min-h-11 items-center px-3.5 py-2 text-sm text-heading`,children:`ChatGPT in Chrome`}):null]}):null,mt?gt?(0,G.jsx)(yd,{inline:!0,catalog:gt,selected:He,onAdd:e=>Ln({providers:e,providerModels:{}})}):ht.isPending?(0,G.jsx)(`p`,{role:`status`,className:`text-sm text-secondary`,children:`Loading OpenRouter models…`}):(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`p`,{role:`alert`,className:`text-sm text-negative`,children:`Couldn't load OpenRouter's model list.`}),(0,G.jsx)(U,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{ht.refetch()},children:`Retry`})]}):null,pt||Nt?Vt?(0,G.jsx)(`div`,{children:(0,G.jsx)(cd,{compact:!0,leadingField:(0,G.jsxs)(`div`,{className:`min-w-0 space-y-1.5`,children:[(0,G.jsx)(`label`,{className:`block text-sm font-medium text-secondary`,htmlFor:`setup-provider`,children:`Provider to connect`}),(0,G.jsx)(`select`,{ref:Mt,id:`setup-provider`,className:`setup-input`,value:Vt.name,onChange:e=>{e.target.value!==Vt.name&&(jt.current=document.activeElement===e.currentTarget,At(e.target.value))},children:Bt.map(e=>(0,G.jsx)(`option`,{value:e.name,children:e.displayName??e.name},e.name))})]}),secondaryActions:Gn,offerFreeTier:pt,providerName:Vt.name,keyUrl:Vt.keyUrl,modelHint:Vt.modelHint,onSaved:()=>{Pt(!1),r()}},Vt.name)}):(0,G.jsx)(`p`,{className:`max-w-prose text-sm text-secondary`,children:He.length>0?`This project's provider selection is ${He.join(`, `)}. Configure an allowed provider in Settings, or change the selection in project Settings.`:`Provider configuration is unavailable here. Open Settings to connect an answer engine, then check again.`}):null,(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(dt===!0||ft)&&!Nt&&Vt?(0,G.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,className:`-ml-3 text-sm`,onClick:()=>Pt(!0),children:`Use a different provider`}):null,!Vt||ut===!0?(0,G.jsx)(U,{type:`button`,variant:`outline`,size:`sm`,asChild:!0,children:(0,G.jsx)(R,{to:`/settings`,target:`_blank`,rel:`noopener noreferrer`,children:`Open provider settings`})}):null,!Kn&&!mt?Gn:null]})]}):(0,G.jsxs)(`section`,{"aria-labelledby":`setup-provider-heading`,className:`space-y-2 border-b border-default pb-6 mb-6`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,G.jsx)(`h2`,{id:`setup-provider-heading`,className:`text-lg font-semibold text-heading`,children:`AI engines`}),st?null:(0,G.jsxs)(`span`,{role:`status`,className:`flex items-center gap-2`,children:[(0,G.jsx)(bn,{tone:dt===!0?`positive`:`neutral`,children:dt===!0?`Ready`:dt===!1?`Not connected`:`Checking`}),(0,G.jsx)(Dr,{text:dt===!0?`An AI engine is available for this project. An administrator manages provider settings.`:dt===!1?`Ask an administrator to connect an AI engine for this project. You can save queries now.`:`Checking for a connected AI engine. An administrator manages provider settings. You can save queries now.`})]})]}),st?(0,G.jsx)(`p`,{role:`alert`,className:`text-sm text-negative`,children:`Provider readiness could not be checked. Try again.`}):null,(0,G.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,className:Jd,disabled:rt.isFetching,onClick:()=>{rt.refetch()},children:st?`Retry provider check`:`Check again`})]}):null,Yn=(()=>{switch(oe){case 0:return(0,G.jsxs)(Mr,{className:`surface-card step-card`,children:[(0,G.jsx)(`div`,{className:`section-head`,children:(0,G.jsx)(`div`,{children:(0,G.jsx)(`h2`,{children:`System check`})})}),(0,G.jsx)(`p`,{className:`supporting-copy`,children:`Checking that your Canonry instance is configured and reachable.`}),(0,G.jsx)(`div`,{className:`compact-stack`,children:d.healthChecks.map(e=>(0,G.jsxs)(`div`,{className:`health-check-row`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`run-row-title`,children:e.label}),(0,G.jsx)(`p`,{className:`supporting-copy`,children:e.id===`provider`&&f?`OpenRouter connected. Choose models before your first check.`:e.detail}),e.id===`provider`&&e.state!==`ready`&&(0,G.jsxs)(`div`,{className:`mt-3 rounded-md border border-default bg-bg-elevated/40 p-3 space-y-2`,children:[(0,G.jsxs)(`p`,{className:`text-xs text-secondary`,children:[`Paste a Gemini key to enable visibility checks (free at`,` `,(0,G.jsx)(`a`,{href:`https://aistudio.google.com/apikey`,target:`_blank`,rel:`noreferrer`,className:`text-positive-400 hover:text-positive underline underline-offset-2`,children:`aistudio.google.com`}),`).`]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`input`,{type:`password`,value:_n,onChange:e=>vn(e.target.value),placeholder:`AI... (paste here)`,className:`flex-1 rounded-md border border-base bg-bg px-2.5 py-1.5 text-sm text-heading placeholder:text-faint focus:border-mono-600 focus:outline-none font-mono`,disabled:yn}),(0,G.jsx)(U,{type:`button`,size:`sm`,disabled:yn||!_n.trim(),onClick:Qn(In),children:yn?`Saving...`:`Save`})]}),Sn&&(0,G.jsxs)(`div`,{role:`alert`,className:`space-y-1 text-xs text-negative`,children:[(0,G.jsx)(`p`,{children:Sn}),(0,G.jsx)(`p`,{children:`Check that the key is complete, then retry Save.`})]}),(0,G.jsxs)(`p`,{className:`text-sm text-secondary`,children:[`Connect more answer engines later in`,` `,(0,G.jsx)(R,{to:`/settings`,className:`text-link hover:underline`,children:`Settings`}),`.`]}),c.providerStatuses.some(e=>e.name===`openrouter`)&&(0,G.jsxs)(`details`,{children:[(0,G.jsx)(`summary`,{className:`min-h-11 cursor-pointer py-3 text-sm text-link`,children:`Connect OpenRouter`}),(0,G.jsx)(cd,{providerName:`openrouter`,compact:!0,keyUrl:c.providerStatuses.find(e=>e.name===`openrouter`)?.keyUrl,onSaved:()=>{r()}})]})]})]}),(0,G.jsx)(bn,{tone:e.state===`ready`?`positive`:`caution`,title:e.id===`api`?vi(u.apiStatus):e.id===`worker`?vi(u.workerStatus):e.detail,children:e.state===`ready`?`Ready`:`Attention`})]},e.id))}),(0,G.jsxs)(`div`,{className:`setup-nav`,children:[d.launchState.blockedReason?(0,G.jsx)(`p`,{role:`status`,className:`supporting-copy text-negative`,children:d.launchState.blockedReason}):(0,G.jsx)(`span`,{}),(0,G.jsx)(U,{type:`button`,disabled:!p,title:d.launchState.blockedReason,onClick:()=>{y({flowVersion:1,onboardingSessionId:_,event:`onboarding.step_completed`,step:`system`,method:`automatic`},`onboarding.step_completed:system`),j(re)},children:`Continue`})]})]});case 1:return(0,G.jsxs)(Mr,{className:`surface-card step-card`,children:[(0,G.jsxs)(`div`,{className:`section-head`,children:[(0,G.jsx)(`div`,{children:(0,G.jsx)(`h2`,{children:`Create project`})}),F?(0,G.jsx)(bn,{tone:`positive`,children:`Created`}):null]}),F?(0,G.jsxs)(`div`,{className:`compact-stack`,children:[(0,G.jsxs)(`p`,{className:`text-neutral`,children:[`Project `,(0,G.jsx)(`span`,{className:`text-heading font-medium`,children:F}),` created successfully.`]}),(0,G.jsxs)(`div`,{className:`setup-nav`,children:[(0,G.jsx)(U,{type:`button`,variant:`outline`,onClick:Bn,children:`Back`}),(0,G.jsx)(U,{type:`button`,onClick:()=>Vn(`project`,2),children:`Continue`})]})]}):(0,G.jsxs)(`div`,{className:`compact-stack`,children:[(0,G.jsxs)(`div`,{className:`setup-field`,children:[(0,G.jsx)(`label`,{className:`setup-label`,htmlFor:`project-name`,children:`Project name`}),(0,G.jsx)(`input`,{id:`project-name`,className:`setup-input`,type:`text`,placeholder:`my-website`,value:le,onChange:e=>ue(e.target.value)}),wn&&wn!==le?(0,G.jsxs)(`p`,{className:`supporting-copy`,children:[`Slug: `,wn]}):null]}),(0,G.jsxs)(`div`,{className:`setup-field`,children:[(0,G.jsx)(`label`,{className:`setup-label`,htmlFor:`display-name`,children:`Display name (optional)`}),(0,G.jsx)(`input`,{id:`display-name`,className:`setup-input`,type:`text`,placeholder:`My Website`,value:de,onChange:e=>fe(e.target.value)})]}),(0,G.jsxs)(`div`,{className:`setup-field`,children:[(0,G.jsx)(`label`,{className:`setup-label`,htmlFor:`domain`,children:`Canonical domain`}),(0,G.jsx)(`input`,{id:`domain`,className:`setup-input`,type:`text`,placeholder:`example.com`,value:pe,onChange:e=>me(e.target.value)})]}),(0,G.jsxs)(`div`,{className:`setup-field-row`,children:[(0,G.jsxs)(`div`,{className:`setup-field`,children:[(0,G.jsx)(`label`,{className:`setup-label`,htmlFor:`country`,children:`Country`}),(0,G.jsx)(`input`,{id:`country`,className:`setup-input`,type:`text`,placeholder:`US`,maxLength:2,value:he,onChange:e=>ge(e.target.value.toUpperCase())})]}),(0,G.jsxs)(`div`,{className:`setup-field`,children:[(0,G.jsx)(`label`,{className:`setup-label`,htmlFor:`language`,children:`Language`}),(0,G.jsx)(`input`,{id:`language`,className:`setup-input`,type:`text`,placeholder:`en`,maxLength:5,value:N,onChange:e=>P(e.target.value.toLowerCase())})]})]}),(0,G.jsxs)(`label`,{className:`flex items-start gap-3 rounded-md border border-default bg-surface p-3 cursor-pointer hover:border-strong`,children:[(0,G.jsx)(`input`,{type:`checkbox`,className:`mt-0.5 h-4 w-4 rounded border-strong bg-bg`,checked:_e,onChange:e=>ye(e.target.checked)}),(0,G.jsxs)(`span`,{className:`flex-1`,children:[(0,G.jsx)(`span`,{className:`block text-sm text-heading`,children:`Auto-extract backlinks`}),(0,G.jsxs)(`span`,{className:`block text-xs text-muted mt-0.5`,children:[`When a new Common Crawl release syncs, automatically extract backlinks for this project.`,` `,(0,G.jsx)(R,{to:`/backlinks`,className:`text-positive-400 hover:text-positive underline underline-offset-2`,children:`Manage backlinks`})]})]})]}),we?(0,G.jsx)(`p`,{className:`text-negative-400 text-sm`,children:we}):null,(0,G.jsxs)(`div`,{className:`setup-nav`,children:[(0,G.jsx)(U,{type:`button`,variant:`outline`,onClick:Bn,children:`Back`}),(0,G.jsx)(U,{type:`button`,disabled:!wn||!pe||L,onClick:Qn(Mn),children:L?`Creating...`:`Create project`})]})]})]});case 2:return(0,G.jsxs)(Wn,{className:m?`visibility-setup-section step-card`:`surface-card step-card`,"aria-labelledby":`setup-queries-heading`,children:[(0,G.jsxs)(`div`,{className:`section-head`,children:[(0,G.jsx)(`div`,{children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`h2`,{id:`setup-queries-heading`,children:`Add queries`}),(0,G.jsx)(Dr,{text:`Queries your customers ask AI assistants, one per line. You can refine the list later.`})]})}),ce?(0,G.jsx)(bn,{tone:`neutral`,children:`Loading`}):E.isError?(0,G.jsx)(bn,{tone:`negative`,children:`Load failed`}):Me?(0,G.jsxs)(bn,{tone:`positive`,children:[Tn.length,` saved`]}):(0,G.jsxs)(bn,{tone:`neutral`,children:[Tn.length,` quer`,Tn.length===1?`y`:`ies`]})]}),(0,G.jsxs)(`div`,{className:`space-y-2 border-b border-default pb-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,G.jsx)(`div`,{className:`min-w-0 space-y-1`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`h3`,{className:`text-sm font-semibold text-heading`,children:`Research queries with your agent`}),(0,G.jsx)(Dr,{text:`Ask your agent to compare answers and available sources with Canonry Research, then recommend queries. Research does not change your tracked queries.`})]})}),(0,G.jsx)(U,{type:`button`,variant:`outline`,size:`sm`,className:`shrink-0 self-start ${Jd}`,onClick:Qn(Ut),children:Ft?`Research prompt copied`:`Copy research prompt`})]}),(0,G.jsxs)(`details`,{open:Rt||void 0,className:`text-sm text-secondary`,children:[(0,G.jsx)(`summary`,{className:`min-h-9 cursor-pointer py-2 text-link pointer-coarse:py-3 max-md:py-3 ${Jd}`,children:`View agent prompt`}),(0,G.jsx)(`textarea`,{"aria-label":`Agent query research prompt`,readOnly:!0,className:`setup-textarea mt-2 w-full`,rows:8,value:Ht})]}),Rt?(0,G.jsx)(`p`,{role:`alert`,className:`text-sm text-negative`,children:`Could not copy. Select and copy the prompt above.`}):null]}),ce?(0,G.jsx)(`div`,{className:`rounded-md border border-default bg-bg-elevated/40 p-4 text-sm text-secondary`,role:`status`,children:`Loading saved queries…`}):E.isError?(0,G.jsxs)(`div`,{className:`compact-stack`,children:[(0,G.jsx)(`div`,{role:`alert`,className:`rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative`,children:`Saved queries could not be loaded. Retry before changing the query basket.`}),(0,G.jsxs)(`div`,{className:`setup-nav`,children:[(0,G.jsx)(U,{type:`button`,variant:`outline`,onClick:m?De:Bn,children:`Back`}),(0,G.jsx)(U,{type:`button`,onClick:()=>{E.refetch()},children:`Retry loading queries`})]})]}):Me?(0,G.jsxs)(`div`,{className:`compact-stack`,children:[(0,G.jsx)(`ul`,{className:`detail-list`,children:Tn.map(e=>(0,G.jsx)(`li`,{children:e},e))}),(0,G.jsxs)(`div`,{className:`setup-nav`,children:[(0,G.jsx)(U,{type:`button`,variant:`outline`,onClick:m?De:Bn,children:`Back`}),(0,G.jsx)(U,{type:`button`,variant:`outline`,onClick:()=>Ne(!1),children:`Edit queries`}),(0,G.jsx)(U,{type:`button`,onClick:()=>Vn(`queries`,m?4:3,Tn.length),children:`Continue`})]})]}):(0,G.jsxs)(`div`,{className:`compact-stack`,children:[Xe.length>0?(0,G.jsxs)(`div`,{className:`compact-stack`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-muted text-xs uppercase tracking-wide`,children:[(0,G.jsx)(`span`,{className:`flex-1 border-t border-base`}),`auto-generate`,(0,G.jsx)(`span`,{className:`flex-1 border-t border-base`})]}),(0,G.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,G.jsxs)(`div`,{className:`setup-field flex-1`,children:[(0,G.jsx)(`label`,{className:`setup-label`,htmlFor:`gen-provider`,children:`Provider`}),(0,G.jsx)(`select`,{id:`gen-provider`,className:`setup-input`,value:bt,onChange:e=>xt(e.target.value),children:Xe.map(e=>(0,G.jsxs)(`option`,{value:e.name,children:[e.displayName??e.name,e.model&&!Je(e.name)?` (${e.model})`:``]},e.name))})]}),(0,G.jsxs)(`div`,{className:`setup-field`,children:[(0,G.jsx)(`label`,{className:`setup-label`,htmlFor:`gen-count`,children:`Count`}),(0,G.jsx)(`select`,{id:`gen-count`,className:`setup-input`,value:St,onChange:e=>Ct(Number(e.target.value)),children:[3,5,10,15,20].map(e=>(0,G.jsx)(`option`,{value:e,children:e},e))})]}),(0,G.jsx)(U,{type:`button`,variant:`outline`,disabled:wt||!bt,onClick:Qn(Pn),children:wt?`Analyzing site...`:`Generate`})]}),Et?(0,G.jsx)(`p`,{className:`text-negative-400 text-sm`,children:Et}):null]}):null,m?null:(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-muted text-xs uppercase tracking-wide`,children:[(0,G.jsx)(`span`,{className:`flex-1 border-t border-base`}),`or type manually`,(0,G.jsx)(`span`,{className:`flex-1 border-t border-base`})]}),(0,G.jsxs)(`div`,{className:`setup-field`,children:[(0,G.jsx)(`label`,{className:`setup-label`,htmlFor:`queries`,children:`Queries (one per line)`}),(0,G.jsx)(`textarea`,{id:`queries`,className:`setup-textarea`,rows:6,placeholder:`emergency dentist brooklyn
42
+ best invisalign downtown brooklyn
43
+ pediatric dentist brooklyn heights`,value:Ae,onChange:e=>je(e.target.value)})]}),Pe?(0,G.jsx)(`p`,{className:`text-negative-400 text-sm`,children:Pe}):null,(0,G.jsxs)(`div`,{className:`setup-nav`,children:[(0,G.jsx)(U,{type:`button`,variant:`outline`,onClick:m?De:Bn,children:`Back`}),(0,G.jsx)(U,{type:`button`,variant:`ghost`,onClick:Hn,children:m?`Finish without AI Visibility`:`Skip for now`}),(0,G.jsx)(U,{type:`button`,disabled:Tn.length===0||Le,onClick:Qn(Nn),children:Le?`Saving...`:`Save ${Tn.length} quer${Tn.length===1?`y`:`ies`}`})]})]})]});case 3:return(0,G.jsxs)(Mr,{className:`surface-card step-card`,children:[(0,G.jsxs)(`div`,{className:`section-head`,children:[(0,G.jsx)(`div`,{children:(0,G.jsx)(`h2`,{children:`Add competitors`})}),V?(0,G.jsx)(bn,{tone:`positive`,children:`Saved`}):null]}),(0,G.jsx)(`p`,{className:`supporting-copy`,children:`Optional. Domains that compete for the same queries, one per line. You can add them later from the project.`}),V?(0,G.jsxs)(`div`,{className:`compact-stack`,children:[(0,G.jsx)(`ul`,{className:`detail-list`,children:En.map(e=>(0,G.jsx)(`li`,{children:e},e))}),(0,G.jsxs)(`div`,{className:`setup-nav`,children:[(0,G.jsx)(U,{type:`button`,variant:`outline`,onClick:Bn,children:`Back`}),(0,G.jsx)(U,{type:`button`,onClick:()=>Vn(`competitors`,4,En.length),children:`Continue`})]})]}):(0,G.jsxs)(`div`,{className:`compact-stack`,children:[(0,G.jsxs)(`div`,{className:`setup-field`,children:[(0,G.jsx)(`label`,{className:`setup-label`,htmlFor:`competitors`,children:`Competitor domains (one per line)`}),(0,G.jsx)(`textarea`,{id:`competitors`,className:`setup-textarea`,rows:4,placeholder:`competitor1.com
44
+ competitor2.com`,value:B,onChange:e=>Wt(e.target.value)})]}),qt?(0,G.jsx)(`p`,{className:`text-negative-400 text-sm`,children:qt}):null,(0,G.jsxs)(`div`,{className:`setup-nav`,children:[(0,G.jsx)(U,{type:`button`,variant:`outline`,onClick:Bn,children:`Back`}),(0,G.jsx)(`div`,{className:`flex gap-2`,children:En.length===0?(0,G.jsx)(U,{type:`button`,onClick:Un,children:`Continue without competitors`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(U,{type:`button`,variant:`outline`,onClick:Un,children:`Skip`}),(0,G.jsx)(U,{type:`button`,disabled:Zt,onClick:Qn(Fn),children:Zt?`Saving...`:`Save ${En.length} competitor${En.length===1?``:`s`}`})]})})]})]})]});case 4:{let e=gn.data,t=e?.status??(dn===te?.id?te.status:void 0),n=t===`completed`||t===`partial`||t===`failed`||t===`cancelled`,r=e?.snapshots??[],i=e?.queryCounts,a=t?Zd(t,r.length):!1,c=k&&!rn,u=ln??(e?.error?qn(e.error):t===`cancelled`?`The check was cancelled before it produced a baseline.`:(t===`completed`||t===`partial`)&&r.length===0?`The check finished without producing any snapshots.`:te?.statusDetail||`The check did not produce a baseline.`),d=null;return c||a?d=(0,G.jsx)(bn,{tone:`positive`,children:`Complete`}):ln&&!rn?d=(0,G.jsx)(bn,{tone:`negative`,children:`Failed`}):n?d=(0,G.jsx)(bn,{tone:`negative`,children:t===`cancelled`?`Cancelled`:`Failed`}):rn&&(d=(0,G.jsx)(bn,{tone:`caution`,children:`Running`})),(0,G.jsxs)(Mr,{className:`surface-card step-card`,children:[(0,G.jsxs)(`div`,{className:`section-head`,children:[(0,G.jsx)(`div`,{children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`h2`,{children:yt()?`AI Visibility`:`Run your first AI Visibility check`}),yt()?null:(0,G.jsx)(Dr,{text:`Asks each AI engine your queries and records whether ${F??`your site`} is mentioned and cited. It uses your provider account. You can also finish now and run it later from the project.`})]})}),d]}),c?(0,G.jsxs)(`div`,{className:`compact-stack`,children:[(0,G.jsxs)(`p`,{className:`text-secondary`,children:[`Setup is complete. `,(0,G.jsx)(`span`,{className:`text-strong font-medium`,children:F}),` already has a successful answer-visibility baseline.`]}),(0,G.jsxs)(`div`,{className:`setup-nav`,children:[(0,G.jsx)(`span`,{}),(0,G.jsx)(U,{type:`button`,onClick:()=>Oe(),children:o?`Finish setup`:`Open project dashboard →`})]})]}):!rn&&yt()?(0,G.jsxs)(`div`,{className:`compact-stack`,children:[F?(0,G.jsx)(Us,{projectName:F}):(0,G.jsx)(`p`,{className:`text-sm text-secondary`,children:Ls}),ln&&(0,G.jsx)(`p`,{role:`alert`,className:`text-sm text-negative`,children:ln}),(0,G.jsxs)(`div`,{className:`setup-nav`,children:[(0,G.jsx)(`span`,{}),(0,G.jsx)(U,{type:`button`,onClick:De,children:`Open project dashboard →`})]})]}):rn?n?a?(0,G.jsxs)(`div`,{className:`compact-stack`,children:[(0,G.jsxs)(`p`,{className:`text-neutral`,children:[`Check complete. Your first AI Visibility snapshot for`,` `,(0,G.jsx)(`span`,{className:`text-heading font-medium`,children:F}),`:`]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 mt-1`,children:[(0,G.jsxs)(`div`,{className:`rounded-md border border-default bg-surface p-3`,children:[(0,G.jsx)(`p`,{className:`text-xs font-medium text-secondary`,children:`Mentioned`}),(0,G.jsx)(`p`,{className:`text-2xl font-bold tabular-nums text-primary mt-1`,children:i?(0,G.jsxs)(G.Fragment,{children:[i.mentionedQueries,(0,G.jsxs)(`span`,{className:`text-faint text-lg`,children:[` / `,i.totalQueries]})]}):`Unavailable`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-sm text-secondary`,children:`queries naming your brand`})]}),(0,G.jsxs)(`div`,{className:`rounded-md border border-default bg-surface p-3`,children:[(0,G.jsx)(`p`,{className:`text-xs font-medium text-secondary`,children:`Cited`}),(0,G.jsx)(`p`,{className:`text-2xl font-bold tabular-nums text-primary mt-1`,children:i?(0,G.jsxs)(G.Fragment,{children:[i.citedQueries,(0,G.jsxs)(`span`,{className:`text-faint text-lg`,children:[` / `,i.totalQueries]})]}):`Unavailable`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-sm text-secondary`,children:`queries citing your site`})]}),(0,G.jsxs)(`div`,{className:`rounded-md border border-default bg-surface p-3`,children:[(0,G.jsx)(`p`,{className:`text-xs font-medium text-secondary`,children:`Results`}),(0,G.jsx)(`p`,{className:`text-2xl font-bold tabular-nums text-primary mt-1`,children:r.length}),(0,G.jsx)(`p`,{className:`mt-0.5 text-sm text-secondary`,children:`completed engine checks`})]})]}),!s&&F?(0,G.jsx)(sd,{projectName:F}):null,(0,G.jsxs)(`div`,{className:`setup-nav`,children:[(0,G.jsx)(`span`,{}),(0,G.jsx)(U,{type:`button`,onClick:()=>Oe(),children:o?`Finish setup`:`Open project dashboard →`})]})]}):(0,G.jsxs)(`div`,{className:`compact-stack`,children:[(0,G.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative`,children:[(0,G.jsx)(`p`,{children:u}),(0,G.jsx)(`p`,{className:`mt-1 text-xs text-secondary`,children:yt()?Ls:l?`Fix provider or query configuration if needed, then retry without leaving setup.`:`Ask an administrator to review the provider and query configuration.`})]}),(0,G.jsxs)(`div`,{className:`setup-nav`,children:[l&&!yt()?(0,G.jsx)(U,{type:`button`,variant:`outline`,asChild:!0,children:(0,G.jsx)(R,{to:`/settings`,children:`Configure providers`})}):(0,G.jsx)(`span`,{}),yt()||!l?(0,G.jsx)(U,{type:`button`,onClick:De,children:`Open project dashboard →`}):(0,G.jsx)(U,{type:`button`,disabled:on||!!kn,onClick:Qn(Rn),children:on?`Retrying…`:`Retry check`})]})]}):(0,G.jsxs)(`div`,{className:`compact-stack`,children:[(0,G.jsx)(`p`,{className:`text-neutral`,children:`Check running. This usually takes 30 to 60 seconds.`}),(0,G.jsx)(`div`,{className:`rounded-md border border-default bg-surface p-3 text-xs text-muted`,children:(0,G.jsxs)(`p`,{children:[`Status: `,(0,G.jsx)(`span`,{className:`text-neutral`,children:t??`queued`})]})}),gn.isError&&(0,G.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative`,children:[(0,G.jsx)(`p`,{children:gn.error instanceof Error?gn.error.message:`Could not refresh the check status.`}),(0,G.jsx)(U,{type:`button`,variant:`outline`,size:`sm`,className:`mt-2`,onClick:()=>{gn.refetch()},children:`Retry status check`})]}),(0,G.jsxs)(`div`,{className:`setup-nav`,children:[(0,G.jsx)(`span`,{}),(0,G.jsx)(U,{type:`button`,variant:`outline`,onClick:o?()=>Oe():De,children:o?`Finish setup`:`Watch on project page`})]})]}):(0,G.jsxs)(`div`,{className:`compact-stack`,children:[(0,G.jsxs)(`p`,{className:`text-sm text-secondary`,children:[(0,G.jsx)(`span`,{className:`font-mono tabular-nums text-heading`,children:Tn.length}),` `,Tn.length===1?`query`:`queries`,vt>0?(0,G.jsxs)(G.Fragment,{children:[` · `,(0,G.jsx)(`span`,{className:`font-mono tabular-nums text-heading`,children:vt}),` `,vt===1?`engine`:`engines`]}):null]}),(kn||ln)&&(0,G.jsx)(`div`,{role:`alert`,className:`rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative`,children:(0,G.jsx)(`p`,{children:ln??kn})}),(0,G.jsxs)(`div`,{className:`setup-nav`,children:[(0,G.jsx)(U,{type:`button`,variant:`outline`,onClick:Bn,children:`Back`}),(0,G.jsx)(U,{type:`button`,variant:`ghost`,onClick:ke,children:`Finish without running`}),On===`no_provider`&&!m?(0,G.jsx)(U,{type:`button`,asChild:!0,children:(0,G.jsx)(R,{to:`/settings`,children:`Configure a provider`})}):(0,G.jsx)(U,{type:`button`,disabled:on||!!kn,title:kn,onClick:Qn(Rn),children:on?`Starting…`:ln?`Retry check`:`Run check`})]})]})]})}default:return null}})();return(0,G.jsxs)(`div`,{className:m?`page-container visibility-setup`:`page-container`,children:[o?(0,G.jsx)(ad,{current:`visibility`,outcomes:{site:T,fixes:T}}):null,(0,G.jsxs)(`div`,{className:`page-header`,children:[(0,G.jsxs)(`div`,{className:`page-header-left`,children:[(0,G.jsx)(`h1`,{ref:i?a:void 0,tabIndex:i?-1:void 0,className:`page-title outline-none`,children:i?`Set up AI Visibility`:`Setup`}),(0,G.jsx)(`p`,{className:`page-subtitle`,children:i?`Connect an AI engine, then choose queries for your first check.`:`Create a project and run its first visibility check.`})]}),o?(0,G.jsx)(`div`,{className:`page-header-right`,children:(0,G.jsx)(U,{type:`button`,variant:`outline`,className:Jd,onClick:ke,children:`Skip AI Visibility`})}):null]}),o?null:(0,G.jsx)(tf,{current:m?+(oe===4):oe,labels:m?Xd:Yd}),(0,G.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-2 text-[13px] text-secondary`,children:[(0,G.jsx)(`p`,{children:`Draft fields use tab storage when available. Credentials are excluded from drafts.`}),(0,G.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,disabled:!!C&&!E.isSuccess||L||Le||Zt||on,onClick:en,children:`Reset unsaved fields`})]}),(0,G.jsxs)(`section`,{className:`setup-wizard`,children:[Jn,oe===4&&!rn&&l&&f&&xe&&!mt&&(0,G.jsx)(Dd,{project:xe,onSave:Ln}),Yn]})]})}var of=`modulepreload`,sf=function(e,t){return new URL(e,t).href},cf={},lf=function(e){return e.pathname.endsWith(`.css`)},uf=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},df=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=sf(t,n);let r=s(t),i=lf(r);return uf(cf,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:of,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ff=(0,W.lazy)(async()=>({default:(await df(()=>import(`./SiteHealthSection-DEwB7O4i.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url)).SiteHealthSection})),pf=`Public pages only, crawled from this computer and stored locally. The first scan reads up to 100 pages, then stops.`,mf=1800,hf=`https://github.com/Canonry/canonry#or-use-any-shell-capable-coding-agent`,gf=`Use the official Canonry docs:
45
+ - Agent quickstart: https://github.com/Canonry/canonry#or-use-any-shell-capable-coding-agent
46
+ - CLI reference: https://github.com/Canonry/canonry/blob/main/skills/canonry/references/canonry-cli.md
47
+ - Plugin setup: https://github.com/Canonry/canonry/blob/main/docs/plugins.md
48
+ - MCP setup: https://github.com/Canonry/canonry/blob/main/docs/mcp.md
49
+
50
+ `,_f=`Help me set up Canonry for my public site.
51
+
52
+ ${gf}Pick one path and stay on it. Use connected Canonry tools (plugin or MCP) only if you have them and I have not pointed you at a specific install. A connected tool runs in its own process and never sees \`CANONRY_CONFIG_DIR\`, \`CANONRY_PORT\`, or anything else you export in a shell, so it always acts on my default install. If I named a config directory, a port, or a sandbox, that is the shell path: use \`cnry\` and tell me which path you chose. Never mix the two in one run, and never create a duplicate project. The \`cnry\` and \`canonry\` commands are interchangeable.
53
+
54
+ 1. Ask for my public domain, country, and language. Do not create or scan anything yet. Country and language are only applied when a project is created, so if you reuse an existing project, report its country and language instead of changing them.
55
+ 2. Shell path only: confirm \`cnry\` is on PATH, then run \`cnry --version\`. If Canonry is missing, propose \`npm install -g @canonry/canonry\` and wait for approval. Then run \`cnry doctor --format json\`, which is the command that says whether config, database, and server are in place. \`cnry --version\` does not read config and succeeds on a completely unconfigured install, so it cannot answer this. If config is missing, run \`cnry bootstrap\` yourself: it is not interactive, takes about a second, and is safe to rerun. Do not hand it to me and wait. The interactive command is \`cnry init\`, which is optional provider and OAuth setup that Page Health does not need. Bootstrap prints an API key, so do not repeat its output back to me, and never ask me to paste passwords, API keys, OAuth credentials, or command output.
56
+ 3. Confirm the API is reachable. \`cnry doctor --format json\` reports it, and any project read exits non-zero with \`CONNECTION_ERROR\` when it is not. If it is unreachable, propose \`cnry start\` and wait for approval. Use \`cnry start\`, which is the background daemon, and not \`cnry serve\`, which runs in the foreground and will block you until I stop it, even though some error messages suggest it. Stop anything you started with \`cnry stop\`.
57
+ 4. List projects with the connected project tool or \`cnry project list --format json\`, and reuse one whose domain matches. Confirm the proposed name is not already assigned to a different domain. To find out whether a project has already been scanned, run \`cnry technical-aeo score <project> --format json\` with no \`--run-id\`, which reports the latest run. Read the \`hasData\` field, not the score: this command exits 0 and reports \`aggregateScore: 0\` for a project that has never been scanned, so reading the score alone would have you tell me my site scored zero. If \`hasData\` is true and \`runStatus\` is \`completed\` or \`partial\`, read that scan instead of starting a new one. If no project matches, show the exact create operation and wait for approval.
58
+ 5. Propose a bounded Site Health scan: \`--max-pages 100\` for a first look, plus whether dead-link checking is on (it is off unless you pass \`--check-dead-links\`). Show the connected operation or the exact \`cnry technical-aeo run <project> --max-pages 100 --wait --format json\` command with the project name filled in, and wait for separate approval before scanning. \`--wait\` polls for up to 15 minutes and returns only the run id and status. If the status it returns is still \`queued\` or \`running\`, the scan has not finished: do not rerun it or report results, poll \`cnry technical-aeo progress <project> --run-id <run-id> --format json\` until it is terminal. If \`--wait\` outruns your own tool timeout first, recover the run id with \`cnry technical-aeo score <project> --format json\` and poll the same way.
59
+ 6. When the run is \`completed\` or \`partial\`, read \`cnry technical-aeo crawl <project> --run-id <run-id> --format json\` first. It is the only one of these commands that carries \`termination\` and \`complete\`; the score and pages commands do not. Then read \`cnry technical-aeo score <project> --run-id <run-id> --format json\` and \`cnry technical-aeo pages <project> --run-id <run-id> --sort score-asc --limit 10 --format jsonl\`. Tell me the termination reason in plain words and whether the scan covered the whole site or stopped at a page, link, depth, or time limit. A \`partial\` run scored the pages it reached and not my site, so never present it as a full-site result. If it stopped early, the fix depends on the reason, so say which: a page or depth limit needs a larger budget, a time limit needs a smaller scan (a lower \`--max-pages\` or \`--max-depth\`). If the run failed or was cancelled, inspect the run error and stop.
60
+ 7. Summarize only completed evidence, then propose AI Visibility setup. Ask before you add queries, connect providers, start a provider-backed or quota-consuming run, edit files, or publish.`;function vf(e,t){return e===`legacy`?`legacy`:e===`platform`?`platform`:t.state===`success`?t.projectCount===0?`platform`:`legacy`:t.state===`error`?`retry`:`loading`}var yf=`pointer-coarse:min-h-11 max-md:min-h-11`,bf=`2000-01-01T00:00:00.000Z`,xf=5e3;function Sf(e,t){let n=new Set,r=new Map;for(let e of t)e.trigger!==un.probe&&(r.has(e.projectId)||r.set(e.projectId,e.id),(e.status===V.completed||e.status===V.partial)&&n.add(e.projectId));let i=(e.every(e=>e.createdAt)?[...e].sort((e,t)=>(e.createdAt??``).localeCompare(t.createdAt??``)||e.name.localeCompare(t.name)):e).find(e=>!n.has(e.id));return i?{projectName:i.name,runId:r.get(i.id)}:null}var Cf=[{value:`US`,label:`United States`},{value:`CA`,label:`Canada`},{value:`GB`,label:`United Kingdom`},{value:`AU`,label:`Australia`},{value:`NZ`,label:`New Zealand`},{value:`IE`,label:`Ireland`},{value:`DE`,label:`Germany`},{value:`FR`,label:`France`},{value:`ES`,label:`Spain`},{value:`IT`,label:`Italy`},{value:`NL`,label:`Netherlands`},{value:`BR`,label:`Brazil`},{value:`MX`,label:`Mexico`},{value:`IN`,label:`India`},{value:`SG`,label:`Singapore`},{value:`JP`,label:`Japan`}],wf=[{value:`en`,label:`English`},{value:`es`,label:`Spanish`},{value:`fr`,label:`French`},{value:`de`,label:`German`},{value:`it`,label:`Italian`},{value:`pt`,label:`Portuguese`},{value:`nl`,label:`Dutch`},{value:`ja`,label:`Japanese`}];function Tf(e,t){try{let n=new Intl.DisplayNames([`en`],{type:`region`}),r=new Intl.DisplayNames([`en`],{type:`language`}),i=e.length===2?n.of(e.toUpperCase()):void 0,a=t?r.of(t.toLowerCase()):void 0;return`${i??(e||`Country`)} · ${a??(t||`Language`)}`}catch{return`${e||`Country`} · ${t||`Language`}`}}function Ef(e,t){let n=e.trim().toUpperCase(),r=t.trim().toLowerCase();return{countryValid:Cf.some(e=>e.value===n),languageValid:wf.some(e=>e.value===r)}}function Df(e){let t=e.replace(/^\[|\]$/g,``);return/^(?:\d{1,3}\.){3}\d{1,3}$/.test(t)||t.includes(`:`)}function Of(e){let t=e.trim();if(!t)return null;let n=/^[a-z][a-z\d+.-]*:\/\//i.test(t)?t:`https://${t}`,r;try{r=new URL(n)}catch{return null}if(r.protocol!==`http:`&&r.protocol!==`https:`)return null;let i=r.hostname.toLowerCase().replace(/^www\./,``);if(!i||i===`localhost`||Df(i)||!i.includes(`.`))return null;let a=i.replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``);return a?{canonicalDomain:i,projectName:a,displayName:i}:null}async function kf(e,t=mf){let n,r=new Promise(e=>{n=setTimeout(()=>e({state:`timed-out`}),t)}),i=await Promise.race([e.then(e=>({state:`queued`,run:e})),r]);return n&&clearTimeout(n),i}function Af(e,t){e.catch(()=>{tr({title:`Site Health scan did not start`,detail:`The project is safe. Choose Run scan in Site Health to retry.`,tone:`negative`,dedupeKey:`site-health-dispatch:${t}`})})}function jf(e){let t=(0,W.useRef)(Xt()).current,n=(0,W.useRef)(new Set);return{onboardingSessionId:t,emit:(0,W.useCallback)((t,r)=>{if(r){if(n.current.has(r))return;n.current.add(r)}Qt({...t,surface:e,eventId:Fe()})},[e])}}function Mf(e,t){return e instanceof Lt&&e.statusCode===409?`A project with this name already exists. Change the project name, or open the existing project.`:e instanceof Error&&e.message?e.message:t}function Nf(){return(0,G.jsxs)(`div`,{className:`page-container max-w-3xl`,"aria-busy":`true`,"aria-live":`polite`,children:[(0,G.jsx)(`div`,{className:`page-header`,children:(0,G.jsxs)(`div`,{className:`page-header-left`,children:[(0,G.jsx)(`h1`,{className:`page-title`,children:`Preparing setup`}),(0,G.jsx)(`p`,{className:`page-subtitle`,children:`Checking the projects already on this install.`})]})}),(0,G.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border border-default bg-surface p-4 text-sm text-secondary`,role:`status`,children:[(0,G.jsx)(O,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),`Loading projects…`]})]})}function Pf({onRetry:e}){return(0,G.jsxs)(`div`,{className:`page-container max-w-3xl`,children:[(0,G.jsx)(`div`,{className:`page-header`,children:(0,G.jsxs)(`div`,{className:`page-header-left`,children:[(0,G.jsx)(`h1`,{className:`page-title`,children:`Can’t load projects`}),(0,G.jsx)(`p`,{className:`page-subtitle`,children:`Canonry could not confirm whether this install already has a project.`})]})}),(0,G.jsxs)(`div`,{className:`rounded-lg border border-negative bg-negative-soft p-4`,role:`alert`,tabIndex:-1,children:[(0,G.jsx)(`p`,{className:`text-sm font-medium text-heading`,children:`Setup is paused to protect existing projects.`}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-secondary`,children:`Check the connection or sign in again, then retry.`}),(0,G.jsx)(U,{type:`button`,className:`mt-4`,variant:`secondary`,onClick:e,children:`Retry project check`})]})]})}function Ff({projectName:e,initialRunId:t}){return(0,G.jsx)(bl,{title:`Site Health setup`,children:(0,G.jsx)(If,{projectName:e,initialRunId:t})})}function If({projectName:e,initialRunId:t}){let n=Se(),r=I({...fr({client:H}),enabled:!!e,retry:!1,refetchOnMount:`always`}),{onboardingSessionId:i,emit:a}=jf(`site_health`),[o]=(0,W.useState)(()=>st(t));(0,W.useEffect)(()=>{o&&$t()},[o]),(0,W.useEffect)(()=>{e&&a({flowVersion:1,onboardingSessionId:i,event:`onboarding.started`,step:`run`,resumed:!!t&&!o},`onboarding.started`)},[a,o,t,i,e]),(0,W.useEffect)(()=>{e&&t&&Re(e)?.runId!==t&&Qe(e,t)},[t,e]);let s=I({...ur({client:H,path:{id:t??``}}),enabled:!!t,refetchInterval:({state:e})=>{let t=e.data?.status;return t===`completed`||t===`partial`||t===`failed`||t===`cancelled`?!1:2e3},refetchIntervalInBackground:!0}).data?.status;if((0,W.useEffect)(()=>{if(!e||!t||!s)return;if(s===`completed`||s===`partial`){a({flowVersion:1,onboardingSessionId:i,event:`onboarding.step_completed`,step:`run`,method:`automatic`},`onboarding.step_completed:run`),Ye(t);return}if(s!==`failed`&&s!==`cancelled`)return;let n=s===`cancelled`?`run_cancelled`:`run_failed`;a({flowVersion:1,onboardingSessionId:i,event:`onboarding.blocked`,step:`run`,action:`retry_run`,reasonCode:n},`onboarding.blocked:run:${n}`),Ye(t)},[a,t,i,e,s]),!e)return(0,G.jsxs)(`div`,{className:`page-container max-w-3xl`,children:[(0,G.jsx)(`div`,{className:`page-header`,children:(0,G.jsxs)(`div`,{className:`page-header-left`,children:[(0,G.jsx)(`h1`,{className:`page-title`,children:`Project not found`}),(0,G.jsx)(`p`,{className:`page-subtitle`,children:`This setup link does not identify a project.`})]})}),(0,G.jsx)(U,{type:`button`,variant:`secondary`,onClick:()=>{n({to:`/projects`})},children:`View projects`})]});if(r.isPending)return(0,G.jsxs)(`div`,{className:`page-container max-w-3xl`,"aria-busy":`true`,"aria-live":`polite`,children:[(0,G.jsx)(ad,{current:`site`}),(0,G.jsxs)(`div`,{className:`mt-8 flex items-center gap-3 text-sm text-secondary`,role:`status`,children:[(0,G.jsx)(O,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),`Loading Site Health setup…`]})]});if(r.isError)return(0,G.jsxs)(`div`,{className:`page-container max-w-3xl`,children:[(0,G.jsx)(`div`,{className:`page-header`,children:(0,G.jsxs)(`div`,{className:`page-header-left`,children:[(0,G.jsx)(`h1`,{className:`page-title`,children:`Can’t resume setup`}),(0,G.jsx)(`p`,{className:`page-subtitle`,children:`Canonry could not load the project for this Site Health scan.`})]})}),(0,G.jsxs)(`div`,{className:`rounded-lg border border-negative bg-negative-soft p-4`,role:`alert`,children:[(0,G.jsx)(`p`,{className:`text-sm text-secondary`,children:`Check the connection or sign in again, then retry.`}),(0,G.jsx)(U,{type:`button`,className:`mt-4`,variant:`secondary`,onClick:()=>{r.refetch()},children:`Retry project check`})]})]});let c=r.data.find(t=>t.name===e);return c?(0,G.jsxs)(`div`,{className:`page-container max-w-7xl py-8 md:py-10`,children:[(0,G.jsx)(`h1`,{className:`sr-only`,children:`Set up Canonry`}),(0,G.jsx)(W.Suspense,{fallback:(0,G.jsxs)(`div`,{className:`space-y-5`,children:[(0,G.jsx)(ad,{current:`site`}),(0,G.jsxs)(`div`,{className:`flex min-h-72 items-center justify-center gap-3 text-sm text-secondary`,role:`status`,children:[(0,G.jsx)(O,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),`Loading Site Health…`]})]}),children:(0,G.jsx)(ff,{projectName:c.name,projectId:c.id,initialRunId:t,onReleaseInitialRun:()=>{n({to:`/setup`,search:{onboarding:`site-health`,setupProject:c.name},replace:!0})},showOnboardingActions:!0,onContinueOnboarding:()=>{t||Hu(c.name),n({to:`/setup`,search:{experience:`legacy`,onboarding:`site-health`,setupProject:c.name},replace:!0})},onSkipOnboarding:()=>{t||Hu(c.name),a({flowVersion:1,onboardingSessionId:i,event:`onboarding.step_completed`,step:`run`,method:`skipped`},`onboarding.step_completed:run`),n({to:`/setup`,search:{onboarding:`complete`,setupProject:c.name,skipped:`visibility`},replace:!0})}})})]}):(0,G.jsxs)(`div`,{className:`page-container max-w-3xl`,children:[(0,G.jsx)(`div`,{className:`page-header`,children:(0,G.jsxs)(`div`,{className:`page-header-left`,children:[(0,G.jsx)(`h1`,{className:`page-title`,children:`Project not found`}),(0,G.jsxs)(`p`,{className:`page-subtitle`,children:[`Canonry could not find `,e,`. It will not open a different project.`]})]})}),(0,G.jsx)(U,{type:`button`,variant:`secondary`,onClick:()=>{n({to:`/projects`})},children:`View projects`})]})}function Lf(){let e=Ce({from:`/setup`}),t=e.onboarding===`site-health`&&!e.setupProject,n=e.onboarding===`site-health`&&e.experience!==`legacy`,r=ln(),i=e.experience===`legacy`?`legacy`:e.experience===`platform`?`platform`:r,[a,o]=(0,W.useState)(!1),[s,c]=(0,W.useState)(void 0),l=I({...fr({client:H}),enabled:i===`auto`,retry:!1,refetchOnMount:`always`}),u=I({...lr({client:H,query:{kind:z[`site-audit`],since:bf,limit:xf}}),enabled:i===`auto`,retry:!1,refetchOnMount:`always`}),d=i===`auto`&&l.isSuccess&&l.isFetchedAfterMount&&l.data.length===0;(0,W.useEffect)(()=>{d&&o(!0)},[d]);let f=i===`auto`?l.isSuccess&&l.isFetchedAfterMount?{state:`success`,projectCount:l.data.length}:l.isError?{state:`error`}:{state:`loading`}:{state:`idle`},p=i===`legacy`?`legacy`:a||d?`platform`:vf(i,f);if(e.onboarding===`complete`&&e.setupProject)return(0,G.jsx)(Id,{projectName:e.setupProject,skippedVisibility:e.skipped===`visibility`});if(t||n)return(0,G.jsx)(Ff,{projectName:e.setupProject,initialRunId:e.siteHealthRunId});let m=i===`auto`&&p===`legacy`&&!e.setupProject&&l.isSuccess;if(m&&s===void 0)return u.isError?c(null):u.isSuccess&&u.isFetchedAfterMount&&c(Sf(l.data,u.data)),(0,G.jsx)(Nf,{});let h=m?s:null;return h?(0,G.jsx)(Rf,{projectName:h.projectName,runId:h.runId}):p===`legacy`?(0,G.jsx)(nf,{visibilityProjectName:e.setupProject,siteHealthOnboarding:e.onboarding===`site-health`,onboardingFinish:e.onboarding===`site-health`||e.onboarding===`first-run`}):p===`loading`?(0,G.jsx)(Nf,{}):p===`retry`?(0,G.jsx)(Pf,{onRetry:()=>{l.refetch()}}):(0,G.jsx)(zf,{onActivationStarted:()=>o(!0),skipSiteScan:e.siteScan===`skip`})}function Rf({projectName:e,runId:t}){let n=Se();return(0,W.useEffect)(()=>{n({to:`/setup`,search:{onboarding:`site-health`,setupProject:e,...t?{siteHealthRunId:t}:{}},replace:!0})},[n,e,t]),(0,G.jsx)(Nf,{})}function zf({onActivationStarted:e,skipSiteScan:t}){return(0,G.jsx)(bl,{title:`Site Health setup`,children:(0,G.jsx)(Bf,{onActivationStarted:e,skipSiteScan:t})})}function Bf({onActivationStarted:e,skipSiteScan:t}){let n=Se(),r=ve(),i=Qu(),a=I({...br({client:H}),retry:!1}),c=F(dr()),[u]=(0,W.useState)(()=>zu(`platform`)),[d,f]=(0,W.useState)(u.domain??``),[p,m]=(0,W.useState)(u.projectName??``),[g,_]=(0,W.useState)(u.displayName??``),[v,y]=(0,W.useState)(u.country??`US`),[b,x]=(0,W.useState)(u.language??`en`),[S,C]=(0,W.useState)(!1),[w,T]=(0,W.useState)(`idle`),[E,D]=(0,W.useState)(null),[ee,te]=(0,W.useState)(null),[k,A]=(0,W.useState)(!1),[ne,re]=(0,W.useState)(null),[ie,ae]=(0,W.useState)(!1),oe=jt(),j=Ft(),M=a.isError?void 0:a.data,se=typeof M?.enabled==`boolean`?M.enabled:null,ce=c.isPending?c.variables.body.enabled:se,[le,ue]=(0,W.useState)(null),de=(0,W.useRef)(null),{onboardingSessionId:fe,emit:pe}=jf(`platform`);(0,W.useEffect)(()=>{pe({flowVersion:1,onboardingSessionId:fe,event:`onboarding.started`,step:`project`,resumed:!1},`onboarding.started`)},[pe,fe]),(0,W.useEffect)(()=>{E||Bu(`platform`,{domain:d,projectName:p,displayName:g,country:v,language:b})},[E,d,p,g,v,b]);let me=()=>{Vu(`platform`),f(``),m(``),_(``),y(`US`),x(`en`),C(!1),te(null),A(!1)},he=Of(d),ge=p||he?.projectName||``,N=g||he?.displayName||``,P=w===`creating`||w===`dispatching`,_e=ee??ne,ye=Tf(v,b),{countryValid:be,languageValid:xe}=Ef(v,b),Ce=be&&xe;(0,W.useEffect)(()=>{_e&&de.current?.focus()},[_e]);let we=(e,t)=>n({to:`/setup`,search:{...t?{siteHealthRunId:t}:{},onboarding:`site-health`,setupProject:e.name},replace:!0}),Te=async e=>{T(`dispatching`),re(null);try{let t=i.mutateAsync({projectName:e.name,projectId:e.id,projectLabel:e.displayName||e.name,suppressErrorToast:!0,body:{checkDeadLinks:!0,maxPages:100}}),n=await kf(t);if(n.state===`queued`){pe({flowVersion:1,onboardingSessionId:fe,event:`run.requested`,origin:`dashboard_setup`,result:`queued`,kind:`site_health`,providerCountBucket:`0`,queryCountBucket:`0`}),ft(n.run.runId),await we(e,n.run.runId);return}t.then(()=>{pe({flowVersion:1,onboardingSessionId:fe,event:`run.requested`,origin:`dashboard_setup`,result:`queued`,kind:`site_health`,providerCountBucket:`0`,queryCountBucket:`0`})},e=>{pe({flowVersion:1,onboardingSessionId:fe,event:`run.requested`,origin:`dashboard_setup`,result:`rejected`,kind:`site_health`,providerCountBucket:`0`,queryCountBucket:`0`,reasonCode:at(e,`run_rejected`)})}),Af(t,e.id),await we(e)}catch(e){T(`recovery`),re(Mf(e,`The project was created, but the Site Health scan could not be started.`));let t=at(e,`run_rejected`);pe({flowVersion:1,onboardingSessionId:fe,event:`run.requested`,origin:`dashboard_setup`,result:`rejected`,kind:`site_health`,providerCountBucket:`0`,queryCountBucket:`0`,reasonCode:t}),pe({flowVersion:1,onboardingSessionId:fe,event:`onboarding.blocked`,step:`run`,action:`retry_run`,reasonCode:t},`onboarding.blocked:run:${t}`)}},L=async i=>{if(i.preventDefault(),he&&(t||S)&&Ce&&!P){T(`creating`),te(null),A(!1),re(null);try{let i=await bt({name:ge,displayName:N,canonicalDomain:he.canonicalDomain,country:v,language:b});if(e(),D(i),Vu(`platform`),pe({flowVersion:1,onboardingSessionId:fe,event:`onboarding.step_completed`,step:`project`,method:`manual`},`onboarding.step_completed:project`),await r.invalidateQueries({queryKey:pr({client:H})}),t){Hu(i.name),await n({to:`/setup`,search:{experience:`legacy`,onboarding:`first-run`,setupProject:i.name},replace:!0});return}await Te(i)}catch(t){T(`idle`);let n=t instanceof Lt&&t.statusCode===409;A(n),te(Mf(t,`Could not create the project. Try again.`)),pe({flowVersion:1,onboardingSessionId:fe,event:`onboarding.blocked`,step:`project`,action:`save`,reasonCode:at(t,`project_create_failed`)},`onboarding.blocked:project`),n&&(e(),r.invalidateQueries({queryKey:pr({client:H})}))}}},Ee=()=>{E&&!P&&Te(E)},De=()=>{P||n({to:`/projects`})},Oe=async()=>{try{await navigator.clipboard.writeText(j?_f:_f.replace(gf,``)),ae(!0)}catch{tr({tone:`negative`,title:`Could not copy setup request`,detail:j?`Open the agent quickstart to continue with the CLI instead.`:`Check your browser’s clipboard permission and try again.`})}},ke=async e=>{ue(null);try{let t=await c.mutateAsync({client:H,body:{enabled:e}});r.setQueryData(Cr({client:H}),t),t.enabled!==e&&ue(`The server kept telemetry ${t.enabled?`on`:`off`}. Check its telemetry settings.`)}catch{ue(`Could not update telemetry. Try again.`)}};return E&&w===`recovery`?(0,G.jsxs)(`div`,{className:`page-container max-w-3xl`,children:[(0,G.jsx)(ad,{current:`site`}),(0,G.jsx)(`div`,{className:`page-header mt-8`,children:(0,G.jsxs)(`div`,{className:`page-header-left`,children:[(0,G.jsx)(`h1`,{className:`page-title`,children:`Project created`}),(0,G.jsxs)(`p`,{className:`page-subtitle`,children:[E.displayName||E.name,` is ready. The Site Health scan needs another try.`]})]})}),(0,G.jsxs)(`div`,{ref:de,className:`rounded-lg border border-negative bg-negative-soft p-4`,role:`alert`,tabIndex:-1,children:[(0,G.jsx)(`p`,{className:`text-sm font-medium text-heading`,children:ne}),(0,G.jsx)(`p`,{className:`mt-1 text-sm text-secondary`,children:`You can retry the scan or continue setup and retry from Site Health.`}),(0,G.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-3`,children:[(0,G.jsx)(U,{type:`button`,onClick:Ee,children:`Retry Site Health scan`}),(0,G.jsx)(U,{type:`button`,variant:`secondary`,onClick:()=>{we(E)},children:`Continue setup`})]})]})]}):(0,G.jsxs)(`div`,{className:`page-container max-w-xl py-8 md:py-12`,children:[t?null:(0,G.jsx)(ad,{current:`site`}),(0,G.jsxs)(`header`,{className:`mb-8 ${t?``:`mt-8`}`,children:[(0,G.jsx)(`h1`,{id:`site-map-setup-title`,className:`text-2xl font-semibold tracking-[-0.025em] text-heading`,children:t?`Create a project`:`Scan your site`}),(0,G.jsx)(`p`,{className:`mt-2 max-w-lg text-sm leading-6 text-secondary`,children:t?`Add a public domain, then choose the queries you want to track. No site scan will run.`:`Enter your public website to see its pages, structure, internal links, and Technical AEO scores.`})]}),(0,G.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-2 text-[13px] text-secondary`,children:[(0,G.jsx)(`p`,{children:`Draft fields use tab storage when available. Scan permission resets on reload.`}),(0,G.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,disabled:P,onClick:me,children:`Reset draft`})]}),(0,G.jsxs)(`form`,{"aria-labelledby":`site-map-setup-title`,className:`space-y-6`,onSubmit:Qn(L),noValidate:!0,children:[(0,G.jsxs)(`div`,{className:`grid gap-2`,children:[(0,G.jsx)(`label`,{className:`text-sm font-medium text-heading`,htmlFor:`launchpad-domain`,children:`Website URL`}),(0,G.jsx)(`input`,{id:`launchpad-domain`,className:`h-10 w-full rounded-md border border-strong bg-bg-elevated/50 px-3 text-base text-heading outline-none transition placeholder:text-muted focus:border-mono-500 focus:ring-1 focus:ring-mono-500 md:h-9 md:text-sm ${yf}`,type:`text`,inputMode:`url`,autoComplete:`url`,autoCapitalize:`none`,spellCheck:!1,required:!0,"aria-invalid":!(!d||he),"aria-describedby":d&&!he?`launchpad-domain-hint launchpad-domain-error`:`launchpad-domain-hint`,placeholder:`https://example.com`,value:d,onChange:e=>{f(e.target.value),te(null),A(!1)}}),(0,G.jsx)(`p`,{id:`launchpad-domain-hint`,className:`text-sm text-secondary`,children:t?(0,G.jsxs)(G.Fragment,{children:[`A public domain is still required.`,` `,(0,G.jsx)(R,{to:`/setup`,search:{experience:`platform`},className:`font-medium text-link underline-offset-4 hover:underline`,children:`Map with Site Health instead`})]}):(0,G.jsxs)(G.Fragment,{children:[`Only public pages are scanned.`,` `,(0,G.jsx)(R,{to:`/setup`,search:{experience:`platform`,onboarding:`first-run`,siteScan:`skip`},className:`font-medium text-link underline-offset-4 hover:underline`,children:`Set up without a site scan`})]})}),d&&!he?(0,G.jsx)(`p`,{id:`launchpad-domain-error`,className:`text-sm text-negative`,role:`alert`,children:`Enter a public domain, such as example.com.`}):null]}),(0,G.jsxs)(`details`,{className:`group border-y border-default`,children:[(0,G.jsxs)(`summary`,{className:`flex min-h-9 cursor-pointer list-none items-center justify-between gap-4 py-2 text-sm [&::-webkit-details-marker]:hidden ${yf}`,children:[(0,G.jsx)(`span`,{className:`font-medium text-heading`,children:`Project name and locale`}),(0,G.jsxs)(`span`,{className:`flex items-center gap-2 text-secondary`,children:[ye,(0,G.jsx)(o,{className:`size-4 transition-transform group-open:rotate-180 motion-reduce:transition-none`,"aria-hidden":`true`})]})]}),(0,G.jsxs)(`div`,{className:`space-y-5 border-t border-default py-4`,children:[he?(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`mb-3 text-sm font-medium text-heading`,children:`Project`}),(0,G.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,G.jsxs)(`div`,{className:`grid gap-2`,children:[(0,G.jsx)(`label`,{className:`text-sm text-secondary`,htmlFor:`launchpad-project-name`,children:`Project name`}),(0,G.jsx)(`input`,{id:`launchpad-project-name`,className:`setup-input h-10`,type:`text`,value:ge,onChange:e=>m(e.target.value)})]}),(0,G.jsxs)(`div`,{className:`grid gap-2`,children:[(0,G.jsx)(`label`,{className:`text-sm text-secondary`,htmlFor:`launchpad-display-name`,children:`Display name`}),(0,G.jsx)(`input`,{id:`launchpad-display-name`,className:`setup-input h-10`,type:`text`,value:N,onChange:e=>_(e.target.value)})]})]})]}):null,(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`p`,{className:`mb-3 text-sm font-medium text-heading`,children:`Locale`}),(0,G.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,G.jsxs)(`div`,{className:`grid gap-2`,children:[(0,G.jsx)(`label`,{className:`text-sm text-secondary`,htmlFor:`launchpad-country`,children:`Country`}),(0,G.jsx)(`select`,{id:`launchpad-country`,className:`setup-input h-10`,value:v,onChange:e=>y(e.target.value),children:Cf.map(e=>(0,G.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),(0,G.jsxs)(`div`,{className:`grid gap-2`,children:[(0,G.jsx)(`label`,{className:`text-sm text-secondary`,htmlFor:`launchpad-language`,children:`Language`}),(0,G.jsx)(`select`,{id:`launchpad-language`,className:`setup-input h-10`,value:b,onChange:e=>x(e.target.value),children:wf.map(e=>(0,G.jsx)(`option`,{value:e.value,children:e.label},e.value))})]})]})]})]})]}),t?null:(0,G.jsxs)(`p`,{className:`text-sm text-secondary`,children:[`First scan: up to `,100,` pages. A limited scan describes the pages reached, not the whole site.`]}),t?null:(0,G.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-start gap-3 py-2`,children:[(0,G.jsx)(`input`,{className:`mt-0.5 size-4 shrink-0 rounded border-strong bg-bg`,type:`checkbox`,checked:S,onChange:e=>C(e.target.checked),"aria-label":`Allow Canonry to scan this public site.`}),(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-sm leading-5 text-heading`,children:`Allow Canonry to scan this public site.`}),(0,G.jsx)(Dr,{text:pf})]})]}),_e?(0,G.jsxs)(`div`,{ref:de,className:`rounded-md border border-negative bg-negative-soft p-3`,role:`alert`,tabIndex:-1,children:[(0,G.jsx)(`p`,{className:`text-sm font-medium text-heading`,children:_e}),k?(0,G.jsx)(U,{type:`button`,variant:`secondary`,size:`sm`,className:`mt-3`,onClick:De,children:`View projects`}):null]}):null,(0,G.jsxs)(`div`,{className:`grid gap-2`,children:[(0,G.jsx)(U,{className:`w-full ${yf}`,type:`submit`,disabled:!he||!t&&!S||!Ce||P,children:w===`creating`||w===`dispatching`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(O,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),` `,t?`Creating project…`:`Mapping site…`]}):t?`Create project`:`Scan site`}),w===`dispatching`?(0,G.jsx)(`span`,{className:`text-center text-sm text-secondary`,role:`status`,children:`Opening Site Health when the scan is ready.`}):null]})]}),(0,G.jsxs)(`section`,{className:`mt-8 border-t border-default pt-6`,"aria-labelledby":`agent-setup-title`,children:[(0,G.jsx)(`p`,{id:`agent-setup-title`,className:`text-sm font-medium text-heading`,children:`Use your agent instead`}),(0,G.jsx)(`p`,{className:`mt-1 text-sm leading-5 text-secondary`,children:oe?`Connect your agent to this instance, or copy a request for a new local installation.`:`Connect ChatGPT or Claude Desktop to this instance.`}),(0,G.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1`,children:[(0,G.jsx)(U,{asChild:!0,variant:`secondary`,size:`sm`,children:(0,G.jsx)(R,{to:`/agent-setup`,children:`Agent setup`})}),oe?(0,G.jsxs)(U,{type:`button`,variant:`ghost`,size:`sm`,onClick:Qn(Oe),children:[ie?(0,G.jsx)(l,{className:`size-3.5`,"aria-hidden":`true`}):(0,G.jsx)(h,{className:`size-3.5`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{"aria-live":`polite`,children:ie?`Copied new-install request`:`Copy new-install request`})]}):null,oe&&j?(0,G.jsx)(U,{asChild:!0,variant:`ghost`,size:`sm`,children:(0,G.jsxs)(`a`,{href:hf,target:`_blank`,rel:`noopener noreferrer`,children:[`Agent quickstart`,(0,G.jsx)(s,{className:`size-3.5`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`sr-only`,children:` (opens in a new tab)`})]})}):null]})]}),se===null?null:(0,G.jsxs)(`section`,{className:`mt-6 border-t border-default pt-5`,"aria-labelledby":`telemetry-title`,children:[(0,G.jsxs)(`label`,{className:`flex min-h-11 items-start gap-3 py-2 ${c.isPending?`cursor-wait`:`cursor-pointer`}`,children:[(0,G.jsx)(`input`,{className:`mt-0.5 size-4 shrink-0 rounded border-strong bg-bg accent-accent focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-mono-500 disabled:cursor-wait`,type:`checkbox`,checked:ce??!1,disabled:c.isPending,onChange:e=>{ke(e.target.checked)},"aria-describedby":`telemetry-detail`}),(0,G.jsxs)(`span`,{className:`grid gap-0.5`,children:[(0,G.jsx)(`span`,{id:`telemetry-title`,className:`text-sm leading-5 text-heading`,children:`Share anonymous product telemetry`}),(0,G.jsx)(`span`,{id:`telemetry-detail`,className:`max-w-[70ch] text-sm leading-5 text-secondary`,children:`Helps prioritize improvements. Canonry does not send raw domains, URLs, queries, answer content, or credentials.`})]})]}),c.isPending?(0,G.jsx)(`p`,{className:`mt-1 text-sm text-secondary`,role:`status`,children:`Saving preference…`}):null,le?(0,G.jsx)(`p`,{className:`mt-1 text-sm text-negative`,role:`alert`,children:le}):null]})]})}function Vf(){return(0,G.jsx)(`div`,{className:`page-container`,children:(0,G.jsx)(`section`,{className:`page-section`,children:(0,G.jsxs)(Mr,{className:`surface-card empty-card`,children:[(0,G.jsx)(`h1`,{children:`Route not found`}),(0,G.jsx)(`p`,{children:`The current path does not map to a dashboard view.`}),(0,G.jsx)(U,{asChild:!0,children:(0,G.jsx)(R,{to:`/`,children:`Return to overview`})})]})})})}var Q=Ae(()=>df(()=>import(`./ProjectPage-D7jNMDzn.js`),__vite__mapDeps([14,1,2,3,4,5,6,7,15,8,16,9,10,11,12,13,0,17,18,19,20]),import.meta.url),`ProjectPage`),Hf=Ae(()=>df(()=>import(`./RunsPage-vVs_xnqi.js`),__vite__mapDeps([21,1,2,3,4,5,6,7,15,9,10,13]),import.meta.url),`RunsPage`),Uf=Ae(()=>df(()=>import(`./HistoryPage-DMU_b4kk.js`),__vite__mapDeps([22,3,1,2,18,4,5,6,7,10,13]),import.meta.url),`HistoryPage`),Wf=Ae(()=>df(()=>import(`./SettingsPage-wY4KTSfr.js`),__vite__mapDeps([23,1,2,3,4,5,6,7,16,9,13]),import.meta.url),`SettingsPage`),Gf=Ae(()=>df(()=>import(`./AgentSetupPage-CKRlDQZp.js`),__vite__mapDeps([24,1,2,3,7,6,5,8,16]),import.meta.url),`AgentSetupPage`),Kf=Ae(()=>df(()=>import(`./BacklinksPage-CEJPc6fQ.js`),__vite__mapDeps([25,1,2,3,7,6,5,16,13,17]),import.meta.url),`BacklinksPage`),qf=Ae(()=>df(()=>import(`./TrafficPage-DDpApkaw.js`),__vite__mapDeps([26,1,2,3,4,5,6,7,16,9,10,12,13,20]),import.meta.url),`TrafficPage`),Jf=Ae(()=>df(()=>import(`./TrafficSourceDetailPage-C2pV1K3V.js`),__vite__mapDeps([27,1,2,3,4,5,6,7,15,11,12,13,20,9,10]),import.meta.url),`TrafficSourceDetailPage`),Yf=Ae(()=>df(()=>import(`./MeasurementPropertyPage-DWwuFP2S.js`),__vite__mapDeps([28,1,2,3,4,5,6,7,15,8,10,11,12,19]),import.meta.url),`MeasurementPropertyPage`);function Xf(){return(0,G.jsx)(vl,{children:(0,G.jsx)(Wr,{children:(0,G.jsx)(_l,{})})})}var Zf=xe()({component:Xf,validateSearch:e=>({manageQueries:e.manageQueries===!0||e.manageQueries===`true`||void 0,runId:typeof e.runId==`string`?e.runId:void 0,siteHealthRunId:typeof e.siteHealthRunId==`string`?e.siteHealthRunId:void 0,seoProfileId:typeof e.seoProfileId==`string`?e.seoProfileId:void 0,seoRunId:typeof e.seoRunId==`string`?e.seoRunId:void 0,seoRegion:typeof e.seoRegion==`string`&&e.seoRegion?e.seoRegion:void 0,seoMarket:typeof e.seoMarket==`string`&&e.seoMarket?e.seoMarket:void 0,seoShow:typeof e.seoShow==`string`&&e.seoShow?e.seoShow:void 0,seoSort:typeof e.seoSort==`string`&&e.seoSort?e.seoSort:void 0,seoQ:typeof e.seoQ==`string`&&e.seoQ?e.seoQ:void 0,evidenceId:typeof e.evidenceId==`string`?e.evidenceId:void 0,runStatus:typeof e.runStatus==`string`?e.runStatus:void 0,runKind:typeof e.runKind==`string`?e.runKind:void 0,runProject:typeof e.runProject==`string`?e.runProject:void 0,runWindow:typeof e.runWindow==`string`?e.runWindow:void 0,runQuery:typeof e.runQuery==`string`?e.runQuery:void 0,onboarding:e.onboarding===`site-health`||e.onboarding===`first-run`||e.onboarding===`complete`?e.onboarding:void 0,experience:e.experience===`legacy`||e.experience===`platform`?e.experience:void 0,siteScan:e.siteScan===`skip`?`skip`:void 0,skipped:e.skipped===`visibility`?`visibility`:void 0,setupProject:typeof e.setupProject==`string`?e.setupProject:void 0,scope:typeof e.scope==`string`?e.scope:void 0,class:typeof e.class==`string`?e.class:void 0,...Object.fromEntries([`queryWorkspace`,`researchMode`,`trackingQueryId`,`measurementScope`,`measurementScopeKey`,`measurementMarketKey`,`queryClass`,`measurementProvider`,`measurementModel`,`measurementLocation`,`measurementFrom`,`measurementTo`,`measurementRevision`,`measurementRunId`,`measurementQueryKey`,`measurementAnswer`].map(t=>[t,typeof e[t]==`string`?e[t]:void 0]))})}),Qf=L({getParentRoute:()=>Zf,path:`/`,component:Mu,beforeLoad:async({context:e})=>{let t=e.queryClient.getQueryData(pr({client:H}));if(t===void 0)try{t=await e.queryClient.ensureQueryData(fr({client:H}))}catch{return}if(t.length===0)throw we({to:`/setup`})}}),$f=L({getParentRoute:()=>Zf,path:`/projects`,component:Iu}),ep=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,$=L({getParentRoute:()=>Zf,path:`/projects/$projectName`,component:()=>(0,G.jsx)(Oe,{}),beforeLoad:async({context:e,params:t,location:n})=>{let r=t.projectName;if(!ep.test(r))return;let i=e.queryClient.getQueryData(pr({client:H}));if(!i)try{i=await e.queryClient.ensureQueryData(fr({client:H}))}catch{return}let a=i.find(e=>e.id===r);if(a)throw we({to:n.pathname.replace(`/projects/${r}`,`/projects/${encodeURIComponent(a.name)}`),replace:!0})}}),tp=L({getParentRoute:()=>$,path:`/`,component:()=>(0,G.jsx)(Q,{tab:`overview`})}),np=L({getParentRoute:()=>$,path:`/portfolio`,component:()=>(0,G.jsx)(Q,{tab:`portfolio`})}),rp=L({getParentRoute:()=>$,path:`/search-console`,component:()=>(0,G.jsx)(Q,{tab:`search-console`})}),ip=L({getParentRoute:()=>$,path:`/seo-data`,component:()=>(0,G.jsx)(Q,{tab:`seo-data`})}),ap=L({getParentRoute:()=>$,path:`/conversions`,component:()=>(0,G.jsx)(Q,{tab:`conversions`})}),op=L({getParentRoute:()=>$,path:`/local`,component:()=>(0,G.jsx)(Q,{tab:`local`})}),sp=L({getParentRoute:()=>$,path:`/discovery`,component:()=>(0,G.jsx)(Q,{tab:`discovery`})}),cp=L({getParentRoute:()=>$,path:`/queries`,component:()=>(0,G.jsx)(Q,{tab:`queries`})}),lp=L({getParentRoute:()=>$,path:`/client-queries`,component:()=>(0,G.jsx)(Q,{tab:`client-queries`})}),up=L({getParentRoute:()=>$,path:`/properties/$targetKey`,component:()=>(0,G.jsx)(Yf,{})}),dp=L({getParentRoute:()=>$,path:`/report`,beforeLoad:({params:e})=>{throw we({to:`/projects/$projectName`,params:e,replace:!0})}}),fp=L({getParentRoute:()=>$,path:`/activity`,component:()=>(0,G.jsx)(Q,{tab:`activity`})}),pp=L({getParentRoute:()=>$,path:`/backlinks`,component:()=>(0,G.jsx)(Q,{tab:`backlinks`})}),mp=L({getParentRoute:()=>$,path:`/technical-aeo`,component:()=>(0,G.jsx)(Q,{tab:`technical-aeo`})}),hp=L({getParentRoute:()=>$,path:`/history`,component:()=>(0,G.jsx)(Q,{tab:`history`})}),gp=L({getParentRoute:()=>$,path:`/settings`,component:()=>(0,G.jsx)(Q,{tab:`settings`})}),_p=L({getParentRoute:()=>Zf,path:`/runs`,component:Hf}),vp=L({getParentRoute:()=>Zf,path:`/history`,component:Uf}),yp=L({getParentRoute:()=>Zf,path:`/settings`,component:Wf,beforeLoad:({context:e})=>{}}),bp=L({getParentRoute:()=>Zf,path:`/setup`,component:Lf}),xp=L({getParentRoute:()=>Zf,path:`/agent-setup`,component:Gf}),Sp=L({getParentRoute:()=>Zf,path:`/backlinks`,component:Kf}),Cp=L({getParentRoute:()=>Zf,path:`/traffic`,component:qf}),wp=L({getParentRoute:()=>Zf,path:`/traffic/$projectName/$sourceId`,component:Jf}),Tp=L({getParentRoute:()=>Zf,path:`*`,component:Vf}),Ep=Zf.addChildren([Qf,$f,$.addChildren([tp,np,rp,ip,ap,op,sp,cp,lp,up,dp,fp,pp,mp,hp,gp]),_p,vp,yp,bp,xp,Sp,Cp,wp,Tp]);function Dp(){return typeof window<`u`&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:`/`}var Op=Dp(),kp=Op===`/`?``:Op.replace(/\/$/,``);function Ap(e,t){return be({routeTree:Ep,basepath:kp||`/`,context:{queryClient:e},...t?.initialEntries&&{history:Ee({initialEntries:t.initialEntries})}})}var jp=!1;async function Mp(e){return(await Fn({client:H,body:e,keepalive:!0})).data}function Np(){jp||typeof window>`u`||(jp=!0,!(Ve()||An())&&(zt({send:Mp}),H.interceptors.request.use((e,t)=>{let n=t.fetch??globalThis.fetch,r=typeof t.url==`string`?t.url:void 0;return t.fetch=async(t,i)=>{try{return await n(t,i)}catch(t){throw t instanceof DOMException&&t.name===`AbortError`||jn({method:e.method,route:r,network:!0}),t}},e}),H.interceptors.response.use((e,t,n)=>(jn({method:t.method,route:typeof n.url==`string`?n.url:void 0,path:Fp(t.url),status:e.status}),e)),window.addEventListener(`error`,e=>{vt({kind:`unhandled`,error:e.error})}),window.addEventListener(`unhandledrejection`,e=>{vt({kind:`unhandled`,error:e.reason})}),Bp()))}function Pp(e){let t=null,n=()=>{let n=e.state.matches.at(-1);if(!n)return;St(n.fullPath);let r=e.state.location;if(!r)return;let i=r.search&&typeof r.search==`object`?r.search:{};t&&t.pathname===r.pathname&&Be(t.search,i),t={pathname:r.pathname,search:i}};return n(),e.subscribe(`onResolved`,n)}function Fp(e){try{return new URL(e,window.location.origin).pathname}catch{return}}var Ip={LCP:[2500,4e3],INP:[200,500],CLS:[.1,.25],FCP:[1800,3e3],TTFB:[800,1800]};function Lp(e,t){let[n,r]=Ip[e];return t<=n?`good`:t<=r?`needs-improvement`:`poor`}function Rp(){let e=0,t=0,n=-1/0,r=-1/0;return{add(i){i.hadRecentInput||(i.startTime-r<1e3&&i.startTime-n<5e3?t+=i.value:(t=i.value,n=i.startTime),r=i.startTime,e=Math.max(e,t))},value:()=>e}}function zp(){let e=0;return{add(t){t.interactionId&&(e=Math.max(e,t.duration))},value:()=>e}}function Bp(){if(typeof PerformanceObserver>`u`)return;let e=new Set,t=(t,n)=>{!e.has(t)&&Number.isFinite(n)&&(e.add(t),kn(t,Lp(t,n)))},n=(e,t,n={})=>{try{new PerformanceObserver(e=>t(e.getEntries())).observe({type:e,buffered:!0,...n})}catch{}};try{let e=performance.getEntriesByType(`navigation`)[0];e&&e.responseStart>0&&t(`TTFB`,e.responseStart)}catch{}n(`paint`,e=>{let n=e.find(e=>e.name===`first-contentful-paint`);n&&t(`FCP`,n.startTime)});let r=0;n(`largest-contentful-paint`,e=>{let t=e.at(-1);t&&(r=t.startTime)});let i=Rp();n(`layout-shift`,e=>{for(let t of e)i.add({startTime:t.startTime,value:t.value??0,hadRecentInput:t.hadRecentInput===!0})});let a=zp();n(`event`,e=>{for(let t of e)a.add(t)},{durationThreshold:40});let o=()=>{r>0&&t(`LCP`,r),t(`CLS`,i.value()),a.value()>0&&t(`INP`,a.value())};document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&o()}),window.addEventListener(`pagehide`,o)}var Vp=6e4,Hp=`Anyone with this password can sign in to this dashboard.`,Up={label:`Root API key`,help:`To create the password from here, enter the root API key (apiKey in config.yaml). It is used once and not saved.`,missing:`Enter the root API key.`,rejected:`That is not the root API key for this install.`,show:`Show passwords and key`},Wp={id:`embed`,scopes:[`read`,`embed`],projectId:`embed`,readOnly:!0};function Gp(){let e=(0,W.useRef)(Gt()).current,[t,n]=(0,W.useState)(e?`ready`:`checking`),[r,i]=(0,W.useState)(null),[a,o]=(0,W.useState)(null),[s,c]=(0,W.useState)(e),[l,u]=(0,W.useState)(!1),[d,f]=(0,W.useState)(``),[p,m]=(0,W.useState)(``),[h,g]=(0,W.useState)(``),[_,v]=(0,W.useState)(!1),[y,b]=(0,W.useState)(`password`),[x,S]=(0,W.useState)(!1),[C,w]=(0,W.useState)(``),[T,E]=(0,W.useState)(null),[D,O]=(0,W.useState)(!1),[ee,te]=(0,W.useState)(!1),k=(0,W.useRef)(null),A=(0,W.useRef)(null),ne=(0,W.useRef)(null),re=()=>{let t=r?`${r.name}:${r.role}`:e?`api-key:explicit`:a?`api-key:${a.id}`:`no-accounts`;if(!k.current||ne.current!==t){A.current?.clear();let e=er();A.current=e,k.current=Ap(e),Pp(k.current),ne.current=t}return{queryClient:A.current,router:k.current}},ie=e=>e.authRequired?(u(!0),i(e.user),o(null),c(!1),n(e.user?`ready`:`account-login`),!0):!1;(0,W.useEffect)(()=>{let t=!1,r=async(e,r=!1)=>{try{let e=await Ln();if(t)return;o(e),c(!1),n(`ready`)}catch(i){if(t)return;if(r&&i instanceof Lt&&i.statusCode===401)return Tn().then(()=>{t||(E(null),o(null),c(!1),te(!0),n(`login`))}).catch(r=>{t||(E(r instanceof Error?r.message:`Could not clear the invalid session`),n(e))});E(i instanceof Error?i.message:`Could not verify API key access`),n(e)}};return e?(r(`api-key-error`),()=>{t=!0}):(Promise.allSettled([Yt(),xn()]).then(([e,i])=>{if(t||e.status===`fulfilled`&&ie(e.value))return;if(i.status===`rejected`){let e=i.reason;E(e instanceof Error?e.message:`Failed to reach the Canonry API`),n(`login`);return}let a=i.value;a.authenticated&&Ve()?(o(Wp),c(!1),n(`ready`)):a.authenticated?(c(!0),r(`api-key-error`,!0)):(o(null),c(!1),n(a.setupRequired?`setup`:`login`))}),()=>{t=!0})},[]),(0,W.useEffect)(()=>{if(t!==`ready`||e)return;let r=setInterval(()=>{l?Yt().then(e=>{e.authRequired&&!e.user&&(te(!0),i(null),o(null),n(`account-login`))}).catch(()=>{}):xn().then(e=>{e.authenticated||(te(!0),o(null),n(e.setupRequired?`setup`:`login`))}).catch(()=>{})},Vp);return rt(()=>{te(!0),i(null),o(null),c(!1),n(l?`account-login`:`login`)}),()=>{clearInterval(r),rt(null)}},[t,l,e]);let ae=async e=>{if(e.preventDefault(),!p.trim()||p.trim().length<8){E(`Password must be at least 8 characters`);return}if(p!==h){E(`Passwords do not match`);return}let t=C.trim();if(x&&!t)E(Up.missing);else{O(!0),E(null);try{if(!(await tt(p.trim(),x?t:void 0)).authenticated){E(`Setup failed`);return}m(``),g(``),w(``),S(!1),v(!1),te(!1),o(null),c(!0),n(`checking`);try{let e=await Ln();o(e),c(!1),n(`ready`)}catch(e){E(e instanceof Error?e.message:`Could not verify API key access`),n(`api-key-error`)}}catch(e){if(e instanceof Lt&&e.statusCode===401&&e.code===`AUTH_REQUIRED`){E(x?Up.rejected:null),S(!0);return}E(e instanceof Lt||e instanceof Error?e.message:`Setup failed`)}finally{O(!1)}}},oe=e=>{m(e),E(null)},j=e=>{w(e),E(null)},M=e=>{g(e),E(null)},se=async e=>{if(e.preventDefault(),p.trim()){O(!0),E(null);try{if(!(y===`api-key`?await We(p.trim()):await ut(p.trim())).authenticated){E(y===`api-key`?`Invalid API key`:`Incorrect password`);return}let e=await Ln();o(e),c(!1),m(``),v(!1),te(!1),n(`ready`)}catch(e){E(e instanceof Lt||e instanceof Error?e.message:`Authentication failed`)}finally{O(!1)}}},ce=e=>{b(e),m(``),v(!1),E(null)},le=async e=>{if(e.preventDefault(),d.trim()&&p){O(!0),E(null);try{let e=await Ne(d.trim(),p);if(!e.user){E(`Incorrect name or password.`);return}m(``),te(!1),i(e.user),o(null),c(!1),n(`ready`)}catch(e){E(e instanceof Lt?e.message:`Incorrect name or password.`)}finally{O(!1)}}};if(t===`ready`){let{queryClient:e,router:t}=re();return(0,G.jsx)(Zn,{account:r,apiKey:a,apiKeyPending:s,children:(0,G.jsx)(ye,{client:e,children:(0,G.jsx)(Te,{router:t})})})}let ue=p.trim(),de=p.length>0&&ue.length<8,fe=h.length>0&&p!==h,pe=ue.length>=8&&p===h&&(!x||C.trim().length>0);return(0,G.jsx)(`div`,{className:`min-h-screen bg-bg px-4 py-8`,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-[calc(100vh-4rem)] max-w-md flex-col items-center justify-center gap-5`,children:[(0,G.jsxs)(`div`,{"data-testid":`auth-brand`,className:`flex items-center gap-2.5`,children:[(0,G.jsx)(`img`,{className:`size-7`,src:`./favicon.svg`,alt:``,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`text-lg font-semibold tracking-tight text-heading`,children:`Canonry`})]}),(0,G.jsx)(Mr,{className:`surface-card w-full`,children:t===`checking`?(0,G.jsx)(Ar,{className:`py-8`,children:(0,G.jsx)(`p`,{className:`supporting-copy text-center`,children:`Connecting to Canonry…`})}):t===`api-key-error`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(kr,{children:[(0,G.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Dashboard access`}),(0,G.jsx)(`h1`,{className:`font-medium tracking-tight text-primary`,children:`Could not verify API key access`})]}),(0,G.jsxs)(Ar,{className:`space-y-4`,children:[(0,G.jsx)(`p`,{className:`supporting-copy`,children:T??`Canonry could not verify this session’s access, so the dashboard stayed locked.`}),(0,G.jsx)(U,{type:`button`,className:`w-full`,onClick:()=>{window.location.reload()},children:`Try again`})]})]}):t===`account-login`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(kr,{children:[(0,G.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Dashboard access`}),(0,G.jsx)(`h1`,{className:`font-medium tracking-tight text-primary`,children:`Sign in to Canonry`})]}),(0,G.jsxs)(Ar,{children:[ee?(0,G.jsx)(`p`,{className:`mb-4 rounded-md border border-caution bg-caution-soft px-3 py-2 text-sm text-caution`,children:`You were signed out — please sign in again.`}):null,(0,G.jsxs)(`form`,{className:`space-y-4`,onSubmit:Qn(le),children:[(0,G.jsxs)(`label`,{className:`block space-y-1.5`,htmlFor:`account-name`,children:[(0,G.jsx)(`span`,{className:`text-xs font-medium text-secondary`,children:`Name`}),(0,G.jsx)(`input`,{autoFocus:!0,id:`account-name`,className:`w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600`,type:`text`,name:`username`,autoComplete:`username`,value:d,onChange:e=>{f(e.target.value),E(null)},"aria-invalid":!!T,"aria-describedby":T?`account-login-error`:void 0})]}),(0,G.jsxs)(`label`,{className:`block space-y-1.5`,htmlFor:`account-password`,children:[(0,G.jsx)(`span`,{className:`text-xs font-medium text-secondary`,children:`Password`}),(0,G.jsx)(`input`,{id:`account-password`,className:`w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600`,type:`password`,name:`password`,autoComplete:`current-password`,value:p,onChange:e=>oe(e.target.value),"aria-invalid":!!T,"aria-describedby":T?`account-login-error`:void 0})]}),T?(0,G.jsx)(`p`,{id:`account-login-error`,role:`alert`,className:`text-sm text-negative-400`,children:T}):null,(0,G.jsx)(U,{type:`submit`,disabled:D||!d.trim()||!p,children:D?`Signing in…`:`Sign in`})]})]})]}):t===`setup`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(kr,{children:[(0,G.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`First-time setup`}),(0,G.jsx)(`h1`,{className:`font-medium tracking-tight text-primary`,children:`Create a dashboard password`}),(0,G.jsx)(jr,{children:Hp})]}),(0,G.jsx)(Ar,{children:(0,G.jsxs)(`form`,{className:`space-y-4`,onSubmit:Qn(ae),children:[(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`label`,{className:`block text-xs font-medium text-secondary`,htmlFor:`dashboard-password-new`,children:`Password`}),(0,G.jsx)(`input`,{autoFocus:!0,id:`dashboard-password-new`,className:`w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600`,type:_?`text`:`password`,name:`new-password`,autoComplete:`new-password`,minLength:8,required:!0,value:p,onChange:e=>oe(e.target.value),"aria-invalid":de,"aria-describedby":`dashboard-password-new-help`}),(0,G.jsx)(`span`,{id:`dashboard-password-new-help`,"aria-live":`polite`,className:de?`block text-sm text-negative-400`:`block text-sm text-secondary`,children:de?`Enter at least 8 characters.`:`Use at least 8 characters.`})]}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`label`,{className:`block text-xs font-medium text-secondary`,htmlFor:`dashboard-password-confirm`,children:`Confirm password`}),(0,G.jsx)(`input`,{id:`dashboard-password-confirm`,className:`w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600`,type:_?`text`:`password`,name:`confirm-password`,autoComplete:`new-password`,minLength:8,required:!0,value:h,onChange:e=>M(e.target.value),"aria-invalid":fe,"aria-describedby":`dashboard-password-confirm-help`}),(0,G.jsx)(`span`,{id:`dashboard-password-confirm-help`,"aria-live":`polite`,className:fe?`block text-sm text-negative-400`:`block text-sm text-secondary`,children:fe?`Passwords do not match.`:`Enter the same password again.`})]}),x?(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(`label`,{className:`block text-xs font-medium text-secondary`,htmlFor:`dashboard-setup-root-key`,children:Up.label}),(0,G.jsx)(`input`,{autoFocus:!0,id:`dashboard-setup-root-key`,className:`w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600`,type:_?`text`:`password`,name:`apiKey`,autoComplete:`off`,spellCheck:!1,required:!0,value:C,onChange:e=>j(e.target.value),"aria-invalid":T===Up.rejected,"aria-describedby":`dashboard-setup-root-key-help`}),(0,G.jsx)(`span`,{id:`dashboard-setup-root-key-help`,"aria-live":`polite`,className:`block text-sm text-secondary`,children:Up.help})]}):null,(0,G.jsxs)(`label`,{className:`flex min-h-10 cursor-pointer items-center gap-2 text-sm text-secondary`,htmlFor:`dashboard-password-show`,children:[(0,G.jsx)(`input`,{id:`dashboard-password-show`,type:`checkbox`,checked:_,onChange:e=>v(e.target.checked)}),x?Up.show:`Show passwords`]}),T?(0,G.jsx)(`p`,{id:`dashboard-password-setup-error`,role:`alert`,className:`text-sm text-negative-400`,children:T}):null,(0,G.jsx)(U,{type:`submit`,disabled:D||!pe,children:D?`Creating password…`:`Create password and continue`})]})})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(kr,{children:[(0,G.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Dashboard access`}),(0,G.jsx)(`h1`,{className:`font-medium tracking-tight text-primary`,children:`Sign in to Canonry`}),(0,G.jsx)(jr,{children:y===`api-key`?`Enter an API key from this Canonry install. This opens the dashboard with that key’s access and does not change the password.`:`Enter your dashboard password to continue.`})]}),(0,G.jsxs)(Ar,{children:[ee?(0,G.jsx)(`p`,{className:`mb-4 rounded-md border border-caution bg-caution-soft px-3 py-2 text-sm text-caution`,children:`Your session expired — please sign in again.`}):null,(0,G.jsxs)(`form`,{className:`space-y-4`,onSubmit:Qn(se),children:[(0,G.jsxs)(`label`,{className:`block space-y-1.5`,htmlFor:`dashboard-password-current`,children:[(0,G.jsx)(`span`,{className:`text-xs font-medium text-secondary`,children:y===`api-key`?`Canonry API key`:`Password`}),(0,G.jsx)(`input`,{autoFocus:!0,id:`dashboard-password-current`,className:`w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600`,type:_?`text`:`password`,name:y===`api-key`?`apiKey`:`password`,autoComplete:y===`api-key`?`off`:`current-password`,spellCheck:!1,required:!0,value:p,onChange:e=>oe(e.target.value),"aria-invalid":!!T,"aria-describedby":T?`dashboard-password-login-error`:void 0})]}),(0,G.jsxs)(`label`,{className:`flex min-h-10 cursor-pointer items-center gap-2 text-sm text-secondary`,htmlFor:`dashboard-login-password-show`,children:[(0,G.jsx)(`input`,{id:`dashboard-login-password-show`,type:`checkbox`,checked:_,onChange:e=>v(e.target.checked)}),y===`api-key`?`Show API key`:`Show password`]}),T?(0,G.jsx)(`p`,{id:`dashboard-password-login-error`,role:`alert`,className:`text-sm text-negative-400`,children:T}):null,(0,G.jsx)(U,{type:`submit`,disabled:D||!p.trim(),children:D?`Signing in…`:`Open dashboard`}),(0,G.jsx)(U,{type:`button`,variant:`ghost`,onClick:()=>ce(y===`api-key`?`password`:`api-key`),children:y===`api-key`?`Use dashboard password instead`:`Forgot password? Use API key`})]})]})]})})]})})}var Kp=document.getElementById(`root`);if(!Kp)throw Error(`Expected #root element for web app bootstrap.`);Np(),(0,Rr.createRoot)(Kp).render((0,G.jsx)(W.StrictMode,{children:(0,G.jsx)(Gp,{})}));export{ts as $,Ni as $t,mu as A,Oa as At,Us as B,ia as Bt,Gu as C,da as Ct,gu as D,la as Dt,Au as E,Ca as Et,xl as F,ea as Ft,As as G,oa as Gt,Ns as H,aa as Ht,bl as I,Ta as It,js as J,Aa as Jt,Ms as K,Ba as Kt,yl as L,za as Lt,au as M,pa as Mt,cu as N,_a as Nt,lu as O,ya as Ot,Sl as P,La as Pt,is as Q,Ri as Qt,Rs as R,Ia as Rt,Qu as S,Yi as St,Pu as T,Ji as Tt,Os as U,ca as Ut,Hs as V,qi as Vt,Es as W,sa as Wt,ls as X,ka as Xt,ds as Y,ma as Yt,os as Z,Mi as Zt,nd as _,Sa as _t,Dd as a,di as an,to as at,ed as b,Xi as bt,bd as c,Jr as cn,Ya as ct,ud as d,Hr as dn,Za as dt,Pi as en,es as et,pd as f,Ha as ft,ad as g,Ki as gt,cd as h,Gi as ht,qd as i,pi as in,no as it,ou as j,Qi as jt,pu as k,va as kt,Sd as l,ti as ln,Qa as lt,hd as m,Wi as mt,Gd as n,mi as nn,ro as nt,Pd as o,Qr as on,eo as ot,gd as p,Va as pt,Ds as q,wa as qt,Kd as r,hi as rn,oo as rt,wd as s,ei as sn,Ua as st,df as t,vi as tn,Mo as tt,xd as u,Gr as un,Xa as ut,Z as v,ga as vt,Uu as w,ua as wt,X as x,Zi as xt,$u as y,K as yt,Ls as z,xa as zt};