graview 0.1.58 → 0.1.59
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/preview/{chunk.27CW6SCT.js → chunk.2FOIJ5ID.js} +1 -1
- package/dist/preview/{chunk.JB7TTJXQ.js → chunk.2FP4KEEG.js} +1 -1
- package/dist/preview/{chunk.PBCNOFQH.js → chunk.2MFXP3FB.js} +1 -1
- package/dist/preview/{chunk.XU34T2H4.js → chunk.2NJDT47T.js} +1 -1
- package/dist/preview/{chunk.EPPXZZPK.js → chunk.2QESVWUW.js} +1 -1
- package/dist/preview/{chunk.IDJPBWL2.js → chunk.2XTCDFWU.js} +1 -1
- package/dist/preview/{chunk.WXIEQZLY.js → chunk.3UTRR5YM.js} +1 -1
- package/dist/preview/{chunk.INZQ6WZM.js → chunk.3XIIJHQ6.js} +1 -1
- package/dist/preview/chunk.3XLOFZRM.js +1 -0
- package/dist/preview/{chunk.POBMGM3X.js → chunk.4OMOP77U.js} +1 -1
- package/dist/preview/{chunk.WNQFHMNR.js → chunk.4QWTSI7V.js} +1 -1
- package/dist/preview/{chunk.4HSH2UIK.js → chunk.4T5QIZKB.js} +2 -2
- package/dist/preview/chunk.6BLNFVB4.js +1 -0
- package/dist/preview/{chunk.ACYDJQRC.js → chunk.6E36I2GC.js} +1 -1
- package/dist/preview/{chunk.YD3TKV6P.js → chunk.6IUEGPCZ.js} +2 -2
- package/dist/preview/{chunk.M34CS7DI.js → chunk.6N7LNTB6.js} +1 -1
- package/dist/preview/chunk.6O3YPUW3.js +1 -0
- package/dist/preview/{chunk.GEB2DFBU.js → chunk.6VNKGTLF.js} +1 -1
- package/dist/preview/{chunk.JGKA5QBX.js → chunk.7AMBLGVB.js} +1 -1
- package/dist/preview/{chunk.NFX24NUI.js → chunk.7JOG6XFC.js} +1 -1
- package/dist/preview/chunk.7XSDXX5Z.js +1 -0
- package/dist/preview/{chunk.HZB5F476.js → chunk.ATSKKTUO.js} +1 -1
- package/dist/preview/{chunk.HXRV3WVJ.js → chunk.ATVPAYS6.js} +1 -1
- package/dist/preview/{chunk.KKNDX4JT.js → chunk.AXXYJCSW.js} +1 -1
- package/dist/preview/{chunk.O4CVKTPJ.js → chunk.B5HLA45D.js} +1 -1
- package/dist/preview/{chunk.LRUNFSHP.js → chunk.BDBLGGFJ.js} +1 -1
- package/dist/preview/{chunk.A6C4AGJJ.js → chunk.BFN6B4C4.js} +1 -1
- package/dist/preview/{chunk.TJ647W6J.js → chunk.BPC4XQFZ.js} +2 -2
- package/dist/preview/{chunk.7V23SXGJ.js → chunk.CIB65YO6.js} +1 -1
- package/dist/preview/chunk.CJUIJ6TL.js +1 -0
- package/dist/preview/{chunk.KJHPDL4N.js → chunk.CLR6KAA3.js} +1 -1
- package/dist/preview/{chunk.4KC35UNR.js → chunk.CUJX3IVA.js} +4 -2
- package/dist/preview/{chunk.ILRCNTGT.js → chunk.CYUMQPMH.js} +1 -1
- package/dist/preview/{chunk.7SQAKSJD.js → chunk.CZH27V2R.js} +1 -1
- package/dist/preview/chunk.D3AISGQH.js +1 -0
- package/dist/preview/{chunk.KJ264E6K.js → chunk.DGM3Y2FB.js} +1 -1
- package/dist/preview/{chunk.HMFJT4KO.js → chunk.DO45KXLM.js} +1 -1
- package/dist/preview/{chunk.IULQRCEE.js → chunk.DWHPZBPZ.js} +1 -1
- package/dist/preview/{chunk.NKC3JILT.js → chunk.E22DDEQI.js} +1 -1
- package/dist/preview/chunk.E2REVMAG.js +6 -0
- package/dist/preview/{chunk.E34OQVSR.js → chunk.E4SYOBGB.js} +1 -1
- package/dist/preview/{chunk.TJOXNEFU.js → chunk.EGJUFZD5.js} +1 -1
- package/dist/preview/chunk.EZ3CRUBU.js +21 -0
- package/dist/preview/{chunk.LMN4TSAP.js → chunk.F6P3WSMW.js} +1 -1
- package/dist/preview/{chunk.4Y2JTY6Q.js → chunk.FJTVY6AE.js} +1 -1
- package/dist/preview/chunk.G2TCFWYX.js +1 -0
- package/dist/preview/{chunk.TWKXSLYY.js → chunk.G7HIAUEA.js} +1 -1
- package/dist/preview/{chunk.64R3K2OE.js → chunk.GDUM2UOM.js} +1 -1
- package/dist/preview/chunk.GQHFLOTZ.js +5 -0
- package/dist/preview/{chunk.DBZHRYBK.js → chunk.GR2B7SKI.js} +1 -1
- package/dist/preview/{chunk.GCBZ3WE2.js → chunk.HF5SNUTK.js} +1 -1
- package/dist/preview/{chunk.VUPLFUUS.js → chunk.HJOVOA52.js} +1 -1
- package/dist/preview/{chunk.QGV7H7RQ.js → chunk.HKINU7VO.js} +1 -1
- package/dist/preview/{chunk.GZB6A6KF.js → chunk.HVUUJQRE.js} +1 -1
- package/dist/preview/{chunk.34TW32TB.js → chunk.IIESMHXY.js} +2 -2
- package/dist/preview/{chunk.GQBJVCSM.js → chunk.IPPZEGBX.js} +1 -1
- package/dist/preview/{chunk.WNSC3RWD.js → chunk.IZ2ZTNEV.js} +1 -1
- package/dist/preview/{chunk.OHQ3JH65.js → chunk.J4HTSXUA.js} +1 -1
- package/dist/preview/{chunk.B3WZHPM3.js → chunk.JPNBQFJ3.js} +1 -1
- package/dist/preview/{chunk.ELAMMS2V.js → chunk.KE6ZRUMP.js} +1 -1
- package/dist/preview/{chunk.ELERUERU.js → chunk.KHZA5F7A.js} +1 -1
- package/dist/preview/{chunk.TF5I4VHX.js → chunk.KKQXGN5U.js} +1 -1
- package/dist/preview/{chunk.U6O3MMQR.js → chunk.KOGUYWHG.js} +1 -1
- package/dist/preview/{chunk.YHTE34RN.js → chunk.KSVJHSRH.js} +1 -1
- package/dist/preview/{chunk.JES77WXG.js → chunk.L3K25NCS.js} +1 -1
- package/dist/preview/chunk.LDLTQNJ2.js +1 -0
- package/dist/preview/{chunk.LL2MLSPH.js → chunk.LDYOQCY7.js} +1 -1
- package/dist/preview/{chunk.F7SF6EP2.js → chunk.LHJWII6C.js} +1 -1
- package/dist/preview/{chunk.E5MSFXL6.js → chunk.LKE2FBXL.js} +1 -1
- package/dist/preview/{chunk.RRKYJYZJ.js → chunk.M3JIIF32.js} +1 -1
- package/dist/preview/{chunk.BB33TI4S.js → chunk.MHILFBK6.js} +1 -1
- package/dist/preview/chunk.MMWLLWFS.js +1 -0
- package/dist/preview/{chunk.2VYNNWW5.js → chunk.MOAUE3N2.js} +3 -3
- package/dist/preview/{chunk.LCPGZK7G.js → chunk.MRYN42EQ.js} +1 -1
- package/dist/preview/{chunk.JUNMJYH5.js → chunk.MZJ3KTEU.js} +1 -1
- package/dist/preview/{chunk.GKSUTAIX.js → chunk.N4LOI3YA.js} +1 -1
- package/dist/preview/{chunk.LY3YOWKV.js → chunk.NIFQDN6R.js} +1 -1
- package/dist/preview/chunk.NOLGJFA4.js +2 -0
- package/dist/preview/{chunk.3YZHZGTM.js → chunk.NSGQXCH6.js} +1 -1
- package/dist/preview/{chunk.HEWVPXRE.js → chunk.OLW44AP5.js} +1 -1
- package/dist/preview/{chunk.PZG3B7F4.js → chunk.OVSZXILB.js} +1 -1
- package/dist/preview/{chunk.ZOHMWSHD.js → chunk.P3CUCDHO.js} +1 -1
- package/dist/preview/{chunk.UAP5M3CD.js → chunk.P52UTBNO.js} +2 -2
- package/dist/preview/{chunk.XN2RVXOI.js → chunk.P6CHNBRR.js} +1 -1
- package/dist/preview/chunk.PCVPH5KM.js +1 -0
- package/dist/preview/{chunk.ETBFD76E.js → chunk.PS5SEND3.js} +1 -1
- package/dist/preview/chunk.Q355UPFG.js +1 -0
- package/dist/preview/{chunk.QPXXY2DL.js → chunk.Q3Y5EV5A.js} +3 -3
- package/dist/preview/{chunk.LDAYDCUO.js → chunk.Q6LLURRM.js} +1 -1
- package/dist/preview/{chunk.YS6GVLIP.js → chunk.QC4YXFF7.js} +1 -1
- package/dist/preview/chunk.QDZAITMN.js +1 -0
- package/dist/preview/chunk.QHU3KUZZ.js +1 -0
- package/dist/preview/{chunk.SDLUWRGI.js → chunk.QL555VQ2.js} +1 -1
- package/dist/preview/{chunk.CCWPF5PK.js → chunk.QLTHHWBA.js} +1 -1
- package/dist/preview/{chunk.4AFFPYOK.js → chunk.QT6UV7HN.js} +1 -1
- package/dist/preview/{chunk.4444RPWW.js → chunk.QXMQUIQZ.js} +1 -1
- package/dist/preview/{chunk.KWJWAIQJ.js → chunk.R4YDAJRL.js} +1 -1
- package/dist/preview/{chunk.5ICIMQE6.js → chunk.RKZ4J3H2.js} +1 -1
- package/dist/preview/{chunk.RE7DELSR.js → chunk.ROHSF4WM.js} +1 -1
- package/dist/preview/{chunk.S2H7B6RG.js → chunk.S6VON4LU.js} +1 -1
- package/dist/preview/{chunk.GDOTG7YA.js → chunk.S7ZLGODY.js} +1 -1
- package/dist/preview/{chunk.ZN5HTWSI.js → chunk.SU6WKQ73.js} +1 -1
- package/dist/preview/{chunk.EQTSV7BK.js → chunk.SZG6HJWH.js} +1 -1
- package/dist/preview/{chunk.SPXRLO5K.js → chunk.T227XQIO.js} +1 -1
- package/dist/preview/{chunk.D5KTGX7F.js → chunk.TCPTVTFU.js} +1 -1
- package/dist/preview/chunk.U37WZMUO.js +1 -0
- package/dist/preview/chunk.U5JFW2YM.js +1 -0
- package/dist/preview/{chunk.GP7F3PEF.js → chunk.U5PX2ECA.js} +1 -1
- package/dist/preview/{chunk.VHSWBFXB.js → chunk.U7G56KXT.js} +1 -1
- package/dist/preview/{chunk.H3BFHI3G.js → chunk.UFTAGUTU.js} +1 -1
- package/dist/preview/{chunk.LO3U3P55.js → chunk.UHUBQ4EX.js} +1 -1
- package/dist/preview/{chunk.KXPRILAO.js → chunk.UITZ74YJ.js} +1 -1
- package/dist/preview/{chunk.KFQSYCY3.js → chunk.UM5H2VVR.js} +1 -1
- package/dist/preview/chunk.V5MOMBZG.js +1 -0
- package/dist/preview/{chunk.B2GVJD6H.js → chunk.V6EEDYYW.js} +1 -1
- package/dist/preview/{chunk.TBW7CU4G.js → chunk.VDGMFX5C.js} +1 -1
- package/dist/preview/{chunk.EB4NVTJL.js → chunk.VFRURRNI.js} +1 -1
- package/dist/preview/{chunk.6W7O5YLL.js → chunk.VGHZQEHS.js} +1 -1
- package/dist/preview/{chunk.MQ5HBUBL.js → chunk.VNBEAF62.js} +1 -1
- package/dist/preview/chunk.VNJKGSGZ.js +25 -0
- package/dist/preview/{chunk.TUUVVO5U.js → chunk.VS25R6R2.js} +1 -1
- package/dist/preview/chunk.VUSJ7HPC.js +1 -0
- package/dist/preview/chunk.VXRECLX6.js +1 -0
- package/dist/preview/{chunk.7MSFDD7J.js → chunk.W2VOD6SD.js} +1 -1
- package/dist/preview/{chunk.WJFQIE3Y.js → chunk.W66VMALY.js} +1 -1
- package/dist/preview/{chunk.WQOI6BLM.js → chunk.WEGPDJTB.js} +1 -1
- package/dist/preview/{chunk.3OYGXYQY.js → chunk.WGTBQHHE.js} +1 -1
- package/dist/preview/chunk.WGVIJDV5.js +1 -0
- package/dist/preview/{chunk.SDVPJYVF.js → chunk.WTUB7W2D.js} +1 -1
- package/dist/preview/{chunk.VG7OWV2H.js → chunk.X2G4ZRB2.js} +1 -1
- package/dist/preview/chunk.X3MMJ3QC.js +5 -0
- package/dist/preview/chunk.X5YRNNHU.js +1 -0
- package/dist/preview/{chunk.BTVBZ6KE.js → chunk.XOTES3PI.js} +2 -2
- package/dist/preview/{chunk.YIA2EDVF.js → chunk.YGZCESXY.js} +1 -1
- package/dist/preview/chunk.YMC2T2HN.js +1 -0
- package/dist/preview/{chunk.HS3GHAUR.js → chunk.YMRVKG6W.js} +1 -1
- package/dist/preview/chunk.YN6BXZHO.js +1 -0
- package/dist/preview/{chunk.YP2F5UGY.js → chunk.Z4CJJ4QP.js} +1 -1
- package/dist/preview/{chunk.2EDC63RI.js → chunk.ZFH4SCCF.js} +1 -1
- package/dist/preview/{chunk.NOFWGDOT.js → chunk.ZLMI2NHC.js} +1 -1
- package/dist/preview/{chunk.YZZONE4M.js → chunk.ZT3NEAFI.js} +1 -1
- package/dist/preview/{chunk.I3WWCPQ2.js → chunk.ZUKYMU6C.js} +1 -1
- package/dist/preview/index.html +51 -51
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.32FMOHZK.js +0 -1
- package/dist/preview/chunk.3FCOFEGW.js +0 -1
- package/dist/preview/chunk.43OKZU73.js +0 -1
- package/dist/preview/chunk.47JQPYXL.js +0 -2
- package/dist/preview/chunk.4GGPPCMM.js +0 -1
- package/dist/preview/chunk.6K7EN2YI.js +0 -1
- package/dist/preview/chunk.6VC6AGYV.js +0 -5
- package/dist/preview/chunk.7BBGRTXM.js +0 -5
- package/dist/preview/chunk.7ECBGIUK.js +0 -1
- package/dist/preview/chunk.ARWBIBSI.js +0 -6
- package/dist/preview/chunk.BKVBX2YB.js +0 -1
- package/dist/preview/chunk.DM767F2Q.js +0 -21
- package/dist/preview/chunk.GUEHKCWN.js +0 -1
- package/dist/preview/chunk.HT2BEOEV.js +0 -25
- package/dist/preview/chunk.JOAN54PN.js +0 -1
- package/dist/preview/chunk.L7V24JPO.js +0 -1
- package/dist/preview/chunk.LA4CPZ2N.js +0 -1
- package/dist/preview/chunk.MV3AJ7JH.js +0 -1
- package/dist/preview/chunk.MYNQWWCL.js +0 -1
- package/dist/preview/chunk.OASYYMG5.js +0 -1
- package/dist/preview/chunk.PM3SYXKB.js +0 -1
- package/dist/preview/chunk.QB25SMP6.js +0 -1
- package/dist/preview/chunk.R7LFO7KI.js +0 -1
- package/dist/preview/chunk.S5MGE2U5.js +0 -1
- package/dist/preview/chunk.TXGNPW76.js +0 -1
- package/dist/preview/chunk.UGFDSE37.js +0 -1
- package/dist/preview/chunk.UKMVJV6Q.js +0 -1
- package/dist/preview/chunk.UUG3BYVN.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as y}from"./chunk.
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as y}from"./chunk.QLTHHWBA.js";import{D as v,G as I,T as h,ba as w}from"./chunk.VNJKGSGZ.js";import{_a as g}from"./chunk.X3MMJ3QC.js";import{b as d}from"./chunk.AJZBJBMO.js";var k=d(I(),1);var t=d(h(),1),r={display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"};function D({shows:e,onShows:i,mine:a,onMine:l}){let o={all:"All",changes:"Changes",ai:"AI"};return(0,t.jsxs)("div",{"data-testid":"activity-filter",role:"group","aria-label":"Show",style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center"},children:[["all","changes","ai"].map(s=>(0,t.jsx)("button",{type:"button","data-shows":s,"aria-pressed":e===s,onClick:()=>i(s),style:{...r,...e===s?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:o[s]},s)),(0,t.jsx)("button",{type:"button","data-testid":"activity-mine","aria-pressed":a,onClick:()=>l(!a),style:{...r,marginLeft:"auto",...a?{borderColor:"var(--graview-accent)",color:"var(--graview-ink)"}:{}},children:"Just mine"})]})}var x=e=>e.ask.kind==="suggest"?"suggest":e.ask.kind==="fill"?"fill in":e.ask.kind==="record"?"add one":e.ask.kind==="panel"?"draw a panel":`answer \u201C${e.ask.said}\u201D`;function $(e){let i=e.offered.filter(a=>e.accepted?.includes(a.id)).map(a=>a.label);switch(e.outcome){case"accepted":return i.length>0?`Took ${i.join(", ")}`:"Taken";case"partly":return`Took ${i.length} of ${e.offered.length}: ${i.join(", ")}`;case"dismissed":return"Dismissed";case"drawn":return e.panel?`Drew \u201C${e.panel.title}\u201D`:"Drew a panel";case"failed":return e.failed??"Failed";default:return"Offered, not yet taken"}}function C(e){let i=[...new Set((e.usage??[]).map(o=>o.model))];if(i.length===0)return null;let a=(e.usage??[]).flatMap(o=>o.costUsd===void 0?[]:[o.costUsd]),l=a.length>0?a.reduce((o,s)=>o+s,0):void 0;return`${i.join(", ")}${l!==void 0?` \xB7 $${l<.01?l.toPrecision(2):l.toFixed(2)}`:""}`}function E({entry:e,undo:i}){let{store:a,principal:l,seats:o,people:s,ai:b}=w(),c=y(),[p,u]=(0,k.useState)(!1),A=e.by.kind==="human"&&e.by.onBehalfOf===void 0&&(e.by.id===void 0||l.id===void 0||e.by.id===l.id)?"you":g(e.by,{graph:a.graph,schema:a.schema,seats:o,people:s}),f=C(e),S=v(b),m=n=>{u(!0),(__graviewPreload(import.meta.url,["./chunk.NOLGJFA4.js","./chunk.BJUUSIQY.js","./chunk.X2G4ZRB2.js","./chunk.UITZ74YJ.js","./chunk.2NJDT47T.js","./chunk.XOZU4OFA.js","./chunk.MHILFBK6.js","./chunk.QLTHHWBA.js","./chunk.AXXYJCSW.js","./chunk.NSGQXCH6.js","./chunk.SZG6HJWH.js","./chunk.2FOIJ5ID.js","./chunk.6IUEGPCZ.js","./chunk.CUJX3IVA.js","./chunk.VNJKGSGZ.js","./chunk.SDO3U72B.js","./chunk.X3MMJ3QC.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.YMC2T2HN.js")).then(n).finally(()=>u(!1))};return(0,t.jsxs)("li",{"data-testid":"activity-interaction","data-interaction":e.id,"data-outcome":e.outcome,style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,t.jsx)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:(0,t.jsxs)("span",{style:{minWidth:0},children:[(0,t.jsx)("strong",{style:{fontWeight:600},children:A})," ",(0,t.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["asked AI to ",x(e)]}),(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",e.targetLabel]})]})}),e.offered.length>0&&e.outcome!=="accepted"&&e.outcome!=="partly"?(0,t.jsxs)("div",{"data-testid":"interaction-offered",style:{color:"var(--graview-ink-muted)"},children:["Offered ",e.offered.map(n=>n.label).join(", ")]}):null,(0,t.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6,flexWrap:"wrap"},children:[(0,t.jsx)("span",{"data-testid":"interaction-outcome",style:{color:e.outcome==="failed"?"var(--graview-warn)":"var(--graview-ink)"},children:$(e)}),(e.batches??[]).map(n=>(0,t.jsx)("span",{"data-interaction-batch":n,style:{marginLeft:"auto"},children:i(n)},n))]}),f?(0,t.jsx)("div",{"data-testid":"interaction-model",style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:f}):null,S?(0,t.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[e.panel?(0,t.jsx)("button",{type:"button","data-testid":"interaction-reopen",disabled:p,onClick:()=>m(n=>n.drawPanel(c,e.panel)),style:r,children:"Show the panel"}):null,(0,t.jsx)("button",{type:"button","data-testid":"interaction-again",disabled:p,onClick:()=>m(n=>n.askAgain(c,e)),style:r,children:"Ask again"})]}):null]})}export{D as a,E as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as k,h,i as b,n as S,o as w,p as I}from"./chunk.
|
|
1
|
+
import{f as k,h,i as b,n as S,o as w,p as I}from"./chunk.NOLGJFA4.js";import"./chunk.BJUUSIQY.js";import"./chunk.X2G4ZRB2.js";import"./chunk.UITZ74YJ.js";import"./chunk.2NJDT47T.js";import"./chunk.XOZU4OFA.js";import"./chunk.MHILFBK6.js";import{a as A}from"./chunk.QLTHHWBA.js";import"./chunk.AXXYJCSW.js";import"./chunk.NSGQXCH6.js";import"./chunk.SZG6HJWH.js";import"./chunk.2FOIJ5ID.js";import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{G as M,T as f}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b as d}from"./chunk.AJZBJBMO.js";var n=d(M(),1);var r=d(f(),1),C="several";function T({chosen:c,acts:p,onAct:N}){let t=A(),u=(0,n.useMemo)(()=>[...c].sort(),[c]),i=u.join(`
|
|
2
2
|
`),o=(0,n.useMemo)(()=>({on:"selection",ids:u}),[i]),l=(0,n.useMemo)(()=>p.filter(e=>e.open.length===0&&!e.more&&!e.destructive),[p]),g=(0,n.useMemo)(()=>new Map(l.map(e=>[h(e.id),e])),[l]),v=S(t,o,C),[y,x]=(0,n.useState)(null);(0,n.useEffect)(()=>{if(v!==void 0)return;let e=!0;return w(t,o,{by:C,ask:()=>b(t.ai,{store:t.store,target:o,principal:t.principal,interaction:k(),places:t.places,selection:t.selection,...t.place?{place:t.place}:{},shared:l.map(a=>({id:a.id,label:a.label,mutation:a.mutation,args:a.args}))})}).then(a=>{e&&x({key:i,result:a})}),()=>{e=!1}},[i]);let s=v??(y?.key===i?y.result:void 0);if(s===void 0)return(0,r.jsx)("span",{role:"status",className:"graview-several-quiet","data-testid":"several-ai-thinking",style:{textDecoration:"none"},children:"AI: thinking\u2026"});let m=s.offers.filter(e=>e.type!=="act"||g.has(e.id));if(m.length===0)return null;let E=e=>{let a=g.get(e.id);if(a){t.desk.record({...s.interaction,outcome:"accepted",accepted:[e.id]}),N(a);return}I(t,s,e)};return(0,r.jsx)("div",{role:"group","aria-label":"Suggested by AI",className:"graview-several-acts","data-testid":"several-ai",children:m.map(e=>(0,r.jsxs)("button",{type:"button",className:"graview-several-act","data-testid":"several-ai-offer","data-ai-offer":e.id,"data-ai-offer-type":e.type,onClick:()=>E(e),children:[e.label,(0,r.jsx)("span",{style:{color:"var(--graview-ink-faint)",fontWeight:400},children:" \xB7 suggested"})]},e.id))})}export{T as SeveralAi};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as ut,b as yt,c as ht,d as wt,e as vt,f as kt,g as bt}from"./chunk.7JOG6XFC.js";import{a as be,e as lt}from"./chunk.BBLIT7S7.js";import{a as mt,b as Te,c as xt}from"./chunk.5IEFTFKQ.js";import{a as ie,f as at,h as dt}from"./chunk.2FP4KEEG.js";import"./chunk.PXQVXBNG.js";import{i as ct}from"./chunk.UDCDK7XJ.js";import{e as gt}from"./chunk.G2TCFWYX.js";import"./chunk.B3WVCSW5.js";import{c as pt,f as ft,i as xe,j as Se}from"./chunk.VDGMFX5C.js";import{b as ae,e as de}from"./chunk.T227XQIO.js";import{a as H}from"./chunk.SDO3U72B.js";import"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var St=["good","warn","bad","neutral","accent"],Tt=["value","max","aria-label","placeholder","disabled"],Et=["click","change"],Ee=["_blank","_self"],Mt=["section","div","span","strong","p","hr","a","button","input","progress"],le={type:{oneOf:St}},Me={"gv-card":{host:"section",properties:{tone:le},events:{},children:"any"},"gv-group":{host:"div",properties:{direction:{type:{oneOf:["row","column"]}}},events:{},children:"any"},"gv-title":{host:"strong",properties:{},events:{},children:"text"},"gv-text":{host:"p",properties:{tone:le},events:{},children:"text"},"gv-badge":{host:"span",properties:{tone:le},events:{},children:"text"},"gv-field":{host:"div",properties:{label:{type:"string"}},events:{},children:"text"},"gv-progress":{host:"progress",properties:{value:{type:"number",as:"value"},max:{type:"number",as:"max"},label:{type:"string",as:"aria-label"}},events:{},children:"none"},"gv-divider":{host:"hr",properties:{},events:{},children:"none"},"gv-link":{host:"a",properties:{href:{type:"url"}},events:{},children:"text"},"gv-button":{host:"button",properties:{tone:le,disabled:{type:"boolean",as:"disabled"}},events:{press:{from:"click"}},children:"text"},"gv-input":{host:"input",properties:{label:{type:"string",as:"aria-label"},value:{type:"string",as:"value"},placeholder:{type:"string",as:"placeholder"}},events:{change:{from:"change",detail:"value"}},children:"none"}},Re=1e4;var zt=0,qt=1,Xt=2,Yt=3,Rt=1,Jt=2,Qt=3,Zt=1,er=3,tr=8,Ke="~",Ge=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),J=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function Kt(n,e){return e.type==="url"?"href":e.as??`data-gv-${n.toLowerCase()}`}var rr=2e3;function Gt(n,e){if(e==null)return{ok:!0,value:null};let u=n.type;if(u==="boolean")return typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,reason:"value"};if(u==="number")return typeof e=="number"&&Number.isFinite(e)?{ok:!0,value:String(e)}:{ok:!1,reason:"value"};if(typeof e!="string"||e.length>rr)return{ok:!1,reason:u==="url"?"url":"value"};if(typeof u=="object")return u.oneOf.includes(e)?{ok:!0,value:e}:{ok:!1,reason:"value"};if(u==="url"){let p;try{p=new URL(e)}catch{return{ok:!1,reason:"url"}}return p.protocol!=="https:"||p.hostname===""||!/^https:\/\//i.test(e)?{ok:!1,reason:"url"}:{ok:!0,value:p.href}}return{ok:!0,value:e}}function nr(n){let e=n.host==="a";return Mt.includes(n.host)&&(n.target===void 0||e&&Ee.includes(n.target))&&Object.values(n.properties).every(u=>u.type!=="url"||e)&&Object.values(n.properties).every(u=>u.as===void 0||u.type!=="url"&&Tt.includes(u.as))&&Object.values(n.events).every(u=>Et.includes(u.from))}function We(n,e){let u=e.kit??Me,p=e.maxNodes??2e3,o=n.ownerDocument,f=[],v=new Map,W={dom:n,name:Ke,component:{host:"div",properties:{},events:{},children:"any"},children:[],listeners:new Map,id:Ke};v.set(Ke,W);let K=e.links?new Set(e.links.origins.flatMap(r=>{try{let c=new URL(r);return c.protocol==="https:"&&c.hostname!==""?[c.origin]:[]}catch{return[]}})):void 0,L=0,R=0,A=!1,m=r=>{f.push(r),f.length>200&&f.shift()},h=()=>({dom:o.createComment(""),children:[],refused:!0,listeners:new Map}),_=(r,c,w)=>{let i=r.component;if(!Ge(i.properties,c))return m({reason:"property",element:r.name,name:c});let a=i.properties[c],y=Gt(a,w),x=y.ok&&a.type==="url"&&K&&typeof y.value=="string"&&!K.has(new URL(y.value).origin)?{ok:!1,reason:"url"}:y,T=r.dom,S=Kt(c,a);if(!x.ok)return T.removeAttribute(S),m({reason:x.reason,element:r.name,name:c});let k=x.value;k===null||k===!1?T.removeAttribute(S):T.setAttribute(S,k===!0?"":k),S==="value"&&"value"in T&&(T.value=typeof k=="string"?k:""),S==="disabled"&&"disabled"in T&&(T.disabled=k!==null&&k!==!1)},M=(r,c,w)=>{let i=r.component;if(!Ge(i.events,c))return m({reason:"event",element:r.name,name:c});let a=r.listeners.get(c);if(a&&(a(),r.listeners.delete(c),R-=1),w==null)return;if(!J(w)||typeof w.listener!="number")return m({reason:"value",element:r.name,name:c});let y=w.listener,x=i.events[c],T=r.dom,S=()=>e.onEvent(y,x.detail==="value"?String(T.value??""):void 0);T.addEventListener(x.from,S),r.listeners.set(c,()=>T.removeEventListener(x.from,S)),R+=1},g=r=>{if(!r.refused){L-=1,r.id!==void 0&&v.delete(r.id);for(let c of r.listeners.values())c();R-=r.listeners.size,r.listeners.clear();for(let c of r.children)g(c)}},O=(r,c)=>{if(!J(r)||typeof r.id!="string"||v.has(r.id))return m({reason:"record"}),h();if(L>=p)return m({reason:"budget"}),A||(A=!0,e.onOverBudget?.()),h();let w=r.id,i=c.component.children;if(r.type===tr)return h();if(r.type===er){if(i==="none")return m({reason:"child",element:c.name}),h();let S={dom:o.createTextNode(String(r.data??"").slice(0,Re)),children:[],text:!0,listeners:new Map,id:w};return v.set(w,S),L+=1,S}if(r.type!==Zt)return m({reason:"record"}),h();let a=String(r.element);if(!Ge(u,a)||!nr(u[a]))return m({reason:"element",element:a}),h();if(i!=="any")return m({reason:"child",element:a}),h();let y=u[a],x=o.createElement(y.host);x.setAttribute("data-gv",a.replace(/^gv-/,"")),x.className=`graview-guest-${a.replace(/^gv-/,"")}`,y.host==="a"&&(x.setAttribute("rel","noopener noreferrer"),x.setAttribute("target",y.target??"_blank"),x.setAttribute("referrerpolicy","no-referrer")),y.host==="button"&&x.setAttribute("type","button");let T={dom:x,name:a,component:y,children:[],listeners:new Map,id:w};if(v.set(w,T),L+=1,J(r.properties))for(let[S,k]of Object.entries(r.properties))_(T,S,k);if(J(r.attributes))for(let S of Object.keys(r.attributes))m({reason:"attribute",element:a,name:S});if(J(r.eventListeners))for(let[S,k]of Object.entries(r.eventListeners))M(T,S,k);if(Array.isArray(r.children))for(let S of r.children){let k=O(S,T);T.children.push(k),x.appendChild(k.dom)}return T},V=r=>{if(!Array.isArray(r))return m({reason:"record"});let[c,w]=r,i=typeof w=="string"?v.get(w):void 0;if(!i)return m({reason:"record"});switch(c){case zt:{if(i.text)return m({reason:"record"});let a=Number(r[3]),y=Number.isInteger(a)&&a>=0&&a<=i.children.length?a:i.children.length,x=O(r[2],i);i.dom.insertBefore(x.dom,i.children[y]?.dom??null),i.children.splice(y,0,x);return}case qt:{let a=Number(r[2]),y=i.children[a];if(!y)return m({reason:"record"});i.children.splice(a,1),y.dom.parentNode?.removeChild(y.dom),g(y);return}case Xt:if(!i.text)return m({reason:"record"});i.dom.data=String(r[2]??"").slice(0,Re);return;case Yt:{if(i===W||i.text)return m({reason:"record"});let a=String(r[2]),y=r[4]??Rt;return y===Rt?_(i,a,r[3]):y===Qt?M(i,a,r[3]):m(y===Jt?{reason:"attribute",element:i.name,name:a}:{reason:"record"})}default:return m({reason:"record"})}};return{apply(r,c){if(!Array.isArray(r))return m({reason:"record"}),!0;for(let w=0;w<r.length;w+=1){if(c&&w%32===0&&c())return!1;V(r[w])}return!0},get refused(){return f},get size(){return L},get listening(){return R},dispose(){for(let r of W.children)g(r);W.children.length=0,n.replaceChildren()}}}var Oe=`
|
|
2
|
+
.graview-guest { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: var(--graview-ink, inherit); font: inherit; }
|
|
3
|
+
.graview-guest-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--graview-edge, #d0d0d0); border-radius: 10px; background: var(--graview-panel, transparent); }
|
|
4
|
+
.graview-guest-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
|
|
5
|
+
.graview-guest-group[data-gv-direction="row"] { flex-direction: row; flex-wrap: wrap; align-items: center; }
|
|
6
|
+
.graview-guest-title { font-weight: 600; font-size: 1rem; overflow-wrap: anywhere; }
|
|
7
|
+
.graview-guest-text { margin: 0; font-size: 0.875rem; line-height: 1.45; overflow-wrap: anywhere; }
|
|
8
|
+
.graview-guest-badge { align-self: flex-start; padding: 1px 8px; border: 1px solid currentColor; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; }
|
|
9
|
+
.graview-guest-field { font-size: 0.875rem; overflow-wrap: anywhere; }
|
|
10
|
+
.graview-guest-field[data-gv-label]::before { content: attr(data-gv-label) " "; color: var(--graview-ink-muted, inherit); }
|
|
11
|
+
.graview-guest-progress { width: 100%; }
|
|
12
|
+
.graview-guest-divider { width: 100%; margin: 2px 0; border: 0; border-top: 1px solid var(--graview-edge, #d0d0d0); }
|
|
13
|
+
.graview-guest-link { color: var(--graview-accent, inherit); text-decoration: underline; }
|
|
14
|
+
.graview-guest-button { align-self: flex-start; font: inherit; padding: 4px 12px; border-radius: 8px; border: 1px solid var(--graview-edge, #d0d0d0); background: var(--graview-panel, transparent); color: inherit; cursor: pointer; }
|
|
15
|
+
.graview-guest-input { font: inherit; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--graview-edge, #d0d0d0); }
|
|
16
|
+
.graview-guest [data-gv-tone="good"] { color: var(--graview-good, inherit); }
|
|
17
|
+
.graview-guest [data-gv-tone="bad"] { color: var(--graview-bad, inherit); }
|
|
18
|
+
.graview-guest [data-gv-tone="warn"] { color: var(--graview-warn, inherit); }
|
|
19
|
+
.graview-guest [data-gv-tone="accent"] { color: var(--graview-accent, inherit); }
|
|
20
|
+
.graview-guest [data-gv-tone="neutral"] { color: var(--graview-ink-muted, inherit); }
|
|
21
|
+
`;var Wt=new WeakSet;function or(n,e){if(n.startsWith("blob:"))return"blob:";try{return new URL(n,e.location.href).origin}catch{return n}}function Ot(n,e,u){let p=or(e,n),o=`this page's Content-Security-Policy${u?` (${u})`:""} does not allow a worker from ${p}: it needs worker-src ${p}`;return Wt.has(n)||(Wt.add(n),n.console?.warn?.(`Graview: worker views cannot start on this page, because ${o}. A host that will not allow ${p} serves each view's whole script from its own origin and passes worker: { url } (the @graview/guest README, "What the host page allows").`)),o}function sr(n,e){return n===""?!0:e.startsWith("blob:")?n.startsWith("blob"):e.startsWith(n)||n.startsWith(e)}function ue(n,e){let u="script"in e.source?n.URL.createObjectURL(new n.Blob([e.source.script],{type:"text/javascript"})):void 0,p="script"in e.source?u:e.source.url,o,f,v=!1,W=!1,K=0,L=0,R="",A=0,m=0,h=n.performance,_=h.now(),M,g=i=>{let a=i,y=String(a.effectiveDirective||a.violatedDirective||"").split(" ")[0];/^(worker-src|script-src|script-src-elem|child-src|default-src)$/.test(y)&&sr(String(a.blockedURI??""),p)&&(M=y)},O=n.document;O?.addEventListener("securitypolicyviolation",g);let V=()=>O?.removeEventListener("securitypolicyviolation",g),r=()=>{W||(W=!0,f?.close(),o?.terminate(),o=void 0,n.clearTimeout(K),n.clearInterval(L),V(),u&&n.URL.revokeObjectURL(u))},c=(i,a)=>{W||(r(),e.onStop(i,a))},w=()=>{n.clearTimeout(K),V(),R=ut();let i=new n.MessageChannel;f=i.port1;let a=Math.max(1,e.silentMs),y=Math.max(10,Math.min(1e3,Math.floor(a/4)));_=h.now();let x=_;L=n.setInterval(()=>{let S=h.now();if(S-x>y*2&&(_+=S-x-y),x=S,S-_>=a)return c("silent");A+=1,i.port1.postMessage({type:"heartbeat",beat:A})},y);let T={graview:"host-hello",protocol:1,nonce:R,view:e.name};o.postMessage(T,[i.port2]),e.onReady(R,i.port1)};try{o=new n.Worker(p,{name:e.name})}catch(i){o=void 0;let a=i,y=a?.name==="SecurityError"?Ot(n,p,M):`the worker could not be made: ${String(a?.message??i)}`;queueMicrotask(()=>c("start",y))}return o&&(K=n.setTimeout(()=>c("start",`it never said it was ready in ${e.readyMs.toLocaleString("en-US")} ms`),e.readyMs),o.onerror=i=>{let a=typeof i.message=="string"&&i.message!==""?i.message:void 0;if(v)return void e.onError?.(a??"an error");n.clearTimeout(K),n.setTimeout(()=>!v&&c("start",M?Ot(n,p,M):a?`it failed before it said ready: ${a}`:"it failed before it said ready, and the engine gave no reason (a page policy that refuses it, or a script that does not load)"),0)},o.onmessage=i=>{if(!e.limiter.message()||v||!lt(i.data)||i.data.protocol!==1){e.onDropped();return}v=!0,w()}),{get worker(){return o},answer(i){let a=i;return typeof a!="object"||a===null||a.type!=="heartbeat"||a.nonce!==R?!1:(typeof a.beat=="number"&&a.beat>m&&a.beat<=A&&(m=a.beat,_=h.now()),!0)},stop:r}}function ce(n,e){let u=e(),p=0;return{draw(o){let f=e();f-u>=1e3&&(u=f,p=0);let v=o(()=>p+(e()-f)>=n);return p+=e()-f,v&&p<n}}}var ir=Symbol.for("graview.view.clicked");function At(n,e){n[ir]=Object.freeze([...e])}var ar=H(()=>(__graviewPreload(import.meta.url,["./chunk.UDCDK7XJ.js","./chunk.AJZBJBMO.js"]),import("./chunk.QUJS63OJ.js"))),dr=H(()=>(__graviewPreload(import.meta.url,["./chunk.G2TCFWYX.js","./chunk.B3WVCSW5.js","./chunk.VDGMFX5C.js","./chunk.T227XQIO.js","./chunk.X3MMJ3QC.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.WTUB7W2D.js"))),lr=H(()=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.KNYLY7MH.js"))),ur=H(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.Q6LLURRM.js","./chunk.AXXYJCSW.js","./chunk.N4LOI3YA.js","./chunk.RKZ4J3H2.js","./chunk.HKINU7VO.js","./chunk.YGZCESXY.js","./chunk.2FOIJ5ID.js","./chunk.X3MMJ3QC.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.DGM3Y2FB.js"))),cr=H(()=>(__graviewPreload(import.meta.url,["./chunk.VDGMFX5C.js","./chunk.T227XQIO.js","./chunk.X3MMJ3QC.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.E2REVMAG.js"))),pr=H(()=>(__graviewPreload(import.meta.url,["./chunk.BBLIT7S7.js","./chunk.AJZBJBMO.js"]),import("./chunk.RRCPEHM4.js"))),fr=H(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.Q6LLURRM.js","./chunk.AXXYJCSW.js","./chunk.N4LOI3YA.js","./chunk.RKZ4J3H2.js","./chunk.HKINU7VO.js","./chunk.YGZCESXY.js","./chunk.2FOIJ5ID.js","./chunk.X3MMJ3QC.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.U5JFW2YM.js")));function gr(n,e,u){switch(n){case"manifest":return u??"Its manifest names something this app does not have.";case"source":return u??`Its code is longer than the ${e.maxSourceBytes.toLocaleString("en-US")} bytes a view may be.`;case"start":return`It could not start${u?`: ${u}.`:"."}`;case"error":return`It failed before it drew anything${u?`: ${u}`:"."}`;case"silent":return`It stopped answering for ${e.silentMs.toLocaleString("en-US")} ms.`;case"nodes":return`It drew more than the ${e.maxNodes.toLocaleString("en-US")} things a view may draw.`;case"flood":return`It sent more than ${e.messages} messages in ${e.messageWindowMs.toLocaleString("en-US")} ms.`;case"slow":return`It took longer than ${e.pushMs.toLocaleString("en-US")} ms to draw what it was shown.`}}function mr(n,e){let u=n.ownerDocument,p=u.defaultView,{manifest:o}=e,f=u.createElement("div");f.className="graview-worker-view",f.setAttribute("role","region"),f.setAttribute("aria-label",o.title??o.name),f.setAttribute("data-worker-view",o.name),f.style.cssText="display:block;position:relative;contain:layout paint style;isolation:isolate;overflow:clip;min-width:0",n.appendChild(f);let v=f.attachShadow({mode:"open"}),W=e.author?u.createElement("p"):void 0;W&&(W.className="graview-worker-view-author",W.setAttribute("data-worker-view-author",o.name),W.style.cssText="margin:4px 0 0;font-size:0.75rem;color:var(--graview-ink-muted, inherit)",W.textContent=e.author,n.appendChild(W));let K={applied:0,refused:0,dropped:0},L=ae(e.limits),R={maxSourceBytes:e.limits?.maxSourceBytes??256e3,maxNodes:e.limits?.maxNodes??5e3,messages:e.limits?.messages??120,messageWindowMs:e.limits?.messageWindowMs??1e3,pushMs:e.limits?.pushMs??1e3,silentMs:e.limits?.silentMs??5e3,drawMs:e.limits?.drawMs??100},A,m,h,_,M,g=!1,O={applied:0,refused:0,dropped:0},V=[],r=()=>{if(!h)return;let t=h.stats;K.applied+=t.applied-O.applied,K.refused+=t.refused-O.refused,K.dropped+=t.dropped-O.dropped,O={...t}},c=()=>{},w,i,a=()=>{let t=v.querySelector("[data-graview-view-root]"),d=p.ResizeObserver;i||!t||typeof d!="function"||(i=new d(b=>{let E=b[b.length-1]?.borderBoxSize?.[0],s=Math.ceil(E?E.blockSize:t.offsetHeight);s!==w&&(w=s,f.setAttribute("data-graview-content-height",String(s)),e.onContentHeight?.(s))}),i.observe(t))},y=()=>{i&&(i.disconnect(),i=void 0,w=void 0,f.removeAttribute("data-graview-content-height"),e.onContentHeight?.(void 0))},x=0,T=()=>{},S=()=>{T(),T=()=>{},r(),h?.dispose(),h=void 0,_?.stop(),c(),p.clearInterval(x)},k=(t,d)=>{if(g)return;g=!0,S(),y(),M?.dispose();let b=gr(t,R,d);f.removeAttribute("data-worker-view-drawn"),f.setAttribute("data-worker-view-failed",t),e.fallback!==!1&&(e.fallback??_t)(f,t,b),e.onFailure?.(t,b)},_t=(t,d,b)=>{let E=A??(()=>{try{return Se(e.store,e.principal,{manifest:o,...e.input?{input:e.input()}:{},...m?{computed:m}:{}})}catch{return}})(),s=u.createElement("div");s.setAttribute("data-graview-fallback",d),s.style.cssText="padding:12px;display:grid;gap:6px;color:var(--graview-ink, inherit);font-family:var(--graview-font-body, inherit)";let I=u.createElement("strong");I.textContent=o.title??o.name;let C=u.createElement("ul");C.style.cssText="margin:0;padding-left:1.2em";for(let ne of[...E?.node?[E.node]:[],...E?.nodes??[]]){let oe=u.createElement("li");oe.textContent=ne.label??ne.id,C.appendChild(oe)}let N=u.createElement("p");N.style.cssText="margin:0;font-size:0.8125rem;color:var(--graview-ink-muted, inherit)",N.textContent=`This view was stopped. ${b}`,s.append(I,C,N),v.replaceChildren(s)},Ae=ft(o,e.store);if(Ae.length>0)return queueMicrotask(()=>k("manifest",Ae.join(" "))),he();let Le=t=>{if(("source"in t?new TextEncoder().encode(t.source).length:"script"in t?new TextEncoder().encode(t.script).length:0)>R.maxSourceBytes)return["source"];let b="source"in t?mt(t.source):[];return b.length>0?["source",b.join(" ")]:void 0},$=e.worker,_e=typeof $=="function"?void 0:Le($);if(_e)return queueMicrotask(()=>k(..._e)),he();let Ie=bt(p,()=>Ne(),"blob"),pe=()=>kt(()=>e.theme?.()??wt(f),e.brand,Ie),Pe="",fe=()=>{Pe=JSON.stringify(pe()),h?.push()},Ne=()=>{h&&JSON.stringify(pe())!==Pe&&fe()},It=vt(u,Ne),B,Pt=xe(e.store,o)?fr().then(({computedOn:t})=>{m=t(e.store.schema)}):Promise.resolve(),U,Nt=o.pictures?lr().then(({createGuestPictures:t})=>{g||(B=t(p,{as:"blob",view:`"${o.title??o.name}"`,pictures:o.pictures,...e.limits?{limits:e.limits}:{},...e.file?{file:e.file}:{},moved:()=>h?.push(),onLeft:d=>{D?.postMessage({type:"notice",text:d}),e.onProblem?.(d)}}))}):Promise.resolve();c=()=>{It(),Ie.dispose(),B?.dispose(),X?.dispose(),U?.dispose(),re?.dispose()};let D,Q=t=>D?.postMessage(t),Ce=!1,Ve=!1,Z=()=>f.toggleAttribute("data-worker-view-drawn",!g&&Ve&&M!==void 0&&V.length===0&&z.size===0&&!B?.waiting()&&!(U?.waiting??0)),F=p.performance,z=new Map,ee=F.now(),ge=Math.max(10,Math.min(250,Math.floor(R.pushMs/4))),Ct=()=>{x||(ee=F.now(),x=p.setInterval(()=>{let t=F.now(),d=t-ee>ge*2?t-ee-ge:0;ee=t;for(let[b,E]of z){let s=E+d;if(z.set(b,s),t-s>=R.pushMs)return k("slow")}},ge))},Vt=ce(R.drawMs,()=>F.now()),De=()=>{},me=t=>{if(g)return;if(!M)return void V.push(t);let d=M;if(!Vt.draw(E=>t[0]==="render"?d.apply(t[1],E):(d.style(t[1]),!0)))return k("slow");t[0]==="render"&&De()},He=()=>at(e.store.schema,new Set([...e.store.kindsKeptFrom(e.principal),...e.store.modules.disabledKinds])),q=dt({sees:t=>e.store.seenBy(e.principal).graph.has(t),places:()=>ie(e.places?.()??[]),lists:He,schema:e.store.schema,...e.onNavigate?{onNavigate:e.onNavigate}:e.goTo?{onNavigate:t=>yt(e.goTo(),t)}:{},...e.hrefOf?{hrefOf:e.hrefOf}:!e.onNavigate&&e.goTo?{hrefOf:t=>ht(e.goTo(),t)}:{},onLost:t=>{D?.postMessage({type:"notice",text:t}),e.onProblem?.(t)}}),j=new Set,je=new Set,X,Be=!1,Ue=()=>{Be||(Be=!0,ur().then(({createGuestMedia:t})=>{g||(X=t(p,{view:`"${o.title??o.name}"`,pictures:o.pictures!==void 0,shown:()=>A,...e.file?{file:e.file}:{},onProblem:d=>{D?.postMessage({type:"notice",text:d}),e.onProblem?.(d)}}),X.refresh(v))},()=>e.onProblem?.(`The view "${o.title??o.name}" places a video or a full-screen viewer, and the host's player could not be loaded.`)))},$e=!1,Fe=!1,te=new Map,ze=()=>{$e||!o.accepts?.length||($e=!0,cr().then(({createGuestDrops:t})=>{g||(U=t(p,{shadow:v,manifest:o,store:e.store,principal:e.principal,files:()=>e.files?.(),shown:()=>j,hears:()=>Fe,idOf:d=>M?.renderer.idOf(d),send:Q,change:(d,b)=>{if(!h)return{ok:!1,reason:"refused",message:"The view has gone."};let E=h.change(d,b);return r(),E},handed:(d,b)=>te.set(d.href,{file:d,drop:b}),onProblem:d=>{D?.postMessage({type:"notice",text:d}),e.onProblem?.(d)},onBusy:()=>Z()}),U.refresh())},()=>e.onProblem?.(`The view "${o.title??o.name}" takes files, and the host's drop could not be loaded.`)))},re,qe=[],Xe=!1,Dt=t=>{qe=t,re?.bind(t),!(Xe||t.length===0)&&(Xe=!0,pr().then(({createGuestGestures:d,unheardWords:b})=>{if(!g){if(o.gestures!==!0){let E=b(o.title??o.name);return D?.postMessage({type:"notice",text:E}),e.onProblem?.(E)}re=d(v,{root:()=>v.querySelector("[data-graview-view-root]")??void 0,idOf:E=>M?.renderer.idOf(E),send:Q}),re.bind(qe)}},()=>{}))},Ht=t=>{let d=e.store.seenBy(e.principal).graph;for(let b of j){let E=d.getNode(b);for(let s of Object.values(E??{}))for(let I of pt(s))if(I.href===t)return I}},Ye=t=>{if(t.localName==="graview-video")return Ue();t.hasAttribute("data-lightbox")&&(t.setAttribute("aria-haspopup","dialog"),Ue())};Promise.all([ar(),dr()]).then(([{createOpenDrawing:t,handedLinks:d,judgeLink:b,linkRefusedWords:E},{createPressReader:s,createSaver:I,fillPrefills:C,judgePress:N,markPresses:ne,prefillOf:oe,quietPictures:jt}])=>{if(g)return;let Y=s(),et=(l,G)=>{let P=M?.renderer.idOf(l);P!==void 0&&Q({type:"dom-event",target:P,event:"acted",pressed:G})},we=I({reader:Y,save:(l,G)=>{if(!h)return;let P=h.pressed(N(e.store,o,j,l));r(),et(G,{as:l.as,...P})}}),tt=()=>we.flush();p.addEventListener("pagehide",tt),T=()=>{p.removeEventListener("pagehide",tt),we.flush()};let Bt=new WeakSet;De=()=>{q.refresh(v),ne(v),jt(v),C(v,Y,Bt,l=>oe(e.store,e.principal,o,j,l)),X?.refresh(v),U?.refresh()};let rt,nt=new Set,Ut=()=>(rt!==A&&([rt,nt]=[A,d(A)]),nt),ot=new Set;M=t(v,{origin:e.origin??p.location.origin,link:l=>b(l,{handed:Ut(),...e.links?{origins:e.links.origins}:{}}),...e.asset?{asset:e.asset}:{},...e.images?{imageOrigins:e.images.origins}:{},...o.pictures?{picture:l=>B?.drawn(l)}:{},onRefused:l=>{if(l.reason==="url"&&l.element==="a"&&l.address!==void 0&&!ot.has(l.address)){ot.add(l.address);let P=E(l.address,e.links?.origins);return D?.postMessage({type:"notice",text:P}),e.onProblem?.(P)}if(l.reason!=="url"||l.element!=="img"||l.address===void 0||je.has(l.address))return;je.add(l.address);let G=ct(l.address,{...e.images?{origins:e.images.origins}:{},assets:e.asset!==void 0},l.length);D?.postMessage({type:"notice",text:G}),e.onProblem?.(G)},...e.limits?.maxNodes!==void 0?{maxNodes:e.limits.maxNodes}:{},onOverBudget:()=>k("nodes"),send:Q,onFieldSet:l=>Y.filled(l),onAttribute:(l,G)=>{(G==="data-record"||G==="data-place")&&q.link(l),G==="data-lightbox"&&Ye(l),G==="data-drop"&&ze()},decorate:l=>{(l.hasAttribute("data-record")||l.hasAttribute("data-place"))&&q.link(l),Ye(l),l.hasAttribute("data-drop")&&ze()},before:(l,G,P)=>{Y.heard(l,G),we.heard(l,G,P),q.pressed(l,G,P);let ve=G.closest("a[href]");ve&&P.contains(ve)&&!ve.hasAttribute("data-graview-link")&&l.type==="click"&&l.stopPropagation();let se=G.closest("[data-lightbox]"),st=l.type==="keydown"?l.key:void 0;if(se&&P.contains(se)&&l.isTrusted&&(l.type==="click"||(st==="Enter"||st===" ")&&se.localName!=="button")&&(l.preventDefault(),l.stopPropagation(),X?.open(se)),U?.before(l,G,P))return!1;let ke=Y.press(l,G,P);if(!ke||!h)return;l.stopPropagation(),l.type==="keydown"&&l.preventDefault();let $t=h.pressed(N(e.store,o,j,ke));r();let it={as:ke.as,...$t},Ft=G.closest("[data-act]");return queueMicrotask(()=>et(Ft,it)),{pressed:it}}});for(let l of V.splice(0))me(l);a(),Z()},()=>k("start","the view's drawing could not be loaded"));let ye=t=>_=ue(p,{source:t,name:o.name,limiter:L,readyMs:e.limits?.readyMs??5e3,silentMs:e.limits?.silentMs??5e3,onDropped:()=>K.dropped+=1,onStop:(d,b)=>k(d,b),onError:d=>{Ce||k("error",d)},onReady:(d,b)=>{D=b,Ct();let E=de({store:e.store,principal:e.principal,view:o.name,nonce:d,send:s=>{s.type==="props"&&typeof s.push=="number"&&(z.set(s.push,F.now()),Z()),b.postMessage(s)},props:()=>{let s=Se(e.store,e.principal,{manifest:o,...e.input?{input:e.input()}:{},theme:pe(),...e.places?{places:ie(e.places())}:{},...m?{computed:m}:{}});return j=new Set([...s.node?[s.node.id]:[],...(s.nodes??[]).map(I=>I.id)]),A=s,s},...B?{hand:B.hand}:{},judgeAct:(s,I)=>{let C=gt(e.store,o,s,I,{shown:j,file:N=>te.get(N)?.file??Ht(N),dropped:N=>te.get(N)?.drop});if(C.ok)for(let N of C.spent??[])te.delete(N);return C},onHears:s=>{s.includes("drop")&&(Fe=!0)},onGestures:Dt,onClicks:s=>At(f,s),onRender:s=>{Ce=!0,me(["render",s])},onPushed:(s,I)=>{if(z.delete(s),I>=R.pushMs)return k("slow");Ve=!0,Z()},onFlood:()=>k("flood"),onStyle:s=>me(["style",s]),places:()=>[...new Set([...ie(e.places?.()??[]).map(s=>s.as),...He().map(s=>s.slug)])],...e.limits?{limits:e.limits}:{},limiter:L});h=E,b.onmessage=({data:s})=>{if(!_?.answer(s)&&(E.receive(s),r(),!g&&s?.nonce===d&&s.type==="navigate")){let I={...s.where!==void 0?{where:s.where}:{},...s.section!==void 0?{section:s.section}:{}},C=typeof s.place=="string"?{place:s.place,...I}:typeof s.to=="string"&&{record:s.to,...I};C&&q.go(C)}},fe()}}),Je=o.pictures!==void 0||xe(e.store,o),Qe=()=>Promise.all([Nt.catch(()=>Promise.reject(new Error("the view's pictures could not be loaded"))),Pt.catch(()=>Promise.reject(new Error("the view's computed values could not be worked out")))]),Ze=t=>{"source"in t?(Je?Promise.all([Te(t.source),Qe()]).then(([d])=>d):Te(t.source)).then(d=>{g||ye({script:d})},d=>k("start",d instanceof Error&&d.message.startsWith("the view's")?d.message:"the view's runtime could not be loaded")):Je?Qe().then(()=>{g||ye(t)},d=>k("start",d instanceof Error?d.message:"the view's pictures could not be loaded")):ye(t)};return typeof $=="function"?xt($).then(t=>{if(g)return;let d=Le(t);d?k(...d):Ze(t)},t=>k("source",`Its code did not arrive${t instanceof Error&&t.message?`: ${t.message}`:""}.`)):Ze($),he();function he(){return{element:f,shadow:v,get worker(){return _?.worker},update:()=>{h&&fe()},get stats(){return r(),K},get refused(){return M?.refused??[]},get contentHeight(){return w},dispose(){g=!0,S(),i?.disconnect(),M?.dispose(),f.remove(),W?.remove()}}}}var Lt="graview-guest-kit";function $r(n,e){let u=n.ownerDocument,p=u.defaultView;if(!u.getElementById(Lt)){let g=u.createElement("style");g.id=Lt,g.textContent=Oe,u.head.appendChild(g)}let o=u.createElement("div");o.className="graview-guest",o.setAttribute("role","group"),o.setAttribute("aria-label",e.title??e.view),o.setAttribute("data-guest-view",e.view),n.appendChild(o);let f={applied:0,refused:0,dropped:0},v=ae(e.limits),W=ce(e.limits?.drawMs??100,()=>p.performance.now()),K,L,R,A=!1,m={applied:0,refused:0,dropped:0},h=()=>{if(!K)return;let g=K.stats;f.applied+=g.applied-m.applied,f.refused+=g.refused-m.refused,f.dropped+=g.dropped-m.dropped,m={...g}},_=()=>{h(),K?.dispose(),K=void 0,R?.stop()},M=(g,O)=>{A||(A=!0,_(),L?.dispose(),e.onFailure?.(g,O))};return R=ue(p,{source:e.worker,name:e.view,limiter:v,readyMs:e.limits?.readyMs??5e3,silentMs:e.limits?.silentMs??5e3,onDropped:()=>f.dropped+=1,onStop:(g,O)=>M(g,O),onReady:(g,O)=>{let V=We(o,{...e.kit?{kit:e.kit}:{},...e.links?{links:e.links}:{},onEvent:(c,w)=>O.postMessage({type:"event",listener:c,...w!==void 0?{detail:w}:{}}),...e.limits?.maxNodes!==void 0?{maxNodes:e.limits.maxNodes}:{},onOverBudget:()=>M("budget")});L=V;let r=de({store:e.store,principal:e.principal,view:e.view,nonce:g,send:c=>O.postMessage(c),onRender:c=>{W.draw(w=>V.apply(c,w))||M("slow")},...e.input?{input:e.input}:{},...e.onNavigate?{onNavigate:e.onNavigate}:{},onSize:e.onSize??(c=>o.style.minHeight=`${c}px`),...e.limits?{limits:e.limits}:{},limiter:v});K=r,O.onmessage=c=>{R?.answer(c.data)||(r.receive(c.data),h())},r.push()}}),{element:o,get worker(){return R?.worker},update:()=>K?.push(),get stats(){return h(),f},get refused(){return L?.refused??[]},dispose(){A=!0,_(),L?.dispose(),o.remove()}}}export{Me as GUEST_KIT,Oe as GUEST_KIT_CSS,Ee as KIT_LINK_TARGETS,St as KIT_TONES,We as createKitRenderer,Kt as hostAttribute,Gt as kitValue,$r as mountGuestWorker,mr as mountWorkerView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as y}from"./chunk.
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as y}from"./chunk.D3AISGQH.js";import{j as g}from"./chunk.6IUEGPCZ.js";import{G as R,Ga as m,T as c}from"./chunk.VNJKGSGZ.js";import{a as f}from"./chunk.SDO3U72B.js";import{oa as p}from"./chunk.X3MMJ3QC.js";import{b as u}from"./chunk.AJZBJBMO.js";var o=u(R(),1);var r=u(c(),1),S,h=()=>S??=m(f(()=>(__graviewPreload(import.meta.url,["./chunk.ZFH4SCCF.js","./chunk.RKZ4J3H2.js","./chunk.HKINU7VO.js","./chunk.YGZCESXY.js","./chunk.X3MMJ3QC.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.TCPTVTFU.js"))));function L(e){let[n,t]=(0,o.useState)(()=>h().current);return(0,o.useEffect)(()=>{if(!e||n)return;let i=!0;return h().load().then(a=>i&&t(a),()=>{}),()=>{i=!1}},[e,n]),n}function D(e,n){let t=L(n.length>0);return(0,o.useMemo)(()=>t?t.withLines(e,n):n,[t,e,n])}function I(e,n){let t=L(n.some(i=>i.shape));return(0,o.useMemo)(()=>{let i=new Map;if(!t)return i;for(let a of n){let l=t.ruleLine(a,e);l&&i.set(a.name,l)}return i},[t,e,n])}function M(e){let n=e.line;if(!(!n||e.message.endsWith(` \u2014 ${n.text}`)||e.message===b(e)))return e.message}function b(e){let n=e.line;return n?n.record!==void 0?`${n.record} \u2014 ${n.text}`:n.text:e.message}var P={name:{},op:{color:"var(--graview-ink-muted)",fontWeight:500},value:{fontWeight:600,fontVariantNumeric:"tabular-nums"},word:{color:"var(--graview-ink-muted)"},open:{color:"var(--graview-ink-faint)"},close:{color:"var(--graview-ink-faint)"}};function w({parts:e}){return(0,r.jsx)(r.Fragment,{children:e.map((n,t)=>(0,r.jsxs)("span",{children:[n.space?" ":"",(0,r.jsx)("span",{"data-graview-rule-part":n.as,style:P[n.as],children:n.text})]},t))})}function x(e,n){let t=p(e?.tryDefinition(n),n);return t.charAt(0).toUpperCase()+t.slice(1)}function C({line:e,schema:n,brand:t,lead:i=e.record===void 0?"kind":"record",stacked:a=!1,style:l}){let d=e.kind,s=i==="kind"?d?x(n,d):void 0:i==="record"?e.record:void 0,k=i==="kind"&&s?`${s}: ${e.said}`:i==="record"&&s?`${s} \u2014 ${e.said}`:e.said;return(0,r.jsxs)("span",{"data-graview-rule-line":"",style:{overflowWrap:"anywhere",...l},children:[(0,r.jsx)("span",{style:g,children:k}),(0,r.jsxs)("span",{"aria-hidden":"true",children:[i!=="none"&&d?(0,r.jsx)("span",{style:{display:"inline-flex",verticalAlign:"-0.1em",marginRight:"0.4em"},children:(0,r.jsx)(y,{kind:d,...n?{schema:n}:{},...t?{brand:t}:{},size:13})}):null,s?(0,r.jsxs)("span",{"data-graview-rule-head":"",style:{fontWeight:600,marginRight:i==="record"||a?0:"0.6em"},children:[s,i==="record"&&!a?(0,r.jsx)("span",{style:{color:"var(--graview-ink-faint)",fontWeight:400},children:" \u2014 "}):null]}):null,a&&s?(0,r.jsx)("br",{}):null,(0,r.jsx)(w,{parts:e.parts}),e.when&&e.when.length>0?(0,r.jsxs)("span",{"data-graview-rule-when":"",style:{color:"var(--graview-ink-faint)"},children:[", when ",(0,r.jsx)(w,{parts:e.when})]}):null]})]})}function z(e){return e.line?e.label&&e.label.trim().length>0?e.label:void 0:e.label&&e.label!==e.message&&!e.message.startsWith(e.label)?e.label:void 0}export{D as a,I as b,M as c,C as d,z as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as _}from"./chunk.
|
|
1
|
+
import{b as _}from"./chunk.IIESMHXY.js";import"./chunk.6IUEGPCZ.js";import"./chunk.CUJX3IVA.js";import{G as se,T as U,ba as H,ea as Y}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import{$d as $,vb as z}from"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b as D}from"./chunk.AJZBJBMO.js";var u=D(se(),1);function L(e,t,s=!1){if(e<t.at||e===t.at&&s)return e;let i=t.at+t.removed.length;return e>=i?e+t.inserted.length-t.removed.length:s?t.at:t.at+t.inserted.length}var X=e=>e>=55296&&e<=56319,G=e=>e>=56320&&e<=57343;function V(e,t,s){let i=Math.min(e.length,t.length),n=0,l=Math.max(0,Math.min(i,t.length-s));for(;n<l&&e.charCodeAt(e.length-1-n)===t.charCodeAt(t.length-1-n);)n++;let r=0;for(;r<i-n&&e.charCodeAt(r)===t.charCodeAt(r);)r++;return r>0&&X(e.charCodeAt(r-1))&&r--,n>0&&G(e.charCodeAt(e.length-n))&&n--,{at:r,removed:e.slice(r,e.length-n),inserted:t.slice(r,t.length-n)}}function M(e,t){let s=Math.min(e.length,t.length),i=0;for(;i<s&&e.charCodeAt(i)===t.charCodeAt(i);)i++;i>0&&X(e.charCodeAt(i-1))&&i--;let n=0;for(;n<s-i&&e.charCodeAt(e.length-1-n)===t.charCodeAt(t.length-1-n);)n++;return n>0&&G(e.charCodeAt(e.length-n))&&n--,{at:i,removed:e.slice(i,e.length-n),inserted:t.slice(i,t.length-n)}}function q(e,t){let s=c=>c.at+c.removed.length;if(s(e)<t.at)return e;if(e.at>s(t))return{...e,at:e.at+t.inserted.length-t.removed.length};let i=Math.min(e.at,t.at),n=s(e)-s(t),l=e.removed.slice(0,t.at-i)+t.inserted+(n>0?e.removed.slice(e.removed.length-n):""),r=t.at<=e.at?t.inserted+e.inserted:e.inserted+t.inserted,d=M(l,r);return{...d,at:i+d.at}}function I(e,t){let s=L(e.start,t,!0),i=e.end===e.start?s:L(e.end,t);return{start:s,end:Math.max(s,i)}}function ce(e,t){let{kind:s,id:i,session:n}=e.author,l=`${s}:${i??""}:`;return t.startsWith(l)&&(!n||t.slice(l.length)===n)}function Z(e,t,s,i){let n=e.anchor,l=e.head;for(let d of s)if(!(d.seq<e.rev||ce(d,t)))for(let c of d.primitives)c.op!=="splice-text"||c.id!==e.node||c.field!==e.field||(n=L(n,c),l=L(l,c));let r=d=>Math.max(0,Math.min(i,d));return{start:r(n),end:r(l)}}var O=(e,t,s)=>e.ops.length>0&&e.ops.every(i=>{let n=i.mutation?.args;return i.mutation?.name===z&&n?.node===t&&n.field===s}),le=(e,t,s,i)=>t.ops.length>0&&t.ops.every(n=>n.undoes!==void 0)&&e.batches().some(n=>t.ops.some(l=>l.undoes===n.id||l.undoes===n.ops[0]?.id)&&O(n,s,i)),J=(e,t)=>e.author.kind==="human"&&(t?.id===void 0||e.author.id===void 0||e.author.id===t.id);function Q(e,t,s,i){let n=e.batches();for(let l=n.length-1;l>=0;l--){let r=n[l];if(!(!J(r,t)||r.undone||!O(r,s,i))&&e.canUndo(r.id).ok)return r.id}}function j(e,t,s,i){let n=e.batches();for(let l=n.length-1;l>=0;l--){let r=n[l];if(J(r,t)){if(O(r,s,i))return;if(le(e,r,s,i))return r.undone?void 0:r.id}}}var p=D(U(),1);function de(e){let{store:t}=H(),{live:s,nodeId:i,field:n}=e,[l,r]=(0,u.useState)(null);return(0,u.useEffect)(()=>{let d=!0;return s.typing(i,n).then(c=>d&&r(c)),()=>{d=!1}},[i,n]),l&&!t.collaborative(i,n)?(0,p.jsx)(p.Fragment,{children:e.writtenWhole}):(0,p.jsx)(ue,{...e,typing:l})}function ue({nodeId:e,field:t,label:s,markdown:i,live:n,onDone:l,typing:r}){let{store:d,principal:c}=H(),m=Y(e),f=te(m?.[t]),[x,oe]=(0,u.useState)(!1),y=(0,u.useRef)(null),R=(0,u.useRef)(f),E=(0,u.useRef)(!1),B=(0,u.useRef)(n);B.current=n;let N=()=>te(d.graph.getNode(e)?.[t]);(0,u.useEffect)(()=>y.current?.focus(),[x,r]);let b=(0,u.useRef)(void 0),C=()=>{b.current===void 0&&(b.current=setTimeout(()=>{b.current=void 0;let o=y.current;if(!o||o.ownerDocument.activeElement!==o)return;let a=o.selectionDirection==="backward";B.current.sayCaret({node:e,field:t,anchor:a?o.selectionEnd:o.selectionStart,head:a?o.selectionStart:o.selectionEnd,rev:d.log.length})},fe))};(0,u.useEffect)(()=>()=>{clearTimeout(b.current),B.current.sayCaret(null)},[]);let W=o=>{let a=y.current;if(a){if(a.value!==o){let h=I({start:a.selectionStart,end:a.selectionEnd},M(a.value,o)),g=a.selectionDirection??"none";a.value=o,a.setSelectionRange(h.start,h.end,g)}R.current=o}},K=()=>{let o=y.current;if(!o||!r||E.current)return;let a=R.current,h=N(),g=V(a,o.value,o.selectionEnd);if(g.removed===""&&g.inserted==="")return W(h);let v=a===h?g:q(g,M(a,h));try{r.splice(v.at,v.removed.length,v.inserted)}catch{}let w=N();if(o.value!==w){o.value=w;let S=Math.min(w.length,v.at+v.inserted.length);o.setSelectionRange(S,S)}R.current=w,C()};(0,u.useLayoutEffect)(()=>{E.current||W(f)},[f]);let ie=async o=>{if(!r)return;r.flush();for(let h=0;r.waiting()>0&&h<100;h++)await new Promise(g=>setTimeout(g,30));let a=o?j(d,c,e,t):Q(d,c,e,t);if(a)try{o?d.redo(a,{author:c}):d.undo(a,{author:c})}catch{}},T=o=>{r?.flush(),n.sayCaret(null),l(o)},k=(0,u.useRef)(void 0);(0,u.useEffect)(()=>()=>k.current?.(),[]);let ae=o=>{k.current?.();let a=o.ownerDocument,h=y.current?.closest("[data-graview-live]"),g=A=>{let P=A.target;if(P instanceof Node&&h?.contains(P))return S();P instanceof Element&&P.closest(ee)||(S(),T(!0))},v=()=>{let A=a.activeElement;A!==null&&A!==a.body||o.isConnected&&he(o)||(S(),y.current?.focus({preventScroll:!0}))},w=new MutationObserver(v);w.observe(a.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["open","hidden"]}),a.addEventListener("focusin",g),a.addEventListener("toggle",v,!0);let S=()=>{k.current=void 0,w.disconnect(),a.removeEventListener("focusin",g),a.removeEventListener("toggle",v,!0)};k.current=S},F=[...n.who.values()].filter(o=>o.caret?.node===e&&o.caret.field===t);return(0,p.jsxs)("div",{style:{display:"grid",gap:8,minWidth:0},"data-graview-live":t,children:[x?(0,p.jsx)("div",{"data-graview-preview":t,"aria-label":`${s}, as it will read`,role:"region",style:me,children:(0,p.jsx)(_,{text:f,markdown:!0})}):(0,p.jsxs)("div",{style:{position:"relative",minWidth:0},children:[(0,p.jsx)("textarea",{ref:y,"aria-label":s,"data-graview-field":t,defaultValue:f,readOnly:!r,rows:3,onInput:K,onCompositionStart:()=>{E.current=!0},onCompositionEnd:()=>{E.current=!1,K()},onSelect:C,onFocus:C,onPointerDown:()=>r?.flush(),onKeyDown:o=>{let a=o.key;a==="Escape"?(o.preventDefault(),T(!1)):(o.metaKey||o.ctrlKey)&&!o.altKey&&a.toLowerCase()==="z"?(o.preventDefault(),ie(o.shiftKey)):(o.metaKey||o.ctrlKey)&&a==="Enter"?(o.preventDefault(),T(!1)):(a==="Enter"||ge.has(a))&&r?.flush()},onKeyUp:C,onBlur:o=>{r?.flush(),n.sayCaret(null);let a=o.relatedTarget;if(a instanceof Node&&o.currentTarget.closest("[data-graview-live]")?.contains(a))return;let h=a instanceof Element?a.closest(ee):null;if(h)return ae(h);T(!0)},style:ve}),F.length>0?(0,p.jsx)(pe,{text:f,others:F,area:y,log:d.log.all()}):null]}),(0,p.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,p.jsx)("button",{type:"button",onClick:()=>T(!1),style:ne,children:"Done"}),i?(0,p.jsx)("button",{type:"button","aria-pressed":x,onClick:()=>oe(!x),style:ne,children:x?"Write":"Preview"}):null,(0,p.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:"Saved as you type \xB7 Ctrl or \u2318 Z takes back your typing"})]})]})}function pe({text:e,others:t,area:s,log:i}){let n=(0,u.useRef)(null);(0,u.useLayoutEffect)(()=>{let c=s.current,m=n.current;if(!c||!m)return;let f=()=>{m.scrollTop=c.scrollTop};return f(),c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)});let l=t.map(c=>({one:c,at:Z(c.caret,c.participant,i,e.length).end})).sort((c,m)=>c.at-m.at),r=[],d=0;for(let{one:c,at:m}of l){r.push(e.slice(d,m)),d=m;let f=$(c)||"Somebody";r.push((0,p.jsx)("span",{"data-graview-caret":c.participant,title:`${f} is typing here`,style:{borderLeft:`2px solid hsl(${Math.round(c.hue)} 55% 52%)`,marginLeft:-1,marginRight:-1,pointerEvents:"auto"}},c.participant))}return r.push(`${e.slice(d)}\u200B`),(0,p.jsx)("div",{ref:n,"aria-hidden":"true",style:ye,children:r})}var ee='[data-graview-overlay], dialog, [role="dialog"], [role="alertdialog"], [popover]',he=e=>{if(e.hasAttribute("hidden")||e instanceof HTMLDialogElement&&!e.open)return!1;if(e.hasAttribute("popover"))try{return e.matches(":popover-open")}catch{}return!0},fe=120,te=e=>typeof e=="string"?e:"",ge=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"]),me={minHeight:"7.5em",padding:"8px 10px",border:"1px dashed var(--graview-edge-bright)",borderRadius:6,lineHeight:1.6,minWidth:0},ne={font:"inherit",fontSize:"0.8125rem",minHeight:28,padding:"2px 12px"},re={font:"inherit",lineHeight:1.5,width:"100%",boxSizing:"border-box",minHeight:"7.5em",padding:"8px 10px",borderRadius:6},ve={...re,resize:"vertical",fieldSizing:"content",color:"var(--graview-ink)",background:"var(--graview-panel, transparent)",border:"1px solid var(--graview-edge-bright)"},ye={...re,position:"absolute",inset:0,height:"100%",border:"1px solid transparent",color:"transparent",whiteSpace:"pre-wrap",overflowWrap:"break-word",overflow:"hidden",pointerEvents:"none"};export{de as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as p}from"./chunk.VDGMFX5C.js";import{fc as g}from"./chunk.X3MMJ3QC.js";function w(n){let r=n.policy?.sees??[];if(r.length===0)return!0;let t=o=>o.fields===void 0&&(o.hide?.length??0)===0;return n.schema.kinds.every(o=>r.some(s=>s.roles==="*"&&!s.own&&!s.via&&t(s)&&s.kinds.includes(o)))}function b(n){let r=n;for(let t=0;t<8&&r?._zod?.def;t+=1){let o=r._zod.def;if(o.type==="enum")return Object.values(o.entries);if(o.type==="literal")return o.values;if(!("innerType"in o))return;r=o.innerType}}var c=(n,r)=>({ok:!1,reason:n,message:r});function k(n,r){return p(n).find(t=>(t.as??t.act)===r)??p(n).find(t=>t.act===r&&t.as===void 0)}var m=n=>typeof n=="object"&&n!==null&&!Array.isArray(n)&&"href"in n;function S(n,r,t,o,s){let l=k(r,t);if(!l)return c("undeclared",`This view may not ask for \u201C${t}\u201D: its manifest does not name it.`);let u={},f=new Map;for(let[a,d]of Object.entries(o)){let y=i=>{if(!m(i))return i;let e=typeof i.href=="string"?s?.file(i.href):void 0;if(!e)throw c("malformed",`\u201C${a}\u201D is a file the host did not hand this view: a view hands an act a file the person dropped (event.files), or one a record it was shown holds, as it was handed.`);let h=s?.dropped(e.href);if(h){if(f.has(e.href))throw c("malformed",`\u201C${a}\u201D hands the act a dropped file it already carries: each file a person dropped goes in one act, once.`);f.set(e.href,h)}return e};try{u[a]=Array.isArray(d)?d.map(y):y(d)}catch(i){return i}}if(!w(n)){let a=new Set([...f.values()].map(e=>e.target)),d=a.size===1?[...a][0]:void 0,y=e=>m(e)&&typeof e.href=="string"&&f.has(e.href)||g(e)||d!==void 0&&e===d&&s?.shown.has(d)===!0;return f.size>0&&a.size===1&&Object.values(u).every(e=>Array.isArray(e)?e.every(y):y(e))?{ok:!0,name:l.act,args:{...u,...l.constants??{}},spent:[...f.keys()]}:c("press-only","In this app some members may not see some records, so a view's act applies only when you press it.")}return{ok:!0,name:l.act,args:{...u,...l.constants??{}}}}export{w as a,b,c,k as d,S as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Lt,b as Le,c as Dt,g as kt,h as ne,i as Ft,j as Tt}from"./chunk.6VC6AGYV.js";import{m as Ct}from"./chunk.IDJPBWL2.js";import{g as vt}from"./chunk.HS3GHAUR.js";import{a as pt}from"./chunk.43OKZU73.js";import{d as gt}from"./chunk.EQTSV7BK.js";import{d as yt}from"./chunk.27CW6SCT.js";import{C as xt,D as Pt,g as mt,p as Rt,q as wt,t as St,u as bt,v as Et}from"./chunk.YD3TKV6P.js";import{c as Nr}from"./chunk.4KC35UNR.js";import{G as M,O as ft,T as ee,ca as ht}from"./chunk.HT2BEOEV.js";import{Ad as lt,Bd as st,Ec as nt,Qd as ut,Rd as ct,Sd as dt,Uc as ot,_a as at,da as Ce,ka as de,zd as it}from"./chunk.7BBGRTXM.js";import{b as D}from"./chunk.AJZBJBMO.js";function Mr(e,t){return it(e,t).slice(1)}function fe(e,t){return e.kinds.find(r=>Mr(e,r)===t)}function Fn(e,t,r){return lt(e,t,r)}function Tn(e,t){return st(e,t)}var _=D(M(),1),g=D(M(),1),x=D(M(),1),Ve=D(M(),1),hr=D(M(),1),S=D(M(),1),tn=D(M(),1),rn=D(M(),1),an=D(M(),1),v=D(M(),1),Pr=D(M(),1);var Ae=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Ut=/^[\\/]{2}/;function Or(e,t){return t+e.replace(/\\/g,"/")}var Nt="popstate";function ge(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function jt(e={}){let{initialEntries:t=["/"],initialIndex:r,v5Compat:a=!1}=e,n;n=t.map((h,y)=>c(h,typeof h=="string"?null:h.state,y===0?"default":void 0,typeof h=="string"?void 0:h.mask));let o=s(r??n.length-1),i="POP",l=null;function s(h){return Math.min(Math.max(h,0),n.length-1)}function u(){return n[o]}function c(h,y=null,p,f){let R=ve(n?u().pathname:"/",h,y,p,f);return O(R.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(h)}`),R}function d(h){return typeof h=="string"?h:W(h)}return{get index(){return o},get action(){return i},get location(){return u()},createHref:d,createURL(h){return new URL(d(h),"http://localhost")},encodeLocation(h){let y=typeof h=="string"?V(h):h;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(h,y){i="PUSH";let p=ge(h)?h:c(h,y);o+=1,n.splice(o,n.length,p),a&&l&&l({action:i,location:p,delta:1})},replace(h,y){i="REPLACE";let p=ge(h)?h:c(h,y);n[o]=p,a&&l&&l({action:i,location:p,delta:0})},go(h){i="POP";let y=s(o+h),p=n[y];o=y,l&&l({action:i,location:p,delta:h})},listen(h){return l=h,()=>{l=null}}}}function zt(e={}){function t(a,n){let o=n.state?.masked,{pathname:i,search:l,hash:s}=o||a.location;return ve("",{pathname:i,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:W(n)}return _r(t,r,null,e)}function L(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function O(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ar(){return Math.random().toString(36).substring(2,10)}function Mt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ve(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?V(t):t,state:r,key:t&&t.key||a||Ar(),mask:n}}function W({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function V(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function _r(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",s=null,u=c();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function c(){return(i.state||{idx:null}).idx}function d(){l="POP";let f=c(),R=f==null?null:f-u;u=f,s&&s({action:l,location:p.location,delta:R})}function m(f,R){l="PUSH";let w=ge(f)?f:ve(p.location,f,R);r&&r(w,f),u=c()+1;let b=Mt(w,u),P=p.createHref(w.mask||w);try{i.pushState(b,"",P)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;n.location.assign(P)}o&&s&&s({action:l,location:p.location,delta:1})}function h(f,R){l="REPLACE";let w=ge(f)?f:ve(p.location,f,R);r&&r(w,f),u=c();let b=Mt(w,u),P=p.createHref(w.mask||w);i.replaceState(b,"",P),o&&s&&s({action:l,location:p.location,delta:0})}function y(f){return $r(n,f)}let p={get action(){return l},get location(){return e(n,i)},listen(f){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(Nt,d),s=f,()=>{n.removeEventListener(Nt,d),s=null}},createHref(f){return t(n,f)},createURL:y,encodeLocation(f){let R=y(f);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:m,replace:h,go(f){return i.go(f)}};return p}function $r(e,t,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),L(a,"No window.location.(origin|href) available to create URL");let n=typeof t=="string"?t:W(t);return n=n.replace(/ $/,"%20"),!r&&Ut.test(n)&&(n=a+n),new URL(n,a)}var Ir;Ir=new WeakMap;function _e(e,t,r="/"){return Hr(e,t,r,!1)}function Hr(e,t,r,a,n){let o=typeof t=="string"?V(t):t,i=U(o.pathname||"/",r);if(i==null)return null;let l=n??jr(e),s=null,u=qr(i);for(let c=0;s==null&&c<l.length;++c)s=Qr(l[c],u,a);return s}function Ur(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function jr(e){let t=Bt(e);return zr(t),t}function Bt(e,t=[],r=[],a="",n=!1){let o=(i,l,s=n,u)=>{let c={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(a)&&s)return;L(c.relativePath.startsWith(a),`Absolute route path "${c.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(a.length)}let d=H([a,c.relativePath]),m=r.concat(c);i.children&&i.children.length>0&&(L(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Bt(i.children,t,m,d,s)),!(i.path==null&&!i.index)&&t.push({path:d,score:Gr(d,i.index),routesMeta:m.map((h,y)=>{let[p,f]=Vt(h.relativePath,h.caseSensitive,y===m.length-1);return{...h,matcher:p,compiledParams:f}})})};return e.forEach((i,l)=>{if(i.path===""||!i.path?.includes("?"))o(i,l);else for(let s of Wt(i.path))o(i,l,!0,s)}),t}function Wt(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=Wt(a.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),n&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function zr(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Xr(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Br=/^:[\w-]+$/,Wr=3,Yr=2,Vr=1,Jr=10,Kr=-2,Ot=e=>e==="*";function Gr(e,t){let r=e.split("/"),a=r.length;return r.some(Ot)&&(a+=Kr),t&&(a+=Yr),r.filter(n=>!Ot(n)).reduce((n,o)=>n+(Br.test(o)?Wr:o===""?Vr:Jr),a)}function Xr(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function Qr(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let s=a[l],u=l===a.length-1,c=o==="/"?t:t.slice(o.length)||"/",d={path:s.relativePath,caseSensitive:s.caseSensitive,end:u},m=s.matcher&&s.compiledParams?Yt(d,c,s.matcher,s.compiledParams):ie(d,c),h=s.route;if(!m&&u&&r&&!a[a.length-1].route.index&&(m=ie({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!m)return null;Object.assign(n,m.params),i.push({params:n,pathname:H([o,m.pathname]),pathnameBase:ea(H([o,m.pathnameBase])),route:h}),m.pathnameBase!=="/"&&(o=H([o,m.pathnameBase]))}return i}function ie(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Vt(e.path,e.caseSensitive,e.end);return Yt(e,t,r,a)}function Yt(e,t,r,a){let n=t.match(r);if(!n)return null;let o=n[0],i=te(o,1),l=n.slice(1);return{params:a.reduce((u,{paramName:c,isOptional:d},m)=>{if(c==="*"){let y=l[m]||"";i=te(o.slice(0,o.length-y.length),1)}let h=l[m];return d&&!h?u[c]=void 0:u[c]=(h||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Vt(e,t=!1,r=!0){O(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s,u,c)=>{if(a.push({paramName:l,isOptional:s!=null}),s){let d=c.charAt(u+i.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function qr(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return O(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function U(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Jt(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?V(e):e,o;return r?(r=Kt(r),r.startsWith("/")||r.startsWith("\\")?o=At(r.substring(1),"/"):o=At(r,t)):o=t,{pathname:o,search:ta(a),hash:ra(n)}}function At(e,t){let r=te(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function De(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Zr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function $e(e){let t=Zr(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function Se(e,t,r,a=!1){let n;typeof e=="string"?n=V(e):(n={...e},L(!n.pathname||!n.pathname.includes("?"),De("?","pathname","search",n)),L(!n.pathname||!n.pathname.includes("#"),De("#","pathname","hash",n)),L(!n.search||!n.search.includes("#"),De("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,l;if(i==null)l=r;else{let d=t.length-1;if(!a&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),d-=1;n.pathname=m.join("/")}l=d>=0?t[d]:"/"}let s=Jt(n,l),u=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}var Kt=e=>e.replace(/[\\/]{2,}/g,"/"),H=e=>Kt(e.join("/"));function te(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var ea=e=>te(e).replace(/^\/*/,"/"),ta=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ra=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var Gt=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Xt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function aa(e){let t=e.map(r=>r.route.path).filter(Boolean);return H(t)||"/"}var Qt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function qt(e,t){let r=e;if(typeof r!="string"||!Ae.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(Qt)try{let o=new URL(window.location.href),i=Ut.test(r)?new URL(Or(r,o.protocol)):new URL(r),l=U(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch{O(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var Mn=Symbol("Uninstrumented");var On=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var _t=new URL("http://localhost");function Ie(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),_t)}catch{return _t}}function ke(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function na(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function He(e,t,r,a){let n=null;try{n=e==null?null:new URL(e,r)}catch{}let o=new URL(t,r),i=n!=null&&!ke(n,r),l=!ke(o,r);if(a==="reject"){if(i||l)throw new Error("External navigation is not allowed")}else if(l&&(n==null||!na(e,n)||!ke(n,o)))throw new Error("External navigation is not allowed")}var Zt=["POST","PUT","PATCH","DELETE"],An=new Set(Zt),oa=["GET",...Zt],_n=new Set(oa);var $n=Symbol("ResetLoaderData"),ia,la,sa,ua;ia=new WeakMap;la=new WeakMap;sa=new WeakMap;ua=new WeakMap;var ca=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function da(e){try{return ca.includes(new URL(e).protocol)}catch{return!1}}var G=_.createContext(null);G.displayName="DataRouter";var re=_.createContext(null);re.displayName="DataRouterState";var er=_.createContext(!1);function fa(){return _.useContext(er)}var Ue=_.createContext({isTransitioning:!1});Ue.displayName="ViewTransition";var tr=_.createContext(new Map);tr.displayName="Fetchers";var ha=_.createContext(null);ha.displayName="Await";var N=_.createContext(null);N.displayName="Navigation";var X=_.createContext(null);X.displayName="Location";var I=_.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName="Route";var je=_.createContext(null);je.displayName="RouteError";var Ne=!0,rr="REACT_ROUTER_ERROR",ma="REDIRECT",pa="ROUTE_ERROR_RESPONSE";function ya(e){if(e.startsWith(`${rr}:${ma}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function ga(e){if(e.startsWith(`${rr}:${pa}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Gt(t.status,t.statusText,t.data)}catch{}}function be(e,{relative:t}={}){L(Q(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=g.useContext(N),{hash:n,pathname:o,search:i}=ae(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:H([r,o])),a.createHref({pathname:l,search:i,hash:n})}function Q(){return g.useContext(X)!=null}function T(){return L(Q(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(X).location}function va(){return g.useContext(X).navigationType}var ar="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function nr(e){g.useContext(N).static||g.useLayoutEffect(e)}function q(){let{isDataRoute:e}=g.useContext(I);return e?ka():Ra()}function Ra(){L(Q(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(G),{basename:t,navigator:r}=g.useContext(N),{matches:a}=g.useContext(I),{pathname:n}=T(),o=JSON.stringify($e(a)),i=g.useRef(!1);return nr(()=>{i.current=!0}),g.useCallback((s,u={})=>{if(O(i.current,ar),!i.current)return;if(typeof s=="number"){r.go(s);return}let c=Se(s,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:H([t,c.pathname])),He(typeof s=="string"?s:W(s),r.createHref(c),Ie(r),"reject"),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var In=g.createContext(null);function wa(){let{matches:e}=g.useContext(I);return e[e.length-1]?.params??{}}function ae(e,{relative:t}={}){let{matches:r}=g.useContext(I),{pathname:a}=T(),n=JSON.stringify($e(r));return g.useMemo(()=>Se(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function or(e,t){return ir(e,t)}function ir(e,t,r){L(Q(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=g.useContext(N),{matches:n}=g.useContext(I),o=n[n.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;if(Ne){let f=u&&u.path||"";cr(l,!u||f.endsWith("*")||f.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${f}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
1
|
+
import{a as Lt,b as Le,c as Dt,g as kt,h as ne,i as Ft,j as Tt}from"./chunk.GQHFLOTZ.js";import{m as Ct}from"./chunk.2XTCDFWU.js";import{g as vt}from"./chunk.YMRVKG6W.js";import{a as pt}from"./chunk.D3AISGQH.js";import{d as gt}from"./chunk.SZG6HJWH.js";import{d as yt}from"./chunk.2FOIJ5ID.js";import{C as xt,D as Pt,g as mt,p as Rt,q as wt,t as St,u as bt,v as Et}from"./chunk.6IUEGPCZ.js";import{c as Nr}from"./chunk.CUJX3IVA.js";import{G as M,O as ft,T as ee,ca as ht}from"./chunk.VNJKGSGZ.js";import{Bd as it,Cd as lt,Dd as st,Ec as nt,Sd as ut,Td as ct,Ud as dt,Vc as ot,_a as at,da as Ce,ka as de}from"./chunk.X3MMJ3QC.js";import{b as D}from"./chunk.AJZBJBMO.js";function Mr(e,t){return it(e,t).slice(1)}function fe(e,t){return e.kinds.find(r=>Mr(e,r)===t)}function Fn(e,t,r){return lt(e,t,r)}function Tn(e,t){return st(e,t)}var _=D(M(),1),g=D(M(),1),x=D(M(),1),Ve=D(M(),1),hr=D(M(),1),S=D(M(),1),tn=D(M(),1),rn=D(M(),1),an=D(M(),1),v=D(M(),1),Pr=D(M(),1);var Ae=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Ut=/^[\\/]{2}/;function Or(e,t){return t+e.replace(/\\/g,"/")}var Nt="popstate";function ge(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function jt(e={}){let{initialEntries:t=["/"],initialIndex:r,v5Compat:a=!1}=e,n;n=t.map((h,y)=>c(h,typeof h=="string"?null:h.state,y===0?"default":void 0,typeof h=="string"?void 0:h.mask));let o=s(r??n.length-1),i="POP",l=null;function s(h){return Math.min(Math.max(h,0),n.length-1)}function u(){return n[o]}function c(h,y=null,p,f){let R=ve(n?u().pathname:"/",h,y,p,f);return O(R.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(h)}`),R}function d(h){return typeof h=="string"?h:W(h)}return{get index(){return o},get action(){return i},get location(){return u()},createHref:d,createURL(h){return new URL(d(h),"http://localhost")},encodeLocation(h){let y=typeof h=="string"?V(h):h;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(h,y){i="PUSH";let p=ge(h)?h:c(h,y);o+=1,n.splice(o,n.length,p),a&&l&&l({action:i,location:p,delta:1})},replace(h,y){i="REPLACE";let p=ge(h)?h:c(h,y);n[o]=p,a&&l&&l({action:i,location:p,delta:0})},go(h){i="POP";let y=s(o+h),p=n[y];o=y,l&&l({action:i,location:p,delta:h})},listen(h){return l=h,()=>{l=null}}}}function zt(e={}){function t(a,n){let o=n.state?.masked,{pathname:i,search:l,hash:s}=o||a.location;return ve("",{pathname:i,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:W(n)}return _r(t,r,null,e)}function L(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function O(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ar(){return Math.random().toString(36).substring(2,10)}function Mt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ve(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?V(t):t,state:r,key:t&&t.key||a||Ar(),mask:n}}function W({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function V(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function _r(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",s=null,u=c();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function c(){return(i.state||{idx:null}).idx}function d(){l="POP";let f=c(),R=f==null?null:f-u;u=f,s&&s({action:l,location:p.location,delta:R})}function m(f,R){l="PUSH";let w=ge(f)?f:ve(p.location,f,R);r&&r(w,f),u=c()+1;let b=Mt(w,u),P=p.createHref(w.mask||w);try{i.pushState(b,"",P)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;n.location.assign(P)}o&&s&&s({action:l,location:p.location,delta:1})}function h(f,R){l="REPLACE";let w=ge(f)?f:ve(p.location,f,R);r&&r(w,f),u=c();let b=Mt(w,u),P=p.createHref(w.mask||w);i.replaceState(b,"",P),o&&s&&s({action:l,location:p.location,delta:0})}function y(f){return $r(n,f)}let p={get action(){return l},get location(){return e(n,i)},listen(f){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(Nt,d),s=f,()=>{n.removeEventListener(Nt,d),s=null}},createHref(f){return t(n,f)},createURL:y,encodeLocation(f){let R=y(f);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:m,replace:h,go(f){return i.go(f)}};return p}function $r(e,t,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),L(a,"No window.location.(origin|href) available to create URL");let n=typeof t=="string"?t:W(t);return n=n.replace(/ $/,"%20"),!r&&Ut.test(n)&&(n=a+n),new URL(n,a)}var Ir;Ir=new WeakMap;function _e(e,t,r="/"){return Hr(e,t,r,!1)}function Hr(e,t,r,a,n){let o=typeof t=="string"?V(t):t,i=U(o.pathname||"/",r);if(i==null)return null;let l=n??jr(e),s=null,u=qr(i);for(let c=0;s==null&&c<l.length;++c)s=Qr(l[c],u,a);return s}function Ur(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function jr(e){let t=Bt(e);return zr(t),t}function Bt(e,t=[],r=[],a="",n=!1){let o=(i,l,s=n,u)=>{let c={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(a)&&s)return;L(c.relativePath.startsWith(a),`Absolute route path "${c.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(a.length)}let d=H([a,c.relativePath]),m=r.concat(c);i.children&&i.children.length>0&&(L(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Bt(i.children,t,m,d,s)),!(i.path==null&&!i.index)&&t.push({path:d,score:Gr(d,i.index),routesMeta:m.map((h,y)=>{let[p,f]=Vt(h.relativePath,h.caseSensitive,y===m.length-1);return{...h,matcher:p,compiledParams:f}})})};return e.forEach((i,l)=>{if(i.path===""||!i.path?.includes("?"))o(i,l);else for(let s of Wt(i.path))o(i,l,!0,s)}),t}function Wt(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=Wt(a.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),n&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function zr(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Xr(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Br=/^:[\w-]+$/,Wr=3,Yr=2,Vr=1,Jr=10,Kr=-2,Ot=e=>e==="*";function Gr(e,t){let r=e.split("/"),a=r.length;return r.some(Ot)&&(a+=Kr),t&&(a+=Yr),r.filter(n=>!Ot(n)).reduce((n,o)=>n+(Br.test(o)?Wr:o===""?Vr:Jr),a)}function Xr(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function Qr(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let s=a[l],u=l===a.length-1,c=o==="/"?t:t.slice(o.length)||"/",d={path:s.relativePath,caseSensitive:s.caseSensitive,end:u},m=s.matcher&&s.compiledParams?Yt(d,c,s.matcher,s.compiledParams):ie(d,c),h=s.route;if(!m&&u&&r&&!a[a.length-1].route.index&&(m=ie({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!m)return null;Object.assign(n,m.params),i.push({params:n,pathname:H([o,m.pathname]),pathnameBase:ea(H([o,m.pathnameBase])),route:h}),m.pathnameBase!=="/"&&(o=H([o,m.pathnameBase]))}return i}function ie(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Vt(e.path,e.caseSensitive,e.end);return Yt(e,t,r,a)}function Yt(e,t,r,a){let n=t.match(r);if(!n)return null;let o=n[0],i=te(o,1),l=n.slice(1);return{params:a.reduce((u,{paramName:c,isOptional:d},m)=>{if(c==="*"){let y=l[m]||"";i=te(o.slice(0,o.length-y.length),1)}let h=l[m];return d&&!h?u[c]=void 0:u[c]=(h||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Vt(e,t=!1,r=!0){O(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s,u,c)=>{if(a.push({paramName:l,isOptional:s!=null}),s){let d=c.charAt(u+i.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function qr(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return O(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function U(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Jt(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?V(e):e,o;return r?(r=Kt(r),r.startsWith("/")||r.startsWith("\\")?o=At(r.substring(1),"/"):o=At(r,t)):o=t,{pathname:o,search:ta(a),hash:ra(n)}}function At(e,t){let r=te(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function De(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Zr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function $e(e){let t=Zr(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function Se(e,t,r,a=!1){let n;typeof e=="string"?n=V(e):(n={...e},L(!n.pathname||!n.pathname.includes("?"),De("?","pathname","search",n)),L(!n.pathname||!n.pathname.includes("#"),De("#","pathname","hash",n)),L(!n.search||!n.search.includes("#"),De("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,l;if(i==null)l=r;else{let d=t.length-1;if(!a&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),d-=1;n.pathname=m.join("/")}l=d>=0?t[d]:"/"}let s=Jt(n,l),u=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}var Kt=e=>e.replace(/[\\/]{2,}/g,"/"),H=e=>Kt(e.join("/"));function te(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var ea=e=>te(e).replace(/^\/*/,"/"),ta=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ra=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var Gt=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Xt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function aa(e){let t=e.map(r=>r.route.path).filter(Boolean);return H(t)||"/"}var Qt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function qt(e,t){let r=e;if(typeof r!="string"||!Ae.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(Qt)try{let o=new URL(window.location.href),i=Ut.test(r)?new URL(Or(r,o.protocol)):new URL(r),l=U(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch{O(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var Mn=Symbol("Uninstrumented");var On=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var _t=new URL("http://localhost");function Ie(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),_t)}catch{return _t}}function ke(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function na(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function He(e,t,r,a){let n=null;try{n=e==null?null:new URL(e,r)}catch{}let o=new URL(t,r),i=n!=null&&!ke(n,r),l=!ke(o,r);if(a==="reject"){if(i||l)throw new Error("External navigation is not allowed")}else if(l&&(n==null||!na(e,n)||!ke(n,o)))throw new Error("External navigation is not allowed")}var Zt=["POST","PUT","PATCH","DELETE"],An=new Set(Zt),oa=["GET",...Zt],_n=new Set(oa);var $n=Symbol("ResetLoaderData"),ia,la,sa,ua;ia=new WeakMap;la=new WeakMap;sa=new WeakMap;ua=new WeakMap;var ca=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function da(e){try{return ca.includes(new URL(e).protocol)}catch{return!1}}var G=_.createContext(null);G.displayName="DataRouter";var re=_.createContext(null);re.displayName="DataRouterState";var er=_.createContext(!1);function fa(){return _.useContext(er)}var Ue=_.createContext({isTransitioning:!1});Ue.displayName="ViewTransition";var tr=_.createContext(new Map);tr.displayName="Fetchers";var ha=_.createContext(null);ha.displayName="Await";var N=_.createContext(null);N.displayName="Navigation";var X=_.createContext(null);X.displayName="Location";var I=_.createContext({outlet:null,matches:[],isDataRoute:!1});I.displayName="Route";var je=_.createContext(null);je.displayName="RouteError";var Ne=!0,rr="REACT_ROUTER_ERROR",ma="REDIRECT",pa="ROUTE_ERROR_RESPONSE";function ya(e){if(e.startsWith(`${rr}:${ma}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function ga(e){if(e.startsWith(`${rr}:${pa}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Gt(t.status,t.statusText,t.data)}catch{}}function be(e,{relative:t}={}){L(Q(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=g.useContext(N),{hash:n,pathname:o,search:i}=ae(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:H([r,o])),a.createHref({pathname:l,search:i,hash:n})}function Q(){return g.useContext(X)!=null}function T(){return L(Q(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(X).location}function va(){return g.useContext(X).navigationType}var ar="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function nr(e){g.useContext(N).static||g.useLayoutEffect(e)}function q(){let{isDataRoute:e}=g.useContext(I);return e?ka():Ra()}function Ra(){L(Q(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(G),{basename:t,navigator:r}=g.useContext(N),{matches:a}=g.useContext(I),{pathname:n}=T(),o=JSON.stringify($e(a)),i=g.useRef(!1);return nr(()=>{i.current=!0}),g.useCallback((s,u={})=>{if(O(i.current,ar),!i.current)return;if(typeof s=="number"){r.go(s);return}let c=Se(s,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:H([t,c.pathname])),He(typeof s=="string"?s:W(s),r.createHref(c),Ie(r),"reject"),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var In=g.createContext(null);function wa(){let{matches:e}=g.useContext(I);return e[e.length-1]?.params??{}}function ae(e,{relative:t}={}){let{matches:r}=g.useContext(I),{pathname:a}=T(),n=JSON.stringify($e(r));return g.useMemo(()=>Se(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function or(e,t){return ir(e,t)}function ir(e,t,r){L(Q(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=g.useContext(N),{matches:n}=g.useContext(I),o=n[n.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;if(Ne){let f=u&&u.path||"";cr(l,!u||f.endsWith("*")||f.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${f}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
2
2
|
|
|
3
3
|
Please change the parent <Route path="${f}"> to <Route path="${f==="/"?"*":`${f}/*`}">.`)}let c=T(),d;if(t){let f=typeof t=="string"?V(t):t;L(s==="/"||f.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${f.pathname}" was given in the \`location\` prop.`),d=f}else d=c;let m=d.pathname||"/",h=m;if(s!=="/"){let f=s.replace(/^\//,"").split("/");h="/"+m.replace(/^\//,"").split("/").slice(f.length).join("/")}let y=r&&r.state.matches.length?r.state.matches.map(f=>Object.assign(f,{route:r.manifest[f.route.id]||f.route})):_e(e,{pathname:h});Ne&&(O(u||y!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),O(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let p=Pa(y&&y.map(f=>Object.assign({},f,{params:Object.assign({},i,f.params),pathname:H([s,a.encodeLocation?a.encodeLocation(f.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathname]),pathnameBase:f.pathnameBase==="/"?s:H([s,a.encodeLocation?a.encodeLocation(f.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathnameBase])})),n,r);return t&&p?g.createElement(X.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...d},navigationType:"POP"}},p):p}function Sa(){let e=ur(),t=Xt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},i=null;return Ne&&(console.error("Error handled by React Router default ErrorBoundary:",e),i=g.createElement(g.Fragment,null,g.createElement("p",null,"\u{1F4BF} Hey developer \u{1F44B}"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:o},"ErrorBoundary")," or"," ",g.createElement("code",{style:o},"errorElement")," prop on your route."))),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),r?g.createElement("pre",{style:n},r):null,i)}var ba=g.createElement(Sa,null),lr=class extends g.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=ga(e.digest);r&&(e=r)}let t=e!==void 0?g.createElement(I.Provider,{value:this.props.routeContext},g.createElement(je.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?g.createElement(Ea,{error:e},t):t}};lr.contextType=er;var Fe=new WeakMap;function Ea({children:e,error:t}){let{basename:r,navigator:a}=g.useContext(N);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=ya(t.digest);if(n){let o=Fe.get(t);if(o)throw o;let i=qt(n.location,r),l=i.absoluteURL||i.to;if(He(n.location,l,Ie(a),"allow-explicit"),da(l))throw new Error("Invalid redirect location");if(Qt&&!Fe.get(t))if(i.isExternal||n.reloadDocument)window.location.href=l;else{let s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:n.replace}));throw Fe.set(t,s),s}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l}`})}}return e}function xa({routeContext:e,match:t,children:r}){let a=g.useContext(G);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),g.createElement(I.Provider,{value:e},r)}function Pa(e,t=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let n=e,o=a?.errors;if(o!=null){let c=n.findIndex(d=>d.route.id&&o?.[d.route.id]!==void 0);L(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,c+1))}let i=!1,l=-1;if(r&&a){i=a.renderFallback;for(let c=0;c<n.length;c++){let d=n[c];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=c),d.route.id){let{loaderData:m,errors:h}=a,y=d.route.loader&&!m.hasOwnProperty(d.route.id)&&(!h||h[d.route.id]===void 0);if(d.route.lazy||y){r.isStatic&&(i=!0),l>=0?n=n.slice(0,l+1):n=[n[0]];break}}}}let s=r?.onError,u=a&&s?(c,d)=>{s(c,{location:a.location,params:a.matches?.[0]?.params??{},pattern:aa(a.matches),errorInfo:d})}:void 0;return n.reduceRight((c,d,m)=>{let h,y=!1,p=null,f=null;a&&(h=o&&d.route.id?o[d.route.id]:void 0,p=d.route.errorElement||ba,i&&(l<0&&m===0?(cr("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,f=null):l===m&&(y=!0,f=d.route.hydrateFallbackElement||null)));let R=t.concat(n.slice(0,m+1)),w=()=>{let b;return h?b=p:y?b=f:d.route.Component?b=g.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=c,g.createElement(xa,{match:d,routeContext:{outlet:c,matches:R,isDataRoute:a!=null},children:b})};return a&&(d.route.ErrorBoundary||d.route.errorElement||m===0)?g.createElement(lr,{location:a.location,revalidation:a.revalidation,component:p,error:h,children:w(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:u}):w()},null)}function ze(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ca(e){let t=g.useContext(G);return L(t,ze(e)),t}function Be(e){let t=g.useContext(re);return L(t,ze(e)),t}function La(e){let t=g.useContext(I);return L(t,ze(e)),t}function We(e){let t=La(e),r=t.matches[t.matches.length-1];return L(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Da(){return We("useRouteId")}function sr(){let e=Be("useNavigation");return g.useMemo(()=>{let{matches:t,historyAction:r,...a}=e.navigation;return a},[e.navigation])}function Ye(){let{matches:e,loaderData:t}=Be("useMatches");return g.useMemo(()=>e.map(r=>Ur(r,t)),[e,t])}function ur(){let e=g.useContext(je),t=Be("useRouteError"),r=We("useRouteError");return e!==void 0?e:t.errors?.[r]}function ka(){let{router:e}=Ca("useNavigate"),t=We("useNavigate"),r=g.useRef(!1);return nr(()=>{r.current=!0}),g.useCallback(async(n,o={})=>{O(r.current,ar),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var $t={};function cr(e,t,r){!t&&!$t[e]&&($t[e]=!0,O(!1,r))}var Fa="useOptimistic",Hn=x[Fa];var Un=x.memo(Ta);function Ta({routes:e,manifest:t,future:r,state:a,isStatic:n,onError:o}){return ir(e,void 0,{manifest:t,state:a,isStatic:n,onError:o,future:r})}function Na({basename:e,children:t,initialEntries:r,initialIndex:a,useTransitions:n}){let o=x.useRef();o.current==null&&(o.current=jt({initialEntries:r,initialIndex:a,v5Compat:!0}));let i=o.current,[l,s]=x.useState({action:i.action,location:i.location}),u=x.useCallback(c=>{n===!1?s(c):x.startTransition(()=>s(c))},[n]);return x.useLayoutEffect(()=>i.listen(u),[i,u]),x.createElement(Ee,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,useTransitions:n})}function Ma({to:e,replace:t,state:r,relative:a}){L(Q(),"<Navigate> may be used only in the context of a <Router> component.");let{static:n,navigator:o}=x.useContext(N);O(!n,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=x.useContext(I),{pathname:l}=T(),s=q(),u=Se(e,$e(i),l,a==="path");He(typeof e=="string"?e:W(e),o.createHref(u),Ie(o),"reject");let c=JSON.stringify(u);return x.useEffect(()=>{s(JSON.parse(c),{replace:t,state:r,relative:a})},[s,c,a,t,r]),null}function dr(e){L(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Ee({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1,useTransitions:i}){L(!Q(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=x.useMemo(()=>({basename:l,navigator:n,static:o,useTransitions:i,future:{}}),[l,n,o,i]);typeof r=="string"&&(r=V(r));let{pathname:u="/",search:c="",hash:d="",state:m=null,key:h="default",mask:y}=r,p=x.useMemo(()=>{let f=U(u,l);return f==null?null:{location:{pathname:f,search:c,hash:d,state:m,key:h,mask:y},navigationType:a}},[l,u,c,d,m,h,a,y]);return O(p!=null,`<Router basename="${l}"> is not able to match the URL "${u}${c}${d}" because it does not start with the basename, so the <Router> won't render anything.`),p==null?null:x.createElement(N.Provider,{value:s},x.createElement(X.Provider,{children:t,value:p}))}function Oa({children:e,location:t}){return or(Re(e),t)}function Re(e,t=[]){let r=[];return x.Children.forEach(e,(a,n)=>{if(!x.isValidElement(a))return;let o=[...t,n];if(a.type===x.Fragment){r.push.apply(r,Re(a.props.children,o));return}L(a.type===dr,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),L(!a.props.index||!a.props.children,"An index route cannot have child routes.");let i={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(i.children=Re(a.props.children,o)),r.push(i)}),r}var pe="get",ye="application/x-www-form-urlencoded";function xe(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Aa(e){return xe(e)&&e.tagName.toLowerCase()==="button"}function _a(e){return xe(e)&&e.tagName.toLowerCase()==="form"}function $a(e){return xe(e)&&e.tagName.toLowerCase()==="input"}function Ia(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ha(e,t){return e.button===0&&(!t||t==="_self")&&!Ia(e)}function we(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(n=>[r,n]):[[r,a]])},[]))}function Ua(e,t){let r=we(e);return t&&t.forEach((a,n)=>{r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)})}),r}var he=null;function ja(){if(he===null)try{new FormData(document.createElement("form"),0),he=!1}catch{he=!0}return he}var za=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Te(e){return e!=null&&!za.has(e)?(O(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ye}"`),null):e}function Ba(e,t){let r,a,n,o,i;if(_a(e)){let l=e.getAttribute("action");a=l?U(l,t):null,r=e.getAttribute("method")||pe,n=Te(e.getAttribute("enctype"))||ye,o=new FormData(e)}else if(Aa(e)||$a(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(a=s?U(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||pe,n=Te(e.getAttribute("formenctype"))||Te(l.getAttribute("enctype"))||ye,o=new FormData(l,e),!ja()){let{name:u,type:c,value:d}=e;if(c==="image"){let m=u?`${u}.`:"";o.append(`${m}x`,"0"),o.append(`${m}y`,"0")}else u&&o.append(u,d)}}else{if(xe(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=pe,a=null,n=ye,i=e}return o&&n==="text/plain"&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}var jn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Wa={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Ya=/[&><\u2028\u2029]/g;function It(e){return e.replace(Ya,t=>Wa[t])}function Je(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var Va=Symbol("SingleFetchRedirect");function fr(e,t,r,a){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?n.pathname.endsWith("/")?n.pathname=`${n.pathname}_.${a}`:n.pathname=`${n.pathname}.${a}`:n.pathname==="/"?n.pathname=`_root.${a}`:t&&U(n.pathname,t)==="/"?n.pathname=`${te(t)}/_root.${a}`:n.pathname=`${te(n.pathname)}.${a}`,n}async function Ja(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){if(console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode&&import.meta.hot)throw r;return window.location.reload(),new Promise(()=>{})}}function Ka(e){return e!=null&&typeof e.page=="string"}function Ga(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Xa(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await Ja(o,r);return i.links?i.links():[]}return[]}));return en(a.flat(1).filter(Ga).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function Ht(e,t,r,a,n,o){let i=(s,u)=>r[u]?s.route.id!==r[u].route.id:!0,l=(s,u)=>r[u].pathname!==s.pathname||r[u].route.path?.endsWith("*")&&r[u].params["*"]!==s.params["*"];return o==="assets"?t.filter((s,u)=>i(s,u)||l(s,u)):o==="data"?t.filter((s,u)=>{let c=a.routes[s.route.id];if(!c||!c.hasLoader)return!1;if(i(s,u)||l(s,u))return!0;if(s.route.shouldRevalidate){let d=s.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function Qa(e,t,{includeHydrateFallback:r}={}){return qa(e.map(a=>{let n=t.routes[a.route.id];if(!n)return[];let o=[n.module];return n.clientActionModule&&(o=o.concat(n.clientActionModule)),n.clientLoaderModule&&(o=o.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(o=o.concat(n.hydrateFallbackModule)),n.imports&&(o=o.concat(n.imports)),o}).flat(1))}function qa(e){return[...new Set(e)]}function Za(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function en(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!Ka(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let l=JSON.stringify(Za(o));return r.has(l)||(r.add(l),n.push({key:l,link:o})),n},[])}function Ke(){let e=S.useContext(G);return Je(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function nn(){let e=S.useContext(re);return Je(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var le=S.createContext(void 0);le.displayName="FrameworkContext";function Pe(){let e=S.useContext(le);return Je(e,"You must render this element inside a <HydratedRouter> element"),e}function on(e,t){let r=S.useContext(le),[a,n]=S.useState(!1),[o,i]=S.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,m=S.useRef(null);S.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let p=R=>{R.forEach(w=>{i(w.isIntersecting)})},f=new IntersectionObserver(p,{threshold:.5});return m.current&&f.observe(m.current),()=>{f.disconnect()}}},[e]),S.useEffect(()=>{if(a){let p=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(p)}}},[a]);let h=()=>{n(!0)},y=()=>{n(!1),i(!1)};return r?e!=="intent"?[o,m,{}]:[o,m,{onFocus:oe(l,h),onBlur:oe(s,y),onMouseEnter:oe(u,h),onMouseLeave:oe(c,y),onTouchStart:oe(d,h)}]:[!1,m,{}]}function oe(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function mr({page:e,...t}){let r=fa(),{nonce:a}=Pe(),{router:n}=Ke(),o=S.useMemo(()=>_e(n.routes,e,n.basename),[n.routes,e,n.basename]);return o?(t.nonce==null&&a&&(t={...t,nonce:a}),r?S.createElement(sn,{page:e,matches:o,...t}):S.createElement(un,{page:e,matches:o,...t})):null}function ln(e){let{manifest:t,routeModules:r}=Pe(),[a,n]=S.useState([]);return S.useEffect(()=>{let o=!1;return Xa(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function sn({page:e,matches:t,...r}){let a=T(),{future:n}=Pe(),{basename:o}=Ke(),i=S.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let l=fr(e,o,n.v8_trailingSlashAwareDataRequests,"rsc"),s=!1,u=[];for(let c of t)typeof c.route.shouldRevalidate=="function"?s=!0:u.push(c.route.id);return s&&u.length>0&&l.searchParams.set("_routes",u.join(",")),[l.pathname+l.search]},[o,n.v8_trailingSlashAwareDataRequests,e,a,t]);return S.createElement(S.Fragment,null,i.map(l=>S.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...r})))}function un({page:e,matches:t,...r}){let a=T(),{future:n,manifest:o,routeModules:i}=Pe(),{basename:l}=Ke(),{loaderData:s,matches:u}=nn(),c=S.useMemo(()=>Ht(e,t,u,o,a,"data"),[e,t,u,o,a]),d=S.useMemo(()=>Ht(e,t,u,o,a,"assets"),[e,t,u,o,a]),m=S.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let p=new Set,f=!1;if(t.forEach(w=>{let b=o.routes[w.route.id];!b||!b.hasLoader||(!c.some(P=>P.route.id===w.route.id)&&w.route.id in s&&i[w.route.id]?.shouldRevalidate||b.hasClientLoader?f=!0:p.add(w.route.id))}),p.size===0)return[];let R=fr(e,l,n.v8_trailingSlashAwareDataRequests,"data");return f&&p.size>0&&R.searchParams.set("_routes",t.filter(w=>p.has(w.route.id)).map(w=>w.route.id).join(",")),[R.pathname+R.search]},[l,n.v8_trailingSlashAwareDataRequests,s,a,o,c,t,e,i]),h=S.useMemo(()=>Qa(d,o),[d,o]),y=ln(d);return S.createElement(S.Fragment,null,m.map(p=>S.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...r})),h.map(p=>S.createElement("link",{key:p,rel:"modulepreload",href:p,...r})),y.map(({key:p,link:f})=>S.createElement("link",{key:p,nonce:r.nonce,...f,crossOrigin:f.crossOrigin??r.crossOrigin})))}function cn(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var dn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{dn&&(window.__reactRouterVersion="7.18.3")}catch{}function fn({basename:e,children:t,useTransitions:r,window:a}){let n=v.useRef();n.current==null&&(n.current=zt({window:a,v5Compat:!0}));let o=n.current,[i,l]=v.useState({action:o.action,location:o.location}),s=v.useCallback(u=>{r===!1?l(u):v.startTransition(()=>l(u))},[r]);return v.useLayoutEffect(()=>o.listen(s),[o,s]),v.createElement(Ee,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:o,useTransitions:r})}function pr({basename:e,children:t,history:r,useTransitions:a}){let[n,o]=v.useState({action:r.action,location:r.location}),i=v.useCallback(l=>{a===!1?o(l):v.startTransition(()=>o(l))},[a]);return v.useLayoutEffect(()=>r.listen(i),[r,i]),v.createElement(Ee,{basename:e,children:t,location:n.location,navigationType:n.action,navigator:r,useTransitions:a})}pr.displayName="unstable_HistoryRouter";var se=v.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:i,mask:l,state:s,target:u,to:c,preventScrollReset:d,viewTransition:m,defaultShouldRevalidate:h,...y},p){let{basename:f,navigator:R,useTransitions:w}=v.useContext(N),b=typeof c=="string"&&Ae.test(c),P=qt(c,f);c=P.to;let E=be(c,{relative:n}),F=T(),k=null;if(l){let Y=Se(l,[],F.mask?F.mask.pathname:"/",!0);f!=="/"&&(Y.pathname=Y.pathname==="/"?f:H([f,Y.pathname])),k=R.createHref(Y)}let[$,K,B]=on(a,y),ue=wr(c,{replace:i,mask:l,state:s,target:u,preventScrollReset:d,relative:n,viewTransition:m,defaultShouldRevalidate:h,useTransitions:w});function Z(Y){t&&t(Y),Y.defaultPrevented||ue(Y)}let ce=!(P.isExternal||o),rt=v.createElement("a",{...y,...B,href:(ce?k:void 0)||P.absoluteURL||E,onClick:ce?Z:t,ref:cn(p,K),target:u,"data-discover":!b&&r==="render"?"true":void 0});return $&&!b?v.createElement(v.Fragment,null,rt,v.createElement(mr,{page:E})):rt});se.displayName="Link";var yr=v.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:i,viewTransition:l,children:s,...u},c){let d=ae(i,{relative:u.relative}),m=T(),h=v.useContext(re),{navigator:y,basename:p}=v.useContext(N),f=h!=null&&xr(d)&&l===!0,R=y.encodeLocation?y.encodeLocation(d).pathname:d.pathname,w=m.pathname,b=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;r||(w=w.toLowerCase(),b=b?b.toLowerCase():null,R=R.toLowerCase()),b&&p&&(b=U(b,p)||b);let P=R!=="/"&&R.endsWith("/")?R.length-1:R.length,E=w===R||!n&&w.startsWith(R)&&w.charAt(P)==="/",F=b!=null&&(b===R||!n&&b.startsWith(R)&&b.charAt(R.length)==="/"),k={isActive:E,isPending:F,isTransitioning:f},$=E?t:void 0,K;typeof a=="function"?K=a(k):K=[a,E?"active":null,F?"pending":null,f?"transitioning":null].filter(Boolean).join(" ");let B=typeof o=="function"?o(k):o;return v.createElement(se,{...u,"aria-current":$,className:K,ref:c,style:B,to:i,viewTransition:l},typeof s=="function"?s(k):s)});yr.displayName="NavLink";var gr=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:i=pe,action:l,onSubmit:s,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:m,...h},y)=>{let{useTransitions:p}=v.useContext(N),f=Sr(),R=br(l,{relative:u}),w=i.toLowerCase()==="get"?"get":"post",b=typeof l=="string"&&Ae.test(l);return v.createElement("form",{ref:y,method:w,action:R,onSubmit:a?s:E=>{if(s&&s(E),E.defaultPrevented)return;E.preventDefault();let F=E.nativeEvent.submitter,k=F?.getAttribute("formmethod")||i,$=()=>f(F||E.currentTarget,{fetcherKey:t,method:k,navigate:r,replace:n,state:o,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:m});p&&r!==!1?v.startTransition(()=>$()):$()},...h,"data-discover":!b&&e==="render"?"true":void 0})});gr.displayName="Form";function vr({getKey:e,storageKey:t,...r}){let a=v.useContext(le),{basename:n}=v.useContext(N),o=T(),i=Ye();Er({getKey:e,storageKey:t});let l=v.useMemo(()=>{if(!a||!e)return null;let u=Oe(o,i,n,e);return u!==o.key?u:null},[]);if(!a||a.isSpaMode)return null;let s=((u,c)=>{if(!window.history.state||!window.history.state.key){let d=Math.random().toString(32).slice(2);window.history.replaceState({key:d},"")}try{let m=JSON.parse(sessionStorage.getItem(u)||"{}")[c||window.history.state.key];typeof m=="number"&&window.scrollTo(0,m)}catch(d){console.error(d),sessionStorage.removeItem(u)}}).toString();return r.nonce==null&&a?.nonce&&(r.nonce=a.nonce),v.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${It(JSON.stringify(t||Me))}, ${It(JSON.stringify(l))})`}})}vr.displayName="ScrollRestoration";function Rr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ge(e){let t=v.useContext(G);return L(t,Rr(e)),t}function hn(e){let t=v.useContext(re);return L(t,Rr(e)),t}function wr(e,{target:t,replace:r,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s,useTransitions:u}={}){let c=q(),d=T(),m=ae(e,{relative:i});return v.useCallback(h=>{if(Ha(h,t)){h.preventDefault();let y=r!==void 0?r:W(d)===W(m),p=()=>c(e,{replace:y,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s});u?v.startTransition(()=>p()):p()}},[d,c,m,r,a,n,t,e,o,i,l,s,u])}function Xe(e){O(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(we(e)),r=v.useRef(!1),a=T(),n=v.useMemo(()=>Ua(a.search,r.current?null:t.current),[a.search]),o=q(),i=v.useCallback((l,s)=>{let u=we(typeof l=="function"?l(new URLSearchParams(n)):l);r.current=!0,o("?"+u,s)},[o,n]);return[n,i]}var mn=0,pn=()=>`__${String(++mn)}__`;function Sr(){let{router:e}=Ge("useSubmit"),{basename:t}=v.useContext(N),r=Da(),a=e.fetch,n=e.navigate;return v.useCallback(async(o,i={})=>{let{action:l,method:s,encType:u,formData:c,body:d}=Ba(o,t);if(i.navigate===!1){let m=i.fetcherKey||pn();await a(m,r,i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:c,body:d,formMethod:i.method||s,formEncType:i.encType||u,flushSync:i.flushSync})}else await n(i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:c,body:d,formMethod:i.method||s,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[a,n,t,r])}function br(e,{relative:t}={}){let{basename:r}=v.useContext(N),a=v.useContext(I);L(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...ae(e||".",{relative:t})},i=T();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),s=l.getAll("index");if(s.some(c=>c==="")){l.delete("index"),s.filter(d=>d).forEach(d=>l.append("index",d));let c=l.toString();o.search=c?`?${c}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:H([r,o.pathname])),W(o)}var Me="react-router-scroll-positions",me={};function Oe(e,t,r,a){let n=null;return a&&(r!=="/"?n=a({...e,pathname:U(e.pathname,r)||e.pathname},t):n=a(e,t)),n==null&&(n=e.key),n}function Er({getKey:e,storageKey:t}={}){let{router:r}=Ge("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=hn("useScrollRestoration"),{basename:o}=v.useContext(N),i=T(),l=Ye(),s=sr();v.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),yn(v.useCallback(()=>{if(s.state==="idle"){let u=Oe(i,l,o,e);me[u]=window.scrollY}try{sessionStorage.setItem(t||Me,JSON.stringify(me))}catch(u){O(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,l,t])),typeof document<"u"&&(v.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||Me);u&&(me=JSON.parse(u))}catch{}},[t]),v.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(me,()=>window.scrollY,e?(c,d)=>Oe(c,d,o,e):void 0);return()=>u&&u()},[r,o,e]),v.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{O(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}n!==!0&&window.scrollTo(0,0)}},[i,a,n]))}function yn(e,t){let{capture:r}=t||{};v.useEffect(()=>{let a=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,a),()=>{window.removeEventListener("pagehide",e,a)}},[e,r])}function xr(e,{relative:t}={}){let r=v.useContext(Ue);L(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Ge("useViewTransitionState"),n=ae(e,{relative:t});if(!r.isTransitioning)return!1;let o=U(r.currentLocation.pathname,a)||r.currentLocation.pathname,i=U(r.nextLocation.pathname,a)||r.nextLocation.pathname;return ie(n.pathname,i)!=null||ie(n.pathname,o)!=null}var Qe=D(M(),1),Cr=D(Nr(),1);var j=D(ee(),1);function Lr({context:e,own:t}){ne(e.store);let r=ht(),a=ft()?.live??e.store;ne(a);let n=vt();if(!r||a.batches().length===0&&n===0)return null;let o=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(Qe.Suspense,{fallback:null,children:(0,j.jsx)(Ct,{})}),(0,j.jsx)(Qe.Suspense,{fallback:null,children:(0,j.jsx)(Lt,{})})]});return t?(0,Cr.createPortal)(o,t):(0,j.jsx)("div",{className:"graview-bar-own",children:o})}var A=D(M(),1);var J=D(M(),1),gn=(0,J.createContext)(null);function ii(){let e=new Map,t=new Set,r=()=>{for(let a of t)a()};return{count:a=>e.get(a)??0,place(a){return e.set(a,(e.get(a)??0)+1),r(),()=>{e.set(a,(e.get(a)??1)-1),r()}},subscribe(a){return t.add(a),()=>t.delete(a)}}}function Dr(e){let t=(0,J.useContext)(gn);(0,J.useLayoutEffect)(()=>t?.place(e),[t,e])}function li(e,t){return(0,J.useSyncExternalStore)(e.subscribe,()=>e.count(t)>0,()=>!1)}var kr=D(M(),1),z=D(ee(),1),qe="var(--graview-text-small)",Ze="var(--graview-text-body)",mi="var(--graview-font-display, var(--graview-font-body, system-ui))",et={maxWidth:760,margin:"0 auto",padding:"40px var(--graview-page-gutter, 20px) max(96px, calc(var(--graview-foot-room, 0px) + env(safe-area-inset-bottom, 0px)))",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40},tt=1160,pi={...et,maxWidth:tt},Fr={margin:0,fontSize:"var(--graview-text-title)",lineHeight:1.2,letterSpacing:"-0.012em",overflowWrap:"anywhere",textWrap:"balance"},yi={margin:0,fontSize:"var(--graview-text-heading)",lineHeight:1.3,textWrap:"balance"},gi={margin:0,fontSize:qe,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},vi={margin:0,fontSize:Ze,color:"var(--graview-ink-muted)",maxWidth:"60ch"},Tr={color:"var(--graview-ink-muted)",fontSize:qe},Ri={borderTop:"1px solid var(--graview-edge)",paddingTop:24},vn={color:"var(--graview-accent)",textDecorationColor:"color-mix(in srgb, currentColor 50%, transparent)",textDecorationThickness:1,textUnderlineOffset:"0.2em",display:"inline-flex",alignItems:"center",columnGap:"0.3em",minHeight:24},wi={...vn,textDecoration:"none"},Si={color:"inherit",textDecoration:"none",display:"inline-flex",alignItems:"center",minHeight:24},bi=`.graview-list{container-type:inline-size}
|
|
4
4
|
.graview-rows{display:grid;grid-template-columns:minmax(0,1fr);column-gap:1.5rem;margin:0;padding:0;list-style:none;border-top:1px solid var(--graview-edge)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ot}from"./chunk.644FUGSX.js";import"./chunk.NKC3JILT.js";import{e as V,l as ue,n as G,r as st}from"./chunk.HEWVPXRE.js";import{a as ee}from"./chunk.G4JJXA63.js";import"./chunk.LL2MLSPH.js";import{b as nt}from"./chunk.EB4NVTJL.js";import{d as tt}from"./chunk.XU34T2H4.js";import"./chunk.XOZU4OFA.js";import"./chunk.BB33TI4S.js";import"./chunk.2EDC63RI.js";import"./chunk.3YZHZGTM.js";import{d as et}from"./chunk.EQTSV7BK.js";import{c as Ze}from"./chunk.27CW6SCT.js";import{Ad as Xe,K as ze,X as Je,ga as Ye,ja as qe,na as Ae,oa as F,ob as Ve,pb as Qe,zd as Ne}from"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var At="Nothing by that name here.",$=o=>o.normalize("NFD").replace(/\p{M}+/gu,"").toLowerCase().replace(/[’']/g,"'").replace(/[^\p{L}\p{N}' ]+/gu," ").replace(/\s+/g," ").trim(),Nt=/^(?:(?:can you |could you |please )?(?:go|take me|bring me|head|jump|navigate|switch|get me)(?: back)? to|(?:please )?(?:open|show(?: me)?|bring up|let me see|view)) (.+)$/,St=/^(?:(?:can you |could you |please )?tell me (?:about|of)|what(?: is|'s| are) (?:in |on )?|describe|explain|who(?: is|'s)) (.+)$/,Ot=/^(?:what(?: is|'s| am i looking at| do i see)(?: (?:here|this|on (?:this|the) (?:page|screen)|in view|this place|this page))?|where am i|describe (?:this|here|this place|this page)|tell me about (?:this|here|this place|this page))$/,rt=new Set(["here","this","this place","this page","on this page","on the page","on this screen","in view"]),Ct=/^(?:date|day|when|on|at|the date|the day)$/,jt=/^(?:what(?: is|'s) (?:wrong|broken|the (?:problem|matter|trouble))|what needs (?:fixing|attention|doing)|any (?:problems|issues|trouble)|(?:show(?: me)? |go to |open )?(?:the )?(?:problems|issues|trouble|standing|what's wrong)|is (?:anything|something) (?:wrong|broken)|are there (?:any )?(?:problems|issues))(?: (?:with|about|on|in) (.+))?$/,z=o=>o.replace(/^(?:the|a|an|my|our) /,""),te=new Set(["the","a","an","my","our","all","any","of","that","which","who","are","is","be","what","whats","what's","with","me","show","list","every","there","do","i","have","we","due","for","please","were","was","by","from","in","on"]),ft=864e5,he=o=>Date.UTC(Number(o.slice(0,4)),Number(o.slice(5,7))-1,Number(o.slice(8,10))),xe=o=>new Date(o).toISOString().slice(0,10),C=(o,i)=>xe(he(o)+i*ft),xt=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Mt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Wt="(monday|tuesday|tues|wednesday|thursday|thurs|friday|saturday|sunday)",it="(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|jun|jul|aug|sept|sep|oct|nov|dec)",at="(\\d{1,2})(?:st|nd|rd|th)?",Dt=o=>xt.findIndex(i=>i.startsWith(o.slice(0,3))),dt=o=>Mt.findIndex(i=>o.startsWith(i.toLowerCase()));function Rt(o,i){return Je(o,{year:o.slice(0,4)!==i.slice(0,4)})}function Se(o,i,y){if(o<0||i<1||i>31)return;let f=Number(y.slice(0,4)),c=k=>{let j=Date.UTC(k,o,i);return new Date(j).getUTCMonth()===o?xe(j):void 0},p=c(f);if(p)return he(p)<he(y)-183*ft?c(f+1):p}function Oe(o,i,y){let f=new Date(he(i)).getUTCDay(),c=u=>{let S=(f-y+7)%7,w=C(i,-S+u*7);return{from:w,to:C(w,6)}},p=()=>{let u=`${i.slice(0,8)}01`,S=new Date(Date.UTC(Number(i.slice(0,4)),Number(i.slice(5,7)),1));return{from:u,to:C(xe(S.getTime()),-1)}},k=u=>u?{from:u,to:u,day:Rt(u,i)}:void 0,j=(u,S)=>{let w=Dt(S);return k(u==="this"||u==="next"?C(c(u==="next"?1:0).from,(w-y+7)%7):u==="last"?C(i,-((f-w+6)%7+1)):C(i,(w-f+7)%7))},J=u=>{let S=C(i,f===0?-1:6-f);return{from:C(S,u*7),to:C(S,u*7+1)}},B="\\b(?:(?:due |for |on |by )(?:the )?)?",P=[[/\b(?:overdue|past due|late)\b/,()=>({overdue:!0,to:C(i,-1)})],[/\b(?:due |for |on )?today\b/,()=>({from:i,to:i})],[/\b(?:due |for |on )?tomorrow\b/,()=>k(C(i,1))],[/\b(?:due |for |on )?yesterday\b/,()=>k(C(i,-1))],[/\b(?:due |for |on )?this week\b/,()=>c(0)],[/\b(?:due |for |on )?next week\b/,()=>c(1)],[/\b(?:due |for |on )?(?:last|previous) week\b/,()=>c(-1)],[/\b(?:due |for |on )?next weekend\b/,()=>J(1)],[/\b(?:due |for |on )?(?:this |the )?weekend\b/,()=>J(0)],[/\b(?:due |for |on )?this month\b/,()=>p()],[new RegExp(`${B}(\\d{4}) (\\d{2}) (\\d{2})\\b`),u=>k(Se(Number(u[2])-1,Number(u[3]),`${u[1]}-01-01`))],[new RegExp(`${B}${at} (?:of )?${it}\\b`),u=>k(Se(dt(u[2]),Number(u[1]),i))],[new RegExp(`${B}${it} (?:the )?${at}\\b`),u=>k(Se(dt(u[1]),Number(u[2]),i))],[new RegExp(`${B}(?:(this|next|last|coming) )?${Wt}\\b`),u=>j(u[1],u[2])]];for(let[u,S]of P){let w=o.match(u);if(!w)continue;let N=S(w);if(N)return{ask:{words:w[0],...N},rest:o.replace(w[0]," ").replace(/\s+/g," ").trim()}}}function ht(o,i,y={}){let f=y.principal??{kind:"human"},c=o.seenBy(f),p=c.schema,k=y.today??o.today?.()??ze(),j=y.weekStartsOn??1,J=o.kindsKeptFrom(f),B=o.modules.disabledKinds,P=p.kinds.filter(e=>!J.has(e)&&!B.has(e)),u=new Set(P),S=(y.places??[]).filter(e=>e.kind===null||u.has(e.kind)),w=c.graph,N=$(i).replace(/[?.!]+$/,"").trim();if(N.length===0)return{unresolved:!0};let M=e=>p.tryDefinition(e),H=e=>Ye(M(e.kind),e),I=e=>qe(p,e),se=e=>S.find(t=>t.kind===e&&t.address===Ne(p,e))?.address??Ne(p,e),ge=e=>Xe(p,e.kind,e.id),Me=e=>({to:"record",id:e.id,kind:e.kind,label:H(e),address:ge(e),said:`Went to ${H(e)}.`}),We=e=>{let t=`Went to ${e.title}.`;return e.kind===null?{to:"place",slug:e.slug,title:e.title,address:e.address,...e.slug==="overview"?{face:"scene"}:{},said:t}:e.lens||e.address.startsWith("/places/")?{to:"picture",kind:e.kind,as:e.slug,title:e.title,address:e.address,said:t}:{to:"kind",kind:e.kind,title:e.title,address:e.address,said:t}},De=()=>({unresolved:!0,say:At}),oe=e=>{let t=M(e.kind),s=et(e,t,{limit:3,excerpt:!0}).map(r=>r.alone.startsWith(r.label)?r.alone:`${r.label.toLowerCase()} ${r.alone}`).join(", "),n=c.violations().filter(r=>r.nodeIds.includes(e.id));return[`${H(e)} \u2014 ${Ae(F(t,e.kind))}${s?` (${s})`:""}.`,n.length>0?`Trouble: ${n.map(r=>r.message).join("; ")}.`:""].filter(Boolean).join(" ")},re=e=>{let t=new Set([G(e),G(z(e))]);for(let n of[" page"," view"," lens"," place"," picture"," list"])e.endsWith(n)&&(t.add(G(e.slice(0,-n.length))),t.add(G(z(e.slice(0,-n.length)))));t.delete("");let s=n=>t.has(G(n.title))||t.has(G(z($(n.title))))||t.has(G(n.slug));return S.find(n=>n.kind!==null&&n.address.startsWith("/places/")&&s(n))??S.find(s)},pe=e=>{let t=st(o,e,{principal:f,today:k,limit:6,near:!1,...y.selection?{from:y.selection}:{}}),s=t.hits.filter(r=>r.about==="node"&&u.has(r.kind)&&w.getNode(r.id)!==void 0),n=s.filter(r=>r.why.field==="label"&&r.why.strength==="exact");return n.length===1?{one:w.getNode(n[0].id),picks:s}:n.length>1?{picks:n}:s.length===1&&t.total===1?{one:w.getNode(s[0].id),picks:s}:{picks:s}},Re=e=>{let t=e.map(s=>`${s.label} (${F(M(s.kind),s.kind)})`);return`${e.length===1?"One thing matches":`${e.length} things match`}: ${t.join("; ")}.`},Ee=(e,t)=>{if(rt.has(e))return Le();let s=t?pe(z(e)||e):void 0,n=s?.one&&$(H(s.one))===$(z(e)||e)?void 0:re(e);if(n){let l=We(n);return{about:"place",say:t?`${l.said} ${me(n)}`:l.said,moves:[l],subject:n.slug}}let r=pe(z(e)||e);if(r.one){let l=Me(r.one);return{about:t?"describe":"record",say:t?`${l.said} ${oe(r.one)}`:l.said,moves:[l],subject:r.one.id}}if(r.picks.length>0)return{about:"picks",say:Re(r.picks),moves:[],picks:r.picks};let h=ae(e);if(h)return h;let d=Pe(e);if(d){if(d.rest.split(" ").every(l=>l===""||te.has(l))){let l=I(d.kind),v={to:"kind",kind:d.kind,title:l,address:se(d.kind),said:`Went to the ${l.toLowerCase()}.`};return{about:"kind",say:v.said,moves:[v]}}return{unresolved:!0}}return De()},me=e=>{if(e.kind===null){let h=P.map(l=>({kind:l,count:w.nodesOfKind(l).length})).filter(l=>l.count>0).map(l=>`${l.count} ${(l.count===1?F(M(l.kind),l.kind):I(l.kind)).toLowerCase()}`),d=c.violations().length;return[h.length>0?`It holds ${fe(h)}.`:"It holds nothing yet.",d>0?`${d===1?"One problem":`${d} problems`} to see to.`:""].filter(Boolean).join(" ")}let t=w.nodesOfKind(e.kind).length,s=I(e.kind).toLowerCase(),n=new Set(c.violations().flatMap(h=>h.nodeIds)),r=w.nodesOfKind(e.kind).filter(h=>n.has(h.id)).length;return[e.lens?`It draws the ${s} as ${Ae(e.lens)}${t>0?` \u2014 ${t} of them`:""}.`:`${t===0?"No":t} ${t===1?F(M(e.kind),e.kind):s} ${t===1?"is":"are"} here.`,r>0?`${r} ${r===1?"has":"have"} a problem.`:""].filter(Boolean).join(" ")},Le=()=>{let e=(y.selection??[]).map(s=>w.getNode(s)).find(s=>s!==void 0);if(e)return{about:"here",say:oe(e),moves:[],subject:e.id};let t=S.find(s=>s.slug===y.place)??S.find(s=>s.slug==="home");return t?{about:"here",say:`${t.title}. ${me(t)}`,moves:[],subject:t.slug}:{about:"here",say:me({slug:"home",title:"Home",kind:null,cardinality:"many",address:"/",stop:"#"}),moves:[]}},Pe=e=>{let t=P.flatMap(s=>[I(s),F(M(s),s),s].map(n=>({kind:s,name:$(n)}))).filter(s=>s.name.length>0).sort((s,n)=>n.name.length-s.name.length);for(let{kind:s,name:n}of t)if(!(` ${e} `.indexOf(` ${n} `)<0))return{kind:s,rest:` ${e} `.replace(` ${n} `," ").replace(/\s+/g," ").trim()}},ie=(e,t)=>{let s=V(p,e).filters.filter(d=>d.about==="field"&&d.type==="date");if(s.length===0)return;let n=s.find(d=>t.some(l=>$(d.key)===l||$(d.label)===l));if(n)return n;let r=M(e)?.fieldRoles??{};for(let d of["due","deadline","date","when","start","end"]){let l=r[d],v=l?s.find(x=>x.key===l):void 0;if(v)return v}return s.find(d=>["due","deadline","date","when","on","at"].includes(d.key.toLowerCase()))??(s.length===1?s[0]:void 0)},He=e=>{let t=M(e),s=V(p,e).filters;if(t?.lifecycle)return{conditions:[{key:"is",value:"current"}],holds:d=>ue(be,d,{key:"is",value:"current"})};let r=s.find(d=>d.about==="field"&&d.type==="boolean"&&ne.has($(d.key)));if(r)return{conditions:[{key:r.key,value:"false"}],holds:d=>d[r.key]!==!0};let h=s.find(d=>d.about==="field"&&d.type==="choice"&&(d.options??[]).some(l=>ne.has($(l))));if(h){let d=new Set((h.options??[]).filter(v=>ne.has($(v)))),l=(h.options??[]).filter(v=>!d.has(v));return l.length===1?{conditions:[{key:h.key,value:l[0]}],holds:v=>v[h.key]===l[0]}:"unsayable"}return{conditions:[],holds:()=>!0}},Ie=(e,t)=>{let s=e.words.startsWith("due")||$(t.key)==="due",n=Ct.test($(t.label));if(e.day)return s?`due ${e.day}`:n?`on ${e.day}`:`${t.label.toLowerCase()} on ${e.day}`;let r=e.words.replace(/^(?:due|for|on|by) (?:the )?/,"");return s?`due ${r}`:n?r:`${t.label.toLowerCase()} ${r}`},ye=new Set(c.violations().flatMap(e=>e.nodeIds)),be={schema:p,graph:c.graph,flagged:ye,today:k},ae=e=>{let t=Oe(e,k,j),s=Pe(t?.rest??e),n=s?.kind,r=(s?.rest??t?.rest??e).split(" ").filter(Boolean);if(!n&&t){let g=e.split(" "),m=P.filter(L=>ie(L,g)!==void 0),E=m.filter(L=>{let b=ie(L,g);return g.some(O=>$(b.key)===O||$(b.label)===O)}),U=m.length===1?m:E;if(U.length!==1)return;n=U[0]}if(!n)return;let h=V(p,n).filters,d=[],l=[],v=[],x=[],q=!1,de=[];for(let g=0;g<r.length;g++){let m=r[g],E=g>0&&(r[g-1]==="not"||r[g-1]==="un"),U=h.find(b=>b.about==="field"&&b.type==="choice"&&(b.options??[]).some(O=>$(O)===m));if(U&&!E){let b=(U.options??[]).find(O=>$(O)===m);d.push({key:U.key,value:b}),l.push(b);continue}let L=h.find(b=>b.about==="field"&&b.type==="boolean"&&[$(b.key),$(b.label)].some(O=>O===m||O===m.replace(/^un/,"")));if(L){let b=!E&&!(m.startsWith("un")&&!$(L.key).startsWith("un"));d.push({key:L.key,value:String(b)}),l.push(b?m:`not ${m.replace(/^un/,"")}`);continue}if(Pt.has(m)&&!E){let b=He(n);b==="unsayable"?(q=!0,x.push(O=>!ut(p,O))):(d.push(...b.conditions),x.push(b.holds)),l.push(m);continue}m==="not"||m==="un"||t&&h.some(b=>b.type==="date"&&($(b.key)===m||$(b.label)===m))||de.push(m)}if(r=de,r.some(g=>!te.has(g))||!t&&d.length===0&&x.length===0)return;let T=I(n).toLowerCase(),Q=I(n);if(t){let g=ie(n,e.split(" "));if(!g){let m={to:"kind",kind:n,title:Q,address:se(n),said:`Went to the ${T}.`};return{about:"kind",say:`${ee(Q)} carry no date, so I can't tell which are ${/^(?:due|for|on|overdue|past due|late)\b/.test(t.ask.words)?t.ask.words:`due ${t.ask.words}`}. ${m.said}`,moves:[m]}}if(t.ask.from&&d.push({key:g.key,value:`after:${C(t.ask.from,-1)}`}),t.ask.to&&d.push({key:g.key,value:`before:${C(t.ask.to,1)}`}),t.ask.overdue){let m=He(n);m==="unsayable"?(q=!0,x.push(E=>!ut(p,E))):(d.push(...m.conditions),x.push(m.holds))}t.ask.overdue?l.push("overdue"):v.push(Ie(t.ask,g))}let R=w.nodesOfKind(n).filter(g=>d.every(m=>ue(be,g,m))&&x.every(m=>m(g))),K=[...l,...v].join(" and "),Y=[...l,T,...v].join(" "),W=R.slice(0,6).map(g=>({about:"node",id:g.id,kind:n,label:H(g),why:{field:d[0]?.key??"label",reading:d[0]?.key??"Name",fragment:K,strength:"field"},current:!0,flagged:ye.has(g.id),address:ge(g)})),X=R.length===0?`No ${T} are ${K}.`:`${R.length===1?`One ${F(M(n),n)} is`:`${R.length} ${T} are`} ${K}: ${fe(R.slice(0,6).map(H))}${R.length>6?`, and ${R.length-6} more`:""}.`;if(q)return{about:"kind",say:X,moves:[],picks:W,offer:{draft:Y,label:"Show as a view"}};let Z=d.map(g=>`${g.key}:${g.value}`).join(","),we=`${se(n)}?${new URLSearchParams({filter:Z}).toString()}`,_={to:"kind",kind:n,title:ee(Y),filter:Z,address:we,said:`Went to the ${Y}.`};return{about:"kind",say:`${_.said} ${X}`,moves:[_],picks:W}},Te=e=>M(e)?.figure==="person"?!0:[e,F(M(e),e),I(e)].some(s=>$(s).split(" ").some(n=>Et.has(n))),pt=e=>{let t=[],s=n=>M(n)?.edges??{};for(let[n,r]of Object.entries(s(e)))for(let h of r.to??[])u.has(h)&&t.push({key:n,direction:"out",far:h,words:ct(`${r.description??""} ${n}`)});for(let n of P)for(let[r,h]of Object.entries(s(n)))(h.to??[]).includes(e)&&t.push({key:r,direction:"in",far:n,words:ct(`${h.inverse??""} ${r}`)});return t},mt=e=>{let t=e.match(/^(who|which|what)\b/)?.[1];if(!t)return;let s=Oe(e,k,j);if(!s||s.ask.overdue)return;let n=s.rest.split(" ").filter(Boolean),r=P.flatMap(a=>[I(a),F(M(a),a),a].map(A=>({kind:a,name:$(A)}))).filter(a=>a.name.length>0).sort((a,A)=>A.name.length-a.name.length),h=` ${n.join(" ")} `,d=[];for(let{kind:a,name:A}of r)h.includes(` ${A} `)&&(h=h.replace(` ${A} `," "),d.includes(a)||d.push(a));let l=h.match(/\b(?:is|are|was|were)\b|'s\b/)?.[0],v=h.replace(/'s\b/g," ").split(" ").filter(a=>a.length>0&&!te.has(a)&&!Ce.has(a)),x=t==="who"?d.find(Te):d[0];if(!x&&t!=="who")return;let q=d.find(a=>a!==x),de=v.flatMap(a=>[je(a),...lt.has(je(a))?[...lt]:[]]),T=P.filter(a=>q?a===q:a!==x).flatMap(a=>{let A=ie(a,e.split(" "))??V(p,a).filters.find(D=>D.about==="field"&&D.type==="date");return A?pt(a).filter(D=>(x?D.far===x:Te(D.far))&&D.far!==a).map(D=>({kind:a,field:A,relation:D,said:v.length===0||de.some(ve=>D.words.some(vt=>Lt(vt,ve)))})):[]}).filter(a=>a.said);if(T.length===0)return;let Q=T.filter(a=>n.some(A=>$(a.field.key)===A||$(a.field.label)===A)),R=T.length===1?T[0]:Q.length===1?Q[0]:void 0;if(!R)return;let{kind:K,field:Y,relation:W}=R,X=[...s.ask.from?[{key:Y.key,value:`after:${C(s.ask.from,-1)}`}]:[],...s.ask.to?[{key:Y.key,value:`before:${C(s.ask.to,1)}`}]:[]],Z=w.nodesOfKind(K).filter(a=>X.every(A=>ue(be,a,A))),we=a=>(W.direction==="out"?c.graph.out(a.id,W.key):c.graph.in(a.id,W.key)).filter(A=>A.kind===W.far&&u.has(W.far)),_=[],g=[];for(let a of Z){let A=we(a);A.length===0&&g.push(a);for(let D of A)_.some(ve=>ve.id===D.id)||_.push(D)}let m=Ie(s.ask,Y),E=s.ask.day?`On ${s.ask.day}`:ee(s.ask.words.replace(/^(?:due|for|on|by) (?:the )?/,"")),U=I(K).toLowerCase(),L=X.map(a=>`${a.key}:${a.value}`).join(","),b=`${U} ${m}`,O={to:"kind",kind:K,title:ee(b),filter:L,address:`${se(K)}?${new URLSearchParams({filter:L}).toString()}`,said:`Went to the ${b}.`};if(Z.length===0)return{about:"related",say:`No ${b}. ${O.said}`,moves:[O]};let le=v.join(" "),yt=l==="was"||l==="were",Ge=a=>yt?a===1?"was":"were":a===1?"is":"are",ce=_.map(H),bt=ce.length>8?[...ce.slice(0,8),`${ce.length-8} more`]:ce,kt=_.length===0?`${E}: nobody ${Ge(1)}${le?` ${le}`:""}.`:`${E}: ${fe(bt)}${le?` ${Ge(_.length)} ${le}`:""}.`,$t=t==="who"&&g.length>0?`${fe(g.slice(0,4).map(H))}${g.length>4?` and ${g.length-4} more`:""} ${g.length===1?"has":"have"} nobody.`:"",wt=_.slice(0,8).map(a=>({about:"node",id:a.id,kind:a.kind,label:H(a),why:{field:W.key,reading:Ze(p,W.direction==="out"?K:W.far,W.key,W.direction==="out"?"out":"in"),fragment:m,strength:"field"},current:!0,flagged:ye.has(a.id),address:ge(a)}));return{about:"related",say:[kt,$t,O.said].filter(Boolean).join(" "),moves:[O],picks:wt}},Ke=N.match(jt);if(Ke){let e=Ke[1];if(e&&!rt.has(e)&&!/^(?:it|this|that)$/.test(e)){let n=re(e),r=n?void 0:pe(z(e)||e);if(r?.one){let h=Me(r.one);return{about:"describe",say:`${h.said} ${oe(r.one)}`,moves:[h],subject:r.one.id}}if(!n)return r&&r.picks.length>0?{about:"picks",say:Re(r.picks),moves:[],picks:r.picks}:De()}if(e&&/^(?:it|this|that)$|^(?:here|this place|this page)$/.test(e)){let n=(y.selection??[]).map(r=>w.getNode(r)).find(r=>r!==void 0);if(n)return{about:"describe",say:oe(n),moves:[],subject:n.id}}let t=c.violations();if(t.length===0)return{about:"problems",say:"Nothing is wrong \u2014 every rule holds.",moves:[]};let s={to:"problems",address:"/problems",said:"Went to the problems."};return{about:"problems",say:`${s.said} ${Qe(t)}: ${t.slice(0,4).map(n=>n.message).join("; ")}${t.length>4?"\u2026":"."}`,moves:[s]}}if(Ot.test(N))return Le();let _e=mt(N);if(_e)return _e;let ke=Oe(N,k,j);if(ke&&!re(z(ke.ask.words))&&ke.rest.replace(/'s\b/g,"").split(" ").every(e=>e===""||te.has(e)||Ce.has(e))){let e=ae(N);if(e)return e}if(/^open /.test(N)){let e=ae(N);if(e)return e}let Fe=N.match(Nt)??N.match(/^(?:go|take me|head|get me)(?: back)? (home)$/);if(Fe)return Ee(Fe[1].trim(),!1);let Be=N.match(St);if(Be){let e=Ee(Be[1].trim(),!0);return"unresolved"in e&&e.unresolved&&!/^tell me|^describe/.test(N)?{unresolved:!0}:e}let $e=re(N);if($e){let e=We($e);return{about:"place",say:e.said,moves:[e],subject:$e.slug}}let Ue=ae(N);return Ue||{unresolved:!0}}var Ce=new Set(["who","whom","whose","which","what","whats","what's","who's"]),Et=new Set(["person","people","user","users","member","members","volunteer","volunteers","gardener","gardeners","player","players","staff","worker","workers","employee","employees","owner","owners","assignee","assignees","helper","helpers","student","students","teacher","teachers","customer","customers","client","clients","contact","contacts","author","authors"]),lt=new Set(["work","cover","staff","assign","do","run","schedul","roster","book","duty","serv","help"]);function je(o){let i=o.toLowerCase().replace(/'s$/,"");for(let y of["ing","ed","es","s"])if(i.length>y.length+2&&i.endsWith(y)){let f=i.slice(0,-y.length);return f.length>3&&f[f.length-1]===f[f.length-2]?f.slice(0,-1):f}return i}function ct(o){return o.toLowerCase().split(/[^a-z']+/).filter(i=>i.length>1&&!te.has(i)&&!Ce.has(i)&&!["it","they","them","their","its","this","here","to","at"].includes(i)).map(je)}var Lt=(o,i)=>o===i||o.length>=4&&i.length>=4&&(o.startsWith(i)||i.startsWith(o)),ne=new Set(["done","finished","complete","completed","closed","resolved","agreed","canceled","archived","shipped","delivered"]),Pt=new Set(["open","unfinished","outstanding","pending","remaining","undone","incomplete"]);function ut(o,i){return V(o,i.kind).filters.some(f=>f.about==="field"&&(f.type==="boolean"&&ne.has(f.key.toLowerCase())&&i[f.key]===!0||f.type==="choice"&&typeof i[f.key]=="string"&&ne.has(String(i[f.key]).toLowerCase())))}function fe(o){return o.length<=1?o[0]??"":`${o.slice(0,-1).join(", ")} and ${o[o.length-1]}`}function zt(o,i,y={}){let f=y.scene!==void 0?{...y.pages,scene:y.scene}:y.pages;return[...nt(o,i,f?{pages:f}:{})].map(({first:c,hidden:p,lens:k,...j})=>j)}function gt(o,i){return{...o.principal?{principal:o.principal}:{},...o.places?{places:o.places}:{},...o.selection?{selection:o.selection}:{},...o.place?{place:o.place}:{},...i??o.today?{today:i??o.today}:{},...o.weekStartsOn!==void 0?{weekStartsOn:o.weekStartsOn}:{}}}function Jt(o,i,y,f){let c=ht(o,i,gt(y,f));if(c.unresolved)return c.say?{reply:{say:c.say,proposals:[],grounded:!0}}:{};if(c.about==="picks")return{};let p=c.moves.length>0?{moves:c.moves}:{},k=c.subject?o.graph.getNode(c.subject):void 0;if(c.about==="problems")return{...p,problems:!0};if(k&&(c.about==="describe"||c.about==="here"))return{...p,told:k.id};let j=k?tt(o,ot(Ve(o.violations(),[k.id])).slice(0,3)):[];return{reply:{say:c.say,proposals:j,grounded:!0,...p,...c.picks&&c.picks.length>0?{picks:c.picks}:{},...c.offer?{offer:c.offer}:{}}}}function Yt(o,i,y={}){let f=gt(y),c=[];for(let p of i){let k=typeof p=="string"?p:typeof p=="object"&&p!==null&&typeof p.to=="string"?p.to:void 0;if(!k||k.trim().length===0)continue;let j=ht(o,/^(?:go|take me|open|show)\b/i.test(k.trim())?k:`go to ${k}`,f);if("moves"in j)for(let J of j.moves)c.some(B=>B.address===J.address)||c.push(J)}return c}export{At as NOTHING_BY_THAT_NAME,gt as askContextOf,Jt as goingFrom,Yt as movesFromNames,zt as placesFromViews,ht as resolveAsk};
|
|
1
|
+
import{a as ot}from"./chunk.644FUGSX.js";import"./chunk.E22DDEQI.js";import{e as V,l as ue,n as G,r as st}from"./chunk.OLW44AP5.js";import{a as ee}from"./chunk.G4JJXA63.js";import"./chunk.LDYOQCY7.js";import{b as nt}from"./chunk.VFRURRNI.js";import{d as tt}from"./chunk.2NJDT47T.js";import"./chunk.XOZU4OFA.js";import"./chunk.MHILFBK6.js";import"./chunk.ZFH4SCCF.js";import"./chunk.NSGQXCH6.js";import{d as et}from"./chunk.SZG6HJWH.js";import{c as Ze}from"./chunk.2FOIJ5ID.js";import{Bd as Ne,Cd as Xe,K as ze,X as Je,ga as Ye,ja as qe,na as Ae,oa as F,ob as Ve,pb as Qe}from"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var At="Nothing by that name here.",$=o=>o.normalize("NFD").replace(/\p{M}+/gu,"").toLowerCase().replace(/[’']/g,"'").replace(/[^\p{L}\p{N}' ]+/gu," ").replace(/\s+/g," ").trim(),Nt=/^(?:(?:can you |could you |please )?(?:go|take me|bring me|head|jump|navigate|switch|get me)(?: back)? to|(?:please )?(?:open|show(?: me)?|bring up|let me see|view)) (.+)$/,St=/^(?:(?:can you |could you |please )?tell me (?:about|of)|what(?: is|'s| are) (?:in |on )?|describe|explain|who(?: is|'s)) (.+)$/,Ot=/^(?:what(?: is|'s| am i looking at| do i see)(?: (?:here|this|on (?:this|the) (?:page|screen)|in view|this place|this page))?|where am i|describe (?:this|here|this place|this page)|tell me about (?:this|here|this place|this page))$/,rt=new Set(["here","this","this place","this page","on this page","on the page","on this screen","in view"]),Ct=/^(?:date|day|when|on|at|the date|the day)$/,jt=/^(?:what(?: is|'s) (?:wrong|broken|the (?:problem|matter|trouble))|what needs (?:fixing|attention|doing)|any (?:problems|issues|trouble)|(?:show(?: me)? |go to |open )?(?:the )?(?:problems|issues|trouble|standing|what's wrong)|is (?:anything|something) (?:wrong|broken)|are there (?:any )?(?:problems|issues))(?: (?:with|about|on|in) (.+))?$/,z=o=>o.replace(/^(?:the|a|an|my|our) /,""),te=new Set(["the","a","an","my","our","all","any","of","that","which","who","are","is","be","what","whats","what's","with","me","show","list","every","there","do","i","have","we","due","for","please","were","was","by","from","in","on"]),ft=864e5,he=o=>Date.UTC(Number(o.slice(0,4)),Number(o.slice(5,7))-1,Number(o.slice(8,10))),xe=o=>new Date(o).toISOString().slice(0,10),C=(o,i)=>xe(he(o)+i*ft),xt=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Mt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Wt="(monday|tuesday|tues|wednesday|thursday|thurs|friday|saturday|sunday)",it="(january|february|march|april|may|june|july|august|september|october|november|december|jan|feb|mar|apr|jun|jul|aug|sept|sep|oct|nov|dec)",at="(\\d{1,2})(?:st|nd|rd|th)?",Dt=o=>xt.findIndex(i=>i.startsWith(o.slice(0,3))),dt=o=>Mt.findIndex(i=>o.startsWith(i.toLowerCase()));function Rt(o,i){return Je(o,{year:o.slice(0,4)!==i.slice(0,4)})}function Se(o,i,y){if(o<0||i<1||i>31)return;let f=Number(y.slice(0,4)),c=k=>{let j=Date.UTC(k,o,i);return new Date(j).getUTCMonth()===o?xe(j):void 0},p=c(f);if(p)return he(p)<he(y)-183*ft?c(f+1):p}function Oe(o,i,y){let f=new Date(he(i)).getUTCDay(),c=u=>{let S=(f-y+7)%7,w=C(i,-S+u*7);return{from:w,to:C(w,6)}},p=()=>{let u=`${i.slice(0,8)}01`,S=new Date(Date.UTC(Number(i.slice(0,4)),Number(i.slice(5,7)),1));return{from:u,to:C(xe(S.getTime()),-1)}},k=u=>u?{from:u,to:u,day:Rt(u,i)}:void 0,j=(u,S)=>{let w=Dt(S);return k(u==="this"||u==="next"?C(c(u==="next"?1:0).from,(w-y+7)%7):u==="last"?C(i,-((f-w+6)%7+1)):C(i,(w-f+7)%7))},J=u=>{let S=C(i,f===0?-1:6-f);return{from:C(S,u*7),to:C(S,u*7+1)}},B="\\b(?:(?:due |for |on |by )(?:the )?)?",P=[[/\b(?:overdue|past due|late)\b/,()=>({overdue:!0,to:C(i,-1)})],[/\b(?:due |for |on )?today\b/,()=>({from:i,to:i})],[/\b(?:due |for |on )?tomorrow\b/,()=>k(C(i,1))],[/\b(?:due |for |on )?yesterday\b/,()=>k(C(i,-1))],[/\b(?:due |for |on )?this week\b/,()=>c(0)],[/\b(?:due |for |on )?next week\b/,()=>c(1)],[/\b(?:due |for |on )?(?:last|previous) week\b/,()=>c(-1)],[/\b(?:due |for |on )?next weekend\b/,()=>J(1)],[/\b(?:due |for |on )?(?:this |the )?weekend\b/,()=>J(0)],[/\b(?:due |for |on )?this month\b/,()=>p()],[new RegExp(`${B}(\\d{4}) (\\d{2}) (\\d{2})\\b`),u=>k(Se(Number(u[2])-1,Number(u[3]),`${u[1]}-01-01`))],[new RegExp(`${B}${at} (?:of )?${it}\\b`),u=>k(Se(dt(u[2]),Number(u[1]),i))],[new RegExp(`${B}${it} (?:the )?${at}\\b`),u=>k(Se(dt(u[1]),Number(u[2]),i))],[new RegExp(`${B}(?:(this|next|last|coming) )?${Wt}\\b`),u=>j(u[1],u[2])]];for(let[u,S]of P){let w=o.match(u);if(!w)continue;let N=S(w);if(N)return{ask:{words:w[0],...N},rest:o.replace(w[0]," ").replace(/\s+/g," ").trim()}}}function ht(o,i,y={}){let f=y.principal??{kind:"human"},c=o.seenBy(f),p=c.schema,k=y.today??o.today?.()??ze(),j=y.weekStartsOn??1,J=o.kindsKeptFrom(f),B=o.modules.disabledKinds,P=p.kinds.filter(e=>!J.has(e)&&!B.has(e)),u=new Set(P),S=(y.places??[]).filter(e=>e.kind===null||u.has(e.kind)),w=c.graph,N=$(i).replace(/[?.!]+$/,"").trim();if(N.length===0)return{unresolved:!0};let M=e=>p.tryDefinition(e),H=e=>Ye(M(e.kind),e),I=e=>qe(p,e),se=e=>S.find(t=>t.kind===e&&t.address===Ne(p,e))?.address??Ne(p,e),ge=e=>Xe(p,e.kind,e.id),Me=e=>({to:"record",id:e.id,kind:e.kind,label:H(e),address:ge(e),said:`Went to ${H(e)}.`}),We=e=>{let t=`Went to ${e.title}.`;return e.kind===null?{to:"place",slug:e.slug,title:e.title,address:e.address,...e.slug==="overview"?{face:"scene"}:{},said:t}:e.lens||e.address.startsWith("/places/")?{to:"picture",kind:e.kind,as:e.slug,title:e.title,address:e.address,said:t}:{to:"kind",kind:e.kind,title:e.title,address:e.address,said:t}},De=()=>({unresolved:!0,say:At}),oe=e=>{let t=M(e.kind),s=et(e,t,{limit:3,excerpt:!0}).map(r=>r.alone.startsWith(r.label)?r.alone:`${r.label.toLowerCase()} ${r.alone}`).join(", "),n=c.violations().filter(r=>r.nodeIds.includes(e.id));return[`${H(e)} \u2014 ${Ae(F(t,e.kind))}${s?` (${s})`:""}.`,n.length>0?`Trouble: ${n.map(r=>r.message).join("; ")}.`:""].filter(Boolean).join(" ")},re=e=>{let t=new Set([G(e),G(z(e))]);for(let n of[" page"," view"," lens"," place"," picture"," list"])e.endsWith(n)&&(t.add(G(e.slice(0,-n.length))),t.add(G(z(e.slice(0,-n.length)))));t.delete("");let s=n=>t.has(G(n.title))||t.has(G(z($(n.title))))||t.has(G(n.slug));return S.find(n=>n.kind!==null&&n.address.startsWith("/places/")&&s(n))??S.find(s)},pe=e=>{let t=st(o,e,{principal:f,today:k,limit:6,near:!1,...y.selection?{from:y.selection}:{}}),s=t.hits.filter(r=>r.about==="node"&&u.has(r.kind)&&w.getNode(r.id)!==void 0),n=s.filter(r=>r.why.field==="label"&&r.why.strength==="exact");return n.length===1?{one:w.getNode(n[0].id),picks:s}:n.length>1?{picks:n}:s.length===1&&t.total===1?{one:w.getNode(s[0].id),picks:s}:{picks:s}},Re=e=>{let t=e.map(s=>`${s.label} (${F(M(s.kind),s.kind)})`);return`${e.length===1?"One thing matches":`${e.length} things match`}: ${t.join("; ")}.`},Ee=(e,t)=>{if(rt.has(e))return Le();let s=t?pe(z(e)||e):void 0,n=s?.one&&$(H(s.one))===$(z(e)||e)?void 0:re(e);if(n){let l=We(n);return{about:"place",say:t?`${l.said} ${me(n)}`:l.said,moves:[l],subject:n.slug}}let r=pe(z(e)||e);if(r.one){let l=Me(r.one);return{about:t?"describe":"record",say:t?`${l.said} ${oe(r.one)}`:l.said,moves:[l],subject:r.one.id}}if(r.picks.length>0)return{about:"picks",say:Re(r.picks),moves:[],picks:r.picks};let h=ae(e);if(h)return h;let d=Pe(e);if(d){if(d.rest.split(" ").every(l=>l===""||te.has(l))){let l=I(d.kind),v={to:"kind",kind:d.kind,title:l,address:se(d.kind),said:`Went to the ${l.toLowerCase()}.`};return{about:"kind",say:v.said,moves:[v]}}return{unresolved:!0}}return De()},me=e=>{if(e.kind===null){let h=P.map(l=>({kind:l,count:w.nodesOfKind(l).length})).filter(l=>l.count>0).map(l=>`${l.count} ${(l.count===1?F(M(l.kind),l.kind):I(l.kind)).toLowerCase()}`),d=c.violations().length;return[h.length>0?`It holds ${fe(h)}.`:"It holds nothing yet.",d>0?`${d===1?"One problem":`${d} problems`} to see to.`:""].filter(Boolean).join(" ")}let t=w.nodesOfKind(e.kind).length,s=I(e.kind).toLowerCase(),n=new Set(c.violations().flatMap(h=>h.nodeIds)),r=w.nodesOfKind(e.kind).filter(h=>n.has(h.id)).length;return[e.lens?`It draws the ${s} as ${Ae(e.lens)}${t>0?` \u2014 ${t} of them`:""}.`:`${t===0?"No":t} ${t===1?F(M(e.kind),e.kind):s} ${t===1?"is":"are"} here.`,r>0?`${r} ${r===1?"has":"have"} a problem.`:""].filter(Boolean).join(" ")},Le=()=>{let e=(y.selection??[]).map(s=>w.getNode(s)).find(s=>s!==void 0);if(e)return{about:"here",say:oe(e),moves:[],subject:e.id};let t=S.find(s=>s.slug===y.place)??S.find(s=>s.slug==="home");return t?{about:"here",say:`${t.title}. ${me(t)}`,moves:[],subject:t.slug}:{about:"here",say:me({slug:"home",title:"Home",kind:null,cardinality:"many",address:"/",stop:"#"}),moves:[]}},Pe=e=>{let t=P.flatMap(s=>[I(s),F(M(s),s),s].map(n=>({kind:s,name:$(n)}))).filter(s=>s.name.length>0).sort((s,n)=>n.name.length-s.name.length);for(let{kind:s,name:n}of t)if(!(` ${e} `.indexOf(` ${n} `)<0))return{kind:s,rest:` ${e} `.replace(` ${n} `," ").replace(/\s+/g," ").trim()}},ie=(e,t)=>{let s=V(p,e).filters.filter(d=>d.about==="field"&&d.type==="date");if(s.length===0)return;let n=s.find(d=>t.some(l=>$(d.key)===l||$(d.label)===l));if(n)return n;let r=M(e)?.fieldRoles??{};for(let d of["due","deadline","date","when","start","end"]){let l=r[d],v=l?s.find(x=>x.key===l):void 0;if(v)return v}return s.find(d=>["due","deadline","date","when","on","at"].includes(d.key.toLowerCase()))??(s.length===1?s[0]:void 0)},He=e=>{let t=M(e),s=V(p,e).filters;if(t?.lifecycle)return{conditions:[{key:"is",value:"current"}],holds:d=>ue(be,d,{key:"is",value:"current"})};let r=s.find(d=>d.about==="field"&&d.type==="boolean"&&ne.has($(d.key)));if(r)return{conditions:[{key:r.key,value:"false"}],holds:d=>d[r.key]!==!0};let h=s.find(d=>d.about==="field"&&d.type==="choice"&&(d.options??[]).some(l=>ne.has($(l))));if(h){let d=new Set((h.options??[]).filter(v=>ne.has($(v)))),l=(h.options??[]).filter(v=>!d.has(v));return l.length===1?{conditions:[{key:h.key,value:l[0]}],holds:v=>v[h.key]===l[0]}:"unsayable"}return{conditions:[],holds:()=>!0}},Ie=(e,t)=>{let s=e.words.startsWith("due")||$(t.key)==="due",n=Ct.test($(t.label));if(e.day)return s?`due ${e.day}`:n?`on ${e.day}`:`${t.label.toLowerCase()} on ${e.day}`;let r=e.words.replace(/^(?:due|for|on|by) (?:the )?/,"");return s?`due ${r}`:n?r:`${t.label.toLowerCase()} ${r}`},ye=new Set(c.violations().flatMap(e=>e.nodeIds)),be={schema:p,graph:c.graph,flagged:ye,today:k},ae=e=>{let t=Oe(e,k,j),s=Pe(t?.rest??e),n=s?.kind,r=(s?.rest??t?.rest??e).split(" ").filter(Boolean);if(!n&&t){let g=e.split(" "),m=P.filter(L=>ie(L,g)!==void 0),E=m.filter(L=>{let b=ie(L,g);return g.some(O=>$(b.key)===O||$(b.label)===O)}),U=m.length===1?m:E;if(U.length!==1)return;n=U[0]}if(!n)return;let h=V(p,n).filters,d=[],l=[],v=[],x=[],q=!1,de=[];for(let g=0;g<r.length;g++){let m=r[g],E=g>0&&(r[g-1]==="not"||r[g-1]==="un"),U=h.find(b=>b.about==="field"&&b.type==="choice"&&(b.options??[]).some(O=>$(O)===m));if(U&&!E){let b=(U.options??[]).find(O=>$(O)===m);d.push({key:U.key,value:b}),l.push(b);continue}let L=h.find(b=>b.about==="field"&&b.type==="boolean"&&[$(b.key),$(b.label)].some(O=>O===m||O===m.replace(/^un/,"")));if(L){let b=!E&&!(m.startsWith("un")&&!$(L.key).startsWith("un"));d.push({key:L.key,value:String(b)}),l.push(b?m:`not ${m.replace(/^un/,"")}`);continue}if(Pt.has(m)&&!E){let b=He(n);b==="unsayable"?(q=!0,x.push(O=>!ut(p,O))):(d.push(...b.conditions),x.push(b.holds)),l.push(m);continue}m==="not"||m==="un"||t&&h.some(b=>b.type==="date"&&($(b.key)===m||$(b.label)===m))||de.push(m)}if(r=de,r.some(g=>!te.has(g))||!t&&d.length===0&&x.length===0)return;let T=I(n).toLowerCase(),Q=I(n);if(t){let g=ie(n,e.split(" "));if(!g){let m={to:"kind",kind:n,title:Q,address:se(n),said:`Went to the ${T}.`};return{about:"kind",say:`${ee(Q)} carry no date, so I can't tell which are ${/^(?:due|for|on|overdue|past due|late)\b/.test(t.ask.words)?t.ask.words:`due ${t.ask.words}`}. ${m.said}`,moves:[m]}}if(t.ask.from&&d.push({key:g.key,value:`after:${C(t.ask.from,-1)}`}),t.ask.to&&d.push({key:g.key,value:`before:${C(t.ask.to,1)}`}),t.ask.overdue){let m=He(n);m==="unsayable"?(q=!0,x.push(E=>!ut(p,E))):(d.push(...m.conditions),x.push(m.holds))}t.ask.overdue?l.push("overdue"):v.push(Ie(t.ask,g))}let R=w.nodesOfKind(n).filter(g=>d.every(m=>ue(be,g,m))&&x.every(m=>m(g))),K=[...l,...v].join(" and "),Y=[...l,T,...v].join(" "),W=R.slice(0,6).map(g=>({about:"node",id:g.id,kind:n,label:H(g),why:{field:d[0]?.key??"label",reading:d[0]?.key??"Name",fragment:K,strength:"field"},current:!0,flagged:ye.has(g.id),address:ge(g)})),X=R.length===0?`No ${T} are ${K}.`:`${R.length===1?`One ${F(M(n),n)} is`:`${R.length} ${T} are`} ${K}: ${fe(R.slice(0,6).map(H))}${R.length>6?`, and ${R.length-6} more`:""}.`;if(q)return{about:"kind",say:X,moves:[],picks:W,offer:{draft:Y,label:"Show as a view"}};let Z=d.map(g=>`${g.key}:${g.value}`).join(","),we=`${se(n)}?${new URLSearchParams({filter:Z}).toString()}`,_={to:"kind",kind:n,title:ee(Y),filter:Z,address:we,said:`Went to the ${Y}.`};return{about:"kind",say:`${_.said} ${X}`,moves:[_],picks:W}},Te=e=>M(e)?.figure==="person"?!0:[e,F(M(e),e),I(e)].some(s=>$(s).split(" ").some(n=>Et.has(n))),pt=e=>{let t=[],s=n=>M(n)?.edges??{};for(let[n,r]of Object.entries(s(e)))for(let h of r.to??[])u.has(h)&&t.push({key:n,direction:"out",far:h,words:ct(`${r.description??""} ${n}`)});for(let n of P)for(let[r,h]of Object.entries(s(n)))(h.to??[]).includes(e)&&t.push({key:r,direction:"in",far:n,words:ct(`${h.inverse??""} ${r}`)});return t},mt=e=>{let t=e.match(/^(who|which|what)\b/)?.[1];if(!t)return;let s=Oe(e,k,j);if(!s||s.ask.overdue)return;let n=s.rest.split(" ").filter(Boolean),r=P.flatMap(a=>[I(a),F(M(a),a),a].map(A=>({kind:a,name:$(A)}))).filter(a=>a.name.length>0).sort((a,A)=>A.name.length-a.name.length),h=` ${n.join(" ")} `,d=[];for(let{kind:a,name:A}of r)h.includes(` ${A} `)&&(h=h.replace(` ${A} `," "),d.includes(a)||d.push(a));let l=h.match(/\b(?:is|are|was|were)\b|'s\b/)?.[0],v=h.replace(/'s\b/g," ").split(" ").filter(a=>a.length>0&&!te.has(a)&&!Ce.has(a)),x=t==="who"?d.find(Te):d[0];if(!x&&t!=="who")return;let q=d.find(a=>a!==x),de=v.flatMap(a=>[je(a),...lt.has(je(a))?[...lt]:[]]),T=P.filter(a=>q?a===q:a!==x).flatMap(a=>{let A=ie(a,e.split(" "))??V(p,a).filters.find(D=>D.about==="field"&&D.type==="date");return A?pt(a).filter(D=>(x?D.far===x:Te(D.far))&&D.far!==a).map(D=>({kind:a,field:A,relation:D,said:v.length===0||de.some(ve=>D.words.some(vt=>Lt(vt,ve)))})):[]}).filter(a=>a.said);if(T.length===0)return;let Q=T.filter(a=>n.some(A=>$(a.field.key)===A||$(a.field.label)===A)),R=T.length===1?T[0]:Q.length===1?Q[0]:void 0;if(!R)return;let{kind:K,field:Y,relation:W}=R,X=[...s.ask.from?[{key:Y.key,value:`after:${C(s.ask.from,-1)}`}]:[],...s.ask.to?[{key:Y.key,value:`before:${C(s.ask.to,1)}`}]:[]],Z=w.nodesOfKind(K).filter(a=>X.every(A=>ue(be,a,A))),we=a=>(W.direction==="out"?c.graph.out(a.id,W.key):c.graph.in(a.id,W.key)).filter(A=>A.kind===W.far&&u.has(W.far)),_=[],g=[];for(let a of Z){let A=we(a);A.length===0&&g.push(a);for(let D of A)_.some(ve=>ve.id===D.id)||_.push(D)}let m=Ie(s.ask,Y),E=s.ask.day?`On ${s.ask.day}`:ee(s.ask.words.replace(/^(?:due|for|on|by) (?:the )?/,"")),U=I(K).toLowerCase(),L=X.map(a=>`${a.key}:${a.value}`).join(","),b=`${U} ${m}`,O={to:"kind",kind:K,title:ee(b),filter:L,address:`${se(K)}?${new URLSearchParams({filter:L}).toString()}`,said:`Went to the ${b}.`};if(Z.length===0)return{about:"related",say:`No ${b}. ${O.said}`,moves:[O]};let le=v.join(" "),yt=l==="was"||l==="were",Ge=a=>yt?a===1?"was":"were":a===1?"is":"are",ce=_.map(H),bt=ce.length>8?[...ce.slice(0,8),`${ce.length-8} more`]:ce,kt=_.length===0?`${E}: nobody ${Ge(1)}${le?` ${le}`:""}.`:`${E}: ${fe(bt)}${le?` ${Ge(_.length)} ${le}`:""}.`,$t=t==="who"&&g.length>0?`${fe(g.slice(0,4).map(H))}${g.length>4?` and ${g.length-4} more`:""} ${g.length===1?"has":"have"} nobody.`:"",wt=_.slice(0,8).map(a=>({about:"node",id:a.id,kind:a.kind,label:H(a),why:{field:W.key,reading:Ze(p,W.direction==="out"?K:W.far,W.key,W.direction==="out"?"out":"in"),fragment:m,strength:"field"},current:!0,flagged:ye.has(a.id),address:ge(a)}));return{about:"related",say:[kt,$t,O.said].filter(Boolean).join(" "),moves:[O],picks:wt}},Ke=N.match(jt);if(Ke){let e=Ke[1];if(e&&!rt.has(e)&&!/^(?:it|this|that)$/.test(e)){let n=re(e),r=n?void 0:pe(z(e)||e);if(r?.one){let h=Me(r.one);return{about:"describe",say:`${h.said} ${oe(r.one)}`,moves:[h],subject:r.one.id}}if(!n)return r&&r.picks.length>0?{about:"picks",say:Re(r.picks),moves:[],picks:r.picks}:De()}if(e&&/^(?:it|this|that)$|^(?:here|this place|this page)$/.test(e)){let n=(y.selection??[]).map(r=>w.getNode(r)).find(r=>r!==void 0);if(n)return{about:"describe",say:oe(n),moves:[],subject:n.id}}let t=c.violations();if(t.length===0)return{about:"problems",say:"Nothing is wrong \u2014 every rule holds.",moves:[]};let s={to:"problems",address:"/problems",said:"Went to the problems."};return{about:"problems",say:`${s.said} ${Qe(t)}: ${t.slice(0,4).map(n=>n.message).join("; ")}${t.length>4?"\u2026":"."}`,moves:[s]}}if(Ot.test(N))return Le();let _e=mt(N);if(_e)return _e;let ke=Oe(N,k,j);if(ke&&!re(z(ke.ask.words))&&ke.rest.replace(/'s\b/g,"").split(" ").every(e=>e===""||te.has(e)||Ce.has(e))){let e=ae(N);if(e)return e}if(/^open /.test(N)){let e=ae(N);if(e)return e}let Fe=N.match(Nt)??N.match(/^(?:go|take me|head|get me)(?: back)? (home)$/);if(Fe)return Ee(Fe[1].trim(),!1);let Be=N.match(St);if(Be){let e=Ee(Be[1].trim(),!0);return"unresolved"in e&&e.unresolved&&!/^tell me|^describe/.test(N)?{unresolved:!0}:e}let $e=re(N);if($e){let e=We($e);return{about:"place",say:e.said,moves:[e],subject:$e.slug}}let Ue=ae(N);return Ue||{unresolved:!0}}var Ce=new Set(["who","whom","whose","which","what","whats","what's","who's"]),Et=new Set(["person","people","user","users","member","members","volunteer","volunteers","gardener","gardeners","player","players","staff","worker","workers","employee","employees","owner","owners","assignee","assignees","helper","helpers","student","students","teacher","teachers","customer","customers","client","clients","contact","contacts","author","authors"]),lt=new Set(["work","cover","staff","assign","do","run","schedul","roster","book","duty","serv","help"]);function je(o){let i=o.toLowerCase().replace(/'s$/,"");for(let y of["ing","ed","es","s"])if(i.length>y.length+2&&i.endsWith(y)){let f=i.slice(0,-y.length);return f.length>3&&f[f.length-1]===f[f.length-2]?f.slice(0,-1):f}return i}function ct(o){return o.toLowerCase().split(/[^a-z']+/).filter(i=>i.length>1&&!te.has(i)&&!Ce.has(i)&&!["it","they","them","their","its","this","here","to","at"].includes(i)).map(je)}var Lt=(o,i)=>o===i||o.length>=4&&i.length>=4&&(o.startsWith(i)||i.startsWith(o)),ne=new Set(["done","finished","complete","completed","closed","resolved","agreed","canceled","archived","shipped","delivered"]),Pt=new Set(["open","unfinished","outstanding","pending","remaining","undone","incomplete"]);function ut(o,i){return V(o,i.kind).filters.some(f=>f.about==="field"&&(f.type==="boolean"&&ne.has(f.key.toLowerCase())&&i[f.key]===!0||f.type==="choice"&&typeof i[f.key]=="string"&&ne.has(String(i[f.key]).toLowerCase())))}function fe(o){return o.length<=1?o[0]??"":`${o.slice(0,-1).join(", ")} and ${o[o.length-1]}`}function zt(o,i,y={}){let f=y.scene!==void 0?{...y.pages,scene:y.scene}:y.pages;return[...nt(o,i,f?{pages:f}:{})].map(({first:c,hidden:p,lens:k,...j})=>j)}function gt(o,i){return{...o.principal?{principal:o.principal}:{},...o.places?{places:o.places}:{},...o.selection?{selection:o.selection}:{},...o.place?{place:o.place}:{},...i??o.today?{today:i??o.today}:{},...o.weekStartsOn!==void 0?{weekStartsOn:o.weekStartsOn}:{}}}function Jt(o,i,y,f){let c=ht(o,i,gt(y,f));if(c.unresolved)return c.say?{reply:{say:c.say,proposals:[],grounded:!0}}:{};if(c.about==="picks")return{};let p=c.moves.length>0?{moves:c.moves}:{},k=c.subject?o.graph.getNode(c.subject):void 0;if(c.about==="problems")return{...p,problems:!0};if(k&&(c.about==="describe"||c.about==="here"))return{...p,told:k.id};let j=k?tt(o,ot(Ve(o.violations(),[k.id])).slice(0,3)):[];return{reply:{say:c.say,proposals:j,grounded:!0,...p,...c.picks&&c.picks.length>0?{picks:c.picks}:{},...c.offer?{offer:c.offer}:{}}}}function Yt(o,i,y={}){let f=gt(y),c=[];for(let p of i){let k=typeof p=="string"?p:typeof p=="object"&&p!==null&&typeof p.to=="string"?p.to:void 0;if(!k||k.trim().length===0)continue;let j=ht(o,/^(?:go|take me|open|show)\b/i.test(k.trim())?k:`go to ${k}`,f);if("moves"in j)for(let J of j.moves)c.some(B=>B.address===J.address)||c.push(J)}return c}export{At as NOTHING_BY_THAT_NAME,gt as askContextOf,Jt as goingFrom,Yt as movesFromNames,zt as placesFromViews,ht as resolveAsk};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{o as B}from"./chunk.6IUEGPCZ.js";import{G as R,Ga as T,J as L,T as a,ba as C}from"./chunk.VNJKGSGZ.js";import{a as P}from"./chunk.SDO3U72B.js";import{Sd as b,Wc as w,de as A}from"./chunk.X3MMJ3QC.js";import{b as i}from"./chunk.AJZBJBMO.js";var I=i(a(),1),H=B.part(e=>(0,I.jsx)(e.ActivityRail,{calls:[]}),{quiet:!0});var x=i(a(),1),O=e=>e.tabIndex>=0&&!e.disabled&&e.getClientRects().length>0;function F(e){if(!e)return!1;if(O(e))return e.focus({preventScroll:!1}),!0;let r=[...e.querySelectorAll("a[href], button, input, select, textarea, [tabindex]")].find(O);return r?(r.focus(),!0):(e.hasAttribute("tabindex")||e.setAttribute("tabindex","-1"),e.focus(),!0)}var E=`.graview-skips{display:contents}
|
|
2
|
+
.graview-skip{position:absolute;width:0;height:0;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
|
|
3
|
+
.graview-skip:focus{width:auto;height:auto;overflow:visible;clip-path:none;padding:6px 12px;border-radius:8px;border:1px solid var(--graview-accent);background:var(--graview-float,var(--graview-panel));color:var(--graview-ink);font:inherit;font-size:.875rem;font-weight:600;box-shadow:var(--graview-lift-high);outline:2px solid var(--graview-accent);outline-offset:1px}
|
|
4
|
+
.graview-skips[data-place=bar] .graview-skip:focus{position:fixed;left:8px;top:6px;z-index:${w("toast")}}
|
|
5
|
+
.graview-skips[data-place=here] .graview-skip:focus{position:static;justify-self:start}`;function M({to:e,place:r="bar"}){return e.length===0?null:(0,x.jsxs)("span",{className:"graview-skips","data-place":r,children:[(0,x.jsx)("style",{children:E}),e.map(o=>(0,x.jsx)("button",{type:"button",className:"graview-skip","data-graview-skip":o.testid,"data-testid":`skip-${o.testid}`,...o.opens?{"data-graview-skip-opens":""}:{},onClick:o.go,children:o.label},o.testid))]})}var d=i(R(),1),h=i(a(),1),N=T(P(()=>(__graviewPreload(import.meta.url,["./chunk.QHU3KUZZ.js","./chunk.YMRVKG6W.js","./chunk.P3CUCDHO.js","./chunk.OVSZXILB.js","./chunk.BDBLGGFJ.js","./chunk.IZ2ZTNEV.js","./chunk.CJUIJ6TL.js","./chunk.UITZ74YJ.js","./chunk.E4SYOBGB.js","./chunk.QLTHHWBA.js","./chunk.GZHZLJBF.js","./chunk.KHZA5F7A.js","./chunk.OJGHDWI6.js","./chunk.KSVJHSRH.js","./chunk.NSGQXCH6.js","./chunk.SZG6HJWH.js","./chunk.2FOIJ5ID.js","./chunk.6IUEGPCZ.js","./chunk.CUJX3IVA.js","./chunk.VNJKGSGZ.js","./chunk.SDO3U72B.js","./chunk.X3MMJ3QC.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.WGVIJDV5.js")))),j=N.part((e,r)=>{let o=e.RecordInteractions;return(0,h.jsx)(o,{...r})},{quiet:!0});function V(e,r,o){let t=e.target;return(t.on==="record"||t.on==="field"?t.id===r:t.on==="selection"?t.ids.includes(r):t.on==="act"?t.id===r:!1)||e.offered.some(n=>n.id===`record:${r}`||n.id.startsWith(`fill:${r}:`))||(e.batches??[]).some(n=>o(n).includes(r))}function _({id:e,style:r,headingStyle:o,className:t}){let{ai:f,aiDesk:n,store:y}=C(),{entries:u}=L(n),l=f.off===!0;(0,d.useEffect)(()=>{l||n.load()},[n,l]);let S=y.log.length,m=(0,d.useMemo)(()=>{let k=g=>y.log.all().flatMap(v=>v.batch===g?v.writes:[]);return u.filter(g=>V(g,e,k))},[u,e,y,S]);return l||m.length===0?null:(0,h.jsx)(d.Suspense,{fallback:null,children:(0,h.jsx)(j,{entries:m,...r?{style:r}:{},...o?{headingStyle:o}:{},...t?{className:t}:{}})})}var c=i(R(),1);var p=i(a(),1),G={textDecorationLine:"underline",textDecorationColor:"color-mix(in srgb, currentColor 50%, transparent)",textDecorationThickness:1,textUnderlineOffset:"0.2em"};function D({children:e,mark:r="\u2192"}){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("span",{style:G,children:e}),(0,p.jsx)("span",{"aria-hidden":"true",children:r})]})}var s=i(a(),1);function Lo({context:e,stop:r,title:o,label:t,style:f,className:n,children:y,...u}){let l=b(e.views?.arrangement?.()),S=y??(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(D,{mark:"\u2197",children:["In ",l==="Scene"?"the scene":l.replace(/^The /,"the ")]})}),m=t?{"aria-label":t}:{};if(e.overview){let k=e.overview;return(0,s.jsx)("a",{href:r,...u,...m,...o?{title:o}:{},style:f,...n?{className:n}:{},onClick:g=>{g.preventDefault(),k(r)},children:S})}return e.embedded?null:(0,s.jsx)("a",{href:`${e.sceneHref??"/"}${r}`,...u,...m,...o?{title:o}:{},style:f,...n?{className:n}:{},children:S})}function Co(){return(0,s.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:e=>{e.preventDefault(),window.location.assign(A(window.location.href))},style:{color:"inherit",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24},children:"Start fresh"})}function To(e){let r=(0,c.useRef)(0),o=(0,c.useCallback)(t=>e.subscribe(()=>{r.current+=1,t()}),[e]);return(0,c.useSyncExternalStore)(o,()=>r.current,()=>0)}function Io(e){return e===void 0?{}:e==="sm"||e==="md"?{"data-size":e}:{style:{"--graview-control-height":typeof e=="number"?`${e}px`:e}}}var Oo=(e,r)=>r?`${e} ${r}`:e;export{H as a,F as b,M as c,_ as d,D as e,Lo as f,Co as g,To as h,Io as i,Oo as j};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ke,b as Pe,c as Se,d as se,e as Y}from"./chunk.TKUNRFDE.js";import{c as B,e as ae}from"./chunk.
|
|
1
|
+
import{a as ke,b as Pe,c as Se,d as se,e as Y}from"./chunk.TKUNRFDE.js";import{c as B,e as ae}from"./chunk.VNBEAF62.js";import{a as ie}from"./chunk.KSVJHSRH.js";import{G as ne,T as te,ba as re,da as oe}from"./chunk.VNJKGSGZ.js";import"./chunk.SDO3U72B.js";import{Uc as ee,W as _,ga as Z}from"./chunk.X3MMJ3QC.js";import"./chunk.FQLNBIQ5.js";import{b as A}from"./chunk.AJZBJBMO.js";var f=A(ne(),1);var P=A(ne(),1),$e=(e,n)=>`graview:last-visit:${n??"anyone"}:${e.join(",")}`;function Ee(e,n,r){let t=new Set;for(let o of e)if(!(o.author.id!==void 0&&o.author.id===r)&&Date.parse(o.at)>n)for(let i of o.writes)t.add(i);return t}function le(e,n,r){let t=$e(n,r?.id),[o]=(0,P.useState)(()=>{try{let i=globalThis.localStorage?.getItem(t);return i?Number(i):null}catch{return null}});return(0,P.useEffect)(()=>{let i=()=>{if(document.visibilityState==="hidden")try{globalThis.localStorage?.setItem(t,String(Date.now()))}catch{}};return document.addEventListener("visibilitychange",i),window.addEventListener("pagehide",i),()=>{document.removeEventListener("visibilitychange",i),window.removeEventListener("pagehide",i)}},[t]),(0,P.useMemo)(()=>o===null?new Set:Ee(e,o,r?.id),[e,o,r?.id])}function de(e,n,r){let t=new Set;if(r===void 0)return t;t.add(r);for(let o of[...e.out(r),...e.in(r)])t.add(o.id);for(let o of n)if(o.author.id===r)for(let i of o.primitives)i.op==="add-node"&&t.add(i.node.id);return t}var g=A(te(),1);function Ne(e,n,r={x:0,y:0}){let t=(o,i)=>{let c=B(o,i,n.cell,n.tilt);return{x:n.originX+r.x+c.x,y:n.originY+r.y+c.y}};return[t(e.col,e.row),t(e.col+e.side,e.row),t(e.col+e.side,e.row+e.side),t(e.col,e.row+e.side)]}var D=e=>e.map(n=>`${n.x.toFixed(1)},${n.y.toFixed(1)}`).join(" ");function Xe({frame:e,width:n,height:r,pan:t,pinned:o,close:i,today:c,swallowed:y,chosen:p=[],onFocus:w}){let{selection:u,store:d,scheme:S,principal:b}=re(),m=oe(),a=(0,f.useMemo)(()=>d.log.all(),[d,m]),h=le(a,d.schema.kinds,b),$=(0,f.useMemo)(()=>de(d.graph,a,b?.id),[d,a,b?.id]),ge=ie(),E=e.city,F=e.nodes.filter(l=>l.plot!==void 0&&Math.round(l.plane)===2),R=E?.cell??0,K=E?.tilt??.5,T=(0,f.useRef)(w);T.current=w;let ce=(0,f.useCallback)(l=>!T.current||y?.current?!1:(T.current(l),!0),[y]),G=(0,f.useRef)(new Map),j=(0,f.useRef)({nodes:void 0,names:new Map});j.current.nodes!==m&&(j.current={nodes:m,names:new Map});let V=j.current.names,O=new Map;for(let l of F){let L=l.aggregate?.memberIds??[],v=ae(d.schema,l.kind),q=s=>v?d.graph.getNode(s)?.[v.field]:void 0,C=L.filter(s=>p.includes(s)),H=`${R}|${K}|${l.plot.col},${l.plot.row},${l.plot.side}|${C.join(",")}|${L.map(s=>`${s}=${String(q(s))}`).join(",")}`,I=G.current.get(l.id);if(I&&I.key===H){O.set(l.id,I);continue}let W={cell:R,originX:0,originY:0,tilt:K},J={x:0,y:0},ve=d.schema.tryDefinition(l.kind),me=s=>{let x=V.get(s);if(x!==void 0)return x;let M=d.graph.getNode(s),U=M?Z(ve,M):s;return V.set(s,U),U},k=v?v.values.map(()=>[]):[[]],N=v?[...v.tiers]:["waiting"];for(let s of C.length>0?[...C,...L.filter(x=>!C.includes(x))]:L){let x=v?v.values.indexOf(q(s)):0;x>=0?k[x].push(s):(k.length===N.length&&(k.push([]),N.push("waiting")),k[k.length-1].push(s))}let{blocks:he,rests:xe}=Y(l.plot,k,N.map(s=>se[s])),be=Ne(l.plot,W,J),Q=v?Be(d.schema,l.kind):void 0;O.set(l.id,{key:H,tile:D(be),rests:xe.map(s=>({count:s.count,rows:s.rows,at:B(s.col,s.row,R,K)})),buildings:he.map(s=>{let M=(Q?d.graph.getNode(s.id):void 0)?.[Q];return{id:s.id,tier:N[s.lane],overdue:typeof M=="string"&&N[s.lane]!=="done"&&M.slice(0,10)<(c??new Date().toISOString().slice(0,10)),name:me(s.id),width:s.footprint*R,...De(s,W,J)}})})}if(G.current=O,!E)return null;let ue={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible"},fe=u.join(`
|
|
2
2
|
`),we=ge.join(`
|
|
3
3
|
`),ye=h?[...h].join(`
|
|
4
4
|
`):"",pe=$?[...$].join(`
|