@maycombhq/atticus 2.0.0-beta.10 → 2.0.0-beta.11
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.
- package/dist/bin.js +3 -3
- package/dist/{chunk-GZ4TKR3Q.js → chunk-23VFQHFQ.js} +33 -134
- package/dist/{chunk-VKMTFIWS.js → chunk-26DBAGOP.js} +18 -18
- package/dist/{chunk-PKCMRPPB.js → chunk-27EDZN52.js} +33 -27
- package/dist/{chunk-AJJK7GLO.js → chunk-2K2ZEJVR.js} +3 -3
- package/dist/{chunk-XRO65C7V.js → chunk-3DDJLI7N.js} +8 -6
- package/dist/{chunk-XQ3YIV5R.js → chunk-3LU6YCSQ.js} +6 -6
- package/dist/{chunk-XTVDAHH2.js → chunk-3WU7LVTL.js} +5 -5
- package/dist/{chunk-6GNS32SI.js → chunk-4AYZQ3SY.js} +4 -4
- package/dist/{chunk-6VBXAGJX.js → chunk-4ONORLK5.js} +14 -14
- package/dist/{chunk-7TGYNOXD.js → chunk-4URR24DD.js} +7 -7
- package/dist/{chunk-CIUHAHM6.js → chunk-4UZJOQYK.js} +8 -8
- package/dist/chunk-4Y4FY34K.js +34 -0
- package/dist/{chunk-52R2YXP5.js → chunk-4YWRU7JK.js} +16 -16
- package/dist/chunk-52WCHTVZ.js +41 -0
- package/dist/{chunk-YIEOFHOL.js → chunk-55TBYJF2.js} +17 -11
- package/dist/{chunk-MH5OCRUM.js → chunk-5ACUW753.js} +2 -2
- package/dist/chunk-5BJFMAQU.js +32 -0
- package/dist/{chunk-YPBQNJHA.js → chunk-5ICB2BXH.js} +8 -8
- package/dist/{chunk-YGKYFMSL.js → chunk-5NZSJ5ZG.js} +3 -3
- package/dist/{chunk-YPIEYQF4.js → chunk-5P5BGG5L.js} +6 -6
- package/dist/{chunk-B7434AE2.js → chunk-5RUMHLIS.js} +2 -2
- package/dist/{chunk-5MI2SEV5.js → chunk-5TY4DTHQ.js} +3 -3
- package/dist/{chunk-NIXVDQVO.js → chunk-5V5BJACL.js} +2 -2
- package/dist/{chunk-7DUDLVFJ.js → chunk-6E2GJANQ.js} +20 -20
- package/dist/{chunk-RK6MKKKP.js → chunk-6N2GUZMZ.js} +1 -1
- package/dist/{chunk-LK44ULGI.js → chunk-6RGIM2ZH.js} +32 -6
- package/dist/{chunk-OS7PQ35Z.js → chunk-6V3DTQWK.js} +22 -22
- package/dist/{chunk-OSGQW2Z6.js → chunk-77RSRG3A.js} +8 -8
- package/dist/{chunk-5YIBJXGB.js → chunk-7A7IG7OA.js} +10 -10
- package/dist/{chunk-YLAJAI2W.js → chunk-7HQOZALR.js} +11 -11
- package/dist/{chunk-XB5RFZHH.js → chunk-7HWXYP4H.js} +12 -12
- package/dist/{chunk-PIVKU64W.js → chunk-7J7UY46S.js} +2 -2
- package/dist/{chunk-62YMDXY6.js → chunk-7KXYMC2P.js} +16 -16
- package/dist/{chunk-23M2LUYM.js → chunk-7LCQ7JAM.js} +1 -1
- package/dist/{chunk-5XN76FTF.js → chunk-7RGCQ4VZ.js} +5 -5
- package/dist/{chunk-CHC5FKTU.js → chunk-7RUMD56V.js} +1 -1
- package/dist/{chunk-IUD3ME4E.js → chunk-7S3XFWOU.js} +4 -4
- package/dist/{chunk-ZONE6E3Z.js → chunk-7SZPENUP.js} +2 -2
- package/dist/{chunk-T6USVBEJ.js → chunk-7VFVQX5K.js} +5 -5
- package/dist/chunk-ACWQDL6T.js +37 -0
- package/dist/{chunk-AKJTKMXU.js → chunk-ANCI3LFS.js} +5 -5
- package/dist/{chunk-B3O52AUQ.js → chunk-ASKDCMW5.js} +4 -4
- package/dist/chunk-ATNG5VOZ.js +122 -0
- package/dist/{chunk-I7IWQIEB.js → chunk-B3QOYE74.js} +4 -4
- package/dist/chunk-B3UHYXHU.js +41 -0
- package/dist/{chunk-GXJVY6WT.js → chunk-BA5DTXHQ.js} +5 -5
- package/dist/{chunk-5XDNUJ4P.js → chunk-BKFGGJKA.js} +2 -2
- package/dist/{chunk-DDAHCPGA.js → chunk-BQNEHB5U.js} +12 -12
- package/dist/{chunk-P3TKKBAH.js → chunk-BUWSOQLU.js} +4 -4
- package/dist/{chunk-X4W4XXWP.js → chunk-BX52REMA.js} +5 -5
- package/dist/{chunk-4SVJNVEE.js → chunk-BXBCMGIQ.js} +2 -0
- package/dist/{chunk-CRE4BJHM.js → chunk-C2YGYTU6.js} +23 -23
- package/dist/{chunk-7URGP4DD.js → chunk-C5JFMAXX.js} +12 -12
- package/dist/chunk-C75W7VXX.js +42 -0
- package/dist/{chunk-NGPU2ARF.js → chunk-CAN3EBE5.js} +1 -1
- package/dist/{chunk-FR7JPYBD.js → chunk-CE4S5ZY3.js} +12 -12
- package/dist/{chunk-BMHGA7WD.js → chunk-CRQ73DIF.js} +12 -12
- package/dist/{chunk-KIAI6PWL.js → chunk-CZI2ACNT.js} +17 -17
- package/dist/chunk-D7MWYJZF.js +43 -0
- package/dist/chunk-DDAEAZEV.js +54 -0
- package/dist/{chunk-G2E5MNYP.js → chunk-DGKNOPSE.js} +7 -7
- package/dist/{chunk-UF7TAFJM.js → chunk-DQNKG4HY.js} +18 -18
- package/dist/{chunk-6TJCUYC5.js → chunk-DS3ZEJVN.js} +3 -3
- package/dist/{chunk-3QAKDIEU.js → chunk-DYWTQXP4.js} +23 -23
- package/dist/chunk-E25G46RW.js +54 -0
- package/dist/{chunk-F2FOQLJ7.js → chunk-EAQFRD2B.js} +6 -6
- package/dist/{chunk-W5OYJMBT.js → chunk-EATSD7YD.js} +5 -5
- package/dist/{chunk-YGR6OCHQ.js → chunk-EBWIOODZ.js} +8 -14
- package/dist/{chunk-LVGBKKSM.js → chunk-EHUYLNLC.js} +15 -15
- package/dist/{chunk-IDGSU7JF.js → chunk-EI4KQYJ3.js} +9 -9
- package/dist/{chunk-FQSRHTTC.js → chunk-EQOSXLK3.js} +15 -15
- package/dist/{chunk-KC5DROFC.js → chunk-EV4TEFOD.js} +14 -14
- package/dist/{chunk-2KDSXJFJ.js → chunk-EW7MRMD5.js} +24 -6
- package/dist/{chunk-FZL2HNWP.js → chunk-EZSZFI54.js} +3 -3
- package/dist/{chunk-MKRBG5EF.js → chunk-FMRMTI7W.js} +1 -1
- package/dist/{chunk-E3JYO547.js → chunk-FOQXYMOR.js} +20 -20
- package/dist/{chunk-G5SFOH7P.js → chunk-G3PBLW4K.js} +8 -18
- package/dist/{chunk-2XM6PYQQ.js → chunk-G7WZH54P.js} +33 -11
- package/dist/{chunk-FTV6I76U.js → chunk-GG6HIU74.js} +25 -25
- package/dist/{chunk-6EDQE7GO.js → chunk-GMJXC5AL.js} +2 -2
- package/dist/chunk-GPLFYLGH.js +130 -0
- package/dist/{chunk-UR7RMZ3R.js → chunk-GVFUEGGM.js} +2 -2
- package/dist/{chunk-WGZWR4RF.js → chunk-GWSWS264.js} +5 -5
- package/dist/{chunk-NPCD54I7.js → chunk-H4VJO3M2.js} +8 -5
- package/dist/{chunk-73VPWF5R.js → chunk-HGQZTUAC.js} +4 -4
- package/dist/{chunk-2RX7PI2Y.js → chunk-HOUUBE74.js} +4 -4
- package/dist/{chunk-BDEKREZH.js → chunk-HQMCHHY5.js} +3 -3
- package/dist/{chunk-DPHCFZ7W.js → chunk-HR4DVO6X.js} +3 -3
- package/dist/chunk-HZYFLEWO.js +39 -0
- package/dist/chunk-IA2RKC6I.js +279 -0
- package/dist/{chunk-AY2IUF4K.js → chunk-IILZ7J3L.js} +541 -64
- package/dist/chunk-IRW64JFF.js +247 -0
- package/dist/{chunk-BJPMKJTL.js → chunk-IVHN2VYG.js} +100 -2
- package/dist/{chunk-OEI7LVRP.js → chunk-IWZPGIGT.js} +24 -24
- package/dist/{chunk-QICFHVRW.js → chunk-IY4PHPHT.js} +4 -4
- package/dist/{chunk-ZE3P35DA.js → chunk-J27QGXO4.js} +9 -9
- package/dist/{chunk-BMCKL3VQ.js → chunk-JBSD57N7.js} +24 -24
- package/dist/{chunk-67J3VZBA.js → chunk-JEUXCIRD.js} +5 -5
- package/dist/{chunk-577AJVRS.js → chunk-JMOLB347.js} +1976 -282
- package/dist/{chunk-7EKESFWV.js → chunk-JQX6BSE4.js} +11 -11
- package/dist/{chunk-YXJ4XOHF.js → chunk-JRPQX2EK.js} +4 -4
- package/dist/{chunk-MTEBM4Y4.js → chunk-JUQHYTXN.js} +18 -12
- package/dist/{chunk-APSVL2AI.js → chunk-JUZ75OG4.js} +15 -15
- package/dist/{chunk-7GB4ZRE2.js → chunk-KIWEBM6G.js} +12 -12
- package/dist/{chunk-KM2FBM3T.js → chunk-KLKENMWQ.js} +282 -50
- package/dist/chunk-KQK6SQPE.js +48 -0
- package/dist/{chunk-TM7LC37P.js → chunk-KQRYW7OS.js} +179 -115
- package/dist/{chunk-65C57N7P.js → chunk-KU4T2CXJ.js} +19 -19
- package/dist/{chunk-GFXLPJWY.js → chunk-KXZR2BLL.js} +2 -2
- package/dist/{chunk-MGVYVW7Q.js → chunk-L7I5PKGD.js} +1 -1
- package/dist/{chunk-XKS6THI5.js → chunk-LDIARP6F.js} +2 -2
- package/dist/{chunk-NNUASOAA.js → chunk-LEHZTKB3.js} +12 -12
- package/dist/{chunk-FJCFYKVO.js → chunk-LS3WR2RF.js} +86 -29
- package/dist/{chunk-Y4BRGOJR.js → chunk-LUPW4WLK.js} +13 -10
- package/dist/{chunk-HE4ZQXZM.js → chunk-LVBPY2M6.js} +14 -4
- package/dist/{chunk-EX6ZXS5K.js → chunk-LZWVK4YY.js} +4 -4
- package/dist/chunk-MCWWMMLN.js +48 -0
- package/dist/{chunk-BXIX7S7O.js → chunk-MKC7P5LD.js} +15 -15
- package/dist/{chunk-JQ7XQPQS.js → chunk-MKIULIUQ.js} +4 -4
- package/dist/{chunk-D3PO4DOZ.js → chunk-MMB2OHUY.js} +4 -2
- package/dist/{chunk-MTAUZW2Z.js → chunk-MQNBEO3N.js} +210 -104
- package/dist/{chunk-4PJADZRR.js → chunk-MSL3CLHX.js} +16 -16
- package/dist/{chunk-5KTOPOEP.js → chunk-MV4637YA.js} +25 -25
- package/dist/{chunk-WARBF2KY.js → chunk-MYKQVS5W.js} +4 -4
- package/dist/{chunk-4QUQEBFT.js → chunk-MYOW3RPC.js} +6 -6
- package/dist/{chunk-ROTY5J2L.js → chunk-NBGBMRIS.js} +1 -1
- package/dist/{chunk-BUYJL3GJ.js → chunk-NBQO75XT.js} +1 -1
- package/dist/chunk-NCR24CPV.js +41 -0
- package/dist/chunk-NDW4ROST.js +38 -0
- package/dist/{chunk-AWECWW5Y.js → chunk-NELU7LSL.js} +13 -11
- package/dist/{chunk-R64GLVBO.js → chunk-NG5R2WIY.js} +10 -10
- package/dist/{chunk-ZZXF6OOJ.js → chunk-NH5QH3WS.js} +2 -2
- package/dist/{chunk-XIWYUQZQ.js → chunk-NIYB5K5B.js} +9 -9
- package/dist/{chunk-LDKUC2QJ.js → chunk-NR5T46ZY.js} +17 -17
- package/dist/{chunk-PEF5OEMB.js → chunk-NX6QEEOA.js} +4 -4
- package/dist/{chunk-OGRWQ562.js → chunk-O6ILVBYB.js} +2 -2
- package/dist/{chunk-Y7KBQ4BD.js → chunk-OFWYZH6B.js} +22 -22
- package/dist/{chunk-N3NBWIYQ.js → chunk-OHXTB6CO.js} +11 -9
- package/dist/chunk-OJN7WME4.js +34 -0
- package/dist/{chunk-2HMWX4T6.js → chunk-OR5VRULZ.js} +11 -11
- package/dist/{chunk-UBWCUP3G.js → chunk-ORZSD2KD.js} +2 -2
- package/dist/{chunk-V2TH46ZY.js → chunk-OXVVRJDQ.js} +12 -12
- package/dist/{chunk-7YYEKTYF.js → chunk-PQW7PYUR.js} +8 -8
- package/dist/{chunk-EZIUFEN6.js → chunk-Q32Y5T2U.js} +12 -12
- package/dist/{chunk-FOGG4AUR.js → chunk-QWHTTA2X.js} +23 -7
- package/dist/{chunk-HKTUIMH4.js → chunk-R3RVFCJ2.js} +3 -3
- package/dist/{chunk-J5LHDJU4.js → chunk-R3VFLYZZ.js} +7 -7
- package/dist/{chunk-QKEFZRHS.js → chunk-R6UTCLH5.js} +17 -17
- package/dist/{chunk-SS66Q4VE.js → chunk-RB2VSED2.js} +12 -12
- package/dist/chunk-REWZE2XI.js +53 -0
- package/dist/{chunk-MF7QH4AX.js → chunk-RIEFYHXI.js} +5 -5
- package/dist/{chunk-7F2RUWPU.js → chunk-RJDP642F.js} +1 -1
- package/dist/{chunk-YFSSNGLR.js → chunk-RWMSJP7H.js} +31 -29
- package/dist/{chunk-JMSEEBN4.js → chunk-S2FDPN32.js} +1 -1
- package/dist/chunk-S5LSDXV4.js +40 -0
- package/dist/{chunk-OJLRFGBP.js → chunk-S7ZWCMDO.js} +79 -15
- package/dist/{chunk-ILFKECGI.js → chunk-SG5KY4VB.js} +4 -4
- package/dist/{chunk-FEZE6NIA.js → chunk-SH7AZZDA.js} +18 -18
- package/dist/{chunk-E3Z67HRK.js → chunk-SILY6ZEZ.js} +4 -4
- package/dist/{chunk-5IALSMZ2.js → chunk-SINJKQSI.js} +14 -14
- package/dist/chunk-SIUDWWKS.js +47 -0
- package/dist/{chunk-XEG3FE2R.js → chunk-SKMHS4CL.js} +1 -1
- package/dist/chunk-SNHOLLGN.js +280 -0
- package/dist/{chunk-LTQANUDH.js → chunk-SUQZGPVG.js} +25 -25
- package/dist/{chunk-47QE246J.js → chunk-T6ESD5KM.js} +5 -5
- package/dist/{chunk-YVLMBAYE.js → chunk-TC3KTG33.js} +3 -3
- package/dist/{chunk-IV7BCWWN.js → chunk-TCADP67G.js} +3 -3
- package/dist/{chunk-6JLPXDWN.js → chunk-TEBBD4XH.js} +5 -5
- package/dist/{chunk-F7UQR4ZX.js → chunk-TGEOLIAK.js} +3 -3
- package/dist/{chunk-FMKKVWZD.js → chunk-TQYBXDVH.js} +2 -2
- package/dist/{chunk-TZDSDDSV.js → chunk-TZXHUDI6.js} +2 -2
- package/dist/{chunk-YMOJD5BO.js → chunk-U5PDQTLA.js} +3 -3
- package/dist/{chunk-CNKGYDMG.js → chunk-U6YKL7SI.js} +23 -23
- package/dist/{chunk-7UKVYFQ2.js → chunk-UABFFMWH.js} +8 -8
- package/dist/{chunk-XPEEICAO.js → chunk-UFBKJOWB.js} +15 -15
- package/dist/chunk-UFTQIK2J.js +43 -0
- package/dist/{chunk-ZP4FJHR4.js → chunk-UNFCFJMF.js} +18 -18
- package/dist/{chunk-IZNSAEBX.js → chunk-UTR67XU2.js} +2 -2
- package/dist/{chunk-6GWHKMQR.js → chunk-V4XKYGLK.js} +4 -4
- package/dist/{chunk-ISNZYKAS.js → chunk-VYNZED7B.js} +21 -21
- package/dist/{chunk-FV5YFR6I.js → chunk-WCLAOKCH.js} +9 -9
- package/dist/chunk-WFYHOXTB.js +29 -0
- package/dist/{chunk-QWVBEK4P.js → chunk-WGU6NIUV.js} +13 -13
- package/dist/{chunk-R4TBNKKC.js → chunk-WIMOJMAK.js} +974 -489
- package/dist/{chunk-XKZHAD6Y.js → chunk-WKXOEIOY.js} +15 -15
- package/dist/chunk-WUE6HKIU.js +790 -0
- package/dist/{chunk-R6B6XAKK.js → chunk-WUP77GG2.js} +4 -4
- package/dist/{chunk-RRVT4MPS.js → chunk-XF3DATVU.js} +18 -18
- package/dist/{chunk-KIHOIVST.js → chunk-XJAJQGXJ.js} +3 -3
- package/dist/{chunk-Y5PZHS4K.js → chunk-XKJRPVJO.js} +5 -5
- package/dist/{chunk-N4QZJJVB.js → chunk-XNRPCI23.js} +5 -5
- package/dist/{chunk-XNYNEEBR.js → chunk-XOVLGBKI.js} +18 -18
- package/dist/{chunk-GR6YKM55.js → chunk-XPJR74MA.js} +95 -13
- package/dist/{chunk-4GZXS6S2.js → chunk-XPWSNKF3.js} +226 -8
- package/dist/{chunk-LRS573EX.js → chunk-XR5DD5DQ.js} +4 -4
- package/dist/{chunk-PGKHJYOB.js → chunk-XZJE6WIT.js} +1 -1
- package/dist/{chunk-3GTZ2OON.js → chunk-Y5AYBGLB.js} +16 -10
- package/dist/{chunk-OIU657QQ.js → chunk-YLAM4HZH.js} +4 -4
- package/dist/{chunk-JF2NSTFO.js → chunk-YVCOQ5TZ.js} +3 -3
- package/dist/{chunk-F7YL2RZ4.js → chunk-YWOMGMZB.js} +23 -23
- package/dist/{chunk-WLIIQ2A4.js → chunk-YWZDAZMA.js} +7 -7
- package/dist/{chunk-JAA53T23.js → chunk-Z2EYRUOH.js} +20 -20
- package/dist/{chunk-UYYN2IUZ.js → chunk-Z46OXTBE.js} +6 -6
- package/dist/chunk-ZHWSL6SR.js +45 -0
- package/dist/chunk-ZJQUIG3A.js +87 -0
- package/dist/{chunk-T4RTWMJD.js → chunk-ZKUDS7JG.js} +5 -5
- package/dist/{chunk-HHUFVJF7.js → chunk-ZTNS3L5Z.js} +6 -6
- package/dist/files.json +471 -423
- package/dist/packages/sdk/npm/index.js +2300 -1983
- package/dist/packages/ui/dist/assets/{elk-api-Mo5w5xCa.js → elk-api-DDup23Us.js} +2 -2
- package/dist/packages/ui/dist/assets/{index-Bp3XhPHX.css → index-C0JEkXyN.css} +1 -1
- package/dist/packages/ui/dist/assets/index-mTOWhQZm.js +29 -0
- package/dist/packages/ui/dist/index.html +2 -2
- package/package.json +5 -5
- package/dist/chunk-26PLPSQW.js +0 -48
- package/dist/chunk-2G4DFUWJ.js +0 -43
- package/dist/chunk-2M6WXO73.js +0 -38
- package/dist/chunk-5F3RJCHB.js +0 -45
- package/dist/chunk-B2VSVN4P.js +0 -34
- package/dist/chunk-CITDNDIZ.js +0 -53
- package/dist/chunk-DAQBIK5G.js +0 -47
- package/dist/chunk-DZRQDNPT.js +0 -34
- package/dist/chunk-FLOEZA6K.js +0 -29
- package/dist/chunk-FNHSVBRA.js +0 -48
- package/dist/chunk-FPGVOSOG.js +0 -41
- package/dist/chunk-FZ2E5LGK.js +0 -54
- package/dist/chunk-HB6XSGI6.js +0 -131
- package/dist/chunk-HUZQDKQK.js +0 -48
- package/dist/chunk-L4VJ4ETL.js +0 -41
- package/dist/chunk-XPCWQXTY.js +0 -37
- package/dist/packages/ui/dist/assets/index-DM212ZbV.js +0 -29
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),l=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(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 u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return D(e.type,t,e.props)}function te(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ne(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var O=/\/+/g;function re(e,t){return typeof e==`object`&&e&&e.key!=null?ne(``+e.key):t.toString(36)}function ie(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ae(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ae(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+re(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(O,`$&/`)+`/`),ae(o,r,i,``,function(e){return e})):o!=null&&(te(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(O,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+re(a,u),c+=ae(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+re(a,u++),c+=ae(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ae(ie(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function oe(e,t,n){if(e==null)return e;var r=[],i=0;return ae(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function k(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var A=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)};function se(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,A)}catch(e){A(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ce(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else se(ce.bind(null,e))}var j={map:oe,forEach:function(e,t,n){oe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oe(e,function(){t++}),t},toArray:function(e){return oe(e,function(e){return e})||[]},only:function(e){if(!te(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=j,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ce,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=te,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:k}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=se,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),d=o(((e,t)=>{t.exports=u()})),f=o((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,ee());else{var t=n(l);t!==null&&O(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&&O(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ee():S=!1}}}var ee;if(typeof y==`function`)ee=function(){y(D)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,ne=te.port2;te.port1.onmessage=D,ee=function(){ne.postMessage(null)}}else ee=function(){_(D,0)};function O(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,O(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,ee()))),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}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),h=o(((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=m()})),g=o((e=>{var t=p(),n=d(),r=h();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 f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function m(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)&&m(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(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 _(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 v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(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)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(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 x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(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 E(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 D=Object.assign,ee=Symbol.for(`react.element`),te=Symbol.for(`react.transitional.element`),ne=Symbol.for(`react.portal`),O=Symbol.for(`react.fragment`),re=Symbol.for(`react.strict_mode`),ie=Symbol.for(`react.profiler`),ae=Symbol.for(`react.consumer`),oe=Symbol.for(`react.context`),k=Symbol.for(`react.forward_ref`),A=Symbol.for(`react.suspense`),se=Symbol.for(`react.suspense_list`),ce=Symbol.for(`react.memo`),j=Symbol.for(`react.lazy`),le=Symbol.for(`react.activity`),M=Symbol.for(`react.legacy_hidden`),ue=Symbol.for(`react.memo_cache_sentinel`),de=Symbol.for(`react.view_transition`),N=Symbol.for(`react.recoverable`),P=Symbol.iterator;function fe(e){return typeof e!=`object`||!e?null:(e=P&&e[P]||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 ie:return`Profiler`;case re:return`StrictMode`;case A:return`Suspense`;case se:return`SuspenseList`;case le:return`Activity`;case de:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case ne:return`Portal`;case oe:return e.displayName||`Context`;case ae:return(e._context.displayName||`Context`)+`.Consumer`;case k:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ce: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,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge=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 be(e){return{current:e}}function xe(e){0>ye||(e.current=ve[ye],ve[ye]=null,ye--)}function Se(e,t){ye++,ve[ye]=e.current,e.current=t}var Ce=be(null),we=be(null),Te=be(null),Ee=be(null);function De(e,t){switch(Se(Te,t),Se(we,e),Se(Ce,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Tp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Tp(t),e=Ep(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}xe(Ce),Se(Ce,e)}function Oe(){xe(Ce),xe(we),xe(Te)}function ke(e){var t=e.memoizedState;t!==null&&(xh._currentValue=t.memoizedState,Se(Ee,e)),t=Ce.current;var n=Ep(t,e.type);t!==n&&(Se(we,e),Se(Ce,n))}function Ae(e){we.current===e&&(xe(Ce),xe(we)),Ee.current===e&&(xe(Ee),xh._currentValue=_e)}var je,Me;function Ne(e){if(je===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);je=t&&t[1]||``,Me=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+je+e+Me}var Pe=!1;function Fe(e,t){if(!e||Pe)return``;Pe=!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(`
|
|
4
|
+
`),l=s.split(`
|
|
5
|
+
`);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=`
|
|
6
|
+
`+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{Pe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ne(n):``}function Ie(e,t){switch(e.tag){case 26:case 27:case 5:return Ne(e.type);case 16:return Ne(`Lazy`);case 13:return e.child!==t&&t!==null?Ne(`Suspense Fallback`):Ne(`Suspense`);case 19:return Ne(`SuspenseList`);case 0:case 15:return Fe(e.type,!1);case 11:return Fe(e.type.render,!1);case 1:return Fe(e.type,!0);case 31:return Ne(`Activity`);case 30:return Ne(`ViewTransition`);default:return``}}function Le(e){try{var t=``,n=null;do t+=Ie(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var Re=Object.prototype.hasOwnProperty,ze=t.unstable_scheduleCallback,Be=t.unstable_cancelCallback,Ve=t.unstable_shouldYield,He=t.unstable_requestPaint,Ue=t.unstable_now,We=t.unstable_getCurrentPriorityLevel,Ge=t.unstable_ImmediatePriority,Ke=t.unstable_UserBlockingPriority,qe=t.unstable_NormalPriority,Je=t.unstable_LowPriority,Ye=t.unstable_IdlePriority,Xe=t.log,Ze=t.unstable_setDisableYieldValue,Qe=null,$e=null;function et(e){if(typeof Xe==`function`&&Ze(e),$e&&typeof $e.setStrictMode==`function`)try{$e.setStrictMode(Qe,e)}catch{}}var tt=Math.clz32?Math.clz32:it,nt=Math.log,rt=Math.LN2;function it(e){return e>>>=0,e===0?32:31-(nt(e)/rt|0)|0}var at=256,ot=262144,st=4194304;function ct(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 lt(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=ct(n))):i=ct(o):i=ct(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ct(n))):i=ct(o)):i=ct(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 ut(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function dt(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-tt(n),i=1<<r;t|=e[r],n&=~i}return t}function ft(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 pt(){var e=st;return st<<=1,!(st&62914560)&&(st=4194304),e}function mt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ht(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function gt(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-tt(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&&_t(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function _t(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-tt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-tt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function yt(e,t){var n=t&-t;return n=n&42?1:bt(n),(n&(e.suspendedLanes|t))===0?n:0}function bt(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 xt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function St(){var e=ge.p;return e===0?(e=window.event,e===void 0?32:Lh(e.type)):e}function I(e,t){var n=ge.p;try{return ge.p=e,t()}finally{ge.p=n}}var Ct=Math.random().toString(36).slice(2),wt=`__reactFiber$`+Ct,Tt=`__reactProps$`+Ct,Et=`__reactContainer$`+Ct,Dt=`__reactEvents$`+Ct,Ot=`__reactListeners$`+Ct,kt=`__reactHandles$`+Ct,At=`__reactResources$`+Ct,jt=`__reactMarker$`+Ct,Mt=`__reactLoad$`+Ct;function Nt(e){delete e[wt],delete e[Tt],delete e[Ot],delete e[kt]}function Pt(e){var t;if(t=e[wt])return t;for(var n=e.parentNode;n;){if(t=n[Et]||n[wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Dm(e);e!==null;){if(n=e[wt])return n;e=Dm(e)}return t}e=n,n=e.parentNode}return null}function Ft(e){if(e=e[wt]||e[Et]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function It(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Lt(e){var t=e[At];return t||=e[At]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Rt(e){e[jt]=!0}function zt(e){e[Mt]=void 0}var Bt=new Set,Vt={};function Ht(e,t){Ut(e,t),Ut(e+`Capture`,t)}function Ut(e,t){for(Vt[e]=t,e=0;e<t.length;e++)Bt.add(t[e])}var Wt=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]*$`),Gt={},Kt={};function qt(e){return Re.call(Kt,e)?!0:Re.call(Gt,e)?!1:Wt.test(e)?Kt[e]=!0:(Gt[e]=!0,!1)}var Jt=!1;function Yt(){var e=Jt;return Jt=!1,e}function Xt(e,t,n){if(qt(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 Zt(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 Qt(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 $t(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function en(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function tn(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 nn(e){if(!e._valueTracker){var t=en(e)?`checked`:`value`;e._valueTracker=tn(e,t,``+e[t])}}function rn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=en(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var an=/[\n"\\]/g;function on(e){return e.replace(an,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function sn(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=``+$t(t)):e.value!==``+$t(t)&&(e.value=``+$t(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):ln(e,$t(n)):o===`number`&&e.value==t?ln(e,$t(e.value)):ln(e,$t(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=``+$t(s):e.removeAttribute(`name`)}function cn(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)){nn(e);return}n=n==null?``:``+$t(n),t=t==null?n:``+$t(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),nn(e)}function ln(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function un(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=``+$t(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 dn(e,t,n){t!=null&&(t=``+$t(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+$t(n)}function fn(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=$t(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),nn(e)}function pn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var mn=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 hn(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||mn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function gn(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]=``,Jt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(hn(e,a,r),Jt=!0)}else for(var o in t)t.hasOwnProperty(o)&&hn(e,o,t[o])}function _n(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 vn=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`]]),yn=/^[\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 bn(e){return yn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function xn(){}var Sn=null;function Cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wn=null,Tn=null;function En(e){var t=Ft(e);if(t&&(e=t.stateNode)){var n=e[Tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(sn(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="`+on(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Tt]||null;if(!a)throw Error(i(90));sn(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&&rn(r)}break a;case`textarea`:dn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&un(e,!!n.multiple,t,!1)}}}var Dn=!1;function On(e,t,n){if(Dn)return e(t,n);Dn=!0;try{return e(t)}finally{if(Dn=!1,(wn!==null||Tn!==null)&&(Zd(),wn&&(t=wn,e=Tn,Tn=wn=null,En(t),e)))for(t=0;t<e.length;t++)En(e[t])}}function kn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Tt]||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 An=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,jn=!1;if(An)try{var Mn={};Object.defineProperty(Mn,"passive",{get:function(){jn=!0}}),window.addEventListener(`test`,Mn,Mn),window.removeEventListener(`test`,Mn,Mn)}catch{jn=!1}var Nn=null,Pn=null,Fn=null;function In(){if(Fn)return Fn;var e,t=Pn,n=t.length,r,i=`value`in Nn?Nn.value:Nn.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 Fn=i.slice(e,1<r?1-r:void 0)}function Ln(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 Rn(){return!0}function zn(){return!1}function Bn(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)?Rn:zn,this.isPropagationStopped=zn,this}return D(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=Rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Rn)},persist:function(){},isPersistent:Rn}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hn=Bn(Vn),Un=D({},Vn,{view:0,detail:0}),Wn=Bn(Un),Gn,Kn,qn,Jn=D({},Un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ar,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!==qn&&(qn&&e.type===`mousemove`?(Gn=e.screenX-qn.screenX,Kn=e.screenY-qn.screenY):Kn=Gn=0,qn=e),Gn)},movementY:function(e){return`movementY`in e?e.movementY:Kn}}),Yn=Bn(Jn),Xn=Bn(D({},Jn,{dataTransfer:0})),Zn=Bn(D({},Un,{relatedTarget:0})),Qn=Bn(D({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0})),$n=Bn(D({},Vn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),er=Bn(D({},Vn,{data:0})),tr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},nr={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`},rr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ir(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rr[e])?!!t[e]:!1}function ar(){return ir}var or=Bn(D({},Un,{key:function(e){if(e.key){var t=tr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?nr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ar,charCode:function(e){return e.type===`keypress`?Ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),sr=Bn(D({},Jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),cr=Bn(D({},Vn,{submitter:0})),lr=Bn(D({},Un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ar})),ur=Bn(D({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0})),dr=Bn(D({},Jn,{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})),fr=Bn(D({},Vn,{newState:0,oldState:0,source:0})),pr=[9,13,27,32],mr=An&&`CompositionEvent`in window,hr=null;An&&`documentMode`in document&&(hr=document.documentMode);var gr=An&&`TextEvent`in window&&!hr,_r=An&&(!mr||hr&&8<hr&&11>=hr),vr=` `,yr=!1;function br(e,t){switch(e){case`keyup`:return pr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function xr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Sr=!1;function Cr(e,t){switch(e){case`compositionend`:return xr(t);case`keypress`:return t.which===32?(yr=!0,vr):null;case`textInput`:return e=t.data,e===vr&&yr?null:e;default:return null}}function wr(e,t){if(Sr)return e===`compositionend`||!mr&&br(e,t)?(e=In(),Fn=Pn=Nn=null,Sr=!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 _r&&t.locale!==`ko`?null:t.data;default:return null}}var Tr={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 Er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Tr[e.type]:t===`textarea`}function Dr(e,t,n,r){wn?Tn?Tn.push(r):Tn=[r]:wn=r,t=cp(t,`onChange`),0<t.length&&(n=new Hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Or=null,kr=null;function Ar(e){ep(e,0)}function jr(e){if(rn(It(e)))return e}function Mr(e,t){if(e===`change`)return t}var Nr=!1;if(An){var Pr;if(An){var Fr=`oninput`in document;if(!Fr){var Ir=document.createElement(`div`);Ir.setAttribute(`oninput`,`return;`),Fr=typeof Ir.oninput==`function`}Pr=Fr}else Pr=!1;Nr=Pr&&(!document.documentMode||9<document.documentMode)}function Lr(){Or&&(Or.detachEvent(`onpropertychange`,Rr),kr=Or=null)}function Rr(e){if(e.propertyName===`value`&&jr(kr)){var t=[];Dr(t,kr,e,Cn(e)),On(Ar,t)}}function zr(e,t,n){e===`focusin`?(Lr(),Or=t,kr=n,Or.attachEvent(`onpropertychange`,Rr)):e===`focusout`&&Lr()}function Br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return jr(kr)}function Vr(e,t){if(e===`click`)return jr(t)}function Hr(e,t){if(e===`input`||e===`change`)return jr(t)}function Ur(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Wr=typeof Object.is==`function`?Object.is:Ur;function Gr(e,t){if(Wr(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(!Re.call(t,i)||!Wr(e[i],t[i]))return!1}return!0}function Kr(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 qr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jr(e,t){var n=qr(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=qr(n)}}function Yr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Kr(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=Kr(e.document)}return t}function Zr(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 Qr=An&&`documentMode`in document&&11>=document.documentMode,$r=null,ei=null,ti=null,ni=!1;function ri(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ni||$r==null||$r!==Kr(r)||(r=$r,`selectionStart`in r&&Zr(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}),ti&&Gr(ti,r)||(ti=r,r=cp(ei,`onSelect`),0<r.length&&(t=new Hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=$r)))}function ii(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ai={animationend:ii(`Animation`,`AnimationEnd`),animationiteration:ii(`Animation`,`AnimationIteration`),animationstart:ii(`Animation`,`AnimationStart`),transitionrun:ii(`Transition`,`TransitionRun`),transitionstart:ii(`Transition`,`TransitionStart`),transitioncancel:ii(`Transition`,`TransitionCancel`),transitionend:ii(`Transition`,`TransitionEnd`)},oi={},si={};An&&(si=document.createElement(`div`).style,`AnimationEvent`in window||(delete ai.animationend.animation,delete ai.animationiteration.animation,delete ai.animationstart.animation),`TransitionEvent`in window||delete ai.transitionend.transition);function ci(e){if(oi[e])return oi[e];if(!ai[e])return e;var t=ai[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in si)return oi[e]=t[n];return e}var li=ci(`animationend`),ui=ci(`animationiteration`),di=ci(`animationstart`),fi=ci(`transitionrun`),pi=ci(`transitionstart`),mi=ci(`transitioncancel`),hi=ci(`transitionend`),gi=new Map,_i=`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(` `);_i.push(`scrollEnd`);function vi(e,t){gi.set(e,t),Ht(t,[e])}var yi=0;function bi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Md.identifierPrefix;var n=yi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function xi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Bd;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 Si(e,t){return e=xi(e),t=xi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Ci=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)},wi=[],Ti=0,Ei=0;function Di(){for(var e=Ti,t=Ei=Ti=0;t<e;){var n=wi[t];wi[t++]=null;var r=wi[t];wi[t++]=null;var i=wi[t];wi[t++]=null;var a=wi[t];if(wi[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&&ji(n,i,a)}}function Oi(e,t,n,r){wi[Ti++]=e,wi[Ti++]=t,wi[Ti++]=n,wi[Ti++]=r,Ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ki(e,t,n,r){return Oi(e,t,n,r),Mi(e)}function Ai(e,t){return Oi(e,null,null,t),Mi(e)}function ji(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-tt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Mi(e){if(50<Vd)throw Vd=0,Hd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ni={};function Pi(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 Fi(e,t,n,r){return new Pi(e,t,n,r)}function Ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Li(e,t){var n=e.alternate;return n===null?(n=Fi(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 Ri(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 zi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ii(r)&&(s=1);else if(typeof r==`string`)s=sh(e,n,Ce.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case le:return e=Fi(31,n,t,a),e.elementType=le,e.lanes=o,e;case O:return Bi(n.children,a,o,t);case re:s=8,a|=24;break;case ie:return e=Fi(12,n,t,a|2),e.elementType=ie,e.lanes=o,e;case A:return e=Fi(13,n,t,a),e.elementType=A,e.lanes=o,e;case se:return e=Fi(19,n,t,a),e.elementType=se,e.lanes=o,e;case M:case de:return e=a|32,e=Fi(30,n,t,e),e.elementType=de,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case oe:s=10;break a;case ae:s=9;break a;case k:s=11;break a;case ce: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=Fi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Bi(e,t,n,r){return e=Fi(7,e,r,t),e.lanes=n,e}function Vi(e,t,n){return e=Fi(6,e,null,t),e.lanes=n,e}function Hi(e){var t=Fi(18,null,null,0);return t.stateNode=e,t}function Ui(e,t,n){return t=Fi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Wi=new WeakMap;function Gi(e,t){if(typeof e==`object`&&e){var n=Wi.get(e);return n===void 0?(t={value:e,source:t,stack:Le(t)},Wi.set(e,t),t):n}return{value:e,source:t,stack:Le(t)}}var Ki=[],qi=0,Ji=null,Yi=0,Xi=[],Zi=0,Qi=null,$i=1,ea=``;function ta(e,t){Ki[qi++]=Yi,Ki[qi++]=Ji,Ji=e,Yi=t}function na(e,t,n){Xi[Zi++]=$i,Xi[Zi++]=ea,Xi[Zi++]=Qi,Qi=e;var r=$i;e=ea;var i=32-tt(r)-1;r&=~(1<<i),n+=1;var a=32-tt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,$i=1<<32-tt(t)+i|n<<i|r,ea=a+e}else $i=1<<a|n<<i|r,ea=e}function ra(e){e.return!==null&&(ta(e,1),na(e,1,0))}function ia(e){for(;e===Ji;)Ji=Ki[--qi],Ki[qi]=null,Yi=Ki[--qi],Ki[qi]=null;for(;e===Qi;)Qi=Xi[--Zi],Xi[Zi]=null,ea=Xi[--Zi],Xi[Zi]=null,$i=Xi[--Zi],Xi[Zi]=null}function aa(e,t){Xi[Zi++]=$i,Xi[Zi++]=ea,Xi[Zi++]=Qi,$i=t.id,ea=t.overflow,Qi=e}var oa=null,sa=null,ca=!1,la=null,ua=!1,da=Error(i(519));function fa(e){throw va(Gi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),da}function pa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[wt]=e,t[Tt]=r,n){case`dialog`:tp(`cancel`,t),tp(`close`,t);break;case`iframe`:case`object`:case`embed`:tp(`load`,t);break;case`video`:case`audio`:for(n=0;n<Qf.length;n++)tp(Qf[n],t);break;case`source`:tp(`error`,t);break;case`img`:case`image`:case`link`:tp(`error`,t),tp(`load`,t);break;case`details`:tp(`toggle`,t);break;case`input`:tp(`invalid`,t),cn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:tp(`invalid`,t);break;case`textarea`:tp(`invalid`,t),fn(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||mp(t.textContent,n)?(r.popover!=null&&(tp(`beforetoggle`,t),tp(`toggle`,t)),r.onScroll!=null&&tp(`scroll`,t),r.onScrollEnd!=null&&tp(`scrollend`,t),r.onClick!=null&&(t.onclick=xn),t=!0):t=!1,t||fa(e,!0)}function ma(e){for(oa=e.return;oa;)switch(oa.tag){case 5:case 31:case 13:ua=!1;return;case 27:case 3:ua=!0;return;default:oa=oa.return}}function ha(e){if(e!==oa)return!1;if(!ca)return ma(e),ca=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Op(e.type,e.memoizedProps)),n=!n),n&&sa&&fa(e),ma(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));sa=Em(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));sa=Em(e)}else t===27?(t=sa,Lp(e.type)?(e=Tm,Tm=null,sa=e):sa=t):sa=oa?wm(e.stateNode.nextSibling):null;return!0}function ga(){sa=oa=null,ca=!1}function _a(){var e=la;return e!==null&&(wd===null?wd=e:wd.push.apply(wd,e),la=null),e}function va(e){la===null?la=[e]:la.push(e)}var ya=be(null),ba=null,xa=null;function Sa(e,t,n){Se(ya,t._currentValue),t._currentValue=n}function Ca(e){e._currentValue=ya.current,xe(ya)}function wa(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 Ta(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),wa(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),wa(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),wa(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 Ea(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;Wr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Ee.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[xh]:e.push(xh))}a=a.return}return e!==null&&Ta(t,e,n,r),t.flags|=262144,e!==null}function Da(e){for(e=e.firstContext;e!==null;){if(!Wr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Oa(e){ba=e,xa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ka(e){return ja(ba,e)}function Aa(e,t){return ba===null&&Oa(e),ja(e,t)}function ja(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},xa===null){if(e===null)throw Error(i(308));xa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else xa=xa.next=t;return n}var Ma=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()})}},Na=t.unstable_scheduleCallback,Pa=t.unstable_NormalPriority,Fa={$$typeof:oe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ia(){return{controller:new Ma,data:new Map,refCount:0}}function La(e){e.refCount--,e.refCount===0&&Na(Pa,function(){e.controller.abort()})}function Ra(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 za=null;function Ba(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Va=null,Ha=0,Ua=0,Wa=null;function Ga(e,t){if(Va===null){var n=Va=[];Ha=0,Ua=qf(),Wa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ha++,t.then(Ka,Ka),t}function Ka(){if(--Ha===0&&(za=null,Va!==null)){Wa!==null&&(Wa.status=`fulfilled`);var e=Va;Va=null,Ua=0,Wa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function qa(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 Ja=F.S;F.S=function(e,t){if(Dd=Ue(),typeof t==`object`&&t&&typeof t.then==`function`&&Ga(e,t),za!==null)for(var n=Nf;n!==null;)Ra(n,za),n=n.next;if(n=e.types,n!==null){for(var r=Nf;r!==null;)Ra(r,n),r=r.next;if(Ua!==0){r=za,r===null&&(r=za=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ja!==null&&Ja(e,t)};var Ya=be(null);function Xa(){var e=Ya.current;return e===null?cd.pooledCache:e}function Za(e,t){t===null?Se(Ya,Ya.current):Se(Ya,t.pool)}function Qa(){var e=Xa();return e===null?null:{parent:Fa._currentValue,pool:e}}var $a=Error(i(460)),eo=Error(i(474)),to=Error(i(542)),no={then:function(){}};function ro(e){return e=e.status,e===`fulfilled`||e===`rejected`}function io(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(xn,xn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,co(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(xn,xn);else{if(e=cd,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,co(e),e}throw oo=t,$a}}function ao(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(oo=e,$a):e}}var oo=null;function so(){if(oo===null)throw Error(i(459));var e=oo;return oo=null,e}function co(e){if(e===$a||e===to)throw Error(i(483))}var lo=null,uo=0;function fo(e){var t=uo;return uo+=1,lo===null&&(lo=[]),io(lo,e,t)}function po(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function mo(e,t){throw t.$$typeof===ee?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ho(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=Li(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=Vi(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),po(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===j&&ao(i)===t.type)?(t=a(t,n.props),po(t,n),t.return=e,t):(t=zi(n.type,n.key,n.props,null,e.mode,r),po(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=Ui(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=Bi(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=Vi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case te:return n=zi(t.type,t.key,t.props,null,e.mode,n),po(n,t),n.return=e,n;case ne:return t=Ui(t,e.mode,n),t.return=e,t;case j:return t=ao(t),f(e,t,n)}if(he(t)||fe(t))return t=Bi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,fo(t),n);if(t.$$typeof===oe)return f(e,Aa(e,t),n);mo(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 te:return n.key===i?l(e,t,n,r):null;case ne:return n.key===i?u(e,t,n,r):null;case j:return n=ao(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,fo(n),r);if(n.$$typeof===oe)return p(e,t,Aa(e,n),r);mo(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 te:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case ne:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case j:return r=ao(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,fo(r),i);if(r.$$typeof===oe)return m(e,t,n,Aa(t,r),i);mo(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),ca&&ta(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 ca&&ta(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)}),ca&&ta(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),ca&&ta(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 ca&&ta(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)}),ca&&ta(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 te: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),po(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===j&&ao(l)===r.type){n(e,r.sibling),c=a(r,o.props),po(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===O?(c=Bi(o.props.children,e.mode,c,o.key),po(c,o),c.return=e,e=c):(c=zi(o.type,o.key,o.props,null,e.mode,c),po(c,o),c.return=e,e=c)}return s(e);case ne: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=Ui(o,e.mode,c),c.return=e,e=c}return s(e);case j:return o=ao(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,fo(o),c);if(o.$$typeof===oe)return _(e,r,Aa(e,o),c);mo(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=Vi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{uo=0;var i=_(e,t,n,r);return lo=null,i}catch(t){if(t===$a||t===to)throw t;var a=Fi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var go=ho(!0),_o=ho(!1),vo=!1;function yo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bo(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 xo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function So(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,sd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Mi(e),ji(e,null,n),t}return Oi(e,r,t,n),Mi(e)}function Co(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,vt(e,n)}}function wo(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 To=!1;function Eo(){if(To){var e=Wa;if(e!==null)throw e}}function Do(e,t,n,r){To=!1;var i=e.updateQueue;vo=!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?(ud&f)===f:(r&f)===f){f!==0&&f===Ua&&(To=!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=D({},d,f);break a;case 2:vo=!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),vd|=o,e.lanes=o,e.memoizedState=d}}function Oo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function ko(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Oo(n[e],t)}var Ao=be(null),jo=be(0);function Mo(e,t){e=gd,Se(jo,e),Se(Ao,t),gd=e|t.baseLanes}function No(){Se(jo,gd),Se(Ao,Ao.current)}function Po(){gd=jo.current,xe(Ao),xe(jo)}var Fo=be(null),Io=null;function Lo(e){var t=e.alternate;Se(Ho,Ho.current&1),Se(Fo,e),Io===null&&(t===null||Ao.current!==null||t.memoizedState!==null)&&(Io=e)}function Ro(e){Se(Ho,Ho.current),Se(Fo,e),Io===null&&(Io=e)}function zo(e){e.tag===22?(Se(Ho,Ho.current),Se(Fo,e),Io===null&&(Io=e)):Bo()}function Bo(){Se(Ho,Ho.current),Se(Fo,Fo.current)}function Vo(e){xe(Fo),Io===e&&(Io=null),xe(Ho)}var Ho=be(0);function Uo(e,t){Se(Fo,Fo.current),Se(Ho,t)}function Wo(e){xe(Ho),xe(Fo),Io===e&&(Io=null)}function Go(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||xm(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 Ko=0,qo=null,Jo=null,Yo=null,Xo=!1,Zo=!1,Qo=!1,$o=0,es=0,ts=null,ns=0;function rs(){throw Error(i(321))}function is(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Wr(e[n],t[n]))return!1;return!0}function as(e,t,n,r,i,a){return Ko=a,qo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?xc:Sc,Qo=!1,a=n(r,i),Qo=!1,Zo&&(a=ss(t,n,r,i)),os(e),a}function os(e){F.H=bc;var t=Jo!==null&&Jo.next!==null;if(Ko=0,Yo=Jo=qo=null,Xo=!1,es=0,ts=null,t)throw Error(i(300));e===null||zc||(e=e.dependencies,e!==null&&Da(e)&&(zc=!0))}function ss(e,t,n,r){qo=e;var a=0;do{if(Zo&&(ts=null),es=0,Zo=!1,25<=a)throw Error(i(301));if(a+=1,Yo=Jo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=Cc,o=t(n,r)}while(Zo);return o}function cs(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?hs(t):t,e=e.useState()[0],(Jo===null?null:Jo.memoizedState)!==e&&(qo.flags|=1024),t}function ls(){var e=$o!==0;return $o=0,e}function us(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ds(e){if(Xo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Xo=!1}Ko=0,Yo=Jo=qo=null,Zo=!1,es=$o=0,ts=null}function fs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yo===null?qo.memoizedState=Yo=e:Yo=Yo.next=e,Yo}function ps(){if(Jo===null){var e=qo.alternate;e=e===null?null:e.memoizedState}else e=Jo.next;var t=Yo===null?qo.memoizedState:Yo.next;if(t!==null)Yo=t,Jo=e;else{if(e===null)throw qo.alternate===null?Error(i(467)):Error(i(310));Jo=e,e={memoizedState:Jo.memoizedState,baseState:Jo.baseState,baseQueue:Jo.baseQueue,queue:Jo.queue,next:null},Yo===null?qo.memoizedState=Yo=e:Yo=Yo.next=e}return Yo}function ms(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hs(e){var t=es;return es+=1,ts===null&&(ts=[]),e=io(ts,e,t),t=qo,(Yo===null?t.memoizedState:Yo.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?xc:Sc),e}function gs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return hs(e);if(e.$$typeof===N)return;if(e.$$typeof===oe)return ka(e)}throw Error(i(438,String(e)))}function _s(e){var t=null,n=qo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=qo.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=ms(),qo.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]=ue;return t.index++,n}function vs(e,t){return typeof t==`function`?t(e):t}function ys(e){return bs(ps(),Jo,e)}function bs(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?(Ko&f)===f:(ud&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===Ua&&(d=!0);else if((Ko&p)===p){u=u.next,p===Ua&&(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,qo.lanes|=p,vd|=p;f=u.action,Qo&&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,qo.lanes|=f,vd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Wr(o,e.memoizedState)&&(zc=!0,d&&(n=Wa,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 xs(e){var t=ps(),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);Wr(o,t.memoizedState)||(zc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ss(e,t,n){var r=qo,a=ps(),o=ca;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Wr((Jo||a).memoizedState,n);if(s&&(a.memoizedState=n,zc=!0),a=a.queue,qs(Ts.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Yo!==null&&!!(Yo.memoizedState.tag&1),Hs(e?9:8,{destroy:void 0},ws.bind(null,r,a,n,t),null),e){if(r.flags|=2048,cd===null)throw Error(i(349));o||Ko&127||Cs(r,t,n)}return n}function Cs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=qo.updateQueue,t===null?(t=ms(),qo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ws(e,t,n,r){t.value=n,t.getSnapshot=r,Es(t)&&Ds(e)}function Ts(e,t,n){return n(function(){Es(t)&&Ds(e)})}function Es(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wr(e,n)}catch{return!0}}function Ds(e){var t=Ai(e,2);t!==null&&Kd(t,e,2)}function Os(e){var t=fs();if(typeof e==`function`){var n=e;if(e=n(),Qo){et(!0);try{n()}finally{et(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:e},t}function ks(e,t,n,r){return e.baseState=n,bs(e,Jo,typeof r==`function`?r:vs)}function As(e,t,n,r,a){if(_c(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)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,js(t,o)):(o.next=n.next,t.pending=n.next=o)}}function js(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};o.types=a===null?null:a.types,F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Ms(e,t,s)}catch(n){Ps(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Ms(e,t,a)}catch(n){Ps(e,t,n)}}function Ms(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ns(e,t,n)},function(n){return Ps(e,t,n)}):Ns(e,t,n)}function Ns(e,t,n){t.status=`fulfilled`,t.value=n,Fs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,js(e,n)))}function Ps(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Fs(t),t=t.next;while(t!==r)}e.action=null}function Fs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Is(e,t){return t}function Ls(e,t){if(ca){var n=cd.formState;if(n!==null){a:{var r=qo;if(ca){if(sa){b:{for(var i=sa,a=ua;i.nodeType!==8;)if(!a||(i=wm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){sa=wm(i.nextSibling),r=i.data===`F!`;break a}}fa(r)}r=!1}r&&(t=n[0])}}return n=fs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Is,lastRenderedState:t},n.queue=r,n=mc.bind(null,qo,r),r.dispatch=n,r=Os(!1),a=gc.bind(null,qo,!1,r.queue),r=fs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=As.bind(null,qo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Rs(e){return zs(ps(),Jo,e)}function zs(e,t,n){if(t=bs(e,t,Is)[0],e=ys(vs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=hs(t)}catch(e){throw e===$a?to:e}else r=t;t=ps();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(qo.flags|=2048,Hs(9,{destroy:void 0},Bs.bind(null,i,n),null)),[r,a,e]}function Bs(e,t){e.action=t}function Vs(e){var t=ps(),n=Jo;if(n!==null)return zs(t,n,e);ps(),t=t.memoizedState,n=ps();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Hs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=qo.updateQueue,t===null&&(t=ms(),qo.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 Us(){return ps().memoizedState}function Ws(e,t,n,r){var i=fs();qo.flags|=e,i.memoizedState=Hs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Gs(e,t,n,r){var i=ps();r=r===void 0?null:r;var a=i.memoizedState.inst;Jo!==null&&r!==null&&is(r,Jo.memoizedState.deps)?i.memoizedState=Hs(t,a,n,r):(qo.flags|=e,i.memoizedState=Hs(1|t,a,n,r))}function Ks(e,t){Ws(8390656,8,e,t)}function qs(e,t){Gs(2048,8,e,t)}function Js(e){qo.flags|=4;var t=qo.updateQueue;if(t===null)t=ms(),qo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ys(e){var t=ps().memoizedState;return Js({ref:t,nextImpl:e}),function(){if(sd&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Xs(e,t){return Gs(4,2,e,t)}function Zs(e,t){return Gs(4,4,e,t)}function Qs(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 $s(e,t,n){n=n==null?null:n.concat([e]),Gs(4,4,Qs.bind(null,t,e),n)}function ec(){}function tc(e,t){var n=ps();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&is(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function nc(e,t){var n=ps();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&is(t,r[1]))return r[0];if(r=e(),Qo){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r}function rc(e,t,n){return n===void 0||Ko&1073741824&&!(ud&261930)?e.memoizedState=t:(e.memoizedState=n,e=Wd(),qo.lanes|=e,vd|=e,n)}function L(e,t,n,r){return Wr(n,t)?n:Ao.current===null?!(Ko&106)||Ko&1073741824&&!(ud&261930)?(zc=!0,e.memoizedState=n):(e=Wd(),qo.lanes|=e,vd|=e,t):(e=rc(e,n,r),Wr(e,t)||(zc=!0),e)}function ic(e,t,n,r,i){var a=ge.p;ge.p=a!==0&&8>a?a:8;var o=F.T,s={};s.types=o===null?null:o.types,F.T=s,gc(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?hc(e,t,qa(c,r),Ud(e)):hc(e,t,r,Ud(e))}catch(n){hc(e,t,{then:function(){},status:`rejected`,reason:n},Ud())}finally{ge.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function ac(){}function oc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=sc(e).queue;ic(e,a,t,_e,n===null?ac:function(){return cc(e),n(r)})}function sc(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:vs,lastRenderedState:_e},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function cc(e){var t=sc(e);t.next===null&&(t=e.alternate.memoizedState),hc(e,t.next.queue,{},Ud())}function lc(){return ka(xh)}function uc(){return ps().memoizedState}function dc(){return ps().memoizedState}function fc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ud();e=xo(n);var r=So(t,e,n);r!==null&&(Kd(r,t,n),Co(r,t,n)),t={cache:Ia()},e.payload=t;return}t=t.return}}function pc(e,t,n){var r=Ud();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},_c(e)?vc(t,n):(n=ki(e,t,n,r),n!==null&&(Kd(n,e,r),yc(n,t,r)))}function mc(e,t,n){hc(e,t,n,Ud())}function hc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(_c(e))vc(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,Wr(s,o))return Oi(e,t,i,0),cd===null&&Di(),!1}catch{}if(n=ki(e,t,i,r),n!==null)return Kd(n,e,r),yc(n,t,r),!0}return!1}function gc(e,t,n,r){if(r={lane:2,revertLane:qf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},_c(e)){if(t)throw Error(i(479))}else t=ki(e,n,r,2),t!==null&&Kd(t,e,2)}function _c(e){var t=e.alternate;return e===qo||t!==null&&t===qo}function vc(e,t){Zo=Xo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function yc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vt(e,n)}}var bc={readContext:ka,use:gs,useCallback:rs,useContext:rs,useEffect:rs,useImperativeHandle:rs,useLayoutEffect:rs,useInsertionEffect:rs,useMemo:rs,useReducer:rs,useRef:rs,useState:rs,useDebugValue:rs,useDeferredValue:rs,useTransition:rs,useSyncExternalStore:rs,useId:rs,useHostTransitionStatus:rs,useFormState:rs,useActionState:rs,useOptimistic:rs,useMemoCache:rs,useCacheRefresh:rs,useEffectEvent:rs},xc={readContext:ka,use:gs,useCallback:function(e,t){return fs().memoizedState=[e,t===void 0?null:t],e},useContext:ka,useEffect:Ks,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ws(4194308,4,Qs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ws(4194308,4,e,t)},useInsertionEffect:function(e,t){Ws(4,2,e,t)},useMemo:function(e,t){var n=fs();t=t===void 0?null:t;var r=e();if(Qo){et(!0);try{e()}finally{et(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=fs();if(n!==void 0){var i=n(t);if(Qo){et(!0);try{n(t)}finally{et(!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=pc.bind(null,qo,e),[r.memoizedState,e]},useRef:function(e){var t=fs();return e={current:e},t.memoizedState=e},useState:function(e){e=Os(e);var t=e.queue,n=mc.bind(null,qo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ec,useDeferredValue:function(e,t){return rc(fs(),e,t)},useTransition:function(){var e=Os(!1);return e=ic.bind(null,qo,e.queue,!0,!1),fs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=qo,a=fs();if(ca){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),cd===null)throw Error(i(349));ud&127||Cs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ks(Ts.bind(null,r,o,e),[e]),r.flags|=2048,Hs(9,{destroy:void 0},ws.bind(null,r,o,n,t),null),n},useId:function(){var e=fs(),t=cd.identifierPrefix;if(ca){var n=ea,r=$i;n=(r&~(1<<32-tt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=$o++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=ns++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:lc,useFormState:Ls,useActionState:Ls,useOptimistic:function(e){var t=fs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=gc.bind(null,qo,!0,n),n.dispatch=t,[e,t]},useMemoCache:_s,useCacheRefresh:function(){return fs().memoizedState=fc.bind(null,qo)},useEffectEvent:function(e){var t=fs(),n={impl:e};return t.memoizedState=n,function(){if(sd&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Sc={readContext:ka,use:gs,useCallback:tc,useContext:ka,useEffect:qs,useImperativeHandle:$s,useInsertionEffect:Xs,useLayoutEffect:Zs,useMemo:nc,useReducer:ys,useRef:Us,useState:function(){return ys(vs)},useDebugValue:ec,useDeferredValue:function(e,t){return L(ps(),Jo.memoizedState,e,t)},useTransition:function(){var e=ys(vs)[0],t=ps().memoizedState;return[typeof e==`boolean`?e:hs(e),t]},useSyncExternalStore:Ss,useId:uc,useHostTransitionStatus:lc,useFormState:Rs,useActionState:Rs,useOptimistic:function(e,t){return ks(ps(),Jo,e,t)},useMemoCache:_s,useCacheRefresh:dc,useEffectEvent:Ys},Cc={readContext:ka,use:gs,useCallback:tc,useContext:ka,useEffect:qs,useImperativeHandle:$s,useInsertionEffect:Xs,useLayoutEffect:Zs,useMemo:nc,useReducer:xs,useRef:Us,useState:function(){return xs(vs)},useDebugValue:ec,useDeferredValue:function(e,t){var n=ps();return Jo===null?rc(n,e,t):L(n,Jo.memoizedState,e,t)},useTransition:function(){var e=xs(vs)[0],t=ps().memoizedState;return[typeof e==`boolean`?e:hs(e),t]},useSyncExternalStore:Ss,useId:uc,useHostTransitionStatus:lc,useFormState:Vs,useActionState:Vs,useOptimistic:function(e,t){var n=ps();return Jo===null?(n.baseState=e,[e,n.queue.dispatch]):ks(n,Jo,e,t)},useMemoCache:_s,useCacheRefresh:dc,useEffectEvent:Ys};function wc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Tc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ud(),i=xo(r);i.payload=t,n!=null&&(i.callback=n),t=So(e,i,r),t!==null&&(Kd(t,e,r),Co(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ud(),i=xo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=So(e,i,r),t!==null&&(Kd(t,e,r),Co(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ud(),r=xo(n);r.tag=2,t!=null&&(r.callback=t),t=So(e,r,n),t!==null&&(Kd(t,e,n),Co(t,e,n))}};function Ec(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?!Gr(n,r)||!Gr(i,a):!0}function Dc(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&&Tc.enqueueReplaceState(t,t.state,null)}function Oc(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=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function kc(e){Ci(e)}function Ac(e){console.error(e)}function jc(e){Ci(e)}function Mc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Nc(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 Pc(e,t,n){return n=xo(n),n.tag=3,n.payload={element:null},n.callback=function(){Mc(e,t)},n}function Fc(e){return e=xo(e),e.tag=3,e}function Ic(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(){Nc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Nc(t,n,r),typeof i!=`function`&&(Ad===null?Ad=new Set([this]):Ad.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Lc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ea(t,n,a,!0),n=Fo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Io===null?af():n.alternate===null&&_d===0&&(_d=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===no?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Df(e,r,a)),!1;case 22:return n.flags|=65536,r===no?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)),Df(e,r,a)),!1}throw Error(i(435,n.tag))}return Df(e,r,a),af(),!1}if(ca)return t=Fo.current,t===null?(r!==da&&(t=Error(i(423),{cause:r}),va(Gi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Gi(r,n),a=Pc(e.stateNode,r,a),wo(e,a),_d!==4&&(_d=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==da&&(e=Error(i(422),{cause:r}),va(Gi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Gi(o,n),Cd===null?Cd=[o]:Cd.push(o),_d!==4&&(_d=2),t===null)return!0;r=Gi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Pc(n.stateNode,r,e),wo(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`&&(Ad===null||!Ad.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Fc(a),Ic(a,e,n,r),wo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Rc=Error(i(461)),zc=!1;function Bc(e,t,n,r){t.child=e===null?_o(t,null,n,r):go(t,e.child,n,r)}function Vc(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 Oa(t),r=as(e,t,n,o,a,i),s=ls(),e!==null&&!zc?(us(e,t,i),hl(e,t,i)):(ca&&s&&ra(t),t.flags|=1,Bc(e,t,r,i),t.child)}function Hc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Uc(e,t,a,r,i)):(e=zi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!gl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Gr:n,n(o,r)&&e.ref===t.ref)return hl(e,t,i)}return t.flags|=1,e=Li(a,r),e.ref=t.ref,e.return=t,t.child=e}function Uc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Gr(a,r)&&e.ref===t.ref){if(zc=!1,t.pendingProps=r=a,gl(e,i))e.flags&131072&&(zc=!0);else return t.lanes=e.lanes,hl(e,t,i)}}return Zc(e,t,n,r,i)}function Wc(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 Kc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Za(t,a===null?null:a.cachePool),a===null?No():Mo(t,a),zo(t);else return r=t.lanes=536870912,Kc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Za(t,null),No(),Bo()):(Za(t,a.cachePool),Mo(t,a),Bo(),t.memoizedState=null);return Bc(e,t,i,n),t.child}function Gc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Kc(e,t,n,r,i){var a=Xa();return a=a===null?null:{parent:Fa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Za(t,null),No(),zo(t),e!==null&&Ea(e,t,r,!0),t.childLanes=i,null}function qc(e,t){return t=ol({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Jc(e,t,n){return go(t,e.child,null,n),e=qc(t,t.pendingProps),e.flags|=2,Vo(t),t.memoizedState=null,e}function Yc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(ca){if(r.mode===`hidden`)return e=qc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Gc(null,e);if(Ro(t),(e=sa)?(e=bm(e,ua),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qi===null?null:{id:$i,overflow:ea},retryLane:536870912,hydrationErrors:null},n=Hi(e),n.return=t,t.child=n,oa=t,sa=null)):e=null,e===null)throw fa(t);return t.lanes=536870912,null}return qc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ro(t),a){if(t.flags&256)t.flags&=-257,t=Jc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(zc||Ea(e,t,n,!1),a=(n&e.childLanes)!==0,zc||a){if(Ao.current===null){if(r=cd,r!==null&&(s=yt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ai(e,s),Kd(r,e,s),Rc;af()}t=Jc(e,t,n)}else e=o.treeContext,sa=wm(s.nextSibling),oa=t,ca=!0,la=null,ua=!1,e!==null&&aa(t,e),t=qc(t,r),t.flags|=134221824;return t}return e=Li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Xc(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 Zc(e,t,n,r,i){return Oa(t),n=as(e,t,n,r,void 0,i),r=ls(),e!==null&&!zc?(us(e,t,i),hl(e,t,i)):(ca&&r&&ra(t),t.flags|=1,Bc(e,t,n,i),t.child)}function Qc(e,t,n,r,i,a){return Oa(t),t.updateQueue=null,n=ss(t,r,n,i),os(e),r=ls(),e!==null&&!zc?(us(e,t,a),hl(e,t,a)):(ca&&r&&ra(t),t.flags|=1,Bc(e,t,n,a),t.child)}function $c(e,t,n,r,i){if(Oa(t),t.stateNode===null){var a=Ni,o=n.contextType;typeof o==`object`&&o&&(a=ka(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Tc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},yo(t),o=n.contextType,a.context=typeof o==`object`&&o?ka(o):Ni,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(wc(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&&Tc.enqueueReplaceState(a,a.state,null),Do(t,r,a,i),Eo(),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=Oc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ni,typeof u==`object`&&u&&(o=ka(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)&&Dc(t,a,r,o),vo=!1;var f=t.memoizedState;a.state=f,Do(t,r,a,i),Eo(),l=t.memoizedState,s||f!==l||vo?(typeof d==`function`&&(wc(t,n,d,r),l=t.memoizedState),(c=vo||Ec(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,bo(e,t),o=t.memoizedProps,u=Oc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ni,typeof l==`object`&&l&&(c=ka(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)&&Dc(t,a,r,c),vo=!1,f=t.memoizedState,a.state=f,Do(t,r,a,i),Eo();var p=t.memoizedState;o!==d||f!==p||vo||e!==null&&e.dependencies!==null&&Da(e.dependencies)?(typeof s==`function`&&(wc(t,n,s,r),p=t.memoizedState),(u=vo||Ec(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Da(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,Xc(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=go(t,e.child,null,i),t.child=go(t,null,n,i)):Bc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=hl(e,t,i),e}function el(e,t,n,r){return ga(),t.flags|=256,Bc(e,t,n,r),t.child}var tl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nl(e){return{baseLanes:e,cachePool:Qa()}}function rl(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=xd),e}function il(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ho.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ca){if(i?Lo(t):Bo(),(e=sa)?(e=bm(e,ua),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qi===null?null:{id:$i,overflow:ea},retryLane:536870912,hydrationErrors:null},n=Hi(e),n.return=t,t.child=n,oa=t,sa=null)):e=null,e===null)throw fa(t);return t.lanes=Sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Bo(),i=t.mode,a=ol({mode:`hidden`,children:a},i),r=Bi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=nl(n),r.childLanes=rl(e,o,n),t.memoizedState=tl,Gc(null,r)):(Lo(t),al(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return cl(e,t,a,o,r,c,s,n)}return i?(Bo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Li(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Bi(i,a,n,null),i.flags|=2):i=Li(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Gc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=nl(n):(a=i.cachePool,a===null?a=Qa():(s=Fa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=rl(e,o,n),t.memoizedState=tl,Gc(e.child,r)):(Lo(t),n=e.child,e=n.sibling,n=Li(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 al(e,t){return t=ol({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function ol(e,t){return e=Fi(22,e,null,t),e.lanes=0,e}function sl(e,t,n){return go(t,e.child,null,n),e=al(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Lo(t),t.flags&=-257,sl(e,t,c)):t.memoizedState===null?(Bo(),o=a.fallback,s=t.mode,a=ol({mode:`visible`,children:a.children},s),o=Bi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,go(t,e.child,null,c),a=t.child,a.memoizedState=nl(c),a.childLanes=rl(e,r,c),t.memoizedState=tl,Gc(null,a)):(Bo(),t.child=e.child,t.flags|=128,null);if(Lo(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,va({value:a,source:null,stack:null})),sl(e,t,c)}if(zc||Ea(e,t,c,!1),r=(c&e.childLanes)!==0,zc||r){if(Ao.current!==null)return sl(e,t,c);if(r=cd,r!==null&&(a=yt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ai(e,a),Kd(r,e,a),Rc;return xm(o)||af(),sl(e,t,c)}return xm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,sa=wm(o.nextSibling),oa=t,ca=!0,la=null,ua=!1,e!==null&&aa(t,e),t=al(t,a.children),t.flags|=134221824,t)}function ll(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),wa(e.return,t,n)}function ul(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Go(n)===null&&(t=e),e=e.sibling}return t}function dl(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 fl(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 pl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ho.current;if(t.flags&128)return Uo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Uo(t,o),i===`backwards`&&e!==null?(fl(e),Bc(e,t,r,n),fl(e)):Bc(e,t,r,n),r=ca?Yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ll(e,n,t);else if(e.tag===19)ll(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=ul(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,fl(t)),dl(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&&Go(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}dl(t,!0,n,null,a,r);break;case`together`:dl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=ul(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),dl(t,!1,i,n,a,r)}return t.child}function ml(e,t,n){var r=t.pendingProps;return Sa(t,t.type,r.value),Bc(e,t,r.children,n),t.child}function hl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),vd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ea(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=Li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function gl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Da(e)))}function _l(e,t,n){switch(t.tag){case 3:De(t,t.stateNode.containerInfo),Sa(t,Fa,e.memoizedState.cache),ga();break;case 27:case 5:ke(t);break;case 4:De(t,t.stateNode.containerInfo);break;case 10:Sa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ro(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Lo(t),t.flags|=128,null;r=Ea(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?il(e,t,n):(Lo(t),e=hl(e,t,n),e===null?null:e.sibling)}Lo(t);break;case 19:if(t.flags&128)return pl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ea(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return pl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Uo(t,Ho.current),r)break;return null;case 22:return t.lanes=0,Wc(e,t,n,t.pendingProps);case 24:Sa(t,Fa,e.memoizedState.cache)}return hl(e,t,n)}function vl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)zc=!0;else{if(!gl(e,n)&&!(t.flags&128))return zc=!1,_l(e,t,n);zc=!!(e.flags&131072)}}else zc=!1,ca&&t.flags&1048576&&na(t,Yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ao(t.elementType),t.type=e,typeof e==`function`)Ii(e)?(r=Oc(e,r),t.tag=1,t=$c(null,t,e,r,n)):(t.tag=0,t=Zc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===k){t.tag=11,t=Vc(null,t,e,r,n);break a}if(a===ce){t.tag=14,t=Hc(null,t,e,r,n);break a}if(a===oe){t.tag=10,t.type=e,t=ml(null,t,n);break a}}throw t=me(e)||e,Error(i(306,t,``))}}return t;case 0:return Zc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Oc(r,t.pendingProps),$c(e,t,r,a,n);case 3:a:{if(De(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,bo(e,t),Do(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Sa(t,Fa,r),r!==o.cache&&Ta(t,[Fa],n,!0),Eo(),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=el(e,t,r,n);break a}if(r!==a){a=Gi(Error(i(424)),t),va(a),t=el(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(sa=wm(e.firstChild),oa=t,ca=!0,la=null,ua=!0,n=_o(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ga(),r===a){t=hl(e,t,n);break a}Bc(e,t,r,n)}t=t.child}return t;case 26:return Xc(e,t),e===null?(n=Jm(t.type,null,t.pendingProps,null))?t.memoizedState=n:ca||(t.stateNode=Dp(t.type,t.pendingProps,Te.current,t)):t.memoizedState=Jm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ke(t),e===null&&ca&&(r=t.stateNode=Am(t.type,t.pendingProps,Te.current),oa=t,ua=!0,a=sa,Lp(t.type)?(Tm=a,sa=wm(r.firstChild)):sa=a),Bc(e,t,t.pendingProps.children,n),Xc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ca&&((a=r=sa)&&(r=vm(r,t.type,t.pendingProps,ua),r===null?a=!1:(t.stateNode=r,oa=t,sa=wm(r.firstChild),ua=!1,a=!0)),a||fa(t)),ke(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Op(a,o)?r=null:s!==null&&Op(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=as(e,t,cs,null,null,n),xh._currentValue=a),Xc(e,t),Bc(e,t,r,n),t.child;case 6:return e===null&&ca&&((e=n=sa)&&(n=ym(n,t.pendingProps,ua),n===null?e=!1:(t.stateNode=n,oa=t,sa=null,e=!0)),e||fa(t)),null;case 13:return il(e,t,n);case 4:return De(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=go(t,null,r,n):Bc(e,t,r,n),t.child;case 11:return Vc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Xc(e,t),Bc(e,t,r,n),t.child;case 8:return Bc(e,t,t.pendingProps.children,n),t.child;case 12:return Bc(e,t,t.pendingProps.children,n),t.child;case 10:return ml(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Oa(t),a=ka(a),r=r(a),t.flags|=1,Bc(e,t,r,n),t.child;case 14:return Hc(e,t,t.type,t.pendingProps,n);case 15:return Uc(e,t,t.type,t.pendingProps,n);case 19:return pl(e,t,n);case 31:return Yc(e,t,n);case 22:return Wc(e,t,n,t.pendingProps);case 24:return Oa(t),r=ka(Fa),e===null?(a=Xa(),a===null&&(a=cd,o=Ia(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},yo(t),Sa(t,Fa,a)):((e.lanes&n)!==0&&(bo(e,t),Do(t,null,null,n),Eo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Sa(t,Fa,r),r!==a.cache&&Ta(t,[Fa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Sa(t,Fa,r))),Bc(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:ca&&ra(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Xc(e,t),Bc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function yl(e){e.flags|=4}function bl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?ch(t,r):ch(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(tf())e.flags|=8192;else throw oo=no,eo}}else e.flags&=-16777217}function xl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!lh(t)){if(tf())e.flags|=8192;else throw oo=no,eo}}function Sl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:pt(),e.lanes|=t,Sd|=t)}function Cl(e,t){if(!ca)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 wl(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 Tl(e,t,n){var r=t.pendingProps;switch(ia(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wl(t),null;case 1:return wl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ca(Fa),Oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ha(t)?yl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,_a())),wl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(yl(t),o===null?(wl(t),bl(t,a,null,r,n)):(wl(t),xl(t,o))):o?o===e.memoizedState?(wl(t),t.flags&=-16777217):(yl(t),wl(t),xl(t,o)):(e=e.memoizedProps,e!==r&&yl(t),wl(t),bl(t,a,e,r,n)),null;case 27:if(Ae(t),n=Te.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&yl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return wl(t),t.subtreeFlags&=-33554433,null}e=Ce.current,ha(t)?pa(t,e):(e=Am(a,r,n),t.stateNode=e,yl(t))}return wl(t),t.subtreeFlags&=-33554433,null;case 5:if(Ae(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&yl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return wl(t),t.subtreeFlags&=-33554433,null}if(o=Ce.current,ha(t))pa(t,o);else{var s=wp(Te.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[wt]=t,o[Tt]=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(_p(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&&yl(t)}}return wl(t),t.subtreeFlags&=-33554433,bl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&yl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Te.current,ha(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=oa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[wt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||mp(e.nodeValue,n)),e||fa(t,!0)}else e=wp(e).createTextNode(r),e[wt]=t,t.stateNode=e}return wl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ha(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[wt]=t}else ga(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;wl(t),e=!1}else n=_a(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Vo(t),t):(Vo(t),null);if(t.flags&128)throw Error(i(558))}return wl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ha(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[wt]=t}else ga(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;wl(t),a=!1}else a=_a(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Vo(t),t):(Vo(t),null)}return Vo(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),Sl(t,t.updateQueue),wl(t),null);case 4:return Oe(),e===null&&ip(t.stateNode.containerInfo),t.flags|=67108864,wl(t),null;case 10:return Ca(t.type),wl(t),null;case 19:if(Wo(t),r=t.memoizedState,r===null)return wl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Cl(r,!1);else{if(_d!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Go(e),o!==null){for(t.flags|=128,Cl(r,!1),e=o.updateQueue,t.updateQueue=e,Sl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ri(n,e),n=n.sibling;return Uo(t,Ho.current&1|2),ca&&ta(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ue()>Od&&(t.flags|=128,a=!0,Cl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Go(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Sl(t,e),Cl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ca)return wl(t),null}else 2*Ue()-r.renderingStartTime>Od&&n!==536870912&&(t.flags|=128,a=!0,Cl(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=Ue(),e.sibling=null,o=Ho.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ca?Uo(t,o):(n=o,Se(Fo,t),Se(Ho,n),Io===null&&(Io=t)),ca&&ta(t,r.treeForkCount),e}return wl(t),null;case 22:case 23:return Vo(t),Po(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(wl(t),t.subtreeFlags&6&&(t.flags|=8192)):wl(t),n=t.updateQueue,n!==null&&Sl(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&&xe(Ya),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ca(Fa),wl(t),null;case 25:return null;case 30:return t.flags|=33554432,wl(t),null}throw Error(i(156,t.tag))}function El(e,t){switch(ia(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ca(Fa),Oe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(Vo(t),t.alternate===null)throw Error(i(340));ga()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Vo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ga()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Wo(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 Oe(),null;case 10:return Ca(t.type),null;case 22:case 23:return Vo(t),Po(),e!==null&&xe(Ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ca(Fa),null;case 25:return null;default:return null}}function Dl(e,t){switch(ia(t),t.tag){case 3:Ca(Fa),Oe();break;case 26:case 27:case 5:Ae(t);break;case 4:Oe();break;case 31:t.memoizedState!==null&&Vo(t);break;case 13:Vo(t);break;case 19:Wo(t);break;case 10:Ca(t.type);break;case 22:case 23:Vo(t),Po(),e!==null&&xe(Ya);break;case 24:Ca(Fa)}}function Ol(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){Ef(t,t.return,e)}}function kl(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){Ef(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ef(t,t.return,e)}}function Al(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ko(t,n)}catch(t){Ef(e,e.return,t)}}}function jl(e,t,n){n.props=Oc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ef(e,t,n)}}function Ml(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=bi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Yp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Xp(e);m(e.child,!1,pm,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){Ef(e,t,n)}}function Nl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Ef(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){Ef(e,t,n)}else n.current=null}}function Pl(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++)hm(e.stateNode,t[n])}function Fl(e){for(var t=e.return;t!==null&&(Rl(t)&&hm(e.stateNode,t.stateNode),!Ll(t));)t=t.return}function Il(e){for(var t=e.return;t!==null&&(Rl(t)&&gm(e.stateNode,t.stateNode),!Ll(t));)t=t.return}function Ll(e){return e.tag===5||e.tag===3||e.tag===27}function Rl(e){return e&&e.tag===7&&e.stateNode!==null}function zl(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){Ef(e,e.return,t)}}function Bl(e,t,n){try{var r=e.stateNode;yp(r,e.type,n,t),r[Tt]=t}catch(t){Ef(e,e.return,t)}}function Vl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Lp(e.type)||e.tag===4}function Hl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Vl(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&&Lp(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 Ul(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=xn)),Pl(e,r),Jt=!0;else if(i!==4&&(i===27&&(Pl(e,r),r=null,Lp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ul(e,t,n,r),e=e.sibling;e!==null;)Ul(e,t,n,r),e=e.sibling}function Wl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Pl(e,r),Jt=!0;else if(i!==4&&(i===27&&(Pl(e,r),r=null,Lp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Wl(e,t,n,r),e=e.sibling;e!==null;)Wl(e,t,n,r),e=e.sibling}function Gl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);_p(t,r,n),t[wt]=e,t[Tt]=n}catch(t){Ef(e,e.return,t)}}var Kl=!1,ql=null;function Jl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Kl=!0)}var Yl=null;function Xl(){var e=Yl;return Yl=null,e}var Zl=0;function Ql(e,t,n,r,i){return Zl=0,$l(e.child,t,n,r,i)}function $l(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Up(o);r.push(s),s.view&&(a=!0)}else a||Up(o).view&&(a=!0);Kl=!0,Bp(o,Zl===0?t:t+`_`+Zl,n),Zl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||$l(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function eu(e,t){for(;e!==null;)e.tag===5?Vp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||eu(e.child,t)),e=e.sibling}function tu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(tu(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=Si(t.default,t.share),t!==`none`&&(Ql(e,n,t,null,!1)||eu(e.child,!1))}e=e.sibling}}function nu(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=bi(r,n),a=Si(r.default,n.paired?r.share:r.enter);a===`none`?tu(e):Ql(e,i,a,null,!1)?(tu(e),n.paired||t||Gd(e,r.onEnter)):eu(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)nu(e,t),e=e.sibling;else tu(e)}function ru(e){if(ql!==null&&ql.size!==0){var t=ql;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=Si(n.default,n.share);if(a!==`none`&&(Ql(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Gd(e,n.onShare)):eu(e.child,!1)),t.delete(r),t.size===0)break}}}ru(e)}e=e.sibling}}}function iu(e){if(e.tag===30){var t=e.memoizedProps,n=bi(t,e.stateNode),r=ql===null?void 0:ql.get(n),i=Si(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Ql(e,n,i,null,!1)?r===void 0?Gd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,ql.delete(n),Gd(e,t.onShare)):eu(e.child,!1)),ql!==null&&ru(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)iu(e),e=e.sibling;else ql!==null&&ru(e)}function au(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=bi(t,e.stateNode);t=Si(t.default,t.update),e.flags&=-5,t!==`none`&&Ql(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&au(e);e=e.sibling}}function ou(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,eu(e.child,!1))}ou(e)}e=e.sibling}}function su(e){if(e.tag===30)e.stateNode.paired=null,eu(e.child,!1),ou(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)su(e),e=e.sibling;else ou(e)}function cu(e){for(e=e.child;e!==null;)e.tag===30?eu(e.child,!1):e.subtreeFlags&33554432&&cu(e),e=e.sibling}function lu(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=Up(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&&Bp(c,Zl===0?n:n+`_`+Zl,i),s&&e.flags&4||(Yl===null&&(Yl=[]),Yl.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:lu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function uu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=bi(n,r),a=Si(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Wp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Zl=0,i=lu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Gd(e,n.onUpdate))}else e.subtreeFlags&33554432&&uu(e,t);e=e.sibling}}var du=!1,fu=!1,pu=!1,mu=!1,hu=typeof WeakSet==`function`?WeakSet:Set,gu=null,_u=!1,vu=!1,yu=!1,bu=!1;function xu(e,t,n){if(e=e.containerInfo,Sp=Ah,e=Xr(e),Zr(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},Ah=!1,n=(n&335544064)===n,gu=t,t=n?9270:1024;gu!==null;){if(e=gu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&iu(r[a]);if(e.alternate===null&&e.flags&2)n&&Jl(e),Su(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&iu(r),Su(n);continue}if(r!==null&&r.memoizedState!==null){n&&Jl(e),Su(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,gu=r):(n&&au(e),Su(n))}}ql=null}function Su(e){for(;gu!==null;){var t=gu,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=Oc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Ef(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)_m(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:_m(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=bi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=Si(a.default,a.update),a!==`none`&&Ql(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,gu=r;break}gu=t.return}}function Cu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Hu(e,n),r&4&&Ol(5,n);break;case 1:if(Hu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ef(n,n.return,e)}else{var i=Oc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ef(n,n.return,e)}}}r&64&&Al(n),r&512&&Ml(n,n.return);break;case 3:if(Hu(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{ko(e,t)}catch(e){Ef(n,n.return,e)}}break;case 27:t===null&&r&4&&Gl(n);case 26:case 5:Hu(e,n),t===null&&r&4&&zl(n),r&512&&Ml(n,n.return);break;case 12:Hu(e,n);break;case 31:Hu(e,n),r&4&&Mu(e,n);break;case 13:Hu(e,n),r&4&&Nu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Af.bind(null,n),Cm(e,n))));break;case 22:if(r=n.memoizedState!==null||du,!r){var a=t!==null&&t.memoizedState!==null||fu;t=du,i=fu,du=r,(fu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Wu(e,n,r)):Hu(e,n),du=t,fu=i}break;case 30:Hu(e,n),r&512&&Ml(n,n.return);break;case 7:r&512&&Ml(n,n.return);default:Hu(e,n)}}function wu(e,t){for(e=e.child;e!==null;)Tu(e,t),e=e.sibling}function Tu(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){Ef(e,e.return,t)}Eu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Jt=!0}catch(t){Ef(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?zp(s,!0):zp(e.stateNode,!1)}catch(t){Ef(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&wu(e,t);break;default:wu(e,t)}}function Eu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:Tu(n,r);break a;case 22:n.memoizedState===null&&Eu(n,r);break a;default:Eu(n,r)}}e=e.sibling}}function Du(e){var t=e.alternate;t!==null&&(e.alternate=null,Du(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nt(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 Ou=null,ku=!1;function Au(e,t,n){for(n=n.child;n!==null;)ju(e,t,n),n=n.sibling}function ju(e,t,n){if($e&&typeof $e.onCommitFiberUnmount==`function`)try{$e.onCommitFiberUnmount(Qe,n)}catch{}switch(n.tag){case 26:fu||Nl(n,t),Au(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!fu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:fu||Nl(n,t),Il(n);var r=Ou,i=ku;Lp(n.type)&&(Ou=n.stateNode,ku=!1),Au(e,t,n),jm(n.stateNode,n.type,n.memoizedProps),Ou=r,ku=i;break;case 5:fu||Nl(n,t),Il(n);case 6:if(n.tag===6&&Il(n),r=Ou,i=ku,Ou=null,Au(e,t,n),Ou=r,ku=i,Ou!==null){if(ku)try{(Ou.nodeType===9?Ou.body:Ou.nodeName===`HTML`?Ou.ownerDocument.body:Ou).removeChild(n.stateNode),Jt=!0}catch(e){Ef(n,t,e)}else try{Ou.removeChild(n.stateNode),Jt=!0}catch(e){Ef(n,t,e)}}break;case 18:Ou!==null&&(ku?(e=Ou,Rp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),ng(e)):Rp(Ou,n.stateNode));break;case 4:r=Ou,i=ku,Ou=n.stateNode.containerInfo,ku=!0,Au(e,t,n),Ou=r,ku=i;break;case 0:case 11:case 14:case 15:kl(2,n,t),fu||kl(4,n,t),Au(e,t,n);break;case 1:fu||(Nl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&jl(n,t,r)),Au(e,t,n);break;case 21:Au(e,t,n);break;case 22:fu=(r=fu)||n.memoizedState!==null,Au(e,t,n),fu=r;break;case 30:Nl(n,t),Au(e,t,n);break;case 7:fu||Nl(n,t),Au(e,t,n);break;default:Au(e,t,n)}}function Mu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ng(e)}catch(e){Ef(t,t.return,e)}}}function Nu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ng(e)}catch(e){Ef(t,t.return,e)}}function Pu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new hu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new hu),t;default:throw Error(i(435,e.tag))}}function Fu(e,t){var n=Pu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=jf.bind(null,e,t);t.then(r,r)}})}function Iu(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(Lp(l.type)){Ou=l.stateNode,ku=!1;break a}break;case 5:Ou=l.stateNode,ku=!1;break a;case 3:case 4:Ou=l.stateNode.containerInfo,ku=!0;break a}l=l.return}if(Ou===null)throw Error(i(160));ju(s,c,o),Ou=null,ku=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ru(t,e,n),t=t.sibling}var Lu=null;function Ru(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}Iu(t,e,n),R(e),a&4&&(kl(3,e,e.return),Ol(3,e),kl(5,e,e.return));break;case 1:Iu(t,e,n),R(e),a&512&&(fu||r===null||Nl(r,r.return)),a&64&&du&&(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=Lu,Iu(t,e,n),R(e),a&512&&(fu||r===null||Nl(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(du)e.stateNode=Dp(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[jt]||r[wt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),_p(r,t,n),r[wt]=e,Rt(r),t=r;break a;case`link`:if(o=ah(`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),_p(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=ah(`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),_p(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[wt]=e,Rt(r),t=r}e.stateNode=t}}else du||oh(o,e.type,e.stateNode)}else e.stateNode=th(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Bl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||fu||t.parentNode.removeChild(t)):a.count--,n===null?du||oh(o,e.type,e.stateNode):th(o,n,e.memoizedProps))}break;case 27:Iu(t,e,n),R(e),a&512&&(fu||r===null||Nl(r,r.return)),r!==null&&a&4&&Bl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=pu,pu=!1,Iu(t,e,n),pu=o,R(e),a&512&&(fu||r===null||Nl(r,r.return)),e.flags&32){t=e.stateNode;try{pn(t,``),Jt=!0}catch(t){Ef(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Bl(e,t,r===null?t:r.memoizedProps)),a&1024&&(mu=!0);break;case 6:if(Iu(t,e,n),R(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Jt=!0}catch(t){Ef(e,e.return,t)}}break;case 3:if(Jt=!1,ih=null,o=Lu,Lu=Fm(t.containerInfo),Iu(t,e,n),Lu=o,R(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{ng(t.containerInfo)}catch(t){Ef(e,e.return,t)}mu&&(mu=!1,zu(e)),Jt=!1;break;case 4:a=pu,pu=du,r=Yt(),o=Lu,Lu=Fm(e.stateNode.containerInfo),Iu(t,e,n),R(e),Lu=o,Jt&&vu&&(yu=!0),Jt=r,pu=a;break;case 12:Iu(t,e,n),R(e);break;case 31:Iu(t,e,n),R(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Fu(e,t)));break;case 13:Iu(t,e,n),R(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Ed=Ue()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Fu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=du,l=fu,u=pu;du=c||o,pu=u||o,fu=l||s,Iu(t,e,n),fu=l,pu=u,du=c,R(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||du||fu||(t=s||fu,n=du,r=fu,du=o||du,fu=t,Uu(e,2),du=n,fu=r),!o&&pu||wu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Fu(e,n))));break;case 19:Iu(t,e,n),R(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Fu(e,t)));break;case 30:a&512&&(fu||r===null||Nl(r,r.return)),a=Yt(),o=vu,s=(n&335544064)===n,c=e.memoizedProps,vu=s&&Si(c.default,c.update)!==`none`,Iu(t,e,n),R(e),s&&r!==null&&Jt&&(e.flags|=4),vu=o,Jt=a;break;case 21:break;case 7:a&512&&(fu||r===null||Nl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Iu(t,e,n),R(e)}}function R(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Vl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Rl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ll(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Wl(e,Hl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(pn(l,``),n.flags&=-33),Wl(e,Hl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ul(e,Hl(e),u,s);break;default:throw Error(i(161))}}catch(t){Ef(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;zu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Ah=!0,t.reset(),Ah=!1),e=e.sibling}}function Bu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Vu(t,e),t=t.sibling;else uu(t,!1)}function Vu(e,t){var n=e.alternate;if(n===null)nu(e,!1);else switch(e.tag){case 3:if(bu=_u=!1,Xl(),Bu(t,e),!_u&&!yu){if(e=Yl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Vp(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`})),bu=!0}Yl=null;break;case 5:Bu(t,e);break;case 4:r=_u,_u=!1,Bu(t,e),_u&&(yu=!0),_u=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Bu(t,e):nu(e,!1));break;case 30:r=_u,i=Xl(),_u=!1,Bu(t,e),_u&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=bi(a,o),o=bi(n.memoizedProps,o);var s=Si(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Zl=0,t=lu(e,n,t,o,s,a,!0),Zl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Gd(e,e.memoizedProps.onUpdate),Yl=i):i!==null&&(i.push.apply(i,Yl),Yl=i),_u=e.flags&32?!0:r;break;default:Bu(t,e)}}function Hu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Cu(e,t.alternate,t),t=t.sibling}function Uu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:kl(4,n,n.return),Uu(n,r);break;case 1:Nl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&jl(n,n.return,i),Uu(n,r);break;case 27:r&2&&jm(n.stateNode,n.type,n.memoizedProps);case 5:Nl(n,n.return),n.tag!==5&&n.tag!==27||Il(n),Uu(n,r);break;case 6:Il(n);break;case 26:Nl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||fu||i.parentNode.removeChild(i),Uu(n,r);break;case 22:n.memoizedState===null&&Uu(n,r);break;case 30:Nl(n,n.return),Uu(n,r);break;case 7:Nl(n,n.return);default:Uu(n,r)}e=e.sibling}}function Wu(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:Wu(i,a,n),Ol(4,a);break;case 1:if(Wu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ef(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++)Oo(l[i],c)}catch(e){Ef(r,r.return,e)}}s&&o&64&&Al(a),Ml(a,a.return);break;case 27:n&2&&Gl(a);case 5:a.tag!==5&&a.tag!==27||Fl(a),Wu(i,a,n),s&&r===null&&o&4&&zl(a),Ml(a,a.return);break;case 6:Fl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||du||oh(Fm(c.ownerDocument),a.type,c),Wu(i,a,n),s&&r===null&&o&4&&zl(a),Ml(a,a.return);break;case 12:Wu(i,a,n);break;case 31:Wu(i,a,n),s&&o&4&&Mu(i,a);break;case 13:Wu(i,a,n),s&&o&4&&Nu(i,a);break;case 22:a.memoizedState===null&&Wu(i,a,n),Ml(a,a.return);break;case 30:Wu(i,a,n),Ml(a,a.return);break;case 7:Ml(a,a.return);default:Wu(i,a,n)}t=t.sibling}}function Gu(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&&La(n))}function Ku(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&La(e))}function qu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Ju(e,t,n,r),t=t.sibling;else i&&cu(t)}function Ju(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&su(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:qu(e,t,n,r),a&2048&&Ol(9,t);break;case 1:qu(e,t,n,r);break;case 3:qu(e,t,n,r),i&&bu&&(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&&La(a)));break;case 12:if(a&2048){qu(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){Ef(t,t.return,e)}}else qu(e,t,n,r);break;case 31:qu(e,t,n,r);break;case 13:qu(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&&su(t),o._visibility&2?qu(e,t,n,r):(o._visibility|=2,Yu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&su(s),o._visibility&2?qu(e,t,n,r):Xu(e,t)),a&2048&&Gu(s,t);break;case 24:qu(e,t,n,r),a&2048&&Ku(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(eu(a.child,!0),eu(t.child,!0))),qu(e,t,n,r);break;default:qu(e,t,n,r)}}function Yu(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:Yu(a,o,s,c,i),Ol(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Yu(a,o,s,c,i)):u._visibility&2?Yu(a,o,s,c,i):Xu(a,o),i&&l&2048&&Gu(o.alternate,o);break;case 24:Yu(a,o,s,c,i),i&&l&2048&&Ku(o.alternate,o);break;default:Yu(a,o,s,c,i)}t=t.sibling}}function Xu(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:Xu(n,r),i&2048&&Gu(r.alternate,r);break;case 24:Xu(n,r),i&2048&&Ku(r.alternate,r);break;default:Xu(n,r)}t=t.sibling}}var Zu=8192;function Qu(e,t,n){if(e.subtreeFlags&Zu)for(e=e.child;e!==null;)$u(e,t,n),e=e.sibling}function $u(e,t,n){switch(e.tag){case 26:Qu(e,t,n),e.flags&Zu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&dh(n,e)):fh(n,Lu,e.memoizedState,e.memoizedProps));break;case 5:Qu(e,t,n),e.flags&Zu&&(e=e.stateNode,(t&335544128)===t&&dh(n,e));break;case 3:case 4:var r=Lu;Lu=Fm(e.stateNode.containerInfo),Qu(e,t,n),Lu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Zu,Zu=16777216,Qu(e,t,n),Zu=r):Qu(e,t,n));break;case 30:if((e.flags&Zu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,ql===null&&(ql=new Map),ql.set(r,i)}Qu(e,t,n);break;default:Qu(e,t,n)}}function ed(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 td(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];gu=r,id(r,e)}ed(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)nd(e),e=e.sibling}function nd(e){switch(e.tag){case 0:case 11:case 15:td(e),e.flags&2048&&kl(9,e,e.return);break;case 3:td(e);break;case 12:td(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,rd(e)):td(e);break;default:td(e)}}function rd(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];gu=r,id(r,e)}ed(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:kl(8,t,t.return),rd(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,rd(t));break;default:rd(t)}e=e.sibling}}function id(e,t){for(;gu!==null;){var n=gu;switch(n.tag){case 0:case 11:case 15:kl(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:La(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,gu=r;else a:for(n=e;gu!==null;){r=gu;var i=r.sibling,a=r.return;if(Du(r),r===n){gu=null;break a}if(i!==null){i.return=a,gu=i;break a}gu=a}}}var ad={getCacheForType:function(e){var t=ka(Fa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ka(Fa).controller.signal}},od=typeof WeakMap==`function`?WeakMap:Map,sd=0,cd=null,ld=null,ud=0,dd=0,fd=null,pd=!1,md=!1,hd=!1,gd=0,_d=0,vd=0,yd=0,bd=0,xd=0,Sd=0,Cd=null,wd=null,Td=!1,Ed=0,Dd=0,Od=1/0,kd=null,Ad=null,jd=0,Md=null,Nd=null,Pd=0,Fd=0,Id=null,Ld=null,Rd=null,zd=null,Bd=null,Vd=0,Hd=null;function Ud(){return sd&2&&ud!==0?ud&-ud:F.T===null?St():qf()}function Wd(){if(xd===0){if(!(ud&536870912)||ca){var e=ot;ot<<=1,!(ot&3932160)&&(ot=262144),xd=e}else xd=536870912}return e=Fo.current,e!==null&&(e.flags|=32),xd}function Gd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Yp(bi(e.memoizedProps,n))),zd===null&&(zd=[]),zd.push(t.bind(null,r))}}function Kd(e,t,n){(e===cd&&(dd===2||dd===9)||e.cancelPendingCommit!==null)&&($d(e,0),Xd(e,ud,xd,!1)),ht(e,n),(!(sd&2)||e!==cd)&&(e===cd&&(!(sd&2)&&(yd|=n),_d===4&&Xd(e,ud,xd,!1)),zf(e))}function qd(e,t,n){if(sd&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ut(e,t),a=r?cf(e,t):of(e,t,!0),o=r;do{if(a===0){md&&!r&&Xd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Yd(n))a=of(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=Cd;var l=c.current.memoizedState.isDehydrated;if(l&&($d(c,s).flags|=256),s=of(c,s,!1),s!==2&&s!==6){if(hd&&!l){c.errorRecoveryDisabledLanes|=o,yd|=o,a=4;break a}o=wd,wd=a,o!==null&&(wd===null?wd=o:wd.push.apply(wd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){$d(e,0),Xd(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:Xd(r,t,xd,!pd);break a;case 2:wd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Ed+300-Ue(),10<a)){if(Xd(r,t,xd,!pd),lt(r,0,!0)!==0)break a;Pd=t,r.timeoutHandle=jp(Jd.bind(null,r,n,wd,kd,Td,t,xd,yd,Sd,pd,o,`Throttled`,-0,0),a);break a}Jd(r,n,wd,kd,Td,t,xd,yd,Sd,pd,o,null,-0,0)}break}}while(1);zf(e)}function Jd(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:xn},ql=null,$u(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=gh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?Ed-Ue():(a&4194048)===a?Dd-Ue():0,m=mh(d,m),m!==null)?(Pd=a,e.cancelPendingCommit=m(hf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Xd(e,a,o,!l)):hf(e,t,a,n,r,i,o,s,c,l,u,d)}function Yd(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(!Wr(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 Xd(e,t,n,r){t=dt(e,t),t&=~bd,t&=~yd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-tt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&_t(e,n,t)}function Zd(){return sd&6?!0:(Bf(0,!1),!1)}function Qd(){if(ld!==null){if(dd===0)var e=ld.return;else e=ld,xa=ba=null,ds(e),lo=null,uo=0,e=ld;for(;e!==null;)Dl(e.alternate,e),e=e.return;ld=null}}function $d(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Mp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Pd=0,Qd(),cd=e,ld=n=Li(e.current,null),ud=t,dd=0,fd=null,pd=!1,md=ut(e,t),hd=!1,Sd=xd=bd=yd=vd=_d=0,wd=Cd=null,Td=!1,gd=dt(e,t),Di(),n}function ef(e,t){qo=null,F.H=bc,t===$a||t===to?(t=so(),dd=3):t===eo?(t=so(),dd=4):dd=t===Rc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,fd=t,ld===null&&(_d=1,Mc(e,Gi(t,e.current)))}function tf(){var e=Fo.current;return e===null?!0:(ud&4194048)===ud?Io===null:(ud&62914560)===ud||ud&536870912?e===Io:!1}function nf(){var e=F.H;return F.H=bc,e===null?bc:e}function rf(){var e=F.A;return F.A=ad,e}function af(){_d=4,pd||(ud&4194048)!==ud&&Fo.current!==null||(md=!0),!(vd&134217727)&&!(yd&134217727)||cd===null||Xd(cd,ud,xd,!1)}function of(e,t,n){var r=sd;sd|=2;var i=nf(),a=rf();(cd!==e||ud!==t)&&(kd=null,$d(e,t)),t=!1;var o=_d;a:do try{if(dd!==0&&ld!==null){var s=ld,c=fd;switch(dd){case 8:Qd(),o=6;break a;case 3:case 2:case 9:case 6:Fo.current===null&&(t=!0);var l=dd;if(dd=0,fd=null,ff(e,s,c,l),n&&md){o=0;break a}break;default:l=dd,dd=0,fd=null,ff(e,s,c,l)}}sf(),o=_d;break}catch(t){ef(e,t)}while(1);return t&&e.shellSuspendCounter++,xa=ba=null,sd=r,F.H=i,F.A=a,ld===null&&(cd=null,ud=0,Di()),o}function sf(){for(;ld!==null;)uf(ld)}function cf(e,t){var n=sd;sd|=2;var r=nf(),a=rf();cd!==e||ud!==t?(kd=null,Od=Ue()+500,$d(e,t)):md=ut(e,t);a:do try{if(dd!==0&&ld!==null){t=ld;var o=fd;b:switch(dd){case 1:dd=0,fd=null,ff(e,t,o,1);break;case 2:case 9:if(ro(o)){dd=0,fd=null,df(t);break}t=function(){dd!==2&&dd!==9||cd!==e||(dd=7),zf(e)},o.then(t,t);break a;case 3:dd=7;break a;case 4:dd=5;break a;case 7:ro(o)?(dd=0,fd=null,df(t)):(dd=0,fd=null,ff(e,t,o,7));break;case 5:var s=null;switch(ld.tag){case 26:s=ld.memoizedState;case 5:case 27:var c=ld;if(s?lh(s):c.stateNode.complete){dd=0,fd=null;var l=c.sibling;if(l!==null)ld=l;else{var u=c.return;u===null?ld=null:(ld=u,pf(u))}break b}}dd=0,fd=null,ff(e,t,o,5);break;case 6:dd=0,fd=null,ff(e,t,o,6);break;case 8:Qd(),_d=6;break a;default:throw Error(i(462))}}lf();break}catch(t){ef(e,t)}while(1);return xa=ba=null,F.H=r,F.A=a,sd=n,ld===null?(cd=null,ud=0,Di(),_d):0}function lf(){for(;ld!==null&&!Ve();)uf(ld)}function uf(e){var t=vl(e.alternate,e,gd);e.memoizedProps=e.pendingProps,t===null?pf(e):ld=t}function df(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Qc(n,t,t.pendingProps,t.type,void 0,ud);break;case 11:t=Qc(n,t,t.pendingProps,t.type.render,t.ref,ud);break;case 5:ds(t);var r=t;r===oa&&(ca?(ma(r),r.tag===5&&r.stateNode!=null&&(sa=r.stateNode)):(ma(r),ca=!0));default:Dl(n,t),t=ld=Ri(t,gd),t=vl(n,t,gd)}e.memoizedProps=e.pendingProps,t===null?pf(e):ld=t}function ff(e,t,n,r){xa=ba=null,ds(t),lo=null,uo=0;var i=t.return;try{if(Lc(e,i,t,n,ud)){_d=1,Mc(e,Gi(n,e.current)),ld=null;return}}catch(t){if(i!==null)throw ld=i,t;_d=1,Mc(e,Gi(n,e.current)),ld=null;return}t.flags&32768?(ca||r===1?e=!0:md||ud&536870912?e=!1:(pd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Fo.current,r!==null&&r.tag===13&&(r.flags|=16384))),mf(t,e)):pf(t)}function pf(e){var t=e;do{if(t.flags&32768){mf(t,pd);return}e=t.return;var n=Tl(t.alternate,t,gd);if(n!==null){ld=n;return}if(t=t.sibling,t!==null){ld=t;return}ld=t=e}while(t!==null);_d===0&&(_d=5)}function mf(e,t){do{var n=El(e.alternate,e);if(n!==null){n.flags&=32767,ld=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ld=e;return}ld=e=n}while(e!==null);_d=6,ld=null}function hf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do Cf();while(jd!==0);if(sd&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===cd&&(ld=cd=null,ud=0),Nd=t,Md=e,Pd=n,Id=a,Ld=r,gf(e,t,n,s,c,l,f)}}function gf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Fd=s,s|=Ei,gt(e,n,s,r,i,a),zd=null,(n&335544064)===n?(Bd=Ba(e),r=10262):(Bd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Mf(qe,function(){return wf(),null})):(e.callbackNode=null,e.callbackPriority=0),Kl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=F.T,F.T=null,i=ge.p,ge.p=2,a=sd,sd|=4;try{xu(e,t,n)}finally{sd=a,ge.p=i,F.T=r}}jd=1,Kl?Rd=qp(o,e.containerInfo,Bd,yf,bf,vf,xf,wf,_f,null,null):(yf(),bf(),xf())}function _f(e){if(jd!==0){var t=Md.onRecoverableError;t(e,{componentStack:null})}}function vf(){jd===3&&(jd=0,Vu(Nd,Md),jd=4)}function yf(){if(jd===1){jd=0;var e=Md,t=Nd,n=Pd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=F.T,F.T=null;var i=ge.p;ge.p=2;var a=sd;sd|=4;try{vu=yu=!1,Ru(t,e,n),n=Cp;var o=Xr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Yr(s.ownerDocument.documentElement,s)){if(c!==null&&Zr(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 _=Jr(s,h),v=Jr(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}}Ah=!!Sp,Cp=Sp=null}finally{sd=a,ge.p=i,F.T=r}}e.current=t,jd=2}}function bf(){if(jd===2){jd=0;var e=Md,t=Nd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=ge.p;ge.p=2;var i=sd;sd|=4;try{Cu(e,t.alternate,t)}finally{sd=i,ge.p=r,F.T=n}}jd=3}}function xf(){if(jd===4||jd===3){jd=0;var e=Rd;Rd=null,He();var t=Md,n=Nd,r=Pd,i=Ld,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?jd=5:(jd=0,Nd=Md=null,Sf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Ad=null),xt(r),n=n.stateNode,$e&&typeof $e.onCommitFiberRoot==`function`)try{$e.onCommitFiberRoot(Qe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=F.T,a=ge.p,ge.p=2,F.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{F.T=n,ge.p=a}}if(i=zd,o=Bd,Bd=null,i!==null&&(zd=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);Pd&3&&Cf(),zf(t),a=t.pendingLanes,r&261930&&a&42?t===Hd?Vd++:(Vd=0,Hd=t):(Vd=0,Hd=null),Bf(0,!1)}}function Sf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,La(t)))}function Cf(){return Rd!==null&&(Rd.skipTransition(),Rd=null),yf(),bf(),xf(),wf()}function wf(){if(jd!==5)return!1;var e=Md,t=Fd;Fd=0;var n=xt(Pd),r=F.T,a=ge.p;try{ge.p=32>n?32:n,F.T=null,n=Id,Id=null;var o=Md,s=Pd;if(jd=0,Nd=Md=null,Pd=0,sd&6)throw Error(i(331));var c=sd;if(sd|=4,nd(o.current),Ju(o,o.current,s,n),sd=c,Bf(0,!1),$e&&typeof $e.onPostCommitFiberRoot==`function`)try{$e.onPostCommitFiberRoot(Qe,o)}catch{}return!0}finally{ge.p=a,F.T=r,Sf(e,t)}}function Tf(e,t,n){t=Gi(n,t),t=Pc(e.stateNode,t,2),e=So(e,t,2),e!==null&&(ht(e,2),zf(e))}function Ef(e,t,n){if(e.tag===3)Tf(e,e,n);else for(;t!==null;){if(t.tag===3){Tf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Ad===null||!Ad.has(r))){e=Gi(n,e),n=Fc(2),r=So(t,n,2),r!==null&&(Ic(n,r,t,e),ht(r,2),zf(r));break}}t=t.return}}function Df(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new od;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)||(hd=!0,i.add(n),e=Of.bind(null,e,t,n),t.then(e,e))}function Of(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,cd===e&&(ud&n)===n&&(_d===4||_d===3&&(ud&62914560)===ud&&300>Ue()-Ed?sd&2?bd|=n:$d(e,0):bd|=n,Sd===ud&&(Sd=0)),zf(e)}function kf(e,t){t===0&&(t=pt()),e=Ai(e,t),e!==null&&(ht(e,t),zf(e))}function Af(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),kf(e,n)}function jf(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),kf(e,n)}function Mf(e,t){return ze(e,t)}var Nf=null,Pf=null,Ff=!1,If=!1,Lf=!1,Rf=0;function zf(e){e!==Pf&&e.next===null&&(Pf===null?Nf=Pf=e:Pf=Pf.next=e),If=!0,Ff||(Ff=!0,Kf())}function Bf(e,t){if(!Lf&&If){Lf=!0;do for(var n=!1,r=Nf;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-tt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Gf(r,a))}else a=ud,a=lt(r,r===cd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ut(r,a)||(n=!0,Gf(r,a))}r=r.next}while(n);Lf=!1}}function Vf(){Hf()}function Hf(){If=Ff=!1;var e=0;Rf!==0&&Ap()&&(e=Rf);for(var t=Ue(),n=null,r=Nf;r!==null;){var i=r.next,a=Uf(r,t);a===0?(r.next=null,n===null?Nf=i:n.next=i,i===null&&(Pf=n)):(n=r,(e!==0||a&3)&&(If=!0)),r=i}jd!==0&&jd!==5||Bf(e,!1),Rf!==0&&(Rf=0)}function Uf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-tt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ft(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=cd,n=ud,n=lt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(dd===2||dd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Be(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ut(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Be(r),xt(n)){case 2:case 8:n=Ke;break;case 32:n=qe;break;case 268435456:n=Ye;break;default:n=qe}return r=Wf.bind(null,e),n=ze(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Be(r),e.callbackPriority=2,e.callbackNode=null,2}function Wf(e,t){if(jd!==0&&jd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Cf()&&e.callbackNode!==n)return null;var r=ud;return r=lt(e,e===cd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(qd(e,r,t),Uf(e,Ue()),e.callbackNode!=null&&e.callbackNode===n?Wf.bind(null,e):null)}function Gf(e,t){if(Cf())return null;qd(e,t,!0)}function Kf(){Fp(function(){sd&6?ze(Ge,Vf):Hf()})}function qf(){if(Rf===0){var e=Ua;e===0&&(e=at,at<<=1,!(at&261888)&&(at=256)),Rf=e}return Rf}function Jf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:bn(e)}function Yf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Jf((i[Tt]||null).action),o=r.submitter;o&&(t=(t=o[Tt]||null)?Jf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Rf!==0){var e=new FormData(i,o);oc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),oc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Xf=0;Xf<_i.length;Xf++){var Zf=_i[Xf];vi(Zf.toLowerCase(),`on`+(Zf[0].toUpperCase()+Zf.slice(1)))}vi(li,`onAnimationEnd`),vi(ui,`onAnimationIteration`),vi(di,`onAnimationStart`),vi(`dblclick`,`onDoubleClick`),vi(`focusin`,`onFocus`),vi(`focusout`,`onBlur`),vi(fi,`onTransitionRun`),vi(pi,`onTransitionStart`),vi(mi,`onTransitionCancel`),vi(hi,`onTransitionEnd`),Ut(`onMouseEnter`,[`mouseout`,`mouseover`]),Ut(`onMouseLeave`,[`mouseout`,`mouseover`]),Ut(`onPointerEnter`,[`pointerout`,`pointerover`]),Ut(`onPointerLeave`,[`pointerout`,`pointerover`]),Ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Qf=`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(` `),$f=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Qf));function ep(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){Ci(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){Ci(e)}i.currentTarget=null,a=c}}}}function tp(e,t){var n=t[Dt];n===void 0&&(n=t[Dt]=new Set);var r=e+`__bubble`;n.has(r)||(ap(t,e,2,!1),n.add(r))}function np(e,t,n){var r=0;t&&(r|=4),ap(n,e,r,t)}var rp=`_reactListening`+Math.random().toString(36).slice(2);function ip(e){if(!e[rp]){e[rp]=!0,Bt.forEach(function(t){t!==`selectionchange`&&($f.has(t)||np(t,!1,e),np(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[rp]||(t[rp]=!0,np(`selectionchange`,!1,t))}}function ap(e,t,n,r){switch(Lh(t)){case 2:var i=jh;break;case 8:i=Mh;break;default:i=Nh}n=i.bind(null,t,n,e),i=void 0,!jn||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 op(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=Pt(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}On(function(){var r=a,i=Cn(n),s=[];a:{var c=gi.get(e);if(c!==void 0){var l=Hn,u=e;switch(e){case`keypress`:if(Ln(n)===0)break a;case`keydown`:case`keyup`:l=or;break;case`focusin`:u=`focus`,l=Zn;break;case`focusout`:u=`blur`,l=Zn;break;case`beforeblur`:case`afterblur`:l=Zn;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=Yn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Xn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=lr;break;case li:case ui:case di:l=Qn;break;case hi:l=ur;break;case`scroll`:case`scrollend`:l=Wn;break;case`wheel`:l=dr;break;case`copy`:case`cut`:case`paste`:l=$n;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=sr;break;case`submit`:l=cr;break;case`toggle`:case`beforetoggle`:l=fr}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=kn(m,p),g!=null&&d.push(sp(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!==Sn&&(u=n.relatedTarget||n.fromElement)&&(Pt(u)||u[Et]))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?Pt(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=Yn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=sr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:It(c),h=l==null?u:It(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Pt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,lp):null,c!==null&&up(s,u,c,d,!1),l!==null&&f!==null&&up(s,f,l,d,!0)))}a:{if(c=r?It(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Mr;else if(Er(c)){if(Nr)_=Hr;else{_=Br;var v=zr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&_n(r.elementType)&&(_=Mr):_=Vr;if(_&&=_(e,r)){Dr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?It(r):window,e){case`focusin`:(Er(v)||v.contentEditable===`true`)&&($r=v,ei=r,ti=null);break;case`focusout`:ti=ei=$r=null;break;case`mousedown`:ni=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ni=!1,ri(s,n,i);break;case`selectionchange`:if(Qr)break;case`keydown`:case`keyup`:ri(s,n,i)}var y;if(mr)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 Sr?br(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(_r&&n.locale!==`ko`&&(Sr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Sr&&(y=In()):(Nn=i,Pn=`value`in Nn?Nn.value:Nn.textContent,Sr=!0)),v=cp(r,b),0<v.length&&(b=new er(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=xr(n),y!==null&&(b.data=y)))),(y=gr?Cr(e,n):wr(e,n))&&(b=cp(r,`onBeforeInput`),0<b.length&&(v=new er(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Yf(s,e,r,n,i)}ep(s,t)})}function sp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function cp(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=kn(e,n),i!=null&&r.unshift(sp(e,i,a)),i=kn(e,t),i!=null&&r.push(sp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function lp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function up(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=kn(n,a),l!=null&&o.unshift(sp(n,l,c))):i||(l=kn(n,a),l!=null&&o.push(sp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var dp=/\r\n?/g,fp=/\u0000|\uFFFD/g;function pp(e){return(typeof e==`string`?e:``+e).replace(dp,`
|
|
9
|
+
`).replace(fp,``)}function mp(e,t){return t=pp(t),pp(e)===t}function hp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&pn(e,``+r);else return;break;case`className`:Zt(e,`class`,r);break;case`tabIndex`:Zt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Zt(e,n,r);break;case`style`:gn(e,r,o);return;case`data`:if(t!==`object`){Zt(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=bn(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`&&hp(e,t,`name`,a.name,a,null),hp(e,t,`formEncType`,a.formEncType,a,null),hp(e,t,`formMethod`,a.formMethod,a,null),hp(e,t,`formTarget`,a.formTarget,a,null)):(hp(e,t,`encType`,a.encType,a,null),hp(e,t,`method`,a.method,a,null),hp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=bn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=xn);return;case`onScroll`:r!=null&&tp(`scroll`,e);return;case`onScrollEnd`:r!=null&&tp(`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=bn(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`:tp(`beforetoggle`,e),tp(`toggle`,e),Xt(e,`popover`,r);break;case`xlinkActuate`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Qt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Qt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Xt(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=vn.get(n)||n,Xt(e,n,r);else return}Jt=!0}function gp(e,t,n,r,a,o){switch(n){case`style`:gn(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`)pn(e,r);else if(typeof r==`number`||typeof r==`bigint`)pn(e,``+r);else return;break;case`onScroll`:r!=null&&tp(`scroll`,e);return;case`onScrollEnd`:r!=null&&tp(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=xn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Vt.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[Tt]||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}Jt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Xt(e,n,r)}return}Jt=!0}function _p(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:tp(`error`,e),tp(`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:hp(e,t,o,s,n,null)}}a&&hp(e,t,`srcSet`,n.srcSet,n,null),r&&hp(e,t,`src`,n.src,n,null);return;case`input`:tp(`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:hp(e,t,r,d,n,null)}}cn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in tp(`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:hp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&un(e,!!r,n,!0):un(e,!!r,t,!1);return;case`textarea`:for(s in tp(`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:hp(e,t,s,c,n,null)}fn(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:hp(e,t,l,r,n,null)}return;case`dialog`:tp(`beforetoggle`,e),tp(`toggle`,e),tp(`cancel`,e),tp(`close`,e);break;case`iframe`:case`object`:tp(`load`,e);break;case`video`:case`audio`:for(r=0;r<Qf.length;r++)tp(Qf[r],e);break;case`image`:tp(`error`,e),tp(`load`,e);break;case`details`:tp(`toggle`,e);break;case`embed`:case`source`:case`link`:tp(`error`,e),tp(`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:hp(e,t,u,r,n,null)}return;default:if(_n(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&gp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&hp(e,t,c,r,n,null))}var vp={};function yp(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)||hp(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&&(Jt=!0),o=m;break;case`name`:m!==f&&(Jt=!0),a=m;break;case`checked`:m!==f&&(Jt=!0),u=m;break;case`defaultChecked`:m!==f&&(Jt=!0),d=m;break;case`value`:m!==f&&(Jt=!0),s=m;break;case`defaultValue`:m!==f&&(Jt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&hp(e,t,p,m,r,f)}}sn(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)||hp(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&&(Jt=!0),p=o;break;case`defaultValue`:o!==l&&(Jt=!0),c=o;break;case`multiple`:o!==l&&(Jt=!0),s=o;default:o!==l&&hp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?un(e,!!n,n?[]:``,!1):un(e,!!n,t,!0)):un(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:hp(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&&(Jt=!0),p=a;break;case`defaultValue`:a!==o&&(Jt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&hp(e,t,s,a,r,o)}dn(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:hp(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&&(Jt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:hp(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)&&hp(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:hp(e,t,u,p,r,m)}return;default:if(_n(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&gp(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||gp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&hp(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||hp(e,t,f,p,r,m)}function bp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function xp(){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&&bp(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&&bp(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 wp(e){return e.nodeType===9?e:e.ownerDocument}function Tp(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 Ep(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 Dp(e,t,n,r){return n=wp(n).createElement(e),n[wt]=r,n[Tt]=t,_p(n,e,t),Rt(n),n}function Op(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 kp=null;function Ap(){var e=window.event;return e&&e.type===`popstate`?e!==kp&&(kp=e,!0):(kp=null,!1)}var jp=typeof setTimeout==`function`?setTimeout:void 0,Mp=typeof clearTimeout==`function`?clearTimeout:void 0,Np=typeof Promise==`function`?Promise:void 0,Pp=typeof requestAnimationFrame==`function`?requestAnimationFrame:jp,Fp=typeof queueMicrotask==`function`?queueMicrotask:Np===void 0?jp:function(e){return Np.resolve(null).then(e).catch(Ip)};function Ip(e){setTimeout(function(){throw e})}function Lp(e){return e===`head`}function Rp(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),ng(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Mm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Mm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[jt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Mm(e.ownerDocument.body)}n=i}while(n);ng(t)}function zp(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 Bp(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 Vp(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 Hp(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 Up(e){return Hp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Wp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Hp(t,n,e)}function Gp(e){return e.documentElement.clientHeight}function Kp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function qp(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`&&(Gp(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+=uh(f),u>ph){s.length=o;break}f=new Promise(Kp.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 Jp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Jp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Jp.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},Jp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Yp(e){return{name:e,group:new Jp(`group`,e),imagePair:new Jp(`image-pair`,e),old:new Jp(`old`,e),new:new Jp(`new`,e)}}function Xp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Xp.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(tm(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=$p(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Zp,e,s,r)}this._eventListeners=a}};function Zp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Xp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=tm(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=$p(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Qp,e,n,i),r.splice(t,1),a!==null&&a()}};function Qp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function $p(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function em(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function tm(e,t,n,r){if(e.length===0)return-1;r=em(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&em(a.optionsOrUseCapture)===r)return i}return-1}Xp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(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,$p(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,$p(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Xp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,nm,e,void 0,void 0)};function nm(e,t){return e.tag!==6&&(e=b(e),Om(e,t))}Xp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,rm,t,void 0,void 0);for(var n=t.length-1;0<=n&&!nm(t[n],e);n--);};function rm(e,t){return t.push(e),!1}Xp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=wp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,im,e,void 0,void 0))};function im(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Xp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,am,e,void 0,void 0)};function am(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Xp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,om,e,void 0,void 0);for(var n=t=0;n<sm.length;n++){var r=sm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):sm[t++]=r}sm.length=t}};function om(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var sm=[],cm=!1;function lm(e,t,n){sm.push({fragmentInstance:e,observer:t,instance:n}),cm||(cm=!0,km(function(){cm=!1;var e=sm;sm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Xp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,um,e,void 0,void 0),e};function um(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=b(e),t.push.apply(t,e.getClientRects());return!1}Xp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Xp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,rm,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(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=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(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=b(n[0]),i=b(n[n.length-1]);var a=_(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||dm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function dm(e,t,n,r,i){var a=Pt(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=g(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=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function fm(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)}Xp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,rm,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),fm(e,n);return}if(r=b(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=b(a),fm(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function pm(e,t){return e=b(e),mm(e,t),!1}function mm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function hm(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,$p(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<sm.length;i++){var a=sm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(sm[r++]=a)}sm.length=r,n.observe(e)}),mm(e,t))}function gm(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,$p(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?lm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function _m(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`:_m(n),Nt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function vm(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[jt])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=wm(e.nextSibling),e===null)break}return null}function ym(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=wm(e.nextSibling),e===null))return null;return e}function bm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=wm(e.nextSibling),e===null))return null;return e}function xm(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 wm(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 Tm=null;function Em(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return wm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Dm(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 Om(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 km(e){Pp(function(){Pp(function(t){return e(t)})})}function Am(e,t,n){switch(t=wp(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 jm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&hp(e,t,r,null,vp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===xn&&(e.onclick=null),Nt(e)}function Mm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nt(e)}var Nm=new Map,Pm=new Set;function Fm(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 Im=ge.d;ge.d={f:Lm,r:Rm,D:Vm,C:Hm,L:Um,m:Wm,X:Km,S:Gm,M:qm};function Lm(){var e=Im.f(),t=Zd();return e||t}function Rm(e){var t=Ft(e);t!==null&&t.tag===5&&t.type===`form`?cc(t):Im.r(e)}var zm=typeof document>`u`?null:document;function Bm(e,t,n){var r=zm;if(r&&typeof t==`string`&&t){var i=on(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Pm.has(i)||(Pm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),_p(t,`link`,e),Rt(t),r.head.appendChild(t)))}}function Vm(e){Im.D(e),Bm(`dns-prefetch`,e,null)}function Hm(e,t){Im.C(e,t),Bm(`preconnect`,e,t)}function Um(e,t,n){Im.L(e,t,n);var r=zm;if(r&&e&&t){var i=`link[rel="preload"][as="`+on(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+on(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+on(n.imageSizes)+`"]`)):i+=`[href="`+on(e)+`"]`;var a=i;switch(t){case`style`:a=Ym(e);break;case`script`:a=$m(e)}if(!(Nm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Nm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Xm(a))||t===`script`&&r.querySelector(eh(a))))){var o=r.createElement(`link`);_p(o,`link`,e),t===`style`&&(o[Mt]=!0,o.onload=o.onerror=function(){zt(o)}),Rt(o),r.head.appendChild(o)}}}function Wm(e,t){Im.m(e,t);var n=zm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+on(r)+`"][href="`+on(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=$m(e)}if(!Nm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Nm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(eh(a)))return}r=n.createElement(`link`),_p(r,`link`,e),Rt(r),n.head.appendChild(r)}}}function Gm(e,t,n){Im.S(e,t,n);var r=zm;if(r&&e){var i=Lt(r).hoistableStyles,a=Ym(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Xm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Nm.get(a))&&z(e,n);var c=o=r.createElement(`link`);Rt(c),_p(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,nh(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Km(e,t){Im.X(e,t);var n=zm;if(n&&e){var r=Lt(n).hoistableScripts,i=$m(e),a=r.get(i);a||(a=n.querySelector(eh(i)),a||(e=D({src:e,async:!0},t),(t=Nm.get(i))&&rh(e,t),a=n.createElement(`script`),Rt(a),_p(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function qm(e,t){Im.M(e,t);var n=zm;if(n&&e){var r=Lt(n).hoistableScripts,i=$m(e),a=r.get(i);a||(a=n.querySelector(eh(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Nm.get(i))&&rh(e,t),a=n.createElement(`script`),Rt(a),_p(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Jm(e,t,n,r){var a=(a=Te.current)?Fm(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=Ym(n.href),t=Lt(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=Ym(n.href);var o=Lt(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(Xm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Nm.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},Nm.set(e,o)),Qm(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=$m(n),t=Lt(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 Ym(e){return`href="`+on(e)+`"`}function Xm(e){return`link[rel="stylesheet"][`+e+`]`}function Zm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Qm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Mt]){r.loading=1;return}}else t=e.createElement(`link`),t[Mt]=!0,t.onload=t.onerror=zt.bind(null,t),_p(t,`link`,n),Rt(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 $m(e){return`[src="`+on(e)+`"]`}function eh(e){return`script[async]`+e}function th(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+on(n.href)+`"]`);if(r)return t.instance=r,Rt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Rt(r),_p(r,`style`,a),nh(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Ym(n.href);var o=e.querySelector(Xm(a));if(o)return t.state.loading|=4,t.instance=o,Rt(o),o;r=Zm(n),(a=Nm.get(a))&&z(r,a),o=(e.ownerDocument||e).createElement(`link`),Rt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),_p(o,`link`,r),t.state.loading|=4,nh(o,n.precedence,e),t.instance=o;case`script`:return o=$m(n.src),(a=e.querySelector(eh(o)))?(t.instance=a,Rt(a),a):(r=n,(a=Nm.get(o))&&(r=D({},n),rh(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Rt(a),_p(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,nh(r,n.precedence,e));return t.instance}function nh(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 z(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function rh(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var ih=null;function ah(e,t,n){if(ih===null){var r=new Map,i=ih=new Map;i.set(n,r)}else i=ih,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[jt]||a[wt]||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 oh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function sh(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 ch(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function lh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function uh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function dh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=uh(t),e.suspenseyImages.push(t)),e=_h.bind(e),t.decode().then(e,e))}function fh(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=Ym(r.href),a=t.querySelector(Xm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=gh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Rt(a);return}a=t.ownerDocument||t,r=Zm(r),(i=Nm.get(i))&&z(r,i),a=a.createElement(`link`),Rt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),_p(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=gh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ph=0;function mh(e,t){return e.stylesheets&&e.count===0&&yh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&yh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ph===0&&(ph=62500*xp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&yh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ph?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function hh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)yh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function gh(){this.count--,hh(this)}function _h(){this.imgCount--,hh(this)}var vh=null;function yh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,vh=new Map,t.forEach(bh,e),vh=null,gh.call(e))}function bh(e,t){if(!(t.state.loading&4)){var n=vh.get(e);if(n)var r=n.get(null);else{n=new Map,vh.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=gh.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 xh={$$typeof:oe,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function Sh(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=mt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.hiddenUpdates=mt(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 Ch(e,t,n,r,i,a,o,s,c,l,u,d){return e=new Sh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Fi(3,null,null,t),e.current=a,a.stateNode=e,t=Ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},yo(a),e}function wh(e){return e?(e=Ni,e):Ni}function Th(e,t,n,r,i,a){i=wh(i),r.context===null?r.context=i:r.pendingContext=i,r=xo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=So(e,r,t),n!==null&&(Kd(n,e,t),Co(n,e,t))}function Eh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Dh(e,t){Eh(e,t),(e=e.alternate)&&Eh(e,t)}function Oh(e){if(e.tag===13||e.tag===31){var t=Ai(e,67108864);t!==null&&Kd(t,e,67108864),Dh(e,67108864)}}function kh(e){if(e.tag===13||e.tag===31){var t=Ud();t=bt(t);var n=Ai(e,t);n!==null&&Kd(n,e,t),Dh(e,t)}}var Ah=!0;function jh(e,t,n,r){var i=F.T;F.T=null;var a=ge.p;try{ge.p=2,Nh(e,t,n,r)}finally{ge.p=a,F.T=i}}function Mh(e,t,n,r){var i=F.T;F.T=null;var a=ge.p;try{ge.p=8,Nh(e,t,n,r)}finally{ge.p=a,F.T=i}}function Nh(e,t,n,r){if(Ah){var i=Ph(r);if(i===null)op(e,t,r,Fh,n),Kh(e,r);else if(Jh(i,e,t,n,r))r.stopPropagation();else if(Kh(e,r),t&4&&-1<Gh.indexOf(e)){for(;i!==null;){var a=Ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ct(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-tt(o);s.entanglements[1]|=c,o&=~c}zf(a),!(sd&6)&&(Od=Ue()+500,Bf(0,!1))}}break;case 31:case 13:s=Ai(a,2),s!==null&&Kd(s,a,2),Zd(),Dh(a,2)}if(a=Ph(r),a===null&&op(e,t,r,Fh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else op(e,t,r,null,n)}}function Ph(e){return e=Cn(e),Ih(e)}var Fh=null;function Ih(e){if(Fh=null,e=Pt(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 Fh=e,null}function Lh(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(We()){case Ge:return 2;case Ke:return 8;case qe:case Je:return 32;case Ye:return 268435456;default:return 32}default:return 32}}var Rh=!1,zh=null,Bh=null,Vh=null,Hh=new Map,Uh=new Map,Wh=[],Gh=`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 Kh(e,t){switch(e){case`focusin`:case`focusout`:zh=null;break;case`dragenter`:case`dragleave`:Bh=null;break;case`mouseover`:case`mouseout`:Vh=null;break;case`pointerover`:case`pointerout`:Hh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Uh.delete(t.pointerId)}}function qh(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=Ft(t),t!==null&&Oh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Jh(e,t,n,r,i){switch(t){case`focusin`:return zh=qh(zh,e,t,n,r,i),!0;case`dragenter`:return Bh=qh(Bh,e,t,n,r,i),!0;case`mouseover`:return Vh=qh(Vh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Hh.set(a,qh(Hh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Uh.set(a,qh(Uh.get(a)||null,e,t,n,r,i)),!0}return!1}function Yh(e){var t=Pt(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,I(e.priority,function(){kh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,I(e.priority,function(){kh(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 Xh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ph(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sn=r,n.target.dispatchEvent(r),Sn=null}else return t=Ft(n),t!==null&&Oh(t),e.blockedOn=n,!1;t.shift()}return!0}function Zh(e,t,n){Xh(e)&&n.delete(t)}function Qh(){Rh=!1,zh!==null&&Xh(zh)&&(zh=null),Bh!==null&&Xh(Bh)&&(Bh=null),Vh!==null&&Xh(Vh)&&(Vh=null),Hh.forEach(Zh),Uh.forEach(Zh)}function $h(e,n){e.blockedOn===n&&(e.blockedOn=null,Rh||(Rh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Qh)))}var eg=null;function tg(e){eg!==e&&(eg=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){eg===e&&(eg=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(Ih(r||n)===null)continue;break}var a=Ft(n);a!==null&&(e.splice(t,3),t-=3,oc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function ng(e){function t(t){return $h(t,e)}zh!==null&&$h(zh,e),Bh!==null&&$h(Bh,e),Vh!==null&&$h(Vh,e),Hh.forEach(t),Uh.forEach(t);for(var n=0;n<Wh.length;n++){var r=Wh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Wh.length&&(n=Wh[0],n.blockedOn===null);)Yh(n),n.blockedOn===null&&Wh.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[Tt]||null;if(typeof a==`function`)o||tg(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Tt]||null)s=o.formAction;else if(Ih(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),tg(n)}}}function rg(){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 ig(e){this._internalRoot=e}ag.prototype.render=ig.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;Th(n,Ud(),e,t,null,null)},ag.prototype.unmount=ig.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Th(e.current,2,null,e,null,null),Zd(),t[Et]=null}};function ag(e){this._internalRoot=e}ag.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Wh.length&&t!==0&&t<Wh[n].priority;n++);Wh.splice(n,0,e),n===0&&Yh(e)}};var og=n.version;if(og!==`19.3.1`)throw Error(i(527,og,`19.3.1`));ge.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:f(e),e=e===null?null:e.stateNode,e};var B={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var sg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sg.isDisabled&&sg.supportsFiber)try{Qe=sg.inject(B),$e=sg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=kc,s=Ac,c=jc;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=Ch(e,1,!1,null,null,n,r,null,o,s,c,rg),e[Et]=t.current,ip(e),new ig(t)}})),_=o(((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=g()})),v=c(d(),1),y=_(),b=/^#\/[a-z][a-z0-9-]*(\/[^?\s]*)?(\?[^\s]*)?$/,x=e=>typeof e==`object`&&!!e;function S(e,t){let n=0,r=new Map,i=new Map,a=new Set,o=[];return t(e=>{if(x(e)){if(e.type===`api-reply`&&typeof e.id==`number`){let t=r.get(e.id);r.delete(e.id),t?.({status:Number(e.status),body:e.body})}else if(e.type===`run-progress`&&typeof e.id==`number`)typeof e.line==`string`&&i.get(e.id)?.onLine(e.line);else if(e.type===`run-end`&&typeof e.id==`number`){let t=i.get(e.id);i.delete(e.id),t?.done({state:typeof e.state==`string`?e.state:`failed`,lines:Array.isArray(e.lines)?e.lines.filter(e=>typeof e==`string`):[],...typeof e.runId==`string`?{runId:e.runId}:{}})}else if(e.type===`event`&&x(e.event)&&typeof e.event.type==`string`)for(let t of a)t(e.event);else if(e.type===`navigate`&&typeof e.hash==`string`&&b.test(e.hash))for(let t of o)t(e.hash)}}),{call(t,i){let a=++n;return new Promise(n=>{r.set(a,n),e({type:`api`,id:a,method:i.method,path:t,...i.body===void 0?{}:{body:i.body}})})},runStep(t,r){let a=++n;return new Promise(n=>{i.set(a,{onLine:r,done:n}),e({type:`run-step`,id:a,args:t})})},onEvent(e){return a.add(e),()=>a.delete(e)},onNavigate(e){o.push(e)}}}function C(e){return t=>{if(!(t.button!==0||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey))for(let n of t.composedPath()){let t=n;if(t.tagName?.toLowerCase()!==`a`)continue;let r=t.getAttribute?.(`href`);r&&b.test(r)&&e(r);return}}}var w;function T(){if(w!==void 0)return w??void 0;let e=globalThis.acquireVsCodeApi;if(typeof e!=`function`||typeof window>`u`){w=null;return}let t=e();return w=S(e=>t.postMessage(e),e=>window.addEventListener(`message`,t=>e(t.data))),w.onNavigate(e=>{location.hash!==e&&(location.hash=e)}),window.addEventListener(`click`,C(e=>{location.hash!==e&&(location.hash=e)})),w}var E={app:{loading:`Loading`,cantLoad:e=>`Couldn't load this: ${e}`,tryAgain:`Try again`,scrollTable:e=>`Table: ${e} (scrolls sideways)`,scrollCode:`Code block (scrolls sideways)`,changePicker:`Change`,noChanges:`No changes yet`,offline:`The Atticus server isn't answering. Check that atticus ui is still running in its terminal (start it again with atticus ui if it stopped), then press Try again or reload the page.`,notJson:e=>`The server answered with something that isn't Atticus's (status ${e}). Check that the address is the one atticus ui printed.`,offlinePanel:`The Atticus server the extension started isn't answering. Run Atticus: Open the app from the Command Palette to start it again, then press Try again.`,offlineShort:`the server isn't answering (the note at the top says how to fix it)`,online:`The server is answering again.`,working:`Working on it…`,ccReading:`Reading your metarepo…`,ccCantRead:`Couldn't read what needs attention: each panel below says why.`,notLoaded:`not loaded`,checking:`Checking…`,checkedAt:e=>`Checked again at ${e}.`,newTab:`(opens in a new tab)`,askEmpty:`Type a question first.`,tourEscape:`Esc closes the tour`,needId:`Type a record id first, for example ledger-db.account. The Knowledge explorer finds one.`,needFolder:`Type the folder for the sandbox first: a new, empty one.`,noExecutors:`No tool is set up on this machine yet, so there is nothing to check.`,forceSnow:`To replace it, tick “Replace a snow.md a person edited” and draft again.`,forceStories:e=>`Edit them on this page, or to replace them run atticus plan stories ${e} --force in a terminal.`,panelNoSave:(e,t)=>`The VS Code panel can't save files, so ${e} wasn't saved. Copy the text below into a file, or run ${t} in a terminal.`},theme:{label:`Theme`,hint:`System follows your computer's light or dark setting.`,choices:{system:`System`,light:`Light`,dark:`Dark`}},findings:{needsReason:`Not relevant and Waive need a reason: type it above first.`,cantWaive:`This rule can't be waived`},flows:{title:`Flows`,intro:`Each flow is what happens, step by step, when something starts it: who calls, what the code does, and the components, tables and topics it reaches. Every step cites the file and line it was read from.`,repo:`Repo`,filter:`Find a flow`,filterHint:`Name, id or what starts it`,listTitle:`Flows`,noSpecs:`No repo has a spec yet. Draft one with atticus spec draft <repo>, or /atticus-spec in Copilot Chat or Claude Code.`,noFlows:`This repo's spec has no flows yet.`,noMatch:`No flow matches. Try part of its name or what starts it.`,pick:`Pick a flow from the list to see its steps.`,counts:(e,t)=>`${e} step${e===1?``:`s`}, ${t} confirmed`,unreadable:`These files don't read:`,file:`File`,copyFile:`Copy the file's path`,calledBy:`Called by`,notJoined:`The estate pass hasn't run, so calls to other repos aren't linked to their flows. Run atticus estate join.`,start:`Start`,goesTo:(e,t)=>`Goes to ${e} on ${t}.`,backTo:e=>`Goes back to ${e}.`,opens:(e,t)=>`Opens "${e}" in ${t}`,unjoined:e=>`Not linked to a flow: ${e}`,more:e=>`and ${e} more`,confirmed:{check:`Confirmed by the check`,ai:`Confirmed by the AI`,person:`Confirmed by a person`},notConfirmed:`Not confirmed yet`,errorsTitle:`When it goes wrong`,noErrors:`The spec names no error paths for this flow.`,diagram:e=>`The steps of ${e}`,lanes:{caller:`starts it`,gateway:`gateway`,self:`runs the flow`,component:`called`,store:`table`,topic:`topic`},kinds:{endpoint:`Endpoint`,action:`Action`,page:`Page`,listener:`Listener`,job:`Job`,entry:`Entry`,lookup:`Lookup`,read:`Read`,write:`Write`,"call-out":`Call`,publish:`Publish`,transform:`Transform`,validate:`Validate`,branch:`Branch`,log:`Log`,respond:`Respond`,loop:`Loop`,retry:`Retry`},openFlows:`Flows of this repo`,frame:(e,t,n)=>`${e===`retry`?`Retry`:`Loop`}: steps ${t} to ${n} again`,marks:{added:`Added`,changed:`Changed`,removed:`Removed`},was:e=>`Before: ${e}`,newLane:`new`,change:`Change`,pickRepo:`A repo's flows`,changeIntro:`The flows this change adds, changes or removes, each drawn beside today's: added steps say Added, changed ones say Changed with what they did before, removed ones say Removed and are struck through.`,noTargets:e=>`${e} has no target flows yet. Run atticus change architecture ${e}, or /atticus-architecture in Copilot Chat or Claude Code.`,targetsTitle:`Target flows`,targetCounts:(e,t,n)=>[e?`${e} added`:``,t?`${t} changed`:``,n?`${n} removed`:``].filter(Boolean).join(`, `)||`no step changes`,deltaKinds:{new:`New flow`,modify:`Changed flow`,remove:`Removed flow`},whyChange:`Why`,openTargets:`Its target flows`},questions:{proposal:{title:`Proposed by your assistant`,listed:`An answer is proposed`,notYet:e=>`${e} read the code and proposes this. It is not an answer until you accept it.`,option:(e,t)=>`Option ${e}: ${t}`,words:e=>`In words: ${e}`,cites:`The lines it rests on (each checked: the quoted words are on that line)`,accept:`Accept as my answer`,accepting:`Accepting…`,orAnswer:`Or answer it yourself below.`,command:e=>`atticus questions answer ${e} --accept-proposal`},title:`Questions`,intro:`When the code doesn't settle something, Atticus asks here. Your answer is written to the question's file in questions/; then run the command shown, and the step reads it.`,filter:`Show`,filterOpen:`Open`,filterAll:`All`,listTitle:`Questions`,empty:`No questions are waiting. A scan step adds one here when the code is unclear.`,emptyAll:`No questions yet. A scan step adds one here when the code is unclear.`,unreadable:e=>`${e} isn't a valid question file.`,pickFromList:`Pick a question from the list to answer it.`,askedBy:(e,t)=>`Asked by ${e} on ${t}`,evidence:`What it read`,notShown:`Not shown: the file isn't here, or the line is past its end.`,options:`Your answer`,optionChanges:`It would change`,ownWords:`In my own words`,ownWordsLabel:`Your answer, in your own words`,scope:`Who the answer is for`,scopeRepo:e=>`This repo only (${e})`,scopeType:e=>`Every repo of type ${e}`,scopeTypeOther:`Every repo of a type`,typeLabel:`The repo type`,proposed:`proposed`,submit:`Save the answer`,saving:`Saving`,pickOne:`Pick one of the options, or answer in your own words.`,needWords:`Write your answer, or pick one of the options.`,needType:`Say which repo type the answer is for, or keep it to this repo.`,saved:e=>`Saved to ${e}. Commit it for review with the rest of the scan.`,skillWritten:e=>`Also written under Answers in ${e}.`,skillMissing:e=>`${e} isn't there yet, so the answer is kept in the question file, with that path.`,next:`Run this next; it reads your answer:`,copy:`Copy the command`,answered:(e,t)=>`Answered by ${e} on ${t}`,retired:`This question is retired; nothing reads its answer.`,change:`Change the answer`,whose:`Whose`,whoseAll:`Everyone's`,whoseMine:`My teams'`,owner:(e,t)=>`Owner: ${t?`${t} (${e})`:e}`,noOwner:e=>`No owner: ${e}`,restsOn:e=>{let t=typeof e==`string`?[e]:e;return`Ask first: ${t.join(`, `)} ${t.length===1?`rests`:`rest`} on it`},joins:e=>`Its answer joins ${e} ${e===1?`call`:`calls`}`,mineTeams:e=>`Questions for your teams: ${e}.`,mineNone:e=>`${e} is on no team in org-pack/roles.yaml, so no question is yours here. Add yourself under a team's people there (schemaVersion 2), or show everyone's.`,emptyMine:`No questions are waiting for your teams.`,changeOwner:(e,t)=>`Owner: the people of ${e} (${(typeof t==`string`?[t]:t).join(`, `)})`,mineChanges:e=>`Questions of the changes that name ${e} under owners. ${e} is on no team in org-pack/roles.yaml.`,rule:{label:`Answer by rule (optional)`,hint:`A host pattern (*.payments.forge.internal) or a path prefix (/forge/limits/**): your answer then covers every call that matches, the calls found later too, in the repos the scope above allows.`,answered:e=>`By rule: every call matching ${e}`},another:{label:`Which repo, system or team`,loading:`Loading the repos, systems and teams…`,failed:e=>`The list didn't load: ${e}`,empty:`The org pack lists no repos, systems or teams yet. Answer in your own words instead.`,choose:`Choose one`,repos:`Repos of the manifest`,systems:`Systems of the profile`,teams:`Teams in roles.yaml`,notRead:`not read yet`,noSystem:`no system yet`,newVendor:`Not listed: a vendor's name`,newVendorHint:`Leave the list on “Choose one” and type a vendor's name to add it to the profile.`,pickOne:`Choose a repo, system or team, or type a vendor's name.`,addTeam:(e,t)=>`${e} has no system yet: add ${t} (another team's, owner ${e}) to the profile, as a file change for review in the pull request`,addVendor:e=>`Add ${e} to the profile as a vendor, as a file change for review in the pull request`,needAdd:`Tick the box to add the system to the profile, or choose one that is listed.`,added:(e,t)=>`Wrote the system ${e} into ${t}; review it in the same pull request.`},reopened:(e,t,n)=>`Asked again on ${n}: you answered ${t}, and ${e}`,fromProposal:(e,t)=>`It was ${e}'s proposal (${t}), confirmed by the person who answered. It cited:`},knowledge:{nav:{sources:`Knowledge sources`,documents:`Documents`,items:`Knowledge items`,search:`Search the wikis`,parties:`Teams, vendors and products`,orgpack:`Org pack from the wikis`},emptyGo:`Open Knowledge sources to add or sync a wiki`,documents:{title:`Documents`,intro:`Files dropped in the metarepo's inputs/ are general knowledge: decisions, runbooks, specs, request forms and slides. Sync reads them into a snapshot, and your assistant reads that into knowledge items, each quote checked against the file. A file for one change only goes in that change's Files attached instead.`,add:`Add files`,adding:`Adding…`,added:e=>`Added ${e} file${e===1?``:`s`} to inputs/inbox/. Commit them through a pull request.`,sync:`Sync inputs/`,syncing:`Syncing…`,syncedNow:`inputs/ is read into a new snapshot. Your assistant reads it into items next.`,listTitle:`Files in inputs/`,empty:`Nothing in inputs/ yet. Add files here, or run atticus intake add <files>.`,neverSynced:`Not synced yet: Sync reads what can be read into a snapshot.`,synced:(e,t,n)=>`Snapshot of ${e}: ${t} of ${n} file${n===1?``:`s`} read.`,kindLabel:`Kind`,anyKind:`Any kind`,systemLabel:`System`,anySystem:`Any system`,filtered:`documents`,kinds:{document:`Document`,spreadsheet:`Spreadsheet`,diagram:`Diagram`,image:`Picture`,openapi:`OpenAPI spec`,swagger:`Swagger spec`,asyncapi:`AsyncAPI spec`,protobuf:`Protobuf spec`,avro:`Avro schema`,payload:`Payload sample`,"ticket-export":`Ticket export`,unknown:`Unknown`},states:{read:`Read`,skipped:`Not read`,"not-synced":`Not synced yet`},inbox:`In the inbox`,systems:e=>`About ${e}`,noSystems:`Names no system`,age:e=>e===0?`changed today`:`changed ${e} day${e===1?``:`s`} ago`,items:(e,t)=>`${e} knowledge item${e===1?``:`s`}, ${t} verified`,verified:`verified`,why:e=>`Not read: ${e}.`,newer:e=>`A newer version is ${e}.`,duplicate:e=>`The same file as ${e}.`,readTitle:`Read them into knowledge items`,readWhy:`Your assistant reads the snapshot of inputs/ into patterns, standards, processes, requests, decisions and constraints. Atticus checks every quote against the file.`},kinds:{pattern:`Pattern`,standard:`Standard`,process:`Process`,request:`Request`,decision:`Decision`,constraint:`Constraint`,team:`Team`,vendor:`Vendor`,product:`Product`,project:`Project`},groups:[{title:`Requests and processes`,kinds:[`request`,`process`]},{title:`Standards and patterns`,kinds:[`standard`,`pattern`]},{title:`Decisions and constraints`,kinds:[`decision`,`constraint`]},{title:`Teams and vendors`,kinds:[`team`,`vendor`]},{title:`Products and projects`,kinds:[`product`,`project`]}],fields:{title:`Title`,name:`Name`,appliesWhen:`Applies when`,leadTime:`Lead time`,handledBy:`Handled by`,catalogueItem:`Catalogue item`,inputs:`It needs`,steps:`Steps`,notes:`Notes`,definition:`Definition`,rules:`Rules`,reason:`Reason`,owner:`Owner`,responsibilities:`Responsibilities`,owns:`Owns`,uses:`Uses`,contacts:`Contacts`,channel:`Channel`,aliases:`Also called`,description:`What it is`,ownedBy:`Owned by`,usedBy:`Used by`,vendor:`Vendor`,systems:`Systems`,urls:`Links`,decision:`Decision`,stance:`Stance`},review:{verified:(e,t)=>`✓ Verified by ${e} on ${t}`,corrected:(e,t)=>`✓ Corrected by ${e} on ${t}`,rejected:(e,t)=>`✗ Rejected by ${e} on ${t}`,stale:e=>`Check again: its page changed since ${e} reviewed it`,none:`Not yet verified: check it against its page`,because:`Why`,correctedFields:e=>`Corrected: ${e}`},ai:{intro:`This step needs a model. Run the command in a terminal at the metarepo:`,slash:`Or type this in Copilot Chat or Claude Code:`,copy:`Copy the command`,copySlash:`Copy the slash command`},sources:{intro:`The wikis and docs repos in org-pack/sources.yaml. Sync copies a source's pages to a dated snapshot; the knowledge scan then reads the snapshot with your assistant, and every quote is checked.`,listTitle:`Sources`,empty:`No wiki is in sources.yaml yet. Add one below.`,type:`Type`,location:`Where`,ref:`Branch or tag`,path:`Folder of its pages`,checkout:`Checkout`,owner:`Owner`,tags:`Tags`,noTags:`No tags: it is read for every kind`,authority:`Authority`,authorities:{standard:`Standard: the organisation's own rules`,platform:`Platform: a shared platform team's guidance`,framework:`Framework: a framework's own documentation`,team:`Team: a team's pages`,reference:`Reference: glossaries and notes`},noAuthority:`Not set: it ranks as a team's pages`,byPage:e=>`${e} page override${e===1?``:`s`} in sources.yaml`,scope:`Applies to`,everywhere:`Every task: no appliesTo in sources.yaml`,restricted:`Restricted pages`,readsRestricted:`Read: the metarepo's audience may read them`,skipsRestricted:`Skipped, path and reason only`,maxPages:e=>`A scan reads at most ${e} page${e===1?``:`s`} of it a run`,snapshot:`Newest snapshot`,noSnapshot:`Never synced`,snapshotLine:(e,t,n)=>`${e}: ${t} page${t===1?``:`s`}, ${n} day${n===1?``:`s`} old`,commit:e=>`at commit ${e.slice(0,7)}`,scanned:e=>`The knowledge scan read the snapshot of ${e}`,notScanned:`The knowledge scan hasn't read it yet`,stale:e=>`Sync it again: the snapshot is older than ${e} days`,unsynced:`Not synced yet: sync it so the knowledge scan can read it`,sync:e=>`Sync ${e}`,syncing:`Syncing`,synced:e=>`Synced ${e}.`,scanLabel:`Knowledge scan`,addTitle:`Add a source`,addIntro:`Atticus checks the wiki and writes its entry into org-pack/sources.yaml, keeping the file's comments. Commit the file through a pull request: merging it is the approval.`,addType:`Type of wiki`,addLocation:`Location: a URL, or a folder relative to the metarepo`,addId:`Id (optional; made from the location when empty)`,addPath:`Folder of its pages (git only)`,addRef:`Branch or tag (git only; default the repository's default branch)`,addSubmodule:`Keep it as a submodule of the metarepo (git only)`,addKinds:`Kinds of knowledge it holds, comma-separated`,addFrameworks:`Frameworks it is about, comma-separated`,addOwner:`Owner`,addSave:`Write it into sources.yaml (otherwise only show the entry)`,add:`Add the source`,adding:`Adding`,needLocation:`Say where the wiki is.`,gitOnly:`Branch, folder and submodule are for a git wiki.`,notSlug:e=>`${e} isn't a tag: use lowercase letters, digits and dashes.`,problems:`These files don't read:`},scan:{title:`What the last scan changed`,never:`No knowledge scan has run yet.`,at:e=>`Scanned on ${e}`,added:`New`,changed:`Changed`,removed:`Gone`,nothing:`The last scan changed no item.`,flags:(e,t,n)=>`${e} conflict${e===1?``:`s`} between pages, ${t} quarantined text${t===1?``:`s`}, ${n} item${n===1?``:`s`} that failed the checks`,checkAgain:`Reviews to check again`,noCheckAgain:`No review waits to be checked again.`,rescan:`Read every source again (only changed pages go to your assistant):`},items:{intro:`What the knowledge scan read from the wikis, as people reviewed it. A tick lasts until the page under it changes; a rejected item is left out of plans and answers, and still listed here with its reason.`,kind:`Kind`,allKinds:`All kinds`,empty:`There are no knowledge items yet. Sync a source on the Knowledge sources page, then read it with your assistant.`,noMatch:`No item matches.`,pick:`Pick an item to see it and review it.`,reviewStart:e=>e?`Review what no one has checked (${e})`:`Nothing waits for a review`,reviewStop:`Stop reviewing`,reviewKeys:e=>`Review mode, ${e} waiting: j or ↓ next, k or ↑ back, v verify and go on, c correct, r reject.`,missing:e=>`There is no knowledge item ${e}: a rescan may have removed it, or the link is wrong. Pick one from the list.`,count:e=>`${e} item${e===1?``:`s`}`,quote:`What the page says`,page:(e,t)=>`${e}${t?`, line ${t}`:``}`,links:`Links`,noLinks:`The page gives no link for it.`,conflict:`Another page disagrees with it: see the conflicts in knowledge/scan.yaml.`,verify:`Verify`,correct:`Correct`,reject:`Reject`,cancel:`Cancel`,save:`Save the correction`,saving:`Saving`,rejectWhy:`Why is it wrong? The next person reads it.`,rejectSave:`Reject it`,needWhy:`Say why it is wrong.`,noChange:`Change a field first, or cancel.`,verified:e=>`Verified ${e}. Commit knowledge/reviews/ through a pull request.`,corrected:e=>`Corrected ${e}. Everything that reads it uses the correction from now on.`,rejected:e=>`Rejected ${e}: plans and answers leave it out.`,correctIntro:`Only the fields a person may correct are here. What the page quoted can't be corrected: a quote is checked word for word.`,addValue:`Add one`,remove:`Remove`,linkLabel:`Label`,linkUrl:`Address (https://…)`,badUrl:e=>`${e} isn't an http(s) address.`,item:e=>`Item ${e}`,link:e=>`Link ${e}`,open:`Open the item`},search:{intro:`Look for a term or phrase across every wiki. The plain search runs here and shows the pages and sections that mention it. Your assistant then reads only those pages and proposes what they hold about it; every quote is checked.`,label:`A term or phrase`,placeholder:`e.g. new starter, Kafka topic, change freeze`,go:`Search`,needText:`Type a word or phrase to look for first.`,searching:`Searching the wikis again…`,noSnapshot:`No source has a snapshot yet: sync one on the Knowledge sources page first.`,none:e=>`No page of the wikis mentions "${e}". There is nothing to send to your assistant.`,found:(e,t)=>`${e} section${e===1?``:`s`} on ${t} page${t===1?``:`s`} mention it.`,next:`Have your assistant read those pages:`,savedTitle:`Saved searches`,noSaved:`No search has been saved yet. Each search your assistant runs is saved here.`,candidates:(e,t)=>`${e} found, ${t} kept`,fresh:`New`,known:e=>`Already known as ${e}`,kept:(e,t)=>`Kept as a ${e} by ${t}`,keepAs:`Keep as`,keep:`Keep`,keeping:`Keeping`,keepOf:e=>`Keep ${e}`,keptNote:(e,t)=>`Kept ${e} as a ${t}, verified by you. Commit knowledge/items/ and reviews/ through a pull request.`,pick:`Pick a saved search to see what it found.`},parties:{intro:`The teams, vendors, products and projects the wikis name: what each team owns and uses, who owns each product, and the other names people use for them.`,empty:`No team, vendor or product has been read from the wikis yet. The knowledge scan reads them.`,teams:`Teams`,vendors:`Vendors`,products:`Products and projects`,owns:`Owns`,uses:`Uses`,usedBy:`Used by`,ownedBy:`Owned by`,aliases:`Also called`,responsibilities:`Responsible for`,none:`None named`,review:`Review it on the Knowledge items page`},orgpack:{intro:`The products and vendors the wikis name, drafted as each platform profile's systems. Accept the ones you pick: Atticus writes them into profile.yaml, keeping its comments, and you commit it through a pull request.`,empty:`The org pack has no platform profile yet.`,noDraft:`No draft yet for this platform.`,draft:`Draft from the wikis`,drafting:`Drafting`,drafted:e=>`Drafted ${e} system${e===1?``:`s`}.`,nothing:`The profile already has every system the knowledge items name.`,add:`Add`,update:`Update`,gains:e=>`gains ${e}`,verified:e=>`✓ Verified by ${e}`,unverified:`Not yet verified: check it against its page`,accept:`Accept the picked systems`,accepting:`Accepting`,pickOne:`Pick at least one system.`,accepted:(e,t,n)=>`Added ${e} and updated ${t} in ${n}. Commit it through a pull request: merging it is the approval.`,pick:e=>`Accept ${e}`,at:e=>`Drafted on ${e}`,command:`Or in a terminal:`},needs:{title:`What this change needs`,intro:`What the organisation needs from this change, from the knowledge items: requests to raise, standards to follow, decisions to keep to, teams to involve. Atticus never raises one: you do, then mark it here.`,none:e=>`${e} has no needs list yet. Find what it needs early: a request's lead time runs from the day it is raised.`,empty:`Nothing in the knowledge items applies to this change.`,groups:[{title:`Requests and processes to raise`,kinds:[`request`,`process`]},{title:`Standards and patterns to follow`,kinds:[`standard`,`pattern`]},{title:`Decisions and constraints that apply`,kinds:[`decision`,`constraint`]},{title:`Teams, vendors and products to involve`,kinds:[`team`,`vendor`,`product`,`project`]}],for:e=>e===`change`?`the whole change`:e.replace(`:`,` `),leadTime:`Lead time`,handledBy:`Handled by`,catalogueItem:`Catalogue item`,inputs:`It needs`,steps:`How`,rules:`Rules`,links:`Links`,why:`Why`,when:e=>`Needed ${e.replace(`-`,` `)}`,from:e=>`From ${e}`,fromStories:`Suggested by the stories stage`,open:`Open`,done:(e,t)=>`Done by ${e}${t?`: ${t}`:``}`,notNeeded:(e,t)=>`Not needed (${e}): ${t}`,markDone:`Done`,markDoneOf:e=>`Done: ${e}`,markSkipOf:e=>`Not needed: ${e}`,reopenOf:e=>`Reopen: ${e}`,openAgain:`open again`,markSkip:`Not needed`,reopen:`Reopen`,doneNote:`Note (optional), e.g. the CTASK number`,skipNote:`Why it isn't needed (a reviewer reads it)`,save:`Save`,cancel:`Cancel`,needWhy:`Say why it isn't needed.`,marked:(e,t)=>`${e} is ${t}. Commit needs.yaml with the change.`,considered:`Considered and left out`,openCount:e=>`${e} open`}},nav:{main:`Main`,dashboard:`Overview`,onboarding:`Onboarding`,feature:`Feature design`,architecture:`Architecture`,stories:`Stories`,tasks:`Tasks`,knowledge:`Knowledge`,sections:{Home:`Home`,Map:`Map`,Change:`Change`,Questions:`Questions`,Knowledge:`Knowledge`,SetUp:`Set up`,Atticus:`Atticus`},groups:{Define:`Define`,Design:`Design`,Plan:`Plan`,Build:`Build`,Release:`Release`},tabs:e=>`${e} pages`,youAreHere:`You are here`,ofChange:e=>`change ${e}`,screens:{home:`Home`,canvas:`Estate canvas`,trust:`Trust`,explore:`Search the catalog`,map:`Ecosystem map`,impact:`Impact explorer`,features:`Features`,orgpack:`Org pack`,intake:`Intake`,scans:`Scans`,brief:`Feature brief`,ux:`Prototypes and UX`,archReview:`Architecture review`,diagrams:`Diagrams`,reconcile:`Reconcile`,contracts:`Contracts`,mappings:`API mappings`,breakdown:`Breakdown`,initiatives:`Initiatives`,changes:`All changes`,tasks:`Task board`,trace:`Test trace`,todo:`Manual steps`,release:`Release plan`,serviceDesk:`Service desk queue`,governance:`Governance`,evals:`AI quality`,learning:`Learning`,settings:`Settings`,ai:`AI`,repos:`Repos`,cockpit:`At a glance`,systems:`Systems`,outside:`Outside systems`,mismatches:`Mismatches`,runs:`Model runs`,history:`Prompt history`,words:`What the words mean`,changeDiagram:`Change diagram`,estimate:`Estimate`,conformance:`Code against design`,changeKnowledge:`Knowledge`}},trust:{contracts:(e,t,n)=>`Contracts: ${e} mismatch${e===1?``:`es`} and ${t} unconfirmed on ${n} link${n===1?``:`s`} with a payload on both sides.`,contractsOpen:`Open Mismatches`,intro:`How far to trust each repo's map. Your assistant reads a repo and writes facts, each citing a file and line; the verifier keeps the facts whose line says what they claim and rejects the rest. Here is what it kept and rejected, how much of the code the facts cover, whether they are of the commit the checkout is at, and whether the catalog is built from them or from the built-in readers.`,empty:`No repo is listed yet. Add your repos in Set up › Repos, then have your assistant read one with /atticus-map <repo>.`,reportIn:e=>`The verifier's reports are in ${e}/.`,summary:(e,t)=>`${e} of ${t} repos trusted`,states:{"not-read":`Not read yet`,unverified:`Not verified`,rejected:`Facts rejected`,stale:`Facts of another commit`,unwritten:`Verified, not in the catalog`,"unknown-files":`Files not read yet`,trusted:`Trusted`},why:{notRead:`Your assistant hasn't read this repo yet, so any map of it comes from the built-in readers.`,unverified:`Its facts haven't been checked by the verifier yet.`,rejected:e=>`The verifier rejected ${e} fact${e===1?``:`s`}: the cited line doesn't say what the fact claims. Fix ${e===1?`it`:`them`} and verify again.`,stale:(e,t)=>`The facts are of commit ${e.slice(0,7)}, but the checkout is at ${t.slice(0,7)}. Read the repo again.`,unwritten:`Its facts are verified, but the catalog isn't built from them yet.`,unknownFiles:(e,t)=>`${e} source file${e===1?` has`:`s have`} no fact citing ${e===1?`it`:`them`} yet: read ${e===1?`it`:`them`}, or exclude generated code in org-pack/scan/${t}.yaml.`,trusted:`Every fact is verified at the checkout's commit, every source file is read, and the catalog is built from the facts.`},audit:`Sample audit`,auditNone:e=>`None yet: atticus verify audit ${e}`,auditTally:(e,t)=>t.precision===null?`${e}: no answers yet`:`${e}: ${Math.round(t.precision*100)}% right (${t.right} of ${t.right+t.wrong}; 95% between ${Math.round((t.low??0)*100)}% and ${Math.round((t.high??0)*100)}%)`,auditFacts:`facts`,auditLinks:`links`,auditSmall:`A small sample: read the range, not the number.`,sample:{open:`Answer a sample`,openOf:e=>`Answer a sample audit of ${e}`,intro:`A random sample of the repo's kept facts and the links the join makes from it, drawn as atticus verify audit draws it: the same seed draws the same sample on any machine. Read each item's lines and say whether it is right. Your answers go to the repo's audit file, a person's record you commit in a pull request; nothing is sent anywhere.`,seed:`Seed`,seedHint:e=>`Leave it empty for ${e}, the repo at its facts' commit.`,seedHintNone:`Leave it empty for the repo at its facts' commit.`,size:`How many facts and how many links`,draw:`Draw`,loading:`Drawing the sample…`,failed:e=>`Couldn't draw the sample: ${e}`,refused:{"no-facts":e=>`${e} has no facts to audit yet. Have your assistant read it (/atticus-map ${e}), then run atticus verify ${e}.`,"bad-facts":e=>`${e}'s facts file doesn't read as facts: run atticus verify ${e} first.`,unverified:(e,t)=>`${t} of ${e}'s facts aren't verified yet, and an audit samples kept facts only. Run atticus verify ${e} first.`,"bad-file":e=>`${e}'s audit file isn't one Atticus can read: atticus verify audit ${e} --report says why.`},empty:`Nothing to sample: the repo has no kept facts a reader wrote and no links.`,item:(e,t,n,r)=>`${e} of ${t}: ${n} ${r}`,fact:`fact`,link:e=>`link (${e})`,lines:`The lines it rests on`,noText:`(the line isn't in the checkout)`,choices:{right:`Right`,wrong:`Wrong`,unsure:`Unsure`},note:`Note (what is wrong with it)`,noteOptional:`Note (optional)`,onFile:(e,t)=>`On file: ${e}, by ${t}`,save:`Save the answers`,saving:`Writing the answers…`,nothingPicked:`Answer at least one item first.`,saved:(e,t,n)=>`Written to ${e}: ${t} answered, ${n} open. The app wrote only that file; commit it in a pull request:`,copyCommit:`Copy the git command`,sameInTerminal:`The same draw in a terminal:`,copyCommand:`Copy the audit command`,wrongFact:`Correct this fact`,wrongFactOf:e=>`Correct the fact ${e}`,wrongLink:e=>`Open ${e} on the estate canvas, then the link's Why is this linked? › This link is wrong`,factGone:`This fact isn't in the repo's facts any more, so there is nothing to correct.`},builtOn:`Built on`,builtOnNone:`Not read yet`,builtOnOne:(e,t,n)=>`${e}${t?` ${t}`:``} (${n})`,builtOnModule:(e,t)=>`${e}, in ${t}`,builtOnGap:e=>`${e}: none of its patterns are in the facts`,terms:`Terms`,termsNone:`None in the facts`,termRole:{owner:`its own id`,consumer:`a consumer it lets in`,none:`names no system`,unknown:`open: nothing says what it means yet`},termOne:(e,t,n,r)=>`${e} ${t}: ${n} (${r})`,termNote:e=>typeof e==`number`||/^[0-9a-f]{8}$/.test(e)?`note ${e}`:`the note "${e}"`,builtOnIntro:`What each repo's build files declare it is built on, each read from the line that declares it. Where a repo declares a framework and its facts show none of that framework's patterns — a Spring Boot service with no route, a React app with no screen — the entry points were probably missed, and that is a question for a person rather than something to be decided here.`,kept:`Facts kept`,rejected:`Rejected`,redacted:e=>`${e} quote${e===1?``:`s`} redacted`,coverage:`Coverage`,coverageOf:(e,t,n,r)=>`${Math.round(e*100)}%: ${t} file${t===1?``:`s`} read, ${n} not read, ${r} excluded`,noReport:`No verifier's report yet`,commit:`Commit`,sameCommit:e=>`${e.slice(0,7)}, the checkout's`,otherCommit:(e,t)=>`Facts ${e.slice(0,7)}, checkout ${t.slice(0,7)}`,noCheckout:e=>`Facts ${e.slice(0,7)}; no checkout to compare with`,noFactsCommit:`No facts yet`,catalogFrom:`Catalog from`,from:{facts:`Its facts`,readers:`The built-in readers`,both:`Its facts and the readers`,none:`Nothing yet`},records:(e,t)=>`${e} record${e===1?``:`s`} from facts, ${t} from readers`,unknownFiles:e=>`The ${e} file${e===1?``:`s`} no fact cites yet`,more:(e,t)=>`and ${e} more, listed in ${t}`,files:(e,t)=>`Files: ${e}, ${t}`,none:`None`,show:(e,t)=>`${e} ${t}: show them`,what:{kept:`facts kept`,redacted:`quotes redacted`,rejected:`lines rejected`,unknown:`files not read`,excluded:`files excluded`,asked:`questions open`,unverified:`facts not checked`},asked:`Questions open`,unverified:`Not checked yet`,keptFix:`Each is checked on its line. Open a citation to see the quote, and Correct this if the fact is wrong.`,redactedFix:`A secret value in the quote was replaced with <redacted> before the facts were kept. Nothing to do: the claim is still checked on its line.`,rejectedFix:e=>`The cited line doesn't say what the fact claims, or the line isn't a fact. Your assistant fixes each from ${e}, then the verifier checks them again:`,rejectedLine:(e,t)=>t?`${e}: ${t}`:e,rejectedNoLine:`No file or line: the line isn't a fact`,unknownFix:e=>`No fact cites these yet. Have your assistant read them, or exclude generated code in org-pack/scan/${e}.yaml:`,excludedFix:e=>`Left out of the read by org-pack/scan/${e}.yaml. If one should be read, take its exclusion out of that file and read the repo again.`,askedFix:`Atticus asked because the code doesn't say. Answer each; the next verify reads the answer.`,answer:`Answer it`,unverifiedFix:`The verifier hasn't checked these on their lines yet:`,moreFacts:(e,t)=>`and ${e} more, in ${t}`,openCanvas:`Open the repo on the estate canvas`,fresh:{title:`Freshness`,intro:`Which repos' clones have moved past the commit their facts were read at, and what reading each again costs: the files changed that the facts cite, the facts to read again (the rest are carried as they are), and the command to run. Most stale first. Read from the facts and the clones with local git only; nothing is fetched or written. The same list in a terminal: atticus estate fresh.`,empty:`No repo is read yet, so none can be stale. atticus next says which to read first.`,allFresh:e=>`All ${e} repo${e===1?``:`s`} read ${e===1?`is`:`are`} fresh: the facts are of the commit the clone is at.`,summary:(e,t,n)=>`${e} of ${t} read moved on · ${n} fact${n===1?``:`s`} to read again`,caption:`Repos whose clone has moved past their facts' commit, most stale first`,col:{repo:`Repo`,state:`State`,facts:`Facts at`,clone:`Clone at`,cited:`Files cited that changed`,reread:`Facts to read again`,carried:`Carried`,run:`Run`},states:{stale:`Read again`,"unknown-commit":`Commit not in the clone`,moved:`Moved, nothing cited changed`,"no-checkout":`No clone`,fresh:`Fresh`,"not-read":`Not read yet`},more:e=>`+${e} more`,freshCount:e=>`${e} more repo${e===1?` is`:`s are`} fresh, and not listed here.`}},changeKnowledge:{title:`Knowledge that applies`,onFeature:`The pages attached to this change, ranked, with their source, the tasks that use them and the pages that disagree, are on the change's Knowledge page. Confirm or exclude them there.`,openPage:`Open the change's knowledge`,intro:`What the change's stages picked from the org's knowledge, with why: from the feature stage on, each picks the patterns, standards, decisions, processes and requests, and the wiki and document sections, that its own input leads to. Confirm what applies, and every later stage that takes its kind picks it; exclude what doesn't, and no later stage picks it again.`,none:`No knowledge is attached to this change yet. The feature stage is the first that picks pages from the org's wikis, documents and standards. Once the brief is written, run:`,featureCommand:e=>`atticus change feature ${e}`,working:`Writing knowledge.yaml…`,caption:`Knowledge that applies to this change`,item:`Item`,why:`Why`,stages:`Stages`,status:`Status`,actions:`Confirm or exclude`,statuses:{suggested:`Suggested`,confirmed:`Confirmed`,excluded:`Excluded`},confirm:`Confirm`,exclude:`Exclude`,confirmItem:e=>`Confirm ${e}`,excludeItem:e=>`Exclude ${e}`,kinds:{Pattern:`Pattern or standard`,Decision:`Decision`,ProcessDefinition:`Process or request`,Party:`Team or vendor`,Product:`Product`,GlossaryTerm:`Term`,SourceDocument:`Document`,WikiSection:`Wiki section`,DocumentSection:`Document section`},nearMisses:e=>`Nearly picked (${e}): left out for room`,nearMissStage:e=>`left out of ${e}`,set:(e,t,n)=>`${e} is ${t}, in ${n}. Commit it with the change's files:`,copyCommit:`Copy the git command`,noStages:`a person`,fromSource:(e,t)=>t?`from ${e} (${t})`:`from ${e}`,tasks:e=>{let t=typeof e==`string`?[e]:e;return`task${t.length===1?``:`s`} ${t.join(`, `)}`}},knowledgeConflicts:{title:`Pages that disagree`,intro:`Two pages say different things about the same item. A person decides which applies (or both, in different cases); nothing is picked for them. A signal may suggest a page (it replaces the other, its owner handles the item, its source is tagged for the kind, it is in the team's space, or it was edited last), but only suggests. When code verified in a repo holds one page's value, the code settles it: a document never overrides a fact verified from code.`,says:(e,t)=>`${e} says "${t}"`,open:e=>`Waiting for a person: question ${e} (atticus questions answer ${e} --option <n>, or on the Questions page).`,notAsked:`No one has been asked yet; a change that relies on it asks a person which applies.`,applies:(e,t)=>`${e} applies (${t}).`,both:(e,t)=>`Both apply, in different cases (${e}${t?`: "${t}"`:``}).`,byPerson:e=>`answered by ${e}`,byCode:(e,t,n,r)=>`settled by the code: ${e} ${t} has ${n}, verified at ${r}`,suggested:(e,t,n)=>`Suggested, not decided: ${e}, by ${t} (${n}).`},conformance:{title:`Code against design`,intro:`Does the code do what the design says? Each repo's branch is scanned at its commit and checked against the change's target flows: every call, table, column, migration and endpoint they add must be there, every call they remove gone, and nothing they don't name added. Every item cites its file and line. No AI; a person can dismiss a finding as not relevant.`,none:`No change yet. Start one from a brief, then run its architecture stage.`,noTargets:e=>`${e} has no target flows yet, so there is nothing to check the code against. Its architecture stage writes them:`,notChecked:e=>`${e}'s code hasn't been checked against its target flows yet. A task run checks it when its build passes, or run:`,repo:(e,t)=>`${e} at ${t}`,commits:(e,t)=>`Commit ${e.slice(0,12)}, compared with ${t.slice(0,12)}`,task:e=>`Only the steps task ${e} builds`,counts:e=>`${e.found} found, ${e.missing} missing, ${e.stillThere} still there, ${e.unexpected} not in the design`,allGood:`Everything its target flows add is there, and nothing they don't name.`,itemsCaption:e=>`What the check looked for in ${e}, and what it found`,status:{found:`Found`,missing:`Missing`,"still-there":`Still there`,unexpected:`Not in the design`},col:{status:`Result`,what:`What`,step:`Step`,task:`Task`,at:`Where`,finding:`Finding`},step:(e,t)=>t?`${e} item ${t}`:`${e} trigger`,noStep:`no target flow`,unchecked:`Not checked by a scan`,uncheckedIntro:`A scan can't show these steps; a person or a test checks them.`,gate:e=>e?`The findings are on the conform gate, round ${e}. Dismiss one as not relevant from the change's findings.`:`Nothing was written to the conform gate.`,problems:`What couldn't be read`,run:`Check the code again`},changeImpact:{title:`What this change breaks`,intro:`From the change's target flows: each entry or table they break, who calls or uses it today, the fields that stop crossing and the gateway routes to update, each with the team that owns it. A link the map only guessed may break, and isn't counted as a break until someone confirms it.`,noTargets:e=>`${e} has no target flows yet, so there is nothing to weigh. Its architecture stage writes them:`,nothing:`Its target flows break nothing the map shows.`,counts:(e,t,n)=>`${e} caller${e===1?``:`s`} ${e===1?`breaks`:`break`}, ${t} may break (link guessed), ${n} gateway route${n===1?``:`s`} to update.`,owned:e=>`Owned by ${e}`,why:`Why it breaks`,gone:`Stops crossing`,required:`Callers must now send`,callersCaption:e=>`Who calls or uses ${e}, and whether it breaks`,col:{who:`Caller`,verdict:`Breaks?`,owner:`Owner`,where:`Where`},breaks:`Breaks`,mayBreak:e=>`May break (link guessed ${e})`,guessWords:{"joined-by-path":`by path`,"joined-by-label":`by a host's first label`,"joined-by-platform-setting":`by a platform-wide setting`,"joined-by-folder-name":`by a setting's folder name`,"joined-despite-conflict":`despite an open host conflict`,"joined-by-service-name":`by a Service's short name`},confirm:e=>`Not counted as a break: the critic's ${e} asks the caller's owner to confirm each guessed link.`,nobody:`The map shows nobody calling or using it.`,chain:`Up the chain: who calls the callers`,upstream:(e,t)=>`Up the chain, ${e} more ${e===1?`breaks`:`break`} and ${t} may break (resting on a guessed link).`,chainCaption:e=>`Who calls the callers of ${e}, hop by hop`,chainCol:{who:`Caller`,via:`Calls`,verdict:`Breaks?`,owner:`Owner`,where:`Where`},via:e=>`via ${[...e].join(`, `)}`,depth:e=>`${e} hops up`,restsOwn:e=>`May break (its link guessed ${e})`,restsOn:(e,t)=>`May break (rests on ${e}, guessed ${t})`,capped:e=>`The walk stops at ${e} hops up; more callers are above the last ones listed.`,routes:`Gateway routes to update`,route:(e,t)=>`${e}: ${[...t].join(`, `)} ${t.length===1?`calls`:`call`} through it`,teams:`Teams to involve`,noTeam:e=>`no team (${e})`,problems:`Notes`,command:e=>`atticus change impact ${e}`},estimate:{title:`Estimate`,intro:`How big the change is, counted from its target flows: each step it adds, changes or removes is a unit of work, classed by what it reaches. The days come from the org pack's ranges, summed; every unit and driver says where it comes from. No AI, and never a number nobody stands behind.`,none:`No change yet. Start one from a brief, then run its architecture stage.`,noTargets:e=>`${e} has no target flows yet, so there is nothing to size. Its architecture stage writes them:`,effort:`Effort`,effortRange:(e,t,n)=>`${e} to ${t} developer days (most likely ${n})`,noDays:e=>`${e} unit${e===1?``:`s`} of work, and no days:`,noTable:`the org pack has no estimates.yaml, so no unit has a range. Add one with the ranges your teams agree.`,noMatch:`no class in the org pack's estimates.yaml matches this work.`,from:(e,t)=>`from ${e} of ${t} units of work; the rest need a class and count for nothing yet`,calendar:`Calendar`,waiting:e=>`Waiting, from the release forecast: ${e} working days`,longer:e=>e===`work`?`The work takes longer than the waiting.`:`The waiting takes longer than the work.`,noWait:`No waiting worked out: the release forecast couldn't be read.`,calibration:`Calibration`,notCalibrated:(e,t)=>e?`Not calibrated yet: the ranges are ${e}'s, from ${t??`estimates.yaml`}. Once past changes record their effort, the ranges are checked against them.`:`Not calibrated yet, and no ranges to calibrate.`,drivers:`What drives it`,driversCaption:`What makes the change bigger or riskier, with where it comes from`,noDrivers:`Nothing makes it bigger or riskier than its units of work.`,widens:e=>`widens the upper end ${e}×`,work:`The work`,workCaption:e=>`Every unit of work in ${e}`,needsClass:`needs a class`,perRepo:`By repo`,col:{what:`What`,count:`How many`,effect:`Effect`,source:`From`,repo:`Repo`,flow:`Flow`,step:`Step`,cls:`Class`,days:`Days`,units:`Units`},days:e=>`${e.p20}–${e.p80} (${e.p50})`,problems:`What couldn't be read`},changeDiagram:{title:`Change diagram`,intro:`What the change touches, drawn from its target flows: each component, entry and table, marked + new, ◇ changed or ✕ retired; the rest is there for context. A part is new only when the target flow says so.`,pick:`Change`,none:`No change yet. Start one from a brief, then run its architecture stage.`,noTargets:e=>`${e} has no target flows yet, so there is nothing to draw. Its architecture stage writes them:`,legend:`Legend`,legendNew:`+ New`,legendModify:`◇ Changed`,legendRetire:`✕ Retired`,legendContext:`Unmarked: there for context`,parts:`Every part and its mark`,caption:e=>`The parts of ${e}'s picture`,lines:`Every line and its mark`,col:{part:`Part`,kind:`Kind`,in:`In`,mark:`Mark`,from:`From`,to:`To`,what:`What`},mark:{new:`New`,modify:`Changed`,retire:`Retired`,none:`Context`},from:(e,t)=>`Drawn from ${e} target flow${e===1?``:`s`} in ${t}.`,problems:`What couldn't be drawn`,mermaid:`The same picture as Mermaid`,mermaidHint:`Paste it into a pull request, a wiki or a chat that draws Mermaid.`,copyMermaid:`Copy the Mermaid`,flows:e=>`The target flows of ${e}, step by step`},runNext:{title:`Run next`,copy:`Copy the command`,copySlash:`Copy the slash command`,terminal:`In a terminal, at the metarepo:`,slash:`Or type this in Copilot Chat or Claude Code:`,slashIn:e=>`Or type this in Copilot Chat or Claude Code in ${e}:`,noSlash:`No slash command does this step yet. Run the command in a terminal.`,whatNext:`Not sure what comes next? Type /atticus-next in Copilot Chat or Claude Code, or run atticus next.`,after:`After that`,install:`atticus assistant-files writes the slash commands into the metarepo, where Copilot Chat and Claude Code both read them:`,plugin:`For Claude Code, add the Atticus plugin: it carries the metarepo's slash commands, and says the next step when a session starts in a metarepo.`,commands:[{name:`/atticus-next`,args:`[--all]`,where:`metarepo`,what:`Says the next step to take, its command and why.`},{name:`/atticus-map`,args:`<repo>`,where:`metarepo`,what:`Reads a repo into facts, each citing its line; Atticus checks every one and the assistant loops until all pass.`},{name:`/atticus-probe`,args:``,where:`metarepo`,what:`Shows Atticus what the assistant can do here (open a file, write one, run a command) after atticus probe, so the first read of a repo is handed to it the way it can take it.`},{name:`/atticus-propose`,args:`[question id]`,where:`metarepo`,what:`Reads the code and config behind each open question and proposes an answer with the lines it rests on; Atticus checks every citation, and a person accepts it or answers otherwise.`},{name:`/atticus-survey`,args:`<repo>`,where:`metarepo`,what:`Drafts a repo's scan settings; Atticus checks them against the code.`},{name:`/atticus-verify`,args:`<repo>`,where:`metarepo`,what:`Compares a repo's code with its last scan; Atticus checks every item.`},{name:`/atticus-spec`,args:`<repo>`,where:`metarepo`,what:`Writes a repo's spec of flows and loops until the spec check passes.`},{name:`/atticus-answer`,args:`[question]`,where:`metarepo`,what:`Explains the open questions; the person chooses each answer.`},{name:`/atticus-knowledge`,args:`<source>`,where:`metarepo`,what:`Reads a knowledge source into items; Atticus checks every quote.`},{name:`/atticus-find`,args:`<term or phrase>`,where:`metarepo`,what:`Searches every wiki for it and proposes what the pages hold about it; Atticus checks every quote.`},{name:`/atticus-needs`,args:`<change>`,where:`metarepo`,what:`Says what a change needs from the organisation: requests to raise, standards to follow, teams to involve.`},{name:`/atticus-feature`,args:`<change>`,where:`metarepo`,what:`Places a change on the estate's flows and features, looping with the checks and critic.`},{name:`/atticus-architecture`,args:`<change>`,where:`metarepo`,what:`Writes a change's target flows from its feature, looping with the checks and critic.`},{name:`/atticus-stories`,args:`<change>`,where:`metarepo`,what:`Writes a change's stories and tasks from its approved design.`},{name:`/atticus-small`,args:`<change>`,where:`metarepo`,what:`Plans a small change in one step: its place on the flows, its target flows and its stories.`},{name:`/atticus-draft`,args:`<change>`,where:`metarepo`,what:`Drafts a change's proposal, spec and interfaces from its brief and the catalog.`},{name:`/atticus-attach`,args:`<change> <files…>`,where:`metarepo`,what:`Attaches a spec, screenshot, PDF or document to a change, for its steps to read and cite.`},{name:`/atticus-knowledge-ask`,args:`<question>`,where:`metarepo`,what:`Answers a question from the knowledge items only, citing each one.`},{name:`/atticus-ask`,args:`<question>`,where:`metarepo`,what:`Answers a question about the systems from the catalog.`},{name:`/atticus-impact`,args:`<record id>`,where:`metarepo`,what:`Lists what a change to one record reaches.`},{name:`/atticus-critic`,args:`<change>`,where:`metarepo`,what:`Reviews a change with the critic's AI lenses, one at a time; every finding is recorded.`},{name:`/atticus-plan`,args:`<change>`,where:`metarepo`,what:`The old name of /atticus-stories, kept for one version.`},{name:`/atticus-snow`,args:`<change>`,where:`metarepo`,what:`Drafts the service-desk requests a change needs.`},{name:`/atticus-release`,args:`<change>`,where:`metarepo`,what:`Checks whether a change is ready to release.`},{name:`/atticus-task`,args:`<change> <task>`,where:`metarepo`,what:`Starts a task with its context loaded: its story, criteria, today's code and the files to change. In a code repo, /atticus-task <task>.`}]},work:{loading:`Loading`,unreadable:`These files couldn't be read:`,estate:`What is read and trusted`,coverage:`Onboarded and read`,reposListed:`repos in the manifests`,reposCloned:`cloned`,reposScanned:`in the catalog`,records:`facts in the catalog`,openOnboarding:`Open Onboarding`,trustNone:`No repo is listed yet, so there is no map to trust.`,allTrusted:`Every repo's map is trusted: its facts are verified and of the commit checked out.`,notTrusted:`Not trusted yet`,openTrust:`Open Map › Trust`,inFlight:`Changes in flight`,noChanges:`No change is in flight. Start one with atticus change new "<title>" --type <type>.`,stageCol:`Stage`,changeCol:`Change`,stateCol:`State`,commandCol:`Run`,slashTitle:`Slash commands in Copilot Chat and Claude Code`,slashIntro:`These slash commands are in Copilot Chat once atticus assistant-files has written them, and in Claude Code through the Atticus plugin. In each AI step your assistant does the model work and Atticus checks it.`,slashWhere:{metarepo:`the metarepo`,repo:`a code repo`},onbIntro:`Pick the repos, connect the knowledge sources, then run the steps in order. Each step is a command; this page shows which one is next.`,steps:`Steps, in order`,stepPick:`Pick the repos: edit the manifest. Each repo is one entry.`,stepPickNone:`There is no manifest yet. Propose one from a folder of clones or your Git host's organisation:`,stepAddOne:`Or add one repo at a time, saying what it is in your own words. That line goes into every reading prompt, the questions a join asks and these views:`,stepSync:`Clone the repos, or bring the clones up to date:`,stepRead:`Have your assistant read each repo and write its facts, each citing its line:`,stepWrite:`Check the facts against the code and put them in the catalog:`,stepAnswer:`Answer the questions the scan raised:`,stepAnswerLink:`Open the Questions page`,stepTrust:`See how far to trust each repo's map, and the files not read yet:`,done:`DONE`,todo:`TO DO`,repos:`Repos`,noRepos:`No repos in any manifest yet.`,repoCol:`Repo`,aboutCol:`What it is`,aboutDraft:`Unconfirmed draft`,aboutMissing:`Nothing says yet. Say what it is, in one line:`,typeCol:`Type in the manifest`,matchCol:`Matched repo type`,matchHint:`Run to see the match and its evidence:`,cloneCol:`Clone`,cloned:`CLONED`,notCloned:`NOT YET`,settingsCol:`Scan settings`,settingsMissing:`none yet`,lastScanCol:`In the catalog`,notScanned:`nothing yet`,recordCount:e=>`${e} fact${e===1?``:`s`}`,atCommit:e=>`at ${e.slice(0,7)}`,sources:`Knowledge sources`,sourcesMissing:e=>`${e} isn't there. Add a wiki with atticus sources add <type> <location>; it prints the entry to paste.`,sourcesNone:e=>`${e} lists no wikis or absorbed repos yet.`,sourcesFile:`File`,wikiCol:`Wiki`,kindCol:`Kind`,whereCol:`Location`,spacesCol:`Spaces`,ownerCol:`Owner`,absorbedTitle:`Absorbed repos`,syncSources:`Read the wikis:`,pickChange:`Change`,noChangeYet:`No change yet. Start one with atticus change new "<title>" --type <type>.`,noChangeTitle:`No change yet`,noChangeCommand:`atticus change new "<title>" --type <type>`,noChangeLink:`All changes lists every change once you start one.`,pickAChangeTitle:`Pick a change`,pickAChange:`This tab is about one change. Pick it in All changes, and every tab of Change follows it.`,openAllChanges:`Open All changes`,stageIs:e=>`This change is at the ${e} stage.`,goStage:e=>`Open ${e}`,files:`The change's files`,noFiles:`No files for this change yet.`,fileCol:`File`,statusCol:`Status`,tasks:`Tasks`,noTasks:`No tasks yet. Write them with atticus plan stories <change>.`,taskCol:`Task`,repoTaskCol:`Repo`,runCol:`Run it`,taskDone:`DONE`,taskOpen:`OPEN`,taskInRepo:e=>`Prints the same context for any assistant, to read before coding in ${e}.`,stage:{feature:`feature`,architecture:`architecture`,stories:`stories`,tasks:`tasks`,release:`release`,done:`done`},why:{discover:`There are no repos to work on until a manifest lists them.`,sync:e=>`${e} repo${e===1?` isn't`:`s aren't`} cloned yet.`,read:{"not-read":e=>`${e} isn't read yet: your assistant reads it and writes its facts, each citing its line, and atticus verify checks every one.`,unverified:e=>`${e}'s facts aren't verified yet: atticus verify checks each against the line it cites.`,rejected:e=>`Some of ${e}'s facts were rejected: your assistant fixes them from the rejected file, then verify runs again.`,stale:e=>`${e}'s facts are of another commit than its checkout: your assistant reads what changed again.`,unwritten:e=>`${e}'s facts are verified but not in the catalog yet: atticus verify --write puts them there.`},write:e=>`When the read is done, atticus verify ${e} --write checks the facts and puts them in the catalog.`,answer:e=>`${e} question${e===1?` is`:`s are`} waiting. Answer on the Questions page; it shows the command to rerun.`,onboarded:`Every repo is read and its facts verified. Map › Trust says how far to trust each repo's map; atticus next says what comes next.`,change:(e,t)=>`${e} is at the ${t} stage.`,newChange:`Everything is onboarded and no change is in flight. Start one.`,feature:`Your assistant places the change on the estate's flows and features; Atticus checks and criticises every draft until nothing blocks.`,architecture:`Your assistant writes the target flows; Atticus checks and criticises every draft until nothing blocks.`,stories:`Writes the stories, stories.md and tasks.md from the approved design.`,task:(e,t)=>`Task ${e} in ${t} is the next open one. /atticus-task gives your assistant its context: the story, the criteria, the step with today's code and the files to change.`,small:`A small change: your assistant places it, writes its target flows and words its stories in one step; Atticus runs every stage's checks and the critic at its gate.`,later:`The change is past this stage; its status says what it needs now.`,refresh:`The diagram is drawn from the catalog. When a repo's code has changed, your assistant reads it again and atticus verify --write puts its facts in the catalog.`,stageDone:(e,t)=>`The ${e} stage is done; the change now waits on its hand-off gate. ${t}`,stageBlocked:(e,t)=>`The ${e} stage is done, but the gate can't be raised yet: ${t}`,stageUnderWay:(e,t)=>t===`questions`?`The ${e} stage waits for answers to its questions; run it again once they are answered.`:t===`waiting`?`The ${e} stage is with your assistant: finish its hand-off, then run it again.`:t===`stopped`?`The ${e} stage stopped for a person to fix a file; run it again once it is fixed.`:`The ${e} stage is drafting; run it again to go on.`,critic:`Reviews the change's files against the checklists.`,handoff:`Opens the stage's hand-off PR; merging it approves the stage.`,questionsList:`Lists the open questions with their files.`},architectureIntro:`The diagram is drawn from the catalog. A change at the design stage shows its next step here.`},shell:{aiOff:`AI OFF`,textOnlyAi:`TEXT-ONLY AI`,aiIsOffIn:`AI is off in this organisation: no AI step runs; people write and the rule checks review.`,imageReadingIsOff:`Image reading is off: pictures go to a person in Intake.`,setYourGitUser:`SET YOUR GIT USER`,recordedAs:(e,t,n)=>`${e}${t} · recorded as ${n}`,askAtticus:`Ask Atticus`,askWhatBreaksIf:e=>`Ask: what breaks if ${e} changes?`,askNeutral:`Ask: who calls a component, or what breaks if a table changes?`,ask:`Ask`,help:`Help`,replayTheTour:`Replay the tour`,skipToContent:`Skip to content`},boundary:{couldntBeShown:e=>`${e} couldn't be shown`,somethingOnThisScreen:e=>`Something on this screen failed: ${e}. The other screens still work; reload to try again.`},flowView:{nodesInGroupsEdges:(e,t,n,r)=>`${e}: ${t} nodes in ${n} groups, ${r} edges.`,callsInsideIt:e=>`, ${e} calls inside it`,edgePointAtAnother:(e,t,n,r,i)=>`${e}: ${t} edge${n}${r}${i}. Point at another box, or click it again to clear.`,everythingHereIsOne:`Everything here is one system: open Container to see its components and how they connect.`,edgesPointAtA:e=>`${e} edges. Point at a box to light its edges; dashed lines are asynchronous.`},menu:{atticus:`ATTICUS`,askAtticus:`Ask Atticus`,morePages:`More pages`,keysMac:`Cmd+K`,keys:`Ctrl+K`,anyPage:e=>`${e}: any page`},palette:{askItem:e=>`Ask: ${e}`,askDetail:`answer from the catalog, with the query shown`,goToAScreen:`Go to a screen, change or record, or ask a question`,goToAScreen2:`Go to a screen, change or record… or ask a question`,nothingMatches:`Nothing matches.`,results:`Results`,toMoveEnterTo:`↑ ↓ to move · Enter to open · Esc to close`,goToAnything:`Go to anything`},tour:{tourOf:(e,t,n)=>`Tour · ${e} of ${t} · ${n}`,steps:{home:{title:`Your home`,body:`Home is one page. First what needs a person across every change (changes in each phase, blocking findings, open needs, questions and manual steps) and the step to run next; then what is read and trusted, and each change in flight with the stage it is at. Beside it: Map, Change, Questions, Knowledge and Set up. Everyone sees the same screens; Ctrl+K jumps anywhere.`},ask:{title:`Ask in plain words`,body:`Type a question such as “who calls <a component>?” or “what breaks if <a table> changes?” in the box at the top. Atticus answers from the catalog and always shows the query it ran.`},change:{title:`One change, a tab per stage`,body:`Change opens on All changes: pick one, and the tabs follow it. At a glance says where the change is and what blocks it; then a tab for each stage: feature, architecture, stories and tasks. Each shows that stage's files and the command to run next; Feature also lists the org knowledge that applies, to confirm or exclude. Watch a change you aren't on, and your digest says how it is doing.`},assistant:{title:`Run a step in your assistant`,body:`The AI steps run in your assistant, not here: type /atticus-next in Copilot Chat or Claude Code and it says what comes next and runs it when you ask. Its questions come back here to answer, and this page follows along.`},approve:{title:`Approving is the pull request`,body:`Each phase ends with a hand-off PR in the metarepo. Merging it approves the gate; your Git host's rules decide who may approve. Atticus records you by your Git user.`}},skipTheTour:`Skip the tour`,back:`Back`,next:`Next`,done:`Done`},glossary:{title:`What the words mean`,intro:`Atticus's own words, each in one plain sentence. atticus explain <word> says the same on the command line.`,link:`Words`,linkTitle:`What Atticus's words mean`,terms:[{term:`metarepo`,says:`The Git repo Atticus keeps for your estate: the catalog read from your repos' code, the changes in flight, the knowledge and the org pack. Its pull requests are how things get approved.`},{term:`org pack`,says:`Your organisation's settings for Atticus, in org-pack/: the repos and their types, the change types, the checklists and how AI runs here, changed through a pull request.`},{term:`catalog`,says:`What Atticus read from your code: systems, components, endpoints, tables, settings and how they connect, each citing the file and line it came from.`},{term:`estate`,says:`All your systems and the repos behind them, as the catalog describes them.`},{term:`flow`,says:`One path through your code from a trigger (an endpoint, a job, a message) to what it reads, writes and returns, step by step, read from the code.`},{term:`change`,says:`A piece of work from idea to release, kept in the metarepo with its brief, its design, its stories and its tasks.`},{term:`target flow`,says:`How a flow will run once a change is in: the steps it adds, changes or removes, with what each reads and writes.`},{term:`hand-off`,says:`The pull request in the metarepo that ends a phase of a change; merging it approves the phase's gate.`},{term:`gate`,says:`The point between two phases of a change where its findings are checked and a person approves, by merging the hand-off pull request.`},{term:`finding`,says:`Something the critic or a check raised about a change (blocking, a risk, a gap or an idea), citing where it is; a person decides what to do with it.`},{term:`critic`,says:`The AI reviewer that reads a change at a gate, one lens at a time, and raises findings.`},{term:`lens`,says:`One way the critic reads a change, such as security, data or architecture, each with its own rules.`},{term:`checking round`,says:`One more critic round after a gate's rounds are used, which reviews only what a person fixed.`},{term:`question`,says:`Something Atticus asked a person because the code doesn't say, with options and the lines it read; the answer is kept in the metarepo for the steps that read it.`},{term:`knowledge item`,says:`A fact read from a wiki or a document you added (a process, a standard, a decision, a team), quoted with its page, until a person verifies it.`},{term:`need`,says:`Something a change needs from the organisation, such as a firewall rule or an access request, with how to ask for it and who handles it.`},{term:`dialect`,says:`The rules that tell Atticus's scanner how to read one framework or language, your own house frameworks included.`},{term:`base clone`,says:`Atticus's own read-only copy of a repo, in the metarepo's workspace/, which the scans read; it never touches your working copy.`},{term:`slash command`,says:`A command you type in your assistant's chat, such as /atticus-next, that runs one Atticus step with the assistant's model.`},{term:`service desk`,says:`Your operations ticketing system, where a change's release and access requests are raised.`}]},filter:{label:`Filter`,placeholder:`Words to match, for example forge-ledger`,shown:(e,t)=>`${e} of ${t} shown`,words:e=>`“${e}”`,inRepo:e=>`in ${e}`,inChange:e=>`in ${e}`,among:e=>`among ${e}`,nothingMatches:e=>`Nothing matches ${e}.`,clear:`Clear the filter`,repo:`Repo`,allRepos:`All repos`},common:{nothingHereYet:`Nothing here yet.`,of:(e,t,n)=>`${e}: ${t} of ${n}`},across:{findings:`Findings`,tasks:`Tasks`,stories:`Stories`,tests:`Tests`,requests:`Requests`,releases:`Releases`,needs:`Needs`,change:`Change`,severity:`Severity`,finding:`Finding`,where:`Where`,state:`State`,task:`Task`,repo:`Repo`,what:`What`,done:`Done`,story:`Story`,title:`Title`,repos:`Repos`,written:`Written`,requirementsTested:`Requirements tested`,gaps:`Gaps`,firstGaps:`First gaps`,request:`Request`,for:`For`,missing:`Missing`,risk:`Risk`,next:`Next`,handOff:`Hand-off`,noFindingsOnAny:`No findings on any open change. Run the critic on a change to review it.`,noTasksYetTasks:`No tasks yet: tasks come with a change's plan.`,noStoriesYetWrite:`No stories yet: write them on a change's Breakdown.`,noOpenChangesTo:`No open changes to trace.`,noServiceRequestsDrafted:`No service requests drafted on any open change.`,noOpenChanges:`No open changes.`,notYet:`not yet`,noneOpen:`none open`,acrossChanges:`Across changes`,ofAcrossOpenChange:(e,t,n,r)=>`${e} of ${t} across ${n} open change${r}`,acrossOpenChanges:e=>`${e} across open changes`,nothingMatches:e=>`Nothing matches “${e}”.`,acrossChanges2:e=>`${e} across changes`,needsIntro:`Every open need of every open change: the requests to raise, the standards to follow and the teams to involve. Done, Not needed and Reopen work as on a change's page.`,needsShowAll:`Show the needs done or not needed too`,needsCount:(e,t)=>`${e} open need${e===1?``:`s`} across ${t} open change${t===1?``:`s`}`,needsNone:`No open needs on any change.`,needsNoChanges:`No open changes.`,needsOf:e=>`Needs of ${e}`,needsNotYet:e=>`${e} change${e===1?` hasn't`:`s haven't`} been looked at for needs yet`,needsCantRead:(e,t)=>`Couldn't read the needs of ${e}: ${t}`},changes:{define:`Define`,design:`Design`,plan:`Plan`,build:`Build`,release:`Release`,handOffPrOpened:`Hand-off PR opened. Reviewers approve it on the Git host; merging it approves the gate.`,syncedWithTheGit:`Synced with the Git host.`,criticRoundStartedThe:`Critic round started: the rule checks ran and any AI lens is with your assistant. Mark each run done below.`,theRuleChecksRan:`The rule checks ran. AI is off here, so no lens waits.`,checkedTheAnswer:`Checked the answer.`,readyToTryAgain:`Ready to try again.`,findAChange:`Find a change`,idTitleOrRepo:`Id, title or repo`,state:`State`,everyState:`Every state`,blocked:`Blocked`,blocked2:`BLOCKED`,noChangeMatches:`No change matches.`,changes:`Changes`,acrossAllChanges:`Across all changes`,noChangesYetStart:`No changes yet. Start one with atticus change new.`,currentPhase:e=>`${e}: current phase`,done:`done`,toCome:`to come`,phases:`Phases`,text:e=>`${e} text`,save:`Save`,close:`Close`,ifSomeoneSavedMeanwhile:`If someone saved meanwhile, Atticus refuses the save and asks you to reload.`,edit:e=>`Edit ${e}`,reason:`Reason`,reasonNeededToWaive:`Reason (needed to waive or dismiss)`,applyFix:`Apply fix`,owner:`owner`,ask:e=>`Ask ${e}`,notRelevant:`Not relevant`,waive:`Waive`,next:`Next`,risk:e=>`RISK ${e}`,handOff:(e,t,n)=>`${e} HAND-OFF · ${t}${n}`,whatBlocksTheHand:`What blocks the hand-off`,raiseHandOff:`Raise hand-off`,syncAndMergeWhen:`Sync and merge when approved`,runTheCriticYour:`Run the critic (your assistant)`,runTheRuleChecks:`Run the rule checks`,artifact:`Artifact`,status:`Status`,findings:`Findings`,actions:`Actions`,edit2:`Edit`,artifacts:`Artifacts`,checks:`checks`,noOpenFindingsOn:`No open findings on this change.`,openFindings:`Open findings`,done2:`DONE`,byHand:`BY HAND`,runWithAi:`Run with AI`,inputs:`Files attached`,promote:`Copy to general knowledge`,promoteFor:e=>`Copy ${e} to general knowledge`,promoted:e=>`${e} is copied to the metarepo's inputs/inbox/: general knowledge, read at the next sync. This change keeps its copy. Commit both through a pull request.`,attachLabel:`Attach a file`,attachHelp:`A spec, screenshot, PDF, email export or document. It is copied into the change's inputs/, and the change's steps read it as data, citing it by line or page.`,noInputs:`No file is attached yet.`,attached:e=>`Attached ${e}. The change's steps read it from now on.`,attachTooLarge:e=>`That file is ${e} MB; the app attaches files up to 15 MB. For a larger one, run atticus change attach in a terminal.`,inputFile:`File`,inputKind:`What it is`,inputWho:`Attached`,inputWhen:(e,t)=>`${e}, ${t.slice(0,10)}`,inputRead:(e,t)=>e===`text`?`Read, cited by ${t??`line`}`:`Not read: open it to see it`,inputOlder:e=>`Older version: ${e} replaces it`,inputHidden:`Hides instructions: kept out of every AI step until a person decides`,prototypes:`The prototype, compared`,noPrototypes:e=>`No prototype is attached. Compare one with the estate: atticus change attach ${e} --prototype <repo>`,prototypeMarker:`Prototype`,prototypeUnconfirmed:`a draft nobody has confirmed`,prototypeNoAbout:`Nothing says what it is yet.`,prototypeCounts:e=>`${e.exists} exist, ${e.changes} change, ${e.new} new, ${e.vendor} only a vendor provides`,prototypeGroup:{exists:`Exists`,changes:`Changes`,new:`New`,vendor:`Only a vendor`},prototypeGroupHelp:{exists:`The estate serves it as the prototype needs.`,changes:`The estate serves the operation, but not as the prototype needs.`,new:`Nothing in the estate serves it.`,vendor:`Only a vendor provides it, so it needs a route through the external gateway.`},prototypeNoCalls:`None.`,prototypeGroupCount:(e,t)=>`${e} · ${t}`,prototypeLeg:{"ui-bff":`UI to BFF`,"bff-mock":`BFF to mock`},prototypeCites:(e,t)=>`Prototype: ${e} → ${t}`,prototypeEstate:(e,t)=>`Estate: ${e} ${t}`,prototypeVendor:(e,t)=>`Vendor: ${e} ${t}`,prototypeTeam:(e,t)=>`Another team: ${e} ${t}`,prototypeLeft:e=>`${e} call${e===1?``:`s`} reach${e===1?`es`:``} nothing in the prototype and ${e===1?`isn't`:`aren't`} compared.`,noTasksYetThey:`No tasks yet: they come with the plan.`,tasks:`Tasks`,markDone:`Mark done`,retry:`Retry`,noAiRunsYet:`No AI runs yet.`,aiRuns:`AI runs`,pickAChangeOn:`Pick a change on the left, or start one with `,atticusChangeNew:`atticus change new`,noChangeSelected:`No change selected`},commandCenter:{select:e=>`Select ${e}`,bulkTitle:`Act on the selected items`,selected:e=>`${e} selected`,bulkAction:`What to do`,bulkNeedDone:e=>`Mark ${e} need${e===1?``:`s`} done`,bulkNeedNot:e=>`Mark ${e} need${e===1?``:`s`} not needed`,bulkStepSkip:e=>`Skip ${e} manual step${e===1?``:`s`}`,bulkTicket:`The ticket or note, for all of them`,bulkWhy:`Why, for all of them`,bulkDo:e=>`Do it for ${e}`,bulkClear:`Clear the selection`,bulkDone:(e,t)=>t?`Done for ${e}; ${t} couldn't be changed: open each to see why.`:`Done for ${e}.`,howStepsRun:`How AI steps run:`,howStepsRunChange:`Change in Set up › AI`,howStepsRunCantRead:`Atticus couldn't read how AI steps run here (org-pack/runtime.yaml).`,define:`Define`,design:`Design`,plan:`Plan`,build:`Build`,release:`Release`,theCatalogIsAccepted:`The catalog is accepted as the baseline, with your name, in catalog/baseline.yaml. Commit it and open a pull request: merging it makes it the baseline on main.`,changesInFlight2:`Changes in flight`,blockingFindings:`Blocking findings`,openOwnerQuestions:`Open owner questions`,factsInTheCatalog:`Facts in the catalog`,checksFromCode:`Checks from code`,aiLenses:`AI lenses`,done:` (done)`,toDo:` (to do)`,optional:` · optional`,acceptTheCatalogAs:`Accept the catalog as the baseline`,afterWalkingTheEcosystem:`After walking the ecosystem map with the architect. Every later scan, document and change is compared with it. It is a file in the metarepo, so it reaches main through a pull request.`,setUpAtticus:`Set up Atticus`,ofDone:(e,t)=>`${e} of ${t} done`,showMyDigest:`Show my digest`,sendItToMe:`Send it to me`,sentTo:e=>`Sent to ${e}.`,thingsNeedAttention:e=>`${e} things need attention.`,nothingIsBlockedRight:`Nothing is blocked right now.`,liveFromYourMetarepo:e=>`Live from your metarepo · you are ${e}`,liveFromYourMetarepo2:`Live from your metarepo`,approvingIsThePull:`Approving is the pull request: each phase ends with a hand-off PR, and merging it approves the gate. Your Git host decides who may approve.`,keyNumbers:`Key numbers`,currentPhase:e=>`${e}: current phase`,done2:`done`,toCome:`to come`,noChangeInFlight:`No change in flight. Start one with atticus change new.`,gatePipeline:e=>`Gate pipeline · ${e}`,gatePipeline2:`Gate pipeline`,interfacesInTheCatalog:`Interfaces in the catalog`,interfaces:`Interfaces`,theCatalogIsEmpty:`The catalog is empty. Read a repo first: atticus map <repo>, then atticus verify <repo> --write.`,systemMap:`System map`,explore:`Explore`,loading:`Loading…`,couldntLoadWhatNeeds:`Couldn't load what needs a person. Check that atticus ui is still running, then reload.`,nothingNeedsAPerson:`Nothing needs a person right now.`,needsAPerson:`Needs a person`,waitingOnYou:`Waiting on you`,waitingIntro:`What waits on a person across every change, by kind.`,waitQuestions:`Questions to answer`,waitNeeds:`Needs still open`,waitSteps:`Manual steps to do`,waitBlocking:`Blocking findings`,openNeeds:`Open needs`,byChangeIntro:`Grouped by change, changes with something blocking first; then what belongs to no change.`,noChangeGroup:`Not part of a change`,blocked:`BLOCKED`,groupCount:e=>`${e} waiting`,inState:e=>`in ${e}`,sectionNeeds:`Open needs`,sectionFindings:`Findings`,sectionSteps:`Manual steps`,sectionQuestions:e=>e?`Questions · ${e}`:`Questions`,sectionTriage:`To sort out`,sectionKnowledge:`Knowledge to verify`,knowledgeToVerify:e=>`${e} knowledge item${e===1?``:`s`} no one has verified yet`,knowledgeDetail:`Verify, correct or reject each against its page`,findings:e=>`${e} findings`,noOpenFindings:`No open findings.`,findingsByLens:`Findings by lens`,openFindingsBySource:`Open findings by source`,whereFindingsComeFrom:`Where findings come from`,records:e=>`${e} records`,noFactsYet:`No facts yet.`,catalog:`Catalog`,aPersonApprovesEvery:`A person approves every write · Atticus never touches live systems · every fact keeps its evidence`},explore:{evidence:`Evidence`,noEvidenceRecordedTreat:`No evidence recorded: treat this fact as unconfirmed.`,whatBreaksIfThis:`What breaks if this changes`,isOwnedBy:` is owned by `,theCatalogDoesntKnow:`The catalog doesn't know who owns `,yet:` yet.`,queryRun:`Query run: `,editItBelowTo:` · edit it below to refine`,ask:e=>`Ask: ${e}`,search:`Search`,tryDailyLimitKind:`Try: daily limit · kind:interface via:gateway · "ledger-db"`,wordsMatchIdsAnd:`Words match ids and names; `,kind:`kind:`,system:`system:`,status:`status:`,narrowIt:` narrow it.`,searchTheCatalog:`Search the catalog`,searchForAService:`Search for a service, a table, a topic, a term or a feature.`,searchResults:`Search results`,nothingMatchesTryFewer:`Nothing matches. Try fewer words.`,results:`Results`,theCatalogIsEmpty:`The catalog is empty. Read a repo first: atticus map <repo>, then atticus verify <repo> --write.`,around:e=>`Around ${e}`,theWholeEstate:`The whole estate`},knowCommon:{table:`Table`},design:{interfaces:`Interfaces`,tables:`Tables`,result:`Result`,what:`What`,next:`Next`,diagramLabel:`Diagram label`,matched:`Matched`,how:`How`,similar:`Similar`,context:`Context`,data:`Data`,events:`Events`,container:`Container`,sequence:`Sequence`,item:`Item`,party:`Party`,due:`Due`,forecast2:`Forecast`,status:`Status`,commitment:`Commitment`,neededBy:`Needed by`,noInTheCatalog:e=>`No ${e} in the catalog.`,evidence:`Evidence`,noEvidenceTreatIt:`No evidence: treat it as unconfirmed.`,thePathOfTheCall:`The path of the call`,scopesIt:e=>`scopes ${e}`,noScopeDemanded:`no scope demanded`,theCallerMeets:e=>`the caller meets ${e}`,thenReaches:e=>`then reaches ${e}`,noRouteRecordedFor:`The catalog has no gateway route for this call: only that it goes through a gateway.`,consumersAndDependants:`Consumers and dependants`,seeImpact:`See impact`,nothingInTheCatalog:`Nothing in the catalog depends on it.`,record:`Record`,apis:`APIs`,interfacesAndEvents:`Interfaces and events`,dataStores:`Data stores`,dataStoresComeFrom:`Data stores come from DDL, migrations, ORM mappings and DBA exports, never live databases.`,contractsList:`Contracts list`,contracts:`Contracts`,chooseAnApiAn:`Choose an API, an interface or a table to see its evidence and who depends on it.`,pickAContract:`Pick a contract`,contractsByKind:`Contracts by kind`,contractMix:`Contract mix`,ofInterfacesVerifiedFrom:(e,t)=>`${e} of ${t} interfaces verified from code`,aVendorSpecIs:`A vendor spec is a document until its caller is scanned; code wins when they differ.`,fieldMappings:`Field mappings`,verifiedFromCode:`Verified from code`,noDiagramsYetPut:`No diagrams yet. Put draw.io, Visio, Lucid CSV or Mermaid files under `,inputsDiagrams:`inputs/diagrams/`,orAddThemOn:` (or add them on `,intake:`Intake`,thenComeBack:`), then come back.`,reconcileADiagramAgainst:`Reconcile a diagram against the catalog`,edgesMatchCode:(e,t)=>`${e}/${t} edges match code`,toResolve:e=>`${e} TO RESOLVE`,inSync:`IN SYNC`,checkAgain:`Check again`,ofDrawnEdgesAgree:(e,t)=>`${e} of ${t} drawn edges agree with code`,drawnEdgesAgreeWith:`drawn edges agree with the code`,itemsToResolveBy:`Items to resolve by kind`,labelsMatchedToThe:(e,t)=>`${e}/${t} labels matched to the catalog`,noDiagramsCouldBe:`No diagrams could be read.`,diagrams:`Diagrams`,pickADiagram:`Pick a diagram.`,all:e=>`All ${e}`,filterItems:`Filter items`,everyDrawnEdgeAgrees:`Every drawn edge agrees with the code.`,itemsToResolve:`Items to resolve`,codeWinsOverA:`Code wins over a diagram: a conflict goes to `,triage:`triage`,untilAPersonDecides:` until a person decides.`,edgeByEdge:e=>`Edge by edge · ${e}`,edgeByEdge2:`Edge by edge`,ofEdgesAgreeWith:(e,t)=>`${e} of ${t} edges agree with code`,diagramLabels:`Diagram labels`,noMatch:`NO MATCH`,confirmANameWith:`Confirm a name with `,atticusAliasLabelId:`atticus alias "<label>" <id>`,itIsSavedTo:`; it is saved to the alias table.`,nameMatching:`Name matching`,view:`View`,system:`System`,drawnFromTheCatalog:`Drawn from the catalog; rebuilt whenever it changes. Edits happen in draw.io and come back through the metarepo.`,generatedViews:`Generated views`,nothingToDrawThe:e=>`Nothing to draw: the catalog has nothing for the ${e} view.`,theCatalogIsEmpty:`The catalog is empty. Read a repo first: atticus map <repo>, then atticus verify <repo> --write.`,view2:e=>`${e} view`,mermaidSource:`Mermaid source`,nothingToDrawFor:`Nothing to draw for this view yet.`,mermaid:`Mermaid`,copied:`Copied`,copy:`Copy`,diagramsUnder:`Diagrams under `,areComparedWithThe:` are compared with the catalog on `,reconcile:`Reconcile`,diagramsInTheMetarepo:`Diagrams in the metarepo`,writeTheDrawIo:`Write the draw.io shape library with `,atticusDiagramLibraryFile:`atticus diagram library <file>`,andLoadItIn:` and load it in draw.io, or in the draw.io integration for IntelliJ or VS Code: boxes keep their catalog ids.`,catalogShapeLibrary:`Catalog shape library`,nothingPlannedYet:`Nothing planned yet.`,today:e=>`today ${e}`,target:e=>`target ${e}`,timelineOfPlanItems:(e,t,n)=>`Timeline of ${e} plan items from ${t}; today ${n}`,changesParties:(e,t,n)=>`${e} · ${t} changes · ${n} parties`,noInitiativesYet:`No initiatives yet.`,startOneFromA:`Start one from a guided journey: `,atticusInitiativeNewTitle:`atticus initiative new "<title>" --journey new-feature`,initiatives:`Initiatives`,criticalPath:`Critical path`,planItems:`Plan items`,forecast:e=>` · forecast ${e}`,target2:(e,t)=>`Target ${e}${t}`,timeline:`Timeline`,noCommitmentsYet:`No commitments yet.`,commitments:`Commitments`,whoOwesWhat:`Who owes what`},know:{verifiedFromCode:`verified from code`,fromDocumentsOnly:`from documents only`,coverageBySystemAnd2:`Coverage by system and area`,component:`Component`,record:`Record`,kind:`Kind`,why:`Why`,owner:`Owner`,confirmedByPeople:`Confirmed by people`,foundInCodeOnly:`Found in code only`,unknown2:`Unknown`,code:`Code`,pattern:`Pattern`,interaction:`Interaction`,route:`Route`,target:`Target`,term:`Term`,definition:`Definition`,file:`File`,readAs:`Read as`,about:`About`,facts:`Facts`,status:`Status`,sync:`Sync`,scan2:`Scan`,repo:`Repo`,platform:`Platform`,type:`Type`,baseClone:`Base clone`,guideTo:e=>`Guide to ${e}`,guide:e=>`Guide · ${e}`,generatedFromTheCatalog:`Generated from the catalog`,theCatalogIsEmpty:`The catalog is empty. Read a repo first: atticus map <repo>, then atticus verify <repo> --write.`,around:e=>`Around ${e}`,ecosystemMap:`Ecosystem map`,showAll:`Show all`,clickANodeTo:`Click a node to centre it`,gaps:e=>` · ${e} gaps`,verified:(e,t,n)=>`${e}/${t} verified${n}`,factsVerifiedFromCode:e=>`${e}: facts verified from code`,noSystemsYet:`No systems yet.`,systems:`Systems`,coverageBySystemAnd:`Coverage by system and area`,notExpected:`not expected`,notExpected2:(e,t)=>`${e} · ${t}: not expected`,whatTheCatalogKnows:`What the catalog knows`,factsByRepo:{intro:`No System record says more yet, so this is what each repo's verified facts say. Map › Trust says how far to trust them.`,caption:`Facts by repo`,repo:`Repo`,entries:`Entries`,tables:`Tables`,calls:`Calls`,flows:`Flows`,none:`No repo has facts yet: read one with atticus map <repo>, then atticus verify <repo> --write.`,cantRead:e=>`${e}'s facts couldn't be read.`},ask:e=>` · ask ${e}`,ownerUnknown:` · owner unknown`,questionsForOwners:`Questions for owners`,noOpenQuestionsEvery:`No open questions: every gap has an answer.`,recordId:`Record id`,aComponentInterfaceTable:`A component, interface, table, column or topic id, e.g. ledger-db.account`,showImpact:`Show impact`,incidentModeOn:`Incident mode on`,incidentMode:`Incident mode`,findAnIdIn:`Find an id in the Knowledge explorer`,whatBreaksIfThis:`What breaks if this changes`,noOwnerRecordedFor:e=>`No owner recorded for ${e}.`,fromTheLastScan:`From the catalog. Atticus never connects to live systems, consoles or monitoring.`,ownersToCall:`Owners to call`,noAlertsDashboardsOr:`No alerts, dashboards or runbooks in the catalog for what it reaches.`,whatWatchesIt:`What watches it`,noChangeTouchesWhat:`No change touches what it reaches.`,recentNearbyChanges:`Recent nearby changes`,nothingDependsOnIt:`Nothing depends on it.`,blastRadiusOf:e=>`Blast radius of ${e}`,recordsAffectedBy:e=>`Records affected by ${e}`,hop:(e,t)=>`${e} hop${t}`,recordsHopsAway:(e,t)=>`${e} records ${t} hops away`,blastRadius:`Blast radius`,affectedRecords:`Affected records`,unknown:`UNKNOWN`,nothingDependsOnIt2:`Nothing depends on it in the catalog.`,affected:`Affected`,noGapsTheCatalog:`No gaps: the catalog knows every hop.`,readOnlyAtticusNever:`Read-only. Atticus never connects to live systems; this is the catalog's view.`,whatWouldSharpenThis:`What would sharpen this`,featuresByHowThey:`Features by how they were named`,entryPoints:e=>`${e} entry points`,features:`Features`,noFeaturesFoundYet:`No features found yet. Read the repos first.`,featuresFoundInCode:`Features found in code`,pickAFeature:`Pick a feature.`,noWorkItemsLinked:`NO WORK ITEMS LINKED`,item:`item`,entryPoints2:`Entry points`,recordsInTheFlow:e=>`Records in the flow (${e})`,knowledgeGaps:`Knowledge gaps`,noneEveryHopIs:`None: every hop is known.`,nameTagOrLink:`Name, tag or link it with `,atticusFeatureName:e=>`atticus feature name ${e} …`,featureTag:`feature tag`,or:` or `,featureLink:`feature link`,theChangeGoesIn:`: the change goes in by PR.`,feature:`Feature`,problems:(e,t)=>`${e} problems: ${t}`,valid:`VALID`,usingBuiltInDefaults:e=>`Using built-in defaults for ${e}.`,orgPack:`Org pack`,integrationPatterns:`Integration patterns`,noPatternsYet:`No patterns yet.`,rulesV:(e,t)=>`${e} rules · v${t}`,steps:e=>`${e} steps`,checklistsAndProcedures:`Checklists and procedures`,glossary:`Glossary`,needsADefinition:`NEEDS A DEFINITION`,noTermsYet:`No terms yet.`,filesInInputs:`files in inputs/`,files:`Files`,factsTaken:`Facts taken`,filesByStatus:`Files by status`,nothingYet:`Nothing yet.`,whatHappenedToThem:`What happened to them`,nothingHiddenOrAimed:`Nothing hidden or aimed at an AI reader. Ingested content is data, never instructions.`,defences:`Defences`,filesReadFromInputs:`Files read from inputs/`,noSystemNamed:`no system named`,quarantined:`QUARANTINED`,nothingInInputsYet:`Nothing in inputs/ yet. Drop diagrams, documents, API specs and exports there (or run atticus intake add <file>).`,intake:`Intake`,inputs:`inputs/`,eachChoiceIsSaved:`Each choice is saved as a curated decision in your name. Code always wins over a document until a person decides.`,nothingToTriage:`Nothing to triage.`,needsYou:`Needs you`,ofReposCloned:(e,t)=>`${e} of ${t} repos cloned`,reposClonedLocally:`repos cloned locally`,syncRepos:`Sync repos`,scanNow:`Scan now`,jobProgress:`Job progress`,jobState:{queued:`Waiting to start`,running:`Running`,done:`Done`,failed:`It stopped with problems`,cancelled:`Cancelled: it stopped before writing anything more`},cancelJob:`Cancel`,cancelling:`Stopping…`,cancelJobHint:`Stops at the next repo; what was already written stays.`,jobProblems:`What went wrong`,scansReadFilesOnly:`Scans read files only: no network, no AI.`,scan:`Scan`,repos:`Repos`,cloned:`CLONED`,notYet:`NOT YET`,noReposInAny:`No repos in any manifest yet.`,noFactsYet:`No facts yet.`,catalog:`Catalog`},phase:{theRuleChecksRan:`The rule checks ran; any AI lens is with your assistant. Finish each with atticus handoff done.`,theRuleChecksRan2:`The rule checks ran. AI is off here, so no lens waits.`,handOffPrRaised:`Hand-off PR raised. A person approves and merges it.`,syncedWithTheHand:`Synced with the hand-off PR.`,sourceField:`Source field`,targetField:`Target field`,rule:`Rule`,whenMissingOrInvalid:`When missing or invalid`,transform:`Transform`,record:`Record`,theStoryWritersPrompt:`The story writer's prompt is ready for your assistant.`,requirement:`Requirement`,story2:`Story`,test:`Test`,code:`Code`,gap:`Gap`,what:`What`,handOff:(e,t)=>` · hand-off ${e} ${t}`,approvalMerge:`Approval: merge `,pr:e=>`PR #${e}`,onTheGitHost:` on the Git host; that approves the gate.`,approvalRaiseTheHand:`Approval: raise the hand-off; merging its PR approves the gate.`,runTheCritic:`Run the critic`,runTheRuleChecks:`Run the rule checks`,raiseHandOff:`Raise hand-off`,syncAndMergeWhen:`Sync and merge when approved`,gate:`Gate`,notWrittenYetFor:`Not written yet for this change. It is drafted when the change reaches this phase, or by its agent.`,noSuchArtifact:e=>`This change has no ${e}. Atticus 2 writes a change's brief, design, stories and tasks in its stages instead: see Feature design, Architecture and Stories.`,text:e=>`${e} text`,edit:`Edit`,for:e=>` for ${e}`,question:(e,t)=>`Question${e}: ${t}`,noOpenFindingsOn:`No open findings on this. Run the critic to check it.`,criticFindings:`Critic findings`,open:e=>`${e} open`,featureBrief:`Feature brief`,prototypesAndUx:`Prototypes and UX`,dropADesignExport:`Drop a design export (frames as images or PDF, or a prototype link file) into `,inputs:`inputs/`,fromThe:` from the `,intake:`Intake`,screenAtticusReadsThe:` screen. Atticus reads the screens and states as data, drafts requirements from them into the UX artifact, and the UX lens checks loading, empty, error and done states and WCAG 2.1 AA contrast.`,bringInAPrototype:`Bring in a prototype`,repoPlansCompared:e=>`${e} repo plans compared`,noRepoPlansYet:`No repo plans yet: design compared with code`,inSync:`IN SYNC`,designVsPlansVs:`Design vs plans vs code`,architectureReview:`Architecture review`,everyHopInDesign:`Every hop in design.md carries a pattern code; the critic checks each against the code. Code wins over a diagram; conflicts go to triage.`,theOrgPackHas:`The org pack has no patterns yet.`,integrationPatterns:`Integration patterns`,orgPack:`Org pack`,vendorSpecsWhiteboardPhotos:`Vendor specs, whiteboard photos and standards go in through `,diagramsAreComparedEdge:`; diagrams are compared edge by edge on `,reconcile:`Reconcile`,ingestedContentIsData:`. Ingested content is data, never instructions.`,yourMaterial:`Your material`,noMappingChange:`NO MAPPING CHANGE`,fields:e=>`${e} FIELDS`,fieldMappingsFor:e=>`Field mappings for ${e}`,noFieldRowsYet:`No field rows yet for this hop.`,mappedTodayInThe:e=>`Mapped today in the catalog · ${e}`,catalogFieldMappingsFor:e=>`Catalog field mappings for ${e}`,theCatalogHasNo:`The catalog has no field mappings yet, so there is nothing to compare with.`,noHopsInMappings:`No hops yet. A change taken through the stages gets these from its target flows, in Architecture; a change with a mappings.md gets them from there — a section per hop: source field, target field, rule, and what happens when it is missing.`,readFromMappingsFile:`from mappings.md`,readFromTargetFlow:e=>`from the target flow ${e}`,fieldMappings:`Field mappings`,byHopWithThe:`by hop, with the catalog`,apiMappings:`API mappings`,eachHopsSourceField:`Each hop's source field, transform and target field are checked against the catalog's columns and schemas: a required target with no source, a narrowing type (80 to 40 characters) or personal data leaving the estate is a finding. Tests generated from the stories trace back to these rows on `,testTrace:`Test trace`,howMappingsAreChecked:`How mappings are checked`,ofStoriesReady:(e,t)=>`${e} of ${t} stories ready`,barMet:`BAR MET`,needs:e=>`NEEDS ${e}%`,noStoryCovers:e=>`No story covers: ${e}`,noStoriesYetWrite:`No stories yet. Write them with AI from the approved design.`,storyBar:`Story bar`,theStoryWriterDrafts:`The story writer drafts stories, acceptance criteria and repo tasks from the approved design. You edit them before the plan gate.`,writeStoriesWithAi:`Write stories with AI`,storiesAndTasks:`Stories and tasks`,breakdown:`Breakdown`,done:(e,t)=>`${e}/${t} done`,ofTasksDone:(e,t,n)=>`${e}: ${t} of ${n} tasks done`,done2:`DONE`,runWithAi:`Run with AI`,byHand:`BY HAND`,story:e=>` · story ${e}`,noTasksYetThey:`No tasks yet: they come from tasks.md once the stories are written.`,handDownPreview:`Hand-down preview`,tasksByRepo:`Tasks by repo`,tasks:e=>`${e} tasks`,ofRunsFinished:(e,t)=>`${e} of ${t} runs finished`,everyWriteIsApproved:`Every write is approved by a person; AI never pushes to protected branches.`,noRunsYet:`No runs yet.`,aiTaskRuns:`AI task runs`,taskBoard:`Task board`,tasksInCrossRepo:`Tasks in cross-repo order. Run a ready task with AI: Atticus hands the Spec Kit feature down to the repo, prepares the prompt for your assistant and reads the result back at the PR.`,everyRequirementShouldReach:`Every requirement should reach a story, a test, code and a release. Gaps are flagged before QA sign-off.`,requirementToCode:`Requirement to code`,noRequirement:`NO REQUIREMENT`,noStory:`NO STORY`,noTest:`NO TEST`,nothingToTraceYet:`Nothing to trace yet: the change has no requirements with scenarios.`,traceGaps:`Trace gaps`,noGapsEveryRequirement:`No gaps: every requirement reaches a story and a test.`,gapsBeforeQaSign:`Gaps before QA sign-off`,ofRowsHaveA:(e,t)=>`${e} of ${t} rows have a test`,ofTracedToA:(e,t)=>`${e} of ${t} traced to a test`,gapsByKind:`Gaps by kind`,scenarioCoverage:`Scenario coverage`,theTestStrategyAsks:`The test strategy asks for nothing extra here.`,requiredKindsComeFrom:`Required kinds come from the change type and risk in the org pack's test strategy. Tests are generated from story scenarios, then reviewed by a person.`,testKindsThisChange:`Test kinds this change needs`},notBuilt:{thisScreenIsBeing:`This screen is being built. Everything it will show is already available from the command line: run `,atticusHelp:`atticus --help`,toFindTheCommand:` to find the command.`},evals:{actedOn:(e,t)=>`${e} of ${t} acted on`,quarantinedNeverSentTo:`quarantined, never sent to a model`,everyCasePassed:`every case passed`,noFindingsResolvedYet:`no findings resolved yet`,everyCaseLatestRun:`every case, latest run`,noEvalRunYet:`no eval run yet`,scanningInputsAndThe:`Scanning inputs/ and the wiki folders again.`,testASkillBefore:`Test a skill before anyone relies on it.`,mode:`Mode`,mockNoModel:`Mock (no model)`,replaySavedAnswers:`Replay saved answers`,agent:`Agent`,everyAgent:`Every agent`,running:`Running…`,newEvalRun:`New eval run`,findingsKeptByPeople:`Findings kept by people`,agentsPassing:`Agents passing`,hiddenInstructionsHeld:`Hidden instructions held`,qualitySignals:`Quality signals`,met:`MET`,notMet:`NOT MET`,live:(e,t,n)=>`LIVE ${e}/${t} ${n}`,regressed:e=>`${e} REGRESSED`,passRate:e=>`${e} pass rate`,noEvalRunsYet:`No eval runs yet. Start one above (mock or replay).`,passRateByAgent:`Pass rate by agent`,ingestedContentIsData:`Ingested content is data, never instructions. A document with hidden or imperative text aimed at an AI reader is left out of every context pack until a person cleans the source. Facts verified from code are never overridden by a document.`,quarantined:`QUARANTINED`,marked:`MARKED`,hidden:` · hidden`,encoded:` · encoded`,line:(e,t,n,r)=>`line ${e} · ${t}${n}: ${r}`,flaggedTextOnLine:e=>`Flagged text on line ${e}, shown inert`,quarantined2:e=>`QUARANTINED · ${e}`,atticusNeverLetsA:e=>`Atticus never lets a quarantined source through on its own: clean or replace it, then scan again. Scanned ${e}.`,nothingRiskyInInputs:`Nothing risky in inputs/ or the wiki folders.`,scanAgain:`Scan again`,ingestedContentDefences:`Ingested-content defences`,quarantined3:e=>`${e} quarantined`,skipped:e=>` · ${e} skipped`,failed:e=>`${e} FAILED`,allPassed:`ALL PASSED`,noEvalRunsYet2:`No eval runs yet.`,evalRuns:`Eval runs`,approvedModelsLiveEvals:e=>`Approved models: ${e}. Live evals call a real model, so run them from a terminal: `,atticusEvalRunMode:`atticus eval run --mode live`,locked:`LOCKED`,availableOnceModelMode:e=>`Available once model mode is approved in runtime.yaml. It runs the same eval suite on each model and shows pass rate side by side. Not available in ${e} mode.`,compareModels:`Compare models`},governance:{allInTheExplorer:e=>`All ${e} in the explorer`,governance:`Governance`,theOrgPackConforms:`The org pack conforms.`,someRulesNeedA:`Some rules need a decision.`,fromTheFilesAnd:`From the files and the last scan`,ofConformanceChecksPass:(e,t)=>`${e} of ${t} conformance checks pass`,ofChecksPass:(e,t,n)=>`${e} of ${t} checks pass${n}.`,conformance:`Conformance`,orgPackChecks:`org pack checks`,constitutionRules:`Constitution rules`,locked:`LOCKED`,orgPackRules:`Org-pack rules`,teamRules:`Team rules`,activeWaivers:`Active waivers`,constitutionRulesCantBe:(e,t)=>`Constitution rules can't be waived or loosened. ${e} rules are in force; ${t} of them can be waived, each with a reason.`,refused:(e,t,n)=>`Refused ${e}${t}: ${n}`,rulesAndWaivers:`Rules and waivers`,rule:`Rule`,findings:`Findings`,dismissed:`Dismissed`,waived:`Waived`,overridden:`Overridden`,overridden2:e=>`${e} overridden`,acrossARuleDismissed:e=>`Across ${e}. A rule dismissed again and again is a candidate for a checklist change, reviewed in a PR.`,noCriticFindingsYet:`No critic findings yet, so nothing to measure.`,howOftenRulesAre:`How often rules are overridden`,by:(e,t)=>` · by ${e} ${t}`,reason:e=>`Reason: ${e}`,noActiveWaivers:`No active waivers.`,waivers:`Waivers`,sensitiveData:`Sensitive data`,columnsTaggedWithA:`Columns tagged with a data classification, and so where tagged fields live.`,noColumnsAreTagged:`No columns are tagged yet. Tag sensitive fields as curated decisions so their flows show here.`,authenticationGaps:`Authentication gaps`,callsWithNoOauth2:`Calls with no OAuth2, mTLS or API key declared in code or config.`,everyCallDeclaresHow:`Every call declares how it authenticates.`,timeoutsAndRetries:`Timeouts and retries`,timeoutAndRetrySettings:`Timeout and retry settings, to compare a caller's patience with what it calls.`,noTimeoutOrRetry:`No timeout or retry settings were found in code or config.`,retiring:`Retiring`,recordsPlannedForRetirement:`Records planned for retirement; check who still depends on them.`,nothingIsPlannedFor:`Nothing is planned for retirement.`,readOnlyBlastRadius:`Read-only blast radius from the catalog. Atticus never connects to live systems, consoles or monitoring. `,openTheImpactExplorer:`Open the impact explorer`,incidentMode:`Incident mode`},learning:{inProgress:`IN PROGRESS`,everyone:`Everyone`,youHaveFinishedThis:`You have finished this lesson.`,stepOf:(e,t)=>`Step ${e} of ${t}`,tryInTheSandbox:`Try in the sandbox`,copy:e=>`Copy ${e}`,checkMyWork:`Check my work`,hideTheHint:`Hide the hint`,showAHint:`Show a hint`,hint:e=>`Hint: ${e}`,lessonsRunOnlyIn:`Lessons run only in a practice sandbox: a throwaway copy of the invented Forge estate. No network, no real systems, no real data. This metarepo isn't one, so lessons are read-only here.`,aNewEmptyFolder:`A new, empty folder for the sandbox`,homeYouAtticusSandbox:`/home/you/atticus-sandbox`,makeASandbox:`Make a sandbox`,learning:`Learning`,practiceSandboxOfflineForge:`PRACTICE SANDBOX · OFFLINE FORGE`,notASandbox:`NOT A SANDBOX`,lessonsBuiltOnThe:`Lessons built on the Forge estate, with a sandbox to practise in. Nothing here touches a real system.`,ofLessonsDone:(e,t)=>`${e} of ${t} lessons done`,ofDone:(e,t)=>`${e} of ${t} done.`,progress:`Progress`,lessonsDone:e=>`${e} lessons done`,noLessonsAreInstalled:`No lessons are installed.`,progressByKindOf:`Progress by kind of work`,lessonsDone2:`lessons done`,practiseInASandbox:`Practise in a sandbox`,exercise:e=>`Exercise · ${e}`,done:`done`,writtenFor:`Written for`,min:(e,t,n)=>`${e} · ${t} min · ${n}`,continue:`Continue`,done2:`Done`,start:`Start`,lessonsRunInA:`Lessons run in a practice sandbox`,noLessonsWrittenFor:`No lessons written for this kind of work.`,lessonsAndExercisesUse:`Lessons and exercises use only the invented Forge ecosystem. A check passes from what the sandbox's files say, never from a model.`,lessons:`Lessons`},release:{atGoNoGo:`AT GO / NO-GO`,postReleaseReview:`POST-RELEASE REVIEW`,noneNeeded:`NONE NEEDED`,knowledgeGap:`knowledge gap`,approvedNotMerged:`APPROVED, NOT MERGED`,notRaised:`NOT RAISED`,goNoGoPr2:`Go / no-go PR opened. Reviewers decide on the Git host; merging it is the go.`,syncedWithTheGit:`Synced with the Git host.`,archivedItsReposWere:`Archived. Its repos were rescanned.`,changes:`Changes`,noChangesInFlight:`No changes in flight.`,next:`Next`,type:e=>`TYPE ${e}`,risk:e=>`RISK ${e}`,requests:`Requests`,snowMdListsNo:`snow.md lists no service-desk request.`,ofFiled:(e,t)=>`${e} of ${t} filed.`,findings:`Findings`,blocking:(e,t)=>`${e} blocking, ${t}.`,goNoGoPr:`Go / no-go PR`,approvedBy:e=>`; approved by ${e}`,mergingIsTheGo:(e,t)=>`Merging ${e} is the go${t}.`,goNoGoIs:`Go / no-go is the release hand-off PR: merging it is the go.`,archiveGate:`Archive gate`,opensOnceReleasedMerged:`Opens once released, merged, built and the catalog matches.`,gatesToGoLive:`Gates to go-live`,aPersonApprovesEvery:`A person approves every gate by merging its hand-off PR; the Git host decides who may approve, and the person who raised a PR can't be its only approver.`,askForGoNo:`Ask for go / no-go`,theChangeReachesGo:`The change reaches go / no-go after QA`,syncAndMergeWhen:`Sync and merge when approved`,readsThePrMerges:`Reads the PR; merges it as you once it is approved and the Git host's checks pass`,archive:`Archive`,archivesTheChangeAnd:`Archives the change and rescans its repos`,nothingStopsThisChange:`Nothing stops this change right now.`,whatStopsIt:`What stops it`,theChangeMayBe:`The change may be archived.`,alsoTouchesAgreeAn:e=>`Also touches ${e}. Agree an order before release.`,overlap:`OVERLAP`,noOtherOpenChange:`No other open change touches the same things.`,conflictsWithOtherChanges:`Conflicts with other changes`,forTheApprovalBoard:`For the approval board or an audit: one Markdown document generated from the change folder (summary, every file with its sha-256, critic rounds and waivers, approvals, trace, requests and steps, drift and AI runs), each item with its source.`,kb:e=>`${e} KB`,evidenceFiles:`Evidence files`,theChangeFolderIs:`The change folder is empty.`,evidencePack:`Evidence pack`,pickAChangeOn:`Pick a change on the left. Changes reach go / no-go after QA.`,noChangeSelected:`No change selected`},releaseViews:{gatewayRoute:`GATEWAY ROUTE`,rollout:`Rollout`,rollback2:`Rollback`,readiness:`Readiness`,verification:`Verification`,hypercare:`Hypercare`,onTrack:`ON TRACK`,atRisk:`AT RISK`,noTarget:`NO TARGET`,waitingForAPerson:`waiting for a person to file it`,notFiled:`not filed`,workingDay:`working day`,noLeadTimeTo:`, no lead time to forecast`,business:`Business`,technical:`Technical`,recorded:`Recorded.`,workedOutFromInterfaces:`Worked out from interfaces.md, data.md, stories.md and the catalog: a route before its caller, a topic before its publisher, a migration before the code that reads it, a callee before its caller.`,n0BeforeAnything:`0 · Before anything`,from:e=>` · from ${e}`,waitsOn:e=>`Waits on ${e}`,rollback:`Rollback`,deployOrder:`Deploy order`,beforeStep:e=>`, before step ${e}`,notPlaced:`Not placed`,criticReleaseLensStill:`Critic, release lens: still open`,nothingToDeployYet:`Nothing to deploy yet: interfaces.md, data.md, tasks.md and stories.md name no repo.`,deploymentPlan:`Deployment plan`,computed:`computed`,noDate:`No date`,released:`Released.`,readyToReleaseBy:e=>`Ready to release by this day at the earliest (${e} from today).`,target:(e,t)=>`Target ${e} (${t}).`,noTargetDateThe:`No target date: the change isn't part of an initiative with one.`,whatSetsTheDay:`What sets the day`,waitOnAService:e=>`; ${e} wait on a service request`,tasksOfDone:(e,t,n)=>`Tasks: ${e} of ${t} done${n}.`,forecast:`Forecast`,fromDatesNoEstimates:`from dates, no estimates`,rolloutReadinessAndHypercare:`Rollout, readiness and hypercare`,fromDesignMd:`from design.md`,signsOff:`Signs off`,copyTheSecurityReview:`Copy the security review draft`,interfacesMdListsNo:`interfaces.md lists no new or changed interfaces.`,newOrChangedInterfaces:`New or changed interfaces and their auth`,operation:`Operation`,callerCallee:`Caller → callee`,auth:`Auth`,crosses:`Crosses`,saidNowhere:`said nowhere`,no:`no`,dataFieldsTouched:`Data fields touched`,dataMdAddsNo:`data.md adds no fields.`,looksLikePersonalData:` (judged personal data)`,dataCrossingABoundary:`Data crossing a boundary`,noNewOrChanged:`No new or changed call crosses a system boundary.`,mappingsMdDoesntSay:`mappings.md doesn't say which fields it sends.`,vendorsSecretsAndFindings:`Vendors, secrets and findings`,aNewVendor:`a new vendor`,alreadyCalled:e=>`already called (${e})`,noVendorSecretOr:`No vendor, secret or open security finding.`,gapsForTheReviewer:`Gaps for the reviewer`,securityReviewDraft:`Security review draft`,fromTheCatalogAnd:`from the catalog and the change`,audience:`Audience`,copyTheReleaseNotes:`Copy the release notes`,releaseNotes:`Release notes`,generatedNoAi:`from the change folder; what breaks callers is judged`,measuredByOn:(e,t,n,r)=>`${e}, measured by ${t} on ${n}${r}`,notMeasuredYet:`Not measured yet.`,measured:`MEASURED`,open:`OPEN`,recordedButBriefMd:e=>`${e}: recorded, but brief.md no longer has this measure.`,measure:`Measure`,chooseAMeasure:`Choose a measure`,whatYouMeasured:`What you measured`,howOptional:`How (optional)`,as:e=>` as ${e}`,record:e=>`Record${e}`,recordAnOutcome:`Record an outcome`,briefMdHasNo:`brief.md has no "Success measures" section, so there is nothing to measure after release.`,outcomes:`Outcomes`,theBriefsSuccessMeasures:`the brief's success measures`,exportEvidencePack:`Export evidence pack`,evidenceMd:e=>`evidence-${e}.md`,copyEvidenceMd:e=>`Copy evidence-${e}.md`},serviceDesk:{toFile2:`TO FILE`,waitingForYou:`WAITING FOR YOU`,drafted:`Drafted.`,filedAsAStep:`Filed as a step.`,toFile3:`To file`,waitingForYou2:`Waiting for you`,filed:`Filed`,pastRequest:`past request`,requestTemplate:`request template`,draftTheRequestsA:`Draft the requests a change needs`,replaceASnowMd:`Replace a snow.md a person edited`,draftFromTheOrg:`Draft from the org pack's templates`,noChangesToDraft:`No changes to draft requests for.`,template:e=>`TEMPLATE ${e}`,noTemplateMatches:`NO TEMPLATE MATCHES`,leadTimeDays:e=>`Lead time ${e} days. `,noneNamed:`none named`,approversValuesComeFrom:(e,t)=>`${e}Approvers: ${t}. Values come from snow.md; edit them there.`,fields:`Fields`,copyAllFields:`Copy all fields`,required:` · required`,missingFillItIn:`Missing: fill it in snow.md`,empty:`Empty`,copy:e=>`Copy ${e}`,atticusNeverCallsThe:`Atticus never calls the desk from here. Filing makes a step in To-do with every field ready to copy; you submit it in the desk and record the number.`,fileSCompleteDrafts:e=>`File ${e}'s complete drafts as steps`,fillFirst:e=>`Fill ${e} first`,fillInSnowMd:e=>`Fill ${e} in snow.md before filing.`,filedAsStep:`Filed as step `,submitItInThe:`. Submit it in the desk, then `,recordTheRequestNumber:`record the request number in To-do`,filedAs:e=>`Filed as ${e}`,open:`open`,serviceDeskQueue:`Service desk queue`,toFile:e=>`${e} to file.`,nothingToFile:`Nothing to file.`,show:`Show`,draftsOnlyYouFile:`Drafts only: you file them. Next: the `,releasePlan:`release plan`,requests:`Requests`,noDraftsYet:`No drafts yet.`,queue:`Queue`,writesFromTheApp:`Writes from the app become steps you perform. Reads come from an export you load into inputs/.`,from:(e,t)=>`${e} from ${t}.`,noDeskExportLoaded:`No desk export loaded yet.`,inTheOrgPack:(e,t)=>`${e} ${t} in the org pack.`,serviceDeskAdapter:`Service desk adapter`,approveEachWrite:e=>`${e} · APPROVE EACH WRITE`,noneAllowedHere:`NONE ALLOWED HERE`,calledThroughTheCommon:`Called through the common step spec from `,toDo:`To-do`,noCredentialsPassTo:`. No credentials pass to the tool. `,executorsAllowList:`Executors allow-list`,localAutomationTool:`Local automation tool`,toFill:e=>` · ${e} to fill`,noneInThisView:`None in this view.`,noServiceDeskDrafts:`No service-desk drafts. Draft them for a change below.`,pickARequestOn:`Pick a request on the left.`,noRequestSelected:`No request selected`,draftRequests:`Draft requests`},systems:{title:`Systems`,pick:`Which system`,empty:`No system in the catalog yet: read the repos first.`,openPage:`Open its page`,inFlight:`Changes in flight in its repos`,noChanges:`No change in flight touches its repos.`,questions:`Open questions about it`,noQuestions:`No open question about it.`,outside:`The systems outside the estate: vendors and other teams`},mismatches:{title:`Mismatches`,intro:`The payload on both sides of every link compared: each REST call, each hop through a gateway, each topic's publisher and listeners, and each call to an outside system, from the fields your assistant read and the specs on file. A difference that a mapping nobody traced touches is unconfirmed, never a mismatch. Read from the facts and the specs; nothing is written.`,empty:`No link has a payload on both sides yet. Your assistant records what each call sends and each entry takes when it reads a repo (/atticus-map); atticus verify <repo> --write reads the repo's specs; atticus intake add takes a vendor's or another team's.`,counts:(e,t,n,r)=>`${e} mismatch${e===1?``:`es`}, ${t} unconfirmed; ${r} of ${n} link${n===1?``:`s`} had a payload on both sides.`,filter:`Show`,filters:{all:`Everything`,mismatch:`Mismatches`,unconfirmed:`Unconfirmed`},link:(e,t,n,r)=>`${e} ${t} → ${n}${r?` via ${r}`:``}`,cols:{kind:`What`,says:`Says`,sender:`One side`,receiver:`The other`},kinds:{"field-missing":`Read, never sent`,"field-extra":`Sent, not taken`,"field-not-sent":`Required, not sent`,"field-required":`Required on one side only`,"field-type":`Types differ`,"field-number":`Field number reused`,"error-unlisted":`Error not listed`,"error-unanswered":`Error never answered`},status:{mismatch:`Mismatch`,unconfirmed:`Unconfirmed`},via:e=>`Through ${e}`,specs:e=>`Specs read: ${e}`,notes:`Left out`,command:`atticus join contracts`,commandLabel:`Copy the command that prints this list`},outside:{title:`Outside systems`,contracts:`The calls against this spec`,contractsIntro:`Each call to this system compared with the operation or message its newest spec publishes. Marked new: what this spec brings that the one it replaced didn't.`,noContracts:`No call to it differs from its spec, or none says what it sends.`,newWithSpec:`New with this spec`,intro:`The systems no repo of the estate belongs to: vendors, and other teams' systems. For each, who calls it, the operations its spec publishes, the calls that match nothing in that spec, and the questions open about it. Read from the facts, the catalog and the specs in inputs/; nothing is written.`,pick:`Which outside system`,empty:`No outside system yet: the profiles name none that the estate's repos don't belong to. Add a vendor or another team's system to a profile's systems in the org pack.`,boundary:{vendor:`A vendor`,internal:`Another team's system`,product:`A product no estate repo belongs to`},owner:e=>`Owner: ${e}`,aliases:e=>`Also called ${e}`,callers:`Who calls it`,noCallers:`No call in the estate's facts reaches it yet. A call reaches it when it names it, uses one of its hosts, or a person's answer says so.`,callerCols:{from:`From`,call:`Call`,line:`Line`,operation:`Operation`,seen:`Seen in`},through:(e,t)=>`through ${e} ${t}`,seen:{interface:`the catalog`,join:`the estate join`,spec:`its spec`,shared:`their shared map`},noOperation:`—`,operations:`Its operations`,specFrom:(e,t,n)=>`From ${e}${t?`, ${t}`:``}${n?` ${n}`:``}`,opCols:{op:`Operation`,line:`Spec line`,calls:`Calls`},unmatched:`Calls that match nothing in its spec`,noUnmatched:`Every call to it matches an operation its spec publishes.`,ambiguous:`Calls two or more operations answer`,ambiguousOf:e=>`Could be ${e}`,noSpec:`No spec of it is in inputs/ yet, so its operations aren't known. Add one:`,noSpecWhy:`Then intake links it to this system by name (atticus triage asks when it can't tell), and this page lists its operations and the calls that match none.`,questions:`Open questions about it`,noQuestions:`No open question about it.`,answer:`Answer it`,copy:e=>`Copy: ${e}`,notes:`What the estate's facts left out`,shared:`Their shared map`,sharedFrom:(e,t,n)=>`${e}'s Atticus map, their commit ${t.slice(0,7)}, imported ${n.slice(0,10)}. Their entries stay theirs: Atticus never verifies, corrects or reports on them; a wrong one is theirs to fix in their own map.`,sharedCols:{entry:`Their entry`,repo:`Their repo`,line:`Their line`,calls:`Calls`},sharedUnmatched:`Calls their map has no entry for`,noSharedUnmatched:`Every call to it is answered by an entry of their map.`,noShared:`If the team that owns it runs Atticus, bring in their map, read-only, so calls to it join their entries:`,sharedImport:e=>`atticus join shared import <their metarepo> --team <their team id> --system ${e} --name "<their team's name>"`},cockpit:{title:`This change at a glance`,none:`No change yet: start one with atticus change new, and All changes lists it.`,where:`Where it is`,state:(e,t)=>`In ${e}, ${t} risk.`,stages:{feature:`Placement`,architecture:`Target flows`,stories:`Stories`},stageScreen:{feature:`feature-design`,architecture:`architecture`,stories:`stories`},marks:{done:`done`,current:`in progress`,todo:`to come`},stage:(e,t)=>`${e}: ${t}`,progress:(e,t,n)=>[`${e} draft${e===1?``:`s`}`,`${t} critic round${t===1?``:`s`}`,...n?[`${n} question${n===1?``:`s`} to answer`]:[]].join(`, `),next:`What's next`,copySlash:`Copy the slash command`,copyCommand:`Copy the command`,blocks:`What blocks it`,questions:e=>`${e} question${e===1?``:`s`} wait for a person`,repos:`Repos and branches`,noRepos:`No repo has a branch for this change yet: atticus workspace open makes them.`,branchOn:(e,t)=>`${e}, from ${t}`,pr:`the pull request`,watch:`Watch this change`,unwatch:`Stop watching`,watched:`You watch it: your digest says how it is doing.`,unwatched:`You no longer watch it.`,like:{title:`Earlier changes like this one`,intro:`Archived changes whose brief is nearest this one's. One you pick is attached to this change as an example its steps read, as data.`,byWords:e=>`By shared words, since ${e}.`,none:`No archived change is near this one yet.`,archived:e=>`archived ${e}`,use:`Use as an example`,used:`Attached to this change (Files attached): its steps read it as an example.`}},repos:{title:`Repos and their branches`,intro:`The catalog is read from each repo's default branch: that is the baseline, the one the hand-off PRs build on. Other branches people work on can be scanned beside it and compared with it, never merged into it.`,empty:`No repo is listed yet: run atticus repos discover <folder>, or add one to a repos.manifest.yaml.`,typeOwner:(e,t)=>`${e} · ${t}`,about:`What it is`,noAbout:`Nothing says yet`,aboutHint:`One line: what it is for, who uses it. It goes into every reading prompt, the questions a join asks and these views, so a repo whose id says nothing can still be read and placed. Up to 300 characters.`,aboutWhy:`A person's note, not read from the code: where the two disagree, the facts read from the code are what counts.`,aboutBy:e=>`said by ${e}`,aboutDraft:`Unconfirmed draft`,aboutDraftWhy:e=>`${e} drafted this from what it read. Until a person confirms it, it is marked unconfirmed everywhere it is used.`,aboutCites:`Read from`,editAbout:`Say what it is`,editAboutDraft:`Confirm, change or drop`,acceptAbout:`Confirm it`,rejectAbout:`Drop it`,aboutSaved:`Saved to the manifest: commit it in a pull request. Every reading prompt, question and view now says what this repo is.`,aboutDropped:`Dropped from the manifest: commit it in a pull request. Nothing says what this repo is now.`,aboutTooLong:e=>`One line, up to ${e} characters.`,aboutEmpty:`Say what it is, in one line, before saving.`,url:`URL`,defaultBranch:`Default branch`,atCommit:e=>`read at ${e}`,remoteSays:e=>`The remote's default is ${e}`,branches:`Other branches`,noBranches:`None listed`,branchesHint:`One a line, for example develop or release/2026.11. Each can be scanned beside the baseline.`,scanned:(e,t,n)=>`${e} scanned on ${t}, at ${n}`,scan:e=>`Scan ${e}`,scanStarted:e=>`Scanning ${e} beside the baseline: follow it on Scans.`,compare:(e,t)=>`Compare ${e} with ${t}`,comparedNow:`Compared.`,compared:(e,t,n,r)=>`${e} against the baseline: ${t} added, ${n} removed, ${r} changed.`,edit:`Edit branches`,save:`Save to the manifest`,saved:`Saved to the manifest: commit it in a pull request. Run atticus workspace sync if the default branch changed.`},aiSettings:{title:`How AI runs here`,intro:`Choose whether AI runs, which assistants your people use, and whether Atticus may call a model itself. Saving writes the org pack's runtime.yaml.`,aiLabel:`AI here`,ai:{on:`On: every AI step may run`,"text-only":`Text only: no step is given a picture`,off:`Off: no AI step runs; people write what agents would draft`},assistantsLabel:`Assistants your people use`,assistantsHint:`Atticus writes the slash commands, instructions and skills for each one ticked.`,defaultAssistant:`Default assistant`,modesLabel:`How a step runs`,modes:{"hand-off":`Hand-off: the person's own assistant does the step`,model:`Model: Atticus calls the provider below`,"headless-claude-code":`Headless Claude Code: Claude Code runs the step on this machine`},defaultMode:`Default`,providerLabel:`Model provider`,noProvider:`None: AI steps hand off to the person's assistant`,providerHint:`Used when a step runs in model mode. A key never goes here: name the environment variable that holds it in keyEnv. For a provider Atticus has no built-in for, add a plugin: atticus plugin add vertex, or your own in org-pack/plugins/model-providers/.`,pluginProvider:(e,t)=>t?`${e} (plugin)`:`${e} (plugin, not pinned yet: atticus plugin pin ${e})`,keySet:e=>`${e} is set on this machine.`,keyNotSet:e=>`${e} isn't set on this machine: set it to the key before testing.`,keyLabel:e=>`The key for ${e}`,setKey:`Set the key on this machine`,keyKept:e=>`Kept ${e} in this machine's credential store. It never goes in runtime.yaml.`,save:`Save`,saved:e=>`Saved ${e}. Commit it in a pull request: the org pack is reviewed like code.`,saveNote:e=>`Saving writes ${e}; commit it in a pull request.`,test:`Test the provider`,budgetsLabel:`Models and budgets`,modelsLabel:`Models allowed`,modelsHint:`One model id a line. Model mode refuses any other; empty allows any.`,defaultTokensLabel:`Tokens for a step`,perAgentLabel:`Tokens for an agent`,perAgentHint:`One a line, for example architect: 300000. Others get the tokens for a step.`,badDefaultTokens:`The tokens for a step must be a whole number above 0, such as 200000.`,badBudgetLine:e=>`"${e}" doesn't read as an agent and its tokens: write it as architect: 300000.`,answered:(e,t)=>`${e} answered in ${t} ms.`,notAnswered:e=>`It didn't answer: ${e}`},settings:{handOff:`Hand-off`,yourOwnAssistantCopilot:`Your own assistant (Copilot or Claude Code) does the work. Atticus builds the context pack, watches the branch, then checks the result.`,model:`Model`,directModelAccessThrough:`Direct model access through an approved gateway. Unlocks draft-and-PR runs and model comparisons.`,headlessClaudeCode:`Headless Claude Code`,claudeCodeRunsA:`Claude Code runs a task on its own in the change's worktree; a person still approves every write.`,workTracker:`Work tracker`,serviceDesk:`Service desk`,gitHost:`Git host`,wiki:`Wiki`,notifications:`Notifications`,designTool:`Design tool`,modelProvider:`Model provider`,liveFallsBackTo:`live; falls back to steps for a person when it can't be reached`,writesBecomeStepsIn:`writes become steps in To-do; reads come from exports`,inMemoryForTests:`in-memory, for tests and demos`,notSet:`NOT SET`,notConfigured:`not configured`,everyAiStepMay:`Every AI step may run, in the modes allowed below.`,textOnly:`TEXT ONLY`,noAiStepIs:`No AI step is given a picture; pictures go to a person in Intake.`,noAiStepRuns:`No AI step runs. People write what agents would draft, the rule checks review it, and no gate waits for an AI lens.`,saved:`Saved.`,assistants:`Assistants`,editors:`Editors`,models:`Models`,noneApproved:`none approved`,autonomy:`Autonomy`,contextBudget:`Context budget`,runRecords:`Run records`,buildEngine:`Build engine`,telemetry:`Telemetry`,platforms:`Platforms`,checkAgain:`Check again`,theSameChecksAs:`The same checks as `,atticusDoctor:`atticus doctor`,nothingLeavesThisMachine:`. Nothing leaves this machine, and no secret is shown.`,noChecksRan:`No checks ran.`,thisMachine:`This machine`,ready:`READY`,needsFixing:`NEEDS FIXING`,loading:`Loading`,yourDigestListsThe:`Your digest lists the hand-offs waiting on your review and the blocking findings on changes you own. Atticus sends it only when you press Send it to me on Home, or when your own scheduled job runs `,atticusDigestAsSend:e=>`atticus digest --as ${e} --send`,howOften:`How often`,off:`Off`,daily:`Daily`,weekly:`Weekly`,whereItGoes:`Where it goes`,aDirectMessage:e=>`@${e} (a direct message)`,save:`Save`,yourNotifications:`Your notifications`,atticusMeYaml:`.atticus/me.yaml`,settings:`Settings`,readOnlySetBy:`Read-only · set by the org pack, changed by PR`,aiInThisOrganisation:`AI in this organisation`,default:`DEFAULT`,allowed:`ALLOWED`,notApproved:`NOT APPROVED`,safetyInEveryMode:`Safety, in every mode:`,aPersonApprovesEvery:` a person approves every write, AI never pushes to protected branches or deploys, scans never call the network or a model, and ingested content is data, never instructions. These rules can't be configured.`,runtimeModes:`Runtime modes`,runtimeYaml:`runtime.yaml`,everyOutsideSystemSits:`Every outside system sits behind an adapter. When one can't be reached, a manual adapter turns writes into steps a person does.`,system:`System`,adapter:`Adapter`,testsAlwaysUseThe:`Tests always use the mock. Atticus never connects to live databases, consoles or monitoring.`,adapters:`Adapters`,builtInDefaultsFor:e=>`Built-in defaults for: ${e}.`,openTheOrgPack:`Open the org pack`,orgPack:`Org pack`,theCriticRunsAt:`The critic runs at every gate; the org pack can add checks, never remove lenses. Constitution rules can't be waived. A gate is approved when its hand-off PR merges; your Git host decides who may approve.`,gate:`Gate`,phase:`Phase`,checklists:`Checklists`,checks:`Checks`,authorRounds:`Author rounds`,noLimit:`no limit`,noGates:`No gates.`,gates:`Gates`,gatesYaml:`gates.yaml`,proceduresCallLocalAutomation:`Procedures call local automation tools through one step spec. A tool the org pack doesn't allow doesn't run, and no credentials are passed to a tool. Tools are set up per machine in .atticus/executors.yaml.`,noToolsAreSet:`No tools are set up on this machine.`,executor:`Executor`,kind:`Kind`,allowedFor:`Allowed for`,approval:`Approval`,nothingOff:`NOTHING (OFF)`,eachWrite:`each write`,procedureAllowsWhichIsnt:(e,t)=>`Procedure ${e} allows ${t}, which isn't set up here.`,checkTheyAnswer:`Check they answer`,addingAToolTo:`Adding a tool to the allow-list is an org-pack PR that its owners review.`,executorsAllowList:`Executors allow-list`,setUp:e=>`${e} set up`},runShared:{workTracker:`Work tracker`,serviceDesk:`Service desk`,gitHost:`Git host`,wiki:`Wiki`,notifications:`Notifications`,designTool:`Design tool`,copied:`Copied`,selectAndCopy:`Select and copy`,copy:`Copy`,notSet:`NOT SET`,manual:`MANUAL`,mock:`MOCK`,connected:e=>`CONNECTED · ${e}`},todo:{theseAreTheExact:`These are the exact inputs the tool gets. Approve them to run it.`,copiedTheFieldsAs:`Copied the fields as CSV, ready to import.`,allChanges:`All changes`,noChange2:`No change`,done2:`Done`,open2:`Open`,waitingOnOthers:`Waiting on others`,workItem:`work item`,choose:`Choose`,patDana:`pat, dana`,localTool:`LOCAL TOOL`,aToolOnThe:`A tool on the allow-list can do this step for you. You approve the exact inputs; it gets no credentials.`,tool:`Tool`,showTheInputs:`Show the inputs`,inputsTheToolGets:`Inputs the tool gets`,sha256:e=>`sha-256 ${e}…`,runWithIApprove:e=>`Run with ${e}, I approve these inputs`,manual:`MANUAL`,procedure:e=>`PROCEDURE ${e}`,whyThisIsManual:e=>`Why this is manual: ${e}. `,whereEveryValueComes:(e,t)=>`Where: ${e}. ${t}Every value comes from the change files. Nothing is sent until you do it.`,it:`it`,them:`them`,doFirstThisStep:(e,t)=>`Do ${e} first: this step depends on ${t}.`,fieldsToCopy:`Fields to copy`,copyAllFields:`Copy all fields`,copyAsCsv:`Copy as CSV`,empty:`Empty`,copy:e=>`Copy ${e}`,whenItsDoneRecord:`When it's done, record`,optional:` (optional)`,markDone:`Mark done`,reasonToSkip:`Reason to skip`,skipWithThisReason:`Skip with this reason`,done:`Done`,skipped:`Skipped`,byALocalTool:` (by a local tool)`,byOn:(e,t,n,r,i,a)=>`${e} by ${t} on ${n}${r}.${i}${a}`,toDoAndManual:`To-do and manual steps`,waitForAPerson:e=>`${e} wait for a person.`,nothingToDoEvery:`Nothing to do: every manual step is done.`,change:`Change`,stepsAPersonDoes:`Steps a person does in the work tracker, service desk or Git host when Atticus can't reach them.`,ofStepsDone:(e,t)=>`${e} of ${t} steps done`,steps:`Steps`,noManualStepsYet:`No manual steps yet.`,progress:`Progress`,open:e=>`${e} OPEN`,exportsInInputs:(e,t)=>`Exports in inputs/: ${e}, ${t}.`,noExportsInInputs:`No exports in inputs/ yet: drop a tracker or desk export there so Atticus can check results.`,whereStepsComeFrom:`Where steps come from`,allowListedToolsCan:`Allow-listed tools can do a step for you. A person approves each write and no credentials are passed. `,executorsAllowList:`Executors allow-list`,noToolsSetUp:`No tools set up on this machine (.atticus/executors.yaml).`,localAutomation:`Local automation`,noChange:`no change`,waits:`WAITS`,toDo:`TO DO`,openSteps:`Open steps`,noOpenSteps:`No open steps.`,pickAStepOn:`Pick a step on the left.`,step:`Step`,noStepSelected:`No step selected`,procedure2:`Procedure`,toolsAllowed:`Tools allowed`,writes:`Writes`,lastRun:`Last run`,noneOff:`none (off)`,notHere:` · not here`,setUpHere:`Set up here`,notSetUpOn:`Not set up on this machine`,neverRun:`never run`,theOrgPackHas:`The org pack has no procedures yet (process/procedures).`,eachRunShowsThe:`Each run shows the exact inputs first, waits for your approval, and logs what happened. Protected branches and deploys are never touched.`,proceduresALocalTool:`Procedures a local tool can run`,nothingDoneYet:`Nothing done yet.`,ownerNotKnown:`owner not known`,copyQuestionText:`Copy question text`,openChange:`Open change`,eachQuestionIsAsked:`Each question is asked once and the answer is reused at every gate. Asking happens outside Atticus: copy the text, then record the answer on the change.`,noOwnerQuestionsWaiting:`No owner questions waiting.`,ownerQuestionsWaiting:`Owner questions waiting`},dashboardExtra:{of:(e,t,n)=>`${e} of ${t} ${n}`},graph:{map:`Map`},viewer:{toolbar:`Picture controls`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,reset:`Actual size`,fit:`Fit to screen`,fitSelection:`Zoom to the picked box`,focus:`Focus on the picked box`,focusOff:`Show everything`,fullScreen:`Full screen`,leaveFullScreen:`Leave full screen`,zoomLevel:e=>`Zoom ${e}%`,search:`Find a box`,searchPlaceholder:`Find a repo, system or topic`,found:e=>`${e}: centred and picked.`,notFound:e=>`Nothing here is called ${e}.`,minimap:`Map of the whole picture`,keys:`Keys: + and − zoom, 0 fits, 1 is actual size, arrows pan, S zooms to the picked box, M focuses on it, F is full screen, / finds a box, Esc leaves full screen.`,region:e=>`${e}: picture`,fullScreenOn:`Full screen: Tab stays inside the picture. Press Esc to leave.`,focusOn:e=>`Focus on ${e} and what it links to; everything else is dimmed.`,details:`Details`,hideDetails:`Hide details`,showDetails:`Show details`},topics:{owner:e=>`Owner: ${e}`,ownerOutside:e=>`Owner: ${e} (outside the estate)`,ownerUnknown:`Owner not known`,noListener:`No listener in the estate`,noPublisher:`No publisher in the estate`,noListenerFix:`Read the repo that listens on it, or, if a system outside the estate does, name that system so its listener is known.`,noPublisherFix:`Read the repo that publishes to it, or, if a system outside the estate does, name that system so its publisher is known.`,listens:`listens`,declared:`Declared in the profile`,declaredMark:`declared`,declaredGap:`Only the profile says so: no repo of the estate shows the other side`,declaredFix:`A person named it in the profile, so it rests on their word. If a repo of the estate serves the other side, read that repo: the code's link takes its place.`},me:{aiIsOffHere:`AI is off here, so write it yourself: the critic's rule checks still review it.`},flowsScreen:{thisFlow:`this flow`},flowsModel:{whoCallsThisEntry:`Who calls this entry point isn't known yet.`,callerNotKnown:`Caller not known`,calledByFlows:(e,t)=>t?`${e} and ${t} more`:e,start:`Start`},runs:{title:`Model runs`,intro:`What Atticus asked a model and what came back, for every AI step, newest first. A prompt and an answer are shown as text, as they were written.`,listTitle:`Runs`,caption:`Model runs, newest first`,cols:{step:`Step or change`,agent:`Agent`,model:`Model`,round:`Round`,state:`State`,answered:`Answered`,handedBack:`Handed back`,when:`When`},classes:{read:`Read`,draft:`Draft`,critic:`Critic`,knowledge:`Knowledge`,quick:`Quick`},modelCell:(e,t)=>`${t??`Not recorded`}${e?` · ${e}`:``}`,modelNotRecorded:`Not recorded`,yes:`Yes`,notYet:`Not yet`,problems:e=>e===0?`Nothing`:e===1?`1 problem`:`${e} problems`,states:{prepared:`Prepared`,waiting:`Waiting for its answer`,produced:`Answered, not checked yet`,validated:`Passed the checks`,failed:`Failed`,cancelled:`Cancelled`},empty:`No model runs yet. A run is listed here once an AI step starts: run one from its page, or with its command or slash command.`,emptyFor:e=>`No model runs for ${e} yet.`,onlyFor:e=>`Only the runs of ${e}.`,showAll:`Show every run`,pick:`Open a run from the list to read what it was asked and what it answered.`,back:`Back to every run`,missing:e=>`There is no run ${e}. It may have been removed from .runs/.`,runTitle:(e,t)=>`${e}, round ${t}`,prompt:`Prompt`,answer:`Answer`,noAnswer:`No answer yet: the run is waiting for one.`,handedBack:`Handed back`,noneHandedBack:`Nothing was handed back: this is the step's first round.`,roundProblems:e=>`Round ${e}: the problems the checks found`,failedAnswer:e=>`The answer round ${e} gave`,noFailedAnswer:`The answer that failed them isn't in the prompt.`,tools:{title:`What the model looked up`,offered:(e,t)=>`Read-only tools offered: ${e||`none`}. The model called them ${t===1?`once`:`${t} times`}.`,stopped:e=>`A cap stopped the tool calls (${e}).`,call:(e,t,n,r)=>`Round ${e}: ${t}, ${n} tokens back${r?`, refused`:``}`,returned:e=>`What ${e} gave back`},retrieval:{title:`How the context was found`,expansion:(e,t)=>`The model read the input first${e?` (run ${e})`:``}${t?`, an answer kept from before`:``}.`,terms:e=>`Search terms: ${e||`none`}.`,name:(e,t,n,r)=>`${e}: ${t?`the index's ${t}`:n?`new in this change`:`nothing in the index`} ("${r}")`,dropped:(e,t)=>`Left out: ${e}, ${t}.`,rerank:(e,t,n)=>`The model ordered ${e} candidates. Kept, in its order: ${t||`none`}. Judged not needed: ${n||`none`}.`,rerankIgnored:e=>`The model's order of ${e} candidates named one it wasn't shown, so the engine's order stood.`,meaning:e=>`Meaning: ${e}.`},rounds:`Rounds of this step`,round:e=>`Round ${e}`,thisRound:`(this one)`,facts:{agent:`Agent`,runtime:`Runs with`,stepClass:`Kind of step`,model:`Model`,state:`State`,started:`Started`,finished:`Finished`,size:`Prompt size`,file:`Prompt file`},tokens:e=>`${e} tokens`,textBox:e=>`${e}, scrolls on its own`,forChange:e=>`Model runs for ${e}`,knowledge:`Model runs of the knowledge steps`,surveys:`Model runs of the surveys`,all:`Every model run`},history:{title:`Prompt history`,intro:`What people asked their assistant in this metarepo and what it answered, by session, newest first. It is kept on this machine only, in .atticus/history/, and never committed. Each prompt and response is shown as text, as it was written.`,what:`Recorded: prompts and replies in Claude Code with the Atticus plugin, and @atticus requests and replies in VS Code. Copilot's other chats can't be recorded: VS Code gives extensions no access to them, and Copilot in IntelliJ gives plugins no chat at all.`,recordingOn:`Recording is on. atticus history off stops it on this machine.`,offOrgPack:`Recording is off for everyone: the org pack's runtime.yaml says history: { record: false }. What was kept before is still here.`,offLocal:`Recording is off on this machine: atticus history on turns it back on. What was kept before is still here.`,empty:`No prompts yet. With the Atticus plugin in Claude Code, or @atticus in VS Code, each prompt and reply in this metarepo is listed here.`,change:`Change`,everyChange:`Every change`,session:e=>`Session ${e}`,surfaces:{"claude-code":`Claude Code`,vscode:`VS Code, @atticus`,cli:`Command line`},onlySession:e=>`Only session ${e}.`,showAll:`Show every session`,prompt:`Prompt`,response:`Response`,noResponse:`No response yet.`,command:`Command`,about:`About`,box:(e,t)=>`${e} ${t}, scrolls on its own`,truncated:e=>`Cut at 64 KB: the text was ${e} bytes.`,masked:`Parts that looked like a secret were masked (***) before it was kept.`,newest:(e,t)=>`The newest ${e} of ${t} turns. atticus history --limit n lists more.`,turns:e=>e===1?`1 turn`:`${e} turns`},runStep:{withCopilot:`Run with Copilot`,withModel:e=>`Run with ${e}`,running:`Running…`,busy:`The step is running. The button comes back when it ends.`,hintCopilot:`Copilot runs it in VS Code, with your consent, and the checks read its answer.`,hintModel:e=>`The server runs it with ${e}, as runtime.yaml sets, and the checks read its answer.`,started:e=>`Started on the server with ${e}.`,progress:`Progress`,output:`What the step printed`,ends:{done:`Done: the step finished.`,handoff:`Handed off: the prompt waits for its answer.`,question:`It asked a question: answer it in Waiting on you, then run the step again.`,stopped:`It stopped: its checks found problems. Read the run to see them.`,failed:`It failed.`,cancelled:`Cancelled.`,"too-long":`It stopped: the prompt was too long for the model.`,"no-consent":`It didn't run: Copilot wasn't allowed to use the model.`,"no-model":`It didn't run: no Copilot model is available.`,"model-error":`It stopped: the model answered with an error.`,"too-many-rounds":`It stopped: the checks still found problems after the last round.`},refused:e=>`It didn't run: ${e}`,ended:e=>`It ended: ${e}.`,openRun:`Read the run in Model runs`,openRuns:`Open Model runs`,cancel:`Cancel`,cancelling:`Stopping…`,cancelHint:`Stops the model call; nothing from this run is kept.`,cantStart:e=>`Couldn't start it: ${e}`},nextStep:{releasePlan:`Release plan`},evidence:{cite:e=>`Where this was found: ${e}`,citeOf:(e,t)=>`Where this was found: ${t}, ${e}`,loading:`Reading the facts for this line…`,quote:`The line, as the reader quoted it`,noQuote:`No quote was kept for this line.`,facts:e=>`${e} fact${e===1?``:`s`} on this line`,by:{assistant:`read by the assistant`,reader:`read by a built-in reader`,person:`a person's fact`},verified:{line:`checked on its line by atticus verify`,sample:`checked by a sample session`,person:`confirmed by a person`,none:`not checked yet: run atticus verify`},gaps:{unverified:`No fact verified from code cites this`,question:`A question is open on this`,corrected:`A person corrected this; atticus verify applies it`},short:{unverified:`unproven`,question:`question open`,corrected:`corrected`},noFacts:e=>`${e} has no facts yet: what is drawn from it comes from the built-in readers, not from a read the verifier checked.`,openQuestion:`Answer it`,correct:`Correct this`,correctFact:e=>`Correct the fact ${e}`,close:`Close`,correctTitle:e=>`Correct ${e}`,correctIntro:`Say the fact is wrong, or put the claim right. Atticus writes your correction to the repo's corrections file; atticus verify applies it every time it runs, so the next read keeps it. A corrected claim is still checked on its line: the code must say it.`,wrong:`It is wrong`,edit:`Put the claim right`,reason:`Why (required to mark it wrong)`,reasonOptional:`Why (optional)`,line:`Line it is on`,save:`Save the correction`,saving:`Writing the correction…`,needReason:`Say why the fact is wrong first.`,nothingChanged:`Change a field or the line first.`,saved:e=>`Written to ${e}.`,correction:(e,t)=>e===`wrong`?`Marked wrong by ${t}`:`Corrected by ${t}`,links:`Links`,noLinks:`No link starts or ends here in this view.`,linkOf:(e,t,n)=>`${e} ${n} ${t}`},correctionNext:{title:`What happens next`,onlyWrote:e=>`The app wrote only ${e}. It runs no command: nothing else changes until you run the steps below, and a person reviews the pull request.`,fileDiff:e=>`The change to ${e}, as written`,stepsTitle:`Run these, in order`,step:{verify:`Apply it: verify checks the facts again and writes the catalog`,branch:`Make a branch for the change`,add:`Add the exact files the write changes`,commit:`Commit them`,push:`Push the branch`,pr:`Open a pull request`},prByHand:e=>`Open a pull request from ${e} on your Git host. Set adapters.gitHost in org-pack/runtime.yaml and Atticus gives its command here.`,copy:e=>`Copy: ${e}`,previewTitle:`What atticus verify --write will change`,previewIntro:`Worked out here by the same checks the command runs, without writing anything. It compares with the catalog on disk, so it also shows anything else waiting to be written.`,loading:`Working out what the write will change…`,failed:e=>`Couldn't work out what the write will change: ${e}`,unavailable:{"no-checkout":`There is no checkout of the repo here, so what the write changes can't be worked out. Clone it (atticus workspace sync); the commands still apply.`,"unreadable-facts":`The repo's facts file doesn't read as facts, so the write would change nothing yet. Have your assistant read the repo again.`},blocked:e=>`The write puts nothing in the catalog: ${e} fact${e===1?` is`:`s are`} rejected. Fix ${e===1?`it`:`them`} first (Map › Trust lists ${e===1?`it`:`them`}).`,headMoved:(e,t)=>`The checkout is at ${e.slice(0,7)}, past the facts' commit ${t.slice(0,7)}: verify reads the changed files' facts again, which this preview doesn't.`,facts:`Facts`,dropped:`Left out`,droppedWhy:{wrong:`marked wrong by a person`,rejected:`rejected by the verifier`},edited:`Edited`,field:(e,t,n)=>`${e}: ${t??`(none)`} → ${n??`(none)`}`,noFactChange:`No fact changes.`,kept:e=>`${e} fact${e===1?``:`s`} kept.`,links:`Links`,moved:(e,t,n)=>`${e}: moves from ${t} to ${n}`,added:e=>`${e}: added`,removed:e=>`${e}: removed`,changed:(e,t,n)=>`${e}: ${t} → ${n}`,unmade:e=>`${e}: this repo no longer makes it (the record stays, held by the other side, until that repo is written again)`,linkWhat:(e,t,n,r)=>`${e} → ${t} ${n?`${n} `:``}${r}`,noLinkChange:`No link changes.`,catalog:(e,t,n,r)=>`Catalog records: ${e} added, ${t} changed, ${n} removed, ${r} with only their evidence changed.`,stale:e=>`Corrections on file that meet no fact in this read (kept, applied when it is read again): ${e}.`},why:{contracts:`Contract`,contractsOf:(e,t)=>`${e} mismatch${e===1?``:`es`}${t?`, ${t} unconfirmed`:``} between what each side sends and takes`,contractsAll:`All mismatches`,open:`Why is this linked?`,openOf:e=>`Why is ${e} linked?`,intro:`Each call on this link, how Atticus joined it to what it calls, and the line it cites at each end. A verified call is read from code at both ends and named by someone; an inferred one is a guess.`,call:(e,t,n)=>`${e} → ${t}${n?`: ${n}`:``}`,how:{answer:`A person answered which repo or system it calls.`,named:`The call names the component it goes to.`,repo:`The call names the repo it goes to.`,host:`The call's host is one the manifest lists for that repo.`,declared:`A person declared who calls this gateway route.`,topic:`It publishes a topic the other side listens to.`,path:`Nobody named where it goes: it is the only entry in the estate that serves its path, so this is a guess.`,label:`Its host names no repo; the host's first part happens to be a component's name, so this is a guess.`,"platform-setting":`Its host comes from a platform-wide setting nobody set for this service, so this is a guess.`,"folder-name":`Its host comes from a setting that is this service's only because its file sits in a folder named like it, so this is a guess.`,conflict:`Its host or base path is one a deploy file gives and the manifest disagrees with (an open conflict on Map › Trust), so this is a guess.`,"service-name":`Its host is a Kubernetes Service's short name, which reaches that Service only from its own namespace, and no deploy file says this service runs there, so this is a guess.`,shared:`It calls another team's system, and the map that team shares has the entry that answers it.`,unknown:`The catalog doesn't say how this was joined: it was written before Atticus kept that, or by a built-in reader. Run atticus verify on the caller's repo with --write to record it.`},gateway:`It goes through a gateway on the way.`,declared:`Declared in the profile`,declaredTopic:`Declared in the profile: a person named this topic or queue as that system's, and no repo of the estate serves the other side. It rests on their word, not on code at both ends.`,declaredIn:`In the profile`,sharedMap:(e,t)=>`Joined to ${e}'s map${t?` (their commit ${t.slice(0,7)})`:``}.`,sharedTheirs:e=>`What answers it is ${e}'s, read from the map they share: Atticus never verifies or corrects it. If their entry is wrong, tell ${e}; correct this call only if it goes somewhere else.`,verified:`✓ Verified`,inferred:`△ Inferred`,caller:`The call`,callee:`What answers it`,hops:`Through the gateway`,other:`Lines cited`,noLine:`No line cited at this end.`,more:e=>`${e} more call${e===1?``:`s`} on this link. Open either end to see its calls one by one, or list the Interface records with atticus query "kind:interface".`,none:`This link isn't a call, so there is no join to explain: its lines are listed under it.`,wrong:`This link is wrong`,wrongOf:e=>`Say the call ${e} is wrong`,wrongTitle:e=>`What is wrong with ${e}?`,wrongIntro:`Your word outranks every join rule. Atticus writes it to the caller's repo's corrections file through the local API; atticus verify applies it every time it runs. Nothing changes until you run the command below and the change is reviewed in a pull request.`,pickCall:`The call on that line`,choice:{estate:`It calls another repo or component of the estate`,outside:`It calls an outside system (a vendor, a cloud service)`,"not-a-call":`It isn't a call`},target:`What it calls`,targetHint:`A repo or component id, as the manifest names it.`,outsideTarget:`The outside system`,outsideHint:`The system's name, e.g. Northwind Pay.`,reason:`Why (required when it isn't a call)`,reasonOptional:`Why (optional)`,save:`Write the correction`,saving:`Writing the correction…`,needTarget:`Say what it calls first.`,sameTarget:`The call names that already: pick another target.`,needReason:`Say why it isn't a call first.`,noCall:e=>`No call fact of ${e} is on this line, so there is nothing to correct here. Read the repo again (/atticus-map ${e}) or correct the line's facts from its citation.`,loadingFacts:`Reading the caller's facts…`,factsFailed:e=>`Couldn't read the caller's facts: ${e}`,will:{moves:(e,t,n)=>`This call leaves ${e} → ${t} and goes to ${n}: verify joins it to the entry of ${n} that serves it, or says none does.`,outside:(e,t,n)=>`This call leaves ${e} → ${t} and goes to ${n}, outside the estate: no repo is joined to it.`,unknown:e=>`Atticus doesn't know ${e} as a repo or component of the estate, so verify will take it as outside.`,dropped:(e,t)=>`The call is dropped from the catalog: ${e} → ${t} loses it, and goes if it was the link's only call.`},saved:e=>`Written to ${e}.`,moved:`What moved when the estate was joined again`,movedTo:(e,t,n)=>`${e}: was ${t}, now ${n}`,movedOff:(e,t)=>`${e}: was ${t}, now on no link of the parts open here`,notYet:`No call has moved yet: run the verify command above. The picture reads the catalog again when it changes.`},stageReview:{title:`What the critic found`,intro:`The critic's findings on this stage's latest draft, each with what you can do about it: make the fix, say it isn't relevant, waive it where the rule allows, or ask its owner. Or leave a comment: the stage's next run gives it to your assistant as your answer, with the next draft.`,notRun:`This stage hasn't run for this change yet, so there is nothing to review. Run it first:`,noRound:e=>e?`The critic hasn't reviewed a draft at the ${e} gate yet. The stage runs it on each draft that passes its checks.`:`No gate in gates.yaml reviews this stage's phase, so the critic doesn't run here.`,clean:(e,t)=>`Nothing found at the ${e} gate, round ${t}.`,round:(e,t,n)=>`${n} finding${n===1?``:`s`} at the ${e} gate, round ${t}`,loopState:{drafting:`The stage is drafting.`,waiting:`The stage waits on your assistant's answer.`,questions:`The stage waits on the questions below.`,stopped:`The stage stopped: its assistant couldn't fix what was found.`,done:`The stage is done.`},severity:{blocking:`Blocking`,gap:`Knowledge gap`,risk:`Risk`,idea:`Idea`},state:{open:`Open`,applied:`Fixed`,dismissed:`Not relevant`,waived:`Waived`,asked:`Asked`},where:`Where`,why:`Why`,fix:`The fix`,options:`What you can do`,apply:`Make the fix`,applyFor:e=>`Make the fix for ${e}`,dismiss:`Not relevant`,dismissFor:e=>`Not relevant: ${e}`,waive:`Waive`,waiveFor:e=>`Waive ${e}`,ask:e=>`Ask ${e}`,askFor:(e,t)=>`Ask ${t} about ${e}`,cantWaive:`This rule can't be waived: fix it, or say it isn't relevant with why.`,reason:e=>`Why, for ${e} (needed for not relevant and waive)`,needReason:`Write why first: not relevant and waive need a reason.`,acted:e=>`Recorded: ${e}.`,actions:{apply:`the fix is made`,"not-relevant":`not relevant`,waive:`waived`,ask:`asked of its owner`},resolved:(e,t)=>`${e} by ${t}`,proposed:(e,t)=>`Proposed by the assistant (${e}) as ${t===`fixed`?`fixed`:`not relevant`}, waiting on a person`,question:e=>`The question for ${e}`,comments:`Comments`,comment:e=>`Your comment on ${e}`,commentHint:`Say what the next draft should do about it. Your words go to the assistant as your answer.`,saveComment:`Save the comment`,savingComment:`Writing the comment…`,needComment:`Write the comment first.`,read:`read by a draft`,unread:`not read yet: run the stage`,commented:e=>`Written to ${e}. Commit them, then run the stage again: its next draft reads your comment.`,copyCommit:`Copy the git command`,questions:`The stage's questions`,noQuestions:`The stage has no question for a person.`,answered:e=>`Answered: ${e}`,answerIt:e=>`Answer: ${e}`,next:`Then run the stage again`,nextWhy:`It reads your answers, comments and choices, drafts again where they ask, and the critic checks the new draft.`,pickForArchitecture:`Pick a change to see what the critic found in its architecture.`}},D=class extends Error{problem;constructor(e){super(e.detail??e.title),this.problem=e}};function ee(){return document.querySelector(`meta[name="atticus-token"]`)?.content??``}function te(e=!1){return{type:`about:blank`,title:`Server not answering`,status:0,detail:e?E.app.offlinePanel:E.app.offline}}var ne=`atticus:server`,O=!1;function re(e){e!==!O&&(O=!e,typeof dispatchEvent==`function`&&dispatchEvent(new CustomEvent(ne,{detail:{up:e}})))}var ie=e=>e===E.app.offline||e===E.app.offlinePanel;function ae(e,t){if(e)try{return JSON.parse(e)}catch{throw new D({type:`about:blank`,title:`Not an Atticus answer`,status:t,detail:E.app.notJson(t)})}}var oe=`The Atticus app isn't answering`;async function k(e,t={}){let n=T();if(n){let r=await n.call(e,{method:t.method??`GET`,...t.body===void 0?{}:{body:t.body}});if(t.signal?.aborted)throw new DOMException(`Aborted`,`AbortError`);if(r.status===503&&r.body?.title===oe)throw re(!1),new D(te(!0));if(re(!0),r.status<200||r.status>=300)throw new D(r.body??{type:`about:blank`,title:`Request failed`,status:r.status});return r.body}let r,i;try{r=await fetch(e,{method:t.method??`GET`,headers:{"X-Atticus-Token":ee(),...t.body===void 0?{}:{"Content-Type":`application/json`}},...t.body===void 0?{}:{body:JSON.stringify(t.body)},...t.signal?{signal:t.signal}:{}}),i=await r.text()}catch(e){throw t.signal?.aborted?e:(re(!1),new D(te()))}re(!0);let a=ae(i,r.status);if(!r.ok)throw new D(a??{type:`about:blank`,title:r.statusText||`Request failed`,status:r.status});return a}function A(e){let[t,n]=(0,v.useState)({state:`loading`}),[r,i]=(0,v.useState)(0),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(),l=(0,v.useCallback)(()=>i(e=>e+1),[]),u=(0,v.useRef)(!1);return(0,v.useEffect)(()=>{if(!e)return;let t=new AbortController;return u.current&&o(!0),k(e,{signal:t.signal}).then(e=>n({state:`ready`,data:e}),e=>{t.signal.aborted||n({state:`error`,error:e instanceof Error?e.message:String(e),...e instanceof D&&e.problem.notYet?{notYet:!0}:{}})}).finally(()=>{t.signal.aborted||(u.current=!0,o(!1),c(Date.now()))}),()=>t.abort()},[e,r]),{...t,reload:l,refreshing:a,...s===void 0?{}:{at:s}}}var se=e=>e.type===`file.changed`||e.type===`run.changed`||e.type===`index.rebuilt`;function ce(...e){let t=(0,v.useRef)(e);t.current=e,j(e=>{if(se(e))for(let e of t.current)e?.reload()})}function j(e){let t=(0,v.useRef)(e);t.current=e,(0,v.useEffect)(()=>{let e=T();if(e)return e.onEvent(e=>t.current(e));let n,r=!1,i=500,a=()=>{if(r)return;let e=new URL(`/api/events`,location.href);e.protocol=e.protocol===`https:`?`wss:`:`ws:`,e.searchParams.set(`token`,ee()),n=new WebSocket(e),n.onmessage=e=>{try{t.current(JSON.parse(String(e.data)))}catch{}},n.onopen=()=>{i=500},n.onclose=()=>{r||(setTimeout(a,i),i=Math.min(i*2,1e4))}};return a(),()=>{r=!0,n?.close()}},[])}var le=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),M=o(((e,t)=>{t.exports=le()}))(),ue=E.common;function de(e){return t=>{t.key!==`Escape`||t.defaultPrevented||t.nativeEvent.isComposing||(t.preventDefault(),t.stopPropagation(),e())}}function N(e){let t=e.labelledBy??(e.title?`p-${e.title.toLowerCase().replace(/[^a-z0-9]+/g,`-`)}`:void 0);return(0,M.jsxs)(`section`,{className:`panel ${e.kind??``}`,"aria-labelledby":e.title?t:void 0,style:{gridColumn:e.span,gridRow:e.rows},children:[e.title&&(0,M.jsxs)(`div`,{className:`row between`,style:{marginBottom:10},children:[(0,M.jsx)(`h2`,{id:t,className:`h`,children:e.title}),e.meta&&(0,M.jsx)(`span`,{className:`hud`,children:e.meta})]}),e.children]})}function P(e){return e.of.state===`loading`?(0,M.jsxs)(`div`,{className:`stack`,"aria-busy":`true`,"aria-live":`polite`,children:[(0,M.jsx)(`span`,{className:`sr`,children:E.app.loading}),(0,M.jsx)(`div`,{className:`skeleton`,style:{width:`80%`}}),(0,M.jsx)(`div`,{className:`skeleton`,style:{width:`60%`}}),(0,M.jsx)(`div`,{className:`skeleton`,style:{width:`70%`}})]}):e.of.state===`error`&&e.of.notYet?(0,M.jsx)(`div`,{className:`state`,children:e.of.error}):e.of.state===`error`?(0,M.jsx)(fe,{error:e.of.error,retry:e.of.reload}):e.empty?.(e.of.data)?e.emptyContent===void 0?(0,M.jsx)(`div`,{className:`state`,children:e.emptyText??ue.nothingHereYet}):(0,M.jsx)(M.Fragment,{children:e.emptyContent}):(0,M.jsx)(M.Fragment,{children:e.children(e.of.data)})}function fe({error:e,retry:t}){return(0,M.jsxs)(`div`,{className:`state error`,role:`alert`,children:[(0,M.jsx)(`p`,{style:{margin:0},children:E.app.cantLoad(ie(e)?E.app.offlineShort:e)}),t&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,style:{marginTop:8},onClick:t,children:E.app.tryAgain})]})}function pe({href:e,children:t}){return(0,M.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,children:[t,(0,M.jsxs)(`span`,{className:`sr`,children:[` `,E.app.newTab]})]})}function me(e){let[t,n]=(0,v.useState)(!1);return(0,M.jsxs)(`span`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.of.refreshing,onClick:()=>{n(!0),(e.run??e.of.reload)()},children:e.of.refreshing?E.app.checking:e.label}),(0,M.jsx)(`span`,{role:`status`,className:`muted`,style:{fontSize:12},children:t&&!e.of.refreshing&&e.of.at?E.app.checkedAt(new Date(e.of.at).toTimeString().slice(0,8)):``})]})}function he(e){let t=e.size??56,n=t/2-5,r=2*Math.PI*n,i=e.max>0?Math.min(e.value/e.max,1):0;return(0,M.jsxs)(`svg`,{role:`img`,"aria-label":e.label,width:t,height:t,viewBox:`0 0 ${t} ${t}`,children:[(0,M.jsx)(`circle`,{cx:t/2,cy:t/2,r:n,fill:`none`,stroke:`var(--track)`,strokeWidth:4}),(0,M.jsx)(`circle`,{cx:t/2,cy:t/2,r:n,fill:`none`,stroke:e.color??`var(--accent)`,strokeWidth:4,strokeLinecap:`round`,strokeDasharray:`${r*i} ${r}`,transform:`rotate(-90 ${t/2} ${t/2})`,style:{filter:`drop-shadow(0 0 var(--glow-size) ${e.color??`var(--accent)`})`}}),(0,M.jsx)(`text`,{x:t/2,y:t/2+5,textAnchor:`middle`,fill:`var(--text)`,fontFamily:`Rajdhani, sans-serif`,fontWeight:700,fontSize:t/4,children:e.text??`${e.value}/${e.max}`})]})}function F(e){let t=e.parts.reduce((e,t)=>e+t.value,0),n=2*Math.PI*26,r=0;return(0,M.jsxs)(`div`,{className:`row`,style:{gap:12},children:[(0,M.jsxs)(`svg`,{role:`img`,"aria-label":`${e.title}: ${e.parts.map(e=>`${e.label} ${e.value}`).join(`, `)}`,width:70,height:70,viewBox:`0 0 70 70`,children:[(0,M.jsx)(`circle`,{cx:35,cy:35,r:26,fill:`none`,stroke:`var(--track)`,strokeWidth:10}),e.parts.map(e=>{let i=t?e.value/t*n:0,a=(0,M.jsx)(`circle`,{cx:35,cy:35,r:26,fill:`none`,stroke:e.color,strokeWidth:10,strokeDasharray:`${i} ${n}`,strokeDashoffset:-r,transform:`rotate(-90 35 35)`},e.label);return r+=i,a})]}),(0,M.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,display:`flex`,flexDirection:`column`,gap:5,fontSize:11.5},children:e.parts.map(e=>(0,M.jsxs)(`li`,{className:`row`,style:{gap:6},children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,style:{width:8,height:8,borderRadius:2,background:e.color}}),e.label,` `,e.value]},e.label))})]})}function ge(e){let t=e.max>0?Math.round(e.value/e.max*100):0;return(0,M.jsx)(`div`,{role:`img`,"aria-label":ue.of(e.label,e.value,e.max),className:`track`,children:(0,M.jsx)(`span`,{style:{width:`${t}%`,background:e.color,boxShadow:e.color?`0 0 10px ${e.color}`:void 0}})})}var _e=E.knowCommon;function ve(e,t,n=!1){let r=A(n?void 0:`/api/view/${e}${t?`/${encodeURIComponent(t)}`:``}`);return r.state===`ready`?{state:`ready`,data:r.data.data,reload:r.reload}:r}function ye(e,t){let n=e.split(`?`)[1];return n?new URLSearchParams(n).get(t)??void 0:void 0}function be(e,t,n){location.hash=`#/${e}?${t}=${encodeURIComponent(n)}`}function xe(e,t){let n=A(`/api/changes`),r=ye(e,`change`)??(n.state===`ready`?n.data[0]?.id:void 0);return{id:r,picker:(0,M.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:E.app.changePicker}),(0,M.jsxs)(`select`,{value:r??``,onChange:e=>be(t,`change`,e.target.value),disabled:n.state!==`ready`||n.data.length===0,style:{height:32,background:`var(--box)`,color:`var(--text)`,border:`1px solid var(--line-2)`,borderRadius:7,padding:`0 8px`,font:`inherit`},children:[n.state===`ready`&&n.data.length===0&&(0,M.jsx)(`option`,{value:``,children:E.app.noChanges}),n.state===`ready`&&n.data.map(e=>(0,M.jsxs)(`option`,{value:e.id,children:[e.id,` · `,e.state]},e.id))]})]}),none:n.state===`ready`&&n.data.length===0,list:n}}function Se(e){return(0,M.jsx)(`div`,{className:`bento`,children:(0,M.jsx)(N,{title:e.title,span:`1 / -1`,children:e.list.state===`error`?(0,M.jsx)(fe,{error:e.list.error,retry:e.list.reload}):(0,M.jsxs)(`div`,{"aria-busy":`true`,"aria-live":`polite`,children:[(0,M.jsx)(`span`,{className:`sr`,children:E.app.loading}),(0,M.jsx)(`div`,{className:`skeleton`})]})})})}function Ce(e){return e.split(/(`[^`]+`|\*\*[^*]+\*\*|_\([^)]*\)_)/).map((e,t)=>e.startsWith("`")&&e.endsWith("`")&&e.length>1?(0,M.jsx)(`code`,{className:`mono`,style:{fontSize:`0.92em`,color:`var(--accent)`},children:e.slice(1,-1)},t):e.startsWith(`_(`)&&e.endsWith(`)_`)?(0,M.jsx)(`span`,{className:`muted mono`,style:{fontSize:`0.85em`},children:e.slice(1,-1)},t):e.startsWith(`**`)&&e.endsWith(`**`)&&e.length>3?(0,M.jsx)(`strong`,{children:e.slice(2,-2)},t):e)}var we=e=>e.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());function Te({text:e}){let t=[],n=[],r=[],i=[],a=()=>{if(i.length&&t.push((0,M.jsx)(`p`,{style:{margin:`4px 0 8px`,lineHeight:1.6,color:`var(--text-2)`},children:Ce(i.join(` `))},`p${t.length}`)),i=[],n.length&&t.push((0,M.jsx)(`ul`,{style:{margin:`4px 0 8px`,paddingLeft:20,lineHeight:1.6},children:n.map((e,t)=>(0,M.jsx)(`li`,{children:Ce(e)},t))},`l${t.length}`)),n=[],r.length){let[e,...n]=r,i=n.filter(e=>!/^\s*\|?\s*:?-{2,}/.test(e));t.push((0,M.jsx)(`div`,{style:{overflowX:`auto`,position:`relative`,margin:`6px 0 10px`},tabIndex:0,role:`region`,"aria-label":E.app.scrollTable(we(e).join(`, `)),children:(0,M.jsxs)(`table`,{style:{borderCollapse:`collapse`,width:`100%`,fontSize:12},children:[(0,M.jsx)(`thead`,{children:(0,M.jsx)(`tr`,{children:we(e).map((e,t)=>(0,M.jsx)(`th`,{className:`hud`,style:{textAlign:`left`,fontWeight:400,fontSize:10,padding:`4px 10px 6px 0`},children:e},t))})}),(0,M.jsx)(`tbody`,{children:i.map((e,t)=>(0,M.jsx)(`tr`,{style:{borderTop:`1px solid var(--rule)`,verticalAlign:`top`},children:we(e).map((e,t)=>(0,M.jsx)(`td`,{style:{padding:`6px 10px 6px 0`,color:`var(--text-2)`},children:Ce(e)},t))},t))})]})},`t${t.length}`))}r=[]},o=!1,s=[];for(let c of e.split(`
|
|
10
|
+
`)){let e=c.trimEnd();if(/^```/.test(e)){o?(t.push((0,M.jsx)(`pre`,{className:`mono`,tabIndex:0,role:`region`,"aria-label":E.app.scrollCode,style:{fontSize:11.5,background:`var(--box)`,border:`1px solid var(--line)`,borderRadius:8,padding:10,overflowX:`auto`},children:s.join(`
|
|
11
|
+
`)},`c${t.length}`)),s=[]):a(),o=!o;continue}if(o){s.push(c);continue}let l=/^(#{1,4})\s+(.*)$/.exec(e),u=/^\s*(?:[-*]|\d+\.)\s+(?:\[[ xX]\]\s+)?(.*)$/.exec(e);if(e.trimStart().startsWith(`|`)){if(n.length){let e=r;r=[],a(),r=e}r.push(e)}else if(r.length&&a(),l){a();let e=l[1].length;t.push((0,M.jsx)(`div`,{className:e<=2?`h`:`hud`,style:{margin:`12px 0 6px`,fontSize:e<=1?16:e===2?14:11},children:Ce(l[2])},t.length))}else u?(i.length&&a(),n.push(u[1])):!e.trim()||/^<!--/.test(e)?a():(n.length&&a(),i.push(e.trim()))}return a(),(0,M.jsx)(`div`,{children:t})}function Ee(e){return e instanceof D?e.problem.detail??e.problem.title:e instanceof Error?e.message:String(e)}function De(){let[e,t]=(0,v.useState)(!1),[n,r]=(0,v.useState)();return{busy:e,note:n,run:async(e,n)=>{t(!0),r({ok:!0,text:E.app.working,working:!0});try{await e(),r({ok:!0,text:n})}catch(e){r({ok:!1,text:Ee(e)})}finally{t(!1)}}}}function Oe({note:e}){return e?(0,M.jsx)(`p`,{role:e.ok?`status`:`alert`,"aria-busy":e.working?!0:void 0,style:{margin:`8px 0 0`,whiteSpace:`pre-line`,color:e.working?`var(--text-2)`:e.ok?`var(--green)`:`var(--magenta-text)`,fontSize:12.5},children:e.text}):null}function ke(e){return(0,M.jsx)(`div`,{style:{overflowX:`auto`,position:`relative`},tabIndex:0,role:`region`,"aria-label":e.caption??_e.table,children:(0,M.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:12.5,minWidth:480},children:[e.caption&&(0,M.jsx)(`caption`,{className:`sr`,children:e.caption}),(0,M.jsx)(`thead`,{children:(0,M.jsx)(`tr`,{className:`hud`,style:{textAlign:`left`,fontSize:10},children:e.cols.map(e=>(0,M.jsx)(`th`,{scope:`col`,style:{padding:`4px 8px 6px 0`,fontWeight:400,width:e.width},children:e.label},e.label))})}),(0,M.jsx)(`tbody`,{children:e.rows.map(t=>(0,M.jsx)(`tr`,{style:{borderTop:`1px solid var(--rule)`,verticalAlign:`top`},children:e.cols.map(e=>(0,M.jsx)(`td`,{className:e.mono?`mono`:void 0,style:{padding:`7px 8px 7px 0`,wordBreak:`break-word`},children:e.cell(t)},e.label))},e.rowKey(t)))})]})})}var Ae=e=>Array.isArray(e)?e.join(`, `):e==null?``:String(e),je=E.viewer,Me={min:.1,max:3,step:1.25},Ne=(e,t,n)=>Math.min(n,Math.max(t,e)),Pe=e=>Ne(e,Me.min,Me.max);function Fe(e,t,n={}){let r=n.pad??24,i=Math.max(1,t.width-r*2),a=Math.max(1,t.height-r*2),o=Ne(Math.min(i/Math.max(1,e.w),a/Math.max(1,e.h)),n.min??Me.min,n.max??1);return{k:o,x:(t.width-e.w*o)/2-e.x*o,y:(t.height-e.h*o)/2-e.y*o}}function Ie(e,t,n){let r=Pe(e.k*t),i=r/e.k;return{k:r,x:n.x-(n.x-e.x)*i,y:n.y-(n.y-e.y)*i}}function Le(e,t,n,r=e.k){return{k:r,x:n.width/2-(t.x+t.w/2)*r,y:n.height/2-(t.y+t.h/2)*r}}var Re=(e,t=0)=>Math.exp(-e*(t===1?33:t===2?400:1)/500);function ze(e){if(!(e.ctrlKey||e.metaKey||e.altKey))switch(e.key){case`+`:case`=`:return`zoom-in`;case`-`:case`_`:return`zoom-out`;case`0`:return`fit`;case`1`:return`reset`;case`s`:case`S`:return`fit-selection`;case`m`:case`M`:return`focus`;case`f`:case`F`:return`full-screen`;case`Escape`:return`leave`;case`/`:return`search`;case`ArrowLeft`:return`pan-left`;case`ArrowRight`:return`pan-right`;case`ArrowUp`:return`pan-up`;case`ArrowDown`:return`pan-down`;default:return}}function Be(e,t){return t===`pan-left`?{...e,x:e.x+80}:t===`pan-right`?{...e,x:e.x-80}:t===`pan-up`?{...e,y:e.y+80}:t===`pan-down`?{...e,y:e.y-80}:e}function Ve(e,t,n=8){let r=t.trim().toLowerCase();if(!r)return[];let i=e=>{let t=e.label.toLowerCase();return t===r?0:t.startsWith(r)?1:t.includes(r)?2:e.id.toLowerCase().includes(r)?3:9};return e.map(e=>({n:e,s:i(e)})).filter(e=>e.s<9).sort((e,t)=>e.s-t.s||e.n.label.length-t.n.label.length||(e.n.id<t.n.id?-1:1)).slice(0,n).map(e=>e.n)}function He(e,t){let n=new Set([t]);for(let r of e)r.from===t&&n.add(r.to),r.to===t&&n.add(r.from);return n}function Ue(e,t,n,r){if(!e.length)return r;let i=t===null?-1:e.indexOf(t);return n?i<=0?e[e.length-1]:void 0:i===-1||i===e.length-1?e[0]:void 0}function We(e){return e.key!==`Escape`||e.defaultPrevented?!1:!e.target?.closest?.(`[role="search"]`)}function Ge(e){e?.querySelector(`[data-viewer-action="full-screen"]`)?.focus()}var Ke=`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`;function qe(e=!1){let[t,n]=(0,v.useState)(e),r=(0,v.useCallback)(e=>n(t=>e===void 0?!t:e),[]);return(0,v.useEffect)(()=>{if(!t||typeof window>`u`)return;let e=e=>{let t=e.target;We({key:e.key,defaultPrevented:e.defaultPrevented,target:t})&&n(!1)};window.addEventListener(`keydown`,e);let r=document.body,i=r.style.overflow;return r.style.overflow=`hidden`,()=>{window.removeEventListener(`keydown`,e),r.style.overflow=i}},[t]),[t,r]}function Je(e,t,n=420){return Math.max(n,Math.floor(e-Ne(t,0,160)-24))}function Ye(e,t={}){let n=t.min??420,[r,i]=(0,v.useState)(t.fixed??Math.max(n,560));return(0,v.useEffect)(()=>{if(t.fixed!==void 0||typeof window>`u`)return;let r=()=>{let t=e.current;t&&i(Je(window.innerHeight,t.getBoundingClientRect().top,n))};r(),window.addEventListener(`resize`,r);let a=typeof ResizeObserver>`u`?void 0:new ResizeObserver(r);return a&&e.current?.parentElement&&a.observe(e.current.parentElement),()=>{window.removeEventListener(`resize`,r),a?.disconnect()}},[e,n,t.fixed]),t.fixed??r}var Xe=({d:e})=>(0,M.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 14 14`,"aria-hidden":`true`,focusable:`false`,children:(0,M.jsx)(`path`,{d:e,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`})}),Ze={in:`M3 7 H11 M7 3 V11`,out:`M3 7 H11`,reset:`M2 4 V10 M5 4 V10 M9 4 H12 V10 H9 Z`,fit:`M2 5 V2 H5 M9 2 H12 V5 M12 9 V12 H9 M5 12 H2 V9`,sel:`M4 4 H10 V10 H4 Z M1 7 H3 M11 7 H13 M7 1 V3 M7 11 V13`,focus:`M7 4 A3 3 0 1 1 6.99 4 M1 7 H2.5 M11.5 7 H13`,full:`M2 5 V2 H5 M9 2 H12 V5 M12 9 V12 H9 M5 12 H2 V9 M5 5 L9 9 M9 5 L5 9`,leave:`M5 2 V5 H2 M9 2 V5 H12 M12 9 H9 V12 M2 9 H5 V12`};function Qe(e){let t=(0,v.useId)(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),o=t=>{let n=Ve(e.nodes,t,1)[0];n?(e.onFind(n.id),a(je.found(n.label))):t.trim()&&a(je.notFound(t.trim()))},s=(t,n,r,i={})=>(0,M.jsx)(`button`,{type:`button`,className:`btn viewer-btn ${i.on?`primary`:``}`,"aria-label":n,title:n,"data-viewer-action":t,disabled:i.off,...i.on===void 0?{}:{"aria-pressed":i.on},onClick:()=>e.onAction(t),children:(0,M.jsx)(Xe,{d:r})});return(0,M.jsxs)(`div`,{className:`viewer-bar`,role:`toolbar`,"aria-label":je.toolbar,children:[(0,M.jsxs)(`div`,{className:`viewer-group`,children:[s(`zoom-out`,je.zoomOut,Ze.out),(0,M.jsx)(`span`,{className:`hud viewer-zoom`,"aria-live":`polite`,children:je.zoomLevel(Math.round(e.zoom*100))}),s(`zoom-in`,je.zoomIn,Ze.in),s(`reset`,je.reset,Ze.reset),s(`fit`,je.fit,Ze.fit),s(`fit-selection`,je.fitSelection,Ze.sel,{off:!e.picked}),s(`focus`,e.focus?je.focusOff:je.focus,Ze.focus,{on:e.focus,off:!e.picked&&!e.focus}),s(`full-screen`,e.full?je.leaveFullScreen:je.fullScreen,e.full?Ze.leave:Ze.full,{on:e.full})]}),(0,M.jsxs)(`form`,{className:`viewer-group viewer-find`,role:`search`,onSubmit:e=>{e.preventDefault(),o(n)},children:[(0,M.jsx)(`input`,{ref:e.searchRef,className:`field`,type:`search`,"aria-label":je.search,placeholder:je.searchPlaceholder,list:t,value:n,onChange:t=>{r(t.target.value),e.nodes.some(e=>e.label===t.target.value)&&o(t.target.value)},onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),e.preventDefault(),r(``))}}),(0,M.jsx)(`datalist`,{id:t,children:Ve(e.nodes,n,8).map(e=>(0,M.jsx)(`option`,{value:e.label,children:e.kind??``},e.id))}),(0,M.jsx)(`span`,{className:`sr`,"aria-live":`polite`,children:i})]})]})}function $e(e){let[t,n]=(0,v.useState)(!0),r=(0,v.useId)(),i=(0,v.useRef)(null),a=e.frameRef??i,o=(0,v.useRef)(e.full);return(0,v.useEffect)(()=>{if(o.current&&!e.full&&Ge(a.current),o.current=e.full,!e.full||typeof document>`u`)return;let t=a.current;t&&!t.contains(document.activeElement)&&t.focus();let n=e=>{t&&!t.contains(e.target)&&t.focus()};return document.addEventListener(`focusin`,n),()=>document.removeEventListener(`focusin`,n)},[e.full,a]),(0,M.jsxs)(`div`,{ref:a,className:`viewer ${e.full?`viewer-full`:``} ${e.className??``}`,role:`region`,tabIndex:0,"aria-label":je.region(e.title),onKeyDown:t=>{if(e.full&&t.key===`Tab`&&a.current){let e=a.current,n=Ue([...e.querySelectorAll(Ke)].filter(t=>t!==e&&!t.closest(`[hidden]`)&&t.getClientRects().length>0),document.activeElement,t.shiftKey,e);n&&(t.preventDefault(),n.focus());return}let n=t.target;if(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.tagName===`SELECT`||n.isContentEditable||n.closest?.(`.viewer-aside`))return;let r=ze(t);r&&(r.startsWith(`pan-`)&&n.closest?.(`.react-flow__node`)||(r!==`leave`||e.full)&&(t.preventDefault(),e.onKeyAction(r)))},...e.full?{"aria-modal":!0}:{},children:[e.toolbar,e.full&&(0,M.jsx)(`p`,{className:`sr`,role:`status`,children:je.fullScreenOn}),(0,M.jsxs)(`div`,{className:`viewer-stage`,style:e.full?void 0:{height:e.height},children:[e.children,e.aside&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{type:`button`,className:`btn viewer-aside-toggle`,"aria-expanded":t,"aria-controls":r,onClick:()=>n(e=>!e),children:t?je.hideDetails:je.showDetails}),(0,M.jsx)(`aside`,{id:r,className:`viewer-aside`,"aria-label":je.details,hidden:!t,children:e.aside})]})]}),(0,M.jsx)(`p`,{className:`hud viewer-keys`,children:je.keys})]})}var et=E.flowView;function tt(e,t=5){return e.length<=t?e.join(`, `):`${e.slice(0,t).join(`, `)} and ${e.length-t} more`}var nt=(e,t=0)=>t?`${e} · ${t} inside`:e,rt=6.6,it=22,at=10,ot=96,st=24,ct=10,lt=24,ut=16,dt=e=>Math.max(64,Math.ceil(e.length*rt)+18),ft=e=>(Math.round(e*10)/10).toString();function pt(e){let t=new Map;for(let n of e.edges)n.from===n.to&&t.set(n.from,(t.get(n.from)??0)+1);let n=t=>{let n=e.nodes.find(e=>e.id===t);return n?.group?`group:${n.group}`:`node:${t}`},r=[...e.nodes.filter(e=>!e.group).map(e=>`node:${e.id}`),...e.groups.filter(t=>e.nodes.some(e=>e.group===t.id)).map(e=>`group:${e.id}`)].sort(),i=new Map(r.map(e=>[e,new Set]));for(let t of e.edges){let e=n(t.from),r=n(t.to);e!==r&&i.has(e)&&i.has(r)&&i.get(r).add(e)}let a=new Map;for(;a.size<r.length;){let e=r.filter(e=>!a.has(e)),t=e.filter(e=>[...i.get(e)].every(e=>a.has(e)));if(!t.length){let n=e=>[...i.get(e)].filter(e=>!a.has(e)).length;t=[e.reduce((e,t)=>n(t)<n(e)?t:e)]}for(let e of t)a.set(e,Math.max(0,...[...i.get(e)].filter(e=>a.has(e)).map(e=>a.get(e)+1)))}let o=new Map,s=new Map;for(let n of r){if(n.startsWith(`node:`)){let r=e.nodes.find(e=>`node:${e.id}`===n);s.set(n,{w:dt(nt(r.label,t.get(r.id))),h:it});continue}let r=e.groups.find(e=>`group:${e.id}`===n),i=e.nodes.filter(e=>e.group===r.id),a=Math.ceil(i.length/ut),c=Math.ceil(i.length/a),l=Math.max(...i.map(e=>dt(e.label)));o.set(n,i.map((e,t)=>({id:e.id,col:Math.floor(t/c),row:t%c,w:l}))),s.set(n,{w:Math.max(dt(r.label)+12,a*l+(a-1)*at+20),h:lt+c*it+(c-1)*at+ct})}let c=[...new Set(a.values())].sort((e,t)=>e-t),l=new Map,u=st,d=0,f=[];for(let e of c){let t=r.filter(t=>a.get(t)===e);for(let e=0;e<t.length;e+=ut){let n=t.slice(e,e+ut),r=Math.max(...n.map(e=>s.get(e).w)),i=n.reduce((e,t)=>e+s.get(t).h,0)+(n.length-1)*at*2;f.push({units:n,x:u,h:i}),d=Math.max(d,i),u+=r+ot}}for(let e of f){let t=st+(d-e.h)/2;for(let n of e.units){let r=s.get(n);l.set(n,{x:e.x,y:t,w:r.w,h:r.h}),t+=r.h+20}}let p=new Map,m=new Map;for(let e of r){let t=l.get(e);if(e.startsWith(`node:`))p.set(e.slice(5),t);else{m.set(e.slice(6),t);for(let n of o.get(e))p.set(n.id,{x:t.x+ct+n.col*(n.w+at),y:t.y+lt+n.row*32,w:n.w,h:it})}}let h=e.edges.filter(e=>e.from!==e.to&&p.has(e.from)&&p.has(e.to)).map(e=>{let t=p.get(e.from),n=p.get(e.to),r=t.y+t.h/2,i=n.y+n.h/2,a;if(n.x>t.x+t.w){let e=t.x+t.w,o=(e+n.x)/2;a=`M${ft(e)} ${ft(r)} C${ft(o)} ${ft(r)} ${ft(o)} ${ft(i)} ${ft(n.x)} ${ft(i)}`}else{let e=Math.max(0,Math.min(t.x,n.x)-40);a=`M${ft(t.x)} ${ft(r)} C${ft(e)} ${ft(r)} ${ft(e)} ${ft(i)} ${ft(n.x)} ${ft(i)}`}return{id:e.id,from:e.from,to:e.to,label:e.label,async:e.async,d:a}}),g=[...p.values(),...m.values()];return{width:Math.max(320,...g.map(e=>e.x+e.w+st)),height:Math.max(160,...g.map(e=>e.y+e.h+st)),nodes:p,groups:m,edges:h,inside:t}}var mt=.6,ht=960;function gt({view:e,height:t,selected:n,highlight:r=[],onPick:i,initialFull:a,initialFocus:o}){let s=(0,v.useMemo)(()=>pt(e),[e]),[c,l]=(0,v.useState)(n),[u,d]=qe(a),[f,p]=(0,v.useState)(!!o),m=(0,v.useRef)(null),h=(0,v.useRef)(null),g=(0,v.useRef)(null),_=Ye(m,{min:t??420}),[y,b]=(0,v.useState)({width:ht,height:_}),x={x:0,y:0,w:s.width,h:s.height},S=e=>Fe(x,e,{min:mt}),[C,w]=(0,v.useState)(()=>S({width:ht,height:_})),T=(0,v.useRef)(!1);(0,v.useEffect)(()=>{let e=h.current;if(!e||typeof window>`u`)return;let t=()=>{let t=e.getBoundingClientRect();if(!t.width||!t.height)return;let n={width:t.width,height:t.height};b(n),T.current||(T.current=!0,w(Fe({x:0,y:0,w:s.width,h:s.height},n,{min:mt})))};t();let n=typeof ResizeObserver>`u`?void 0:new ResizeObserver(t);return n?.observe(e),window.addEventListener(`resize`,t),()=>{n?.disconnect(),window.removeEventListener(`resize`,t)}},[s,u]),(0,v.useEffect)(()=>{T.current=!1},[s]),(0,v.useEffect)(()=>{let e=h.current;if(!e)return;let t=t=>{t.preventDefault();let n=e.getBoundingClientRect(),r={x:t.clientX-n.left,y:t.clientY-n.top};w(e=>Ie(e,Re(t.deltaY,t.deltaMode),r))};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]);let D=(0,v.useRef)(new Map),[ee,te]=(0,v.useState)(!1),ne=e=>{e.target.closest?.(`[data-node]`)||(D.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),e.currentTarget.setPointerCapture?.(e.pointerId),te(!0))},O=e=>{let t=D.current,n=t.get(e.pointerId);if(n){if(t.size===2){let[r,i]=[...t.values()],a=r===n?i:r,o=Math.hypot(n.x-a.x,n.y-a.y),s=Math.hypot(e.clientX-a.x,e.clientY-a.y),c=e.currentTarget.getBoundingClientRect(),l={x:(e.clientX+a.x)/2-c.left,y:(e.clientY+a.y)/2-c.top};o>0&&w(e=>Ie(e,s/o,l))}else{let t=e.clientX-n.x,r=e.clientY-n.y;w(e=>({...e,x:e.x+t,y:e.y+r}))}t.set(e.pointerId,{x:e.clientX,y:e.clientY})}},re=e=>{D.current.delete(e.pointerId),D.current.size||te(!1)},ie=new Set(r),ae=e=>c!==void 0&&(e.from===c||e.to===c),oe=t=>e.nodes.find(e=>e.id===t)?.label??t,k=c?s.edges.filter(ae):[],A=f&&c?He(s.edges,c):void 0,se=(e,t=Math.max(C.k,1))=>w(Le(C,e,y,Pe(t))),ce=e=>{let t=s.nodes.get(e);return t?{x:t.x,y:t.y,w:t.w,h:t.h}:void 0},j=e=>{let t={x:y.width/2,y:y.height/2};switch(e){case`zoom-in`:return w(e=>Ie(e,Me.step,t));case`zoom-out`:return w(e=>Ie(e,1/Me.step,t));case`reset`:return w(e=>Ie(e,1/e.k,t));case`fit`:return w(S(y));case`fit-selection`:{let e=c?ce(c):void 0;e&&se(e,Math.max(C.k,1.2));return}case`focus`:return p(e=>!e);case`full-screen`:T.current=!1,d(),requestAnimationFrame(()=>m.current?.focus());return;case`leave`:return T.current=!1,d(!1);case`search`:return g.current?.focus();default:return w(t=>Be(t,e))}},le=e=>{l(e),i?.(e);let t=ce(e);t&&se(t)},ue=e.nodes.length>12;return(0,M.jsxs)(`div`,{style:{display:`grid`,gap:8},children:[(0,M.jsx)($e,{title:e.title,full:u,height:_,frameRef:m,onKeyAction:j,toolbar:(0,M.jsx)(Qe,{zoom:C.k,full:u,focus:f,picked:!!c,nodes:e.nodes,onAction:j,onFind:le,searchRef:g}),children:(0,M.jsxs)(`div`,{ref:h,className:`flow-canvas ${ee?`panning`:``}`,onPointerDown:ne,onPointerMove:O,onPointerUp:re,onPointerCancel:re,children:[(0,M.jsxs)(`svg`,{role:`group`,"aria-label":et.nodesInGroupsEdges(e.title,e.nodes.length,e.groups.length,e.edges.length),width:`100%`,height:`100%`,style:{display:`block`},children:[(0,M.jsx)(`defs`,{children:(0,M.jsx)(`marker`,{id:`flow-arrow`,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,M.jsx)(`path`,{d:`M0 0 L8 4 L0 8 z`,fill:`var(--accent)`})})}),(0,M.jsxs)(`g`,{transform:`translate(${ft(C.x)} ${ft(C.y)}) scale(${Math.round(C.k*1e3)/1e3})`,children:[e.groups.map(e=>{let t=s.groups.get(e.id);return t?(0,M.jsxs)(`g`,{children:[(0,M.jsx)(`rect`,{x:t.x,y:t.y,width:t.w,height:t.h,rx:8,fill:`var(--wash)`,stroke:`var(--accent)`,strokeOpacity:.35,strokeDasharray:e.kind===`datastore`?void 0:`3 4`}),(0,M.jsx)(`text`,{x:t.x+ct,y:t.y+16,fontFamily:`Rajdhani, sans-serif`,fontWeight:700,fontSize:12,letterSpacing:`0.08em`,fill:`var(--flow-label)`,children:e.label})]},`group-${e.id}`):null}),(0,M.jsx)(`g`,{fill:`none`,children:s.edges.map(e=>(0,M.jsx)(`path`,{d:e.d,stroke:ae(e)?`var(--accent-soft)`:`var(--accent)`,strokeOpacity:c===void 0?.45:ae(e)?1:A?.06:.12,strokeWidth:(ae(e)?1.6:1)/Math.max(.5,Math.min(1,C.k)),strokeDasharray:e.async?`5 4`:void 0,markerEnd:`url(#flow-arrow)`,children:(0,M.jsx)(`title`,{children:`${oe(e.from)} → ${oe(e.to)}${e.label?`: ${e.label}`:``}`})},e.id))}),e.nodes.map(e=>{let t=s.nodes.get(e.id);if(!t)return null;let n=c===e.id;return(0,M.jsxs)(`g`,{"data-node":e.id,tabIndex:0,role:`button`,"aria-label":`${e.label} (${e.kind})`,"aria-pressed":n,className:`flow-node`,opacity:A&&!A.has(e.id)?.2:1,style:{cursor:`pointer`},onMouseEnter:()=>l(e.id),onFocus:()=>l(e.id),onClick:()=>{l(n?void 0:e.id),i?.(e.id)},children:[(0,M.jsx)(`rect`,{x:t.x,y:t.y,width:t.w,height:t.h,rx:e.kind===`table`?3:e.kind===`topic`?t.h/2:6,fill:n?`var(--picked-on)`:ie.has(e.id)?`var(--picked-strong)`:`var(--box)`,stroke:n||ie.has(e.id)?`var(--accent-soft)`:e.kind===`table`?`var(--flow-table)`:`var(--accent)`,strokeDasharray:e.kind===`topic`?`4 3`:void 0,strokeWidth:n?1.6:1}),(0,M.jsx)(`text`,{x:t.x+9,y:t.y+15,fontFamily:`JetBrains Mono, monospace`,fontSize:11,fill:n?`var(--text)`:`var(--accent-pale)`,children:nt(e.label,s.inside.get(e.id))})]},e.id)})]})]}),ue&&(0,M.jsx)(_t,{l:s,v:C,size:y,onCentre:e=>se(e,C.k)})]})}),(0,M.jsxs)(`p`,{className:`muted`,style:{fontSize:12,margin:0},"aria-live":`polite`,children:[c?et.edgePointAtAnother(oe(c),k.length,k.length===1?``:`s`,k.length?` (${tt([...new Set(k.map(e=>e.label).filter(Boolean))])})`:``,s.inside.get(c)?et.callsInsideIt(s.inside.get(c)??0):``):e.type===`context`&&e.nodes.length===1?et.everythingHereIsOne:et.edgesPointAtA(s.edges.length),f&&c?` ${E.viewer.focusOn(oe(c))}`:``]})]})}function _t(e){let t=160/Math.max(1,e.l.width),n=Math.max(40,Math.round(e.l.height*t)),r={x:-e.v.x/e.v.k,y:-e.v.y/e.v.k,w:e.size.width/e.v.k,h:e.size.height/e.v.k};return(0,M.jsx)(`div`,{className:`flow-minimap`,"aria-hidden":`true`,"data-node":`minimap`,onPointerDown:n=>{let r=n.currentTarget.getBoundingClientRect(),i=(n.clientX-r.left)/t,a=(n.clientY-r.top)/t;e.onCentre({x:i,y:a,w:0,h:0})},children:(0,M.jsxs)(`svg`,{width:160,height:n,children:[[...e.l.nodes.values()].map((e,n)=>(0,M.jsx)(`rect`,{x:e.x*t,y:e.y*t,width:Math.max(1,e.w*t),height:Math.max(1,e.h*t),fill:`var(--minimap-node)`},n)),(0,M.jsx)(`rect`,{x:r.x*t,y:r.y*t,width:r.w*t,height:r.h*t,fill:`none`,stroke:`var(--accent)`,strokeWidth:1.5})]})})}var vt=E.graph,yt=new Set([`event-bus`,`pubsub`,`mq`]),bt={System:`system`,Component:`component`,Table:`table`,Endpoint:`topic`};function xt(e,t=vt.map){let n=new Set(e.nodes.map(e=>e.system).filter(e=>!!e)),r=e.nodes.filter(e=>e.kind===`System`&&n.has(e.id)).map(e=>({id:e.id,label:e.label||e.id,kind:`system`})),i=new Set(r.map(e=>e.id)),a=e.nodes.filter(e=>!i.has(e.id)).map(e=>({id:e.id,label:e.label||e.id,kind:bt[e.kind]??`box`,...e.system&&i.has(e.system)?{group:e.system}:{}})),o=new Map;for(let t of e.edges){if(i.has(t.from)||i.has(t.to))continue;let e=`${t.from}\u0000${t.to}\u0000${t.via}`,n=o.get(e);n?n.n++:o.set(e,{id:t.id,from:t.from,to:t.to,via:t.via,n:1})}return{type:`context`,title:t,groups:r,nodes:a,edges:[...o.values()].map(e=>({id:e.id,from:e.from,to:e.to,label:e.n>1?`${e.n} × ${e.via}`:e.via,async:yt.has(e.via)}))}}function St({g:e,focus:t,highlight:n=[],onPick:r,height:i=430}){let a=(0,v.useMemo)(()=>xt(e),[e]);return(0,M.jsx)(gt,{view:a,height:i,...t?{selected:t}:{},highlight:n,...r?{onPick:r}:{}},t??``)}var I=E.know,Ct={verified:{bg:`var(--cov-verified)`,label:I.verifiedFromCode},"document-only":{bg:`var(--cov-doc)`,label:I.fromDocumentsOnly},unknown:{bg:`var(--cov-unknown)`,label:`unknown`}};function wt({system:e,link:t}){let n=A(`/api/guide/${encodeURIComponent(e)}`);return(0,M.jsx)(N,{title:I.guide(e),span:`1 / -1`,meta:t?(0,M.jsx)(`a`,{href:`#/systems?system=${encodeURIComponent(e)}`,children:E.systems.openPage}):I.generatedFromTheCatalog,children:(0,M.jsx)(P,{of:n,children:t=>(0,M.jsx)(`div`,{tabIndex:0,role:`region`,"aria-label":I.guideTo(e),style:{maxHeight:560,overflowY:`auto`,paddingRight:6},children:(0,M.jsx)(Te,{text:t.markdown})})})})}function Tt(e){let t=t=>e.facts.filter(e=>e.kind===t),n=new Set(t(`store`).map(e=>`${e.claim.store??``}.${e.claim.name??``}`));return{repo:e.repo,entries:t(`entry`).length,tables:n.size,calls:t(`call`).length,flows:t(`flow`).length}}function Et(e){let t=A(e?`/api/trust`:void 0),[n,r]=(0,v.useState)({state:`loading`}),i=t.state===`ready`?t.data.repos.filter(e=>e.facts.present).map(e=>e.repo).join(` `):void 0,a=t.state===`error`?t.error:void 0;return(0,v.useEffect)(()=>{if(a!==void 0)return r({state:`error`,error:a});if(i===void 0)return;let e=!0;return Promise.all(i.split(` `).filter(Boolean).map(e=>k(`/api/facts/${encodeURIComponent(e)}`))).then(t=>e&&r({state:`ready`,data:t.map(Tt)}),t=>e&&r({state:`error`,error:t instanceof Error?t.message:String(t)})),()=>{e=!1}},[i,a]),n}function Dt({of:e}){let t=I.factsByRepo;return(0,M.jsx)(P,{of:e,empty:e=>e.length===0,emptyText:t.none,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:[t.intro,` `,(0,M.jsx)(`a`,{href:`#/trust`,children:E.work.openTrust})]}),(0,M.jsx)(ke,{caption:t.caption,rows:e,rowKey:e=>e.repo,cols:[{label:t.repo,cell:e=>e.repo,mono:!0},{label:t.entries,cell:e=>e.entries},{label:t.tables,cell:e=>e.tables},{label:t.calls,cell:e=>e.calls},{label:t.flows,cell:e=>e.flows}]})]})})}function Ot(){let e=A(`/api/graph`),t=ve(`coverage`),n=ve(`questions`),r=A(`/api/catalog/kinds`),i=r.state===`ready`&&!r.data.some(e=>e.kind===`System`&&e.count>0),a=Et(i),[o,s]=(0,v.useState)();return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:o?I.around(o):I.ecosystemMap,kind:`hero`,span:`1 / -1`,meta:o?(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>s(void 0),children:I.showAll}):I.clickANodeTo,children:(0,M.jsx)(P,{of:e,empty:e=>e.nodes.length===0,emptyText:I.theCatalogIsEmpty,children:e=>(0,M.jsx)(St,{g:e,...o?{focus:o}:{},onPick:s,height:520})})}),(0,M.jsx)(N,{title:I.systems,span:`span 4`,rows:`span 2`,children:(0,M.jsx)(P,{of:t,empty:e=>e.systems.length===0,emptyText:I.noSystemsYet,children:e=>(0,M.jsx)(`div`,{className:`stack`,children:e.systems.map(e=>{let t=e.verified+e.documentOnly+e.unknown;return(0,M.jsxs)(`button`,{type:`button`,onClick:()=>s(e.system),className:`stack`,style:{gap:4,background:`transparent`,border:0,color:`inherit`,textAlign:`left`,font:`inherit`,cursor:`pointer`,padding:`6px 0`,borderBottom:`1px solid var(--rule)`},children:[(0,M.jsxs)(`span`,{className:`row between`,children:[(0,M.jsx)(`span`,{className:`mono`,style:{fontSize:12.5},children:e.system}),(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:I.verified(e.verified,t,e.gaps?I.gaps(e.gaps):``)})]}),(0,M.jsx)(ge,{value:e.verified,max:Math.max(t,1),label:I.factsVerifiedFromCode(e.system)})]},e.system)})})})}),o&&t.state===`ready`&&t.data.systems.some(e=>e.system===o)&&(0,M.jsx)(wt,{system:o,link:!0}),(0,M.jsx)(N,{title:I.whatTheCatalogKnows,span:`span 8`,children:i?(0,M.jsx)(Dt,{of:a}):(0,M.jsx)(P,{of:t,empty:e=>e.systems.length===0,emptyText:I.noSystemsYet,children:e=>{let t=[...new Set(e.systems.flatMap(e=>e.areas.map(e=>e.area)))];return(0,M.jsxs)(`div`,{style:{overflowX:`auto`,position:`relative`},tabIndex:0,role:`region`,"aria-label":E.app.scrollTable(I.coverageBySystemAnd2),children:[(0,M.jsxs)(`table`,{style:{borderCollapse:`separate`,borderSpacing:4,width:`100%`,fontSize:11},children:[(0,M.jsx)(`caption`,{className:`sr`,children:I.coverageBySystemAnd}),(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{}),t.map(e=>(0,M.jsx)(`th`,{className:`hud`,style:{fontSize:9.5,fontWeight:400,textAlign:`center`},children:e},e))]})}),(0,M.jsx)(`tbody`,{children:e.systems.map(e=>(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{className:`mono`,style:{textAlign:`left`,fontWeight:400,paddingRight:8},children:e.system}),t.map(t=>{let n=e.areas.find(e=>e.area===t);if(!n)return(0,M.jsx)(`td`,{title:I.notExpected2(e.system,t),children:(0,M.jsx)(`span`,{className:`sr`,children:I.notExpected})},t);let r=Ct[n.state]??Ct.unknown;return(0,M.jsxs)(`td`,{title:`${e.system} · ${n.area}: ${r.label}${n.records.length?` (${n.records.length})`:``}`,style:{background:r.bg,height:26,borderRadius:4,textAlign:`center`,border:`1px solid var(--cov-line)`},children:[(0,M.jsx)(`span`,{className:`sr`,children:r.label}),n.records.length?(0,M.jsx)(`span`,{"aria-hidden":`true`,children:n.records.length}):null]},n.area)})]},e.system))})]}),(0,M.jsx)(`div`,{className:`row`,style:{gap:14,marginTop:8,flexWrap:`wrap`},children:Object.entries(Ct).map(([e,t])=>(0,M.jsxs)(`span`,{className:`row`,style:{gap:6,fontSize:11.5},children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,style:{width:12,height:12,borderRadius:3,background:t.bg,display:`inline-block`}}),t.label]},e))})]})}})}),(0,M.jsx)(N,{title:I.questionsForOwners,span:`span 4`,meta:n.state===`ready`?n.data.questions.length:void 0,children:(0,M.jsx)(P,{of:n,empty:e=>e.questions.length===0,emptyText:I.noOpenQuestionsEvery,children:e=>(0,M.jsx)(`ul`,{tabIndex:0,"aria-label":I.questionsForOwners,style:{listStyle:`none`,margin:0,padding:0,maxHeight:300,overflowY:`auto`},className:`stack`,children:e.questions.slice(0,12).map(e=>(0,M.jsxs)(`li`,{className:`stack`,style:{gap:2,paddingBottom:6,borderBottom:`1px solid var(--rule)`},children:[(0,M.jsx)(`span`,{style:{fontSize:12.5},children:e.question}),(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[e.system??``,e.owner?I.ask(e.owner):I.ownerUnknown]})]},e.id))})})})]})}function kt(e){let t=new Map,n=new Map(e.affected.map(e=>[e.id,e.kind])),r=new Map;t.set(e.root,{id:e.root,kind:`Component`,label:e.root,status:`current`});for(let i of e.affected){t.set(i.id,{id:i.id,kind:i.kind,label:i.id,status:`current`});for(let e=1;e<i.path.length;e++){let a=i.path[e-1],o=i.path[e];t.has(a)||t.set(a,{id:a,kind:n.get(a)??I.component,label:a,status:`current`}),r.set(`${a}>${o}`,{id:`${a}>${o}`,from:a,to:o,via:``,confidence:`verified`,status:`current`})}}return{nodes:[...t.values()],edges:[...r.values()]}}function At({hash:e}){let t=ye(e,`q`)??``,[n,r]=(0,v.useState)(t),i=ye(e,`incident`)===`1`,a=A(t?`/api/impact/${encodeURIComponent(t)}?depth=4`:void 0),o=A(t&&i?`/api/incident/${encodeURIComponent(t)}`:void 0),[s,c]=(0,v.useState)(!1),l=e=>{e.preventDefault(),n.trim()?(c(!1),location.hash=`#/impact?q=${encodeURIComponent(n.trim())}${i?`&incident=1`:``}`):c(!0)},u=new Map;if(a.state===`ready`)for(let e of a.data.affected)u.set(e.path.length-1,(u.get(e.path.length-1)??0)+1);let d=a.state===`ready`?kt(a.data):void 0;return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsxs)(N,{title:I.whatBreaksIfThis,span:`1 / -1`,children:[(0,M.jsxs)(`form`,{onSubmit:l,className:`row`,style:{flexWrap:`wrap`},children:[(0,M.jsx)(`label`,{htmlFor:`impact-id`,className:`sr`,children:I.recordId}),(0,M.jsx)(`input`,{id:`impact-id`,value:n,onChange:e=>{r(e.target.value),c(!1)},"aria-describedby":s?`impact-blank`:void 0,placeholder:I.aComponentInterfaceTable,style:{flex:`1 1 360px`,height:40,background:`var(--box)`,color:`var(--text)`,border:`1px solid var(--accent)`,borderRadius:10,padding:`0 12px`,font:`inherit`}}),(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,children:I.showImpact}),(0,M.jsx)(`button`,{type:`button`,className:`btn ${i?`danger`:``}`,"aria-pressed":i,onClick:()=>location.hash=`#/impact?q=${encodeURIComponent(n.trim())}${i?``:`&incident=1`}`,children:i?I.incidentModeOn:I.incidentMode}),(0,M.jsx)(`a`,{href:`#/explore`,className:`muted`,style:{fontSize:12},children:I.findAnIdIn})]}),s&&(0,M.jsx)(`p`,{id:`impact-blank`,role:`alert`,className:`run-note bad`,children:E.app.needId})]}),t&&i&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(N,{title:I.ownersToCall,span:`span 4`,kind:`dark`,children:(0,M.jsx)(P,{of:o,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[e.call.map(e=>(0,M.jsxs)(`div`,{className:`list-row`,children:[(0,M.jsx)(`span`,{className:`chip blocking`,children:e.owner}),(0,M.jsx)(`span`,{className:`mono`,style:{fontSize:11.5},children:e.systems.join(`, `)})]},e.owner)),e.ownerUnknown.length>0&&(0,M.jsx)(`p`,{style:{margin:0,fontSize:12.5,color:`var(--amber-text)`},children:I.noOwnerRecordedFor(e.ownerUnknown.join(`, `))}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:11.5},children:I.fromTheLastScan})]})})}),(0,M.jsx)(N,{title:I.whatWatchesIt,span:`span 4`,children:(0,M.jsx)(P,{of:o,empty:e=>e.watch.length===0,emptyText:I.noAlertsDashboardsOr,children:e=>(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18,fontSize:12.5,lineHeight:1.6},children:e.watch.map((e,t)=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{className:`chip dim`,children:e.kind}),` `,e.name,` `,(0,M.jsxs)(`span`,{className:`mono muted`,children:[`(`,e.component,`)`]})]},t))})})}),(0,M.jsx)(N,{title:I.recentNearbyChanges,span:`span 4`,children:(0,M.jsx)(P,{of:o,empty:e=>e.recentChanges.length===0,emptyText:I.noChangeTouchesWhat,children:e=>(0,M.jsx)(`div`,{className:`stack`,style:{gap:6},children:e.recentChanges.map(e=>(0,M.jsxs)(`a`,{href:`#/changes/${encodeURIComponent(e.id)}`,className:`list-row`,style:{textDecoration:`none`,color:`inherit`},children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{style:{fontSize:12.5},children:e.title}),(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[e.id,` · `,e.updatedAt.slice(0,10),` · `,e.systems.join(`, `)]})]}),(0,M.jsx)(`span`,{className:`chip`,children:e.state.toUpperCase()})]},e.id))})})})]}),t?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(N,{title:I.blastRadiusOf(t),kind:`hero`,span:`1 / -1`,children:(0,M.jsx)(P,{of:a,empty:e=>e.affected.length===0,emptyText:I.nothingDependsOnIt,children:()=>(0,M.jsx)(St,{g:d,focus:t,height:380})})}),(0,M.jsx)(N,{title:I.blastRadius,span:`1 / -1`,kind:`dark`,children:(0,M.jsx)(P,{of:a,children:e=>(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`span`,{className:`big`,children:e.affected.length}),(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:I.recordsAffectedBy(e.root)}),[...u.entries()].sort((e,t)=>e[0]-t[0]).map(([e,t])=>(0,M.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`span`,{className:`hud`,style:{width:56,fontSize:10},children:I.hop(e,e===1?``:`s`)}),(0,M.jsx)(`div`,{style:{flex:1},children:(0,M.jsx)(ge,{value:t,max:Math.max(...u.values()),label:I.recordsHopsAway(t,e)})}),(0,M.jsx)(`span`,{className:`n`,children:t})]},e))]})})}),(0,M.jsx)(N,{title:I.affected,span:`span 8`,children:(0,M.jsx)(P,{of:a,empty:e=>e.affected.length===0,emptyText:I.nothingDependsOnIt2,children:e=>(0,M.jsx)(ke,{caption:I.affectedRecords,rows:e.affected,rowKey:e=>`${e.kind}/${e.id}`,cols:[{label:I.record,cell:e=>e.id,mono:!0},{label:I.kind,cell:e=>(0,M.jsx)(`span`,{className:`chip dim`,children:e.kind})},{label:I.why,cell:e=>e.reason},{label:I.owner,cell:e=>e.owner?(0,M.jsx)(`span`,{className:`chip dim`,style:{whiteSpace:`nowrap`},children:e.owner}):(0,M.jsx)(`span`,{className:`chip warn`,children:I.unknown})}]})})}),(0,M.jsxs)(N,{title:I.whatWouldSharpenThis,span:`span 4`,children:[(0,M.jsx)(P,{of:a,empty:e=>e.gaps.length===0,emptyText:I.noGapsTheCatalog,children:e=>(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18,lineHeight:1.6},children:e.gaps.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{className:`mono`,children:e.record}),`: `,e.question]},`${e.record}/${e.field}`))})}),(0,M.jsx)(`p`,{className:`muted`,style:{fontSize:11.5,margin:`10px 0 0`},children:I.readOnlyAtticusNever})]})]}):null]})}function jt({records:e}){let t=A(`/api/graph`),n=new Set(e.flatMap(e=>[e,e.split(`.`)[0]]));return(0,M.jsx)(P,{of:t,empty:e=>e.nodes.length===0,emptyText:``,children:e=>(0,M.jsx)(`div`,{style:{border:`1px solid var(--line)`,borderRadius:10,background:`var(--inset)`},children:(0,M.jsx)(St,{g:e,highlight:e.nodes.filter(e=>n.has(e.id)).map(e=>e.id),height:300})})})}function Mt({hash:e}){let t=ve(`features`),n=ye(e,`id`)??(t.state===`ready`?t.data.features[0]?.id:void 0),r=ve(`features`,n,!n);return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:I.featuresFoundInCode,span:`span 4`,rows:`span 2`,meta:t.state===`ready`?t.data.features.length:void 0,children:(0,M.jsx)(P,{of:t,empty:e=>e.features.length===0,emptyText:I.noFeaturesFoundYet,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,M.jsx)(F,{title:I.featuresByHowThey,parts:[{label:I.confirmedByPeople,value:e.coverage.confirmed.length,color:`var(--green)`},{label:I.foundInCodeOnly,value:e.coverage.detectedOnly.length,color:`var(--accent)`},{label:I.unknown2,value:e.coverage.unknown.length,color:`var(--amber)`}]}),(0,M.jsx)(`nav`,{"aria-label":I.features,className:`stack`,style:{gap:2},children:e.features.map(e=>(0,M.jsxs)(`a`,{href:`#/features?id=${encodeURIComponent(e.id)}`,"aria-current":e.id===n?`page`:void 0,className:`list-row`,style:{textDecoration:`none`,padding:`7px 6px`,borderRadius:6,background:e.id===n?`var(--picked)`:void 0},children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{children:e.name??e.id}),(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:I.entryPoints(e.entryPoints.length)})]}),(0,M.jsx)(`span`,{className:`chip ${e.namedBy===`detected`?``:e.namedBy===`ai`?`ai`:`done`}`,children:e.namedBy.toUpperCase()})]},e.id))})]})})}),(0,M.jsx)(N,{title:r.state===`ready`?r.data.feature.name??r.data.feature.id:I.feature,span:`span 8`,rows:`span 2`,meta:r.state===`ready`?r.data.system:void 0,children:n?(0,M.jsx)(P,{of:r,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:14},children:[(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[(0,M.jsx)(`span`,{className:`chip`,children:e.feature.confidence.toUpperCase()}),e.feature.tags.map(e=>(0,M.jsx)(`span`,{className:`chip dim`,children:e},e)),e.feature.externalRefs.length===0?(0,M.jsx)(`span`,{className:`chip warn`,children:I.noWorkItemsLinked}):e.feature.externalRefs.map((e,t)=>(0,M.jsxs)(`span`,{className:`chip done`,children:[e.system??I.item,` `,e.id??``]},t))]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`hud`,style:{fontSize:10,marginBottom:6},children:I.entryPoints2}),(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18,lineHeight:1.7},className:`mono`,children:e.feature.entryPoints.map(e=>(0,M.jsx)(`li`,{children:e},e))})]}),(0,M.jsx)(jt,{records:[...e.feature.records,...e.feature.entryPoints]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`hud`,style:{fontSize:10,marginBottom:6},children:I.recordsInTheFlow(e.feature.records.length)}),(0,M.jsx)(`p`,{className:`mono`,style:{margin:0,fontSize:11.5,lineHeight:1.7,color:`var(--text-2)`},children:e.feature.records.join(` · `)})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`hud`,style:{fontSize:10,marginBottom:6},children:I.knowledgeGaps}),e.looseEnds.length===0?(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:I.noneEveryHopIs}):(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18,lineHeight:1.6},children:e.looseEnds.map((e,t)=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{className:`chip warn`,children:e.kind}),` `,e.text]},t))})]}),(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:[I.nameTagOrLink,(0,M.jsx)(`span`,{className:`mono`,children:I.atticusFeatureName(e.feature.id)}),`,`,` `,(0,M.jsx)(`span`,{className:`mono`,children:I.featureTag}),` `,I.or,(0,M.jsx)(`span`,{className:`mono`,children:I.featureLink}),I.theChangeGoesIn]})]})}):(0,M.jsx)(`p`,{className:`muted`,children:I.pickAFeature})})]})}function Nt(){let e=A(`/api/orgpack`),t=ve(`glossary`);return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:I.orgPack,span:`span 4`,kind:`dark`,children:(0,M.jsx)(P,{of:e,children:e=>(0,M.jsxs)(`div`,{className:`stack`,children:[Object.entries(e.counts).map(([e,t])=>(0,M.jsxs)(`div`,{className:`list-row`,children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:e}),(0,M.jsx)(`span`,{className:`n`,style:{fontSize:16},children:t})]},e)),e.problems.length?(0,M.jsx)(`p`,{role:`alert`,style:{color:`var(--magenta-text)`,margin:0},children:I.problems(e.problems.length,e.problems.map(e=>`${e.file}: ${e.message}`).join(`; `))}):(0,M.jsx)(`span`,{className:`chip done`,style:{width:`fit-content`},children:I.valid}),e.defaulted.length>0&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:I.usingBuiltInDefaults(e.defaulted.join(`, `))})]})})}),(0,M.jsx)(N,{title:I.integrationPatterns,span:`span 8`,children:(0,M.jsx)(P,{of:e,empty:e=>!e.patterns?.length,emptyText:I.noPatternsYet,children:e=>(0,M.jsx)(ke,{caption:I.integrationPatterns,rows:e.patterns??[],rowKey:e=>e.code,cols:[{label:I.code,cell:e=>(0,M.jsx)(`span`,{className:`chip`,children:e.code}),width:`130px`},{label:I.pattern,cell:e=>(0,M.jsx)(`span`,{title:e.definition,children:e.name})},{label:I.interaction,cell:e=>e.interaction},{label:I.route,cell:e=>e.route},{label:I.target,cell:e=>e.targetType}]})})}),(0,M.jsx)(N,{title:I.checklistsAndProcedures,span:`span 4`,children:(0,M.jsx)(P,{of:e,children:e=>(0,M.jsxs)(`div`,{className:`stack`,children:[(e.checklists??[]).map(e=>(0,M.jsxs)(`div`,{className:`list-row`,children:[(0,M.jsx)(`span`,{children:e.name}),(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:I.rulesV(e.rules,e.version)})]},e.name)),(e.procedures??[]).map(e=>(0,M.jsxs)(`div`,{className:`list-row`,children:[(0,M.jsx)(`span`,{children:e.title??e.id}),(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:I.steps(e.steps)})]},e.id))]})})}),(0,M.jsx)(N,{title:I.glossary,span:`span 8`,children:(0,M.jsx)(P,{of:t,empty:e=>e.terms.length===0,emptyText:I.noTermsYet,children:e=>(0,M.jsx)(ke,{caption:I.glossary,rows:e.terms,rowKey:e=>e.id,cols:[{label:I.term,cell:e=>e.term,width:`180px`},{label:I.definition,cell:e=>e.definition??(0,M.jsx)(`span`,{className:`chip warn`,children:I.needsADefinition})}]})})})]})}function Pt(e){let t=De();return e.options.length===0?null:(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:e.options.map((n,r)=>(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:t.busy,onClick:()=>void t.run(()=>k(`/api/triage/${encodeURIComponent(e.item)}/decide`,{method:`POST`,body:{option:r+1}}).then(()=>e.done(`Decided: ${n.label}.`)),`Decided: ${n.label}.`),children:n.label},r))}),(0,M.jsx)(Oe,{note:t.note?.ok&&!t.note.working?void 0:t.note})]})}var Ft={read:`var(--green)`,"needs-reading":`var(--accent)`,"no-reader":`var(--violet)`,unresolved:`var(--amber)`,duplicate:`var(--gone)`,superseded:`var(--gone)`,failed:`var(--magenta)`};function It(){let e=ve(`intake`),t=ve(`triage`),[n,r]=(0,v.useState)(),i=e.state===`ready`?e.data.documents:[],a=[...new Set(i.map(e=>e.status))],o=i.reduce((e,t)=>e+t.records.length,0);return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:I.files,span:`span 3`,kind:`dark`,children:(0,M.jsx)(P,{of:e,children:()=>(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`span`,{className:`big`,children:i.length}),(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:I.filesInInputs})]})})}),(0,M.jsx)(N,{title:I.factsTaken,span:`span 2`,kind:`dark`,children:(0,M.jsx)(`span`,{className:`big`,children:o})}),(0,M.jsx)(N,{title:I.whatHappenedToThem,span:`span 3`,children:(0,M.jsx)(P,{of:e,empty:()=>i.length===0,emptyText:I.nothingYet,children:()=>(0,M.jsx)(F,{title:I.filesByStatus,parts:a.map(e=>({label:e,value:i.filter(t=>t.status===e).length,color:Ft[e]??`var(--accent-pale)`}))})})}),(0,M.jsx)(N,{title:I.defences,span:`span 4`,children:(0,M.jsx)(P,{of:e,children:()=>{let e=i.filter(e=>e.defences&&e.defences.risk!==`cleared`);return e.length===0?(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:I.nothingHiddenOrAimed}):(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18,fontSize:12.5},children:e.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{className:`mono`,children:e.path}),`: `,e.defences.reason]},e.path))})}})}),(0,M.jsx)(N,{title:I.intake,span:`span 8`,meta:I.inputs,children:(0,M.jsx)(P,{of:e,empty:e=>e.documents.length===0,emptyText:I.nothingInInputsYet,children:e=>(0,M.jsx)(ke,{caption:I.filesReadFromInputs,rows:e.documents,rowKey:e=>e.path,cols:[{label:I.file,cell:e=>e.path,mono:!0},{label:I.readAs,cell:e=>e.classification},{label:I.about,cell:e=>Ae(e.systems)||(0,M.jsx)(`span`,{className:`muted`,children:I.noSystemNamed})},{label:I.facts,cell:e=>e.records.length},{label:I.status,cell:e=>e.defences?.risk===`high`?(0,M.jsx)(`span`,{className:`chip blocking`,title:e.defences.reason,children:I.quarantined}):(0,M.jsx)(`span`,{className:`chip ${e.status===`read`?`done`:e.status===`failed`||e.status===`unresolved`?`warn`:`dim`}`,children:e.status.toUpperCase()})}]})})}),(0,M.jsx)(N,{title:I.needsYou,span:`span 4`,meta:t.state===`ready`?t.data.items.length:void 0,children:(0,M.jsx)(P,{of:t,empty:e=>e.items.length===0,emptyText:I.nothingToTriage,children:e=>(0,M.jsxs)(`div`,{className:`stack`,children:[n&&(0,M.jsx)(Oe,{note:{ok:!0,text:n}}),e.items.map(e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4,padding:`6px 0`,borderBottom:`1px solid var(--rule)`},children:[(0,M.jsxs)(`span`,{className:`row between`,style:{alignItems:`flex-start`},children:[(0,M.jsx)(`span`,{style:{fontSize:12.5},children:e.summary}),(0,M.jsx)(`span`,{className:`chip ${e.kind===`defences`?`blocking`:`warn`}`,children:e.kind.toUpperCase()})]}),(0,M.jsxs)(`span`,{className:`mono muted`,style:{fontSize:11},children:[e.id,` · `,e.source.path,e.source.line?`:${e.source.line}`:``]}),(0,M.jsx)(Pt,{item:e.id,options:e.options,done:e=>{r(e),t.reload()}})]},e.id)),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:I.eachChoiceIsSaved})]})})})]})}function Lt(){let e=A(`/api/repos`),t=A(`/api/catalog/kinds`),[n,r]=(0,v.useState)(),i=De();j(i=>{n&&i.jobId===n.id&&(i.type===`job.progress`&&r({...n,progress:{done:Number(i.done),total:Number(i.total),message:String(i.message)}}),i.type===`job.done`&&(k(`/api/jobs/${n.id}`).then(r),e.reload(),t.reload()))});let[a,o]=(0,v.useState)(!1),s=(e,t)=>i.run(async()=>{o(!1);let t=await k(e,{method:`POST`,body:{}});r(await k(`/api/jobs/${t.jobId}`))},`${t} started.`),c=e=>{o(!0),k(`/api/jobs/${e}/cancel`,{method:`POST`,body:{}}).catch(()=>void 0)},l=e.state===`ready`?e.data.filter(e=>e.baseClone.present).length:0,u=e.state===`ready`?e.data.length:0;return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:I.scan,span:`span 4`,kind:`dark`,children:(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsxs)(`div`,{className:`row`,children:[(0,M.jsx)(he,{value:l,max:Math.max(u,1),size:64,label:I.ofReposCloned(l,u)}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12.5},children:I.reposClonedLocally})]}),(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:[(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:i.busy,onClick:()=>void s(`/api/workspace/sync`,I.sync),children:I.syncRepos}),(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:i.busy,onClick:()=>void s(`/api/scan`,I.scan2),children:I.scanNow})]}),n&&(0,M.jsxs)(`div`,{className:`stack`,role:`status`,"aria-live":`polite`,children:[(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[I.jobState[n.state]??n.state,n.state===`running`?` · ${n.progress.message}`:``]}),(0,M.jsx)(ge,{value:n.progress.done,max:Math.max(n.progress.total,1),label:I.jobProgress}),n.state===`running`&&(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,alignItems:`center`},children:[(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:a,"aria-describedby":`scan-cancel-hint`,onClick:()=>c(n.id),children:a?I.cancelling:I.cancelJob}),(0,M.jsx)(`span`,{id:`scan-cancel-hint`,className:`muted`,style:{fontSize:12},children:I.cancelJobHint})]}),n.errors.length>0&&(0,M.jsx)(`ul`,{"aria-label":I.jobProblems,style:{margin:0,paddingLeft:18,color:`var(--magenta-text)`},children:n.errors.map((e,t)=>(0,M.jsx)(`li`,{children:e},`${t}:${e}`))})]}),(0,M.jsx)(Oe,{note:i.note}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:11.5},children:I.scansReadFilesOnly})]})}),(0,M.jsx)(N,{title:I.repos,span:`span 8`,children:(0,M.jsx)(P,{of:e,empty:e=>e.length===0,emptyText:I.noReposInAny,children:e=>(0,M.jsx)(ke,{caption:I.repos,rows:e,rowKey:e=>e.id,cols:[{label:I.repo,cell:e=>e.id,mono:!0},{label:I.platform,cell:e=>e.platform},{label:I.type,cell:e=>e.type??``},{label:I.baseClone,cell:e=>(0,M.jsx)(`span`,{className:`chip ${e.baseClone.present?`done`:`dim`}`,children:e.baseClone.present?I.cloned:I.notYet})}]})})}),(0,M.jsx)(N,{title:I.catalog,span:`1 / -1`,children:(0,M.jsx)(P,{of:t,empty:e=>e.length===0,emptyText:I.noFactsYet,children:e=>(0,M.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(150px, 1fr))`,gap:10},children:e.map(e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:e.kind}),(0,M.jsx)(`span`,{className:`n`,style:{fontSize:20},children:e.count})]},e.kind))})})})]})}var Rt=E.systems;function zt(e,t){let n=new Set(e.repos??[]);return t.filter(e=>![`released`,`archived`].includes(e.state)).filter(e=>e.repos.some(e=>n.has(e))).sort((e,t)=>e.title.localeCompare(t.title))}var Bt=e=>`#/systems?system=${encodeURIComponent(e)}`;function Vt(e){return(0,M.jsx)(`nav`,{"aria-label":Rt.pick,children:(0,M.jsx)(`ul`,{className:`row`,style:{gap:6,flexWrap:`wrap`,listStyle:`none`,padding:0,margin:0},children:e.systems.map(t=>(0,M.jsx)(`li`,{children:(0,M.jsx)(`a`,{className:`chip`,href:Bt(t.id),"aria-current":t.id===e.current?`page`:void 0,children:t.name??t.id})},t.id))})})}function Ht({hash:e}){let t=A(`/api/catalog/System?limit=500`),n=A(`/api/changes`),r=ve(`questions`);ce(t,n,r);let i=ye(e,`system`),a=t.state===`ready`?t.data.items:[],o=i??a[0]?.id,s=a.find(e=>e.id===o),c=r.state===`ready`?(r.data.questions??[]).filter(e=>e.system===o):[];return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsxs)(N,{title:Rt.title,span:`1 / -1`,children:[(0,M.jsx)(P,{of:t,empty:e=>e.items.length===0,emptyText:Rt.empty,children:()=>(0,M.jsx)(Vt,{systems:a,current:o})}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`},children:(0,M.jsx)(`a`,{href:`#/outside`,children:Rt.outside})})]}),o&&(0,M.jsx)(wt,{system:o}),s&&(0,M.jsx)(N,{title:Rt.inFlight,span:`span 6`,children:n.state===`ready`?zt(s,n.data).length===0?(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:Rt.noChanges}):(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:zt(s,n.data).map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`a`,{href:`#/cockpit?change=${encodeURIComponent(e.id)}`,children:e.title}),(0,M.jsx)(`span`,{className:`muted`,children:` · ${e.state}`})]},e.id))}):(0,M.jsx)(P,{of:n,children:()=>null})}),s&&(0,M.jsx)(N,{title:Rt.questions,span:`span 6`,children:c.length===0?(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:Rt.noQuestions}):(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:c.map(e=>(0,M.jsx)(`li`,{children:e.question},e.id))})})]})}var Ut=E.runShared;function Wt(e){return e instanceof D?e.problem.detail??e.problem.title:e instanceof Error?e.message:String(e)}function Gt(e,t){return e.replace(/Re-run with --force to [^.]*\./,t)}var Kt=e=>t=>{throw Error(Gt(Wt(t),e))};function qt(){let[e,t]=(0,v.useState)(!1),[n,r]=(0,v.useState)();return{busy:e,note:n,run:async(e,n)=>{t(!0),r({ok:!0,text:E.app.working,working:!0});try{let t=await e();r({ok:!0,text:typeof n==`string`?n:n(t)})}catch(e){r({ok:!1,text:Wt(e)})}finally{t(!1)}},clear:()=>r(void 0)}}function Jt({note:e}){return e?(0,M.jsx)(`p`,{role:e.ok?`status`:`alert`,"aria-busy":e.working?!0:void 0,className:`run-note ${e.working?`working`:e.ok?`ok`:`bad`}`,children:e.text}):null}function Yt({text:e,label:t}){let[n,r]=(0,v.useState)();return(0,M.jsx)(`button`,{type:`button`,className:`btn run-copy`,"aria-label":t,onClick:()=>{navigator.clipboard?navigator.clipboard.writeText(e).then(()=>r(`copied`),()=>r(`failed`)):r(`failed`),setTimeout(()=>r(void 0),2e3)},children:n===`copied`?Ut.copied:n===`failed`?Ut.selectAndCopy:Ut.copy})}function Xt({rows:e}){return(0,M.jsx)(`dl`,{className:`run-facts`,children:e.map(([e,t])=>(0,M.jsxs)(`div`,{style:{display:`contents`},children:[(0,M.jsx)(`dt`,{className:`hud`,children:e}),(0,M.jsx)(`dd`,{children:t})]},e))})}function Zt(e){return(0,M.jsx)(`div`,{role:`group`,"aria-label":e.label,className:`row run-choice`,children:e.options.map(t=>(0,M.jsx)(`button`,{type:`button`,className:`btn ${e.value===t.value?`on`:``}`,"aria-pressed":e.value===t.value,onClick:()=>e.onChange(t.value),children:t.label},t.value))})}function Qt({type:e}){return e?e===`manual`?(0,M.jsx)(`span`,{className:`chip warn`,children:Ut.manual}):e===`mock`?(0,M.jsx)(`span`,{className:`chip dim`,children:Ut.mock}):(0,M.jsx)(`span`,{className:`chip done`,children:Ut.connected(e.toUpperCase())}):(0,M.jsx)(`span`,{className:`chip dim`,children:Ut.notSet})}var $t={"work-tracker":Ut.workTracker,"service-desk":Ut.serviceDesk,"git-host":Ut.gitHost,wiki:Ut.wiki,notify:Ut.notifications,design:Ut.designTool},en=e=>e?e.slice(0,10):``,tn=(e,t)=>`${e} ${t}${e===1?``:`s`}`,nn=E.runStep,rn=new Set([`scan survey`,`scan verify`,`spec draft`,`knowledge scan`,`change feature`,`change architecture`,`change draft`,`plan stories`,`change needs`,`knowledge find`,`knowledge ask`]);function an(e){let t=[],n=/"((?:[^"\\]|\\.)*)"|'([^']*)'|(\S+)/g,r;for(;r=n.exec(e);)if(r[1]!==void 0)t.push(r[1].replace(/\\(.)/g,`$1`));else if(r[2]!==void 0)t.push(r[2]);else if(/["']/.test(r[3]))return;else t.push(r[3]);return t}function on(e){let t=an(e.trim());if(!t||t[0]!==`atticus`||t.length<3)return;let n=t.slice(1);if((n[0]===`critic`&&n[1]!==`stats`||rn.has(`${n[0]} ${n[1]}`))&&!n.some(e=>e.startsWith(`-`)||/[<>]/.test(e)||e.trim()===``))return n}function sn(e){return e.panel?{kind:`copilot`}:typeof e.serverModel==`string`&&e.serverModel?{kind:`model`,model:e.serverModel}:{kind:`copy`}}var cn;function ln(e){let[t,n]=(0,v.useState)(void 0);return(0,v.useEffect)(()=>{if(!e)return;let t=!0;return cn??=k(`/api/runs?limit=1`).then(e=>e.serverModel??null,()=>(cn=void 0,null)),cn.then(e=>{t&&n(e)}),()=>{t=!1}},[e]),t}var un=new Set([`done`,`failed`,`cancelled`]);async function dn(e,t){let n=await t.call(`/api/runs`,{method:`POST`,body:{args:e}});t.onJob?.(n.jobId),t.onLine(nn.started(n.model));let r=``;for(;;){let e=await t.call(`/api/jobs/${encodeURIComponent(n.jobId)}`),i=e.progress?.message??``;if(i&&i!==r&&t.onLine(i),r=i,un.has(e.state)){let n=e.result??{},r=Array.isArray(n.lines)?n.lines.filter(e=>typeof e==`string`):e.errors,i=e.state===`done`?n.code===0||n.code===void 0?`done`:`stopped`:e.state,a=typeof n.runId==`string`?n.runId:await t.call(`/api/runs?limit=1`).then(t=>t.runs.find(t=>t.startedAt>=e.startedAt)?.runId).catch(()=>void 0);return{state:i,lines:r,...a?{runId:a}:{}}}await t.wait(700)}}var fn=e=>e instanceof D?e.problem.detail??e.problem.title:e instanceof Error?e.message:String(e),pn=new Set([`refused`,`not-started`]);function mn(e){return pn.has(e.state)?nn.refused(e.lines[0]??e.state):nn.ends[e.state]??nn.ended(e.state)}function hn(e){let t=(0,v.useId)();if(e.choice.kind===`copy`)return null;let n=e.choice.kind===`copilot`?nn.withCopilot:nn.withModel(e.choice.model),r=e.choice.kind===`copilot`?nn.hintCopilot:nn.hintModel(e.choice.model),i=e.state.phase===`running`,a=e.state;return(0,M.jsxs)(`div`,{className:`runstep stack`,children:[(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`center`},children:[(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:i,"aria-describedby":`${t}-why`,onClick:e.onRun,children:i?nn.running:n}),i&&e.onCancel&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.stopping,title:nn.cancelHint,onClick:e.onCancel,children:e.stopping?nn.cancelling:nn.cancel}),(0,M.jsx)(`span`,{id:`${t}-why`,className:`muted`,style:{fontSize:12},children:i?nn.busy:r})]}),(0,M.jsxs)(`div`,{"aria-live":`polite`,className:`runstep-live`,children:[a.lines.length>0&&(0,M.jsx)(`ul`,{className:`runstep-lines mono`,"aria-label":nn.progress,children:a.lines.map((e,t)=>(0,M.jsx)(`li`,{children:e},`${t}:${e}`))}),a.phase===`ended`&&(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`p`,{className:`runstep-end`,children:mn(a.end)}),!pn.has(a.end.state)&&a.end.lines.length>0&&(0,M.jsx)(`pre`,{className:`runstep-out`,tabIndex:0,role:`region`,"aria-label":nn.output,children:a.end.lines.join(`
|
|
12
|
+
`)}),!pn.has(a.end.state)&&(0,M.jsx)(`a`,{href:a.end.runId?`#/runs?run=${encodeURIComponent(a.end.runId)}`:`#/runs`,children:a.end.runId?nn.openRun:nn.openRuns})]})]}),a.phase===`error`&&(0,M.jsx)(`p`,{role:`alert`,className:`run-note bad`,children:nn.cantStart(a.error)})]})}function gn({command:e}){let t=on(e),n=T(),r=ln(!!t&&!n),[i,a]=(0,v.useState)({phase:`idle`,lines:[]}),[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(!1),u=(0,v.useRef)(!0);if((0,v.useEffect)(()=>(u.current=!0,()=>{u.current=!1}),[]),!t)return null;let d=sn({panel:!!n,serverModel:r}),f=e=>{u.current&&a(t=>({phase:`running`,lines:[...t.lines,e]}))},p=()=>{a({phase:`running`,lines:[]}),s(void 0),l(!1),(n?n.runStep(t,f):dn(t,{call:(e,t)=>k(e,t??{}),wait:e=>new Promise(t=>setTimeout(t,e)),onLine:f,onJob:e=>{u.current&&s(e)}})).then(e=>{u.current&&a(t=>({phase:`ended`,lines:t.lines,end:e}))},e=>{u.current&&a(t=>({phase:`error`,lines:t.lines,error:fn(e)}))})},m=o?()=>{l(!0),k(`/api/jobs/${encodeURIComponent(o)}/cancel`,{method:`POST`,body:{}}).catch(()=>void 0)}:void 0;return(0,M.jsx)(hn,{choice:d,state:i,onRun:p,...m?{onCancel:m}:{},stopping:c})}function _n(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=_n(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var vn={value:()=>{}};function yn(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new bn(n)}function bn(e){this._=e}function xn(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}bn.prototype=yn.prototype={constructor:bn,on:function(e,t){var n=this._,r=xn(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Sn(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Cn(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Cn(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new bn(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Sn(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Cn(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=vn,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var wn={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Tn(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),wn.hasOwnProperty(t)?{space:wn[t],local:e}:e}function En(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Dn(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function On(e){var t=Tn(e);return(t.local?Dn:En)(t)}function kn(){}function An(e){return e==null?kn:function(){return this.querySelector(e)}}function jn(e){typeof e!=`function`&&(e=An(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new yi(r,this._parents)}function Mn(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Nn(){return[]}function Pn(e){return e==null?Nn:function(){return this.querySelectorAll(e)}}function Fn(e){return function(){return Mn(e.apply(this,arguments))}}function In(e){e=typeof e==`function`?Fn(e):Pn(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new yi(r,i)}function Ln(e){return function(){return this.matches(e)}}function Rn(e){return function(t){return t.matches(e)}}var zn=Array.prototype.find;function Bn(e){return function(){return zn.call(this.children,e)}}function Vn(){return this.firstElementChild}function Hn(e){return this.select(e==null?Vn:Bn(typeof e==`function`?e:Rn(e)))}var Un=Array.prototype.filter;function Wn(){return Array.from(this.children)}function Gn(e){return function(){return Un.call(this.children,e)}}function Kn(e){return this.selectAll(e==null?Wn:Gn(typeof e==`function`?e:Rn(e)))}function qn(e){typeof e!=`function`&&(e=Ln(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new yi(r,this._parents)}function Jn(e){return Array(e.length)}function Yn(){return new yi(this._enter||this._groups.map(Jn),this._parents)}function Xn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Xn.prototype={constructor:Xn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Zn(e){return function(){return e}}function Qn(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new Xn(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function $n(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new Xn(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function er(e){return e.__data__}function tr(e,t){if(!arguments.length)return Array.from(this,er);var n=t?$n:Qn,r=this._parents,i=this._groups;typeof e!=`function`&&(e=Zn(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=nr(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new yi(o,r),o._enter=s,o._exit=c,o}function nr(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function rr(){return new yi(this._exit||this._groups.map(Jn),this._parents)}function ir(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function ar(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new yi(s,this._parents)}function or(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function sr(e){e||=cr;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new yi(i,this._parents).order()}function cr(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function lr(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ur(){return Array.from(this)}function dr(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function fr(){let e=0;for(let t of this)++e;return e}function pr(){return!this.node()}function mr(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function hr(e){return function(){this.removeAttribute(e)}}function gr(e){return function(){this.removeAttributeNS(e.space,e.local)}}function _r(e,t){return function(){this.setAttribute(e,t)}}function vr(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function yr(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function br(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function xr(e,t){var n=Tn(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?gr:hr:typeof t==`function`?n.local?br:yr:n.local?vr:_r)(n,t))}function Sr(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Cr(e){return function(){this.style.removeProperty(e)}}function wr(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Tr(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Er(e,t,n){return arguments.length>1?this.each((t==null?Cr:typeof t==`function`?Tr:wr)(e,t,n??``)):Dr(this.node(),e)}function Dr(e,t){return e.style.getPropertyValue(t)||Sr(e).getComputedStyle(e,null).getPropertyValue(t)}function Or(e){return function(){delete this[e]}}function kr(e,t){return function(){this[e]=t}}function Ar(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function jr(e,t){return arguments.length>1?this.each((t==null?Or:typeof t==`function`?Ar:kr)(e,t)):this.node()[e]}function Mr(e){return e.trim().split(/^|\s+/)}function Nr(e){return e.classList||new Pr(e)}function Pr(e){this._node=e,this._names=Mr(e.getAttribute(`class`)||``)}Pr.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Fr(e,t){for(var n=Nr(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Ir(e,t){for(var n=Nr(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Lr(e){return function(){Fr(this,e)}}function Rr(e){return function(){Ir(this,e)}}function zr(e,t){return function(){(t.apply(this,arguments)?Fr:Ir)(this,e)}}function Br(e,t){var n=Mr(e+``);if(arguments.length<2){for(var r=Nr(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?zr:t?Lr:Rr)(n,t))}function Vr(){this.textContent=``}function Hr(e){return function(){this.textContent=e}}function Ur(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Wr(e){return arguments.length?this.each(e==null?Vr:(typeof e==`function`?Ur:Hr)(e)):this.node().textContent}function Gr(){this.innerHTML=``}function Kr(e){return function(){this.innerHTML=e}}function qr(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function Jr(e){return arguments.length?this.each(e==null?Gr:(typeof e==`function`?qr:Kr)(e)):this.node().innerHTML}function Yr(){this.nextSibling&&this.parentNode.appendChild(this)}function Xr(){return this.each(Yr)}function Zr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Qr(){return this.each(Zr)}function $r(e){var t=typeof e==`function`?e:On(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function ei(){return null}function ti(e,t){var n=typeof e==`function`?e:On(e),r=t==null?ei:typeof t==`function`?t:An(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function ni(){var e=this.parentNode;e&&e.removeChild(this)}function ri(){return this.each(ni)}function ii(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ai(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function oi(e){return this.select(e?ai:ii)}function si(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function ci(e){return function(t){e.call(this,t,this.__data__)}}function li(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function ui(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function di(e,t,n){return function(){var r=this.__on,i,a=ci(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function fi(e,t,n){var r=li(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?di:ui,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function pi(e,t,n){var r=Sr(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function mi(e,t){return function(){return pi(this,e,t)}}function hi(e,t){return function(){return pi(this,e,t.apply(this,arguments))}}function gi(e,t){return this.each((typeof t==`function`?hi:mi)(e,t))}function*_i(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var vi=[null];function yi(e,t){this._groups=e,this._parents=t}function bi(){return new yi([[document.documentElement]],vi)}function xi(){return this}yi.prototype=bi.prototype={constructor:yi,select:jn,selectAll:In,selectChild:Hn,selectChildren:Kn,filter:qn,data:tr,enter:Yn,exit:rr,join:ir,merge:ar,selection:xi,order:or,sort:sr,call:lr,nodes:ur,node:dr,size:fr,empty:pr,each:mr,attr:xr,style:Er,property:jr,classed:Br,text:Wr,html:Jr,raise:Xr,lower:Qr,append:$r,insert:ti,remove:ri,clone:oi,datum:si,on:fi,dispatch:gi,[Symbol.iterator]:_i};function Si(e){return typeof e==`string`?new yi([[document.querySelector(e)]],[document.documentElement]):new yi([[e]],vi)}function Ci(e){let t;for(;t=e.sourceEvent;)e=t;return e}function wi(e,t){if(e=Ci(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var Ti={passive:!1},Ei={capture:!0,passive:!1};function Di(e){e.stopImmediatePropagation()}function Oi(e){e.preventDefault(),e.stopImmediatePropagation()}function ki(e){var t=e.document.documentElement,n=Si(e).on(`dragstart.drag`,Oi,Ei);`onselectstart`in t?n.on(`selectstart.drag`,Oi,Ei):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function Ai(e,t){var n=e.document.documentElement,r=Si(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,Oi,Ei),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var ji=e=>()=>e;function Mi(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Mi.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Ni(e){return!e.ctrlKey&&!e.button}function Pi(){return this.parentNode}function Fi(e,t){return t??{x:e.x,y:e.y}}function Ii(){return navigator.maxTouchPoints||`ontouchstart`in this}function Li(){var e=Ni,t=Pi,n=Fi,r=Ii,i={},a=yn(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,Ti).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(Si(n.view).on(`mousemove.drag`,m,Ei).on(`mouseup.drag`,h,Ei),ki(n.view),Di(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(Oi(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){Si(e.view).on(`mousemove.drag mouseup.drag`,null),Ai(e.view,l),Oi(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Di(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(Oi(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Di(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=wi(l||r,t),p,m,h;if((h=n.call(e,new Mi(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=wi(l||a,t),_=o}u.call(r,e,new Mi(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:ji(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:ji(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:ji(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:ji(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Ri(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zi(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Bi(){}var Vi=.7,Hi=1/Vi,Ui=`\\s*([+-]?\\d+)\\s*`,Wi=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,Gi=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Ki=/^#([0-9a-f]{3,8})$/,qi=RegExp(`^rgb\\(${Ui},${Ui},${Ui}\\)$`),Ji=RegExp(`^rgb\\(${Gi},${Gi},${Gi}\\)$`),Yi=RegExp(`^rgba\\(${Ui},${Ui},${Ui},${Wi}\\)$`),Xi=RegExp(`^rgba\\(${Gi},${Gi},${Gi},${Wi}\\)$`),Zi=RegExp(`^hsl\\(${Wi},${Gi},${Gi}\\)$`),Qi=RegExp(`^hsla\\(${Wi},${Gi},${Gi},${Wi}\\)$`),$i={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ri(Bi,ia,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ea,formatHex:ea,formatHex8:ta,formatHsl:na,formatRgb:ra,toString:ra});function ea(){return this.rgb().formatHex()}function ta(){return this.rgb().formatHex8()}function na(){return _a(this).formatHsl()}function ra(){return this.rgb().formatRgb()}function ia(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Ki.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?aa(t):n===3?new la(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?oa(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?oa(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=qi.exec(e))?new la(t[1],t[2],t[3],1):(t=Ji.exec(e))?new la(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Yi.exec(e))?oa(t[1],t[2],t[3],t[4]):(t=Xi.exec(e))?oa(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Zi.exec(e))?ga(t[1],t[2]/100,t[3]/100,1):(t=Qi.exec(e))?ga(t[1],t[2]/100,t[3]/100,t[4]):$i.hasOwnProperty(e)?aa($i[e]):e===`transparent`?new la(NaN,NaN,NaN,0):null}function aa(e){return new la(e>>16&255,e>>8&255,e&255,1)}function oa(e,t,n,r){return r<=0&&(e=t=n=NaN),new la(e,t,n,r)}function sa(e){return e instanceof Bi||(e=ia(e)),e?(e=e.rgb(),new la(e.r,e.g,e.b,e.opacity)):new la}function ca(e,t,n,r){return arguments.length===1?sa(e):new la(e,t,n,r??1)}function la(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Ri(la,ca,zi(Bi,{brighter(e){return e=e==null?Hi:Hi**+e,new la(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Vi:Vi**+e,new la(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new la(ma(this.r),ma(this.g),ma(this.b),pa(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:ua,formatHex:ua,formatHex8:da,formatRgb:fa,toString:fa}));function ua(){return`#${ha(this.r)}${ha(this.g)}${ha(this.b)}`}function da(){return`#${ha(this.r)}${ha(this.g)}${ha(this.b)}${ha((isNaN(this.opacity)?1:this.opacity)*255)}`}function fa(){let e=pa(this.opacity);return`${e===1?`rgb(`:`rgba(`}${ma(this.r)}, ${ma(this.g)}, ${ma(this.b)}${e===1?`)`:`, ${e})`}`}function pa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ma(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ha(e){return e=ma(e),(e<16?`0`:``)+e.toString(16)}function ga(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ya(e,t,n,r)}function _a(e){if(e instanceof ya)return new ya(e.h,e.s,e.l,e.opacity);if(e instanceof Bi||(e=ia(e)),!e)return new ya;if(e instanceof ya)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new ya(o,s,c,e.opacity)}function va(e,t,n,r){return arguments.length===1?_a(e):new ya(e,t,n,r??1)}function ya(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ri(ya,va,zi(Bi,{brighter(e){return e=e==null?Hi:Hi**+e,new ya(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Vi:Vi**+e,new ya(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new la(Sa(e>=240?e-240:e+120,i,r),Sa(e,i,r),Sa(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ya(ba(this.h),xa(this.s),xa(this.l),pa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=pa(this.opacity);return`${e===1?`hsl(`:`hsla(`}${ba(this.h)}, ${xa(this.s)*100}%, ${xa(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function ba(e){return e=(e||0)%360,e<0?e+360:e}function xa(e){return Math.max(0,Math.min(1,e||0))}function Sa(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Ca=e=>()=>e;function wa(e,t){return function(n){return e+n*t}}function Ta(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Ea(e){return(e=+e)==1?Da:function(t,n){return n-t?Ta(t,n,e):Ca(isNaN(t)?n:t)}}function Da(e,t){var n=t-e;return n?wa(e,n):Ca(isNaN(e)?t:e)}var Oa=(function e(t){var n=Ea(t);function r(e,t){var r=n((e=ca(e)).r,(t=ca(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Da(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function ka(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Aa=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ja=new RegExp(Aa.source,`g`);function Ma(e){return function(){return e}}function Na(e){return function(t){return e(t)+``}}function Pa(e,t){var n=Aa.lastIndex=ja.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Aa.exec(e))&&(i=ja.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:ka(r,i)})),n=ja.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Na(c[0].x):Ma(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}var Fa=180/Math.PI,Ia={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function La(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Fa,skewX:Math.atan(c)*Fa,scaleX:o,scaleY:s}}var Ra;function za(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Ia:La(t.a,t.b,t.c,t.d,t.e,t.f)}function Ba(e){return e==null||(Ra||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Ra.setAttribute(`transform`,e),!(e=Ra.transform.baseVal.consolidate()))?Ia:(e=e.matrix,La(e.a,e.b,e.c,e.d,e.e,e.f))}function Va(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:ka(e,i)},{i:c-2,x:ka(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:ka(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:ka(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:ka(e,n)},{i:s-2,x:ka(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var Ha=Va(za,`px, `,`px)`,`deg)`),Ua=Va(Ba,`, `,`)`,`)`),Wa=1e-12;function Ga(e){return((e=Math.exp(e))+1/e)/2}function Ka(e){return((e=Math.exp(e))-1/e)/2}function qa(e){return((e=Math.exp(2*e))-1)/(e+1)}var Ja=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<Wa)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=Ga(y),c=s/(n*g)*(i*qa(t*r+y)-Ka(y));return[a+c*d,o+c*f,s*i/Ga(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),Ya=0,Xa=0,Za=0,Qa=1e3,$a,eo,to=0,no=0,ro=0,io=typeof performance==`object`&&performance.now?performance:Date,ao=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function oo(){return no||=(ao(so),io.now()+ro)}function so(){no=0}function co(){this._call=this._time=this._next=null}co.prototype=lo.prototype={constructor:co,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?oo():+n)+(t==null?0:+t),!this._next&&eo!==this&&(eo?eo._next=this:$a=this,eo=this),this._call=e,this._time=n,ho()},stop:function(){this._call&&(this._call=null,this._time=1/0,ho())}};function lo(e,t,n){var r=new co;return r.restart(e,t,n),r}function uo(){oo(),++Ya;for(var e=$a,t;e;)(t=no-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ya}function fo(){no=(to=io.now())+ro,Ya=Xa=0;try{uo()}finally{Ya=0,mo(),no=0}}function po(){var e=io.now(),t=e-to;t>Qa&&(ro-=t,to=e)}function mo(){for(var e,t=$a,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:$a=n);eo=e,ho(r)}function ho(e){Ya||(Xa&&=clearTimeout(Xa),e-no>24?(e<1/0&&(Xa=setTimeout(fo,e-io.now()-ro)),Za&&=clearInterval(Za)):(Za||=(to=io.now(),setInterval(po,Qa)),Ya=1,ao(fo)))}function go(e,t,n){var r=new co;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var _o=yn(`start`,`end`,`cancel`,`interrupt`),vo=[];function yo(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Co(e,n,{name:t,index:r,group:i,on:_o,tween:vo,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function bo(e,t){var n=So(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function xo(e,t){var n=So(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function So(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Co(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=lo(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return go(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(go(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function wo(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]):a=!1;a&&delete e.__transition}}function To(e){return this.each(function(){wo(this,e)})}function Eo(e,t){var n,r;return function(){var i=xo(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Do(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=xo(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Oo(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=So(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Eo:Do)(n,e,t))}function ko(e,t,n){var r=e._id;return e.each(function(){var e=xo(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return So(e,r).value[t]}}function Ao(e,t){var n;return(typeof t==`number`?ka:t instanceof ia?Oa:(n=ia(t))?(t=n,Oa):Pa)(e,t)}function jo(e){return function(){this.removeAttribute(e)}}function Mo(e){return function(){this.removeAttributeNS(e.space,e.local)}}function No(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function Po(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function Fo(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Io(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Lo(e,t){var n=Tn(e),r=n===`transform`?Ua:Ao;return this.attrTween(e,typeof t==`function`?(n.local?Io:Fo)(n,r,ko(this,`attr.`+e,t)):t==null?(n.local?Mo:jo)(n):(n.local?Po:No)(n,r,t))}function Ro(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function zo(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Bo(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&zo(e,i)),n}return i._value=t,i}function Vo(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Ro(e,i)),n}return i._value=t,i}function Ho(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=Tn(e);return this.tween(n,(r.local?Bo:Vo)(r,t))}function Uo(e,t){return function(){bo(this,e).delay=+t.apply(this,arguments)}}function Wo(e,t){return t=+t,function(){bo(this,e).delay=t}}function Go(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Uo:Wo)(t,e)):So(this.node(),t).delay}function Ko(e,t){return function(){xo(this,e).duration=+t.apply(this,arguments)}}function qo(e,t){return t=+t,function(){xo(this,e).duration=t}}function Jo(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Ko:qo)(t,e)):So(this.node(),t).duration}function Yo(e,t){if(typeof t!=`function`)throw Error();return function(){xo(this,e).ease=t}}function Xo(e){var t=this._id;return arguments.length?this.each(Yo(t,e)):So(this.node(),t).ease}function Zo(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();xo(this,e).ease=n}}function Qo(e){if(typeof e!=`function`)throw Error();return this.each(Zo(this._id,e))}function $o(e){typeof e!=`function`&&(e=Ln(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Os(r,this._parents,this._name,this._id)}function es(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Os(o,this._parents,this._name,this._id)}function ts(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function ns(e,t,n){var r,i,a=ts(t)?bo:xo;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function rs(e,t){var n=this._id;return arguments.length<2?So(this.node(),n).on.on(e):this.each(ns(n,e,t))}function is(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function as(){return this.on(`end.remove`,is(this._id))}function os(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=An(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,yo(l[f],t,n,f,l,So(u,n)));return new Os(a,this._parents,t,n)}function ss(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Pn(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=So(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&yo(p,t,n,h,f,m);a.push(f),o.push(u)}return new Os(a,o,t,n)}var cs=bi.prototype.constructor;function ls(){return new cs(this._groups,this._parents)}function us(e,t){var n,r,i;return function(){var a=Dr(this,e),o=(this.style.removeProperty(e),Dr(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function ds(e){return function(){this.style.removeProperty(e)}}function fs(e,t,n){var r,i=n+``,a;return function(){var o=Dr(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function ps(e,t,n){var r,i,a;return function(){var o=Dr(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Dr(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function ms(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=xo(this,e),l=c.on,u=c.value[a]==null?s||=ds(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function hs(e,t,n){var r=(e+=``)==`transform`?Ha:Ao;return t==null?this.styleTween(e,us(e,r)).on(`end.style.`+e,ds(e)):typeof t==`function`?this.styleTween(e,ps(e,r,ko(this,`style.`+e,t))).each(ms(this._id,e)):this.styleTween(e,fs(e,r,t),n).on(`end.style.`+e,null)}function gs(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function _s(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&gs(e,a,n)),r}return a._value=t,a}function vs(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,_s(e,t,n??``))}function ys(e){return function(){this.textContent=e}}function bs(e){return function(){var t=e(this);this.textContent=t??``}}function xs(e){return this.tween(`text`,typeof e==`function`?bs(ko(this,`text`,e)):ys(e==null?``:e+``))}function Ss(e){return function(t){this.textContent=e.call(this,t)}}function Cs(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Ss(r)),t}return r._value=e,r}function ws(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Cs(e))}function Ts(){for(var e=this._name,t=this._id,n=ks(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=So(c,t);yo(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Os(r,this._parents,e,n)}function Es(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=xo(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var Ds=0;function Os(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function ks(){return++Ds}var As=bi.prototype;Os.prototype={constructor:Os,select:os,selectAll:ss,selectChild:As.selectChild,selectChildren:As.selectChildren,filter:$o,merge:es,selection:ls,transition:Ts,call:As.call,nodes:As.nodes,node:As.node,size:As.size,empty:As.empty,each:As.each,on:rs,attr:Lo,attrTween:Ho,style:hs,styleTween:vs,text:xs,textTween:ws,remove:as,tween:Oo,delay:Go,duration:Jo,ease:Xo,easeVarying:Qo,end:Es,[Symbol.iterator]:As[Symbol.iterator]};function js(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ms={time:null,delay:0,duration:250,ease:js};function Ns(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function Ps(e){var t,n;e instanceof Os?(t=e._id,e=e._name):(t=ks(),(n=Ms).time=oo(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&yo(c,e,t,l,o,n||Ns(c,t));return new Os(r,this._parents,e,t)}bi.prototype.interrupt=To,bi.prototype.transition=Ps;var Fs=e=>()=>e;function Is(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Ls(e,t,n){this.k=e,this.x=t,this.y=n}Ls.prototype={constructor:Ls,scale:function(e){return e===1?this:new Ls(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ls(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var Rs=new Ls(1,0,0);zs.prototype=Ls.prototype;function zs(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Rs;return e.__zoom}function Bs(e){e.stopImmediatePropagation()}function Vs(e){e.preventDefault(),e.stopImmediatePropagation()}function Hs(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function Us(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Ws(){return this.__zoom||Rs}function Gs(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Ks(){return navigator.maxTouchPoints||`ontouchstart`in this}function qs(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Js(){var e=Hs,t=Us,n=qs,r=Gs,i=Ks,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Ja,l=yn(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,Ws).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,ee).on(`touchend.zoom touchcancel.zoom`,te).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,Ws),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(Rs.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new Ls(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new Ls(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new Ls(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=Si(this.that).datum();l.call(e,this.that,new Is(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=wi(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],wo(this),s.start();Vs(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=Si(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=wi(t,i),l=t.clientX,u=t.clientY;ki(t.view),Bs(t),a.mouse=[c,this.__zoom.invert(c)],wo(this),a.start();function d(e){if(Vs(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=wi(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),Ai(e.view,a.moved),Vs(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=wi(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);Vs(r),s>0?Si(this).transition().duration(s).call(x,d,c,r):Si(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(Bs(t),s=0;s<i;++s)c=r[s],l=wi(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),wo(this),a.start())}}function ee(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(Vs(e),s=0;s<a;++s)c=i[s],l=wi(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function te(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(Bs(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=wi(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=Si(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Fs(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Fs(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Fs(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Fs([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var Ys={error001:()=>`[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The React Flow parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`},Xs=[[-1/0,-1/0],[1/0,1/0]],Zs=[`Enter`,` `,`Escape`],Qs;(function(e){e.Strict=`strict`,e.Loose=`loose`})(Qs||={});var $s;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})($s||={});var ec;(function(e){e.Partial=`partial`,e.Full=`full`})(ec||={});var tc={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null},nc;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(nc||={});var rc;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(rc||={});var L;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(L||={});var ic={[L.Left]:L.Right,[L.Right]:L.Left,[L.Top]:L.Bottom,[L.Bottom]:L.Top};function ac(e){return e===null?null:e?`valid`:`invalid`}var oc=e=>`id`in e&&`source`in e&&`target`in e,sc=e=>`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),cc=e=>`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),lc=(e,t=[0,0])=>{let{width:n,height:r}=zc(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},uc=(e,t={nodeOrigin:[0,0],nodeLookup:void 0})=>e.length===0?{x:0,y:0,width:0,height:0}:Tc(e.reduce((e,n)=>{let r=typeof n==`string`,i=!t.nodeLookup&&!r?n:void 0;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):cc(n)?n:t.nodeLookup.get(n.id)),Cc(e,i?Dc(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),dc=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(e=>{if(t.filter===void 0||t.filter(e)){let t=Dc(e);n=Cc(n,t)}}),Tc(n)},fc=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s={...Pc(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??null,l=e.height??t.height??t.initialHeight??null,u=kc(s,Ec(t)),d=(i??0)*(l??0),f=a&&u>0;(!t.internals.handleBounds||f||u>=d||t.dragging)&&c.push(t)}return c},pc=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function mc(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{e.measured.width&&e.measured.height&&(t?.includeHiddenNodes||!e.hidden)&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function hc({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return Promise.resolve(!1);let s=Ic(dc(e),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration}),Promise.resolve(!0)}function gc({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=i;if(o.extent===`parent`&&!o.expandParent){if(!s)a?.(`005`,Ys.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&Rc(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=Rc(d)?yc(t,d,o.measured):t;return{position:{x:f.x-c+o.measured.width*u[0],y:f.y-l+o.measured.height*u[1]},positionAbsolute:f}}async function _c({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=pc(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var vc=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),yc=(e={x:0,y:0},t,n)=>({x:vc(e.x,t[0][0],t[1][0]-(n?.width??0)),y:vc(e.y,t[0][1],t[1][1]-(n?.height??0))});function bc(e,t,n){let{width:r,height:i}=zc(n),{x:a,y:o}=n.internals.positionAbsolute;return yc(e,[[a,o],[a+r,o+i]],t)}var xc=(e,t,n)=>e<t?vc(Math.abs(e-t),1,t)/t:e>n?-vc(Math.abs(e-n),1,t)/t:0,Sc=(e,t,n=15,r=40)=>[xc(e.x,r,t.width-r)*n,xc(e.y,r,t.height-r)*n],Cc=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),wc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Tc=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Ec=(e,t=[0,0])=>{let{x:n,y:r}=cc(e)?e.internals.positionAbsolute:lc(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Dc=(e,t=[0,0])=>{let{x:n,y:r}=cc(e)?e.internals.positionAbsolute:lc(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},Oc=(e,t)=>Tc(Cc(wc(e),wc(t))),kc=(e,t)=>{let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Ac=e=>jc(e.width)&&jc(e.height)&&jc(e.x)&&jc(e.y),jc=e=>!isNaN(e)&&isFinite(e),Mc=(e,t)=>{},Nc=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Pc=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?Nc(s,o):s},Fc=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),Ic=(e,t,n,r,i,a)=>{let o=t/(e.width*(1+a)),s=n/(e.height*(1+a)),c=vc(Math.min(o,s),r,i),l=e.x+e.width/2,u=e.y+e.height/2;return{x:t/2-l*c,y:n/2-u*c,zoom:c}},Lc=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function Rc(e){return e!==void 0&&e!==`parent`}function zc(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Bc(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Vc(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function Hc(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=Jc(e),s=Pc({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?Nc(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var Uc=e=>({width:e.offsetWidth,height:e.offsetHeight}),Wc=e=>e.getRootNode?.()||window?.document,Gc=[`INPUT`,`SELECT`,`TEXTAREA`];function Kc(e){let t=e.composedPath?.()?.[0]||e.target;return Gc.includes(t?.nodeName)||t?.hasAttribute?.(`contenteditable`)||!!t?.closest(`.nokey`)}var qc=e=>`clientX`in e,Jc=(e,t)=>{let n=qc(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},Yc=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...Uc(t)}})};function Xc({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function Zc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Qc({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case L.Left:return[t-Zc(t-r,a),n];case L.Right:return[t+Zc(r-t,a),n];case L.Top:return[t,n-Zc(n-i,a)];case L.Bottom:return[t,n+Zc(i-n,a)]}}function $c({sourceX:e,sourceY:t,sourcePosition:n=L.Bottom,targetX:r,targetY:i,targetPosition:a=L.Top,curvature:o=.25}){let[s,c]=Qc({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=Qc({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=Xc({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function el({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function tl({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1}){if(!i)return r;let a=n||t.selected||e.selected,o=Math.max(e.internals.z||0,t.internals.z||0,1e3);return r+(a?o:0)}function nl({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=Cc(Dc(e),Dc(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),kc({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},Tc(a))>0}var rl=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,il=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),al=(e,t)=>{if(!e.source||!e.target)return Ys.error006(),t;let n;return n=oc(e)?{...e}:{...e,id:rl(e)},il(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function ol({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=el({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var sl={[L.Left]:{x:-1,y:0},[L.Right]:{x:1,y:0},[L.Top]:{x:0,y:-1},[L.Bottom]:{x:0,y:1}},cl=({source:e,sourcePosition:t=L.Bottom,target:n})=>t===L.Left||t===L.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},ll=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function ul({source:e,sourcePosition:t=L.Bottom,target:n,targetPosition:r=L.Top,center:i,offset:a}){let o=sl[t],s=sl[r],c={x:e.x+o.x*a,y:e.y+o.y*a},l={x:n.x+s.x*a,y:n.y+s.y*a},u=cl({source:c,sourcePosition:t,target:l}),d=u.x===0?`y`:`x`,f=u[d],p=[],m,h,g={x:0,y:0},_={x:0,y:0},[v,y,b,x]=el({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[d]*s[d]===-1){m=i.x??v,h=i.y??y;let e=[{x:m,y:c.y},{x:m,y:l.y}],t=[{x:c.x,y:h},{x:l.x,y:h}];p=o[d]===f?d===`x`?e:t:d===`x`?t:e}else{let i=[{x:c.x,y:l.y}],u=[{x:l.x,y:c.y}];if(p=d===`x`?o.x===f?u:i:o.y===f?i:u,t===r){let t=Math.abs(e[d]-n[d]);if(t<=a){let r=Math.min(a-1,a-t);o[d]===f?g[d]=(c[d]>e[d]?-1:1)*r:_[d]=(l[d]>n[d]?-1:1)*r}}if(t!==r){let e=d===`x`?`y`:`x`,t=o[d]===s[e],n=c[e]>l[e],r=c[e]<l[e];(o[d]===1&&(!t&&n||t&&r)||o[d]!==1&&(!t&&r||t&&n))&&(p=d===`x`?i:u)}let v={x:c.x+g.x,y:c.y+g.y},y={x:l.x+_.x,y:l.y+_.y};Math.max(Math.abs(v.x-p[0].x),Math.abs(y.x-p[0].x))>=Math.max(Math.abs(v.y-p[0].y),Math.abs(y.y-p[0].y))?(m=(v.x+y.x)/2,h=p[0].y):(m=p[0].x,h=(v.y+y.y)/2)}return[[e,{x:c.x+g.x,y:c.y+g.y},...p,{x:l.x+_.x,y:l.y+_.y},n],m,h,b,x]}function dl(e,t,n,r){let i=Math.min(ll(e,t)/2,ll(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function fl({sourceX:e,sourceY:t,sourcePosition:n=L.Bottom,targetX:r,targetY:i,targetPosition:a=L.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20}){let[u,d,f,p,m]=ul({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l});return[u.reduce((e,t,n)=>{let r=``;return r=n>0&&n<u.length-1?dl(u[n-1],t,u[n+1],o):`${n===0?`M`:`L`}${t.x} ${t.y}`,e+=r,e},``),d,f,p,m]}function pl(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function ml(e){let{sourceNode:t,targetNode:n}=e;if(!pl(t)||!pl(n))return null;let r=t.internals.handleBounds||hl(t.handles),i=n.internals.handleBounds||hl(n.handles),a=_l(r?.source??[],e.sourceHandle),o=_l(e.connectionMode===Qs.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,Ys.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||L.Bottom,c=o?.position||L.Top,l=gl(t,a,s),u=gl(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function hl(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function gl(e,t,n=L.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??zc(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case L.Top:return{x:i+o/2,y:a};case L.Right:return{x:i+o,y:a+s/2};case L.Bottom:return{x:i+o/2,y:a+s};case L.Left:return{x:i,y:a+s/2}}}function _l(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function vl(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function yl(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=vl(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var bl={nodeOrigin:[0,0],nodeExtent:Xs,elevateNodesOnSelect:!0,defaults:{}},xl={...bl,checkEquality:!0};function Sl(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function Cl(e,t,n){let r=Sl(bl,n);for(let n of e.values())if(n.parentId)El(n,e,t,r);else{let e=yc(lc(n,r.nodeOrigin),Rc(n.extent)?n.extent:r.nodeExtent,zc(n));n.internals.positionAbsolute=e}}function wl(e,t,n,r){let i=Sl(xl,r),a=new Map(t),o=i?.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(let s of e){let e=a.get(s.id);if(i.checkEquality&&s===e?.internals.userNode)t.set(s.id,e);else{let n=yc(lc(s,i.nodeOrigin),Rc(s.extent)?s.extent:i.nodeExtent,zc(s));e={...i.defaults,...s,measured:{width:s.measured?.width,height:s.measured?.height},internals:{positionAbsolute:n,handleBounds:s.measured?e?.internals.handleBounds:void 0,z:Dl(s,o),userNode:s}},t.set(s.id,e)}s.parentId&&El(e,t,n,r)}}function Tl(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function El(e,t,n,r){let{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o}=Sl(bl,r),s=e.parentId,c=t.get(s);if(!c){console.warn(`Parent node ${s} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Tl(e,n);let{x:l,y:u,z:d}=Ol(e,c,a,o,i?1e3:0),{positionAbsolute:f}=e.internals,p=l!==f.x||u!==f.y;(p||d!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:p?{x:l,y:u}:f,z:d})}function Dl(e,t){return(jc(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Ol(e,t,n,r,i){let{x:a,y:o}=t.internals.positionAbsolute,s=zc(e),c=lc(e,n),l=Rc(e.extent)?yc(c,e.extent,s):c,u=yc({x:a+l.x,y:o+l.y},r,s);e.extent===`parent`&&(u=bc(u,s,t));let d=Dl(e,i),f=t.internals.z??0;return{x:u.x,y:u.y,z:f>d?f:d}}function kl(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=Oc(a.get(n.parentId)?.expandedRect??Ec(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=zc(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function Al(e,t,n,r,i,a){let o=r?.querySelector(`.xyflow__viewport`),s=!1;if(!o)return{changes:[],updatedInternals:s};let c=[],l=window.getComputedStyle(o),{m22:u}=new window.DOMMatrixReadOnly(l.transform),d=[];for(let r of e.values()){let e=t.get(r.id);if(e){if(e.hidden)e.internals={...e.internals,handleBounds:void 0},s=!0;else{let o=Uc(r.nodeElement),l=e.measured.width!==o.width||e.measured.height!==o.height;if(o.width&&o.height&&(l||!e.internals.handleBounds||r.force)){let f=r.nodeElement.getBoundingClientRect(),p=Rc(e.extent)?e.extent:a,{positionAbsolute:m}=e.internals;e.parentId&&e.extent===`parent`?m=bc(m,o,t.get(e.parentId)):p&&(m=yc(m,p,o)),e.measured=o,e.internals={...e.internals,positionAbsolute:m,handleBounds:{source:Yc(`source`,r.nodeElement,f,u,e.id),target:Yc(`target`,r.nodeElement,f,u,e.id)}},e.parentId&&El(e,t,n,{nodeOrigin:i}),s=!0,l&&(c.push({id:e.id,type:`dimensions`,dimensions:o}),e.expandParent&&e.parentId&&d.push({id:e.id,parentId:e.parentId,rect:Ec(e,i)}))}}}}if(d.length>0){let e=kl(d,t,n,i);c.push(...e)}return{changes:c,updatedInternals:s}}async function jl({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r),s=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(s)}function Ml(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s=`${n}-source-${a}`,c=`${i}-target-${o}`,l=e.get(s)||new Map,u=e.get(c)||new Map,d={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o};t.set(r.id,r),e.set(s,l.set(`${i}-${o}`,d)),e.set(c,u.set(`${n}-${a}`,d))}}function Nl(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:Nl(n,t):!1}function Pl(e,t,n){let r=e;do{if(r?.matches(t))return!0;if(r===n)return!1;r=r.parentElement}while(r);return!1}function Fl(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!Nl(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function Il({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function Ll({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1;function m({noDragClassName:m,handleSelector:h,domNode:g,isSelectable:_,nodeId:v,nodeClickDistance:y=0}){f=Si(g);function b({x:e,y:n},i){let{nodeLookup:o,nodeExtent:c,snapGrid:l,snapToGrid:u,nodeOrigin:d,onNodeDrag:f,onSelectionDrag:p,onError:m,updateNodePositions:h}=t();a={x:e,y:n};let g=!1,_={x:0,y:0,x2:0,y2:0};s.size>1&&c&&(_=wc(dc(s)));for(let[t,r]of s){if(!o.has(t))continue;let i={x:e-r.distance.x,y:n-r.distance.y};u&&(i=Nc(i,l));let a=[[c[0][0],c[0][1]],[c[1][0],c[1][1]]];if(s.size>1&&c&&!r.extent){let{positionAbsolute:e}=r.internals,t=e.x-_.x+c[0][0],n=e.x+r.measured.width-_.x2+c[1][0],i=e.y-_.y+c[0][1],o=e.y+r.measured.height-_.y2+c[1][1];a=[[t,i],[n,o]]}let{position:f,positionAbsolute:p}=gc({nodeId:t,nextPosition:i,nodeLookup:o,nodeExtent:a,nodeOrigin:d,onError:m});g=g||r.position.x!==f.x||r.position.y!==f.y,r.position=f,r.internals.positionAbsolute=p}if(g&&(h(s,!0),i&&(r||f||!v&&p))){let[e,t]=Il({nodeId:v,dragItems:s,nodeLookup:o});r?.(i,s,e,t),f?.(i,e,t),v||p?.(i,t)}}async function x(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r}=t(),[i,s]=Sc(l,u,r);(i!==0||s!==0)&&(a.x=(a.x??0)-i/e[2],a.y=(a.y??0)-s/e[2],await n({x:i,y:s})&&b(a,null)),o=requestAnimationFrame(x)}function S(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:y}=t();d=!0,(!m||!_)&&!o&&v&&(i.get(v)?.selected||y()),_&&m&&v&&e?.(v);let b=Hc(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=b,s=Fl(i,c,b,v),s.size>0&&(n||h||!v&&g)){let[e,t]=Il({nodeId:v,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),v||g?.(r.sourceEvent,t)}}let C=Li().clickDistance(y).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,r===0&&S(e),a=Hc(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=Jc(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),h=Hc(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if((e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||v&&!m.has(v))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,x()),!d){let t=h.xSnapped-(a.x??0),n=h.ySnapped-(a.y??0);Math.sqrt(t*t+n*n)>f&&S(e)}(a.x!==h.xSnapped||a.y!==h.ySnapped)&&s&&d&&(l=Jc(e.sourceEvent,u),b(h,e.sourceEvent))}}).on(`end`,e=>{if(d&&!p&&(c=!1,d=!1,cancelAnimationFrame(o),s.size>0)){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(r(s,!1),i||a||!v&&o){let[t,r]=Il({nodeId:v,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),v||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!m||!Pl(t,`.${m}`,g))&&(!h||Pl(t,h,g))});f.call(C)}function h(){f?.on(`.drag`,null)}return{update:m,destroy:h}}function Rl(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())kc(i,Ec(e))>0&&r.push(e);return r}var zl=250;function Bl(e,t,n,r){let i=[],a=1/0,o=Rl(e,n,t+zl);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=gl(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function Vl(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...gl(o,c,c.position,!0)}:c}function Hl(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Ul(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var Wl=()=>!0;function Gl(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=Wl,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S}){let C=Wc(e.target),w=0,T,{x:E,y:D}=Jc(e),ee=C?.elementFromPoint(E,D),te=Hl(a,ee),ne=s?.getBoundingClientRect();if(!ne||!te)return;let O=Vl(i,te,r,c,t);if(!O)return;let re=Jc(e,ne),ie=!1,ae=null,oe=!1,k=null;function A(){if(!u||!ne)return;let[e,t]=Sc(re,ne,S);f({x:e,y:t}),w=requestAnimationFrame(A)}let se={...O,nodeId:i,type:te,position:O.position},ce=c.get(i),j={inProgress:!0,isValid:null,from:gl(ce,se,L.Left,!0),fromHandle:se,fromPosition:se.position,fromNode:ce,to:re,toHandle:null,toPosition:ic[se.position],toNode:null};y(j);let le=j;m?.(e,{nodeId:i,handleId:r,handleType:te});function M(e){if(!x()||!se){ue(e);return}let a=b();re=Jc(e,ne),T=Bl(Pc(re,a,!1,[1,1]),n,c,se),ie||=(A(),!0);let s=Kl(e,{handle:T,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:C,lib:l,flowId:d,nodeLookup:c});k=s.handleDomNode,ae=s.connection,oe=Ul(!!T,s.isValid);let u={...le,isValid:oe,to:T&&oe?Fc({x:T.x,y:T.y},a):re,toHandle:s.toHandle,toPosition:oe&&s.toHandle?s.toHandle.position:ic[se.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null};oe&&T&&le.toHandle&&u.toHandle&&le.toHandle.type===u.toHandle.type&&le.toHandle.nodeId===u.toHandle.nodeId&&le.toHandle.id===u.toHandle.id&&le.to.x===u.to.x&&le.to.y===u.to.y||(y(u),le=u)}function ue(e){(T||k)&&ae&&oe&&h?.(ae);let{inProgress:t,...n}=le,r={...n,toPosition:le.toHandle?le.toPosition:null};g?.(e,r),a&&v?.(e,r),p(),cancelAnimationFrame(w),ie=!1,oe=!1,ae=null,k=null,C.removeEventListener(`mousemove`,M),C.removeEventListener(`mouseup`,ue),C.removeEventListener(`touchmove`,M),C.removeEventListener(`touchend`,ue)}C.addEventListener(`mousemove`,M),C.addEventListener(`mouseup`,ue),C.addEventListener(`touchmove`,M),C.addEventListener(`touchend`,ue)}function Kl(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Wl,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=Jc(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=Hl(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===Qs.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=Vl(t,e,a,u,n,!1)}return _}var ql={onPointerDown:Gl,isValid:Kl};function Jl({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=Si(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=10,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{let r=n();if(e.sourceEvent.type!==`wheel`||!t)return;let i=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,a=r[2]*2**i;t.scaleTo(a)},f=[0,0],p=Js().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:wi}}var Yl=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Xl=e=>({x:e.x,y:e.y,zoom:e.k}),Zl=({x:e,y:t,zoom:n})=>Rs.translate(e,t).scale(n),Ql=(e,t)=>e.target.closest(`.${t}`),$l=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),eu=(e,t=0,n=()=>{})=>{let r=typeof t==`number`&&t>0;return r||n(),r?e.transition().duration(t).on(`end`,n):e},tu=e=>{let t=e.ctrlKey&&Lc()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function nu({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(Ql(u,t))return!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=wi(u),t=d*2**tu(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===$s.Vertical?0:u.deltaX*f,m=i===$s.Horizontal?0:u.deltaY*f;!Lc()&&u.shiftKey&&i!==$s.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=Xl(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,s?.(u,h)),e.isPanScrolling&&(c?.(u,h),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150))}}function ru({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){if(!t&&r.type===`wheel`&&!r.ctrlKey||Ql(r,e))return null;r.preventDefault(),n.call(this,r,i)}}function iu({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=Xl(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function au({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&$l(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,Xl(a.transform))}}function ou({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&$l(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i&&Yl(e.prevViewport,o.transform))){let t=Xl(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function su({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:s,noPanClassName:c,lib:l}){return u=>{let d=e||t,f=n&&u.ctrlKey;if(u.button===1&&u.type===`mousedown`&&(Ql(u,`${l}-flow__node`)||Ql(u,`${l}-flow__edge`)))return!0;if(!r&&!d&&!i&&!a&&!n||o||Ql(u,s)&&u.type===`wheel`||Ql(u,c)&&(u.type!==`wheel`||i&&u.type===`wheel`&&!e)||!n&&u.ctrlKey&&u.type===`wheel`)return!1;if(!n&&u.type===`touchstart`&&u.touches?.length>1)return u.preventDefault(),!1;if(!d&&!i&&!f&&u.type===`wheel`||!r&&(u.type===`mousedown`||u.type===`touchstart`)||Array.isArray(r)&&!r.includes(u.button)&&u.type===`mousedown`)return!1;let p=Array.isArray(r)&&r.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||u.type===`wheel`)&&p}}function cu({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:i,viewport:a,onPanZoom:o,onPanZoomStart:s,onPanZoomEnd:c,onDraggingChange:l}){let u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=Js().clickDistance(!jc(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(i),p=Si(e).call(f);y({x:a.x,y:a.y,zoom:vc(a.zoom,t,n)},[[0,0],[d.width,d.height]],i);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(tu);function g(e,t){return p?new Promise(n=>{f?.transform(eu(p,t?.duration,()=>n(!0)),e)}):Promise.resolve(!1)}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:a,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,zoomActivationKeyPressed:S,lib:C,onTransformChange:w}){r&&!u.isZoomingOrPanning&&v();let T=i&&!S&&!r?nu({zoomPanValues:u,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:s,onPanZoom:o,onPanZoomEnd:c}):ru({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});if(p.on(`wheel.zoom`,T,{passive:!1}),!r){let e=iu({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:s});f.on(`start`,e);let t=au({zoomPanValues:u,panOnDrag:a,onPaneContextMenu:!!n,onPanZoom:o,onTransformChange:w});f.on(`zoom`,t);let r=ou({zoomPanValues:u,panOnDrag:a,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:c,onDraggingChange:l});f.on(`end`,r)}let E=su({zoomActivationKeyPressed:S,panOnDrag:a,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C});f.filter(E),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=Zl(e),i=f?.constrain()(r,t,n);return i&&await g(i),new Promise(e=>e(i))}async function b(e,t){let n=Zl(e);return await g(n,t),new Promise(e=>e(n))}function x(e){if(p){let t=Zl(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?zs(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}function C(e,t){return p?new Promise(n=>{f?.scaleTo(eu(p,t?.duration,()=>n(!0)),e)}):Promise.resolve(!1)}function w(e,t){return p?new Promise(n=>{f?.scaleBy(eu(p,t?.duration,()=>n(!0)),e)}):Promise.resolve(!1)}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!jc(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var lu;(function(e){e.Line=`line`,e.Handle=`handle`})(lu||={});function uu({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function du(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function fu(e,t){return Math.max(0,t-e)}function pu(e,t){return Math.max(0,e-t)}function mu(e,t,n){return Math.max(0,t-e,e-n)}function hu(e,t){return e?!t:t}function gu(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),ee=-a[0]*x,te=-a[1]*S,ne=mu(E,h,g),O=mu(D,_,v);if(o){let e=0,t=0;c&&w<0?e=fu(y+w+ee,o[0][0]):!c&&w>0&&(e=pu(y+E+ee,o[1][0])),l&&T<0?t=fu(b+T+te,o[0][1]):!l&&T>0&&(t=pu(b+D+te,o[1][1])),ne=Math.max(ne,e),O=Math.max(O,t)}if(s){let e=0,t=0;c&&w>0?e=pu(y+w,s[0][0]):!c&&w<0&&(e=fu(y+E,s[1][0])),l&&T>0?t=pu(b+T,s[0][1]):!l&&T<0&&(t=fu(b+D,s[1][1])),ne=Math.max(ne,e),O=Math.max(O,t)}if(i){if(u){let e=mu(E/C,_,v)*C;if(ne=Math.max(ne,e),o){let e=0;e=!c&&!l||c&&!l&&f?pu(b+te+E/C,o[1][1])*C:fu(b+te+(c?w:-w)/C,o[0][1])*C,ne=Math.max(ne,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?fu(b+E/C,s[1][1])*C:pu(b+(c?w:-w)/C,s[0][1])*C,ne=Math.max(ne,e)}}if(d){let e=mu(D*C,h,g)/C;if(O=Math.max(O,e),o){let e=0;e=!c&&!l||l&&!c&&f?pu(y+D*C+ee,o[1][0])/C:fu(y+(l?T:-T)*C+ee,o[0][0])/C,O=Math.max(O,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?fu(y+D*C,s[1][0])/C:pu(y+(l?T:-T)*C,s[0][0])/C,O=Math.max(O,e)}}}T+=T<0?O:-O,w+=w<0?ne:-ne,i&&(f?E>D*C?T=(hu(c,l)?-w:w)/C:w=(hu(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let re=c?y+w:y,ie=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+re,y:a[1]*T*(l?-1:1)+ie}}var _u={width:0,height:0,x:0,y:0},vu={..._u,pointerX:0,pointerY:0,aspectRatio:1};function yu(e){return[[0,0],[e.measured.width,e.measured.height]]}function bu(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function xu({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=Si(e);function o({controlPosition:e,boundaries:o,keepAspectRatio:s,onResizeStart:c,onResize:l,onResizeEnd:u,shouldResize:d}){let f={..._u},p={...vu},m=du(e),h,g=null,_=[],v,y,b,x=Li().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:l}=n();if(h=r.get(t),!h)return;g=l?.getBoundingClientRect()??null;let{xSnapped:u,ySnapped:d}=Hc(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:g});f={width:h.measured.width??0,height:h.measured.height??0,x:h.position.x??0,y:h.position.y??0},p={...f,pointerX:u,pointerY:d,aspectRatio:f.width/f.height},v=void 0,h.parentId&&(h.extent===`parent`||h.expandParent)&&(v=r.get(h.parentId),y=v&&h.extent===`parent`?yu(v):void 0),_=[],b=void 0;for(let[e,n]of r)if(n.parentId===t&&(_.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=bu(n,h,n.origin??s);b=b?[[Math.min(e[0][0],b[0][0]),Math.min(e[0][1],b[0][1])],[Math.max(e[1][0],b[1][0]),Math.max(e[1][1],b[1][1])]]:e}c?.(e,{...f})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:c}=n(),u=Hc(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:g}),x=[];if(!h)return;let{x:S,y:C,width:w,height:T}=f,E={},D=h.origin??c,{width:ee,height:te,x:ne,y:O}=gu(p,m,u,o,s,D,y,b),re=ee!==w,ie=te!==T,ae=ne!==S&&re,oe=O!==C&&ie;if(!ae&&!oe&&!re&&!ie)return;if((ae||oe||D[0]===1||D[1]===1)&&(E.x=ae?ne:f.x,E.y=oe?O:f.y,f.x=E.x,f.y=E.y,_.length>0)){let e=ne-S,t=O-C;for(let n of _)n.position={x:n.position.x-e+D[0]*(ee-w),y:n.position.y-t+D[1]*(te-T)},x.push(n)}if((re||ie)&&(E.width=re?ee:f.width,E.height=ie?te:f.height,f.width=E.width,f.height=E.height),v&&h.expandParent){let e=D[0]*(E.width??0);E.x&&E.x<e&&(f.x=e,p.x-=E.x-e);let t=D[1]*(E.height??0);E.y&&E.y<t&&(f.y=t,p.y-=E.y-t)}let k=uu({width:f.width,prevWidth:w,height:f.height,prevHeight:T,affectsX:m.affectsX,affectsY:m.affectsY}),A={...f,direction:k};d?.(e,A)!==!1&&(l?.(e,A),r(E,x))}).on(`end`,e=>{u?.(e,{...f}),i?.()});a.call(x)}function s(){a.on(`.drag`,null)}return{update:o,destroy:s}}var Su=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Cu=o(((e,t)=>{t.exports=Su()})),wu=o((e=>{var t=d(),n=Cu();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Tu=c(o(((e,t)=>{t.exports=wu()}))(),1),Eu=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},Du=e=>e?Eu(e):Eu,{useDebugValue:Ou}=v.default,{useSyncExternalStoreWithSelector:ku}=Tu.default,Au=e=>e;function ju(e,t=Au,n){let r=ku(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Ou(r),r}var Mu=(e,t)=>{let n=Du(e),r=(e,r=t)=>ju(n,e,r);return Object.assign(r,n),r},Nu=(e,t)=>e?Mu(e,t):Mu;function Pu(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var Fu=h(),Iu=(0,v.createContext)(null),Lu=Iu.Provider,Ru=Ys.error001();function R(e,t){let n=(0,v.useContext)(Iu);if(n===null)throw Error(Ru);return ju(n,e,t)}function zu(){let e=(0,v.useContext)(Iu);if(e===null)throw Error(Ru);return(0,v.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var Bu={display:`none`},Vu={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},Hu=`react-flow__node-desc`,Uu=`react-flow__edge-desc`,Wu=`react-flow__aria-live`,Gu=e=>e.ariaLiveMessage;function Ku({rfId:e}){let t=R(Gu);return(0,M.jsx)(`div`,{id:`${Wu}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:Vu,children:t})}function qu({rfId:e,disableKeyboardA11y:t}){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{id:`${Hu}-${e}`,style:Bu,children:[`Press enter or space to select a node.`,!t&&`You can then use the arrow keys to move the node around.`,` Press delete to remove it and escape to cancel.`,` `]}),(0,M.jsx)(`div`,{id:`${Uu}-${e}`,style:Bu,children:`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`}),!t&&(0,M.jsx)(Ku,{rfId:e})]})}var Ju=e=>e.userSelectionActive?`none`:`all`,Yu=(0,v.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=R(Ju),s=`${e}`.split(`-`);return(0,M.jsx)(`div`,{className:_n([`react-flow__panel`,n,...s]),style:{...r,pointerEvents:o},ref:a,...i,children:t})});function Xu({proOptions:e,position:t=`bottom-right`}){return e?.hideAttribution?null:(0,M.jsx)(Yu,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev`,children:(0,M.jsx)(`a`,{href:`https://reactflow.dev`,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var Zu=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},Qu=e=>e.id;function $u(e,t){return Pu(e.selectedNodes.map(Qu),t.selectedNodes.map(Qu))&&Pu(e.selectedEdges.map(Qu),t.selectedEdges.map(Qu))}function ed({onSelectionChange:e}){let t=zu(),{selectedNodes:n,selectedEdges:r}=R(Zu,$u);return(0,v.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var td=e=>!!e.onSelectionChangeHandlers;function nd({onSelectionChange:e}){let t=R(td);return e||t?(0,M.jsx)(ed,{onSelectionChange:e}):null}var rd=[0,0],id={x:0,y:0,zoom:1},ad=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.onBeforeDelete.debug.autoPanSpeed.paneClickDistance`.split(`.`),`rfId`],od=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),sd={translateExtent:Xs,nodeOrigin:rd,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`,paneClickDistance:0};function cd(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c,setPaneClickDistance:l}=R(od,Pu),u=zu();(0,v.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=sd,s()}),[]);let d=(0,v.useRef)(sd);return(0,v.useEffect)(()=>{for(let s of ad){let c=e[s];c!==d.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`paneClickDistance`?l(c):s===`fitView`?u.setState({fitViewOnInit:c}):s===`fitViewOptions`?u.setState({fitViewOnInitOptions:c}):u.setState({[s]:c}))}d.current=e},ad.map(t=>e[t])),null}function ld(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function ud(e){let[t,n]=(0,v.useState)(e===`system`?null:e);return(0,v.useEffect)(()=>{if(e!==`system`){n(e);return}let t=ld(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?ld()?.matches?`dark`:`light`:t}var dd=typeof document<`u`?document:null;function fd(e=null,t={target:dd,actInsideInputWithModifier:!0}){let[n,r]=(0,v.useState)(!1),i=(0,v.useRef)(!1),a=(0,v.useRef)(new Set([])),[o,s]=(0,v.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(`+`,`
|
|
13
|
+
`).replace(`
|
|
14
|
+
|
|
15
|
+
`,`
|
|
16
|
+
+`).split(`
|
|
17
|
+
`));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,v.useEffect)(()=>{let n=t?.target||dd;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&Kc(e))return!1;let n=md(e.code,s);a.current.add(e[n]),pd(o,a.current,!1)&&(e.preventDefault(),r(!0))},c=e=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&Kc(e))return!1;let n=md(e.code,s);pd(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[n]),e.key===`Meta`&&a.current.clear(),i.current=!1},l=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,c),window.addEventListener(`blur`,l),window.addEventListener(`contextmenu`,l),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,c),window.removeEventListener(`blur`,l),window.removeEventListener(`contextmenu`,l)}}},[e,r]),n}function pd(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function md(e,t){return t.includes(e)?`code`:`key`}var hd=()=>{let e=zu();return(0,v.useMemo)(()=>({zoomIn:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},{duration:n?.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>{let{nodeLookup:n,minZoom:r,maxZoom:i,panZoom:a,domNode:o}=e.getState();if(!a||!o)return Promise.resolve(!1);let s=mc(n,t),{width:c,height:l}=Uc(o);return hc({nodes:s,width:c,height:l,minZoom:r,maxZoom:i,panZoom:a},t)},setCenter:async(t,n,r)=>{let{width:i,height:a,maxZoom:o,panZoom:s}=e.getState(),c=r?.zoom===void 0?o:r.zoom,l=i/2-t*c,u=a/2-n*c;return s?(await s.setViewport({x:l,y:u,zoom:c},{duration:r?.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=Ic(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{let{transform:r,snapGrid:i,domNode:a}=e.getState();if(!a)return t;let{x:o,y:s}=a.getBoundingClientRect();return Pc({x:t.x-o,y:t.y-s},r,n.snapToGrid,i)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=Fc(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function gd(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)_d(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function _d(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured??={},t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&(t.width=e.dimensions.width,t.height=e.dimensions.height)),typeof e.resizing==`boolean`&&(t.resizing=e.resizing)}}function vd(e,t){return gd(e,t)}function yd(e,t){return gd(e,t)}function bd(e,t){return{id:e,type:`select`,selected:t}}function xd(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);(a.selected!==void 0||e)&&a.selected!==e&&(n&&(a.selected=e),r.push(bd(a.id,e)))}return r}function Sd({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function Cd(e){return{id:e.id,type:`remove`}}var wd=e=>sc(e),Td=e=>oc(e);function Ed(e){return(0,v.forwardRef)(e)}var Dd=typeof window<`u`?v.useLayoutEffect:v.useEffect;function Od(e){let[t,n]=(0,v.useState)(BigInt(0)),[r]=(0,v.useState)(()=>kd(()=>n(e=>e+BigInt(1))));return Dd(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function kd(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var Ad=(0,v.createContext)(null);function jd({children:e}){let t=zu(),n=Od((0,v.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(Sd({items:s,lookup:o}))},[])),r=Od((0,v.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(Sd({items:s,lookup:o}))},[])),i=(0,v.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,M.jsx)(Ad.Provider,{value:i,children:e})}function Md(){let e=(0,v.useContext)(Ad);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var Nd=e=>!!e.panZoom;function Pd(){let e=hd(),t=zu(),n=Md(),r=R(Nd),i=(0,v.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=wd(e)?e:n.get(e.id),a=i.parentId?Vc(i.position,i.measured,i.parentId,n,r):i.position;return Ec({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&wd(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&Td(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await _c({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(Cd);o?.(f),c(e)}if(m){let e=d.map(Cd);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=Ac(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=kc(Ec(s?r:a),o);return n&&c>0||c>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=Ac(e)?e:a(e);if(!r)return!1;let i=kc(r,t);return n&&i>0||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return uc(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}-${n??null}`)?.values()??[])}},[]);return(0,v.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var Fd=e=>e.selected,Id={actInsideInputWithModifier:!1},Ld=typeof window<`u`?window:void 0;function Rd({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=zu(),{deleteElements:r}=Pd(),i=fd(e,Id),a=fd(t,{target:Ld});(0,v.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(Fd),edges:e.filter(Fd)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,v.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function zd(e){let t=zu();(0,v.useEffect)(()=>{let n=()=>{if(!e.current)return!1;let n=Uc(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,Ys.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var Bd={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},Vd=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function Hd({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=$s.Free,zoomOnDoubleClick:o=!0,panOnDrag:s=!0,defaultViewport:c,translateExtent:l,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:m,noWheelClassName:h,noPanClassName:g,onViewportChange:_,isControlledViewport:y,paneClickDistance:b}){let x=zu(),S=(0,v.useRef)(null),{userSelectionActive:C,lib:w}=R(Vd,Pu),T=fd(f),E=(0,v.useRef)();zd(S);let D=(0,v.useCallback)(e=>{_?.({x:e[0],y:e[1],zoom:e[2]}),y||x.setState({transform:e})},[_,y]);return(0,v.useEffect)(()=>{if(S.current){E.current=cu({domNode:S.current,minZoom:u,maxZoom:d,translateExtent:l,viewport:c,paneClickDistance:b,onDraggingChange:e=>x.setState({paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=x.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=x.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=x.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=E.current.getViewport();return x.setState({panZoom:E.current,transform:[e,t,n],domNode:S.current.closest(`.react-flow`)}),()=>{E.current?.destroy()}}},[]),(0,v.useEffect)(()=>{E.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:s,zoomActivationKeyPressed:T,preventScrolling:p,noPanClassName:g,userSelectionActive:C,noWheelClassName:h,lib:w,onTransformChange:D})},[e,t,n,r,i,a,o,s,T,p,g,C,h,w,D]),(0,M.jsx)(`div`,{className:`react-flow__renderer`,ref:S,style:Bd,children:m})}var Ud=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Wd(){let{userSelectionActive:e,userSelectionRect:t}=R(Ud,Pu);return e&&t?(0,M.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var Gd=(e,t)=>n=>{n.target===t.current&&e?.(n)},Kd=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function qd({isSelecting:e,selectionKeyPressed:t,selectionMode:n=ec.Full,panOnDrag:r,selectionOnDrag:i,onSelectionStart:a,onSelectionEnd:o,onPaneClick:s,onPaneContextMenu:c,onPaneScroll:l,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:p}){let m=(0,v.useRef)(null),h=zu(),g=(0,v.useRef)(0),_=(0,v.useRef)(0),y=(0,v.useRef)(),b=(0,v.useRef)(new Map),{userSelectionActive:x,elementsSelectable:S,dragging:C}=R(Kd,Pu),w=S&&(e||x),T=(0,v.useRef)(!1),E=(0,v.useRef)(!1),D=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,_.current=0},ee=e=>{T.current?T.current=!1:(s?.(e),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1}))},te=e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():c?.(e)},ne=l?e=>l(e):void 0,O=t=>{let{resetSelectedElements:n,domNode:r,edgeLookup:i}=h.getState();if(y.current=r?.getBoundingClientRect(),!S||!e||t.button!==0||t.target!==m.current||!y.current)return;t.target?.setPointerCapture?.(t.pointerId),E.current=!0,T.current=!1,b.current=new Map;for(let[e,t]of i)b.current.set(t.source,b.current.get(t.source)?.add(e)||new Set([e])),b.current.set(t.target,b.current.get(t.target)?.add(e)||new Set([e]));let{x:o,y:s}=Jc(t.nativeEvent,y.current);n(),h.setState({userSelectionRect:{width:0,height:0,startX:o,startY:s,x:o,y:s}}),a?.(t)},re=e=>{let{userSelectionRect:t,edgeLookup:r,transform:i,nodeLookup:a,triggerNodeChanges:o,triggerEdgeChanges:s}=h.getState();if(!y.current||!t)return;T.current=!0;let{x:c,y:l}=Jc(e.nativeEvent,y.current),{startX:u,startY:d}=t,f={startX:u,startY:d,x:c<u?c:u,y:l<d?l:d,width:Math.abs(c-u),height:Math.abs(l-d)},p=fc(a,f,i,n===ec.Partial,!0),m=new Set,v=new Set;for(let e of p){v.add(e.id);let t=b.current.get(e.id);if(t)for(let e of t)m.add(e)}g.current!==v.size&&(g.current=v.size,o(xd(a,v,!0))),_.current!==m.size&&(_.current=m.size,s(xd(r,m))),h.setState({userSelectionRect:f,userSelectionActive:!0,nodesSelectionActive:!1})},ie=e=>{if(e.button!==0||!E.current)return;e.target?.releasePointerCapture?.(e.pointerId);let{userSelectionRect:n}=h.getState();!x&&n&&e.target===m.current&&ee?.(e),g.current>0&&h.setState({nodesSelectionActive:!0}),D(),o?.(e),(t||i)&&(T.current=!1),E.current=!1},ae=r===!0||Array.isArray(r)&&r.includes(0);return(0,M.jsxs)(`div`,{className:_n([`react-flow__pane`,{draggable:ae,dragging:C,selection:e}]),onClick:w?void 0:Gd(ee,m),onContextMenu:Gd(te,m),onWheel:Gd(ne,m),onPointerEnter:w?void 0:u,onPointerDown:w?O:d,onPointerMove:w?re:d,onPointerUp:w?ie:void 0,onPointerLeave:f,ref:m,style:Bd,children:[p,(0,M.jsx)(Wd,{})]})}function Jd({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);l?(t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])):c?.(`012`,Ys.error012(e))}function Yd({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=zu(),[c,l]=(0,v.useState)(!1),u=(0,v.useRef)();return(0,v.useEffect)(()=>{u.current=Ll({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{Jd({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}})},[]),(0,v.useEffect)(()=>{if(t)u.current?.destroy();else if(e.current)return u.current?.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{u.current?.destroy()}},[n,r,t,a,e,i]),c}var Xd=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function Zd(){let e=zu();return(0,v.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=Xd(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=Nc(t,i));let{position:a,positionAbsolute:s}=gc({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var Qd=(0,v.createContext)(null),$d=Qd.Provider;Qd.Consumer;var ef=()=>(0,v.useContext)(Qd),tf=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),nf=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o,u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===Qs.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,valid:u&&l}};function rf({type:e=`source`,position:t=L.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=zu(),_=ef(),{connectOnClick:v,noPanClassName:y,rfId:b}=R(tf,Pu),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,valid:E}=R(nf(_,m,e),Pu);_||g.getState().onError?.(`010`,Ys.error010());let D=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t}=g.getState();t(al(i,e))}n?.(i),s?.(i)},ee=e=>{if(!_)return;let t=qc(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();ql.onPointerDown(e.nativeEvent,{autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:t.onConnectEnd,updateConnection:t.updateConnection,onConnect:D,isValidConnection:n||t.isValidConnection,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed})}t?u?.(e):d?.(e)};return(0,M.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:_n([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:E,connectionindicator:r&&(!T||w)&&(T?a:i)}]),onMouseDown:ee,onTouchStart:ee,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=Wc(t.target),h=n||c,{connection:v,isValid:y}=ql.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&D(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var af=(0,v.memo)(Ed(rf));function of({data:e,isConnectable:t,sourcePosition:n=L.Bottom}){return(0,M.jsxs)(M.Fragment,{children:[e?.label,(0,M.jsx)(af,{type:`source`,position:n,isConnectable:t})]})}function sf({data:e,isConnectable:t,targetPosition:n=L.Top,sourcePosition:r=L.Bottom}){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(af,{type:`target`,position:n,isConnectable:t}),e?.label,(0,M.jsx)(af,{type:`source`,position:r,isConnectable:t})]})}function cf(){return null}function lf({data:e,isConnectable:t,targetPosition:n=L.Top}){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(af,{type:`target`,position:n,isConnectable:t}),e?.label]})}var uf={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},df={input:of,default:sf,output:lf,group:cf};function ff(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var pf=e=>{let{width:t,height:n,x:r,y:i}=dc(e.nodeLookup,{filter:e=>!!e.selected});return{width:jc(t)?t:null,height:jc(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function mf({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=zu(),{width:i,height:a,transformString:o,userSelectionActive:s}=R(pf,Pu),c=Zd(),l=(0,v.useRef)(null);if((0,v.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]),Yd({nodeRef:l}),s||!i||!a)return null;let u=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,M.jsx)(`div`,{className:_n([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,M.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:u,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(uf,e.key)&&(e.preventDefault(),c({direction:uf[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var hf=typeof window<`u`?window:void 0,gf=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function _f({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,defaultViewport:T,translateExtent:E,minZoom:D,maxZoom:ee,preventScrolling:te,onSelectionContextMenu:ne,noWheelClassName:O,noPanClassName:re,disableKeyboardA11y:ie,onViewportChange:ae,isControlledViewport:oe}){let{nodesSelectionActive:k,userSelectionActive:A}=R(gf),se=fd(l,{target:hf}),ce=fd(h,{target:hf}),j=ce||w,le=ce||b,ue=u&&j!==!0,de=se||A||ue;return Rd({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,M.jsx)(Hd,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:le,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!se&&j,defaultViewport:T,translateExtent:E,minZoom:D,maxZoom:ee,zoomActivationKeyCode:g,preventScrolling:te,noWheelClassName:O,noPanClassName:re,onViewportChange:ae,isControlledViewport:oe,paneClickDistance:s,children:(0,M.jsxs)(qd,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:j,isSelecting:!!de,selectionMode:d,selectionKeyPressed:se,selectionOnDrag:ue,children:[e,k&&(0,M.jsx)(mf,{onSelectionContextMenu:ne,noPanClassName:re,disableKeyboardA11y:ie})]})})}_f.displayName=`FlowRenderer`;var vf=(0,v.memo)(_f),yf=e=>t=>e?fc(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function bf(e){return R((0,v.useCallback)(yf(e),[e]),Pu)}var xf=e=>e.updateNodeInternals;function Sf(){let e=R(xf),[t]=(0,v.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,v.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function Cf({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=zu(),a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useRef)(e.sourcePosition),c=(0,v.useRef)(e.targetPosition),l=(0,v.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,v.useEffect)(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,v.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,v.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function wf({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeExtent:_,nodeClickDistance:v,onError:y}){let{node:b,internals:x,isParent:S}=R(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},Pu),C=b.type||`default`,w=g?.[C]||df[C];w===void 0&&(y?.(`003`,Ys.error003(C)),C=`default`,w=df.default);let T=!!(b.draggable||s&&b.draggable===void 0),E=!!(b.selectable||c&&b.selectable===void 0),D=!!(b.connectable||l&&b.connectable===void 0),ee=!!(b.focusable||u&&b.focusable===void 0),te=zu(),ne=Bc(b),O=Cf({node:b,nodeType:C,hasDimensions:ne,resizeObserver:d}),re=Yd({nodeRef:O,disabled:b.hidden||!T,noDragClassName:f,handleSelector:b.dragHandle,nodeId:e,isSelectable:E,nodeClickDistance:v}),ie=Zd();if(b.hidden)return null;let ae=zc(b),oe=ff(b),k=E||T||t||n||r||i,A=n?e=>n(e,{...x.userNode}):void 0,se=r?e=>r(e,{...x.userNode}):void 0,ce=i?e=>i(e,{...x.userNode}):void 0,j=a?e=>a(e,{...x.userNode}):void 0,le=o?e=>o(e,{...x.userNode}):void 0,ue=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=te.getState();E&&(!r||!T||i>0)&&Jd({id:e,store:te,nodeRef:O}),t&&t(n,{...x.userNode})},de=t=>{if(!(Kc(t.nativeEvent)||m)){if(Zs.includes(t.key)&&E){let n=t.key===`Escape`;Jd({id:e,store:te,unselect:n,nodeRef:O})}else T&&b.selected&&Object.prototype.hasOwnProperty.call(uf,t.key)&&(t.preventDefault(),te.setState({ariaLiveMessage:`Moved selected node ${t.key.replace(`Arrow`,``).toLowerCase()}. New position, x: ${~~x.positionAbsolute.x}, y: ${~~x.positionAbsolute.y}`}),ie({direction:uf[t.key],factor:t.shiftKey?4:1}))}};return(0,M.jsx)(`div`,{className:_n([`react-flow__node`,`react-flow__node-${C}`,{[p]:T},b.className,{selected:b.selected,selectable:E,parent:S,draggable:T,dragging:re}]),ref:O,style:{zIndex:x.z,transform:`translate(${x.positionAbsolute.x}px,${x.positionAbsolute.y}px)`,pointerEvents:k?`all`:`none`,visibility:ne?`visible`:`hidden`,...b.style,...oe},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:A,onMouseMove:se,onMouseLeave:ce,onContextMenu:j,onClick:ue,onDoubleClick:le,onKeyDown:ee?de:void 0,tabIndex:ee?0:void 0,role:ee?`button`:void 0,"aria-describedby":m?void 0:`${Hu}-${h}`,"aria-label":b.ariaLabel,children:(0,M.jsx)($d,{value:e,children:(0,M.jsx)(w,{id:e,data:b.data,type:C,positionAbsoluteX:x.positionAbsolute.x,positionAbsoluteY:x.positionAbsolute.y,selected:b.selected,selectable:E,draggable:T,deletable:b.deletable??!0,isConnectable:D,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:re,dragHandle:b.dragHandle,zIndex:x.z,parentId:b.parentId,...ae})})})}var Tf=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Ef(e){let{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=R(Tf,Pu),o=bf(e.onlyRenderVisibleElements),s=Sf();return(0,M.jsx)(`div`,{className:`react-flow__nodes`,style:Bd,children:o.map(o=>(0,M.jsx)(wf,{id:o,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},o))})}Ef.displayName=`NodeRenderer`;var Df=(0,v.memo)(Ef);function Of(e){return R((0,v.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&nl({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),Pu)}var kf=({color:e=`none`,strokeWidth:t=1})=>(0,M.jsx)(`polyline`,{style:{stroke:e,strokeWidth:t},strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`,points:`-5,-4 0,0 -5,4`}),Af=({color:e=`none`,strokeWidth:t=1})=>(0,M.jsx)(`polyline`,{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`}),jf={[rc.Arrow]:kf,[rc.ArrowClosed]:Af};function Mf(e){let t=zu();return(0,v.useMemo)(()=>Object.prototype.hasOwnProperty.call(jf,e)?jf[e]:(t.getState().onError?.(`009`,Ys.error009(e)),null),[e])}var Nf=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=Mf(t);return c?(0,M.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,M.jsx)(c,{color:n,strokeWidth:o})}):null},Pf=({defaultColor:e,rfId:t})=>{let n=R(e=>e.edges),r=R(e=>e.defaultEdgeOptions),i=(0,v.useMemo)(()=>yl(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,M.jsx)(`svg`,{className:`react-flow__marker`,children:(0,M.jsx)(`defs`,{children:i.map(e=>(0,M.jsx)(Nf,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};Pf.displayName=`MarkerDefinitions`;var Ff=(0,v.memo)(Pf);function If({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:a={},labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,v.useState)({x:1,y:0,width:0,height:0}),p=_n([`react-flow__edge-textwrapper`,l]),m=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n===void 0||!n?null:(0,M.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,M.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,M.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]})}If.displayName=`EdgeText`;var Lf=(0,v.memo)(If);function Rf({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`path`,{...u,d:e,fill:`none`,className:_n([`react-flow__edge-path`,u.className])}),l&&(0,M.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}),r&&jc(t)&&jc(n)?(0,M.jsx)(Lf,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function zf({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===L.Left||e===L.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function Bf({sourceX:e,sourceY:t,sourcePosition:n=L.Bottom,targetX:r,targetY:i,targetPosition:a=L.Top}){let[o,s]=zf({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=zf({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=Xc({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function Vf(e){return(0,v.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=L.Bottom,targetPosition:s=L.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=Bf({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return(0,M.jsx)(Rf,{id:x,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var Hf=Vf({isInternal:!1}),Uf=Vf({isInternal:!0});Hf.displayName=`SimpleBezierEdge`,Uf.displayName=`SimpleBezierEdgeInternal`;function Wf(e){return(0,v.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=L.Bottom,targetPosition:m=L.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=fl({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset}),S=e.isInternal?void 0:t;return(0,M.jsx)(Rf,{id:S,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var Gf=Wf({isInternal:!1}),Kf=Wf({isInternal:!0});Gf.displayName=`SmoothStepEdge`,Kf.displayName=`SmoothStepEdgeInternal`;function qf(e){return(0,v.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,M.jsx)(Gf,{...n,id:r,pathOptions:(0,v.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var Jf=qf({isInternal:!1}),Yf=qf({isInternal:!0});Jf.displayName=`StepEdge`,Yf.displayName=`StepEdgeInternal`;function Xf(e){return(0,v.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=ol({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return(0,M.jsx)(Rf,{id:y,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var Zf=Xf({isInternal:!1}),Qf=Xf({isInternal:!0});Zf.displayName=`StraightEdge`,Qf.displayName=`StraightEdgeInternal`;function $f(e){return(0,v.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=L.Bottom,targetPosition:s=L.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=$c({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature}),S=e.isInternal?void 0:t;return(0,M.jsx)(Rf,{id:S,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var ep=$f({isInternal:!1}),tp=$f({isInternal:!0});ep.displayName=`BezierEdge`,tp.displayName=`BezierEdgeInternal`;var np={default:tp,straight:Qf,step:Yf,smoothstep:Kf,simplebezier:Uf},rp={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},ip=(e,t,n)=>n===L.Left?e-t:n===L.Right?e+t:e,ap=(e,t,n)=>n===L.Top?e-t:n===L.Bottom?e+t:e,op=`react-flow__edgeupdater`;function sp({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,M.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:_n([op,`${op}-${s}`]),cx:ip(t,r,e),cy:ap(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function cp({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=zu(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,isValidConnection:a,connectionMode:o,connectionRadius:s,lib:c,onConnectStart:p,onConnectEnd:h,cancelConnection:g,nodeLookup:_,rfId:v,panBy:y,updateConnection:b}=m.getState(),x=t.type===`target`;f(!0),u?.(e,n,t.type),ql.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:o,connectionRadius:s,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:_,isTarget:x,edgeUpdaterType:t.type,lib:c,flowId:v,cancelConnection:g,panBy:y,isValidConnection:a,onConnect:e=>l?.(n,e),onConnectStart:p,onConnectEnd:h,onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:b,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,M.jsxs)(M.Fragment,{children:[(e===!0||e===`source`)&&(0,M.jsx)(sp,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,M.jsx)(sp,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function lp({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:y}){let b=R(t=>t.edgeLookup.get(e)),x=R(e=>e.defaultEdgeOptions);b=x?{...x,...b}:b;let S=b.type||`default`,C=h?.[S]||np[S];C===void 0&&(_?.(`011`,Ys.error011(S)),S=`default`,C=np.default);let w=!!(b.focusable||t&&b.focusable===void 0),T=d!==void 0&&(b.reconnectable||n&&b.reconnectable===void 0),E=!!(b.selectable||r&&b.selectable===void 0),D=(0,v.useRef)(null),[ee,te]=(0,v.useState)(!1),[ne,O]=(0,v.useState)(!1),re=zu(),{zIndex:ie,sourceX:ae,sourceY:oe,targetX:k,targetY:A,sourcePosition:se,targetPosition:ce}=R((0,v.useCallback)(t=>{let n=t.nodeLookup.get(b.source),r=t.nodeLookup.get(b.target);if(!n||!r)return{zIndex:b.zIndex,...rp};let i=ml({id:e,sourceNode:n,targetNode:r,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:t.connectionMode,onError:_});return{zIndex:tl({selected:b.selected,zIndex:b.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect}),...i||rp}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex]),Pu),j=(0,v.useMemo)(()=>b.markerStart?`url('#${vl(b.markerStart,m)}')`:void 0,[b.markerStart,m]),le=(0,v.useMemo)(()=>b.markerEnd?`url('#${vl(b.markerEnd,m)}')`:void 0,[b.markerEnd,m]);if(b.hidden||ae===null||oe===null||k===null||A===null)return null;let ue=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=re.getState();E&&(re.setState({nodesSelectionActive:!1}),b.selected&&a?(r({nodes:[],edges:[b]}),D.current?.blur()):n([e])),i&&i(t,b)},de=a?e=>{a(e,{...b})}:void 0,N=o?e=>{o(e,{...b})}:void 0,P=s?e=>{s(e,{...b})}:void 0,fe=c?e=>{c(e,{...b})}:void 0,pe=l?e=>{l(e,{...b})}:void 0;return(0,M.jsx)(`svg`,{style:{zIndex:ie},children:(0,M.jsxs)(`g`,{className:_n([`react-flow__edge`,`react-flow__edge-${S}`,b.className,g,{selected:b.selected,animated:b.animated,inactive:!E&&!i,updating:ee,selectable:E}]),onClick:ue,onDoubleClick:de,onContextMenu:N,onMouseEnter:P,onMouseMove:fe,onMouseLeave:pe,onKeyDown:w?t=>{if(!y&&Zs.includes(t.key)&&E){let{unselectNodesAndEdges:n,addSelectedEdges:r}=re.getState();t.key===`Escape`?(D.current?.blur(),n({edges:[b]})):r([e])}}:void 0,tabIndex:w?0:void 0,role:w?`button`:`img`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":w?`${Uu}-${m}`:void 0,ref:D,children:[!ne&&(0,M.jsx)(C,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:E,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:ae,sourceY:oe,targetX:k,targetY:A,sourcePosition:se,targetPosition:ce,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:j,markerEnd:le,pathOptions:`pathOptions`in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),T&&(0,M.jsx)(cp,{edge:b,isReconnectable:T,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:ae,sourceY:oe,targetX:k,targetY:A,sourcePosition:se,targetPosition:ce,setUpdateHover:te,setReconnecting:O})]})})}var up=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function dp({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=R(up,Pu),b=Of(t);return(0,M.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,M.jsx)(Ff,{defaultColor:e,rfId:n}),b.map(e=>(0,M.jsx)(lp,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}dp.displayName=`EdgeRenderer`;var fp=(0,v.memo)(dp),pp=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function mp({children:e}){let t=R(pp);return(0,M.jsx)(`div`,{className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:t},children:e})}function hp(e){let t=Pd(),n=(0,v.useRef)(!1);(0,v.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var gp=e=>e.panZoom?.syncViewport;function _p(e){let t=R(gp),n=zu();return(0,v.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function vp(e){return e.connection.inProgress?{...e.connection,to:Pc(e.connection.to,e.transform)}:{...e.connection}}function yp(e){return e?t=>e(vp(t)):vp}function bp(e){return R(yp(e),Pu)}var xp=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Sp({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=R(xp,Pu);return a&&i&&c?(0,M.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,M.jsx)(`g`,{className:_n([`react-flow__connection`,ac(s)]),children:(0,M.jsx)(Cp,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var Cp=({style:e,type:t=nc.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f}=bp();if(!i)return;if(n)return(0,M.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:ac(r),toNode:u,toHandle:d});let p=``,m={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case nc.Bezier:[p]=$c(m);break;case nc.SimpleBezier:[p]=Bf(m);break;case nc.Step:[p]=fl({...m,borderRadius:0});break;case nc.SmoothStep:[p]=fl(m);break;default:[p]=ol(m)}return(0,M.jsx)(`path`,{d:p,fill:`none`,className:`react-flow__connection-path`,style:e})};Cp.displayName=`ConnectionLine`;var wp={};function Tp(e=wp){(0,v.useRef)(e),zu(),(0,v.useEffect)(()=>{},[e])}function Ep(){zu(),(0,v.useRef)(!1),(0,v.useEffect)(()=>{},[])}function Dp({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:ee,minZoom:te,maxZoom:ne,preventScrolling:O,defaultMarkerColor:re,zoomOnScroll:ie,zoomOnPinch:ae,panOnScroll:oe,panOnScrollSpeed:k,panOnScrollMode:A,zoomOnDoubleClick:se,panOnDrag:ce,onPaneClick:j,onPaneMouseEnter:le,onPaneMouseMove:ue,onPaneMouseLeave:de,onPaneScroll:N,onPaneContextMenu:P,paneClickDistance:fe,nodeClickDistance:pe,onEdgeContextMenu:me,onEdgeMouseEnter:he,onEdgeMouseMove:F,onEdgeMouseLeave:ge,reconnectRadius:_e,onReconnect:ve,onReconnectStart:ye,onReconnectEnd:be,noDragClassName:xe,noWheelClassName:Se,noPanClassName:Ce,disableKeyboardA11y:we,nodeExtent:Te,rfId:Ee,viewport:De,onViewportChange:Oe}){return Tp(e),Tp(t),Ep(),hp(n),_p(De),(0,M.jsx)(vf,{onPaneClick:j,onPaneMouseEnter:le,onPaneMouseMove:ue,onPaneMouseLeave:de,onPaneContextMenu:P,onPaneScroll:N,paneClickDistance:fe,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:ie,zoomOnPinch:ae,zoomOnDoubleClick:se,panOnScroll:oe,panOnScrollSpeed:k,panOnScrollMode:A,panOnDrag:ce,defaultViewport:D,translateExtent:ee,minZoom:te,maxZoom:ne,onSelectionContextMenu:d,preventScrolling:O,noDragClassName:xe,noWheelClassName:Se,noPanClassName:Ce,disableKeyboardA11y:we,onViewportChange:Oe,isControlledViewport:!!De,children:(0,M.jsxs)(mp,{children:[(0,M.jsx)(fp,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:ve,onReconnectStart:ye,onReconnectEnd:be,onlyRenderVisibleElements:T,onEdgeContextMenu:me,onEdgeMouseEnter:he,onEdgeMouseMove:F,onEdgeMouseLeave:ge,reconnectRadius:_e,defaultMarkerColor:re,noPanClassName:Ce,disableKeyboardA11y:we,rfId:Ee}),(0,M.jsx)(Sp,{style:h,type:m,component:g,containerStyle:_}),(0,M.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,M.jsx)(Df,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:pe,onlyRenderVisibleElements:T,noPanClassName:Ce,noDragClassName:xe,disableKeyboardA11y:we,nodeExtent:Te,rfId:Ee}),(0,M.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}Dp.displayName=`GraphView`;var Op=(0,v.memo)(Dp),kp=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,nodeOrigin:s,nodeExtent:c}={})=>{let l=new Map,u=new Map,d=new Map,f=new Map,p=r??t??[],m=n??e??[],h=s??[0,0],g=c??Xs;Ml(d,f,p),wl(m,l,u,{nodeOrigin:h,nodeExtent:g,elevateNodesOnSelect:!1});let _=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=Ic(dc(l,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),i,a,.5,2,.1);_=[e,t,n]}return{rfId:`1`,width:0,height:0,transform:_,nodes:m,nodeLookup:l,parentLookup:u,edges:p,edgeLookup:f,connectionLookup:d,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:Xs,nodeExtent:g,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Qs.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:h,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...tc},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:Mc,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1}},Ap=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,nodeOrigin:s,nodeExtent:c})=>Nu((l,u)=>({...kp({nodes:e,edges:t,width:i,height:a,fitView:o,nodeOrigin:s,nodeExtent:c,defaultNodes:n,defaultEdges:r}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:i}=u();wl(e,t,n,{nodeOrigin:r,nodeExtent:c,elevateNodesOnSelect:i,checkEquality:!0}),l({nodes:e})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=u();Ml(t,n,e),l({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=u();t(e),l({hasDefaultNodes:!0})}if(t){let{setEdges:e}=u();e(t),l({hasDefaultEdges:!0})}},updateNodeInternals:(e,t={triggerFitView:!0})=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,fitViewOnInit:a,fitViewDone:o,fitViewOnInitOptions:s,domNode:c,nodeOrigin:d,nodeExtent:f,debug:p,fitViewSync:m}=u(),{changes:h,updatedInternals:g}=Al(e,r,i,c,d,f);if(g){if(Cl(r,i,{nodeOrigin:d,nodeExtent:f}),t.triggerFitView){let e=o;!o&&a&&(e=m({...s,nodes:s?.nodes})),l({fitViewDone:e})}else l({});h?.length>0&&(p&&console.log(`React Flow: trigger node changes`,h),n?.(h))}},updateNodePositions:(e,t=!1)=>{let n=[],r=[];for(let[i,a]of e){let e=!!(a?.expandParent&&a?.parentId&&a?.position),o={id:i,type:`position`,position:e?{x:Math.max(0,a.position.x),y:Math.max(0,a.position.y)}:a.position,dragging:t};e&&n.push({id:i,parentId:a.parentId,rect:{...a.internals.positionAbsolute,width:a.measured.width,height:a.measured.height}}),r.push(o)}if(n.length>0){let{nodeLookup:e,parentLookup:t,nodeOrigin:i}=u(),a=kl(n,e,t,i);r.push(...a)}u().triggerNodeChanges(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=u();e?.length&&(i&&n(vd(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=u();e?.length&&(i&&n(yd(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=u();t?i(e.map(e=>bd(e,!0))):(i(xd(r,new Set([...e]),!0)),a(xd(n)))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=u();t?a(e.map(e=>bd(e,!0))):(a(xd(n,new Set([...e]))),i(xd(r,new Set,!0)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=u(),s=e||r,c=t||n,l=s.map(e=>{let t=i.get(e.id);return t&&(t.selected=!1),bd(e.id,!1)}),d=c.map(e=>bd(e.id,!1));a(l),o(d)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=u();t?.setScaleExtent([e,n]),l({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=u();t?.setScaleExtent([n,e]),l({maxZoom:e})},setTranslateExtent:e=>{u().panZoom?.setTranslateExtent(e),l({translateExtent:e})},setPaneClickDistance:e=>{u().panZoom?.setClickDistance(e)},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r}=u(),i=t.reduce((e,t)=>t.selected?[...e,bd(t.id,!1)]:e,[]),a=e.reduce((e,t)=>t.selected?[...e,bd(t.id,!1)]:e,[]);n(i),r(a)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o}=u();(e[0][0]!==o[0][0]||e[0][1]!==o[0][1]||e[1][0]!==o[1][0]||e[1][1]!==o[1][1])&&(wl(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1}),l({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=u();return jl({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},fitView:e=>{let{panZoom:t,width:n,height:r,minZoom:i,maxZoom:a,nodeLookup:o}=u();return t?hc({nodes:mc(o,e),width:n,height:r,panZoom:t,minZoom:i,maxZoom:a},e):Promise.resolve(!1)},fitViewSync:e=>{let{panZoom:t,width:n,height:r,minZoom:i,maxZoom:a,nodeLookup:o}=u();if(!t)return!1;let s=mc(o,e);return hc({nodes:s,width:n,height:r,panZoom:t,minZoom:i,maxZoom:a},e),s.size>0},cancelConnection:()=>{l({connection:{...tc}})},updateConnection:e=>{l({connection:e})},reset:()=>l({...kp()})}),Object.is);function jp({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,fitView:o,nodeOrigin:s,nodeExtent:c,children:l}){let[u]=(0,v.useState)(()=>Ap({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,nodeOrigin:s,nodeExtent:c}));return(0,M.jsx)(Lu,{value:u,children:(0,M.jsx)(jd,{children:l})})}function Mp({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,nodeOrigin:c,nodeExtent:l}){return(0,v.useContext)(Iu)?(0,M.jsx)(M.Fragment,{children:e}):(0,M.jsx)(jp,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,nodeOrigin:c,nodeExtent:l,children:e})}var Np={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function Pp({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onNodesDelete:E,onEdgesDelete:D,onDelete:ee,onSelectionChange:te,onSelectionDragStart:ne,onSelectionDrag:O,onSelectionDragStop:re,onSelectionContextMenu:ie,onSelectionStart:ae,onSelectionEnd:oe,onBeforeDelete:k,connectionMode:A,connectionLineType:se=nc.Bezier,connectionLineStyle:ce,connectionLineComponent:j,connectionLineContainerStyle:le,deleteKeyCode:ue=`Backspace`,selectionKeyCode:de=`Shift`,selectionOnDrag:N=!1,selectionMode:P=ec.Full,panActivationKeyCode:fe=`Space`,multiSelectionKeyCode:pe=Lc()?`Meta`:`Control`,zoomActivationKeyCode:me=Lc()?`Meta`:`Control`,snapToGrid:he,snapGrid:F,onlyRenderVisibleElements:ge=!1,selectNodesOnDrag:_e,nodesDraggable:ve,nodesConnectable:ye,nodesFocusable:be,nodeOrigin:xe=rd,edgesFocusable:Se,edgesReconnectable:Ce,elementsSelectable:we=!0,defaultViewport:Te=id,minZoom:Ee=.5,maxZoom:De=2,translateExtent:Oe=Xs,preventScrolling:ke=!0,nodeExtent:Ae,defaultMarkerColor:je=`#b1b1b7`,zoomOnScroll:Me=!0,zoomOnPinch:Ne=!0,panOnScroll:Pe=!1,panOnScrollSpeed:Fe=.5,panOnScrollMode:Ie=$s.Free,zoomOnDoubleClick:Le=!0,panOnDrag:Re=!0,onPaneClick:ze,onPaneMouseEnter:Be,onPaneMouseMove:Ve,onPaneMouseLeave:He,onPaneScroll:Ue,onPaneContextMenu:We,paneClickDistance:Ge=0,nodeClickDistance:Ke=0,children:qe,onReconnect:Je,onReconnectStart:Ye,onReconnectEnd:Xe,onEdgeContextMenu:Ze,onEdgeDoubleClick:Qe,onEdgeMouseEnter:$e,onEdgeMouseMove:et,onEdgeMouseLeave:tt,reconnectRadius:nt=10,onNodesChange:rt,onEdgesChange:it,noDragClassName:at=`nodrag`,noWheelClassName:ot=`nowheel`,noPanClassName:st=`nopan`,fitView:ct,fitViewOptions:lt,connectOnClick:ut,attributionPosition:dt,proOptions:ft,defaultEdgeOptions:pt,elevateNodesOnSelect:mt,elevateEdgesOnSelect:ht,disableKeyboardA11y:gt=!1,autoPanOnConnect:_t,autoPanOnNodeDrag:vt,autoPanSpeed:yt,connectionRadius:bt,isValidConnection:xt,onError:St,style:I,id:Ct,nodeDragThreshold:wt,viewport:Tt,onViewportChange:Et,width:Dt,height:Ot,colorMode:kt=`light`,debug:At,...jt},Mt){let Nt=Ct||`1`,Pt=ud(kt);return(0,M.jsx)(`div`,{"data-testid":`rf__wrapper`,...jt,style:{...I,...Np},ref:Mt,className:_n([`react-flow`,i,Pt]),id:Ct,children:(0,M.jsxs)(Mp,{nodes:e,edges:t,width:Dt,height:Ot,fitView:ct,nodeOrigin:xe,nodeExtent:Ae,children:[(0,M.jsx)(Op,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:o,connectionLineType:se,connectionLineStyle:ce,connectionLineComponent:j,connectionLineContainerStyle:le,selectionKeyCode:de,selectionOnDrag:N,selectionMode:P,deleteKeyCode:ue,multiSelectionKeyCode:pe,panActivationKeyCode:fe,zoomActivationKeyCode:me,onlyRenderVisibleElements:ge,defaultViewport:Te,translateExtent:Oe,minZoom:Ee,maxZoom:De,preventScrolling:ke,zoomOnScroll:Me,zoomOnPinch:Ne,zoomOnDoubleClick:Le,panOnScroll:Pe,panOnScrollSpeed:Fe,panOnScrollMode:Ie,panOnDrag:Re,onPaneClick:ze,onPaneMouseEnter:Be,onPaneMouseMove:Ve,onPaneMouseLeave:He,onPaneScroll:Ue,onPaneContextMenu:We,paneClickDistance:Ge,nodeClickDistance:Ke,onSelectionContextMenu:ie,onSelectionStart:ae,onSelectionEnd:oe,onReconnect:Je,onReconnectStart:Ye,onReconnectEnd:Xe,onEdgeContextMenu:Ze,onEdgeDoubleClick:Qe,onEdgeMouseEnter:$e,onEdgeMouseMove:et,onEdgeMouseLeave:tt,reconnectRadius:nt,defaultMarkerColor:je,noDragClassName:at,noWheelClassName:ot,noPanClassName:st,rfId:Nt,disableKeyboardA11y:gt,nodeExtent:Ae,viewport:Tt,onViewportChange:Et}),(0,M.jsx)(cd,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:ve,nodesConnectable:ye,nodesFocusable:be,edgesFocusable:Se,edgesReconnectable:Ce,elementsSelectable:we,elevateNodesOnSelect:mt,elevateEdgesOnSelect:ht,minZoom:Ee,maxZoom:De,nodeExtent:Ae,onNodesChange:rt,onEdgesChange:it,snapToGrid:he,snapGrid:F,connectionMode:A,translateExtent:Oe,connectOnClick:ut,defaultEdgeOptions:pt,fitView:ct,fitViewOptions:lt,onNodesDelete:E,onEdgesDelete:D,onDelete:ee,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onSelectionDrag:O,onSelectionDragStart:ne,onSelectionDragStop:re,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:st,nodeOrigin:xe,rfId:Nt,autoPanOnConnect:_t,autoPanOnNodeDrag:vt,autoPanSpeed:yt,onError:St,connectionRadius:bt,isValidConnection:xt,selectNodesOnDrag:_e,nodeDragThreshold:wt,onBeforeDelete:k,paneClickDistance:Ge,debug:At}),(0,M.jsx)(nd,{onSelectionChange:te}),qe,(0,M.jsx)(Xu,{proOptions:ft,position:dt}),(0,M.jsx)(qu,{rfId:Nt,disableKeyboardA11y:gt})]})})}var Fp=Ed(Pp),Ip=e=>e.domNode?.querySelector(`.react-flow__edgelabel-renderer`);function Lp({children:e}){let t=R(Ip);return t?(0,Fu.createPortal)(e,t):null}function Rp(e){return R((0,v.useCallback)(t=>t.nodeLookup.get(e),[e]),Pu)}function zp({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,M.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:_n([`react-flow__background-pattern`,n,r])})}function Bp({radius:e,className:t}){return(0,M.jsx)(`circle`,{cx:e,cy:e,r:e,className:_n([`react-flow__background-pattern`,`dots`,t])})}var Vp;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(Vp||={});var Hp={[Vp.Dots]:1,[Vp.Lines]:1,[Vp.Cross]:6},Up=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Wp({id:e,variant:t=Vp.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,v.useRef)(null),{transform:f,patternId:p}=R(Up,Pu),m=r||Hp[t],h=t===Vp.Dots,g=t===Vp.Cross,_=Array.isArray(n)?n:[n,n],y=[_[0]*f[2]||1,_[1]*f[2]||1],b=m*f[2],x=Array.isArray(a)?a:[a,a],S=g?[b,b]:y,C=[x[0]*f[2]||1+S[0]/2,x[1]*f[2]||1+S[1]/2],w=`${p}${e||``}`;return(0,M.jsxs)(`svg`,{className:_n([`react-flow__background`,l]),style:{...c,...Bd,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,M.jsx)(`pattern`,{id:w,x:f[0]%y[0],y:f[1]%y[1],width:y[0],height:y[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${C[0]},-${C[1]})`,children:h?(0,M.jsx)(Bp,{radius:b/2,className:u}):(0,M.jsx)(zp,{dimensions:S,lineWidth:i,variant:t,className:u})}),(0,M.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${w})`})]})}Wp.displayName=`Background`;var Gp=(0,v.memo)(Wp);function Kp(){return(0,M.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,M.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function qp(){return(0,M.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,M.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function Jp(){return(0,M.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,M.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function Yp(){return(0,M.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,M.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function Xp(){return(0,M.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,M.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function Zp({children:e,className:t,...n}){return(0,M.jsx)(`button`,{type:`button`,className:_n([`react-flow__controls-button`,t]),...n,children:e})}var Qp=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function $p({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p=`React Flow controls`}){let m=zu(),{isInteractive:h,minZoomReached:g,maxZoomReached:_}=R(Qp,Pu),{zoomIn:v,zoomOut:y,fitView:b}=Pd();return(0,M.jsxs)(Yu,{className:_n([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p,children:[t&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Zp,{onClick:()=>{v(),a?.()},className:`react-flow__controls-zoomin`,title:`zoom in`,"aria-label":`zoom in`,disabled:_,children:(0,M.jsx)(Kp,{})}),(0,M.jsx)(Zp,{onClick:()=>{y(),o?.()},className:`react-flow__controls-zoomout`,title:`zoom out`,"aria-label":`zoom out`,disabled:g,children:(0,M.jsx)(qp,{})})]}),n&&(0,M.jsx)(Zp,{className:`react-flow__controls-fitview`,onClick:()=>{b(i),s?.()},title:`fit view`,"aria-label":`fit view`,children:(0,M.jsx)(Jp,{})}),r&&(0,M.jsx)(Zp,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:`toggle interactivity`,"aria-label":`toggle interactivity`,children:h?(0,M.jsx)(Xp,{}):(0,M.jsx)(Yp,{})}),u]})}$p.displayName=`Controls`,(0,v.memo)($p);function em({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,M.jsx)(`rect`,{className:_n([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var tm=(0,v.memo)(em),nm=e=>e.nodes.map(e=>e.id),rm=e=>e instanceof Function?e:()=>e;function im({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=tm,onClick:o}){let s=R(nm,Pu),c=rm(t),l=rm(e),u=rm(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,M.jsx)(M.Fragment,{children:s.map(e=>(0,M.jsx)(om,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function am({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=R(t=>{let n=t.nodeLookup.get(e),{x:r,y:i}=n.internals.positionAbsolute,{width:a,height:o}=zc(n);return{node:n,x:r,y:i,width:a,height:o}},Pu);return!l||l.hidden||!Bc(l)?null:(0,M.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var om=(0,v.memo)(am),sm=(0,v.memo)(im),cm=200,lm=150,um=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Oc(dc(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},dm=`react-flow__minimap-desc`;function fm({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_=`React Flow mini map`,inversePan:y,zoomStep:b=10,offsetScale:x=5}){let S=zu(),C=(0,v.useRef)(null),{boundingRect:w,viewBB:T,rfId:E,panZoom:D,translateExtent:ee,flowWidth:te,flowHeight:ne}=R(um,Pu),O=e?.width??cm,re=e?.height??lm,ie=w.width/O,ae=w.height/re,oe=Math.max(ie,ae),k=oe*O,A=oe*re,se=x*oe,ce=w.x-(k-w.width)/2-se,j=w.y-(A-w.height)/2-se,le=k+se*2,ue=A+se*2,de=`${dm}-${E}`,N=(0,v.useRef)(0),P=(0,v.useRef)();N.current=oe,(0,v.useEffect)(()=>{if(C.current&&D)return P.current=Jl({domNode:C.current,panZoom:D,getTransform:()=>S.getState().transform,getViewScale:()=>N.current}),()=>{P.current?.destroy()}},[D]),(0,v.useEffect)(()=>{P.current?.update({translateExtent:ee,width:te,height:ne,inversePan:y,pannable:h,zoomStep:b,zoomable:g})},[h,g,y,b,ee,te,ne]);let fe=p?e=>{let[t,n]=P.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,pe=m?(0,v.useCallback)((e,t)=>{m(e,S.getState().nodeLookup.get(t))},[]):void 0;return(0,M.jsx)(Yu,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*oe:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`string`?o:void 0},className:_n([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,M.jsxs)(`svg`,{width:O,height:re,viewBox:`${ce} ${j} ${le} ${ue}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":de,ref:C,onClick:fe,children:[_&&(0,M.jsx)(`title`,{id:de,children:_}),(0,M.jsx)(sm,{onClick:pe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,M.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${ce-se},${j-se}h${le+se*2}v${ue+se*2}h${-le-se*2}z
|
|
18
|
+
M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}fm.displayName=`MiniMap`;var pm=(0,v.memo)(fm);function mm({nodeId:e,position:t,variant:n=lu.Handle,className:r,style:i={},children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,shouldResize:f,onResizeStart:p,onResize:m,onResizeEnd:h}){let g=ef(),_=typeof e==`string`?e:g,y=zu(),b=(0,v.useRef)(null),x=n===lu.Line?`right`:`bottom-right`,S=t??x,C=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(b.current&&_)return C.current||=xu({domNode:b.current,nodeId:_,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=y.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=y.getState(),o=[],s={x:e.x,y:e.y},c=r.get(_);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width,l=e.height??c.measured.height,u=kl([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...Vc({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:_,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:_,type:`dimensions`,resizing:!0,setAttributes:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:()=>{let e={id:_,type:`dimensions`,resizing:!1};y.getState().triggerNodeChanges([e])}}),C.current.update({controlPosition:S,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,onResizeStart:p,onResize:m,onResizeEnd:h,shouldResize:f}),()=>{C.current?.destroy()}},[S,s,c,l,u,d,p,m,h,f]);let w=S.split(`-`),T=n===lu.Line?`borderColor`:`backgroundColor`,E=o?{...i,[T]:o}:i;return(0,M.jsx)(`div`,{className:_n([`react-flow__resize-control`,`nodrag`,...w,n,r]),ref:b,style:E,children:a})}(0,v.memo)(mm);var hm={crossingsPerEdge:.5,overlaps:0,detailedNodes:60,overviewLeaves:300,layoutMs500:1500},gm={width:1600,height:900},_m=(e,t,n)=>(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),vm=(e,t)=>Math.abs(e.x-t.x)<1e-9&&Math.abs(e.y-t.y)<1e-9;function ym(e,t,n,r){if(vm(e,n)||vm(e,r)||vm(t,n)||vm(t,r))return!1;let i=_m(n,r,e),a=_m(n,r,t),o=_m(e,t,n),s=_m(e,t,r);return(i>0&&a<0||i<0&&a>0)&&(o>0&&s<0||o<0&&s>0)}function bm(e){let t=e.edges.map(e=>{let t=[];for(let n=1;n<e.points.length;n++)t.push([e.points[n-1],e.points[n]]);return t}),n=0;for(let e=0;e<t.length;e++)for(let r=e+1;r<t.length;r++)for(let[i,a]of t[e])for(let[e,o]of t[r])ym(i,a,e,o)&&n++;let r=new Map(e.nodes.map(e=>[e.id,e.parent])),i=(e,t)=>{for(let n=r.get(t);n;n=r.get(n))if(n===e)return!0;return!1},a=0;for(let t=0;t<e.nodes.length;t++)for(let n=t+1;n<e.nodes.length;n++){let r=e.nodes[t],o=e.nodes[n];if(i(r.id,o.id)||i(o.id,r.id))continue;let s=Math.min(r.x+r.width,o.x+o.width)-Math.max(r.x,o.x),c=Math.min(r.y+r.height,o.y+o.height)-Math.max(r.y,o.y);s>0&&c>0&&a++}let o=new Set(e.nodes.map(e=>e.parent).filter(Boolean)),s=t.reduce((e,t)=>e+t.reduce((e,[t,n])=>e+Math.hypot(n.x-t.x,n.y-t.y),0),0),c=[...e.nodes.flatMap(e=>[e.x,e.x+e.width]),...e.edges.flatMap(e=>e.points.map(e=>e.x))],l=[...e.nodes.flatMap(e=>[e.y,e.y+e.height]),...e.edges.flatMap(e=>e.points.map(e=>e.y))],u=c.length?Math.max(...c)-Math.min(...c):0,d=l.length?Math.max(...l)-Math.min(...l):0;return{nodes:e.nodes.length,leaves:e.nodes.filter(e=>!o.has(e.id)).length,edges:e.edges.length,crossings:n,crossingsPerEdge:e.edges.length?n/e.edges.length:0,overlaps:a,averageEdgeLength:e.edges.length?s/e.edges.length:0,width:u,height:d,screens:u*d/(gm.width*gm.height)}}function xm(e,t=`detailed`){let n=[];return e.crossingsPerEdge>hm.crossingsPerEdge&&n.push(`crossings`),e.overlaps>hm.overlaps&&n.push(`overlaps`),t===`detailed`&&e.nodes>hm.detailedNodes&&n.push(`nodes`),t===`overview`&&e.leaves>hm.overviewLeaves&&n.push(`leaves`),n}function Sm(e,t,n=16){let r={},i=[],a=new Map(e.map(e=>[e.id,e.parent])),o=(e,t)=>{for(let n=a.get(t);n;n=a.get(n))if(n===e)return!0;for(let n=a.get(e);n;n=a.get(n))if(n===t)return!0;return!1};for(let n of e){let e=t[n.id];e&&(r[n.id]={x:e.x,y:e.y},i.push({...n,x:e.x,y:e.y}))}let s=e=>i.find(t=>!o(t.id,e.id)&&Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)>0&&Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y)>0);for(let a of e){if(t[a.id])continue;let e={...a};for(let t=0,r=s(e);r&&t<1e3;t++,r=s(e))e.y=r.y+r.height+n;r[a.id]={x:e.x,y:e.y},i.push(e)}return r}var Cm=`__root__`,wm=16,Tm=36;function Em(e){return{"elk.algorithm":`layered`,"elk.direction":e,"elk.edgeRouting":`ORTHOGONAL`,"elk.hierarchyHandling":`INCLUDE_CHILDREN`,"elk.spacing.nodeNode":`32`,"elk.layered.spacing.nodeNodeBetweenLayers":`64`,"elk.spacing.edgeLabel":`4`,"elk.edgeLabels.placement":`CENTER`,"elk.layered.considerModelOrder.strategy":`NODES_AND_EDGES`}}function Dm(e){let t=new Map;for(let n of e.groups)t.set(n.id,n.parent);for(let n of e.nodes)t.set(n.id,n.parent);let n=new Set(e.groups.map(e=>e.id)),r=new Map;for(let e of t.keys()){let i=[],a=new Set([e]);for(let r=t.get(e);r&&n.has(r)&&!a.has(r);r=t.get(r))i.push(r),a.add(r);r.set(e,i)}return r}function Om(e,t,n){let r=e.get(t)??[],i=new Set(e.get(n)??[]);return r.find(e=>i.has(e))??`__root__`}var km=e=>[...e].sort((e,t)=>e.id<t.id?-1:+(e.id>t.id));function Am(e,t){let n=Dm(e),r=new Map;r.set(Cm,{id:Cm,layoutOptions:Em(t),children:[],edges:[]});for(let t of km(e.groups))r.set(t.id,{id:t.id,layoutOptions:{"elk.padding":`[top=${t.header??Tm},left=${wm},bottom=${wm},right=${wm}]`},children:[],edges:[]});for(let t of km(e.nodes))r.has(t.id)||r.set(t.id,{id:t.id,width:t.width,height:t.height});let i=e=>n.get(e)?.[0]??`__root__`;for(let t of km(e.groups))r.get(i(t.id)).children.push(r.get(t.id));for(let t of km(e.nodes)){let n=r.get(t.id);e.groups.some(e=>e.id===t.id)||r.get(i(t.id)).children.push(n)}let a=[];for(let t of km(e.edges)){if(t.from===t.to||!n.has(t.from)||!n.has(t.to)){a.push(t.id);continue}let e={id:t.id,sources:[t.from],targets:[t.to]};t.label&&(e.labels=[{text:t.id,width:t.label.width,height:t.label.height}]),r.get(Om(n,t.from,t.to)).edges.push(e)}return{graph:r.get(Cm),dropped:a}}function jm(e,t,n=[]){let r=new Set(t.groups.map(e=>e.id)),i={},a={},o=(e,t,n)=>{for(let a of e.children??[]){let e={id:a.id,x:a.x??0,y:a.y??0,width:a.width??0,height:a.height??0,group:r.has(a.id)};n&&(e.parent=n),i[a.id]=e,o(a,{x:t.x+e.x,y:t.y+e.y},a.id)}for(let n of e.edges??[]){let e=n.sections?.[0];if(!e)continue;let r=e=>({x:e.x+t.x,y:e.y+t.y}),i={id:n.id,from:n.sources[0],to:n.targets[0],points:[e.startPoint,...e.bendPoints??[],e.endPoint].map(r)},o=n.labels?.[0];o&&o.x!==void 0&&o.y!==void 0&&(i.label=r({x:o.x,y:o.y})),a[n.id]=i}};return o(e,{x:0,y:0}),{boxes:i,routes:a,dropped:n}}function Mm(e,t){let n=0,r=0,i=new Set;for(let a=e[t];a&&!i.has(a.id);a=a.parent?e[a.parent]:void 0)i.add(a.id),n+=a.x,r+=a.y;return{x:n,y:r}}var Nm=16;function Pm(e,t){if(!Object.keys(t).filter(t=>e.boxes[t]).length)return e;let n=new Map(Object.keys(e.boxes).map(t=>[t,Mm(e.boxes,t)])),r={};for(let[t,n]of Object.entries(e.boxes))r[t]={...n};let i=e=>e?1+i(r[e]?.parent):0,a=[...Object.values(r).filter(e=>e.group).map(e=>e.id).sort((e,t)=>i(t)-i(e)||(e<t?-1:1)),void 0];for(let e of a){let n=Object.values(r).filter(t=>t.parent===e).sort((e,t)=>e.id<t.id?-1:1),i={};for(let e of n)t[e.id]&&(i[e.id]=t[e.id]);let a=Sm(n.map(e=>({id:e.id,x:e.x,y:e.y,width:e.width,height:e.height})),i);for(let e of n)Object.assign(r[e.id],a[e.id]);if(e&&n.length){let t=r[e];t.width=Math.max(t.width,...n.map(e=>r[e.id].x+e.width+Nm)),t.height=Math.max(t.height,...n.map(e=>r[e.id].y+e.height+Nm))}}let o=new Set(Object.keys(r).filter(t=>{let i=n.get(t),a=Mm(r,t),o=e.boxes[t],s=r[t];return[i.x-a.x,i.y-a.y,o.width-s.width,o.height-s.height].some(e=>Math.abs(e)>.5)})),s={};for(let[t,n]of Object.entries(e.routes))!o.has(n.from)&&!o.has(n.to)&&(s[t]=n);return{boxes:r,routes:s,dropped:e.dropped}}async function Fm(e,t=location.href,n=e=>fetch(e).then(e=>e.text()),r=e=>URL.createObjectURL(new Blob([e],{type:`text/javascript`}))){let i=new URL(e,t),a=new URL(t);return i.origin!==`null`&&i.origin===a.origin?i.href:r(await n(i.href))}var Im=`modulepreload`,Lm=function(e,t){return new URL(e,t).href},Rm={},zm=function(e){return e.pathname.endsWith(`.css`)},Bm=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},Vm=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=Lm(t,n);let r=s(t),i=zm(r);return Bm(Rm,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`:Im,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)})};function Hm(e){return{name:`elk`,async layout(t,n){let{graph:r,dropped:i}=Am(t,n);return jm(await e.layout(r),t,i)}}}var Um;function Wm(){return Um??=Promise.all([Vm(()=>import(`./elk-api-DDup23Us.js`).then(e=>c(e.default,1)),[],import.meta.url),Vm(()=>import(`./elk-worker.min-DdYmS5kP.js`),[],import.meta.url)]).then(async([e,t])=>Hm(new e.default({workerUrl:await Fm(t.default)}))),Um}function Gm(e,t){let n=t=>{let n=Mm(e.boxes,t),r=e.boxes[t];return{x:n.x+r.width/2,y:n.y+r.height/2}};return{nodes:Object.values(e.boxes).map(t=>({id:t.id,...Mm(e.boxes,t.id),width:t.width,height:t.height,...t.parent?{parent:t.parent}:{}})),edges:t.filter(t=>e.boxes[t.from]&&e.boxes[t.to]&&t.from!==t.to).map(t=>({id:t.id,points:e.routes[t.id]?.points??[n(t.from),n(t.to)]}))}}async function Km(e,t,n,r,i){let a=Pm(await(i??await Wm()).layout({nodes:e,edges:t,groups:n},r.direction),r.pinned??{}),o=bm(Gm(a,t));return{...a,score:o,over:xm(o,`detailed`)}}function qm(e){let t=/^(.+):(\d+)$/.exec(e.trim());return t?{file:t[1],line:Number(t[2])}:void 0}function Jm(e,t,n){let r=[];for(let i of e.facts){i.cite.file===t&&i.cite.line===n&&r.push({fact:i,spot:i.cite});for(let e of i.steps??[])e.file===t&&e.line===n&&r.push({fact:i,spot:e,step:e.what})}return r}var Ym=(e,t,n)=>e.questions.filter(e=>e.evidence.includes(`${t}:${n}`)),Xm=e=>!!e.correction&&(e.correction.action===`wrong`||e.by!==`person`);function Zm(e,t){if(!e||!t.length)return[];let n=t.flatMap(t=>Jm(e,t.file,t.line)),r=[];return n.some(e=>e.fact.verified!==`none`)||r.push(`unverified`),t.some(t=>Ym(e,t.file,t.line).length)&&r.push(`question`),n.some(e=>Xm(e.fact))&&r.push(`corrected`),r}function Qm(e,t,n={}){let r=new Map;for(let t of e){if(!t.repo)continue;let e=t.at?qm(t.at):t.path&&t.line?{file:t.path,line:t.line}:void 0;e&&r.set(t.repo,[...r.get(t.repo)??[],e])}if(!r.size)return n.bare&&e.length===0?[`unverified`]:[];let i=new Set,a=0,o=0;for(let[e,n]of r){let r=t(e);if(!r)continue;a++;let s=Zm(r,n);s.includes(`unverified`)&&o++;for(let e of s)e!==`unverified`&&i.add(e)}return a>0&&o===a&&i.add(`unverified`),[...i].sort()}var $m=e=>[...new Set(e.map(e=>e.repo).filter(e=>!!e))];function eh(e,t){let n=(e,t)=>`${e??``}|${t}`,r=new Set(e.caller.map(e=>n(e.repo,e.at))),i=new Set(e.callee.map(e=>n(e.repo,e.at))),a=e=>!!e.system&&!!e.entry&&e.entry.repo===e.call.repo&&e.entry.fact===e.call.fact&&i.has(n(e.entry.repo,e.entry.at));return t.filter(t=>(t.interfaces??(t.interface?[t.interface]:[])).includes(e.interface)||!t.interface&&(r.has(n(t.call.repo,t.call.at))||a(t)))}function th(e,t){let n=e.flatMap(e=>eh(e,t));return[...n.some(e=>e.status===`mismatch`)?[`contract-mismatch`]:[],...n.some(e=>e.status===`unconfirmed`)?[`contract-unconfirmed`]:[]]}var nh=`#/mismatches`,z={title:`Architecture`,lens:`Lens`,lenses:{architecture:`Architecture`,repo:`Repo`,data:`Data`,integration:`Integration`,infrastructure:`Infrastructure`},breadcrumbs:`Where you are`,canvas:`Picture`,canvasLabel:`The picture of this part of the estate`,canvasHelp:`Drag a box to move it; its links follow. Double-click a box to open it here. Scroll or use the buttons to zoom. The outline below has the same boxes for keyboards.`,layingOut:`Laying out the picture`,layoutFailed:e=>`Couldn't lay out the picture: ${e}`,minimap:`Map of the whole picture`,keep:`Keep this arrangement`,keeping:`Keeping`,kept:e=>`Kept in ${e}. The view opens like this next time.`,keepFailed:e=>`Couldn't keep the arrangement: ${e}`,keptNothing:`Drag a box first: only boxes you moved are kept.`,tidy:`Tidy up`,reset:`Reset`,resetDone:`Arrangement dropped. Every box is placed by the layout again.`,moved:e=>`${e} box${e===1?``:`es`} placed by you`,openHere:`Open here`,closeHere:`Close here`,gapsOn:e=>`${e} thing${e===1?``:`s`} missing`,sharedGaps:e=>`Every part here is missing the same thing: ${e}.`,insideGaps:e=>`every part inside is missing: ${e}`,insideLinks:e=>`${e} link${e===1?``:`s`} inside`,edgeCount:(e,t)=>`${e} × ${t}`,legible:{nodes:e=>`This picture has ${e} boxes, more than about 60 can be read at once.`,crossings:`Too many links cross in this picture to follow them.`,api:`This view is clearer another way.`,focus:`Open one in focus to see who reads and writes it.`,collapse:`Close the parts opened here to see the whole again.`,group:`Open one part at a time instead.`},collapseAll:`Close the parts opened here`,openPart:e=>`Open ${e}`,outline:`Outline`,outlineHelp:`Tab moves through the boxes. Enter opens one. Escape closes it. Arrow keys move up and down.`,inspector:`Details`,pick:`Pick a box to see its details.`,open:`Open`,close:`Close`,focus:`Show in focus`,focusOff:`Back to the whole view`,focusHint:`Tables are clearer one at a time. Open one in focus to see who reads and writes it.`,groupHint:`This view has more boxes than can be read at once. Open a part of it instead.`,empty:`Nothing to show here in this lens.`,emptyEstate:`The catalog is empty. Read a repo first (atticus map <repo>, then atticus verify <repo> --write), then come back.`,properties:`Properties`,kind:`Kind`,stateLabel:`State`,loading:`Loading`,loadFailed:e=>`Couldn't load this: ${e}`,evidence:`Where it was found`,noEvidence:`No file cited.`,gaps:`What is missing`,noGaps:`Nothing missing.`,next:`Next step`,copy:`Copy`,copied:`Copied`,state:{current:`Current`,new:`New`,changed:`Changed`,retired:`Retired`},gap:{"contract-mismatch":`The two sides' payloads don't match`,"contract-unconfirmed":`The payloads may not match: a mapping isn't traced`,inferred:`Seen at one end only`,"no-repo":`No repo known`,"no-system":`No system known`,"no-component":`No component known`,"no-owner":`No owner known`,"no-store":`No store known`,"no-endpoint":`Endpoint not found`,"not-in-catalog":`Not in the catalog`,conflicts:`Sources disagree`,"joined-by-path":`Joined by its path: nobody named where it goes`,"joined-by-label":`Joined by its host's first part: a guess`,"joined-by-platform-setting":`Joined by a platform-wide setting: a guess`,"joined-by-folder-name":`Joined by the folder its host's setting is in: a guess`,"joined-despite-conflict":`Joined by a host the manifest disagrees with: a guess`,"joined-by-service-name":`Joined by a Service's short name from another namespace: a guess`,unverified:`No fact verified from code`,question:`A question is open on it`,corrected:`A correction waits for atticus verify`,"not-in-shared-map":`Their shared map has no entry for it`,"no-listener":E.topics.noListener,"no-publisher":E.topics.noPublisher,"declared-topic":E.topics.declaredGap},gapFix:{inferred:`Only one side's code shows it. Read the other side's repo, or open Why is this linked? on its links.`,"no-repo":`Add the repo that builds it to the manifest, then read it.`,"no-system":`Say which system it is part of in the manifest.`,"no-component":`Read the repo so its components are known.`,"no-owner":`Name the owner in the manifest.`,"no-store":`Read the repo that owns the store.`,"no-endpoint":`Read the callee's repo so its entry is known.`,"not-in-catalog":`Read the repo that has it.`,conflicts:`Open the record and settle which source is right.`,"joined-by-path":`Open Why is this linked?, and say where it goes if the guess is wrong.`,"joined-by-label":`Open Why is this linked?, and say where it goes if the guess is wrong.`,"joined-by-platform-setting":`Open Why is this linked?, and say where it goes if the guess is wrong; or set the variable for this service.`,"joined-by-folder-name":`Open Why is this linked?, and say where it goes if the guess is wrong; or name the service in the setting's target.`,"joined-despite-conflict":`Settle the host conflict on Map › Trust (list the host in the manifest, or correct the deploy file).`,"joined-by-service-name":`Open Why is this linked?, and say where it goes if the guess is wrong; or have the caller's own Service read so its namespace is known, or call the Service by its full .svc.cluster.local name.`,unverified:`Read the repo and verify it; Map › Trust lists what isn't checked yet.`,question:`Answer the open question on Questions; Map › Trust lists the repo's questions.`,corrected:`Run atticus verify on the repo with --write to apply the correction.`,"not-in-shared-map":`Ask the team that owns the system (their map is theirs to change), refresh it with atticus join shared refresh, or correct the call if it goes elsewhere.`,"no-listener":E.topics.noListenerFix,"no-publisher":E.topics.noPublisherFix,"declared-topic":E.topics.declaredFix},repoCounts:`See what each count holds on Map › Trust`,edges:(e,t)=>`${e} link${e===1?``:`s`}${t?`, ${t} implied link${t===1?``:`s`} hidden`:``}`,outsideMark:`outside`,children:e=>`${e} inside`},rh=`declared-topic`,ih=e=>e.length>1?e[0].gaps.filter(t=>e.every(e=>e.gaps.includes(t))):[];function ah(e,t,n){let r=e.get(t)?.node;if(!r)return[];let i=[],a=(t,r,o)=>{let s=n.has(t.id)&&e.has(t.id),c=s?e.get(t.id).children:[],l=ih(c);i.push({node:t,depth:r,expanded:s,gaps:t.gaps.filter(e=>!o.includes(e)),inside:l});for(let e of c)a(e,r+1,l)};return a(r,0,[]),i}function oh(e,t,n){let r=e.findIndex(e=>e.node.id===t);if(r<0)return;let i=e[r];switch(n){case`ArrowDown`:return{focus:e[Math.min(e.length-1,r+1)].node.id};case`ArrowUp`:return{focus:e[Math.max(0,r-1)].node.id};case`Home`:return{focus:e[0].node.id};case`End`:return{focus:e[e.length-1].node.id};case`Enter`:case`ArrowRight`:return i.node.childCount>0?{open:t}:{select:t};case`Escape`:case`ArrowLeft`:return i.expanded?{close:t}:i.node.parent&&e.some(e=>e.node.id===i.node.parent)?{focus:i.node.parent}:void 0;default:return}}var sh=(e,t={})=>({id:e.id,label:e.label,kind:e.kind,gaps:e.gaps,childCount:e.childCount,outside:!1,group:!1,inside:0,...e.kind===`topic`&&typeof e.properties.owner==`string`?{owner:e.properties.owner,...e.properties.ownerOutside===!0?{ownerOutside:!0}:{}}:{},...e.kind===`topic`&&e.properties.declared===!0?{declared:!0}:{},...t}),ch=new Set([`component`,`endpoint`,`topic`,`client`,`store`,`table`,`deployment`]);function lh(e,t){let n=(e,t)=>t.some(t=>!e.gaps.includes(t))?{...e,gaps:[...e.gaps,...t.filter(t=>!e.gaps.includes(t))]}:e,r=e=>n(e,Qm(e.evidence,t,{bare:!!e.record&&ch.has(e.kind)})),i=new Map;for(let[a,o]of e)i.set(a,{...o,node:r(o.node),children:o.children.map(r),outside:o.outside.map(r),edges:o.edges.map(e=>n(e,Qm(e.evidence,t)))});return i}function uh(e,t){if(!t.length)return e;let n=new Map;for(let[r,i]of e)n.set(r,{...i,edges:i.edges.map(e=>{let n=th(e.joins??[],t).filter(t=>!e.gaps.includes(t));return n.length?{...e,gaps:[...e.gaps,...n]}:e})});return n}function dh(e){let t=new Set;for(let n of e.values())for(let e of[n.node,...n.children,...n.outside,...n.edges])for(let n of e.evidence)n.repo&&t.add(n.repo);return[...t].sort()}var fh=(e,t)=>e>1?z.edgeCount(e,t):t;function ph(e,t,n,r){let i=new Map,a=new Map;if(r){for(let e of[r.node,...r.neighbours])i.set(e.id,sh(e));for(let e of r.edges)a.set(e.id,e)}else{let r=e.get(t);if(!r)return{boxes:[],links:[]};let o=(t,r)=>{for(let e of t.edges)a.set(e.id,e);for(let a of t.children){if(i.has(a.id))continue;let t=n.has(a.id)?e.get(a.id):void 0;i.set(a.id,sh(a,{group:!!t,...r?{parent:r}:{}})),t&&o(t,a.id)}};o(r);for(let e of r.outside)i.has(e.id)||i.set(e.id,sh(e,{outside:!0}))}let o=(e,t)=>{for(let n=i.get(e)?.parent;n;n=i.get(n)?.parent)if(n===t)return!0;return!1},s=[...a.values()].filter(e=>i.has(e.from)&&i.has(e.to)),c=e=>s.some(t=>t!==e&&t.type===e.type&&(i.get(e.to).group&&t.from===e.from&&o(t.to,e.to)||i.get(e.from).group&&t.to===e.to&&o(t.from,e.from))),l=[];for(let e of s){if(e.from===e.to){i.get(e.from).inside+=e.count;continue}if(c(e))continue;let t=e.type===`subscribes`&&i.get(e.to).kind===`topic`,n=e.gaps.includes(rh),r=fh(e.count,t?E.topics.listens:e.type);l.push({id:e.id,from:t?e.to:e.from,to:t?e.from:e.to,type:e.type,count:e.count,label:n?`${r} · ${E.topics.declaredMark}`:r,async:e.sync===`async`||e.type===`publishes`||e.type===`subscribes`,gaps:e.gaps,...n?{declared:!0}:{}})}let u=[...i.values()].filter(e=>!e.outside),d=u.length>1?u[0].gaps.filter(e=>u.every(t=>t.gaps.includes(e))):[];if(d.length)for(let e of u)i.set(e.id,{...e,gaps:e.gaps.filter(e=>!d.includes(e))});return{boxes:[...i.values()],links:l,shared:d}}function mh(e){return e===`architecture`||e===`infrastructure`?`DOWN`:`RIGHT`}function hh(e){return{width:Math.min(280,Math.max(150,Math.ceil(e.label.length*7.5)+56)),height:e.kind===`topic`?82:64}}function gh(e,t,n,r){let i=e.includes(`nodes`)?`nodes`:e.includes(`crossings`)?`crossings`:void 0;if(!i&&!t)return;let a=i??`api`;if(t?.mode===`focus`&&t.id)return{mode:`focus`,id:t.id,why:a};if(n.size)return{mode:`collapse`,why:a};let o=[...r].filter(e=>e.childCount>0).sort((e,t)=>t.childCount-e.childCount||(e.id<t.id?-1:1))[0];return o?{mode:`group`,id:o.id,why:a}:{mode:`group`,why:a}}function _h(e,t,n=`node`){return[e,...n===`focus`?[`focus`]:[],t.replace(/:/g,`-`)].join(`.`)}function vh(e){let t=e.path.map(e=>e.id),n=e.node.childCount>0||t.length===0?[...t,e.node.id]:t;return{current:n[n.length-1],expanded:n,selected:e.node.id}}var yh=E.topics;function bh({n:e}){return(0,M.jsxs)(`span`,{className:`arch-gap`,children:[(0,M.jsxs)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,"aria-hidden":`true`,focusable:`false`,children:[(0,M.jsx)(`path`,{d:`M6 1 L11 11 H1 Z`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M6 5 V7.5 M6 9 V9.5`,stroke:`currentColor`,strokeWidth:`1.5`})]}),z.gapsOn(e)]})}function xh({data:e}){let{box:t,dir:n}=e,r=[`arch-box`,t.group?`group`:``,t.outside?`outside`:``,t.kind===`topic`?`topic`:``,t.gaps.length?`gappy`:``,e.selected?`picked`:``,t.mark?`m-${t.mark}`:``].join(` `);return(0,M.jsxs)(`div`,{className:r,title:t.gaps.map(e=>z.gap[e]??e).join(`, `)||void 0,children:[(0,M.jsx)(af,{type:`target`,position:n===`RIGHT`?L.Left:L.Top}),(0,M.jsxs)(`div`,{className:`arch-box-head`,children:[(0,M.jsx)(`span`,{className:`hud`,children:t.kind}),t.childCount>0&&!t.group&&(0,M.jsx)(`span`,{className:`hud`,children:z.children(t.childCount)})]}),(0,M.jsxs)(`div`,{className:`arch-box-label`,children:[t.label,t.outside&&` (${z.outsideMark})`]}),t.kind===`topic`&&(0,M.jsxs)(`div`,{className:`hud arch-box-owner`,children:[Sh(t),t.declared&&` · ${yh.declared}`]}),(t.gaps.length>0||t.inside>0)&&(0,M.jsxs)(`div`,{className:`arch-box-foot`,children:[t.gaps.length>0&&(0,M.jsx)(bh,{n:t.gaps.length}),t.inside>0&&(0,M.jsx)(`span`,{className:`hud`,children:z.insideLinks(t.inside)})]}),(0,M.jsx)(af,{type:`source`,position:n===`RIGHT`?L.Right:L.Bottom})]})}var Sh=e=>e.owner?e.ownerOutside?yh.ownerOutside(e.owner):yh.owner(e.owner):yh.ownerUnknown,Ch=(e,t)=>!!e&&!!t&&Math.abs(e.x-t.x)<.5&&Math.abs(e.y-t.y)<.5;function wh(e){let t=e.map((e,t)=>`${t?`L`:`M`}${e.x},${e.y}`).join(` `),n=Math.max(1,Math.floor(e.length/2)),r=e[n-1],i=e[n];return[t,(r.x+i.x)/2,(r.y+i.y)/2]}function Th(e){let t=Rp(e.source),n=Rp(e.target),r=e.data,[i,a,o]=r.points&&Ch(t?.internals.positionAbsolute,r.ends?.from)&&Ch(n?.internals.positionAbsolute,r.ends?.to)?wh(r.points):fl({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition}),s=`arch-link ${r.link.async?`async`:``} ${r.link.gaps.length?`gappy`:``} ${r.link.mark?`m-${r.link.mark}`:``}`;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Rf,{id:e.id,path:i,className:s,...e.markerEnd?{markerEnd:e.markerEnd}:{}}),(0,M.jsx)(Lp,{children:(0,M.jsxs)(`div`,{className:`arch-link-label nodrag nopan ${r.link.gaps.length?`gappy`:``} ${r.link.mark?`m-${r.link.mark}`:``}`,style:{transform:`translate(-50%, -50%) translate(${a}px, ${o}px)`},children:[r.link.gaps.length>0&&(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),r.link.label,r.link.gaps.length>0&&(0,M.jsxs)(`span`,{className:`sr`,children:[` (`,z.gapsOn(r.link.gaps.length),`)`]})]})})]})}var Eh={box:xh},Dh=.6,Oh={link:Th};function kh(e){return{nodes:e.boxes.map(e=>({id:e.id,...hh(e),...e.parent?{parent:e.parent}:{}})),groups:e.boxes.filter(e=>e.group).map(e=>({id:e.id,...e.parent?{parent:e.parent}:{}})),edges:e.links.map(e=>({id:e.id,from:e.from,to:e.to,label:{width:Math.ceil(e.label.length*6.6)+16,height:20}}))}}function Ah(e,t,n,r){let i=e=>{let n=e?t.boxes[e]:void 0;return n?1+i(n.parent):0};return{nodes:e.boxes.filter(e=>t.boxes[e.id]).map(e=>{let i=t.boxes[e.id];return{id:e.id,type:`box`,position:{x:i.x,y:i.y},data:{box:e,dir:n,selected:e.id===r},width:i.width,height:i.height,ariaLabel:`${e.kind} ${e.label}${e.kind===`topic`?`, ${Sh(e)}`:``}${e.declared?`, ${yh.declared}`:``}${e.gaps.length?`, ${e.gaps.map(e=>z.gap[e]??e).join(`, `)}`:``}`,...e.parent?{parentId:e.parent,expandParent:!0}:{},...e.group?{zIndex:-1}:{}}}).sort((e,t)=>i(e.id)-i(t.id)),edges:e.links.filter(e=>t.boxes[e.from]&&t.boxes[e.to]&&e.from!==e.to).map(e=>{let n=t.routes[e.id],r={link:e};return n&&(r.points=n.points,r.ends={from:Mm(t.boxes,e.from),to:Mm(t.boxes,e.to)}),{id:e.id,source:e.from,target:e.to,type:`link`,data:r,markerEnd:{type:rc.ArrowClosed,width:16,height:16},ariaLabel:`${e.from} ${e.label} ${e.to}`}})}}function jh(e){let[t,n]=(0,v.useState)(e.initial?{state:`ready`}:{state:`running`}),[r]=(0,v.useState)(()=>e.initial?Ah(e.graph,e.initial,e.direction,e.selected):void 0),[i,a]=(0,v.useState)(r?.nodes??[]),[o,s]=(0,v.useState)(r?.edges??[]),c=(0,v.useRef)(void 0),l=(0,v.useRef)(e.pinned);l.current=e.pinned;let u=(0,v.useRef)(e);u.current=e;let d=(0,v.useRef)(null),f=(0,v.useRef)(null),[p,m]=qe(e.initialFull),[h,g]=(0,v.useState)(!!e.initialFocus),[_,y]=(0,v.useState)(1),b=Ye(d,e.height===void 0?{}:{fixed:e.height}),x=`${(0,v.useMemo)(()=>JSON.stringify([e.direction,e.graph.boxes.map(e=>[e.id,e.parent??``,e.group]),e.graph.links.map(e=>[e.id,e.label])]),[e.graph,e.direction])}#${e.tidy}`,S=(0,v.useRef)(e.initial?x:``);(0,v.useEffect)(()=>{if(S.current===x)return;S.current=x;let e=!0,{graph:t,direction:r,engine:i}=u.current,o=kh(t);return n(e=>e.state===`ready`?e:{state:`running`}),Km(o.nodes,o.edges,o.groups,{direction:r,pinned:l.current},i).then(i=>{if(!e)return;let o=Ah(t,i,r,u.current.selected);a(o.nodes),s(o.edges),n({state:`ready`}),u.current.onLaid(i),requestAnimationFrame(()=>void c.current?.fitView({padding:.08,duration:200,minZoom:Dh}))},t=>e&&n({state:`failed`,error:t instanceof Error?t.message:String(t)})),()=>{e=!1}},[x]),(0,v.useEffect)(()=>{let t=new Map(e.graph.boxes.map(e=>[e.id,e]));a(n=>n.map(n=>{let r=t.get(n.id)??n.data.box,i=n.id===e.selected;return r===n.data.box&&i===n.data.selected?n:{...n,data:{...n.data,box:r,selected:i}}}))},[e.graph,e.selected]);let C=(0,v.useCallback)(e=>a(t=>vd(e,t)),[]),w=(0,v.useMemo)(()=>h&&e.selected?He(e.graph.links,e.selected):void 0,[h,e.selected,e.graph.links]),T=(0,v.useMemo)(()=>w?i.map(e=>Mh(e,w)):i,[i,w]),D=(0,v.useMemo)(()=>w&&e.selected?o.map(t=>Nh(t,e.selected)):o,[o,w,e.selected]),ee=t=>{let n=c.current,r={duration:200};switch(t){case`zoom-in`:n?.zoomIn(r);return;case`zoom-out`:n?.zoomOut(r);return;case`reset`:n?.zoomTo(1,r);return;case`fit`:n?.fitView({padding:.08,minZoom:Dh,...r});return;case`fit-selection`:e.selected&&n?.fitView({nodes:[{id:e.selected}],maxZoom:1.2,...r});return;case`focus`:g(e=>!e);return;case`full-screen`:m(),requestAnimationFrame(()=>d.current?.focus());return;case`leave`:m(!1);return;case`search`:f.current?.focus();return;default:{let e=n?.getViewport();if(!e)return;let r=Be({x:e.x,y:e.y,k:e.zoom},t);n?.setViewport({x:r.x,y:r.y,zoom:e.zoom},{duration:120})}}},te=t=>{e.onSelect(t),requestAnimationFrame(()=>void c.current?.fitView({nodes:[{id:t}],maxZoom:1,duration:250}))};return t.state===`failed`?(0,M.jsx)(`div`,{className:`state error`,role:`alert`,children:z.layoutFailed(t.error)}):(0,M.jsx)($e,{title:z.canvasLabel,full:p,height:b,frameRef:d,onKeyAction:ee,...e.aside?{aside:e.aside}:{},toolbar:(0,M.jsx)(Qe,{zoom:_,full:p,focus:h,picked:!!e.selected,nodes:e.graph.boxes,onAction:ee,onFind:te,searchRef:f}),children:(0,M.jsx)(`div`,{className:`arch-canvas ${_<.5?`far`:``} ${w?`focusing`:``}`,style:{height:`100%`,...Ph(_)},"aria-busy":t.state===`running`,children:t.state===`running`&&!i.length?(0,M.jsxs)(`div`,{className:`stack`,"aria-live":`polite`,children:[(0,M.jsx)(`span`,{className:`sr`,children:z.layingOut}),(0,M.jsx)(`div`,{className:`skeleton`,style:{width:`70%`}}),(0,M.jsx)(`div`,{className:`skeleton`,style:{width:`50%`}})]}):(0,M.jsxs)(Fp,{nodes:T,edges:D,nodeTypes:Eh,edgeTypes:Oh,onNodesChange:C,onInit:e=>{c.current=e,y(e.getZoom())},onMove:(e,t)=>y(t.zoom),onNodeClick:(t,n)=>e.onSelect(n.id),onSelectionChange:({nodes:t})=>{t.length===1&&t[0].id!==e.selected&&e.onSelect(t[0].id)},onNodeDoubleClick:(t,n)=>{n.data.box.childCount>0&&e.onToggle(n.id)},onNodeDragStop:(t,n,r)=>{for(let t of r.length?r:[n])e.onMoved(t.id,t.position)},nodesConnectable:!1,edgesFocusable:!1,zoomOnDoubleClick:!1,zoomOnPinch:!0,zoomOnScroll:!0,panOnDrag:!0,minZoom:Me.min,maxZoom:Me.max,fitView:!0,fitViewOptions:{padding:.08,minZoom:Dh},colorMode:`dark`,"aria-label":z.canvasLabel,children:[(0,M.jsx)(Gp,{gap:24}),i.length>12&&(0,M.jsx)(pm,{pannable:!0,zoomable:!0,ariaLabel:E.viewer.minimap})]})})})}function Mh(e,t){let n=t.has(e.id)||e.data.box.group;return n===(e.className!==`dim`)?e:{...e,className:n?``:`dim`}}function Nh(e,t){return e.source===t||e.target===t?e:{...e,className:`dim`}}var Ph=e=>({"--label-scale":String(Math.round(Math.min(1.8,Math.max(1,.7/e))*100)/100)}),Fh=E.correctionNext,Ih=e=>Fh.linkWhat(e.from,e.to,e.method,e.path);function Lh({text:e,label:t}){return(0,M.jsxs)(`div`,{className:`work-cmd`,children:[(0,M.jsx)(`code`,{className:`mono`,children:e}),(0,M.jsx)(Yt,{text:e,label:Fh.copy(`${t}: ${e}`)})]})}function Rh({v:e}){if(!e.preview)return(0,M.jsx)(`p`,{className:`ev-say`,children:Fh.unavailable[e.unavailable??`no-checkout`]});let t=e.preview,n=t.links,r=n?[...n.moved.map(e=>Fh.moved(Ih({...e,to:e.was}),e.was,e.to)),...n.added.map(e=>Fh.added(Ih(e))),...n.removed.map(e=>Fh.removed(Ih(e))),...n.changed.map(e=>Fh.changed(Ih(e),e.was?.confidence??``,e.confidence)),...n.unmade.map(e=>Fh.unmade(Ih(e)))]:[],i=[...t.facts.dropped.map(e=>`${Fh.dropped}: ${e.label} (${Fh.droppedWhy[e.why]}${e.message?`: ${e.message}`:``})`),...t.facts.edited.map(e=>`${Fh.edited}: ${e.label} (${e.fields.map(e=>Fh.field(e.name,e.was,e.now)).join(`; `)})`)];return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[t.headMoved&&(0,M.jsx)(`p`,{className:`ev-say`,children:Fh.headMoved(t.headMoved.head,t.headMoved.commit)}),t.blocked&&(0,M.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:Fh.blocked(t.blocked.rejected)}),(0,M.jsx)(`h5`,{className:`hud`,children:Fh.facts}),i.length?(0,M.jsx)(`ul`,{className:`ev-list`,children:i.map(e=>(0,M.jsx)(`li`,{children:e},e))}):(0,M.jsx)(`p`,{className:`ev-say`,children:Fh.noFactChange}),(0,M.jsx)(`p`,{className:`ev-say`,children:Fh.kept(t.facts.kept)}),n&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`h5`,{className:`hud`,children:Fh.links}),r.length?(0,M.jsx)(`ul`,{className:`ev-list`,children:r.map(e=>(0,M.jsx)(`li`,{children:e},e))}):(0,M.jsx)(`p`,{className:`ev-say`,children:Fh.noLinkChange})]}),t.catalog&&(0,M.jsx)(`p`,{className:`ev-say`,children:Fh.catalog(t.catalog.added,t.catalog.changed,t.catalog.removed,t.catalog.evidenceOnly)}),t.staleCorrections.length>0&&(0,M.jsx)(`p`,{className:`ev-say`,children:Fh.stale(t.staleCorrections.join(`, `))})]})}function zh(e){let t=(0,v.useId)(),n=e.preview.state===`ready`?e.preview.data:void 0;return(0,M.jsxs)(`section`,{className:`stack`,style:{gap:6},"aria-labelledby":`${t}-t`,children:[(0,M.jsx)(`h4`,{id:`${t}-t`,className:`h`,style:{fontSize:14},children:Fh.title}),(0,M.jsx)(`p`,{className:`ev-say`,children:Fh.onlyWrote(e.file)}),e.line&&(0,M.jsxs)(`figure`,{style:{margin:0},children:[(0,M.jsx)(`figcaption`,{className:`hud`,children:Fh.fileDiff(e.file)}),(0,M.jsx)(`pre`,{className:`mono`,style:{whiteSpace:`pre-wrap`,margin:0},children:(0,M.jsx)(`code`,{children:`+ ${e.line}`})})]}),(0,M.jsx)(`h5`,{className:`hud`,children:Fh.stepsTitle}),e.preview.state===`loading`&&(0,M.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:Fh.loading}),e.preview.state===`error`&&(0,M.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:Fh.failed(e.preview.error)}),n&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`ol`,{className:`stack`,style:{gap:4,paddingLeft:18,margin:0},children:n.steps.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{className:`ev-say`,children:Fh.step[e.step]}),e.command?(0,M.jsx)(Lh,{text:e.command,label:Fh.step[e.step]}):(0,M.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:Fh.prByHand(n.branch)})]},e.step))}),(0,M.jsx)(`h5`,{className:`hud`,children:Fh.previewTitle}),(0,M.jsx)(`p`,{className:`ev-say`,children:Fh.previewIntro}),(0,M.jsx)(Rh,{v:n})]})]})}function Bh(e){let t=A(`/api/facts/${encodeURIComponent(e.repo)}/preview?fact=${encodeURIComponent(e.result.correction.fact)}`);return(0,M.jsx)(zh,{file:e.result.file,line:e.result.line,preview:t})}var Vh=E.evidence,Hh=(0,v.createContext)(void 0),Uh=()=>(0,v.useContext)(Hh);function Wh({children:e}){let[t,n]=(0,v.useState)(new Map),r=(0,v.useRef)(new Set),i=(0,v.useCallback)(e=>{r.current.add(e),n(t=>t.get(e)?.state===`ready`?t:new Map(t).set(e,{state:`loading`})),k(`/api/facts/${encodeURIComponent(e)}`).then(t=>n(n=>new Map(n).set(e,{state:`ready`,data:t})),t=>n(n=>new Map(n).set(e,{state:`error`,error:Wt(t)})))},[]);j(e=>{if(e.type===`file.changed`&&typeof e.path==`string`&&/(^|\/)facts\//.test(e.path))for(let e of r.current)i(e)});let a=(0,v.useMemo)(()=>({of:e=>t.get(e),need:e=>{r.current.has(e)||i(e)},reload:i}),[t,i]);return(0,M.jsx)(Hh.Provider,{value:a,children:e})}var Gh={unverified:`△`,question:`?`,corrected:`✎`};function Kh({gaps:e,short:t=!1}){return e.length?(0,M.jsx)(`span`,{className:`ev-gaps`,children:e.map(e=>(0,M.jsxs)(`span`,{className:`ev-gap ev-${e}`,children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,children:Gh[e]}),` `,t?Vh.short[e]:Vh.gaps[e]]},e))}):null}function qh({hit:e}){let t=e.fact;return(0,M.jsxs)(`span`,{className:`ev-fact`,children:[(0,M.jsx)(`code`,{className:`mono`,children:e.step??t.label}),` `,(0,M.jsxs)(`span`,{className:`muted`,children:[Vh.by[t.by]??t.by,` · `,Vh.verified[t.verified]??t.verified]}),t.correction&&(0,M.jsxs)(`span`,{className:`ev-corr`,children:[` · `,Vh.correction(t.correction.action,t.correction.by)]})]})}function Jh(e){let t=qm(e.at),n=e.of?.state===`ready`?e.of.data:void 0,r=n&&t?Jm(n,t.file,t.line):[],i=r.find(e=>e.spot.quote)?.spot.quote;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`span`,{className:`ev-place mono`,children:[e.repo?`${e.repo} · `:``,e.at]}),e.of?.state===`loading`&&(0,M.jsx)(`span`,{className:`ev-say`,children:Vh.loading}),n&&!n.present&&e.repo&&(0,M.jsx)(`span`,{className:`ev-say`,children:Vh.noFacts(e.repo)}),n&&n.present&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`ev-say`,children:Vh.quote}),i?(0,M.jsx)(`code`,{className:`ev-quote mono`,children:i}):(0,M.jsx)(`span`,{className:`ev-say`,children:Vh.noQuote}),r.map(e=>(0,M.jsx)(qh,{hit:e},`${e.fact.id}:${e.step??``}`))]}),n&&t&&(0,M.jsx)(Kh,{gaps:Zm(n,[t])})]})}function Yh({repo:e,at:t}){let n=Uh();(0,v.useEffect)(()=>{e&&n?.need(e)},[e,n]);let r=e?n?.of(e):void 0,[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),c=(0,v.useId)(),l=(0,v.useRef)(null),u=qm(t),d=r?.state===`ready`?r.data:void 0,f=d&&u?Zm(d,[u]):[],p=t.split(`/`).pop();return(0,M.jsxs)(`span`,{className:`ev-wrap${i?` open`:``}${o?` quiet`:``}`,onKeyDown:e=>{e.key===`Escape`&&!i&&s(!0)},onMouseLeave:()=>s(!1),onBlur:()=>s(!1),children:[(0,M.jsxs)(`button`,{ref:l,type:`button`,className:`ev-cite${f.length?` gappy`:``}`,"aria-describedby":c,"aria-expanded":i,"aria-label":e?Vh.citeOf(t,e):Vh.cite(t),onClick:()=>a(e=>!e),children:[(0,M.jsx)(`code`,{className:`mono`,children:p}),f.length>0&&(0,M.jsx)(Kh,{gaps:f,short:!0})]}),(0,M.jsx)(`span`,{role:`tooltip`,id:c,className:`ev-tip`,children:(0,M.jsx)(Jh,{repo:e,at:t,of:r})}),i&&(0,M.jsx)(Xh,{repo:e,at:t,of:r,onClose:()=>{a(!1),l.current?.focus()}})]})}function Xh(e){let t=qm(e.at),n=e.of?.state===`ready`?e.of.data:void 0,r=n&&t?Jm(n,t.file,t.line):[],i=n&&t?Ym(n,t.file,t.line):[],[a,o]=(0,v.useState)(),s=[...new Map(r.map(e=>[e.fact.id,e.fact])).values()];return(0,M.jsxs)(`div`,{className:`ev-details`,role:`group`,"aria-label":Vh.cite(e.at),onKeyDown:de(e.onClose),children:[(0,M.jsx)(Jh,{repo:e.repo,at:e.at,of:e.of}),i.length>0&&(0,M.jsx)(`ul`,{className:`ev-list`,children:i.map(e=>(0,M.jsxs)(`li`,{children:[e.question,` `,(0,M.jsx)(`a`,{href:`#/questions/${e.id}`,children:Vh.openQuestion})]},e.id))}),e.repo&&s.length>0&&(0,M.jsx)(`ul`,{className:`ev-list`,children:s.map(t=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":Vh.correctFact(t.label),"aria-expanded":a===t.id,onClick:()=>o(a===t.id?void 0:t.id),children:Vh.correct}),` `,(0,M.jsx)(`code`,{className:`mono`,children:t.label}),a===t.id&&(0,M.jsx)($h,{repo:e.repo,fact:t,onClose:()=>o(void 0)})]},t.id))}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onClose,children:Vh.close})]})}function Zh(e,t){let n=t.reason.trim();if(t.action===`wrong`)return n?{body:{fact:e.id,action:`wrong`,reason:n}}:{error:Vh.needReason};let r=Object.fromEntries(Object.entries(t.set).filter(([t,n])=>(e.claim[t]??``)!==n.trim())),i=Number(t.line),a=Number.isInteger(i)&&i>0&&i!==e.cite.line;return!Object.keys(r).length&&!a?{error:Vh.nothingChanged}:{body:{fact:e.id,action:`edit`,...Object.keys(r).length?{set:r}:{},...a?{line:i}:{},...n?{reason:n}:{}}}}function Qh(e){let t=(0,v.useId)(),[n,r]=(0,v.useState)({action:`wrong`,reason:``,set:{...e.fact.claim},line:String(e.fact.cite.line)}),[i,a]=(0,v.useState)(),o=e.saving??{state:`idle`},s=o.state===`working`;return(0,M.jsxs)(`form`,{className:`ev-correct stack`,onSubmit:t=>{t.preventDefault();let r=Zh(e.fact,n);if(`error`in r)return a(r.error);a(void 0),e.onSave?.(r.body)},onKeyDown:de(e.onClose),"aria-labelledby":`${t}-t`,children:[(0,M.jsx)(`h3`,{id:`${t}-t`,className:`h`,style:{fontSize:14},children:Vh.correctTitle(e.fact.label)}),(0,M.jsx)(`p`,{className:`ev-say`,children:Vh.correctIntro}),(0,M.jsxs)(`fieldset`,{className:`ev-choice`,children:[(0,M.jsx)(`legend`,{className:`sr`,children:Vh.correctTitle(e.fact.label)}),[`wrong`,`edit`].map(e=>(0,M.jsxs)(`label`,{className:`row`,style:{gap:6},children:[(0,M.jsx)(`input`,{type:`radio`,name:`${t}-action`,value:e,checked:n.action===e,onChange:()=>r({...n,action:e})}),e===`wrong`?Vh.wrong:Vh.edit]},e))]}),n.action===`edit`&&(0,M.jsxs)(`div`,{className:`ev-fields`,children:[Object.keys(e.fact.claim).map(e=>(0,M.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`hud`,children:e}),(0,M.jsx)(`input`,{value:n.set[e]??``,onChange:t=>r({...n,set:{...n.set,[e]:t.target.value}})})]},e)),(0,M.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`hud`,children:Vh.line}),(0,M.jsx)(`input`,{type:`number`,min:1,value:n.line,onChange:e=>r({...n,line:e.target.value})})]})]}),(0,M.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`hud`,children:n.action===`wrong`?Vh.reason:Vh.reasonOptional}),(0,M.jsx)(`textarea`,{rows:2,value:n.reason,onChange:e=>r({...n,reason:e.target.value})})]}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:s,children:s?Vh.saving:Vh.save}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onClose,children:Vh.close})]}),i&&(0,M.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:i}),o.state===`working`&&(0,M.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:Vh.saving}),o.state===`error`&&(0,M.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:o.text}),o.state===`done`&&(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`p`,{role:`status`,className:`ev-say`,children:Vh.saved(o.result.file)}),(0,M.jsx)(Bh,{repo:e.repo,result:o.result})]})]})}function $h(e){let t=Uh(),[n,r]=(0,v.useState)({state:`idle`});return(0,M.jsx)(Qh,{repo:e.repo,fact:e.fact,saving:n,onSave:n=>{r({state:`working`}),k(`/api/facts/${encodeURIComponent(e.repo)}/corrections`,{method:`POST`,body:n}).then(n=>{r({state:`done`,result:n}),t?.reload(e.repo)},e=>r({state:`error`,text:Wt(e)}))},onClose:e.onClose})}function eg(e){let t=e.caller.find(e=>e.repo&&e.source===`code`)??e.caller.find(e=>e.repo);return t?.repo?{repo:t.repo,at:t.at}:void 0}function tg(e,t){let n=eg(e),r=n?qm(n.at):void 0;if(!t||!r)return[];let i=new Map;for(let e of Jm(t,r.file,r.line))e.fact.kind===`call`&&!e.step&&i.set(e.fact.id,e.fact);return[...i.values()]}function ng(e,t){let n=t.reason.trim();if(t.kind===`not-a-call`)return n?{body:{fact:e.id,action:`wrong`,reason:n}}:{error:`needReason`};let r=t.target.trim();return r?(e.claim.to??``).trim()===r?{error:`sameTarget`}:{body:{fact:e.id,action:`edit`,set:{to:r},...n?{reason:n}:{}}}:{error:`needTarget`}}function rg(e,t=[]){let n=new Set(t);for(let t of e.values())for(let e of[t.node,...t.children,...t.outside])(e.kind===`repo`||e.kind===`component`)&&n.add(e.id.slice(e.id.indexOf(`:`)+1));return[...n].sort()}function ig(e,t,n){if(t.kind===`not-a-call`)return{kind:`dropped`,from:e.from,was:e.to};let r=t.target.trim();return t.kind===`estate`&&n.includes(r)?{kind:`moves`,from:e.from,was:e.to,to:r}:{kind:`outside`,from:e.from,was:e.to,to:r,unknown:t.kind===`estate`}}function ag(e){let t=new Map;for(let n of e.values())for(let e of n.edges)for(let n of e.joins??[]){let e=eg(n);e&&t.set(`${e.repo}:${e.at}`,{link:`${n.from} → ${n.to}`,what:[n.method,n.path].filter(Boolean).join(` `)})}return t}function og(e,t,n){let r=ag(e),i=ag(t),a=[];for(let e of n){let t=r.get(e),n=i.get(e);t&&t.link!==n?.link&&a.push({call:e,what:t.what,was:t.link,...n?{now:n.link}:{}})}return a}var B=E.why;function sg({title:e,list:t}){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`dt`,{className:`hud`,children:e}),(0,M.jsx)(`dd`,{style:{margin:0},children:(0,M.jsx)(`ul`,{className:`ev-list`,children:t.map(e=>(0,M.jsxs)(`li`,{children:[e.repo&&(0,M.jsxs)(`span`,{className:`mono`,children:[e.repo,`: `]}),(0,M.jsx)(`code`,{className:`mono`,children:e.at})]},`${e.repo??``}:${e.at}`))})})]})}function cg({title:e,list:t}){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`dt`,{className:`hud`,children:e}),(0,M.jsx)(`dd`,{style:{margin:0},children:t.length?(0,M.jsx)(`ul`,{className:`ev-list`,children:t.map(e=>(0,M.jsxs)(`li`,{children:[e.repo&&(0,M.jsxs)(`span`,{className:`mono`,children:[e.repo,`: `]}),(0,M.jsx)(Yh,{repo:e.repo,at:e.at})]},`${e.repo??``}:${e.at}`))}):(0,M.jsx)(`span`,{className:`ev-say`,children:B.noLine})})]})}function lg({join:e,topic:t,children:n}){let r=[e.method,e.path].filter(Boolean).join(` `),i=!!t&&e.how===`declared`&&!e.gateway,a=i?e.other.filter(e=>e.source===`manual`):[],o=i?e.other.filter(e=>e.source!==`manual`):e.other;return(0,M.jsxs)(`article`,{className:`stack`,style:{gap:4},"aria-label":B.call(e.from,e.to,r),children:[(0,M.jsxs)(`p`,{style:{margin:0},children:[(0,M.jsx)(`code`,{className:`mono`,children:B.call(e.from,e.to,r)}),` `,i?(0,M.jsx)(`span`,{className:`chip`,children:B.declared}):(0,M.jsx)(`span`,{className:`chip ${e.verified?`done`:`warn`}`,children:e.verified?B.verified:B.inferred})]}),(0,M.jsxs)(`p`,{className:`ev-say`,style:{margin:0},children:[i?B.declaredTopic:B.how[e.how]??B.how.unknown,e.gateway&&` ${B.gateway}`,e.shared&&` ${B.sharedMap(e.shared.team,e.shared.commit)}`]}),e.shared&&(0,M.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:B.sharedTheirs(e.shared.team)}),(0,M.jsxs)(`dl`,{className:`stack`,style:{gap:2,margin:0},children:[(0,M.jsx)(cg,{title:B.caller,list:e.caller}),e.hops.length>0&&(0,M.jsx)(cg,{title:B.hops,list:e.hops}),e.shared&&e.callee.length?(0,M.jsx)(sg,{title:B.callee,list:e.callee}):(0,M.jsx)(cg,{title:B.callee,list:e.callee}),o.length>0&&(0,M.jsx)(cg,{title:B.other,list:o}),a.length>0&&(0,M.jsx)(sg,{title:B.declaredIn,list:a})]}),n]})}function ug({list:e}){if(!e.length)return null;let t=e.filter(e=>e.status===`mismatch`).length;return(0,M.jsxs)(`section`,{className:`stack`,style:{gap:2},"aria-label":B.contracts,children:[(0,M.jsxs)(`p`,{className:`ev-say`,style:{margin:0},children:[(0,M.jsxs)(`span`,{className:`chip warn`,children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),B.contracts]}),` `,B.contractsOf(t,e.length-t)]}),(0,M.jsx)(`ul`,{className:`ev-list`,style:{margin:0},children:e.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{className:`chip ${e.status===`mismatch`?`warn`:``}`,children:E.mismatches.status[e.status]}),` `,e.message]},e.id))}),(0,M.jsx)(`a`,{href:nh,children:B.contractsAll})]})}function dg(e){let t=e.link.joins??[];return t.length?(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,M.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:B.intro}),t.map(t=>(0,M.jsxs)(lg,{join:t,topic:e.link.type===`publishes`||e.link.type===`subscribes`,children:[e.contracts&&(0,M.jsx)(ug,{list:eh(t,e.contracts)}),e.under?.(t)]},t.interface)),e.link.count>t.length&&(0,M.jsx)(`p`,{className:`ev-say`,children:B.more(e.link.count-t.length)})]}):(0,M.jsx)(`p`,{className:`ev-say`,children:B.none})}var fg=[`estate`,`outside`,`not-a-call`];function pg(e){return e.kind===`moves`?[B.will.moves(e.from,e.was,e.to)]:e.kind===`dropped`?[B.will.dropped(e.from,e.was)]:[...e.unknown?[B.will.unknown(e.to)]:[],B.will.outside(e.from,e.was,e.to)]}function mg(e){let t=(0,v.useId)(),n=eg(e.join),r=tg(e.join,e.facts?.state===`ready`?e.facts.data:void 0),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(`estate`),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(),m=e.saving??{state:`idle`},h=[e.join.method,e.join.path].filter(Boolean).join(` `),g=B.call(e.join.from,e.join.to,h),_=r.find(e=>e.id===i)??r[0];if(!n)return(0,M.jsx)(`p`,{className:`ev-say`,children:B.noLine});if(!e.facts||e.facts.state===`loading`)return(0,M.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:B.loadingFacts});if(e.facts.state===`error`)return(0,M.jsx)(`p`,{role:`alert`,className:`state error`,children:B.factsFailed(e.facts.error)});if(!_)return(0,M.jsx)(`p`,{className:`ev-say`,children:B.noCall(n.repo)});let y=()=>o===`not-a-call`?{kind:o,reason:u}:{kind:o,target:c,reason:u};return(0,M.jsxs)(`form`,{className:`ev-correct stack`,onSubmit:t=>{t.preventDefault();let r=ng(_,y());if(`error`in r)return p(B[r.error]);p(void 0),e.onSave?.(n.repo,r.body,ig(e.join,y(),e.known))},onKeyDown:de(e.onClose),"aria-labelledby":`${t}-t`,children:[(0,M.jsx)(`h4`,{id:`${t}-t`,className:`h`,style:{fontSize:14},children:B.wrongTitle(g)}),(0,M.jsx)(`p`,{className:`ev-say`,children:B.wrongIntro}),r.length>1&&(0,M.jsxs)(`fieldset`,{className:`ev-choice`,children:[(0,M.jsx)(`legend`,{className:`hud`,children:B.pickCall}),r.map(e=>(0,M.jsxs)(`label`,{className:`row`,style:{gap:6},children:[(0,M.jsx)(`input`,{type:`radio`,name:`${t}-call`,value:e.id,checked:_.id===e.id,onChange:()=>a(e.id)}),(0,M.jsx)(`code`,{className:`mono`,children:e.label})]},e.id))]}),(0,M.jsxs)(`fieldset`,{className:`ev-choice`,children:[(0,M.jsx)(`legend`,{className:`sr`,children:B.wrongTitle(g)}),fg.map(e=>(0,M.jsxs)(`label`,{className:`row`,style:{gap:6},children:[(0,M.jsx)(`input`,{type:`radio`,name:`${t}-choice`,value:e,checked:o===e,onChange:()=>s(e)}),B.choice[e]]},e))]}),o!==`not-a-call`&&(0,M.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`hud`,children:o===`estate`?B.target:B.outsideTarget}),(0,M.jsx)(`input`,{value:c,list:o===`estate`?`${t}-known`:void 0,"aria-describedby":`${t}-hint`,onChange:e=>l(e.target.value)}),(0,M.jsx)(`span`,{id:`${t}-hint`,className:`ev-say`,children:o===`estate`?B.targetHint:B.outsideHint}),o===`estate`&&(0,M.jsx)(`datalist`,{id:`${t}-known`,children:e.known.map(e=>(0,M.jsx)(`option`,{value:e},e))})]}),(0,M.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`hud`,children:o===`not-a-call`?B.reason:B.reasonOptional}),(0,M.jsx)(`textarea`,{rows:2,value:u,onChange:e=>d(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:m.state===`working`,children:m.state===`working`?B.saving:B.save}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onClose,children:E.evidence.close})]}),f&&(0,M.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:f}),m.state===`working`&&(0,M.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`ev-say`,children:B.saving}),m.state===`error`&&(0,M.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:m.text}),m.state===`done`&&(0,M.jsxs)(`div`,{role:`status`,className:`stack`,style:{gap:4},children:[pg(m.will).map(e=>(0,M.jsx)(`p`,{className:`ev-say`,style:{margin:0},children:e},e)),(0,M.jsx)(`p`,{className:`ev-say`,children:B.saved(m.result.file)}),(0,M.jsx)(Bh,{repo:n.repo,result:m.result})]})]})}function hg(e){let t=Uh(),n=eg(e.join),r=n?.repo;(0,v.useEffect)(()=>{r&&t?.need(r)},[r,t]);let[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)({state:`idle`}),c=[e.join.method,e.join.path].filter(Boolean).join(` `);return n?(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":i,"aria-label":B.wrongOf(B.call(e.join.from,e.join.to,c)),onClick:()=>a(e=>!e),children:B.wrong}),i&&(0,M.jsx)(mg,{join:e.join,facts:t?.of(n.repo),known:e.known,saving:o,onSave:(r,i,a)=>{s({state:`working`}),k(`/api/facts/${encodeURIComponent(r)}/corrections`,{method:`POST`,body:i}).then(i=>{s({state:`done`,result:i,will:a}),t?.reload(r),e.onSaved?.(`${n.repo}:${n.at}`)},e=>s({state:`error`,text:Wt(e)}))},onClose:()=>a(!1)})]}):null}function gg({moved:e}){return(0,M.jsxs)(`div`,{role:`status`,className:`stack`,style:{gap:4},children:[(0,M.jsx)(`h3`,{className:`h`,style:{fontSize:14},children:B.moved}),e.length?(0,M.jsx)(`ul`,{className:`ev-list`,children:e.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`code`,{className:`mono`,children:e.call}),` `,e.now?B.movedTo(e.what,e.was,e.now):B.movedOff(e.what,e.was)]},e.call))}):(0,M.jsx)(`p`,{className:`ev-say`,children:B.notYet})]})}var _g=[`architecture`,`repo`,`data`,`integration`,`infrastructure`],vg=(e,t)=>`/api/graph/node/${encodeURIComponent(e)}?lens=${t}`;function yg(e){return(0,M.jsx)(Wh,{children:(0,M.jsx)(xg,{...e})})}var bg=[];function xg({hash:e,screen:t=`architecture`}){let n=ye(e,`lens`),r=_g.includes(n??``)?n:`architecture`,i=ye(e,`node`),[a,o]=(0,v.useState)(new Map),s=Uh(),c=dh(a).join(` `);(0,v.useEffect)(()=>{for(let e of c.split(` `).filter(Boolean))s?.need(e)},[c,s]);let l=A(`/api/contracts`),u=l.state===`ready`?l.data.findings:bg,d=(0,v.useMemo)(()=>uh(lh(a,e=>{let t=s?.of(e);return t?.state===`ready`?t.data:void 0}),u),[a,s,u]),[f,p]=(0,v.useState)({state:`loading`}),[m,h]=(0,v.useState)(`estate`),[g,_]=(0,v.useState)(new Set([`estate`])),[y,b]=(0,v.useState)(),[x,S]=(0,v.useState)(),[C,w]=(0,v.useState)(new Set),[T,E]=(0,v.useState)(),[ee,te]=(0,v.useState)({state:`loading`,key:``}),[ne,O]=(0,v.useState)(0),[re,ie]=(0,v.useState)({state:`idle`}),ae=(0,v.useRef)(new Map),[oe,se]=(0,v.useState)(),ce=(0,v.useCallback)(async(e,t)=>{let n=await k(vg(e,r));return o(r=>new Map(t??r).set(e,n)),n},[r]);(0,v.useEffect)(()=>{let e=!0;return p({state:`loading`}),h(`estate`),_(new Set([`estate`])),b(void 0),S(void 0),w(new Set),ce(`estate`,new Map).then(async()=>{let t=i&&i!==`estate`?await ce(i).catch(()=>void 0):void 0;if(t&&e){let e=vh(t);for(let n of e.expanded)n!==`estate`&&n!==t.node.id&&await ce(n).catch(()=>void 0);_(new Set(e.expanded)),h(e.current),b(e.selected)}e&&p({state:`ready`})},t=>e&&p({state:`error`,error:t instanceof Error?t.message:String(t),...t instanceof D&&t.problem.notYet?{notYet:!0}:{}})),()=>{e=!1}},[ce,i]),j(e=>{if(e.type===`file.changed`&&typeof e.path==`string`&&e.path.startsWith(`catalog`))for(let e of d.keys())ce(e).catch(()=>void 0)});let le=e=>{if(x){if(x.node.id===e)return x.node;let t=x.neighbours.find(t=>t.id===e);if(t)return t}for(let t of d.values()){if(t.node.id===e)return t.node;let n=t.children.find(t=>t.id===e)??t.outside.find(t=>t.id===e);if(n)return n}},ue=async e=>{let t=le(e);if(!t||t.childCount===0)b(e);else try{d.has(e)||await ce(e),_(t=>new Set(t).add(e)),h(e),b(e),S(void 0),w(new Set)}catch(e){p({state:`error`,error:e instanceof Error?e.message:String(e)})}},de=e=>{_(t=>{let n=new Set(t);return n.delete(e),n});let t=le(e)?.parent;m===e&&t?(h(t),w(new Set)):fe(e),S(void 0)},P=async e=>{if(C.has(e))return fe(e);try{d.has(e)||await ce(e),w(t=>new Set(t).add(e)),_(t=>new Set(t).add(e)),b(e)}catch(e){p({state:`error`,error:e instanceof Error?e.message:String(e)})}},fe=e=>w(t=>{let n=new Set(t),r=t=>{for(let n=le(t)?.parent;n;n=le(n)?.parent)if(n===e)return!0;return!1};for(let i of t)(i===e||r(i))&&n.delete(i);return n}),pe=async e=>{try{S(await k(`/api/graph/focus/${encodeURIComponent(e)}?lens=${r}`)),b(e)}catch(e){p({state:`error`,error:e instanceof Error?e.message:String(e)})}},me=(0,v.useMemo)(()=>ah(d,`estate`,g),[d,g]),he=d.get(m),F=(0,v.useMemo)(()=>ph(d,m,C,x),[d,m,C,x]),ge=x?x.node.id:m,_e=_h(r,ge,x?`focus`:`node`);(0,v.useEffect)(()=>{let e=!0;return te({state:`loading`,key:_e}),ie({state:`idle`}),E(void 0),k(`/api/graph/layout/${encodeURIComponent(_e)}`).then(t=>e&&te({state:`ready`,key:_e,pinned:t.positions,moved:0}),t=>e&&te({state:`error`,key:_e,error:t instanceof Error?t.message:String(t)})),()=>{e=!1}},[_e]);let ve=async(e,t)=>{ie({state:`saving`});try{let n=await k(`/api/graph/layout/${encodeURIComponent(_e)}`,{method:`PUT`,body:{lens:r,node:ge,positions:e}});return te({state:`ready`,key:_e,pinned:n.positions,moved:0}),ie({state:`done`,text:t||z.kept(n.path)}),!0}catch(e){return ie({state:`error`,text:z.keepFailed(e instanceof Error?e.message:String(e))}),!1}},xe=ee.state===`ready`?ee.pinned:{},Se=!x&&he?gh(T?.over??[],he.suggest,C,he.children):void 0,Ce=(e,t)=>{let n=oh(me,e,t.key);n&&(t.preventDefault(),`focus`in n?ae.current.get(n.focus)?.focus():`open`in n?ue(n.open):`close`in n?de(n.close):b(n.select))},we=y?le(y):void 0,Te=rg(a),Ee=oe?og(oe.before,a,oe.calls):[],De=e=>(0,M.jsx)(hg,{join:e,known:Te,onSaved:e=>se(t=>({calls:[...new Set([...t?.calls??[],e])],before:t?.before??a}))}),Oe=he?[...he.path,he.node]:[];return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:z.title,span:`1 / -1`,children:(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:12},children:[(0,M.jsx)(`div`,{role:`tablist`,"aria-label":z.lens,className:`row`,style:{gap:6},children:_g.map(e=>(0,M.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":e===r,className:`btn ${e===r?`primary`:``}`,onClick:()=>be(t,`lens`,e),children:z.lenses[e]},e))}),(0,M.jsx)(`nav`,{"aria-label":z.breadcrumbs,children:(0,M.jsx)(`ol`,{className:`row`,style:{gap:4,listStyle:`none`,margin:0,padding:0},children:Oe.map((e,t)=>(0,M.jsxs)(`li`,{className:`row`,style:{gap:4},children:[t>0&&(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),t===Oe.length-1&&!x?(0,M.jsx)(`span`,{className:`chip`,"aria-current":`location`,children:e.label}):(0,M.jsx)(`button`,{type:`button`,className:`btn`,"aria-current":t===Oe.length-1?`location`:void 0,onClick:()=>{e.id!==m&&w(new Set),h(e.id),S(void 0)},children:e.label})]},e.id))})})]})}),f.state===`loading`&&(0,M.jsx)(N,{span:`1 / -1`,children:(0,M.jsxs)(`div`,{className:`stack`,"aria-busy":`true`,"aria-live":`polite`,children:[(0,M.jsx)(`span`,{className:`sr`,children:z.loading}),(0,M.jsx)(`div`,{className:`skeleton`,style:{width:`80%`}}),(0,M.jsx)(`div`,{className:`skeleton`,style:{width:`60%`}})]})}),f.state===`error`&&(0,M.jsx)(N,{span:`1 / -1`,children:f.notYet?(0,M.jsx)(`div`,{className:`state`,children:z.emptyEstate}):(0,M.jsx)(`div`,{className:`state error`,role:`alert`,children:z.loadFailed(f.error)})}),f.state===`ready`&&he&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(N,{title:z.canvas,span:`1 / -1`,meta:z.edges(F.links.length,x?0:he.hiddenEdges),children:[Se&&(0,M.jsxs)(`div`,{className:`state arch-notice`,role:`status`,children:[(0,M.jsxs)(`p`,{children:[Se.why===`nodes`?z.legible.nodes(T?.score.nodes??0):z.legible[Se.why],` `,z.legible[Se.mode]]}),Se.mode===`focus`&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void pe(Se.id),children:z.focus}),Se.mode===`collapse`&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>w(new Set),children:z.collapseAll}),Se.mode===`group`&&Se.id&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void ue(Se.id),children:z.openPart(le(Se.id)?.label??Se.id)})]}),F.shared&&F.shared.length>0&&(0,M.jsxs)(`p`,{className:`arch-shared`,children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),z.sharedGaps(F.shared.map(e=>z.gap[e]??e).join(`; `))]}),(0,M.jsx)(Cg,{ready:ee.state===`ready`,saving:re.state===`saving`,moved:ee.state===`ready`?ee.moved:0,...x?{onFocusOff:()=>S(void 0)}:{},onKeep:()=>{Object.keys(xe).length?ve(xe,``):ie({state:`error`,text:z.keptNothing})},onTidy:()=>O(e=>e+1),onReset:()=>void ve({},z.resetDone).then(e=>e&&O(e=>e+1))}),re.state===`done`&&(0,M.jsx)(`p`,{className:`hud`,role:`status`,children:re.text}),re.state===`error`&&(0,M.jsx)(`p`,{className:`state error`,role:`alert`,children:re.text}),F.boxes.length?ee.state===`error`?(0,M.jsx)(`div`,{className:`state error`,role:`alert`,children:z.loadFailed(ee.error)}):ee.state===`loading`||ee.key!==_e?(0,M.jsxs)(`div`,{className:`stack`,"aria-busy":`true`,"aria-live":`polite`,children:[(0,M.jsx)(`span`,{className:`sr`,children:z.layingOut}),(0,M.jsx)(`div`,{className:`skeleton`,style:{width:`70%`}})]}):(0,M.jsx)(jh,{graph:F,direction:mh(r),pinned:xe,tidy:ne,...y?{selected:y}:{},onSelect:e=>b(e),onToggle:e=>void P(e),onMoved:(e,t)=>te(n=>n.state===`ready`?{...n,pinned:{...n.pinned,[e]:{x:t.x,y:t.y}},moved:n.moved+ +!n.pinned[e]}:n),onLaid:E,aside:(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`h2`,{className:`h`,children:z.inspector}),we?(0,M.jsx)(Sg,{node:we,isCurrent:we.id===m,onOpen:ue,onFocus:pe,lens:r,links:(x?.edges??he.edges).filter(e=>e.from===we.id||e.to===we.id),labelOf:e=>le(e)?.label??e,under:De,contracts:u,...!x&&F.boxes.some(e=>e.id===we.id)?{here:{open:C.has(we.id),toggle:()=>void P(we.id)}}:{}}):(0,M.jsx)(`p`,{children:z.pick}),oe&&(0,M.jsx)(gg,{moved:Ee})]})},_e):(0,M.jsx)(`div`,{className:`state`,children:z.empty}),(0,M.jsx)(`p`,{className:`hud`,style:{marginTop:8},children:z.canvasHelp})]}),(0,M.jsxs)(N,{title:z.outline,span:`1 / -1`,children:[(0,M.jsx)(`p`,{className:`hud`,id:`outline-help`,children:z.outlineHelp}),(0,M.jsx)(`ul`,{role:`tree`,"aria-describedby":`outline-help`,style:{listStyle:`none`,padding:0},children:me.map(e=>(0,M.jsx)(`li`,{role:`treeitem`,"aria-level":e.depth+1,"aria-expanded":e.node.childCount>0?e.expanded:void 0,"aria-selected":e.node.id===y,style:{paddingLeft:e.depth*18},children:(0,M.jsxs)(`button`,{type:`button`,className:`btn ${e.node.id===m?`primary`:``}`,ref:t=>{t?ae.current.set(e.node.id,t):ae.current.delete(e.node.id)},onKeyDown:t=>Ce(e.node.id,t),onClick:()=>b(e.node.id),onDoubleClick:()=>void(e.expanded?de(e.node.id):ue(e.node.id)),children:[(0,M.jsx)(`span`,{className:`hud`,children:e.node.kind}),` `,e.node.label,e.node.childCount>0&&` · ${z.children(e.node.childCount)}`,e.gaps.length>0&&` · ${z.gaps}: ${e.gaps.map(e=>z.gap[e]??e).join(`, `)}`,e.inside.length>0&&` · ${z.insideGaps(e.inside.map(e=>z.gap[e]??e).join(`, `))}`]})},e.node.id))})]})]})]})}function Sg({node:e,isCurrent:t,lens:n,onOpen:r,onFocus:i,here:a,links:o=[],labelOf:s=e=>e,under:c,contracts:l}){return(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`h3`,{className:`h`,children:e.label}),(0,M.jsx)(Xt,{rows:[[z.kind,e.kind],[z.stateLabel,z.state[e.state]],...Object.entries(e.properties).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)])]}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:6},children:[e.childCount>0&&!t&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>r(e.id),children:z.open}),e.childCount>0&&a&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:a.toggle,children:a.open?z.closeHere:z.openHere}),e.kind===`repo`&&(0,M.jsx)(`a`,{className:`btn`,href:`#/flows?repo=${encodeURIComponent(e.label)}`,children:E.flows.openFlows}),e.kind===`repo`&&(0,M.jsx)(`a`,{className:`btn`,href:`#/trust`,children:z.repoCounts}),e.kind===`system`&&e.id.startsWith(`system:`)&&e.record&&(0,M.jsx)(`a`,{className:`btn`,href:Bt(e.id.slice(7)),children:E.systems.openPage}),e.kind!==`estate`&&(n===`data`||e.kind===`table`)&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>i(e.id),children:z.focus})]}),(0,M.jsx)(`h4`,{className:`hud`,children:z.gaps}),e.gaps.length?(0,M.jsx)(`ul`,{children:e.gaps.map(e=>(0,M.jsxs)(`li`,{children:[z.gap[e]??e,z.gapFix[e]&&(0,M.jsxs)(`span`,{className:`hud`,children:[` · `,z.gapFix[e]]})]},e))}):(0,M.jsx)(`p`,{children:z.noGaps}),(0,M.jsx)(`h4`,{className:`hud`,children:z.evidence}),e.evidence.length?(0,M.jsx)(`ul`,{children:e.evidence.map(e=>(0,M.jsxs)(`li`,{children:[e.repo&&(0,M.jsxs)(`span`,{className:`mono`,children:[e.repo,`: `]}),(0,M.jsx)(Yh,{repo:e.repo,at:e.at})]},`${e.repo??``}:${e.at}`))}):(0,M.jsx)(`p`,{children:z.noEvidence}),(0,M.jsx)(`h4`,{className:`hud`,children:E.evidence.links}),o.length?(0,M.jsx)(`ul`,{children:o.map(e=>(0,M.jsxs)(`li`,{children:[E.evidence.linkOf(s(e.from),s(e.to),e.type),e.gaps.length>0&&` · ${z.gaps}: ${e.gaps.map(e=>z.gap[e]??e).join(`, `)}`,e.joins?.length?(0,M.jsxs)(`details`,{children:[(0,M.jsx)(`summary`,{children:E.why.openOf(E.evidence.linkOf(s(e.from),s(e.to),e.type))}),(0,M.jsx)(dg,{link:e,...c?{under:c}:{},...l?{contracts:l}:{}})]}):e.evidence.length>0&&(0,M.jsx)(`ul`,{children:e.evidence.map(e=>(0,M.jsxs)(`li`,{children:[e.repo&&(0,M.jsxs)(`span`,{className:`mono`,children:[e.repo,`: `]}),(0,M.jsx)(Yh,{repo:e.repo,at:e.at})]},`${e.repo??``}:${e.at}`))})]},e.id))}):(0,M.jsx)(`p`,{children:E.evidence.noLinks}),e.next&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`h4`,{className:`hud`,children:z.next}),(0,M.jsx)(`p`,{children:e.next.why}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,M.jsx)(`code`,{className:`mono`,children:e.next.command}),(0,M.jsx)(Yt,{text:e.next.command,label:`${z.copy}: ${e.next.command}`})]}),(0,M.jsx)(gn,{command:e.next.command})]})]})}function Cg(e){return(0,M.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`,marginBottom:8},children:[e.onFocusOff&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onFocusOff,children:z.focusOff}),(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:!e.ready||e.saving,onClick:e.onKeep,children:e.saving?z.keeping:z.keep}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:!e.ready,onClick:e.onTidy,children:z.tidy}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:!e.ready||e.saving,onClick:e.onReset,children:z.reset}),e.moved>0&&(0,M.jsx)(`span`,{className:`hud`,children:z.moved(e.moved)})]})}var wg=E.me,Tg=(0,v.createContext)({saveNotify:async()=>void 0});function Eg({children:e}){let t=A(`/api/me`),[n,r]=(0,v.useState)(),i=n??(t.state===`ready`?t.data:void 0),a=async e=>{r(await k(`/api/me/notify`,{method:`PUT`,body:e}))};return(0,M.jsx)(Tg.Provider,{value:{...i?{me:i}:{},saveNotify:a},children:e})}var Dg=()=>(0,v.useContext)(Tg),Og=()=>Dg().me?.ai!==`off`,kg=wg.aiIsOffHere,Ag=e=>e.toLowerCase().split(/\s+/).filter(Boolean);function jg(e,t){let n=Ag(t);if(!n.length)return!0;let r=e.filter(e=>!!e).map(e=>e.toLowerCase());return n.every(e=>r.some(t=>t.includes(e)))}var Mg=E.filter;function Ng(e){return[e.text?.trim()?Mg.words(e.text.trim()):``,e.kind?Mg.among(e.kind):``,e.repo?Mg.inRepo(e.repo):``,e.change?Mg.inChange(e.change):``].filter(Boolean).join(` `)}function Pg(e){return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4,...e.grow?{flex:`1 1 200px`}:{}},children:[(0,M.jsx)(`label`,{htmlFor:e.id,className:`hud`,style:{fontSize:10},children:Mg.label}),(0,M.jsx)(`input`,{id:e.id,className:`field`,value:e.value,placeholder:Mg.placeholder,autoComplete:`off`,onChange:t=>e.onChange(t.target.value)})]})}function Fg(e){return(0,M.jsx)(`p`,{className:`hud`,"aria-live":`polite`,style:{margin:0,fontSize:10,minHeight:`1em`},children:e.active?Mg.shown(e.shown,e.total):``})}function Ig(e){return(0,M.jsxs)(`div`,{className:`state stack`,style:{gap:8,alignItems:`flex-start`},children:[(0,M.jsx)(`span`,{children:Mg.nothingMatches(e.what)}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>{e.onClear(),e.focus&&document.getElementById(e.focus)?.focus()},children:Mg.clear})]})}var V=E.runs;function Lg(e){let t=e.label??(e.change?V.forChange(e.change):V.all);return(0,M.jsx)(`a`,{className:`runs-link`,href:Rg({...e.change?{change:e.change}:{},...e.q?{q:e.q}:{}}),children:t})}function Rg(e){let t=new URLSearchParams;e.change&&t.set(`change`,e.change),e.q&&t.set(`q`,e.q),e.run&&t.set(`run`,e.run);let n=t.toString();return`#/runs${n?`?${n}`:``}`}var zg=e=>V.states[e]??e,Bg=e=>e.replace(`T`,` `).slice(0,16),Vg=e=>e?V.classes[e]??e:void 0,Hg=e=>V.modelCell(Vg(e.stepClass),e.model);function Ug(e,t){return e.filter(e=>jg([e.change,e.agent,e.runId,e.state,zg(e.state),e.runtime,e.model??``,Vg(e.stepClass)??``],t))}function Wg(e){return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[e.change&&(0,M.jsxs)(`p`,{className:`work-say`,style:{margin:0},children:[V.onlyFor(e.change),` `,(0,M.jsx)(`a`,{href:`#/runs`,children:V.showAll})]}),(0,M.jsx)(P,{of:e.of,empty:e=>e.runs.length===0,emptyContent:(0,M.jsx)(`div`,{className:`state`,children:e.change?V.emptyFor(e.change):V.empty}),children:t=>{let n=Ug(t.runs,e.text);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{role:`search`,children:(0,M.jsx)(Pg,{id:`runs-find`,value:e.text,onChange:t=>e.onText?.(t)})}),(0,M.jsx)(Fg,{shown:n.length,total:t.runs.length,active:!!e.text.trim()}),n.length===0?(0,M.jsx)(Ig,{what:Ng({text:e.text}),onClear:()=>e.onClear?.(),focus:`runs-find`}):(0,M.jsx)(ke,{caption:V.caption,rows:n,rowKey:e=>e.runId,cols:[{label:V.cols.step,cell:t=>(0,M.jsxs)(`a`,{href:Rg({run:t.runId}),"aria-current":t.runId===e.current?`page`:void 0,children:[t.change,(0,M.jsx)(`span`,{className:`mono runs-id`,children:t.runId})]})},{label:V.cols.agent,cell:e=>e.agent,mono:!0},{label:V.cols.model,cell:e=>Hg(e)},{label:V.cols.round,cell:e=>e.attempt},{label:V.cols.state,cell:e=>(0,M.jsx)(`span`,{className:`chip ${Gg[e.state]??`dim`}`,children:zg(e.state)})},{label:V.cols.answered,cell:e=>e.answered?V.yes:V.notYet},{label:V.cols.handedBack,cell:e=>V.problems(e.handedBack)},{label:V.cols.when,cell:e=>(0,M.jsx)(`time`,{dateTime:e.startedAt,children:Bg(e.startedAt)}),mono:!0}]})]})}})]})}var Gg={validated:`done`,produced:`warn`,waiting:`warn`,failed:`blocking`};function Kg({text:e,label:t}){return(0,M.jsx)(`pre`,{className:`runs-text`,tabIndex:0,role:`region`,"aria-label":V.textBox(t),children:e})}function qg(e){return(0,M.jsx)(P,{of:e.of,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:14},children:[(0,M.jsx)(Xt,{rows:[[V.facts.agent,(0,M.jsx)(`span`,{className:`mono`,children:e.run.agent})],[V.facts.runtime,e.run.runtime],...e.run.stepClass?[[V.facts.stepClass,Vg(e.run.stepClass)]]:[],[V.facts.model,e.run.model?(0,M.jsx)(`span`,{className:`mono`,children:e.run.model}):V.modelNotRecorded],[V.facts.state,zg(e.run.state)],[V.facts.started,(0,M.jsx)(`time`,{dateTime:e.run.startedAt,children:Bg(e.run.startedAt)})],...e.run.finishedAt?[[V.facts.finished,(0,M.jsx)(`time`,{dateTime:e.run.finishedAt,children:Bg(e.run.finishedAt)})]]:[],...e.run.promptTokens===void 0?[]:[[V.facts.size,V.tokens(e.run.promptTokens)]],...e.run.promptPath?[[V.facts.file,(0,M.jsx)(`code`,{className:`mono`,children:e.run.promptPath})]]:[]]}),e.rounds.length>1&&(0,M.jsxs)(`nav`,{"aria-label":V.rounds,children:[(0,M.jsx)(`h3`,{className:`hud runs-h`,children:V.rounds}),(0,M.jsx)(`ol`,{className:`runs-rounds`,children:e.rounds.map(t=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`a`,{href:Rg({run:t.runId}),"aria-current":t.runId===e.run.runId?`page`:void 0,children:V.round(t.attempt)}),` `,(0,M.jsx)(`span`,{className:`muted`,children:zg(t.state)}),t.runId===e.run.runId&&(0,M.jsxs)(`span`,{className:`muted`,children:[` `,V.thisRound]})]},t.runId))})]}),(0,M.jsxs)(`div`,{className:`runs-pair`,children:[(0,M.jsxs)(`section`,{"aria-labelledby":`run-prompt`,children:[(0,M.jsx)(`h3`,{id:`run-prompt`,className:`hud runs-h`,children:V.prompt}),(0,M.jsx)(Kg,{text:e.prompt,label:V.prompt})]}),(0,M.jsxs)(`section`,{"aria-labelledby":`run-answer`,children:[(0,M.jsx)(`h3`,{id:`run-answer`,className:`hud runs-h`,children:V.answer}),e.answer===void 0?(0,M.jsx)(`div`,{className:`state`,children:V.noAnswer}):(0,M.jsx)(Kg,{text:e.answer,label:V.answer})]})]}),e.tools&&(0,M.jsxs)(`section`,{"aria-labelledby":`run-tools`,children:[(0,M.jsx)(`h3`,{id:`run-tools`,className:`hud runs-h`,children:V.tools.title}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:V.tools.offered(e.tools.offered.join(`, `),e.tools.calls.length)}),e.tools.stopped&&(0,M.jsx)(`p`,{className:`muted`,role:`note`,children:V.tools.stopped(e.tools.stopped)}),e.tools.calls.map((e,t)=>(0,M.jsxs)(`section`,{"aria-labelledby":`run-tool-${t}`,children:[(0,M.jsx)(`h4`,{id:`run-tool-${t}`,className:`runs-h4`,children:V.tools.call(e.round,e.name,e.tokens,e.error===!0)}),(0,M.jsx)(`pre`,{className:`runs-line`,children:JSON.stringify(e.input)}),(0,M.jsx)(Kg,{text:e.output,label:V.tools.returned(e.name)})]},`${t}:${e.name}`))]}),e.retrieval&&(e.retrieval.expansion||e.retrieval.rerank||e.retrieval.meaning)&&(0,M.jsxs)(`section`,{"aria-labelledby":`run-retrieval`,children:[(0,M.jsx)(`h3`,{id:`run-retrieval`,className:`hud runs-h`,children:V.retrieval.title}),e.retrieval.expansion&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0},children:[V.retrieval.expansion(e.retrieval.expansion.run,e.retrieval.expansion.cached),` `,V.retrieval.terms(e.retrieval.expansion.terms.join(`; `))]}),(0,M.jsxs)(`ul`,{children:[e.retrieval.expansion.names.map(e=>(0,M.jsx)(`li`,{children:V.retrieval.name(e.name,e.id,e.new===!0,e.quote)},`n:${e.name}`)),e.retrieval.expansion.dropped.map(e=>(0,M.jsx)(`li`,{children:V.retrieval.dropped(e.name,e.why)},`d:${e.name}`))]})]}),e.retrieval.rerank&&(0,M.jsx)(`p`,{className:`muted`,children:e.retrieval.rerank.used?V.retrieval.rerank(e.retrieval.rerank.shown,e.retrieval.rerank.order.join(`, `),e.retrieval.rerank.dropped.join(`, `)):V.retrieval.rerankIgnored(e.retrieval.rerank.shown)}),e.retrieval.meaning&&(0,M.jsx)(`p`,{className:`muted`,children:V.retrieval.meaning(e.retrieval.meaning)})]}),(0,M.jsxs)(`section`,{"aria-labelledby":`run-back`,children:[(0,M.jsx)(`h3`,{id:`run-back`,className:`hud runs-h`,children:V.handedBack}),e.handedBack.length===0?(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:V.noneHandedBack}):e.handedBack.map(e=>(0,M.jsxs)(`div`,{className:`runs-pair`,children:[(0,M.jsxs)(`section`,{"aria-labelledby":`run-back-${e.attempt}`,children:[(0,M.jsx)(`h4`,{id:`run-back-${e.attempt}`,className:`runs-h4`,children:V.roundProblems(e.attempt)}),(0,M.jsx)(`ul`,{className:`runs-problems`,children:e.problems.map((e,t)=>(0,M.jsx)(`li`,{children:(0,M.jsx)(`pre`,{className:`runs-line`,children:e})},`${t}:${e}`))})]}),(0,M.jsxs)(`section`,{"aria-labelledby":`run-failed-${e.attempt}`,children:[(0,M.jsx)(`h4`,{id:`run-failed-${e.attempt}`,className:`runs-h4`,children:V.failedAnswer(e.attempt)}),e.previousAnswer===void 0?(0,M.jsx)(`p`,{className:`muted`,children:V.noFailedAnswer}):(0,M.jsx)(Kg,{text:e.previousAnswer,label:V.failedAnswer(e.attempt)})]})]},e.attempt))]})]})})}function Jg({hash:e}){let t=ye(e,`change`),n=ye(e,`run`),[r,i]=(0,v.useState)(ye(e,`q`)??``),a=ye(e,`q`);(0,v.useEffect)(()=>i(a??``),[a]);let o=A(`/api/runs${t?`?change=${encodeURIComponent(t)}`:``}`),s=A(n?`/api/runs/${encodeURIComponent(n)}/transcript`:void 0);j(e=>{e.type===`file.changed`&&(o.reload(),n&&s.reload())});let c=s.state===`ready`&&s.data.run.runId===n?s:{state:`loading`};return(0,M.jsxs)(`div`,{className:`bento`,children:[n&&(0,M.jsxs)(N,{title:c.state===`ready`?V.runTitle(c.data.run.change,c.data.run.attempt):V.title,span:`1 / -1`,labelledBy:`run-detail`,children:[(0,M.jsx)(`p`,{style:{margin:`0 0 10px`},children:(0,M.jsx)(`a`,{href:Rg(t?{change:t}:{}),children:V.back})}),s.state===`error`?(0,M.jsx)(qg,{of:{...s,error:s.error||V.missing(n)}}):(0,M.jsx)(qg,{of:c})]}),(0,M.jsxs)(N,{title:n?V.listTitle:V.title,span:`1 / -1`,children:[(0,M.jsx)(`p`,{className:`work-say`,style:{marginTop:0},children:V.intro}),(0,M.jsx)(Wg,{of:o,text:r,onText:i,onClear:()=>i(``),...t?{change:t}:{},...n?{current:n}:{}}),!n&&o.state===`ready`&&o.data.runs.length>0&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`,fontSize:12},children:V.pick})]})]})}var Yg=E.runNext;function Xg({text:e,label:t}){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`work-cmd`,children:[(0,M.jsx)(`code`,{className:`mono`,children:e}),(0,M.jsx)(Yt,{text:e,label:`${t}: ${e}`})]}),(0,M.jsx)(gn,{command:e})]})}function Zg({slash:e}){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`work-say`,children:e.where===E.work.slashWhere.metarepo?Yg.slash:Yg.slashIn(e.where)}),(0,M.jsx)(Xg,{text:e.command,label:Yg.copySlash})]})}function Qg({step:e}){return(0,M.jsxs)(`section`,{className:`panel hero work-next`,"aria-labelledby":`run-next`,children:[(0,M.jsx)(`h2`,{id:`run-next`,className:`h`,children:Yg.title}),(0,M.jsx)(`p`,{className:`work-why`,children:e.why}),(0,M.jsx)(`p`,{className:`work-say`,children:Yg.terminal}),(0,M.jsx)(Xg,{text:e.command,label:Yg.copy}),e.slash?(0,M.jsx)(Zg,{slash:e.slash}):(0,M.jsx)(`p`,{className:`work-say`,children:Yg.noSlash}),(0,M.jsx)(`p`,{className:`work-say`,children:Yg.whatNext}),e.link&&(0,M.jsx)(`p`,{style:{margin:`8px 0 0`},children:(0,M.jsx)(`a`,{href:e.link.href,children:e.link.label})}),e.after&&e.after.length>0&&(0,M.jsxs)(`details`,{className:`work-after`,children:[(0,M.jsx)(`summary`,{children:Yg.after}),(0,M.jsx)(`ol`,{children:e.after.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`p`,{className:`work-say`,children:e.why}),(0,M.jsx)(Xg,{text:e.command,label:Yg.copy}),e.slash&&(0,M.jsx)(Zg,{slash:e.slash})]},e.command))})]})]})}function $g({of:e,step:t}){return(0,M.jsx)(P,{of:e,children:e=>(0,M.jsx)(Qg,{step:t(e)})})}function e_({bare:e=!1}){let t=E.work,n=(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`work-why`,children:t.pickAChange}),(0,M.jsx)(`p`,{className:`work-say`,children:(0,M.jsx)(`a`,{href:`#/changes`,children:t.openAllChanges})})]});return e?(0,M.jsx)(`div`,{className:`state`,children:n}):(0,M.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pick-a-change`,style:{gridColumn:`1 / -1`},children:[(0,M.jsx)(`h2`,{id:`pick-a-change`,className:`h`,children:t.pickAChangeTitle}),n]})}function t_({title:e}){let t=E.work;return(0,M.jsxs)(`section`,{className:`panel`,"aria-labelledby":`no-change`,style:{gridColumn:`1 / -1`},children:[(0,M.jsx)(`h2`,{id:`no-change`,className:`h`,children:e??t.noChangeTitle}),(0,M.jsx)(`p`,{className:`work-why`,children:t.noChangeYet}),(0,M.jsx)(`p`,{className:`work-say`,children:Yg.terminal}),(0,M.jsx)(Xg,{text:t.noChangeCommand,label:Yg.copy}),(0,M.jsx)(`p`,{className:`work-say`,children:(0,M.jsx)(`a`,{href:`#/changes`,children:t.noChangeLink})})]})}function n_({list:e}){return e.length===0?null:(0,M.jsxs)(`div`,{className:`state error`,role:`alert`,children:[E.work.unreadable,(0,M.jsx)(`ul`,{children:e.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`code`,{className:`mono`,children:e.file}),`: `,e.message]},`${e.file}:${e.message}`))})]})}var r_=E.knowledge,i_=e=>r_.kinds[e]??e,a_=e=>r_.fields[e]??e,o_=e=>e.slice(0,10);function s_(e){return e?e.state===`verified`?r_.review.verified(e.by,o_(e.at)):e.state===`corrected`?r_.review.corrected(e.by,o_(e.at)):e.state===`rejected`?r_.review.rejected(e.by,o_(e.at)):r_.review.stale(e.by):r_.review.none}var c_={verified:`done`,corrected:`done`,rejected:`blocking`,stale:`warn`};function l_({review:e}){return(0,M.jsx)(`span`,{className:`chip ${e?c_[e.state]:`dim`}`,children:s_(e)})}function u_({command:e,slash:t,why:n,runs:r}){return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[n&&(0,M.jsx)(`p`,{className:`work-why`,children:n}),(0,M.jsx)(`p`,{className:`work-say`,children:r_.ai.intro}),(0,M.jsx)(Xg,{text:e,label:r_.ai.copy}),t&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`work-say`,children:r_.ai.slash}),(0,M.jsx)(Xg,{text:t,label:r_.ai.copySlash})]}),r&&(0,M.jsx)(`p`,{className:`work-say`,children:(0,M.jsx)(Lg,{...r})})]})}function d_({text:e}){return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,M.jsx)(`div`,{className:`state`,children:e}),(0,M.jsx)(`p`,{style:{margin:0},children:(0,M.jsx)(`a`,{href:`#/wikis`,children:r_.emptyGo})}),(0,M.jsx)(u_,{command:`atticus knowledge scan`,slash:`/atticus-knowledge`,runs:{q:`knowledge`,label:E.runs.knowledge}})]})}function f_({conflicts:e}){let t=E.knowledgeConflicts;if(!e.length)return null;let n=e=>`${e.source}/${e.page}`;return(0,M.jsx)(`ul`,{className:`stack`,style:{listStyle:`none`,padding:0,margin:0,gap:8},children:e.map(e=>{let r=e.decided,i=r?r.by===`person`?t.byPerson(r.who):t.byCode(r.kind,r.record,r.value,r.at):void 0,a=r?void 0:e.suggested;return(0,M.jsxs)(`li`,{role:`note`,children:[(0,M.jsxs)(`p`,{style:{margin:0},children:[(0,M.jsx)(`span`,{className:`mono`,children:e.about.join(`, `)}),e.summary?(0,M.jsxs)(`span`,{className:`muted`,children:[` · `,e.summary]}):null]}),(0,M.jsx)(`ul`,{style:{margin:`4px 0`,paddingLeft:18},children:e.pages.map(e=>(0,M.jsx)(`li`,{children:t.says(n(e),e.says)},n(e)))}),(0,M.jsx)(`p`,{className:`work-say`,style:{margin:0},children:i?e.applies.length>1?t.both(i,r?.by===`person`?r.words:void 0):t.applies(e.applies.map(n).join(`, `),i):e.question?.state===`open`?t.open(e.question.id):t.notAsked}),a?(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:t.suggested(n(a),a.signal,a.detail)}):null]},e.key)})})}function p_({urls:e}){return e.length?(0,M.jsx)(`ul`,{style:{margin:`4px 0`,paddingLeft:18},children:e.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(pe,{href:e.url,children:e.label??e.url}),e.label&&(0,M.jsx)(`span`,{className:`muted mono`,style:{fontSize:11,marginLeft:6},children:e.url})]},e.url))}):null}function m_(e){let t=e.quote;if(t)return r_.items.page(`${t.source}/${t.page}${t.section?` (${t.section})`:``}`,t.line)}function h_(e){let t=e.indexOf(`#`);return t<0?e:`${e.slice(0,t)} (${e.slice(t+1)})`}var g_=e=>e.quote?.text,__=e=>Array.isArray(e.urls)?e.urls:[];function v_(e){return Array.isArray(e)?e.map(e=>typeof e==`object`&&e?e.label??e.url:String(e)).join(`, `):e==null?``:String(e)}function y_(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean);if(!n.length)return!0;let r=e.record,i=[e.id,e.title,e.kind,v_(r.handledBy),v_(r.owner),v_(r.ownedBy),v_(r.aliases),v_(r.appliesWhen),g_(r)??``].join(` `).toLowerCase();return n.every(e=>i.includes(e))}function b_(e,t){return t.map(t=>({title:t.title,items:e.filter(e=>t.kinds.includes(e.kind))})).filter(e=>e.items.length>0)}function x_(e){let t={};for(let[n,r]of Object.entries(e.fields)){let i=e.record[n];t[n]=r===`text`?typeof i==`string`?i:``:r===`list`?Array.isArray(i)?i.map(String):[]:__(e.record).map(e=>({url:e.url,...e.label?{label:e.label}:{}}))}return t}var S_=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function C_(e,t){let n=x_(e),r={};for(let[i,a]of Object.entries(e.fields)){let e=t[i]??n[i];if(a===`text`)e=e.trim();else if(a===`list`)e=e.map(e=>e.trim()).filter(Boolean);else{let t=[];for(let n of e){let e=n.url.trim(),r=n.label?.trim();if(e||r){if(!/^https?:\/\/\S+$/.test(e))return{error:r_.items.badUrl(e||r||``)};t.push(r?{url:e,label:r}:{url:e})}}e=t}S_(e,n[i])||(r[i]=e)}return!Object.keys(r).length&&!e.review?.corrected?.length?{error:r_.items.noChange}:{set:r}}function w_(e){let t=e.split(`,`).map(e=>e.trim()).filter(Boolean),n=t.find(e=>!/^[a-z0-9][a-z0-9._-]*$/.test(e));return n?{error:r_.sources.notSlug(n)}:t}var T_=E.knowledge.needs,E_=E.knowledge.review;function D_(e){let t=e.review;return t?.state===`verified`||t?.state===`corrected`?{text:E_.verified(t.by,t.at.slice(0,10)),ok:!0}:t?.state===`stale`?{text:E_.stale(t.by),ok:!1}:t?.state===`rejected`?{text:E_.rejected(t.by,t.at.slice(0,10)),ok:!1,rejected:!0}:{text:E_.none,ok:!1}}function O_(e){return e===`open`?T_.openAgain:e===`not-needed`?T_.markSkip.toLowerCase():e}function k_(e,t,n){return e===`not-needed`&&!t.trim()?{error:T_.needWhy}:{body:{status:e,for:n,...e!==`open`&&t.trim()?{note:t.trim()}:{}}}}function A_({n:e}){let t=[];return e.leadTime&&t.push([T_.leadTime,e.leadTime]),e.handledBy&&t.push([T_.handledBy,e.handledBy]),e.catalogueItem&&t.push([T_.catalogueItem,e.catalogueItem]),e.inputs.length&&t.push([T_.inputs,e.inputs.join(`, `)]),t.length?(0,M.jsx)(`dl`,{className:`run-facts`,style:{margin:`4px 0`},children:t.map(([e,t])=>(0,M.jsxs)(`div`,{style:{display:`contents`},children:[(0,M.jsx)(`dt`,{children:e}),(0,M.jsx)(`dd`,{children:t})]},e))}):null}function j_(e){let t=e.n,[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(),c=D_(t),l=`need-${e.scope?`${e.scope}-`:``}${t.item}-${t.for}`.replace(/[^a-z0-9-]/gi,`-`),u=(0,v.useRef)(null),d=(0,v.useRef)(null),f=(0,v.useRef)(null),p=(0,v.useRef)(null),m=(0,v.useRef)(!1),h=(0,v.useRef)(`title`);(0,v.useEffect)(()=>{n?d.current?.focus():m.current&&({title:u,done:f,"not-needed":p}[h.current].current??u.current)?.focus(),m.current=!!n},[n]);let g=()=>{h.current=n??`title`,s(void 0),r(void 0)},_=o=>{let c=k_(o,i,t.for);`error`in c?(s(c.error),d.current?.focus()):(s(void 0),h.current=`title`,r(void 0),a(``),n||u.current?.focus(),e.onMark?.(t,c.body))};return(0,M.jsxs)(`li`,{className:`list-row`,style:{display:`block`},children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:6},children:[(0,M.jsxs)(`span`,{children:[(0,M.jsx)(`a`,{ref:u,id:`${l}-t`,href:`#/knowledge?item=${encodeURIComponent(t.item)}`,style:t.status===`not-needed`?{textDecoration:`line-through`}:void 0,children:(0,M.jsx)(`strong`,{children:t.title})}),` `,(0,M.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[`(`,T_.for(t.for),`) · `,i_(t.kind)]})]}),(0,M.jsxs)(`span`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,M.jsx)(`span`,{className:`chip ${c.ok?`done`:c.rejected?`blocking`:`warn`}`,children:c.text}),(0,M.jsx)(`span`,{className:`chip ${t.status===`open`?`ai`:`dim`}`,children:t.status===`open`?T_.open:t.status===`done`?T_.done(t.by??``,t.note):T_.notNeeded(t.by??``,t.note??``)})]})]}),(0,M.jsx)(A_,{n:t}),(0,M.jsxs)(`p`,{style:{margin:`4px 0`},children:[(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[T_.why,`:`]}),` `,t.why,t.because&&(0,M.jsxs)(M.Fragment,{children:[` `,(0,M.jsx)(`q`,{children:t.because.quote}),` `,(0,M.jsx)(`span`,{className:`muted mono`,style:{fontSize:11},children:`${t.because.file}${t.because.line?`:${t.because.line}`:``}`})]})]}),t.when&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:`2px 0`,fontSize:12},children:T_.when(t.when)}),t.rules.length>0&&(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:T_.rules}),(0,M.jsx)(`ul`,{style:{margin:`2px 0`,paddingLeft:18},children:t.rules.map(e=>(0,M.jsx)(`li`,{children:e},e))})]}),t.steps.length>0&&(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:T_.steps}),(0,M.jsx)(`ol`,{style:{margin:`2px 0`,paddingLeft:20},children:t.steps.map((e,t)=>(0,M.jsx)(`li`,{children:e},t))})]}),t.urls.length>0&&(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:T_.links}),(0,M.jsx)(p_,{urls:t.urls})]}),(0,M.jsxs)(`p`,{className:`muted mono`,style:{margin:`2px 0`,fontSize:11},children:[t.from===`stories`?T_.fromStories:``,t.page?`${t.from===`stories`?` · `:``}${T_.from(h_(t.page))}`:``]}),e.onMark&&!n&&(0,M.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:t.status===`open`?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:e.busy,ref:f,"aria-label":T_.markDoneOf(t.title),onClick:()=>r(`done`),children:T_.markDone}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.busy,ref:p,"aria-label":T_.markSkipOf(t.title),onClick:()=>r(`not-needed`),children:T_.markSkip})]}):(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.busy,"aria-label":T_.reopenOf(t.title),onClick:()=>_(`open`),children:T_.reopen})}),n&&(0,M.jsxs)(`form`,{className:`stack`,style:{gap:6,marginTop:6},onKeyDown:de(g),onSubmit:e=>{e.preventDefault(),_(n)},children:[(0,M.jsx)(`label`,{htmlFor:`${l}-note`,className:`hud`,style:{fontSize:10},children:n===`done`?T_.doneNote:T_.skipNote}),(0,M.jsx)(`input`,{ref:d,id:`${l}-note`,className:`field`,"aria-describedby":o?`${l}-err`:void 0,"aria-invalid":o?!0:void 0,value:i,onChange:e=>a(e.target.value)}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:e.busy,children:T_.save}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:g,children:T_.cancel})]}),o&&(0,M.jsx)(`p`,{id:`${l}-err`,role:`alert`,style:{margin:0,color:`var(--magenta-text)`,fontSize:12.5},children:o})]})]})}function M_(e){return(0,M.jsx)(P,{of:e.of,children:t=>t.present?(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,M.jsxs)(`p`,{className:`hud`,style:{fontSize:10,margin:0},children:[t.file,` · `,T_.openCount(t.needs.filter(e=>e.status===`open`).length)]}),t.needs.length===0&&(0,M.jsx)(`div`,{className:`state`,children:T_.empty}),b_(t.needs,T_.groups).map(t=>(0,M.jsxs)(`section`,{"aria-label":t.title,children:[(0,M.jsx)(`h3`,{className:`hud`,style:{fontSize:11,margin:`6px 0`},children:t.title}),(0,M.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:t.items.map(t=>(0,M.jsx)(j_,{n:t,onMark:e.onMark,busy:e.busy},`${t.item}|${t.for}`))})]},t.title)),t.considered.length>0&&(0,M.jsxs)(`details`,{children:[(0,M.jsx)(`summary`,{children:T_.considered}),(0,M.jsx)(`ul`,{style:{margin:`4px 0`,paddingLeft:18},children:t.considered.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{className:`mono`,children:e.item}),`: `,e.why]},e.item))})]})]}):(0,M.jsx)(u_,{command:t.command,slash:t.slash,why:T_.none(t.change),runs:{change:t.change}})})}function N_({change:e,span:t}){let n=A(`/api/changes/${encodeURIComponent(e)}/needs`),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)();return j(e=>{e.type===`file.changed`&&n.reload()}),(0,M.jsxs)(`section`,{className:`panel`,"aria-labelledby":`needs-${e}`,style:{gridColumn:t??`1 / -1`},children:[(0,M.jsx)(`h2`,{id:`needs-${e}`,className:`h`,style:{marginBottom:6},children:T_.title}),(0,M.jsxs)(`p`,{className:`work-say`,style:{marginTop:0},children:[T_.intro,` `,(0,M.jsx)(Lg,{change:e})]}),(0,M.jsx)(M_,{of:n,onMark:(t,r)=>{i(!0),o({ok:!0,text:E.app.working,working:!0}),k(`/api/changes/${encodeURIComponent(e)}/needs/${encodeURIComponent(t.item)}`,{method:`POST`,body:r}).then(e=>o({ok:!0,text:T_.marked(e.need.title,O_(e.need.status))})).catch(e=>o({ok:!1,text:Ee(e)})).finally(()=>{i(!1),n.reload()})},busy:r}),(0,M.jsx)(Oe,{note:a})]})}var P_=E.across,F_=E.knowledge.needs,I_=e=>e.filter(e=>e.state!==`archived`),L_=(e,t)=>`${e}|${t.item}|${t.for}`;function R_(e,t){let n=(e,n)=>jg([e.change,e.title,JSON.stringify(n)],t.text),r=[],i=0;for(let a of e){if(!a.needs?.present)continue;i+=a.needs.needs.filter(e=>e.status===`open`).length;let e=a.needs.needs.filter(e=>(t.all||e.status===`open`||t.kept?.has(L_(a.change,e)))&&n(a,e));e.length&&r.push({change:a.change,title:a.title,needs:e})}return{groups:r,open:i,notYet:e.filter(e=>e.needs&&!e.needs.present).map(e=>({change:e.change,title:e.title,command:e.needs.command,slash:e.needs.slash})),errors:e.filter(e=>e.error!==void 0).map(e=>({change:e.change,title:e.title,error:e.error}))}}var z_=e=>`needs-across-${e.replace(/[^a-z0-9-]/gi,`-`)}`;function B_(e){return(0,M.jsx)(P,{of:e.of,empty:e=>e.length===0,emptyText:P_.needsNoChanges,children:t=>{let n=R_(t,e);return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,M.jsx)(`p`,{className:`muted`,"aria-live":`polite`,style:{margin:0,fontSize:12},children:P_.needsCount(n.open,t.length)}),n.errors.map(e=>(0,M.jsx)(`p`,{role:`alert`,style:{margin:0,color:`var(--magenta-text)`,fontSize:12.5},children:P_.needsCantRead(e.change,e.error)},e.change)),n.groups.length===0&&(e.text.trim()?(0,M.jsx)(Ig,{what:Ng({text:e.text}),onClear:()=>e.onClear?.(),focus:`across-filter`}):(0,M.jsx)(`div`,{className:`state`,children:P_.needsNone})),n.groups.map(t=>(0,M.jsxs)(`section`,{"aria-labelledby":z_(t.change),children:[(0,M.jsxs)(`h3`,{id:z_(t.change),className:`h`,style:{fontSize:14,margin:`6px 0`},children:[(0,M.jsx)(`a`,{href:`#/changes/${encodeURIComponent(t.change)}`,children:t.title}),` `,(0,M.jsx)(`span`,{className:`muted mono`,style:{fontSize:11},children:t.change})]}),(0,M.jsx)(`p`,{className:`work-say`,style:{margin:`0 0 4px`},children:(0,M.jsx)(Lg,{change:t.change})}),b_(t.needs,F_.groups).map(n=>(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h4`,{className:`hud`,style:{fontSize:11,margin:`6px 0`},children:n.title}),(0,M.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:n.items.map(n=>(0,M.jsx)(j_,{n,scope:t.change,busy:e.busy,onMark:e.onMark?(n,r)=>e.onMark(t.change,n,r):void 0},L_(t.change,n)))})]},n.title))]},t.change)),n.notYet.length>0&&(0,M.jsxs)(`details`,{children:[(0,M.jsx)(`summary`,{children:P_.needsNotYet(n.notYet.length)}),(0,M.jsx)(`ul`,{style:{listStyle:`none`,margin:`6px 0 0`,padding:0},className:`stack`,children:n.notYet.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`a`,{href:`#/changes/${encodeURIComponent(e.change)}`,children:e.title}),(0,M.jsx)(u_,{command:e.command,slash:e.slash,why:F_.none(e.change),runs:{change:e.change}})]},e.change))})]})]})}})}function V_(e){let[t,n]=(0,v.useState)({state:`loading`}),[r,i]=(0,v.useState)(0),a=e.state===`error`?e.reload:void 0,o=(0,v.useCallback)(()=>{a?.(),i(e=>e+1)},[a]),s=e.state===`ready`?JSON.stringify(I_(e.data).map(e=>[e.id,e.title])):void 0,c=e.state===`error`?e.error:void 0,l=e.state===`error`&&e.notYet;return(0,v.useEffect)(()=>{if(c!==void 0){n({state:`error`,error:c,...l?{notYet:!0}:{}});return}if(s===void 0)return;let e=new AbortController,t=JSON.parse(s);return Promise.all(t.map(([t,n])=>k(`/api/changes/${encodeURIComponent(t)}/needs`,{signal:e.signal}).then(e=>({change:t,title:n,needs:e}),e=>({change:t,title:n,error:Ee(e)})))).then(t=>{e.signal.aborted||n({state:`ready`,data:t})}),()=>e.abort()},[s,c,l,r]),{...t,reload:o}}function H_({text:e,onClear:t}){let n=A(`/api/changes`),r=V_(n),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(new Set),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)();return j(e=>{e.type===`file.changed`&&(n.reload(),r.reload())}),(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,M.jsx)(`p`,{className:`work-say`,style:{margin:0},children:P_.needsIntro}),(0,M.jsxs)(`label`,{className:`row`,style:{gap:6,fontSize:12.5},children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:i,onChange:e=>a(e.target.checked)}),P_.needsShowAll]}),(0,M.jsx)(Oe,{note:u}),(0,M.jsx)(B_,{of:r,all:i,text:e,kept:o,onMark:(e,t,n)=>{l(!0),s(n=>new Set([...n,L_(e,t)])),d({ok:!0,text:E.app.working,working:!0}),k(`/api/changes/${encodeURIComponent(e)}/needs/${encodeURIComponent(t.item)}`,{method:`POST`,body:n}).then(e=>d({ok:!0,text:F_.marked(e.need.title,O_(e.need.status))})).catch(e=>d({ok:!1,text:Ee(e)})).finally(()=>{l(!1),r.reload()})},busy:c,...t?{onClear:t}:{}})]})}var U_=E.across,W_=[{id:`findings`,label:U_.findings},{id:`tasks`,label:U_.tasks},{id:`stories`,label:U_.stories},{id:`tests`,label:U_.tests},{id:`requests`,label:U_.requests},{id:`releases`,label:U_.releases},{id:`needs`,label:U_.needs}],G_=e=>e==null?``:String(e),K_=e=>(0,M.jsx)(`a`,{href:`#/changes/${e.change}`,className:`mono`,children:e.change}),q_=(e,t=``)=>(0,M.jsx)(`span`,{className:`chip ${t}`,children:e.toUpperCase()}),J_={findings:[{label:U_.change,cell:K_,width:`18%`},{label:U_.severity,cell:e=>q_(G_(e.severity),e.severity===`blocking`?`blocking`:``)},{label:U_.finding,cell:e=>G_(e.summary)},{label:U_.where,cell:e=>`${G_(e.gate)} · ${G_(e.artifact)}`,mono:!0},{label:U_.state,cell:e=>G_(e.state)}],tasks:[{label:U_.change,cell:K_,width:`18%`},{label:U_.task,cell:e=>G_(e.id),mono:!0},{label:U_.repo,cell:e=>G_(e.repo),mono:!0},{label:U_.what,cell:e=>G_(e.description)},{label:U_.done,cell:e=>e.done?q_(`done`,`done`):q_(`open`)}],stories:[{label:U_.change,cell:K_,width:`18%`},{label:U_.story,cell:e=>G_(e.id),mono:!0},{label:U_.title,cell:e=>G_(e.title)},{label:U_.repos,cell:e=>e.repos.join(`, `),mono:!0},{label:U_.written,cell:e=>e.written?`${G_(e.criteria)} criteria`:(0,M.jsx)(`span`,{className:`muted`,children:U_.notYet})}],tests:[{label:U_.change,cell:K_,width:`18%`},{label:U_.requirementsTested,cell:e=>`${G_(e.tested)} of ${G_(e.rows)}`},{label:U_.gaps,cell:e=>e.gaps?q_(`${G_(e.gaps)} gaps`,`warn`):q_(`none`,`done`)},{label:U_.firstGaps,cell:e=>e.topGaps.join(`; `)}],requests:[{label:U_.change,cell:K_,width:`18%`},{label:U_.request,cell:e=>G_(e.heading)},{label:U_.for,cell:e=>G_(e.record),mono:!0},{label:U_.state,cell:e=>q_(G_(e.state),e.state===`filed`?`done`:e.state===`to-file`?`warn`:``)},{label:U_.missing,cell:e=>e.missing.length?e.missing.join(`, `):`nothing`}],releases:[{label:U_.change,cell:K_,width:`18%`},{label:U_.state,cell:e=>q_(e.changeState,e.atRelease?`done`:``)},{label:U_.risk,cell:e=>G_(e.risk)},{label:U_.next,cell:e=>G_(e.nextStep)},{label:U_.handOff,cell:e=>{let t=e.handoff;return t?(0,M.jsx)(pe,{href:t.pr,children:`${t.phase} · ${t.state}`}):(0,M.jsx)(`span`,{className:`muted`,children:U_.noneOpen})}}]},Y_={findings:U_.noFindingsOnAny,tasks:U_.noTasksYetTasks,stories:U_.noStoriesYetWrite,tests:U_.noOpenChangesTo,requests:U_.noServiceRequestsDrafted,releases:U_.noOpenChanges};function X_(e,t){return e.filter(e=>jg([JSON.stringify(e)],t))}function Z_({view:e}){let t=A(e===`needs`?void 0:`/api/across?view=${e}`);ce(t);let[n,r]=(0,v.useState)(``),i=W_.find(t=>t.id===e).label;return(0,M.jsxs)(N,{title:U_.acrossChanges2(i),span:`span 9`,rows:`span 3`,children:[(0,M.jsx)(`nav`,{"aria-label":U_.acrossChanges,className:`row`,style:{gap:6,flexWrap:`wrap`,marginBottom:10},children:W_.map(t=>(0,M.jsx)(`a`,{href:`#/changes?across=${t.id}`,"aria-current":t.id===e?`page`:void 0,className:`btn ${t.id===e?`primary`:``}`,children:t.label},t.id))}),(0,M.jsx)(`div`,{style:{marginBottom:10},children:(0,M.jsx)(Pg,{id:`across-filter`,value:n,onChange:r})}),e===`needs`?(0,M.jsx)(H_,{text:n,onClear:()=>r(``)}):(0,M.jsx)(Q_,{data:t,view:e,text:n,label:i,onClear:()=>r(``)})]})}function Q_(e){let{data:t,view:n,text:r,label:i}=e;return(0,M.jsx)(M.Fragment,{children:(0,M.jsx)(P,{of:t,empty:e=>e.rows.length===0,emptyText:Y_[n],children:t=>{let a=X_(t.rows,r);return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,M.jsx)(`p`,{className:`muted`,role:`status`,style:{margin:0,fontSize:12},children:U_.ofAcrossOpenChange(a.length,t.rows.length,t.changes,t.changes===1?``:`s`)}),a.length?(0,M.jsx)(ke,{rows:a,cols:J_[n],rowKey:e=>`${e.change}|${G_(e.id??e.heading??``)}|${a.indexOf(e)}`,caption:U_.acrossOpenChanges(i)}):(0,M.jsx)(Ig,{what:Ng({text:r}),onClear:e.onClear,focus:`across-filter`})]})}})})}var $_=E.changes,ev=15;function tv(e){let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)}function nv({change:e}){let t=A(`/api/changes/${e}/inputs`),n=De(),r=De(),i=(0,v.useRef)(null),a=(0,v.useId)();return j(e=>{e.type===`file.changed`&&t.reload()}),(0,M.jsx)(N,{title:$_.inputs,span:`span 4`,meta:t.state===`ready`?t.data.files.length:void 0,children:(0,M.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`label`,{htmlFor:a,className:`hud`,children:$_.attachLabel}),(0,M.jsx)(`input`,{id:a,ref:i,type:`file`,disabled:n.busy,"aria-describedby":`${a}-help`,onChange:r=>{let a=r.target.files?.[0];a&&n.run(async()=>{if(a.size>ev*1024*1024)throw Error($_.attachTooLarge(Math.ceil(a.size/1048576)));let n=tv(new Uint8Array(await a.arrayBuffer())),r=await k(`/api/changes/${e}/inputs`,{method:`POST`,body:{name:a.name,content:n}});return t.reload(),i.current&&(i.current.value=``),r},$_.attached(a.name))}}),(0,M.jsx)(`span`,{id:`${a}-help`,className:`muted`,style:{fontSize:12},children:$_.attachHelp}),(0,M.jsx)(Oe,{note:n.note}),(0,M.jsx)(Oe,{note:r.note})]}),(0,M.jsx)(P,{of:t,empty:e=>e.files.length===0,emptyText:$_.noInputs,children:t=>(0,M.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:12.5},children:[(0,M.jsx)(`caption`,{className:`sr`,children:$_.inputs}),(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{className:`hud`,style:{textAlign:`left`,fontSize:10},children:[(0,M.jsx)(`th`,{style:{padding:`4px 0`,fontWeight:400},children:$_.inputFile}),(0,M.jsx)(`th`,{style:{fontWeight:400},children:$_.inputKind}),(0,M.jsx)(`th`,{style:{fontWeight:400},children:$_.inputWho})]})}),(0,M.jsx)(`tbody`,{children:t.files.map(t=>(0,M.jsxs)(`tr`,{style:{borderTop:`1px solid var(--rule)`},children:[(0,M.jsx)(`td`,{className:`mono`,style:{padding:`7px 0`,wordBreak:`break-all`},children:t.path}),(0,M.jsx)(`td`,{children:(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{children:`${t.kind} · ${t.format}`}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:$_.inputRead(t.read,t.citeBy)}),t.supersededBy&&(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:$_.inputOlder(t.supersededBy)}),t.defences?.risk===`high`&&(0,M.jsx)(`span`,{className:`chip blocking`,children:$_.inputHidden})]})}),(0,M.jsx)(`td`,{children:(0,M.jsxs)(`span`,{className:`stack`,style:{gap:4,alignItems:`flex-start`},children:[(0,M.jsx)(`span`,{children:$_.inputWhen(t.addedBy,t.addedAt)}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:r.busy,"aria-label":$_.promoteFor(t.path),onClick:()=>void r.run(()=>k(`/api/changes/${e}/inputs/${encodeURIComponent(t.path.replace(/^inputs\//,``))}/promote`,{method:`POST`}),$_.promoted(t.path)),children:$_.promote})]})})]},t.path))})]})})]})})}var rv=E.changes,iv=[`exists`,`changes`,`new`,`vendor`];function av({c:e}){return(0,M.jsxs)(`li`,{className:`stack`,style:{gap:3,borderTop:`1px solid var(--rule)`,paddingTop:6},children:[(0,M.jsxs)(`span`,{children:[(0,M.jsx)(`span`,{className:`chip`,children:rv.prototypeLeg[e.leg]}),` `,(0,M.jsx)(`span`,{className:`mono`,children:[e.method,e.path].filter(Boolean).join(` `)})]}),(0,M.jsx)(`span`,{children:e.sentence}),(0,M.jsx)(`span`,{className:`muted mono`,style:{fontSize:11.5,wordBreak:`break-all`},children:rv.prototypeCites(e.call.at,e.lands.at)}),e.estate&&(0,M.jsx)(`span`,{className:`muted mono`,style:{fontSize:11.5,wordBreak:`break-all`},children:rv.prototypeEstate(e.estate.entry.repo,e.estate.entry.at)}),e.vendor?.at&&(0,M.jsx)(`span`,{className:`muted mono`,style:{fontSize:11.5,wordBreak:`break-all`},children:e.vendor.boundary===`internal`?rv.prototypeTeam(e.vendor.name,e.vendor.at):rv.prototypeVendor(e.vendor.name,e.vendor.at)}),e.differences.length>0&&(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:e.differences.map((e,t)=>(0,M.jsx)(`li`,{children:e.message},t))})]})}function ov({p:e}){let t=`proto-${e.repo}`;return(0,M.jsxs)(`article`,{className:`stack`,style:{gap:8},"aria-labelledby":t,children:[(0,M.jsxs)(`h3`,{id:t,className:`h`,style:{fontSize:13},children:[(0,M.jsx)(`span`,{className:`chip`,children:rv.prototypeMarker}),` `,(0,M.jsx)(`span`,{className:`mono`,children:e.repo})]}),(0,M.jsx)(`span`,{className:`muted`,children:e.about?`${e.about.text}${e.about.trust===`suggested`?` (${rv.prototypeUnconfirmed})`:``}`:rv.prototypeNoAbout}),e.problem&&(0,M.jsx)(`div`,{className:`state`,role:`status`,children:e.problem}),e.comparison&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`hud`,children:rv.prototypeCounts(e.comparison.counts)}),iv.map(t=>{let n=e.comparison.calls.filter(e=>e.group===t);return(0,M.jsxs)(`section`,{className:`stack`,style:{gap:4},"aria-label":rv.prototypeGroup[t],children:[(0,M.jsx)(`h4`,{className:`hud`,style:{margin:0},children:rv.prototypeGroupCount(rv.prototypeGroup[t],n.length)}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:rv.prototypeGroupHelp[t]}),n.length?(0,M.jsx)(`ul`,{className:`stack`,style:{gap:6,listStyle:`none`,margin:0,padding:0},children:n.map(e=>(0,M.jsx)(av,{c:e},e.id))}):(0,M.jsx)(`span`,{className:`muted`,children:rv.prototypeNoCalls})]},t)}),e.comparison.left.length>0&&(0,M.jsx)(`span`,{className:`muted`,children:rv.prototypeLeft(e.comparison.left.length)})]})]})}function sv({change:e}){let t=A(`/api/changes/${e}/prototypes`);return j(e=>{e.type===`file.changed`&&t.reload()}),(0,M.jsx)(N,{title:rv.prototypes,span:`span 4`,meta:t.state===`ready`?t.data.prototypes.length:void 0,children:(0,M.jsx)(P,{of:t,empty:e=>e.prototypes.length===0,emptyContent:(0,M.jsx)(`div`,{className:`state`,children:rv.noPrototypes(e)}),children:e=>(0,M.jsx)(`div`,{className:`stack`,style:{gap:14},children:e.prototypes.map(e=>(0,M.jsx)(ov,{p:e},e.repo))})})})}var H=E.changes;function cv(e,t,n){let r=t.toLowerCase().split(/\s+/).filter(Boolean);return e.filter(e=>{if(n===`blocked`&&!e.openFindings.blocking||n&&n!==`blocked`&&e.state!==n)return!1;let t=[e.id,e.title,e.type,...e.repos??[]].join(` `).toLowerCase();return r.every(e=>t.includes(e))})}var lv=[`define`,`design`,`plan`,`build`,`qa`,`release-ready`],uv={define:H.define,design:H.design,plan:H.plan,build:H.build,qa:`QA`,"release-ready":H.release};function dv({list:e,current:t,across:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``);return(0,M.jsx)(N,{title:H.changes,span:`span 3`,rows:`span 3`,children:(0,M.jsx)(P,{of:e,empty:e=>e.length===0,emptyText:H.noChangesYetStart,children:e=>{let s=[...new Set(e.map(e=>e.state))],c=cv(e,r,a);return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`label`,{htmlFor:`change-filter`,className:`hud`,style:{fontSize:10},children:H.findAChange}),(0,M.jsx)(`input`,{id:`change-filter`,className:`field`,value:r,placeholder:H.idTitleOrRepo,onChange:e=>i(e.target.value)}),(0,M.jsx)(`label`,{htmlFor:`change-state`,className:`sr`,children:H.state}),(0,M.jsxs)(`select`,{id:`change-state`,className:`field`,value:a,onChange:e=>o(e.target.value),children:[(0,M.jsx)(`option`,{value:``,children:H.everyState}),(0,M.jsx)(`option`,{value:`blocked`,children:H.blocked}),s.map(e=>(0,M.jsx)(`option`,{value:e,children:uv[e]??e},e))]})]}),(0,M.jsxs)(`nav`,{"aria-label":H.changes,className:`stack`,style:{gap:2},children:[c.map(e=>(0,M.jsxs)(`a`,{href:`#/changes/${e.id}`,"aria-current":!n&&e.id===t?`page`:void 0,className:`list-row`,style:{textDecoration:`none`,padding:`8px 6px`,borderRadius:6,background:!n&&e.id===t?`var(--picked)`:void 0},children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2,minWidth:0},children:[(0,M.jsx)(`span`,{className:`mono`,style:{fontSize:12},children:e.id}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:e.title})]}),(0,M.jsx)(`span`,{className:`chip ${e.openFindings.blocking?`blocking`:``}`,children:e.openFindings.blocking?H.blocked2:(uv[e.state]??e.state).toUpperCase()})]},e.id)),c.length===0&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:H.noChangeMatches})]}),(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4,borderTop:`1px solid var(--line)`,paddingTop:8},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:H.acrossAllChanges}),(0,M.jsx)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:W_.map(e=>(0,M.jsx)(`a`,{href:`#/changes?across=${e.id}`,"aria-current":n===e.id?`page`:void 0,className:`chip`,style:{textDecoration:`none`},children:e.label},e.id))})]})]})}})})}function fv({state:e}){let t=lv.indexOf(e);return(0,M.jsx)(`ol`,{className:`row between`,style:{listStyle:`none`,margin:0,padding:0},"aria-label":H.phases,children:lv.map((e,n)=>(0,M.jsxs)(`li`,{className:`stack`,style:{alignItems:`center`,gap:6},"aria-current":n===t?`step`:void 0,children:[n===t?(0,M.jsx)(he,{value:n+1,max:lv.length,size:46,label:H.currentPhase(uv[e]??``)}):(0,M.jsx)(`span`,{role:`img`,"aria-label":`${uv[e]}: ${n<t?H.done:H.toCome}`,style:{width:42,height:42,borderRadius:`50%`,border:`1.5px solid ${n<t?`var(--btn-text)`:`var(--step-off)`}`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:n<t?`✓`:``}),(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10,color:n===t?`var(--accent)`:void 0},children:uv[e]})]},e))})}function pv({change:e,artifact:t,onClose:n}){let r=A(`/api/changes/${e}/artifacts/${t}`),[i,a]=(0,v.useState)(),o=De(),s=(0,v.useRef)(null),c=r.state===`ready`;return(0,v.useEffect)(()=>{c&&s.current?.focus()},[c]),(0,M.jsx)(N,{title:H.edit(t),span:`1 / -1`,meta:r.state===`ready`?r.data.path:void 0,children:(0,M.jsx)(P,{of:r,children:c=>(0,M.jsxs)(`form`,{onSubmit:n=>{n.preventDefault(),o.run(()=>k(`/api/changes/${e}/artifacts/${t}`,{method:`PUT`,body:{content:i??c.content,baseSha256:c.sha256}}).then(()=>r.reload()),`Saved ${c.path}.`)},onKeyDown:de(n),className:`stack`,children:[(0,M.jsx)(`label`,{htmlFor:`artifact-text`,className:`sr`,children:H.text(t)}),(0,M.jsx)(`textarea`,{ref:s,id:`artifact-text`,value:i??c.content,onChange:e=>a(e.target.value),rows:18,spellCheck:!0,style:{width:`100%`,background:`var(--box)`,color:`var(--text)`,border:`1px solid var(--line-2)`,borderRadius:8,padding:12,font:`13px/1.6 var(--mono)`}}),(0,M.jsxs)(`div`,{className:`row`,children:[(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:o.busy,children:H.save}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:n,children:H.close}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:H.ifSomeoneSavedMeanwhile})]}),(0,M.jsx)(Oe,{note:o.note})]})})})}var mv=E.findings.needsReason,hv=E.findings.cantWaive;function gv({change:e,f:t,done:n}){let[r,i]=(0,v.useState)(``),a=De(),o=i=>a.run(()=>k(`/api/findings/${e}/${t.id}/action`,{method:`POST`,body:{action:i,gate:t.gate,...r?{reason:r}:{}}}).then(n),`Recorded: ${i.replace(/-/g,` `)}.`);return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,M.jsx)(`label`,{className:`sr`,htmlFor:`reason-${t.id}`,children:H.reason}),(0,M.jsx)(`input`,{id:`reason-${t.id}`,value:r,onChange:e=>i(e.target.value),placeholder:H.reasonNeededToWaive,style:{height:30,background:`var(--box)`,color:`var(--text)`,border:`1px solid var(--line-2)`,borderRadius:6,padding:`0 8px`}}),(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:a.busy,onClick:()=>void o(`apply`),children:H.applyFix}),t.question&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:a.busy,onClick:()=>void o(`ask`),children:H.ask(t.question.owner??H.owner)}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:a.busy||!r,title:r?void 0:mv,"aria-describedby":r?void 0:`why-${t.id}`,onClick:()=>void o(`not-relevant`),children:H.notRelevant}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:a.busy||!r||!t.waivable,title:t.waivable?r?void 0:mv:hv,"aria-describedby":!t.waivable||!r?`why-${t.id}`:void 0,onClick:()=>void o(`waive`),children:H.waive})]}),(!r||!t.waivable)&&(0,M.jsx)(`p`,{id:`why-${t.id}`,className:`muted`,style:{margin:0,fontSize:11.5},children:[r?``:mv,t.waivable?``:`${hv}.`].filter(Boolean).join(` `)}),(0,M.jsx)(Oe,{note:a.note})]})}function _v({id:e}){let t=Og(),n=A(`/api/changes/${e}`),r=A(`/api/changes/${e}/status`),i=A(`/api/changes/${e}/tasks`),a=A(`/api/changes/${e}/runs`),o=A(`/api/findings?change=${e}&state=open`),[s,c]=(0,v.useState)(),l=(0,v.useRef)(new Map),u=()=>{let e=s;c(void 0),e&&l.current.get(e)?.focus()},d=De(),f=De(),p=De(),m=()=>{n.reload(),r.reload(),o.reload(),a.reload(),i.reload()};return j(e=>{(e.type===`file.changed`||e.type===`run.changed`)&&m()}),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(N,{title:n.state===`ready`?`${n.data.id} · ${n.data.title}`:e,span:`span 9`,kind:`hero`,children:(0,M.jsx)(P,{of:n,children:n=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:14},children:[(0,M.jsx)(fv,{state:n.state}),(0,M.jsx)(P,{of:r,children:r=>(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsxs)(`p`,{style:{margin:0,fontSize:14},children:[(0,M.jsx)(`span`,{className:`hud`,style:{marginRight:8},children:H.next}),r.nextStep]}),(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[(0,M.jsx)(`span`,{className:`chip ${r.risk.level===`high`?`blocking`:r.risk.level===`medium`?`warn`:``}`,children:H.risk(r.risk.level.toUpperCase())}),n.handoff&&(0,M.jsx)(`span`,{className:`chip`,children:H.handOff(n.handoff.phase.toUpperCase(),n.handoff.state.toUpperCase(),n.handoff.pr?` · ${n.handoff.pr}`:``)})]}),r.blockers.length>0&&(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18,color:`var(--text-2)`,lineHeight:1.6},"aria-label":H.whatBlocksTheHand,children:r.blockers.map(e=>(0,M.jsx)(`li`,{children:e.message},e.message))}),(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:[(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:d.busy,onClick:()=>void d.run(()=>k(`/api/changes/${e}/handoff`,{method:`POST`,body:{}}).then(m),H.handOffPrOpened),children:H.raiseHandOff}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:d.busy,onClick:()=>void d.run(()=>k(`/api/changes/${e}/sync`,{method:`POST`,body:{}}).then(m),H.syncedWithTheGit),children:H.syncAndMergeWhen}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:f.busy,onClick:()=>void f.run(()=>k(`/api/changes/${e}/critic`,{method:`POST`,body:{}}).then(m),t?H.criticRoundStartedThe:H.theRuleChecksRan),children:t?H.runTheCriticYour:H.runTheRuleChecks})]}),(0,M.jsx)(Oe,{note:d.note}),(0,M.jsx)(Oe,{note:f.note})]})})]})})}),s&&(0,M.jsx)(pv,{change:e,artifact:s,onClose:u}),(0,M.jsx)(N,{title:H.artifacts,span:`span 5`,children:(0,M.jsx)(P,{of:n,empty:e=>e.artifacts.length===0,children:e=>(0,M.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:12.5},children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{className:`hud`,style:{textAlign:`left`,fontSize:10},children:[(0,M.jsx)(`th`,{style:{padding:`4px 0`,fontWeight:400},children:H.artifact}),(0,M.jsx)(`th`,{style:{fontWeight:400},children:H.status}),(0,M.jsx)(`th`,{style:{fontWeight:400},children:H.findings}),(0,M.jsx)(`th`,{style:{fontWeight:400},children:(0,M.jsx)(`span`,{className:`sr`,children:H.actions})})]})}),(0,M.jsx)(`tbody`,{children:e.artifacts.map(e=>(0,M.jsxs)(`tr`,{style:{borderTop:`1px solid var(--rule)`},children:[(0,M.jsx)(`td`,{className:`mono`,style:{padding:`7px 0`},children:e.artifact}),(0,M.jsx)(`td`,{children:(0,M.jsx)(`span`,{className:`chip ${e.status===`done`?`done`:e.status===`blocked`?`dim`:`warn`}`,children:e.status.toUpperCase()})}),(0,M.jsx)(`td`,{children:e.openFindings||``}),(0,M.jsx)(`td`,{style:{textAlign:`right`},children:e.status!==`blocked`&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,ref:t=>{t?l.current.set(e.artifact,t):l.current.delete(e.artifact)},onClick:()=>c(e.artifact),"aria-label":H.edit(e.artifact),children:H.edit2})})]},e.artifact))})]})})}),(0,M.jsx)(nv,{change:e}),(0,M.jsx)(sv,{change:e}),(0,M.jsx)(N,{title:H.openFindings,span:`span 4`,meta:o.state===`ready`?o.data.length:void 0,children:(0,M.jsx)(P,{of:o,empty:e=>e.length===0,emptyText:H.noOpenFindingsOn,children:t=>(0,M.jsx)(`div`,{className:`stack`,style:{gap:12},children:t.map(t=>(0,M.jsxs)(`article`,{className:`stack`,style:{gap:6,borderTop:`1px solid var(--rule)`,paddingTop:10},children:[(0,M.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,M.jsx)(`span`,{className:`chip ${t.severity===`blocking`?`blocking`:t.severity===`gap`?`warn`:`dim`}`,children:t.severity.toUpperCase()}),(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[t.gate,` · `,t.lens??H.checks,` · `,t.artifact]})]}),(0,M.jsx)(`div`,{style:{fontSize:13},children:t.question?.text??t.summary}),(0,M.jsx)(`div`,{className:`muted`,style:{fontSize:12},children:t.why}),(0,M.jsx)(gv,{change:e,f:t,done:m})]},`${t.gate}/${t.id}`))})})}),(0,M.jsxs)(N,{title:H.tasks,span:`span 5`,children:[(0,M.jsx)(P,{of:i,empty:e=>e.length===0,emptyText:H.noTasksYetThey,children:n=>n.map(n=>(0,M.jsxs)(`div`,{className:`list-row`,children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2,minWidth:0},children:[(0,M.jsxs)(`span`,{style:{fontSize:12.5},children:[(0,M.jsx)(`span`,{className:`mono`,children:n.id}),` `,n.description]}),(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[n.repo,n.story?` · ${n.story}`:``]})]}),n.done?(0,M.jsx)(`span`,{className:`chip done`,children:H.done2}):t?(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:p.busy,onClick:()=>void p.run(()=>k(`/api/changes/${e}/runs`,{method:`POST`,body:{agent:`task-runner`,runtime:`hand-off`,task:n.id,autonomy:`draft`}}).then(m),`Task ${n.id} handed to your assistant. Open the prompt, then mark it done.`),children:H.runWithAi}):(0,M.jsx)(`span`,{className:`chip dim`,title:kg,children:H.byHand})]},n.id))}),(0,M.jsx)(Oe,{note:p.note})]}),(0,M.jsx)(N,{title:H.aiRuns,span:`span 4`,children:(0,M.jsx)(P,{of:a,empty:e=>e.length===0,emptyText:H.noAiRunsYet,children:e=>e.slice().reverse().map(e=>(0,M.jsxs)(`div`,{className:`list-row`,style:{alignItems:`flex-start`},children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2,minWidth:0},children:[(0,M.jsx)(`span`,{style:{fontSize:12.5},children:e.agent}),(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[e.runtime,` · `,e.promptPath??e.runId]}),e.errors.length>0&&(0,M.jsx)(`span`,{style:{color:`var(--magenta-text)`,fontSize:12},children:e.errors.join(`; `)})]}),(0,M.jsxs)(`span`,{className:`row`,style:{gap:6},children:[(0,M.jsx)(`span`,{className:`chip ${e.state===`validated`?`done`:e.state===`failed`?`blocking`:`ai`}`,children:e.state.toUpperCase()}),(e.state===`waiting`||e.state===`prepared`)&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void p.run(()=>k(`/api/runs/${e.runId}/done`,{method:`POST`,body:{}}).then(m),H.checkedTheAnswer),children:H.markDone}),e.state===`failed`&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>void p.run(()=>k(`/api/runs/${e.runId}/retry`,{method:`POST`,body:{}}).then(m),H.readyToTryAgain),children:H.retry})]})]},e.runId))})}),(0,M.jsx)(N_,{change:e,span:`span 9`})]})}function vv({hash:e}){let t=e.replace(/^#\/?changes\/?/,``).split(`?`)[0]||void 0,n=new URLSearchParams(e.split(`?`)[1]??``).get(`across`),r=W_.find(e=>e.id===n)?.id,i=A(`/api/changes`),a=i.state===`ready`?i.data[0]?.id:void 0,o=t??a;return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(dv,{list:i,current:o,across:r}),r&&!t?(0,M.jsx)(Z_,{view:r},r):o?(0,M.jsx)(_v,{id:o},o):(0,M.jsx)(N,{title:H.noChangeSelected,span:`span 9`,children:(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0},children:[H.pickAChangeOn,(0,M.jsx)(`code`,{className:`mono`,children:H.atticusChangeNew}),`.`]})})]})}var yv=E.trust.sample;function bv({text:e,label:t}){return(0,M.jsxs)(`div`,{className:`work-cmd`,children:[(0,M.jsx)(`code`,{className:`mono`,children:e}),(0,M.jsx)(Yt,{text:e,label:`${t}: ${e}`})]})}function xv({repo:e,item:t}){let n=Uh(),[r,i]=(0,v.useState)(!1);if((0,v.useEffect)(()=>{t.kind===`fact`&&n?.need(e)},[n,e,t.kind]),t.kind===`link`)return(0,M.jsx)(`a`,{href:`#/canvas?lens=repo&node=${encodeURIComponent(`repo:${e}`)}`,children:yv.wrongLink(e)});let a=n?.of(e),o=a?.state===`ready`?a.data.facts.find(e=>e.id===t.fact):void 0;return a?.state===`ready`&&!o?(0,M.jsx)(`p`,{className:`work-say`,children:yv.factGone}):(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":r,"aria-label":yv.wrongFactOf(t.claim),disabled:!o,onClick:()=>i(e=>!e),children:yv.wrongFact}),r&&o&&(0,M.jsx)($h,{repo:e,fact:o,onClose:()=>i(!1)})]})}function Sv(e){let t=(0,v.useId)();if(e.sample.state===`loading`)return(0,M.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`work-say`,children:yv.loading});if(e.sample.state===`error`)return(0,M.jsx)(`p`,{role:`alert`,className:`state error`,children:yv.failed(e.sample.error)});let n=e.sample.data;if(n.refused)return(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`p`,{className:`work-say`,children:yv.refused[n.refused](e.repo,n.unverified??0)}),(0,M.jsx)(bv,{text:n.command,label:yv.copyCommand})]});if(!n.items.length)return(0,M.jsx)(`p`,{className:`work-say`,children:yv.empty});let r=t=>e.picks[t.id]??{note:t.note??``},i=()=>{let t=n.items.flatMap(t=>{let n=e.picks[t.id];return n?.answer?[{id:t.id,answer:n.answer,...n.note.trim()?{note:n.note.trim()}:{}}]:[]});e.onSave(t)},a=e.saving;return(0,M.jsxs)(`section`,{className:`stack`,style:{gap:8},"aria-labelledby":`${t}-t`,children:[(0,M.jsx)(`h4`,{id:`${t}-t`,className:`h`,style:{fontSize:14},children:yv.openOf(e.repo)}),(0,M.jsx)(`ol`,{className:`stack`,style:{gap:8,paddingLeft:18,margin:0},children:n.items.map((i,a)=>{let o=r(i),s=o.answer??i.answer,c=`${t}-${a}`,l=i.kind===`fact`?yv.fact:yv.link(i.of);return(0,M.jsx)(`li`,{children:(0,M.jsxs)(`fieldset`,{className:`ev-choice`,children:[(0,M.jsx)(`legend`,{children:yv.item(a+1,n.items.length,l,i.claim)}),(0,M.jsx)(`p`,{className:`hud`,style:{margin:0},children:yv.lines}),(0,M.jsx)(`ul`,{className:`ev-list`,children:i.lines.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`code`,{className:`mono`,children:e.cite}),` `,e.text?(0,M.jsx)(`code`,{className:`mono`,children:e.text}):yv.noText]},e.cite))}),i.answer&&i.by&&(0,M.jsx)(`p`,{className:`work-say`,children:yv.onFile(yv.choices[i.answer],i.by)}),(0,M.jsx)(`div`,{className:`row`,style:{gap:12,flexWrap:`wrap`},children:[`right`,`wrong`,`unsure`].map(t=>(0,M.jsxs)(`label`,{className:`row`,style:{gap:4},children:[(0,M.jsx)(`input`,{type:`radio`,name:c,value:t,checked:s===t,onChange:()=>e.onPick(i.id,{...o,answer:t})}),yv.choices[t]]},t))}),(0,M.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`hud`,children:s===`wrong`?yv.note:yv.noteOptional}),(0,M.jsx)(`textarea`,{rows:1,value:o.note,onChange:t=>e.onPick(i.id,{...o,note:t.target.value})})]}),s===`wrong`&&(0,M.jsx)(xv,{repo:e.repo,item:i})]})},i.id)})}),(0,M.jsx)(`div`,{className:`row`,style:{gap:6},children:(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:a.state===`working`,onClick:i,children:a.state===`working`?yv.saving:yv.save})}),e.problem&&(0,M.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:e.problem}),a.state===`working`&&(0,M.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`work-say`,children:yv.saving}),a.state===`error`&&(0,M.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:a.text}),a.state===`done`&&(0,M.jsxs)(`div`,{role:`status`,children:[(0,M.jsx)(`p`,{className:`work-say`,children:yv.saved(a.result.file,a.result.answered,a.result.open)}),(0,M.jsx)(bv,{text:a.result.commit,label:yv.copyCommit})]}),(0,M.jsx)(`p`,{className:`work-say`,children:yv.sameInTerminal}),(0,M.jsx)(bv,{text:n.command,label:yv.copyCommand})]})}function Cv({repo:e}){let t=(0,v.useId)(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(`10`),[o,s]=(0,v.useState)({seed:``,size:`10`}),c=new URLSearchParams({...o.seed.trim()?{seed:o.seed.trim()}:{},...o.size?{size:o.size}:{}}).toString(),l=A(`/api/facts/${encodeURIComponent(e)}/audit?${c}`),[u,d]=(0,v.useState)({}),[f,p]=(0,v.useState)({state:`idle`}),[m,h]=(0,v.useState)(),g=l.state===`ready`?l.data:void 0;return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,M.jsx)(`p`,{className:`work-say`,children:yv.intro}),(0,M.jsxs)(`form`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`flex-end`},onSubmit:e=>{e.preventDefault(),d({}),p({state:`idle`}),s({seed:n,size:i})},children:[(0,M.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`hud`,children:yv.seed}),(0,M.jsx)(`input`,{value:n,"aria-describedby":`${t}-seed`,onChange:e=>r(e.target.value)}),(0,M.jsx)(`span`,{id:`${t}-seed`,className:`work-say`,children:g?.defaultSeed?yv.seedHint(g.defaultSeed):yv.seedHintNone})]}),(0,M.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`hud`,children:yv.size}),(0,M.jsx)(`input`,{type:`number`,min:1,max:100,value:i,onChange:e=>a(e.target.value)})]}),(0,M.jsx)(`button`,{type:`submit`,className:`btn`,children:yv.draw})]}),(0,M.jsx)(Sv,{repo:e,sample:l,picks:u,onPick:(e,t)=>d(n=>({...n,[e]:t})),saving:f,onSave:t=>{if(g){if(!t.length)return h(yv.nothingPicked);h(void 0),p({state:`working`}),k(`/api/facts/${encodeURIComponent(e)}/audit`,{method:`POST`,body:{seed:g.seed,size:g.size,answers:t}}).then(e=>{p({state:`done`,result:e}),d({}),l.reload()},e=>p({state:`error`,text:Wt(e)}))}},problem:m})]})}var U=E.trust,wv=E.runNext;function Tv({repo:e}){let[t,n]=(0,v.useState)(!1);return(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":t,"aria-label":U.sample.openOf(e),onClick:()=>n(e=>!e),children:U.sample.open}),t&&(0,M.jsx)(Cv,{repo:e})]})}function Ev(e){let t=e.verify.report;switch(e.state){case`not-read`:return U.why.notRead;case`unverified`:return U.why.unverified;case`rejected`:return U.why.rejected(t?.rejected??0);case`stale`:return U.why.stale(t?.commit??e.facts.commit??``,e.checkout.commit??``);case`unwritten`:return U.why.unwritten;case`unknown-files`:return U.why.unknownFiles(t?.coverage.unknown??0,e.repo);default:return U.why.trusted}}function Dv(e){let t=e.verify.report?.commit??e.facts.commit;return t?e.checkout.commit?e.sameCommit?U.sameCommit(t):U.otherCommit(t,e.checkout.commit):U.noCheckout(t):U.noFactsCommit}var Ov=e=>e===`trusted`?`done`:e===`rejected`||e===`stale`?`blocking`:`warn`;function kv(e){let[t,n]=(0,v.useState)(!1);return e.n===0?(0,M.jsx)(M.Fragment,{children:U.none}):(0,M.jsxs)(`details`,{className:`trust-list`,onToggle:e=>n(e.currentTarget.open),children:[(0,M.jsx)(`summary`,{children:U.show(e.n,e.what)}),e.children(t)]})}var Av=(e,t)=>e?t?`${e}:${t}`:e:void 0,jv=50;function Mv(e){return(0,M.jsx)(P,{of:e.of,empty:t=>!(e.only?t.facts.filter(e.only):t.facts).length,emptyText:U.none,children:t=>{let n=e.only?t.facts.filter(e.only):t.facts;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`ul`,{className:`mono trust-items`,children:n.slice(0,jv).map(t=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(Yh,{repo:e.repo,at:`${t.cite.file}:${t.cite.line}`}),` `,t.label]},t.id))}),n.length>jv&&(0,M.jsx)(`p`,{className:`work-say`,children:U.moreFacts(n.length-jv,t.file)})]})}})}function Nv(e){let t=A(`/api/facts/${encodeURIComponent(e.repo)}`);return(0,M.jsx)(Mv,{repo:e.repo,of:t,...e.only?{only:e.only}:{}})}var Pv=e=>!!e.cite.quote?.includes(`<redacted>`);function Fv({r:e}){let t=e.verify.report,n=`trust-${e.repo}`,r=e.lists,i=e.verify.path.replace(/\.verify\.yaml$/,`.rejected.jsonl`);return(0,M.jsxs)(`article`,{className:`list-row`,style:{display:`block`},"aria-labelledby":n,children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:8},children:[(0,M.jsx)(`h3`,{id:n,className:`h`,style:{fontSize:14,margin:0},children:e.repo}),(0,M.jsx)(`span`,{className:`chip ${Ov(e.state)}`,children:U.states[e.state]})]}),(0,M.jsx)(`p`,{className:`work-why`,style:{margin:`6px 0`},children:Ev(e)}),(0,M.jsxs)(`dl`,{className:`run-facts`,style:{margin:`8px 0`},children:[(0,M.jsx)(`dt`,{children:U.kept}),(0,M.jsxs)(`dd`,{children:[t?t.accepted:U.noReport,t&&t.redacted>0?` (${U.redacted(t.redacted)})`:``,t&&e.facts.present&&(0,M.jsx)(kv,{n:t.accepted,what:U.what.kept,children:t=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`work-say`,children:U.keptFix}),t&&(0,M.jsx)(Nv,{repo:e.repo})]})}),t&&t.redacted>0&&e.facts.present&&(0,M.jsx)(kv,{n:t.redacted,what:U.what.redacted,children:t=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`work-say`,children:U.redactedFix}),t&&(0,M.jsx)(Nv,{repo:e.repo,only:Pv})]})})]}),(0,M.jsx)(`dt`,{children:U.rejected}),(0,M.jsxs)(`dd`,{children:[t?t.rejected:U.noReport,r&&r.rejected.length>0&&(0,M.jsx)(kv,{n:r.rejected.length,what:U.what.rejected,children:()=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`ul`,{className:`trust-items`,children:r.rejected.map((e,t)=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`code`,{className:`mono`,children:Av(e.file,e.line)??U.rejectedNoLine}),e.fact&&(0,M.jsxs)(`span`,{className:`mono`,children:[` `,e.fact]}),` · `,U.rejectedLine(e.code,e.message)]},`${e.fact??e.code}-${t}`))}),(0,M.jsx)(`p`,{className:`work-say`,children:U.rejectedFix(i)}),(0,M.jsx)(Xg,{text:`/atticus-map ${e.repo}`,label:wv.copySlash}),(0,M.jsx)(Xg,{text:`atticus verify ${e.repo}`,label:wv.copy})]})})]}),(0,M.jsx)(`dt`,{children:U.coverage}),(0,M.jsxs)(`dd`,{children:[t?U.coverageOf(t.coverage.ratio,t.coverage.read,t.coverage.unknown,t.coverage.excluded):U.noReport,t&&t.coverage.unknown>0&&(0,M.jsx)(kv,{n:t.coverage.unknown,what:U.what.unknown,children:()=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`ul`,{className:`mono trust-items`,children:t.unknownFiles.map(e=>(0,M.jsx)(`li`,{children:e},e))}),t.coverage.unknown>t.unknownFiles.length&&(0,M.jsx)(`p`,{className:`work-say`,children:U.more(t.coverage.unknown-t.unknownFiles.length,e.verify.path)}),(0,M.jsx)(`p`,{className:`work-say`,children:U.unknownFix(e.repo)}),(0,M.jsx)(Xg,{text:`/atticus-map ${e.repo}`,label:wv.copySlash})]})}),t&&t.coverage.excluded>0&&(0,M.jsx)(kv,{n:t.coverage.excluded,what:U.what.excluded,children:()=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`ul`,{className:`mono trust-items`,children:(r?.excluded??[]).map(e=>(0,M.jsx)(`li`,{children:e},e))}),t.coverage.excluded>(r?.excluded.length??0)&&(0,M.jsx)(`p`,{className:`work-say`,children:U.more(t.coverage.excluded-(r?.excluded.length??0),e.verify.path)}),(0,M.jsx)(`p`,{className:`work-say`,children:U.excludedFix(e.repo)})]})})]}),r&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`dt`,{children:U.asked}),(0,M.jsxs)(`dd`,{children:[r.asked.length,(0,M.jsx)(kv,{n:r.asked.length,what:U.what.asked,children:()=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`work-say`,children:U.askedFix}),(0,M.jsx)(`ul`,{className:`trust-items`,children:r.asked.map(e=>(0,M.jsxs)(`li`,{children:[e.question,` `,e.lines.map(e=>(0,M.jsxs)(`code`,{className:`mono`,children:[e,` `]},e)),(0,M.jsx)(`a`,{href:`#/questions/${e.id}`,children:U.answer})]},e.id))})]})})]})]}),e.facts.unverified>0&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`dt`,{children:U.unverified}),(0,M.jsxs)(`dd`,{children:[e.facts.unverified,(0,M.jsx)(kv,{n:e.facts.unverified,what:U.what.unverified,children:()=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`work-say`,children:U.unverifiedFix}),(0,M.jsx)(`ul`,{className:`mono trust-items`,children:(r?.unverified??[]).map(e=>(0,M.jsxs)(`li`,{children:[e.file,`:`,e.line,` `,e.fact]},e.fact))}),e.facts.unverified>(r?.unverified.length??0)&&(0,M.jsx)(`p`,{className:`work-say`,children:U.more(e.facts.unverified-(r?.unverified.length??0),e.facts.path)}),(0,M.jsx)(Xg,{text:`atticus verify ${e.repo}`,label:wv.copy})]})})]})]}),(0,M.jsx)(`dt`,{children:U.audit}),(0,M.jsxs)(`dd`,{children:[e.audit?(0,M.jsxs)(M.Fragment,{children:[U.auditTally(U.auditFacts,e.audit.facts),` ·`,` `,U.auditTally(U.auditLinks,e.audit.links),e.audit.facts.right+e.audit.facts.wrong+e.audit.links.right+e.audit.links.wrong<30&&(0,M.jsxs)(`span`,{className:`work-say`,children:[` `,U.auditSmall]})]}):(0,M.jsx)(`span`,{className:`mono`,children:U.auditNone(e.repo)}),e.facts.present&&(0,M.jsx)(Tv,{repo:e.repo})]}),(0,M.jsx)(`dt`,{children:U.builtOn}),(0,M.jsx)(`dd`,{children:e.frameworks?.length?e.frameworks.map(e=>e.component?U.builtOnModule(U.builtOnOne(e.name,e.version,e.cite),e.component):U.builtOnOne(e.name,e.version,e.cite)).join(`, `):U.builtOnNone}),(0,M.jsx)(`dt`,{children:U.terms}),(0,M.jsx)(`dd`,{children:e.terms?.length?(0,M.jsx)(`ul`,{className:`mono trust-items`,"aria-label":`${U.terms}: ${e.repo}`,children:e.terms.map(e=>(0,M.jsxs)(`li`,{children:[U.termOne(e.term,e.value,U.termRole[e.role]??e.role,e.cite),e.note===void 0?``:`; ${U.termNote(e.note)}`]},`${e.cite}-${e.term}-${e.value}`))}):U.termsNone}),(0,M.jsx)(`dt`,{children:U.commit}),(0,M.jsx)(`dd`,{className:`mono`,children:Dv(e)}),(0,M.jsx)(`dt`,{children:U.catalogFrom}),(0,M.jsxs)(`dd`,{children:[U.from[e.catalog.from],` · `,U.records(e.catalog.fromFacts,e.catalog.fromReaders),e.catalog.fromFacts+e.catalog.fromReaders>0&&(0,M.jsxs)(M.Fragment,{children:[` · `,(0,M.jsx)(`a`,{href:`#/canvas?lens=repo&node=${encodeURIComponent(`repo:${e.repo}`)}`,children:U.openCanvas})]})]})]}),(e.frameworks??[]).filter(e=>e.gap).map(e=>(0,M.jsxs)(`p`,{className:`work-say`,children:[(0,M.jsx)(`strong`,{children:U.builtOnGap(e.name)}),` `,e.gap]},`gap-${e.name}-${e.cite}`)),e.next&&(0,M.jsxs)(`div`,{style:{marginTop:8},children:[e.next.slash&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`work-say`,children:wv.slash}),(0,M.jsx)(Xg,{text:e.next.slash,label:wv.copySlash})]}),(0,M.jsx)(`p`,{className:`work-say`,children:wv.terminal}),(0,M.jsx)(Xg,{text:e.next.command,label:wv.copy})]}),(0,M.jsx)(`p`,{className:`work-say mono`,style:{margin:`6px 0 0`},children:U.files(e.facts.path,e.verify.path)})]})}var Iv=U.fresh,Lv=e=>e.slice(0,7);function Rv({of:e}){let t=e.state===`ready`?e.data.repos.filter(e=>e.state!==`not-read`):[],n=t.filter(e=>e.state!==`fresh`);return(0,M.jsxs)(N,{title:Iv.title,span:`1 / -1`,meta:t.length?Iv.summary(n.length,t.length,n.reduce((e,t)=>e+t.reread,0)):void 0,children:[(0,M.jsx)(`p`,{className:`work-why`,style:{marginTop:0},children:Iv.intro}),(0,M.jsx)(P,{of:e,empty:e=>!e.repos.some(e=>e.state!==`not-read`)&&!e.problems.length,emptyText:Iv.empty,children:e=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(n_,{list:e.problems}),n.length===0?(0,M.jsx)(`p`,{className:`work-say`,children:Iv.allFresh(t.length)}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`caption`,{className:`sr`,children:Iv.caption}),(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{scope:`col`,children:Iv.col.repo}),(0,M.jsx)(`th`,{scope:`col`,children:Iv.col.state}),(0,M.jsx)(`th`,{scope:`col`,children:Iv.col.facts}),(0,M.jsx)(`th`,{scope:`col`,children:Iv.col.clone}),(0,M.jsx)(`th`,{scope:`col`,children:Iv.col.cited}),(0,M.jsx)(`th`,{scope:`col`,children:Iv.col.reread}),(0,M.jsx)(`th`,{scope:`col`,children:Iv.col.carried}),(0,M.jsx)(`th`,{scope:`col`,children:Iv.col.run})]})}),(0,M.jsx)(`tbody`,{children:n.map(e=>(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{scope:`row`,className:`mono`,children:e.repo}),(0,M.jsx)(`td`,{children:(0,M.jsx)(`span`,{className:`chip ${e.state===`moved`?`warn`:`blocking`}`,children:Iv.states[e.state]})}),(0,M.jsxs)(`td`,{className:`mono`,children:[e.factsCommits[0]?Lv(e.factsCommits[0]):``,e.factsCommits.length>1?` ${Iv.more(e.factsCommits.length-1)}`:``]}),(0,M.jsx)(`td`,{className:`mono`,children:e.head?Lv(e.head):``}),(0,M.jsx)(`td`,{children:e.citedChanged}),(0,M.jsx)(`td`,{children:e.reread}),(0,M.jsx)(`td`,{children:e.carried}),(0,M.jsxs)(`td`,{children:[e.slash&&(0,M.jsx)(Xg,{text:e.slash,label:wv.copySlash}),e.command&&(0,M.jsx)(Xg,{text:e.command,label:wv.copy})]})]},e.repo))})]}),t.length>n.length&&(0,M.jsx)(`p`,{className:`work-say`,children:Iv.freshCount(t.length-n.length)})]})]})})]})}function zv({of:e,fresh:t}){return(0,M.jsxs)(`div`,{className:`bento`,children:[t&&(0,M.jsx)(Rv,{of:t}),(0,M.jsxs)(N,{title:E.nav.screens.trust,span:`1 / -1`,meta:e.state===`ready`&&e.data.repos.length?U.summary(e.data.repos.filter(e=>e.state===`trusted`).length,e.data.repos.length):void 0,children:[(0,M.jsx)(`p`,{className:`work-why`,style:{marginTop:0},children:U.intro}),(0,M.jsx)(P,{of:e,empty:e=>e.repos.length===0&&!e.problems.length,emptyText:U.empty,children:e=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(n_,{list:e.problems}),(0,M.jsx)(`p`,{className:`work-say`,children:U.reportIn(e.factsDir)}),e.contracts&&(0,M.jsxs)(`p`,{className:`work-say`,children:[e.contracts.mismatches>0&&(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),U.contracts(e.contracts.mismatches,e.contracts.unconfirmed,e.contracts.compared),` `,(0,M.jsx)(`a`,{href:`#/mismatches`,children:U.contractsOpen})]}),(0,M.jsx)(`div`,{className:`stack`,style:{gap:12},children:e.repos.map(e=>(0,M.jsx)(Fv,{r:e},e.repo))})]})})]})]})}function Bv(){let e=A(`/api/trust`);ce(e);let t=A(`/api/trust/fresh`);return ce(t),(0,M.jsx)(Wh,{children:(0,M.jsx)(zv,{of:e,fresh:t})})}var W=E.outside,Vv=e=>`#/outside?system=${encodeURIComponent(e)}`;function Hv(e){return(0,M.jsx)(`nav`,{"aria-label":W.pick,children:(0,M.jsx)(`ul`,{className:`row`,style:{gap:6,flexWrap:`wrap`,listStyle:`none`,padding:0,margin:0},children:e.systems.map(t=>(0,M.jsx)(`li`,{children:(0,M.jsx)(`a`,{className:`chip`,href:Vv(t.id),"aria-current":t.id===e.current?`page`:void 0,children:t.name})},t.id))})})}var Uv=e=>[e.method,e.path].filter(Boolean).join(` `)||(e.fact??``);function Wv({text:e}){return(0,M.jsxs)(`div`,{className:`work-cmd`,children:[(0,M.jsx)(`code`,{className:`mono`,children:e}),(0,M.jsx)(Yt,{text:e,label:W.copy(e)})]})}function Gv({calls:e,extra:t}){return(0,M.jsx)(`ul`,{className:`ev-list`,style:{margin:0},children:e.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`code`,{className:`mono`,children:Uv(e)}),` · `,e.repo,` `,(0,M.jsx)(`code`,{className:`mono`,children:e.at}),` · `,t(e)]},`${e.repo}|${e.at}`))})}function Kv({system:e}){let t=`outside-${e.id}`;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(N,{title:e.name,span:`1 / -1`,labelledBy:`${t}-name`,children:(0,M.jsxs)(`p`,{className:`work-say`,style:{margin:0},children:[W.boundary[e.boundary]??e.boundary,e.owner?` · ${W.owner(e.owner)}`:``,e.aliases.length?` · ${W.aliases(e.aliases.join(`, `))}`:``]})}),(0,M.jsx)(N,{title:W.callers,span:`1 / -1`,labelledBy:`${t}-callers`,children:e.callers.length?(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`caption`,{className:`sr`,children:W.callers}),(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{scope:`col`,children:W.callerCols.from}),(0,M.jsx)(`th`,{scope:`col`,children:W.callerCols.call}),(0,M.jsx)(`th`,{scope:`col`,children:W.callerCols.line}),(0,M.jsx)(`th`,{scope:`col`,children:W.callerCols.operation}),(0,M.jsx)(`th`,{scope:`col`,children:W.callerCols.seen})]})}),(0,M.jsx)(`tbody`,{children:e.callers.map(e=>(0,M.jsxs)(`tr`,{children:[(0,M.jsxs)(`td`,{children:[e.repo,e.component&&e.component!==e.repo?` (${e.component})`:``]}),(0,M.jsxs)(`td`,{children:[(0,M.jsx)(`code`,{className:`mono`,children:Uv(e)}),e.through&&(0,M.jsxs)(`span`,{className:`work-say`,children:[` `,W.through(e.through.repo,e.through.at)]})]}),(0,M.jsx)(`td`,{children:(0,M.jsx)(`code`,{className:`mono`,children:e.at})}),(0,M.jsx)(`td`,{children:e.operation?(0,M.jsx)(`code`,{className:`mono`,children:e.operation}):W.noOperation}),(0,M.jsx)(`td`,{children:e.seen.map(e=>W.seen[e]??e).join(`, `)})]},`${e.repo}|${e.at}`))})]}):(0,M.jsx)(`p`,{className:`work-say`,children:W.noCallers})}),(0,M.jsx)(N,{title:W.operations,span:`span 6`,labelledBy:`${t}-ops`,children:e.spec?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`work-say`,children:W.specFrom(e.spec.path,e.spec.title,e.spec.version)}),(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`caption`,{className:`sr`,children:W.operations}),(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{scope:`col`,children:W.opCols.op}),(0,M.jsx)(`th`,{scope:`col`,children:W.opCols.line}),(0,M.jsx)(`th`,{scope:`col`,children:W.opCols.calls})]})}),(0,M.jsx)(`tbody`,{children:e.spec.operations.map(e=>(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`td`,{children:(0,M.jsx)(`code`,{className:`mono`,children:`${e.method} ${e.path}`})}),(0,M.jsx)(`td`,{children:(0,M.jsx)(`code`,{className:`mono`,children:e.cite})}),(0,M.jsx)(`td`,{children:e.calls})]},e.id))})]})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`work-say`,children:W.noSpec}),(e.addSpec??[]).map(e=>(0,M.jsx)(Wv,{text:e},e)),(0,M.jsx)(`p`,{className:`work-say`,children:W.noSpecWhy})]})}),(0,M.jsxs)(N,{title:W.unmatched,span:`span 6`,labelledBy:`${t}-unmatched`,children:[e.unmatched.length?(0,M.jsx)(Gv,{calls:e.unmatched,extra:e=>e.message}):(0,M.jsx)(`p`,{className:`work-say`,children:e.spec?W.noUnmatched:W.noSpec}),e.ambiguous.length>0&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`h3`,{className:`hud`,children:W.ambiguous}),(0,M.jsx)(Gv,{calls:e.ambiguous,extra:e=>W.ambiguousOf(e.candidates.join(`, `))})]})]}),(e.shared||e.boundary===`internal`)&&(0,M.jsx)(N,{title:W.shared,span:`1 / -1`,labelledBy:`${t}-shared`,children:e.shared?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`work-say`,children:W.sharedFrom(e.shared.name,e.shared.commit,e.shared.importedAt)}),(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`caption`,{className:`sr`,children:W.shared}),(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{scope:`col`,children:W.sharedCols.entry}),(0,M.jsx)(`th`,{scope:`col`,children:W.sharedCols.repo}),(0,M.jsx)(`th`,{scope:`col`,children:W.sharedCols.line}),(0,M.jsx)(`th`,{scope:`col`,children:W.sharedCols.calls})]})}),(0,M.jsx)(`tbody`,{children:e.shared.entries.map(e=>(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`td`,{children:(0,M.jsx)(`code`,{className:`mono`,children:[e.method,e.path].filter(Boolean).join(` `)})}),(0,M.jsxs)(`td`,{children:[e.repo,e.component===e.repo?``:` (${e.component})`]}),(0,M.jsx)(`td`,{children:(0,M.jsx)(`code`,{className:`mono`,children:e.at})}),(0,M.jsx)(`td`,{children:e.calls})]},`${e.repo}|${e.fact}`))})]}),(0,M.jsx)(`h3`,{className:`hud`,children:W.sharedUnmatched}),e.shared.unmatched.length?(0,M.jsx)(Gv,{calls:e.shared.unmatched,extra:e=>e.message}):(0,M.jsx)(`p`,{className:`work-say`,children:W.noSharedUnmatched})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`work-say`,children:W.noShared}),(0,M.jsx)(Wv,{text:W.sharedImport(e.id)})]})}),(e.spec||e.contracts)&&(0,M.jsxs)(N,{title:W.contracts,span:`1 / -1`,labelledBy:`${t}-contracts`,children:[(0,M.jsx)(`p`,{className:`work-say`,children:W.contractsIntro}),e.contracts?.findings.length?(0,M.jsx)(`ul`,{className:`ev-list`,style:{margin:0},children:e.contracts.findings.map(t=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{className:`chip ${t.status===`mismatch`?`warn`:``}`,children:E.mismatches.status[t.status]}),` `,e.contracts?.new?.includes(t.id)&&(0,M.jsx)(`span`,{className:`chip warn`,children:W.newWithSpec}),` `,t.message]},t.id))}):(0,M.jsx)(`p`,{className:`work-say`,children:W.noContracts})]}),(0,M.jsx)(N,{title:W.questions,span:`1 / -1`,labelledBy:`${t}-questions`,children:e.questions.length?(0,M.jsx)(`ul`,{className:`ev-list`,style:{margin:0},children:e.questions.map(e=>(0,M.jsxs)(`li`,{children:[e.question,` `,(0,M.jsxs)(`span`,{className:`muted`,children:[`(`,e.repo,`)`]}),` `,(0,M.jsx)(`a`,{href:`#/questions/${e.id}`,children:W.answer})]},e.id))}):(0,M.jsx)(`p`,{className:`work-say`,children:W.noQuestions})})]})}function qv({hash:e}){let t=A(`/api/outside`);ce(t);let n=ye(e,`system`),r=t.state===`ready`?t.data.systems:[],i=n??r[0]?.id,a=r.find(e=>e.id===i);return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsxs)(N,{title:W.title,span:`1 / -1`,children:[(0,M.jsx)(`p`,{className:`work-say`,children:W.intro}),(0,M.jsx)(P,{of:t,empty:e=>e.systems.length===0,emptyText:W.empty,children:e=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Hv,{systems:e.systems,current:i}),e.notes.length>0&&(0,M.jsxs)(`details`,{children:[(0,M.jsx)(`summary`,{children:W.notes}),(0,M.jsx)(`ul`,{className:`ev-list`,children:e.notes.map(e=>(0,M.jsx)(`li`,{children:e},e))})]})]})})]}),a&&(0,M.jsx)(Kv,{system:a})]})}var Jv=E.mismatches,Yv=[`all`,`mismatch`,`unconfirmed`],Xv=e=>[e.what,e.value?`: ${e.value}`:``,e.at?` (${e.at})`:``].join(``);function Zv({link:e,list:t}){let n=(0,v.useId)(),r=[e.method,e.path].filter(Boolean).join(` `),i=e.entry?.repo??e.system??``,a=Jv.link(e.call.repo,r,i,e.through.join(`, `));return(0,M.jsxs)(`section`,{className:`stack`,style:{gap:4},"aria-labelledby":n,children:[(0,M.jsx)(`h3`,{className:`hud`,id:n,style:{margin:0},children:(0,M.jsx)(`code`,{className:`mono`,children:a})}),e.specs.length>0&&(0,M.jsx)(`p`,{className:`work-say`,children:Jv.specs(e.specs.join(`, `))}),(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`caption`,{className:`sr`,children:a}),(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{scope:`col`,children:Jv.cols.kind}),(0,M.jsx)(`th`,{scope:`col`,children:Jv.cols.says}),(0,M.jsx)(`th`,{scope:`col`,children:Jv.cols.sender}),(0,M.jsx)(`th`,{scope:`col`,children:Jv.cols.receiver})]})}),(0,M.jsx)(`tbody`,{children:t.map(e=>(0,M.jsxs)(`tr`,{children:[(0,M.jsxs)(`td`,{children:[(0,M.jsxs)(`span`,{className:`chip ${e.status===`mismatch`?`warn`:``}`,children:[e.status===`mismatch`&&(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`⚠ `}),Jv.status[e.status]]}),` `,Jv.kinds[e.kind]??e.kind]}),(0,M.jsxs)(`td`,{children:[e.message,e.via?.length?(0,M.jsx)(`div`,{className:`work-say`,children:Jv.via(e.via.join(`, `))}):null]}),(0,M.jsx)(`td`,{children:(0,M.jsx)(`code`,{className:`mono`,children:Xv(e.sender)})}),(0,M.jsx)(`td`,{children:(0,M.jsx)(`code`,{className:`mono`,children:Xv(e.receiver)})})]},e.id))})]})]})}function Qv({view:e}){let[t,n]=(0,v.useState)(`all`),r=(0,v.useId)(),i=e.findings.filter(e=>t===`all`||e.status===t),a=e.links.map(e=>({l:e,list:i.filter(t=>t.id.startsWith(`${e.key}#`))})).filter(e=>e.list.length),o=e.counts;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`work-say`,children:Jv.counts(o.mismatches,o.unconfirmed,o.links,o.compared)}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:6,alignItems:`center`},children:[(0,M.jsx)(`label`,{htmlFor:r,children:Jv.filter}),(0,M.jsx)(`select`,{id:r,value:t,onChange:e=>n(e.target.value),children:Yv.map(e=>(0,M.jsx)(`option`,{value:e,children:Jv.filters[e]},e))}),(0,M.jsx)(`code`,{className:`mono`,children:Jv.command}),(0,M.jsx)(Yt,{text:Jv.command,label:Jv.commandLabel})]}),(0,M.jsx)(`div`,{className:`stack`,style:{gap:12},children:a.map(({l:e,list:t})=>(0,M.jsx)(Zv,{link:e,list:t},e.key))}),e.notes.length>0&&(0,M.jsxs)(`details`,{children:[(0,M.jsx)(`summary`,{children:Jv.notes}),(0,M.jsx)(`ul`,{className:`ev-list`,children:e.notes.map(e=>(0,M.jsx)(`li`,{children:e},e))})]})]})}function $v(){let e=A(`/api/contracts`);return ce(e),(0,M.jsx)(`div`,{className:`bento`,children:(0,M.jsxs)(N,{title:Jv.title,span:`1 / -1`,children:[(0,M.jsx)(`p`,{className:`work-say`,children:Jv.intro}),(0,M.jsx)(P,{of:e,empty:e=>e.counts.compared===0,emptyText:Jv.empty,children:e=>(0,M.jsx)(Qv,{view:e})})]})})}var ey={define:`brief`,design:`arch-review`,plan:`breakdown`,build:`tasks`,qa:`trace`,"release-ready":`release`,"post-release-review":`release`,returned:`brief`},ty=[[`brief`,`brief`],[`proposal`,`brief`],[`ux`,`ux`],[`design`,`arch-review`],[`interfaces`,`arch-review`],[`data`,`arch-review`],[`mappings`,`mappings`],[`stories`,`breakdown`],[`specs`,`breakdown`],[`tasks`,`breakdown`],[`snow`,`breakdown`],[`tests`,`trace`],[`security`,`release`]],ny=(e,t)=>`#/${e}${t?`?change=${encodeURIComponent(t)}`:``}`;function ry(e){let t=[];for(let n of e.changes){let e=ey[n.state];e&&t.push({kind:`phase`,title:`${n.title} is in ${n.state}`,detail:`${n.id} · ${n.type}`,href:ny(e,n.id),id:n.id,change:n.id,...n.updatedAt?{since:n.updatedAt}:{}})}for(let n of e.findings)n.state===`open`&&(n.severity===`blocking`||n.severity===`gap`)&&t.push({kind:`finding`,title:n.summary,detail:`${n.severity} · ${n.artifact}${n.change?` · ${n.change}`:``}`,href:ny(ty.find(([e])=>n.artifact.startsWith(e))?.[1]??`changes`,n.change),id:n.id,...n.change?{change:n.change}:{},...n.severity===`blocking`?{blocking:!0}:{}});for(let n of e.needs??[])n.status===`open`&&t.push({kind:`need`,title:n.title,detail:[n.kind,n.handledBy,n.leadTime,n.change].filter(Boolean).join(` · `),href:`#/changes?across=needs`,id:n.item,change:n.change});for(let n of e.triage)t.push({kind:`triage`,title:n.summary,detail:n.kind,href:`#/intake`,id:n.id});for(let n of e.questions)t.push({kind:`question`,title:n.question,detail:`${n.system??``}${n.owner?` · ask ${n.owner}`:``}`,href:`#/map`,id:n.id,...n.system?{repo:n.system}:{}});for(let n of e.questionFiles??[])t.push({kind:`question`,title:n.question,detail:`${n.repo} · ${n.id}`,href:`#/questions/${encodeURIComponent(n.id)}`,id:n.id,repo:n.repo});for(let n of e.steps)t.push({kind:`step`,title:n.title,detail:`${n.system}${n.change?` · ${n.change}`:``}`,href:`#/todo`,id:n.id,...n.change?{change:n.change}:{}});return e.knowledgeToVerify&&t.push({kind:`knowledge`,title:E.commandCenter.knowledgeToVerify(e.knowledgeToVerify),detail:E.commandCenter.knowledgeDetail,href:`#/knowledge`}),t}var iy=[`need`,`finding`,`step`],ay=[`question`,`need`,`finding`,`step`,`triage`,`knowledge`];function oy(e,t,n){let r=e.filter(e=>e.kind!==`phase`),i=new Map(t.map((e,t)=>[e.id,{...e,n:t}])),a=r.filter(e=>jg([e.title,e.id,e.change,e.change&&i.get(e.change)?.title,e.repo],n)),o=(e,t)=>t.flatMap(t=>{let n=e.filter(e=>e.kind===t);return n.length?t===`finding`?[{kind:t,items:[...n.filter(e=>e.blocking),...n.filter(e=>!e.blocking)]}]:t===`question`?[...new Set(n.map(e=>e.repo??``))].sort((e,t)=>e?t?e.localeCompare(t):-1:1).map(e=>({kind:t,...e?{repo:e}:{},items:n.filter(t=>(t.repo??``)===e)})):[{kind:t,items:n}]:[]}),s=[...new Set(a.map(e=>e.change).filter(e=>!!e))],c=e=>i.get(e.change??``)?.n??2**53-1,l=s.map(e=>{let t=a.filter(t=>t.change===e),n=i.get(e);return{change:e,title:n?.title??e,...n?.state?{state:n.state}:{},blocking:t.filter(e=>e.blocking).length,count:t.length,sections:o(t,iy)}}).sort((e,t)=>Number(t.blocking>0)-Number(e.blocking>0)||c(e)-c(t)),u=a.filter(e=>!e.change);return u.length&&l.push({title:E.commandCenter.noChangeGroup,blocking:0,count:u.length,sections:o(u,ay)}),{groups:l,shown:a.length,total:r.length}}var sy=E.nextStep,cy=E.work;function ly(e){switch(e){case`draft`:case`define`:case`returned`:return`feature`;case`design`:return`architecture`;case`plan`:return`stories`;case`build`:case`qa`:return`tasks`;case`released`:case`archived`:return`done`;default:return`release`}}var uy={feature:{id:`feature-design`,label:E.nav.feature},architecture:{id:`architecture`,label:E.nav.architecture},stories:{id:`stories`,label:E.nav.stories},tasks:{id:`task-list`,label:E.nav.tasks},release:{id:`release`,label:sy.releasePlan},done:void 0},dy=e=>ly(e.state)!==`done`,fy=(e,t)=>`#/${e}${t?`?change=${encodeURIComponent(t)}`:``}`,py=e=>({command:e,where:cy.slashWhere.metarepo}),my=e=>({command:`atticus critic ${e}`,why:cy.why.critic,slash:py(`/atticus-critic ${e}`)}),hy=e=>({command:`atticus change handoff ${e} --approve`,why:cy.why.handoff});function gy(e,t){return{command:`atticus task run ${e} ${t.id}`,why:cy.why.task(t.id,t.repo),slash:py(`/atticus-task ${e} ${t.id}`),after:[{command:`atticus task context ${e} ${t.id}`,why:cy.taskInRepo(t.repo)}]}}function _y(e,t){let n=ly(e.state);return e.fastPath&&(n===`feature`||n===`architecture`||n===`stories`)?{command:`atticus change small ${e.id}`,why:cy.why.small,slash:py(`/atticus-small ${e.id}`),after:[hy(e.id)]}:vy(n,e,t)}function vy(e,t,n){switch(e){case`feature`:return{command:`atticus change feature ${t.id}`,why:cy.why.feature,slash:py(`/atticus-feature ${t.id}`),after:[hy(t.id)]};case`architecture`:return{command:`atticus change architecture ${t.id}`,why:cy.why.architecture,slash:py(`/atticus-architecture ${t.id}`),after:[hy(t.id)]};case`stories`:return{command:`atticus plan stories ${t.id}`,why:cy.why.stories,slash:py(`/atticus-stories ${t.id}`),after:[my(t.id),hy(t.id)]};case`tasks`:{let e=n?.find(e=>!e.done);return e?gy(t.id,e):{command:`atticus change status ${t.id}`,why:cy.why.later}}default:return{command:`atticus change status ${t.id}`,why:cy.why.later,...e===`release`?{slash:py(`/atticus-release ${t.id}`)}:{}}}}var yy=new Set([`drafting`,`waiting`,`questions`,`stopped`]);function by(e,t,n){let r=n.reasons.filter(e=>e.code!==`no-handoff`&&e.code!==`pr-not-merged`&&e.code!==`changes-requested`),i={command:`atticus change status ${t.id}`};if(r.length)return{...i,why:cy.why.stageBlocked(e,r[0].message)};let a=cy.why.stageDone(e,n.nextStep);return n.reasons.some(e=>e.code===`pr-not-merged`)?{command:`atticus change sync ${t.id}`,why:a}:n.reasons.some(e=>e.code===`no-handoff`||e.code===`changes-requested`)?{...hy(t.id),why:a}:{...i,why:a}}function xy(e,t,n,r){let i=r?.stages.find(t=>t.stage===e);if(r&&i&&!t.fastPath&&ly(t.state)!==`done`){if(i.state===`done`)return by(e,t,r);if(yy.has(i.state))return{...vy(e,t,n),why:cy.why.stageUnderWay(e,i.state)}}let a=ly(t.state);if(a===e)return _y(t,n);let o=e=>e===`feature`||e===`architecture`||e===`stories`;if(t.fastPath&&o(a)&&o(e))return _y(t,n);let s=uy[a];return{command:`atticus change status ${t.id}`,why:cy.stageIs(cy.stage[a]),...s?{link:{href:fy(s.id,t.id),label:cy.goStage(s.label)}}:{}}}function Sy(e,t){return t===void 0?void 0:e.find(e=>e.id===t)}function Cy(e){let t=e.repos;return{listed:t.length,cloned:t.filter(e=>e.cloned).length,settings:t.filter(e=>e.scanSettings.present).length,scanned:t.filter(e=>e.lastScan!==null).length,records:e.catalog.records}}var wy=new Set([`not-read`,`unverified`,`rejected`,`stale`,`unwritten`]);function Ty(e){return{command:`atticus map ${e}`,why:cy.why.read[`not-read`](e),slash:py(`/atticus-map ${e}`),after:[{command:`atticus verify ${e} --write`,why:cy.why.write(e)}]}}function Ey(e,t,n){let r=e.repos;if(r.length===0)return{command:`atticus repos discover <folder>`,why:cy.why.discover};let i=r.filter(e=>!e.cloned);if(i.length)return{command:`atticus workspace sync`,why:cy.why.sync(i.length)};let a={href:`#/trust`,label:cy.openTrust};if(n){let e=new Set(r.map(e=>e.id)),t=n.repos.find(t=>e.has(t.repo)&&wy.has(t.state)&&t.next);if(t?.next)return{command:t.next.command,why:cy.why.read[t.state](t.repo),...t.next.slash?{slash:py(t.next.slash)}:{},link:a}}else{let e=r.find(e=>e.lastScan===null);if(e)return{...Ty(e.id),link:a}}return t>0?{command:`atticus questions list --state open`,why:cy.why.answer(t),slash:py(`/atticus-answer`),link:{href:`#/questions`,label:cy.stepAnswerLink}}:{command:`atticus next`,why:cy.why.onboarded,link:a,done:!0}}function Dy(e,t,n){return Ey(e,t,n).done===!0}function Oy(e,t,n,r){if(!Dy(e,t,r)){let n=Ey(e,t,r);return n.link?n:{...n,link:{href:`#/onboarding`,label:cy.openOnboarding}}}let i=n.find(dy);if(!i)return{command:`atticus change new "<title>" --type <type>`,why:cy.why.newChange};let a=ly(i.state),o=uy[a];return{..._y(i),why:cy.why.change(i.id,cy.stage[a]),...o?{link:{href:fy(o.id,i.id),label:cy.goStage(o.label)}}:{}}}function ky(e,t){if(t)return xy(`architecture`,t.change,void 0,t.cockpit);let n=e.find(e=>ly(e.state)===`architecture`);return n?_y(n):{command:`atticus map <repo>`,why:cy.why.refresh,slash:py(`/atticus-map <repo>`),after:[{command:`atticus verify <repo> --write`,why:cy.why.write(`<repo>`)}]}}var Ay=E.dashboardExtra,jy=E.work,My=E.runNext;function Ny({v:e}){let t=Cy(e),n=Math.max(t.listed,1),r=[[t.cloned,jy.reposCloned],[t.scanned,jy.reposScanned]];return(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(n_,{list:e.problems}),(0,M.jsxs)(`p`,{style:{margin:0},children:[(0,M.jsx)(`span`,{className:`n`,style:{fontSize:22},children:t.listed}),` `,jy.reposListed,` ·`,` `,(0,M.jsx)(`span`,{className:`n`,style:{fontSize:22},children:t.records}),` `,jy.records]}),(0,M.jsx)(`div`,{className:`row`,style:{gap:18,flexWrap:`wrap`},children:r.map(([e,r])=>(0,M.jsxs)(`div`,{className:`stack`,style:{alignItems:`center`,gap:4},children:[(0,M.jsx)(he,{value:e,max:n,label:Ay.of(e,t.listed,r),text:`${e}/${t.listed}`}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:r})]},r))}),(0,M.jsx)(`a`,{href:`#/onboarding`,children:jy.openOnboarding})]})}function Py({changes:e}){let t=e.filter(dy);return t.length===0?(0,M.jsx)(`div`,{className:`state`,children:jy.noChanges}):(0,M.jsx)(ke,{caption:jy.inFlight,rows:t,rowKey:e=>e.id,cols:[{label:jy.changeCol,cell:e=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`code`,{className:`mono`,children:e.id}),(0,M.jsx)(`br`,{}),(0,M.jsx)(`span`,{className:`muted`,children:e.title})]})},{label:jy.stateCol,cell:e=>e.openFindings?.blocking?(0,M.jsxs)(M.Fragment,{children:[e.state,` `,(0,M.jsx)(`span`,{className:`chip blocking`,children:E.commandCenter.blocked})]}):e.state},{label:jy.stageCol,cell:e=>{let t=ly(e.state),n=uy[t];return n?(0,M.jsx)(`a`,{href:`#/${n.id}?change=${encodeURIComponent(e.id)}`,children:n.label}):jy.stage[t]}},{label:jy.commandCol,cell:e=>(0,M.jsx)(Xg,{text:_y(e).command,label:My.copy})}]})}function Fy(){return(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:jy.slashIntro}),(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18,lineHeight:1.7},children:My.commands.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsxs)(`code`,{className:`mono`,children:[e.name,` `,e.args]}),` `,e.what,` `,(0,M.jsxs)(`span`,{className:`muted`,children:[`(`,jy.slashWhere[e.where],`)`]})]},e.name))}),(0,M.jsx)(`p`,{className:`work-say`,children:My.install}),(0,M.jsx)(Xg,{text:`atticus assistant-files`,label:My.copy}),(0,M.jsx)(`p`,{className:`work-say`,children:My.plugin}),(0,M.jsx)(Xg,{text:`/plugin marketplace add maycombhq/atticus`,label:My.copy}),(0,M.jsx)(Xg,{text:`/plugin install atticus@maycombhq`,label:My.copy})]})}function Iy(e,t,n){for(let r of[e,t,n])if(r.state===`error`)return r;return e.state!==`ready`||t.state!==`ready`||n.state!==`ready`?{state:`loading`}:{state:`ready`,data:{onboarding:e.data,changes:t.data,questions:n.data}}}function Ly(e){let t=e.trust?.state===`ready`?e.trust.data:void 0;return(0,M.jsx)(P,{of:Iy(e.onboarding,e.changes,e.questions),children:e=>(0,M.jsx)(Qg,{step:Oy(e.onboarding,e.questions.questions.length,e.changes,t)})})}function Ry({v:e}){let t=E.trust,n=e.repos.filter(e=>e.state!==`trusted`);return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,M.jsx)(n_,{list:e.problems}),(0,M.jsx)(`p`,{style:{margin:0},children:t.summary(e.repos.length-n.length,e.repos.length)}),n.length===0?(0,M.jsx)(`p`,{className:`work-say`,style:{margin:0},children:jy.allTrusted}):(0,M.jsx)(`ul`,{"aria-label":jy.notTrusted,style:{margin:0,paddingLeft:18,lineHeight:1.7},children:n.slice(0,5).map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{className:`mono`,children:e.repo}),` `,(0,M.jsx)(`span`,{className:`chip ${Ov(e.state)}`,children:t.states[e.state]})]},e.repo))}),(0,M.jsx)(`a`,{href:`#/trust`,children:jy.openTrust})]})}function zy(e){return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:jy.estate,span:`span 5`,children:(0,M.jsxs)(`div`,{className:`stack`,style:{gap:14},children:[(0,M.jsx)(P,{of:e.onboarding,children:e=>(0,M.jsx)(Ny,{v:e})}),(0,M.jsx)(P,{of:e.trust,empty:e=>e.repos.length===0&&e.problems.length===0,emptyText:jy.trustNone,children:e=>(0,M.jsx)(Ry,{v:e})})]})}),(0,M.jsx)(N,{title:jy.inFlight,span:`span 7`,meta:e.changes.state===`ready`?String(e.changes.data.filter(dy).length):void 0,children:(0,M.jsx)(P,{of:e.changes,children:e=>(0,M.jsx)(Py,{changes:e})})})]})}var G=E.commandCenter,By=[`define`,`design`,`plan`,`build`,`qa`,`release-ready`],Vy={define:G.define,design:G.design,plan:G.plan,build:G.build,qa:`QA`,"release-ready":G.release},Hy=new Set([...By,`returned`,`post-release-review`]);function Uy({runs:e,failed:t}){return t?(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:G.howStepsRunCantRead}):e?(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:[G.howStepsRun,` `,(0,M.jsx)(`strong`,{children:e}),` · `,(0,M.jsx)(`a`,{href:`#/ai`,children:G.howStepsRunChange})]}):null}function Wy(){let e=A(`/api/settings/ai`);return j(t=>{t.type===`file.changed`&&e.reload()}),(0,M.jsx)(Uy,{...e.state===`ready`&&e.data.runs?{runs:e.data.runs}:{},failed:e.state===`error`})}function Gy(){let e=A(`/api/setup`),[t,n]=(0,v.useState)();if(e.state!==`ready`||e.data.baselined)return null;let r=e.data,i=r.steps.filter(e=>e.done).length,a=r.steps.find(e=>e.id===`scan`)?.done,o=async()=>{try{await k(`/api/baseline`,{method:`POST`,body:{}}),n({ok:!0,text:G.theCatalogIsAccepted}),e.reload()}catch(e){n({ok:!1,text:e instanceof D?e.problem.detail??e.problem.title:String(e)})}};return(0,M.jsx)(`div`,{className:`bento`,children:(0,M.jsxs)(N,{title:G.setUpAtticus,kind:`hero`,span:`1 / -1`,meta:G.ofDone(i,r.steps.length),children:[(0,M.jsx)(`ol`,{style:{listStyle:`none`,margin:0,padding:0},className:`stack`,children:r.steps.map(e=>(0,M.jsxs)(`li`,{className:`row`,style:{alignItems:`flex-start`,gap:10},children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,className:`chip ${e.done?`done`:e.optional?`dim`:`warn`}`,style:{minWidth:24,textAlign:`center`},children:e.done?`✓`:`·`}),(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,M.jsxs)(`span`,{style:{fontSize:13},children:[e.label,(0,M.jsx)(`span`,{className:`sr`,children:e.done?G.done:G.toDo}),(0,M.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[` `,`· `,e.detail,e.optional?G.optional:``]})]}),!e.done&&e.fix&&(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:e.fix})]})]},e.id))}),a&&(0,M.jsxs)(`div`,{className:`row`,style:{marginTop:12,gap:10,flexWrap:`wrap`},children:[(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,onClick:()=>void o(),children:G.acceptTheCatalogAs}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:G.afterWalkingTheEcosystem})]}),t&&(0,M.jsx)(`p`,{role:t.ok?`status`:`alert`,style:{margin:`8px 0 0`,fontSize:12.5},children:t.text})]})})}function Ky(){let[e,t]=(0,v.useState)(!1),[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(),o=async e=>{t(!0),a(void 0);try{r(await k(`/api/me/digest`,{method:`POST`,body:{send:e}}))}catch(e){a(e instanceof D?e.problem.detail??e.problem.title:String(e))}finally{t(!1)}};return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:6,marginTop:10},children:[(0,M.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:e,onClick:()=>void o(!1),children:G.showMyDigest}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:e,onClick:()=>void o(!0),children:G.sendItToMe})]}),i&&(0,M.jsx)(`p`,{role:`alert`,style:{margin:0,color:`var(--magenta-text)`,fontSize:12.5},children:i}),n&&(0,M.jsxs)(`div`,{role:`status`,className:`stack`,style:{gap:2,fontSize:12.5},children:[(0,M.jsx)(`strong`,{children:n.title}),n.lines.map((e,t)=>(0,M.jsx)(`span`,{className:`clamp2`,children:e},t)),n.sent&&(0,M.jsx)(`span`,{style:{color:`var(--green)`},children:G.sentTo(n.sent.channel)}),n.notSent&&(0,M.jsx)(`span`,{className:`muted`,children:n.notSent})]})]})}function qy(e){let t=[{label:G.waitQuestions,n:e.questions,href:`#/questions`},{label:G.waitNeeds,n:e.needs,href:`#/changes?across=needs`},{label:G.waitSteps,n:e.steps,href:`#/todo`},{label:G.waitBlocking,n:e.blocking,href:`#/changes?across=findings`}];return(0,M.jsx)(`ul`,{className:`row`,style:{listStyle:`none`,margin:0,padding:0,gap:8,flexWrap:`wrap`},children:t.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsxs)(`a`,{href:e.href,className:`btn`,children:[e.label,` `,(0,M.jsx)(`span`,{className:`chip ${e.n?`warn`:`dim`}`,children:e.n===void 0?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`–`}),(0,M.jsx)(`span`,{className:`sr`,children:E.app.notLoaded})]}):e.n})]})},e.href))})}var Jy={need:()=>G.sectionNeeds,finding:()=>G.sectionFindings,step:()=>G.sectionSteps,question:e=>G.sectionQuestions(e.repo),triage:()=>G.sectionTriage,knowledge:()=>G.sectionKnowledge},Yy=e=>`waiting-${(e??`no-change`).replace(/[^a-z0-9-]/gi,`-`)}`,Xy=`waiting-filter`,Zy=e=>e.kind===`need`&&!!e.change&&!!e.id||e.kind===`step`&&!!e.id,Qy=e=>`${e.kind}|${e.change??``}|${e.id??``}`;function $y(e,t,n){let r=n.trim();return r?e.flatMap(e=>t===`step-skip`&&e.kind===`step`&&e.id?[{path:`/api/todo/${encodeURIComponent(e.id)}/done`,body:{skip:!0,note:r,...e.change?{change:e.change}:{}}}]:t!==`step-skip`&&e.kind===`need`&&e.change&&e.id?[{path:`/api/changes/${encodeURIComponent(e.change)}/needs/${encodeURIComponent(e.id)}`,body:{status:t===`need-done`?`done`:`not-needed`,note:r}}]:[]):[]}function eb({x:e,selected:t,onSelect:n}){return(0,M.jsxs)(`li`,{className:`row`,style:{gap:6,alignItems:`flex-start`},children:[n&&Zy(e)&&(0,M.jsx)(`input`,{type:`checkbox`,"aria-label":G.select(e.title),checked:!!t,onChange:e=>n(e.target.checked),style:{marginTop:10}}),(0,M.jsxs)(`a`,{href:e.href,className:`list-row`,style:{alignItems:`flex-start`,textDecoration:`none`,color:`inherit`},children:[(0,M.jsxs)(`span`,{style:{minWidth:0},children:[(0,M.jsx)(`span`,{className:`clamp2`,style:{fontSize:12.5},children:e.title}),(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:e.detail})]}),(0,M.jsx)(`span`,{className:`chip ${e.blocking?`blocking`:e.kind===`finding`?`warn`:``}`,children:e.kind.toUpperCase()})]})]})}function tb(e){let t=e.selected.filter(e=>e.kind===`need`).length,n=e.selected.filter(e=>e.kind===`step`).length,[r,i]=(0,v.useState)(t?`need-done`:`step-skip`),[a,o]=(0,v.useState)(``),s=$y(e.selected,r,a||`-`).length;return(0,M.jsxs)(`form`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`flex-end`},"aria-label":G.bulkTitle,onSubmit:t=>{t.preventDefault(),a.trim()&&e.onDo(r,a)},children:[(0,M.jsx)(`span`,{children:G.selected(e.selected.length)}),(0,M.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`hud`,children:G.bulkAction}),(0,M.jsxs)(`select`,{id:`bulk-action`,className:`field`,value:r,onChange:e=>i(e.target.value),children:[t>0&&(0,M.jsx)(`option`,{value:`need-done`,children:G.bulkNeedDone(t)}),t>0&&(0,M.jsx)(`option`,{value:`need-not-needed`,children:G.bulkNeedNot(t)}),n>0&&(0,M.jsx)(`option`,{value:`step-skip`,children:G.bulkStepSkip(n)})]})]}),(0,M.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`hud`,children:r===`need-done`?G.bulkTicket:G.bulkWhy}),(0,M.jsx)(`input`,{id:`bulk-note`,className:`field`,value:a,onChange:e=>o(e.target.value),required:!0})]}),(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:e.busy||!a.trim(),children:G.bulkDo(s)}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onClear,children:G.bulkClear})]})}function nb(e){let[t,n]=(0,v.useState)(new Set),[r,i]=(0,v.useState)(!1);if(e.state===`loading`)return(0,M.jsx)(`div`,{className:`state`,role:`status`,children:G.loading});if(e.state===`error`)return(0,M.jsx)(`div`,{className:`state`,role:`alert`,children:G.couldntLoadWhatNeeds});let a=oy(e.items,e.changes,e.text);return a.total===0?(0,M.jsx)(`div`,{className:`state`,children:G.nothingNeedsAPerson}):(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:G.byChangeIntro}),(0,M.jsx)(Pg,{id:Xy,value:e.text,onChange:e.onText}),e.onBulk&&t.size>0&&(0,M.jsx)(tb,{selected:e.items.filter(e=>t.has(Qy(e))),busy:r,onClear:()=>n(new Set),onDo:(r,a)=>{i(!0),e.onBulk(e.items.filter(e=>t.has(Qy(e))),r,a).finally(()=>{i(!1),n(new Set)})}}),(0,M.jsx)(Fg,{shown:a.shown,total:a.total,active:!!e.text.trim()}),a.groups.length===0&&(0,M.jsx)(Ig,{what:Ng({text:e.text}),onClear:()=>e.onText(``),focus:Xy}),a.groups.map(r=>(0,M.jsxs)(`section`,{"aria-labelledby":Yy(r.change),children:[(0,M.jsxs)(`h3`,{id:Yy(r.change),className:`h row`,style:{fontSize:14,margin:`6px 0`,gap:6,flexWrap:`wrap`},children:[r.change?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`a`,{href:`#/changes/${encodeURIComponent(r.change)}`,children:r.title}),(0,M.jsx)(`span`,{className:`muted mono`,style:{fontSize:11},children:r.change})]}):(0,M.jsx)(`span`,{children:r.title}),(0,M.jsx)(`span`,{className:`chip`,children:G.groupCount(r.count)}),r.blocking>0&&(0,M.jsx)(`span`,{className:`chip blocking`,children:G.blocked}),r.state&&(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:G.inState(r.state)})]}),r.sections.map(r=>(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h4`,{className:`hud`,style:{fontSize:11,margin:`6px 0`},children:Jy[r.kind](r)}),(0,M.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:r.items.map((r,i)=>(0,M.jsx)(eb,{x:r,selected:t.has(Qy(r)),...e.onBulk?{onSelect:e=>n(t=>{let n=new Set(t);return e?n.add(Qy(r)):n.delete(Qy(r)),n})}:{}},`${r.id??``}|${i}`))})]},`${r.kind}|${r.repo??``}`))]},r.change??``))]})}function rb(){let e=A(`/api/changes`),t=A(`/api/findings?state=open`),n=A(`/api/catalog/kinds`),r=A(`/api/view/questions`),i=A(`/api/view/triage`),a=A(`/api/todo`),o=A(`/api/questions?state=open`),s=A(`/api/onboarding`),c=A(`/api/trust`),l=A(`/api/knowledge/items`),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(),{me:m}=Dg(),h=V_(e),g=h.state===`ready`?h.data.flatMap(e=>(e.needs?.needs??[]).map(t=>({...t,change:e.change}))):[],_=ry({needs:g,changes:e.state===`ready`?e.data:[],findings:t.state===`ready`?t.data:[],questions:r.state===`ready`?r.data.data?.questions??[]:[],triage:i.state===`ready`?i.data.data?.items??[]:[],steps:a.state===`ready`?a.data.steps:[],questionFiles:o.state===`ready`?o.data.questions:[],...l.state===`ready`?{knowledgeToVerify:l.data.items.filter(e=>!e.review||e.review.state===`stale`).length}:{}}),y=A(`/api/graph`),b=y.state===`ready`?[...new Set(y.data.nodes.map(e=>e.system??(e.kind===`System`?e.id:void 0)))].filter(e=>!!e).sort():[],x=A(y.state!==`ready`||y.data.nodes.length===0?void 0:b.length===1?`/api/diagram/container/graph?focus=${encodeURIComponent(b[0])}`:`/api/diagram/context/graph`);j(i=>{(i.type===`index.rebuilt`||i.type===`file.changed`)&&(n.reload(),y.reload(),x.reload(),e.reload(),t.reload()),i.type===`file.changed`&&(s.reload(),c.reload(),h.reload(),a.reload(),r.reload(),o.reload(),l.reload()),i.type===`run.changed`&&t.reload()});let S=e.state===`ready`?e.data.filter(e=>Hy.has(e.state)):[],C=t.state===`ready`?t.data:[],w=C.filter(e=>e.severity===`blocking`),T=C.filter(e=>e.severity===`gap`),D=r.state===`ready`?r.data.data?.questions?.length??0:0,ee=n.state===`ready`?n.data.reduce((e,t)=>e+t.count,0):0,te=n.state===`ready`?n.data.find(e=>e.kind===`Interface`)?.count??0:0,ne=S[0],O=new Map;for(let e of C)O.set(e.lens??`checks`,(O.get(e.lens??`checks`)??0)+1);let re=Math.max(1,...O.values());return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,M.jsx)(`p`,{className:`n`,style:{margin:0,fontSize:24,letterSpacing:`0.02em`},children:e.state===`error`||t.state===`error`?E.app.ccCantRead:e.state!==`ready`||t.state!==`ready`?E.app.ccReading:w.length+T.length>0?G.thingsNeedAttention(w.length+T.length):G.nothingIsBlockedRight}),(0,M.jsx)(`span`,{className:`hud`,children:m?G.liveFromYourMetarepo(m.user):G.liveFromYourMetarepo2})]}),(0,M.jsx)(Wy,{}),(0,M.jsx)(Gy,{}),(0,M.jsx)(Ly,{onboarding:s,changes:e,questions:o,trust:c}),(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsxs)(N,{title:G.waitingOnYou,span:`1 / -1`,children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:`0 0 8px`,fontSize:12.5},children:G.waitingIntro}),(0,M.jsx)(qy,{questions:r.state===`ready`?D:void 0,needs:h.state===`ready`?g.filter(e=>e.status===`open`).length:void 0,steps:a.state===`ready`?a.data.steps.length:void 0,blocking:t.state===`ready`?w.length:void 0})]}),(0,M.jsxs)(N,{title:G.needsAPerson,span:`1 / -1`,meta:_.filter(e=>e.kind!==`phase`).length||void 0,children:[(0,M.jsx)(nb,{onBulk:async(e,t,n)=>{let r=0,i=$y(e,t,n);for(let e of i)await k(e.path,{method:`POST`,body:e.body}).catch(()=>{r++});p(G.bulkDone(i.length-r,r)),h.reload(),a.reload()},items:_,changes:e.state===`ready`?e.data:[],text:u,onText:d,state:e.state===`loading`||t.state===`loading`?`loading`:e.state===`error`||t.state===`error`?`error`:`ready`}),f&&(0,M.jsx)(`p`,{role:`status`,className:`muted`,style:{margin:`6px 0 0`},children:f}),m&&(0,M.jsx)(Ky,{})]})]}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:G.approvingIsThePull}),(0,M.jsx)(zy,{onboarding:s,trust:c,changes:e}),(0,M.jsx)(`div`,{className:`bento`,role:`list`,"aria-label":G.keyNumbers,children:[{label:G.changesInFlight2,value:e.state===`ready`?S.length:void 0,color:`var(--text)`},{label:G.blockingFindings,value:t.state===`ready`?w.length:void 0,color:w.length?`var(--magenta)`:`var(--text)`},{label:G.openOwnerQuestions,value:r.state===`ready`?D:void 0,color:D?`var(--amber)`:`var(--text)`},{label:G.factsInTheCatalog,value:n.state===`ready`?ee:void 0,color:`var(--accent)`}].map(e=>(0,M.jsxs)(`div`,{role:`listitem`,className:`panel`,style:{gridColumn:`span 3`},children:[(0,M.jsx)(`div`,{className:`hud`,style:{fontSize:10},children:e.label}),(0,M.jsx)(`div`,{className:`n`,style:{fontSize:30,color:e.color},children:e.value===void 0?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`–`}),(0,M.jsx)(`span`,{className:`sr`,children:E.app.notLoaded})]}):e.value.toLocaleString()})]},e.label))}),(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:ne?G.gatePipeline(ne.id):G.gatePipeline2,span:`span 5`,children:(0,M.jsx)(P,{of:e,empty:()=>!ne,emptyText:G.noChangeInFlight,children:()=>{let e=By.indexOf(ne.state);return(0,M.jsx)(`div`,{className:`row between`,style:{gap:6},children:By.map((t,n)=>(0,M.jsxs)(`div`,{className:`stack`,style:{alignItems:`center`,gap:6},children:[n===e?(0,M.jsx)(he,{value:n+1,max:By.length,size:48,label:G.currentPhase(Vy[t]??``)}):(0,M.jsx)(`span`,{"aria-label":`${Vy[t]}: ${n<e?G.done2:G.toCome}`,role:`img`,style:{width:44,height:44,borderRadius:`50%`,border:`1.5px solid ${n<e?`var(--btn-text)`:`var(--step-off)`}`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:n<e?`var(--btn-text)`:`var(--muted)`},children:n<e?`✓`:``}),(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10,color:n===e?`var(--accent)`:void 0},children:Vy[t]})]},t))})}})}),(0,M.jsx)(N,{title:G.catalog,span:`span 4`,children:(0,M.jsx)(P,{of:n,empty:e=>e.length===0,emptyText:G.noFactsYet,children:e=>{let t=[...e].sort((e,t)=>t.count-e.count).slice(0,5),n=Math.max(1,...t.map(e=>e.count));return(0,M.jsx)(`div`,{className:`stack`,children:t.map(e=>(0,M.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`span`,{className:`hud`,style:{width:110,fontSize:10},children:e.kind}),(0,M.jsx)(`div`,{style:{flex:1},children:(0,M.jsx)(ge,{value:e.count,max:n,label:G.records(e.kind)})}),(0,M.jsx)(`span`,{className:`n`,style:{fontSize:14},children:e.count})]},e.kind))})}})}),(0,M.jsx)(N,{title:G.interfaces,kind:`dark`,span:`span 3`,children:(0,M.jsx)(P,{of:n,children:()=>(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`span`,{className:`big`,children:te}),(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:G.interfacesInTheCatalog})]})})}),(0,M.jsx)(N,{title:G.systemMap,kind:`hero`,span:`1 / -1`,meta:(0,M.jsx)(`a`,{href:`#/explore`,children:G.explore}),children:(0,M.jsx)(P,{of:y,empty:e=>e.nodes.length===0,emptyText:G.theCatalogIsEmpty,children:()=>(0,M.jsx)(P,{of:x,empty:e=>e.view.nodes.length===0,emptyText:G.theCatalogIsEmpty,children:e=>(0,M.jsx)(gt,{view:e.view,height:420})})})}),(0,M.jsx)(N,{title:G.findingsByLens,span:`span 4`,children:(0,M.jsx)(P,{of:t,empty:e=>e.length===0,emptyText:G.noOpenFindings,children:()=>(0,M.jsx)(`div`,{className:`stack`,children:[...O.entries()].sort((e,t)=>t[1]-e[1]).map(([e,t])=>(0,M.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`span`,{className:`hud`,style:{width:96,fontSize:10},children:e}),(0,M.jsx)(`div`,{style:{flex:1},children:(0,M.jsx)(ge,{value:t,max:re,label:G.findings(e)})}),(0,M.jsx)(`span`,{className:`n`,style:{fontSize:14},children:t})]},e))})})}),(0,M.jsx)(N,{title:G.whereFindingsComeFrom,kind:`dark`,span:`span 4`,children:(0,M.jsx)(P,{of:t,empty:e=>e.length===0,emptyText:G.noOpenFindings,children:e=>(0,M.jsx)(F,{title:G.openFindingsBySource,parts:[{label:G.checksFromCode,value:e.filter(e=>e.layer!==`ai`).length,color:`var(--accent)`},{label:G.aiLenses,value:e.filter(e=>e.layer===`ai`).length,color:`var(--magenta)`}]})})})]}),(0,M.jsx)(`div`,{className:`bento`,children:(0,M.jsx)(N,{title:E.work.slashTitle,span:`1 / -1`,children:(0,M.jsx)(Fy,{})})}),(0,M.jsx)(`p`,{className:`hud`,style:{textAlign:`center`,fontSize:10,color:`var(--faint)`},children:G.aPersonApprovesEvery})]})}var ib=E.explore,ab=[`name`,`description`,`system`,`owner`,`ownerComponent`,`from`,`to`,`via`,`method`,`normalizedPath`,`type`,`runtime`,`table`,`dataType`];function ob(e){return e==null?``:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):Array.isArray(e)?e.map(ob).join(`, `):JSON.stringify(e)}function sb(e,t){let n=e.split(`?`)[1];return n?new URLSearchParams(n).get(t)??``:``}var cb=e=>sb(e,`q`);function lb({row:e}){let t=A(`/api/catalog/${e.kind}/${encodeURIComponent(e.id)}`);return(0,M.jsx)(N,{title:e.id,meta:e.kind,span:`span 4`,rows:`span 2`,children:(0,M.jsx)(P,{of:t,children:e=>{let t=Object.keys(e).filter(e=>![`kind`,`id`,`evidence`,`schemaVersion`,`flags`].includes(e)),n=[...ab.filter(e=>t.includes(e)),...t.filter(e=>!ab.includes(e))];return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[(0,M.jsx)(`dl`,{style:{margin:0,display:`grid`,gridTemplateColumns:`120px 1fr`,gap:`6px 10px`,fontSize:12.5},children:n.map(t=>(0,M.jsxs)(`div`,{style:{display:`contents`},children:[(0,M.jsx)(`dt`,{className:`hud`,style:{fontSize:10},children:t}),(0,M.jsx)(`dd`,{className:/^(from|to|system|owner|ownerComponent|table)$/.test(t)?`mono`:``,style:{margin:0,wordBreak:`break-word`},children:ob(e[t])})]},t))}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`hud`,style:{fontSize:10,marginBottom:6},children:ib.evidence}),(e.evidence??[]).length===0?(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:ib.noEvidenceRecordedTreat}):(0,M.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0,display:`flex`,flexDirection:`column`,gap:6},children:(e.evidence??[]).map((e,t)=>(0,M.jsxs)(`li`,{style:{fontSize:12.5},children:[(0,M.jsx)(`span`,{className:`chip ${e.source===`code`||e.source===`config`?``:e.source===`document`||e.source===`diagram`?`warn`:`ai`}`,children:e.source.toUpperCase()}),` `,(0,M.jsxs)(`span`,{className:`mono`,children:[e.repo?`${e.repo} · `:``,e.path??``,e.line?`:${e.line}`:``]})]},t))})]}),(0,M.jsx)(`a`,{href:`#/impact?q=${encodeURIComponent(e.id)}`,className:`btn`,style:{display:`inline-flex`,alignItems:`center`,textDecoration:`none`,width:`fit-content`},children:ib.whatBreaksIfThis})]})}})})}function ub({hash:e}){let t=cb(e),n=sb(e,`ask`),r=A(n?`/api/ask?q=${encodeURIComponent(n)}`:void 0),[i,a]=(0,v.useState)(t),[o,s]=(0,v.useState)(t);(0,v.useEffect)(()=>{a(t),s(t)},[t]),(0,v.useEffect)(()=>{r.state===`ready`&&(r.data.action===`impact`&&r.data.id?location.hash=`#/impact?q=${encodeURIComponent(r.data.id)}`:(a(r.data.query),s(r.data.query)))},[r.state,r.state===`ready`?r.data:void 0]);let[c,l]=(0,v.useState)(),u=A(o?`/api/search?q=${encodeURIComponent(o)}&limit=60`:void 0),d=c&&(c.kind===`Component`||c.kind===`System`)?c.id:c?.system,f=A(d?`/api/graph?focus=${encodeURIComponent(d)}&depth=2`:`/api/graph`);return ce(u,f),(0,M.jsxs)(`div`,{className:`bento`,children:[n&&(0,M.jsx)(N,{title:ib.ask(n),kind:`hero`,span:`1 / -1`,children:(0,M.jsx)(P,{of:r,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,M.jsx)(`p`,{style:{margin:0},children:e.explanation}),e.action===`owner`&&(0,M.jsx)(`p`,{style:{margin:0,fontSize:18},children:e.owner?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`mono`,children:e.id}),` `,ib.isOwnedBy,(0,M.jsx)(`span`,{className:`chip done`,children:e.owner})]}):(0,M.jsxs)(M.Fragment,{children:[ib.theCatalogDoesntKnow,(0,M.jsx)(`span`,{className:`mono`,children:e.id}),` `,ib.yet]})}),(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[ib.queryRun,(0,M.jsx)(`span`,{className:`mono`,style:{color:`var(--accent)`},children:e.query}),ib.editItBelowTo]}),e.error&&(0,M.jsx)(`span`,{role:`alert`,style:{color:`var(--magenta-text)`},children:e.error})]})})}),(0,M.jsx)(N,{title:ib.searchTheCatalog,span:`1 / -1`,children:(0,M.jsxs)(`form`,{role:`search`,onSubmit:e=>{e.preventDefault(),l(void 0),s(i.trim()),history.replaceState(null,``,`#/explore?q=${encodeURIComponent(i.trim())}`)},className:`row`,style:{flexWrap:`wrap`},children:[(0,M.jsx)(`label`,{htmlFor:`kq`,className:`sr`,children:ib.search}),(0,M.jsx)(`input`,{id:`kq`,value:i,onChange:e=>a(e.target.value),placeholder:ib.tryDailyLimitKind,style:{flex:`1 1 360px`,height:40,background:`var(--box)`,color:`var(--text)`,border:`1px solid var(--accent)`,borderRadius:10,padding:`0 12px`,font:`inherit`}}),(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,children:ib.search}),(0,M.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[ib.wordsMatchIdsAnd,(0,M.jsx)(`span`,{className:`mono`,children:ib.kind}),`, `,(0,M.jsx)(`span`,{className:`mono`,children:ib.system}),`,`,` `,(0,M.jsx)(`span`,{className:`mono`,children:ib.status}),` `,ib.narrowIt]})]})}),(0,M.jsx)(N,{title:ib.results,span:`span 3`,rows:`span 2`,meta:u.state===`ready`?u.data.total:void 0,children:o?(0,M.jsx)(P,{of:u,empty:e=>e.rows.length===0,emptyText:ib.nothingMatchesTryFewer,children:e=>(0,M.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},"aria-label":ib.searchResults,children:e.rows.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsxs)(`button`,{type:`button`,onClick:()=>l(e),"aria-pressed":c?.id===e.id&&c?.kind===e.kind,className:`list-row`,style:{width:`100%`,background:c?.id===e.id?`var(--picked)`:`transparent`,border:0,color:`inherit`,font:`inherit`,textAlign:`left`,cursor:`pointer`,padding:`7px 6px`,borderRadius:6},children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2,minWidth:0},children:[(0,M.jsx)(`span`,{className:`mono`,style:{fontSize:12,wordBreak:`break-all`},children:e.id}),e.name&&e.name!==e.id&&(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:e.name})]}),(0,M.jsx)(`span`,{className:`chip dim`,children:e.kind})]})},`${e.kind}/${e.id}`))})}):(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:ib.searchForAService})}),(0,M.jsx)(N,{title:d?ib.around(d):ib.theWholeEstate,kind:`hero`,span:`1 / -1`,children:(0,M.jsx)(P,{of:f,empty:e=>e.nodes.length===0,emptyText:ib.theCatalogIsEmpty,children:e=>(0,M.jsx)(St,{g:e,...d?{focus:d}:{},highlight:u.state===`ready`?u.data.rows.map(e=>e.id):[]})})}),c&&(0,M.jsx)(lb,{row:c},`${c.kind}/${c.id}`)]})}var db=E.flowsModel,fb={action:`A person`,page:`A person`,job:`A schedule`,listener:`A message`},pb=6,mb=e=>e.length>pb?`${e.slice(0,pb).join(`, `)} and ${e.length-pb} more`:e.join(`, `),hb=e=>e?.path?`${e.path}${e.line===void 0?``:`:${e.line}`}`:void 0,gb=new Set([`loop`,`retry`]);function _b(e){let t=e.data??{},n=[];for(let e of[`sends`,`returns`,`reads`,`checks`])t[e]?.length&&n.push(`${e}: ${mb(t[e])}`);return(t.from?.length||t.to?.length)&&n.push(`maps: ${mb(t.from??[])} → ${mb(t.to??[])}`),e.store?.columns.length&&n.push(`columns: ${mb(e.store.columns)}`),e.repeats&&n.push(`repeats steps ${e.repeats.from} to ${e.repeats.to}`),n}function vb(e){let t=e.trigger,n=[],r=[{id:`caller`,label:t.caller?.who??fb[t.kind]??(n.push(db.whoCallsThisEntry),db.callerNotKnown),kind:`caller`}],i=t.caller?.via&&t.caller.via!==`direct`?t.caller.via:void 0;i&&r.push({id:`gateway`,label:i,kind:`gateway`}),r.push({id:`self`,label:e.component,kind:`self`});let a=(e,t,n,i)=>{let a=r.find(t=>t.id===e);return a?i&&(a.isNew=!0):r.push({id:e,label:t,kind:n,...i?{isNew:!0}:{}}),e},o=[{n:0,shown:db.start,kind:t.kind,what:t.what,from:`caller`,to:`self`,...i?{label:`via ${i}`}:{},back:!1,fields:[],...hb(t.evidence[0])?{cite:hb(t.evidence[0])}:{},more:Math.max(0,t.evidence.length-1),frames:[]}];e.steps.forEach((t,r)=>{let i=r+1,s=`self`,c,l=!1;if(t.kind===`call-out`&&t.to)s=a(`component:${t.to.component}`,t.to.component,`component`,t.to.new),c=t.to.entry;else if(t.kind===`publish`){let e=t.to?.entry??t.refs?.[0]??`a topic`;s=a(`topic:${e}`,e,`topic`,t.to?.new)}else t.store&&[`read`,`write`,`lookup`].includes(t.kind)?s=a(`store:${t.store.table}`,t.store.table,`store`,t.store.new):t.kind===`respond`&&(s=`caller`,l=!0);let u=e.target?t.target:i,d=e.target?void 0:e.calls.find(e=>e.step===i),f=e.target?void 0:e.unmatched.find(e=>e.step===i);gb.has(t.kind)&&!t.repeats&&t.mark!==`removed`&&n.push(`Step ${u??i} is a ${t.kind} that doesn't say which steps it repeats yet.`),o.push({n:i,shown:u===void 0?t.today===void 0?``:`was ${t.today}`:String(u),kind:t.kind,what:t.what,from:`self`,to:s,...c?{label:c}:{},back:l,fields:_b(t),...hb(t.evidence[0])?{cite:hb(t.evidence[0])}:{},more:Math.max(0,t.evidence.length-1),...t.confirmedBy?{confirmedBy:t.confirmedBy}:{},...d?{opens:{repo:d.repo,flow:d.flow,...d.name?{name:d.name}:{}}}:{},...f?{unjoined:f.message}:{},frames:[],...t.mark&&t.mark!==`same`?{mark:t.mark}:{},...t.was&&t.was.what!==t.what?{was:t.was.what}:{},...t.why?{why:t.why}:{}})});let s=t=>e.target?o.find(n=>n.n>0&&e.steps[n.n-1].target===t)?.n:t,c=[];e.steps.forEach((t,n)=>{if(!gb.has(t.kind)||!t.repeats||t.mark===`removed`)return;let r=s(t.repeats.from),i=s(t.repeats.to);if(r===void 0||i===void 0||r>i||i>e.steps.length)return;let a=n+1;c.push({kind:t.kind,step:a,from:Math.min(r,a),to:Math.max(i,a),depth:0,repeats:t.repeats})}),c.sort((e,t)=>e.from-t.from||t.to-e.to),c.forEach((e,t)=>{e.depth=c.slice(0,t).filter(t=>t.from<=e.from&&t.to>=e.to).length});for(let e of c)for(let t=e.from;t<=e.to;t++)o[t].frames.push({depth:e.depth,kind:e.kind,first:t===e.from,last:t===e.to,repeats:e.repeats});for(let e of o)e.frames.sort((e,t)=>e.depth-t.depth);return{lanes:r,rows:o,frames:c,errors:e.errors.map(e=>({when:e.when,then:e.then,...hb(e.evidence[0])?{cite:hb(e.evidence[0])}:{}})),gaps:n}}function yb(e){let t=e.calledBy[0],n=e.flow.trigger.caller??(t?{who:db.calledByFlows(t.name??t.flow,e.calledBy.length-1)}:void 0);return vb({component:e.flow.component,trigger:{...e.flow.trigger,caller:n},steps:e.flow.steps,errors:e.flow.errors,calls:e.calls,unmatched:e.unmatched,target:!1})}function bb(e){return vb({component:e.component,trigger:{...e.trigger,evidence:e.triggerEvidence},steps:e.steps,errors:[],calls:[],unmatched:[],target:!0})}var xb=E.flowsScreen,Sb=E.flows,Cb=(e,t)=>`#/flows?repo=${encodeURIComponent(e)}${t?`&flow=${encodeURIComponent(t)}`:``}`,wb=(e,t)=>`#/flows?change=${encodeURIComponent(e)}${t?`&flow=${encodeURIComponent(t)}`:``}`,Tb=e=>Sb.kinds[e]??e;function Eb({at:e,repo:t}){return(0,M.jsx)(Yh,{repo:t,at:e})}function Db({by:e}){return e?(0,M.jsxs)(`span`,{className:`seq-ok`,children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`✓ `}),Sb.confirmed[e]??e]}):(0,M.jsxs)(`span`,{className:`seq-unsure`,children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`○ `}),Sb.notConfirmed]})}function Ob({r:e,lanes:t,now:n,repo:r}){let i=(0,v.useRef)(null);(0,v.useEffect)(()=>{n&&i.current?.scrollIntoView({block:`center`,behavior:`smooth`})},[n]);let a=e=>t.findIndex(t=>t.id===e)+1,o=a(e.from),s=a(e.to),c=e.n===0?o:a(`self`),l=Math.min(o,s),u=Math.max(o,s),d=u-l+1,f=t[s-1];return(0,M.jsxs)(`li`,{ref:i,className:`seq-row${n?` seq-now`:``}`,...n?{"aria-current":`step`}:{},children:[e.frames.map(e=>(0,M.jsx)(`span`,{className:`seq-frame ${e.kind}${e.first?` first`:``}${e.last?` last`:``}`,style:{"--depth":e.depth},"aria-hidden":`true`,children:e.first&&(0,M.jsx)(`span`,{className:`seq-frame-label`,children:Sb.frame(e.kind,e.repeats.from,e.repeats.to)})},e.depth)),t.map((e,t)=>(0,M.jsx)(`span`,{className:`seq-life`,style:{gridColumn:t+1},"aria-hidden":`true`},e.id)),o!==s&&(0,M.jsx)(`span`,{className:`seq-arrow ${s>o?`right`:`left`}${e.back?` back`:``}`,style:{gridColumn:`${l} / ${u+1}`,"--span":d},"aria-hidden":`true`,children:e.label&&(0,M.jsx)(`em`,{children:e.label})}),(0,M.jsxs)(`div`,{className:`seq-box k-${e.kind}${e.mark?` m-${e.mark}`:``}`,style:{gridColumn:c},children:[(0,M.jsxs)(`div`,{className:`seq-top`,children:[(0,M.jsx)(`span`,{className:`seq-n`,children:e.shown}),(0,M.jsx)(`span`,{className:`seq-kind`,children:Tb(e.kind)}),e.mark&&(0,M.jsx)(`span`,{className:`seq-mark m-${e.mark}`,children:Sb.marks[e.mark]})]}),(0,M.jsx)(`p`,{className:`seq-what`,children:e.what}),e.was&&(0,M.jsx)(`p`,{className:`seq-was`,children:Sb.was(e.was)}),e.why&&(0,M.jsx)(`p`,{className:`seq-why`,children:e.why}),o!==s&&(0,M.jsx)(`p`,{className:`sr`,children:e.back?Sb.backTo(f.label):Sb.goesTo(e.label??f.label,f.label)}),e.fields.length>0&&(0,M.jsx)(`ul`,{className:`seq-fields`,children:e.fields.map(e=>(0,M.jsx)(`li`,{children:e},e))}),e.cite&&(0,M.jsxs)(`p`,{className:`seq-cite`,children:[(0,M.jsx)(Eb,{at:e.cite,repo:r}),e.more>0&&(0,M.jsxs)(`span`,{children:[` `,Sb.more(e.more)]})]}),e.n>0&&e.mark!==`added`&&(0,M.jsx)(Db,{by:e.confirmedBy}),e.opens&&(0,M.jsx)(`a`,{className:`seq-opens`,href:Cb(e.opens.repo,e.opens.flow),children:Sb.opens(e.opens.name??e.opens.flow,e.opens.repo)}),e.unjoined&&(0,M.jsx)(`p`,{className:`seq-unjoined`,children:Sb.unjoined(e.unjoined)})]})]})}function kb({seq:e,name:t,current:n,hideErrors:r,repo:i}){let a=e.frames.reduce((e,t)=>Math.max(e,t.depth+1),0),o={"--lanes":e.lanes.length,"--frames":a},[s,c]=qe();return(0,M.jsxs)(`div`,{className:`seq-wrap ${s?`viewer-full`:``}`,onKeyDown:e=>{if((e.key===`f`||e.key===`F`)&&!e.ctrlKey&&!e.metaKey&&!e.altKey){if(e.target.tagName===`INPUT`)return;e.preventDefault(),c()}},...s?{role:`dialog`,"aria-modal":!0,"aria-label":Sb.diagram(t??xb.thisFlow)}:{},children:[(0,M.jsxs)(`div`,{className:`seq-bar`,children:[(0,M.jsx)(`button`,{type:`button`,className:`btn`,"aria-pressed":s,onClick:()=>c(),children:s?E.viewer.leaveFullScreen:E.viewer.fullScreen}),s&&(0,M.jsx)(`span`,{className:`hud`,role:`status`,children:E.viewer.fullScreenOn})]}),(0,M.jsxs)(`div`,{className:`seq`,style:o,tabIndex:0,role:`region`,"aria-label":Sb.diagram(t??xb.thisFlow),children:[(0,M.jsx)(`div`,{className:`seq-row seq-head`,"aria-hidden":`true`,children:e.lanes.map((e,t)=>(0,M.jsxs)(`div`,{className:`seq-lane ${e.kind}${e.isNew?` new`:``}`,style:{gridColumn:t+1},children:[(0,M.jsx)(`strong`,{children:e.label}),(0,M.jsxs)(`small`,{children:[Sb.lanes[e.kind],e.isNew?` · ${Sb.newLane}`:``]})]},e.id))}),(0,M.jsx)(`ol`,{className:`seq-steps`,"aria-label":Sb.diagram(t??xb.thisFlow),children:e.rows.map(t=>(0,M.jsx)(Ob,{r:t,lanes:e.lanes,now:t.n===n,repo:i},t.n))})]}),!r&&(0,M.jsx)(`h3`,{className:`h seq-h`,children:Sb.errorsTitle}),r?null:e.errors.length?(0,M.jsx)(`ul`,{className:`seq-errors`,children:e.errors.map((e,t)=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{children:e.when}),` `,(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`→`}),` `,(0,M.jsx)(`strong`,{children:e.then}),e.cite&&(0,M.jsx)(Eb,{at:e.cite,repo:i})]},t))}):(0,M.jsx)(`p`,{className:`muted`,children:Sb.noErrors})]})}var Ab=(e,t)=>{let n=t.trim().toLowerCase();return!n||[e.name,e.id,e.trigger.what].some(e=>e.toLowerCase().includes(n))};function jb(e){let t=e.spec.flows.filter(t=>Ab(t,e.filter));return(0,M.jsxs)(`div`,{className:`stack`,children:[e.spec.flows.length===0?(0,M.jsx)(`div`,{className:`state`,children:Sb.noFlows}):t.length===0?(0,M.jsx)(`div`,{className:`state`,children:Sb.noMatch}):(0,M.jsx)(`ul`,{className:`flow-list`,children:t.map(t=>(0,M.jsx)(`li`,{children:(0,M.jsxs)(`a`,{href:Cb(e.spec.repo,t.id),"aria-current":t.id===e.current?`true`:void 0,children:[(0,M.jsx)(`span`,{className:`flow-name`,children:t.name}),(0,M.jsxs)(`span`,{className:`flow-trigger`,children:[(0,M.jsx)(`span`,{className:`seq-kind`,children:Tb(t.trigger.kind)}),` `,t.trigger.what]}),(0,M.jsx)(`span`,{className:`flow-counts`,children:Sb.counts(t.steps,t.confirmed)})]})},t.id))}),e.spec.problems.length>0&&(0,M.jsxs)(`div`,{className:`state error`,children:[Sb.unreadable,(0,M.jsx)(`ul`,{children:e.spec.problems.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`code`,{children:e.file}),`: `,e.message]},e.file))})]})]})}function Mb({repo:e,flow:t,step:n}){let r=A(`/api/specs/${encodeURIComponent(e)}/flows/${encodeURIComponent(t)}`);return j(e=>{e.type===`file.changed`&&typeof e.path==`string`&&e.path.includes(`specs`)&&r.reload()}),(0,M.jsx)(P,{of:r,children:t=>{let r=yb(t);return(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`h2`,{className:`h`,children:t.flow.name}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,M.jsx)(`span`,{className:`hud`,children:Sb.file}),(0,M.jsx)(`code`,{children:t.file}),(0,M.jsx)(Yt,{text:t.file,label:Sb.copyFile})]}),t.calledBy.length>0&&(0,M.jsxs)(`p`,{children:[Sb.calledBy,`:`,` `,t.calledBy.map((e,t)=>(0,M.jsxs)(`span`,{children:[t>0&&`, `,(0,M.jsx)(`a`,{href:Cb(e.repo,e.flow),children:e.name??e.flow}),` (`,e.repo,`)`]},`${e.flow}.${e.step}`))]}),!t.joined&&(0,M.jsx)(`p`,{className:`muted`,children:Sb.notJoined}),r.gaps.map(e=>(0,M.jsx)(`p`,{className:`seq-unjoined`,children:e},e)),(0,M.jsx)(kb,{seq:r,name:t.flow.name,repo:e,...n===void 0?{}:{current:n}})]})}})}function Nb(e){let{repo:t,flow:n}=e,r=A(`/api/specs/${encodeURIComponent(t)}`),[i,a]=(0,v.useState)(e.q??``);return(0,M.jsxs)(`div`,{className:`flows-grid`,children:[(0,M.jsxs)(N,{title:Sb.listTitle,children:[(0,M.jsxs)(`label`,{className:`stack`,style:{gap:4,marginBottom:10},children:[(0,M.jsx)(`span`,{className:`hud`,children:Sb.filter}),(0,M.jsx)(`input`,{id:`flow-filter`,type:`search`,placeholder:Sb.filterHint,value:i,onChange:e=>a(e.target.value)})]}),(0,M.jsx)(P,{of:r,children:e=>(0,M.jsx)(jb,{spec:e,filter:i,current:n})})]}),(0,M.jsx)(N,{children:n?(0,M.jsx)(Mb,{repo:t,flow:n,...e.step===void 0?{}:{step:e.step}}):(0,M.jsx)(`div`,{className:`state`,children:Sb.pick})})]})}function Pb(e){return(0,M.jsxs)(`div`,{className:`stack`,children:[e.list.flows.length===0?(0,M.jsx)(`div`,{className:`state`,children:Sb.noTargets(e.list.change)}):(0,M.jsx)(`ul`,{className:`flow-list`,children:e.list.flows.map(t=>(0,M.jsx)(`li`,{children:(0,M.jsxs)(`a`,{href:wb(e.list.change,t.flow),"aria-current":t.flow===e.current?`true`:void 0,children:[(0,M.jsx)(`span`,{className:`flow-name`,children:t.name}),(0,M.jsxs)(`span`,{className:`flow-trigger`,children:[(0,M.jsx)(`span`,{className:`seq-kind d-${t.change}`,children:Sb.deltaKinds[t.change]}),` `,t.repo]}),(0,M.jsx)(`span`,{className:`flow-counts`,children:Sb.targetCounts(t.added,t.changed,t.removed)})]})},t.flow))}),e.list.problems.length>0&&(0,M.jsxs)(`div`,{className:`state error`,children:[Sb.unreadable,(0,M.jsx)(`ul`,{children:e.list.problems.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsx)(`code`,{children:e})},e))})]})]})}function Fb({change:e,flow:t}){let n=A(`/api/changes/${encodeURIComponent(e)}/target-flows/${encodeURIComponent(t)}`);return j(e=>{e.type===`file.changed`&&typeof e.path==`string`&&e.path.includes(`changes`)&&n.reload()}),(0,M.jsx)(P,{of:n,children:e=>{let t=bb(e);return(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`h2`,{className:`h`,children:e.name}),(0,M.jsxs)(`p`,{children:[(0,M.jsx)(`span`,{className:`seq-kind d-${e.delta}`,children:Sb.deltaKinds[e.delta]}),` `,Sb.targetCounts(e.counts.added,e.counts.changed,e.counts.removed),`.`,` `,e.delta!==`new`&&(0,M.jsx)(`a`,{href:Cb(e.repo,e.flow),children:e.flow})]}),(0,M.jsxs)(`p`,{children:[(0,M.jsx)(`span`,{className:`hud`,children:Sb.whyChange}),` `,e.why]}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,M.jsx)(`span`,{className:`hud`,children:Sb.file}),(0,M.jsx)(`code`,{children:e.file}),(0,M.jsx)(Yt,{text:e.file,label:Sb.copyFile})]}),[...e.problems,...t.gaps].map(e=>(0,M.jsx)(`p`,{className:`seq-unjoined`,children:e},e)),(0,M.jsx)(kb,{seq:t,name:e.name,repo:e.repo,hideErrors:!0})]})}})}function Ib({change:e,flow:t}){let n=A(`/api/changes/${encodeURIComponent(e)}/target-flows`);return(0,M.jsxs)(`div`,{className:`flows-grid`,children:[(0,M.jsxs)(N,{title:Sb.targetsTitle,children:[(0,M.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:Sb.changeIntro}),(0,M.jsx)(P,{of:n,children:e=>(0,M.jsx)(Pb,{list:e,current:t})})]}),(0,M.jsx)(N,{children:t?(0,M.jsx)(Fb,{change:e,flow:t}):(0,M.jsx)(`div`,{className:`state`,children:Sb.pick})})]})}function Lb(e){return e.list.state!==`ready`||e.list.data.length===0?null:(0,M.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`span`,{className:`hud`,children:Sb.change}),(0,M.jsxs)(`select`,{id:`flow-change`,value:e.change??``,onChange:e=>location.hash=e.target.value?wb(e.target.value):`#/flows`,children:[(0,M.jsx)(`option`,{value:``,children:Sb.pickRepo}),e.list.data.map(e=>(0,M.jsx)(`option`,{value:e.id,children:e.title},e.id))]})]})}function Rb({hash:e}){let t=A(`/api/specs`),n=A(`/api/changes`),r=ye(e,`change`),i=ye(e,`repo`),a=ye(e,`flow`),o=ye(e,`q`),s=Number(ye(e,`step`)),c=Number.isInteger(s)&&s>=0?s:void 0;return(0,M.jsx)(Wh,{children:(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsxs)(N,{title:Sb.title,children:[(0,M.jsx)(`p`,{className:`muted`,style:{marginTop:0},children:Sb.intro}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:16,flexWrap:`wrap`},children:[(0,M.jsx)(Lb,{list:n,...r?{change:r}:{}}),!r&&(0,M.jsx)(P,{of:t,empty:e=>e.repos.length===0,emptyText:Sb.noSpecs,children:e=>{let t=i??e.repos[0].repo;return(0,M.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`span`,{className:`hud`,children:Sb.repo}),(0,M.jsx)(`select`,{id:`flow-repo`,value:t,onChange:e=>location.hash=Cb(e.target.value),children:e.repos.map(e=>(0,M.jsxs)(`option`,{value:e.repo,children:[e.repo,` (`,e.flows,`)`]},e.repo))})]})}})]})]}),r&&(0,M.jsx)(Ib,{change:r,flow:a},r),!r&&t.state===`ready`&&t.data.repos.length>0&&(0,M.jsx)(Nb,{repo:i??t.data.repos[0].repo,flow:a,q:o,step:c},`${i}?${o}`)]})})}var K=E.questions;function zb(e){return e?[...e.restsOn.length?[K.restsOn(e.restsOn)]:[],`team`in e.owner?K.owner(e.owner.team,e.owner.name):`change`in e.owner?K.changeOwner(e.owner.change,e.owner.people):K.noOwner(e.owner.none),...e.joins?[K.joins(e.joins)]:[],...e.proposal?[K.proposal.listed]:[]]:[]}function Bb(e){let t=K.proposal,{question:n,proposal:r}=e,i=`proposal-${n.id}`;return(0,M.jsxs)(`section`,{"aria-labelledby":i,className:`stack`,style:{gap:6},children:[(0,M.jsx)(`h3`,{id:i,className:`hud`,style:{margin:0,fontSize:10},children:t.title}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:t.notYet(r.by)}),(0,M.jsx)(`p`,{style:{margin:0},children:(0,M.jsx)(`strong`,{children:r.answer.option===void 0?t.words(r.answer.text??``):t.option(r.answer.option,n.options[r.answer.option-1]?.label??``)})}),(0,M.jsx)(`p`,{style:{margin:0},children:r.why}),(0,M.jsx)(`h4`,{className:`hud`,style:{margin:0,fontSize:10},children:t.cites}),(0,M.jsx)(`ul`,{style:{margin:0},children:r.cites.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsxs)(`span`,{className:`mono`,children:[e.repo??n.repo,` `,e.file,`:`,e.line]}),` `,(0,M.jsx)(`q`,{children:e.quote})]},`${e.repo??n.repo}:${e.file}:${e.line}`))}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,alignItems:`center`,flexWrap:`wrap`},children:[(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:e.busy,onClick:e.onAccept,children:e.busy?t.accepting:t.accept}),(0,M.jsx)(`code`,{className:`mono`,children:t.command(n.id)}),(0,M.jsx)(Yt,{text:t.command(n.id),label:K.copy})]}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:t.orAnswer})]})}function Vb(e){let t=A(`/api/questions/${e.id}/targets`);return(0,M.jsx)(Hb,{...e,of:t})}function Hb(e){let t=K.another,n=e.of,r=`q-${e.id}-target`;if(n.state===`loading`)return(0,M.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`muted`,style:{margin:0},children:t.loading});if(n.state===`error`)return(0,M.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:t.failed(n.error)});let i=n.data.picks;if(!i.length)return(0,M.jsx)(`p`,{className:`state`,style:{margin:0},children:t.empty});let a=i.find(t=>t.id===e.form.target),o=!a&&e.form.target?e.form.target:``,s=(t,n)=>e.set({target:t?t.id:n??``,addSystem:void 0,needsSystem:t?t.adds?`internal`:void 0:n?.trim()?`vendor`:void 0}),c=(e,n)=>{let r=i.filter(t=>t.kind===e);return r.length?(0,M.jsx)(`optgroup`,{label:n,children:r.map(n=>(0,M.jsxs)(`option`,{value:n.id,children:[n.name,e===`repo`&&!n.read?` (${t.notRead})`:``,e===`system`&&n.boundary?` (${n.boundary})`:``,e===`team`&&n.adds?` (${t.noSystem})`:``]},n.id))}):null};return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:6,marginLeft:24},children:[(0,M.jsx)(`label`,{htmlFor:`${r}-pick`,className:`hud`,style:{fontSize:10},children:t.label}),(0,M.jsxs)(`select`,{id:`${r}-pick`,className:`field`,value:a?.id??``,onChange:e=>s(i.find(t=>t.id===e.target.value)),children:[(0,M.jsx)(`option`,{value:``,children:t.choose}),c(`repo`,t.repos),c(`system`,t.systems),c(`team`,t.teams)]}),(0,M.jsx)(`label`,{htmlFor:`${r}-new`,className:`hud`,style:{fontSize:10},children:t.newVendor}),(0,M.jsx)(`input`,{id:`${r}-new`,className:`field`,value:o,"aria-describedby":`${r}-new-d`,onChange:e=>s(void 0,e.target.value)}),(0,M.jsx)(`span`,{id:`${r}-new-d`,className:`muted`,style:{fontSize:12},children:t.newVendorHint}),e.form.needsSystem&&(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,alignItems:`flex-start`},children:[(0,M.jsx)(`input`,{type:`checkbox`,id:`${r}-add`,checked:!!e.form.addSystem,onChange:t=>e.set({addSystem:t.target.checked?e.form.needsSystem:void 0})}),(0,M.jsx)(`label`,{htmlFor:`${r}-add`,children:a?.adds?t.addTeam(a.id,a.adds.name):t.addVendor(e.form.target??``)})]})]})}var Ub=/^q-[0-9a-f]{12}$/;function Wb({e}){return(0,M.jsxs)(`figure`,{style:{margin:0},children:[(0,M.jsxs)(`figcaption`,{children:[(0,M.jsx)(`code`,{className:`mono`,children:e.ref}),!e.found&&(0,M.jsx)(`span`,{className:`muted`,style:{marginLeft:6,fontSize:12},children:K.notShown})]}),e.found&&(0,M.jsx)(`pre`,{className:`mono`,style:{margin:`4px 0 0`,fontSize:12,overflowX:`auto`},children:e.lines.map((t,n)=>{let r=e.start+n,i=r===e.line;return(0,M.jsxs)(`span`,{style:{display:`block`},"aria-current":i?`true`:void 0,children:[(0,M.jsx)(`span`,{className:`muted`,children:`${String(r).padStart(4)} `}),i?(0,M.jsx)(`mark`,{children:t}):t]},r)})})]})}function Gb({id:e,refs:t}){let n=A(`/api/questions/${e}/evidence`);return n.state===`ready`?(0,M.jsx)(`div`,{className:`stack`,style:{gap:8},children:n.data.excerpts.map(e=>(0,M.jsx)(Wb,{e},e.ref))}):(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:t.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsx)(`code`,{className:`mono`,children:e})},e))})}function Kb(e){let t=decodeURIComponent(e.replace(/^#\/?/,``).split(/[?]/)[0].split(`/`)[1]??``);return Ub.test(t)?t:void 0}var qb={"facts-targets":`Another repo…`,"facts-topics":`A topic owned by another team or vendor`},Jb=new Set([`facts-targets`,`scan-hosts`]);function Yb(e){if(e.pick===void 0)return{error:K.pickOne};if(e.another){if(!e.target?.trim())return{error:K.another.pickOne};if(e.needsSystem&&!e.addSystem)return{error:K.another.needAdd}}let t=e.another?{target:e.target.trim(),...e.addSystem?{addSystem:e.addSystem}:{}}:e.pick===`words`?e.text.trim()?{text:e.text.trim()}:void 0:{option:e.pick};if(!t)return{error:K.needWords};let n=e.match?.trim()?{match:e.match.trim()}:{};return e.scope===`repo-type`?e.repoType.trim()?{body:{...t,scope:`repo-type`,repoType:e.repoType.trim(),...n}}:{error:K.needType}:{body:{...t,scope:`repo`,...n}}}var Xb=e=>e.slice(0,10),Zb=e=>/[.!?]$/.test(e.trim())?e.trim():`${e.trim()}.`,Qb=e=>[...new Set(e.map(e=>e.repo))].sort((e,t)=>e.localeCompare(t)),$b=(e,t)=>e.filter(e=>(!t.repo||e.repo===t.repo)&&jg([e.question,e.id,e.repo],t.text)),ex=`questions-filter`;function tx(e,t){let n=[...e===`open`?[`state=open`]:[],...t===`mine`?[`mine=true`]:[]];return`/api/questions${n.length?`?${n.join(`&`)}`:``}`}function nx(e){let t=e.text??``,n=e.repo??``;return(0,M.jsx)(P,{of:e.of,empty:e=>e.questions.length===0&&e.problems.length===0&&!e.me,emptyText:e.mine?K.emptyMine:e.all?K.emptyAll:K.empty,children:r=>{let i=$b(r.questions,{text:t,repo:n}),a=!!t.trim()||!!n;return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[r.me&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:r.me.teams.length?K.mineTeams(r.me.teams.map(e=>e.name??e.id).join(`, `)):r.questions.length?K.mineChanges(r.me.handle):K.mineNone(r.me.handle)}),r.me&&r.me.teams.length>0&&r.questions.length===0&&(0,M.jsx)(`div`,{className:`state`,children:K.emptyMine}),r.problems.map(e=>(0,M.jsxs)(`p`,{className:`state error`,role:`alert`,style:{margin:0},children:[K.unreadable(e.file),` `,e.message]},e.file)),(0,M.jsx)(Fg,{shown:i.length,total:r.questions.length,active:a}),a&&i.length===0&&r.questions.length>0&&(0,M.jsx)(Ig,{what:Ng({text:t,repo:n}),onClear:()=>e.onClear?.(),focus:ex}),i.length>0&&(0,M.jsx)(`ul`,{className:`stack`,style:{listStyle:`none`,margin:0,padding:0,gap:6},children:i.map(t=>(0,M.jsx)(`li`,{children:(0,M.jsxs)(`a`,{href:`#/questions/${t.id}`,"aria-current":t.id===e.current?`true`:void 0,className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{children:t.question}),(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[t.repo,` · `,t.state,` · `,t.id]}),zb(r.about?.[t.id]).map(e=>(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:e},e))]})},t.id))})]})}})}function rx({result:e}){return(0,M.jsxs)(`div`,{role:`status`,className:`stack`,style:{gap:6},children:[(0,M.jsx)(`p`,{style:{margin:0},children:K.saved(`questions/${e.question.id}.yaml`)}),e.system?.added&&(0,M.jsx)(`p`,{style:{margin:0},children:K.another.added(e.system.id,e.system.profile)}),e.skill&&(0,M.jsx)(`p`,{style:{margin:0},children:e.skill.written?K.skillWritten(e.skill.path):K.skillMissing(e.skill.path)}),(0,M.jsx)(`p`,{style:{margin:0},children:K.next}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,alignItems:`center`,flexWrap:`wrap`},children:[(0,M.jsx)(`code`,{className:`mono`,children:e.rerun}),(0,M.jsx)(Yt,{text:e.rerun,label:K.copy})]})]})}function ix(e){let t=e.question,[n,r]=(0,v.useState)({pick:t.answer?.option??(t.answer?.text?`words`:void 0),text:t.answer?.text??``,scope:t.answer?.scope.level??t.scope.level,repoType:t.scope.level===`repo-type`?t.scope.id:``,match:t.answer?.match??``}),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(),u=e=>r(t=>({...t,...e})),d=async r=>{r.preventDefault();let i=Yb(n);if(`error`in i)s(i.error);else{a(!0),s(void 0);try{let n=await k(`/api/questions/${t.id}/answer`,{method:`POST`,body:i.body});l(n),e.onAnswered(n)}catch(e){s(Wt(e))}finally{a(!1)}}},f=async()=>{a(!0),s(void 0);try{let r=await k(`/api/questions/${t.id}/answer`,{method:`POST`,body:{acceptProposal:!0,scope:n.scope,...n.scope===`repo-type`&&n.repoType.trim()?{repoType:n.repoType.trim()}:{},...n.match?.trim()?{match:n.match.trim()}:{}}});l(r),e.onAnswered(r)}catch(e){s(Wt(e))}finally{a(!1)}},p=`q-${t.id}`;return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[(0,M.jsx)(`h2`,{className:`h`,style:{margin:0},children:t.question}),(0,M.jsxs)(`p`,{className:`hud`,style:{margin:0,fontSize:10},children:[K.askedBy(t.askedBy.command,Xb(t.askedBy.at)),` · `,t.repo]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h3`,{className:`hud`,style:{margin:`0 0 4px`,fontSize:10},children:K.evidence}),(0,M.jsx)(Gb,{id:t.id,refs:t.evidence})]}),t.answer&&(0,M.jsxs)(`p`,{style:{margin:0},children:[K.answered(t.answer.by,Xb(t.answer.at)),`:`,` `,t.answer.text??t.options[(t.answer.option??1)-1]?.label,t.answer.match?` · ${K.rule.answered(t.answer.match)}`:``]}),t.reopened&&(0,M.jsx)(`p`,{className:`state`,style:{margin:0},children:K.reopened(t.reopened.why,t.reopened.answer.text??t.options[(t.reopened.answer.option??1)-1]?.label??``,Xb(t.reopened.at))}),t.answer?.proposal&&(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:K.fromProposal(t.answer.proposal.by,Xb(t.answer.proposal.at))}),(0,M.jsx)(`ul`,{style:{margin:0},children:t.answer.proposal.cites.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsxs)(`span`,{className:`mono`,children:[e.repo??t.repo,` `,e.file,`:`,e.line]}),` `,(0,M.jsx)(`q`,{children:e.quote})]},`${e.repo??t.repo}:${e.file}:${e.line}`))})]}),t.state===`open`&&e.proposal&&!c&&(0,M.jsx)(Bb,{question:t,proposal:e.proposal,busy:i,onAccept:()=>void f()}),t.state===`retired`?(0,M.jsx)(`p`,{className:`state`,children:K.retired}):(0,M.jsxs)(`form`,{className:`stack`,style:{gap:10},onSubmit:e=>void d(e),noValidate:!0,children:[(0,M.jsxs)(`fieldset`,{className:`stack`,style:{gap:6,border:0,padding:0,margin:0},children:[(0,M.jsx)(`legend`,{className:`hud`,style:{fontSize:10,marginBottom:4},children:t.answer?K.change:K.options}),t.options.map((e,r)=>{let i=`${p}-o${r+1}`;return(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,alignItems:`flex-start`},children:[(0,M.jsx)(`input`,{type:`radio`,id:i,name:`${p}-pick`,checked:n.pick===r+1,onChange:()=>u({pick:r+1,another:qb[t.askedBy.step]===e.label}),"aria-describedby":`${i}-d`}),(0,M.jsxs)(`label`,{htmlFor:i,className:`stack`,style:{gap:2},children:[(0,M.jsxs)(`span`,{children:[r+1,`. `,e.label]}),(0,M.jsxs)(`span`,{id:`${i}-d`,className:`muted`,style:{fontSize:12},children:[Zb(e.means),` `,K.optionChanges,`: `,Zb(e.changes)]})]})]},i)}),n.another&&(0,M.jsx)(Vb,{id:t.id,form:n,set:u}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,alignItems:`flex-start`},children:[(0,M.jsx)(`input`,{type:`radio`,id:`${p}-words`,name:`${p}-pick`,checked:n.pick===`words`,onChange:()=>u({pick:`words`,another:!1})}),(0,M.jsx)(`label`,{htmlFor:`${p}-words`,children:K.ownWords})]}),n.pick===`words`&&(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`label`,{htmlFor:`${p}-text`,className:`hud`,style:{fontSize:10},children:K.ownWordsLabel}),(0,M.jsx)(`textarea`,{id:`${p}-text`,className:`field`,rows:3,value:n.text,onChange:e=>u({text:e.target.value})})]})]}),(0,M.jsxs)(`fieldset`,{className:`stack`,style:{gap:6,border:0,padding:0,margin:0},children:[(0,M.jsx)(`legend`,{className:`hud`,style:{fontSize:10,marginBottom:4},children:K.scope}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`input`,{type:`radio`,id:`${p}-repo`,name:`${p}-scope`,checked:n.scope===`repo`,onChange:()=>u({scope:`repo`})}),(0,M.jsxs)(`label`,{htmlFor:`${p}-repo`,children:[K.scopeRepo(t.repo),t.scope.level===`repo`?` (${K.proposed})`:``]})]}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`input`,{type:`radio`,id:`${p}-type`,name:`${p}-scope`,checked:n.scope===`repo-type`,onChange:()=>u({scope:`repo-type`})}),(0,M.jsx)(`label`,{htmlFor:`${p}-type`,children:t.scope.level===`repo-type`?`${K.scopeType(t.scope.id)} (${K.proposed})`:K.scopeTypeOther})]}),n.scope===`repo-type`&&t.scope.level!==`repo-type`&&(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`label`,{htmlFor:`${p}-type-id`,className:`hud`,style:{fontSize:10},children:K.typeLabel}),(0,M.jsx)(`input`,{id:`${p}-type-id`,className:`field`,value:n.repoType,onChange:e=>u({repoType:e.target.value})})]})]}),Jb.has(t.askedBy.step)&&(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`label`,{htmlFor:`${p}-match`,className:`hud`,style:{fontSize:10},children:K.rule.label}),(0,M.jsx)(`input`,{id:`${p}-match`,className:`field mono`,value:n.match??``,"aria-describedby":`${p}-match-d`,onChange:e=>u({match:e.target.value})}),(0,M.jsx)(`span`,{id:`${p}-match-d`,className:`muted`,style:{fontSize:12},children:K.rule.hint})]}),o&&(0,M.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:o}),(0,M.jsx)(`div`,{children:(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:i,children:i?K.saving:K.submit})})]}),c&&(0,M.jsx)(rx,{result:c})]})}function ax({id:e,onAnswered:t,proposal:n}){let r=A(`/api/questions/${e}`);ce(r);let i=(0,v.useRef)(null);return(0,v.useEffect)(()=>{r.state===`ready`&&i.current?.focus()},[r.state,e]),(0,M.jsx)(`div`,{ref:i,tabIndex:-1,children:(0,M.jsx)(P,{of:r,children:e=>(0,M.jsx)(ix,{question:e,onAnswered:t,...n?{proposal:n}:{}},e.id)})})}function ox({hash:e}){let[t,n]=(0,v.useState)(`open`),[r,i]=(0,v.useState)(`all`),a=A(tx(t,r));ce(a);let o=Kb(e),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(``),d=[...new Set([...a.state===`ready`?Qb(a.data.questions):[],...l?[l]:[]])].sort((e,t)=>e.localeCompare(t));return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,M.jsx)(`p`,{className:`n`,style:{margin:0,fontSize:24},children:K.title}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,M.jsx)(Pg,{id:ex,value:s,onChange:c}),(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`label`,{htmlFor:`questions-repo`,className:`hud`,style:{fontSize:10},children:E.filter.repo}),(0,M.jsxs)(`select`,{id:`questions-repo`,className:`field`,value:l,onChange:e=>u(e.target.value),children:[(0,M.jsx)(`option`,{value:``,children:E.filter.allRepos}),d.map(e=>(0,M.jsx)(`option`,{value:e,children:e},e))]})]}),(0,M.jsx)(Zt,{label:K.whose,value:r,options:[{value:`all`,label:K.whoseAll},{value:`mine`,label:K.whoseMine}],onChange:i}),(0,M.jsx)(Zt,{label:K.filter,value:t,options:[{value:`open`,label:K.filterOpen},{value:`all`,label:K.filterAll}],onChange:n})]})]}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:`4px 0 12px`,fontSize:12.5,lineHeight:1.55},children:K.intro}),(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:K.listTitle,span:`span 5`,children:(0,M.jsx)(nx,{of:a,current:o,all:t===`all`,mine:r===`mine`,text:s,repo:l,onClear:()=>{c(``),u(``)}})}),(0,M.jsx)(`section`,{className:`panel`,style:{gridColumn:`span 7`},children:o?(0,M.jsx)(ax,{id:o,onAnswered:a.reload,...a.state===`ready`&&a.data.about?.[o]?.proposal?{proposal:a.data.about[o].proposal}:{}}):(0,M.jsx)(`div`,{className:`state`,children:K.pickFromList})})]})]})}var q=E.design,sx=e=>e.kind===`Endpoint`?`${String(e.method??``)} ${String(e.normalizedPath??e.path??e.id)}`.trim():e.kind===`Interface`?`${String(e.from??`?`)} → ${String(e.to??`?`)}${e.via?` · ${String(e.via)}`:``}`:e.name??e.id;function cx({kind:e,title:t,pick:n,picked:r}){let i=A(`/api/catalog/${e}?limit=200`);return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsxs)(`div`,{className:`row between`,children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:t}),(0,M.jsx)(`span`,{className:`n`,style:{fontSize:14},children:i.state===`ready`?i.data.total:``})]}),(0,M.jsx)(P,{of:i,empty:e=>e.items.length===0,emptyText:q.noInTheCatalog(t.toLowerCase()),children:e=>(0,M.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:e.items.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsxs)(`button`,{type:`button`,"aria-pressed":r===e.id,onClick:()=>n(e),className:`list-row`,style:{width:`100%`,background:r===e.id?`var(--picked)`:`transparent`,border:0,color:`inherit`,font:`inherit`,textAlign:`left`,cursor:`pointer`,padding:`6px`,borderRadius:6},children:[(0,M.jsx)(`span`,{className:`mono`,style:{fontSize:11.5,wordBreak:`break-all`},children:sx(e)}),(0,M.jsx)(`span`,{className:`chip ${e.confidence===`verified`?`done`:`warn`}`,children:(e.confidence??`unknown`).toUpperCase()})]})},e.id))})})]})}function lx({evidence:e}){let t=Uh(),n=$m(e).join(` `);return(0,v.useEffect)(()=>{for(let e of n.split(` `).filter(Boolean))t?.need(e)},[n,t]),(0,M.jsx)(Kh,{gaps:Qm(e,e=>{let n=t?.of(e);return n?.state===`ready`?n.data:void 0},{bare:!0})})}function ux({r:e}){let t=A(`/api/catalog/GatewayRoute?limit=500`),n=e=>`${e.repo??``}|${e.path??``}:${e.line??``}`,r=(e.evidence??[]).filter(e=>e.side===`gateway`&&e.path).map(n),i=e=>r.length?e.flatMap(e=>{let t=(e.evidence??[])[0],i=t?.path?r.indexOf(n(t)):-1;return i<0?[]:[{x:e,n:i}]}).sort((e,t)=>e.n-t.n||(e.x.id<t.x.id?-1:1)).map(e=>e.x):[];return(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`hud`,style:{fontSize:10,marginBottom:6},children:q.thePathOfTheCall}),(0,M.jsx)(P,{of:t,empty:e=>i(e.items).length===0,emptyText:q.noRouteRecordedFor,children:t=>(0,M.jsxs)(`ol`,{className:`stack`,style:{gap:4,margin:0,paddingLeft:18,fontSize:12.5},children:[i(t.items).map((t,n)=>{let r=t.scopes??[],i=t.policies??[];return(0,M.jsxs)(`li`,{children:[(0,M.jsxs)(`span`,{className:`mono`,children:[String(t.proxy??t.id),` `,String(t.basepath??``)]}),` `,(0,M.jsx)(`span`,{className:`chip ${r.length?`done`:`blocking`}`,children:r.length?q.scopesIt(r.join(`, `)):q.noScopeDemanded}),` `,(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:n===0&&e.auth?q.theCallerMeets(String(e.auth)):i.join(`, `)||q.thenReaches(String(t.target??``))})]},t.id)}),(0,M.jsx)(`li`,{children:(0,M.jsxs)(`span`,{className:`mono`,children:[String(e.to??``),` `,String(e.method??``),` `,String(e.normalizedPath??``)]})})]})})]})}function dx({r:e}){let t=A(`/api/catalog/${e.kind}/${encodeURIComponent(e.id)}`),n=A(`/api/impact/${encodeURIComponent(e.id)}?depth=2`);return(0,M.jsx)(N,{title:sx(e),span:`span 5`,rows:`span 2`,meta:e.kind,children:(0,M.jsx)(P,{of:t,children:t=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`hud`,style:{fontSize:10,marginBottom:6},children:q.evidence}),(0,M.jsx)(lx,{evidence:t.evidence??[]}),(t.evidence??[]).length===0?(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:q.noEvidenceTreatIt}):(t.evidence??[]).map((e,t)=>(0,M.jsxs)(`div`,{style:{fontSize:12.5,marginBottom:4},children:[(0,M.jsx)(`span`,{className:`chip ${e.source===`code`?``:`warn`}`,children:e.source.toUpperCase()}),` `,e.path&&e.line?(0,M.jsxs)(M.Fragment,{children:[e.repo&&(0,M.jsxs)(`span`,{className:`mono`,children:[e.repo,` · `]}),(0,M.jsx)(Yh,{repo:e.repo,at:`${e.path}:${e.line}`})]}):(0,M.jsxs)(`span`,{className:`mono`,children:[e.repo?`${e.repo} · `:``,e.path??``]})]},t))]}),t.kind===`Interface`&&t.via===`gateway`?(0,M.jsx)(ux,{r:t}):null,(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`hud`,style:{fontSize:10,marginBottom:6},children:q.consumersAndDependants}),(0,M.jsx)(P,{of:n,empty:e=>e.affected.length===0,emptyText:q.nothingInTheCatalog,children:t=>(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[t.affected.filter(e=>e.kind===`Component`).map(e=>(0,M.jsx)(`span`,{className:`chip dim`,children:e.id},e.id)),(0,M.jsx)(`a`,{href:`#/impact?q=${encodeURIComponent(e.id)}`,children:q.seeImpact})]})})]}),(0,M.jsxs)(`details`,{children:[(0,M.jsx)(`summary`,{className:`hud`,style:{fontSize:10,cursor:`pointer`},children:q.record}),(0,M.jsx)(`pre`,{className:`mono`,style:{fontSize:11,whiteSpace:`pre-wrap`,color:`var(--text-2)`},children:JSON.stringify(Object.fromEntries(Object.entries(t).filter(([e])=>e!==`evidence`)),null,2)})]})]})})})}function fx(){let e=A(`/api/catalog/kinds`),t=A(`/api/catalog/Interface?limit=500`),[n,r]=(0,v.useState)(),i=A(`/api/catalog/Endpoint?limit=1`),a=n??(i.state===`ready`?i.data.items[0]:void 0),o=t=>e.state===`ready`?e.data.find(e=>e.kind===t)?.count??0:0,s=t.state===`ready`?t.data.items.filter(e=>e.confidence===`verified`).length:0,c=t.state===`ready`?t.data.items.length:0;return(0,M.jsx)(Wh,{children:(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:q.contracts,span:`span 4`,rows:`span 2`,children:(0,M.jsxs)(`div`,{className:`stack`,tabIndex:0,role:`region`,"aria-label":q.contractsList,style:{gap:14,maxHeight:640,overflowY:`auto`},children:[(0,M.jsx)(cx,{kind:`Endpoint`,title:q.apis,pick:r,...a?{picked:a.id}:{}}),(0,M.jsx)(cx,{kind:`Interface`,title:q.interfacesAndEvents,pick:r,...a?{picked:a.id}:{}}),(0,M.jsx)(cx,{kind:`Table`,title:q.dataStores,pick:r,...a?{picked:a.id}:{}}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:11.5},children:q.dataStoresComeFrom})]})}),a?(0,M.jsx)(dx,{r:a},`${a.kind}/${a.id}`):(0,M.jsx)(N,{title:q.pickAContract,span:`span 5`,rows:`span 2`,children:(0,M.jsx)(`div`,{className:`state`,children:q.chooseAnApiAn})}),(0,M.jsx)(N,{title:q.contractMix,span:`span 3`,kind:`dark`,children:(0,M.jsx)(P,{of:e,children:()=>(0,M.jsx)(F,{title:q.contractsByKind,parts:[{label:`APIs`,value:o(`Endpoint`),color:`var(--accent)`},{label:q.interfaces,value:o(`Interface`),color:`var(--violet)`},{label:q.tables,value:o(`Table`),color:`var(--amber)`}]})})}),(0,M.jsx)(N,{title:q.verifiedFromCode,span:`span 3`,children:(0,M.jsx)(P,{of:t,children:()=>(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(he,{value:s,max:Math.max(c,1),size:64,label:q.ofInterfacesVerifiedFrom(s,c)}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:11.5},children:q.aVendorSpecIs}),(0,M.jsx)(`a`,{href:`#/mappings`,children:q.fieldMappings})]})})})]})})}var px=/^inputs\/diagrams\/.+\.(drawio|drawio\.xml|vsdx|mmd|mermaid|csv)$/i;function mx(e){return e===`error`?!0:e?e.documents.some(e=>px.test(e.path)):void 0}function hx(){let e=A(`/api/knowledge/documents`),t=mx(e.state===`ready`?e.data:e.state===`error`?`error`:void 0);return{r:A(t?`/api/view/reconcile`:void 0),none:t===!1}}var gx=e=>/No diagrams to reconcile/.test(e);function _x({hash:e}){let{r:t,none:n}=hx(),r=ye(e,`file`),[i,a]=(0,v.useState)(`all`);if(j(e=>{e.type===`job.done`&&t.reload()}),n||t.state===`error`&&gx(t.error))return(0,M.jsx)(`div`,{className:`bento`,children:(0,M.jsx)(N,{title:q.reconcileADiagramAgainst,span:`1 / -1`,children:(0,M.jsxs)(`div`,{className:`state`,children:[q.noDiagramsYetPut,(0,M.jsx)(`span`,{className:`mono`,children:q.inputsDiagrams}),` `,q.orAddThemOn,(0,M.jsx)(`a`,{href:`#/intake`,children:q.intake}),q.thenComeBack]})})});let o=t.state===`ready`?t.data.data.diagrams:[],s=o.find(e=>e.file===r)??o[0],c=s?[...new Set(s.items.map(e=>e.type))]:[],l=s?s.items.filter(e=>i===`all`||e.type===i):[];return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:q.diagrams,span:`span 4`,children:(0,M.jsx)(P,{of:t,empty:()=>o.length===0,emptyText:q.noDiagramsCouldBe,children:()=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[o.map(e=>(0,M.jsxs)(`a`,{href:`#/reconcile?file=${encodeURIComponent(e.file)}`,"aria-current":e===s?`page`:void 0,className:`list-row`,style:{textDecoration:`none`,padding:6,borderRadius:6,background:e===s?`var(--picked)`:void 0},children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`mono`,style:{fontSize:11.5},children:e.file.replace(/^inputs\/diagrams\//,``)}),(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:q.edgesMatchCode(e.matches.length,e.edges)})]}),(0,M.jsx)(`span`,{className:`chip ${e.items.length?`warn`:`done`}`,children:e.items.length?q.toResolve(e.items.length):q.inSync})]},e.file)),(0,M.jsx)(me,{of:t,label:q.checkAgain}),s&&(0,M.jsxs)(`div`,{className:`stack`,style:{gap:12,marginTop:10},children:[(0,M.jsxs)(`div`,{className:`row`,children:[(0,M.jsx)(he,{value:s.matches.length,max:Math.max(s.edges,1),size:72,label:q.ofDrawnEdgesAgree(s.matches.length,s.edges)}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12.5},children:q.drawnEdgesAgreeWith})]}),(0,M.jsx)(F,{title:q.itemsToResolveBy,parts:c.map((e,t)=>({label:e,value:s.items.filter(t=>t.type===e).length,color:[`var(--magenta)`,`var(--amber)`,`var(--accent)`,`var(--violet)`,`var(--green)`,`var(--accent-pale)`][t%6]}))}),s.names.length>0&&(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:q.labelsMatchedToThe(s.names.filter(e=>e.id).length,s.names.length)})]})]})})}),(0,M.jsx)(N,{title:s?q.edgeByEdge(s.file.split(`/`).pop()??``):q.edgeByEdge2,span:`span 8`,meta:s?(0,M.jsx)(ge,{value:s.matches.length,max:Math.max(s.edges,1),label:q.ofEdgesAgreeWith(s.matches.length,s.edges)}):void 0,children:s?(0,M.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,M.jsx)(`div`,{className:`row`,role:`group`,"aria-label":q.filterItems,style:{flexWrap:`wrap`,gap:6},children:[`all`,...c].map(e=>(0,M.jsx)(`button`,{type:`button`,className:`btn ${i===e?`primary`:``}`,"aria-pressed":i===e,onClick:()=>a(e),children:e===`all`?q.all(s.items.length):`${e} ${s.items.filter(t=>t.type===e).length}`},e))}),l.length===0?(0,M.jsx)(`div`,{className:`state`,children:q.everyDrawnEdgeAgrees}):(0,M.jsx)(ke,{caption:q.itemsToResolve,rows:l,rowKey:e=>e.id,cols:[{label:q.result,cell:e=>(0,M.jsx)(`span`,{className:`chip ${/mismatch|conflict|unknown/.test(e.type)?`blocking`:`warn`}`,children:e.type}),width:`150px`},{label:q.what,cell:e=>e.summary},{label:q.next,cell:e=>e.suggestion?.text??``}]}),(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:11.5},children:[q.codeWinsOverA,(0,M.jsx)(`a`,{href:`#/intake`,children:q.triage}),` `,q.untilAPersonDecides]})]}):(0,M.jsx)(`div`,{className:`state`,children:q.pickADiagram})}),s&&s.names.some(e=>!e.id||e.how!==`exact`)&&(0,M.jsxs)(N,{title:q.nameMatching,span:`1 / -1`,children:[(0,M.jsx)(ke,{caption:q.diagramLabels,rows:s.names.filter(e=>!e.id||e.how!==`exact`),rowKey:e=>e.name,cols:[{label:q.diagramLabel,cell:e=>e.name},{label:q.matched,cell:e=>e.id?(0,M.jsx)(`span`,{className:`mono`,children:e.id}):(0,M.jsx)(`span`,{className:`chip warn`,children:q.noMatch})},{label:q.how,cell:e=>e.how??``},{label:q.similar,cell:e=>e.similar.slice(0,3).join(`, `),mono:!0}]}),(0,M.jsxs)(`p`,{className:`muted`,style:{margin:`8px 0 0`,fontSize:12},children:[q.confirmANameWith,(0,M.jsx)(`span`,{className:`mono`,children:q.atticusAliasLabelId}),q.itIsSavedTo]})]})]})}var vx=[{id:`context`,label:q.context,focus:!1},{id:`data`,label:q.data,focus:!1},{id:`event`,label:q.events,focus:!1},{id:`container`,label:q.container,focus:!0},{id:`sequence`,label:q.sequence,focus:!0}];function yx({hash:e}){let t=ye(e,`view`)??`context`,n=vx.find(e=>e.id===t)??vx[0],r=ve(`coverage`),i=r.state===`ready`?r.data.systems.map(e=>e.system):[],[a,o]=(0,v.useState)(),s=a??i[0],c=A(n.focus&&!s?void 0:`/api/diagram/${n.id}${n.focus&&s?`?focus=${encodeURIComponent(s)}`:``}`),l=n.id!==`sequence`,u=A(!l||n.focus&&!s?void 0:`/api/diagram/${n.id}/graph${n.focus&&s?`?focus=${encodeURIComponent(s)}`:``}`),d=A(l?void 0:s?`/api/graph?focus=${encodeURIComponent(s)}&depth=1`:`/api/graph`),[f,p]=(0,v.useState)(!1);return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:q.generatedViews,span:`1 / -1`,children:(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[(0,M.jsx)(`div`,{role:`tablist`,"aria-label":q.view,className:`row`,style:{gap:6},children:vx.map(e=>(0,M.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":e.id===n.id,className:`btn ${e.id===n.id?`primary`:``}`,onClick:()=>be(`diagrams`,`view`,e.id),children:e.label},e.id))}),n.focus&&(0,M.jsxs)(`label`,{className:`row`,style:{gap:6},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:q.system}),(0,M.jsx)(`select`,{value:s??``,onChange:e=>o(e.target.value),style:{height:32,background:`var(--box)`,color:`var(--text)`,border:`1px solid var(--line-2)`,borderRadius:7,padding:`0 8px`,font:`inherit`},children:i.map(e=>(0,M.jsx)(`option`,{children:e},e))})]}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:q.drawnFromTheCatalog})]})}),(0,M.jsx)(N,{title:q.view2(n.label),kind:`hero`,span:`1 / -1`,children:l?(0,M.jsx)(P,{of:u,empty:e=>e.view.nodes.length===0,emptyText:q.nothingToDrawThe(n.label.toLowerCase()),children:e=>(0,M.jsx)(gt,{view:e.view,height:460})}):(0,M.jsx)(P,{of:d,empty:e=>e.nodes.length===0,emptyText:q.theCatalogIsEmpty,children:e=>(0,M.jsx)(St,{g:e,...n.focus&&s?{focus:s}:{},height:460})})}),(0,M.jsx)(N,{title:q.mermaid,span:`1 / -1`,meta:c.state===`ready`?(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>{navigator.clipboard?.writeText(c.data.text).then(()=>p(!0))},children:f?q.copied:q.copy}):void 0,children:(0,M.jsx)(P,{of:c,empty:e=>!e.text.trim(),emptyText:q.nothingToDrawFor,children:e=>(0,M.jsx)(`pre`,{className:`mono`,tabIndex:0,"aria-label":q.mermaidSource,style:{margin:0,fontSize:11.5,lineHeight:1.55,whiteSpace:`pre-wrap`,maxHeight:460,overflowY:`auto`,color:`var(--text-2)`},children:e.text})})}),(0,M.jsx)(N,{title:q.diagramsInTheMetarepo,span:`span 7`,children:(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:[q.diagramsUnder,(0,M.jsx)(`span`,{className:`mono`,children:q.inputsDiagrams}),` `,q.areComparedWithThe,(0,M.jsx)(`a`,{href:`#/reconcile`,children:q.reconcile}),`.`]})}),(0,M.jsx)(N,{title:q.catalogShapeLibrary,span:`span 5`,children:(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:[q.writeTheDrawIo,(0,M.jsx)(`span`,{className:`mono`,children:q.atticusDiagramLibraryFile}),` `,q.andLoadItIn]})})]})}var bx={done:`var(--green)`,open:`var(--accent)`,"at-risk":`var(--amber)`,slipped:`var(--magenta)`};function xx({s:e}){let t=e=>Date.parse(`${e}T00:00:00Z`)/864e5,n=e.items;if(n.length===0)return(0,M.jsx)(`div`,{className:`state`,children:q.nothingPlannedYet});let r=Math.min(t(e.today),...n.map(e=>t(e.start))),i=Math.max(...n.map(e=>Math.max(t(e.due),t(e.projectedFinish))),r+1),a=e=>230+(t(e)-r)/(i-r)*520,o=n.length*26+30;return(0,M.jsxs)(`svg`,{role:`img`,"aria-label":q.timelineOfPlanItems(n.length,n[0].start,e.today),viewBox:`0 0 760 ${o}`,style:{width:`100%`,display:`block`},children:[n.map((e,t)=>{let n=10+t*26,r=bx[e.status]??`var(--accent)`;return(0,M.jsxs)(`g`,{children:[(0,M.jsx)(`text`,{x:0,y:n+13,fill:e.critical?`var(--text)`:`var(--muted-2)`,fontSize:11,fontFamily:`IBM Plex Sans, sans-serif`,children:e.what.length>34?`${e.what.slice(0,33)}…`:e.what}),(0,M.jsx)(`rect`,{x:a(e.start),y:n+3,width:Math.max(a(e.projectedFinish)-a(e.start),3),height:12,rx:3,fill:r,opacity:.75,style:{filter:`drop-shadow(0 0 var(--glow-size) ${r})`}}),(0,M.jsx)(`line`,{x1:a(e.due),x2:a(e.due),y1:n,y2:n+18,stroke:`var(--text)`,strokeWidth:1.5})]},e.key)}),(0,M.jsx)(`line`,{x1:a(e.today),x2:a(e.today),y1:0,y2:o-16,stroke:`var(--magenta)`,strokeDasharray:`3 3`}),(0,M.jsx)(`text`,{x:a(e.today)+4,y:o-4,fill:`var(--magenta-text)`,fontSize:10,fontFamily:`JetBrains Mono, monospace`,children:q.today(e.today)}),e.targetRelease&&(0,M.jsx)(`text`,{x:750,y:o-4,textAnchor:`end`,fill:`var(--muted-2)`,fontSize:10,fontFamily:`JetBrains Mono, monospace`,children:q.target(e.targetRelease)})]})}var Sx={"on-track":`done`,done:`done`,"at-risk":`warn`,slipped:`blocking`,open:`dim`,"not-planned":`dim`};function Cx({hash:e}){let t=A(`/api/initiatives`),n=ye(e,`id`),r=t.state===`ready`?t.data.find(e=>e.initiative===n)??t.data[0]:void 0;return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsxs)(N,{title:q.initiatives,span:`span 4`,children:[(0,M.jsx)(P,{of:t,empty:e=>e.length===0,emptyText:q.noInitiativesYet,children:e=>(0,M.jsx)(`div`,{className:`stack`,style:{gap:6},children:e.map(e=>(0,M.jsxs)(`a`,{href:`#/initiatives?id=${encodeURIComponent(e.initiative)}`,"aria-current":e===r?`page`:void 0,className:`stack`,style:{gap:4,textDecoration:`none`,color:`inherit`,padding:8,borderRadius:8,border:`1px solid var(--line)`,background:e===r?`var(--picked-faint)`:void 0},children:[(0,M.jsxs)(`span`,{className:`row between`,children:[(0,M.jsx)(`span`,{style:{fontWeight:600},children:e.title}),(0,M.jsx)(`span`,{className:`chip ${Sx[e.status]??``}`,children:e.status.toUpperCase()})]}),(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:q.changesParties(e.journey,e.changes.length,new Set(e.commitments.map(e=>e.party)).size)})]},e.initiative))})}),(0,M.jsxs)(`p`,{className:`muted`,style:{margin:`10px 0 0`,fontSize:12},children:[q.startOneFromA,(0,M.jsx)(`span`,{className:`mono`,children:q.atticusInitiativeNewTitle}),`.`]})]}),r?(0,M.jsxs)(`div`,{className:`column`,style:{gridColumn:`span 8`},children:[(0,M.jsx)(N,{title:r.title,kind:`hero`,span:`span 8`,meta:r.targetRelease?q.target2(r.targetRelease,r.projectedRelease?q.forecast(r.projectedRelease):``):void 0,children:(0,M.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[r.criticalPath.length>0&&(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:q.criticalPath}),r.criticalPath.map((e,t)=>(0,M.jsxs)(`span`,{className:`row`,style:{gap:6},children:[t>0&&(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,M.jsx)(`span`,{className:`chip`,children:e})]},e))]}),(0,M.jsx)(ke,{caption:q.planItems,rows:r.items,rowKey:e=>e.key,cols:[{label:q.item,cell:e=>(0,M.jsx)(`span`,{className:e.critical?``:`muted`,children:e.what})},{label:q.party,cell:e=>e.party??``},{label:q.due,cell:e=>e.due,mono:!0},{label:q.forecast2,cell:e=>e.projectedFinish,mono:!0},{label:q.status,cell:e=>(0,M.jsx)(`span`,{className:`chip ${Sx[e.status]??``}`,title:e.why,children:e.status.toUpperCase()})}]})]})}),(0,M.jsx)(N,{title:q.timeline,span:`span 8`,kind:`dark`,children:(0,M.jsx)(xx,{s:r})}),(0,M.jsxs)(N,{title:q.whoOwesWhat,span:`span 8`,children:[r.commitments.length===0?(0,M.jsx)(`div`,{className:`state`,children:q.noCommitmentsYet}):(0,M.jsx)(ke,{caption:q.commitments,rows:r.commitments,rowKey:e=>e.id,cols:[{label:q.party,cell:e=>e.party},{label:q.commitment,cell:e=>e.what},{label:q.neededBy,cell:e=>e.neededBy,mono:!0},{label:q.status,cell:e=>(0,M.jsx)(`span`,{className:`chip ${Sx[e.status]??``}`,title:e.why,children:e.status.toUpperCase()})}]}),r.notes.map((e,t)=>(0,M.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`,fontSize:12},children:e},t))]})]}):null]})}var J=E.phase,wx={blocking:`blocking`,gap:`warn`,risk:`warn`,idea:`dim`};function Tx(e){let t=A(`/api/changes/${e.id}`),n=A(`/api/changes/${e.id}/status`),r=De(),i=Og(),a=()=>{t.reload(),n.reload(),e.reload()},o=(0,M.jsx)(N,{title:e.title,kind:`hero`,meta:e.picker,children:(0,M.jsx)(P,{of:t,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:14},children:[(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`span`,{style:{fontSize:18,fontWeight:600},children:e.title}),(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[e.id,` · `,e.type,e.handoff?J.handOff(e.handoff.phase,e.handoff.state):``]})]}),(0,M.jsx)(fv,{state:e.state})]})})}),s=(0,M.jsx)(N,{title:J.gate,kind:`dark`,children:(0,M.jsx)(P,{of:n,children:t=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,M.jsx)(`p`,{style:{margin:0,lineHeight:1.5},children:t.nextStep}),t.blockers.length>0&&(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18,fontSize:12.5,color:`var(--magenta-text)`},children:t.blockers.map((e,t)=>(0,M.jsx)(`li`,{children:e.message},t))}),t.handoff?(0,M.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[J.approvalMerge,(0,M.jsx)(pe,{href:t.handoff.pr.url,children:J.pr(t.handoff.pr.number)}),` `,J.onTheGitHost]}):(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:J.approvalRaiseTheHand}),(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[e.critic&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:r.busy,onClick:()=>void r.run(()=>k(`/api/changes/${e.id}/critic`,{method:`POST`,body:{}}).then(a),i?J.theRuleChecksRan:J.theRuleChecksRan2),children:i?J.runTheCritic:J.runTheRuleChecks}),(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:r.busy,onClick:()=>void r.run(()=>k(`/api/changes/${e.id}/handoff`,{method:`POST`,body:{}}).then(a),J.handOffPrRaised),children:J.raiseHandOff}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:r.busy,onClick:()=>void r.run(()=>k(`/api/changes/${e.id}/sync`,{method:`POST`,body:{}}).then(a),J.syncedWithTheHand),children:J.syncAndMergeWhen})]}),(0,M.jsx)(Oe,{note:r.note})]})})});return e.part===`hero`?o:s}function Ex(e,t){return e===`error`?!0:e?e.artifacts.some(e=>e.artifact===t):void 0}function Dx({change:e,artifact:t,listed:n,span:r}){let i=A(n?`/api/changes/${e}/artifacts/${t}`:void 0),[a,o]=(0,v.useState)(!1),s=(0,v.useRef)(null),c=(0,v.useRef)(!1);if((0,v.useEffect)(()=>{!a&&c.current&&s.current?.focus(),c.current=a},[a]),a)return(0,M.jsx)(pv,{change:e,artifact:t,onClose:()=>{o(!1),i.reload()}});let l=t[0].toUpperCase()+t.slice(1);if(n===!1)return(0,M.jsx)(N,{title:l,span:r,children:(0,M.jsx)(`div`,{className:`state`,children:J.noSuchArtifact(t)})});let u=i.state===`error`;return(0,M.jsx)(N,{title:l,span:r,meta:u?void 0:(0,M.jsx)(`button`,{ref:s,type:`button`,className:`btn`,onClick:()=>o(!0),children:J.edit}),children:u?(0,M.jsx)(`div`,{className:`state`,children:J.notWrittenYetFor}):(0,M.jsx)(P,{of:i,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,M.jsx)(`span`,{className:`mono muted`,style:{fontSize:11},children:e.path}),(0,M.jsx)(`div`,{tabIndex:0,role:`region`,"aria-label":J.text(t),style:{maxHeight:520,overflowY:`auto`,paddingRight:6},children:(0,M.jsx)(Te,{text:e.content})})]})})})}function Ox({change:e,artifacts:t,span:n,rows:r,tick:i=0}){let a=A(`/api/findings?change=${e}&state=open`),[o,s]=(0,v.useState)();j(e=>{(e.type===`file.changed`||e.type===`run.changed`)&&a.reload()}),(0,v.useEffect)(()=>{i&&a.reload()},[i]);let c=a.state===`ready`?a.data.filter(e=>t.some(t=>e.artifact.startsWith(t))):[];return(0,M.jsx)(N,{title:J.criticFindings,span:n,...r?{rows:r}:{},meta:a.state===`ready`?J.open(c.length):void 0,children:(0,M.jsx)(P,{of:a,empty:()=>c.length===0,emptyText:J.noOpenFindingsOn,children:()=>(0,M.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},className:`stack`,children:c.map(t=>(0,M.jsxs)(`li`,{style:{borderBottom:`1px solid var(--rule)`,paddingBottom:8},children:[(0,M.jsxs)(`button`,{type:`button`,"aria-expanded":o===t.id,onClick:()=>s(o===t.id?void 0:t.id),style:{all:`unset`,cursor:`pointer`,display:`flex`,flexDirection:`column`,gap:4,width:`100%`},children:[(0,M.jsxs)(`span`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,M.jsx)(`span`,{className:`chip ${wx[t.severity]??``}`,children:t.severity.toUpperCase()}),t.lens&&(0,M.jsx)(`span`,{className:`chip ai`,children:t.lens}),(0,M.jsx)(`span`,{className:`mono muted`,style:{fontSize:10.5},children:t.artifact})]}),(0,M.jsx)(`span`,{style:{fontSize:13},children:t.summary})]}),o===t.id&&(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8,marginTop:8},children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:t.why}),t.question&&(0,M.jsx)(`p`,{style:{margin:0,fontSize:12.5},children:J.question(t.question.owner?J.for(t.question.owner):``,t.question.text)}),(0,M.jsx)(gv,{change:e,f:t,done:()=>a.reload()})]})]},t.id))})})})}function kx(){return(0,M.jsx)(`div`,{className:`bento`,children:(0,M.jsx)(t_,{})})}function Ax(e){let t=xe(e.hash,e.screen),[n,r]=(0,v.useState)(0),i=A(t.id?`/api/changes/${t.id}`:void 0),a=i.state===`ready`?i.data:i.state===`error`?`error`:void 0;if(t.none)return(0,M.jsx)(kx,{});if(!t.id)return(0,M.jsx)(Se,{list:t.list,title:e.title});let o={id:t.id,title:e.title,picker:t.picker,...e.critic?{critic:e.critic}:{},reload:()=>r(n+1)};return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsxs)(`div`,{className:`column`,style:{gridColumn:`span 8`},children:[(0,M.jsx)(Tx,{part:`hero`,...o}),e.main?.(t.id),e.artifacts.map(e=>(0,M.jsx)(Dx,{change:t.id,artifact:e,listed:Ex(a,e)},e))]}),(0,M.jsxs)(`div`,{className:`column`,style:{gridColumn:`span 4`},children:[(0,M.jsx)(Tx,{part:`gate`,...o}),(0,M.jsx)(Ox,{change:t.id,artifacts:e.artifacts,tick:n}),e.extra?.(t.id)]})]},t.id)}function jx({hash:e}){return(0,M.jsx)(Ax,{hash:e,screen:`brief`,title:J.featureBrief,artifacts:[`brief`,`proposal`],critic:`business-critic`})}function Mx({hash:e}){return(0,M.jsx)(Ax,{hash:e,screen:`ux`,title:J.prototypesAndUx,artifacts:[`ux`],critic:`ux-critic`,extra:()=>(0,M.jsx)(N,{title:J.bringInAPrototype,span:`span 4`,children:(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5,lineHeight:1.6},children:[J.dropADesignExport,(0,M.jsx)(`span`,{className:`mono`,children:J.inputs}),` `,J.fromThe,(0,M.jsx)(`a`,{href:`#/intake`,children:J.intake}),` `,J.screenAtticusReadsThe]})})})}function Nx({change:e}){let t=ve(`drift`,e);return(0,M.jsx)(N,{title:J.designVsPlansVs,span:`span 4`,children:(0,M.jsx)(P,{of:t,children:e=>{let t=e.findings.filter(e=>e.state===`open`);return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:e.plans.length?J.repoPlansCompared(e.plans.length):J.noRepoPlansYet}),t.length===0?(0,M.jsx)(`span`,{className:`chip done`,style:{width:`fit-content`},children:J.inSync}):(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18,lineHeight:1.6,fontSize:12.5},children:t.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{className:`chip ${wx[e.severity]??``}`,children:e.severity.toUpperCase()}),` `,e.summary]},e.id))})]})}})})}function Px({hash:e}){let t=A(`/api/orgpack`);return(0,M.jsx)(Ax,{hash:e,screen:`arch-review`,title:J.architectureReview,artifacts:[`design`,`interfaces`],critic:`architecture-critic`,extra:e=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Nx,{change:e}),(0,M.jsx)(N,{title:J.integrationPatterns,span:`span 4`,meta:(0,M.jsx)(`a`,{href:`#/orgpack`,children:J.orgPack}),children:(0,M.jsx)(P,{of:t,empty:e=>!e.patterns?.length,emptyText:J.theOrgPackHas,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[e.patterns.map(e=>(0,M.jsxs)(`div`,{className:`list-row`,children:[(0,M.jsx)(`span`,{className:`chip`,children:e.code}),(0,M.jsx)(`span`,{style:{fontSize:12.5},children:e.name})]},e.code)),(0,M.jsx)(`p`,{className:`muted`,style:{margin:`6px 0 0`,fontSize:11.5},children:J.everyHopInDesign})]})})}),(0,M.jsx)(N,{title:J.yourMaterial,span:`span 4`,children:(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5,lineHeight:1.6},children:[J.vendorSpecsWhiteboardPhotos,(0,M.jsx)(`a`,{href:`#/intake`,children:J.intake}),J.diagramsAreComparedEdge,(0,M.jsx)(`a`,{href:`#/reconcile`,children:J.reconcile}),J.ingestedContentIsData]})})]})})}function Fx(e){if(!e)return;if(e===`mappings.md`)return J.readFromMappingsFile;let t=e.replace(/^target-flows\//,``).replace(/\.yaml$/,``);return J.readFromTargetFlow(t)}function Ix({change:e}){let t=A(`/api/changes/${encodeURIComponent(e)}/mappings`);return(0,M.jsx)(N,{title:J.fieldMappings,meta:J.byHopWithThe,children:(0,M.jsx)(P,{of:t,empty:e=>e.hops.length===0,emptyText:J.noHopsInMappings,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:14},children:[e.hops.map(e=>(0,M.jsxs)(`section`,{"aria-label":e.heading,className:`stack`,style:{gap:6},children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:6},children:[(0,M.jsx)(`h3`,{className:`mono`,style:{margin:0,fontSize:13},children:e.heading}),e.noChange?(0,M.jsx)(`span`,{className:`chip`,children:J.noMappingChange}):(0,M.jsx)(`span`,{className:`chip`,children:J.fields(e.rows.length)})]}),Fx(e.from)&&(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:Fx(e.from)}),e.note&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:e.note}),e.rows.length>0&&(0,M.jsx)(ke,{rows:e.rows,rowKey:e=>String(e.line),caption:J.fieldMappingsFor(e.heading),cols:[{label:J.sourceField,cell:e=>e.source,mono:!0},{label:J.targetField,cell:e=>e.target,mono:!0},{label:J.rule,cell:e=>e.rule},{label:J.whenMissingOrInvalid,cell:e=>e.whenMissing}]}),!e.noChange&&e.rows.length===0&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:J.noFieldRowsYet}),e.asIs.length>0&&(0,M.jsxs)(`details`,{children:[(0,M.jsx)(`summary`,{className:`hud`,style:{fontSize:10,cursor:`pointer`},children:J.mappedTodayInThe(e.asIs.length)}),(0,M.jsx)(ke,{rows:e.asIs,rowKey:e=>e.id,caption:J.catalogFieldMappingsFor(e.heading),cols:[{label:J.sourceField,cell:e=>e.source,mono:!0},{label:J.targetField,cell:e=>e.target,mono:!0},{label:J.transform,cell:e=>e.transform??``},{label:J.record,cell:e=>e.id,mono:!0}]})]})]},`${e.from??``}#${e.line}`)),e.catalogMappings===0&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:J.theCatalogHasNo})]})})})}function Lx({hash:e}){return(0,M.jsx)(Ax,{hash:e,screen:`mappings`,title:J.apiMappings,artifacts:[`mappings`],critic:`architecture-critic`,main:e=>(0,M.jsx)(Ix,{change:e}),extra:()=>(0,M.jsx)(N,{title:J.howMappingsAreChecked,span:`span 4`,children:(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5,lineHeight:1.6},children:[J.eachHopsSourceField,(0,M.jsx)(`a`,{href:`#/trace`,children:J.testTrace}),`.`]})})})}function Rx({change:e}){let t=ve(`story-bar`,e);return(0,M.jsx)(N,{title:J.storyBar,span:`span 4`,kind:`dark`,children:(0,M.jsx)(P,{of:t,empty:e=>!e||e.stories.length===0,emptyText:J.noStoriesYetWrite,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,M.jsxs)(`div`,{className:`row`,children:[(0,M.jsx)(he,{value:e.ready.passed,max:Math.max(e.ready.total,1),size:64,label:J.ofStoriesReady(e.ready.passed,e.ready.total)}),(0,M.jsx)(`span`,{className:`chip ${e.met?`done`:`warn`}`,children:e.met?J.barMet:J.needs(Math.round(e.ready.min*100))})]}),e.stories.filter(e=>!e.ready).map(e=>(0,M.jsxs)(`div`,{style:{fontSize:12.5},children:[(0,M.jsx)(`span`,{className:`mono`,children:e.id}),`: `,e.problems.join(`; `)]},e.id)),e.gaps.filter(e=>!e.covered).map(e=>(0,M.jsx)(`div`,{style:{fontSize:12.5,color:`var(--amber-text)`},children:J.noStoryCovers(e.what)},e.id))]})})})}function zx({change:e}){let t=De(),n=Og();return(0,M.jsx)(N,{title:J.storiesAndTasks,span:`span 4`,children:(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:J.theStoryWriterDrafts}),n?(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:t.busy,onClick:()=>void t.run(()=>k(`/api/changes/${e}/runs`,{method:`POST`,body:{agent:`story-writer`,runtime:`hand-off`}}).catch(Kt(E.app.forceStories(e))),J.theStoryWritersPrompt),children:J.writeStoriesWithAi}):(0,M.jsx)(`p`,{style:{margin:0,fontSize:12.5},children:kg}),(0,M.jsx)(Oe,{note:t.note})]})})}function Bx({hash:e}){return(0,M.jsx)(Ax,{hash:e,screen:`breakdown`,title:J.breakdown,artifacts:[`stories`,`tasks`],critic:`story-critic`,extra:e=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Rx,{change:e}),(0,M.jsx)(zx,{change:e}),(0,M.jsx)(Vx,{change:e,span:`span 4`,compact:!0})]})})}function Vx({change:e,span:t,compact:n}){let r=A(`/api/changes/${e}/tasks`),i=Og(),[a,o]=(0,v.useState)({}),[s,c]=(0,v.useState)({}),l=(e,t)=>o(n=>({...n,[e]:t})),u=async t=>{c(e=>({...e,[t.id]:!0})),l(t.id,E.app.working);try{let n=await k(`/api/changes/${e}/runs`,{method:`POST`,body:{agent:`task-runner`,task:t.id,runtime:`hand-off`}});l(t.id,`Run ${n.runId} prepared: your assistant takes it from here.`)}catch(e){l(t.id,e instanceof D?e.problem.detail??e.problem.title:String(e))}finally{c(e=>({...e,[t.id]:!1}))}};return(0,M.jsx)(N,{title:n?J.handDownPreview:J.tasksByRepo,span:t,meta:r.state===`ready`?J.tasks(r.data.length):void 0,children:(0,M.jsx)(P,{of:r,empty:e=>e.length===0,emptyText:J.noTasksYetThey,children:e=>{let t=[...new Set(e.map(e=>e.repo))].sort();return(0,M.jsx)(`div`,{className:`stack`,style:{gap:12},children:t.map(t=>{let r=e.filter(e=>e.repo===t),o=r.filter(e=>e.done).length;return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,M.jsxs)(`div`,{className:`row between`,children:[(0,M.jsx)(`span`,{className:`mono`,style:{fontSize:12.5},children:t}),(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:J.done(o,r.length)})]}),(0,M.jsx)(ge,{value:o,max:r.length,label:J.ofTasksDone(t,o,r.length)}),!n&&r.map(e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4,padding:`6px 0 6px 10px`,borderLeft:`2px solid ${e.done?`var(--green)`:`var(--line-2)`}`},children:[(0,M.jsxs)(`div`,{className:`row between`,style:{alignItems:`flex-start`},children:[(0,M.jsxs)(`span`,{style:{fontSize:13},children:[(0,M.jsx)(`span`,{className:`mono muted`,children:e.id}),` `,e.description]}),e.done?(0,M.jsx)(`span`,{className:`chip done`,children:J.done2}):i?(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:s[e.id],onClick:()=>void u(e),children:J.runWithAi}):(0,M.jsx)(`span`,{className:`chip dim`,title:kg,children:J.byHand})]}),(0,M.jsxs)(`span`,{className:`mono muted`,style:{fontSize:10.5},children:[e.branch,e.story?J.story(e.story):``]}),a[e.id]&&(0,M.jsx)(`span`,{role:`status`,style:{fontSize:12},children:a[e.id]})]},e.id))]},t)})})}})})}function Hx({change:e}){let t=A(`/api/changes/${e}/runs`);j(e=>{e.type===`run.changed`&&t.reload()});let n=t.state===`ready`?t.data.filter(e=>e.state===`validated`).length:0;return(0,M.jsx)(N,{title:J.aiTaskRuns,span:`span 4`,kind:`dark`,children:(0,M.jsx)(P,{of:t,empty:e=>e.length===0,emptyText:J.noRunsYet,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,M.jsxs)(`div`,{className:`row`,children:[(0,M.jsx)(he,{value:n,max:e.length,size:60,label:J.ofRunsFinished(n,e.length)}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:J.everyWriteIsApproved})]}),e.slice(-8).map(e=>(0,M.jsxs)(`div`,{className:`list-row`,children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`mono`,style:{fontSize:11.5},children:e.runId}),(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[e.agent,` · `,e.runtime]})]}),(0,M.jsx)(`span`,{className:`chip ${e.errors.length?`blocking`:e.state===`validated`?`done`:e.state===`failed`?`blocking`:``}`,children:e.state.toUpperCase()})]},e.runId))]})})})}function Ux({hash:e}){let t=xe(e,`tasks`);return t.none?(0,M.jsx)(kx,{}):t.id?(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:J.taskBoard,span:`1 / -1`,meta:t.picker,children:(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:J.tasksInCrossRepo})}),(0,M.jsx)(Vx,{change:t.id,span:`span 8`}),(0,M.jsxs)(`div`,{className:`stack`,style:{gridColumn:`span 4`,gap:16},children:[(0,M.jsx)(Hx,{change:t.id}),(0,M.jsx)(Nx,{change:t.id})]})]},t.id):(0,M.jsx)(Se,{list:t.list,title:J.taskBoard})}function Wx({hash:e}){let t=xe(e,`trace`),n=ve(`trace`,t.id,!t.id),r=A(t.id?`/api/changes/${t.id}/status`:void 0);if(t.none)return(0,M.jsx)(kx,{});if(!t.id)return(0,M.jsx)(Se,{list:t.list,title:J.testTrace});let i=n.state===`ready`?n.data.rows.filter(e=>e.tests.length>0).length:0,a=n.state===`ready`?n.data.rows.length:0;return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsxs)(`div`,{className:`column`,style:{gridColumn:`span 8`},children:[(0,M.jsxs)(N,{title:J.testTrace,kind:`hero`,meta:t.picker,children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:`0 0 12px`,fontSize:12.5},children:J.everyRequirementShouldReach}),(0,M.jsx)(P,{of:n,empty:e=>e.rows.length===0,emptyText:J.nothingToTraceYet,children:e=>(0,M.jsx)(ke,{caption:J.requirementToCode,rows:e.rows,rowKey:e=>`${e.requirement?.key??``}/${e.story??``}/${e.criterion?.n??``}`,cols:[{label:J.requirement,cell:e=>e.requirement?(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{children:e.requirement.requirement}),e.requirement.scenario&&(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:e.requirement.scenario})]}):(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`chip warn`,style:{width:`fit-content`},children:J.noRequirement}),e.criterion&&(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:e.criterion.text})]})},{label:J.story2,cell:e=>e.story??(0,M.jsx)(`span`,{className:`chip warn`,children:J.noStory}),mono:!0},{label:J.test,cell:e=>e.tests.length?e.tests.join(`, `):(0,M.jsx)(`span`,{className:`chip blocking`,children:J.noTest}),mono:!0},{label:J.code,cell:e=>e.code.slice(0,3).join(`, `),mono:!0}]})})]}),(0,M.jsx)(N,{title:J.gapsBeforeQaSign,meta:n.state===`ready`?n.data.gaps.length:void 0,children:(0,M.jsx)(P,{of:n,empty:e=>e.gaps.length===0,emptyText:J.noGapsEveryRequirement,children:e=>(0,M.jsx)(ke,{caption:J.traceGaps,rows:e.gaps,rowKey:e=>`${e.kind}/${e.subject}`,cols:[{label:J.gap,cell:e=>(0,M.jsx)(`span`,{className:`chip warn`,children:e.kind}),width:`190px`},{label:J.what,cell:e=>e.summary}]})})})]}),(0,M.jsxs)(`div`,{className:`column`,style:{gridColumn:`span 4`},children:[(0,M.jsx)(N,{title:J.scenarioCoverage,kind:`dark`,children:(0,M.jsx)(P,{of:n,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,M.jsxs)(`div`,{className:`row`,children:[(0,M.jsx)(he,{value:i,max:Math.max(a,1),size:72,label:J.ofRowsHaveA(i,a),text:a?`${Math.round(i/a*100)}%`:`–`}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12.5},children:J.ofTracedToA(i,a)})]}),(0,M.jsx)(F,{title:J.gapsByKind,parts:[...new Set(e.gaps.map(e=>e.kind))].map((t,n)=>({label:t,value:e.gaps.filter(e=>e.kind===t).length,color:[`var(--amber)`,`var(--magenta)`,`var(--violet)`,`var(--accent)`][n%4]}))})]})})}),(0,M.jsxs)(N,{title:J.testKindsThisChange,children:[(0,M.jsx)(P,{of:r,empty:e=>!e.tests?.required?.length,emptyText:J.theTestStrategyAsks,children:e=>(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[e.tests.required.map(e=>(0,M.jsx)(`span`,{className:`chip`,children:String(e).toUpperCase()},String(e))),e.tests.note&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:e.tests.note})]})}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:`10px 0 0`,fontSize:11.5},children:J.requiredKindsComeFrom})]})]})]})}var Gx={map:()=>(0,M.jsx)(Ot,{}),systems:Ht,impact:At,features:Mt,orgpack:()=>(0,M.jsx)(Nt,{}),intake:()=>(0,M.jsx)(It,{}),scans:()=>(0,M.jsx)(Lt,{}),brief:jx,ux:Mx,"arch-review":Px,diagrams:yx,reconcile:_x,contracts:()=>(0,M.jsx)(fx,{}),mappings:Lx,breakdown:Bx,initiatives:Cx,tasks:Ux,trace:Wx},Kx=E.knowledge.documents,qx=864e5;function Jx(e,t){if(!e)return;let n=Math.floor((t-Date.parse(e))/qx);return Number.isFinite(n)?Kx.age(Math.max(0,n)):void 0}function Yx(e,t){let n=t.text.trim().toLowerCase();return e.filter(e=>(!t.kind||e.kind===t.kind)&&(!t.system||e.systems.includes(t.system))&&(!n||e.path.toLowerCase().includes(n)||(e.title??``).toLowerCase().includes(n)))}function Xx({d:e,now:t}){let n=Jx(e.modifiedAt,t),r=e.items.filter(e=>e.verified).length;return(0,M.jsxs)(`article`,{className:`list-row`,style:{display:`block`},"aria-label":e.path,children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:8},children:[(0,M.jsx)(`span`,{className:`mono`,style:{wordBreak:`break-all`},children:e.path}),(0,M.jsxs)(`span`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,M.jsx)(`span`,{className:`chip`,children:Kx.kinds[e.kind]??e.kind}),(0,M.jsx)(`span`,{className:`chip ${e.state===`read`?``:`warn`}`,children:Kx.states[e.state]}),e.inbox&&(0,M.jsx)(`span`,{className:`chip`,children:Kx.inbox})]})]}),e.title&&e.title!==e.path&&(0,M.jsx)(`p`,{style:{margin:`4px 0 0`},children:e.title}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:`4px 0 0`,fontSize:12.5},children:[e.systems.length?Kx.systems(e.systems.join(`, `)):Kx.noSystems,n,e.items.length?Kx.items(e.items.length,r):void 0].filter(Boolean).join(` · `)}),e.reason&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:`4px 0 0`,fontSize:12.5},children:Kx.why(e.reason)}),e.supersededBy&&!e.reason&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:`4px 0 0`,fontSize:12.5},children:Kx.newer(e.supersededBy)}),e.duplicateOf&&!e.reason&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:`4px 0 0`,fontSize:12.5},children:Kx.duplicate(e.duplicateOf)}),e.items.length>0&&(0,M.jsx)(`ul`,{style:{margin:`6px 0 0`,paddingLeft:18},children:e.items.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`a`,{href:`#/knowledge?q=${encodeURIComponent(e.id)}`,children:e.title}),e.verified?` (${Kx.verified})`:``]},e.id))})]})}function Zx(e){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),s=e.now??Date.now(),c=e.data.documents,l=[...new Set(c.map(e=>e.kind))].sort(),u=[...new Set(c.flatMap(e=>e.systems))].sort(),d=Yx(c,{kind:t,system:r,text:a}),f=!!(t||r||a.trim()),p=c.filter(e=>e.state===`read`).length;return(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:e.data.snapshot?Kx.synced(e.data.snapshot.date,p,c.length):Kx.neverSynced}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,M.jsx)(Pg,{id:`documents-filter`,value:a,onChange:o,grow:!0}),(0,M.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`hud`,children:Kx.kindLabel}),(0,M.jsxs)(`select`,{id:`documents-kind`,className:`field`,value:t,onChange:e=>n(e.target.value),children:[(0,M.jsx)(`option`,{value:``,children:Kx.anyKind}),l.map(e=>(0,M.jsx)(`option`,{value:e,children:Kx.kinds[e]??e},e))]})]}),(0,M.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`hud`,children:Kx.systemLabel}),(0,M.jsxs)(`select`,{id:`documents-system`,className:`field`,value:r,onChange:e=>i(e.target.value),children:[(0,M.jsx)(`option`,{value:``,children:Kx.anySystem}),u.map(e=>(0,M.jsx)(`option`,{value:e,children:e},e))]})]})]}),(0,M.jsx)(Fg,{shown:d.length,total:c.length,active:f}),d.length===0?(0,M.jsx)(Ig,{what:Kx.filtered,onClear:()=>{n(``),i(``),o(``)},focus:`documents-filter`}):(0,M.jsx)(`div`,{className:`stack`,style:{gap:6},children:d.map(e=>(0,M.jsx)(Xx,{d:e,now:s},e.path))})]})}var Qx=e=>{let t=``,n=new Uint8Array(e);for(let e=0;e<n.length;e+=32768)t+=String.fromCharCode(...n.subarray(e,e+32768));return btoa(t)};function $x(){let e=A(`/api/knowledge/documents`);ce(e);let t=De(),n=De();return(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsxs)(N,{title:Kx.title,children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:`0 0 8px`,maxWidth:`70ch`},children:Kx.intro}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,M.jsx)(`label`,{className:`btn`,htmlFor:`documents-add`,children:n.busy?Kx.adding:Kx.add}),(0,M.jsx)(`input`,{id:`documents-add`,type:`file`,multiple:!0,className:`sr`,disabled:n.busy,onChange:t=>{let r=[...t.target.files??[]];t.target.value=``,r.length&&n.run(async()=>{for(let e of r)await k(`/api/knowledge/documents`,{method:`POST`,body:{name:e.name,content:Qx(await e.arrayBuffer())}});e.reload()},Kx.added(r.length))}}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:t.busy,onClick:()=>void t.run(async()=>{await k(`/api/knowledge/sources/inputs/sync`,{method:`POST`}),e.reload()},Kx.syncedNow),children:t.busy?Kx.syncing:Kx.sync})]}),(0,M.jsx)(Oe,{note:n.note}),(0,M.jsx)(Oe,{note:t.note})]}),(0,M.jsx)(N,{title:Kx.listTitle,children:(0,M.jsx)(P,{of:e,empty:e=>e.documents.length===0,emptyText:Kx.empty,children:e=>(0,M.jsx)(Zx,{data:e})})}),(0,M.jsx)(N,{title:Kx.readTitle,children:(0,M.jsx)(u_,{command:`atticus knowledge scan --source inputs`,slash:`/atticus-knowledge inputs`,why:Kx.readWhy})})]})}var eS=E.knowledge,Y=eS.items;function tS(e,t){if(!t)return{};let n=e.find(e=>e.id===t);return n?{item:n}:{missing:t}}function nS(){let e=(0,v.useRef)(null);return(0,v.useEffect)(()=>{e.current?.querySelector(`input, textarea, select`)?.focus()},[]),e}var rS=[`decision`,`stance`];function iS(e){let t=e.screen??`knowledge`;return(0,M.jsx)(P,{of:e.of,empty:e=>e.items.length===0,emptyContent:(0,M.jsx)(d_,{text:Y.empty}),children:n=>{let r=n.items.filter(t=>(!e.kind||t.kind===e.kind)&&y_(t,e.text)),i=b_(r,eS.groups);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(n_,{list:n.problems}),(0,M.jsx)(`p`,{className:`hud`,style:{fontSize:10,margin:`0 0 6px`},"aria-live":`polite`,children:Y.count(r.length)}),i.length===0&&(e.onClear?(0,M.jsx)(Ig,{what:Ng({text:e.text,...e.kind?{kind:i_(e.kind)}:{}}),onClear:e.onClear,focus:`item-find`}):(0,M.jsx)(`div`,{className:`state`,children:Y.noMatch})),i.map(n=>(0,M.jsxs)(`section`,{"aria-label":n.title,style:{marginBottom:10},children:[(0,M.jsx)(`h3`,{className:`hud`,style:{fontSize:11,margin:`6px 0`},children:`${n.title} (${n.items.length})`}),(0,M.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:n.items.map(n=>(0,M.jsxs)(`li`,{className:`list-row`,style:{alignItems:`flex-start`},children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2,minWidth:0},children:[(0,M.jsx)(`a`,{href:`#/${t}?item=${encodeURIComponent(n.id)}`,"aria-current":n.id===e.current?`true`:void 0,children:n.title}),(0,M.jsxs)(`span`,{className:`muted mono`,style:{fontSize:11},children:[i_(n.kind),` · `,n.id]})]}),(0,M.jsx)(l_,{review:n.review})]},n.id))})]},n.title))]})}})}function aS(e){return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`label`,{htmlFor:e.id,className:`hud`,style:{fontSize:10},children:e.label}),(0,M.jsx)(`input`,{id:e.id,className:`field`,value:e.value,onChange:t=>e.onChange(t.target.value)})]})}function oS(e){return(0,M.jsxs)(`fieldset`,{className:`stack`,style:{gap:4,border:0,padding:0,margin:0},children:[(0,M.jsx)(`legend`,{className:`hud`,style:{fontSize:10},children:e.label}),e.value.map((t,n)=>(0,M.jsxs)(`div`,{className:`row`,style:{gap:6},children:[(0,M.jsx)(`input`,{className:`field`,"aria-label":`${e.label}: ${Y.item(n+1)}`,value:t,onChange:t=>e.onChange(e.value.map((e,r)=>r===n?t.target.value:e))}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":`${Y.remove} ${e.label}: ${Y.item(n+1)}`,onClick:()=>e.onChange(e.value.filter((e,t)=>t!==n)),children:Y.remove})]},n)),(0,M.jsx)(`div`,{children:(0,M.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":`${Y.addValue}: ${e.label}`,onClick:()=>e.onChange([...e.value,``]),children:Y.addValue})})]})}function sS(e){let t=(t,n)=>e.onChange(e.value.map((e,r)=>r===t?{...e,...n}:e));return(0,M.jsxs)(`fieldset`,{className:`stack`,style:{gap:4,border:0,padding:0,margin:0},children:[(0,M.jsx)(`legend`,{className:`hud`,style:{fontSize:10},children:e.label}),e.value.map((n,r)=>(0,M.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,M.jsx)(`input`,{className:`field`,style:{flex:`1 1 120px`},"aria-label":`${Y.link(r+1)}: ${Y.linkLabel}`,placeholder:Y.linkLabel,value:n.label??``,onChange:e=>t(r,{label:e.target.value})}),(0,M.jsx)(`input`,{className:`field`,style:{flex:`2 1 220px`},"aria-label":`${Y.link(r+1)}: ${Y.linkUrl}`,placeholder:Y.linkUrl,value:n.url,onChange:e=>t(r,{url:e.target.value})}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":`${Y.remove} ${Y.link(r+1)}`,onClick:()=>e.onChange(e.value.filter((e,t)=>t!==r)),children:Y.remove})]},r)),(0,M.jsx)(`div`,{children:(0,M.jsx)(`button`,{type:`button`,className:`btn`,"aria-label":`${Y.addValue}: ${e.label}`,onClick:()=>e.onChange([...e.value,{url:``,label:``}]),children:Y.addValue})})]})}function cS(e){let[t,n]=(0,v.useState)(()=>x_(e.item)),[r,i]=(0,v.useState)(),a=(e,t)=>n(n=>({...n,[e]:t})),o=n=>{n.preventDefault();let r=C_(e.item,t);`error`in r?i(r.error):(i(void 0),e.onSave(r.set))},s=`fix-${e.item.id}`,c=nS();return(0,M.jsxs)(`form`,{ref:c,onSubmit:o,onKeyDown:de(e.onCancel),className:`stack`,style:{gap:10},"aria-label":Y.correct,children:[(0,M.jsx)(`p`,{className:`work-say`,children:Y.correctIntro}),Object.entries(e.item.fields).map(([e,n])=>n===`text`?(0,M.jsx)(aS,{id:`${s}-${e}`,label:a_(e),value:t[e],onChange:t=>a(e,t)},e):n===`list`?(0,M.jsx)(oS,{id:`${s}-${e}`,label:a_(e),value:t[e],onChange:t=>a(e,t)},e):(0,M.jsx)(sS,{id:`${s}-${e}`,label:a_(e),value:t[e],onChange:t=>a(e,t)},e)),(0,M.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:e.busy,children:e.busy?Y.saving:Y.save}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onCancel,children:Y.cancel})]}),r&&(0,M.jsx)(`p`,{role:`alert`,style:{margin:0,color:`var(--magenta-text)`,fontSize:12.5},children:r})]})}function lS(e){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(),a=nS();return(0,M.jsxs)(`form`,{ref:a,className:`stack`,style:{gap:8},"aria-label":Y.reject,onKeyDown:de(e.onCancel),onSubmit:n=>{n.preventDefault(),t.trim()?e.onSave(t.trim()):(i(Y.needWhy),document.getElementById(`reject-why`)?.focus())},children:[(0,M.jsx)(`label`,{htmlFor:`reject-why`,className:`hud`,style:{fontSize:10},children:Y.rejectWhy}),(0,M.jsx)(`textarea`,{id:`reject-why`,className:`field`,"aria-describedby":r?`reject-why-err`:void 0,"aria-invalid":r?!0:void 0,rows:3,value:t,onChange:e=>n(e.target.value)}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`button`,{type:`submit`,className:`btn danger`,disabled:e.busy,children:e.busy?Y.saving:Y.rejectSave}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:e.onCancel,children:Y.cancel})]}),r&&(0,M.jsx)(`p`,{id:`reject-why-err`,role:`alert`,style:{margin:0,color:`var(--magenta-text)`,fontSize:12.5},children:r})]})}function uS(e){let t=e.item,n=t.record,r=[...Object.keys(t.fields).filter(e=>e!==`urls`),...rS].filter(e=>v_(n[e])!==``),i=g_(n),a=m_(n),o=(t,n)=>e.onReview?.(t,n),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=(0,v.useRef)(null),u=(0,v.useRef)(void 0);return(0,v.useEffect)(()=>{if(e.mode||e.busy||!u.current)return;let t={verify:s,correct:c,reject:l}[u.current];u.current=void 0,t.current?.focus()},[e.mode,e.busy]),(0,M.jsxs)(`article`,{className:`stack`,style:{gap:10},"aria-labelledby":`item-${t.id}`,children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:8},children:[(0,M.jsx)(`h3`,{id:`item-${t.id}`,className:`n`,style:{fontSize:18,margin:0},children:t.title}),(0,M.jsx)(l_,{review:t.review})]}),(0,M.jsxs)(`p`,{className:`muted mono`,style:{margin:0,fontSize:11.5},children:[i_(t.kind),` · `,t.id]}),t.review?.note&&(0,M.jsxs)(`p`,{style:{margin:0},children:[(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[eS.review.because,`:`]}),` `,t.review.note]}),t.review?.corrected?.length?(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:eS.review.correctedFields(t.review.corrected.map(a_).join(`, `))}):null,t.conflict&&!t.conflicts?.length&&(0,M.jsx)(`p`,{role:`note`,className:`chip warn`,style:{margin:0},children:Y.conflict}),t.conflicts?.length?(0,M.jsxs)(`section`,{"aria-label":E.knowledgeConflicts.title,children:[(0,M.jsx)(`p`,{role:`note`,className:`chip warn`,style:{margin:`0 0 6px`},children:E.knowledgeConflicts.title}),(0,M.jsx)(f_,{conflicts:t.conflicts})]}):null,(0,M.jsx)(`dl`,{className:`run-facts`,style:{margin:0},children:r.map(e=>(0,M.jsxs)(`div`,{style:{display:`contents`},children:[(0,M.jsx)(`dt`,{children:a_(e)}),(0,M.jsx)(`dd`,{children:Array.isArray(n[e])&&t.fields[e]===`list`?(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:n[e].map((e,t)=>(0,M.jsx)(`li`,{children:String(e)},t))}):v_(n[e])})]},e))}),i&&(0,M.jsxs)(`figure`,{style:{margin:0},children:[(0,M.jsx)(`figcaption`,{className:`hud`,style:{fontSize:10},children:Y.quote}),(0,M.jsx)(`blockquote`,{style:{margin:`4px 0`,paddingLeft:10,borderLeft:`2px solid var(--line-2)`},children:i}),a&&(0,M.jsx)(`p`,{className:`muted mono`,style:{margin:0,fontSize:11.5},children:a})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:Y.links}),__(n).length?(0,M.jsx)(p_,{urls:__(n)}):(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:Y.noLinks})]}),e.onReview&&!e.mode&&(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,ref:s,disabled:e.busy,onClick:()=>{u.current=`verify`,o({verdict:`verified`},Y.verified(t.id))},children:Y.verify}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,ref:c,disabled:e.busy||Object.keys(t.fields).length===0,onClick:()=>{u.current=`correct`,e.onMode?.(`correct`)},children:Y.correct}),(0,M.jsx)(`button`,{type:`button`,className:`btn danger`,ref:l,disabled:e.busy,onClick:()=>{u.current=`reject`,e.onMode?.(`reject`)},children:Y.reject})]}),e.mode===`correct`&&(0,M.jsx)(cS,{item:t,busy:e.busy,onCancel:()=>e.onMode?.(void 0),onSave:e=>o({verdict:`corrected`,set:e},Y.corrected(t.id))}),e.mode===`reject`&&(0,M.jsx)(lS,{busy:e.busy,onCancel:()=>e.onMode?.(void 0),onSave:e=>o({verdict:`rejected`,note:e},Y.rejected(t.id))}),(0,M.jsx)(`span`,{className:`sr`,"aria-live":`polite`,children:s_(t.review)})]})}function dS(e){return(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,marginBottom:10},role:`search`,children:[(0,M.jsx)(Pg,{id:`item-find`,value:e.text,onChange:e.onText,grow:!0}),(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`label`,{htmlFor:`item-kind`,className:`hud`,style:{fontSize:10},children:Y.kind}),(0,M.jsxs)(`select`,{id:`item-kind`,className:`field`,value:e.kind,onChange:t=>e.onKind(t.target.value),children:[(0,M.jsx)(`option`,{value:``,children:Y.allKinds}),Object.keys(eS.kinds).map(e=>(0,M.jsx)(`option`,{value:e,children:i_(e)},e))]})]})]})}function fS(e){return e.filter(e=>!e.review||e.review.state===`stale`)}function pS(e,t,n){if(!e.length)return;let r=e.findIndex(e=>e.id===t);return r<0?e[0].id:e[Math.min(e.length-1,Math.max(0,r+n))].id}function mS(e){return{j:`next`,ArrowDown:`next`,k:`prev`,ArrowUp:`prev`,v:`verify`,c:`correct`,r:`reject`}[e]}var hS=e=>`#/knowledge?item=${encodeURIComponent(e)}`;function gS({hash:e}){let t=A(`/api/knowledge/items`),n=ye(e,`item`),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(ye(e,`kind`)??``),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(),[p,m]=(0,v.useState)(!1);(0,v.useEffect)(()=>f(void 0),[n]),j(e=>{e.type===`file.changed`&&t.reload()});let{item:h,missing:g}=t.state===`ready`?tS(t.data.items,n):{},_=t.state===`ready`?fS(t.data.items):[],y=e=>{e&&(window.location.hash=hS(e))},b=(e,n)=>{if(!h)return;let r=p?pS(_,h.id,1):void 0;u(!0),f({ok:!0,text:E.app.working,working:!0}),k(`/api/knowledge/items/${encodeURIComponent(h.id)}/review`,{method:`POST`,body:e}).then(()=>{f({ok:!0,text:n}),c(void 0),t.reload(),r&&r!==h.id&&y(r)}).catch(e=>f({ok:!1,text:Ee(e)})).finally(()=>u(!1))};return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsxs)(N,{title:eS.nav.items,span:`span 5`,children:[(0,M.jsxs)(`p`,{className:`work-say`,style:{marginTop:0},children:[Y.intro,` `,(0,M.jsx)(Lg,{q:`knowledge`,label:E.runs.knowledge})]}),(0,M.jsx)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,marginBottom:8},children:(0,M.jsx)(`button`,{type:`button`,className:`btn`,"aria-pressed":p,disabled:!p&&_.length===0,onClick:()=>{let e=!p;m(e),e&&!_.some(e=>e.id===n)&&y(pS(_,n,1))},children:p?Y.reviewStop:Y.reviewStart(_.length)})}),(0,M.jsx)(dS,{text:r,kind:a,onText:i,onKind:o}),(0,M.jsx)(iS,{of:t,text:r,kind:a,current:n,onClear:()=>{i(``),o(``)}})]}),(0,M.jsx)(N,{title:h?.title??Y.open,span:`span 7`,labelledBy:`item-detail`,children:h?(0,M.jsxs)(`div`,{tabIndex:p?0:void 0,role:p?`group`:void 0,"aria-label":p?Y.reviewStop:void 0,"aria-keyshortcuts":p?`j k v c r`:void 0,onKeyDown:e=>{if(!p||s||l)return;let t=e.target;if(/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))return;let n=mS(e.key);n&&(e.preventDefault(),n===`next`||n===`prev`?y(pS(_,h.id,n===`next`?1:-1)):n===`verify`?b({verdict:`verified`},Y.verified(h.id)):c({id:h.id,mode:n}))},children:[p&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:`0 0 8px`,fontSize:12.5},children:Y.reviewKeys(_.length)}),(0,M.jsx)(uS,{item:h,onReview:b,busy:l,mode:s?.id===h.id?s.mode:void 0,onMode:e=>c(e?{id:h.id,mode:e}:void 0)},h.id),(0,M.jsx)(Oe,{note:d})]}):(0,M.jsx)(`div`,{className:`state`,children:g?Y.missing(g):Y.pick})})]})}var _S=E.knowledge.orgpack,vS=e=>e.filter(e=>e.verified).map(e=>e.from);function yS(e){if(e.action===`add`)return`${e.system.boundary}${e.system.owner?`, ${e.system.owner}`:``}${e.system.aliases.length?`, ${e.system.aliases.join(`, `)}`:``}`;let t=[e.adds?.aliases?.length?e.adds.aliases.join(`, `):``,e.adds?.owner?e.adds.owner:``].filter(Boolean).join(`; `);return _S.gains(t)}function bS(e){let t=e.d,[n,r]=(0,v.useState)(()=>vS(t.proposals)),[i,a]=(0,v.useState)(),o=(e,t)=>r(n=>t?[...new Set([...n,e])]:n.filter(t=>t!==e));return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.busy,onClick:()=>e.onDraft?.(t.platform),children:e.busy?_S.drafting:_S.draft}),t.at&&(0,M.jsx)(`span`,{className:`hud`,children:_S.at(t.at.slice(0,10))})]}),(0,M.jsx)(`p`,{className:`work-say`,children:_S.command}),(0,M.jsx)(Xg,{text:t.command,label:E.knowledge.ai.copy}),t.present?t.proposals.length===0?(0,M.jsx)(`div`,{className:`state`,children:_S.nothing}):(0,M.jsxs)(`form`,{onSubmit:r=>{r.preventDefault(),n.length?(a(void 0),e.onAccept?.(t.platform,n)):a(_S.pickOne)},children:[(0,M.jsxs)(`fieldset`,{style:{border:0,padding:0,margin:0},children:[(0,M.jsx)(`legend`,{className:`sr`,children:t.platform}),(0,M.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:t.proposals.map(e=>(0,M.jsxs)(`li`,{className:`list-row`,style:{alignItems:`flex-start`},children:[(0,M.jsxs)(`label`,{className:`row`,style:{gap:8,alignItems:`flex-start`},children:[(0,M.jsx)(`input`,{type:`checkbox`,"aria-label":_S.pick(e.system.name),checked:n.includes(e.from),onChange:t=>o(e.from,t.target.checked)}),(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,M.jsxs)(`span`,{children:[(0,M.jsx)(`span`,{className:`chip dim`,children:e.action===`add`?_S.add:_S.update}),` `,(0,M.jsx)(`strong`,{children:e.system.name}),` `,(0,M.jsx)(`span`,{className:`muted mono`,style:{fontSize:11},children:e.system.id})]}),(0,M.jsx)(`span`,{style:{fontSize:12},children:yS(e)}),e.quote&&(0,M.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[`"`,e.quote,`" (`,e.page?`${h_(e.page)}, `:``,(0,M.jsx)(`a`,{href:`#/knowledge?item=${encodeURIComponent(e.from)}`,children:e.from}),`)`]}),e.notes.map(e=>(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:e},e))]})]}),(0,M.jsx)(`span`,{className:`chip ${e.verified?`done`:`warn`}`,children:e.verified?_S.verified(e.verifiedBy??``):_S.unverified})]},e.from))})]}),(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:e.busy,style:{marginTop:8},children:e.busy?_S.accepting:_S.accept}),i&&(0,M.jsx)(`p`,{role:`alert`,style:{margin:`6px 0 0`,color:`var(--magenta-text)`,fontSize:12.5},children:i})]}):(0,M.jsx)(`div`,{className:`state`,children:_S.noDraft})]})}function xS(e){return(0,M.jsx)(P,{of:e.of,empty:e=>e.platforms.length===0,emptyText:_S.empty,children:t=>(0,M.jsx)(`div`,{className:`bento`,children:t.platforms.map(t=>(0,M.jsx)(N,{title:t.platform,span:`1 / -1`,children:(0,M.jsx)(bS,{d:t,onDraft:e.onDraft,onAccept:e.onAccept,busy:e.busy},`${t.platform}:${t.at??``}:${t.proposals.length}`)},t.platform))})})}function SS(){let e=A(`/api/orgpack/draft`),[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(),a=(0,v.useRef)(null);j(t=>{t.type===`file.changed`&&e.reload()});let o=t=>{n(!0),i({ok:!0,text:E.app.working,working:!0}),t().then(e=>i({ok:!0,text:e})).catch(e=>i({ok:!1,text:Ee(e)})).finally(()=>{n(!1),e.reload(),a.current?.focus()})};return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`work-say`,style:{marginTop:0},children:_S.intro}),(0,M.jsx)(`div`,{ref:a,tabIndex:-1,children:(0,M.jsx)(Oe,{note:r})}),(0,M.jsx)(xS,{of:e,busy:t,onDraft:e=>o(async()=>{let t=(await k(`/api/orgpack/draft`,{method:`POST`,body:{platform:e}})).platforms.find(t=>t.platform===e)?.proposals.length??0;return t?_S.drafted(t):_S.nothing}),onAccept:(e,t)=>o(async()=>{let n=await k(`/api/orgpack/draft/${encodeURIComponent(e)}/accept`,{method:`POST`,body:{only:t}});return _S.accepted(n.added.length,n.updated.length,n.file)})})]})}var CS=E.knowledge,wS=CS.parties,TS=e=>Array.isArray(e)?e.map(String):[],ES=e=>typeof e==`string`&&e?e:void 0,DS=e=>e.trim().toLowerCase(),OS=e=>new Set([e.id,e.title,...TS(e.record.aliases)].map(DS));function kS(e){let t=e.filter(e=>e.kind===`product`||e.kind===`project`),n=e=>{let n=OS(e),r=e=>!!ES(e)&&n.has(DS(ES(e))),i=(e,t)=>{let n=new Set(e.map(DS));return[...e,...t.filter(e=>!n.has(DS(e))&&n.add(DS(e)))]},a=e.record,o=e.kind===`team`||e.kind===`vendor`;return{item:e,aliases:TS(a.aliases),responsibilities:TS(a.responsibilities),owns:o?i(TS(a.owns),t.filter(t=>r(t.record.ownedBy)||e.kind===`vendor`&&r(t.record.vendor)).map(e=>e.title)):[],uses:o?i(TS(a.uses),t.filter(e=>TS(e.record.usedBy).some(e=>r(e))).map(e=>e.title)):[],...ES(a.ownedBy)?{ownedBy:ES(a.ownedBy)}:{},usedBy:TS(a.usedBy),...ES(a.vendor)?{vendor:ES(a.vendor)}:{}}},r=t=>e.filter(e=>t.includes(e.kind)).map(n).sort((e,t)=>e.item.title.localeCompare(t.item.title));return{teams:r([`team`]),vendors:r([`vendor`]),products:r([`product`,`project`])}}function AS({label:e,names:t}){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`dt`,{children:e}),(0,M.jsx)(`dd`,{children:t.length?t.join(`, `):(0,M.jsx)(`span`,{className:`muted`,children:wS.none})})]})}function jS({v:e}){let t=e.item,n=t.kind===`product`||t.kind===`project`;return(0,M.jsxs)(`li`,{className:`list-row`,style:{display:`block`},children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:6},children:[(0,M.jsxs)(`span`,{children:[(0,M.jsx)(`a`,{href:`#/knowledge?item=${encodeURIComponent(t.id)}`,title:wS.review,children:(0,M.jsx)(`strong`,{children:t.title})}),` `,(0,M.jsxs)(`span`,{className:`muted mono`,style:{fontSize:11},children:[i_(t.kind),` · `,t.id]})]}),(0,M.jsx)(l_,{review:t.review})]}),(0,M.jsxs)(`dl`,{className:`run-facts`,style:{margin:`6px 0 0`},children:[e.aliases.length>0&&(0,M.jsx)(AS,{label:wS.aliases,names:e.aliases}),e.responsibilities.length>0&&(0,M.jsx)(AS,{label:wS.responsibilities,names:e.responsibilities}),n?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(AS,{label:wS.ownedBy,names:e.ownedBy?[e.ownedBy]:[]}),(0,M.jsx)(AS,{label:wS.usedBy,names:e.usedBy}),e.vendor&&(0,M.jsx)(AS,{label:CS.fields.vendor,names:[e.vendor]})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(AS,{label:wS.owns,names:e.owns}),(0,M.jsx)(AS,{label:wS.uses,names:e.uses})]})]}),(0,M.jsx)(p_,{urls:__(t.record)})]})}function MS({title:e,list:t}){return(0,M.jsx)(N,{title:`${e} (${t.length})`,span:`span 4`,children:t.length===0?(0,M.jsx)(`div`,{className:`state`,children:wS.none}):(0,M.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:t.map(e=>(0,M.jsx)(jS,{v:e},e.item.id))})})}function NS({of:e}){return(0,M.jsx)(P,{of:e,empty:e=>!e.items.some(e=>[`team`,`vendor`,`product`,`project`].includes(e.kind)),emptyContent:(0,M.jsx)(N,{title:CS.nav.parties,children:(0,M.jsx)(d_,{text:wS.empty})}),children:e=>{let t=kS(e.items.filter(e=>e.review?.state!==`rejected`));return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(MS,{title:wS.teams,list:t.teams}),(0,M.jsx)(MS,{title:wS.vendors,list:t.vendors}),(0,M.jsx)(MS,{title:wS.products,list:t.products})]})}})}function PS(){let e=A(`/api/knowledge/items`);return j(t=>{t.type===`file.changed`&&e.reload()}),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`work-say`,style:{marginTop:0},children:wS.intro}),(0,M.jsx)(NS,{of:e})]})}var FS=E.knowledge,IS=FS.search,LS=(e,t)=>{let n=new URLSearchParams;e&&n.set(`q`,e),t&&n.set(`find`,t);let r=n.toString();return`#/wiki-search${r?`?${r}`:``}`};function RS({of:e}){return(0,M.jsx)(P,{of:e,children:e=>e.sources===0?(0,M.jsx)(`div`,{className:`state`,children:IS.noSnapshot}):e.matches.length===0?(0,M.jsx)(`div`,{className:`state`,children:IS.none(e.phrase)}):(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,M.jsx)(`p`,{style:{margin:0},"aria-live":`polite`,children:IS.found(e.matches.length,e.pages.length)}),e.pages.map(t=>(0,M.jsxs)(`section`,{"aria-label":t,children:[(0,M.jsx)(`h3`,{className:`mono`,style:{fontSize:12.5,margin:`4px 0`},children:t}),(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:e.matches.filter(e=>`${e.source}/${e.page}`===t).map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:`${e.section||t} · ${e.line}`}),(0,M.jsx)(`div`,{style:{color:`var(--text-2)`},children:e.excerpt})]},`${e.section}:${e.line}`))})]},t)),(0,M.jsx)(u_,{command:e.command,slash:e.slash,why:IS.next,runs:{q:`knowledge`,label:E.runs.knowledge}})]})})}function zS(e){return(0,M.jsx)(P,{of:e.of,empty:e=>e.finds.length===0,emptyText:IS.noSaved,children:t=>(0,M.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:t.finds.map(t=>(0,M.jsxs)(`li`,{className:`list-row`,children:[(0,M.jsx)(`a`,{href:LS(e.q??``,t.slug),"aria-current":t.slug===e.current?`true`:void 0,children:t.phrase}),(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[IS.candidates(t.candidates.length,t.candidates.filter(e=>e.kept).length),` ·`,` `,t.at.slice(0,10)]})]},t.slug))})})}function BS(e){let t=e.c,[n,r]=(0,v.useState)(t.kind),i=(0,v.useRef)(null),a=(0,v.useRef)(!!t.kept);(0,v.useEffect)(()=>{t.kept&&!a.current&&i.current?.focus(),a.current=!!t.kept},[t.kept]);let o=m_(t.record),s=g_(t.record);return(0,M.jsxs)(`li`,{ref:i,tabIndex:-1,className:`list-row`,style:{display:`block`},children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:6},children:[(0,M.jsxs)(`span`,{children:[(0,M.jsx)(`strong`,{children:t.title}),` `,(0,M.jsxs)(`span`,{className:`muted mono`,style:{fontSize:11},children:[i_(t.kind),` · `,t.id]})]}),(0,M.jsx)(`span`,{className:`chip ${t.kept?`done`:t.known?`dim`:`ai`}`,children:t.kept?IS.kept(i_(t.kept.as),t.kept.by):t.known?IS.known(t.known):IS.fresh})]}),s&&(0,M.jsx)(`blockquote`,{style:{margin:`4px 0`,paddingLeft:10,borderLeft:`2px solid var(--line-2)`},children:s}),o&&(0,M.jsx)(`p`,{className:`muted mono`,style:{margin:0,fontSize:11},children:o}),(0,M.jsx)(p_,{urls:__(t.record)}),!t.known&&!t.kept&&e.onKeep&&(0,M.jsxs)(`form`,{className:`row`,style:{gap:8,marginTop:6},onSubmit:r=>{r.preventDefault(),e.onKeep?.(t.id,n)},children:[(0,M.jsx)(`label`,{htmlFor:`keep-${t.id}`,className:`hud`,style:{fontSize:10},children:IS.keepAs}),(0,M.jsx)(`select`,{id:`keep-${t.id}`,className:`field`,value:n,onChange:e=>r(e.target.value),children:t.keepAs.map(e=>(0,M.jsx)(`option`,{value:e,children:i_(e)},e))}),(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:e.busy,"aria-label":IS.keepOf(t.title),children:e.keeping===t.id?IS.keeping:IS.keep})]})]})}function VS(e){return(0,M.jsx)(P,{of:e.of,children:t=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,M.jsxs)(`p`,{className:`muted mono`,style:{margin:0,fontSize:11.5},children:[t.file,` · `,t.at.slice(0,10)]}),(0,M.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:t.candidates.map(t=>(0,M.jsx)(BS,{c:t,onKeep:e.onKeep,busy:e.busy,keeping:e.keeping},t.id))})]})})}function HS({hash:e}){let t=ye(e,`q`)??``,n=ye(e,`find`),[r,i]=(0,v.useState)(t);(0,v.useEffect)(()=>i(t),[t]);let a=A(t?`/api/knowledge/search?q=${encodeURIComponent(t)}`:void 0),o=A(`/api/knowledge/finds`),s=A(n?`/api/knowledge/finds/${encodeURIComponent(n)}`:void 0),[c,l]=(0,v.useState)(),u=c!==void 0,[d,f]=(0,v.useState)();(0,v.useEffect)(()=>f(void 0),[n]),j(e=>{e.type===`file.changed`&&(o.reload(),s.reload())});let[p,m]=(0,v.useState)(!1);return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsxs)(N,{title:FS.nav.search,span:`span 7`,children:[(0,M.jsx)(`p`,{className:`work-say`,style:{marginTop:0},children:IS.intro}),(0,M.jsxs)(`form`,{role:`search`,className:`row`,style:{gap:8,marginBottom:12},onSubmit:e=>{if(e.preventDefault(),!r.trim()){m(!0);return}m(!1);let t=LS(r.trim(),n);location.hash===t?a.reload():location.hash=t},children:[(0,M.jsx)(`label`,{htmlFor:`wiki-q`,className:`sr`,children:IS.label}),(0,M.jsx)(`input`,{id:`wiki-q`,className:`field`,style:{flex:1},value:r,placeholder:IS.placeholder,"aria-describedby":p?`wiki-q-blank`:void 0,onChange:e=>{i(e.target.value),m(!1)}}),(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,children:IS.go})]}),p&&(0,M.jsx)(`p`,{id:`wiki-q-blank`,role:`alert`,className:`run-note bad`,style:{marginTop:-4},children:IS.needText}),(0,M.jsx)(`p`,{role:`status`,className:`muted`,style:{margin:`0 0 6px`,fontSize:12},children:a.refreshing?IS.searching:``}),t&&(0,M.jsx)(RS,{of:a})]}),(0,M.jsxs)(`div`,{className:`column`,style:{gridColumn:`span 5`},children:[(0,M.jsx)(N,{title:IS.savedTitle,children:(0,M.jsx)(zS,{of:o,current:n,q:t})}),n&&(0,M.jsxs)(N,{title:s.state===`ready`?s.data.phrase:n,labelledBy:`find-detail`,children:[(0,M.jsx)(VS,{of:s,onKeep:(e,t)=>{n&&(l(e),f({ok:!0,text:E.app.working,working:!0}),k(`/api/knowledge/finds/${encodeURIComponent(n)}/keep`,{method:`POST`,body:{item:e,as:t}}).then(()=>{f({ok:!0,text:IS.keptNote(e,i_(t))}),s.reload(),o.reload()}).catch(e=>f({ok:!1,text:Ee(e)})).finally(()=>l(void 0)))},busy:u,keeping:c}),(0,M.jsx)(Oe,{note:d})]})]})]})}var US=E.knowledge.sources,WS=E.knowledge.scan;function GS(e){let t=e.s;return(0,M.jsxs)(`article`,{className:`list-row`,style:{display:`block`},"aria-labelledby":`src-${t.id}`,children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:8},children:[(0,M.jsx)(`h3`,{id:`src-${t.id}`,className:`h`,style:{fontSize:14,margin:0},children:t.id}),(0,M.jsxs)(`span`,{className:`row`,style:{gap:6},children:[t.stale&&(0,M.jsx)(`span`,{className:`chip warn`,children:t.snapshot?US.stale(e.staleDays):US.unsynced}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.busy,onClick:()=>e.onSync(t.id),children:e.busy?US.syncing:US.sync(t.id)})]})]}),(0,M.jsxs)(`dl`,{className:`run-facts`,style:{margin:`8px 0`},children:[(0,M.jsx)(`dt`,{children:US.type}),(0,M.jsx)(`dd`,{children:t.type}),(0,M.jsx)(`dt`,{children:US.location}),(0,M.jsx)(`dd`,{className:`mono`,style:{wordBreak:`break-all`},children:t.location}),t.ref&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`dt`,{children:US.ref}),(0,M.jsx)(`dd`,{className:`mono`,children:t.ref})]}),t.path&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`dt`,{children:US.path}),(0,M.jsx)(`dd`,{className:`mono`,children:t.path})]}),t.checkout&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`dt`,{children:US.checkout}),(0,M.jsx)(`dd`,{children:t.checkout})]}),(0,M.jsx)(`dt`,{children:US.owner}),(0,M.jsx)(`dd`,{children:t.owner??`—`}),(0,M.jsx)(`dt`,{children:US.tags}),(0,M.jsx)(`dd`,{children:t.tags.kinds.length+t.tags.frameworks.length?[...t.tags.kinds,...t.tags.frameworks].join(`, `):US.noTags}),(0,M.jsx)(`dt`,{children:US.authority}),(0,M.jsxs)(`dd`,{children:[t.authority?US.authorities[t.authority]??t.authority:US.noAuthority,t.byPage?`; ${US.byPage(t.byPage)}`:``]}),(0,M.jsx)(`dt`,{children:US.scope}),(0,M.jsx)(`dd`,{children:t.scope??US.everywhere}),(0,M.jsx)(`dt`,{children:US.restricted}),(0,M.jsxs)(`dd`,{children:[t.readRestricted?US.readsRestricted:US.skipsRestricted,t.maxPages?`; ${US.maxPages(t.maxPages)}`:``]}),(0,M.jsx)(`dt`,{children:US.snapshot}),(0,M.jsx)(`dd`,{children:t.snapshot?`${US.snapshotLine(t.snapshot.date,t.snapshot.pages,t.snapshot.ageDays)}${t.snapshot.commit?`, ${US.commit(t.snapshot.commit)}`:``}`:US.noSnapshot}),(0,M.jsx)(`dt`,{children:US.scanLabel}),(0,M.jsx)(`dd`,{children:t.scanned?US.scanned(t.scanned.date):US.notScanned})]}),(0,M.jsx)(u_,{command:t.commands.scan,slash:t.commands.slash,runs:{q:`knowledge`,label:E.runs.knowledge}})]})}function KS(e){return(0,M.jsx)(P,{of:e.of,children:t=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(n_,{list:t.problems}),t.sources.length===0?(0,M.jsx)(`div`,{className:`state`,children:US.empty}):t.sources.map(n=>(0,M.jsx)(GS,{s:n,staleDays:t.staleDays,onSync:e.onSync,busy:e.syncing===n.id},n.id))]})})}var qS={type:`git`,location:``,id:``,path:``,ref:``,submodule:!1,kinds:``,frameworks:``,owner:``,save:!0};function JS(e){if(!e.location.trim())return{error:US.needLocation};let t=e.type===`git`;if(!t&&(e.path.trim()||e.ref.trim()||e.submodule))return{error:US.gitOnly};let n=w_(e.kinds);if(!Array.isArray(n))return n;let r=w_(e.frameworks);return Array.isArray(r)?{body:{type:e.type,location:e.location.trim(),...e.id.trim()?{id:e.id.trim()}:{},...t&&e.path.trim()?{path:e.path.trim()}:{},...t&&e.ref.trim()?{ref:e.ref.trim()}:{},...t&&e.submodule?{submodule:!0}:{},...n.length?{kinds:n}:{},...r.length?{frameworks:r}:{},...e.owner.trim()?{owner:e.owner.trim()}:{},save:e.save}}:r}function YS(e){return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`label`,{htmlFor:e.id,className:`hud`,style:{fontSize:10},children:e.label}),(0,M.jsx)(`input`,{id:e.id,className:`field`,value:e.value,disabled:e.disabled,list:e.list,onChange:t=>e.onChange(t.target.value)})]})}function XS(e){let[t,n]=(0,v.useState)(e.initial??qS),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(),s=e=>n(t=>({...t,...e})),c=t.type===`git`;return(0,M.jsxs)(`form`,{onSubmit:r=>{r.preventDefault();let a=JS(t);`error`in a?o({ok:!1,text:a.error}):(i(!0),o(void 0),k(`/api/knowledge/sources`,{method:`POST`,body:a.body}).then(r=>{o({ok:!0,text:r.lines.join(`
|
|
19
|
+
`)}),t.save&&(n(qS),e.onAdded?.())}).catch(e=>o({ok:!1,text:Ee(e)})).finally(()=>i(!1)))},className:`stack`,style:{gap:10},"aria-labelledby":`add-source`,children:[(0,M.jsx)(`p`,{className:`work-say`,children:US.addIntro}),(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`label`,{htmlFor:`src-type`,className:`hud`,style:{fontSize:10},children:US.addType}),(0,M.jsx)(`select`,{id:`src-type`,className:`field`,value:t.type,onChange:e=>s({type:e.target.value}),children:e.types.map(e=>(0,M.jsx)(`option`,{value:e,children:e},e))})]}),(0,M.jsx)(YS,{id:`src-location`,label:US.addLocation,value:t.location,onChange:e=>s({location:e})}),(0,M.jsx)(YS,{id:`src-id`,label:US.addId,value:t.id,onChange:e=>s({id:e})}),(0,M.jsx)(YS,{id:`src-path`,label:US.addPath,value:t.path,disabled:!c,onChange:e=>s({path:e})}),(0,M.jsx)(YS,{id:`src-ref`,label:US.addRef,value:t.ref,disabled:!c,onChange:e=>s({ref:e})}),(0,M.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:t.submodule,disabled:!c,onChange:e=>s({submodule:e.target.checked})}),US.addSubmodule]}),(0,M.jsx)(YS,{id:`src-kinds`,label:US.addKinds,value:t.kinds,list:`src-kind-list`,onChange:e=>s({kinds:e})}),(0,M.jsx)(`datalist`,{id:`src-kind-list`,children:e.kinds.map(e=>(0,M.jsx)(`option`,{value:e},e))}),(0,M.jsx)(YS,{id:`src-frameworks`,label:US.addFrameworks,value:t.frameworks,onChange:e=>s({frameworks:e})}),(0,M.jsx)(YS,{id:`src-owner`,label:US.addOwner,value:t.owner,onChange:e=>s({owner:e})}),(0,M.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:t.save,onChange:e=>s({save:e.target.checked})}),US.addSave]}),(0,M.jsx)(`div`,{children:(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:r,children:r?US.adding:US.add})}),(0,M.jsx)(Oe,{note:a})]})}function ZS({label:e,ids:t}){return t.length?(0,M.jsxs)(`div`,{style:{margin:`6px 0`},children:[(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[e,` (`,t.length,`)`]}),(0,M.jsx)(`ul`,{style:{margin:`2px 0`,paddingLeft:18},children:t.map(e=>(0,M.jsx)(`li`,{children:(0,M.jsx)(`a`,{href:`#/knowledge?item=${encodeURIComponent(e)}`,className:`mono`,children:e})},e))})]}):null}function QS({of:e}){return(0,M.jsx)(P,{of:e,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[e.scannedAt?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{style:{margin:0},children:WS.at(e.scannedAt.slice(0,10))}),e.changes&&e.changes.added.length+e.changes.changed.length+e.changes.removed.length?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(ZS,{label:WS.added,ids:e.changes.added}),(0,M.jsx)(ZS,{label:WS.changed,ids:e.changes.changed}),(0,M.jsx)(ZS,{label:WS.removed,ids:e.changes.removed})]}):(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:WS.nothing}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:WS.flags(e.conflicts,e.injections,e.failed)})]}):(0,M.jsx)(`div`,{className:`state`,children:WS.never}),(0,M.jsx)(`h3`,{className:`hud`,style:{fontSize:11,margin:`6px 0 0`},children:WS.checkAgain}),e.checkAgain.length===0?(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:WS.noCheckAgain}):(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:e.checkAgain.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`a`,{href:`#/knowledge?item=${encodeURIComponent(e.id)}`,children:e.title}),` `,(0,M.jsxs)(`span`,{className:`muted mono`,style:{fontSize:11},children:[e.id,` · `,e.by]})]},e.id))}),(0,M.jsx)(u_,{command:e.command,slash:e.slash,why:WS.rescan,runs:{q:`knowledge`,label:E.runs.knowledge}})]})})}function $S(){let e=A(`/api/knowledge/sources`),t=A(`/api/knowledge/scan`),[n,r]=(0,v.useState)(),i=De();return j(n=>{n.type===`file.changed`&&(e.reload(),t.reload())}),(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsxs)(N,{title:US.listTitle,span:`span 7`,children:[(0,M.jsx)(`p`,{className:`work-say`,style:{marginTop:0},children:US.intro}),(0,M.jsx)(Oe,{note:i.note}),(0,M.jsx)(KS,{of:e,onSync:t=>{r(t),i.run(()=>k(`/api/knowledge/sources/${encodeURIComponent(t)}/sync`,{method:`POST`,body:{}}).then(e.reload),US.synced(t)).finally(()=>r(void 0))},syncing:n})]}),(0,M.jsxs)(`div`,{className:`column`,style:{gridColumn:`span 5`},children:[(0,M.jsx)(N,{title:WS.title,children:(0,M.jsx)(QS,{of:t})}),(0,M.jsx)(N,{title:US.addTitle,labelledBy:`add-source`,children:(0,M.jsx)(P,{of:e,children:t=>(0,M.jsx)(XS,{types:t.types,kinds:t.kindSuggestions,onAdded:e.reload})})})]})]})}var eC={wikis:()=>(0,M.jsx)($S,{}),documents:()=>(0,M.jsx)($x,{}),knowledge:gS,"wiki-search":HS,parties:()=>(0,M.jsx)(PS,{}),"orgpack-draft":()=>(0,M.jsx)(SS,{})},tC=E.evals,nC=e=>`${Math.round(e*100)}%`;function rC({label:e,value:t,sub:n}){return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:e}),(0,M.jsx)(`span`,{className:`n`,style:{fontSize:28,color:`var(--accent)`},children:t}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:n})]})}function iC(){let e=A(`/api/evals`),t=A(`/api/evals/defences`),[n,r]=(0,v.useState)(`mock`),[i,a]=(0,v.useState)(``),o=qt(),s=qt();j(t=>{t.type===`file.changed`&&e.reload()});let c=e.state===`ready`?e.data.quality?.agents??[]:[],l=t.state===`ready`?t.data.files.filter(e=>e.risk===`high`):[],u=t.state===`ready`?t.data.files.filter(e=>e.risk===`medium`):[];return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,M.jsx)(`p`,{className:`n`,style:{margin:0,fontSize:24},children:tC.testASkillBefore}),(0,M.jsxs)(`form`,{className:`row`,style:{flexWrap:`wrap`,alignItems:`flex-end`},onSubmit:t=>{t.preventDefault(),o.run(()=>k(`/api/evals/run`,{method:`POST`,body:{mode:n,...i?{agents:[i]}:{}}}).then(t=>(e.reload(),t)),e=>{let t=e.report,n=t.results?.filter(e=>!e.pass).length??0;return`Eval run ${t.runId} finished: ${n?`${tn(n,`case`)} failed`:tC.everyCasePassed}.`})},children:[(0,M.jsxs)(`label`,{className:`run-label`,htmlFor:`eval-mode`,children:[tC.mode,(0,M.jsxs)(`select`,{id:`eval-mode`,className:`run-select`,value:n,onChange:e=>r(e.target.value),children:[(0,M.jsx)(`option`,{value:`mock`,children:tC.mockNoModel}),(0,M.jsx)(`option`,{value:`replay`,children:tC.replaySavedAnswers})]})]}),(0,M.jsxs)(`label`,{className:`run-label`,htmlFor:`eval-agent`,children:[tC.agent,(0,M.jsxs)(`select`,{id:`eval-agent`,className:`run-select`,value:i,onChange:e=>a(e.target.value),children:[(0,M.jsx)(`option`,{value:``,children:tC.everyAgent}),c.map(e=>(0,M.jsx)(`option`,{children:e.agent},e.agent))]})]}),(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:o.busy,children:o.busy?tC.running:tC.newEvalRun})]})]}),(0,M.jsx)(Jt,{note:o.note}),(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:tC.qualitySignals,span:`span 5`,children:(0,M.jsx)(P,{of:e,children:e=>{let n=e.findings.applied+e.findings.dismissed+e.findings.waived,r=c.filter(e=>e.passRate===1).length;return(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,alignItems:`flex-start`},children:[(0,M.jsx)(rC,{label:tC.findingsKeptByPeople,value:n?nC(e.findings.applied/n):`–`,sub:n?tC.actedOn(e.findings.applied,n):tC.noFindingsResolvedYet}),(0,M.jsx)(rC,{label:tC.agentsPassing,value:c.length?`${r}/${c.length}`:`–`,sub:c.length?tC.everyCaseLatestRun:tC.noEvalRunYet}),(0,M.jsx)(rC,{label:tC.hiddenInstructionsHeld,value:t.state===`ready`?String(l.length+t.data.items.length):`–`,sub:tC.quarantinedNeverSentTo})]})}})}),(0,M.jsx)(N,{title:tC.passRateByAgent,span:`span 7`,children:(0,M.jsx)(P,{of:e,empty:()=>c.length===0,emptyText:tC.noEvalRunsYet,children:()=>(0,M.jsx)(`div`,{className:`stack`,style:{gap:8},children:c.map(e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsxs)(`div`,{className:`row between`,children:[(0,M.jsx)(`span`,{className:`mono`,style:{fontSize:12},children:e.agent}),(0,M.jsxs)(`span`,{className:`row`,style:{gap:6},children:[(0,M.jsx)(`span`,{className:`chip dim`,children:e.mode.toUpperCase()}),e.liveBar&&(0,M.jsx)(`span`,{className:`chip ${e.liveBar.pass?`done`:`blocking`}`,children:tC.live(e.liveBar.min,e.liveBar.runs,e.liveBar.pass?tC.met:tC.notMet)}),e.regressed.length>0&&(0,M.jsx)(`span`,{className:`chip blocking`,title:e.regressed.join(`, `),children:tC.regressed(e.regressed.length)}),(0,M.jsx)(`span`,{style:{fontSize:12},children:nC(e.passRate)})]})]}),(0,M.jsx)(ge,{value:Math.round(e.passRate*100),max:100,color:e.passRate<1?`var(--amber)`:void 0,label:tC.passRate(e.agent)})]},e.agent))})})}),(0,M.jsxs)(N,{title:tC.ingestedContentDefences,meta:t.state===`ready`?tC.quarantined3(l.length+t.data.items.length):void 0,span:`span 7`,rows:`span 2`,children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:`0 0 8px`,fontSize:12.5},children:tC.ingestedContentIsData}),(0,M.jsx)(P,{of:t,empty:e=>e.files.length===0&&e.items.length===0,emptyText:tC.nothingRiskyInInputs,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[[...l,...u].map(e=>(0,M.jsxs)(`article`,{className:`stack`,style:{gap:4,borderTop:`1px solid var(--rule)`,paddingTop:8},children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,M.jsx)(`span`,{className:`mono`,style:{fontSize:12},children:e.path}),(0,M.jsx)(`span`,{className:`chip ${e.risk===`high`?`blocking`:`warn`}`,children:e.risk===`high`?tC.quarantined:tC.marked})]}),(0,M.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[e.reason,`. `,e.action,`.`]}),e.signals.slice(0,2).map(e=>(0,M.jsx)(`code`,{className:`run-inert`,"aria-label":tC.flaggedTextOnLine(e.line),children:tC.line(e.line,e.rule,e.hidden?tC.hidden:e.encoded?tC.encoded:``,e.excerpt)},`${e.line}${e.rule}`))]},e.path)),e.items.map(e=>(0,M.jsxs)(`article`,{className:`stack`,style:{gap:4,borderTop:`1px solid var(--rule)`,paddingTop:8},children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,M.jsx)(`span`,{style:{fontSize:12.5},children:e.origin}),(0,M.jsx)(`span`,{className:`chip blocking`,children:tC.quarantined2(e.change)})]}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:e.summary}),(0,M.jsx)(`span`,{style:{fontSize:12},children:e.fix})]},`${e.change}${e.file}${e.source}`)),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:tC.atticusNeverLetsA(tn(e.scanned,`file`))})]})}),(0,M.jsx)(`div`,{className:`row`,style:{marginTop:8},children:(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:s.busy,onClick:()=>void s.run(async()=>{t.reload()},tC.scanningInputsAndThe),children:tC.scanAgain})}),(0,M.jsx)(Jt,{note:s.note})]}),(0,M.jsx)(N,{title:tC.evalRuns,span:`span 5`,children:(0,M.jsx)(P,{of:e,empty:e=>e.runs.length===0,emptyText:tC.noEvalRunsYet2,children:e=>e.runs.slice().reverse().slice(0,8).map(e=>(0,M.jsxs)(`div`,{className:`list-row`,children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`mono`,style:{fontSize:11.5},children:e.runId}),(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[en(e.startedAt),` · `,tn(e.agents.length,`agent`),e.skipped?tC.skipped(e.skipped):``]})]}),(0,M.jsx)(`span`,{className:`chip ${e.failed?`blocking`:`done`}`,children:e.failed?tC.failed(e.failed):tC.allPassed})]},e.runId))})}),(0,M.jsx)(N,{title:tC.compareModels,span:`span 5`,children:(0,M.jsx)(P,{of:e,children:e=>e.modes.allowed.includes(`model`)&&e.models.length>1?(0,M.jsxs)(`p`,{style:{margin:0,fontSize:12.5},children:[tC.approvedModelsLiveEvals(e.models.join(`, `)),(0,M.jsx)(`code`,{className:`mono`,children:tC.atticusEvalRunMode}),`.`]}):(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`span`,{className:`chip dim`,style:{alignSelf:`flex-start`},children:tC.locked}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:tC.availableOnceModelMode(e.modes.default)})]})})})]})]})}var aC=E.governance;function oC(e){let t=A(e.go?`/api/search?q=${encodeURIComponent(e.query)}&limit=8`:void 0),{onDone:n}=e;return(0,v.useEffect)(()=>{t.state!==`loading`&&n()},[t.state,n]),(0,M.jsxs)(N,{title:e.title,span:e.span,meta:t.state===`ready`&&t.data.total?t.data.total:void 0,children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:`0 0 6px`,fontSize:12},children:e.why}),(0,M.jsx)(P,{of:t,empty:e=>e.total===0,emptyText:e.emptyText,children:t=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:0},children:[t.rows.map(t=>(0,M.jsxs)(`div`,{className:`list-row`,children:[(0,M.jsx)(`a`,{href:`#/explore?q=${encodeURIComponent(t.id)}`,style:{fontSize:12.5},children:t.name||t.id}),(0,M.jsx)(`span`,{className:`chip ${e.warn?`warn`:`dim`}`,children:t.system??t.kind})]},t.id)),t.total>t.rows.length&&(0,M.jsx)(`a`,{href:`#/explore?q=${encodeURIComponent(e.query)}`,style:{fontSize:12,marginTop:6},children:aC.allInTheExplorer(t.total)})]})})]})}function sC(){let e=A(`/api/governance`),[t,n]=(0,v.useState)(0),[r]=(0,v.useState)(()=>[0,1,2,3].map(e=>()=>n(t=>Math.max(t,e+1))));return j(t=>{(t.type===`file.changed`||t.type===`index.rebuilt`)&&e.reload()}),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,M.jsx)(`p`,{className:`n`,style:{margin:0,fontSize:24},children:e.state===`ready`?e.data.conformance.passed?aC.theOrgPackConforms:aC.someRulesNeedA:aC.governance}),(0,M.jsx)(`span`,{className:`hud`,children:aC.fromTheFilesAnd})]}),(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:aC.conformance,meta:aC.orgPackChecks,span:`span 6`,children:(0,M.jsx)(P,{of:e,children:e=>{let{pass:t,fail:n,warn:r}=e.conformance.summary,i=t+n,a=i?Math.round(t/i*100):0,o=e.conformance.results.filter(e=>e.status!==`pass`);return(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsxs)(`div`,{className:`row`,children:[(0,M.jsx)(he,{value:t,max:i,size:72,text:`${a}%`,color:n?`var(--amber)`:`var(--green)`,label:aC.ofConformanceChecksPass(t,i)}),(0,M.jsx)(`span`,{style:{fontSize:12.5},children:aC.ofChecksPass(t,i,r?`, ${tn(r,`warning`)}`:``)})]}),o.length>0&&(0,M.jsx)(`ul`,{className:`run-steps`,style:{fontSize:12},children:o.slice(0,6).map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{className:`chip ${e.status===`fail`?`blocking`:`warn`}`,children:e.status.toUpperCase()}),` `,e.file?`${e.file}: `:``,e.message]},`${e.check}${e.file??``}${e.message}`))})]})}})}),(0,M.jsx)(N,{title:aC.rulesAndWaivers,span:`span 6`,children:(0,M.jsx)(P,{of:e,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:0},children:[(0,M.jsxs)(`div`,{className:`list-row`,children:[(0,M.jsx)(`span`,{children:aC.constitutionRules}),(0,M.jsxs)(`span`,{className:`row`,style:{gap:6},children:[(0,M.jsx)(`span`,{className:`n`,style:{fontSize:18},children:e.rules.constitution}),(0,M.jsx)(`span`,{className:`chip dim`,children:aC.locked})]})]}),(0,M.jsxs)(`div`,{className:`list-row`,children:[(0,M.jsx)(`span`,{children:aC.orgPackRules}),(0,M.jsx)(`span`,{className:`n`,style:{fontSize:18},children:e.rules.org})]}),(0,M.jsxs)(`div`,{className:`list-row`,children:[(0,M.jsx)(`span`,{children:aC.teamRules}),(0,M.jsx)(`span`,{className:`n`,style:{fontSize:18},children:e.rules.team})]}),(0,M.jsxs)(`div`,{className:`list-row`,children:[(0,M.jsx)(`span`,{children:aC.activeWaivers}),(0,M.jsx)(`span`,{className:`n`,style:{fontSize:18,color:e.waivers.length?`var(--amber)`:void 0},children:e.waivers.length})]}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`,fontSize:12},children:aC.constitutionRulesCantBe(e.rules.inForce,e.rules.waivable)}),e.rules.refused.map(e=>(0,M.jsx)(`p`,{className:`run-note bad`,children:aC.refused(e.file,e.rule?` (${e.rule})`:``,e.reason)},`${e.file}${e.rule??``}`))]})})}),(0,M.jsx)(N,{title:aC.howOftenRulesAre,span:`span 7`,children:(0,M.jsx)(P,{of:e,empty:e=>e.overrides.rules.length===0,emptyText:aC.noCriticFindingsYet,children:e=>(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{children:aC.rule}),(0,M.jsx)(`th`,{children:aC.findings}),(0,M.jsx)(`th`,{children:aC.dismissed}),(0,M.jsx)(`th`,{children:aC.waived}),(0,M.jsx)(`th`,{children:aC.overridden})]})}),(0,M.jsx)(`tbody`,{children:e.overrides.rules.slice(0,12).map(e=>(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`td`,{className:`mono`,style:{fontSize:11.5},children:e.rule}),(0,M.jsx)(`td`,{children:e.total}),(0,M.jsx)(`td`,{children:e.dismissed}),(0,M.jsx)(`td`,{children:e.waived}),(0,M.jsxs)(`td`,{style:{minWidth:110},children:[(0,M.jsxs)(`span`,{style:{fontSize:11.5},children:[Math.round(e.overrideRate*100),`%`]}),(0,M.jsx)(ge,{value:Math.round(e.overrideRate*100),max:100,color:e.overrideRate>=.5?`var(--amber)`:void 0,label:aC.overridden2(e.rule)})]})]},e.rule))})]}),e.overrides.suggestions.map(e=>(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:e.message},e.rule)),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:aC.acrossARuleDismissed(tn(e.overrides.changes,`change`))})]})})}),(0,M.jsx)(N,{title:aC.waivers,span:`span 5`,children:(0,M.jsx)(P,{of:e,empty:e=>e.waivers.length===0,emptyText:aC.noActiveWaivers,children:e=>e.waivers.map(e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:2,padding:`6px 0`,borderBottom:`1px solid var(--rule)`},children:[(0,M.jsx)(`span`,{style:{fontSize:12.5},children:e.summary}),(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[e.rule,` · `,e.change,` · `,e.gate,e.by?aC.by(e.by,en(e.at)):``]}),e.reason&&(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:aC.reason(e.reason)})]},`${e.change}${e.gate}${e.rule}`))})}),(0,M.jsx)(oC,{go:t>=0,onDone:r[0],title:aC.sensitiveData,why:aC.columnsTaggedWithA,query:`kind:column has:classification`,emptyText:aC.noColumnsAreTagged,span:`span 6`}),(0,M.jsx)(oC,{go:t>=1,onDone:r[1],title:aC.authenticationGaps,why:aC.callsWithNoOauth2,query:`kind:interface missing:auth`,emptyText:aC.everyCallDeclaresHow,span:`span 6`,warn:!0}),(0,M.jsx)(oC,{go:t>=2,onDone:r[2],title:aC.timeoutsAndRetries,why:aC.timeoutAndRetrySettings,query:`kind:setting settingKind:timeout,retry`,emptyText:aC.noTimeoutOrRetry,span:`span 6`}),(0,M.jsx)(oC,{go:t>=3,onDone:r[3],title:aC.retiring,why:aC.recordsPlannedForRetirement,query:`status:planned-retire`,emptyText:aC.nothingIsPlannedFor,span:`span 6`}),(0,M.jsx)(N,{title:aC.incidentMode,span:`span 12`,children:(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:[aC.readOnlyBlastRadius,(0,M.jsx)(`a`,{href:`#/impact`,children:aC.openTheImpactExplorer})]})})]})]})}var cC=E.learning,lC={"not-started":{label:`NEW`,cls:`dim`},"in-progress":{label:cC.inProgress,cls:`warn`},done:{label:`DONE`,cls:`done`}};function uC({cur:e,reload:t}){let[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!1),o=qt(),s=e.step;return s?(0,M.jsxs)(`form`,{className:`stack`,style:{gap:12},onSubmit:e=>{e.preventDefault(),o.run(()=>k(`/api/learning/check`,{method:`POST`,body:n?{answer:n}:{}}).then(e=>{if(e.pass&&(r(``),a(!1),t()),!e.pass)throw Error(`Not yet: ${e.message}${e.hint?`\nHint: ${e.hint}`:``}`);return e}),e=>`Passed: ${e.message}`)},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:cC.stepOf(s.n,e.steps)}),(0,M.jsx)(`p`,{className:`n`,style:{margin:0,fontSize:18},children:s.title}),(0,M.jsx)(`p`,{className:`run-text`,children:s.body}),s.commands.length>0&&(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:cC.tryInTheSandbox}),s.commands.map(e=>(0,M.jsxs)(`div`,{className:`row between run-field`,style:{gridTemplateColumns:`1fr auto`},children:[(0,M.jsx)(`code`,{className:`value`,children:e}),(0,M.jsx)(Yt,{text:e,label:cC.copy(e)})]},e))]}),s.question&&(0,M.jsxs)(`label`,{className:`run-label`,htmlFor:`learn-answer`,children:[s.question,(0,M.jsx)(`input`,{id:`learn-answer`,className:`run-input`,value:n,onChange:e=>r(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:[(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:o.busy,children:cC.checkMyWork}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":i,onClick:()=>a(e=>!e),children:i?cC.hideTheHint:cC.showAHint})]}),i&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:cC.hint(s.hint)}),(0,M.jsx)(Jt,{note:o.note})]}):(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`p`,{className:`run-note ok`,children:cC.youHaveFinishedThis}),(0,M.jsx)(`p`,{className:`run-text`,children:e.outro})]})}function dC(){let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)(!1),i=qt();return(0,M.jsxs)(`form`,{className:`stack`,onSubmit:t=>{t.preventDefault(),e.trim()?(r(!1),i.run(()=>k(`/api/learning/sandbox`,{method:`POST`,body:{dir:e}}),e=>`Made a practice sandbox. Start the app there with: atticus ui --root ${e.root}`)):r(!0)},children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:cC.lessonsRunOnlyIn}),(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,M.jsxs)(`label`,{className:`run-label`,htmlFor:`sandbox-dir`,style:{flex:`1 1 260px`},children:[cC.aNewEmptyFolder,(0,M.jsx)(`input`,{id:`sandbox-dir`,className:`run-input`,value:e,onChange:e=>{t(e.target.value),r(!1)},"aria-describedby":n?`sandbox-dir-blank`:void 0,placeholder:cC.homeYouAtticusSandbox})]}),(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:i.busy,children:cC.makeASandbox})]}),n&&(0,M.jsx)(`p`,{id:`sandbox-dir-blank`,role:`alert`,className:`run-note bad`,children:E.app.needFolder}),(0,M.jsx)(Jt,{note:i.note})]})}function fC(){let e=A(`/api/learning`);ce(e);let[t,n]=(0,v.useState)(`all`),r=qt(),i=e.state===`ready`?e.data.roles:[],a=e.state===`ready`?e.data.lessons.filter(e=>t===`all`||e.role===t):[],o=e.state===`ready`?{done:e.data.lessons.filter(e=>e.state===`done`).length,all:e.data.lessons.length}:{done:0,all:0};return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,M.jsx)(`p`,{className:`n`,style:{margin:0,fontSize:24},children:cC.learning}),e.state===`ready`&&(0,M.jsx)(`span`,{className:`chip ${e.data.sandbox?`done`:`dim`}`,children:e.data.sandbox?cC.practiceSandboxOfflineForge:cC.notASandbox})]}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:cC.lessonsBuiltOnThe}),(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:cC.progress,span:`span 4`,children:(0,M.jsx)(P,{of:e,children:()=>(0,M.jsxs)(`div`,{className:`row`,style:{alignItems:`flex-start`},children:[(0,M.jsx)(he,{value:o.done,max:o.all,size:72,text:o.all?`${Math.round(o.done/o.all*100)}%`:`0%`,label:cC.ofLessonsDone(o.done,o.all)}),(0,M.jsx)(`span`,{style:{fontSize:12.5},children:cC.ofDone(o.done,tn(o.all,`lesson`))})]})})}),(0,M.jsx)(N,{title:cC.progressByKindOf,meta:cC.lessonsDone2,span:`span 8`,children:(0,M.jsx)(P,{of:e,empty:()=>i.length===0,emptyText:cC.noLessonsAreInstalled,children:()=>(0,M.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(180px, 1fr))`,gap:`8px 16px`},children:i.map(e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsxs)(`div`,{className:`row between`,children:[(0,M.jsx)(`span`,{style:{fontSize:12.5},children:e.role}),(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[e.done,`/`,e.lessons]})]}),(0,M.jsx)(ge,{value:e.done,max:e.lessons,label:cC.lessonsDone(e.role)})]},e.role))})})}),e.state===`ready`&&!e.data.sandbox&&(0,M.jsx)(N,{title:cC.practiseInASandbox,span:`span 12`,children:(0,M.jsx)(dC,{})}),e.state===`ready`&&e.data.current&&(0,M.jsx)(N,{title:cC.exercise(e.data.current.title),meta:e.data.current.completed?cC.done:void 0,span:`span 12`,kind:`hero`,children:(0,M.jsx)(uC,{cur:e.data.current,reload:()=>e.reload()},e.data.current.lesson)}),(0,M.jsxs)(N,{title:cC.lessons,span:`span 12`,children:[(0,M.jsx)(`div`,{style:{marginBottom:10},children:(0,M.jsx)(Zt,{label:cC.writtenFor,value:t,onChange:n,options:[{value:`all`,label:cC.everyone},...i.map(e=>({value:e.role,label:e.role}))]})}),(0,M.jsx)(P,{of:e,empty:()=>a.length===0,emptyText:cC.noLessonsWrittenFor,children:t=>(0,M.jsx)(`div`,{className:`stack`,style:{gap:0},children:a.map(n=>(0,M.jsxs)(`article`,{className:`list-row`,style:{alignItems:`flex-start`},children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:3,minWidth:0},children:[(0,M.jsxs)(`span`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,M.jsx)(`span`,{style:{fontSize:13.5},children:n.title}),(0,M.jsxs)(`span`,{className:`chip ${lC[n.state].cls}`,children:[lC[n.state].label,n.state===`in-progress`?` · ${n.done}/${n.steps}`:``]})]}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12.5},children:n.summary}),(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:cC.min(n.role,n.minutes,tn(n.steps,`step`))})]}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:!t.sandbox||r.busy||n.state===`done`,title:t.sandbox?void 0:cC.lessonsRunInA,"aria-label":`${n.state===`in-progress`?cC.continue:cC.start} ${n.title}`,onClick:()=>void r.run(()=>k(`/api/learning/start`,{method:`POST`,body:{lesson:n.id}}).then(t=>(e.reload(),t)),e=>[`Started ${n.title}.`,...e.setup].join(` `)),children:n.state===`in-progress`?cC.continue:n.state===`done`?cC.done2:cC.start})]},n.id))})}),(0,M.jsx)(Jt,{note:r.note}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`,fontSize:12},children:cC.lessonsAndExercisesUse})]})]})]})}var X=E.releaseViews,pC={migration:`MIGRATION`,topic:`TOPIC`,"gateway-route":X.gatewayRoute,code:`CODE`},mC={rollout:X.rollout,rollback:X.rollback2,readiness:X.readiness,verification:X.verification,hypercare:X.hypercare},hC={released:{label:`RELEASED`,chip:`done`},"on-track":{label:X.onTrack,chip:`done`},"at-risk":{label:X.atRisk,chip:`warn`},late:{label:`LATE`,chip:`blocking`},"no-target":{label:X.noTarget,chip:`dim`}};function gC(e,t){return(0,v.useEffect)(()=>{t&&e.reload()},[t]),e}function _C(e){let t=e.state===`filed`?`filed${e.number?` as ${e.number}`:``}`:e.state===`waiting`?X.waitingForAPerson:X.notFiled;return`${e.requestType}${e.record?` for ${e.record}`:``}: ${t}${e.readyBy?`, ready by ${e.readyBy} (${tn(e.waitDays??0,X.workingDay)})`:X.noLeadTimeTo}${e.missing.length?`. Missing ${e.missing.join(`, `)}`:``}.`}function vC({id:e,tick:t}){let n=gC(A(`/api/release/${e}/plan`),t);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(N,{title:X.deploymentPlan,meta:n.state===`ready`?tn(n.data.steps.length,`step`):X.computed,span:`span 5`,children:(0,M.jsx)(P,{of:n,empty:e=>e.steps.length===0,emptyText:X.nothingToDeployYet,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:X.workedOutFromInterfaces}),e.before.length>0&&(0,M.jsx)(`div`,{className:`list-row`,style:{alignItems:`flex-start`},children:(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{style:{fontSize:12.5},children:X.n0BeforeAnything}),e.before.map(e=>(0,M.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[_C(e),` `,(0,M.jsx)(`span`,{className:`hud`,children:e.source})]},e.heading))]})}),(0,M.jsx)(`ol`,{"aria-label":X.deployOrder,className:`stack`,style:{listStyle:`none`,margin:0,padding:0,gap:0},children:e.steps.map(e=>(0,M.jsxs)(`li`,{className:`list-row`,style:{alignItems:`flex-start`,padding:`8px 0`},children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:3,minWidth:0},children:[(0,M.jsxs)(`span`,{style:{fontSize:12.5},children:[e.n,` · `,(0,M.jsx)(`span`,{className:`mono`,children:e.repo}),e.waitDays>0&&(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:X.from(e.earliest)})]}),e.what.map(e=>(0,M.jsx)(`span`,{style:{fontSize:12},children:e},e)),e.why.map(e=>(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:e},e)),e.waitsOn.map(e=>(0,M.jsx)(`span`,{style:{fontSize:11.5,color:`var(--amber)`},children:X.waitsOn(_C(e))},e.heading)),(0,M.jsxs)(`span`,{style:{fontSize:11.5},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:9.5,marginRight:6},children:X.rollback}),e.rollback.text?(0,M.jsxs)(M.Fragment,{children:[e.rollback.text,` `,(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:e.rollback.source})]}):(0,M.jsx)(`span`,{style:{color:`var(--magenta-text)`},children:e.rollback.gap})]})]}),(0,M.jsx)(`span`,{className:`chip ${e.kind===`code`?`dim`:`warn`}`,children:pC[e.kind]})]},e.n))}),e.external.map(e=>(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:[e.what,e.beforeStep?X.beforeStep(e.beforeStep):``,`.`]},e.what)),e.unplaced.length>0&&(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:X.notPlaced}),(0,M.jsx)(`ul`,{className:`run-steps`,children:e.unplaced.map(e=>(0,M.jsx)(`li`,{children:e.why},e.id))})]}),e.findings.length>0&&(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:X.criticReleaseLensStill}),(0,M.jsx)(`ul`,{className:`run-steps`,children:e.findings.map(e=>(0,M.jsxs)(`li`,{children:[e.summary,` `,(0,M.jsx)(`span`,{className:`hud`,children:e.path})]},e.id))})]})]})})}),(0,M.jsx)(N,{title:X.forecast,meta:X.fromDatesNoEstimates,span:`span 4`,children:(0,M.jsx)(P,{of:n,children:e=>{let t=e.forecast,n=hC[t.status];return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:8,alignItems:`baseline`},children:[(0,M.jsx)(`span`,{style:{fontSize:20},className:`mono`,children:t.ready??X.noDate}),(0,M.jsx)(`span`,{className:`chip ${n.chip}`,children:n.label})]}),(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:[t.status===`released`?X.released:X.readyToReleaseBy(tn(t.waitDays,X.workingDay)),` `,t.target?X.target(t.target.date,t.target.source):X.noTargetDateThe]}),t.drivers.length>0&&(0,M.jsx)(`ul`,{className:`run-steps`,"aria-label":X.whatSetsTheDay,children:t.drivers.map(e=>(0,M.jsxs)(`li`,{children:[e.until,`: `,e.what,` `,(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:e.source})]},e.what))}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:X.tasksOfDone(t.tasks.done,t.tasks.total,t.tasks.waitingOnRequests.length?X.waitOnAService(t.tasks.waitingOnRequests.join(`, `)):``)}),t.notes.map(e=>(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:11.5},children:e},e))]})}})}),(0,M.jsx)(N,{title:X.rolloutReadinessAndHypercare,meta:X.fromDesignMd,span:`span 9`,children:(0,M.jsx)(P,{of:n,children:e=>(0,M.jsx)(`dl`,{className:`run-facts`,children:e.sections.map(e=>(0,M.jsxs)(`div`,{style:{display:`contents`},children:[(0,M.jsx)(`dt`,{className:`hud`,children:mC[e.name]??e.name}),(0,M.jsx)(`dd`,{children:e.text?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`run-text`,children:e.text}),` `,(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:e.source})]}):(0,M.jsx)(`span`,{style:{color:`var(--amber)`},children:e.gap})})]},e.name))})})})]})}function yC({id:e,tick:t}){let n=gC(A(`/api/release/${e}/security`),t);return(0,M.jsx)(N,{title:X.securityReviewDraft,meta:X.fromTheCatalogAnd,span:`span 12`,children:(0,M.jsx)(P,{of:n,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:8},children:[(0,M.jsxs)(`p`,{style:{margin:0,fontSize:12.5},children:[(0,M.jsx)(`span`,{className:`hud`,style:{marginRight:8},children:X.signsOff}),e.signOff.how]}),(0,M.jsx)(Yt,{text:e.markdown,label:X.copyTheSecurityReview})]}),e.interfaces.length===0?(0,M.jsx)(`p`,{className:`state`,children:X.interfacesMdListsNo}):(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`caption`,{className:`sr`,children:X.newOrChangedInterfaces}),(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{scope:`col`,children:X.operation}),(0,M.jsx)(`th`,{scope:`col`,children:X.callerCallee}),(0,M.jsx)(`th`,{scope:`col`,children:X.auth}),(0,M.jsx)(`th`,{scope:`col`,children:X.crosses})]})}),(0,M.jsx)(`tbody`,{children:e.interfaces.map(e=>(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`td`,{className:`mono`,children:e.operation}),(0,M.jsxs)(`td`,{children:[e.caller,` → `,e.callee,` (`,e.change,`)`]}),(0,M.jsxs)(`td`,{children:[(0,M.jsx)(`span`,{className:`chip ${e.auth===`not stated`?`blocking`:`done`}`,children:e.auth.toUpperCase()}),` `,(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:e.authSource??X.saidNowhere})]}),(0,M.jsx)(`td`,{children:e.crosses??X.no})]},`${e.operation}|${e.caller}`))})]}),(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:16,alignItems:`flex-start`},children:[(0,M.jsxs)(`div`,{className:`stack`,style:{flex:`1 1 260px`,gap:4},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:X.dataFieldsTouched}),e.fields.length===0?(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:X.dataMdAddsNo}):(0,M.jsx)(`ul`,{className:`run-steps`,children:e.fields.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{className:`mono`,children:e.field}),`: `,e.classification,e.personalLooking?X.looksLikePersonalData:``]},e.field))})]}),(0,M.jsxs)(`div`,{className:`stack`,style:{flex:`1 1 260px`,gap:4},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:X.dataCrossingABoundary}),e.crossings.length===0?(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:X.noNewOrChanged}):(0,M.jsx)(`ul`,{className:`run-steps`,children:e.crossings.map(e=>(0,M.jsxs)(`li`,{children:[e.operation,`: `,e.from,` → `,e.to,` (`,e.toBoundary,`).`,` `,e.fields.length?e.fields.map(e=>`${e.field} (${e.classification}${e.sensitive===`yes`?`, sensitive`:``})`).join(`; `):e.note??X.mappingsMdDoesntSay]},e.operation))})]}),(0,M.jsxs)(`div`,{className:`stack`,style:{flex:`1 1 260px`,gap:4},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:X.vendorsSecretsAndFindings}),(0,M.jsxs)(`ul`,{className:`run-steps`,children:[e.vendors.map(e=>(0,M.jsxs)(`li`,{children:[e.name,`:`,` `,e.isNew?X.aNewVendor:X.alreadyCalled(tn(e.existing,`interface`)),`;`,` `,e.operations.join(`, `)]},e.name)),e.secrets.map(e=>(0,M.jsxs)(`li`,{children:[e.what,` `,(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:e.source})]},`${e.what}|${e.source}`)),e.findings.map(e=>(0,M.jsxs)(`li`,{children:[e.severity,`: `,e.summary]},e.id)),e.vendors.length+e.secrets.length+e.findings.length===0&&(0,M.jsx)(`li`,{children:X.noVendorSecretOr})]})]})]}),e.gaps.length>0&&(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:X.gapsForTheReviewer}),(0,M.jsx)(`ul`,{className:`run-steps`,children:e.gaps.map(e=>(0,M.jsx)(`li`,{children:e},e))})]})]})})})}function bC({id:e,tick:t}){let[n,r]=(0,v.useState)(`business`),i=gC(A(`/api/release/${e}/notes?audience=${n}`),t);return(0,M.jsx)(N,{title:X.releaseNotes,meta:X.generatedNoAi,span:`span 6`,children:(0,M.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:8},children:[(0,M.jsx)(Zt,{label:X.audience,value:n,options:[{value:`business`,label:X.business},{value:`technical`,label:X.technical}],onChange:r}),i.state===`ready`&&(0,M.jsx)(Yt,{text:i.data.markdown,label:X.copyTheReleaseNotes})]}),(0,M.jsx)(P,{of:i,children:e=>(0,M.jsx)(`pre`,{className:`run-text`,tabIndex:0,"aria-label":X.releaseNotes,style:{maxHeight:320,overflow:`auto`,fontFamily:`var(--mono)`,fontSize:12},children:e.markdown})})]})})}function xC({id:e,tick:t}){let n=gC(A(`/api/outcomes?change=${e}`),t),r=A(`/api/health`),i=qt(),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(``),d=t=>{t.preventDefault(),i.run(()=>k(`/api/release/${e}/outcomes`,{method:`POST`,body:{measure:a,value:s,...l.trim()?{note:l}:{}}}).then(()=>{c(``),u(``),n.reload()}),X.recorded)};return(0,M.jsx)(N,{title:X.outcomes,meta:X.theBriefsSuccessMeasures,span:`span 6`,children:(0,M.jsx)(P,{of:n,empty:e=>e.measures.length===0,emptyText:X.briefMdHasNo,children:t=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,M.jsx)(`ul`,{className:`stack`,style:{listStyle:`none`,margin:0,padding:0,gap:0},children:t.measures.map(e=>(0,M.jsxs)(`li`,{className:`list-row`,style:{alignItems:`flex-start`},children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,M.jsxs)(`span`,{style:{fontSize:12.5},children:[e.n,` · `,e.measure]}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:e.latest?X.measuredByOn(e.latest.value,e.latest.by,en(e.latest.at),e.values.length>1?` (${tn(e.values.length,`value`)})`:``):X.notMeasuredYet})]}),(0,M.jsx)(`span`,{className:`chip ${e.latest?`done`:`dim`}`,children:e.latest?X.measured:X.open})]},e.id))}),t.orphans.map(e=>(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:X.recordedButBriefMd(e.measure)},e.id)),t.canRecord?(0,M.jsxs)(`form`,{onSubmit:d,className:`stack`,"aria-label":X.recordAnOutcome,children:[(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,M.jsxs)(`label`,{className:`run-label`,htmlFor:`om-${e}`,style:{flex:`1 1 200px`},children:[X.measure,(0,M.jsxs)(`select`,{id:`om-${e}`,className:`run-select`,value:a,required:!0,onChange:e=>o(e.target.value),children:[(0,M.jsx)(`option`,{value:``,children:X.chooseAMeasure}),t.measures.map(e=>(0,M.jsxs)(`option`,{value:e.id,children:[e.n,` · `,e.measure]},e.id))]})]}),(0,M.jsxs)(`label`,{className:`run-label`,htmlFor:`ov-${e}`,style:{flex:`1 1 160px`},children:[X.whatYouMeasured,(0,M.jsx)(`input`,{id:`ov-${e}`,className:`run-input`,value:s,required:!0,onChange:e=>c(e.target.value)})]})]}),(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,M.jsxs)(`label`,{className:`run-label`,htmlFor:`on-${e}`,style:{flex:`1 1 240px`},children:[X.howOptional,(0,M.jsx)(`input`,{id:`on-${e}`,className:`run-input`,value:l,onChange:e=>u(e.target.value)})]}),(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:i.busy||!a||!s.trim(),children:X.record(r.state===`ready`?X.as(r.data.user):``)})]}),(0,M.jsx)(Jt,{note:i.note})]}):(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:t.why})]})})})}function SC(e,t){let n=URL.createObjectURL(new Blob([t],{type:`text/markdown;charset=utf-8`})),r=document.createElement(`a`);r.href=n,r.download=e,document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}function CC(e,t,n){let r=`evidence-${e}.md`;return n?{saved:!1,text:E.app.panelNoSave(r,`atticus release evidence ${e} --out <folder>`)}:{saved:!0,text:`Saved ${r}: the summary, ${tn(t.files.length,`file`)} with their sha-256, rounds, waivers, approvals, trace, requests, drift and AI runs.`}}function wC({id:e}){let t=qt(),[n,r]=(0,v.useState)();return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:t.busy,onClick:()=>void t.run(()=>k(`/api/release/${e}/evidence`).then(t=>{let n=!!T();return n?r(t.markdown):SC(`evidence-${e}.md`,t.markdown),CC(e,t,n)}),e=>e.text),children:X.exportEvidencePack})}),(0,M.jsx)(Jt,{note:t.note}),n!==void 0&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`label`,{htmlFor:`evidence-${e}`,className:`sr`,children:X.evidenceMd(e)}),(0,M.jsx)(`textarea`,{id:`evidence-${e}`,className:`run-textarea`,readOnly:!0,rows:10,value:n}),(0,M.jsx)(`div`,{children:(0,M.jsx)(Yt,{text:n,label:X.copyEvidenceMd(e)})})]})]})}var TC=E.release,EC={"release-ready":TC.atGoNoGo,released:`RELEASED`,"post-release-review":TC.postReleaseReview};function DC({list:e,current:t}){return(0,M.jsx)(N,{title:TC.changes,span:`span 3`,rows:`span 3`,children:(0,M.jsx)(P,{of:e,empty:e=>e.length===0,emptyText:TC.noChangesInFlight,children:e=>(0,M.jsx)(`nav`,{"aria-label":TC.changes,className:`stack`,style:{gap:2},children:e.map(e=>(0,M.jsxs)(`a`,{href:`#/release/${e.id}`,"aria-current":e.id===t?`page`:void 0,className:`list-row`,style:{textDecoration:`none`,padding:`8px 6px`,borderRadius:6,background:e.id===t?`var(--picked)`:void 0},children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2,minWidth:0},children:[(0,M.jsx)(`span`,{className:`mono`,style:{fontSize:12},children:e.id}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:e.title})]}),(0,M.jsx)(`span`,{className:`chip ${e.atRelease?`warn`:`dim`}`,children:EC[e.state]??e.state.toUpperCase()})]},e.id))})})})}function OC(e){return(0,M.jsxs)(`li`,{"aria-label":`${e.label}: ${e.value}`,children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:e.label}),(0,M.jsx)(`span`,{className:`chip ${e.ok?`done`:e.warn?`warn`:`blocking`}`,style:{alignSelf:`flex-start`},children:e.value}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:e.detail})]})}function kC({id:e}){let t=A(`/api/release/${e}`),n=qt(),[r,i]=(0,v.useState)(0);j(e=>{e.type===`file.changed`&&(t.reload(),i(e=>e+1))});let a=(e,r,i)=>void n.run(()=>k(e,{method:`POST`,body:r}).then(()=>t.reload()),i);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(N,{title:t.state===`ready`?`${t.data.change.id} · ${t.data.change.title}`:e,span:`span 9`,kind:`hero`,children:(0,M.jsx)(P,{of:t,children:t=>{let r=t.openFindings.blocking+t.openFindings.gap,i=t.handoff?.approvals.map(e=>e.by)??[];return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[(0,M.jsxs)(`p`,{style:{margin:0,fontSize:14},children:[(0,M.jsx)(`span`,{className:`hud`,style:{marginRight:8},children:TC.next}),t.status.nextStep]}),(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[(0,M.jsx)(`span`,{className:`chip dim`,children:TC.type(t.change.type.toUpperCase())}),(0,M.jsx)(`span`,{className:`chip ${t.status.risk.level===`high`?`blocking`:t.status.risk.level===`medium`?`warn`:``}`,children:TC.risk(t.status.risk.level.toUpperCase())}),(0,M.jsx)(`span`,{className:`chip`,children:(EC[t.change.state]??t.change.state).toUpperCase()})]}),(0,M.jsxs)(`ul`,{className:`run-gates`,"aria-label":TC.gatesToGoLive,children:[(0,M.jsx)(OC,{label:TC.requests,value:t.requests.total===0?TC.noneNeeded:t.requests.toFile?`${t.requests.toFile} NOT FILED`:`${t.requests.filed} FILED`,ok:t.requests.toFile===0,detail:t.requests.total===0?TC.snowMdListsNo:TC.ofFiled(t.requests.filed,t.requests.total)}),(0,M.jsx)(OC,{label:TC.findings,value:r?`${r} OPEN`:`CLEAR`,ok:r===0,detail:TC.blocking(t.openFindings.blocking,tn(t.openFindings.gap,TC.knowledgeGap))}),(0,M.jsx)(OC,{label:TC.goNoGoPr,value:t.handoff?t.handoff.state===`merged`?`MERGED`:i.length?TC.approvedNotMerged:t.handoff.state.toUpperCase():t.change.state===`release-ready`?TC.notRaised:`LATER`,ok:t.handoff?.state===`merged`,warn:!t.handoff,detail:t.handoff?TC.mergingIsTheGo(t.handoff.pr,i.length?TC.approvedBy(i.join(`, `)):``):TC.goNoGoIs}),(0,M.jsx)(OC,{label:TC.archiveGate,value:t.archive.pass?`OPEN`:`${t.archive.blockers.length} BLOCKERS`,ok:t.archive.pass,warn:!t.archive.pass&&t.change.state!==`released`,detail:TC.opensOnceReleasedMerged})]}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:TC.aPersonApprovesEvery}),(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:[(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:n.busy||t.change.state!==`release-ready`||!!t.handoff&&t.handoff.state===`open`,title:t.change.state===`release-ready`?void 0:TC.theChangeReachesGo,onClick:()=>a(`/api/changes/${e}/handoff`,{},TC.goNoGoPr2),children:TC.askForGoNo}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:n.busy||!t.handoff,title:TC.readsThePrMerges,onClick:()=>a(`/api/changes/${e}/sync`,{},TC.syncedWithTheGit),children:TC.syncAndMergeWhen}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:n.busy||![`released`,`post-release-review`].includes(t.change.state),title:TC.archivesTheChangeAnd,onClick:()=>a(`/api/release/${e}/archive`,{},TC.archivedItsReposWere),children:TC.archive})]}),(0,M.jsx)(Jt,{note:n.note})]})}})}),(0,M.jsx)(vC,{id:e,tick:r}),(0,M.jsx)(N,{title:TC.whatStopsIt,span:`span 6`,children:(0,M.jsx)(P,{of:t,empty:e=>e.status.blockers.length+e.status.reasons.length===0,emptyText:TC.nothingStopsThisChange,children:e=>(0,M.jsx)(`ul`,{className:`run-steps`,children:[...e.status.blockers,...e.status.reasons].filter((e,t,n)=>n.findIndex(t=>t.message===e.message)===t).map(e=>(0,M.jsx)(`li`,{children:e.message},e.message))})})}),(0,M.jsx)(N,{title:TC.archiveGate,span:`span 6`,children:(0,M.jsx)(P,{of:t,children:e=>e.archive.pass?(0,M.jsx)(`p`,{className:`run-note ok`,children:TC.theChangeMayBe}):(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`ul`,{className:`run-steps`,children:e.archive.blockers.map(e=>(0,M.jsx)(`li`,{children:e.message},e.message))}),e.archive.notes.map(e=>(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:e},e))]})})}),(0,M.jsx)(N,{title:TC.conflictsWithOtherChanges,span:`span 6`,children:(0,M.jsx)(P,{of:t,empty:e=>e.conflicts.length===0,emptyText:TC.noOtherOpenChange,children:e=>e.conflicts.map(e=>(0,M.jsxs)(`div`,{className:`list-row`,style:{alignItems:`flex-start`},children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`a`,{href:`#/release/${e.with}`,className:`mono`,children:e.with}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:TC.alsoTouchesAgreeAn(Object.entries(e.overlap).filter(([,e])=>e.length).map(([e,t])=>`${e} ${t.join(`, `)}`).join(`; `))})]}),(0,M.jsx)(`span`,{className:`chip warn`,children:TC.overlap})]},e.with))})}),(0,M.jsx)(N,{title:TC.evidencePack,meta:t.state===`ready`?tn(t.data.evidence.length,`file`):void 0,span:`span 6`,children:(0,M.jsx)(P,{of:t,empty:e=>e.evidence.length===0,emptyText:TC.theChangeFolderIs,children:t=>(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:TC.forTheApprovalBoard}),(0,M.jsx)(wC,{id:e}),(0,M.jsx)(`ul`,{tabIndex:0,"aria-label":TC.evidenceFiles,style:{listStyle:`none`,margin:0,padding:0,maxHeight:220,overflow:`auto`},children:t.evidence.map(e=>(0,M.jsxs)(`li`,{className:`list-row`,style:{padding:`4px 0`},children:[(0,M.jsx)(`span`,{className:`mono`,style:{fontSize:11.5},children:e.path}),(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:9.5},children:e.bytes<1024?`${e.bytes} B`:TC.kb(Math.round(e.bytes/1024))})]},e.path))})]})})}),(0,M.jsx)(yC,{id:e,tick:r}),(0,M.jsx)(bC,{id:e,tick:r}),(0,M.jsx)(xC,{id:e,tick:r})]})}function AC({hash:e}){let t=e.replace(/^#\/?release\/?/,``).split(`?`)[0]||void 0,n=A(`/api/release`),r=t??(n.state===`ready`?n.data[0]?.id:void 0);return(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(DC,{list:n,current:r}),r?(0,M.jsx)(kC,{id:r},r):(0,M.jsx)(N,{title:TC.noChangeSelected,span:`span 9`,children:(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:TC.pickAChangeOn})})]})}var jC=E.repos;function MC(e){return[...new Set(e.split(/[\n,]/).map(e=>e.trim()).filter(Boolean))]}function NC({c:e}){return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},"aria-live":`polite`,children:[(0,M.jsx)(`p`,{style:{margin:0},children:jC.compared(e.branch,e.added.length,e.removed.length,e.changed.length)}),e.added.length+e.removed.length+e.changed.length>0&&(0,M.jsxs)(`ul`,{className:`mono`,style:{margin:0,paddingLeft:18,fontSize:12},children:[e.added.map(e=>(0,M.jsxs)(`li`,{children:[`+ `,e]},`+${e}`)),e.removed.map(e=>(0,M.jsxs)(`li`,{children:[`- `,e]},`-${e}`)),e.changed.map(e=>(0,M.jsxs)(`li`,{children:[`~ `,e.record,` (`,e.fields.join(`, `),`)`]},`~${e.record}`))]})]})}function PC({r:e,onChanged:t}){let n=e.description,r=n?.trust===`suggested`,[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(n?.text??``),c=De(),l=(n,r)=>c.run(async()=>{let r=await k(`/api/repos/${e.id}/description`,{method:`PUT`,body:n});return a(!1),t?.(),r},r),u=o.trim().length>300,d=!o.trim();return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4,margin:`8px 0`},children:[(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`baseline`},children:[(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:jC.about}),r&&(0,M.jsx)(`span`,{className:`chip warn`,title:jC.aboutDraftWhy(n.by??`Your assistant`),children:jC.aboutDraft})]}),(0,M.jsxs)(`p`,{style:{margin:0,maxWidth:`70ch`},children:[n?n.text:(0,M.jsx)(`span`,{className:`muted`,children:jC.noAbout}),n?.by&&!r&&(0,M.jsx)(`span`,{className:`muted`,children:` · ${jC.aboutBy(n.by)}`})]}),n&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12,maxWidth:`70ch`},children:r?jC.aboutDraftWhy(n.by??`Your assistant`):jC.aboutWhy}),r&&!!n?.cites?.length&&(0,M.jsx)(`p`,{className:`muted mono`,style:{margin:0,fontSize:12},children:`${jC.aboutCites}: ${n.cites.map(e=>`${e.file}:${e.line}`).join(`, `)}`}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,M.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":i,"aria-controls":`repo-${e.id}-about-form`,onClick:()=>a(!i),children:n?jC.editAboutDraft:jC.editAbout}),r&&(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:c.busy,onClick:()=>void l({accept:!0},jC.aboutSaved),children:jC.acceptAbout}),n&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:c.busy,onClick:()=>void l({reject:!0},jC.aboutDropped),children:jC.rejectAbout})]}),i&&(0,M.jsxs)(`form`,{id:`repo-${e.id}-about-form`,className:`stack`,style:{gap:4},onSubmit:e=>{e.preventDefault(),!(d||u)&&l({text:o.trim()},jC.aboutSaved)},children:[(0,M.jsxs)(`label`,{className:`stack`,htmlFor:`repo-${e.id}-about`,children:[(0,M.jsx)(`span`,{children:jC.about}),(0,M.jsx)(`span`,{className:`muted`,id:`repo-${e.id}-about-hint`,children:jC.aboutHint})]}),(0,M.jsx)(`textarea`,{id:`repo-${e.id}-about`,className:`field`,rows:2,maxLength:300,value:o,"aria-describedby":`repo-${e.id}-about-hint`,"aria-invalid":u||void 0,onChange:e=>s(e.target.value)}),u&&(0,M.jsx)(`p`,{role:`alert`,style:{margin:0},children:jC.aboutTooLong(300)}),(0,M.jsx)(`div`,{className:`row`,style:{gap:8},children:(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:c.busy||d||u,children:jC.save})}),d&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:jC.aboutEmpty})]}),(0,M.jsx)(Oe,{note:c.note})]})}function FC({r:e,onChanged:t}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(e.defaultBranch),[o,s]=(0,v.useState)(e.branches.join(`
|
|
20
|
+
`)),[c,l]=(0,v.useState)(),u=De(),d=De(),f=e.remoteDefault&&e.remoteDefault!==e.defaultBranch;return(0,M.jsxs)(`article`,{className:`list-row`,style:{display:`block`},"aria-labelledby":`repo-${e.id}`,children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,gap:8},children:[(0,M.jsx)(`h3`,{id:`repo-${e.id}`,className:`h`,style:{fontSize:14,margin:0},children:e.id}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:jC.typeOwner(e.type,e.owner)})]}),(0,M.jsx)(PC,{r:e,onChanged:t}),(0,M.jsxs)(`dl`,{className:`run-facts`,style:{margin:`8px 0`},children:[(0,M.jsx)(`dt`,{children:jC.url}),(0,M.jsx)(`dd`,{className:`mono`,style:{wordBreak:`break-all`},children:e.url}),(0,M.jsx)(`dt`,{children:jC.defaultBranch}),(0,M.jsxs)(`dd`,{children:[(0,M.jsx)(`span`,{className:`mono`,children:e.defaultBranch}),e.commit&&(0,M.jsx)(`span`,{className:`muted`,children:` · ${jC.atCommit(e.commit.slice(0,7))}`}),f&&(0,M.jsx)(`span`,{className:`chip warn`,style:{marginLeft:6},children:jC.remoteSays(e.remoteDefault)})]}),(0,M.jsx)(`dt`,{children:jC.branches}),(0,M.jsx)(`dd`,{children:e.branches.length?e.branches.join(`, `):jC.noBranches})]}),e.scans.length>0&&(0,M.jsx)(`ul`,{style:{margin:`0 0 8px`,paddingLeft:18,fontSize:12.5},children:e.scans.map(e=>(0,M.jsx)(`li`,{children:jC.scanned(e.branch,e.scannedAt.slice(0,10),e.commit.slice(0,7))},e.branch))}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[e.branches.map(t=>(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:u.busy,onClick:()=>void u.run(()=>k(`/api/scan`,{method:`POST`,body:{repos:[e.id],ref:t}}),jC.scanStarted(t)),children:jC.scan(t)},`scan-${t}`)),e.scans.map(t=>(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:u.busy,onClick:()=>void u.run(async()=>{l(await k(`/api/repos/compare?branch=${encodeURIComponent(t.branch)}`))},jC.comparedNow),children:jC.compare(t.branch,e.defaultBranch)},`cmp-${t.branch}`)),(0,M.jsx)(`button`,{type:`button`,className:`btn`,"aria-expanded":n,onClick:()=>r(!n),children:jC.edit})]}),(0,M.jsx)(Oe,{note:u.note}),c&&(0,M.jsx)(NC,{c}),n&&(0,M.jsxs)(`form`,{className:`stack`,style:{marginTop:8},onSubmit:n=>{n.preventDefault(),d.run(async()=>{let n=await k(`/api/repos/${e.id}/branches`,{method:`PUT`,body:{defaultBranch:i,branches:MC(o)}});return t?.(),n},jC.saved)},children:[(0,M.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`span`,{style:{minWidth:140},children:jC.defaultBranch}),(0,M.jsx)(`input`,{id:`repo-${e.id}-default`,className:`field mono`,value:i,onChange:e=>a(e.target.value)})]}),(0,M.jsxs)(`label`,{className:`stack`,htmlFor:`repo-${e.id}-branches`,children:[(0,M.jsx)(`span`,{children:jC.branches}),(0,M.jsx)(`span`,{className:`muted`,children:jC.branchesHint})]}),(0,M.jsx)(`textarea`,{id:`repo-${e.id}-branches`,className:`field mono`,rows:3,value:o,onChange:e=>s(e.target.value)}),(0,M.jsx)(`div`,{className:`row`,style:{gap:8},children:(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:d.busy,children:jC.save})}),(0,M.jsx)(Oe,{note:d.note})]})]})}function IC(){let e=A(`/api/repos/branches`);return ce(e),(0,M.jsxs)(N,{title:jC.title,children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:`0 0 8px`,maxWidth:`70ch`},children:jC.intro}),(0,M.jsx)(P,{of:e,empty:e=>e.repos.length===0,emptyText:jC.empty,children:t=>(0,M.jsx)(`div`,{className:`stack`,style:{gap:8},children:t.repos.map(t=>(0,M.jsx)(FC,{r:t,onChanged:e.reload},t.id))})})]})}var Z=E.serviceDesk,LC={"to-file":{label:Z.toFile2,cls:`warn`},waiting:{label:Z.waitingForYou,cls:`ai`},filed:{label:`FILED`,cls:`done`}},RC=e=>`${e.change}|${e.heading}`;function zC({done:e}){let t=A(`/api/changes`),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!1),o=qt();return(0,M.jsx)(P,{of:t,empty:e=>e.length===0,emptyText:Z.noChangesToDraft,children:t=>(0,M.jsxs)(`form`,{className:`stack`,onSubmit:r=>{r.preventDefault();let a=n||t[0].id;o.run(()=>k(`/api/service-desk/${a}/draft`,{method:`POST`,body:i?{force:!0}:{}}).then(t=>(e(),t)).catch(Kt(E.app.forceSnow)),e=>e.lines.join(`
|
|
21
|
+
`)||Z.drafted)},children:[(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,M.jsxs)(`label`,{className:`run-label`,htmlFor:`draft-change`,children:[Z.draftTheRequestsA,(0,M.jsx)(`select`,{id:`draft-change`,className:`run-select`,value:n||t[0].id,onChange:e=>r(e.target.value),children:t.map(e=>(0,M.jsxs)(`option`,{value:e.id,children:[e.id,` (`,e.state,`)`]},e.id))})]}),(0,M.jsxs)(`label`,{className:`row`,style:{gap:6,fontSize:12.5},htmlFor:`draft-force`,children:[(0,M.jsx)(`input`,{id:`draft-force`,type:`checkbox`,checked:i,onChange:e=>a(e.target.checked)}),Z.replaceASnowMd]}),(0,M.jsx)(`button`,{type:`submit`,className:`btn`,disabled:o.busy,children:Z.draftFromTheOrg})]}),(0,M.jsx)(Jt,{note:o.note})]})})}function BC({r:e,done:t}){let n=qt(),r=e.fields.map(e=>`${e.name}: ${e.value}`).join(`
|
|
22
|
+
`);return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[(0,M.jsx)(`span`,{className:`chip ${LC[e.state].cls}`,children:LC[e.state].label}),(0,M.jsx)(`a`,{className:`chip`,href:`#/changes/${e.change}`,children:e.change}),e.template?(0,M.jsx)(`span`,{className:`chip dim`,children:Z.template(e.template)}):(0,M.jsx)(`span`,{className:`chip blocking`,children:Z.noTemplateMatches})]}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:Z.approversValuesComeFrom(e.leadTimeDays===void 0?``:Z.leadTimeDays(e.leadTimeDays),e.approvers.join(`, `)||Z.noneNamed)}),(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`div`,{className:`row between`,style:{marginBottom:4},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:Z.fields}),(0,M.jsx)(Yt,{text:r,label:Z.copyAllFields})]}),e.fields.map(e=>(0,M.jsxs)(`div`,{className:`run-field`,children:[(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:10},children:[e.name,e.required?Z.required:``]}),(0,M.jsx)(`span`,{className:`value ${e.value?``:`empty`}`,children:e.value||(e.required?Z.missingFillItIn:Z.empty)}),e.value?(0,M.jsx)(Yt,{text:e.value,label:Z.copy(e.name)}):(0,M.jsx)(`span`,{})]},e.name))]}),e.state===`to-file`&&(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:Z.atticusNeverCallsThe}),(0,M.jsx)(`div`,{className:`row`,children:(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:n.busy||e.missing.length>0,title:e.missing.length?Z.fillFirst(e.missing.join(`, `)):void 0,onClick:()=>void n.run(()=>k(`/api/service-desk/${e.change}/submit`,{method:`POST`,body:{}}).then(e=>(t(),e)),e=>e.lines.join(`
|
|
23
|
+
`)||Z.filedAsAStep),children:Z.fileSCompleteDrafts(e.change)})}),e.missing.length>0&&(0,M.jsx)(`p`,{className:`run-note bad`,children:Z.fillInSnowMd(e.missing.join(`, `))})]}),e.state===`waiting`&&(0,M.jsxs)(`p`,{style:{margin:0,fontSize:12.5},children:[Z.filedAsStep,(0,M.jsx)(`span`,{className:`mono`,children:e.step}),Z.submitItInThe,(0,M.jsx)(`a`,{href:`#/todo`,children:Z.recordTheRequestNumber}),`.`]}),e.state===`filed`&&(0,M.jsxs)(`p`,{className:`run-note ok`,children:[Z.filedAs(e.number??``),e.url?(0,M.jsxs)(M.Fragment,{children:[` `,`(`,(0,M.jsx)(pe,{href:e.url,children:Z.open}),`)`]}):null,`.`]}),(0,M.jsx)(Jt,{note:n.note})]})}function VC(){let e=A(`/api/service-desk`),[t,n]=(0,v.useState)(`all`),[r,i]=(0,v.useState)();j(t=>{t.type===`file.changed`&&e.reload()});let a=e.state===`ready`?e.data.requests:[],o=a.filter(e=>t===`all`||e.state===t),s=o.find(e=>RC(e)===r)??o[0],c=e=>a.filter(t=>t.state===e).length;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,M.jsx)(`p`,{className:`n`,style:{margin:0,fontSize:24},children:e.state===`ready`?c(`to-file`)?Z.toFile(tn(c(`to-file`),`request`)):Z.nothingToFile:Z.serviceDeskQueue}),(0,M.jsx)(Zt,{label:Z.show,value:t,onChange:n,options:[{value:`all`,label:`All ${a.length}`},{value:`to-file`,label:`To file ${c(`to-file`)}`},{value:`waiting`,label:`Waiting ${c(`waiting`)}`},{value:`filed`,label:`Filed ${c(`filed`)}`}]})]}),(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0},children:[Z.draftsOnlyYouFile,(0,M.jsx)(`a`,{href:`#/release`,children:Z.releasePlan}),`.`]}),(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:Z.queue,span:`span 4`,children:(0,M.jsx)(P,{of:e,empty:()=>a.length===0,emptyText:Z.noDraftsYet,children:()=>(0,M.jsx)(F,{title:Z.requests,parts:[{label:Z.toFile3,value:c(`to-file`),color:`var(--amber)`},{label:Z.waitingForYou2,value:c(`waiting`),color:`var(--violet)`},{label:Z.filed,value:c(`filed`),color:`var(--green)`}]})})}),(0,M.jsx)(N,{title:Z.serviceDeskAdapter,span:`span 4`,children:(0,M.jsx)(P,{of:e,children:e=>(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`div`,{className:`row`,children:(0,M.jsx)(Qt,{type:e.adapter.configured})}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:Z.writesFromTheApp}),(0,M.jsx)(`p`,{style:{margin:0,fontSize:12.5},children:Z.inTheOrgPack(e.exports.files.length?Z.from(tn(e.exports.requests,Z.pastRequest),tn(e.exports.files.length,`export`)):Z.noDeskExportLoaded,tn(e.templates.length,Z.requestTemplate))})]})})}),(0,M.jsx)(N,{title:Z.localAutomationTool,span:`span 4`,children:(0,M.jsx)(P,{of:e,children:e=>(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:e.executors.length?e.executors.map(e=>(0,M.jsx)(`span`,{className:`chip ai`,children:Z.approveEachWrite(e)},e)):(0,M.jsx)(`span`,{className:`chip dim`,children:Z.noneAllowedHere})}),(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:[Z.calledThroughTheCommon,(0,M.jsx)(`a`,{href:`#/todo`,children:Z.toDo}),Z.noCredentialsPassTo,(0,M.jsx)(`a`,{href:`#/settings`,children:Z.executorsAllowList})]})]})})}),(0,M.jsx)(N,{title:Z.requests,meta:o.length,span:`span 4`,rows:`span 2`,children:(0,M.jsx)(P,{of:e,empty:()=>o.length===0,emptyText:a.length?Z.noneInThisView:Z.noServiceDeskDrafts,children:()=>(0,M.jsx)(`nav`,{"aria-label":Z.requests,className:`stack`,style:{gap:2},children:Object.entries(o.reduce((e,t)=>((e[t.requestType]??=[]).push(t),e),{})).map(([e,t])=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10,marginTop:6},children:e}),t.map(e=>(0,M.jsxs)(`button`,{type:`button`,className:`run-pick`,"aria-current":s&&RC(s)===RC(e)?`true`:void 0,onClick:()=>i(RC(e)),children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2,minWidth:0},children:[(0,M.jsx)(`span`,{style:{fontSize:12.5},children:e.record||e.heading}),(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[e.change,e.missing.length?Z.toFill(e.missing.length):``]})]}),(0,M.jsx)(`span`,{className:`chip ${LC[e.state].cls}`,children:LC[e.state].label})]},RC(e)))]},e))})})}),(0,M.jsx)(N,{title:s?s.heading:Z.noRequestSelected,span:`span 8`,kind:`hero`,children:(0,M.jsx)(P,{of:e,empty:()=>!s,emptyText:Z.pickARequestOn,children:()=>(0,M.jsx)(BC,{r:s,done:()=>e.reload()},RC(s))})}),(0,M.jsx)(N,{title:Z.draftRequests,span:`span 8`,children:(0,M.jsx)(zC,{done:()=>e.reload()})})]})]})}var HC=E.aiSettings,UC=e=>e.split(/\r?\n/).map(e=>e.trim()).filter(Boolean);function WC(e){let t=/^\d+$/.test(e.defaultTokens.trim())?Number(e.defaultTokens.trim()):NaN;if(!Number.isSafeInteger(t)||t<=0)return{error:HC.badDefaultTokens};let n={};for(let t of UC(e.perAgent)){let e=/^([a-z0-9][a-z0-9-]*)\s*:\s*(\d+)$/.exec(t);if(!e||Number(e[2])<=0)return{error:HC.badBudgetLine(t)};n[e[1]]=Number(e[2])}return{models:{allowed:UC(e.models),recommended:e.recommended},budgets:{defaultTokens:t,perAgent:n}}}var GC=[`hand-off`,`model`,`headless-claude-code`],KC=[`on`,`text-only`,`off`];function qC(e){let t=e.limits?WC(e.limits):void 0;if(t&&`error`in t)throw Error(t.error);return{...t??{},ai:e.ai,modes:e.modes,assistants:e.assistants,model:e.provider?{type:e.provider,settings:Object.fromEntries(Object.entries(e.settings).filter(([,e])=>e.trim()!==``))}:null}}var JC=e=>({ai:e.ai,modes:e.modes,assistants:{allowed:e.assistants.filter(e=>e.allowed).map(e=>e.id),default:e.assistants.find(e=>e.default)?.id??e.assistants[0]?.id??`copilot`},provider:e.model?.type??``,settings:Object.fromEntries(Object.entries(e.model?.settings??{}).map(([e,t])=>[e,String(t)])),limits:{models:e.models.allowed.join(`
|
|
24
|
+
`),recommended:e.models.recommended,defaultTokens:String(e.budgets.defaultTokens),perAgent:Object.entries(e.budgets.perAgent).map(([e,t])=>`${e}: ${t}`).join(`
|
|
25
|
+
`)}}),YC=(e,t,n)=>n?[...new Set([...e,t])]:e.filter(e=>e!==t);function XC(e){let[t,n]=(0,v.useState)(()=>JC(e.data)),r=qt(),i=qt(),a=qt(),[o,s]=(0,v.useState)(``),c=e.data.providers.find(e=>e.type===t.provider)?.settings??[],l=t.settings.keyEnv?.trim(),u=e.data.model?.type;return(0,M.jsxs)(`form`,{className:`stack`,onSubmit:n=>{n.preventDefault(),r.run(async()=>{await k(`/api/settings/ai`,{method:`PUT`,body:qC(t)}),e.onSaved?.()},HC.saved(e.data.path))},children:[(0,M.jsx)(`h2`,{className:`h`,children:HC.title}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,maxWidth:`70ch`},children:HC.intro}),(0,M.jsxs)(`fieldset`,{className:`stack`,children:[(0,M.jsx)(`legend`,{className:`hud`,children:HC.aiLabel}),KC.map(e=>(0,M.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`input`,{type:`radio`,id:`ai-on-${e}`,name:`ai`,checked:t.ai===e,onChange:()=>n({...t,ai:e})}),HC.ai[e]]},e))]}),(0,M.jsxs)(`fieldset`,{className:`stack`,children:[(0,M.jsx)(`legend`,{className:`hud`,children:HC.assistantsLabel}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:HC.assistantsHint}),e.data.assistants.map(e=>(0,M.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`input`,{type:`checkbox`,id:`ai-assistant-${e.id}`,checked:t.assistants.allowed.includes(e.id),onChange:r=>n({...t,assistants:{...t.assistants,allowed:YC(t.assistants.allowed,e.id,r.target.checked)}})}),e.name]},e.id)),(0,M.jsxs)(`label`,{className:`row`,style:{gap:8},children:[HC.defaultAssistant,(0,M.jsx)(`select`,{id:`ai-default-assistant`,className:`field`,value:t.assistants.default,onChange:e=>n({...t,assistants:{...t.assistants,default:e.target.value}}),children:e.data.assistants.filter(e=>t.assistants.allowed.includes(e.id)).map(e=>(0,M.jsx)(`option`,{value:e.id,children:e.name},e.id))})]})]}),(0,M.jsxs)(`fieldset`,{className:`stack`,children:[(0,M.jsx)(`legend`,{className:`hud`,children:HC.modesLabel}),GC.map(e=>(0,M.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`input`,{type:`checkbox`,id:`ai-mode-${e}`,checked:t.modes.allowed.includes(e),onChange:r=>n({...t,modes:{...t.modes,allowed:YC(t.modes.allowed,e,r.target.checked)}})}),HC.modes[e]]},e)),(0,M.jsxs)(`label`,{className:`row`,style:{gap:8},children:[HC.defaultMode,(0,M.jsx)(`select`,{id:`ai-default-mode`,className:`field`,value:t.modes.default,onChange:e=>n({...t,modes:{...t.modes,default:e.target.value}}),children:t.modes.allowed.map(e=>(0,M.jsx)(`option`,{value:e,children:HC.modes[e]},e))})]})]}),(0,M.jsxs)(`fieldset`,{className:`stack`,children:[(0,M.jsx)(`legend`,{className:`hud`,children:HC.providerLabel}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:HC.providerHint}),(0,M.jsxs)(`select`,{id:`ai-provider`,className:`field`,"aria-label":HC.providerLabel,value:t.provider,onChange:e=>n({...t,provider:e.target.value}),children:[(0,M.jsx)(`option`,{value:``,children:HC.noProvider}),e.data.providers.map(e=>(0,M.jsx)(`option`,{value:e.type,children:e.plugin?HC.pluginProvider(e.type,!!e.pinned):e.type},e.type))]}),c.map(e=>(0,M.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`span`,{className:`mono`,style:{minWidth:140},children:e}),(0,M.jsx)(`input`,{id:`ai-setting-${e}`,className:`field`,value:t.settings[e]??``,onChange:r=>n({...t,settings:{...t.settings,[e]:r.target.value}})})]},e)),l&&u===t.provider&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},role:`note`,children:e.data.keySet?HC.keySet(l):HC.keyNotSet(l)}),l&&(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,M.jsx)(`label`,{htmlFor:`ai-key`,className:`mono`,children:HC.keyLabel(l)}),(0,M.jsx)(`input`,{id:`ai-key`,type:`password`,className:`field`,autoComplete:`off`,value:o,onChange:e=>s(e.target.value)}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:a.busy||!o.trim(),onClick:()=>void a.run(async()=>{await k(`/api/settings/ai/key`,{method:`POST`,body:{name:l,value:o}}),s(``),e.onSaved?.()},HC.keyKept(l)),children:HC.setKey})]}),(0,M.jsx)(Jt,{note:a.note})]}),t.limits&&(0,M.jsxs)(`fieldset`,{className:`stack`,children:[(0,M.jsx)(`legend`,{className:`hud`,children:HC.budgetsLabel}),(0,M.jsxs)(`label`,{className:`stack`,htmlFor:`ai-models`,children:[(0,M.jsx)(`span`,{children:HC.modelsLabel}),(0,M.jsx)(`span`,{className:`muted`,children:HC.modelsHint})]}),(0,M.jsx)(`textarea`,{id:`ai-models`,className:`field mono`,rows:3,value:t.limits.models,onChange:e=>n({...t,limits:{...t.limits,models:e.target.value}})}),(0,M.jsxs)(`label`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`span`,{style:{minWidth:140},children:HC.defaultTokensLabel}),(0,M.jsx)(`input`,{id:`ai-default-tokens`,className:`field mono`,inputMode:`numeric`,value:t.limits.defaultTokens,onChange:e=>n({...t,limits:{...t.limits,defaultTokens:e.target.value}})})]}),(0,M.jsxs)(`label`,{className:`stack`,htmlFor:`ai-per-agent`,children:[(0,M.jsx)(`span`,{children:HC.perAgentLabel}),(0,M.jsx)(`span`,{className:`muted`,children:HC.perAgentHint})]}),(0,M.jsx)(`textarea`,{id:`ai-per-agent`,className:`field mono`,rows:3,value:t.limits.perAgent,onChange:e=>n({...t,limits:{...t.limits,perAgent:e.target.value}})})]}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:10,flexWrap:`wrap`},children:[(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:r.busy,children:HC.save}),u&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:i.busy,onClick:()=>void i.run(()=>k(`/api/settings/ai/test`,{method:`POST`,body:{}}).then(e=>{if(!e.ok)throw Error(HC.notAnswered(e.error??``));return e}),e=>{let t=e;return HC.answered(t.model??u,t.ms??0)}),children:HC.test}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:HC.saveNote(e.data.path)})]}),(0,M.jsx)(Jt,{note:r.note}),(0,M.jsx)(Jt,{note:i.note})]})}function ZC(){let e=A(`/api/settings/ai`);return ce(e),(0,M.jsx)(`div`,{className:`bento`,children:(0,M.jsx)(N,{title:HC.title,span:`1 / -1`,children:(0,M.jsx)(P,{of:e,children:t=>(0,M.jsx)(XC,{data:t,onSaved:e.reload},JSON.stringify(t))})})})}var Q=E.settings,QC=[{id:`hand-off`,name:Q.handOff,what:Q.yourOwnAssistantCopilot},{id:`model`,name:Q.model,what:Q.directModelAccessThrough},{id:`headless-claude-code`,name:Q.headlessClaudeCode,what:Q.claudeCodeRunsA}],$C={workTracker:Q.workTracker,serviceDesk:Q.serviceDesk,gitHost:Q.gitHost,wiki:Q.wiki,notify:Q.notifications,design:Q.designTool,model:Q.modelProvider},ew={live:{cls:`done`,label:`CONNECTED`,what:Q.liveFallsBackTo},manual:{cls:`warn`,label:`MANUAL`,what:Q.writesBecomeStepsIn},mock:{cls:`dim`,label:`MOCK`,what:Q.inMemoryForTests},"not-set":{cls:`dim`,label:Q.notSet,what:Q.notConfigured}},tw={on:{label:`ON`,what:Q.everyAiStepMay},"text-only":{label:Q.textOnly,what:Q.noAiStepIs},off:{label:`OFF`,what:Q.noAiStepRuns}};function nw(){let[e,t]=(0,v.useState)(0),n=A(`/api/doctor${e?`?fresh=1&n=${e}`:``}`),r={ok:`done`,warn:`warn`,fail:`blocking`};return(0,M.jsx)(N,{title:Q.thisMachine,meta:n.state===`ready`?n.data.ok?Q.ready:Q.needsFixing:void 0,span:`span 12`,children:(0,M.jsx)(P,{of:n,empty:e=>e.checks.length===0,emptyText:Q.noChecksRan,children:i=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[i.checks.map(e=>(0,M.jsxs)(`div`,{className:`row between`,style:{alignItems:`flex-start`,gap:10},children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2,minWidth:0},children:[(0,M.jsxs)(`span`,{style:{fontSize:12.5},children:[e.label,` `,(0,M.jsxs)(`span`,{className:`muted`,children:[`· `,e.detail]})]}),e.status!==`ok`&&e.fix&&(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:e.fix})]}),(0,M.jsx)(`span`,{className:`chip ${r[e.status]}`,children:e.status.toUpperCase()})]},e.id)),(0,M.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(me,{of:n,label:Q.checkAgain,run:()=>t(e+1)}),(0,M.jsxs)(`span`,{className:`muted`,style:{fontSize:12},children:[Q.theSameChecksAs,(0,M.jsx)(`code`,{className:`mono`,children:Q.atticusDoctor}),Q.nothingLeavesThisMachine]})]})]})})})}function rw(){let{me:e,saveNotify:t}=Dg(),[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(),o=qt(),s=n??e?.notify?.digest??`off`,c=i??e?.notify?.channel??``;return(0,M.jsx)(N,{title:Q.yourNotifications,meta:Q.atticusMeYaml,span:`span 12`,children:e?(0,M.jsxs)(`form`,{className:`stack`,style:{gap:8},onSubmit:e=>{e.preventDefault(),o.run(()=>t({digest:s,...c.trim()?{channel:c.trim()}:{}}),Q.saved)},children:[(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5,lineHeight:1.55},children:[Q.yourDigestListsThe,(0,M.jsx)(`code`,{className:`mono`,style:{whiteSpace:`nowrap`},children:Q.atticusDigestAsSend(e.user)}),`.`]}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`label`,{htmlFor:`notify-digest`,className:`hud`,style:{fontSize:10},children:Q.howOften}),(0,M.jsxs)(`select`,{id:`notify-digest`,className:`field`,value:s,onChange:e=>r(e.target.value),children:[(0,M.jsx)(`option`,{value:`off`,children:Q.off}),(0,M.jsx)(`option`,{value:`daily`,children:Q.daily}),(0,M.jsx)(`option`,{value:`weekly`,children:Q.weekly})]})]}),(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4,flex:1,minWidth:180},children:[(0,M.jsx)(`label`,{htmlFor:`notify-channel`,className:`hud`,style:{fontSize:10},children:Q.whereItGoes}),(0,M.jsx)(`input`,{id:`notify-channel`,className:`field`,value:c,placeholder:Q.aDirectMessage(e.user),onChange:e=>a(e.target.value)})]}),(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:o.busy,children:Q.save})]}),(0,M.jsx)(Jt,{note:o.note})]}):(0,M.jsxs)(`div`,{className:`stack`,"aria-busy":`true`,children:[(0,M.jsx)(`span`,{className:`sr`,children:Q.loading}),(0,M.jsx)(`div`,{className:`skeleton`,style:{width:`70%`}})]})})}function iw(){let e=A(`/api/settings`);ce(e);let t=Dg().me?.ai??`on`,n=qt();return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,M.jsx)(`p`,{className:`n`,style:{margin:0,fontSize:24},children:Q.settings}),(0,M.jsx)(`span`,{className:`hud`,children:Q.readOnlySetBy})]}),(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:Q.runtimeModes,meta:Q.runtimeYaml,span:`span 7`,children:(0,M.jsx)(P,{of:e,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,M.jsxs)(`div`,{className:`list-row`,style:{alignItems:`flex-start`},children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{style:{fontSize:13},children:Q.aiInThisOrganisation}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:tw[t].what})]}),(0,M.jsx)(`span`,{className:`chip ${t===`on`?`done`:`warn`}`,children:tw[t].label})]}),QC.map(t=>{let n=e.runtime.modes.allowed.includes(t.id),r=e.runtime.modes.default===t.id;return(0,M.jsxs)(`div`,{className:`list-row`,style:{alignItems:`flex-start`},children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{style:{fontSize:13},children:t.name}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12},children:t.what})]}),(0,M.jsx)(`span`,{className:`chip ${r?``:n?`done`:`dim`}`,children:r?Q.default:n?Q.allowed:Q.notApproved})]},t.id)}),(0,M.jsxs)(`div`,{className:`run-safety`,role:`note`,children:[(0,M.jsx)(`strong`,{style:{color:`var(--green)`},children:Q.safetyInEveryMode}),` `,Q.aPersonApprovesEvery]}),(0,M.jsx)(Xt,{rows:[[Q.assistants,`${e.runtime.assistants.allowed.join(`, `)} (default ${e.runtime.assistants.default})`],[Q.editors,e.runtime.editors.join(`, `)],[Q.models,e.runtime.models.allowed.join(`, `)||Q.noneApproved],[Q.autonomy,`${e.runtime.autonomy.default} by default; at most ${e.runtime.autonomy.maxFixRounds} build-fix rounds${Object.keys(e.runtime.autonomy.capPerRepo).length?`; capped: ${Object.entries(e.runtime.autonomy.capPerRepo).map(([e,t])=>`${e} ${t}`).join(`, `)}`:``}`],[Q.contextBudget,`${e.runtime.budgets.defaultTokens.toLocaleString()} tokens per pack`],[Q.runRecords,`kept ${e.runtime.retention.runsDays} days in .runs/ (git-ignored)`],[Q.buildEngine,e.runtime.buildEngine.default],[Q.telemetry,e.runtime.telemetry.enabled?`on`:`off`]]})]})})}),(0,M.jsx)(N,{title:Q.adapters,span:`span 5`,children:(0,M.jsx)(P,{of:e,children:e=>(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:Q.everyOutsideSystemSits}),(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{children:Q.system}),(0,M.jsx)(`th`,{children:Q.adapter})]})}),(0,M.jsx)(`tbody`,{children:e.adapters.map(e=>(0,M.jsxs)(`tr`,{children:[(0,M.jsxs)(`td`,{children:[$C[e.kind]??e.kind,(0,M.jsx)(`div`,{className:`muted`,style:{fontSize:11.5},children:ew[e.mode].what})]}),(0,M.jsx)(`td`,{children:(0,M.jsxs)(`span`,{className:`chip ${ew[e.mode].cls}`,children:[ew[e.mode].label,e.mode===`live`?` · ${e.type}`:``]})})]},e.kind))})]}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:Q.testsAlwaysUseThe})]})})}),(0,M.jsx)(aw,{s:e,check:n}),(0,M.jsx)(N,{title:Q.orgPack,span:`span 5`,children:(0,M.jsx)(P,{of:e,children:e=>(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(Xt,{rows:[[Q.platforms,e.orgPack.platforms.join(`, `)||`none`],...Object.entries(e.orgPack.counts).map(([e,t])=>[e.replace(/([A-Z])/g,` $1`).toLowerCase(),String(t)])]}),e.orgPack.defaulted.length>0&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:Q.builtInDefaultsFor(e.orgPack.defaulted.join(`, `))}),e.orgPack.problems.map(e=>(0,M.jsxs)(`p`,{className:`run-note bad`,children:[e.file,e.path?` ${e.path}`:``,`: `,e.message]},`${e.file}${e.path}${e.message}`)),(0,M.jsx)(`a`,{href:`#/orgpack`,style:{fontSize:12.5},children:Q.openTheOrgPack})]})})}),(0,M.jsx)(nw,{}),(0,M.jsx)(rw,{}),(0,M.jsx)(N,{title:Q.gates,meta:Q.gatesYaml,span:`span 12`,children:(0,M.jsx)(P,{of:e,empty:e=>e.gates.length===0,emptyText:Q.noGates,children:e=>(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:Q.theCriticRunsAt}),(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{children:Q.gate}),(0,M.jsx)(`th`,{children:Q.phase}),(0,M.jsx)(`th`,{children:Q.checklists}),(0,M.jsx)(`th`,{children:Q.checks}),(0,M.jsx)(`th`,{children:Q.authorRounds})]})}),(0,M.jsx)(`tbody`,{children:e.gates.map(e=>(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`td`,{className:`mono`,children:e.id}),(0,M.jsx)(`td`,{children:e.phase}),(0,M.jsx)(`td`,{children:e.checklists.join(`, `)||`-`}),(0,M.jsx)(`td`,{children:e.checks.join(`, `)||`-`}),(0,M.jsx)(`td`,{children:e.maxAuthorRounds??Q.noLimit})]},e.id))})]})]})})})]})]})}function aw({s:e,check:t}){return(0,M.jsx)(N,{title:Q.executorsAllowList,meta:e.state===`ready`?Q.setUp(e.data.executors.configured.length):void 0,span:`span 7`,children:(0,M.jsx)(P,{of:e,children:e=>(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:Q.proceduresCallLocalAutomation}),e.executors.configured.length===0?(0,M.jsx)(`p`,{className:`state`,children:Q.noToolsAreSet}):(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{children:Q.executor}),(0,M.jsx)(`th`,{children:Q.kind}),(0,M.jsx)(`th`,{children:Q.allowedFor}),(0,M.jsx)(`th`,{children:Q.approval})]})}),(0,M.jsx)(`tbody`,{children:e.executors.configured.map(e=>(0,M.jsxs)(`tr`,{children:[(0,M.jsxs)(`td`,{children:[(0,M.jsx)(`span`,{className:`mono`,children:e.name}),(0,M.jsx)(`div`,{className:`muted`,style:{fontSize:11},children:e.where})]}),(0,M.jsx)(`td`,{children:e.transport}),(0,M.jsx)(`td`,{children:e.allowedFor.length?e.allowedFor.join(`, `):(0,M.jsx)(`span`,{className:`chip dim`,children:Q.nothingOff})}),(0,M.jsx)(`td`,{children:Q.eachWrite})]},e.name))})]}),e.executors.missing.map(e=>(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:Q.procedureAllowsWhichIsnt(e.procedure,e.executor)},`${e.procedure}${e.executor}`)),e.executors.problems.map(e=>(0,M.jsx)(`p`,{className:`run-note bad`,children:e},e)),(0,M.jsxs)(`div`,{className:`row`,children:[(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:t.busy||e.executors.configured.length===0,"aria-describedby":e.executors.configured.length===0?`no-executors`:void 0,onClick:()=>void t.run(()=>k(`/api/settings/executors/check`),e=>{let t=e;return[...t.executors.map(e=>`${e.name}: ${e.reachable?`answers${e.version?` (${e.version})`:``}`:`doesn't answer${e.problem?` (${e.problem})`:``}`}`),...t.problems].join(`
|
|
26
|
+
`)}),children:Q.checkTheyAnswer}),e.executors.configured.length===0&&(0,M.jsx)(`span`,{id:`no-executors`,className:`muted`,style:{fontSize:12},children:E.app.noExecutors})]}),(0,M.jsx)(Jt,{note:t.note}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:Q.addingAToolTo})]})})})}var $=E.todo;function ow(e){let t={id:e.id,value:e.value,required:e.f.required,className:`run-input`};if(e.f.format===`choice`||e.f.format===`yes-no`){let n=e.f.format===`yes-no`?[`yes`,`no`]:e.f.choices??[];return(0,M.jsxs)(`select`,{...t,className:`run-select`,onChange:t=>e.onChange(t.target.value),children:[(0,M.jsx)(`option`,{value:``,children:$.choose}),n.map(e=>(0,M.jsx)(`option`,{children:e},e))]})}let n=e.f.format===`url`?`url`:e.f.format===`date`?`date`:e.f.format===`number`||e.f.format===`integer`?`number`:`text`;return(0,M.jsx)(`input`,{...t,type:n,placeholder:e.f.help??(e.f.format===`handles`?$.patDana:``),onChange:t=>e.onChange(t.target.value)})}function sw({step:e,done:t}){let[n,r]=(0,v.useState)(e.executors[0]??``),[i,a]=(0,v.useState)(),o=qt();return e.executors.length===0?null:(0,M.jsxs)(`div`,{className:`stack`,style:{borderTop:`1px solid var(--rule)`,paddingTop:10},children:[(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:[(0,M.jsx)(`span`,{className:`chip ai`,children:$.localTool}),(0,M.jsx)(`span`,{style:{fontSize:12.5,color:`var(--text-2)`},children:$.aToolOnThe})]}),(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:[(0,M.jsxs)(`label`,{className:`run-label`,htmlFor:`exec-${e.id}`,children:[$.tool,(0,M.jsx)(`select`,{id:`exec-${e.id}`,className:`run-select`,value:n,onChange:e=>{r(e.target.value),a(void 0)},children:e.executors.map(e=>(0,M.jsx)(`option`,{children:e},e))})]}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,style:{alignSelf:`flex-end`},disabled:o.busy,onClick:()=>void o.run(()=>k(`/api/todo/${e.id}/run?with=${encodeURIComponent(n)}${e.change?`&change=${encodeURIComponent(e.change)}`:``}`).then(a),$.theseAreTheExact),children:$.showTheInputs})]}),i&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`pre`,{className:`run-inert`,"aria-label":$.inputsTheToolGets,style:{borderStyle:`solid`},children:JSON.stringify(i.inputs,null,2)}),(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:$.sha256(i.inputsSha256.slice(0,16))}),(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,disabled:o.busy,onClick:()=>void o.run(()=>k(`/api/todo/${e.id}/run`,{method:`POST`,body:{with:n,inputsSha256:i.inputsSha256,...e.change?{change:e.change}:{}}}).then(e=>(t(),e)),e=>e.lines.join(`
|
|
27
|
+
`)||`${n} did the step.`),children:$.runWithIApprove(n)})]}),(0,M.jsx)(Jt,{note:o.note})]})}function cw({step:e,done:t}){let[n,r]=(0,v.useState)({}),[i,a]=(0,v.useState)(``),o=qt(),s=qt(),c=e.fields.map(e=>`${e.name}: ${e.value}`).join(`
|
|
28
|
+
`);return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:[(0,M.jsx)(`span`,{className:`chip`,children:($t[e.system]??e.system).toUpperCase()}),(0,M.jsx)(`span`,{className:`chip warn`,children:$.manual}),e.procedure&&(0,M.jsx)(`span`,{className:`chip dim`,children:$.procedure(e.procedure)}),e.change&&(0,M.jsx)(`a`,{className:`chip`,href:`#/changes/${e.change}`,children:e.change})]}),(0,M.jsx)(`p`,{style:{margin:0,fontSize:15},children:e.title}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:$.whereEveryValueComes(e.where,e.reason?$.whyThisIsManual(e.reason):``)}),e.waitsFor.length>0&&(0,M.jsx)(`p`,{className:`run-note bad`,role:`note`,children:$.doFirstThisStep(e.waitsFor.join(`, `),e.waitsFor.length===1?$.it:$.them)}),e.instructions.length>0&&(0,M.jsx)(`ol`,{className:`run-steps`,children:e.instructions.map(e=>(0,M.jsx)(`li`,{children:e},e))}),e.fields.length>0&&(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`div`,{className:`row between`,style:{marginBottom:4},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:$.fieldsToCopy}),(0,M.jsxs)(`span`,{className:`row`,style:{gap:6},children:[(0,M.jsx)(Yt,{text:c,label:$.copyAllFields}),(0,M.jsx)(`button`,{type:`button`,className:`btn run-copy`,disabled:o.busy,onClick:()=>void o.run(()=>k(`/api/todo/${e.id}/export?format=csv${e.change?`&change=${encodeURIComponent(e.change)}`:``}`).then(e=>{if(!navigator.clipboard)throw Error(`This browser won't copy from here; use Copy all fields.`);return navigator.clipboard.writeText(e.text)}),$.copiedTheFieldsAs),children:$.copyAsCsv})]})]}),e.fields.map(e=>(0,M.jsxs)(`div`,{className:`run-field`,children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:e.name}),(0,M.jsx)(`span`,{className:`value ${e.value?``:`empty`}`,children:e.value||$.empty}),e.value?(0,M.jsx)(Yt,{text:e.value,label:$.copy(e.name)}):(0,M.jsx)(`span`,{})]},e.name)),(0,M.jsx)(Jt,{note:o.note})]}),e.state===`open`?(0,M.jsxs)(`form`,{onSubmit:r=>{r.preventDefault();let i=Object.fromEntries(Object.entries(n).filter(([,e])=>e.trim()));s.run(()=>k(`/api/todo/${e.id}/done`,{method:`POST`,body:{values:i,...e.change?{change:e.change}:{}}}).then(t),`Recorded step ${e.id}.`)},className:`stack`,children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10},children:$.whenItsDoneRecord}),(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,alignItems:`flex-end`},children:[e.result.map(t=>(0,M.jsxs)(`label`,{className:`run-label`,htmlFor:`r-${e.id}-${t.name}`,children:[t.label,t.required?``:$.optional,(0,M.jsx)(ow,{f:t,id:`r-${e.id}-${t.name}`,value:n[t.name]??``,onChange:e=>r(n=>({...n,[t.name]:e}))})]},t.name)),(0,M.jsx)(`button`,{type:`submit`,className:`btn primary`,disabled:s.busy,children:$.markDone})]}),(0,M.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,M.jsxs)(`label`,{className:`run-label`,htmlFor:`skip-${e.id}`,style:{flex:`1 1 240px`},children:[$.reasonToSkip,(0,M.jsx)(`input`,{id:`skip-${e.id}`,className:`run-input`,value:i,onChange:e=>a(e.target.value)})]}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:s.busy||!i.trim(),onClick:()=>void s.run(()=>k(`/api/todo/${e.id}/done`,{method:`POST`,body:{skip:!0,note:i,...e.change?{change:e.change}:{}}}).then(t),`Skipped step ${e.id}.`),children:$.skipWithThisReason})]}),(0,M.jsx)(Jt,{note:s.note}),(0,M.jsx)(sw,{step:e,done:t})]}):(0,M.jsx)(`p`,{className:`run-note ok`,children:$.byOn(e.state===`done`?$.done:$.skipped,e.recorded?.by??``,en(e.recorded?.at),e.recorded?.via===`executor`?$.byALocalTool:``,e.recorded?.note?` ${e.recorded.note}`:``,Object.entries(e.recorded?.values??{}).map(([e,t])=>` ${e}: ${String(t)}.`).join(``))})]})}var lw=(e,t)=>jg([e.title,e.id,e.change,e.system],t),uw=`todo-filter`;function dw(){let e=A(`/api/todo?all=1`),t=A(`/api/findings`),[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(`all`),[o,s]=(0,v.useState)(``);j(n=>{n.type===`file.changed`&&(e.reload(),t.reload())});let c=e.state===`ready`?e.data.steps.filter(e=>i===`all`||(e.change??`none`)===i):[],l=c.filter(e=>e.state===`open`),u=c.filter(e=>e.state!==`open`),d=l.filter(e=>e.waitsFor.length>0),f=!!o.trim(),p=l.filter(e=>lw(e,o)),m=u.filter(e=>lw(e,o)),h=Ng({text:o,...i===`all`?{}:{change:i===`none`?$.noChange2:i}}),g=e.state===`ready`?[...new Set(e.data.steps.map(e=>e.change??`none`))]:[],_=c.find(e=>e.id===n)??l[0],y=t.state===`ready`?t.data.filter(e=>e.question&&(e.state===`open`||e.state===`asked`)):[];return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`},children:[(0,M.jsx)(`p`,{className:`n`,style:{margin:0,fontSize:24},children:e.state===`ready`?l.length?$.waitForAPerson(tn(l.length,`step`)):$.nothingToDoEvery:$.toDoAndManual}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`,alignItems:`flex-end`},children:[(0,M.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(Pg,{id:uw,value:o,onChange:s}),(0,M.jsx)(Fg,{shown:p.length+m.length,total:c.length,active:f})]}),g.length>1&&(0,M.jsx)(Zt,{label:$.change,value:i,onChange:a,options:[{value:`all`,label:$.allChanges},...g.map(e=>({value:e,label:e===`none`?$.noChange2:e}))]})]})]}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:$.stepsAPersonDoes}),(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:$.progress,span:`span 3`,children:(0,M.jsx)(P,{of:e,empty:()=>c.length===0,emptyText:$.noManualStepsYet,children:()=>(0,M.jsxs)(`div`,{className:`stack`,style:{alignItems:`flex-start`},children:[(0,M.jsx)(he,{value:u.length,max:c.length,size:72,label:$.ofStepsDone(u.length,c.length)}),(0,M.jsx)(F,{title:$.steps,parts:[{label:$.done2,value:u.length,color:`var(--green)`},{label:$.open2,value:l.length-d.length,color:`var(--accent)`},{label:$.waitingOnOthers,value:d.length,color:`var(--amber)`}]})]})})}),(0,M.jsx)(N,{title:$.whereStepsComeFrom,span:`span 4`,children:(0,M.jsx)(P,{of:e,children:e=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[e.sources.filter(e=>e.configured||e.open).map(e=>(0,M.jsxs)(`div`,{className:`list-row`,children:[(0,M.jsx)(`span`,{children:$t[e.system]??e.system}),(0,M.jsxs)(`span`,{className:`row`,style:{gap:6},children:[e.open>0&&(0,M.jsx)(`span`,{className:`chip warn`,children:$.open(e.open)}),(0,M.jsx)(Qt,{type:e.configured})]})]},e.system)),(0,M.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`,fontSize:12},children:e.exports.files.length?$.exportsInInputs(tn(e.exports.workItems,$.workItem),tn(e.exports.requests,`request`)):$.noExportsInInputs})]})})}),(0,M.jsx)(N,{title:$.localAutomation,span:`span 5`,children:(0,M.jsx)(P,{of:e,children:e=>(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsxs)(`p`,{className:`muted`,style:{margin:0,fontSize:12.5},children:[$.allowListedToolsCan,(0,M.jsx)(`a`,{href:`#/settings`,children:$.executorsAllowList})]}),(0,M.jsx)(`div`,{className:`row`,style:{flexWrap:`wrap`,gap:6},children:e.executors.configured.length?e.executors.configured.map(e=>(0,M.jsx)(`span`,{className:`chip ai`,children:e},e)):(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:12.5},children:$.noToolsSetUp})}),e.executors.problems.map(e=>(0,M.jsx)(`p`,{className:`run-note bad`,children:e},e))]})})}),(0,M.jsx)(N,{title:$.openSteps,meta:f?`${p.length}/${l.length}`:l.length,span:`span 4`,rows:`span 2`,children:(0,M.jsx)(P,{of:e,empty:()=>l.length===0,emptyText:$.noOpenSteps,children:()=>p.length===0?(0,M.jsx)(Ig,{what:h,onClear:()=>s(``),focus:uw}):(0,M.jsx)(`nav`,{"aria-label":$.openSteps,className:`stack`,style:{gap:2},children:Object.entries(p.reduce((e,t)=>((e[t.system]??=[]).push(t),e),{})).map(([e,t])=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`hud`,style:{fontSize:10,marginTop:6},children:$t[e]??e}),t.map(e=>(0,M.jsxs)(`button`,{type:`button`,className:`run-pick`,"aria-current":e.id===_?.id?`true`:void 0,onClick:()=>r(e.id),children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2,minWidth:0},children:[(0,M.jsx)(`span`,{style:{fontSize:12.5},children:e.title}),(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[e.change??$.noChange,` · `,e.id]})]}),(0,M.jsx)(`span`,{className:`chip ${e.waitsFor.length?`warn`:``}`,children:e.waitsFor.length?$.waits:$.toDo})]},`${e.change}/${e.id}`))]},e))})})}),(0,M.jsx)(N,{title:_?$.step:$.noStepSelected,span:`span 8`,rows:`span 2`,kind:`hero`,children:(0,M.jsx)(P,{of:e,empty:()=>!_,emptyText:$.pickAStepOn,children:()=>(0,M.jsx)(cw,{step:_,done:()=>e.reload()},`${_.change}/${_.id}`)})}),(0,M.jsxs)(N,{title:$.proceduresALocalTool,span:`span 7`,children:[(0,M.jsx)(P,{of:e,empty:e=>e.procedures.length===0,emptyText:$.theOrgPackHas,children:e=>(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{children:$.procedure2}),(0,M.jsx)(`th`,{children:$.toolsAllowed}),(0,M.jsx)(`th`,{children:$.writes}),(0,M.jsx)(`th`,{children:$.lastRun})]})}),(0,M.jsx)(`tbody`,{children:e.procedures.map(e=>(0,M.jsxs)(`tr`,{children:[(0,M.jsxs)(`td`,{children:[e.name,(0,M.jsxs)(`div`,{className:`hud`,style:{fontSize:9.5},children:[e.id,` · `,e.status]})]}),(0,M.jsx)(`td`,{children:e.allowed.length===0?(0,M.jsx)(`span`,{className:`muted`,children:$.noneOff}):e.allowed.map(t=>(0,M.jsxs)(`span`,{className:`chip ${e.configured.includes(t)?`ai`:`dim`}`,title:e.configured.includes(t)?$.setUpHere:$.notSetUpOn,style:{marginRight:4},children:[t,e.configured.includes(t)?``:$.notHere]},t))}),(0,M.jsx)(`td`,{children:e.writes}),(0,M.jsx)(`td`,{children:e.lastRun?`${en(e.lastRun.at)} · ${e.lastRun.status} · ${e.lastRun.executor}`:$.neverRun})]},e.id))})]})}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`,fontSize:12},children:$.eachRunShowsThe})]}),(0,M.jsx)(N,{title:$.done,meta:f?`${m.length}/${u.length}`:u.length,span:`span 5`,children:(0,M.jsx)(P,{of:e,empty:()=>u.length===0,emptyText:$.nothingDoneYet,children:()=>m.length===0?(0,M.jsx)(`div`,{className:`state`,children:E.filter.nothingMatches(h)}):m.map(e=>(0,M.jsxs)(`button`,{type:`button`,className:`run-pick`,"aria-current":e.id===_?.id?`true`:void 0,onClick:()=>r(e.id),children:[(0,M.jsx)(`span`,{style:{fontSize:12.5},children:e.title}),(0,M.jsx)(`span`,{className:`chip ${e.state===`done`?`done`:`dim`}`,children:e.state.toUpperCase()})]},`${e.change}/${e.id}`))})}),(0,M.jsx)(N,{title:$.ownerQuestionsWaiting,meta:y.length||void 0,span:`span 12`,children:(0,M.jsx)(P,{of:t,empty:()=>y.length===0,emptyText:$.noOwnerQuestionsWaiting,children:()=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:0},children:[y.map(e=>(0,M.jsxs)(`div`,{className:`list-row`,children:[(0,M.jsxs)(`span`,{className:`stack`,style:{gap:2,minWidth:0},children:[(0,M.jsx)(`span`,{style:{fontSize:12.5},children:e.question.text}),(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[e.question.owner??$.ownerNotKnown,` · `,e.change,` · `,e.gate]})]}),(0,M.jsxs)(`span`,{className:`row`,style:{gap:6},children:[(0,M.jsx)(`span`,{className:`chip ${e.state===`asked`?`ai`:`warn`}`,children:e.state.toUpperCase()}),(0,M.jsx)(Yt,{text:e.question.text,label:$.copyQuestionText}),(0,M.jsx)(`a`,{className:`btn`,href:`#/changes/${e.change}`,style:{display:`inline-flex`,alignItems:`center`,textDecoration:`none`},children:$.openChange})]})]},`${e.change}/${e.gate}/${e.id}`)),(0,M.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`,fontSize:12},children:$.eachQuestionIsAsked})]})})})]})]})}var fw={todo:dw,release:AC,"service-desk":VC,governance:sC,evals:iC,learning:fC,settings:iw,ai:ZC,repos:IC},pw=E.history,mw=e=>e.replace(`T`,` `).slice(0,16),hw=(e,t)=>`hs-${e}-${t}`.replace(/[^A-Za-z0-9_-]/g,`-`);function gw(e){let t=new URLSearchParams;e.change&&t.set(`change`,e.change),e.session&&t.set(`session`,e.session),e.q&&t.set(`q`,e.q);let n=t.toString();return`#/history${n?`?${n}`:``}`}function _w(e,t){return e.filter(e=>(!t.change||e.change===t.change)&&(!t.session||e.session===t.session)&&jg([e.prompt?.text,e.response?.text,e.prompt?.command,e.change,e.session,pw.surfaces[e.surface]],t.text))}function vw(e){let t=new Map;for(let n of e){let e=`${n.surface}\u0000${n.session}`,r=t.get(e)??{session:n.session,surface:n.surface,turns:[]};r.turns.push(n),t.set(e,r)}return[...t.values()]}function yw(e){return[...new Set(e.flatMap(e=>e.change?[e.change]:[]))].sort()}function bw({r:e,what:t}){return(0,M.jsxs)(`div`,{className:`history-said`,children:[(0,M.jsxs)(`h4`,{className:`runs-h4`,children:[t,` `,(0,M.jsx)(`time`,{dateTime:e.at,children:mw(e.at)})]}),e.truncated&&(0,M.jsx)(`p`,{className:`history-note`,children:pw.truncated(e.size)}),e.masked&&(0,M.jsx)(`p`,{className:`history-note`,children:pw.masked}),(0,M.jsx)(`pre`,{className:`runs-text`,tabIndex:0,role:`region`,"aria-label":pw.box(t,e.id),children:e.text})]})}function xw({t:e}){let t=e.prompt?.command??e.response?.command;return(0,M.jsxs)(`li`,{className:`history-turn`,children:[(e.change||t)&&(0,M.jsxs)(`p`,{className:`history-tags`,children:[e.change&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`hud`,children:pw.about}),` `,(0,M.jsx)(`a`,{href:gw({change:e.change}),children:e.change})]}),t&&(0,M.jsxs)(M.Fragment,{children:[` `,(0,M.jsx)(`span`,{className:`hud`,children:pw.command}),` `,(0,M.jsx)(`code`,{className:`mono`,children:t})]})]}),(0,M.jsxs)(`div`,{className:`runs-pair`,children:[e.prompt?(0,M.jsx)(bw,{r:e.prompt,what:pw.prompt}):(0,M.jsx)(`div`,{}),e.response?(0,M.jsx)(bw,{r:e.response,what:pw.response}):(0,M.jsxs)(`div`,{className:`history-said`,children:[(0,M.jsx)(`h4`,{className:`runs-h4`,children:pw.response}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:pw.noResponse})]})]})]})}function Sw({r:e}){return(0,M.jsx)(`p`,{className:`work-say`,style:{margin:0},children:e.on?pw.recordingOn:e.offBy===`org-pack`?pw.offOrgPack:pw.offLocal})}function Cw(e){return(0,M.jsx)(P,{of:e.of,empty:e=>e.total===0,emptyContent:e.of.state===`ready`?(0,M.jsxs)(`div`,{className:`stack`,style:{gap:8},children:[(0,M.jsx)(Sw,{r:e.of.data.recording}),(0,M.jsx)(`div`,{className:`state`,children:pw.empty}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:pw.what})]}):null,children:t=>{let n=_w(t.turns,{text:e.text,...e.change?{change:e.change}:{},...e.session?{session:e.session}:{}}),r=!!e.text.trim()||!!e.change||!!e.session;return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:10},children:[(0,M.jsx)(Sw,{r:t.recording}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:pw.what}),e.session&&(0,M.jsxs)(`p`,{className:`work-say`,style:{margin:0},children:[pw.onlySession(e.session),` `,(0,M.jsx)(`a`,{href:gw(e.change?{change:e.change}:{}),children:pw.showAll})]}),(0,M.jsxs)(`div`,{className:`row history-filters`,role:`search`,children:[(0,M.jsx)(Pg,{id:`history-find`,value:e.text,onChange:t=>e.onText?.(t),grow:!0}),(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(`label`,{htmlFor:`history-change`,className:`hud`,style:{fontSize:10},children:pw.change}),(0,M.jsxs)(`select`,{id:`history-change`,className:`field`,value:e.change??``,onChange:t=>e.onChange?.(t.target.value),children:[(0,M.jsx)(`option`,{value:``,children:pw.everyChange}),yw(t.turns).map(e=>(0,M.jsx)(`option`,{value:e,children:e},e))]})]})]}),(0,M.jsx)(Fg,{shown:n.length,total:t.turns.length,active:r}),n.length===0?(0,M.jsx)(Ig,{what:Ng({text:e.text,...e.change?{change:e.change}:{}}),onClear:()=>{e.onText?.(``),e.onChange?.(``)},focus:`history-find`}):vw(n).map(e=>(0,M.jsxs)(`section`,{className:`history-session`,"aria-labelledby":hw(e.surface,e.session),children:[(0,M.jsxs)(`h3`,{id:hw(e.surface,e.session),className:`history-h`,children:[(0,M.jsx)(`a`,{href:gw({session:e.session}),children:pw.session(e.session)}),` `,(0,M.jsxs)(`span`,{className:`muted`,children:[pw.surfaces[e.surface]??e.surface,`, `,pw.turns(e.turns.length)]})]}),(0,M.jsx)(`ol`,{className:`history-turns`,children:e.turns.map(e=>(0,M.jsx)(xw,{t:e},e.prompt?.id??e.response?.id))})]},`${e.surface}:${e.session}`)),t.total>t.turns.length&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:0,fontSize:12},children:pw.newest(t.turns.length,t.total)})]})}})}function ww({hash:e}){let t=ye(e,`change`),n=ye(e,`session`),r=ye(e,`q`),[i,a]=(0,v.useState)(r??``);(0,v.useEffect)(()=>a(r??``),[r]);let o=A(`/api/history?limit=1000`);return j(e=>{e.type===`file.changed`&&o.reload()}),(0,M.jsx)(`div`,{className:`bento`,children:(0,M.jsxs)(N,{title:pw.title,span:`1 / -1`,children:[(0,M.jsx)(`p`,{className:`work-say`,style:{marginTop:0},children:pw.intro}),(0,M.jsx)(Cw,{of:o,text:i,onText:a,...t?{change:t}:{},...n?{session:n}:{},onChange:e=>{location.hash=gw({...e?{change:e}:{},...n?{session:n}:{}})}})]})})}var Tw=E.glossary;function Ew(){return(0,M.jsxs)(N,{title:Tw.title,children:[(0,M.jsx)(`p`,{className:`muted`,children:Tw.intro}),(0,M.jsx)(`dl`,{className:`words`,children:Tw.terms.map(e=>(0,M.jsxs)(`div`,{id:`word-${e.term.replace(/ /g,`-`)}`,children:[(0,M.jsx)(`dt`,{children:(0,M.jsx)(`strong`,{children:e.term})}),(0,M.jsx)(`dd`,{style:{margin:`2px 0 10px`},children:e.says})]},e.term))})]})}var Dw=E.stageReview,Ow=E.runNext;function kw({w:e}){return e?e.state===`working`?(0,M.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`work-say`,children:Dw.savingComment}):e.state===`error`?(0,M.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:`6px 0 0`},children:e.text}):e.state===`acted`?(0,M.jsx)(`p`,{role:`status`,className:`work-say`,children:Dw.acted(Dw.actions[e.action]??e.action)}):(0,M.jsxs)(`div`,{role:`status`,children:[(0,M.jsx)(`p`,{className:`work-say`,children:Dw.commented(e.result.files.join(`, `))}),(0,M.jsx)(Xg,{text:e.result.commit,label:Dw.copyCommit})]}):null}function Aw(e){let t=e.item.finding,n=e.item.options,r=(0,v.useId)(),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(),u=e.wrote?.state===`working`,d=t=>{if((t===`not-relevant`||t===`waive`)&&!i.trim())return l(Dw.needReason);l(void 0),e.onAct?.(e.item,t,i.trim())},f=t=>{if(t.preventDefault(),!o.trim())return l(Dw.needComment);l(void 0),e.onComment?.(e.item,o.trim())},p=t.state===`open`,m=n.apply||n.dismiss||n.waive||!!n.ask;return(0,M.jsxs)(`article`,{className:`stage-finding`,"aria-labelledby":`${r}-h`,children:[(0,M.jsxs)(`div`,{className:`row`,style:{gap:8,flexWrap:`wrap`},children:[(0,M.jsx)(`span`,{className:`chip ${t.severity===`blocking`?`blocking`:t.severity===`gap`?`warn`:`dim`}`,children:Dw.severity[t.severity]??t.severity}),(0,M.jsx)(`span`,{className:`chip ${p?``:`done`}`,children:Dw.state[t.state]??t.state}),(0,M.jsx)(`code`,{className:`mono muted`,children:t.id})]}),(0,M.jsx)(`h3`,{id:`${r}-h`,className:`h`,style:{fontSize:15,margin:`6px 0`},children:t.summary}),(0,M.jsxs)(`dl`,{className:`stage-facts`,children:[(0,M.jsx)(`dt`,{children:Dw.where}),(0,M.jsx)(`dd`,{children:(0,M.jsxs)(`code`,{className:`mono`,children:[t.artifact,t.locator.line?`:${t.locator.line}`:``]})}),(0,M.jsx)(`dt`,{children:Dw.why}),(0,M.jsx)(`dd`,{children:t.why}),(0,M.jsx)(`dt`,{children:Dw.fix}),(0,M.jsx)(`dd`,{children:n.fix}),n.ask&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`dt`,{children:Dw.question(n.ask.owner)}),(0,M.jsx)(`dd`,{children:n.ask.text})]})]}),p&&e.item.proposal&&(0,M.jsxs)(`p`,{role:`note`,className:`work-say`,children:[Dw.proposed(e.item.proposal.by,e.item.proposal.claim),e.item.proposal.reason?`: ${e.item.proposal.reason}`:``]}),t.resolution&&(0,M.jsxs)(`p`,{className:`work-say`,children:[Dw.resolved(Dw.state[t.state]??t.state,t.resolution.by),t.resolution.reason?`: ${t.resolution.reason}`:``]}),p&&m&&(0,M.jsxs)(`div`,{className:`stack`,style:{gap:6},children:[(0,M.jsx)(`span`,{className:`hud`,children:Dw.options}),(n.dismiss||n.waive)&&(0,M.jsxs)(`label`,{className:`stack`,style:{gap:2},children:[(0,M.jsx)(`span`,{className:`hud`,children:Dw.reason(t.id)}),(0,M.jsx)(`input`,{className:`field`,value:i,onChange:e=>a(e.target.value)})]}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[n.apply&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:u,"aria-label":Dw.applyFor(t.id),onClick:()=>d(`apply`),children:Dw.apply}),n.dismiss&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:u,"aria-label":Dw.dismissFor(t.id),onClick:()=>d(`not-relevant`),children:Dw.dismiss}),n.waive&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:u,"aria-label":Dw.waiveFor(t.id),onClick:()=>d(`waive`),children:Dw.waive}),n.ask&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:u,"aria-label":Dw.askFor(t.id,n.ask.owner),onClick:()=>d(`ask`),children:Dw.ask(n.ask.owner)})]}),n.dismiss&&!n.waive&&t.severity===`blocking`&&(0,M.jsx)(`p`,{className:`work-say`,children:Dw.cantWaive})]}),(0,M.jsxs)(`div`,{className:`stack`,style:{gap:6,marginTop:8},children:[e.item.comments.length>0&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`hud`,children:Dw.comments}),(0,M.jsx)(`ul`,{className:`stage-comments`,children:e.item.comments.map(e=>(0,M.jsxs)(`li`,{children:[e.text,` `,(0,M.jsxs)(`span`,{className:`muted`,children:[`— `,e.by,`, `,e.at.slice(0,10),` · `,e.read?Dw.read:Dw.unread]})]},e.question))})]}),(0,M.jsxs)(`form`,{className:`stack`,style:{gap:4},onSubmit:f,children:[(0,M.jsx)(`label`,{htmlFor:`${r}-c`,className:`hud`,children:Dw.comment(t.id)}),(0,M.jsx)(`textarea`,{id:`${r}-c`,className:`field`,rows:2,value:o,"aria-describedby":`${r}-ch`,onChange:e=>s(e.target.value)}),(0,M.jsx)(`p`,{id:`${r}-ch`,className:`work-say`,style:{margin:0},children:Dw.commentHint}),(0,M.jsx)(`div`,{children:(0,M.jsx)(`button`,{type:`submit`,className:`btn`,disabled:u,children:u?Dw.savingComment:Dw.saveComment})})]}),c&&(0,M.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:0},children:c}),(0,M.jsx)(kw,{w:e.wrote})]})]})}function jw({qs:e,onAnswered:t}){return e.length?(0,M.jsx)(`ul`,{className:`stage-comments`,children:e.map(e=>(0,M.jsx)(`li`,{children:e.state===`open`?(0,M.jsxs)(`details`,{children:[(0,M.jsx)(`summary`,{children:Dw.answerIt(e.question)}),(0,M.jsx)(ix,{question:e,onAnswered:t})]}):(0,M.jsxs)(M.Fragment,{children:[e.question,` `,(0,M.jsx)(`span`,{className:`muted`,children:Dw.answered(e.answer?.text??e.options[(e.answer?.option??1)-1]?.label??``)})]})},e.id))}):(0,M.jsx)(`p`,{className:`work-say`,children:Dw.noQuestions})}function Mw(e){return(0,M.jsxs)(N,{title:Dw.title,span:`1 / -1`,children:[(0,M.jsx)(`p`,{className:`work-why`,style:{marginTop:0},children:Dw.intro}),(0,M.jsx)(P,{of:e.of,empty:e=>!e.loop.present&&e.findings.length===0,emptyContent:e.of.state===`ready`?(0,M.jsxs)(`div`,{className:`state`,children:[(0,M.jsx)(`p`,{style:{margin:`0 0 8px`},children:Dw.notRun}),(0,M.jsx)(`p`,{className:`work-say`,children:Ow.terminal}),(0,M.jsx)(Xg,{text:e.of.data.next.command,label:Ow.copy}),(0,M.jsx)(`p`,{className:`work-say`,children:Ow.slash}),(0,M.jsx)(Xg,{text:e.of.data.next.slash,label:Ow.copySlash})]}):void 0,children:t=>(0,M.jsxs)(`div`,{className:`stack`,style:{gap:12},children:[t.loop.state&&(0,M.jsx)(`p`,{className:`work-say`,children:Dw.loopState[t.loop.state]??t.loop.state}),t.round===null||!t.gate?(0,M.jsx)(`div`,{className:`state`,children:Dw.noRound(t.gate)}):t.findings.length===0?(0,M.jsx)(`div`,{className:`state`,children:Dw.clean(t.gate,t.round)}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`hud`,style:{margin:0},children:Dw.round(t.gate,t.round,t.findings.length)}),t.findings.map(t=>(0,M.jsx)(Aw,{item:t,...e.wrote?.[t.finding.id]?{wrote:e.wrote[t.finding.id]}:{},...e.onAct?{onAct:e.onAct}:{},...e.onComment?{onComment:e.onComment}:{}},`${t.finding.gate}/${t.finding.id}`))]}),(0,M.jsx)(`h3`,{className:`h`,style:{fontSize:15,margin:`8px 0 0`},children:Dw.questions}),(0,M.jsx)(jw,{qs:t.questions,onAnswered:()=>e.onAnswered?.()}),(0,M.jsx)(`h3`,{className:`h`,style:{fontSize:15,margin:`8px 0 0`},children:Dw.next}),(0,M.jsx)(`p`,{className:`work-why`,style:{margin:0},children:Dw.nextWhy}),(0,M.jsx)(`p`,{className:`work-say`,children:Ow.terminal}),(0,M.jsx)(Xg,{text:t.next.command,label:Ow.copy}),(0,M.jsx)(`p`,{className:`work-say`,children:Ow.slash}),(0,M.jsx)(Xg,{text:t.next.slash,label:Ow.copySlash}),t.problems.length>0&&(0,M.jsx)(n_,{list:t.problems})]})})]})}function Nw({change:e,stage:t}){let n=`/api/changes/${encodeURIComponent(e)}/stages/${t}`,r=A(n);ce(r);let[i,a]=(0,v.useState)({}),o=(e,t)=>a(n=>({...n,[e]:t}));return(0,M.jsx)(Mw,{of:r,wrote:i,onAct:(t,n,i)=>{let a=t.finding;o(a.id,{state:`working`}),k(`/api/findings/${encodeURIComponent(e)}/${encodeURIComponent(a.id)}/action`,{method:`POST`,body:{action:n,gate:a.gate,...i?{reason:i}:{},...n===`ask`&&t.options.ask?{askedOf:t.options.ask.owner}:{}}}).then(()=>{o(a.id,{state:`acted`,action:n}),r.reload()},e=>o(a.id,{state:`error`,text:Ee(e)}))},onComment:(e,t)=>{let i=e.finding;o(i.id,{state:`working`}),k(`${n}/comments`,{method:`POST`,body:{finding:i.id,gate:i.gate,text:t}}).then(e=>{o(i.id,{state:`commented`,result:e}),r.reload()},e=>o(i.id,{state:`error`,text:Ee(e)}))},onAnswered:()=>r.reload()})}var Pw=E.changeImpact,Fw=e=>`none`in e?Pw.noTeam(e.none):e.name?`${e.team} (${e.name})`:e.team;function Iw({i:e}){return e.flows?(0,M.jsxs)(M.Fragment,{children:[e.items.length===0?(0,M.jsx)(`p`,{children:Pw.nothing}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`est-big`,children:Pw.counts(e.breaks,e.mayBreak,e.routes)}),e.upstream&&(e.upstream.breaks>0||e.upstream.mayBreak>0)&&(0,M.jsx)(`p`,{children:Pw.upstream(e.upstream.breaks,e.upstream.mayBreak)}),e.items.map((t,n)=>{let r=`impact-${n}`;return(0,M.jsxs)(`section`,{"aria-labelledby":r,className:`est-band`,children:[(0,M.jsxs)(`h3`,{id:r,className:`hud`,children:[(0,M.jsx)(`span`,{className:`mono`,children:t.name}),` `,(0,M.jsxs)(`span`,{className:`muted`,children:[`(`,t.flow,`)`]})]}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:`0 0 6px`},children:Pw.owned(Fw(t.owner))}),(0,M.jsxs)(`p`,{children:[(0,M.jsxs)(`strong`,{children:[Pw.why,`:`]}),` `,t.why.join(`; `)]}),t.fields.gone.length>0&&(0,M.jsxs)(`p`,{children:[(0,M.jsxs)(`strong`,{children:[Pw.gone,`:`]}),` `,(0,M.jsx)(`span`,{className:`mono`,children:t.fields.gone.join(`, `)})]}),t.fields.required.length>0&&(0,M.jsxs)(`p`,{children:[(0,M.jsxs)(`strong`,{children:[Pw.required,`:`]}),` `,(0,M.jsx)(`span`,{className:`mono`,children:t.fields.required.join(`, `)})]}),t.callers.length===0?(0,M.jsx)(`p`,{children:Pw.nobody}):(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`caption`,{className:`sr`,children:Pw.callersCaption(t.name)}),(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{scope:`col`,children:Pw.col.who}),(0,M.jsx)(`th`,{scope:`col`,children:Pw.col.verdict}),(0,M.jsx)(`th`,{scope:`col`,children:Pw.col.owner}),(0,M.jsx)(`th`,{scope:`col`,children:Pw.col.where})]})}),(0,M.jsx)(`tbody`,{children:t.callers.map(e=>(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`td`,{className:`mono`,children:e.component}),(0,M.jsx)(`td`,{children:e.verdict===`breaks`?(0,M.jsx)(`strong`,{children:Pw.breaks}):Pw.mayBreak(Pw.guessWords[e.guessed??``]??``)}),(0,M.jsx)(`td`,{children:Fw(e.owner)}),(0,M.jsx)(`td`,{className:`mono`,children:[...e.at,...e.flows,...e.routes].join(`, `)})]},e.component))})]}),(t.chain??[]).length>0&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`h4`,{className:`hud`,children:Pw.chain}),(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`caption`,{className:`sr`,children:Pw.chainCaption(t.name)}),(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{scope:`col`,children:Pw.chainCol.who}),(0,M.jsx)(`th`,{scope:`col`,children:Pw.chainCol.via}),(0,M.jsx)(`th`,{scope:`col`,children:Pw.chainCol.verdict}),(0,M.jsx)(`th`,{scope:`col`,children:Pw.chainCol.owner}),(0,M.jsx)(`th`,{scope:`col`,children:Pw.chainCol.where})]})}),(0,M.jsx)(`tbody`,{children:(t.chain??[]).map(e=>{let t=Pw.guessWords[e.guessed??``]??``;return(0,M.jsxs)(`tr`,{children:[(0,M.jsxs)(`td`,{className:`mono`,style:{paddingLeft:`${(e.depth-1)*14}px`},children:[e.component,` `,(0,M.jsxs)(`span`,{className:`sr`,children:[`(`,Pw.depth(e.depth),`)`]})]}),(0,M.jsxs)(`td`,{children:[(0,M.jsx)(`span`,{className:`mono`,children:Pw.via(e.via)}),e.entries.length>0&&(0,M.jsxs)(`span`,{className:`muted mono`,children:[` (`,e.entries.join(`, `),`)`]})]}),(0,M.jsx)(`td`,{children:e.verdict===`breaks`?(0,M.jsx)(`strong`,{children:Pw.breaks}):e.restsOn?Pw.restsOn(e.restsOn,t):Pw.restsOwn(t)}),(0,M.jsx)(`td`,{children:Fw(e.owner)}),(0,M.jsx)(`td`,{className:`mono`,children:[...e.at,...e.flows,...e.routes].join(`, `)})]},e.component)})})]})]}),t.capped&&(0,M.jsx)(`p`,{className:`muted`,children:Pw.capped(Math.max(...(t.chain??[]).map(e=>e.depth)))}),[...t.callers,...t.chain??[]].some(e=>e.verdict===`may-break`)&&(0,M.jsx)(`p`,{role:`note`,className:`muted`,children:Pw.confirm(e.rule)}),t.routes.length>0&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`h4`,{className:`hud`,children:Pw.routes}),(0,M.jsx)(`ul`,{children:t.routes.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{className:`mono`,children:Pw.route(e.id,e.callers)}),` `,(0,M.jsxs)(`span`,{className:`muted`,children:[`(`,[e.proxy,e.basepath,e.repo].filter(Boolean).join(`, `),`)`,` `,Pw.owned(Fw(e.owner))]})]},e.id))})]})]},`${t.flow}.${t.id??n}`)}),(0,M.jsx)(`h3`,{className:`hud`,children:Pw.teams}),(0,M.jsx)(`ul`,{children:e.owners.map(e=>(0,M.jsxs)(`li`,{children:[Fw(e.owner),`: `,(0,M.jsx)(`span`,{className:`mono`,children:e.repos.join(`, `)})]},`${Fw(e.owner)}.${e.repos.join(`,`)}`))})]}),e.problems.length>0&&(0,M.jsxs)(`div`,{role:`note`,className:`cd-problems`,children:[(0,M.jsx)(`h3`,{className:`hud`,children:Pw.problems}),(0,M.jsx)(`ul`,{children:e.problems.map(e=>(0,M.jsx)(`li`,{children:e},e))})]}),(0,M.jsx)(Xg,{text:Pw.command(e.change),label:E.runNext.copy})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{children:Pw.noTargets(e.change)}),(0,M.jsx)(Xg,{text:`atticus change architecture ${e.change}`,label:E.runNext.copy})]})}function Lw({change:e}){let t=A(`/api/changes/${encodeURIComponent(e)}/impact`);return j(e=>{e.type===`file.changed`&&t.reload()}),(0,M.jsxs)(N,{title:Pw.title,children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:`0 0 12px`,fontSize:12.5,lineHeight:1.55},children:Pw.intro}),(0,M.jsx)(P,{of:t,children:e=>(0,M.jsx)(Iw,{i:e})})]})}var Rw=E.work,zw=E.runNext,Bw={feature:[`brief`,`proposal`,`specs`,`interfaces`,`ux`],stories:[`stories`,`tasks`,`snow`],tasks:[`tasks`]};function Vw(e){let t=`pick-${e.screen}`;return(0,M.jsxs)(`div`,{className:`row`,style:{gap:8},children:[(0,M.jsx)(`label`,{htmlFor:t,className:`hud`,style:{fontSize:10},children:Rw.pickChange}),(0,M.jsx)(`select`,{id:t,className:`run-select`,value:e.current??``,onChange:t=>be(e.screen,`change`,t.target.value),children:e.list.map(e=>(0,M.jsxs)(`option`,{value:e.id,children:[e.id,` · `,e.state]},e.id))})]})}function Hw({detail:e,stage:t}){let n=Bw[t],r=e.artifacts.filter(e=>n.includes(e.artifact));return r.length===0?(0,M.jsx)(`div`,{className:`state`,children:Rw.noFiles}):(0,M.jsx)(ke,{caption:Rw.files,rows:r,rowKey:e=>e.artifact,cols:[{label:Rw.fileCol,cell:e=>e.path,mono:!0},{label:Rw.statusCol,cell:e=>(0,M.jsx)(`span`,{className:`chip ${e.status===`done`?`done`:e.status===`ready`?`warn`:`dim`}`,children:e.status.toUpperCase()})}]})}function Uw({change:e,tasks:t}){return t.length===0?(0,M.jsx)(`div`,{className:`state`,children:Rw.noTasks.replace(`<change>`,e)}):(0,M.jsx)(ke,{caption:Rw.tasks,rows:t,rowKey:e=>`${e.repo}:${e.id}`,cols:[{label:Rw.taskCol,cell:e=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`code`,{className:`mono`,children:e.id}),` `,e.description]})},{label:Rw.repoTaskCol,cell:e=>e.repo,mono:!0},{label:Rw.statusCol,cell:e=>(0,M.jsx)(`span`,{className:`chip ${e.done?`done`:`dim`}`,children:e.done?Rw.taskDone:Rw.taskOpen})},{label:Rw.runCol,cell:t=>{let n=gy(e,t);return(0,M.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,M.jsx)(Xg,{text:n.command,label:zw.copy}),(0,M.jsx)(Xg,{text:n.slash.command,label:zw.copySlash})]})}}]})}function Ww(e){let t=uy[e.stage].id,n=e.cockpit?.state===`ready`?e.cockpit.data:void 0;return(0,M.jsx)(P,{of:e.list,empty:e=>e.length===0,emptyContent:(0,M.jsx)(t_,{}),children:r=>{let i=Sy(r,e.wanted);if(!i)return(0,M.jsx)(e_,{});let a=e.tasks?.state===`ready`?e.tasks.data:void 0;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,marginBottom:12},children:[(0,M.jsx)(`p`,{style:{margin:0},children:(0,M.jsx)(`span`,{className:`n`,style:{fontSize:20},children:i.title})}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:12,flexWrap:`wrap`},children:[(0,M.jsx)(Lg,{change:i.id}),e.stage===`tasks`&&(0,M.jsx)(`a`,{href:`#/conformance?change=${encodeURIComponent(i.id)}`,children:E.conformance.title}),(0,M.jsx)(Vw,{list:r,current:i.id,screen:t})]})]}),e.stage===`tasks`&&e.tasks?.state===`loading`?(0,M.jsx)(P,{of:e.tasks,children:()=>null}):e.cockpit?.state===`loading`?(0,M.jsx)(P,{of:e.cockpit,children:()=>null}):(0,M.jsx)(Qg,{step:xy(e.stage,i,a,n)}),(0,M.jsxs)(`div`,{className:`bento`,children:[e.stage!==`tasks`&&(0,M.jsx)(Nw,{change:i.id,stage:e.stage===`feature`?`feature`:`stories`}),(0,M.jsx)(N,{title:Rw.files,span:e.stage===`tasks`?`span 4`:`1 / -1`,children:e.detail?(0,M.jsx)(P,{of:e.detail,children:t=>(0,M.jsx)(Hw,{detail:t,stage:e.stage})}):(0,M.jsx)(`div`,{className:`state`,children:Rw.noFiles})}),e.stage===`tasks`&&(0,M.jsx)(N,{title:Rw.tasks,span:`span 8`,children:e.tasks?(0,M.jsx)(P,{of:e.tasks,children:e=>(0,M.jsx)(Uw,{change:i.id,tasks:e})}):(0,M.jsx)(`div`,{className:`state`,children:Rw.noTasks.replace(`<change>`,i.id)})}),e.stage===`feature`&&(0,M.jsx)(nv,{change:i.id}),e.stage===`feature`&&(0,M.jsxs)(N,{title:E.changeKnowledge.title,span:`1 / -1`,children:[(0,M.jsx)(`p`,{className:`work-why`,style:{marginTop:0},children:E.changeKnowledge.onFeature}),(0,M.jsx)(`p`,{className:`work-say`,style:{margin:0},children:(0,M.jsx)(`a`,{href:`#/change-knowledge?change=${encodeURIComponent(i.id)}`,children:E.changeKnowledge.openPage})})]}),(0,M.jsx)(N_,{change:i.id})]})]})}})}function Gw(e,t){let n=A(`/api/changes`),r=ye(e,`change`),i=n.state===`ready`?Sy(n.data,r):void 0,a=A(i?`/api/changes/${i.id}`:void 0),o=A(i&&t===`tasks`?`/api/changes/${i.id}/tasks`:void 0),s=A(i&&t!==`tasks`?`/api/changes/${i.id}/cockpit`:void 0);return j(e=>{e.type===`file.changed`&&(n.reload(),a.reload(),o.reload(),s.reload())}),(0,M.jsx)(Ww,{stage:t,list:n,wanted:r,detail:i?a:void 0,tasks:i&&t===`tasks`?o:void 0,cockpit:i&&t!==`tasks`?s:void 0})}function Kw({hash:e}){return Gw(e,`feature`)}function qw({hash:e}){return Gw(e,`stories`)}function Jw({hash:e}){return Gw(e,`tasks`)}function Yw({list:e,wanted:t,cockpit:n}){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:`0 0 12px`,fontSize:12.5,lineHeight:1.55},children:Rw.architectureIntro}),(0,M.jsx)(P,{of:e,children:e=>{let r=Sy(e,t);return r&&n?.state===`loading`?(0,M.jsx)(P,{of:n,children:()=>null}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Qg,{step:ky(e,r?{change:r,...n?.state===`ready`?{cockpit:n.data}:{}}:void 0)}),(0,M.jsx)(`p`,{className:`work-say`,style:{margin:`0 0 8px`},children:(0,M.jsx)(Lg,{...e.find(e=>ly(e.state)===`architecture`)?{change:e.find(e=>ly(e.state)===`architecture`).id}:{}})}),e.length>0&&(0,M.jsx)(`p`,{className:`row`,style:{gap:12,flexWrap:`wrap`,margin:`8px 0 0`},children:e.map(e=>(0,M.jsxs)(`span`,{className:`row`,style:{gap:12},children:[(0,M.jsxs)(`a`,{href:`#/flows?change=${encodeURIComponent(e.id)}`,children:[E.flows.openTargets,`: `,e.title]}),(0,M.jsxs)(`a`,{href:`#/change-diagram?change=${encodeURIComponent(e.id)}`,children:[E.changeDiagram.title,`: `,e.title]}),(0,M.jsxs)(`a`,{href:`#/estimate?change=${encodeURIComponent(e.id)}`,children:[E.estimate.title,`: `,e.title]})]},e.id))})]})}})]})}function Xw({list:e,wanted:t}){if(e.state!==`ready`||e.data.length===0)return null;let n=Sy(e.data,t);return(0,M.jsx)(`div`,{className:`bento`,style:{marginBottom:12},children:n?(0,M.jsx)(Nw,{change:n.id,stage:`architecture`}):(0,M.jsxs)(N,{title:E.stageReview.title,span:`1 / -1`,children:[(0,M.jsx)(`p`,{className:`work-say`,style:{marginTop:0},children:E.stageReview.pickForArchitecture}),(0,M.jsx)(`ul`,{className:`stage-comments`,children:e.data.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`a`,{href:`#/architecture?change=${encodeURIComponent(e.id)}`,children:e.title}),` `,(0,M.jsx)(`span`,{className:`muted`,children:e.id})]},e.id))})]})})}function Zw({hash:e}){let t=A(`/api/changes`),n=ye(e,`change`),r=t.state===`ready`?Sy(t.data,n):void 0,i=A(r?`/api/changes/${r.id}/cockpit`:void 0);return j(e=>{e.type===`file.changed`&&(t.reload(),i.reload())}),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Yw,{list:t,wanted:n,...r?{cockpit:i}:{}}),r&&(0,M.jsx)(`div`,{className:`bento`,style:{marginBottom:12},children:(0,M.jsx)(Lw,{change:r.id})}),(0,M.jsx)(Xw,{list:t,wanted:ye(e,`change`)}),(0,M.jsx)(yg,{hash:e})]})}var Qw=E.changeDiagram;function $w(e){let t=new Set(e.nodes.map(e=>e.group).filter(Boolean));return{boxes:[...e.groups.filter(e=>t.has(e.id)).map(e=>({id:e.id,label:e.label,kind:e.kind,gaps:[],childCount:0,outside:!1,group:!0,inside:0})),...e.nodes.map(e=>({id:e.id,label:e.label,kind:e.kind,gaps:[],childCount:0,outside:!1,group:!1,inside:0,...e.group?{parent:e.group}:{},...e.legend?{mark:e.legend}:{}}))],links:e.edges.map(e=>({id:e.id,from:e.from,to:e.to,type:`change`,count:1,label:e.label,async:e.async,gaps:[],...e.legend?{mark:e.legend}:{}}))}}var eT=e=>Qw.mark[e??`none`]??Qw.mark.none;function tT(){return(0,M.jsxs)(`ul`,{className:`cd-legend`,"aria-label":Qw.legend,children:[(0,M.jsx)(`li`,{className:`cd-key m-new`,children:Qw.legendNew}),(0,M.jsx)(`li`,{className:`cd-key m-modify`,children:Qw.legendModify}),(0,M.jsx)(`li`,{className:`cd-key m-retire`,children:Qw.legendRetire}),(0,M.jsx)(`li`,{className:`cd-key`,children:Qw.legendContext})]})}function nT({map:e}){let t=(0,v.useMemo)(()=>$w(e),[e]),n=new Map(e.groups.map(e=>[e.id,e.label])),r=new Map(e.nodes.map(e=>[e.id,e.label]));return e.flows?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`p`,{className:`muted`,style:{margin:`0 0 8px`},children:[Qw.from(e.flows,e.source),` `,(0,M.jsx)(`a`,{href:wb(e.change),children:Qw.flows(e.change)})]}),(0,M.jsx)(tT,{}),(0,M.jsx)(`div`,{className:`cd-canvas`,children:(0,M.jsx)(jh,{graph:t,direction:`RIGHT`,pinned:{},tidy:0,onSelect:()=>void 0,onToggle:()=>void 0,onMoved:()=>void 0,onLaid:()=>void 0})}),e.problems.length>0&&(0,M.jsxs)(`div`,{role:`note`,className:`cd-problems`,children:[(0,M.jsx)(`h3`,{className:`hud`,children:Qw.problems}),(0,M.jsx)(`ul`,{children:e.problems.map(e=>(0,M.jsx)(`li`,{children:e},e))})]}),(0,M.jsx)(`h3`,{className:`hud`,children:Qw.parts}),(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`caption`,{className:`sr`,children:Qw.caption(e.change)}),(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{scope:`col`,children:Qw.col.part}),(0,M.jsx)(`th`,{scope:`col`,children:Qw.col.kind}),(0,M.jsx)(`th`,{scope:`col`,children:Qw.col.in}),(0,M.jsx)(`th`,{scope:`col`,children:Qw.col.mark})]})}),(0,M.jsx)(`tbody`,{children:e.nodes.map(e=>(0,M.jsxs)(`tr`,{className:e.legend?`m-${e.legend}`:``,children:[(0,M.jsx)(`td`,{className:`mono`,children:e.id}),(0,M.jsx)(`td`,{children:e.kind}),(0,M.jsx)(`td`,{children:e.group?n.get(e.group)??e.group:``}),(0,M.jsx)(`td`,{children:eT(e.legend)})]},e.id))})]}),(0,M.jsx)(`h3`,{className:`hud`,children:Qw.lines}),(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{scope:`col`,children:Qw.col.from}),(0,M.jsx)(`th`,{scope:`col`,children:Qw.col.what}),(0,M.jsx)(`th`,{scope:`col`,children:Qw.col.to}),(0,M.jsx)(`th`,{scope:`col`,children:Qw.col.mark})]})}),(0,M.jsx)(`tbody`,{children:e.edges.map(e=>(0,M.jsxs)(`tr`,{className:e.legend?`m-${e.legend}`:``,children:[(0,M.jsx)(`td`,{className:`mono`,children:r.get(e.from)??e.from}),(0,M.jsx)(`td`,{className:`mono`,children:e.label}),(0,M.jsx)(`td`,{className:`mono`,children:r.get(e.to)??e.to}),(0,M.jsx)(`td`,{children:eT(e.legend)})]},e.id))})]}),(0,M.jsx)(`h3`,{className:`hud`,children:Qw.mermaid}),(0,M.jsx)(`p`,{className:`muted`,children:Qw.mermaidHint}),(0,M.jsxs)(`div`,{className:`cd-mermaid`,children:[(0,M.jsx)(`pre`,{tabIndex:0,"aria-label":Qw.mermaid,children:e.mermaid}),(0,M.jsx)(Yt,{text:e.mermaid,label:Qw.copyMermaid})]})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{children:Qw.noTargets(e.change)}),(0,M.jsx)(Xg,{text:`atticus change architecture ${e.change}`,label:E.runNext.copy})]})}function rT({hash:e}){let t=A(`/api/changes`),n=ye(e,`change`)??(t.state===`ready`?t.data[0]?.id:void 0)??void 0,r=A(n?`/api/changes/${encodeURIComponent(n)}/map`:void 0);return j(()=>r.reload()),(0,M.jsxs)(N,{title:Qw.title,children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:`0 0 12px`,fontSize:12.5,lineHeight:1.55},children:Qw.intro}),(0,M.jsx)(P,{of:t,empty:e=>e.length===0,emptyText:Qw.none,children:e=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Vw,{list:e,current:n,screen:`change-diagram`}),n&&(0,M.jsx)(P,{of:r,children:e=>(0,M.jsx)(nT,{map:e})})]})})]})}var iT=E.conformance,aT=e=>`${e.repo?`${e.repo}:`:``}${e.path}${e.line?`:${e.line}`:``}`;function oT({r:e}){let t=e.counts.missing+e.counts.stillThere+e.counts.unexpected>0,n=`conf-${e.repo}`;return(0,M.jsxs)(`section`,{"aria-labelledby":n,className:`est-band`,children:[(0,M.jsx)(`h3`,{id:n,className:`hud`,children:iT.repo(e.repo,e.ref)}),(0,M.jsxs)(`p`,{className:`muted`,style:{margin:`0 0 4px`},children:[iT.commits(e.commit,e.base),e.task?`. ${iT.task(e.task)}`:``]}),(0,M.jsx)(`p`,{className:`est-big`,children:t?iT.counts(e.counts):iT.allGood}),(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`caption`,{className:`sr`,children:iT.itemsCaption(e.repo)}),(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{scope:`col`,children:iT.col.status}),(0,M.jsx)(`th`,{scope:`col`,children:iT.col.what}),(0,M.jsx)(`th`,{scope:`col`,children:iT.col.step}),(0,M.jsx)(`th`,{scope:`col`,children:iT.col.task}),(0,M.jsx)(`th`,{scope:`col`,children:iT.col.at}),(0,M.jsx)(`th`,{scope:`col`,children:iT.col.finding})]})}),(0,M.jsx)(`tbody`,{children:e.items.map((e,t)=>(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`td`,{children:e.status===`found`?iT.status[e.status]:(0,M.jsx)(`strong`,{children:iT.status[e.status]})}),(0,M.jsx)(`td`,{children:e.what}),(0,M.jsx)(`td`,{className:`mono`,children:e.flow?iT.step(e.flow,e.item):iT.noStep}),(0,M.jsx)(`td`,{className:`mono`,children:e.task??``}),(0,M.jsx)(`td`,{className:`mono`,children:e.at.map(aT).join(`, `)}),(0,M.jsx)(`td`,{className:`mono`,children:e.finding?`${e.finding.id} (${e.finding.state})`:``})]},`${e.status}.${e.check}.${e.flow??``}.${e.item??``}.${e.record??``}.${t}`))})]}),e.unchecked.length>0&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`h4`,{className:`hud`,children:iT.unchecked}),(0,M.jsx)(`p`,{className:`muted`,children:iT.uncheckedIntro}),(0,M.jsx)(`ul`,{children:e.unchecked.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{className:`mono`,children:iT.step(e.flow,e.item)}),` (`,e.kind,`): `,e.why]},`${e.flow}.${e.item??`trigger`}`))})]}),e.problems.length>0&&(0,M.jsxs)(`div`,{role:`note`,className:`cd-problems`,children:[(0,M.jsx)(`h4`,{className:`hud`,children:iT.problems}),(0,M.jsx)(`ul`,{children:e.problems.map(e=>(0,M.jsx)(`li`,{children:e},e))})]})]})}function sT({c:e}){return e.flows?e.results.length?(0,M.jsxs)(M.Fragment,{children:[e.results.map(e=>(0,M.jsx)(oT,{r:e},e.repo)),(0,M.jsx)(`p`,{children:iT.gate(e.round)}),(0,M.jsx)(`p`,{className:`hud`,style:{margin:`8px 0 4px`},children:iT.run}),(0,M.jsx)(Xg,{text:`atticus change conform ${e.change}`,label:E.runNext.copy}),e.problems.length>0&&(0,M.jsxs)(`div`,{role:`note`,className:`cd-problems`,children:[(0,M.jsx)(`h3`,{className:`hud`,children:iT.problems}),(0,M.jsx)(`ul`,{children:e.problems.map(e=>(0,M.jsx)(`li`,{children:e},e))})]})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{children:iT.notChecked(e.change)}),(0,M.jsx)(Xg,{text:`atticus change conform ${e.change}`,label:E.runNext.copy})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{children:iT.noTargets(e.change)}),(0,M.jsx)(Xg,{text:`atticus change architecture ${e.change}`,label:E.runNext.copy})]})}function cT({hash:e}){let t=A(`/api/changes`),n=ye(e,`change`)??(t.state===`ready`?t.data[0]?.id:void 0),r=A(n?`/api/changes/${encodeURIComponent(n)}/conformance`:void 0);return j(()=>r.reload()),(0,M.jsxs)(N,{title:iT.title,children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:`0 0 12px`,fontSize:12.5,lineHeight:1.55},children:iT.intro}),(0,M.jsx)(P,{of:t,empty:e=>e.length===0,emptyText:iT.none,children:e=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Vw,{list:e,current:n,screen:`conformance`}),n&&(0,M.jsx)(P,{of:r,children:e=>(0,M.jsx)(sT,{c:e})})]})})]})}var lT=[`Home`,`Map`,`Change`,`Questions`,`Knowledge`,`SetUp`],uT=[...lT,`Atticus`],dT=[`Define`,`Design`,`Plan`,`Build`,`Release`],fT=E.nav,pT=E.nav.screens,mT=E.knowledge.nav,hT=[{id:`home`,label:pT.home,section:`Home`,also:[E.commandCenter.waitingOnYou,fT.dashboard]},{id:`words`,label:pT.words,section:`Home`,aside:!0},{id:`canvas`,label:pT.canvas,section:`Map`},{id:`flows`,label:E.flows.title,section:`Map`},{id:`contracts`,label:pT.contracts,section:`Map`},{id:`impact`,label:pT.impact,section:`Map`},{id:`trust`,label:pT.trust,section:`Map`},{id:`explore`,label:pT.explore,section:`Map`,aside:!0},{id:`systems`,label:pT.systems,section:`Map`,aside:!0},{id:`outside`,label:pT.outside,section:`Map`,aside:!0},{id:`mismatches`,label:pT.mismatches,section:`Map`,aside:!0},{id:`map`,label:pT.map,section:`Map`,full:!0},{id:`features`,label:pT.features,section:`Map`,full:!0},{id:`mappings`,label:pT.mappings,section:`Map`,full:!0},{id:`diagrams`,label:pT.diagrams,section:`Map`,full:!0},{id:`reconcile`,label:pT.reconcile,section:`Map`,full:!0},{id:`governance`,label:pT.governance,section:`Map`,full:!0},{id:`initiatives`,label:pT.initiatives,section:`Map`,full:!0},{id:`changes`,label:pT.changes,section:`Change`},{id:`cockpit`,label:pT.cockpit,section:`Change`,group:`Define`},{id:`brief`,label:pT.brief,section:`Change`,group:`Define`,full:!0},{id:`ux`,label:pT.ux,section:`Change`,group:`Define`,full:!0},{id:`feature-design`,label:fT.feature,section:`Change`,group:`Define`},{id:`change-knowledge`,label:pT.changeKnowledge,section:`Change`,group:`Define`,also:[E.changeKnowledge.title]},{id:`architecture`,label:fT.architecture,section:`Change`,group:`Design`},{id:`arch-review`,label:pT.archReview,section:`Change`,group:`Design`,full:!0},{id:`change-diagram`,label:pT.changeDiagram,section:`Change`,group:`Design`,aside:!0},{id:`stories`,label:fT.stories,section:`Change`,group:`Plan`},{id:`breakdown`,label:pT.breakdown,section:`Change`,group:`Plan`,full:!0},{id:`estimate`,label:pT.estimate,section:`Change`,group:`Plan`,full:!0},{id:`task-list`,label:fT.tasks,section:`Change`,group:`Build`},{id:`tasks`,label:pT.tasks,section:`Change`,group:`Build`,full:!0},{id:`conformance`,label:pT.conformance,section:`Change`,group:`Build`,full:!0},{id:`trace`,label:pT.trace,section:`Change`,group:`Build`,full:!0},{id:`todo`,label:pT.todo,section:`Change`,group:`Build`,full:!0},{id:`release`,label:pT.release,section:`Change`,group:`Release`,full:!0},{id:`service-desk`,label:pT.serviceDesk,section:`Change`,group:`Release`,full:!0},{id:`questions`,label:E.questions.title,section:`Questions`},{id:`knowledge`,label:mT.items,section:`Knowledge`},{id:`wikis`,label:mT.sources,section:`Knowledge`},{id:`documents`,label:mT.documents,section:`Knowledge`},{id:`wiki-search`,label:mT.search,section:`Knowledge`},{id:`parties`,label:mT.parties,section:`Knowledge`,full:!0},{id:`orgpack-draft`,label:mT.orgpack,section:`Knowledge`,full:!0},{id:`repos`,label:pT.repos,section:`SetUp`},{id:`ai`,label:pT.ai,section:`SetUp`},{id:`runs`,label:pT.runs,section:`SetUp`},{id:`orgpack`,label:pT.orgpack,section:`SetUp`},{id:`onboarding`,label:fT.onboarding,section:`SetUp`,aside:!0},{id:`scans`,label:pT.scans,section:`SetUp`,full:!0},{id:`intake`,label:pT.intake,section:`SetUp`,full:!0},{id:`settings`,label:pT.settings,section:`SetUp`,full:!0},{id:`history`,label:pT.history,section:`Atticus`,full:!0},{id:`evals`,label:pT.evals,section:`Atticus`,full:!0},{id:`learning`,label:pT.learning,section:`Atticus`,full:!0}],gT=e=>fT.sections[e],_T=e=>fT.groups[e],vT=(e,t=!1)=>hT.filter(n=>n.section===e&&!n.under&&(t||!n.full&&!n.aside)),yT=(e,t=!1)=>vT(e,t)[0];function bT(){return uT.flatMap(e=>{let t=hT.filter(t=>t.section===e&&t.full);if(!t.length)return[];if(e!==`Change`)return[{section:e,pages:t}];let n=dT.map(e=>({phase:e,pages:t.filter(t=>t.group===e)})).filter(e=>e.pages.length);return[{section:e,pages:n.flatMap(e=>e.pages),phases:n}]})}var xT={dashboard:`home`};function ST(e){let t=e.replace(/^#\/?/,``).split(/[/?]/)[0]||`home`,n=xT[t]??t;return hT.find(e=>e.id===n)??hT[0]}function CT(e){let t=e.replace(/^#\/?/,``),n=/^changes\/([^/?]+)/.exec(t);if(n)return decodeURIComponent(n[1]);let r=t.split(`?`)[1];return r?new URLSearchParams(r).get(`change`)??void 0:void 0}function wT(e,t){return e.section!==`Change`||!t?`#/${e.id}`:e.id===`changes`?`#/changes/${encodeURIComponent(t)}`:`#/${e.id}?change=${encodeURIComponent(t)}`}var TT=E.cockpit,ET=(e,t)=>{let n=ST(e);return n?wT(n,t):`#/${e}`};function DT(e){return e.state===`done`?`done`:e.state===`not-started`?`todo`:`current`}function OT({c:e}){return(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsxs)(`section`,{"aria-labelledby":`cockpit-where`,className:`stack`,style:{gap:6},children:[(0,M.jsx)(`h3`,{id:`cockpit-where`,className:`hud`,children:TT.where}),(0,M.jsx)(`p`,{style:{margin:0},children:TT.state(e.state,e.risk.level)}),e.work&&(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:e.work}),(0,M.jsx)(`ol`,{className:`row`,style:{gap:6,flexWrap:`wrap`,listStyle:`none`,padding:0,margin:0},children:e.stages.map(t=>{let n=DT(t);return(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`a`,{className:`chip ${n===`done`?``:n===`current`?`warn`:``}`,href:ET(TT.stageScreen[t.stage],e.id),"aria-current":n===`current`?`step`:void 0,children:TT.stage(TT.stages[t.stage],TT.marks[n])}),(t.drafts>0||t.openQuestions>0)&&(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:11.5,marginLeft:4},children:TT.progress(t.drafts,t.rounds,t.openQuestions)})]},t.stage)})})]}),(0,M.jsxs)(`section`,{"aria-labelledby":`cockpit-next`,className:`stack`,style:{gap:6},children:[(0,M.jsx)(`h3`,{id:`cockpit-next`,className:`hud`,children:TT.next}),(0,M.jsx)(`p`,{style:{margin:0},children:e.nextStep}),e.next&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:e.next.why}),e.next.slash&&(0,M.jsx)(Xg,{text:e.next.slash,label:TT.copySlash}),(0,M.jsx)(Xg,{text:e.next.command,label:TT.copyCommand})]})]}),e.reasons.length>0&&(0,M.jsxs)(`section`,{"aria-labelledby":`cockpit-blocks`,className:`stack`,style:{gap:6},children:[(0,M.jsx)(`h3`,{id:`cockpit-blocks`,className:`hud`,children:TT.blocks}),(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:e.reasons.map(e=>(0,M.jsx)(`li`,{children:e.message},`${e.code}-${e.message}`))})]}),e.openQuestions>0&&(0,M.jsx)(`p`,{style:{margin:0},children:(0,M.jsx)(`a`,{href:ET(`questions`,e.id),children:TT.questions(e.openQuestions)})}),(0,M.jsxs)(`section`,{"aria-labelledby":`cockpit-repos`,className:`stack`,style:{gap:6},children:[(0,M.jsx)(`h3`,{id:`cockpit-repos`,className:`hud`,children:TT.repos}),e.repos.length===0?(0,M.jsx)(`p`,{className:`muted`,style:{margin:0},children:TT.noRepos}):(0,M.jsx)(`ul`,{style:{margin:0,paddingLeft:18},children:e.repos.map(e=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`span`,{className:`mono`,children:e.id}),`: `,TT.branchOn(e.branch,e.base),e.pr&&(0,M.jsxs)(M.Fragment,{children:[` · `,(0,M.jsx)(`a`,{href:e.pr,children:TT.pr})]})]},e.id))})]})]})}function kT(e){let t=TT.like;return(0,M.jsxs)(`section`,{"aria-label":t.title,children:[(0,M.jsx)(`h3`,{children:t.title}),(0,M.jsx)(`p`,{className:`muted`,children:t.intro}),e.r.how===`words`&&e.r.note&&e.r.changes.length>0&&(0,M.jsx)(`p`,{className:`muted`,children:t.byWords(e.r.note)}),e.r.changes.length===0?(0,M.jsx)(`p`,{className:`muted`,children:t.none}):(0,M.jsx)(`ul`,{className:`plain`,children:e.r.changes.map(n=>(0,M.jsxs)(`li`,{children:[(0,M.jsx)(`strong`,{children:n.title}),n.archived&&(0,M.jsxs)(`span`,{className:`muted`,children:[` · `,t.archived(n.archived)]}),n.summary&&(0,M.jsx)(`div`,{children:n.summary}),e.onUse&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.busy,onClick:()=>e.onUse?.(n.id),children:t.use})]},n.id))})]})}function AT({change:e}){let t=A(`/api/past-changes?change=${encodeURIComponent(e)}`),n=De();return(0,M.jsx)(P,{of:t,children:t=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(kT,{r:t,busy:n.busy,onUse:t=>void n.run(()=>k(`/api/changes/${encodeURIComponent(e)}/like`,{method:`POST`,body:{like:t}}),TT.like.used)}),(0,M.jsx)(Oe,{note:n.note})]})})}function jT(e){let t=De();return(0,M.jsxs)(`span`,{className:`row`,style:{gap:6},children:[(0,M.jsx)(`button`,{type:`button`,className:`btn`,"aria-pressed":e.watching,disabled:t.busy,onClick:()=>void t.run(async()=>{await k(`/api/me/watch`,{method:`PUT`,body:{change:e.change,watch:!e.watching}}),e.onChanged?.()},e.watching?TT.unwatched:TT.watched),children:e.watching?TT.unwatch:TT.watch}),(0,M.jsx)(Oe,{note:t.note})]})}function MT(e){return!e.current||!e.list.some(t=>t.id===e.current)?(0,M.jsx)(e_,{bare:!0}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Vw,{list:e.list,current:e.current,screen:`cockpit`}),(0,M.jsx)(P,{of:e.c,children:e=>(0,M.jsx)(OT,{c:e})}),(0,M.jsx)(AT,{change:e.current})]})}function NT({hash:e}){let t=A(`/api/changes`),n=ye(e,`change`),r=A(n?`/api/changes/${encodeURIComponent(n)}/cockpit`:void 0),i=A(`/api/me`);return ce(r),(0,M.jsx)(N,{title:TT.title,meta:n&&i.state===`ready`?(0,M.jsx)(jT,{change:n,watching:(i.data.watching??[]).includes(n),onChanged:i.reload}):void 0,children:(0,M.jsx)(P,{of:t,empty:e=>e.length===0,emptyText:TT.none,children:e=>(0,M.jsx)(MT,{list:e,current:n,c:r})})})}var PT=E.estimate;function FT({e}){if(!e.units.length)return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{children:PT.noTargets(e.change)}),(0,M.jsx)(Xg,{text:`atticus change architecture ${e.change}`,label:E.runNext.copy})]});let t=e.units.length-e.needsClass;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`section`,{"aria-labelledby":`est-effort`,className:`est-band`,children:[(0,M.jsx)(`h3`,{id:`est-effort`,className:`hud`,children:PT.effort}),e.effort?(0,M.jsxs)(`p`,{className:`est-big`,children:[PT.effortRange(e.effort.p20,e.effort.p80,e.effort.p50),` `,(0,M.jsx)(`span`,{className:`muted`,children:PT.from(t,e.units.length)})]}):(0,M.jsxs)(`p`,{className:`est-big`,children:[PT.noDays(e.units.length),` `,e.table?PT.noMatch:PT.noTable]})]}),(0,M.jsxs)(`section`,{"aria-labelledby":`est-calendar`,className:`est-band`,children:[(0,M.jsx)(`h3`,{id:`est-calendar`,className:`hud`,children:PT.calendar}),(0,M.jsxs)(`p`,{children:[e.calendar.waitDays===void 0?PT.noWait:PT.waiting(e.calendar.waitDays),e.calendar.longer&&(0,M.jsxs)(M.Fragment,{children:[` `,PT.longer(e.calendar.longer)]})]})]}),(0,M.jsxs)(`section`,{"aria-labelledby":`est-calibration`,className:`est-band`,children:[(0,M.jsx)(`h3`,{id:`est-calibration`,className:`hud`,children:PT.calibration}),(0,M.jsx)(`p`,{children:PT.notCalibrated(e.calibration.source,e.table)})]}),(0,M.jsx)(`h3`,{className:`hud`,children:PT.drivers}),e.drivers.length?(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`caption`,{className:`sr`,children:PT.driversCaption}),(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{scope:`col`,children:PT.col.what}),(0,M.jsx)(`th`,{scope:`col`,children:PT.col.count}),(0,M.jsx)(`th`,{scope:`col`,children:PT.col.effect}),(0,M.jsx)(`th`,{scope:`col`,children:PT.col.source})]})}),(0,M.jsx)(`tbody`,{children:e.drivers.map(e=>(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`td`,{children:e.what}),(0,M.jsx)(`td`,{children:e.count}),(0,M.jsx)(`td`,{children:e.widens?PT.widens(e.widens):``}),(0,M.jsx)(`td`,{className:`mono`,children:e.source??``})]},e.id))})]}):(0,M.jsx)(`p`,{children:PT.noDrivers}),e.perRepo.length>1&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`h3`,{className:`hud`,children:PT.perRepo}),(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{scope:`col`,children:PT.col.repo}),(0,M.jsx)(`th`,{scope:`col`,children:PT.col.units}),(0,M.jsx)(`th`,{scope:`col`,children:PT.col.days})]})}),(0,M.jsx)(`tbody`,{children:e.perRepo.map(e=>(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`td`,{className:`mono`,children:e.repo}),(0,M.jsx)(`td`,{children:e.units}),(0,M.jsx)(`td`,{children:e.effort?PT.days(e.effort):PT.needsClass})]},e.repo))})]})]}),(0,M.jsx)(`h3`,{className:`hud`,children:PT.work}),(0,M.jsxs)(`table`,{className:`run-table`,children:[(0,M.jsx)(`caption`,{className:`sr`,children:PT.workCaption(e.change)}),(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{scope:`col`,children:PT.col.repo}),(0,M.jsx)(`th`,{scope:`col`,children:PT.col.flow}),(0,M.jsx)(`th`,{scope:`col`,children:PT.col.step}),(0,M.jsx)(`th`,{scope:`col`,children:PT.col.what}),(0,M.jsx)(`th`,{scope:`col`,children:PT.col.cls}),(0,M.jsx)(`th`,{scope:`col`,children:PT.col.days})]})}),(0,M.jsx)(`tbody`,{children:e.units.map((e,t)=>(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`td`,{className:`mono`,children:e.repo}),(0,M.jsx)(`td`,{className:`mono`,children:e.flow}),(0,M.jsx)(`td`,{children:e.step??``}),(0,M.jsx)(`td`,{children:e.what}),(0,M.jsx)(`td`,{className:`mono`,children:e.class}),(0,M.jsx)(`td`,{children:e.days?PT.days(e.days):(0,M.jsx)(`strong`,{children:PT.needsClass})})]},`${e.flow}.${e.step??`flow`}.${t}`))})]}),e.problems.length>0&&(0,M.jsxs)(`div`,{role:`note`,className:`cd-problems`,children:[(0,M.jsx)(`h3`,{className:`hud`,children:PT.problems}),(0,M.jsx)(`ul`,{children:e.problems.map(e=>(0,M.jsx)(`li`,{children:e},e))})]})]})}function IT({hash:e}){let t=A(`/api/changes`),n=ye(e,`change`)??(t.state===`ready`?t.data[0]?.id:void 0),r=A(n?`/api/changes/${encodeURIComponent(n)}/estimate`:void 0);return j(()=>r.reload()),(0,M.jsxs)(N,{title:PT.title,children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:`0 0 12px`,fontSize:12.5,lineHeight:1.55},children:PT.intro}),(0,M.jsx)(P,{of:t,empty:e=>e.length===0,emptyText:PT.none,children:e=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Vw,{list:e,current:n,screen:`estimate`}),n&&(0,M.jsx)(P,{of:r,children:e=>(0,M.jsx)(FT,{e})})]})})]})}var LT=E.changeKnowledge,RT=E.runNext,zT=e=>e.title??e.id,BT=e=>LT.kinds[e]??e;function VT({item:e}){return(0,M.jsxs)(M.Fragment,{children:[e.title?(0,M.jsx)(`span`,{children:e.title}):(0,M.jsx)(`code`,{className:`mono`,children:e.id}),` `,(0,M.jsx)(`span`,{className:`muted`,children:BT(e.kind)}),e.title&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`br`,{}),(0,M.jsx)(`code`,{className:`mono muted`,children:e.id})]}),e.source&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`br`,{}),(0,M.jsx)(`span`,{className:`muted`,children:LT.fromSource(e.source,e.authority)})]})]})}function HT(e){return(0,M.jsxs)(`span`,{className:`row`,style:{gap:6,flexWrap:`wrap`},children:[(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.busy||e.item.status===`confirmed`,"aria-label":LT.confirmItem(zT(e.item)),onClick:()=>e.onSet(e.item.id,`confirmed`),children:LT.confirm}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:e.busy||e.item.status===`excluded`,"aria-label":LT.excludeItem(zT(e.item)),onClick:()=>e.onSet(e.item.id,`excluded`),children:LT.exclude})]})}function UT({w:e,named:t}){return e.state===`idle`?null:e.state===`working`?(0,M.jsx)(`p`,{role:`status`,"aria-busy":`true`,className:`work-say`,children:LT.working}):e.state===`error`?(0,M.jsx)(`p`,{role:`alert`,className:`state error`,style:{margin:`8px 0 0`},children:e.text}):(0,M.jsxs)(`div`,{role:`status`,style:{marginTop:8},children:[(0,M.jsx)(`p`,{className:`work-say`,children:LT.set(t(e.id),LT.statuses[e.status].toLowerCase(),e.result.file)}),(0,M.jsx)(Xg,{text:e.result.commit,label:LT.copyCommit})]})}function WT(e){let t=e.written??{state:`idle`},n=t=>{let n=e.of.state===`ready`?e.of.data:void 0,r=[...n?.items??[],...n?.nearMisses??[]].find(e=>e.id===t);return r?zT(r):t},r=t.state===`working`,i=e.onSet??(()=>void 0);return(0,M.jsxs)(N,{title:LT.title,span:`1 / -1`,children:[(0,M.jsx)(`p`,{className:`work-why`,style:{marginTop:0},children:LT.intro}),(0,M.jsx)(P,{of:e.of,empty:e=>!e.present,emptyContent:(0,M.jsxs)(`div`,{className:`state`,children:[(0,M.jsx)(`p`,{style:{margin:`0 0 8px`},children:LT.none}),(0,M.jsx)(`p`,{className:`work-say`,children:RT.terminal}),(0,M.jsx)(Xg,{text:LT.featureCommand(e.change),label:RT.copy})]}),children:e=>(0,M.jsxs)(M.Fragment,{children:[e.items.length>0?(0,M.jsx)(ke,{caption:LT.caption,rows:e.items,rowKey:e=>e.id,cols:[{label:LT.item,cell:e=>(0,M.jsx)(VT,{item:e})},{label:LT.why,cell:e=>[e.reason,e.stages.join(`, `)||(e.tasks?.length?``:LT.noStages),e.tasks?.length?LT.tasks(e.tasks):``].filter(Boolean).join(` · `)},{label:LT.status,cell:e=>(0,M.jsx)(`span`,{className:`chip ${e.status===`confirmed`?`done`:e.status===`excluded`?`dim`:`warn`}`,children:LT.statuses[e.status]})},{label:LT.actions,cell:e=>(0,M.jsx)(HT,{item:e,busy:r,onSet:i})}]}):(0,M.jsx)(`div`,{className:`state`,children:LT.none}),e.nearMisses.length>0&&(0,M.jsxs)(`details`,{style:{marginTop:8},children:[(0,M.jsx)(`summary`,{children:LT.nearMisses(e.nearMisses.length)}),(0,M.jsx)(`ul`,{className:`stack`,style:{listStyle:`none`,padding:0,margin:`8px 0 0`},children:e.nearMisses.map(e=>(0,M.jsxs)(`li`,{className:`row between`,style:{gap:8,flexWrap:`wrap`},children:[(0,M.jsxs)(`span`,{children:[(0,M.jsx)(VT,{item:e}),` `,(0,M.jsxs)(`span`,{className:`muted`,children:[`· `,LT.nearMissStage(e.stage)]})]}),(0,M.jsx)(HT,{item:e,busy:r,onSet:i})]},e.id))})]}),e.conflicts?.length?(0,M.jsxs)(`section`,{"aria-label":E.knowledgeConflicts.title,style:{marginTop:12},children:[(0,M.jsx)(`h3`,{style:{margin:`0 0 4px`},children:E.knowledgeConflicts.title}),(0,M.jsx)(`p`,{className:`work-why`,style:{marginTop:0},children:E.knowledgeConflicts.intro}),(0,M.jsx)(f_,{conflicts:e.conflicts})]}):null,(0,M.jsx)(UT,{w:t,named:n})]})})]})}function GT({change:e}){let t=`/api/changes/${encodeURIComponent(e)}/knowledge`,n=A(t);ce(n);let[r,i]=(0,v.useState)({state:`idle`});return(0,M.jsx)(WT,{change:e,of:n,written:r,onSet:(e,r)=>{i({state:`working`}),k(`${t}/${encodeURIComponent(e)}`,{method:`POST`,body:{status:r}}).then(t=>{i({state:`done`,id:e,status:r,result:t}),n.reload()}).catch(e=>i({state:`error`,text:Ee(e)}))}})}function KT(e){return(0,M.jsx)(P,{of:e.list,empty:e=>e.length===0,emptyContent:(0,M.jsx)(t_,{}),children:t=>{let n=Sy(t,e.wanted);return n?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`row between`,style:{flexWrap:`wrap`,marginBottom:12},children:[(0,M.jsx)(`p`,{style:{margin:0},children:(0,M.jsx)(`span`,{className:`n`,style:{fontSize:20},children:n.title})}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:12,flexWrap:`wrap`},children:[(0,M.jsx)(Lg,{change:n.id}),(0,M.jsx)(Vw,{list:t,current:n.id,screen:`change-knowledge`})]})]}),(0,M.jsx)(`div`,{className:`bento`,children:e.panel(n.id)})]}):(0,M.jsx)(e_,{})}})}function qT({hash:e}){let t=A(`/api/changes`);return j(e=>{e.type===`file.changed`&&t.reload()}),(0,M.jsx)(KT,{list:t,wanted:ye(e,`change`),panel:e=>(0,M.jsx)(GT,{change:e})})}var JT=E.work;function YT({done:e}){return(0,M.jsx)(`span`,{className:`chip ${e?`done`:`dim`}`,children:e?JT.done:JT.todo})}function XT({v:e,openQuestions:t}){let n=Cy(e),r=e.repos[0]?.id??`<repo>`,i=e.repos.find(e=>e.lastScan===null)?.id??r,a=n.listed>0&&n.scanned===n.listed;return(0,M.jsxs)(`ol`,{className:`work-steps`,children:[(0,M.jsxs)(`li`,{children:[(0,M.jsxs)(`p`,{children:[(0,M.jsx)(YT,{done:n.listed>0}),` `,e.manifests.length?JT.stepPick:JT.stepPickNone]}),e.manifests.map(e=>(0,M.jsx)(`p`,{children:(0,M.jsx)(`code`,{className:`mono`,children:e.path})},e.path)),(0,M.jsx)(Xg,{text:`atticus repos discover <folder>`,label:E.runNext.copy}),(0,M.jsx)(`p`,{className:`work-say`,children:JT.stepAddOne}),(0,M.jsx)(Xg,{text:`atticus repo add <url> --description "what it is"`,label:E.runNext.copy})]}),(0,M.jsxs)(`li`,{children:[(0,M.jsxs)(`p`,{children:[(0,M.jsx)(YT,{done:n.listed>0&&n.cloned===n.listed}),` `,JT.stepSync]}),(0,M.jsx)(Xg,{text:`atticus workspace sync`,label:E.runNext.copy})]}),(0,M.jsxs)(`li`,{children:[(0,M.jsxs)(`p`,{children:[(0,M.jsx)(YT,{done:a}),` `,JT.stepRead]}),(0,M.jsx)(Xg,{text:`atticus map ${i}`,label:E.runNext.copy}),(0,M.jsx)(`p`,{className:`work-say`,children:E.runNext.slash}),(0,M.jsx)(Xg,{text:`/atticus-map ${i}`,label:E.runNext.copySlash})]}),(0,M.jsxs)(`li`,{children:[(0,M.jsxs)(`p`,{children:[(0,M.jsx)(YT,{done:a}),` `,JT.stepWrite]}),(0,M.jsx)(Xg,{text:`atticus verify ${i} --write`,label:E.runNext.copy})]}),(0,M.jsx)(`li`,{children:(0,M.jsxs)(`p`,{children:[(0,M.jsx)(YT,{done:a&&t===0}),` `,JT.stepAnswer,` `,(0,M.jsx)(`a`,{href:`#/questions`,children:JT.stepAnswerLink})]})}),(0,M.jsx)(`li`,{children:(0,M.jsxs)(`p`,{children:[JT.stepTrust,` `,(0,M.jsx)(`a`,{href:`#/trust`,children:JT.openTrust})]})})]})}function ZT({v:e}){return e.repos.length===0?(0,M.jsx)(`div`,{className:`state`,children:JT.noRepos}):(0,M.jsx)(ke,{caption:JT.repos,rows:e.repos,rowKey:e=>e.id,cols:[{label:JT.repoCol,cell:e=>e.id,mono:!0},{label:JT.aboutCol,cell:e=>e.description?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{children:e.description.text}),e.description.trust===`suggested`&&(0,M.jsx)(`span`,{className:`chip warn`,style:{marginLeft:6},children:JT.aboutDraft})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:JT.aboutMissing}),(0,M.jsx)(Xg,{text:`atticus repo describe ${e.id}`,label:E.runNext.copy})]})},{label:JT.typeCol,cell:e=>e.type,mono:!0},{label:JT.matchCol,cell:e=>(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:JT.matchHint}),(0,M.jsx)(Xg,{text:`atticus repo-type detect ${e.id}`,label:E.runNext.copy})]})},{label:JT.cloneCol,cell:e=>(0,M.jsx)(`span`,{className:`chip ${e.cloned?`done`:`dim`}`,children:e.cloned?JT.cloned:JT.notCloned})},{label:JT.settingsCol,cell:e=>e.scanSettings.present?(0,M.jsx)(`code`,{className:`mono`,children:e.scanSettings.path}):(0,M.jsx)(`span`,{className:`muted`,children:JT.settingsMissing})},{label:JT.lastScanCol,cell:e=>e.lastScan?(0,M.jsxs)(`span`,{children:[JT.recordCount(e.lastScan.records),e.lastScan.commit?` ${JT.atCommit(e.lastScan.commit)}`:``,(0,M.jsx)(`br`,{}),(0,M.jsx)(`span`,{className:`muted`,style:{fontSize:11.5},children:Object.entries(e.lastScan.kinds).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e,t])=>`${e} ${t}`).join(`, `)})]}):(0,M.jsx)(`span`,{className:`muted`,children:JT.notScanned})}]})}function QT({v:e}){let t=e.sources;return t.present?(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsxs)(`p`,{style:{margin:0},children:[JT.sourcesFile,`: `,(0,M.jsx)(`code`,{className:`mono`,children:t.path})]}),t.wikis.length===0&&t.absorbed.length===0&&(0,M.jsx)(`div`,{className:`state`,children:JT.sourcesNone(t.path)}),t.wikis.length>0&&(0,M.jsx)(ke,{caption:JT.sources,rows:t.wikis,rowKey:e=>e.id,cols:[{label:JT.wikiCol,cell:e=>e.id,mono:!0},{label:JT.kindCol,cell:e=>e.type},{label:JT.whereCol,cell:e=>e.location,mono:!0},{label:JT.spacesCol,cell:e=>e.spaces.join(`, `)},{label:JT.ownerCol,cell:e=>e.owner??``}]}),t.absorbed.length>0&&(0,M.jsx)(ke,{caption:JT.absorbedTitle,rows:t.absorbed,rowKey:e=>e.id,cols:[{label:JT.absorbedTitle,cell:e=>e.id,mono:!0},{label:JT.kindCol,cell:e=>`${e.format} · ${e.mode}`},{label:JT.whereCol,cell:e=>e.url,mono:!0}]}),t.wikis.length>0&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`work-say`,children:JT.syncSources}),(0,M.jsx)(Xg,{text:`atticus sources sync`,label:E.runNext.copy})]})]}):(0,M.jsx)(`div`,{className:`state`,children:JT.sourcesMissing(t.path)})}function $T({of:e,questions:t,trust:n}){let r=t.state===`ready`?t.data.questions.length:0;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`p`,{className:`muted`,style:{margin:`0 0 12px`,fontSize:12.5,lineHeight:1.55},children:JT.onbIntro}),(0,M.jsx)($g,{of:e,step:e=>Ey(e,r,n?.state===`ready`?n.data:void 0)}),(0,M.jsxs)(`div`,{className:`bento`,children:[(0,M.jsx)(N,{title:JT.steps,span:`span 5`,children:(0,M.jsx)(P,{of:e,children:e=>(0,M.jsx)(XT,{v:e,openQuestions:r})})}),(0,M.jsx)(N,{title:JT.sources,span:`span 7`,children:(0,M.jsx)(P,{of:e,children:e=>(0,M.jsx)(QT,{v:e})})}),(0,M.jsx)(N,{title:JT.repos,span:`1 / -1`,children:(0,M.jsx)(P,{of:e,children:e=>(0,M.jsxs)(`div`,{className:`stack`,children:[(0,M.jsx)(n_,{list:e.problems}),(0,M.jsx)(ZT,{v:e})]})})})]})]})}function eE(){let e=A(`/api/onboarding`),t=A(`/api/questions?state=open`),n=A(`/api/trust`);return j(r=>{r.type===`file.changed`&&(e.reload(),t.reload(),n.reload())}),(0,M.jsx)($T,{of:e,questions:t,trust:n})}var tE={onboarding:()=>(0,M.jsx)(eE,{}),"feature-design":Kw,"change-knowledge":qT,architecture:Zw,stories:qw,"task-list":Jw,canvas:({hash:e})=>(0,M.jsx)(yg,{hash:e,screen:`canvas`}),trust:()=>(0,M.jsx)(Bv,{}),outside:qv,mismatches:$v,home:()=>(0,M.jsx)(rb,{}),changes:vv,explore:ub,flows:Rb,questions:ox,...Gx,...eC,...fw,runs:Jg,history:ww,"change-diagram":rT,estimate:IT,cockpit:NT,conformance:cT,words:Ew},nE=E.notBuilt;function rE({screen:e}){return(0,M.jsx)(N,{title:e.label,children:(0,M.jsxs)(`p`,{style:{margin:0,color:`var(--text-2)`,lineHeight:1.6},children:[nE.thisScreenIsBeing,(0,M.jsx)(`code`,{className:`mono`,children:nE.atticusHelp}),` `,nE.toFindTheCommand]})})}var iE=E.boundary,aE=class extends v.Component{state={};static getDerivedStateFromError(e){return{error:e instanceof Error?e.message:String(e)}}render(){return this.state.error?(0,M.jsx)(`div`,{className:`bento`,children:(0,M.jsxs)(`section`,{className:`panel`,style:{gridColumn:`1 / -1`},role:`alert`,children:[(0,M.jsx)(`h2`,{className:`h`,children:iE.couldntBeShown(this.props.name)}),(0,M.jsx)(`p`,{className:`muted`,style:{margin:`8px 0 0`},children:iE.somethingOnThisScreen(this.state.error)})]})}):this.props.children}},oE=E.palette,sE=`atticus:open-palette`;function cE(e,t,n){let r=e.trim().toLowerCase(),i=e=>!r||e.toLowerCase().includes(r),a=[...hT.filter(e=>i(e.label)||i(e.id)||(e.also??[]).some(i)).map(e=>({kind:`screen`,label:e.label,detail:e.group?`${gT(e.section)} · ${_T(e.group)}`:gT(e.section),href:`#/${e.id}`})),...t.filter(e=>i(e.id)||i(e.title)).map(e=>({kind:`change`,label:e.title,detail:`${e.id} · ${e.state}`,href:`#/changes/${encodeURIComponent(e.id)}`})),...n.map(e=>({kind:`record`,label:e.name&&e.name!==e.id?`${e.id} · ${e.name}`:e.id,detail:e.kind,href:e.kind===`Capability`?`#/features?id=${encodeURIComponent(e.id)}`:`#/explore?q=${encodeURIComponent(e.id)}`}))];return r&&a.push({kind:`ask`,label:oE.askItem(e.trim()),detail:oE.askDetail,href:`#/explore?ask=${encodeURIComponent(e.trim())}`}),a.slice(0,14)}function lE(){let[e,t]=(0,v.useState)(!1),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(0),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)([]),u=(0,v.useRef)(null),d=(0,v.useRef)(null);(0,v.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),d.current=document.activeElement,t(e=>!e))},n=()=>{d.current=document.activeElement,t(!0)};return addEventListener(`keydown`,e),addEventListener(sE,n),()=>{removeEventListener(`keydown`,e),removeEventListener(sE,n)}},[]),(0,v.useEffect)(()=>{e&&(r(``),a(0),u.current?.focus(),k(`/api/changes`).then(s).catch(()=>s([])))},[e]),(0,v.useEffect)(()=>{let t=n.trim();if(!e||t.length<2){l([]);return}let r=setTimeout(()=>{k(`/api/search?q=${encodeURIComponent(t.split(/\s+/)[0])}&limit=6`).then(e=>l(e.rows)).catch(()=>l([]))},150);return()=>clearTimeout(r)},[n,e]);let f=(0,v.useMemo)(()=>cE(n,o,c),[n,o,c]),p=()=>{t(!1),d.current?.focus?.()},m=e=>{e&&(location.hash=e.href,p())};return e?(0,M.jsx)(`div`,{className:`palette-backdrop`,onClick:p,children:(0,M.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":oE.goToAnything,className:`palette panel`,onClick:e=>e.stopPropagation(),onKeyDown:e=>{e.key===`Escape`?p():e.key===`ArrowDown`?(e.preventDefault(),a(e=>Math.min(e+1,f.length-1))):e.key===`ArrowUp`?(e.preventDefault(),a(e=>Math.max(e-1,0))):e.key===`Enter`&&(e.preventDefault(),m(f[i]))},children:[(0,M.jsx)(`label`,{htmlFor:`palette-input`,className:`sr`,children:oE.goToAScreen}),(0,M.jsx)(`input`,{id:`palette-input`,ref:u,value:n,onChange:e=>{r(e.target.value),a(0)},placeholder:oE.goToAScreen2,role:`combobox`,"aria-expanded":`true`,"aria-controls":`palette-list`,"aria-activedescendant":f[i]?`palette-${i}`:void 0,autoComplete:`off`}),(0,M.jsxs)(`ul`,{id:`palette-list`,role:`listbox`,"aria-label":oE.results,children:[f.map((e,t)=>(0,M.jsxs)(`li`,{id:`palette-${t}`,role:`option`,"aria-selected":t===i,onMouseEnter:()=>a(t),onClick:()=>m(e),children:[(0,M.jsx)(`span`,{children:e.label}),(0,M.jsxs)(`span`,{className:`hud`,style:{fontSize:9.5},children:[e.kind,` · `,e.detail]})]},`${e.kind}/${e.href}`)),f.length===0&&(0,M.jsx)(`li`,{className:`muted`,children:oE.nothingMatches})]}),(0,M.jsx)(`div`,{className:`hud`,style:{fontSize:9.5,marginTop:8},children:oE.toMoveEnterTo})]})}):null}var uE=E.tour,dE=e=>`.nav a[href="#/${e}"]`,fE=[{...uE.steps.home,target:dE(`home`)},{...uE.steps.ask,target:`.ask-form`},{...uE.steps.change,target:dE(`changes`)},{...uE.steps.assistant},{...uE.steps.approve,target:dE(`changes`)}],pE=`atticus.tour.done`,mE=e=>`${pE}:${e}`,hE=()=>{try{return localStorage}catch{return}};function gE(e,t=hE()){try{return t?.getItem(mE(e))===`1`}catch{return!1}}function _E(e,t=hE()){try{t?.setItem(mE(e),`1`)}catch{}}var vE=()=>dispatchEvent(new Event(`atticus:tour`));function yE({metarepo:e}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(0),a=e??``,o=()=>_E(a);(0,v.useEffect)(()=>{e!==void 0&&!gE(e??``)&&window.self===window.top&&(i(0),n(!0))},[e]),(0,v.useEffect)(()=>{if(!t)return;let e=()=>{_E(a),n(!1)};return addEventListener(`hashchange`,e),()=>removeEventListener(`hashchange`,e)},[t,a]),(0,v.useEffect)(()=>{let e=()=>{i(0),n(!0)};return addEventListener(`atticus:tour`,e),()=>removeEventListener(`atticus:tour`,e)},[]);let s=fE[r];(0,v.useEffect)(()=>{if(!t||!s?.target)return;let e=document.querySelector(s.target);return e?.classList.add(`tour-target`),()=>e?.classList.remove(`tour-target`)},[t,s]),(0,v.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&(o(),n(!1))};return addEventListener(`keydown`,e),()=>removeEventListener(`keydown`,e)},[t]);let c=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(!t)return;let e=document.activeElement;return()=>e?.focus?.()},[t]),(0,v.useEffect)(()=>{t&&c.current?.querySelector(`.btn.primary`)?.focus()},[t,r]);let l=e=>{if(e.key!==`Tab`)return;let t=[...c.current?.querySelectorAll(`button`)??[]];if(!t.length)return;let n=t.indexOf(document.activeElement);t[e.shiftKey?n<=0?t.length-1:n-1:n===t.length-1?0:n+1].focus(),e.preventDefault()};if(!t||!s)return null;let u=()=>{o(),n(!1)};return(0,M.jsxs)(`div`,{ref:c,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tour-title`,className:`tour panel hero`,onKeyDown:l,children:[(0,M.jsx)(`div`,{className:`hud`,style:{fontSize:10},children:uE.tourOf(r+1,fE.length,E.app.tourEscape)}),(0,M.jsx)(`h2`,{id:`tour-title`,className:`h`,style:{margin:`6px 0`},children:s.title}),(0,M.jsx)(`p`,{style:{margin:`0 0 12px`,lineHeight:1.55,fontSize:13},children:s.body}),(0,M.jsxs)(`div`,{className:`row between`,children:[(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:uE.skipTheTour}),(0,M.jsxs)(`div`,{className:`row`,style:{gap:6},children:[r>0&&(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>i(r-1),children:uE.back}),r<fE.length-1?(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,onClick:()=>i(r+1),children:uE.next}):(0,M.jsx)(`button`,{type:`button`,className:`btn primary`,onClick:u,children:uE.done})]})]})]})}var bE=E.menu;function xE(){return(0,M.jsxs)(`svg`,{"aria-hidden":`true`,width:`26`,height:`26`,viewBox:`0 0 24 24`,fill:`none`,stroke:`var(--accent)`,strokeLinecap:`round`,style:{filter:`drop-shadow(0 0 var(--glow-size) var(--accent))`},children:[(0,M.jsxs)(`g`,{strokeWidth:`1.25`,children:[(0,M.jsx)(`circle`,{cx:`6.5`,cy:`12.4`,r:`4.5`}),(0,M.jsx)(`circle`,{cx:`17.5`,cy:`12.4`,r:`4.5`}),(0,M.jsx)(`path`,{d:`M11 11.4 H13`})]}),(0,M.jsx)(`path`,{strokeWidth:`1.05`,d:`M3.7 11.3 Q3.9 10.0 5.2 9.6 M20.3 11.3 Q20.1 10.0 18.8 9.6`})]})}var SE=`atticus.menu.more`;function CE(){try{return globalThis.localStorage}catch{return}}function wE(e=CE()){try{let t=e?.getItem(SE);return t===`open`||t!==`closed`&&void 0}catch{return}}function TE(e,t=CE()){try{t?.setItem(SE,e?`open`:`closed`)}catch{}}function EE(e){return/Mac|iPhone|iPad|iPod/.test(e??``)?bE.keysMac:bE.keys}function DE(){try{let e=globalThis.navigator;return e?.userAgentData?.platform||e?.platform}catch{return}}function OE({current:e,hash:t,full:n}){let[r,i]=(0,v.useState)(()=>wE()),a=(0,v.useRef)(null),o=bT(),s=o.reduce((e,t)=>e+t.pages.length,0),c=e.under??e.id,l=o.some(e=>e.pages.some(e=>e.id===c)),u=r??(n||l),d=CT(t),f=e=>{i(e),TE(e)},p=e=>(0,M.jsx)(`a`,{href:wT(e,d),"aria-current":e.id===c?`page`:void 0,children:e.label},e.id);return(0,M.jsxs)(`div`,{className:`more`,onKeyDown:e=>{e.key===`Escape`&&u&&(e.stopPropagation(),f(!1),a.current?.focus())},children:[(0,M.jsxs)(`button`,{ref:a,type:`button`,className:`more-toggle`,"aria-expanded":u,"aria-controls":`more-pages`,onClick:()=>f(!u),children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,className:`more-caret`,children:`▸`}),(0,M.jsx)(`span`,{children:bE.morePages}),(0,M.jsx)(`span`,{className:`more-count`,children:s})]}),(0,M.jsx)(`div`,{id:`more-pages`,className:`more-pages`,hidden:!u,children:o.map(e=>(0,M.jsxs)(`div`,{role:`group`,"aria-label":gT(e.section),children:[(0,M.jsx)(`span`,{className:`more-group`,"aria-hidden":`true`,children:gT(e.section)}),e.phases?e.phases.map(e=>(0,M.jsxs)(`div`,{role:`group`,"aria-label":_T(e.phase),children:[(0,M.jsx)(`span`,{className:`more-phase`,"aria-hidden":`true`,children:_T(e.phase)}),e.pages.map(p)]},e.phase)):e.pages.map(p)]},e.section))})]})}function kE({current:e,hash:t=``,full:n=!1}){return(0,M.jsxs)(`nav`,{"aria-label":E.nav.main,className:`nav`,children:[(0,M.jsxs)(`div`,{className:`brand`,children:[(0,M.jsx)(xE,{}),bE.atticus]}),(0,M.jsx)(`div`,{role:`group`,"aria-label":E.nav.main,children:lT.map(t=>{let n=yT(t);return(0,M.jsx)(`a`,{href:`#/${n.id}`,"aria-current":e.section===t?`page`:void 0,children:gT(t)},t)})}),(0,M.jsxs)(`a`,{className:`ask`,href:`#/explore`,children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,style:{width:8,height:8,borderRadius:`50%`,background:`var(--accent)`,boxShadow:`0 0 8px var(--accent)`}}),bE.askAtticus]}),(0,M.jsx)(OE,{current:e,hash:t,full:n}),(0,M.jsx)(`button`,{type:`button`,className:`menu-hint hud`,onClick:()=>dispatchEvent(new Event(sE)),children:bE.anyPage(EE(DE()))})]})}var AE=E.nav;function jE({current:e,hash:t,full:n=!1}){let r=vT(e.section,n),i=gT(e.section),a=e.section===`Change`?CT(t):void 0;if(r.length<2&&(r[0]?.id===e.id||!r.length))return null;let o=e.under??e.id,s=e=>(0,M.jsx)(`a`,{href:wT(e,a),"aria-current":e.id===o?`page`:void 0,children:e.label},e.id),c=n&&e.section===`Change`,l=c?r.filter(e=>!e.group):r;return(0,M.jsxs)(`div`,{className:`section-tabs`,children:[(0,M.jsxs)(`nav`,{"aria-label":AE.youAreHere,className:`crumbs hud`,children:[(0,M.jsx)(`span`,{children:i}),a&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`span`,{"aria-hidden":`true`,children:` › `}),(0,M.jsx)(`span`,{children:AE.ofChange(a)})]}),(0,M.jsx)(`span`,{"aria-hidden":`true`,children:` › `}),(0,M.jsx)(`span`,{"aria-current":`location`,children:e.label})]}),r.length>1&&(0,M.jsxs)(`nav`,{"aria-label":AE.tabs(i),className:`tabs`,children:[l.map(s),c&&dT.map(e=>{let t=r.filter(t=>t.group===e);return t.length?(0,M.jsxs)(`span`,{role:`group`,"aria-label":_T(e),className:`tab-group`,children:[(0,M.jsx)(`span`,{className:`tab-group-name`,"aria-hidden":`true`,children:_T(e)}),t.map(s)]},e):null})]})]})}var ME=[`system`,`light`,`dark`],NE=`atticus.theme`;function PE(){try{return globalThis.localStorage}catch{return}}function FE(e=PE()){try{let t=e?.getItem(NE);return ME.includes(t)?t:`system`}catch{return`system`}}function IE(e,t=PE()){try{t?.setItem(NE,e)}catch{}}function LE(e,t){return e===`system`?t?`light`:`dark`:e}function RE(e=document){let t=e.body?.classList;return!!t&&[`vscode-light`,`vscode-dark`,`vscode-high-contrast`].some(e=>t.contains(e))}function zE(e,t,n=document){if(RE(n))return;let r=LE(e,t);n.documentElement.dataset.theme=r,n.documentElement.style.colorScheme=r}var BE=`(prefers-color-scheme: light)`,VE=()=>!!globalThis.matchMedia?.(BE).matches;function HE(){zE(FE(),VE())}function UE(){let[e,t]=(0,v.useState)(()=>FE());return(0,v.useEffect)(()=>{if(zE(e,VE()),e!==`system`)return;let t=globalThis.matchMedia?.(BE);if(!t)return;let n=()=>zE(`system`,t.matches);return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e]),[e,e=>{IE(e),t(e)}]}var WE=E.shell;function GE(){let[e,t]=(0,v.useState)(location.hash);return(0,v.useEffect)(()=>{let e=()=>t(location.hash);return addEventListener(`hashchange`,e),()=>removeEventListener(`hashchange`,e)},[]),e}function KE(){let{me:e}=Dg();return!e||e.ai===`on`?null:(0,M.jsx)(`span`,{className:`chip warn`,title:e.ai===`off`?WE.aiIsOffIn:WE.imageReadingIsOff,children:e.ai===`off`?WE.aiOff:WE.textOnlyAi})}function qE({health:e}){let{me:t}=Dg(),n=t?.name?`${t.name} (${e.user})`:e.user;return(0,M.jsxs)(M.Fragment,{children:[t?.warning&&(0,M.jsx)(`span`,{className:`chip warn`,title:t.warning,role:`note`,"aria-label":t.warning,children:WE.setYourGitUser}),(0,M.jsxs)(`span`,{className:`chip dim`,title:WE.recordedAs(e.root,t?.email?` · ${t.email}`:``,e.user),children:[n,` · v`,e.version]})]})}function JE(){let[e,t]=UE();return(0,M.jsxs)(`span`,{className:`row`,style:{gap:6},children:[(0,M.jsx)(`label`,{htmlFor:`theme`,className:`hud`,style:{fontSize:9.5},children:E.theme.label}),(0,M.jsx)(`select`,{id:`theme`,className:`field`,style:{height:28,fontSize:12},title:E.theme.hint,value:e,onChange:e=>t(e.target.value),children:ME.map(e=>(0,M.jsx)(`option`,{value:e,children:E.theme.choices[e]},e))})]})}function YE(e,t){let n=e?.rows[0]?.id??t?.rows[0]?.id;return n?WE.askWhatBreaksIf(n):WE.askNeutral}function XE(){let e=A(`/api/search?q=kind:table&limit=1`),t=A(e.state===`error`||e.state===`ready`&&!e.data.rows.length?`/api/search?q=kind:endpoint&limit=1`:void 0);return YE(e.state===`ready`?e.data:void 0,t.state===`ready`?t.data:void 0)}function ZE({health:e}){let t=XE(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!1);return(0,M.jsxs)(`header`,{className:`topbar`,children:[(0,M.jsxs)(`form`,{role:`search`,className:`ask-form`,onSubmit:e=>{e.preventDefault(),n.trim()?location.hash=`#/explore?ask=${encodeURIComponent(n.trim())}`:(a(!0),document.getElementById(`ask`)?.focus())},children:[(0,M.jsx)(`label`,{htmlFor:`ask`,className:`sr`,children:WE.askAtticus}),(0,M.jsx)(`input`,{id:`ask`,value:n,onChange:e=>{r(e.target.value),a(!1)},"aria-describedby":i?`ask-blank`:void 0,placeholder:t}),(0,M.jsx)(`button`,{type:`submit`,className:`btn`,"aria-label":WE.ask,children:WE.ask}),(0,M.jsx)(`span`,{id:`ask-blank`,role:`status`,className:i?`chip warn`:`sr`,children:i?E.app.askEmpty:``})]}),(0,M.jsx)(KE,{}),!T()&&!RE()&&(0,M.jsx)(JE,{}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:vE,title:WE.replayTheTour,children:WE.help}),(0,M.jsx)(`a`,{className:`btn`,href:`#/words`,title:E.glossary.linkTitle,children:E.glossary.link}),e&&(0,M.jsx)(qE,{health:e})]})}function QE(){let[e,t]=(0,v.useState)({down:!1,epoch:0});return(0,v.useEffect)(()=>{let e=e=>{let n=e.detail.up;t(e=>n?{down:!1,epoch:e.epoch+1}:{...e,down:!0})};return addEventListener(ne,e),()=>removeEventListener(ne,e)},[]),e}function $E({inPanel:e}){let[t,n]=(0,v.useState)(!1);return(0,M.jsxs)(`div`,{className:`state error`,role:`alert`,style:{marginBottom:12},children:[(0,M.jsx)(`p`,{style:{margin:0},children:e?E.app.offlinePanel:E.app.offline}),(0,M.jsx)(`button`,{type:`button`,className:`btn`,style:{marginTop:8},disabled:t,onClick:()=>{n(!0),k(`/api/health`).catch(()=>void 0).finally(()=>n(!1))},children:t?E.app.checking:E.app.tryAgain})]})}function eD(){let e=GE(),t=ST(e),n=A(`/api/health`),r=n.state===`ready`&&n.data.full===!0,i=QE(),a=n.reload;(0,v.useEffect)(()=>{i.epoch&&a()},[i.epoch,a]),(0,v.useEffect)(()=>{document.title=`${t.label} · Atticus`},[t]);let o=(0,v.useRef)(void 0);return(0,v.useEffect)(()=>{o.current!==void 0&&o.current!==t.id&&document.getElementById(`main`)?.focus({preventScroll:!0}),o.current=t.id},[t.id]),(0,M.jsx)(Eg,{children:(0,M.jsxs)(`div`,{className:`shell`,children:[(0,M.jsx)(`a`,{className:`skip`,href:`#main`,children:WE.skipToContent}),(0,M.jsx)(kE,{current:t,hash:e,full:r}),(0,M.jsx)(lE,{}),(0,M.jsx)(yE,{metarepo:n.state===`ready`?n.data.root:n.state===`error`?null:void 0}),(0,M.jsxs)(`main`,{id:`main`,className:`main`,tabIndex:-1,children:[(0,M.jsx)(ZE,{health:n.state===`ready`?n.data:void 0}),(0,M.jsx)(`h1`,{className:`sr`,children:t.label}),(0,M.jsx)(jE,{current:t,hash:e,full:r}),i.down&&(0,M.jsx)($E,{inPanel:!!T()}),(()=>{let n=tE[t.id];return n?(0,M.jsx)(aE,{name:t.label,children:(0,M.jsx)(n,{hash:e})},`${t.id}:${i.epoch}`):(0,M.jsx)(rE,{screen:t})})()]})]})})}T()||HE(),(0,y.createRoot)(document.getElementById(`root`)).render((0,M.jsx)(v.StrictMode,{children:(0,M.jsx)(eD,{})}));export{l as n,o as t};
|
|
29
|
+
//# sourceMappingURL=index-mTOWhQZm.js.map
|