graview 0.1.37 → 0.1.39
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.23WYWIAJ.js +1 -0
- package/dist/preview/chunk.2BJRS3YJ.js +3 -0
- package/dist/preview/{chunk.MJLUAGEV.js → chunk.2GGDOFTF.js} +1 -1
- package/dist/preview/chunk.2HF54MYG.js +1 -0
- package/dist/preview/{chunk.X2OLXTRL.js → chunk.2IX3CZNP.js} +1 -1
- package/dist/preview/chunk.2NSTEREJ.js +1 -0
- package/dist/preview/{chunk.57XTDW57.js → chunk.2RCNSHXK.js} +1 -1
- package/dist/preview/chunk.37ASLBGE.js +1 -0
- package/dist/preview/chunk.3ZNQ5YKX.js +1 -0
- package/dist/preview/{chunk.QYWBQ5NX.js → chunk.4BBJ62ZO.js} +1 -1
- package/dist/preview/chunk.4ECICQ2S.js +1 -0
- package/dist/preview/{chunk.JBRXGPPM.js → chunk.4PNFX3TX.js} +1 -1
- package/dist/preview/{chunk.6DYZBDWT.js → chunk.546WEHEX.js} +1 -1
- package/dist/preview/chunk.57OPL5WD.js +1 -0
- package/dist/preview/{chunk.5CLFTXP3.js → chunk.5JPRFXYQ.js} +1 -1
- package/dist/preview/chunk.5OJJ2TKZ.js +9 -0
- package/dist/preview/chunk.5R4E5C76.js +1 -0
- package/dist/preview/{chunk.YAXOIJVH.js → chunk.5XNVN4HE.js} +1 -1
- package/dist/preview/chunk.5ZMENPY4.js +5 -0
- package/dist/preview/{chunk.74DXEKUV.js → chunk.67USHK26.js} +1 -1
- package/dist/preview/chunk.6CFP5UYP.js +1 -0
- package/dist/preview/{chunk.JDRM6XXD.js → chunk.6DHHUBSC.js} +1 -1
- package/dist/preview/chunk.6HBEYRJU.js +1 -0
- package/dist/preview/chunk.6L7IDF3J.js +1 -0
- package/dist/preview/{chunk.UV2TSAB4.js → chunk.6XU2CXRZ.js} +1 -1
- package/dist/preview/chunk.7EFNLMKU.js +1 -0
- package/dist/preview/chunk.7WSXVXP3.js +1 -0
- package/dist/preview/chunk.ALDLAQ7V.js +1 -0
- package/dist/preview/chunk.AYHCQWSU.js +1 -0
- package/dist/preview/{chunk.FGYCYLUS.js → chunk.B2IRADR2.js} +1 -1
- package/dist/preview/{chunk.SZMWJHU2.js → chunk.B7TB6YRZ.js} +1 -1
- package/dist/preview/chunk.BCHHBGM6.js +1 -0
- package/dist/preview/chunk.BEC5ZH2L.js +1 -0
- package/dist/preview/chunk.BL4S3I2N.js +1 -0
- package/dist/preview/chunk.BS3FX4PX.js +1 -0
- package/dist/preview/chunk.BTSXYZ6Z.js +25 -0
- package/dist/preview/chunk.BYKR7NEE.js +1 -0
- package/dist/preview/chunk.BZSU4HH2.js +1 -0
- package/dist/preview/chunk.C2OAKTZX.js +1 -0
- package/dist/preview/chunk.C4CFYTCW.js +1 -0
- package/dist/preview/{chunk.QJYALCIW.js → chunk.C6X7CKU6.js} +1 -1
- package/dist/preview/chunk.CAMQ7MYJ.js +1 -0
- package/dist/preview/{chunk.LJE5J3JK.js → chunk.CC47O2DW.js} +1 -1
- package/dist/preview/{chunk.TRLVFHFT.js → chunk.CF7DHTKL.js} +2 -2
- package/dist/preview/{chunk.CV4CBHFT.js → chunk.CMN6VVK2.js} +1 -1
- package/dist/preview/chunk.CTK2P4JV.js +3 -0
- package/dist/preview/chunk.DAA7IDQ4.js +1 -0
- package/dist/preview/{chunk.TSI4O3GH.js → chunk.DYNBWIPF.js} +1 -1
- package/dist/preview/chunk.E3HXXUKY.js +1 -0
- package/dist/preview/{chunk.KAWP4RNR.js → chunk.EBHKKOPO.js} +1 -1
- package/dist/preview/chunk.EDC4EMIX.js +1 -0
- package/dist/preview/chunk.EM4Y4YAD.js +2 -0
- package/dist/preview/{chunk.GMZAQGH7.js → chunk.EWWJMS6G.js} +1 -1
- package/dist/preview/chunk.F5UVEF2R.js +1 -0
- package/dist/preview/{chunk.5JPRRV47.js → chunk.FCXBCKED.js} +1 -1
- package/dist/preview/chunk.FGDHEVH4.js +1 -0
- package/dist/preview/chunk.FILCNVGH.js +2 -0
- package/dist/preview/chunk.FJBQ4UP3.js +32 -0
- package/dist/preview/{chunk.EKUAI5YL.js → chunk.FMN5XDLE.js} +1 -1
- package/dist/preview/chunk.G23VFYGF.js +88 -0
- package/dist/preview/chunk.G46WGK5E.js +1 -0
- package/dist/preview/chunk.GAFYE37S.js +3 -0
- package/dist/preview/{chunk.TN4GY6LW.js → chunk.GP2F7TIN.js} +1 -1
- package/dist/preview/chunk.GXKECZ4S.js +19 -0
- package/dist/preview/{chunk.NOZEHLWG.js → chunk.H5CZZZLX.js} +1 -1
- package/dist/preview/{chunk.CGQLE7JW.js → chunk.HA3PPIEQ.js} +1 -1
- package/dist/preview/chunk.HFDYFPMJ.js +1 -0
- package/dist/preview/chunk.HFYUAK5Z.js +6 -0
- package/dist/preview/chunk.HGS32FT2.js +1 -0
- package/dist/preview/chunk.HHUCPVG5.js +1 -0
- package/dist/preview/chunk.I7CU2E3C.js +7 -0
- package/dist/preview/{chunk.3V2M3S4U.js → chunk.IAZRY42B.js} +1 -1
- package/dist/preview/{chunk.UPBUF7KR.js → chunk.ITEF3U2E.js} +1 -1
- package/dist/preview/{chunk.SNKOPWAD.js → chunk.IXYBIDAN.js} +1 -1
- package/dist/preview/{chunk.NZJZIYDK.js → chunk.J3M2MZHG.js} +1 -1
- package/dist/preview/{chunk.YX354FRV.js → chunk.JBTU2PJ4.js} +1 -1
- package/dist/preview/chunk.JCR3ECUM.js +1 -0
- package/dist/preview/{chunk.XS3SAH6U.js → chunk.JEZTPXEB.js} +1 -1
- package/dist/preview/chunk.KIJCOW25.js +1 -0
- package/dist/preview/{chunk.YFW5BF6J.js → chunk.KJNUZYXS.js} +1 -1
- package/dist/preview/chunk.L7DQKPJV.js +117 -0
- package/dist/preview/{chunk.UCVZG7S4.js → chunk.LCYMYLOP.js} +1 -1
- package/dist/preview/chunk.LP2DJ5ZB.js +6 -0
- package/dist/preview/chunk.LP3QUPCE.js +1 -0
- package/dist/preview/chunk.M5QFUGGG.js +1 -0
- package/dist/preview/chunk.N2SV3KX7.js +1 -0
- package/dist/preview/chunk.N7N5OFPL.js +1 -0
- package/dist/preview/{chunk.BA3REPV5.js → chunk.NG3YMQ36.js} +1 -1
- package/dist/preview/{chunk.7OLVQ2FZ.js → chunk.NSNGPQGT.js} +1 -1
- package/dist/preview/chunk.OJKS3UQS.js +1 -0
- package/dist/preview/{chunk.UR5TT4JH.js → chunk.OM5CDW2S.js} +1 -1
- package/dist/preview/chunk.ORXFUK6F.js +344 -0
- package/dist/preview/chunk.OXTUXWMU.js +1 -0
- package/dist/preview/chunk.OYMM2UWE.js +1 -0
- package/dist/preview/chunk.P3JYH6HO.js +1 -0
- package/dist/preview/{chunk.AWRS6TUN.js → chunk.P4WYBSYA.js} +1 -1
- package/dist/preview/chunk.P5325GYR.js +1 -0
- package/dist/preview/chunk.PMER4LVT.js +1 -0
- package/dist/preview/chunk.PONWLTTB.js +1 -0
- package/dist/preview/chunk.PXQVXBNG.js +1 -0
- package/dist/preview/chunk.QCF6Z2AZ.js +1 -0
- package/dist/preview/chunk.QEXXLWEU.js +6 -0
- package/dist/preview/chunk.QMFUPTR4.js +1 -0
- package/dist/preview/chunk.RM7NVN7B.js +3 -0
- package/dist/preview/{chunk.RPOYSIVQ.js → chunk.ROINZMNO.js} +1 -1
- package/dist/preview/chunk.ROKRQRID.js +35 -0
- package/dist/preview/chunk.RWB4235L.js +1 -0
- package/dist/preview/chunk.RXSHFG6S.js +1 -0
- package/dist/preview/chunk.SDO3U72B.js +1 -0
- package/dist/preview/chunk.SHNYYBNW.js +1 -0
- package/dist/preview/{chunk.HYAKRLPT.js → chunk.SK33IHL2.js} +3 -3
- package/dist/preview/chunk.STBJV6HJ.js +1 -0
- package/dist/preview/chunk.TCUB6IDY.js +1 -0
- package/dist/preview/chunk.TJCTTJWE.js +1 -0
- package/dist/preview/{chunk.WVEKYJSI.js → chunk.TU4KG22J.js} +6 -6
- package/dist/preview/chunk.U4E5GQTK.js +1 -0
- package/dist/preview/{chunk.4NCXMVPY.js → chunk.U7QMA4H7.js} +1 -1
- package/dist/preview/chunk.UB3O3QJQ.js +2 -0
- package/dist/preview/{chunk.ENJKCSNX.js → chunk.UCZR33MK.js} +1 -1
- package/dist/preview/chunk.UGCNMAPC.js +1 -0
- package/dist/preview/chunk.UIUHGA6W.js +1 -0
- package/dist/preview/chunk.VC4JPG7O.js +1 -0
- package/dist/preview/{chunk.YNJOLOFG.js → chunk.W4OX4BMP.js} +1 -1
- package/dist/preview/chunk.WJQY4E45.js +1 -0
- package/dist/preview/chunk.WQPNGBR7.js +1 -0
- package/dist/preview/chunk.WTZOOAIW.js +1 -0
- package/dist/preview/chunk.WXYUWBKX.js +1 -0
- package/dist/preview/chunk.XBOZTQQA.js +1 -0
- package/dist/preview/chunk.XLI44BBI.js +17 -0
- package/dist/preview/chunk.XLZ2QRRS.js +1 -0
- package/dist/preview/chunk.XQTMO5PW.js +1 -0
- package/dist/preview/chunk.YWVOACSX.js +5 -0
- package/dist/preview/{chunk.BXWO6ILK.js → chunk.YXGI7H4Y.js} +1 -1
- package/dist/preview/{chunk.UVLPVHID.js → chunk.Z7JRBKA7.js} +1 -1
- package/dist/preview/chunk.ZR5KVYWZ.js +21 -0
- package/dist/preview/{chunk.WNMLA4YW.js → chunk.ZTMDU3OH.js} +1 -1
- package/dist/preview/index.html +45 -42
- package/dist/preview/page.js +7 -7
- package/package.json +6 -6
- package/dist/preview/chunk.24E4R4ZH.js +0 -1
- package/dist/preview/chunk.2JF254FO.js +0 -9
- package/dist/preview/chunk.2TDB4D6Y.js +0 -1
- package/dist/preview/chunk.3IVVXVG7.js +0 -1
- package/dist/preview/chunk.3KJQXYCA.js +0 -1
- package/dist/preview/chunk.5EXYDBAL.js +0 -88
- package/dist/preview/chunk.67PVRVAC.js +0 -1
- package/dist/preview/chunk.6SK2K72G.js +0 -1
- package/dist/preview/chunk.76QUEWYD.js +0 -1
- package/dist/preview/chunk.7MMNMZLF.js +0 -1
- package/dist/preview/chunk.7UQOXYJX.js +0 -1
- package/dist/preview/chunk.AHC4EXLW.js +0 -3
- package/dist/preview/chunk.AZ333RB3.js +0 -1
- package/dist/preview/chunk.BRBY5WJT.js +0 -3
- package/dist/preview/chunk.CYPTJNES.js +0 -1
- package/dist/preview/chunk.D2ILIAND.js +0 -1
- package/dist/preview/chunk.DLCFCMKX.js +0 -1
- package/dist/preview/chunk.DMUUYZ37.js +0 -1
- package/dist/preview/chunk.DNNL7F3P.js +0 -25
- package/dist/preview/chunk.EHT4HBH5.js +0 -35
- package/dist/preview/chunk.ELY2RMGE.js +0 -19
- package/dist/preview/chunk.ENEOGGFM.js +0 -1
- package/dist/preview/chunk.FEPYKPZE.js +0 -1
- package/dist/preview/chunk.FFW6XWHB.js +0 -17
- package/dist/preview/chunk.G7S7GLDK.js +0 -1
- package/dist/preview/chunk.GXPBRYSR.js +0 -1
- package/dist/preview/chunk.H4LFJPDV.js +0 -1
- package/dist/preview/chunk.HBBVVALN.js +0 -5
- package/dist/preview/chunk.HCK4Y6C5.js +0 -1
- package/dist/preview/chunk.HSRGYZOR.js +0 -1
- package/dist/preview/chunk.IHBIRAC4.js +0 -2
- package/dist/preview/chunk.IWK5QL6P.js +0 -1
- package/dist/preview/chunk.J2HQEUYA.js +0 -1
- package/dist/preview/chunk.JFLUVZNW.js +0 -1
- package/dist/preview/chunk.LPJY6V5D.js +0 -1
- package/dist/preview/chunk.LVLAS5GL.js +0 -1
- package/dist/preview/chunk.LVNAB2BW.js +0 -27
- package/dist/preview/chunk.LYJXX6BU.js +0 -2
- package/dist/preview/chunk.MKPJKZAP.js +0 -1
- package/dist/preview/chunk.MMBMVHIG.js +0 -1
- package/dist/preview/chunk.NNNVB6RV.js +0 -1
- package/dist/preview/chunk.NV6IZJKA.js +0 -1
- package/dist/preview/chunk.NWHFFOXW.js +0 -1
- package/dist/preview/chunk.O6KNGFWH.js +0 -1
- package/dist/preview/chunk.PMK73A53.js +0 -1
- package/dist/preview/chunk.PQPZZ7ZW.js +0 -117
- package/dist/preview/chunk.QMZUKAPJ.js +0 -1
- package/dist/preview/chunk.QNGFBJWP.js +0 -1
- package/dist/preview/chunk.QOXTBRKE.js +0 -1
- package/dist/preview/chunk.QXARGANF.js +0 -341
- package/dist/preview/chunk.TX5QIZEP.js +0 -1
- package/dist/preview/chunk.TXS4I326.js +0 -1
- package/dist/preview/chunk.U4URQDC5.js +0 -1
- package/dist/preview/chunk.VUKHDZNI.js +0 -1
- package/dist/preview/chunk.VW6WGFL6.js +0 -1
- package/dist/preview/chunk.VX7MGVP5.js +0 -1
- package/dist/preview/chunk.WLV2QYTS.js +0 -1
- package/dist/preview/chunk.WNKRXL3O.js +0 -1
- package/dist/preview/chunk.XWJ2MRQF.js +0 -1
- package/dist/preview/chunk.Y44TR4WG.js +0 -1
- package/dist/preview/chunk.YW2BZ2LH.js +0 -6
- package/dist/preview/chunk.ZB7GV3IT.js +0 -1
- package/dist/preview/chunk.ZOT4V66Q.js +0 -3
- package/dist/preview/chunk.ZYPCE2LZ.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.5A4AOFOA.js";import"./chunk.KSXB4LDF.js";import"./chunk.YNJOLOFG.js";import"./chunk.5JPRRV47.js";import{a as L,b as R,c as E}from"./chunk.SNKOPWAD.js";import{b as T}from"./chunk.LVNAB2BW.js";import"./chunk.YW2BZ2LH.js";import"./chunk.HYAKRLPT.js";import"./chunk.IHBIRAC4.js";import"./chunk.CYPTJNES.js";import"./chunk.4NCXMVPY.js";import"./chunk.TN4GY6LW.js";import"./chunk.QJYALCIW.js";import"./chunk.HSRGYZOR.js";import"./chunk.BRBY5WJT.js";import"./chunk.ELY2RMGE.js";import"./chunk.UV2TSAB4.js";import"./chunk.6SK2K72G.js";import"./chunk.NNNVB6RV.js";import"./chunk.HJCQ6I3S.js";import"./chunk.AWRS6TUN.js";import"./chunk.KAWP4RNR.js";import"./chunk.UPBUF7KR.js";import"./chunk.FGYCYLUS.js";import"./chunk.NZJZIYDK.js";import"./chunk.3V2M3S4U.js";import"./chunk.EKUAI5YL.js";import"./chunk.GMZAQGH7.js";import"./chunk.57XTDW57.js";import"./chunk.MJLUAGEV.js";import"./chunk.WNMLA4YW.js";import"./chunk.VUKHDZNI.js";import"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.SZMWJHU2.js";import"./chunk.WVUJXDXZ.js";import"./chunk.YFW5BF6J.js";import"./chunk.QYWBQ5NX.js";import"./chunk.ENJKCSNX.js";import"./chunk.LJE5J3JK.js";import"./chunk.X2OLXTRL.js";import"./chunk.JDRM6XXD.js";import"./chunk.GZHZLJBF.js";import{r as A}from"./chunk.GXPBRYSR.js";import"./chunk.NV6IZJKA.js";import"./chunk.OJGHDWI6.js";import"./chunk.7OLVQ2FZ.js";import"./chunk.NOZEHLWG.js";import"./chunk.UVLPVHID.js";import"./chunk.QXARGANF.js";import{F as S,H as $,Q as p,Y as x,_ as C}from"./chunk.DNNL7F3P.js";import{aa as h,qc as k}from"./chunk.HBBVVALN.js";import{b as i}from"./chunk.AJZBJBMO.js";var r=i(S(),1);var l=i(S(),1);var g=i(p(),1);var m={font:"inherit",fontSize:"0.875rem",minHeight:24,padding:0,border:0,borderRadius:2,background:"transparent",boxShadow:"none",color:"var(--graview-accent)",textDecoration:"underline",textUnderlineOffset:3,textAlign:"start",cursor:"pointer"};var e=i(p(),1);function Y({page:n=!1,go:D,onPick:y,onDiscard:M}){let{store:d,seatTalk:c}=x(),u=$(c),N=E(),b=D??N,{keep:P}=L(b),[H,f]=(0,r.useState)(!1);C();let t=u.draft;(0,r.useEffect)(()=>f(!1),[t]),(0,r.useEffect)(()=>{n||R(!1)},[n]);let v=(0,r.useRef)(null),w=t!==null&&!n;if((0,r.useLayoutEffect)(()=>{let s=v.current;if(!w||!s?.parentElement)return;let o=[];for(let a=s.previousElementSibling;a;a=a.previousElementSibling)a instanceof HTMLElement&&!a.inert&&a.tagName!=="STYLE"&&(a.inert=!0,o.push(a));return()=>{for(let a of o)a.inert=!1}},[w]),!t)return null;let G=T(t.drawn),F=d.schema.tryDefinition(t.kind),q=d.graph.nodesOfKind(t.kind).filter(s=>h(F,s)),z=()=>{c.setDraft(null),M?.()};return(0,e.jsxs)("section",{ref:v,"data-testid":"draft-frame","data-graview-draft-frame":n?"page":"scene","aria-label":`Draft: ${t.title}`,style:n?{display:"grid",gap:12,minWidth:0}:{position:"absolute",inset:12,zIndex:k("rail"),display:"grid",gridTemplateRows:"auto auto minmax(0, 1fr)",background:"var(--graview-panel)",border:"1px solid var(--graview-edge)",borderRadius:12,boxShadow:"var(--graview-lift-high)",overflow:"hidden",minHeight:0},children:[(0,e.jsxs)("p",{"data-testid":"draft-line",style:{...K,...n?{}:{padding:"10px 16px"}},children:[n?(0,e.jsx)("span",{children:"Draft"}):(0,e.jsxs)("span",{children:["Draft \u2014 ",(0,e.jsx)("span",{"data-testid":"draft-title",style:{color:"var(--graview-ink)",fontWeight:600},children:t.title})]}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-keep",disabled:H,title:`Keep \u201C${t.title}\u201D as a lens: a place of its own`,onClick:()=>{f(!0),P(t).finally(()=>f(!1))},style:m,children:"Keep as a lens"}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-discard",onClick:z,style:m,children:"Discard"})]}),u.draftNote?(0,e.jsx)("p",{"data-testid":"draft-note",role:"status",style:{margin:0,padding:n?0:"0 16px 8px",fontSize:"0.8125rem",color:"var(--graview-warn)"},children:u.draftNote}):(0,e.jsx)("span",{}),(0,e.jsx)("div",{"data-testid":"draft-lens","data-graview-draft":t.lens.name,style:n?{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",scrollbarGutter:"stable",border:"1px solid var(--graview-edge)",borderRadius:12,background:"var(--graview-panel)"}:{minHeight:0,overflow:"auto",scrollbarGutter:"stable",display:"grid",gridTemplateRows:"minmax(0, 1fr)"},onClick:s=>{let o=s.target?.closest("[data-graview-pick]")?.getAttribute("data-graview-pick");if(!o||!d.graph.getNode(o))return;s.preventDefault();let a=d.graph.getNode(o);y?(c.setDraft(null),y(o)):b({to:"record",id:o,kind:a.kind,label:o,address:"",said:""})},children:(0,e.jsx)(A,{kind:t.kind,view:t.title,children:(0,e.jsx)(G,{nodes:q,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})]})}var K={margin:0,display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 8px",fontSize:"0.875rem",color:"var(--graview-ink-muted)",borderBottom:"1px solid var(--graview-edge)",paddingBottom:8};export{Y as DraftFrame};
|
|
@@ -1,25 +0,0 @@
|
|
|
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{Bc as Cn,Da as Rn,Dc as _n,Gc as Vn,Ha as dt,I as Pn,Ja as Tn,Rc as Ln,Ua as Mn,Wb as On,dd as Hn,id as Ge,jd as ut,qc as In}from"./chunk.HBBVVALN.js";import{a as je,b as D}from"./chunk.AJZBJBMO.js";var oo=je(w=>{"use strict";var ht=Symbol.for("react.transitional.element"),hr=Symbol.for("react.portal"),Sr=Symbol.for("react.fragment"),wr=Symbol.for("react.strict_mode"),vr=Symbol.for("react.profiler"),br=Symbol.for("react.consumer"),xr=Symbol.for("react.context"),Er=Symbol.for("react.forward_ref"),kr=Symbol.for("react.suspense"),Ar=Symbol.for("react.memo"),Xn=Symbol.for("react.lazy"),Pr=Symbol.for("react.activity"),zn=Symbol.iterator;function Rr(e){return e===null||typeof e!="object"?null:(e=zn&&e[zn]||e["@@iterator"],typeof e=="function"?e:null)}var Jn={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Qn=Object.assign,eo={};function me(e,t,n){this.props=e,this.context=t,this.refs=eo,this.updater=n||Jn}me.prototype.isReactComponent={};me.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};me.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function to(){}to.prototype=me.prototype;function St(e,t,n){this.props=e,this.context=t,this.refs=eo,this.updater=n||Jn}var wt=St.prototype=new to;wt.constructor=St;Qn(wt,me.prototype);wt.isPureReactComponent=!0;var Un=Array.isArray;function gt(){}var O={H:null,A:null,T:null,S:null},no=Object.prototype.hasOwnProperty;function vt(e,t,n){var o=n.ref;return{$$typeof:ht,type:e,key:t,ref:o!==void 0?o:null,props:n}}function Tr(e,t){return vt(e.type,t,e.props)}function bt(e){return typeof e=="object"&&e!==null&&e.$$typeof===ht}function Mr(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Yn=/\/+/g;function mt(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Mr(""+e.key):t.toString(36)}function Or(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(gt,gt):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function ye(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case ht:case hr:a=!0;break;case Xn:return a=e._init,ye(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+mt(e,0):o,Un(r)?(n="",a!=null&&(n=a.replace(Yn,"$&/")+"/"),ye(r,t,n,"",function(u){return u})):r!=null&&(bt(r)&&(r=Tr(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Yn,"$&/")+"/")+a)),t.push(r)),1;a=0;var d=o===""?".":o+":";if(Un(e))for(var s=0;s<e.length;s++)o=e[s],i=d+mt(o,s),a+=ye(o,t,n,i,r);else if(s=Rr(e),typeof s=="function")for(e=s.call(e),s=0;!(o=e.next()).done;)o=o.value,i=d+mt(o,s++),a+=ye(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return ye(Or(e),t,n,o,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function Ue(e,t,n){if(e==null)return e;var o=[],r=0;return ye(e,o,"","",function(i){return t.call(n,i,r++)}),o}function Ir(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Zn=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Cr={map:Ue,forEach:function(e,t,n){Ue(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ue(e,function(){t++}),t},toArray:function(e){return Ue(e,function(t){return t})||[]},only:function(e){if(!bt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};w.Activity=Pr;w.Children=Cr;w.Component=me;w.Fragment=Sr;w.Profiler=vr;w.PureComponent=St;w.StrictMode=wr;w.Suspense=kr;w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O;w.__COMPILER_RUNTIME={__proto__:null,c:function(e){return O.H.useMemoCache(e)}};w.cache=function(e){return function(){return e.apply(null,arguments)}};w.cacheSignal=function(){return null};w.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=Qn({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!no.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(o[i]=t[i]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var a=Array(i),d=0;d<i;d++)a[d]=arguments[d+2];o.children=a}return vt(e.type,r,o)};w.createContext=function(e){return e={$$typeof:xr,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:br,_context:e},e};w.createElement=function(e,t,n){var o,r={},i=null;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)no.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(r[o]=t[o]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var d=Array(a),s=0;s<a;s++)d[s]=arguments[s+2];r.children=d}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return vt(e,i,r)};w.createRef=function(){return{current:null}};w.forwardRef=function(e){return{$$typeof:Er,render:e}};w.isValidElement=bt;w.lazy=function(e){return{$$typeof:Xn,_payload:{_status:-1,_result:e},_init:Ir}};w.memo=function(e,t){return{$$typeof:Ar,type:e,compare:t===void 0?null:t}};w.startTransition=function(e){var t=O.T,n={};O.T=n;try{var o=e(),r=O.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(gt,Zn)}catch(i){Zn(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),O.T=t}};w.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()};w.use=function(e){return O.H.use(e)};w.useActionState=function(e,t,n){return O.H.useActionState(e,t,n)};w.useCallback=function(e,t){return O.H.useCallback(e,t)};w.useContext=function(e){return O.H.useContext(e)};w.useDebugValue=function(){};w.useDeferredValue=function(e,t){return O.H.useDeferredValue(e,t)};w.useEffect=function(e,t){return O.H.useEffect(e,t)};w.useEffectEvent=function(e){return O.H.useEffectEvent(e)};w.useId=function(){return O.H.useId()};w.useImperativeHandle=function(e,t,n){return O.H.useImperativeHandle(e,t,n)};w.useInsertionEffect=function(e,t){return O.H.useInsertionEffect(e,t)};w.useLayoutEffect=function(e,t){return O.H.useLayoutEffect(e,t)};w.useMemo=function(e,t){return O.H.useMemo(e,t)};w.useOptimistic=function(e,t){return O.H.useOptimistic(e,t)};w.useReducer=function(e,t,n){return O.H.useReducer(e,t,n)};w.useRef=function(e){return O.H.useRef(e)};w.useState=function(e){return O.H.useState(e)};w.useSyncExternalStore=function(e,t,n){return O.H.useSyncExternalStore(e,t,n)};w.useTransition=function(){return O.H.useTransition()};w.version="19.2.8"});var W=je((aa,ro)=>{"use strict";ro.exports=oo()});var yo=je(Xe=>{"use strict";var Kr=Symbol.for("react.transitional.element"),Br=Symbol.for("react.fragment");function po(e,t,n){var o=null;if(n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:Kr,type:e,key:o,ref:t!==void 0?t:null,props:n}}Xe.Fragment=Br;Xe.jsx=po;Xe.jsxs=po});var Ie=je((ya,mo)=>{"use strict";mo.exports=yo()});function Nn(e){let t,n=!1,o,r,i=0;return()=>{if(n)return Promise.resolve(t);if(o)return o;let a=i>0&&r!==void 0?cr(r):e();i+=1;let d=a.then(s=>(t=s,n=!0,o=void 0,s),s=>{throw o=void 0,r??=fr(s),s});return o=d,d}}var Dn=0;function cr(e){return Dn+=1,import(`${e}${e.includes("?")?"&":"?"}retry=${Dn}`)}function fr(e,t=import.meta.url){let n=e instanceof Error?e.message:typeof e=="string"?e:"",o=/^(?:Failed to fetch|error loading) dynamically imported module: ([a-z]+:\/\/[^\s"'<>]+)/.exec(n)?.[1]?.replace(/[.,;:)\]]+$/,""),r=i=>i.split("/",3).join("/");return o&&r(o)===r(t)?o:void 0}var ce={focusId:null,relation:null,expanded:[],pins:{}},We=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function Q(e){let t=new URLSearchParams;e.focusId&&t.set("focus",e.focusId),e.relation&&t.set("relation",e.relation),e.overview&&t.set("overview","1"),e.zoom&&t.set("zoom","1"),e.past&&t.set("past","1"),e.shown&&e.shown.length>0&&t.set("show",[...e.shown].sort().join(",")),e.selection!==void 0&&e.selection.length>0&&t.set("sel",[...e.selection].sort().join(",")),e.expanded.length>0&&t.set("expand",[...e.expanded].sort().join(","));for(let o of Object.keys(e.pins).sort()){let r=e.pins[o];t.set(`pin.${o}`,`${Fe(r.x)},${Fe(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${Fe(e.pan.x)},${Fe(e.pan.y)}`);for(let o of Object.keys(e.within??{}).sort()){let r=e.within[o];r.length>0&&t.set(`in.${o}`,r)}e.q&&e.q.trim().length>0&&t.set("q",e.q);let n=t.toString();return n?`#${n}`:"#"}function pr(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function Ke(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[h,p]of n){if(!h.startsWith("pin."))continue;let[g,b]=p.split(","),k=g===void 0?null:We(g),m=b===void 0?null:We(b);k===null||m===null||(o[h.slice(4)]={x:k,y:m})}let r=Object.create(null);for(let[h,p]of n)!h.startsWith("in.")||p.length===0||(r[h.slice(3)]=p);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],d=a[0]===void 0?null:We(a[0]),s=a[1]===void 0?null:We(a[1]),u=(n.get("sel")??"").split(",").filter(h=>h.length>0).sort(),f=n.get("overview")==="1";return{...u.length>0?{selection:u}:{},...f?{overview:!0}:{},...n.get("zoom")==="1"?{zoom:!0}:{},...n.get("past")==="1"?{past:!0}:{},...n.get("show")?{shown:[...new Set(n.get("show").split(",").filter(Boolean))].sort()}:{},...d!==null&&s!==null?{pan:{x:d,y:s}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:pr(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(h=>h.length>0&&(f||!h.startsWith("kind:"))).sort(),pins:o}}function Ki(e){let t=Ke(e);return Q(t)==="#"?{...t,overview:!0}:t}function Bi(e){let t=Q(e);return t==="#overview=1"?"":t}function Fe(e){return Math.round(e*100)/100}function Gn(e,t){return Q(e)===Q(t)}var jn="edge:";function Wn(e){if(!e.startsWith(jn))return null;let t=e.slice(jn.length).split(":");if(t.length!==3)return null;let[n,o,r]=t;if(!n||!o||!r)return null;try{return{kind:decodeURIComponent(n),from:decodeURIComponent(o),to:decodeURIComponent(r)}}catch{return null}}function ct(e){let{pan:t,...n}=e;return{...n,pins:{}}}function $(e,t){if(t===e.focusId)return{...e,focusId:t};let n=ct(e);return{...n.within?.q!==void 0?ae(n,"q",null):n,focusId:t}}function Fn(e,t){return{...e,relation:t}}function ae(e,t,n){let o={...e.within??{}};if(n===null?delete o[t]:o[t]=n,Object.keys(o).length===0){let{within:r,...i}=e;return i}return{...e,within:o}}function fe(e,t){if(t!==e.overview&&(e=ct(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function Be(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function Me(e,t){if(t!==(e.zoom===!0)&&(e=ct(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function $e(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var ze="aggregate:",qe="kind:";function ft(e){return`${qe}${e}`}function pe(e){return e.startsWith(qe)?e.slice(qe.length):null}var zi="kinds:beyond";function yr(e){let t=pe(e);return t?[t]:se(e)}function ee(...e){return`${ze}${[...e].sort().join("+")}`}function Kn(e){return e.startsWith(ze)}function se(e){return!Kn(e)||e.includes("|")?[]:e.slice(ze.length).split("+").filter(Boolean)}function Bn(e,t,n={}){let o=pe(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return $e(e,t);let r=o!==null?ee(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return Me(e,!1);if(o!==null&&n.carry){let i=fe({...$(e,r),relation:null},!1);return ae(Me(i,!0),"q",n.carry)}return Me({...$(e,r),relation:null},!0)}function mr(e,t,n){return ae(fe($(e,ee(t)),!1),"view",n)}function Ui(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var $n="aggregate:";function pt(e){return e.startsWith($n)&&e.includes("|")}var qn=e=>e?.off===!0,gr=e=>e!==void 0&&!qn(e)&&(e.fast!==void 0||e.thinking!==void 0||e.answer!==void 0||e.decide!==void 0||e.complete!==void 0||e.turn!==void 0),yt={};var io=D(W(),1),_r={turns:[],outcomes:new Map,busy:!1,pending:null,draft:null,draftNote:null},ao=e=>`graview:seat:${e}`;function Vr(e){if(!e)return{};try{let t=sessionStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return{...Array.isArray(n.turns)?{turns:n.turns}:{},...Array.isArray(n.outcomes)?{outcomes:new Map(n.outcomes)}:{},...n.draft?.drawn?{draft:n.draft}:{}}}catch{return{}}}function Lr(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],draft:t.draft}))}catch{}}function xt(e){let t=e===null?null:ao(e),n={..._r,...Vr(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&Lr(t,n);for(let d of[...o])d()};return{get:()=>n,subscribe(i){return o.add(i),()=>void o.delete(i)},setTurns:i=>r({...n,turns:i(n.turns)}),settle:(i,a)=>r({...n,outcomes:new Map(n.outcomes).set(i,a)}),setBusy:i=>r({...n,busy:i},!1),ask:i=>r({...n,pending:i.trim()||null}),takePending(){let i=n.pending;return i!==null&&r({...n,pending:null},!1),i},setDraft:(i,a=null)=>r({...n,draft:i,draftNote:a})}}function Hr(e){return(0,io.useSyncExternalStore)(e.subscribe,e.get,e.get)}var lo=D(W(),1),Dr={entries:[],ghost:null,loaded:!1};function so(e,t){let n=new Map(e.map(o=>[o.id,o]));for(let o of t)n.set(o.id,{...n.get(o.id),...o});return[...n.values()].sort((o,r)=>o.at<r.at?1:o.at>r.at?-1:0)}function Et(e){let t=Dr,n=new Set,o=r=>{t=r;for(let i of[...n])i()};return{get:()=>t,subscribe:r=>(n.add(r),()=>n.delete(r)),record:r=>{o({...t,entries:so(t.entries,[r])}),Promise.resolve(e()?.keep?.(r)).catch(i=>{console.warn("The host did not keep an AI interaction:",i)})},setGhost:r=>o({...t,ghost:r}),load:()=>{if(t.loaded)return;o({...t,loaded:!0});let r=e()?.load;r&&Promise.resolve(r()).then(i=>o({...t,entries:so(t.entries,i)})).catch(i=>{console.warn("The host's AI interactions could not be read:",i)})}}}function Nr(e){return(0,lo.useSyncExternalStore)(e.subscribe,e.get,e.get)}function uo(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}var Ye=D(W(),1),Ze=(0,Ye.createContext)(void 0),jr=()=>(0,Ye.useContext)(Ze);var A=D(W(),1),Oe=(0,A.createContext)(null);function fo(){return(0,A.useContext)(Oe)}function Gr(e,t){let n=fo(),o=(0,A.useMemo)(()=>n?n.live.seenBy(t):e,[n,e,t]),r=(0,A.useRef)(0),i=(0,A.useCallback)(a=>o.subscribe(()=>{r.current+=1,a()}),[o]);return(0,A.useSyncExternalStore)(i,()=>r.current,()=>0),o}var Wr=Nn(()=>(__graviewPreload(import.meta.url,["./chunk.TI4OSTQV.js","./chunk.AJZBJBMO.js"]),import("./chunk.J2CR4RRH.js"))),co,Fr=400;function kt(e,t,n){let o=(0,A.useContext)(Oe),r=o!==null&&o.owns(e,t),[i,a]=(0,A.useState)(null),[d,s]=(0,A.useState)(co);(0,A.useEffect)(()=>{if(d||r||i===null)return;let E=!0;return Wr().then(R=>{co=R,E&&s(R)},()=>{}),()=>{E=!1}},[d,r,i]);let[u,f]=(0,A.useState)(0),h=(0,A.useMemo)(()=>r||i===null||i>=e.log.length||!d?void 0:d.askDeclaration(n,i),[r,e,i,n,d,u]),p=h&&"waiting"in h?h.waiting:void 0,[g,b]=(0,A.useState)(void 0);(0,A.useEffect)(()=>{if(!p)return;let E=!0,R=setTimeout(()=>E&&b(p),Fr);return p.then(()=>E&&f(C=>C+1)),()=>{E=!1,clearTimeout(R)}},[p]);let k=p!==void 0&&g!==p,m=(0,A.useMemo)(()=>{if(r||i===null||i>=e.log.length||!d||k)return null;try{let E=d.pastAt(e,i,n);return{seq:i,at:E.past?.at,store:E}}catch{return null}},[r,e,i,n,d,k,u]),v=(0,A.useRef)(null),y=k?v.current:m;(0,A.useEffect)(()=>{v.current=y},[y]);let x=(0,A.useCallback)(E=>a(E===null?null:E>=e.log.length?Number.POSITIVE_INFINITY:E),[e]),P=(0,A.useCallback)((E,R)=>[e,y?.store].some(C=>C!==void 0&&(C===E||C.seenBy(R)===E)),[e,y]),N=i!==null,L=(0,A.useMemo)(()=>({past:y,open:N,show:x,live:e,host:n,owns:P}),[y,N,x,e,n,P]);return r?o:L}var go=e=>`graview:setting:${e}`;function ho(){return localStorage}function So(e,t){try{let n=(t??ho()).getItem(go(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function wo(e,t,n){try{(n??ho()).setItem(go(e.name),t)}catch{}}function vo(e,t){if(typeof document>"u")return;let n=document.documentElement;if(e.honored==="root-font-size"){n.style.fontSize=t===e.initial?"":t;return}let o=`graview${e.name.replace(/-([a-z0-9])/g,(r,i)=>i.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}`;t===e.initial?delete n.dataset[o]:n.dataset[o]=t}var V=D(W(),1);function At(e){return Ge(e)}var $r=12,qr=4;function zr(e,t,n){let o=At(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var Je=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-$r);function bo(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=qr)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?ft([...o][0]):n[0]}function Pt(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,d]of e)d.mode!=="asking"&&d.mode!=="docked"&&t.at-d.since>=t.holdMs&&o.set(a,{...d,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=zr(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=bo(t.ids,n);return i({at:a,mode:"reading",trail:Je(r.trail,a)}),o}case"about-to-write":case"write":{let a=bo(t.ids,n);return i({at:a,mode:"writing",trail:Je(r.trail,a),say:void 0,confidence:void 0}),o}case"refused":return i({at:t.where,mode:"refused",say:t.say,confidence:void 0,trail:Je(r.trail,t.where)}),o;case"asking":return i({at:t.where??r.at,mode:"asking",say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},trail:Je(r.trail,t.where)}),o;case"said":return i({say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},...t.caption?{caption:t.caption}:{}}),o;case"over":return i({over:t.over}),o;case"home":return i({at:null,mode:"docked",trail:[],say:void 0,confidence:void 0,over:null}),o;default:return o}}var xo="graview:session";function Eo(e){let t=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);try{let n=e??sessionStorage,o=n.getItem(xo);if(o)return o;let r=t();return n.setItem(xo,r),r}catch{return t()}}var Rt={name:"share-where",title:"Where you are",description:"Whether the others here see which stop you are on.",honored:"root-attribute",options:[{value:"shared",label:"Shown"},{value:"private",label:"Hidden"}],initial:"shared"},Tt={name:"share-over",title:"What you point at",description:"Whether the others see the thing under your pointer, outlined in your color.",honored:"root-attribute",options:[{value:"private",label:"Kept to yourself"},{value:"shared",label:"Outlined for others"}],initial:"private"},ko=[Rt,Tt],Yr=800;function Ao(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:d,settingValues:s,setView:u,ttlMs:f=1e4,people:h,seats:p}=e,[g,b]=(0,V.useState)(()=>new Map),[k,m]=(0,V.useState)(null),[v,y]=(0,V.useState)(null),[x,P]=(0,V.useState)(null),N=typeof r.id=="string"&&r.id.length>0,L=N&&(s[Rt.name]??Rt.initial)==="shared",E=L&&(s[Tt.name]??Tt.initial)==="shared",R=At({kind:r.kind,...r.id?{id:r.id}:{},session:i}),C=N?Mn(r,{graph:n.graph,schema:n.schema,...p?{seats:p}:{},...h?{people:h}:{}}):"",G=d?a.get(`agent:${d}:${i}`):void 0,_=(0,V.useMemo)(()=>!t||!L?null:{participant:R,kind:r.kind,name:C,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:On(r.id??"nobody"),stop:x??Q(o),...E?{over:k}:{},...G?{robot:{at:G.at,mode:G.mode}}:{},at:new Date().toISOString()},[t,L,E,R,C,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,x,k,G?.at,G?.mode]);(0,V.useEffect)(()=>{if(!t||!_)return;t.here(_);let I=setInterval(()=>t.here({..._,at:new Date().toISOString()}),Yr);return()=>clearInterval(I)},[t,_]),(0,V.useEffect)(()=>t?t.onWho(K=>b(ut(new Map,K,Date.now(),f))):void 0,[t,f]);let ne=g.size>0;(0,V.useEffect)(()=>{if(!ne)return;let I=setInterval(()=>{b(K=>{let de=ut(K,[],Date.now(),f);return de.size===K.size?K:de})},Math.max(250,Math.min(1e3,f/4)));return()=>clearInterval(I)},[ne,f]),(0,V.useEffect)(()=>{if(!t||typeof window>"u")return;let I=()=>t.leave();return window.addEventListener("pagehide",I),()=>window.removeEventListener("pagehide",I)},[t]),(0,V.useEffect)(()=>{if(!E||typeof document>"u")return;let I=null,K=de=>{let z=uo(de.target);z!==I&&(I=z,m(z))};return document.addEventListener("pointermove",K,{passive:!0}),()=>document.removeEventListener("pointermove",K)},[E]);let oe=(0,V.useRef)(null),q=v?g.get(v)??null:null,be=(0,V.useCallback)(I=>{oe.current=null,y(I)},[]);return(0,V.useEffect)(()=>{if(v){if(!q){y(null);return}q.stop!==oe.current?.stop&&(oe.current={stop:q.stop,at:Date.now()},u(Ke(q.stop)))}},[v,q,u]),(0,V.useEffect)(()=>{let I=oe.current;!v||I===null||Date.now()-I.at<400||Gn(o,Ke(I.stop))||y(null)},[o,v]),(0,V.useEffect)(()=>{if(!v||typeof document>"u")return;let I=K=>{K.key==="Escape"&&y(null)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[v]),(0,V.useMemo)(()=>({who:g,sharing:_?{participant:R,name:C}:null,following:q,follow:be,sayWhere:P}),[g,_,R,C,q,be])}var Y=D(W(),1);function Po(e){return Ge(e.author)}function Zr(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function Ro(e,t,n,o,r){let i=new Map;for(let[s,u]of e)o-u.at<r&&i.set(s,u);let a=new Set(n.flatMap(s=>s.nodeIds)),d=(s,u,f)=>{let h=i.get(s),p=h?.participants.includes(Po(u))?h.participants:[...h?.participants??[],Po(u)];i.set(s,{at:o,manner:Zr(p,u.author.kind),intent:u.intent,wrote:(h?.wrote??!1)||(f.wrote??!1),read:(h?.read??!1)||(f.read??!1),broke:(h?.broke??!1)||a.has(s),participants:p})};for(let s of t){for(let u of s.writes)d(u,s,{wrote:!0});for(let u of s.reads)s.writes.includes(u)||d(u,s,{read:!0})}for(let s of n)for(let u of s.nodeIds){let f=i.get(u);i.set(u,{at:o,manner:f?.manner??"rule",intent:f?.intent??s.message,wrote:f?.wrote??!1,read:f?.read??!1,broke:!0,participants:f?.participants??["rule::"]})}return i}var Xr=2600;function To(e,t=Xr){let[n,o]=(0,Y.useState)(()=>new Map),r=(0,Y.useRef)(n);r.current=n;let i=(0,Y.useRef)(null),a=(0,Y.useCallback)(s=>{r.current=s,o(s),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,Y.useEffect)(()=>{let s=e.violations(),u=e.subscribe((f,h)=>{let p=e.violations(),g=Vn(e.allInvariants(),s,p).introduces;s=p,a(Ro(r.current,h,g.map(b=>({nodeIds:b.nodeIds,message:b.message})),Date.now(),t))});return()=>{u(),i.current&&clearTimeout(i.current)}},[e,t,a]);let d=(0,Y.useCallback)(s=>{s.reads.length!==0&&a(Ro(r.current,[Jr(s)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:d}}function Jr(e){return{id:`attention:${e.intent}`,seq:-1,batch:"attention",author:e.author,intent:e.intent,mutation:null,primitives:[],inverse:[],reads:e.reads,writes:[],at:new Date().toISOString()}}var l=D(W(),1);function Mo(){let e=null,t=new Set,n=new Set,o=r=>{for(let i of n)i(r)};return{subscribe(r){return t.add(r),t.size===1&&o(!0),()=>{t.delete(r),t.size===0&&(e=null,o(!1))}},snapshot:()=>e,set(r){if(!(e===r||e&&r&&e.x===r.x&&e.y===r.y)){e=r;for(let i of t)i()}},get listeners(){return t.size},onActive(r){return n.add(r),()=>void n.delete(r)}}}var Qe=D(W(),1),Qr=e=>e.definitions.some(t=>Rn(t).size>0);function Oo(e,t,n){let[o,r]=(0,Qe.useState)(void 0),i=(n.roles??[]).join("\0");return(0,Qe.useEffect)(()=>{if(!t||!Qr(e.schema)){r(void 0);return}let a=!0,d=!1,s=e.graph,u=()=>{d||(d=!0,queueMicrotask(()=>{d=!1,a&&e.reread()}))},f=Tn(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{}},u);return dt(s,f.read),r(f),e.reread(),()=>{a=!1,dt(s,void 0)}},[e,t,n.kind,n.id,i]),o}function Io(){let e=!1,t=new Set;return{moving:()=>e,set(n){if(n!==e){e=n;for(let o of t)o()}},subscribe(n){return t.add(n),()=>t.delete(n)}}}var le=D(Ie(),1),Ce=(0,l.createContext)(null),Lo=(0,l.createContext)("scene");function ei({mode:e,children:t}){return(0,le.jsx)(Lo.Provider,{value:e,children:t})}function ti(){return(0,l.useContext)(Lo)}var Ho={kind:"human"},ni=[],oi=[],ri=[],Mt=[];function Do(e,t){let n=(0,l.useId)();(0,l.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??Ho,r=()=>_n(e,o,n);r();let i,a=e.subscribe(()=>{clearTimeout(i),i=setTimeout(r,250)});return()=>{clearTimeout(i),a(),globalThis.__graviewWatch?.unseen?.({words:[],from:n,gone:!0})}},[e,t,n])}var ii={off:!0};function ai({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,seats:a=ni,onSeat:d,people:s=oi,memory:u,presenceTtlMs:f,app:h,settings:p=h?.settings??ri,presence:g,brand:b,locale:k,timeZone:m,onKeepLens:v,providers:y,ai:x,files:P,resolveApp:N,history:L,linkedRecords:E,menuSections:R,subscriptions:C,signIn:G,view:_,onViewChange:ne,children:oe}){let q=(0,l.useContext)(Ce),be=R??q?.menuSections,I=G??q?.signIn,[K,de]=(0,l.useState)(null),z=K??i??a[0]?.principal??Ho,Ve=kt(e,z,L),Bt=Ve.past&&Ve.live===e?Ve.past.store:e,H=(0,l.useMemo)(()=>Bt.seenBy(z),[Bt,z]);Do(e,z);let[re]=(0,l.useState)(()=>Eo(u)),[$t,Qo]=(0,l.useState)(!1),qt=(0,l.useCallback)(()=>Qo(!0),[]),ie=(0,l.useMemo)(()=>g?[...p,...ko]:p,[p,g]),[rt]=(0,l.useState)(()=>n??_t(t,e.schema)),[er,zt]=(0,l.useState)(()=>Be(rt??ce,r??rt?.selection??[])),xe=(0,l.useRef)(rt??ce).current,[Ut,tr]=(0,l.useState)(null),[Yt,nr]=(0,l.useState)(null),X=(0,l.useContext)(Ce),[Zt]=(0,l.useState)(()=>X?.seatTalk??xt(b?.name??e.schema.kinds.join(","))),it=x??X?.ai??yt,Le=(0,l.useMemo)(()=>it.off?ii:it,[it]),Xt=(0,l.useRef)(Le.interactions);Xt.current=Le.interactions;let[Jt]=(0,l.useState)(()=>X?.aiDesk??Et(()=>Xt.current)),[or]=(0,l.useState)(()=>X?.subscriptions??Cn()),Qt=C??X?.subscriptions??or,at=v??X?.onKeepLens,He=h??X?.app,De=k??X?.locale,rr=b?.locale??He?.brand?.locale,Ne=m??X?.timeZone;Pn({reader:De,app:rr,readerTimeZone:Ne,appTimeZone:b?.timeZone??He?.brand?.timeZone});let en=(0,l.useRef)(null),tn=(0,l.useCallback)(c=>{en.current=c},[]),nn=(0,l.useCallback)(c=>en.current?.whereIs(c)??null,[]),[on]=(0,l.useState)(()=>Mo()),[rn]=(0,l.useState)(()=>Io()),[st,ir]=(0,l.useState)(null),[Ee,an]=(0,l.useState)(()=>new Map),ke=(0,l.useRef)(Ee);ke.current=Ee;let Ae=(0,l.useRef)(null),lt=(0,l.useCallback)(c=>H.graph.getNode(c)?.kind,[H]),J=(0,l.useCallback)(c=>{let S=Pt(ke.current,c,lt);ke.current=S,an(S),Ae.current&&clearTimeout(Ae.current),[...S.values()].some(M=>M.mode!=="docked"&&M.mode!=="asking")&&(Ae.current=setTimeout(()=>{let M=Pt(ke.current,{type:"rest",at:Date.now(),holdMs:Ct},lt);ke.current=M,an(M)},Ct+20))},[lt]),sn=(0,l.useCallback)(c=>J({...c,at:c.at??Date.now()}),[J]),ln=(0,l.useCallback)(c=>{ir(c),c&&J({type:"home",author:{kind:"agent",id:c,session:re},at:Date.now()})},[J,re]);(0,l.useEffect)(()=>H.subscribe((c,S)=>{for(let T of S)T.author.kind==="agent"&&J({type:"write",author:T.author,ids:T.writes,at:Date.now()})}),[H,J]),(0,l.useEffect)(()=>()=>{Ae.current&&clearTimeout(Ae.current)},[]);let U=(0,l.useMemo)(()=>({...z,session:re}),[z,re]),dn=Oo(H,E,U),un=(0,l.useCallback)(c=>{de(c),d?.(c)},[d]),[Pe,ar]=(0,l.useState)(()=>Object.fromEntries(ie.map(c=>[c.name,So(c,u)])));(0,l.useEffect)(()=>{for(let c of ie)vo(c,Pe[c.name]??c.initial)},[ie,Pe]);let cn=(0,l.useCallback)((c,S)=>{let T=ie.find(M=>M.name===c);!T||!T.options.some(M=>M.value===S)||(wo(T,S,u),ar(M=>({...M,[c]:S})))},[ie,u]),[fn,sr]=(0,l.useState)(null),{activity:pn,noteAttention:yn}=To(H),mn=(0,l.useCallback)(c=>{yn(c),J({type:"read",author:c.author,ids:c.reads,at:Date.now()})},[yn,J]),ue=(0,l.useCallback)(c=>{if(pe(c)!==null||se(c).length>0||pt(c))return!0;let S=Wn(c);return S?H.graph.allEdges().some(T=>T.kind===S.kind&&T.from===S.from&&T.to===S.to):H.graph.getNode(c)!==void 0},[H]),gn=(0,l.useCallback)(c=>{let S=c.selection??Mt,T=S.filter(ue),M=T.length===S.length?c:Be(c,T);return M.focusId!==null&&!ue(M.focusId)&&(M=$(M,null)),M},[ue]),Re=(0,l.useCallback)(c=>{let S=gn(c),T=Vo(H,U,S.shown);if(S.focusId!==null&&T.size>0){let M=se(S.focusId),An=H.graph.getNode(S.focusId);(M.length>0?M.every(ur=>T.has(ur)):An?T.has(An.kind):!1)&&(S={...S,focusId:null})}if(!S.overview&&S.focusId===null){let M=xe.focusId!==null&&!ue(xe.focusId)?_t(t,e.schema)??{...ce,overview:!0}:xe;M.focusId!==null&&ue(M.focusId)?S={...S,focusId:M.focusId}:M.overview===!0&&(S={...S,overview:!0})}return S},[gn,ue,H,xe,U,t,e.schema]),B=Re(_??er),hn=(0,l.useMemo)(()=>Vo(H,U,B.shown),[H,U,B.shown]),Sn=(0,l.useMemo)(()=>[...H.modules.administered.entries()].map(([c,S])=>{let T=H.mayAdminister(c,U);return{name:c,...S.description?{description:S.description}:{},kinds:S.kinds??[],canShow:T,shown:T&&(B.shown??[]).includes(c)}}),[H,U,B.shown]),Te=(0,l.useCallback)(c=>{let S=T=>Re(typeof c=="function"?c(T):c);if(_!==void 0){ne?.(S(_));return}ne&&ne(S(B)),zt(T=>S(T))},[B,ne,_,Re]);(0,l.useEffect)(()=>{_===void 0&&zt(c=>{let S=Re(c);return S===c?c:S})},[B,_,Re]);let wn=B.selection??Mt,vn=(0,l.useCallback)(c=>{Te(S=>Be(S,typeof c=="function"?c(S.selection??Mt):c))},[Te]),{who:bn,following:xn,follow:En,sayWhere:lr,sharing:kn}=Ao({channel:g,store:H,view:B,principal:U,session:re,robots:Ee,seatWho:st,settingValues:Pe,setView:Te,seats:a,people:s,...f!==void 0?{ttlMs:f}:{}}),dr=(0,l.useMemo)(()=>({store:H,scheme:o,views:t,view:B,setView:Te,homeView:xe,selection:wn,setSelection:vn,menuAt:Ut,setMenuAt:tr,whereIs:nn,pointer:on,motion:rn,registerScene:tn,robots:Ee,noteSeat:sn,seatWho:st,registerSeatWho:ln,actsDoor:Yt,registerActsDoor:nr,seatTalk:Zt,aiDesk:Jt,...u?{memory:u}:{},who:bn,following:xn,follow:En,sayWhere:lr,sharing:kn,session:re,ai:Le,resolveApp:N,linkedRecords:E,menuSections:be,subscriptions:Qt,signIn:I,linkedReads:dn,movedByHand:$t,noteMoved:qt,emphasis:fn,setEmphasis:sr,activity:pn,noteAttention:mn,principal:U,seats:a,people:s,takeSeat:un,settings:ie,settingValues:Pe,chooseSetting:cn,hiddenKinds:hn,administered:Sn,...y?{providers:y}:{},...b?{brand:b}:{},...at?{onKeepLens:at}:{},app:He,...De?{locale:De}:{},...Ne?{timeZone:Ne}:{}}),[H,o,t,B,Te,wn,vn,Ut,nn,on,rn,tn,Ee,sn,st,ln,Yt,Zt,Jt,u,bn,xn,En,kn,re,Le,N,E,be,Qt,I,dn,$t,qt,fn,pn,mn,U,a,s,un,ie,Pe,cn,hn,Sn,y,b,at,He,De,Ne]);return(0,le.jsx)(Ce.Provider,{value:dr,children:(0,le.jsx)(Oe.Provider,{value:Ve,children:(0,le.jsx)(ci,{children:P?(0,le.jsx)(Ze.Provider,{value:P,children:oe}):oe})})})}var No=(0,l.createContext)(null),Ot,It=new Set,si=e=>(It.add(e),()=>void It.delete(e)),Co=()=>Ot;function li(e){if(!Ot){Ot=e;for(let t of[...It])t()}}var di=300;function ui(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,di)),r===t?e(n,o):[]}}function ci({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:d}=te(),s=et(),u=n.q,f=n.focusId,h=!!(u&&u.trim().length>0),p=(0,l.useSyncExternalStore)(si,Co,Co),g=(0,l.useMemo)(()=>h&&p?{flagged:new Set(t.violations().flatMap(x=>x.nodeIds)),touched:p.touchWeights(t.log.all())}:null,[t,s,h,p]),b=f?t.graph.getNode(f)?.kind??pe(f)??(se(f).length===1?se(f)[0]:void 0):void 0,k=(0,l.useMemo)(()=>d.near&&ui(d.near),[d.near]),m=(0,l.useMemo)(()=>!u||!g||!p?null:p.search(t,u,{...b?{inKind:b}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(x=>!i.has(x)),from:[...a,...f&&t.graph.has(f)?[f]:[]],flagged:g.flagged,touched:g.touched,limit:200,rank:k}),[t,u,r,o,i,a,f,b,g,k]),[v,y]=(0,l.useState)();return(0,l.useEffect)(()=>void m?.later?.then(x=>y([m,x])),[m]),(0,le.jsx)(No.Provider,{value:v?.[0]===m?v[1]:m,children:e})}var _o=new WeakMap;function Ba(e){let t=_o.get(e);return t||_o.set(e,t=new Set(e.matched)),t}function fi(){return(0,l.useContext)(No)}function te(){let e=(0,l.useContext)(Ce);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function Vt(){return(0,l.useContext)(Ce)??null}function et(){let{store:e}=te(),t=(0,l.useRef)(null),n=(0,l.useRef)(null),o=(0,l.useCallback)(()=>(n.current!==e&&(n.current=e,t.current=null),t.current??=e.graph.allNodes(),t.current),[e]),r=(0,l.useCallback)(i=>e.subscribe(()=>{t.current=null,i()}),[e]);return(0,l.useSyncExternalStore)(r,o,o)}function pi(e){let{store:t}=te(),n=(0,l.useCallback)(r=>t.subscribe(r),[t]),o=(0,l.useCallback)(()=>e===null?void 0:t.graph.getNode(e),[t,e]);return(0,l.useSyncExternalStore)(n,o,o)}function Vo(e,t,n){let o=new Set(e.modules.disabledKinds);for(let r of e.kindsKeptFrom(t))o.add(r);for(let[r,i]of e.modules.administered)if(!(e.mayAdminister(r,t)&&(n??[]).includes(r)))for(let a of i.kinds??[])o.add(a);return o}var Ct=2600;var jo=new WeakSet,yi=e=>jo.has(e),mi=e=>void jo.add(e);function _t(e,t){let n=Hn(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...ce,focusId:ee(n.place.kind),within:{view:n.place.as}}:{...ce,focusId:ee(n.kind)}}var Go=D(W(),1),gi=(0,Go.createContext)(!1);var tt=Symbol.for("graview.default-view");function Wo(e){return Object.defineProperty(e,tt,{value:!0,enumerable:!1}),e}function Fo(e){return typeof e=="function"&&e[tt]===!0}var Lt=Symbol.for("graview.replaces-page");function Ko(e){return typeof e=="function"&&e[Lt]===!0}function Si(e){return Ln(e)}function wi(e,t){if(t===e)return e;for(let r of t.registrations())e.register(r.kind,r,r.view,r);let n=t.arrangement?.();n&&e.arrange?.(n);let o=t.homeView?.();return o&&e.home?.(o),e}var he=D(W(),1);function vi(){let{selection:e,setSelection:t}=te();return(0,he.useMemo)(()=>({selection:e,set:n=>t(n),clear:()=>t([]),toggle:n=>t(o=>o.includes(n)?o.filter(r=>r!==n):[...o,n]),isSelected:n=>e.includes(n)}),[e,t])}function bi(){let{store:e}=te(),t=et();return(0,he.useMemo)(()=>xi(e),[e,t])}var Bo=new WeakMap;function xi(e){let t=Bo.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),Bo.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function Ei(){let{view:e,setView:t}=te();return(0,he.useMemo)(()=>({view:e,url:Q(e),focus:n=>t(o=>$(o,n)),show:n=>t(o=>Fn(o,n)),toggle:n=>t(o=>$e(o,n)),go:n=>t(n)}),[e,t])}var ge={at:0,depth:0,listeners:new Set,tell(){for(let e of this.listeners)e()}};typeof window<"u"&&window.addEventListener("popstate",e=>{let t=e.state;ge.at=typeof t?.graview=="number"?t.graview:0,ge.at>ge.depth&&(ge.depth=ge.at),ge.tell()});var j=D(W(),1),Dt={profile:{trigger:"profile-button",pane:"profile",opens:"press",focus:"into",drawn:["shell","embed"]},problems:{trigger:"standing",pane:"problems",opens:"press",focus:"into",drawn:["shell","embed"]},places:{trigger:"app-places-open",pane:"app-places",opens:"press",focus:"into",drawn:["embed"]},here:{trigger:"here-open",pane:"here-list",opens:"press",focus:"into",drawn:["shell","embed","pages"]},suggested:{trigger:"suggested-button",pane:"suggested",opens:"press",focus:"into",drawn:["shell","embed","pages"]},activity:{trigger:"activity-button",pane:"activity",opens:"press",focus:"into",drawn:["shell","embed","pages"]},find:{trigger:"find-box",pane:"find-strip",opens:"typing",focus:"stays",drawn:["shell"]},districts:{trigger:"beyond-more",pane:"beyond-list",opens:"press",focus:"into",drawn:["shell","embed"]},acts:{trigger:null,pane:"context-menu",opens:"context-menu",focus:"into",drawn:["shell","embed","pages"]},arrange:{trigger:"arrange-add",pane:"arrange-list",opens:"press",focus:"into",drawn:["pages"]},"studio-ask":{trigger:"studio-agent",pane:"studio-agent-panel",opens:"press",focus:"into",drawn:["studio"]}},ki={position:"fixed",inset:"auto",margin:0,zIndex:In("popover"),boxSizing:"border-box"},nt=6,Se=8,Ai=e=>typeof e.showPopover=="function";function ot(e){try{return e.matches(":popover-open")}catch{return!1}}function Pi(e){if(typeof e=="function"){let o=e();return o?{left:o.x,right:o.x,top:o.y,bottom:o.y}:null}let t=e.current;if(!t||!t.isConnected)return null;let n=t.getBoundingClientRect();return{left:n.left,right:n.right,top:n.top,bottom:n.bottom}}function Nt(e,t,n={}){let o=Pi(t);if(!o)return;let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},i=e.dataset.graviewDesignedHeight??=e.style.maxHeight;e.style.maxHeight=i;let a=e.getBoundingClientRect(),d=r.height-o.bottom-nt-Se,s=o.top-nt-Se,u=a.height<=d||d>=s,f=Math.max(96,Math.floor(u?d:s)),h=Math.min(a.height,f);a.height>f&&(e.style.maxHeight=i?`min(${i}, ${f}px)`:`${f}px`);let p=a.width,g=n.align==="start"?o.left:o.right-p,b=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();b&&p<=b.right-b.left&&(g<b.left?g=o.left+p<=b.right?o.left:b.left:g+p>b.right&&(g=o.right-p>=b.left?o.right-p:b.right-p));let k=p>=r.width-2*Se?Math.max(0,(r.width-p)/2):Math.max(Se,Math.min(g,r.width-Se-p)),m=u?o.bottom+nt:Math.max(Se,o.top-nt-h);e.style.left=`${Math.round(k)}px`,e.style.top=`${Math.round(m)}px`}function $o(e,t,n,o={}){let r=o.align??"end";(0,j.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(Ai(i)&&!ot(i))try{i.showPopover(),Ti()}catch{}let a=0,d=u=>{u?.target instanceof Node&&i.contains(u.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>Nt(i,n,{align:r})))};Nt(i,n,{align:r}),addEventListener("resize",d),addEventListener("scroll",d,!0);let s=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>d());return s?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",d),removeEventListener("scroll",d,!0),s?.disconnect(),i.isConnected&&ot(i))try{i.hidePopover()}catch{}}},[t,e,r])}var jt=new Set;function Ri(e){return jt.add(e),()=>jt.delete(e)}function Ti(){for(let e of jt)if(!(!e.isConnected||!ot(e)))try{e.hidePopover(),e.showPopover()}catch{}}var we=null,Mi='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function Oi(e){for(let t of e.querySelectorAll(Mi))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var Ht=()=>{let e=document.activeElement;return e===null||e===document.body};function Ii(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,d]=(0,j.useState)(!1),s=t.open??a,u=(0,j.useRef)(null),f=(0,j.useRef)(null),h=(0,j.useCallback)(y=>{u.current=y},[]),p=(0,j.useCallback)(y=>{f.current=y},[]),g=`graview-popover-${(0,j.useId)().replace(/:/g,"")}`,b=(0,j.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});b.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let k=(0,j.useCallback)(y=>{b.current.controlled||d(y),b.current.onOpenChange?.(y)},[]),m=(0,j.useCallback)(()=>{(document.querySelector(`[aria-controls="${g}"]`)??u.current??b.current.returnTo?.()??null)?.focus({preventScroll:!0})},[g]),v=(0,j.useCallback)(y=>{let x=f.current,P=typeof document>"u"?null:document.activeElement,N=P===null||P===document.body||x!==null&&x.contains(P);k(!1),!(!y||!N)&&(m(),requestAnimationFrame(()=>{Ht()&&m()}))},[k,m]);return $o(f,i&&s,n??u,t.align?{align:t.align}:{}),(0,j.useEffect)(()=>{if(!i||!s)return;let y={name:e,close:()=>v(!1)};if(we&&we.close!==y.close&&we.close(),we=y,Dt[e].focus==="into"){let R=f.current;R&&!R.contains(document.activeElement)&&Oi(R).focus({preventScroll:!0})}let x=R=>{R.key==="Escape"&&v(!0)},P=R=>{let C=R.target;if(!(C instanceof Node))return;let G=f.current;if(G?.contains(C)||u.current?.contains(C))return;let _=C instanceof Element?C.closest('[role="dialog"], [role="alertdialog"]'):null;_&&!(G&&_.contains(G))||(v(!1),Dt[e].focus==="into"&&requestAnimationFrame(()=>{(Ht()||G!==null&&G.contains(document.activeElement))&&m()}))},N=null,L=null,E=R=>{let C=R.target;if(!(C instanceof Element))return;let G=f.current,_=C.closest('[role="dialog"], [role="alertdialog"]');!_||G&&(G.contains(_)||_.contains(G))||(N=_,v(!1))};return document.addEventListener("keydown",x),document.addEventListener("pointerdown",P,!0),document.addEventListener("focusin",E),()=>{document.removeEventListener("keydown",x),document.removeEventListener("pointerdown",P,!0),document.removeEventListener("focusin",E);let R=N;R&&typeof MutationObserver<"u"&&(L?.disconnect(),L=new MutationObserver(()=>{R.isConnected||(L?.disconnect(),requestAnimationFrame(()=>{(Ht()||document.activeElement.closest("[hidden]")!==null)&&m()}))}),L.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>L?.disconnect(),10*6e4)),we?.close===y.close&&(we=null)}},[i,s,e,v,m]),{open:s,setOpen:y=>y?k(!0):v(!0),toggle:()=>s?v(!0):k(!0),trigger:{ref:h,"aria-expanded":s,"aria-controls":g,"data-graview-popover-trigger":e},pane:{ref:p,id:g,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var F=D(W(),1),Z=D(Ie(),1),Gt=new Set,qo=!1;function Wt(){for(let e of[...Gt])e()}function Ci(){qo||typeof window>"u"||(qo=!0,window.addEventListener("online",Wt))}function _i(e){let t,n=!1,o=!1,r,i=0,a=new Set,d=()=>{i+=1;for(let p of[...a])p()},s=p=>(a.add(p),()=>void a.delete(p)),u=()=>i,f=()=>void h().catch(()=>{});function h(){if(n)return Promise.resolve(t);if(r)return r;let p=e().then(g=>(t=g,n=!0,o=!1,r=void 0,Gt.delete(f),d(),g),g=>{throw r=void 0,o=!0,Gt.add(f),Ci(),d(),g});return p.catch(()=>{}),r=p,p}return{load:h,prefetch:f,get current(){return t},get failed(){return o},part(p,g={}){let b=g.what??"This part";function k(y){(0,F.useSyncExternalStore)(s,u,u);let x=(0,F.useRef)(null),P=(0,F.useRef)(null),N=(0,F.useRef)(!1);return(0,F.useEffect)(()=>{o&&r===void 0&&f()},[]),n&&typeof document<"u"&&x.current!==null&&document.activeElement===x.current&&(N.current=!0),(0,F.useLayoutEffect)(()=>{if(!(!n||!N.current)){N.current=!1;for(let L=P.current?.nextElementSibling??null;L!==null;L=L.nextElementSibling){let E=L.matches(zo)?L:L.querySelector(zo);if(E instanceof HTMLElement){E.focus();return}}}}),n?(0,Z.jsxs)(Z.Fragment,{children:[N.current?(0,Z.jsx)("span",{ref:P,hidden:!0}):null,p(t,y)]}):g.quiet?null:(0,Z.jsx)(Vi,{what:b,button:x,...g.as?{as:g.as}:{}})}let m=(0,F.lazy)(()=>h().then(()=>({default:k}),()=>({default:k})));function v(y){let[x]=(0,F.useState)(()=>n||o);return(0,F.createElement)(x?k:m,y)}return v}}}var zo="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function Vi({what:e,button:t,as:n="p"}){let r=typeof navigator<"u"&&navigator.onLine===!1?`${e} will load when you're back online.`:`${e} didn't load.`;return(0,Z.jsxs)(n,{"data-testid":"lazy-part-missing",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,Z.jsx)("span",{role:"status",children:r})," ",(0,Z.jsx)("button",{ref:t,type:"button","data-testid":"lazy-part-retry",onClick:Wt,style:{font:"inherit",fontWeight:600,color:"var(--graview-ink)",background:"none",border:"1px solid var(--graview-edge)",borderRadius:6,padding:"2px 10px"},children:"Try again"})]})}var ve=D(W(),1);var Uo=(0,ve.createContext)(null);function Li(){let e=(0,ve.useContext)(Uo),t=Vt(),n=(o,r,i)=>t?.setView(a=>ae(ae(fe($(a,ee(o)),!1),"view",r),"filter",i?.filter??null));return(0,ve.useMemo)(()=>e??{record:o=>{t&&(t.setView(r=>$(fe(r,!1),o)),t.setSelection([o]))},place:(o,r)=>{let i=t?.views.places().find(a=>a.as===o);i&&n(i.kind,i.as,r)},list:(o,r)=>n(o,null,r)},[e,t])}var Yo=D(W(),1),Hi=(0,Yo.createContext)(!1);var Zo=D(W(),1),Di=(0,Zo.createContext)(null);var Xo=D(W(),1),Ft='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',Kt=e=>e instanceof HTMLElement&&(e.matches(Ft)||e.hasAttribute("tabindex")),_e=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function Ni(e,t){let n=s=>s.replace(/["\\]/g,"\\$&"),o=t.getAttribute("data-testid"),r=t.getAttribute("data-graview-pick"),i=t.getAttribute("aria-label"),a=o?`[data-testid="${n(o)}"]`:r?`[data-graview-pick="${n(r)}"]`:i?`${t.tagName.toLowerCase()}[aria-label="${n(i)}"]`:null;if(!a)return null;let d=e.querySelector(a);return d&&Kt(d)&&_e(d)?d:null}var ji=e=>e.isConnected&&Kt(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&_e(e);function Jo(e,t){let n=t?Ni(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&_e(o))return o;for(let r of e.querySelectorAll(Ft))if(_e(r))return r;return Kt(e)&&_e(e)?e:null}function Gi(e){(0,Xo.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=m=>{let v=m.target;if(v instanceof Element){n=[];for(let y=v;y&&y!==t.parentElement;y=y.parentElement)n.push(y)}},r=!1,i=!1,a=t.ownerDocument,d=()=>!i&&a.defaultView!==null,s=(m,v)=>void setTimeout(()=>d()&&v(),m),u=m=>void requestAnimationFrame(()=>d()&&m()),f=m=>{if(r=!1,i)return;let v=a.activeElement;if(!(!(v===null||v===a.body||v===a.documentElement)||n.length===0)){if(ji(n[0])){m&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let x of n.slice(1)){if(!x.isConnected)continue;let P=Jo(x,n[0]);if(P){P.focus({preventScroll:!0}),n=[];return}}}},h=(m,v=Date.now()+2500)=>{s(100,()=>{f(m);let y=a.activeElement;(y===null||y===a.body||y===a.documentElement)&&n.length>0&&Date.now()<v&&h(m,v)})},p=()=>{r||n.length===0||(r=!0,s(60,()=>u(()=>{f(!1),h(!1)})))},g=m=>{if(!(m instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(m.key))){if(!(m instanceof KeyboardEvent)){let v=m.target instanceof Element?m.target.closest(Ft):null,y=a.activeElement,x=y===null||y===a.body||y===a.documentElement;if(v&&x&&t.contains(v)){n=[];for(let P=v;P&&P!==t.parentElement;P=P.parentElement)n.push(P);s(150,()=>u(()=>{f(!1),h(!1)}));return}}!(m instanceof KeyboardEvent)&&!(m.target instanceof Node&&n[0]?.contains(m.target))||s(150,()=>u(()=>{f(!0),h(!0)}))}},b=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&p()}),k=m=>{m.relatedTarget===null&&p()};return t.addEventListener("focusin",o),t.addEventListener("focusout",k),t.addEventListener("click",g),t.addEventListener("keydown",g),b.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",k),t.removeEventListener("click",g),t.removeEventListener("keydown",g),b.disconnect()}},[e])}export{Nn as a,ce as b,Q as c,Ke as d,Ki as e,Bi as f,Gn as g,jn as h,Wn as i,ct as j,$ as k,Fn as l,ae as m,fe as n,Be as o,Me as p,$e as q,ze as r,ft as s,pe as t,zi as u,yr as v,ee as w,Kn as x,se as y,Bn as z,mr as A,Ui as B,$n as C,pt as D,gr as E,W as F,xt as G,Hr as H,Nr as I,uo as J,Ze as K,jr as L,Oe as M,fo as N,Gr as O,kt as P,Ie as Q,ei as R,ti as S,Do as T,ai as U,li as V,Ba as W,fi as X,te as Y,Vt as Z,et as _,pi as $,yi as aa,mi as ba,_t as ca,Uo as da,Li as ea,gi as fa,Wo as ga,Fo as ha,Ko as ia,Si as ja,wi as ka,Hi as la,Di as ma,vi as na,bi as oa,Ei as pa,ge as qa,Gi as ra,ki as sa,ot as ta,$o as ua,Ri as va,Ii as wa,_i as xa};
|
|
2
|
-
/*! Bundled license information:
|
|
3
|
-
|
|
4
|
-
react/cjs/react.production.js:
|
|
5
|
-
(**
|
|
6
|
-
* @license React
|
|
7
|
-
* react.production.js
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the MIT license found in the
|
|
12
|
-
* LICENSE file in the root directory of this source tree.
|
|
13
|
-
*)
|
|
14
|
-
|
|
15
|
-
react/cjs/react-jsx-runtime.production.js:
|
|
16
|
-
(**
|
|
17
|
-
* @license React
|
|
18
|
-
* react-jsx-runtime.production.js
|
|
19
|
-
*
|
|
20
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the MIT license found in the
|
|
23
|
-
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*)
|
|
25
|
-
*/
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import{a as I,j as M,k as O}from"./chunk.ELY2RMGE.js";import"./chunk.UV2TSAB4.js";import{g as P}from"./chunk.6SK2K72G.js";import{l as D}from"./chunk.NNNVB6RV.js";import"./chunk.7OLVQ2FZ.js";import"./chunk.NOZEHLWG.js";import{b as C}from"./chunk.UVLPVHID.js";import"./chunk.QXARGANF.js";import{F as q,Q as F}from"./chunk.DNNL7F3P.js";import{ba as L,pc as E}from"./chunk.HBBVVALN.js";import{b as N}from"./chunk.AJZBJBMO.js";var f=N(q(),1);var n=N(F(),1),R=40,B=60;function T(l,o,s){return l.allNodes().filter(i=>i.kind===o).map(i=>i[s])}function Y(l){if(l.length<2)return[];let o=[...l].sort((a,d)=>a-d),s=o[o.length-1]-o[0];if(s<=0)return[];let i=Math.max(1,10**Math.floor(Math.log10(s/4))),e=s/4>=i*5?i*5:i,t=a=>Math.round(a/e)*e;return[...new Set([.2,.4,.6,.8].map(a=>t(o[Math.floor(a*(o.length-1))])))].filter(a=>a>0)}function _(l,o,s){let i=new Set(s.far??[]),e=new Map;for(let t of o.allNodes())i.has(t.kind)&&e.set(t.id,L(l.tryDefinition(t.kind),t));return[...e.entries()].map(([t,a])=>({id:t,label:a}))}function K(l,o,s){let i=_(l,o,s);return(i.length<=R?i:i.map(t=>({end:t,ties:o.out(t.id).length+o.in(t.id).length})).sort((t,a)=>a.ties-t.ties||t.end.label.localeCompare(a.end.label)).slice(0,R).map(t=>t.end)).sort((t,a)=>t.label.localeCompare(a.label))}function U(l,o,s){let i=[];for(let e of s.filters){let t=i.length;if(e.about==="is")for(let a of e.options??[])i.push({value:`is:${a}`,label:a,group:e.label,condition:{key:"is",value:a}});else if(e.about==="edge"){i.push({value:`${e.key}:*`,label:"anything",group:e.label,condition:{key:e.key,value:"*"}}),i.push({value:`${e.key}:none`,label:"nothing",group:e.label,condition:{key:e.key,value:"none"}});for(let a of K(l,o,e))i.push({value:`${e.key}:${a.id}`,label:a.label,group:e.label,condition:{key:e.key,value:a.id}})}else if(e.type==="date")for(let a of["before","after","on"])i.push({value:`${e.key}:${a}`,label:`${a}\u2026`,group:e.label,ask:{key:e.key,op:a,label:e.label}});else if(e.type==="number"){let a=l.tryDefinition(s.kind),d=Y(T(o,s.kind,e.key).filter(p=>typeof p=="number"));for(let p of["at-most","at-least"])for(let v of p==="at-most"?d:[...d].reverse())i.push({value:`${e.key}:${p}:${v}`,label:`${p==="at-most"?"at most":"at least"} ${C(a,e.key,v)}`,group:e.label,condition:{key:e.key,value:`${p}:${v}`}})}else if(e.type==="text"){let a=[...new Set(T(o,s.kind,e.key).filter(d=>typeof d=="string"&&d.length>0&&!d.includes(",")))].sort((d,p)=>d.localeCompare(p));if(a.length>=2&&a.length<=B)for(let d of a)i.push({value:`${e.key}:${d}`,label:d,group:e.label,condition:{key:e.key,value:d}})}else if(e.type==="boolean")i.push({value:`${e.key}:true`,label:"yes",group:e.label,condition:{key:e.key,value:"true"}}),i.push({value:`${e.key}:false`,label:"no",group:e.label,condition:{key:e.key,value:"false"}});else if(e.about==="via"){let a=l.tryDefinition(e.far?.[0]??"");for(let d of e.options??[])i.push({value:`${e.key}:${d}`,label:C(a,e.key.split(".")[1],d),group:e.label,condition:{key:e.key,value:d}})}else for(let a of e.options??[])i.push({value:`${e.key}:${a}`,label:C(l.tryDefinition(s.kind),e.key,a),group:e.label,condition:{key:e.key,value:a}});for(let a=t;a<i.length;a++)i[a]={...i[a],key:e.key}}return i}function V(l,o,s,i){let e=l.tryDefinition(o);return["at-most","at-least"].map(t=>({value:`${s.key}:${t}:${i}`,label:`${t==="at-most"?"at most":"at least"} ${C(e,s.key,i)}`,group:s.label,key:s.key,condition:{key:s.key,value:`${t}:${i}`}}))}function G(l){let o=l.trim().replace(/(?<=\d),(?=\d{3}\b)/g,"");return/^-?\d+(\.\d+)?$/.test(o)?Number(o):null}function j(l,o,s){let i=U(l,o,s);return s.filters.flatMap(e=>{let t=i.filter(d=>d.key===e.key);if(e.type==="number"&&e.about!=="edge")return[{key:e.key,label:e.label,entries:t,atNumber:d=>V(l,s.kind,e,d)}];if(t.length===0)return[];if(e.about!=="edge")return[{key:e.key,label:e.label,entries:t}];let a=_(l,o,e);return a.length<I?[{key:e.key,label:e.label,entries:t}]:[{key:e.key,label:e.label,entries:t.filter(d=>d.value===`${e.key}:*`||d.value===`${e.key}:none`),typed:[...a].sort((d,p)=>d.label.localeCompare(p.label))}]})}var z=8;function H(l,o){let s=o.trim().toLocaleLowerCase();if(!s)return{shown:[],more:0};let e=[...l.filter(t=>t.label.toLocaleLowerCase().includes(s))].sort((t,a)=>+!t.label.toLocaleLowerCase().startsWith(s)-+!a.label.toLocaleLowerCase().startsWith(s));return{shown:e.slice(0,z),more:Math.max(0,e.length-z)}}var J=["day","week","month","year","decade"];function le(l){let{which:o,schema:s,graph:i,offers:e,arrangement:t,set:a,toggle:d,has:p,done:v}=l,m=l.testId,A=(0,f.useRef)(null);(0,f.useEffect)(()=>{let u=A.current?.closest("[data-graview-popover]");!u||document.activeElement!==u||(u.querySelector('[aria-pressed="true"]')??u.querySelector("button, input"))?.focus({preventScroll:!0})},[]);let y=t.sort?e.sorts.find(u=>u.key===t.sort.by):void 0,S=t.group?e.groups.find(u=>u.key===t.group.by):void 0,b=O(y),r=e.natural?e.sorts.find(u=>u.key===e.natural.by):void 0,k=o==="filter"||o==="all"&&l.parts?.filter?j(s,i,e):[],w=u=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:"Sort by"}),(0,n.jsx)($,{testId:`${m}-sort-default`,value:"",on:!t.sort,onPress:()=>(a({sort:void 0}),u()),children:r?`As declared (${M(r.label)})`:"As they were added"}),e.sorts.map(g=>(0,n.jsx)($,{value:g.key,on:t.sort?.by===g.key,onPress:()=>(a({sort:{by:g.key,direction:t.sort?.direction??"asc"}}),u()),children:g.label},g.key)),t.sort?(0,n.jsxs)("div",{role:"group","aria-label":"Order","data-testid":`${m}-direction`,children:[(0,n.jsx)("p",{"aria-hidden":"true",children:"Order"}),["asc","desc"].map(g=>(0,n.jsx)($,{testId:`${m}-direction-${g}`,value:g,on:t.sort.direction===g,onPress:()=>(a({sort:{by:t.sort.by,direction:g}}),u()),children:b[g]},g))]}):null]}),c=u=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:"Group by"}),(0,n.jsx)($,{testId:`${m}-group-none`,value:"",on:!t.group,onPress:()=>(a({group:void 0}),u()),children:"Not grouped"}),e.groups.map(g=>(0,n.jsx)($,{value:g.key,on:t.group?.by===g.key,onPress:()=>(a({group:{by:g.key}}),u()),children:g.label},g.key)),t.group&&S?.buckets?(0,n.jsxs)("div",{role:"group","aria-label":"How wide a group is","data-testid":`${m}-bucket`,children:[(0,n.jsx)("p",{"aria-hidden":"true",children:"Each group"}),J.map(g=>(0,n.jsx)($,{testId:`${m}-bucket-${g}`,value:g,on:(t.group.bucket??"day")===g,onPress:()=>(a({group:{by:t.group.by,bucket:g}}),u()),children:`A ${g}`},g))]}):null]}),x=u=>(0,n.jsx)(Q,{sections:k,has:p,testId:m,onToggle:g=>(d(g),u())}),h=l.parts??{sort:!0,group:!0,filter:!0};return(0,n.jsxs)("div",{ref:A,style:{display:"contents"},children:[(0,n.jsx)("style",{children:Z}),o==="sort"?w(v):o==="group"?c(v):o==="filter"?x(v):(0,n.jsxs)(n.Fragment,{children:[h.sort?(0,n.jsx)("div",{role:"group","aria-label":"Sort",children:w(v)}):null,h.group?(0,n.jsx)("div",{role:"group","aria-label":"Group",children:c(v)}):null,h.filter?(0,n.jsx)("div",{role:"group","aria-label":"Filter",children:x(v)}):null]})]})}function $({value:l,on:o,onPress:s,testId:i,children:e}){return(0,n.jsx)("button",{type:"button",className:"graview-arrange-item",value:l,"data-value":l,"aria-pressed":o,onClick:s,...i?{"data-testid":i}:{},children:e})}function Q({sections:l,has:o,testId:s,onToggle:i}){let[e,t]=(0,f.useState)(null),[a,d]=(0,f.useState)(""),[p,v]=(0,f.useState)(()=>new Set(l.length===1?[l[0].key]:[])),[m,A]=(0,f.useState)({});if(e)return(0,n.jsx)(X,{ask:e,testId:s,onDay:r=>i({key:e.key,value:`${e.op}:${r}`}),onCancel:()=>t(null)});let y=r=>(0,n.jsx)($,{value:r.value,on:r.condition?o(r.condition):!1,onPress:()=>r.condition?i(r.condition):t(r.ask),children:r.label},r.value),S=(r,k)=>{let w=(r.typed??[]).filter(h=>o({key:r.key,value:h.id})),c=H(r.typed??[],k),x=[...w,...c.shown.filter(h=>!w.includes(h))];return(0,n.jsxs)(n.Fragment,{children:[x.map(h=>y({value:`${r.key}:${h.id}`,label:h.label,group:r.label,key:r.key,condition:{key:r.key,value:h.id}})),k.trim()&&c.shown.length===0?(0,n.jsx)("span",{className:"graview-arrange-none",children:"None is called that."}):null,c.more>0?(0,n.jsx)("span",{className:"graview-arrange-none",children:`${c.more} more \u2014 type more of the name`}):null]})},b=a.trim().toLocaleLowerCase();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("label",{className:"graview-arrange-find",children:[(0,n.jsx)("span",{style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:"Find a filter"}),(0,n.jsx)("input",{type:"search","data-testid":`${s}-filter-find`,value:a,placeholder:"Find a filter, a name or a number\u2026",onChange:r=>d(r.target.value)})]}),l.map(r=>{let k=r.entries.filter(c=>c.condition&&o(c.condition)).length+(r.typed??[]).filter(c=>o({key:r.key,value:c.id})).length;if(b){let c=r.label.toLocaleLowerCase().includes(b),x=r.atNumber&&G(b)!==null?r.atNumber(G(b)):[],h=[...x,...c?r.entries:r.entries.filter(g=>g.label.toLocaleLowerCase().includes(b)&&!x.some(W=>W.value===g.value))],u=r.typed?H(r.typed,b):{shown:[],more:0};return h.length===0&&u.shown.length===0?null:(0,n.jsxs)("div",{role:"group","aria-label":r.label,"data-section":r.key,children:[(0,n.jsx)("p",{"aria-hidden":"true",children:r.label}),h.map(y),r.typed?S(r,b):null]},r.key)}if(r.entries.length===0&&!r.typed)return null;let w=p.has(r.key);return(0,n.jsxs)("div",{role:"group","aria-label":r.label,"data-section":r.key,children:[(0,n.jsxs)("button",{type:"button",className:"graview-arrange-section","data-testid":`${s}-section`,"data-key":r.key,"aria-expanded":w,onClick:()=>v(c=>c.has(r.key)?new Set([...c].filter(x=>x!==r.key)):new Set([...c,r.key])),children:[(0,n.jsx)("span",{children:r.label}),k>0?(0,n.jsx)("span",{className:"graview-arrange-on",children:`${k} on`}):null]}),w?(0,n.jsxs)(n.Fragment,{children:[r.typed?(0,n.jsx)("input",{type:"search",className:"graview-arrange-far","data-testid":`${s}-far-find`,"data-key":r.key,"aria-label":`${r.label}: type a name`,placeholder:`Type a name (${r.typed.length})\u2026`,autoFocus:!0,value:m[r.key]??"",onChange:c=>A({...m,[r.key]:c.target.value})}):null,r.entries.map(y),r.typed?S(r,m[r.key]??""):null]}):null]},r.key)})]})}function X({ask:l,testId:o,onDay:s,onCancel:i}){let[e,t]=(0,f.useState)(""),a=/^\d{4}-\d{2}-\d{2}$/.test(e)&&Number(e.slice(0,4))>=1e3,d=()=>{a&&s(e)};return(0,n.jsxs)("div",{role:"group","aria-label":`${l.label} ${l.op} which day`,"data-testid":`${o}-ask-day`,className:"graview-arrange-ask",children:[(0,n.jsx)("p",{"aria-hidden":"true",children:`${l.label} ${l.op}`}),(0,n.jsx)("input",{type:"date","data-testid":`${o}-day`,"aria-label":`${l.label} ${l.op} which day`,autoFocus:!0,value:e,onChange:p=>t(p.target.value),onKeyDown:p=>{p.key==="Enter"?(p.preventDefault(),d()):p.key==="Escape"&&(p.preventDefault(),p.stopPropagation(),p.nativeEvent.stopImmediatePropagation(),i())}}),(0,n.jsxs)("span",{children:[(0,n.jsx)("button",{type:"button","data-testid":`${o}-day-add`,disabled:!a,onClick:d,children:"Add"}),(0,n.jsx)("button",{type:"button",onClick:i,children:"Never mind"})]})]})}var Z=`
|
|
2
|
-
.graview-arrange-list{display:grid;align-content:start;width:min(300px,calc(100vw - 24px));height:auto;max-height:min(70vh,520px);overflow:auto;overscroll-behavior:contain;margin:0;padding:0 6px 6px;border-radius:10px;border:1px solid var(--graview-edge);background:linear-gradient(var(--graview-float),var(--graview-float)),var(--graview-panel);box-shadow:var(--graview-lift-high);color:var(--graview-ink);font-size:.875rem;line-height:1.3}
|
|
3
|
-
.graview-arrange-list>*:first-child:not(.graview-arrange-find){margin-top:6px}
|
|
4
|
-
@media (max-width:519px){.graview-arrange-list{left:0!important;right:0!important;top:auto!important;bottom:0!important;width:100%!important;max-height:min(80dvh,560px)!important;border-radius:14px 14px 0 0;padding-bottom:calc(10px + env(safe-area-inset-bottom))}}
|
|
5
|
-
.graview-arrange-find{position:sticky;top:0;z-index:${E.raised};display:block;margin:0 -6px 2px;padding:6px;background:linear-gradient(var(--graview-float),var(--graview-float)),var(--graview-panel);border-bottom:1px solid var(--graview-edge)}
|
|
6
|
-
.graview-arrange-find input,.graview-arrange-far{box-sizing:border-box;width:100%;min-height:32px;margin:0;padding:0 8px;border:1px solid var(--graview-edge);border-radius:7px;background:var(--graview-panel);font:inherit;color:var(--graview-ink)}
|
|
7
|
-
.graview-arrange-far{width:calc(100% - 16px);margin:2px 8px 4px}
|
|
8
|
-
.graview-arrange-section{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:32px;margin:0;padding:6px 8px;border:0;border-radius:7px;background:none;font:inherit;font-weight:600;text-align:left;color:var(--graview-ink);cursor:pointer}
|
|
9
|
-
.graview-arrange-section::after{content:"";flex:0 0 7px;height:7px;margin-left:auto;border:solid var(--graview-ink-muted);border-width:0 1.5px 1.5px 0;transform:rotate(-45deg)}
|
|
10
|
-
.graview-arrange-section[aria-expanded=true]::after{transform:rotate(45deg)}
|
|
11
|
-
.graview-arrange-section:hover{background:color-mix(in srgb,var(--graview-ink) 7%,transparent)}
|
|
12
|
-
.graview-arrange-on{font-weight:400;color:var(--graview-accent)}
|
|
13
|
-
.graview-arrange-none{display:block;padding:4px 8px 6px 28px;color:var(--graview-ink-muted)}
|
|
14
|
-
.graview-arrange-list [role=group]{display:grid}
|
|
15
|
-
.graview-arrange-list p{margin:8px 8px 2px;font-size:.6875rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--graview-ink-muted)}
|
|
16
|
-
.graview-arrange-item{display:flex;align-items:flex-start;gap:8px;width:100%;min-height:30px;margin:0;padding:6px 8px;border:0;border-radius:7px;background:none;font:inherit;text-align:left;color:var(--graview-ink);cursor:pointer;overflow-wrap:anywhere}
|
|
17
|
-
.graview-arrange-item::before{content:"";flex:0 0 12px}
|
|
18
|
-
.graview-arrange-item[aria-pressed=true]{font-weight:600}
|
|
19
|
-
.graview-arrange-item[aria-pressed=true]::before{content:"\u2713";color:var(--graview-accent)}
|
|
20
|
-
.graview-arrange-item:hover{background:color-mix(in srgb,var(--graview-ink) 7%,transparent)}
|
|
21
|
-
.graview-arrange-ask{display:grid;gap:8px;padding:0 8px 8px}
|
|
22
|
-
.graview-arrange-ask p{margin:8px 0 0}
|
|
23
|
-
.graview-arrange-ask input{box-sizing:border-box;width:100%;min-height:32px;padding:0 8px;border:1px solid var(--graview-edge);border-radius:7px;background:var(--graview-panel);font:inherit;color:var(--graview-ink)}
|
|
24
|
-
.graview-arrange-ask span{display:flex;gap:8px}
|
|
25
|
-
.graview-arrange-ask button{min-height:30px;padding:0 12px;border:1px solid var(--graview-edge);border-radius:7px;background:var(--graview-panel);font:inherit;color:var(--graview-ink);cursor:pointer}
|
|
26
|
-
.graview-arrange-ask button:disabled{opacity:.5;cursor:default}
|
|
27
|
-
`;function se({offers:l,chips:o,schema:s,graph:i,kind:e,arrangement:t,has:a,choose:d,testId:p}){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("style",{children:re}),(0,n.jsx)(ee,{offers:l,chips:o,schema:s,graph:i,kind:e,arrangement:t,has:a,choose:d,testId:p})]})}function ee({offers:l,chips:o,schema:s,graph:i,kind:e,arrangement:t,has:a,choose:d,testId:p}){let v={schema:s,graph:i,...o.flagged?{flagged:o.flagged}:{},...o.today?{today:o.today}:{}},m=s.tryDefinition(e),A=o.nodes.filter(y=>!t.query||P(v,y,t.query));return(0,n.jsx)("div",{className:"graview-arrange-chips","data-testid":`${p}-chips`,children:l.map(y=>{let S=(t.filter??[]).filter(r=>r.key!==y.key),b=new Map;for(let r of A){if(!S.every(w=>D(v,r,w)))continue;let k=String(r[y.key]);b.set(k,(b.get(k)??0)+1)}return(0,n.jsxs)("div",{role:"group","aria-label":y.label,className:"graview-arrange-chip-row","data-field":y.key,children:[(0,n.jsx)("span",{className:"graview-arrange-chip-label","aria-hidden":"true",children:y.label}),(y.options??[]).filter(r=>(b.get(r)??0)>0||a({key:y.key,value:r})).map(r=>{let k=C(m,y.key,r),w=b.get(r)??0;return(0,n.jsxs)("button",{type:"button",className:"graview-arrange-chip","data-testid":`${p}-chip`,"data-value":`${y.key}:${r}`,"aria-pressed":a({key:y.key,value:r}),"aria-label":`${y.label}: ${k}, ${w}`,onClick:()=>d(y.key,r),children:[k,(0,n.jsx)("span",{className:"graview-arrange-chip-count","aria-hidden":"true",children:w})]},r)})]},y.key)})})}var re=`
|
|
28
|
-
.graview-arrange-chips,.graview-arrange-chip-row{display:contents}
|
|
29
|
-
@container (max-width:519px){.graview-arrange-chips{display:flex;flex:1 1 10rem;align-items:center;gap:6px;min-width:0;overflow-x:auto;scrollbar-width:none}.graview-arrange-chip-label{margin:0}.graview-arrange-chip{flex:0 0 auto;white-space:nowrap}}
|
|
30
|
-
.graview-arrange-chip-label{margin:0 0 0 8px;font-size:.8125rem;color:var(--graview-ink-muted)}
|
|
31
|
-
.graview-arrange-chip{display:inline-flex;align-items:center;gap:6px;min-height:28px;max-width:100%;box-sizing:border-box;margin:0;padding:0 10px;border:1px solid var(--graview-edge);border-radius:999px;background:var(--graview-panel);font:inherit;font-size:.8125rem;line-height:1.2;color:var(--graview-ink);cursor:pointer;overflow-wrap:anywhere;text-align:left}
|
|
32
|
-
.graview-arrange-chip:hover{border-color:var(--graview-edge-bright,var(--graview-edge))}
|
|
33
|
-
.graview-arrange-chip[aria-pressed=true]{border-color:var(--graview-accent);background:color-mix(in srgb,var(--graview-accent) 12%,var(--graview-panel));font-weight:600}
|
|
34
|
-
.graview-arrange-chip-count{color:var(--graview-ink-muted);font-variant-numeric:tabular-nums;font-weight:400}
|
|
35
|
-
`;export{se as ArrangeChips,le as ArrangeLists,R as FAR_ENDS,z as TYPED_MATCHES,U as filterEntries,j as filterSections,Y as roundSteps,H as typedMatches,G as typedNumber};
|
|
@@ -1,19 +0,0 @@
|
|
|
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{d as C,e as re}from"./chunk.6SK2K72G.js";import{e as ee}from"./chunk.NNNVB6RV.js";import{b as S}from"./chunk.UVLPVHID.js";import{m as X}from"./chunk.QXARGANF.js";import{F as se,Q as Z,a as K,sa as V,wa as J,xa as Q}from"./chunk.DNNL7F3P.js";import{N as Y,T as M,ba as U}from"./chunk.HBBVVALN.js";import{b as D}from"./chunk.AJZBJBMO.js";var h=D(se(),1);var n=D(Z(),1),Re=9,le=40,ge=2;function de(e){let r=new Map;for(let i of e.allNodes())r.set(i.kind,(r.get(i.kind)??0)+1);return r}var ue=(e,r)=>(e.far??[]).reduce((i,a)=>i+(r.get(a)??0),0);function ce(e,r,i){if(i)return i.flatMap(s=>e.filters.filter(u=>u.key===s));let a=de(r),o=new Set(e.filters.filter(s=>s.about==="edge"&&ue(s,a)>le).map(s=>s.key));return e.filters.filter(s=>s.about==="edge"?!o.has(s.key):s.about==="via"?o.has(s.key.split(".")[0]):!0)}function pe(e,r){let i=e.filter(a=>a.about==="field"&&a.type==="choice"&&(a.options?.length??0)>0);return r?i:i.slice(0,ge)}var fe=520;function ye(e,r,i,a){let o=i.filters.find(s=>s.key===a.key);if(!o)return`${a.key}: ${a.value}`;if(o.about==="is")return a.value.charAt(0).toUpperCase()+a.value.slice(1);if(o.about==="via")return`${o.label}: ${S(e.tryDefinition(o.far?.[0]??""),o.key.split(".")[1],a.value)}`;if(o.about==="edge"){if(a.value==="*")return`${o.label}: anything`;if(a.value==="none")return`${o.label}: nothing`;let s=r.getNode(a.value);return`${o.label}: ${s?U(e.tryDefinition(s.kind),s):a.value}`}if(o.type==="date"){let[s,u]=a.value.split(":");return`${o.label} ${s} ${u?Y(u):""}`.trim()}if(o.type==="boolean")return`${o.label}: ${a.value==="true"?"yes":"no"}`;if(o.type==="number"){let s=a.value.lastIndexOf(":"),u=a.value.slice(0,Math.max(0,s));if(u==="at-most"||u==="at-least")return`${o.label}: ${u==="at-most"?"at most":"at least"} ${S(e.tryDefinition(i.kind),o.key,Number(a.value.slice(s+1)))}`}return o.type==="text"?`${o.label}: ${a.value}`:`${o.label}: ${S(e.tryDefinition(i.kind),o.key,a.value)}`}var P=e=>/^[A-Z][a-z]/.test(e)?e.charAt(0).toLowerCase()+e.slice(1):e;function me(e){return e?.type==="date"?{asc:"Earliest first",desc:"Latest first"}:e?.type==="number"?{asc:"Lowest first",desc:"Highest first"}:e?.type==="boolean"?{asc:"No first",desc:"Yes first"}:e?.type==="choice"?{asc:"In their order",desc:"In reverse order"}:{asc:"A to Z",desc:"Z to A"}}var x=Q(K(()=>(__graviewPreload(import.meta.url,["./chunk.ELY2RMGE.js","./chunk.UV2TSAB4.js","./chunk.6SK2K72G.js","./chunk.NNNVB6RV.js","./chunk.7OLVQ2FZ.js","./chunk.NOZEHLWG.js","./chunk.UVLPVHID.js","./chunk.QXARGANF.js","./chunk.DNNL7F3P.js","./chunk.HBBVVALN.js","./chunk.AJZBJBMO.js"]),import("./chunk.EHT4HBH5.js")))),N=x.part((e,r)=>(0,n.jsx)(e.ArrangeLists,{...r}),{what:"This list",quiet:!0}),he=x.part((e,r)=>(0,n.jsx)(e.ArrangeChips,{...r}),{what:"This list",quiet:!0}),Te=()=>x.load(),q=new Map;function Ie(e){let{schema:r,graph:i,kind:a,arrangement:o,onChange:s}=e,u=e.offers??ee(r,a),g=e.testId??"arrange",y=C(e.allow,"sort")&&u.sorts.length>1,m=C(e.allow,"group")&&u.groups.length>0,F=C(e.allow,"filter")?ce(u,i,e.filters):[],L=e.chips?pe(F,e.filters):[],H=F.filter(t=>!L.includes(t)),G=H.length>0,_=e.query!==!1&&e.allow!==!1,w=we(e.noun,e.kept),v=e.past&&e.past.count>0?e.past:null;if(!y&&!m&&!G&&!_&&!w&&!v)return null;let z=t=>JSON.stringify(re(t)),O=`${g}|${a}`,p={current:q.get(O)??{words:new Set,latest:null,at:0}};q.set(O,p.current),p.current.latest&&Date.now()-p.current.at>1500&&!p.current.words.has(z(o))&&(p.current={words:new Set,latest:null,at:0},q.set(O,p.current));let d=p.current.latest??o,b=t=>{let l={...p.current.latest??o,...t};for(let c of Object.keys(l))l[c]===void 0&&delete l[c];p.current.latest=l,p.current.at=Date.now(),p.current.words.add(z(l)),s(l)},f=d.filter??[],R=t=>{let l=f.filter((c,I)=>I!==t);b({filter:l.length>0?l:void 0})},A=t=>f.some(l=>l.key===t.key&&l.value===t.value),te=t=>A(t)?R(f.findIndex(l=>l.key===t.key&&l.value===t.value)):b({filter:[...f,t]}),T=d.sort?u.sorts.find(t=>t.key===d.sort.by):void 0,j=d.group?u.groups.find(t=>t.key===d.group.by):void 0,ne=me(T),k={schema:r,graph:i,offers:{...u,filters:H},arrangement:d,set:b,toggle:te,has:A,testId:g},ae=(t,l)=>A({key:t,value:l})?R(f.findIndex(c=>c.key===t&&c.value===l)):b({filter:[...f.filter(c=>c.key!==t),{key:t,value:l}]}),oe=d.sort?(0,n.jsxs)(n.Fragment,{children:["Sorted by ",P(T?.label??d.sort.by),(0,n.jsx)("span",{"aria-hidden":"true",children:d.sort.direction==="desc"?" \u2193":" \u2191"})]}):"Sort",ie=d.group?.bucket&&j?.buckets?`, a ${d.group.bucket} each`:"",B=d.group?`Grouped by ${P(j?.label??d.group.by)}${ie}`:"Group";return(0,n.jsxs)("div",{"data-testid":`${g}-bar`,role:"group","aria-label":"Arrange",className:"graview-arrange",style:e.style,onPointerEnter:x.prefetch,onFocus:x.prefetch,children:[(0,n.jsx)("style",{children:xe}),(0,n.jsxs)("div",{className:"graview-arrange-line",children:[w?(0,n.jsxs)("span",{className:"graview-arrange-count","data-testid":`${g}-count`,children:[w.kept?(0,n.jsx)("span",{"data-testid":`${g}-kept`,children:w.kept}):null,w.words]}):null,v?(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":`${g}-past`,title:`${M(v.count)} more behind the horizon \u2014 press to widen the view to the past`,onClick:t=>{let l=t.currentTarget.closest("[data-graview-view]"),c=t.currentTarget;v.widen();let I=0,W=()=>{if(document.activeElement!==c&&document.activeElement!==document.body&&c.isConnected)return;let $=l?.querySelector('[role="group"][aria-label="Arrange"] :is(button, input)');if($&&$!==c&&$.isConnected)return $.focus({preventScroll:!0});++I<120&&requestAnimationFrame(W)};requestAnimationFrame(W)},children:["+",M(v.count)," past"]}):null,f.map((t,l)=>{let c=ye(r,i,u,t);return(0,n.jsxs)("span",{className:"graview-arrange-token","data-testid":`${g}-condition`,children:[c,(0,n.jsx)("button",{type:"button","aria-label":`Remove: ${c}`,title:"Remove",onClick:()=>R(l),children:"\xD7"})]},`${t.key}:${t.value}`)}),y?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-sort`,value:d.sort?.by??"",set:d.sort!==void 0,label:"Sort",name:d.sort?`Sorted by ${P(T?.label??d.sort.by)}, ${ne[d.sort.direction].toLowerCase()}`:"Sort",list:t=>(0,n.jsx)(N,{which:"sort",done:t,...k}),children:oe})}):null,m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-one",children:(0,n.jsx)(E,{testId:`${g}-group`,value:d.group?.by??"",set:d.group!==void 0,label:"Group",name:B,list:t=>(0,n.jsx)(N,{which:"group",done:t,...k}),children:B})}):null,G?(0,n.jsx)("span",{className:"graview-arrange-part",children:(0,n.jsx)(E,{testId:`${g}-add`,value:"",set:!1,label:"Filter",name:f.length>0?`Filter \u2014 ${f.length} on`:"Filter",list:t=>(0,n.jsx)(N,{which:"filter",done:t,...k}),children:"Filter"})}):null,y||m?(0,n.jsx)("span",{className:"graview-arrange-part graview-arrange-all",children:(0,n.jsx)(E,{testId:`${g}-all`,value:"",set:!1,label:"Arrange",name:"Arrange: sort and group",list:t=>(0,n.jsx)(N,{which:"all",done:t,parts:{sort:y,group:m,filter:!1},...k}),children:"Arrange"})}):null,_?(0,n.jsxs)("label",{className:"graview-arrange-words-at",children:[(0,n.jsx)("span",{style:X,children:"Find"}),(0,n.jsx)("input",{type:"search",className:"graview-arrange-words","data-testid":`${g}-query`,value:d.query??"",placeholder:"Find\u2026",onChange:t=>b({query:t.target.value.length>0?t.target.value:void 0})})]}):null,L.length>0&&e.chips?(0,n.jsx)(h.Suspense,{fallback:null,children:(0,n.jsx)(he,{offers:L,chips:e.chips,schema:r,graph:i,kind:a,arrangement:d,has:A,choose:ae,testId:g})}):null]})]})}function we(e,r){if(!r)return null;let i=r.shown!==r.of;if(!e)return i?{words:"",kept:`${r.shown} of ${r.of}`}:null;let a=r.of===1?e.one:e.many;return i?{words:` ${a}`,kept:`${r.shown} of ${r.of}`}:{words:`${r.of} ${a}`}}function E({testId:e,value:r,set:i,label:a,name:o,list:s,children:u}){let g=J("arrange",{align:"start"}),y=(0,h.useRef)(null);return(0,h.useEffect)(()=>{g.open&&y.current?.querySelector('[aria-pressed="true"]')?.focus({preventScroll:!0})},[g.open]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",className:"graview-arrange-open","data-testid":e,"data-set":i?"":void 0,value:r,"aria-label":o,...g.trigger,onClick:g.toggle,children:[u,(0,n.jsx)(be,{})]}),g.open?(0,n.jsx)("div",{...g.pane,ref:m=>{g.pane.ref(m),y.current=m},role:"group","aria-label":a,"data-testid":"arrange-list","data-arrange":e,className:"graview-arrange-list",style:V,onKeyDown:ve,children:s(()=>g.setOpen(!1))}):null]})}function ve(e){if(!["ArrowDown","ArrowUp","Home","End"].includes(e.key))return;let r=[...e.currentTarget.querySelectorAll("button:not([disabled]), input")];if(r.length===0)return;let i=r.indexOf(document.activeElement);if(document.activeElement instanceof HTMLInputElement&&document.activeElement.type==="date"&&(e.key==="ArrowUp"||e.key==="ArrowDown"))return;e.preventDefault();let a=e.key==="Home"?0:e.key==="End"?r.length-1:e.key==="ArrowDown"?(i+1)%r.length:(i-1+r.length)%r.length;r[a].focus()}function be(){return(0,n.jsx)("svg",{width:"9",height:"9",viewBox:"0 0 10 10","aria-hidden":"true",focusable:"false",style:{flex:"0 0 auto",opacity:.7},children:(0,n.jsx)("path",{d:"M2 3.5 L5 6.5 L8 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}var xe=`
|
|
2
|
-
.graview-arrange{container-type:inline-size;box-sizing:border-box;width:100%;min-width:0;max-width:100%}
|
|
3
|
-
.graview-arrange-line{display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;min-width:0;font-size:.875rem;line-height:1.35;color:var(--graview-ink-muted)}
|
|
4
|
-
.graview-arrange-count{margin-right:2px;color:var(--graview-ink-muted)}
|
|
5
|
-
.graview-arrange-part{display:inline-flex;align-items:center;min-width:0}
|
|
6
|
-
.graview-arrange-count~.graview-arrange-part::before{content:"\xB7" / "";margin-right:6px;color:var(--graview-ink-muted)}
|
|
7
|
-
.graview-arrange-open{display:inline-flex;align-items:center;gap:5px;min-height:28px;min-width:0;max-width:100%;margin:0;padding:0 6px;border:1px solid transparent;border-radius:7px;background:none;box-shadow:none;font:inherit;letter-spacing:normal;text-transform:none;text-align:left;color:var(--graview-ink-muted);cursor:pointer}
|
|
8
|
-
.graview-arrange-open[data-set]{color:var(--graview-ink)}
|
|
9
|
-
.graview-arrange-open:hover,.graview-arrange-open[aria-expanded=true]{border-color:var(--graview-edge);color:var(--graview-ink)}
|
|
10
|
-
.graview-arrange :focus-visible,.graview-arrange-list :focus-visible{outline:2px solid var(--graview-accent);outline-offset:1px}
|
|
11
|
-
.graview-arrange-all{display:none}
|
|
12
|
-
@container (max-width: ${fe-1}px){.graview-arrange-one{display:none}.graview-arrange-all{display:inline-flex}}
|
|
13
|
-
.graview-arrange-token{display:inline-flex;align-items:center;gap:0;min-width:0;min-height:26px;box-sizing:border-box;padding:0 2px 0 10px;border:1px solid var(--graview-edge);border-radius:999px;background:var(--graview-panel);color:var(--graview-ink);overflow-wrap:anywhere}
|
|
14
|
-
.graview-arrange-token button{display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;margin:0;padding:0;border:0;border-radius:6px;background:none;font:inherit;line-height:1;color:var(--graview-ink-muted);cursor:pointer}
|
|
15
|
-
.graview-arrange-token button:hover{color:var(--graview-ink);background:color-mix(in srgb,var(--graview-ink) 7%,transparent)}
|
|
16
|
-
.graview-arrange-words-at{display:inline-flex;min-width:0;max-width:100%}
|
|
17
|
-
.graview-arrange-words{box-sizing:border-box;width:min(100%,12rem);min-height:28px;margin:0;padding:0 8px;border:1px solid transparent;border-radius:7px;background:transparent;font:inherit;color:var(--graview-ink)}
|
|
18
|
-
.graview-arrange-words:hover,.graview-arrange-words:focus{border-color:var(--graview-edge)}
|
|
19
|
-
`;function De(e){let r=[];return e.query&&r.push(`\u201C${e.query}\u201D`),e.filter?.length&&r.push(`${e.filter.length} condition${e.filter.length===1?"":"s"}`),e.group&&r.push(`by ${e.group.by}`),e.sort&&r.push(`sorted by ${e.sort.by}`),r.length>0?r.join(" \xB7 "):null}export{Re as a,le as b,ge as c,de as d,ue as e,ce as f,pe as g,fe as h,ye as i,P as j,me as k,Te as l,Ie as m,De as n};
|
|
@@ -1 +0,0 @@
|
|
|
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{l as k,n as M,o as I,p as B,s as P}from"./chunk.7OLVQ2FZ.js";import"./chunk.NOZEHLWG.js";import"./chunk.UVLPVHID.js";import"./chunk.QXARGANF.js";import{F as te,Q as W,a as L,xa as q}from"./chunk.DNNL7F3P.js";import"./chunk.HBBVVALN.js";import{b as h}from"./chunk.AJZBJBMO.js";var r=h(te(),1);var A=h(W(),1),U=q(L(()=>(__graviewPreload(import.meta.url,["./chunk.QXARGANF.js","./chunk.DNNL7F3P.js","./chunk.HBBVVALN.js","./chunk.AJZBJBMO.js"]),import("./chunk.QNGFBJWP.js")))),v={Part:U.part((n,t)=>(0,A.jsx)(n.WhenMonth,{...t}),{quiet:!0}),prefetch:()=>U.prefetch()};var o=h(W(),1),z="try \u201Ctomorrow 3pm\u201D, \u201CFri 10:30\u201D or \u201C17 Oct\u201D";function K(n,t,d,p=!1){let S=Date.UTC(+n.day.slice(0,4),+n.day.slice(5,7)-1,+n.day.slice(8,10),0,t?n.minutes??0:0),g={weekday:p?"long":"short",year:"numeric",month:p?"long":"short",day:"numeric",...t?{hour:"numeric",minute:"2-digit"}:{},timeZone:"UTC"},m;try{m=new Intl.DateTimeFormat(d??"en-US",g)}catch{m=new Intl.DateTimeFormat("en-US",g)}return m.format(S).replace(/ /g," ")}function ce({value:n,time:t,instant:d=!1,label:p,name:S,required:g,autoFocus:m,autoSelect:H,locale:s,onChange:j,onLeave:_,onCancel:V,inputRef:w,boxStyle:Z}){let x=(0,r.useId)(),u=(0,r.useRef)(null),D=(0,r.useRef)(null),b=e=>{let a=M(e);return a?K(a,t,s):e??""},[T,C]=(0,r.useState)(()=>b(n)),[F,y]=(0,r.useState)(!1),[G,E]=(0,r.useState)(n),[J,Q]=(0,r.useState)(n);n!==J&&(Q(n),n!==G&&(E(n),C(b(n)))),(0,r.useEffect)(()=>{H&&(u.current?.focus(),u.current?.select())},[H]);let i=t&&d?B(s):void 0,N=T===b(n),l=M(n),c=N?l:P(T,{today:k().day,time:t,...l?{base:l}:{},...s?{locale:s}:{}}),X=N?n:c?I(c,{time:t,instant:d}):void 0,$=T.trim()==="",f=!$&&c===void 0;(0,r.useEffect)(()=>{u.current?.setCustomValidity(f?`Not a date this reads \u2014 ${z}`:"")},[f]);let O=e=>{E(e),j(e)},Y=e=>{C(e);let a=e.trim()===""?void 0:P(e,{today:k().day,time:t,...l?{base:l}:{},...s?{locale:s}:{}});O(a?I(a,{time:t,instant:d}):void 0)},ee=e=>{let a=t?{day:e,minutes:c?.minutes??l?.minutes??540}:{day:e},R=I(a,{time:t,instant:d});C(b(R)),O(R),y(!1),requestAnimationFrame(()=>{u.current?.focus(),u.current?.select()})},ne=$?`Type a date, or pick one \u2014 ${z}`:f?`Not a date this reads \u2014 ${z}`:c?`${K(c,t,s,!0)}${i?` ${i.short}`:""}`:"";return(0,o.jsxs)("span",{"data-graview-when":t?d?"instant":"moment":"day",style:{display:"inline-flex",flex:"1 1 14rem",flexWrap:"wrap",alignItems:"center",gap:"4px 6px",maxWidth:"100%",minWidth:0},onBlur:e=>{let a=e.relatedTarget;a&&e.currentTarget.contains(a)||!a&&typeof document<"u"&&!document.hasFocus()||(y(!1),_?.(X))},children:[(0,o.jsx)("input",{ref:e=>{u.current=e,typeof w=="function"?w(e):w&&(w.current=e)},type:"text",name:S,required:g,autoFocus:m,"aria-label":p,"aria-describedby":`${x}-said`,"aria-invalid":f||void 0,autoComplete:"off",spellCheck:!1,enterKeyHint:"done",placeholder:t?"tomorrow 3pm":"17 Oct",value:T,"data-graview-part":"control",onChange:e=>Y(e.target.value),onKeyDown:e=>{e.key==="Escape"?(e.preventDefault(),V?.()):e.key==="ArrowDown"&&e.altKey&&(e.preventDefault(),y(!0))},style:{flex:"1 1 12ch",minWidth:"10ch",maxWidth:"100%",boxSizing:"border-box",font:"inherit",...Z}}),(0,o.jsx)("button",{ref:D,type:"button","aria-label":`Pick a date for ${p}`,"aria-expanded":F,"aria-controls":`${x}-month`,"data-graview-part":"when-pick",onClick:()=>y(e=>!e),onPointerEnter:()=>v.prefetch(),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:32,minHeight:32,padding:0,borderRadius:6},children:(0,o.jsxs)("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",children:[(0,o.jsx)("rect",{x:"2",y:"3",width:"12",height:"11",rx:"1.5"}),(0,o.jsx)("path",{d:"M2 6.5h12M5.5 1.5v3M10.5 1.5v3"})]})}),(0,o.jsxs)("span",{id:`${x}-said`,"aria-live":"polite","data-graview-part":"when-said",...i?{"data-graview-zone":i.zone,title:`Times are in ${i.zone.replace(/_/g," ")} (${i.short})`}:{},style:{flexBasis:"100%",fontSize:"0.75rem",color:f?"var(--graview-bad)":"var(--graview-ink-faint)"},children:[ne,i&&!f&&!$?(0,o.jsx)("span",{"data-graview-part":"when-zone",children:` \xB7 ${(i.zone.split("/").at(-1)??i.zone).replace(/_/g," ")} time`}):null]}),F?(0,o.jsx)(r.Suspense,{fallback:null,children:(0,o.jsx)(v.Part,{id:`${x}-month`,label:p,selected:c?.day??l?.day,today:k().day,locale:s,onPick:ee,onClose:()=>{y(!1),D.current?.focus()}})}):null]})}export{ce as WhenInput,K as wallAsRead};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as n}from"./chunk.CYPTJNES.js";import"./chunk.4NCXMVPY.js";import"./chunk.TN4GY6LW.js";import"./chunk.QJYALCIW.js";import"./chunk.HSRGYZOR.js";import"./chunk.BRBY5WJT.js";import"./chunk.UV2TSAB4.js";import"./chunk.6SK2K72G.js";import"./chunk.NNNVB6RV.js";import"./chunk.MJLUAGEV.js";import"./chunk.WNMLA4YW.js";import"./chunk.VUKHDZNI.js";import"./chunk.WVUJXDXZ.js";import{e as p}from"./chunk.YFW5BF6J.js";import"./chunk.QYWBQ5NX.js";import"./chunk.ENJKCSNX.js";import"./chunk.LJE5J3JK.js";import"./chunk.X2OLXTRL.js";import"./chunk.JDRM6XXD.js";import"./chunk.GZHZLJBF.js";import"./chunk.GXPBRYSR.js";import"./chunk.NV6IZJKA.js";import"./chunk.OJGHDWI6.js";import"./chunk.7OLVQ2FZ.js";import"./chunk.NOZEHLWG.js";import"./chunk.UVLPVHID.js";import"./chunk.QXARGANF.js";import{Q as m}from"./chunk.DNNL7F3P.js";import"./chunk.HBBVVALN.js";import{b as t}from"./chunk.AJZBJBMO.js";var i=t(m(),1),a=new WeakMap;function s(o){let e=a.get(o);if(!e){let r=p(o);e=c=>c.mode==="fullscreen"?(0,i.jsx)(n,{blocks:r,slot:"home",heading:2,firstHeading:1}):(0,i.jsx)(n,{blocks:r,slot:"home",heading:3,firstHeading:2}),a.set(o,e)}return e}export{s as homeView};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{a as j,b as D}from"./chunk.5JPRRV47.js";import"./chunk.IHBIRAC4.js";import"./chunk.FGYCYLUS.js";import"./chunk.NZJZIYDK.js";import{a as I}from"./chunk.57XTDW57.js";import"./chunk.VUKHDZNI.js";import"./chunk.UT6642FC.js";import{a as k,b as V}from"./chunk.MB7LKKUD.js";import"./chunk.YFW5BF6J.js";import"./chunk.QYWBQ5NX.js";import"./chunk.ENJKCSNX.js";import"./chunk.LJE5J3JK.js";import"./chunk.X2OLXTRL.js";import"./chunk.JDRM6XXD.js";import"./chunk.7OLVQ2FZ.js";import"./chunk.NOZEHLWG.js";import"./chunk.UVLPVHID.js";import"./chunk.QXARGANF.js";import{F as Q,Q as H,ta as x}from"./chunk.DNNL7F3P.js";import{ea as B,qc as q}from"./chunk.HBBVVALN.js";import{b}from"./chunk.AJZBJBMO.js";var t=b(Q(),1);var a=b(H(),1);function U(r){let n=[];return r.applied.length>0&&r.intent&&n.push(`${r.intent}.`),r.unchanged.length>0&&n.push(`${r.unchanged.length} already so.`),r.allOrNothing&&n.push("None of it was kept."),n.join(" ")}function ie({store:r,chosen:n,principal:d,context:v,via:S,anchor:E,of:g,onChooseAll:A,onClear:p,onActed:F}){let[K,W]=(0,t.useState)(0);(0,t.useEffect)(()=>r.subscribe(()=>W(e=>e+1)),[r]);let m=n.join(`
|
|
2
|
-
`),{acts:h,withheld:N}=(0,t.useMemo)(()=>j(r,n,{...d?{principal:d}:{},...v?{context:v}:{}}),[r,m,d,v,K]),[L,u]=(0,t.useState)(!1),[l,c]=(0,t.useState)(null),[s,O]=(0,t.useState)(null),w=(0,t.useRef)(null),M=(0,t.useId)(),f=(0,t.useMemo)(()=>[...new Set(n.map(e=>r.graph.getNode(e)?.kind))],[r,m]),_=f.length===1&&f[0]?`${B(r.schema,f[0],n.length)} chosen`:`${n.length} chosen`,P=typeof matchMedia=="function"&&matchMedia("(pointer: coarse), (max-width: 599px)").matches?2:3,C=h.filter(e=>!e.more),G=C.slice(0,P),T=[...C.slice(P),...h.filter(e=>e.more)];(0,t.useEffect)(()=>{c(null),u(!1)},[m]),(0,t.useLayoutEffect)(()=>{let e=w.current;if(!e)return;if(typeof e.showPopover=="function"&&!x(e))try{e.showPopover()}catch{}let i=()=>{V(e,E?.()??null),dispatchEvent(new Event(k))};i(),addEventListener("resize",i),addEventListener("scroll",i,!0);let o=typeof ResizeObserver=="function"?new ResizeObserver(i):null;return o?.observe(e),()=>{if(o?.disconnect(),removeEventListener("resize",i),removeEventListener("scroll",i,!0),e.isConnected&&x(e))try{e.hidePopover()}catch{}dispatchEvent(new Event(k))}},[E]);let y=(0,t.useRef)({asking:l,onClear:p});y.current={asking:l,onClear:p},(0,t.useEffect)(()=>{let e=i=>{if(i.key!=="Escape"||i.defaultPrevented)return;let o=document.activeElement;if(!(!(w.current?.contains(o)??!1)&&(o instanceof HTMLTextAreaElement||o instanceof HTMLInputElement&&o.type!=="checkbox"||o instanceof HTMLSelectElement))){if(i.preventDefault(),i.stopPropagation(),y.current.asking){c(null);return}y.current.onClear()}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);let R=(e,i={})=>{let o=D(r,{mutation:e.mutation,subject:e.subject,args:{...e.args,...i},label:e.label},n,{...d?{author:d}:{},...S?{via:S}:{},...v?{context:v}:{}});c(null),u(!1),O(o.refused.length>0||o.applied.length===0?o:null),F(o.refused.map(z=>z.id))},J=e=>{O(null),u(!1),e.open.length>0?c(e):R(e)},$=e=>(0,a.jsxs)("button",{type:"button",className:"graview-several-act","data-testid":"several-act","data-act":e.id,"data-mutation":e.mutation,...e.destructive?{"data-tone":"warn"}:{},"aria-pressed":l?.id===e.id?!0:void 0,onClick:()=>J(e),children:[e.label,e.open.length>0?"\u2026":""]},e.id);return(0,a.jsxs)("div",{ref:w,popover:"manual",role:"region","aria-label":"The chosen records",className:"graview-several-bar","data-testid":"several-bar","data-graview-foot":"","data-graview-overlay":"","data-graview-popover":"","data-graview-offstage":"",style:X,children:[(0,a.jsx)("style",{children:Y}),(0,a.jsxs)("div",{className:"graview-several-line",children:[(0,a.jsx)("span",{role:"status","aria-live":"polite",className:"graview-several-count","data-testid":"several-count",children:_}),(0,a.jsxs)("div",{role:"group","aria-label":`What to do with the ${n.length} chosen`,className:"graview-several-acts",children:[G.map($),T.length>0?(0,a.jsx)("button",{type:"button",className:"graview-several-act","data-testid":"several-more","aria-expanded":L,"aria-controls":M,onClick:()=>u(e=>!e),children:"More"}):null,A&&g!==void 0&&g>n.length?(0,a.jsxs)("button",{type:"button",className:"graview-several-quiet","data-testid":"several-all",onClick:A,children:["Choose all ",g]}):null,(0,a.jsx)("button",{type:"button",className:"graview-several-quiet","data-testid":"several-clear","aria-keyshortcuts":"Escape",title:"Put the choice down \u2014 Escape",onClick:p,children:"Clear"})]})]}),L?(0,a.jsx)("div",{id:M,role:"group","aria-label":"More",className:"graview-several-acts","data-testid":"several-more-acts",children:T.map($)}):null,h.length===0?(0,a.jsx)("p",{className:"graview-several-said","data-testid":"several-none",children:N.length>0?`Nothing here can be done to all of them by you: ${N[0].message}`:"Nothing can be done to all of these at once."}):null,l?(0,a.jsx)("div",{className:"graview-several-ask",role:"group","aria-label":`${l.label}, for all ${n.length}`,"data-testid":"several-ask",children:(0,a.jsx)(I,{store:r,affordance:l.affordance,onApply:e=>R(l,e),onCancel:()=>c(null)})}):null,s?(0,a.jsxs)("div",{role:"alert",className:"graview-several-said","data-testid":"several-outcome",children:[U(s),s.refused.length>0?(0,a.jsxs)(a.Fragment,{children:[" ",s.refused.length===1?"One was not changed, and is still chosen:":`${s.refused.length} were not changed, and are still chosen:`,(0,a.jsx)("ul",{"data-testid":"several-refused",children:s.refused.map(e=>(0,a.jsxs)("li",{"data-record":e.id,children:["\u201C",e.label,"\u201D \u2014 ",e.message]},e.id))})]}):null]}):null]})}var X={position:"fixed",inset:"auto",margin:0,zIndex:q("toast"),boxSizing:"border-box",width:"max-content",height:"auto",bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:16,overflow:"visible"},Y=`
|
|
3
|
-
.graview-several-bar{display:grid;gap:8px;padding:8px 10px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius,12px);background:var(--graview-float);color:var(--graview-ink);box-shadow:var(--graview-lift-high);font-size:.875rem;line-height:1.4;max-height:70vh;overflow:auto}
|
|
4
|
-
.graview-several-line{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;min-width:0}
|
|
5
|
-
.graview-several-count{font-weight:600;white-space:nowrap}
|
|
6
|
-
.graview-several-acts{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:0}
|
|
7
|
-
.graview-several-act,.graview-several-quiet{min-height:32px;padding:0 12px;border-radius:8px;font:inherit;cursor:pointer;box-shadow:none}
|
|
8
|
-
.graview-several-act{border:1px solid var(--graview-edge);background:transparent;color:var(--graview-ink);font-weight:600}
|
|
9
|
-
.graview-several-act:hover,.graview-several-act[aria-pressed=true],.graview-several-act[aria-expanded=true]{background:color-mix(in srgb,var(--graview-accent) 14%,transparent)}
|
|
10
|
-
.graview-several-act[data-tone=warn]{color:var(--graview-warn)}
|
|
11
|
-
.graview-several-quiet{border:0;background:none;color:var(--graview-ink-muted);text-decoration:underline;text-underline-offset:2px}
|
|
12
|
-
.graview-several-bar :focus-visible{outline:2px solid var(--graview-accent);outline-offset:2px}
|
|
13
|
-
.graview-several-said{margin:0;max-width:52ch;overflow-wrap:anywhere}
|
|
14
|
-
.graview-several-said ul{margin:4px 0 0;padding-left:18px}
|
|
15
|
-
.graview-several-ask{padding:8px 4px 2px;border-top:1px solid var(--graview-edge)}
|
|
16
|
-
@media (pointer: coarse){.graview-several-act,.graview-several-quiet{min-height:44px}}
|
|
17
|
-
`;export{ie as SeveralBar};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.GZHZLJBF.js";import{n as D}from"./chunk.GXPBRYSR.js";import"./chunk.NV6IZJKA.js";import"./chunk.OJGHDWI6.js";import"./chunk.7OLVQ2FZ.js";import{a as $}from"./chunk.NOZEHLWG.js";import"./chunk.UVLPVHID.js";import"./chunk.QXARGANF.js";import{F as P,Q as C}from"./chunk.DNNL7F3P.js";import{Ka as w,Ma as R,Qa as c,X as S}from"./chunk.HBBVVALN.js";import{b as k}from"./chunk.AJZBJBMO.js";var m=k(P(),1);var e=k(C(),1),W=[["","Does not repeat"],["day","Daily"],["week","Weekly"],["month","Monthly"],["year","Yearly"]],E=r=>`${r}${r%100>=11&&r%100<=13?"th":["th","st","nd","rd"][r%10]??"th"}`,v={display:"flex",flexWrap:"wrap",gap:"6px 12px",alignItems:"center"};function N({value:r,onChange:d,start:p,label:s,name:l="repeat"}){let f=(0,m.useId)(),a=c(r)?r:void 0,i=typeof p=="string"&&/^\d{4}-\d{2}-\d{2}/.test(p)?p:void 0,u=i?w[new Date(`${i.slice(0,10)}T00:00:00Z`).getUTCDay()]:void 0,o=t=>{let n={...a??{every:"week"},...t};for(let b of Object.keys(n))n[b]===void 0&&delete n[b];d(n)},y=a?.every??"week",g=a?.on??(u?[u]:[]);return(0,e.jsxs)("fieldset",{"data-graview-part":"field","data-graview-field":"repeat","data-graview-repeat":l,style:{display:"grid",gap:8,border:"1px solid var(--graview-edge)",borderRadius:8,padding:"8px 12px",margin:0,minWidth:0},children:[(0,e.jsx)("legend",{"data-graview-part":"label",style:{padding:"0 4px"},children:s}),(0,e.jsxs)("div",{style:v,children:[(0,e.jsx)("label",{htmlFor:`${f}-every`,children:"Repeats"}),(0,e.jsx)("select",{id:`${f}-every`,name:`${l}.every`,value:a?.every??"",onChange:t=>{let n=t.target.value;d(n===""?void 0:{...a?.interval?{interval:a.interval}:{},...a?.until?{until:a.until}:{},every:n})},"data-graview-part":"control",children:W.map(([t,n])=>(0,e.jsx)("option",{value:t,children:n},t))}),a?(0,e.jsxs)("label",{style:v,children:["every",(0,e.jsx)("input",{type:"number",min:1,max:99,name:`${l}.interval`,"aria-label":`Every how many ${y}s`,value:a.interval??1,onChange:t=>o({interval:Number(t.target.value)>1?Math.min(99,Math.round(Number(t.target.value))):void 0}),style:{width:"4.5em"},"data-graview-part":"control"}),y,(a.interval??1)>1?"s":""]}):null]}),a?.every==="week"?(0,e.jsxs)("div",{role:"group","aria-label":"On",style:v,children:[(0,e.jsx)("span",{"aria-hidden":"true",children:"On"}),w.map((t,n)=>(0,e.jsxs)("label",{style:{display:"inline-flex",gap:4,alignItems:"center",minHeight:24},children:[(0,e.jsx)("input",{type:"checkbox",name:`${l}.on`,value:t,checked:g.includes(t),onChange:b=>{let h=w.filter(x=>x===t?b.target.checked:g.includes(x));o({on:h.length===0||h.length===1&&h[0]===u?void 0:h})}}),S(n,"short")]},t))]}):null,a?.every==="month"?(0,e.jsxs)("label",{style:v,children:["On",(0,e.jsxs)("select",{name:`${l}.on`,value:a.on?.[0]===-1?"last":"",onChange:t=>o({on:t.target.value==="last"?[-1]:void 0}),"data-graview-part":"control",children:[(0,e.jsx)("option",{value:"",children:i?`the ${E(Number(i.slice(8,10)))}`:"the same day"}),(0,e.jsx)("option",{value:"last",children:"the last day"})]})]}):null,a?(0,e.jsxs)("label",{style:v,children:["Until",(0,e.jsx)("input",{type:"date",name:`${l}.until`,value:a.until??"",onChange:t=>o({until:t.target.value||void 0}),"data-graview-part":"control"})]}):null,(0,e.jsx)("p",{"aria-live":"polite","data-graview-repeat-said":"",style:{margin:0,color:"var(--graview-ink-dim)",fontSize:"0.8125rem"},children:a?$(i??"",a):"Does not repeat"})]})}function M({nodeId:r,field:d,start:p,value:s,label:l}){let{fields:f,commit:a}=D(r),i=f.find(t=>t.field===R(d)&&t.takesValue&&t.open.length===0),[u,o]=(0,m.useState)(!1),[y,g]=(0,m.useState)(c(s)?s:void 0);return i?u?(0,e.jsxs)("form",{onSubmit:t=>{t.preventDefault(),o(!1),a(i,y??null)},style:{display:"grid",gap:6,marginTop:6},children:[(0,e.jsx)(N,{value:y,onChange:g,start:p,label:l,name:R(d)}),(0,e.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,e.jsx)("button",{type:"submit","data-graview-repeat-keep":d,children:"Keep"}),(0,e.jsx)("button",{type:"button",onClick:()=>o(!1),children:"Cancel"})]})]}):(0,e.jsx)("button",{type:"button","data-graview-repeat-open":d,onClick:()=>(g(c(s)?s:void 0),o(!0)),style:{marginInlineStart:8,fontSize:"0.75rem",padding:"1px 8px",borderRadius:999,minHeight:24},children:c(s)?"Change how it repeats":"Repeat\u2026"}):null}export{M as RepeatEditor,N as RepeatPicker};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as O}from"./chunk.OJGHDWI6.js";import{e as C}from"./chunk.7OLVQ2FZ.js";import{F as x,Q as M,Y as w,Z as I,_ as W,d as V,ma as G,y as B}from"./chunk.DNNL7F3P.js";import{B as D,Fb as F,Lb as N,lc as _,mc as L,sc as j}from"./chunk.HBBVVALN.js";import{b as m}from"./chunk.AJZBJBMO.js";function H(t,e){let n=t.graph.getNode(e);if(!n)return[];let i=n.kind,a=t.schema.tryDefinition(i);if(!a)return[];let c=t.seenFor,u=c?j.keptFrom?.(t,c)?.(n):void 0,o=new Map;for(let r of t.allMutations()){let s=r.subject;if(!s||!(s.kinds==="*"||s.kinds.includes(i)))continue;let l=r.input.shape??{};for(let d of N(r,a)){if(u?.(d))continue;let b=d in l,k=[];for(let h of Object.keys(l)){if(h===s.arg||h===d||X(l[h]))continue;let v=F(r.input).find(S=>S.name===h);k.push({name:h,...v?{kinds:v.kinds}:{},...v?{candidates:v.kinds.includes("*")?t.graph.allNodes().map(S=>S.id):v.kinds.flatMap(S=>t.graph.nodesOfKind(S).map(J=>J.id))}:{},shape:C(r.input,h)})}let Q={field:d,mutation:r.name,title:r.title??r.name,shape:b?C(r.input,d):{type:"unknown"},takesValue:b,alternatives:[],open:k,call:h=>({name:r.name,args:b?{[s.arg]:e,[d]:h}:{[s.arg]:e}})};o.set(d,[...o.get(d)??[],Q])}}return[...o.values()].map(r=>{let s=[...r.filter(d=>d.takesValue),...r.filter(d=>!d.takesValue)],[f,...l]=s;return{...f,alternatives:l}})}function X(t){let e=D(t)?.type;return e==="optional"||e==="default"||e==="nullable"}var R=m(x(),1);function be(t){let{store:e,principal:n}=w(),i=W(),a=(0,R.useMemo)(()=>t===null?[]:H(e,t),[e,t,i]),c=(0,R.useCallback)((u,o,r={})=>{let s=u.call(o);e.apply({name:s.name,args:{...s.args,...r}},{author:n})},[e,n]);return{fields:a,commit:c}}var K=m(x(),1);function Qe(){let{brand:t}=w(),e=t?.kit;return(0,K.useMemo)(()=>_(e),[e])}function Je(t,e){let n=L(t,e),i={...n.color!==void 0?{color:n.color}:{},...n.pattern!==void 0?{pattern:n.pattern}:{},...n.width!==void 0?{width:n.width}:{},...n.cap!==void 0?{cap:n.cap}:{},...n.opacity!==void 0?{opacity:n.opacity}:{}};return{connector:n,style:O(e,{[e]:i})}}var $=m(x(),1);var g=m(M(),1);function Z(t){let e=t?.hint;return typeof e=="string"&&e.length>0?e:void 0}function ee(t){if(t instanceof Error&&t.message)return t.message;let e=String(t);return e==="[object Object]"?"The view threw without a message.":e}var U=class extends $.Component{static contextType=G;state={};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){console.error(`[graview] the ${this.props.view??"view"} of ${this.props.kind} threw while rendering`,e,n.componentStack),this.context?.(e,{module:"@graview/react"})}render(){let{error:e}=this.state;if(!e)return this.props.children;let n=Z(e);return(0,g.jsxs)("div",{role:"alert","data-graview-view-error":this.props.kind,style:{display:"flex",flexDirection:"column",gap:"0.375rem",padding:"var(--graview-pad, 12px)",height:"100%",overflow:"auto",boxSizing:"border-box",borderRadius:"var(--graview-radius-sm, 6px)",background:"var(--graview-panel-warning, #fdf3ec)",color:"var(--graview-ink, #1a1a1a)",font:"var(--graview-font-body, 13px/1.45 system-ui)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,g.jsx)("strong",{style:{color:"var(--graview-warn, #b4462a)"},children:this.props.view?`${this.props.view} could not draw`:"This view could not draw"}),(0,g.jsx)("span",{style:{color:"var(--graview-ink-muted, #555)"},children:this.props.kind}),(0,g.jsx)("span",{children:ee(e)}),n?(0,g.jsx)("span",{style:{color:"var(--graview-ink-muted, #555)"},children:n}):null]})}};var y=m(x(),1);var q=m(M(),1),A=(0,y.createContext)([]);function nt({sections:t,children:e}){let n=(0,y.useContext)(A),i=(0,y.useMemo)(()=>[...n,...t.filter(a=>!n.includes(a))],[n,t]);return(0,q.jsx)(A.Provider,{value:i,children:e})}function z(){let t=(0,y.useContext)(A),e=I()?.menuSections;return(0,y.useMemo)(()=>e?[...t,...e.filter(n=>!t.includes(n))]:t,[t,e])}function rt(){let t=z();return(0,y.useCallback)(e=>{for(let n of t)try{n(e)?.prepare?.()}catch{}},[t])}function ot(t){let e=z();if(t===null||e.length===0)return{start:[],end:[]};let n=e.flatMap(i=>{try{let a=i(t);return a&&((a.items?.length??0)>0||a.render)?[a]:[]}catch{return[]}});return{start:n.filter(i=>i.at==="start"),end:n.filter(i=>i.at!=="start")}}var te=m(x(),1);function st(){return w().activity}var P=(t,e)=>t.length*e*.58;var ne=156,re=2,E=ne-18,oe=7.1,ie=16;function ae(t,e){let n=0,i=E;for(let a of t.split(" ")){let c=e(a),u=i+e(" ")+c;if(u<=E)i=u;else{let o=Math.ceil(c/E)||1;n+=o,i=c-(o-1)*E}}return n}var se=16.25,Y=27,ce=(t,e)=>{let n=Math.ceil(t.length*oe/E);return e?Math.max(Y,Math.ceil(Math.max(n,ae(t,e))*se)+6):Math.max(Y,n*ie+6)};function ut(t,e,n){return t.length===0?0:10+t.reduce((i,a)=>i+ce(a,n),0)+(t.length-1)*re}var de=27,ue=8,lt=4,le=64,pt=t=>Math.max(1,Math.min(ue,t)),ft=t=>t*de+le;var p=m(x(),1);function gt(t,{units:e,target:n=0,legibleAt:i=260}){let[a,c]=(0,p.useState)(e);(0,p.useEffect)(()=>{let o=t.current;if(o===null||typeof ResizeObserver>"u")return;let r=new ResizeObserver(([s])=>{let f=s?.contentRect.width??0;f>0&&c(f)});return r.observe(o),()=>r.disconnect()},[t]);let u=a/e;return{scale:u,width:a,touchable:u*n>=24,legible:a>=i}}function xt(t="--graview-font-body",e="sans-serif"){let n=(0,p.useRef)(void 0),i=(0,p.useMemo)(()=>{if(typeof getComputedStyle!="function"||typeof document>"u")return e;let a=getComputedStyle(document.documentElement).getPropertyValue(t).trim();return a.length>0?a:e},[t,e]);return(0,p.useMemo)(()=>{n.current===void 0&&(n.current=typeof document>"u"?null:document.createElement("canvas").getContext("2d")??null);let a=n.current;return a===null?P:(c,u)=>{a.font=`${u}px ${i}`;let o=a.measureText(c).width;return o>0?o:P(c,u)}},[i])}var wt=(0,p.createContext)(void 0);var T=3;function pe(t){let e=V(t),n=e.focusId;if(!n)return null;if(e.within?.view){let[a]=B(n);if(a)return{at:`screen:${a}`,audience:!0}}return{at:n,audience:!1}}var fe=102,me=32;function St(t,e,n){let i=[],a=new Map,c=new Map,u=0;for(let o of t){let r=pe(o.stop),s=r?e(r.at):null;if(!r||!s){o.name&&i.push({kind:"edge",presence:o,point:{x:n-8,y:fe+u++*me}});continue}if(!o.name){let k=c.get(r.at);c.set(r.at,{n:(k?.n??0)+1,box:s});continue}let f=a.get(r.at)??[];if(f.push(o),a.set(r.at,f),f.length>T)continue;let l=s,d=f.length-1,b=r.audience?{x:l.x+l.width*.5+(d-1)*26,y:l.y+Math.min(l.height,24)}:{x:l.x+l.width*.5-26-d*26,y:l.y+l.height-4};i.push({kind:"person",presence:o,point:b,at:r.at,index:d,of:f.length,audience:r.audience})}for(let[o,r]of a){if(r.length<=T)continue;let s=e(o);s&&i.push({kind:"count",at:o,point:{x:s.x+s.width*.5+2*26+18,y:s.y+s.height-4},n:r.length-T})}for(let[o,{n:r,box:s}]of c)i.push({kind:"count",at:o,point:{x:s.x+s.width*.5+40,y:s.y+s.height-4},n:r});for(let o of t)if(o.name){if(o.robot?.at&&o.robot.mode!=="docked"){let r=e(o.robot.at);r&&i.push({kind:"robot",presence:o,point:{x:r.x+r.width/2+22,y:r.y+r.height-4},mode:o.robot.mode})}if(o.over){let r=e(o.over);r&&i.push({kind:"over",presence:o,box:r})}}return i}export{st as a,P as b,ne as c,re as d,Y as e,ut as f,de as g,lt as h,le as i,pt as j,ft as k,gt as l,xt as m,be as n,Qe as o,Je as p,St as q,U as r,nt as s,rt as t,ot as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as I,c as x}from"./chunk.5CLFTXP3.js";import"./chunk.QXARGANF.js";import{c as b,d as A,k as v,r as w,t as O,w as G}from"./chunk.DNNL7F3P.js";import{$c as E,Mc as k,fd as S,gd as W}from"./chunk.HBBVVALN.js";import"./chunk.AJZBJBMO.js";var F=(e,i)=>k(e,i).slice(1);function j(e,i){let l=e.split("/").filter(Boolean);return l.length===i.length&&l.every((s,h)=>s.startsWith(":")||s==="*"||s===i[h])}var $=["problems","search","map","places"];function R(e,i,l,s,h=[]){let{schema:r}=i,o=r.kinds,f=t=>{if(t.startsWith(w))return(t.slice(w.length).split("|")[0]??"").split("+").every(V=>o.includes(V));let y=O(t);return y!==null?o.includes(y):t.startsWith("edge:")||l.graph.getNode(t)!==void 0},[p="/",u]=e.path.split("?"),n=p.split("/").filter(Boolean),m=u?`?${u}`:"",d=n.length>0&&!$.includes(n[0])?o.find(t=>F(r,t)===n[0]):void 0,c=e.path;if(n[0]==="places"&&n.length===2)`/places/${n[1]}`!==E&&!s.some(t=>t.as===decodeURIComponent(n[1]))&&(c="/");else if(d){let t=n[1]===void 0?void 0:decodeURIComponent(n[1]);c=`/${F(r,d)}${t!==void 0&&l.graph.getNode(t)?.kind===d?`/${n[1]}`:""}${m}`}else n.length>0&&n.length<=2&&!$.includes(n[0])&&!h.some(t=>j(t.path,n))&&(c="/");let g=A(e.stop),P=g.within?.view,U=P!==void 0&&!s.some(t=>t.as===P),a=g;if(U){let{view:t,...y}=g.within??{};a={...a,within:y}}if(g.focusId&&!f(g.focusId)){let t=e.kind&&o.includes(e.kind)?G(e.kind):null;a={...v(a,t),zoom:!1}}return a={...a,relation:a.relation&&(o.includes(a.relation)||r.edgeKinds.includes(a.relation))?a.relation:null,expanded:a.expanded.filter(f),pins:Object.fromEntries(Object.entries(a.pins).filter(([t])=>f(t))),...a.selection?{selection:a.selection.filter(f)}:{}},{face:e.face,path:c,stop:b(a),...e.kind?{kind:e.kind}:{}}}function B(e,i,l){let s=e.at,h=e.pages?.routes()??[];if(e.routing!=="address"||typeof window>"u")return R(s,e.app,i,l,h);let{pathname:r,search:o,hash:f}=window.location,p=W(r,e.basePath),u=I({routing:"address",...e.basePath===void 0?{}:{basePath:e.basePath},face:s.face}),n=u==="pages",m={...s,face:u,...p===null?{}:n?{path:p+o}:{stop:x(e.basePath)??s.stop}},d=R(m,e.app,i,l,h),c=n?d.path===m.path?null:S(d.path,e.basePath===void 0?{}:{basePath:e.basePath}):d.stop===b(A(m.stop))?null:r+o+d.stop;return p!==null&&c!==null&&c!==r+o+f&&window.history.replaceState(window.history.state,"",c),d}export{R as settle,B as settleAt};
|