graview 0.1.62 → 0.1.64
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/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/preview/chunk.2D7K2IJQ.js +4 -0
- package/dist/preview/{chunk.UFDJXQQQ.js → chunk.2DH42I7L.js} +6 -6
- package/dist/preview/chunk.2E62YCMZ.js +1 -0
- package/dist/preview/{chunk.GX4G4BX3.js → chunk.2G5WLG3Z.js} +1 -1
- package/dist/preview/chunk.2HV5FF6O.js +1 -0
- package/dist/preview/{chunk.LGRLVJGS.js → chunk.2JDAUKSN.js} +3 -3
- package/dist/preview/{chunk.ZN3PUM2I.js → chunk.2JEN2RCB.js} +1 -1
- package/dist/preview/{chunk.66P5IDTH.js → chunk.2TCOLAL2.js} +1 -1
- package/dist/preview/{chunk.OWOOKLIU.js → chunk.2V7QTIAV.js} +1 -1
- package/dist/preview/{chunk.IQ3PRWGO.js → chunk.2VIS2NAT.js} +2 -2
- package/dist/preview/{chunk.UQQKDBIH.js → chunk.2VYGDY5Z.js} +1 -1
- package/dist/preview/{chunk.WEOVK2T4.js → chunk.37I45R6V.js} +1 -1
- package/dist/preview/chunk.3FKKH2XU.js +74 -0
- package/dist/preview/chunk.3J7XLJP2.js +1 -0
- package/dist/preview/chunk.3OEODIHB.js +1 -0
- package/dist/preview/{chunk.WPXPVD33.js → chunk.3RD4JHVG.js} +1 -1
- package/dist/preview/{chunk.CHHYIMB7.js → chunk.3RUV4HE4.js} +1 -1
- package/dist/preview/chunk.3SAESG6X.js +1 -0
- package/dist/preview/{chunk.4HEFUOLV.js → chunk.47N2G7A5.js} +1 -1
- package/dist/preview/{chunk.A3ZC2JBO.js → chunk.4DZOAB4D.js} +1 -1
- package/dist/preview/chunk.4HTB6TX2.js +1 -0
- package/dist/preview/chunk.4Q5PCMGZ.js +18 -0
- package/dist/preview/{chunk.DPEIT3TW.js → chunk.4U45EY5M.js} +1 -1
- package/dist/preview/{chunk.2B6P4GPS.js → chunk.4VRX7FCO.js} +1 -1
- package/dist/preview/{chunk.JT3MFPRD.js → chunk.4XCYZRZ3.js} +1 -1
- package/dist/preview/chunk.52MBXPEK.js +1 -0
- package/dist/preview/chunk.5AD2QHWH.js +3 -0
- package/dist/preview/{chunk.MDEX6ZVE.js → chunk.5B7NG6WH.js} +1 -1
- package/dist/preview/chunk.5HJ2GTKZ.js +1 -0
- package/dist/preview/chunk.5IEZF433.js +2 -0
- package/dist/preview/{chunk.QGU5QTR6.js → chunk.5PPCK7QT.js} +1 -1
- package/dist/preview/chunk.6NRWLCIZ.js +5 -0
- package/dist/preview/chunk.75JQCTR6.js +1 -0
- package/dist/preview/{chunk.KMV6PJFL.js → chunk.77JI5T4F.js} +1 -1
- package/dist/preview/chunk.77MLXWZV.js +35 -0
- package/dist/preview/chunk.7AOEZJRM.js +1 -0
- package/dist/preview/{chunk.QIPASE42.js → chunk.7CLKGKSF.js} +1 -1
- package/dist/preview/{chunk.BZMQDEIY.js → chunk.7SRSE5IS.js} +1 -1
- package/dist/preview/{chunk.2GEJNG2U.js → chunk.7VAHHEDX.js} +1 -1
- package/dist/preview/{chunk.VJBBVLGZ.js → chunk.7ZG77OI3.js} +1 -1
- package/dist/preview/chunk.7ZHH7WBN.js +1 -0
- package/dist/preview/chunk.AJEK3I5X.js +6 -0
- package/dist/preview/chunk.APRWUIE3.js +1 -0
- package/dist/preview/{chunk.QHY5NVYH.js → chunk.APUQIELA.js} +1 -1
- package/dist/preview/{chunk.Y4FZKUOK.js → chunk.ATHLE33D.js} +1 -1
- package/dist/preview/chunk.B2YTHEX5.js +1 -0
- package/dist/preview/{chunk.ELOFPE25.js → chunk.B6JR7EQO.js} +1 -1
- package/dist/preview/{chunk.5ODHHH35.js → chunk.BN42H3C6.js} +1 -1
- package/dist/preview/{chunk.DD2NKFDX.js → chunk.BVIJXL4J.js} +1 -1
- package/dist/preview/{chunk.5HGD6OWL.js → chunk.CC7P435K.js} +2 -2
- package/dist/preview/{chunk.IQMD7DG3.js → chunk.CJHYGRWV.js} +1 -1
- package/dist/preview/chunk.CM65MCHA.js +1 -0
- package/dist/preview/{chunk.MYNMBOLD.js → chunk.D2XLECMP.js} +1 -1
- package/dist/preview/chunk.DJIF7IAQ.js +2 -0
- package/dist/preview/{chunk.G4ULQK64.js → chunk.DLWFULWE.js} +1 -1
- package/dist/preview/{chunk.QDWSU47A.js → chunk.DMENNIHT.js} +1 -1
- package/dist/preview/{chunk.L3WTKQQL.js → chunk.DN7UCBOA.js} +1 -1
- package/dist/preview/{chunk.22BZU7ME.js → chunk.DQAMVVE6.js} +1 -1
- package/dist/preview/chunk.DUP2CGVH.js +1 -0
- package/dist/preview/{chunk.TM4EPUNO.js → chunk.DYRULRFX.js} +1 -1
- package/dist/preview/{chunk.AFNSAQEQ.js → chunk.E4TXLT25.js} +1 -1
- package/dist/preview/{chunk.DDUCIUVW.js → chunk.F6BNFLQM.js} +1 -1
- package/dist/preview/chunk.FN34P4IS.js +1 -0
- package/dist/preview/{chunk.AJSUHPBE.js → chunk.FUPYIOXZ.js} +1 -1
- package/dist/preview/{chunk.7KVUUEZA.js → chunk.FXRYMT3U.js} +1 -1
- package/dist/preview/{chunk.DEAP3H2L.js → chunk.G5BVZLCM.js} +1 -1
- package/dist/preview/{chunk.Y2YYH3JN.js → chunk.G7YLK4PX.js} +1 -1
- package/dist/preview/chunk.GF62K25C.js +1 -0
- package/dist/preview/chunk.GFQPO3NC.js +1 -0
- package/dist/preview/{chunk.5STU3KYG.js → chunk.GH5UBSQI.js} +1 -1
- package/dist/preview/chunk.GHHKRFPD.js +1 -0
- package/dist/preview/{chunk.THVC2BEC.js → chunk.GP5DAA4P.js} +1 -1
- package/dist/preview/{chunk.VN23AGIY.js → chunk.HPG6CNKM.js} +1 -1
- package/dist/preview/chunk.HSJEOM3W.js +1 -0
- package/dist/preview/{chunk.H5S7OL2U.js → chunk.HZPRMHSL.js} +1 -1
- package/dist/preview/chunk.IQGSEAQ2.js +5 -0
- package/dist/preview/{chunk.PCDUV3WP.js → chunk.ITBG37WJ.js} +1 -1
- package/dist/preview/{chunk.SVPKUWZU.js → chunk.JHUCKEJS.js} +1 -1
- package/dist/preview/{chunk.H7N7WN4U.js → chunk.JOM6MFVE.js} +1 -1
- package/dist/preview/{chunk.DNVWSWL2.js → chunk.JS2UZYGB.js} +1 -1
- package/dist/preview/{chunk.7XLS6XTY.js → chunk.K2PXP5H6.js} +1 -1
- package/dist/preview/{chunk.6AKW7TXM.js → chunk.K54ISAXN.js} +1 -1
- package/dist/preview/{chunk.3FON2Y72.js → chunk.K5YFUMRS.js} +1 -1
- package/dist/preview/chunk.KHXRJLLU.js +50 -0
- package/dist/preview/chunk.KMIFSPGQ.js +1 -0
- package/dist/preview/chunk.L4V5VLSM.js +1 -0
- package/dist/preview/{chunk.T6WHGKWR.js → chunk.LDMBJC3B.js} +1 -1
- package/dist/preview/{chunk.PLTH2LW5.js → chunk.LTOQ22ZJ.js} +1 -1
- package/dist/preview/{chunk.UVA7AALY.js → chunk.M5VHUIDB.js} +1 -1
- package/dist/preview/chunk.N643PVQA.js +1 -0
- package/dist/preview/{chunk.FULEUL34.js → chunk.NGRL3QOI.js} +1 -1
- package/dist/preview/{chunk.OFWNMTGB.js → chunk.NRPBTV6O.js} +2 -2
- package/dist/preview/{chunk.N6EJXXQK.js → chunk.O7HHNQK4.js} +2 -2
- package/dist/preview/{chunk.5YAOKOGV.js → chunk.OW3M4OBN.js} +1 -1
- package/dist/preview/{chunk.2N4Z5K5S.js → chunk.OXFDB5BB.js} +1 -1
- package/dist/preview/{chunk.4TX6VCBT.js → chunk.P4TAX3HE.js} +1 -1
- package/dist/preview/{chunk.RYRQ66JN.js → chunk.P6FNJR6E.js} +1 -1
- package/dist/preview/chunk.PR74PGLC.js +1 -0
- package/dist/preview/{chunk.F7YXLYLX.js → chunk.PVDDSBRG.js} +1 -1
- package/dist/preview/{chunk.OUDATENL.js → chunk.QROPDEJF.js} +1 -1
- package/dist/preview/{chunk.I77ZGIFE.js → chunk.QRT6BZR6.js} +1 -1
- package/dist/preview/{chunk.OWT3VVOT.js → chunk.R5MLRKAO.js} +2 -2
- package/dist/preview/chunk.RDA35HZB.js +2 -0
- package/dist/preview/{chunk.ROZTJ6IY.js → chunk.REXU6ARY.js} +1 -1
- package/dist/preview/chunk.S6QZBWCJ.js +1 -0
- package/dist/preview/{chunk.MAKODQO3.js → chunk.S7SHWDPR.js} +1 -1
- package/dist/preview/{chunk.SWMDFXUX.js → chunk.SADHOSRC.js} +1 -1
- package/dist/preview/chunk.SJHUC4TL.js +1 -0
- package/dist/preview/chunk.SL5FXE3R.js +1 -0
- package/dist/preview/{chunk.X6KYRBL6.js → chunk.T4JP6BGP.js} +1 -1
- package/dist/preview/{chunk.TIALD6SC.js → chunk.T4TRJDBF.js} +1 -1
- package/dist/preview/{chunk.M4AYA2PL.js → chunk.TA2JTUNX.js} +1 -1
- package/dist/preview/{chunk.EVBCEEQ4.js → chunk.TMHVYI5R.js} +1 -1
- package/dist/preview/chunk.TOLW64EO.js +1 -0
- package/dist/preview/chunk.TP3PZRHE.js +1 -0
- package/dist/preview/{chunk.PZQNR4KZ.js → chunk.TQ2G4AM4.js} +1 -1
- package/dist/preview/{chunk.5J3O2FVG.js → chunk.TUR2DA2M.js} +1 -1
- package/dist/preview/{chunk.B23WZQXQ.js → chunk.TYIBLD2D.js} +1 -1
- package/dist/preview/{chunk.DC35FJAB.js → chunk.UD2GGG7L.js} +1 -1
- package/dist/preview/chunk.UDU545CL.js +1 -0
- package/dist/preview/{chunk.RPDH32XV.js → chunk.UDYFGYJP.js} +1 -1
- package/dist/preview/{chunk.SEHRPTNA.js → chunk.UJNLT3L6.js} +1 -1
- package/dist/preview/chunk.UN2IAA5R.js +1 -0
- package/dist/preview/chunk.VLX7YWVH.js +25 -0
- package/dist/preview/{chunk.T3UQ7ZQK.js → chunk.VT4YBFZL.js} +1 -1
- package/dist/preview/{chunk.ELTV44HU.js → chunk.VZAF3452.js} +2 -2
- package/dist/preview/{chunk.O2BHPYA4.js → chunk.WFCE7NLK.js} +2 -2
- package/dist/preview/{chunk.CY3ELWCM.js → chunk.WHX47OJM.js} +1 -1
- package/dist/preview/{chunk.NUWDMH47.js → chunk.WMARJ5E3.js} +1 -1
- package/dist/preview/chunk.WPQP54FM.js +1 -0
- package/dist/preview/{chunk.6JO5HQDR.js → chunk.WX23K7ZU.js} +1 -1
- package/dist/preview/{chunk.W4BKYSZX.js → chunk.X36BYTEG.js} +1 -1
- package/dist/preview/{chunk.AQRB7LDA.js → chunk.XCLW4GP7.js} +1 -1
- package/dist/preview/{chunk.DDO3GLEJ.js → chunk.XEG7ZDRG.js} +1 -1
- package/dist/preview/{chunk.ILIIBSGA.js → chunk.XIVELWAM.js} +1 -1
- package/dist/preview/{chunk.75GVFX7L.js → chunk.XJWKIXPV.js} +1 -1
- package/dist/preview/{chunk.O75HWF3F.js → chunk.XQ5RTPEF.js} +1 -1
- package/dist/preview/{chunk.NOGGSLVG.js → chunk.YEXFVDRA.js} +1 -1
- package/dist/preview/{chunk.UXMPFPFH.js → chunk.YIZPW7IK.js} +2 -2
- package/dist/preview/chunk.YLOGIJOH.js +1 -0
- package/dist/preview/chunk.YMXWS4XN.js +3 -0
- package/dist/preview/{chunk.Z2TDZSMN.js → chunk.YSBTE3PX.js} +1 -1
- package/dist/preview/{chunk.RD2X25XB.js → chunk.Z26T5E76.js} +1 -1
- package/dist/preview/{chunk.A3OL2BI2.js → chunk.Z4XGEV34.js} +1 -1
- package/dist/preview/chunk.ZA5TDCBC.js +1 -0
- package/dist/preview/chunk.ZNDVJGTY.js +1 -0
- package/dist/preview/chunk.ZQGLPP7A.js +1 -0
- package/dist/preview/index.html +53 -52
- package/dist/preview/page.js +2 -2
- package/dist/preview/splash.js +7 -6
- package/package.json +6 -6
- package/dist/preview/chunk.2AT3GRXM.js +0 -1
- package/dist/preview/chunk.4HRYB7HF.js +0 -1
- package/dist/preview/chunk.5MZYCELA.js +0 -6
- package/dist/preview/chunk.7M4HNKDR.js +0 -1
- package/dist/preview/chunk.7OBIBPYH.js +0 -1
- package/dist/preview/chunk.7V56P2A7.js +0 -1
- package/dist/preview/chunk.7YOAW7ED.js +0 -1
- package/dist/preview/chunk.ACTXR2MI.js +0 -3
- package/dist/preview/chunk.AI34V6WV.js +0 -74
- package/dist/preview/chunk.BLUKSGI4.js +0 -1
- package/dist/preview/chunk.CAKFNKN5.js +0 -1
- package/dist/preview/chunk.CGALLZ54.js +0 -1
- package/dist/preview/chunk.DHJ3FQTR.js +0 -1
- package/dist/preview/chunk.DZZL5IDD.js +0 -5
- package/dist/preview/chunk.H24OC6OE.js +0 -1
- package/dist/preview/chunk.H73ZPYUX.js +0 -1
- package/dist/preview/chunk.HANJZ6FA.js +0 -1
- package/dist/preview/chunk.HIMQ65QT.js +0 -1
- package/dist/preview/chunk.IQPILSV3.js +0 -18
- package/dist/preview/chunk.IYBEXENQ.js +0 -1
- package/dist/preview/chunk.J7Q2WAF4.js +0 -28
- package/dist/preview/chunk.JYFZCJ4N.js +0 -2
- package/dist/preview/chunk.KDXU5DT3.js +0 -1
- package/dist/preview/chunk.KL7E4YHJ.js +0 -1
- package/dist/preview/chunk.LAYQ5PFS.js +0 -1
- package/dist/preview/chunk.LTZUF5VG.js +0 -1
- package/dist/preview/chunk.M7RESZB6.js +0 -25
- package/dist/preview/chunk.MGALQLRW.js +0 -1
- package/dist/preview/chunk.NAD7ZXYP.js +0 -1
- package/dist/preview/chunk.NHTGAP3G.js +0 -3
- package/dist/preview/chunk.NUYA4BWI.js +0 -1
- package/dist/preview/chunk.OKZT2QBM.js +0 -2
- package/dist/preview/chunk.OUPURRDE.js +0 -1
- package/dist/preview/chunk.PD2DECOP.js +0 -1
- package/dist/preview/chunk.PKWQKFPE.js +0 -2
- package/dist/preview/chunk.RMR24LFJ.js +0 -4
- package/dist/preview/chunk.RRKI24WY.js +0 -1
- package/dist/preview/chunk.SGCW2XRC.js +0 -1
- package/dist/preview/chunk.SS7234R6.js +0 -1
- package/dist/preview/chunk.TKUNRFDE.js +0 -1
- package/dist/preview/chunk.U6ZRJKVM.js +0 -1
- package/dist/preview/chunk.UKQUUPKE.js +0 -1
- package/dist/preview/chunk.VACKSKGJ.js +0 -1
- package/dist/preview/chunk.VC3V7HLL.js +0 -1
- package/dist/preview/chunk.VIH5AX7S.js +0 -5
- package/dist/preview/chunk.WKI5INH7.js +0 -1
- package/dist/preview/chunk.Y4S7CDRB.js +0 -1
- package/dist/preview/chunk.YP2QSPXU.js +0 -50
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk.6NRWLCIZ.js";import"./chunk.Q355UPFG.js";import"./chunk.ZQGLPP7A.js";import"./chunk.VZAF3452.js";import"./chunk.WHX47OJM.js";import"./chunk.QRT6BZR6.js";import"./chunk.2V7QTIAV.js";import"./chunk.Z26T5E76.js";import"./chunk.77JI5T4F.js";import"./chunk.SADHOSRC.js";import"./chunk.4DZOAB4D.js";import"./chunk.UDU545CL.js";import"./chunk.7VAHHEDX.js";import"./chunk.P4TAX3HE.js";import"./chunk.T4TRJDBF.js";import"./chunk.2TCOLAL2.js";import"./chunk.2VYGDY5Z.js";import"./chunk.FUPYIOXZ.js";import"./chunk.APRWUIE3.js";import"./chunk.3OEODIHB.js";import"./chunk.WFCE7NLK.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.ZA5TDCBC.js";import"./chunk.2JEN2RCB.js";import"./chunk.7CLKGKSF.js";import"./chunk.TMHVYI5R.js";import"./chunk.R5MLRKAO.js";import"./chunk.YMXWS4XN.js";import"./chunk.GZHZLJBF.js";import"./chunk.3SAESG6X.js";import"./chunk.OJGHDWI6.js";import"./chunk.F6BNFLQM.js";import"./chunk.75JQCTR6.js";import"./chunk.5IEZF433.js";import"./chunk.5AD2QHWH.js";import"./chunk.3FKKH2XU.js";import"./chunk.DLWFULWE.js";import{G as z,V as S}from"./chunk.VLX7YWVH.js";import"./chunk.SDO3U72B.js";import{ga as b,pa as m,ra as k,ta as h}from"./chunk.IQGSEAQ2.js";import"./chunk.FQLNBIQ5.js";import{b as g}from"./chunk.AJZBJBMO.js";var r=g(z(),1),e=g(S(),1),w={color:"var(--graview-ink-muted)"},l={fontSize:"0.8125rem",padding:"0 4px",borderRadius:4,background:"var(--graview-sunken, rgba(127,127,127,0.12))",overflowWrap:"anywhere"};function I(i){let n=i;for(let s=0;s<6&&n?._zod?.def?.innerType&&["optional","default","nullable","prefault","readonly"].includes(n._zod.def.type??"");s++)n=n._zod.def.innerType;return n?._zod?.def?.type??"value"}function P({store:i,inspected:n,close:s}){let f=(0,r.useRef)(null),u=(0,r.useId)(),p=i.schema,t=n.on===void 0?void 0:i.graph.getNode(n.on),d=t?.kind??n.kind,c=d===void 0?void 0:p.tryDefinition(d);(0,r.useEffect)(()=>{let o=f.current;o&&!o.open&&(typeof o.showModal=="function"?o.showModal():o.setAttribute("open",""))},[]);let C=()=>{let o=n.returnTo;s(),requestAnimationFrame(()=>{o?.isConnected?o.focus():document.querySelector("[data-graview-page-title], main h1")?.focus()})},x=t?String(t.label??h(c,t.kind)):n.place?n.place.title:d?m(p,d):"This page",a=[];if(d!==void 0&&a.push(["kind","What it is",(0,e.jsxs)(e.Fragment,{children:[b(h(c,d))," ",(0,e.jsx)("code",{style:l,children:d})]})]),t&&a.push(["record","Record",(0,e.jsx)("code",{style:l,children:t.id})]),n.field!==void 0&&d!==void 0&&a.push(["field","Field",(0,e.jsxs)(e.Fragment,{children:[k(c,n.field)," ",(0,e.jsx)("code",{style:l,children:n.field})]})]),n.place){let o=n.place.lens==="view"?"a view":n.place.lens==="columns"?"a status board":n.place.lens?`the ${n.place.lens} lens`:"a picture";a.push(["drawn-by","Drawn by",(0,e.jsxs)(e.Fragment,{children:["\u201C",n.place.title,"\u201D, ",o," ",(0,e.jsx)("code",{style:l,children:n.place.name??n.place.as})]})])}n.column&&a.push(["column","Column",(0,e.jsxs)(e.Fragment,{children:[n.column.label," ",(0,e.jsx)("code",{style:l,children:`${n.column.field}:${n.column.value}`})]})]),n.href!==void 0&&a.push(["link","Link",(0,e.jsx)("a",{href:n.href,"data-testid":"inspect-link",children:(0,e.jsx)("code",{style:l,children:n.href})})]);let v=c?.fields?.shape;return(0,e.jsx)("dialog",{ref:f,"aria-labelledby":u,"data-testid":"inspect-sheet",onClose:C,onClick:o=>{o.target===o.currentTarget&&o.currentTarget.close()},style:{width:"min(92vw, 440px)",padding:0,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)"},children:(0,e.jsxs)("div",{style:{display:"grid",gap:12,padding:18},children:[(0,e.jsx)("h2",{id:u,style:{margin:0,fontSize:"1.0625rem"},children:x}),(0,e.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"max-content minmax(0, 1fr)",gap:"6px 12px",fontSize:"0.875rem"},children:a.map(([o,y,T])=>(0,e.jsxs)("div",{"data-inspect":o,style:{display:"contents"},children:[(0,e.jsx)("dt",{style:w,children:y}),(0,e.jsx)("dd",{style:{margin:0,minWidth:0},children:T})]},o))}),n.owner&&d!==void 0&&v?(0,e.jsxs)("section",{"aria-labelledby":`${u}-declared`,"data-inspect":"declared",style:{display:"grid",gap:6},children:[(0,e.jsxs)("h3",{id:`${u}-declared`,style:{margin:0,fontSize:"0.8125rem",...w},children:["How ",m(p,d).toLowerCase()," are declared"]}),(0,e.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:2,fontSize:"0.8125rem"},children:Object.entries(v).map(([o,y])=>(0,e.jsxs)("li",{children:[(0,e.jsx)("code",{style:l,children:o})," ",(0,e.jsx)("span",{style:w,children:I(y)})]},o))})]}):null,(0,e.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,e.jsx)("button",{type:"button",autoFocus:!0,onClick:()=>f.current?.close(),children:"Close"})})]})})}export{P as InspectSheet};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as te}from"./chunk.2V7QTIAV.js";import{p as Se,q as ee,t as $,u as be}from"./chunk.3SAESG6X.js";import{m as J,n as ye,o as we,p as X,q as Z}from"./chunk.OJGHDWI6.js";import{c as ke}from"./chunk.5AD2QHWH.js";import{a as he,b as U,c as j,e as ve,o as Me}from"./chunk.3FKKH2XU.js";import{b as de}from"./chunk.DLWFULWE.js";import{D as z,F as Y,G as O,Ia as fe,J as pe,Ja as ge,Ka as T,Oa as _,Q as me,Qa as F,V as M,da as A,ea as q,fa as B,m as le,v as ce,z as ue}from"./chunk.VLX7YWVH.js";import{a as E}from"./chunk.SDO3U72B.js";import{Pd as se,nd as ie,pa as H,sd as ae}from"./chunk.IQGSEAQ2.js";import{b as y}from"./chunk.AJZBJBMO.js";var P=y(O(),1),x=y(M(),1),ne=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.VLX7YWVH.js","./chunk.SDO3U72B.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.YSBTE3PX.js")))),xe=ne.part(t=>(0,x.jsx)(t.HoverChipDoor,{}),{quiet:!0}),De="A",Q=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.KHRS2SKB.js","./chunk.PR74PGLC.js","./chunk.T6PU3NKP.js","./chunk.B6JR7EQO.js","./chunk.2D7K2IJQ.js","./chunk.77JI5T4F.js","./chunk.UDU545CL.js","./chunk.7VAHHEDX.js","./chunk.HJCQ6I3S.js","./chunk.DQAMVVE6.js","./chunk.OXFDB5BB.js","./chunk.DJIF7IAQ.js","./chunk.S6QZBWCJ.js","./chunk.LTOQ22ZJ.js","./chunk.2TCOLAL2.js","./chunk.FUPYIOXZ.js","./chunk.3OEODIHB.js","./chunk.BIDL7GQD.js","./chunk.TA2JTUNX.js","./chunk.HZPRMHSL.js","./chunk.TQ2G4AM4.js","./chunk.X36BYTEG.js","./chunk.LDMBJC3B.js","./chunk.XOZU4OFA.js","./chunk.G7YLK4PX.js","./chunk.Q5WEOX3Q.js","./chunk.2E62YCMZ.js","./chunk.DUP2CGVH.js","./chunk.YFVJUHAK.js","./chunk.YEXFVDRA.js","./chunk.ZA5TDCBC.js","./chunk.2JEN2RCB.js","./chunk.7CLKGKSF.js","./chunk.TMHVYI5R.js","./chunk.R5MLRKAO.js","./chunk.YMXWS4XN.js","./chunk.3SAESG6X.js","./chunk.OJGHDWI6.js","./chunk.F6BNFLQM.js","./chunk.75JQCTR6.js","./chunk.5IEZF433.js","./chunk.5AD2QHWH.js","./chunk.3FKKH2XU.js","./chunk.DLWFULWE.js","./chunk.VLX7YWVH.js","./chunk.SDO3U72B.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.RDA35HZB.js"))));var Ce=Q.part((t,e)=>(0,x.jsx)(t.InspectorPane,{...e}),{what:"This card's acts"});function Le(t){let e=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&t()},n=globalThis;if(n.requestIdleCallback){let c=n.requestIdleCallback(e,{timeout:5e3});return()=>n.cancelIdleCallback?.(c)}let i=setTimeout(e,2500);return()=>clearTimeout(i)}var Oe=150,Ne="[data-graview-pick], [data-graview-view], [data-graview-record], [data-graview-act], [data-graview-field], a[href]";function Re(t){if(t.closest("[data-graview-face='pages'], [data-graview-popover]"))return null;let e=t.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??t.closest("[data-graview-view]")?.getAttribute("data-graview-view");return e?{face:"scene",on:e,about:[e]}:null}function We(t){let{store:e,principal:n,providers:i,ai:c}=A(),p=be(),h=Y(c),r=(0,P.useRef)({aimAt:t,store:e,principal:n,providers:i,prepareSections:p,chipsOn:h});r.current={aimAt:t,store:e,principal:n,providers:i,prepareSections:p,chipsOn:h},(0,P.useEffect)(()=>{if(typeof document>"u")return;let u=null,w=null,k=null,l=g=>{let m=r.current,b=m.chipsOn?m.aimAt(g):null;b&&(k=g,ne.load().then(G=>{k===g&&G.restOn(b,g)},()=>{}))},f=()=>{u&&clearTimeout(u.timer),u=null},s=g=>{let m=r.current,b=m.aimAt(g);if(!b)return;let G=JSON.stringify([b.face,b.on,b.about,b.field,b.place,b.act,m.store.log.length]);G!==w&&(w=G,m.prepareSections(b),Q.load().then(Pe=>Pe.prepareActs(m.store,b,{principal:m.principal,providers:m.providers}),()=>{}))},o=g=>g.target instanceof Element?g.target.closest(Ne):null,d=g=>{if(g.pointerType==="touch")return;let m=o(g);m!==null&&m===u?.element||(f(),m!==null&&(u={element:m,timer:setTimeout(()=>{u=null,s(m),l(m)},Oe)}))},v=g=>{let m=g.relatedTarget;k!==null&&!(m instanceof Node&&k.contains(m))&&(k=null,ne.current?.leaveRest()),u!==null&&(m instanceof Node&&u.element.contains(m)||f())},S=g=>{if(g.pointerType==="mouse")return;let m=o(g);m&&s(m)},I=g=>{if(!fe())return;let m=o(g);m&&s(m)};return document.addEventListener("pointerover",d,{passive:!0}),document.addEventListener("pointerout",v,{passive:!0}),document.addEventListener("pointerdown",S,{capture:!0,passive:!0}),document.addEventListener("focusin",I),()=>{f(),document.removeEventListener("pointerover",d),document.removeEventListener("pointerout",v),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("focusin",I)}},[])}function it({placement:t="float",openActs:e,aimAt:n}={}){let{menuAt:i,setMenuAt:c,registerActsDoor:p,ai:h}=A(),{selection:r}=_();We(n??Re),(0,P.useEffect)(()=>{if(Q.current)return;let f=()=>{v(),Q.prefetch()},s=()=>{},o=ge(()=>void(s=Le(f))),d=["pointerdown","keydown"];for(let S of d)document.addEventListener(S,f,{capture:!0,passive:!0});function v(){o(),s();for(let S of d)document.removeEventListener(S,f,{capture:!0})}return v},[]),(0,P.useEffect)(()=>{if(t==="menu")return p({key:De,open:e??(f=>{let s=f.getBoundingClientRect(),o=f.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??f.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0;c({x:Math.round(s.left+Math.min(16,s.width/2)),y:Math.round(Math.min(s.bottom,s.top+36)),...o?{on:o}:{}})})}),()=>p(null)},[t,p,c,e]);let u=i!==null||r.length>0&&e===void 0,[w,k]=(0,P.useState)(u);(0,P.useEffect)(()=>{u&&k(!0)},[u]);let l=Y(h)?(0,x.jsx)(P.Suspense,{fallback:null,children:(0,x.jsx)(xe,{})}):null;return!w&&!u?l:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(P.Suspense,{fallback:null,children:(0,x.jsx)(Ce,{placement:t,chosen:e===void 0})}),l]})}var K=y(O(),1),V=y(M(),1),Ge=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.KHRS2SKB.js","./chunk.PR74PGLC.js","./chunk.25VJPUDH.js","./chunk.T6PU3NKP.js","./chunk.B6JR7EQO.js","./chunk.FN34P4IS.js","./chunk.2DH42I7L.js","./chunk.VZAF3452.js","./chunk.WHX47OJM.js","./chunk.2D7K2IJQ.js","./chunk.QRT6BZR6.js","./chunk.2V7QTIAV.js","./chunk.Z26T5E76.js","./chunk.77JI5T4F.js","./chunk.SADHOSRC.js","./chunk.4DZOAB4D.js","./chunk.UDU545CL.js","./chunk.7VAHHEDX.js","./chunk.HJCQ6I3S.js","./chunk.DQAMVVE6.js","./chunk.OXFDB5BB.js","./chunk.DJIF7IAQ.js","./chunk.S6QZBWCJ.js","./chunk.LTOQ22ZJ.js","./chunk.2TCOLAL2.js","./chunk.2VYGDY5Z.js","./chunk.FUPYIOXZ.js","./chunk.APRWUIE3.js","./chunk.3OEODIHB.js","./chunk.WFCE7NLK.js","./chunk.BIDL7GQD.js","./chunk.TA2JTUNX.js","./chunk.HZPRMHSL.js","./chunk.TQ2G4AM4.js","./chunk.X36BYTEG.js","./chunk.LDMBJC3B.js","./chunk.XOZU4OFA.js","./chunk.G7YLK4PX.js","./chunk.Q5WEOX3Q.js","./chunk.2E62YCMZ.js","./chunk.DUP2CGVH.js","./chunk.YFVJUHAK.js","./chunk.YEXFVDRA.js","./chunk.WVUJXDXZ.js","./chunk.ZA5TDCBC.js","./chunk.2JEN2RCB.js","./chunk.7CLKGKSF.js","./chunk.TMHVYI5R.js","./chunk.R5MLRKAO.js","./chunk.YMXWS4XN.js","./chunk.GZHZLJBF.js","./chunk.3SAESG6X.js","./chunk.OJGHDWI6.js","./chunk.F6BNFLQM.js","./chunk.75JQCTR6.js","./chunk.5IEZF433.js","./chunk.5AD2QHWH.js","./chunk.3FKKH2XU.js","./chunk.DLWFULWE.js","./chunk.VLX7YWVH.js","./chunk.SDO3U72B.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.KMIFSPGQ.js")))),He=Ge.part((t,e)=>{let n=t.DraftFrame;return(0,V.jsx)(n,{...e})},{what:"The view"});function ct(t){let{seatTalk:e}=A();return(0,K.useSyncExternalStore)(e.subscribe,()=>e.get().draft!==null,()=>!1)?(0,V.jsx)(K.Suspense,{fallback:null,children:(0,V.jsx)(He,{...t})}):null}var C=y(O(),1),D=y(M(),1),Ae=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.7VAHHEDX.js","./chunk.O7HHNQK4.js","./chunk.BJUUSIQY.js","./chunk.TQ2G4AM4.js","./chunk.X36BYTEG.js","./chunk.LDMBJC3B.js","./chunk.XOZU4OFA.js","./chunk.G7YLK4PX.js","./chunk.GH5UBSQI.js","./chunk.2JEN2RCB.js","./chunk.75JQCTR6.js","./chunk.5IEZF433.js","./chunk.5AD2QHWH.js","./chunk.3FKKH2XU.js","./chunk.DLWFULWE.js","./chunk.VLX7YWVH.js","./chunk.SDO3U72B.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.GF62K25C.js")))),ze=Ae.part((t,e)=>{let n=t.QuickAskCard;return(0,D.jsx)(n,{...e})},{what:"The quick ask"});function gt({face:t,on:e=!0}){let{ai:n,aiDesk:i,selection:c,view:p}=A(),h=me()?.open??!1,r=e&&z(n)&&!h,u=ve(i),w=(0,C.useRef)(null),k=(0,C.useRef)({selection:c,place:p.within?.view});return k.current={selection:c,place:p.within?.view},(0,C.useEffect)(()=>{if(!r)return;let l=he(i);return l.drawn+=1,U(l),()=>{l.drawn=Math.max(0,l.drawn-1),l.drawn===0&&(l.open=null),U(l)}},[r,i]),(0,C.useEffect)(()=>{if(!r)return;let l=f=>{if(f.defaultPrevented||f.key.toLowerCase()!=="k"||!(f.metaKey||f.ctrlKey)||f.altKey||f.shiftKey)return;let s=w.current?.closest("[data-graview-embed]"),o=f.target,d=!(o instanceof Node)||o===document.body||o===document.documentElement;if(s&&!(d||o instanceof Node&&s.contains(o)))return;f.preventDefault(),Ae.prefetch();let v=document.activeElement,{selection:S,place:I}=k.current;j(i,{pointed:{...S[0]!==void 0?{on:S[0]}:{},about:S,...I?{place:I}:{}},returnTo:v instanceof HTMLElement&&v!==document.body?v:null})};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[r,i]),r?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("span",{ref:w,hidden:!0,"data-graview-quick-ask":t}),u?(0,D.jsx)(C.Suspense,{fallback:null,children:(0,D.jsx)(ze,{face:t,opening:u,close:()=>j(i,null)},u.at)}):null]}):null}var R=y(O(),1),L=y(M(),1),oe=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.O7HHNQK4.js","./chunk.BJUUSIQY.js","./chunk.TQ2G4AM4.js","./chunk.X36BYTEG.js","./chunk.LDMBJC3B.js","./chunk.XOZU4OFA.js","./chunk.G7YLK4PX.js","./chunk.GH5UBSQI.js","./chunk.2JEN2RCB.js","./chunk.75JQCTR6.js","./chunk.5IEZF433.js","./chunk.5AD2QHWH.js","./chunk.3FKKH2XU.js","./chunk.DLWFULWE.js","./chunk.VLX7YWVH.js","./chunk.SDO3U72B.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.SJHUC4TL.js")))),qe=oe.part((t,e)=>{let n=t.InlineAiMenu;return(0,L.jsx)(n,{...e})},{what:"The AI's suggestions"}),Be=oe.part((t,e)=>{let n=t.GhostTray;return(0,L.jsx)(n,{...e})},{quiet:!0});function _e(){let{ai:t}=A(),e=z(t);return(0,R.useMemo)(()=>e?n=>({id:"inline-ai",heading:"AI",render:i=>(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(qe,{target:n,close:i})}),prepare:()=>oe.prefetch()}):null,[e])}var Fe=[];function St({children:t}){let e=_e(),n=(0,R.useMemo)(()=>e?[e]:Fe,[e]);return(0,L.jsx)($,{sections:n,children:t})}function bt(t){let{ai:e,aiDesk:n}=A(),{ghost:i}=pe(n);return i===null||i.onCard||e.off?null:(0,L.jsx)(R.Suspense,{fallback:null,children:(0,L.jsx)(Be,{...t})})}var N=y(O(),1);var Te=y(M(),1),Qe=t=>globalThis[Symbol.for("graview.shown-lists")]?.get(t),Ee=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.3FKKH2XU.js","./chunk.DLWFULWE.js","./chunk.VLX7YWVH.js","./chunk.SDO3U72B.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.UJNLT3L6.js"))));function Ve(t){let e=t.about[0];if(t.about.length!==1||!e?.startsWith("aggregate:"))return;let n=e.slice(10).split("+");return n.length===1?n[0]:void 0}function Ke(t,e){return t.filter(n=>n.as!==e.as&&!n.hidden&&(n.kind===e.kind||n.over?.includes(e.kind)===!0)).at(-1)}function Ye(t){let e=q(),n=e?.keptViews,i=e?.views,c=(0,N.useContext)(Me);return(0,N.useMemo)(()=>i?p=>{let h=n?.current(),r=Ve(p),u=s=>s.length>0?{id:"tidy-view",items:s,prepare:()=>Ee.prefetch()}:null,w=(s,...o)=>Ee.load().then(d=>d[s](...o),()=>!1),k=(s,o)=>Qe(s)?.().menu(o,n,c)??[];if(p.place===void 0){if(p.face!=="pages"||r===void 0||p.on!==void 0)return null;let s=h?.may.lenses===!0&&n?.lens!==void 0,o=H(e.store.schema,r),d=i.arrangement?.()?.hide?.includes(r)===!0;return u([...s?[{id:d?"show-list":"hide-list",label:d?"Show":"Hide",hint:d?"Back in the places, for everyone":"Off the places, for everyone; still at its address",run:()=>void w("setListHidden",r,o,n,!d,c)}]:[],...k(`list:${r}`,s)])}let l=i.places().find(s=>s.as===p.place&&(r===void 0||s.kind===r||s.over?.includes(r)===!0));if(!l)return null;let f=n&&h?se(l,h,n):null;return u([...f?[l.hidden?{id:"show-view",label:"Show",hint:"Back in the places, for everyone",run:()=>void w("setHidden",l,f,n,!1,c)}:{id:"hide-view",label:"Hide",hint:"Off the places and the scene, for everyone",run:()=>void w("setHidden",l,f,n,!0,c)},{id:"delete-view",label:"Delete",hint:`Kept ${30} days under Recently deleted`,run:()=>{let s=Ke(i.places(),l);w("remove",l,f,n,c).then(o=>o&&t?.(l,s))}}]:[],...k(`place:${l.as}`,f==="lens")])}:null,[n,i,c,t])}var Ue=[];function Dt({children:t}){let{view:e,go:n}=F(),i=(0,N.useCallback)((h,r)=>{let u=e.within?.view;e.focusId===ce(h.kind)&&(u===void 0||u===h.as)&&n(r?ue(e,r.kind,r.as):le(e,!0))},[e,n]),c=Ye(i),p=(0,N.useMemo)(()=>c?[c]:Ue,[c]);return(0,Te.jsx)($,{sections:p,children:t})}function Nt(t={}){return t.scope===void 0?te:de(te,t.scope)}var W=y(O(),1),a=y(M(),1);function Bt({inside:t=!1,widthOf:e}={}){let{store:n,view:i,emphasis:c,setEmphasis:p}=A(),h=Se(),{selection:r,set:u}=_(),{show:w}=F(),k=B(),l=(0,W.useMemo)(()=>{let o=new Map;for(let d of n.graph.allEdges()){let v=o.get(d.kind)??{count:0,ends:new Set};v.count+=1;for(let S of[d.from,d.to]){let I=n.graph.getNode(S);I&&v.ends.add(`kind:${I.kind}`)}o.set(d.kind,v)}return[...o.entries()].sort(([d],[v])=>d.localeCompare(v)).map(([d,v])=>({kind:d,count:v.count,ends:[...v.ends]}))},[n,k]),f=Math.max(0,...l.map(o=>o.count));if((0,W.useEffect)(()=>()=>p(null),[p]),!i.overview&&!t||l.length===0)return null;let s=new Set;for(let o of r){if(o.startsWith("kind:")){s.add(o);continue}let d=n.graph.getNode(o);d&&s.add(`kind:${d.kind}`)}return(0,a.jsxs)("section",{"aria-label":"What the lines mean",role:t?"group":void 0,"data-testid":"relation-key",style:t?{display:"grid",gap:1}:{position:"absolute",left:16,top:14,zIndex:ae("rail"),display:"grid",gap:1,padding:"8px 10px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",maxWidth:je,animation:"graview-settle 380ms 280ms ease backwards"},children:[t?null:(0,a.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-faint)",paddingBottom:2},children:l.length===1?"1 relation":`${l.length} relations`}),e?(0,a.jsx)(Xe,{aloft:i.overview===!0}):null,l.map(({kind:o,count:d,ends:v})=>{let{connector:S,style:I}=ee(h,o),g=Je(n.schema,o),m=c!==null?c===o:s.size===0||v.some(b=>s.has(b));return(0,a.jsxs)("button",{type:"button",title:n.schema.edge(o)?.description===void 0?`${d} of these`:g.words,onMouseEnter:()=>p(o),onMouseLeave:()=>p(null),onFocus:()=>p(o),onBlur:()=>p(null),onClick:()=>{u(v),w(null)},style:{all:"unset",outline:"revert-layer",cursor:"pointer",display:"grid",gridTemplateColumns:"30px 1fr auto",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px",borderRadius:6,opacity:m?1:.4},children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",style:{display:"block",opacity:S.visible?1:.35},children:i.overview&&e?(0,a.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",className:"graview-key-ribbon",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:e(d,f)}):(0,a.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",stroke:X(I),strokeWidth:Z(I,!0),strokeDasharray:J[I.pattern],strokeLinecap:"round"})}),(0,a.jsxs)("span",{style:{display:"grid",minWidth:0},"data-graview-relation-words":o,children:[(0,a.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink)"},children:g.words}),(0,a.jsx)("span",{style:{fontSize:"0.6875rem",color:"var(--graview-ink-faint)"},children:g.ends})]}),S.visible?null:(0,a.jsx)("span",{"data-graview-quiet":o,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontStyle:"italic"},children:"not drawn"}),(0,a.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontVariantNumeric:"tabular-nums"},children:d})]},o)})]})}var je="min(280px, calc(100% - 28px))";function Je(t,e,n){let i=t.edge(e)?.from??[],c=new Map;for(let r of n!==void 0&&i.includes(n)?[n]:i.length>0?i:[""]){let u=ke(t,r,e,"out");c.set(u,[...c.get(u)??[],r])}let p=r=>r==="*"?"anything":H(t,r),h=[...c].map(([r,u])=>{let w=u.flatMap(l=>t.tryDefinition(l)?.edges[e]?.to??[]),k=u[0]&&w.length>0?`${u.map(p).join(", ")} \u2192 ${(w.includes("*")?["*"]:[...new Set(w)]).map(p).join(", ")}`:"";return[r.charAt(0).toUpperCase()+r.slice(1),k]});return{words:h.map(([r])=>r).join(" \xB7 "),ends:h.flatMap(([,r])=>r?[r]:[]).join(" \xB7 ")}}function _t({edgeKind:t,kit:e,width:n=30}){let i=q(),c=(0,W.useMemo)(()=>ie(e??i?.brand?.kit),[e,i?.brand?.kit]),{connector:p,style:h}=ee(c,t);return(0,a.jsx)("svg",{width:n,height:"8","aria-hidden":"true","data-testid":"relation-mark","data-graview-relation":t,style:{display:"inline-block",verticalAlign:"middle",opacity:p.visible?1:.35},children:(0,a.jsx)("path",{d:`M 1 4 L ${n-1} 4`,fill:"none",stroke:X(h),strokeWidth:Z(h,!0),strokeDasharray:J[h.pattern],strokeLinecap:"round"})})}function Xe({aloft:t}){let e={display:"grid",gridTemplateColumns:"30px 1fr",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px"},n={fontSize:"0.75rem",color:"var(--graview-ink-muted)"};return(0,a.jsxs)("div",{role:"group","aria-label":"The lines","data-testid":"line-manners",style:{display:"grid",gap:1,paddingBottom:6,marginBottom:4,borderBottom:"1px solid var(--graview-edge)"},children:[t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{style:e,"data-graview-manner":"ribbon",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:6})}),(0,a.jsx)("span",{style:n,children:"A relation between two districts, as wide as the links along it \u2014 point at one for its words"})]}),(0,a.jsxs)("div",{style:e,"data-graview-manner":"record",children:[(0,a.jsxs)("svg",{width:"30",height:"10","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M 1 5 L 25 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:26,cy:5,r:3,fill:"var(--graview-accent)"})]}),(0,a.jsx)("span",{style:n,children:"A chosen record's link to another record, labeled with the relation"})]}),(0,a.jsxs)("div",{style:e,"data-graview-manner":"district",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeDasharray:"5 4"})}),(0,a.jsx)("span",{style:n,children:"A chosen record's links into a district, with how many"})]})]}):null,(0,a.jsxs)("div",{style:e,"data-graview-manner":"unsure",children:[(0,a.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeOpacity:we,strokeWidth:1.8,strokeDasharray:ye,strokeLinecap:"round"})}),(0,a.jsx)("span",{style:n,children:"Unsure: a link its maker was less than sure of, until a person keeps it \u2014 point at its words for what it was based on"})]})]})}var Ie=y(O(),1),re=y(M(),1),Ze=T(E(()=>(__graviewPreload(import.meta.url,["./chunk.25VJPUDH.js","./chunk.APUQIELA.js","./chunk.S6QZBWCJ.js","./chunk.LTOQ22ZJ.js","./chunk.2TCOLAL2.js","./chunk.FUPYIOXZ.js","./chunk.3OEODIHB.js","./chunk.X36BYTEG.js","./chunk.75JQCTR6.js","./chunk.5IEZF433.js","./chunk.5AD2QHWH.js","./chunk.3FKKH2XU.js","./chunk.DLWFULWE.js","./chunk.VLX7YWVH.js","./chunk.SDO3U72B.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.7AOEZJRM.js")))),et=Ze.part(t=>(0,re.jsx)(t.SuggestedTray,{}),{quiet:!0});function Vt(){let{store:t,whileAway:e}=A(),n=B();return(0,Ie.useMemo)(()=>t.log.all().some(c=>c.suggests!==void 0&&!c.withheld),[t,n])||e?.tidied?(0,re.jsx)(et,{}):null}export{it as a,ct as b,gt as c,Bt as d,je as e,_t as f,_e as g,St as h,bt as i,Ye as j,Dt as k,Nt as l,Vt as m};
|
package/dist/preview/index.html
CHANGED
|
@@ -5,69 +5,70 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title>Graview preview</title>
|
|
7
7
|
<link rel="preload" href="/graview/document" as="fetch" crossorigin="anonymous">
|
|
8
|
-
<link rel="modulepreload" href="/chunk.
|
|
9
|
-
<link rel="modulepreload" href="/chunk.
|
|
10
|
-
<link rel="modulepreload" href="/chunk.
|
|
11
|
-
<link rel="modulepreload" href="/chunk.
|
|
8
|
+
<link rel="modulepreload" href="/chunk.K5YFUMRS.js">
|
|
9
|
+
<link rel="modulepreload" href="/chunk.XJWKIXPV.js">
|
|
10
|
+
<link rel="modulepreload" href="/chunk.TOLW64EO.js">
|
|
11
|
+
<link rel="modulepreload" href="/chunk.4VRX7FCO.js">
|
|
12
12
|
<link rel="modulepreload" href="/chunk.Q5WEOX3Q.js">
|
|
13
|
-
<link rel="modulepreload" href="/chunk.
|
|
14
|
-
<link rel="modulepreload" href="/chunk.
|
|
15
|
-
<link rel="modulepreload" href="/chunk.
|
|
16
|
-
<link rel="modulepreload" href="/chunk.
|
|
17
|
-
<link rel="modulepreload" href="/chunk.
|
|
13
|
+
<link rel="modulepreload" href="/chunk.DUP2CGVH.js">
|
|
14
|
+
<link rel="modulepreload" href="/chunk.YMXWS4XN.js">
|
|
15
|
+
<link rel="modulepreload" href="/chunk.3FKKH2XU.js">
|
|
16
|
+
<link rel="modulepreload" href="/chunk.DLWFULWE.js">
|
|
17
|
+
<link rel="modulepreload" href="/chunk.VLX7YWVH.js">
|
|
18
18
|
<link rel="modulepreload" href="/chunk.SDO3U72B.js">
|
|
19
|
-
<link rel="modulepreload" href="/chunk.
|
|
19
|
+
<link rel="modulepreload" href="/chunk.IQGSEAQ2.js">
|
|
20
20
|
<link rel="modulepreload" href="/chunk.FQLNBIQ5.js">
|
|
21
21
|
<link rel="modulepreload" href="/chunk.AJZBJBMO.js">
|
|
22
|
-
<link rel="modulepreload" href="/chunk.
|
|
23
|
-
<link rel="modulepreload" href="/chunk.
|
|
24
|
-
<link rel="modulepreload" href="/chunk.
|
|
25
|
-
<link rel="modulepreload" href="/chunk.
|
|
26
|
-
<link rel="modulepreload" href="/chunk.
|
|
22
|
+
<link rel="modulepreload" href="/chunk.3J7XLJP2.js">
|
|
23
|
+
<link rel="modulepreload" href="/chunk.4Q5PCMGZ.js">
|
|
24
|
+
<link rel="modulepreload" href="/chunk.2VIS2NAT.js">
|
|
25
|
+
<link rel="modulepreload" href="/chunk.KHXRJLLU.js">
|
|
26
|
+
<link rel="modulepreload" href="/chunk.GHHKRFPD.js">
|
|
27
|
+
<link rel="modulepreload" href="/chunk.6NRWLCIZ.js">
|
|
27
28
|
<link rel="modulepreload" href="/chunk.Q355UPFG.js">
|
|
28
|
-
<link rel="modulepreload" href="/chunk.
|
|
29
|
-
<link rel="modulepreload" href="/chunk.
|
|
30
|
-
<link rel="modulepreload" href="/chunk.
|
|
31
|
-
<link rel="modulepreload" href="/chunk.
|
|
32
|
-
<link rel="modulepreload" href="/chunk.
|
|
33
|
-
<link rel="modulepreload" href="/chunk.
|
|
34
|
-
<link rel="modulepreload" href="/chunk.
|
|
35
|
-
<link rel="modulepreload" href="/chunk.
|
|
36
|
-
<link rel="modulepreload" href="/chunk.
|
|
37
|
-
<link rel="modulepreload" href="/chunk.
|
|
38
|
-
<link rel="modulepreload" href="/chunk.
|
|
39
|
-
<link rel="modulepreload" href="/chunk.
|
|
40
|
-
<link rel="modulepreload" href="/chunk.
|
|
41
|
-
<link rel="modulepreload" href="/chunk.
|
|
42
|
-
<link rel="modulepreload" href="/chunk.
|
|
43
|
-
<link rel="modulepreload" href="/chunk.
|
|
44
|
-
<link rel="modulepreload" href="/chunk.
|
|
45
|
-
<link rel="modulepreload" href="/chunk.
|
|
46
|
-
<link rel="modulepreload" href="/chunk.
|
|
47
|
-
<link rel="modulepreload" href="/chunk.
|
|
48
|
-
<link rel="modulepreload" href="/chunk.
|
|
29
|
+
<link rel="modulepreload" href="/chunk.ZQGLPP7A.js">
|
|
30
|
+
<link rel="modulepreload" href="/chunk.7SRSE5IS.js">
|
|
31
|
+
<link rel="modulepreload" href="/chunk.VZAF3452.js">
|
|
32
|
+
<link rel="modulepreload" href="/chunk.WHX47OJM.js">
|
|
33
|
+
<link rel="modulepreload" href="/chunk.QRT6BZR6.js">
|
|
34
|
+
<link rel="modulepreload" href="/chunk.2V7QTIAV.js">
|
|
35
|
+
<link rel="modulepreload" href="/chunk.Z26T5E76.js">
|
|
36
|
+
<link rel="modulepreload" href="/chunk.77JI5T4F.js">
|
|
37
|
+
<link rel="modulepreload" href="/chunk.SADHOSRC.js">
|
|
38
|
+
<link rel="modulepreload" href="/chunk.4DZOAB4D.js">
|
|
39
|
+
<link rel="modulepreload" href="/chunk.UDU545CL.js">
|
|
40
|
+
<link rel="modulepreload" href="/chunk.7VAHHEDX.js">
|
|
41
|
+
<link rel="modulepreload" href="/chunk.P4TAX3HE.js">
|
|
42
|
+
<link rel="modulepreload" href="/chunk.T4TRJDBF.js">
|
|
43
|
+
<link rel="modulepreload" href="/chunk.2TCOLAL2.js">
|
|
44
|
+
<link rel="modulepreload" href="/chunk.2VYGDY5Z.js">
|
|
45
|
+
<link rel="modulepreload" href="/chunk.FUPYIOXZ.js">
|
|
46
|
+
<link rel="modulepreload" href="/chunk.APRWUIE3.js">
|
|
47
|
+
<link rel="modulepreload" href="/chunk.3OEODIHB.js">
|
|
48
|
+
<link rel="modulepreload" href="/chunk.WFCE7NLK.js">
|
|
49
|
+
<link rel="modulepreload" href="/chunk.HZPRMHSL.js">
|
|
49
50
|
<link rel="modulepreload" href="/chunk.BJUUSIQY.js">
|
|
50
|
-
<link rel="modulepreload" href="/chunk.
|
|
51
|
-
<link rel="modulepreload" href="/chunk.
|
|
51
|
+
<link rel="modulepreload" href="/chunk.TQ2G4AM4.js">
|
|
52
|
+
<link rel="modulepreload" href="/chunk.X36BYTEG.js">
|
|
52
53
|
<link rel="modulepreload" href="/chunk.XOZU4OFA.js">
|
|
53
|
-
<link rel="modulepreload" href="/chunk.
|
|
54
|
+
<link rel="modulepreload" href="/chunk.G7YLK4PX.js">
|
|
54
55
|
<link rel="modulepreload" href="/chunk.MB7LKKUD.js">
|
|
55
56
|
<link rel="modulepreload" href="/chunk.WVUJXDXZ.js">
|
|
56
|
-
<link rel="modulepreload" href="/chunk.
|
|
57
|
-
<link rel="modulepreload" href="/chunk.
|
|
58
|
-
<link rel="modulepreload" href="/chunk.
|
|
59
|
-
<link rel="modulepreload" href="/chunk.
|
|
60
|
-
<link rel="modulepreload" href="/chunk.
|
|
57
|
+
<link rel="modulepreload" href="/chunk.ZA5TDCBC.js">
|
|
58
|
+
<link rel="modulepreload" href="/chunk.2JEN2RCB.js">
|
|
59
|
+
<link rel="modulepreload" href="/chunk.7CLKGKSF.js">
|
|
60
|
+
<link rel="modulepreload" href="/chunk.TMHVYI5R.js">
|
|
61
|
+
<link rel="modulepreload" href="/chunk.R5MLRKAO.js">
|
|
61
62
|
<link rel="modulepreload" href="/chunk.GZHZLJBF.js">
|
|
62
|
-
<link rel="modulepreload" href="/chunk.
|
|
63
|
+
<link rel="modulepreload" href="/chunk.3SAESG6X.js">
|
|
63
64
|
<link rel="modulepreload" href="/chunk.OJGHDWI6.js">
|
|
64
|
-
<link rel="modulepreload" href="/chunk.
|
|
65
|
-
<link rel="modulepreload" href="/chunk.
|
|
66
|
-
<link rel="modulepreload" href="/chunk.
|
|
67
|
-
<link rel="modulepreload" href="/chunk.
|
|
68
|
-
<link rel="modulepreload" href="/chunk.
|
|
69
|
-
<link rel="modulepreload" href="/chunk.
|
|
70
|
-
<script>(()=>{const later=["/chunk.
|
|
65
|
+
<link rel="modulepreload" href="/chunk.F6BNFLQM.js">
|
|
66
|
+
<link rel="modulepreload" href="/chunk.75JQCTR6.js">
|
|
67
|
+
<link rel="modulepreload" href="/chunk.5IEZF433.js">
|
|
68
|
+
<link rel="modulepreload" href="/chunk.5AD2QHWH.js">
|
|
69
|
+
<link rel="modulepreload" href="/chunk.52MBXPEK.js">
|
|
70
|
+
<link rel="modulepreload" href="/chunk.4U45EY5M.js">
|
|
71
|
+
<script>(()=>{const later=["/chunk.GFQPO3NC.js","/chunk.2DH42I7L.js","/chunk.2D7K2IJQ.js","/chunk.HJCQ6I3S.js","/chunk.DQAMVVE6.js","/chunk.OXFDB5BB.js","/chunk.DJIF7IAQ.js","/chunk.BIDL7GQD.js","/chunk.TA2JTUNX.js","/chunk.2E62YCMZ.js","/chunk.YEXFVDRA.js","/chunk.HSJEOM3W.js","/chunk.37I45R6V.js","/chunk.CC7P435K.js","/chunk.ATHLE33D.js","/chunk.APUQIELA.js","/chunk.S6QZBWCJ.js","/chunk.LTOQ22ZJ.js","/chunk.U5P23GO7.js","/chunk.M5VHUIDB.js"],first=[...document.querySelectorAll('link[rel="modulepreload"]')];let left=first.length;const go=()=>{for(const href of later){const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};if(left===0)return go();const one=()=>{if(--left===0)go()};for(const link of first){link.addEventListener("load",one,{once:true});link.addEventListener("error",one,{once:true})}})()</script>
|
|
71
72
|
<style>html,body{margin:0;height:100%}#graview-app{min-height:100dvh}</style>
|
|
72
73
|
</head>
|
|
73
74
|
<body>
|
package/dist/preview/page.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as jt,b as lr,c as ur,d as fr,e as pr,f as qt,g as mr,h as zt}from"./chunk.3FON2Y72.js";import{a as uo}from"./chunk.75GVFX7L.js";import{a as Gt,b as yr,c as gr,d as wr,e as Ut,f as vr,g as br,h as Sr,i as Ar,j as Pr,k as kr,l as Er,m as Rr,n as Tr,o as Ye}from"./chunk.7V56P2A7.js";import{b as hr}from"./chunk.2B6P4GPS.js";import{a as Ct}from"./chunk.Q5WEOX3Q.js";import{a as Lt,h as Bn}from"./chunk.WKI5INH7.js";import{k as lt}from"./chunk.NHTGAP3G.js";import{B as ir,G as sr,K as cr,L as dr,h as er,k as tr,l as nr,m as It,n as rr,p as or,t as ar,y as _t}from"./chunk.AI34V6WV.js";import{c as lo}from"./chunk.G4ULQK64.js";import{Aa as Un,Ba as Kn,Ca as Jn,Ea as Yn,Fa as Qn,G as Wt,Ha as Zn,Ia as Nt,La as Xn,Oa as pt,T as Wn,Z as Nn,a as Dn,b as ut,c as ft,ga as In,ha as _n,j as $n,ja as jn,m as $t,xa as qn,ya as zn,za as Gn}from"./chunk.M7RESZB6.js";import{a as xe}from"./chunk.SDO3U72B.js";import{Bd as Cn,Cd as Ln,Ed as dt,Ib as En,Kb as Rn,ae as Te,be as Mn,ce as Hn,he as Ht,ie as Vt,jb as qe,je as Bt,me as Vn,ne as Dt,rc as Mt,sc as Tn,td as xn,ub as ct,ud as Fn,zb as kn,zd as On}from"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import{b as Be}from"./chunk.AJZBJBMO.js";async function mt(e,n={}){let o=e.compiled===void 0||!po(e.compiled,e.document)?void 0:Bn(e.compiled,n);if(o?.ok)return o;let{compileDocumentWithoutCheck:i}=await fo();return i(e.document,n)}var xr,fo=()=>xr??=(__graviewPreload(import.meta.url,["./chunk.CGALLZ54.js","./chunk.WKI5INH7.js","./chunk.QIPASE42.js","./chunk.OWT3VVOT.js","./chunk.NHTGAP3G.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.Y4S7CDRB.js")).catch(e=>{throw xr=void 0,e});function po(e,n){let o=typeof e=="object"&&e!==null?e.document:void 0,i=n;if(typeof i=="string")try{i=JSON.parse(i)}catch{return!1}return o!==void 0&&Ct(Lt(o).document)===Ct(Lt(i).document)}var d=Be(Wt(),1);var yt=Be(Wt(),1),Kt="data-graview-drawn",mo=200,Fr=50,ho=1e4,ht=()=>typeof performance<"u"?performance.now():Date.now();function yo(e){let n=[...e.querySelectorAll("img")];for(let o of e.querySelectorAll("[data-worker-view]"))o.shadowRoot&&n.push(...o.shadowRoot.querySelectorAll("img"));return n}function go(e,n){if(e.ownerDocument.fonts?.status==="loading"||zn()>0||Jn(n)>0||e.querySelector('[aria-busy="true"]')||yo(e).some(i=>!i.complete&&i.loading!=="lazy"))return!1;for(let i of e.querySelectorAll("[data-worker-view-place]"))if(!i.querySelector("[data-worker-view][data-worker-view-drawn], [data-worker-view][data-worker-view-failed]"))return!1;return!0}function Or(e){let n=e.querySelector("[data-embed-content]"),o=[...e.querySelectorAll("[data-worker-view]")].map(i=>`${i.offsetWidth}x${i.offsetHeight}`);return`${e.scrollWidth}x${e.scrollHeight}|${n?`${n.scrollWidth}x${n.scrollHeight}`:""}|${o.join(",")}`}function wo(e,n,o,i){e.removeAttribute(Kt);let l=e.ownerDocument.defaultView;if(!l)return()=>{};let u=ht(),c=u,v=Or(e),m=!1,E,F=typeof MutationObserver>"u"?void 0:new MutationObserver(x=>{x.some(O=>!(O.target===e&&O.attributeName===Kt))&&(c=ht())});F?.observe(e,{childList:!0,subtree:!0,characterData:!0,attributes:!0});let W=()=>{m=!0,F?.disconnect(),E!==void 0&&clearTimeout(E)},b=x=>{let O=!1,oe=()=>{O||(O=!0,x())};typeof l.requestAnimationFrame=="function"&&l.requestAnimationFrame(()=>setTimeout(oe,0)),setTimeout(oe,100)},T=()=>{if(m)return;let x=Or(e);x!==v&&(v=x,c=ht());let O=ht();if(go(e,i)&&O-c>=mo||O-u>=ho){b(()=>{m||(W(),e.setAttribute(Kt,n),Qn(),o())});return}E=setTimeout(T,Fr)};return E=setTimeout(T,Fr),W}function Cr(e,n,o,i,l){Yn();let u=(0,yt.useRef)({place:o,onDrawn:i});u.current={place:o,onDrawn:i},(0,yt.useLayoutEffect)(()=>{l&&Kn(l);let c=E=>wo(E,u.current.place.path,()=>u.current.onDrawn?.(u.current.place),l);if(e.current)return c(e.current);let v,m=!1;return queueMicrotask(()=>{!m&&e.current&&(v=c(e.current))}),()=>{m=!0,v?.()}},[n,e,l])}var we=Be(Wt(),1),Qe,vo=xe(()=>(__graviewPreload(import.meta.url,["./chunk.NJSK3UO2.js","./chunk.DEAP3H2L.js","./chunk.FULEUL34.js","./chunk.L3WTKQQL.js","./chunk.QDWSU47A.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.VACKSKGJ.js"))),Lr=()=>vo().then(e=>void(Qe=e),()=>new Promise(e=>setTimeout(e,2e3)).then(Lr)),Jt=qn(Lr),Mr=e=>!!e&&Qe===void 0;function Yt({onReady:e,fetch:n}){return(0,we.useLayoutEffect)(()=>void n().then(e),[e,n]),null}var bo=0;function Hr(e){let[n,o]=(0,we.useState)(()=>Qe);(0,we.useEffect)(()=>{if(!e||n)return;let u=!1;return Jt().then(()=>{u||o(Qe)}),()=>{u=!0}},[e,n]);let i=(0,we.useMemo)(()=>bo+=1,[e]);return{over:(0,we.useMemo)(()=>{let u=n??Qe;if(!e||!u)return;let{source:c,worker:v,...m}=e,E={...m,worker:v??{source:c},draft:!0};return{name:e.manifest.name,home:e.manifest.attach==="home",register:F=>u.registerWorkerView(F,E)}},[e,n]),n:i}}var Dr=Be(uo(),1),$=Be(lo(),1);var w=Be(Wn(),1);function gt(e,n={}){let o=Nt(e);return{Face:o.part((l,u)=>(0,d.createElement)(l,u),n),fetch:()=>o.load().then(()=>{}),here:()=>o.current!==void 0||o.failed}}var Xt=e=>Promise.all([e,cr()]).then(([n])=>n),$r=xe(()=>(__graviewPreload(import.meta.url,["./chunk.VC3V7HLL.js","./chunk.CY3ELWCM.js","./chunk.RMR24LFJ.js","./chunk.OWOOKLIU.js","./chunk.KMV6PJFL.js","./chunk.NAD7ZXYP.js","./chunk.2GEJNG2U.js","./chunk.HJCQ6I3S.js","./chunk.22BZU7ME.js","./chunk.2N4Z5K5S.js","./chunk.Y4FZKUOK.js","./chunk.TIALD6SC.js","./chunk.QHY5NVYH.js","./chunk.U6ZRJKVM.js","./chunk.PLTH2LW5.js","./chunk.66P5IDTH.js","./chunk.AJSUHPBE.js","./chunk.KDXU5DT3.js","./chunk.M4AYA2PL.js","./chunk.H5S7OL2U.js","./chunk.PZQNR4KZ.js","./chunk.W4BKYSZX.js","./chunk.U5P23GO7.js","./chunk.7V56P2A7.js","./chunk.2B6P4GPS.js","./chunk.NOGGSLVG.js","./chunk.GZHZLJBF.js","./chunk.UKQUUPKE.js","./chunk.OJGHDWI6.js","./chunk.DDUCIUVW.js","./chunk.NUYA4BWI.js","./chunk.OKZT2QBM.js","./chunk.ACTXR2MI.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.LGRLVJGS.js"))),So=xe(()=>(__graviewPreload(import.meta.url,["./chunk.IQPILSV3.js","./chunk.IQ3PRWGO.js","./chunk.YP2QSPXU.js","./chunk.VIH5AX7S.js","./chunk.Q355UPFG.js","./chunk.VC3V7HLL.js","./chunk.BZMQDEIY.js","./chunk.ELTV44HU.js","./chunk.CY3ELWCM.js","./chunk.I77ZGIFE.js","./chunk.OWOOKLIU.js","./chunk.RD2X25XB.js","./chunk.KMV6PJFL.js","./chunk.SWMDFXUX.js","./chunk.A3ZC2JBO.js","./chunk.NAD7ZXYP.js","./chunk.2GEJNG2U.js","./chunk.4TX6VCBT.js","./chunk.TIALD6SC.js","./chunk.66P5IDTH.js","./chunk.UQQKDBIH.js","./chunk.AJSUHPBE.js","./chunk.LAYQ5PFS.js","./chunk.KDXU5DT3.js","./chunk.O2BHPYA4.js","./chunk.H5S7OL2U.js","./chunk.BJUUSIQY.js","./chunk.PZQNR4KZ.js","./chunk.W4BKYSZX.js","./chunk.XOZU4OFA.js","./chunk.Y2YYH3JN.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.SGCW2XRC.js","./chunk.ZN3PUM2I.js","./chunk.QIPASE42.js","./chunk.EVBCEEQ4.js","./chunk.OWT3VVOT.js","./chunk.NHTGAP3G.js","./chunk.GZHZLJBF.js","./chunk.UKQUUPKE.js","./chunk.OJGHDWI6.js","./chunk.DDUCIUVW.js","./chunk.NUYA4BWI.js","./chunk.OKZT2QBM.js","./chunk.ACTXR2MI.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.PD2DECOP.js"))),Ao=xe(()=>(__graviewPreload(import.meta.url,["./chunk.IQPILSV3.js","./chunk.IQ3PRWGO.js","./chunk.YP2QSPXU.js","./chunk.VIH5AX7S.js","./chunk.Q355UPFG.js","./chunk.VC3V7HLL.js","./chunk.BZMQDEIY.js","./chunk.ELTV44HU.js","./chunk.CY3ELWCM.js","./chunk.I77ZGIFE.js","./chunk.OWOOKLIU.js","./chunk.RD2X25XB.js","./chunk.KMV6PJFL.js","./chunk.SWMDFXUX.js","./chunk.A3ZC2JBO.js","./chunk.NAD7ZXYP.js","./chunk.2GEJNG2U.js","./chunk.4TX6VCBT.js","./chunk.TIALD6SC.js","./chunk.66P5IDTH.js","./chunk.UQQKDBIH.js","./chunk.AJSUHPBE.js","./chunk.LAYQ5PFS.js","./chunk.KDXU5DT3.js","./chunk.O2BHPYA4.js","./chunk.H5S7OL2U.js","./chunk.BJUUSIQY.js","./chunk.PZQNR4KZ.js","./chunk.W4BKYSZX.js","./chunk.XOZU4OFA.js","./chunk.Y2YYH3JN.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.SGCW2XRC.js","./chunk.ZN3PUM2I.js","./chunk.QIPASE42.js","./chunk.EVBCEEQ4.js","./chunk.OWT3VVOT.js","./chunk.NHTGAP3G.js","./chunk.GZHZLJBF.js","./chunk.UKQUUPKE.js","./chunk.OJGHDWI6.js","./chunk.DDUCIUVW.js","./chunk.NUYA4BWI.js","./chunk.OKZT2QBM.js","./chunk.ACTXR2MI.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.OUPURRDE.js"))),Wr=gt(()=>Xt($r().then(e=>e.SceneFace)),{what:"This view"}),Nr=gt(()=>$r().then(e=>e.SceneKeeping),{quiet:!0}),Ir=gt(()=>Xt(So().then(e=>e.PagesContent)),{what:"This page"}),_r=gt(()=>Xt(Ao().then(e=>e.PictureFace)),{what:"This picture"}),Po=Wr.Face,ko=Nr.Face,Eo=Ir.Face,Ro=_r.Face;function De(...e){let n=e.length>0?e:["scene","pages","picture"],o=new Set(n.flatMap(jr));return Promise.all([...[...o].map(i=>i.fetch()),or()]).then(()=>{},()=>{})}var jr=e=>e==="pages"?[Ir]:e==="picture"?[_r]:[Wr,Nr],qr=e=>jr(e).every(n=>n.here()),To=150,Qt=0;function Vr(e,n){if(qr(e))return n();let o=++Qt,i=()=>{o===Qt&&(Qt+=1,n())};De(e).then(i),setTimeout(i,To)}var xo=768;function Fo(e,n){let o=n!==null&&n>=xo;(0,d.useEffect)(()=>{if(!o||e==="picture")return;let i=e==="pages"?"scene":"pages";if(qr(i))return;let l=globalThis,u=()=>void De(i),c=()=>{},v=Zn(()=>{if(l.requestIdleCallback&&l.cancelIdleCallback){let m=l.requestIdleCallback(u,{timeout:4e3});c=()=>l.cancelIdleCallback?.(m)}else{let m=setTimeout(u,1500);c=()=>clearTimeout(m)}});return()=>(v(),c())},[e,o])}function Oo({asked:e,shown:n,onDrawn:o}){return(0,d.useLayoutEffect)(()=>o(e,n),[e,n,o]),null}function Co({auto:e,scene:n}){return(0,w.jsx)("div",{"data-embed-content":"","aria-busy":"true",style:{flex:e?n?`0 0 ${Ut}px`:"0 0 auto":"1 1 auto",minHeight:0,background:"var(--graview-ground)"}})}var Lo=Nt(xe(()=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.5JNXQHN4.js")))).part((e,n)=>(0,w.jsx)(e.StudioPlace,{...n}),{quiet:!0});function zr(e,n,o,i,l){return qt(e,pr(n?ft(n):l??Dn,i),o)}function en(e){return e&&ft(e).overview?"graview":"scene"}function Br(e,n){if(n.homeView?.()===void 0)return!1;let o=e.pages?.first?.trim();return o===void 0||o===""||o==="/"||o.toLowerCase()==="home"}function Gr(e){let[,n]=(0,d.useState)(!1),o=(0,d.useCallback)(()=>n(!0),[]),i=(0,d.useRef)(!1);return e.at&&!wt?(0,w.jsx)(Yt,{onReady:o,fetch:tn}):!i.current&&Mr(e.draftView)?(0,w.jsx)(Yt,{onReady:o,fetch:Jt}):(i.current=!0,(0,w.jsx)(Mo,{...e}))}function Mo(e){let{app:n,stop:o,bar:i=!0,standing:l="Everything is in order",principal:u,heading:c=2}=e,{rootRef:v,scope:m,css:E,scheme:F,store:W,presence:b,brand:T,auto:x,height:O}=vr(e),oe=Hr(e.draftView),R=gr(e,dr,oe.over),[le]=(0,d.useState)(Un),p=e.basePath===void 0?{}:{basePath:e.basePath},[B]=(0,d.useState)(It),D=e.notices??B,z=g=>Ht(g,p),ie={...e.routing?{routing:e.routing}:{},...p},[se]=(0,d.useState)(()=>{let g=e.at?.face;if(g)return g;let Q=o===void 0&&Br(n,R)?"pages":en(o),K=jt({...ie,face:Q});return e.face===void 0&&e.onOpening?.(K),K}),[be,H]=(0,d.useState)(()=>e.face!==void 0&&e.face!=="pages"&&!e.at&&o===void 0&&lr(ie)&&Br(n,R)),Se=(0,d.useRef)(e.onFace);Se.current=e.onFace,(0,d.useLayoutEffect)(()=>{be&&(Se.current?.("pages"),H(!1))},[be]);let A=be?"pages":e.face??se,k=n.schema.kinds,V=e.routing==="address",Ae=(0,d.useMemo)(()=>e.at?wt.settleAt(e,W.seenBy(u??{kind:"human"}),R.places()):void 0,[]),C=(0,d.useMemo)(()=>_n(R,n.schema),[R,n.schema]),me=(0,d.useMemo)(()=>{let g=Ae?.stop??(V?ur(e.basePath):void 0)??o;return A==="scene"&&g===void 0&&C===void 0&&(e.path===void 0||Zt(e.path))?zt(void 0):zr(A,g,k,R.places(),C)},[]),[N]=(0,d.useState)(A);(0,d.useEffect)(()=>{N!=="pages"&&In(R)},[N,R]);let L=(0,d.useRef)(void 0),q=g=>g===void 0||Zt(g)?"/":g;L.current??={path:q(Ae?.path??(V?A==="pages"?(Vt(window.location.pathname,e.basePath)??"/")+window.location.search:"/":e.path)),asked:e.path},e.path!==L.current.asked&&(L.current={path:q(e.path),asked:e.path});let Z=(0,d.useRef)(e.onNavigate);Z.current=e.onNavigate;let Oe=(0,d.useCallback)((g,Q)=>{L.current.path=g,Z.current?.(g,Q)},[]),{at:he,setAt:j,steering:G,steer:ae}=Er(L.current.path),M=(0,d.useContext)(Ur);M&&(M.pages=()=>L.current.path);let[$e]=(0,d.useState)(()=>({})),J=M??$e,ce=(0,d.useMemo)(()=>tr(D),[D]),I=(0,d.useRef)(void 0),Pe=(0,d.useCallback)(g=>void(L.current.path=g),[]),X=er(v),[Ce,ee]=(0,d.useState)(!1),Xe=e.pagesBelow!==void 0&&X!==null&&X<e.pagesBelow&&(A==="scene"||A==="graview")&&!Ce,P=Xe?"pages":A,Le=(0,d.useRef)(!1);Le.current=Ce&&e.pagesBelow!==void 0&&X!==null&&X<e.pagesBelow&&(A==="scene"||A==="graview"),M&&(M.shown=P);let Me=(0,d.useRef)(A==="graview"?"graview":"scene");(P==="scene"||P==="graview")&&(Me.current=P),(0,d.useState)(()=>{if(!V||typeof window>"u"||P==="pages"||P==="picture")return;let{pathname:g,search:Q,hash:K}=window.location;Vt(g,e.basePath)==="/"&&window.history.replaceState(window.history.state,"",`${z(Te)}${Q}${K}`)}),wr(v,P,e.onIntrinsicHeight),Fo(P,X);let te=Rr(e.onError,P),He=Tr(e.onReady,P),ke=(0,d.useRef)(e.onFaceDrawn);ke.current=e.onFaceDrawn;let et=(0,d.useCallback)((g,Q)=>{He(Q),ke.current?.(g)},[He]),[We,Pt]=(0,d.useState)(null),tt=R.places(),Ne=(0,d.useRef)({shown:P,onFace:e.onFace});Ne.current={shown:P,onFace:e.onFace};let _=(0,d.useCallback)((g,Q,K)=>{if(V){I.current?.(g,Q,K);return}Ne.current.onFace?.(g),Z.current?.(g==="pages"?Q??L.current.path:Te,"push")},[V]),[ye,U]=(0,d.useState)(void 0);(0,d.useEffect)(()=>{P==="pages"&&U(void 0)},[P]);let Ie=(0,d.useRef)(o);(0,d.useEffect)(()=>{Ie.current!==o&&(Ie.current=o,U(void 0))},[o]);let Ee=(0,d.useCallback)(g=>{if(Ne.current.shown==="pages"){if(ee(!0),U(g),A==="scene"||A==="graview"){Vr(A,()=>{V?window.history.pushState(null,"",`${z(Te)}${g??""}`):Z.current?.(Te,"push")});return}Vr(Me.current,()=>_(Me.current,void 0,g))}},[V,A,e.basePath,_]),Ve=(0,d.useCallback)(g=>{if(Ne.current.shown==="pages"){G.go.current||(L.current.path=g),ae(g);return}if(L.current.path=g,j(g),Le.current){ee(!1),V?window.history.pushState(null,"",z(g)):Z.current?.(g,"push");return}_("pages",g)},[G,ae,j,_,V,e.basePath]),Ke=R.arrangement?.(),ue=P==="pages",Re=e.hrefOf,_e=Re??(V?z:void 0),Y=(0,d.useMemo)(()=>({open:Ve,...Re?{href:Re}:V?{href:g=>Ht(g,e.basePath===void 0?{}:{basePath:e.basePath})}:{}}),[Ve,V,e.basePath,Re]);return(0,w.jsxs)("section",{ref:v,className:m,"aria-label":e.label??n.name,"data-graview-embed":P,"data-graview-scheme":F,...Xe?{"data-graview-embed-narrow":""}:{},style:{position:"relative",isolation:"isolate",height:O,minHeight:x?0:320,display:"flex",flexDirection:"column",overflow:"hidden",borderRadius:"var(--graview-radius, 12px)"},children:[(0,w.jsx)("style",{children:E}),(0,w.jsxs)(Xn.Provider,{value:te,children:[(0,w.jsx)(br,{rootRef:v,board:D,onReport:e.onReport,where:()=>P==="pages"?Sr(he):P==="picture"?{place:"picture"}:nr(J.view?.focusId)}),(0,w.jsx)(yr,{rootRef:v,firstLook:e.firstLook,app:ir(T??{name:n.name},n.schema)}),(0,w.jsx)(Ye,{module:"@graview/react",report:te,content:!0,children:(0,w.jsx)(Gn.Provider,{value:le,children:(0,w.jsx)(Nn,{store:W,views:R,initialView:me,scheme:F,...Ar(e,b,T),...e.onSeat?{onSeat:e.onSeat}:{},children:(0,w.jsxs)(rr.Provider,{value:ce,children:[(0,w.jsx)(Do,{face:P,stop:ye??o,kinds:k,places:tt,opens:C}),(0,w.jsx)(Ho,{into:J}),(0,w.jsx)(Vo,{rootRef:v,face:A,shown:P,path:he,stop:o,draft:oe.n,onDrawn:e.onDrawn,parts:le}),V?(0,w.jsx)(fr,{pagesWere:Ae?.path,basePath:e.basePath,shown:P,onFace:e.onFace,toggle:I,kinds:k,places:tt,opens:C,landed:Pe}):null,i&&P!=="picture"?(0,w.jsx)(Ye,{module:"@graview/embed",report:te,children:(0,w.jsx)(Pr,{name:T?.name??n.name,heading:c,named:Gt(i).name!==!1,faces:Gt(i).faces===!1?void 0:{scene:{label:Mn(Ke),current:!ue,go:()=>Ee(),reach:()=>void De(Me.current)},pages:{label:Hn(Ke),current:ue,go:()=>Ve(L.current.path),reach:()=>void De("pages")}},at:ue?he:null,without:e.pages?.without(),home:{..._e?.("/")!==void 0?{href:_e("/")}:{},go:()=>Ve("/"),current:ue&&he.split("?")[0]==="/"},reach:{..._e?{href:_e}:{},go:g=>Ve(g.path)},standing:l,hostActions:e.hostActions,barActions:e.barActions,keeping:ue?void 0:(0,w.jsx)($o,{app:n,studio:e.studio,report:te}),onFind:Pt,switch:e.switch})}):null,(0,w.jsx)(ar.Provider,{value:We,children:(0,w.jsx)(Ye,{module:P==="pages"||P==="picture"?"@graview/pages":"@graview/react",report:te,content:!0,children:(0,w.jsxs)(d.Suspense,{fallback:(0,w.jsx)(Co,{auto:x,scene:P!=="pages"&&P!=="picture"}),children:[P==="picture"?(0,w.jsx)(Ro,{scope:m,store:W,views:R,as:(o?ft(o).within?.view:void 0)??""}):P==="pages"?(0,w.jsx)(Eo,{store:W,views:R,presence:b,auto:x,brand:T,steering:G,overview:Ee,scope:m,titleLevel:kr(c),quickAsk:_t(e.quickAsk),props:{...e,onNavigate:Oe,...V?{}:{path:L.current.path}}}):(0,w.jsx)(jn.Provider,{value:Y,children:(0,w.jsx)(Po,{address:V,auto:x,scheme:F,scope:m,quickAsk:_t(e.quickAsk)})}),(0,w.jsx)(Oo,{asked:A,shown:P,onDrawn:et})]})},P)})]})})})})]})]})}var Zt=e=>e.split(/[?#]/)[0]===Te,Ur=(0,d.createContext)(null);function Ho({into:e}){return e.view=pt().view,null}function Vo({rootRef:e,face:n,shown:o,path:i,stop:l,draft:u,onDrawn:c,parts:v}){let{view:m}=pt(),E=o==="scene"||o==="graview",F=ut(m),{pan:W,...b}=m,T=m.pan?ut(b):F,x={face:n,path:E?Te:o==="picture"?l??"#":i,stop:F};return Cr(e,`${o} ${E?T:x.path} ${u}`,x,c,v),null}var wt,Bo=xe(()=>(__graviewPreload(import.meta.url,["./chunk.3FON2Y72.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.SVPKUWZU.js"))),tn=()=>Bo().then(e=>void(wt=e),()=>new Promise(e=>{let n=()=>{window.removeEventListener("online",n),clearTimeout(o),e()},o=setTimeout(n,1e4);window.addEventListener("online",n)}).then(tn));function Do({face:e,stop:n,kinds:o,places:i,opens:l}){let{view:u,go:c}=pt(),v=(0,d.useRef)({face:e,stop:n});return(0,d.useLayoutEffect)(()=>{let m=v.current.stop!==n,E=v.current.face!==e,F=v.current.face==="pages";if(v.current={face:e,stop:n},!m&&!E||e==="pages"||e==="picture")return;let W=(m||F)&&n!==void 0?zr(e,n,o,i):F&&mr(u)?qt(e,zt(l),o):e==="graview"?$t(u,!0):u.overview?$n($t(u,!1),sr(u,o)):u;c(W)},[e,n,o,u,c,l]),null}function $o({app:e,studio:n,report:o}){return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(d.Suspense,{fallback:null,children:(0,w.jsx)(ko,{})}),n!==!1?(0,w.jsx)(Ye,{module:"@graview/studio",report:o,children:(0,w.jsx)(Wo,{app:e,studio:n})}):null]})}function Wo({app:e,studio:n}){let o={app:e,within:"box",...n?{onApply:n.onApply}:{},...n?.landmark?{landmark:n.landmark}:{},...n?.offered!==void 0?{offered:n.offered}:{}},i=n?.place;return i?(0,w.jsx)(i,{...o}):(0,w.jsx)(d.Suspense,{fallback:null,children:(0,w.jsx)(Lo,{...o})})}function No({path:e,stop:n,...o},i){return{...o,app:i.app,at:i.at,remote:i.remote,...i.remote.presence?{presence:i.remote.presence}:{}}}function nn(e,n){let o=n.store??n.remote?.store??hr(n.app,n.seed),i=n.notices??It(),l=null,u={},c=0,v=n.label,m=n.app,E=Promise.resolve(),F=n.at?.face??n.face,W=F===void 0?void 0:jt({...n,face:F}),b=W??en(n.stop),T=null,x=[],O=p=>{if(T=p,p!==b)return;let B=x;x=[];for(let D of B)D()};function oe(){let[p,B]=(0,d.useState)(W),[D,z]=(0,d.useState)(n.stop),[ie,se]=(0,d.useState)(n.path),[be,H]=(0,d.useState)(n.scheme??"auto"),[Se,A]=(0,d.useState)(n.principal),[k,V]=(0,d.useState)(n.seats),[Ae,C]=(0,d.useState)(n.quickAsk),[me,N]=(0,d.useState)(n.people),[L,q]=(0,d.useState)(n.hostContext),[Z,Oe]=(0,d.useState)(n.brand),[he,j]=(0,d.useState)(n.whileAway),[G,ae]=(0,d.useState)(n.label),[M,$e]=(0,d.useState)(n.hostActions),[J,ce]=(0,d.useState)(n.barActions),[I,Pe]=(0,d.useState)(void 0),[X,Ce]=(0,d.useState)(n.draftView);return l={app:ee=>{Pe(ee),se(void 0),z(void 0)},face:B,stop:z,path:se,scheme:H,seat:A,seats:V,quickAsk:C,people:N,hostContext:q,brand:Oe,whileAway:j,label:ae,hostActions:$e,barActions:ce,draft:Ce},(0,w.jsx)(Ur.Provider,{value:u,children:(0,w.jsx)(Gr,{...I?No(n,I):n,store:o,notices:i,...p!==void 0?{face:p}:{},onOpening:ee=>{b=ee},...D!==void 0?{stop:D}:{},...ie!==void 0?{path:ie}:{},...Se?{principal:Se}:{},...k?{seats:k}:{},...Ae!==void 0?{quickAsk:Ae}:{},...me?{people:me}:{},...L?{hostContext:L}:{},...Z?{brand:Z}:{},whileAway:he,label:G,hostActions:M,barActions:J,draftView:X,scheme:be,onFace:ee=>{b=ee,B(ee)},onSeat:A,onFaceDrawn:O},I?.n??0)})}let R=()=>{let p=u.view?.focusId,B=p?o.graph.getNode(p)?.kind:void 0,D=(u.shown??b)==="scene"||(u.shown??b)==="graview";return{face:b,path:D?Te:u.pages?.()??n.path??"/",stop:u.view?ut(u.view):n.stop??"#",...B?{kind:B}:{}}},le=(0,Dr.createRoot)(e);return(0,$.flushSync)(()=>le.render((0,w.jsx)(oe,{}))),{get store(){return o},where:R,setApp:(p,B,D)=>{let z="graph"in B?{store:B}:B,ie=()=>{let se=R();o=z.store,v=D?.label??(v===m.name?p.name:v),m=p,(0,$.flushSync)(()=>{l?.label(v),l?.app({app:p,remote:z,at:se,n:++c})})};wt?ie():E=E.then(tn).then(ie)},setFace:p=>{b=p,(0,$.flushSync)(()=>l?.face(p))},setStop:p=>(0,$.flushSync)(()=>l?.stop(p)),setPath:p=>(0,$.flushSync)(()=>{if(Zt(p)){(b==="pages"||b==="picture")&&(b="scene",l?.face("scene"));return}l?.path(p),b!=="pages"&&(b="pages",l?.face("pages"))}),setScheme:p=>(0,$.flushSync)(()=>l?.scheme(p)),setSeat:p=>(0,$.flushSync)(()=>l?.seat(p)),setSeats:p=>(0,$.flushSync)(()=>l?.seats(p)),setQuickAsk:p=>(0,$.flushSync)(()=>l?.quickAsk(p)),setPeople:p=>(0,$.flushSync)(()=>l?.people(p)),setHostContext:p=>(0,$.flushSync)(()=>l?.hostContext(p)),setBrand:p=>(0,$.flushSync)(()=>l?.brand(p)),setWhileAway:p=>(0,$.flushSync)(()=>l?.whileAway(p)),setDraftView:p=>(0,$.flushSync)(()=>l?.draft(p)),setLabel:p=>{v=p,(0,$.flushSync)(()=>l?.label(p))},setHostActions:p=>(0,$.flushSync)(()=>l?.hostActions(p)),setBarActions:p=>(0,$.flushSync)(()=>l?.barActions(p)),drawn:()=>E.then(()=>T===b?void 0:new Promise(p=>x.push(p))),notify:p=>{let B;return(0,$.flushSync)(()=>{B=i.notify(p)}),B},unmount:()=>le.unmount()}}var vt=e=>`s${(e+1).toString(36)}`;var ve={seat:"x-graview-seat",roles:"x-graview-roles",kind:"x-graview-kind",name:"x-graview-name",for:"x-graview-for",forRoles:"x-graview-for-roles",forName:"x-graview-for-name",via:"x-graview-via"},ze={header:"x-graview-key",param:"graview_key",cookie:"graview_key"};function bt(e,n={}){try{let o=new URL(e),i=o.searchParams.get(ze.param);if(i)return o.searchParams.delete(ze.param),{url:o.origin+o.pathname.replace(/\/$/,"")+o.search,key:i,headers:{[ze.header]:i,...n}}}catch{}return{url:e.replace(/\/$/,""),headers:n}}var Kr="/graview/friction";var Jr="/graview/live",rn="graview.ship",on=`${rn}.${ct}`;var Ge=class extends Error{constructor(n){super(n),this.name="Superseded"}},Fe=e=>e?.lineage?{lineage:e.lineage}:{},Io=(e,n)=>`${e.calls.map(o=>o.name.replace(/-/g," ")).join(", ")} (${n instanceof Error?n.message.split(`
|
|
2
|
-
`)[0]??"":String(n)})`;function _o(e){if(!e)return[];try{let n=e.storage.getItem(e.key);if(n===null)return[];e.storage.removeItem(e.key);let o=JSON.parse(n);return Array.isArray(o)?o.filter(i=>!!i&&Array.isArray(i.calls)):[]}catch{return[]}}var Ue=class extends Error{constructor(o){super(o.sentence);this.refusal=o;this.name="RemoteRefusedError"}},jo={401:"forbidden",403:"forbidden",404:"missing",413:"limit"},pe=class extends Error{constructor(o,i){super(o);this.conflicts=i;this.name="StaleWrite"}},Ze=class extends Error{constructor(n){super(n),this.name="Unreached"}},qo=new Set([502,503,504]);async function zo(e){try{return(await e.clone().json()).reason==="unavailable"}catch{return!1}}function Go(){let e=Math.random().toString(36).slice(2,8),n=0;return()=>`local-${e}-${++n}`}var Uo=1,Ko=()=>({refusals:new Set,conflicts:new Set,statuses:new Set,helds:new Set,builds:new Set,who:new Set,declarations:new Set,tally:{reconnects:0,rebases:0,conflicts:0,resyncs:0}});async function St(e){return(await Yr(e,_o(e.carry),"This app was updated while your changes were on the way.",Ko())).remote}async function Yr(e,n,o,i){let{key:l,...u}=bt(e.url,e.headers),c={...e,...u},v=c.fetch??fetch,m={"content-type":"application/json",...c.headers??{}},E={...At(c.principal),[ve.via]:c.via??"web"};Object.assign(m,E);let F=c.live===!0,W=c.presenceEveryMs,b=c.visible??Qo,T="connecting",x=i.statuses,O=i.tally,oe=[],R,le=[],p=()=>T==="online"&&R!==void 0?"held":T,B=()=>{let t=p();if(i.told!==t){i.told=t;for(let r of[...x])r(t)}},D=t=>{if(!(t===T||de)&&(T==="offline"&&t==="online"&&O.reconnects++,T=t,B(),t==="online"))for(let r of oe.splice(0))r.again()},z=t=>{if(de)return;let r=typeof t=="string"&&t.length>0?t:void 0,s=r!==R;if(R=r,ie(),!!s&&(B(),r===void 0)){for(let a of le.splice(0))a();ne&&clearTimeout(ne),ln()}},ie=()=>{if(i.toldHeld!==R){i.toldHeld=R;for(let t of[...i.helds])t(R??null)}},se=async(t,r)=>{let s;try{s=await v(t,r)}catch(a){throw Y()||D("offline"),new Ze(a instanceof Error?a.message:String(a))}if(s.status===503&&await zo(s))return D("online"),s;if(qo.has(s.status))throw Y()||D("offline"),new Ze(`The server is away (${s.status})`);return D("online"),s},be=async(t=!1)=>{let r=`${c.url}/graview/state?opFormat=${qe.op}`,s=t?await v(r,{headers:m}):await se(r,{headers:m});if(!s.ok)throw new Error((await s.json().catch(()=>({}))).error??`The server refused (${s.status})`);return await s.json()},H=c.state??await be(!0);F||(T="online"),R=typeof H.held=="string"&&H.held.length>0?H.held:void 0,ie();let Se=H.enabledModules??c.enabledModules,A=c.localApp?c.localApp(c.app):c.app,k=new Ln({schema:A.schema,mutations:A.mutations??[],invariants:A.invariants??[],...A.policy?{policy:A.policy}:{},...A.publishing?{publishing:A.publishing}:{},...A.tidying?{tidying:A.tidying}:{},...A.modules?{modules:A.modules}:{},...Se?{enabledModules:Se}:{},...A.intelligence?{intelligence:A.intelligence}:{},...A.brand?.timeZone?{timeZone:A.brand.timeZone}:{},snapshot:H.snapshot,log:H.log,...H.horizon!==void 0?{horizon:H.horizon}:{},ids:Go(),...c.storeOptions??{}});Rn.served.add(k);let V=c.friction!==!1&&c.principal?.kind!=="visitor";V&&xn(k,t=>{V&&v(`${c.url}${Kr}`,{method:"POST",headers:m,body:JSON.stringify({event:t})}).then(r=>void(V=r.status!==404&&r.status!==410),()=>{})});let Ae=On(k),C=H.log.at(-1)?.seq??(H.horizon??0)-1,me=Mt.of(H.log,{horizon:H.horizon??0}),N=null,L,q=new Map,Z=i.who,Oe=!1,he=t=>{if(de)return;Oe=!0;let r=Vn(new Map,t,Date.now(),Bt,N?.participant);L!==void 0&&r.delete(L);let s=r.size!==q.size;if(!s)for(let[a,f]of r)Dt(f,q.get(a))||(s=!0);if(q=r,!!s)for(let a of[...Z])a([...q.values()])},j=[],G=new Set,ae=t=>{let r=j.indexOf(t);r>=0&&j.splice(r,1)},M=new Map,$e=(t,r)=>{let s=M.get(t);s&&(M.delete(t),s.resolve({ops:r.filter(a=>a.batch===t),batch:t}))},J,ce=[],I=(t,r=[])=>{if(t.length===0&&r.length===0)return[];if(J)return ce.push({ops:t,drop:r}),[];let s=Math.min(...t.filter(h=>h.seq>C).map(h=>h.seq));if(Number.isFinite(s)&&s>C+1)return ce.push({ops:t,drop:r}),Pe(),[];let a=j.filter(h=>t.some(re=>re.batch===h)),f=[...new Set([...r,...a])].filter(h=>G.has(h)),y,S=j.filter(h=>!a.includes(h));try{y=k.rebase({confirmed:t,pending:S,drop:f}).confirmed}catch(h){if(!(h instanceof Cn))throw h;return ce.push({ops:t,drop:r}),Pe(),[]}for(let h of a)ae(h);t.some(h=>h.seq>C)&&S.some(h=>!f.includes(h))&&O.rebases++,t.length>0&&(C=Math.max(C,...t.map(h=>h.seq)),me.note(t));for(let h of f)G.delete(h);for(let h of a)$e(h,t);return y},Pe=()=>{J||(J=ke(be().then(t=>{if(X(t)){ce=[];return}let r=new Set(t.log.map(f=>f.batch)),s=j.filter(f=>r.has(f));for(let f of s)ae(f);let a=k.adopt({snapshot:t.snapshot,log:t.log,...t.horizon!==void 0?{horizon:t.horizon}:{},pending:[...j],drop:[...G].filter(f=>!j.includes(f))});G.clear();for(let f of a.pending)G.add(f.batch);C=t.log.at(-1)?.seq??(t.horizon??0)-1,me=Mt.of(t.log,{horizon:t.horizon??0}),O.resyncs++;for(let f of s)$e(f,t.log)}).then(()=>{J=void 0;let t=ce;ce=[];for(let{ops:r,drop:s}of t)I(r,s)},()=>{J=void 0,ce=[]})))},X=t=>(typeof t.build=="string"&&fn(t.build),typeof t.version=="number"&&z(t.held),typeof t.version!="number"||t.version===H.version?!1:(Rt(t.version),!0)),Ce=async t=>{let s=await(await se(`${c.url}/graview/since?seq=${vt(t)}&opFormat=${qe.op}`,{headers:m})).json();return X(s)?[]:s.reset===!0?(Pe(),[]):s.ops??[]},ee=async()=>{let t=await Xe();return J&&await J,t},Xe=async()=>{if(N&&!Y()&&b()){let r=await(await se(`${c.url}/graview/here?opFormat=${qe.op}`,{method:"POST",headers:m,body:JSON.stringify({presence:N,seq:vt(C)})})).json();return X(r)?[]:(typeof r.participant=="string"&&(L=r.participant),he(r.who??[]),I(r.ops??[]))}return I(await Ce(C))},P=new Map,Le=new Map,Me=new Set,te=new Map,He=new Set,ke=t=>(He.add(t),t.finally(()=>He.delete(t)).catch(()=>{}),t),et=Promise.resolve(),We=0,Pt=(t,r)=>{let s=et.then(()=>Ne(t,r));return et=s.catch(()=>{}),s},tt=()=>new Promise((t,r)=>oe.push({again:t,give:r})),Ne=async(t,r)=>{let s,a;for(;;){try{s=await se(`${c.url}/graview/ops`,{method:"POST",headers:m,body:JSON.stringify({...t,opFormat:qe.op})})}catch(h){if(!(h instanceof Ze)||U)throw h;if(await tt(),Y())return nt(t,r);continue}if(a=await s.json().catch(()=>({})),s.status===503&&a.reason==="unavailable"&&typeof a.held=="string"&&!U){if(typeof a.version=="number"?X(a):(z(a.held),!1))break;if(R!==void 0&&(Ot>0||F)){if(await new Promise(h=>le.push(h)),U)throw new Ge("The client closed.");if(Y())return nt(t,r);continue}}let S;if(s.status===503&&a.reason==="unavailable"&&!U)S=an(c.backoff,We++);else{if(We=0,s.status!==429||U)break;S=Jo(s.headers.get("retry-after"),a.retryAfter)}if(await new Promise(h=>setTimeout(h,S)),Y())return nt(t,r)}if(de||X(a))throw new Ge("The app was changed.");if(!s.ok){let S=a.error??`The server refused (${s.status})`;throw a.conflict?new pe(S,a.conflicts??[]):new Ue({reason:a.reason??jo[s.status]??"invalid",sentence:S,...a.wouldNeed?.length?{wouldNeed:a.wouldNeed}:{}})}let f=a.ops??[],y=f[0]?.seq;return y!==void 0&&y>C+1&&(f=await Ce(C)),r!==void 0&&(a.batch&&P.set(r,a.batch),ae(r)),I(f,r!==void 0?[r]:[]),{ops:a.ops??[],...a.batch?{batch:a.batch}:{}}},_,ye=!1,U=!1,Ie=0,Ee,Ve=0,Ke=0,ue=null,Re=()=>{},_e=new Promise(t=>{Re=t}),Y=()=>F&&ye&&_?.readyState===Uo,g=t=>{if(!Y())return!1;try{return _.send(JSON.stringify(t)),!0}catch{return!1}},Q=(t=!1)=>{!N||!Y()||!b()||!t&&ue&&Dt(N,ue)&&(W===void 0||Date.now()-Ke<W)||g({t:"here",presence:N})&&(ue=N,Ke=Date.now())},K=new Set,ne,ln=()=>{if(ne=void 0,R!==void 0)return;let t=[...M.entries()].filter(([r])=>K.has(r));K.clear();for(let[,r]of t)g(r.message)},un=(t,r)=>{M.has(t)&&(K.add(t),ne&&clearTimeout(ne),ne=setTimeout(ln,Math.max(0,r)))},Xr=t=>{M.has(t)&&K.add(t)},nt=(t,r)=>new Promise((s,a)=>{let f=r??`send-${++Ve}`,y=t.undo?{t:"undo",cid:f,batches:t.undo,...t.intent?{intent:t.intent}:{},...t.batch?{batch:t.batch}:{},...t.via?{via:t.via}:{},...Fe(t)}:{t:"call",cid:f,calls:t.calls??[],...t.intent?{intent:t.intent}:{},...t.batch?{batch:t.batch}:{},...t.base?.length?{base:t.base}:{},...t.via?{via:t.via}:{},...Fe(t)};if(M.set(f,{message:y,...r!==void 0?{mine:r}:{},resolve:s,reject:a}),K.size>0||R!==void 0){K.add(f);return}g(y)}),rt=(t,r)=>Y()?nt(t,r):Pt(t,r),eo=t=>{switch(t.t){case"welcome":{if(fn(t.build),typeof t.version=="number"&&t.version!==H.version){Rt(t.version);return}if(ye=!0,Ie=0,typeof t.participant=="string"&&(L=t.participant),z(t.held),t.state?Pe():I(t.ops??[]),K.clear(),ne&&clearTimeout(ne),ne=void 0,R!==void 0)for(let r of M.keys())K.add(r);else for(let r of M.values())g(r.message);Q(!0),D("online"),Re();return}case"ops":I(t.ops??[]);return;case"ack":{let r=M.get(t.cid);if(!r){I(t.ops??[]);return}M.delete(t.cid),We=0,r.mine!==void 0&&(P.set(r.mine,t.batch),ae(r.mine)),I(t.ops??[],r.mine!==void 0?[r.mine]:[]),r.resolve({ops:t.ops??[],batch:t.batch});return}case"refused":case"conflict":{let r=M.get(t.cid);if(!r)return;if(t.t==="refused"&&t.reason==="unavailable"){R!==void 0?Xr(t.cid):un(t.cid,an(c.backoff,We++));return}M.delete(t.cid),r.reject(t.t==="conflict"?new pe(t.sentence,t.conflicts??[]):new Ue({reason:t.reason??"invalid",sentence:t.sentence,...t.wouldNeed?.length?{wouldNeed:[...t.wouldNeed]}:{}}));return}case"busy":typeof t.cid=="string"&&un(t.cid,typeof t.retryAfter=="number"?t.retryAfter:1e3);return;case"presence":he(t.who??[]);return;case"held":z(t.sentence);return;case"declaration":typeof t.version=="number"&&t.version!==H.version&&Rt(t.version);return;case"reload":yn(typeof t.reason=="string"?t.reason:"This app was updated.");return;case"error":if(t.reopen===!0&&_){let r=_;wn(r);try{r.close(1e3,"Opening again.")}catch{}}return;default:return}},de=!1,kt=i.declarations,Et=i.builds,fn=t=>{if(!(de||i.otherBuild!==void 0||!c.build||typeof t!="string"||t.length===0||t===c.build)){i.otherBuild=t;for(let r of[...Et])r(t)}},pn=()=>{let t=[],r=0;for(let s of j){let a=te.get(s);a?t.push({calls:a.calls,...a.intent?{intent:a.intent}:{},...a.via?{via:a.via}:{},...Fe(a),batch:s}):r++}return{carried:t,undos:r}},mn=(t,r)=>`${r} while ${t===1?"an undo of yours was":"undos of yours were"} on the way; ${t===1?"it was":"they were"} not made.`,hn=t=>{de=!0,N=null;let r=new Ge(t);for(let a of M.values())a.reject(r);M.clear(),it&&clearInterval(it),U=!0,Ee&&clearTimeout(Ee),ne&&clearTimeout(ne),ge&&clearTimeout(ge);for(let a of oe.splice(0))a.give(r);for(let a of le.splice(0))a();let s=_;_=void 0,ye=!1;try{s?.close(1e3,t)}catch{}Re()};async function Rt(t){if(de)return;if(!c.resolveApp){yn(`This app was changed on its server (version ${t}); reload the page to carry on.`);return}let{carried:r,undos:s}=pn(),a=c.resolveApp,f=N;hn("The app was changed.");try{let y=await a(t),{state:S,...h}=c,re=await Yr({...h,app:y},r,"The app was changed while your changes were on the way.",i);f&&re.remote.presence.here(f);for(let st of[...kt])st(re.remote,t);let fe=[...s>0?[ot(mn(s,"The app was changed"))]:[],...re.unheard()];for(let st of fe)for(let co of je)co(st.sentence,st)}catch(y){let S=`The app was changed, but the new version could not be opened: ${y instanceof Error?y.message:String(y)}`;for(let h of je)h(S,ot(S))}}function yn(t){if(de)return;let{carried:r,undos:s}=pn();hn(t);let a=!1;if(c.carry&&r.length>0)try{c.carry.storage.setItem(c.carry.key,JSON.stringify(r)),a=!0}catch{}let f=[];!a&&r.length>0&&f.push(`${t} ${r.length===1?"A change of yours was":`${r.length} changes of yours were`} not sent; make ${r.length===1?"it":"them"} again after the page reloads.`),s>0&&f.push(mn(s,"This app was updated"));for(let y of f)for(let S of je)S(y,ot(y));(c.reloadPage??Yo)()}let gn=()=>{if(U||!F)return;let t=`${c.url.replace(/^http/,"ws").replace(/\/$/,"")}${Jr}`,{"content-type":r,...s}=m,a;try{a=c.socket?c.socket(t,s,[on]):so(t,s)}catch{return vn()}_=a,ye=!1,a.onopen=()=>{_===a&&a.send(JSON.stringify({t:"hello",seq:vt(C),protocol:ct,wire:rn,opFormat:qe.op,...c.build?{build:c.build.slice(0,64)}:{},...c.hostProtocol!==void 0?{hostProtocol:c.hostProtocol}:{}}))},a.onmessage=f=>{if(_!==a)return;let y;try{y=JSON.parse(String(f.data))}catch{return}eo(y)},a.onclose=()=>wn(a),a.onerror=()=>{}},ge,to=()=>{Oe=!1,ge&&clearTimeout(ge),ge=setTimeout(()=>{if(ge=void 0,Oe||U)return;let t=new Map([...q].filter(([,r])=>r.held!=="socket"));if(t.size!==q.size){q=t;for(let r of Z)r([...q.values()])}},Bt),ge.unref?.()};function wn(t){if(_!==t)return;let r=ye;_=void 0,ye=!1,ue=null,r&&(D("offline"),to()),vn()}let vn=()=>{if(U)return;let t=an(c.backoff,Ie);Ie++,Ee=setTimeout(gn,t)},bn=k.applyAll.bind(k),no=k.undo.bind(k),ro=k.previewAll.bind(k);k.previewAll=(t,r)=>ro(t,{...c.principal?{author:c.principal}:{},...r});let je=i.refusals,Je=[],ot=t=>({reason:"invalid",sentence:t}),at=i.conflicts,Tt=!1,Sn,xt=async(t,r)=>{if(r instanceof Ge||de)return;let s=r instanceof Ue?r.refusal:En(r),a=s.sentence,f=r instanceof pe?Sn?.yoursOf(k,te.get(t)?.calls??[]):void 0;ae(t);try{I([],[t])}catch{}let y=te.get(t);te.delete(t);let S=y?.calls[0];if(S&&!(r instanceof pe)){let h=k.allMutations().find(fe=>fe.name===S.name)?.subject?.arg,re=h&&k.graph.getNode(S.args[h])?.kind;Fn(k,{type:"refused",act:S.name,code:s.reason,...re?{kind:re}:{}},c.principal)}if(r instanceof pe&&O.conflicts++,r instanceof pe&&!Y()&&await ee().catch(()=>[]),r instanceof pe&&J&&await J,r instanceof pe&&at.size>0){let h=!1,re={sentence:a,conflicts:f?r.conflicts.map(fe=>fe.node===f.node&&fe.field===f.field?{...fe,yours:f.yours}:fe):r.conflicts,keepTheirs(){h=!0},useMine(){if(!(h||!y)){h=!0,Tt=!0;try{k.applyAll(f?[f.over(C)]:y.calls,{...y.intent?{intent:y.intent}:{},...y.via?{via:y.via}:{},...Fe(y)})}finally{Tt=!1}}}};for(let fe of at)fe(re);return}for(let h of je)h(a,s)},oo=(t,r)=>t.flatMap(s=>s.mutation?.name===kn?[]:s.primitives.flatMap(a=>a.op==="splice-text"&&!r.has(a.id)&&!r.has(`${a.id}\0${a.field}`)?[{node:a.id,field:a.field,rev:C}]:[]));k.applyAll=(t,r)=>{let s=Tn(k.log.all().filter(S=>G.has(S.batch))),a=bn(t,{...c.principal?{author:c.principal}:{},...r}),f=t.map((S,h)=>{let re=a.minted?.[h];return re===void 0||S.args?.id!==void 0?S:{...S,mintedHint:re}});j.push(a.batch),G.add(a.batch),te.set(a.batch,{calls:f,...r?.intent?{intent:r.intent}:{},...r?.via?{via:r.via}:{},...Fe(r)});let y=Tt?[]:[...me.baseFor(a.ops,s,(S,h)=>k.collaborative(S,h)),...oo(a.ops,s)];return Le.set(a.batch,ke(rt({calls:f,...r?.intent?{intent:r.intent}:{},batch:a.batch,...y.length>0?{base:y}:{},...r?.via?{via:r.via}:{},...Fe(r)},a.batch).catch(S=>xt(a.batch,S)))),a},k.apply=(t,r)=>k.applyAll([t],r),k.undo=(t,r)=>{let s=typeof t=="string"?[t]:t,a=no(s.map(y=>P.get(y)??y),{...c.principal?{author:c.principal}:{},...r});j.push(a.batch),G.add(a.batch);let f=Promise.allSettled(s.map(y=>Le.get(y)));return Le.set(a.batch,ke(f.then(()=>{let y=s.filter(S=>!Me.has(S));if(y.length===0){ae(a.batch),te.delete(a.batch),I([],[a.batch]);return}return rt({undo:y.map(S=>P.get(S)??S),...r?.intent?{intent:r.intent}:{},batch:a.batch,...r?.via?{via:r.via}:{},...Fe(r)},a.batch)}).catch(y=>xt(a.batch,y)))),a};let ao=async(t,r={})=>{Ft++;try{return(await ke(rt({calls:t,...r}))).ops}finally{Ft--}},Ft=0,An={here(t){N=t,Q()},onWho(t){return Z.add(t),q.size>0&&t([...q.values()]),()=>{Z.delete(t)}},leave(){if(!N)return;let t=JSON.stringify({participant:L??N.participant});if(N=null,g({t:"bye"}))return;let r=globalThis.navigator?.sendBeacon;r?r.call(globalThis.navigator,`${c.url}/graview/leave${l!==void 0?`?${ze.param}=${encodeURIComponent(l)}`:""}`,t):v(`${c.url}/graview/leave`,{method:"POST",headers:m,body:t}).catch(()=>{})}},Ot=c.pollMs??800,it=Ot>0&&typeof setInterval=="function"?setInterval(()=>{Y()||ee().catch(()=>{})},Ot):null;if(F){gn();let t;await Promise.race([_e,new Promise(r=>t=setTimeout(r,c.openTimeoutMs??3e3))]),clearTimeout(t)}if(n.length>0&&!de){let t=[],r=new Set(k.log.all().map(s=>s.batch));for(let s of n)if(!(s.batch!==void 0&&r.has(s.batch)))try{k.applyAll(s.calls,{...s.intent?{intent:s.intent}:{},...s.batch?{batch:s.batch}:{},...s.via?{via:s.via}:{},...Fe(s)})}catch(a){t.push(Io(s,a))}t.length>0&&Je.push(ot(`${o} ${t.length===1?"One no longer fits and was not made":`${t.length} no longer fit and were not made`}: ${t.join("; ")}.`))}let Pn=new Map,io=()=>({store:k,author:c.principal,appliedAll:bn,pending:j,provisional:G,asked:te,answers:Le,letGo:Me,sent:(t,r)=>ke(rt({calls:r,batch:t},t).catch(s=>xt(t,s))),settle:ae,land:I,seen:()=>C,gone:()=>U||de});return{remote:{store:k,typing(t,r){let s=`${t}\0${r}`,a=Pn.get(s);return a||(a=(__graviewPreload(import.meta.url,["./chunk.RPDH32XV.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.DD2NKFDX.js")).then(f=>(Sn=f,f.typingOf(t,r,f.wireOf(io())))),Pn.set(s,a)),a},version:H.version,migrated:H.migrated??[],send:ao,pull:ee,onRefusal(t){je.add(t);let r=Je;Je=[];for(let s of r)t(s.sentence,s);return()=>je.delete(t)},onDeclaration(t){return kt.add(t),()=>kt.delete(t)},onBuild(t){return Et.add(t),i.otherBuild!==void 0&&t(i.otherBuild),()=>Et.delete(t)},onConflict(t){return at.add(t),()=>at.delete(t)},revision:(t,r)=>me.of(t,r),seq:()=>C,participant:()=>L,transport:()=>Y()?"socket":"poll",status:p,onStatus(t){return x.add(t),()=>x.delete(t)},held:()=>R,onHeld(t){return i.helds.add(t),R!==void 0&&t(R),()=>i.helds.delete(t)},counters:()=>({...O}),who:()=>[...q.values()],pending:()=>j.length+Ft,async settled(){for(;He.size>0;)await Promise.allSettled([...He])},presence:An,close(){it&&clearInterval(it),Ae(),An.leave(),U=!0,Ee&&clearTimeout(Ee),ne&&clearTimeout(ne),ge&&clearTimeout(ge);for(let r of oe.splice(0))r.give(new Error("The client closed before the server could be reached."));for(let r of le.splice(0))r();let t=_;_=void 0,ye=!1;try{t?.close(1e3,"Closed.")}catch{}}},unheard(){let t=Je;return Je=[],t}};function so(t,r){let s=globalThis.WebSocket;if(!s)throw new Error("This runtime has no WebSocket; the client polls instead.");let a=typeof globalThis.document<"u",f=c.subprotocol?[on]:[];if(!a)try{return new s(t,{headers:r,...f.length>0?{protocols:f}:{}})}catch{}let y=new URL(t);for(let[S,h]of Object.entries(E))y.searchParams.set(S,h);return l!==void 0&&y.searchParams.set(ze.param,l),f.length>0?new s(y.toString(),f):new s(y.toString())}}function Jo(e,n,o=Date.now()){let i,l=e?.trim();if(l)if(/^\d+(\.\d+)?$/.test(l))i=Number(l)*1e3;else{let v=Date.parse(l);Number.isFinite(v)&&(i=Math.max(0,v-o))}let u=typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0,c=u!==void 0&&u<50&&i!==void 0&&Math.abs(u*1e3-i)<1e3;return u!==void 0&&!c?u:i??1e3}function Yo(){globalThis.location?.reload?.()}function Qo(){return globalThis.document?.visibilityState!=="hidden"}function an(e,n){if(typeof e=="function")return Math.max(0,e(n));let{min:o=250,max:i=1e4,factor:l=2}=e??{};return Math.min(i,o*l**n)*(.75+Math.random()*.5)}function At(e){let n={};if(!e)return n;e.id&&(n[ve.seat]=e.id),e.roles?.length&&(n[ve.roles]=e.roles.join(",")),e.kind!=="human"&&(n[ve.kind]=e.kind),e.name&&(n[ve.name]=encodeURIComponent(e.name));let o=e.onBehalfOf;return o?.id&&(n[ve.for]=o.id),o?.roles?.length&&(n[ve.forRoles]=o.roles.join(",")),o?.name&&(n[ve.forName]=encodeURIComponent(o.name)),n}var Qr="/graview/views";function sn(e){let n=e.fetch??fetch,o=bt(e.url,e.headers),i=o.url,l={"content-type":"application/json",...e.principal?At(e.principal):{},...o.headers},u=e.state?{hidden:e.state.hidden??[],removed:e.state.removed??[],may:e.state.may??dt.may}:dt,c=new Set,v=b=>{if(JSON.stringify(b)!==JSON.stringify(u)){u=b;for(let T of c)T()}},m=async(b,T)=>{let x=await n(`${i}${e.path??Qr}`,{method:b,headers:l,...T!==void 0?{body:JSON.stringify(T)}:{}}),O=await x.json();if(!x.ok)throw new Error(O.error??`The store answered ${x.status}.`);v({hidden:O.hidden??[],removed:O.removed??[],may:O.may??dt.may})},E=()=>m("GET"),F=e.state?Promise.resolve():E().catch(()=>{}),W=e.pollMs?setInterval(()=>void E().catch(()=>{}),e.pollMs):void 0;return{ready:F,refresh:E,close:()=>clearInterval(W),current:()=>u,onChange(b){return c.add(b),()=>void c.delete(b)},hide:b=>m("POST",{hide:b}),show:b=>m("POST",{show:b}),remove:(b,T)=>m("POST",{remove:b,...T?{about:T}:{}}),async restore(b){let T=u.removed.find(x=>x.name===b)?.lens;await m("POST",{restore:b}),T&&await e.onDeclaration?.()},async lens(b){await m("POST",{lens:b}),await e.onDeclaration?.()}}}var dn=document.getElementById("graview-app"),cn=/^\/forms\/([^/]+)\/?$/.exec(location.pathname),Zr=cn?(__graviewPreload(import.meta.url,["./chunk.IQ3PRWGO.js","./chunk.KDXU5DT3.js","./chunk.XOZU4OFA.js","./chunk.Y2YYH3JN.js","./chunk.75GVFX7L.js","./chunk.2B6P4GPS.js","./chunk.NUYA4BWI.js","./chunk.OKZT2QBM.js","./chunk.ACTXR2MI.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.TM4EPUNO.js")):De("pages");try{cn?await Zo(decodeURIComponent(cn[1])):await Xo()}catch(e){let n=document.createElement("pre");n.setAttribute("role","alert"),n.style.cssText="margin:2rem;font:14px/1.5 ui-monospace,monospace;white-space:pre-wrap",n.textContent=e instanceof Error?e.message:String(e),dn.replaceChildren(n),window.__graviewFailed=n.textContent}async function Zo(e){let n=await fetch(`/graview/document?form=${encodeURIComponent(e)}`),o=await n.json();if(!n.ok)throw new Error(o.error??`The preview server did not hand over the form (${n.status}).`);let i=await mt(o);if(!i.ok)throw new Error(lt(i.findings));let l=i.app,u=o.principal,c=await St({app:l,url:location.origin,principal:u,...o.state?{state:o.state,openTimeoutMs:0}:{openTimeoutMs:3e3}});document.title=l.forms?.[e]?.title??l.name;let{mount:v}=await Zr;window.__graview=v(dn,{app:l,form:e,principal:u,remote:c,height:"100dvh",onSubmitted:()=>window.__graviewSubmitted=!0}),window.__graviewReady=!0}async function Xo(){let e=await fetch("/graview/document");if(!e.ok)throw new Error(`The preview server did not hand over the document (${e.status}).`);let n=await e.json(),i=await(async m=>{if(typeof m.module=="string")return(await import(m.module)).app;let E=await mt(m);if(!E.ok)throw new Error(lt(E.findings));return E.app})(n);if(!i||typeof i!="object"||!("schema"in i))throw new Error("The app module the preview server handed does not export an app.");let l=n.principal,u=await St({app:i,url:location.origin,principal:l,live:!0,subprotocol:!0,pollMs:1200,...n.state?{state:n.state,openTimeoutMs:0}:{openTimeoutMs:3e3}});document.title=i.name;let c,v=sn({url:location.origin,principal:l,...n.views?{state:n.views}:{},onDeclaration:async()=>{let m=await(await fetch("/graview/document")).json();if(typeof m.module=="string")return;let E=await mt(m);E.ok&&c?.setApp(E.app,u)}});await Promise.all([Zr,v.ready]),c=nn(dn,{app:i,remote:u,principal:l,studio:!1,face:"pages",routing:"address",bar:!0,height:"100dvh",label:i.name,heading:1,keptViews:v,...n.draftView?{draftView:n.draftView}:{}}),window.__graview=c,c.drawn().then(()=>{window.__graviewReady=!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{a as jt,b as lr,c as ur,d as fr,e as pr,f as qt,g as mr,h as zt}from"./chunk.K5YFUMRS.js";import{a as uo}from"./chunk.XJWKIXPV.js";import{a as Gt,b as yr,c as gr,d as wr,e as Ut,f as vr,g as br,h as Sr,i as Ar,j as Pr,k as kr,l as Er,m as Rr,n as Tr,o as Ye}from"./chunk.TOLW64EO.js";import{b as hr}from"./chunk.4VRX7FCO.js";import{a as Ct}from"./chunk.Q5WEOX3Q.js";import{b as Lt,i as Bn}from"./chunk.DUP2CGVH.js";import{k as lt}from"./chunk.YMXWS4XN.js";import{C as ir,H as sr,L as cr,M as dr,i as er,l as tr,m as nr,n as It,o as rr,q as or,u as ar,z as _t}from"./chunk.3FKKH2XU.js";import{c as lo}from"./chunk.DLWFULWE.js";import{$ as Nn,Aa as zn,Ba as Gn,Ca as Un,Da as Kn,Ea as Jn,G as Wt,Ga as Yn,Ha as Qn,Ja as Zn,Ka as Nt,Na as Xn,Qa as pt,V as Wn,a as Dn,b as ut,c as ft,ia as In,j as $n,ja as _n,la as jn,m as $t,za as qn}from"./chunk.VLX7YWVH.js";import{a as xe}from"./chunk.SDO3U72B.js";import{Dd as xn,Eb as kn,Ed as Fn,Jd as On,Ld as Cn,Md as Ln,Nb as En,Od as dt,Pb as Rn,ke as Te,lb as qe,le as Mn,me as Hn,re as Ht,se as Vt,te as Bt,wb as ct,wc as Mt,we as Vn,xc as Tn,xe as Dt}from"./chunk.IQGSEAQ2.js";import"./chunk.FQLNBIQ5.js";import{b as Be}from"./chunk.AJZBJBMO.js";async function mt(e,n={}){let o=e.compiled===void 0||!po(e.compiled,e.document)?void 0:Bn(e.compiled,n);if(o?.ok)return o;let{compileDocumentWithoutCheck:i}=await fo();return i(e.document,n)}var xr,fo=()=>xr??=(__graviewPreload(import.meta.url,["./chunk.2E62YCMZ.js","./chunk.DUP2CGVH.js","./chunk.7CLKGKSF.js","./chunk.R5MLRKAO.js","./chunk.YMXWS4XN.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.YLOGIJOH.js")).catch(e=>{throw xr=void 0,e});function po(e,n){let o=typeof e=="object"&&e!==null?e.document:void 0,i=n;if(typeof i=="string")try{i=JSON.parse(i)}catch{return!1}return o!==void 0&&Ct(Lt(o).document)===Ct(Lt(i).document)}var d=Be(Wt(),1);var yt=Be(Wt(),1),Kt="data-graview-drawn",mo=200,Fr=50,ho=1e4,ht=()=>typeof performance<"u"?performance.now():Date.now();function yo(e){let n=[...e.querySelectorAll("img")];for(let o of e.querySelectorAll("[data-worker-view]"))o.shadowRoot&&n.push(...o.shadowRoot.querySelectorAll("img"));return n}function go(e,n){if(e.ownerDocument.fonts?.status==="loading"||zn()>0||Jn(n)>0||e.querySelector('[aria-busy="true"]')||yo(e).some(i=>!i.complete&&i.loading!=="lazy"))return!1;for(let i of e.querySelectorAll("[data-worker-view-place]"))if(!i.querySelector("[data-worker-view][data-worker-view-drawn], [data-worker-view][data-worker-view-failed]"))return!1;return!0}function Or(e){let n=e.querySelector("[data-embed-content]"),o=[...e.querySelectorAll("[data-worker-view]")].map(i=>`${i.offsetWidth}x${i.offsetHeight}`);return`${e.scrollWidth}x${e.scrollHeight}|${n?`${n.scrollWidth}x${n.scrollHeight}`:""}|${o.join(",")}`}function wo(e,n,o,i){e.removeAttribute(Kt);let l=e.ownerDocument.defaultView;if(!l)return()=>{};let u=ht(),c=u,v=Or(e),m=!1,E,F=typeof MutationObserver>"u"?void 0:new MutationObserver(x=>{x.some(O=>!(O.target===e&&O.attributeName===Kt))&&(c=ht())});F?.observe(e,{childList:!0,subtree:!0,characterData:!0,attributes:!0});let W=()=>{m=!0,F?.disconnect(),E!==void 0&&clearTimeout(E)},b=x=>{let O=!1,oe=()=>{O||(O=!0,x())};typeof l.requestAnimationFrame=="function"&&l.requestAnimationFrame(()=>setTimeout(oe,0)),setTimeout(oe,100)},T=()=>{if(m)return;let x=Or(e);x!==v&&(v=x,c=ht());let O=ht();if(go(e,i)&&O-c>=mo||O-u>=ho){b(()=>{m||(W(),e.setAttribute(Kt,n),Qn(),o())});return}E=setTimeout(T,Fr)};return E=setTimeout(T,Fr),W}function Cr(e,n,o,i,l){Yn();let u=(0,yt.useRef)({place:o,onDrawn:i});u.current={place:o,onDrawn:i},(0,yt.useLayoutEffect)(()=>{l&&Kn(l);let c=E=>wo(E,u.current.place.path,()=>u.current.onDrawn?.(u.current.place),l);if(e.current)return c(e.current);let v,m=!1;return queueMicrotask(()=>{!m&&e.current&&(v=c(e.current))}),()=>{m=!0,v?.()}},[n,e,l])}var we=Be(Wt(),1),Qe,vo=xe(()=>(__graviewPreload(import.meta.url,["./chunk.NJSK3UO2.js","./chunk.G5BVZLCM.js","./chunk.NGRL3QOI.js","./chunk.DN7UCBOA.js","./chunk.DMENNIHT.js","./chunk.VLX7YWVH.js","./chunk.SDO3U72B.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.L4V5VLSM.js"))),Lr=()=>vo().then(e=>void(Qe=e),()=>new Promise(e=>setTimeout(e,2e3)).then(Lr)),Jt=qn(Lr),Mr=e=>!!e&&Qe===void 0;function Yt({onReady:e,fetch:n}){return(0,we.useLayoutEffect)(()=>void n().then(e),[e,n]),null}var bo=0;function Hr(e){let[n,o]=(0,we.useState)(()=>Qe);(0,we.useEffect)(()=>{if(!e||n)return;let u=!1;return Jt().then(()=>{u||o(Qe)}),()=>{u=!0}},[e,n]);let i=(0,we.useMemo)(()=>bo+=1,[e]);return{over:(0,we.useMemo)(()=>{let u=n??Qe;if(!e||!u)return;let{source:c,worker:v,...m}=e,E={...m,worker:v??{source:c},draft:!0};return{name:e.manifest.name,home:e.manifest.attach==="home",register:F=>u.registerWorkerView(F,E)}},[e,n]),n:i}}var Dr=Be(uo(),1),$=Be(lo(),1);var w=Be(Wn(),1);function gt(e,n={}){let o=Nt(e);return{Face:o.part((l,u)=>(0,d.createElement)(l,u),n),fetch:()=>o.load().then(()=>{}),here:()=>o.current!==void 0||o.failed}}var Xt=e=>Promise.all([e,cr()]).then(([n])=>n),$r=xe(()=>(__graviewPreload(import.meta.url,["./chunk.ZQGLPP7A.js","./chunk.WHX47OJM.js","./chunk.2D7K2IJQ.js","./chunk.2V7QTIAV.js","./chunk.77JI5T4F.js","./chunk.UDU545CL.js","./chunk.7VAHHEDX.js","./chunk.HJCQ6I3S.js","./chunk.DQAMVVE6.js","./chunk.OXFDB5BB.js","./chunk.ATHLE33D.js","./chunk.T4TRJDBF.js","./chunk.APUQIELA.js","./chunk.S6QZBWCJ.js","./chunk.LTOQ22ZJ.js","./chunk.2TCOLAL2.js","./chunk.FUPYIOXZ.js","./chunk.3OEODIHB.js","./chunk.BIDL7GQD.js","./chunk.TA2JTUNX.js","./chunk.HZPRMHSL.js","./chunk.TQ2G4AM4.js","./chunk.X36BYTEG.js","./chunk.U5P23GO7.js","./chunk.TOLW64EO.js","./chunk.4VRX7FCO.js","./chunk.Q5WEOX3Q.js","./chunk.2E62YCMZ.js","./chunk.DUP2CGVH.js","./chunk.YEXFVDRA.js","./chunk.7CLKGKSF.js","./chunk.TMHVYI5R.js","./chunk.R5MLRKAO.js","./chunk.YMXWS4XN.js","./chunk.GZHZLJBF.js","./chunk.3SAESG6X.js","./chunk.OJGHDWI6.js","./chunk.F6BNFLQM.js","./chunk.75JQCTR6.js","./chunk.5IEZF433.js","./chunk.5AD2QHWH.js","./chunk.3FKKH2XU.js","./chunk.DLWFULWE.js","./chunk.VLX7YWVH.js","./chunk.SDO3U72B.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.2JDAUKSN.js"))),So=xe(()=>(__graviewPreload(import.meta.url,["./chunk.4Q5PCMGZ.js","./chunk.2VIS2NAT.js","./chunk.KHXRJLLU.js","./chunk.GHHKRFPD.js","./chunk.6NRWLCIZ.js","./chunk.Q355UPFG.js","./chunk.ZQGLPP7A.js","./chunk.7SRSE5IS.js","./chunk.VZAF3452.js","./chunk.WHX47OJM.js","./chunk.QRT6BZR6.js","./chunk.2V7QTIAV.js","./chunk.Z26T5E76.js","./chunk.77JI5T4F.js","./chunk.SADHOSRC.js","./chunk.4DZOAB4D.js","./chunk.UDU545CL.js","./chunk.7VAHHEDX.js","./chunk.P4TAX3HE.js","./chunk.T4TRJDBF.js","./chunk.2TCOLAL2.js","./chunk.2VYGDY5Z.js","./chunk.FUPYIOXZ.js","./chunk.APRWUIE3.js","./chunk.3OEODIHB.js","./chunk.WFCE7NLK.js","./chunk.HZPRMHSL.js","./chunk.BJUUSIQY.js","./chunk.TQ2G4AM4.js","./chunk.X36BYTEG.js","./chunk.XOZU4OFA.js","./chunk.G7YLK4PX.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.ZA5TDCBC.js","./chunk.2JEN2RCB.js","./chunk.7CLKGKSF.js","./chunk.TMHVYI5R.js","./chunk.R5MLRKAO.js","./chunk.YMXWS4XN.js","./chunk.GZHZLJBF.js","./chunk.3SAESG6X.js","./chunk.OJGHDWI6.js","./chunk.F6BNFLQM.js","./chunk.75JQCTR6.js","./chunk.5IEZF433.js","./chunk.5AD2QHWH.js","./chunk.3FKKH2XU.js","./chunk.DLWFULWE.js","./chunk.VLX7YWVH.js","./chunk.SDO3U72B.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.3J7XLJP2.js"))),Ao=xe(()=>(__graviewPreload(import.meta.url,["./chunk.4Q5PCMGZ.js","./chunk.2VIS2NAT.js","./chunk.KHXRJLLU.js","./chunk.GHHKRFPD.js","./chunk.6NRWLCIZ.js","./chunk.Q355UPFG.js","./chunk.ZQGLPP7A.js","./chunk.7SRSE5IS.js","./chunk.VZAF3452.js","./chunk.WHX47OJM.js","./chunk.QRT6BZR6.js","./chunk.2V7QTIAV.js","./chunk.Z26T5E76.js","./chunk.77JI5T4F.js","./chunk.SADHOSRC.js","./chunk.4DZOAB4D.js","./chunk.UDU545CL.js","./chunk.7VAHHEDX.js","./chunk.P4TAX3HE.js","./chunk.T4TRJDBF.js","./chunk.2TCOLAL2.js","./chunk.2VYGDY5Z.js","./chunk.FUPYIOXZ.js","./chunk.APRWUIE3.js","./chunk.3OEODIHB.js","./chunk.WFCE7NLK.js","./chunk.HZPRMHSL.js","./chunk.BJUUSIQY.js","./chunk.TQ2G4AM4.js","./chunk.X36BYTEG.js","./chunk.XOZU4OFA.js","./chunk.G7YLK4PX.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.ZA5TDCBC.js","./chunk.2JEN2RCB.js","./chunk.7CLKGKSF.js","./chunk.TMHVYI5R.js","./chunk.R5MLRKAO.js","./chunk.YMXWS4XN.js","./chunk.GZHZLJBF.js","./chunk.3SAESG6X.js","./chunk.OJGHDWI6.js","./chunk.F6BNFLQM.js","./chunk.75JQCTR6.js","./chunk.5IEZF433.js","./chunk.5AD2QHWH.js","./chunk.3FKKH2XU.js","./chunk.DLWFULWE.js","./chunk.VLX7YWVH.js","./chunk.SDO3U72B.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.4HTB6TX2.js"))),Wr=gt(()=>Xt($r().then(e=>e.SceneFace)),{what:"This view"}),Nr=gt(()=>$r().then(e=>e.SceneKeeping),{quiet:!0}),Ir=gt(()=>Xt(So().then(e=>e.PagesContent)),{what:"This page"}),_r=gt(()=>Xt(Ao().then(e=>e.PictureFace)),{what:"This picture"}),Po=Wr.Face,ko=Nr.Face,Eo=Ir.Face,Ro=_r.Face;function De(...e){let n=e.length>0?e:["scene","pages","picture"],o=new Set(n.flatMap(jr));return Promise.all([...[...o].map(i=>i.fetch()),or()]).then(()=>{},()=>{})}var jr=e=>e==="pages"?[Ir]:e==="picture"?[_r]:[Wr,Nr],qr=e=>jr(e).every(n=>n.here()),To=150,Qt=0;function Vr(e,n){if(qr(e))return n();let o=++Qt,i=()=>{o===Qt&&(Qt+=1,n())};De(e).then(i),setTimeout(i,To)}var xo=768;function Fo(e,n){let o=n!==null&&n>=xo;(0,d.useEffect)(()=>{if(!o||e==="picture")return;let i=e==="pages"?"scene":"pages";if(qr(i))return;let l=globalThis,u=()=>void De(i),c=()=>{},v=Zn(()=>{if(l.requestIdleCallback&&l.cancelIdleCallback){let m=l.requestIdleCallback(u,{timeout:4e3});c=()=>l.cancelIdleCallback?.(m)}else{let m=setTimeout(u,1500);c=()=>clearTimeout(m)}});return()=>(v(),c())},[e,o])}function Oo({asked:e,shown:n,onDrawn:o}){return(0,d.useLayoutEffect)(()=>o(e,n),[e,n,o]),null}function Co({auto:e,scene:n}){return(0,w.jsx)("div",{"data-embed-content":"","aria-busy":"true",style:{flex:e?n?`0 0 ${Ut}px`:"0 0 auto":"1 1 auto",minHeight:0,background:"var(--graview-ground)"}})}var Lo=Nt(xe(()=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.5JNXQHN4.js")))).part((e,n)=>(0,w.jsx)(e.StudioPlace,{...n}),{quiet:!0});function zr(e,n,o,i,l){return qt(e,pr(n?ft(n):l??Dn,i),o)}function en(e){return e&&ft(e).overview?"graview":"scene"}function Br(e,n){if(n.homeView?.()===void 0)return!1;let o=e.pages?.first?.trim();return o===void 0||o===""||o==="/"||o.toLowerCase()==="home"}function Gr(e){let[,n]=(0,d.useState)(!1),o=(0,d.useCallback)(()=>n(!0),[]),i=(0,d.useRef)(!1);return e.at&&!wt?(0,w.jsx)(Yt,{onReady:o,fetch:tn}):!i.current&&Mr(e.draftView)?(0,w.jsx)(Yt,{onReady:o,fetch:Jt}):(i.current=!0,(0,w.jsx)(Mo,{...e}))}function Mo(e){let{app:n,stop:o,bar:i=!0,standing:l="Everything is in order",principal:u,heading:c=2}=e,{rootRef:v,scope:m,css:E,scheme:F,store:W,presence:b,brand:T,auto:x,height:O}=vr(e),oe=Hr(e.draftView),R=gr(e,dr,oe.over),[le]=(0,d.useState)(Un),p=e.basePath===void 0?{}:{basePath:e.basePath},[B]=(0,d.useState)(It),D=e.notices??B,z=g=>Ht(g,p),ie={...e.routing?{routing:e.routing}:{},...p},[se]=(0,d.useState)(()=>{let g=e.at?.face;if(g)return g;let Q=o===void 0&&Br(n,R)?"pages":en(o),K=jt({...ie,face:Q});return e.face===void 0&&e.onOpening?.(K),K}),[be,H]=(0,d.useState)(()=>e.face!==void 0&&e.face!=="pages"&&!e.at&&o===void 0&&lr(ie)&&Br(n,R)),Se=(0,d.useRef)(e.onFace);Se.current=e.onFace,(0,d.useLayoutEffect)(()=>{be&&(Se.current?.("pages"),H(!1))},[be]);let A=be?"pages":e.face??se,k=n.schema.kinds,V=e.routing==="address",Ae=(0,d.useMemo)(()=>e.at?wt.settleAt(e,W.seenBy(u??{kind:"human"}),R.places()):void 0,[]),C=(0,d.useMemo)(()=>_n(R,n.schema),[R,n.schema]),me=(0,d.useMemo)(()=>{let g=Ae?.stop??(V?ur(e.basePath):void 0)??o;return A==="scene"&&g===void 0&&C===void 0&&(e.path===void 0||Zt(e.path))?zt(void 0):zr(A,g,k,R.places(),C)},[]),[N]=(0,d.useState)(A);(0,d.useEffect)(()=>{N!=="pages"&&In(R)},[N,R]);let L=(0,d.useRef)(void 0),q=g=>g===void 0||Zt(g)?"/":g;L.current??={path:q(Ae?.path??(V?A==="pages"?(Vt(window.location.pathname,e.basePath)??"/")+window.location.search:"/":e.path)),asked:e.path},e.path!==L.current.asked&&(L.current={path:q(e.path),asked:e.path});let Z=(0,d.useRef)(e.onNavigate);Z.current=e.onNavigate;let Oe=(0,d.useCallback)((g,Q)=>{L.current.path=g,Z.current?.(g,Q)},[]),{at:he,setAt:j,steering:G,steer:ae}=Er(L.current.path),M=(0,d.useContext)(Ur);M&&(M.pages=()=>L.current.path);let[$e]=(0,d.useState)(()=>({})),J=M??$e,ce=(0,d.useMemo)(()=>tr(D),[D]),I=(0,d.useRef)(void 0),Pe=(0,d.useCallback)(g=>void(L.current.path=g),[]),X=er(v),[Ce,ee]=(0,d.useState)(!1),Xe=e.pagesBelow!==void 0&&X!==null&&X<e.pagesBelow&&(A==="scene"||A==="graview")&&!Ce,P=Xe?"pages":A,Le=(0,d.useRef)(!1);Le.current=Ce&&e.pagesBelow!==void 0&&X!==null&&X<e.pagesBelow&&(A==="scene"||A==="graview"),M&&(M.shown=P);let Me=(0,d.useRef)(A==="graview"?"graview":"scene");(P==="scene"||P==="graview")&&(Me.current=P),(0,d.useState)(()=>{if(!V||typeof window>"u"||P==="pages"||P==="picture")return;let{pathname:g,search:Q,hash:K}=window.location;Vt(g,e.basePath)==="/"&&window.history.replaceState(window.history.state,"",`${z(Te)}${Q}${K}`)}),wr(v,P,e.onIntrinsicHeight),Fo(P,X);let te=Rr(e.onError,P),He=Tr(e.onReady,P),ke=(0,d.useRef)(e.onFaceDrawn);ke.current=e.onFaceDrawn;let et=(0,d.useCallback)((g,Q)=>{He(Q),ke.current?.(g)},[He]),[We,Pt]=(0,d.useState)(null),tt=R.places(),Ne=(0,d.useRef)({shown:P,onFace:e.onFace});Ne.current={shown:P,onFace:e.onFace};let _=(0,d.useCallback)((g,Q,K)=>{if(V){I.current?.(g,Q,K);return}Ne.current.onFace?.(g),Z.current?.(g==="pages"?Q??L.current.path:Te,"push")},[V]),[ye,U]=(0,d.useState)(void 0);(0,d.useEffect)(()=>{P==="pages"&&U(void 0)},[P]);let Ie=(0,d.useRef)(o);(0,d.useEffect)(()=>{Ie.current!==o&&(Ie.current=o,U(void 0))},[o]);let Ee=(0,d.useCallback)(g=>{if(Ne.current.shown==="pages"){if(ee(!0),U(g),A==="scene"||A==="graview"){Vr(A,()=>{V?window.history.pushState(null,"",`${z(Te)}${g??""}`):Z.current?.(Te,"push")});return}Vr(Me.current,()=>_(Me.current,void 0,g))}},[V,A,e.basePath,_]),Ve=(0,d.useCallback)(g=>{if(Ne.current.shown==="pages"){G.go.current||(L.current.path=g),ae(g);return}if(L.current.path=g,j(g),Le.current){ee(!1),V?window.history.pushState(null,"",z(g)):Z.current?.(g,"push");return}_("pages",g)},[G,ae,j,_,V,e.basePath]),Ke=R.arrangement?.(),ue=P==="pages",Re=e.hrefOf,_e=Re??(V?z:void 0),Y=(0,d.useMemo)(()=>({open:Ve,...Re?{href:Re}:V?{href:g=>Ht(g,e.basePath===void 0?{}:{basePath:e.basePath})}:{}}),[Ve,V,e.basePath,Re]);return(0,w.jsxs)("section",{ref:v,className:m,"aria-label":e.label??n.name,"data-graview-embed":P,"data-graview-scheme":F,...Xe?{"data-graview-embed-narrow":""}:{},style:{position:"relative",isolation:"isolate",height:O,minHeight:x?0:320,display:"flex",flexDirection:"column",overflow:"hidden",borderRadius:"var(--graview-radius, 12px)"},children:[(0,w.jsx)("style",{children:E}),(0,w.jsxs)(Xn.Provider,{value:te,children:[(0,w.jsx)(br,{rootRef:v,board:D,onReport:e.onReport,where:()=>P==="pages"?Sr(he):P==="picture"?{place:"picture"}:nr(J.view?.focusId)}),(0,w.jsx)(yr,{rootRef:v,firstLook:e.firstLook,app:ir(T??{name:n.name},n.schema)}),(0,w.jsx)(Ye,{module:"@graview/react",report:te,content:!0,children:(0,w.jsx)(Gn.Provider,{value:le,children:(0,w.jsx)(Nn,{store:W,views:R,initialView:me,scheme:F,...Ar(e,b,T),...e.onSeat?{onSeat:e.onSeat}:{},children:(0,w.jsxs)(rr.Provider,{value:ce,children:[(0,w.jsx)(Do,{face:P,stop:ye??o,kinds:k,places:tt,opens:C}),(0,w.jsx)(Ho,{into:J}),(0,w.jsx)(Vo,{rootRef:v,face:A,shown:P,path:he,stop:o,draft:oe.n,onDrawn:e.onDrawn,parts:le}),V?(0,w.jsx)(fr,{pagesWere:Ae?.path,basePath:e.basePath,shown:P,onFace:e.onFace,toggle:I,kinds:k,places:tt,opens:C,landed:Pe}):null,i&&P!=="picture"?(0,w.jsx)(Ye,{module:"@graview/embed",report:te,children:(0,w.jsx)(Pr,{name:T?.name??n.name,heading:c,named:Gt(i).name!==!1,faces:Gt(i).faces===!1?void 0:{scene:{label:Mn(Ke),current:!ue,go:()=>Ee(),reach:()=>void De(Me.current)},pages:{label:Hn(Ke),current:ue,go:()=>Ve(L.current.path),reach:()=>void De("pages")}},at:ue?he:null,without:e.pages?.without(),home:{..._e?.("/")!==void 0?{href:_e("/")}:{},go:()=>Ve("/"),current:ue&&he.split("?")[0]==="/"},reach:{..._e?{href:_e}:{},go:g=>Ve(g.path)},standing:l,hostActions:e.hostActions,barActions:e.barActions,keeping:ue?void 0:(0,w.jsx)($o,{app:n,studio:e.studio,report:te}),onFind:Pt,switch:e.switch})}):null,(0,w.jsx)(ar.Provider,{value:We,children:(0,w.jsx)(Ye,{module:P==="pages"||P==="picture"?"@graview/pages":"@graview/react",report:te,content:!0,children:(0,w.jsxs)(d.Suspense,{fallback:(0,w.jsx)(Co,{auto:x,scene:P!=="pages"&&P!=="picture"}),children:[P==="picture"?(0,w.jsx)(Ro,{scope:m,store:W,views:R,as:(o?ft(o).within?.view:void 0)??""}):P==="pages"?(0,w.jsx)(Eo,{store:W,views:R,presence:b,auto:x,brand:T,steering:G,overview:Ee,scope:m,titleLevel:kr(c),quickAsk:_t(e.quickAsk),props:{...e,onNavigate:Oe,...V?{}:{path:L.current.path}}}):(0,w.jsx)(jn.Provider,{value:Y,children:(0,w.jsx)(Po,{address:V,auto:x,scheme:F,scope:m,quickAsk:_t(e.quickAsk)})}),(0,w.jsx)(Oo,{asked:A,shown:P,onDrawn:et})]})},P)})]})})})})]})]})}var Zt=e=>e.split(/[?#]/)[0]===Te,Ur=(0,d.createContext)(null);function Ho({into:e}){return e.view=pt().view,null}function Vo({rootRef:e,face:n,shown:o,path:i,stop:l,draft:u,onDrawn:c,parts:v}){let{view:m}=pt(),E=o==="scene"||o==="graview",F=ut(m),{pan:W,...b}=m,T=m.pan?ut(b):F,x={face:n,path:E?Te:o==="picture"?l??"#":i,stop:F};return Cr(e,`${o} ${E?T:x.path} ${u}`,x,c,v),null}var wt,Bo=xe(()=>(__graviewPreload(import.meta.url,["./chunk.K5YFUMRS.js","./chunk.3FKKH2XU.js","./chunk.DLWFULWE.js","./chunk.VLX7YWVH.js","./chunk.SDO3U72B.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.JHUCKEJS.js"))),tn=()=>Bo().then(e=>void(wt=e),()=>new Promise(e=>{let n=()=>{window.removeEventListener("online",n),clearTimeout(o),e()},o=setTimeout(n,1e4);window.addEventListener("online",n)}).then(tn));function Do({face:e,stop:n,kinds:o,places:i,opens:l}){let{view:u,go:c}=pt(),v=(0,d.useRef)({face:e,stop:n});return(0,d.useLayoutEffect)(()=>{let m=v.current.stop!==n,E=v.current.face!==e,F=v.current.face==="pages";if(v.current={face:e,stop:n},!m&&!E||e==="pages"||e==="picture")return;let W=(m||F)&&n!==void 0?zr(e,n,o,i):F&&mr(u)?qt(e,zt(l),o):e==="graview"?$t(u,!0):u.overview?$n($t(u,!1),sr(u,o)):u;c(W)},[e,n,o,u,c,l]),null}function $o({app:e,studio:n,report:o}){return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(d.Suspense,{fallback:null,children:(0,w.jsx)(ko,{})}),n!==!1?(0,w.jsx)(Ye,{module:"@graview/studio",report:o,children:(0,w.jsx)(Wo,{app:e,studio:n})}):null]})}function Wo({app:e,studio:n}){let o={app:e,within:"box",...n?{onApply:n.onApply}:{},...n?.landmark?{landmark:n.landmark}:{},...n?.offered!==void 0?{offered:n.offered}:{}},i=n?.place;return i?(0,w.jsx)(i,{...o}):(0,w.jsx)(d.Suspense,{fallback:null,children:(0,w.jsx)(Lo,{...o})})}function No({path:e,stop:n,...o},i){return{...o,app:i.app,at:i.at,remote:i.remote,...i.remote.presence?{presence:i.remote.presence}:{}}}function nn(e,n){let o=n.store??n.remote?.store??hr(n.app,n.seed),i=n.notices??It(),l=null,u={},c=0,v=n.label,m=n.app,E=Promise.resolve(),F=n.at?.face??n.face,W=F===void 0?void 0:jt({...n,face:F}),b=W??en(n.stop),T=null,x=[],O=p=>{if(T=p,p!==b)return;let B=x;x=[];for(let D of B)D()};function oe(){let[p,B]=(0,d.useState)(W),[D,z]=(0,d.useState)(n.stop),[ie,se]=(0,d.useState)(n.path),[be,H]=(0,d.useState)(n.scheme??"auto"),[Se,A]=(0,d.useState)(n.principal),[k,V]=(0,d.useState)(n.seats),[Ae,C]=(0,d.useState)(n.quickAsk),[me,N]=(0,d.useState)(n.people),[L,q]=(0,d.useState)(n.hostContext),[Z,Oe]=(0,d.useState)(n.brand),[he,j]=(0,d.useState)(n.whileAway),[G,ae]=(0,d.useState)(n.label),[M,$e]=(0,d.useState)(n.hostActions),[J,ce]=(0,d.useState)(n.barActions),[I,Pe]=(0,d.useState)(void 0),[X,Ce]=(0,d.useState)(n.draftView);return l={app:ee=>{Pe(ee),se(void 0),z(void 0)},face:B,stop:z,path:se,scheme:H,seat:A,seats:V,quickAsk:C,people:N,hostContext:q,brand:Oe,whileAway:j,label:ae,hostActions:$e,barActions:ce,draft:Ce},(0,w.jsx)(Ur.Provider,{value:u,children:(0,w.jsx)(Gr,{...I?No(n,I):n,store:o,notices:i,...p!==void 0?{face:p}:{},onOpening:ee=>{b=ee},...D!==void 0?{stop:D}:{},...ie!==void 0?{path:ie}:{},...Se?{principal:Se}:{},...k?{seats:k}:{},...Ae!==void 0?{quickAsk:Ae}:{},...me?{people:me}:{},...L?{hostContext:L}:{},...Z?{brand:Z}:{},whileAway:he,label:G,hostActions:M,barActions:J,draftView:X,scheme:be,onFace:ee=>{b=ee,B(ee)},onSeat:A,onFaceDrawn:O},I?.n??0)})}let R=()=>{let p=u.view?.focusId,B=p?o.graph.getNode(p)?.kind:void 0,D=(u.shown??b)==="scene"||(u.shown??b)==="graview";return{face:b,path:D?Te:u.pages?.()??n.path??"/",stop:u.view?ut(u.view):n.stop??"#",...B?{kind:B}:{}}},le=(0,Dr.createRoot)(e);return(0,$.flushSync)(()=>le.render((0,w.jsx)(oe,{}))),{get store(){return o},where:R,setApp:(p,B,D)=>{let z="graph"in B?{store:B}:B,ie=()=>{let se=R();o=z.store,v=D?.label??(v===m.name?p.name:v),m=p,(0,$.flushSync)(()=>{l?.label(v),l?.app({app:p,remote:z,at:se,n:++c})})};wt?ie():E=E.then(tn).then(ie)},setFace:p=>{b=p,(0,$.flushSync)(()=>l?.face(p))},setStop:p=>(0,$.flushSync)(()=>l?.stop(p)),setPath:p=>(0,$.flushSync)(()=>{if(Zt(p)){(b==="pages"||b==="picture")&&(b="scene",l?.face("scene"));return}l?.path(p),b!=="pages"&&(b="pages",l?.face("pages"))}),setScheme:p=>(0,$.flushSync)(()=>l?.scheme(p)),setSeat:p=>(0,$.flushSync)(()=>l?.seat(p)),setSeats:p=>(0,$.flushSync)(()=>l?.seats(p)),setQuickAsk:p=>(0,$.flushSync)(()=>l?.quickAsk(p)),setPeople:p=>(0,$.flushSync)(()=>l?.people(p)),setHostContext:p=>(0,$.flushSync)(()=>l?.hostContext(p)),setBrand:p=>(0,$.flushSync)(()=>l?.brand(p)),setWhileAway:p=>(0,$.flushSync)(()=>l?.whileAway(p)),setDraftView:p=>(0,$.flushSync)(()=>l?.draft(p)),setLabel:p=>{v=p,(0,$.flushSync)(()=>l?.label(p))},setHostActions:p=>(0,$.flushSync)(()=>l?.hostActions(p)),setBarActions:p=>(0,$.flushSync)(()=>l?.barActions(p)),drawn:()=>E.then(()=>T===b?void 0:new Promise(p=>x.push(p))),notify:p=>{let B;return(0,$.flushSync)(()=>{B=i.notify(p)}),B},unmount:()=>le.unmount()}}var vt=e=>`s${(e+1).toString(36)}`;var ve={seat:"x-graview-seat",roles:"x-graview-roles",kind:"x-graview-kind",name:"x-graview-name",for:"x-graview-for",forRoles:"x-graview-for-roles",forName:"x-graview-for-name",via:"x-graview-via"},ze={header:"x-graview-key",param:"graview_key",cookie:"graview_key"};function bt(e,n={}){try{let o=new URL(e),i=o.searchParams.get(ze.param);if(i)return o.searchParams.delete(ze.param),{url:o.origin+o.pathname.replace(/\/$/,"")+o.search,key:i,headers:{[ze.header]:i,...n}}}catch{}return{url:e.replace(/\/$/,""),headers:n}}var Kr="/graview/friction";var Jr="/graview/live",rn="graview.ship",on=`${rn}.${ct}`;var Ge=class extends Error{constructor(n){super(n),this.name="Superseded"}},Fe=e=>e?.lineage?{lineage:e.lineage}:{},Io=(e,n)=>`${e.calls.map(o=>o.name.replace(/-/g," ")).join(", ")} (${n instanceof Error?n.message.split(`
|
|
2
|
+
`)[0]??"":String(n)})`;function _o(e){if(!e)return[];try{let n=e.storage.getItem(e.key);if(n===null)return[];e.storage.removeItem(e.key);let o=JSON.parse(n);return Array.isArray(o)?o.filter(i=>!!i&&Array.isArray(i.calls)):[]}catch{return[]}}var Ue=class extends Error{constructor(o){super(o.sentence);this.refusal=o;this.name="RemoteRefusedError"}},jo={401:"forbidden",403:"forbidden",404:"missing",413:"limit"},pe=class extends Error{constructor(o,i){super(o);this.conflicts=i;this.name="StaleWrite"}},Ze=class extends Error{constructor(n){super(n),this.name="Unreached"}},qo=new Set([502,503,504]);async function zo(e){try{return(await e.clone().json()).reason==="unavailable"}catch{return!1}}function Go(){let e=Math.random().toString(36).slice(2,8),n=0;return()=>`local-${e}-${++n}`}var Uo=1,Ko=()=>({refusals:new Set,conflicts:new Set,statuses:new Set,helds:new Set,builds:new Set,who:new Set,declarations:new Set,tally:{reconnects:0,rebases:0,conflicts:0,resyncs:0}});async function St(e){return(await Yr(e,_o(e.carry),"This app was updated while your changes were on the way.",Ko())).remote}async function Yr(e,n,o,i){let{key:l,...u}=bt(e.url,e.headers),c={...e,...u},v=c.fetch??fetch,m={"content-type":"application/json",...c.headers??{}},E={...At(c.principal),[ve.via]:c.via??"web"};Object.assign(m,E);let F=c.live===!0,W=c.presenceEveryMs,b=c.visible??Qo,T="connecting",x=i.statuses,O=i.tally,oe=[],R,le=[],p=()=>T==="online"&&R!==void 0?"held":T,B=()=>{let t=p();if(i.told!==t){i.told=t;for(let r of[...x])r(t)}},D=t=>{if(!(t===T||de)&&(T==="offline"&&t==="online"&&O.reconnects++,T=t,B(),t==="online"))for(let r of oe.splice(0))r.again()},z=t=>{if(de)return;let r=typeof t=="string"&&t.length>0?t:void 0,s=r!==R;if(R=r,ie(),!!s&&(B(),r===void 0)){for(let a of le.splice(0))a();ne&&clearTimeout(ne),ln()}},ie=()=>{if(i.toldHeld!==R){i.toldHeld=R;for(let t of[...i.helds])t(R??null)}},se=async(t,r)=>{let s;try{s=await v(t,r)}catch(a){throw Y()||D("offline"),new Ze(a instanceof Error?a.message:String(a))}if(s.status===503&&await zo(s))return D("online"),s;if(qo.has(s.status))throw Y()||D("offline"),new Ze(`The server is away (${s.status})`);return D("online"),s},be=async(t=!1)=>{let r=`${c.url}/graview/state?opFormat=${qe.op}`,s=t?await v(r,{headers:m}):await se(r,{headers:m});if(!s.ok)throw new Error((await s.json().catch(()=>({}))).error??`The server refused (${s.status})`);return await s.json()},H=c.state??await be(!0);F||(T="online"),R=typeof H.held=="string"&&H.held.length>0?H.held:void 0,ie();let Se=H.enabledModules??c.enabledModules,A=c.localApp?c.localApp(c.app):c.app,k=new Ln({schema:A.schema,mutations:A.mutations??[],invariants:A.invariants??[],...A.policy?{policy:A.policy}:{},...A.publishing?{publishing:A.publishing}:{},...A.tidying?{tidying:A.tidying}:{},...A.modules?{modules:A.modules}:{},...Se?{enabledModules:Se}:{},...A.intelligence?{intelligence:A.intelligence}:{},...A.brand?.timeZone?{timeZone:A.brand.timeZone}:{},snapshot:H.snapshot,log:H.log,...H.horizon!==void 0?{horizon:H.horizon}:{},ids:Go(),...c.storeOptions??{}});Rn.served.add(k);let V=c.friction!==!1&&c.principal?.kind!=="visitor";V&&xn(k,t=>{V&&v(`${c.url}${Kr}`,{method:"POST",headers:m,body:JSON.stringify({event:t})}).then(r=>void(V=r.status!==404&&r.status!==410),()=>{})});let Ae=On(k),C=H.log.at(-1)?.seq??(H.horizon??0)-1,me=Mt.of(H.log,{horizon:H.horizon??0}),N=null,L,q=new Map,Z=i.who,Oe=!1,he=t=>{if(de)return;Oe=!0;let r=Vn(new Map,t,Date.now(),Bt,N?.participant);L!==void 0&&r.delete(L);let s=r.size!==q.size;if(!s)for(let[a,f]of r)Dt(f,q.get(a))||(s=!0);if(q=r,!!s)for(let a of[...Z])a([...q.values()])},j=[],G=new Set,ae=t=>{let r=j.indexOf(t);r>=0&&j.splice(r,1)},M=new Map,$e=(t,r)=>{let s=M.get(t);s&&(M.delete(t),s.resolve({ops:r.filter(a=>a.batch===t),batch:t}))},J,ce=[],I=(t,r=[])=>{if(t.length===0&&r.length===0)return[];if(J)return ce.push({ops:t,drop:r}),[];let s=Math.min(...t.filter(h=>h.seq>C).map(h=>h.seq));if(Number.isFinite(s)&&s>C+1)return ce.push({ops:t,drop:r}),Pe(),[];let a=j.filter(h=>t.some(re=>re.batch===h)),f=[...new Set([...r,...a])].filter(h=>G.has(h)),y,S=j.filter(h=>!a.includes(h));try{y=k.rebase({confirmed:t,pending:S,drop:f}).confirmed}catch(h){if(!(h instanceof Cn))throw h;return ce.push({ops:t,drop:r}),Pe(),[]}for(let h of a)ae(h);t.some(h=>h.seq>C)&&S.some(h=>!f.includes(h))&&O.rebases++,t.length>0&&(C=Math.max(C,...t.map(h=>h.seq)),me.note(t));for(let h of f)G.delete(h);for(let h of a)$e(h,t);return y},Pe=()=>{J||(J=ke(be().then(t=>{if(X(t)){ce=[];return}let r=new Set(t.log.map(f=>f.batch)),s=j.filter(f=>r.has(f));for(let f of s)ae(f);let a=k.adopt({snapshot:t.snapshot,log:t.log,...t.horizon!==void 0?{horizon:t.horizon}:{},pending:[...j],drop:[...G].filter(f=>!j.includes(f))});G.clear();for(let f of a.pending)G.add(f.batch);C=t.log.at(-1)?.seq??(t.horizon??0)-1,me=Mt.of(t.log,{horizon:t.horizon??0}),O.resyncs++;for(let f of s)$e(f,t.log)}).then(()=>{J=void 0;let t=ce;ce=[];for(let{ops:r,drop:s}of t)I(r,s)},()=>{J=void 0,ce=[]})))},X=t=>(typeof t.build=="string"&&fn(t.build),typeof t.version=="number"&&z(t.held),typeof t.version!="number"||t.version===H.version?!1:(Rt(t.version),!0)),Ce=async t=>{let s=await(await se(`${c.url}/graview/since?seq=${vt(t)}&opFormat=${qe.op}`,{headers:m})).json();return X(s)?[]:s.reset===!0?(Pe(),[]):s.ops??[]},ee=async()=>{let t=await Xe();return J&&await J,t},Xe=async()=>{if(N&&!Y()&&b()){let r=await(await se(`${c.url}/graview/here?opFormat=${qe.op}`,{method:"POST",headers:m,body:JSON.stringify({presence:N,seq:vt(C)})})).json();return X(r)?[]:(typeof r.participant=="string"&&(L=r.participant),he(r.who??[]),I(r.ops??[]))}return I(await Ce(C))},P=new Map,Le=new Map,Me=new Set,te=new Map,He=new Set,ke=t=>(He.add(t),t.finally(()=>He.delete(t)).catch(()=>{}),t),et=Promise.resolve(),We=0,Pt=(t,r)=>{let s=et.then(()=>Ne(t,r));return et=s.catch(()=>{}),s},tt=()=>new Promise((t,r)=>oe.push({again:t,give:r})),Ne=async(t,r)=>{let s,a;for(;;){try{s=await se(`${c.url}/graview/ops`,{method:"POST",headers:m,body:JSON.stringify({...t,opFormat:qe.op})})}catch(h){if(!(h instanceof Ze)||U)throw h;if(await tt(),Y())return nt(t,r);continue}if(a=await s.json().catch(()=>({})),s.status===503&&a.reason==="unavailable"&&typeof a.held=="string"&&!U){if(typeof a.version=="number"?X(a):(z(a.held),!1))break;if(R!==void 0&&(Ot>0||F)){if(await new Promise(h=>le.push(h)),U)throw new Ge("The client closed.");if(Y())return nt(t,r);continue}}let S;if(s.status===503&&a.reason==="unavailable"&&!U)S=an(c.backoff,We++);else{if(We=0,s.status!==429||U)break;S=Jo(s.headers.get("retry-after"),a.retryAfter)}if(await new Promise(h=>setTimeout(h,S)),Y())return nt(t,r)}if(de||X(a))throw new Ge("The app was changed.");if(!s.ok){let S=a.error??`The server refused (${s.status})`;throw a.conflict?new pe(S,a.conflicts??[]):new Ue({reason:a.reason??jo[s.status]??"invalid",sentence:S,...a.wouldNeed?.length?{wouldNeed:a.wouldNeed}:{}})}let f=a.ops??[],y=f[0]?.seq;return y!==void 0&&y>C+1&&(f=await Ce(C)),r!==void 0&&(a.batch&&P.set(r,a.batch),ae(r)),I(f,r!==void 0?[r]:[]),{ops:a.ops??[],...a.batch?{batch:a.batch}:{}}},_,ye=!1,U=!1,Ie=0,Ee,Ve=0,Ke=0,ue=null,Re=()=>{},_e=new Promise(t=>{Re=t}),Y=()=>F&&ye&&_?.readyState===Uo,g=t=>{if(!Y())return!1;try{return _.send(JSON.stringify(t)),!0}catch{return!1}},Q=(t=!1)=>{!N||!Y()||!b()||!t&&ue&&Dt(N,ue)&&(W===void 0||Date.now()-Ke<W)||g({t:"here",presence:N})&&(ue=N,Ke=Date.now())},K=new Set,ne,ln=()=>{if(ne=void 0,R!==void 0)return;let t=[...M.entries()].filter(([r])=>K.has(r));K.clear();for(let[,r]of t)g(r.message)},un=(t,r)=>{M.has(t)&&(K.add(t),ne&&clearTimeout(ne),ne=setTimeout(ln,Math.max(0,r)))},Xr=t=>{M.has(t)&&K.add(t)},nt=(t,r)=>new Promise((s,a)=>{let f=r??`send-${++Ve}`,y=t.undo?{t:"undo",cid:f,batches:t.undo,...t.intent?{intent:t.intent}:{},...t.batch?{batch:t.batch}:{},...t.via?{via:t.via}:{},...Fe(t)}:{t:"call",cid:f,calls:t.calls??[],...t.intent?{intent:t.intent}:{},...t.batch?{batch:t.batch}:{},...t.base?.length?{base:t.base}:{},...t.via?{via:t.via}:{},...Fe(t)};if(M.set(f,{message:y,...r!==void 0?{mine:r}:{},resolve:s,reject:a}),K.size>0||R!==void 0){K.add(f);return}g(y)}),rt=(t,r)=>Y()?nt(t,r):Pt(t,r),eo=t=>{switch(t.t){case"welcome":{if(fn(t.build),typeof t.version=="number"&&t.version!==H.version){Rt(t.version);return}if(ye=!0,Ie=0,typeof t.participant=="string"&&(L=t.participant),z(t.held),t.state?Pe():I(t.ops??[]),K.clear(),ne&&clearTimeout(ne),ne=void 0,R!==void 0)for(let r of M.keys())K.add(r);else for(let r of M.values())g(r.message);Q(!0),D("online"),Re();return}case"ops":I(t.ops??[]);return;case"ack":{let r=M.get(t.cid);if(!r){I(t.ops??[]);return}M.delete(t.cid),We=0,r.mine!==void 0&&(P.set(r.mine,t.batch),ae(r.mine)),I(t.ops??[],r.mine!==void 0?[r.mine]:[]),r.resolve({ops:t.ops??[],batch:t.batch});return}case"refused":case"conflict":{let r=M.get(t.cid);if(!r)return;if(t.t==="refused"&&t.reason==="unavailable"){R!==void 0?Xr(t.cid):un(t.cid,an(c.backoff,We++));return}M.delete(t.cid),r.reject(t.t==="conflict"?new pe(t.sentence,t.conflicts??[]):new Ue({reason:t.reason??"invalid",sentence:t.sentence,...t.wouldNeed?.length?{wouldNeed:[...t.wouldNeed]}:{}}));return}case"busy":typeof t.cid=="string"&&un(t.cid,typeof t.retryAfter=="number"?t.retryAfter:1e3);return;case"presence":he(t.who??[]);return;case"held":z(t.sentence);return;case"declaration":typeof t.version=="number"&&t.version!==H.version&&Rt(t.version);return;case"reload":yn(typeof t.reason=="string"?t.reason:"This app was updated.");return;case"error":if(t.reopen===!0&&_){let r=_;wn(r);try{r.close(1e3,"Opening again.")}catch{}}return;default:return}},de=!1,kt=i.declarations,Et=i.builds,fn=t=>{if(!(de||i.otherBuild!==void 0||!c.build||typeof t!="string"||t.length===0||t===c.build)){i.otherBuild=t;for(let r of[...Et])r(t)}},pn=()=>{let t=[],r=0;for(let s of j){let a=te.get(s);a?t.push({calls:a.calls,...a.intent?{intent:a.intent}:{},...a.via?{via:a.via}:{},...Fe(a),batch:s}):r++}return{carried:t,undos:r}},mn=(t,r)=>`${r} while ${t===1?"an undo of yours was":"undos of yours were"} on the way; ${t===1?"it was":"they were"} not made.`,hn=t=>{de=!0,N=null;let r=new Ge(t);for(let a of M.values())a.reject(r);M.clear(),it&&clearInterval(it),U=!0,Ee&&clearTimeout(Ee),ne&&clearTimeout(ne),ge&&clearTimeout(ge);for(let a of oe.splice(0))a.give(r);for(let a of le.splice(0))a();let s=_;_=void 0,ye=!1;try{s?.close(1e3,t)}catch{}Re()};async function Rt(t){if(de)return;if(!c.resolveApp){yn(`This app was changed on its server (version ${t}); reload the page to carry on.`);return}let{carried:r,undos:s}=pn(),a=c.resolveApp,f=N;hn("The app was changed.");try{let y=await a(t),{state:S,...h}=c,re=await Yr({...h,app:y},r,"The app was changed while your changes were on the way.",i);f&&re.remote.presence.here(f);for(let st of[...kt])st(re.remote,t);let fe=[...s>0?[ot(mn(s,"The app was changed"))]:[],...re.unheard()];for(let st of fe)for(let co of je)co(st.sentence,st)}catch(y){let S=`The app was changed, but the new version could not be opened: ${y instanceof Error?y.message:String(y)}`;for(let h of je)h(S,ot(S))}}function yn(t){if(de)return;let{carried:r,undos:s}=pn();hn(t);let a=!1;if(c.carry&&r.length>0)try{c.carry.storage.setItem(c.carry.key,JSON.stringify(r)),a=!0}catch{}let f=[];!a&&r.length>0&&f.push(`${t} ${r.length===1?"A change of yours was":`${r.length} changes of yours were`} not sent; make ${r.length===1?"it":"them"} again after the page reloads.`),s>0&&f.push(mn(s,"This app was updated"));for(let y of f)for(let S of je)S(y,ot(y));(c.reloadPage??Yo)()}let gn=()=>{if(U||!F)return;let t=`${c.url.replace(/^http/,"ws").replace(/\/$/,"")}${Jr}`,{"content-type":r,...s}=m,a;try{a=c.socket?c.socket(t,s,[on]):so(t,s)}catch{return vn()}_=a,ye=!1,a.onopen=()=>{_===a&&a.send(JSON.stringify({t:"hello",seq:vt(C),protocol:ct,wire:rn,opFormat:qe.op,...c.build?{build:c.build.slice(0,64)}:{},...c.hostProtocol!==void 0?{hostProtocol:c.hostProtocol}:{}}))},a.onmessage=f=>{if(_!==a)return;let y;try{y=JSON.parse(String(f.data))}catch{return}eo(y)},a.onclose=()=>wn(a),a.onerror=()=>{}},ge,to=()=>{Oe=!1,ge&&clearTimeout(ge),ge=setTimeout(()=>{if(ge=void 0,Oe||U)return;let t=new Map([...q].filter(([,r])=>r.held!=="socket"));if(t.size!==q.size){q=t;for(let r of Z)r([...q.values()])}},Bt),ge.unref?.()};function wn(t){if(_!==t)return;let r=ye;_=void 0,ye=!1,ue=null,r&&(D("offline"),to()),vn()}let vn=()=>{if(U)return;let t=an(c.backoff,Ie);Ie++,Ee=setTimeout(gn,t)},bn=k.applyAll.bind(k),no=k.undo.bind(k),ro=k.previewAll.bind(k);k.previewAll=(t,r)=>ro(t,{...c.principal?{author:c.principal}:{},...r});let je=i.refusals,Je=[],ot=t=>({reason:"invalid",sentence:t}),at=i.conflicts,Tt=!1,Sn,xt=async(t,r)=>{if(r instanceof Ge||de)return;let s=r instanceof Ue?r.refusal:En(r),a=s.sentence,f=r instanceof pe?Sn?.yoursOf(k,te.get(t)?.calls??[]):void 0;ae(t);try{I([],[t])}catch{}let y=te.get(t);te.delete(t);let S=y?.calls[0];if(S&&!(r instanceof pe)){let h=k.allMutations().find(fe=>fe.name===S.name)?.subject?.arg,re=h&&k.graph.getNode(S.args[h])?.kind;Fn(k,{type:"refused",act:S.name,code:s.reason,...re?{kind:re}:{}},c.principal)}if(r instanceof pe&&O.conflicts++,r instanceof pe&&!Y()&&await ee().catch(()=>[]),r instanceof pe&&J&&await J,r instanceof pe&&at.size>0){let h=!1,re={sentence:a,conflicts:f?r.conflicts.map(fe=>fe.node===f.node&&fe.field===f.field?{...fe,yours:f.yours}:fe):r.conflicts,keepTheirs(){h=!0},useMine(){if(!(h||!y)){h=!0,Tt=!0;try{k.applyAll(f?[f.over(C)]:y.calls,{...y.intent?{intent:y.intent}:{},...y.via?{via:y.via}:{},...Fe(y)})}finally{Tt=!1}}}};for(let fe of at)fe(re);return}for(let h of je)h(a,s)},oo=(t,r)=>t.flatMap(s=>s.mutation?.name===kn?[]:s.primitives.flatMap(a=>a.op==="splice-text"&&!r.has(a.id)&&!r.has(`${a.id}\0${a.field}`)?[{node:a.id,field:a.field,rev:C}]:[]));k.applyAll=(t,r)=>{let s=Tn(k.log.all().filter(S=>G.has(S.batch))),a=bn(t,{...c.principal?{author:c.principal}:{},...r}),f=t.map((S,h)=>{let re=a.minted?.[h];return re===void 0||S.args?.id!==void 0?S:{...S,mintedHint:re}});j.push(a.batch),G.add(a.batch),te.set(a.batch,{calls:f,...r?.intent?{intent:r.intent}:{},...r?.via?{via:r.via}:{},...Fe(r)});let y=Tt?[]:[...me.baseFor(a.ops,s,(S,h)=>k.collaborative(S,h)),...oo(a.ops,s)];return Le.set(a.batch,ke(rt({calls:f,...r?.intent?{intent:r.intent}:{},batch:a.batch,...y.length>0?{base:y}:{},...r?.via?{via:r.via}:{},...Fe(r)},a.batch).catch(S=>xt(a.batch,S)))),a},k.apply=(t,r)=>k.applyAll([t],r),k.undo=(t,r)=>{let s=typeof t=="string"?[t]:t,a=no(s.map(y=>P.get(y)??y),{...c.principal?{author:c.principal}:{},...r});j.push(a.batch),G.add(a.batch);let f=Promise.allSettled(s.map(y=>Le.get(y)));return Le.set(a.batch,ke(f.then(()=>{let y=s.filter(S=>!Me.has(S));if(y.length===0){ae(a.batch),te.delete(a.batch),I([],[a.batch]);return}return rt({undo:y.map(S=>P.get(S)??S),...r?.intent?{intent:r.intent}:{},batch:a.batch,...r?.via?{via:r.via}:{},...Fe(r)},a.batch)}).catch(y=>xt(a.batch,y)))),a};let ao=async(t,r={})=>{Ft++;try{return(await ke(rt({calls:t,...r}))).ops}finally{Ft--}},Ft=0,An={here(t){N=t,Q()},onWho(t){return Z.add(t),q.size>0&&t([...q.values()]),()=>{Z.delete(t)}},leave(){if(!N)return;let t=JSON.stringify({participant:L??N.participant});if(N=null,g({t:"bye"}))return;let r=globalThis.navigator?.sendBeacon;r?r.call(globalThis.navigator,`${c.url}/graview/leave${l!==void 0?`?${ze.param}=${encodeURIComponent(l)}`:""}`,t):v(`${c.url}/graview/leave`,{method:"POST",headers:m,body:t}).catch(()=>{})}},Ot=c.pollMs??800,it=Ot>0&&typeof setInterval=="function"?setInterval(()=>{Y()||ee().catch(()=>{})},Ot):null;if(F){gn();let t;await Promise.race([_e,new Promise(r=>t=setTimeout(r,c.openTimeoutMs??3e3))]),clearTimeout(t)}if(n.length>0&&!de){let t=[],r=new Set(k.log.all().map(s=>s.batch));for(let s of n)if(!(s.batch!==void 0&&r.has(s.batch)))try{k.applyAll(s.calls,{...s.intent?{intent:s.intent}:{},...s.batch?{batch:s.batch}:{},...s.via?{via:s.via}:{},...Fe(s)})}catch(a){t.push(Io(s,a))}t.length>0&&Je.push(ot(`${o} ${t.length===1?"One no longer fits and was not made":`${t.length} no longer fit and were not made`}: ${t.join("; ")}.`))}let Pn=new Map,io=()=>({store:k,author:c.principal,appliedAll:bn,pending:j,provisional:G,asked:te,answers:Le,letGo:Me,sent:(t,r)=>ke(rt({calls:r,batch:t},t).catch(s=>xt(t,s))),settle:ae,land:I,seen:()=>C,gone:()=>U||de});return{remote:{store:k,typing(t,r){let s=`${t}\0${r}`,a=Pn.get(s);return a||(a=(__graviewPreload(import.meta.url,["./chunk.UDYFGYJP.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.BVIJXL4J.js")).then(f=>(Sn=f,f.typingOf(t,r,f.wireOf(io())))),Pn.set(s,a)),a},version:H.version,migrated:H.migrated??[],send:ao,pull:ee,onRefusal(t){je.add(t);let r=Je;Je=[];for(let s of r)t(s.sentence,s);return()=>je.delete(t)},onDeclaration(t){return kt.add(t),()=>kt.delete(t)},onBuild(t){return Et.add(t),i.otherBuild!==void 0&&t(i.otherBuild),()=>Et.delete(t)},onConflict(t){return at.add(t),()=>at.delete(t)},revision:(t,r)=>me.of(t,r),seq:()=>C,participant:()=>L,transport:()=>Y()?"socket":"poll",status:p,onStatus(t){return x.add(t),()=>x.delete(t)},held:()=>R,onHeld(t){return i.helds.add(t),R!==void 0&&t(R),()=>i.helds.delete(t)},counters:()=>({...O}),who:()=>[...q.values()],pending:()=>j.length+Ft,async settled(){for(;He.size>0;)await Promise.allSettled([...He])},presence:An,close(){it&&clearInterval(it),Ae(),An.leave(),U=!0,Ee&&clearTimeout(Ee),ne&&clearTimeout(ne),ge&&clearTimeout(ge);for(let r of oe.splice(0))r.give(new Error("The client closed before the server could be reached."));for(let r of le.splice(0))r();let t=_;_=void 0,ye=!1;try{t?.close(1e3,"Closed.")}catch{}}},unheard(){let t=Je;return Je=[],t}};function so(t,r){let s=globalThis.WebSocket;if(!s)throw new Error("This runtime has no WebSocket; the client polls instead.");let a=typeof globalThis.document<"u",f=c.subprotocol?[on]:[];if(!a)try{return new s(t,{headers:r,...f.length>0?{protocols:f}:{}})}catch{}let y=new URL(t);for(let[S,h]of Object.entries(E))y.searchParams.set(S,h);return l!==void 0&&y.searchParams.set(ze.param,l),f.length>0?new s(y.toString(),f):new s(y.toString())}}function Jo(e,n,o=Date.now()){let i,l=e?.trim();if(l)if(/^\d+(\.\d+)?$/.test(l))i=Number(l)*1e3;else{let v=Date.parse(l);Number.isFinite(v)&&(i=Math.max(0,v-o))}let u=typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0,c=u!==void 0&&u<50&&i!==void 0&&Math.abs(u*1e3-i)<1e3;return u!==void 0&&!c?u:i??1e3}function Yo(){globalThis.location?.reload?.()}function Qo(){return globalThis.document?.visibilityState!=="hidden"}function an(e,n){if(typeof e=="function")return Math.max(0,e(n));let{min:o=250,max:i=1e4,factor:l=2}=e??{};return Math.min(i,o*l**n)*(.75+Math.random()*.5)}function At(e){let n={};if(!e)return n;e.id&&(n[ve.seat]=e.id),e.roles?.length&&(n[ve.roles]=e.roles.join(",")),e.kind!=="human"&&(n[ve.kind]=e.kind),e.name&&(n[ve.name]=encodeURIComponent(e.name));let o=e.onBehalfOf;return o?.id&&(n[ve.for]=o.id),o?.roles?.length&&(n[ve.forRoles]=o.roles.join(",")),o?.name&&(n[ve.forName]=encodeURIComponent(o.name)),n}var Qr="/graview/views";function sn(e){let n=e.fetch??fetch,o=bt(e.url,e.headers),i=o.url,l={"content-type":"application/json",...e.principal?At(e.principal):{},...o.headers},u=e.state?{hidden:e.state.hidden??[],removed:e.state.removed??[],may:e.state.may??dt.may}:dt,c=new Set,v=b=>{if(JSON.stringify(b)!==JSON.stringify(u)){u=b;for(let T of c)T()}},m=async(b,T)=>{let x=await n(`${i}${e.path??Qr}`,{method:b,headers:l,...T!==void 0?{body:JSON.stringify(T)}:{}}),O=await x.json();if(!x.ok)throw new Error(O.error??`The store answered ${x.status}.`);v({hidden:O.hidden??[],removed:O.removed??[],may:O.may??dt.may})},E=()=>m("GET"),F=e.state?Promise.resolve():E().catch(()=>{}),W=e.pollMs?setInterval(()=>void E().catch(()=>{}),e.pollMs):void 0;return{ready:F,refresh:E,close:()=>clearInterval(W),current:()=>u,onChange(b){return c.add(b),()=>void c.delete(b)},hide:b=>m("POST",{hide:b}),show:b=>m("POST",{show:b}),remove:(b,T)=>m("POST",{remove:b,...T?{about:T}:{}}),async restore(b){let T=u.removed.find(x=>x.name===b)?.lens;await m("POST",{restore:b}),T&&await e.onDeclaration?.()},async lens(b){await m("POST",{lens:b}),await e.onDeclaration?.()}}}var dn=document.getElementById("graview-app"),cn=/^\/forms\/([^/]+)\/?$/.exec(location.pathname),Zr=cn?(__graviewPreload(import.meta.url,["./chunk.2VIS2NAT.js","./chunk.3OEODIHB.js","./chunk.XOZU4OFA.js","./chunk.G7YLK4PX.js","./chunk.XJWKIXPV.js","./chunk.4VRX7FCO.js","./chunk.75JQCTR6.js","./chunk.5IEZF433.js","./chunk.5AD2QHWH.js","./chunk.DLWFULWE.js","./chunk.VLX7YWVH.js","./chunk.SDO3U72B.js","./chunk.IQGSEAQ2.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.DYRULRFX.js")):De("pages");try{cn?await Zo(decodeURIComponent(cn[1])):await Xo()}catch(e){let n=document.createElement("pre");n.setAttribute("role","alert"),n.style.cssText="margin:2rem;font:14px/1.5 ui-monospace,monospace;white-space:pre-wrap",n.textContent=e instanceof Error?e.message:String(e),dn.replaceChildren(n),window.__graviewFailed=n.textContent}async function Zo(e){let n=await fetch(`/graview/document?form=${encodeURIComponent(e)}`),o=await n.json();if(!n.ok)throw new Error(o.error??`The preview server did not hand over the form (${n.status}).`);let i=await mt(o);if(!i.ok)throw new Error(lt(i.findings));let l=i.app,u=o.principal,c=await St({app:l,url:location.origin,principal:u,...o.state?{state:o.state,openTimeoutMs:0}:{openTimeoutMs:3e3}});document.title=l.forms?.[e]?.title??l.name;let{mount:v}=await Zr;window.__graview=v(dn,{app:l,form:e,principal:u,remote:c,height:"100dvh",onSubmitted:()=>window.__graviewSubmitted=!0}),window.__graviewReady=!0}async function Xo(){let e=await fetch("/graview/document");if(!e.ok)throw new Error(`The preview server did not hand over the document (${e.status}).`);let n=await e.json(),i=await(async m=>{if(typeof m.module=="string")return(await import(m.module)).app;let E=await mt(m);if(!E.ok)throw new Error(lt(E.findings));return E.app})(n);if(!i||typeof i!="object"||!("schema"in i))throw new Error("The app module the preview server handed does not export an app.");let l=n.principal,u=await St({app:i,url:location.origin,principal:l,live:!0,subprotocol:!0,pollMs:1200,...n.state?{state:n.state,openTimeoutMs:0}:{openTimeoutMs:3e3}});document.title=i.name;let c,v=sn({url:location.origin,principal:l,...n.views?{state:n.views}:{},onDeclaration:async()=>{let m=await(await fetch("/graview/document")).json();if(typeof m.module=="string")return;let E=await mt(m);E.ok&&c?.setApp(E.app,u)}});await Promise.all([Zr,v.ready]),c=nn(dn,{app:i,remote:u,principal:l,studio:!1,face:"pages",routing:"address",bar:!0,height:"100dvh",label:i.name,heading:1,keptViews:v,...n.draftView?{draftView:n.draftView}:{}}),window.__graview=c,c.drawn().then(()=>{window.__graviewReady=!0})}
|
package/dist/preview/splash.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
`);return{html:
|
|
1
|
+
var F=["plain","editorial","shader","ascii"],S=["drift","ripple","veil","caustics"],$="graview-splash",p=/^#[0-9a-fA-F]{6}$/,I=/^[A-Za-z0-9 ,'"-]{1,200}$/,o='system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',q='Georgia, "Times New Roman", serif',f='ui-monospace, "SF Mono", Menlo, Consolas, monospace',s=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");function m(e){if(!e)return;let t=e.trim();if(/^<svg[\s>]/i.test(t)&&!/<script|\bon[a-z]+\s*=|javascript:/i.test(t))return`data:image/svg+xml,${encodeURIComponent(t)}`;if(!(/^</.test(t)||/^[a-z][a-z0-9+.-]*:/i.test(t)||t.startsWith("//")))return/^[A-Za-z0-9._~/-]+$/.test(t)?t:void 0}function E(e,t){if(e)return typeof e=="string"?e:"src"in e?e.src:t==="dark"&&e.dark?e.dark:e.light}function C(e){return e?e==="system-serif"?q:e==="system-mono"?f:e==="system-sans"?o:I.test(e)?e:o:o}function N(e){let t=typeof e.ground=="string"?{light:e.ground}:e.ground??{},i=t.light&&p.test(t.light)?t.light:"#f7f7f2",c=t.dark&&p.test(t.dark)?t.dark:"#0a0f1f",n=e.accent&&p.test(e.accent)?e.accent:void 0;return{light:i,dark:c,tintLight:n??"#001769",tintDark:n??"#9aabff",inkLight:"#18213a",inkDark:"#e8ecf5"}}function A(e){return[1,3,5].map(t=>(parseInt(e.slice(t,t+2),16)/255).toFixed(3)).join(",")}function H(e,t={}){if(t.scheme==="light"||t.scheme==="dark")return t.scheme;if(e.scheme==="light"||e.scheme==="dark")return e.scheme;let i=e.splash?.scheme;return i==="light"||i==="dark"?i:"auto"}function z(e,t={}){let i=e.splash;if(!i||!F.includes(i.style))return{html:"",css:"",script:""};let c=H(e,t),{light:n,dark:T,tintLight:v,tintDark:y,inkLight:b,inkDark:R}=N(e),g=t.title??i.title??e.name??t.name??"",w=t.kicker??i.kicker,x=i.style==="shader"?S.includes(i.shader??"")?i.shader:S[0]:void 0,d=r=>r&&t.assetsAt&&r.startsWith("/graview/assets/")?t.assetsAt(r):r,u=d(m(i.image)),h=u??(i.style==="plain"?d(m(E(e.logo,"light"))):void 0),_=u??(i.style==="plain"?d(m(E(e.logo,"dark"))):void 0),l=(r,P)=>r?`<img class="graview-splash-image" data-scheme="${P}" src="${s(r)}" alt="" decoding="async">`:"",U=i.style==="plain"?h===_?l(h,"light").replace(' data-scheme="light"',""):l(h,"light")+l(_,"dark"):l(u,"light").replace(' data-scheme="light"',""),D=`${w?`<p class="graview-splash-kicker">${s(w)}</p>`:""}<p class="graview-splash-title"${i.style==="ascii"?` data-types="${s(g)}" aria-hidden="true"`:""}>${i.style==="ascii"?"":s(g)}</p>`,M=`<div id="${$}" popover="manual" data-style="${i.style}" data-scheme="${c}"${x?` data-shader="${x}"`:""} data-tint-light="${A(v)}" data-tint-dark="${A(y)}"${t.fade===!1?' data-fade="off"':""} role="status" aria-label="${s(g)}">${U}${i.style==="ascii"?'<pre class="graview-splash-ascii" aria-hidden="true"></pre>':""}${i.style==="shader"?'<canvas class="graview-splash-canvas" aria-hidden="true"></canvas>':""}<div class="graview-splash-words">${D}</div></div>`,a=`#${$}`,k=`--gs-ground:${T};--gs-ink:${R};--gs-tint:${y};--gs-light:0`,L=[`${a}{--gs-ground:${n};--gs-ink:${b};--gs-tint:${v};--gs-light:1;position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;overflow:hidden;background:var(--gs-ground);color:var(--gs-ink);font-family:${C(e.typography?.display)};transition:opacity .28s ease}`,`${a}::backdrop{background:transparent}`,`${a}[data-scheme="dark"]{${k}}`,`@media (prefers-color-scheme: dark){${a}[data-scheme="auto"]{${k}}}`,`${a}[data-gone]{opacity:0;pointer-events:none}`,`${a} .graview-splash-words{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:flex-end;padding:clamp(24px,6vw,72px);box-sizing:border-box}`,`${a} .graview-splash-kicker{margin:0 0 .6em;font:600 clamp(12px,1.4vw,15px)/1.3 ${o};letter-spacing:.14em;text-transform:uppercase;color:var(--gs-tint)}`,`${a} .graview-splash-title{margin:0;font-size:clamp(40px,9vw,128px);font-weight:600;line-height:.95;letter-spacing:-.03em;max-width:14ch;overflow-wrap:anywhere}`,`${a} .graview-splash-image{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}`,`${a}[data-style="editorial"] .graview-splash-words,${a}[data-style="shader"] .graview-splash-words{background:linear-gradient(to top,var(--gs-ground) 0,transparent 55%)}`,`${a}[data-style="plain"] .graview-splash-words{justify-content:center;align-items:center;text-align:center}`,`${a}[data-style="plain"] .graview-splash-title{font-size:clamp(28px,5vw,56px);letter-spacing:-.02em}`,`${a}[data-style="plain"] .graview-splash-image{position:static;width:min(160px,30vw);height:auto;max-height:160px;object-fit:contain;margin:0 auto 24px}`,`${a}[data-style="plain"] .graview-splash-image[data-scheme="dark"]{display:none}`,`${a}[data-scheme="dark"][data-style="plain"] .graview-splash-image[data-scheme="light"]{display:none}${a}[data-scheme="dark"][data-style="plain"] .graview-splash-image[data-scheme="dark"]{display:block}`,`@media (prefers-color-scheme: dark){${a}[data-scheme="auto"][data-style="plain"] .graview-splash-image[data-scheme="light"]{display:none}${a}[data-scheme="auto"][data-style="plain"] .graview-splash-image[data-scheme="dark"]{display:block}}`,`${a} .graview-splash-canvas{position:absolute;inset:0;width:100%;height:100%}`,`${a}[data-style="ascii"] .graview-splash-image{visibility:hidden}`,`${a} .graview-splash-ascii{position:absolute;inset:0;margin:0;padding:0;overflow:hidden;font:12px/14px ${f};color:var(--gs-tint);opacity:.85;white-space:pre;user-select:none}`,`${a}[data-style="ascii"] .graview-splash-title{font-family:${f};font-weight:500}`,`${a}[data-style="ascii"] .graview-splash-title::after{content:"_";animation:graview-splash-blink 1s steps(2) infinite}`,"@keyframes graview-splash-blink{to{visibility:hidden}}",`@media (prefers-reduced-motion: reduce){${a}{transition:none}${a}[data-style="ascii"] .graview-splash-title::after{animation:none;content:""}}`].join(`
|
|
2
|
+
`);return{html:M,css:L,script:B}}var B=String.raw`(function(){
|
|
3
3
|
var s=document.getElementById("graview-splash");if(!s)return;
|
|
4
4
|
if(s.showPopover){try{s.showPopover()}catch(e){}}
|
|
5
|
-
var mq=window.matchMedia?matchMedia("(prefers-reduced-motion: reduce)"):null,still=!!(mq&&mq.matches);
|
|
5
|
+
var mq=window.matchMedia?matchMedia("(prefers-reduced-motion: reduce)"):null,still=!!(mq&&mq.matches),quick=still||navigator.webdriver===true||s.getAttribute("data-fade")==="off";
|
|
6
6
|
var dark=s.getAttribute("data-scheme")==="dark"||(s.getAttribute("data-scheme")==="auto"&&window.matchMedia&&matchMedia("(prefers-color-scheme: dark)").matches);
|
|
7
7
|
var tint=(s.getAttribute(dark?"data-tint-dark":"data-tint-light")||"0,0,0").split(",").map(Number);
|
|
8
8
|
var stop=null,gone=false,t0=Date.now();
|
|
9
|
-
function go(){if(gone)return;gone=true;ob.disconnect();clearTimeout(most);if(stop)stop();if(
|
|
9
|
+
function go(){if(gone)return;gone=true;ob.disconnect();clearTimeout(most);if(stop)stop();if(quick){if(s.parentNode)s.parentNode.removeChild(s);return}
|
|
10
10
|
s.setAttribute("data-gone","");setTimeout(function(){if(s.parentNode)s.parentNode.removeChild(s)},320)}
|
|
11
11
|
function drawn(){return !!document.querySelector("[data-graview-drawn],[role=alert]")}
|
|
12
12
|
var ob=new MutationObserver(function(){if(drawn())go()});
|
|
@@ -32,7 +32,8 @@ var canvas=s.querySelector(".graview-splash-canvas"),gl=canvas&&(canvas.getConte
|
|
|
32
32
|
var which=s.getAttribute("data-shader")||"drift";
|
|
33
33
|
var F={drift:"vec2 d=vec2(sin(u_time*.21)*.02,cos(u_time*.17)*.02);vec2 q=(uv-.5)*(1.06-.04*u_progress)+.5+d;q+=vec2(sin(q.y*6.+u_time*.5),cos(q.x*5.-u_time*.4))*.004;vec3 c=pic(q);c=mix(c,u_tint,(1.-u_progress)*.35+.12*(1.-uv.y));",
|
|
34
34
|
ripple:"vec2 p=uv-.5;p.x*=u_resolution.x/u_resolution.y;float r=length(p);float w=sin(r*28.-u_time*2.6)*exp(-r*2.2)*.012*(1.-u_progress*.6);vec3 c=pic(uv+normalize(p+1e-5)*w);c=mix(c,u_tint,.18*(1.-u_progress)+.1*(1.-uv.y));",
|
|
35
|
-
veil:"vec3 c=pic(uv);float band=smoothstep(-.3,.3,uv.x-uv.y*.6+sin(u_time*.35)*.25-.2);c=mix(c,u_tint,(.55-.4*u_progress)*band+.1*(1.-uv.y));"
|
|
35
|
+
veil:"vec3 c=pic(uv);float band=smoothstep(-.3,.3,uv.x-uv.y*.6+sin(u_time*.35)*.25-.2);c=mix(c,u_tint,(.55-.4*u_progress)*band+.1*(1.-uv.y));",
|
|
36
|
+
caustics:"vec2 p=(uv-.5)*vec2(u_resolution.x/u_resolution.y,1.)*5.;vec2 i=p;float k=1.;for(int n=0;n<4;n++){float t=u_time*.3*(1.-3.5/float(n+1));i=p+vec2(cos(t-i.x)+sin(t+i.y),sin(t-i.y)+cos(t+i.x));k+=1./length(vec2(p.x/(sin(i.x+t)/.005),p.y/(cos(i.y+t)/.005)));}k=1.17-pow(k/4.,1.4);float l=clamp(pow(abs(k),8.),0.,1.);vec3 c=pic(uv+vec2(sin(i.x),cos(i.y))*.004);c=mix(c,u_tint,(1.-u_progress)*.3+.1*(1.-uv.y));c+=l*(.18+.22*u_light)*(1.-.5*u_progress);"};
|
|
36
37
|
if(gl){
|
|
37
38
|
var vs="attribute vec2 a;void main(){gl_Position=vec4(a,0.,1.);}";
|
|
38
39
|
var fs="precision mediump float;uniform sampler2D u_image;uniform float u_time,u_progress,u_light,u_has;uniform vec2 u_resolution,u_size;uniform vec3 u_tint,u_ground;"+
|
|
@@ -54,4 +55,4 @@ loop(function(t){var w=s.clientWidth,h=s.clientHeight,dpr=Math.min(2,window.devi
|
|
|
54
55
|
gl.uniform1f(U("u_time"),t);gl.uniform1f(U("u_progress"),Math.min(1,t/2.4));gl.uniform2f(U("u_resolution"),canvas.width,canvas.height);gl.drawArrays(gl.TRIANGLES,0,3)});
|
|
55
56
|
}else if(canvas)canvas.remove()}else if(canvas)canvas.remove();
|
|
56
57
|
}
|
|
57
|
-
})();`;export{
|
|
58
|
+
})();`;export{$ as SPLASH_ID,S as SPLASH_SHADERS,F as SPLASH_STYLES,z as splashHtml,H as splashScheme};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graview",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.64",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The Graview command line: start a product, check its declaration, write its agent docs, serve its store, preview a document with no product and photograph its places, say whether a product is on one release, host it for an agent over MCP, apply an act to it, sync its seed, install the authoring skills. The tool; @graview/* is the framework.",
|
|
6
6
|
"keywords": [
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@graview/
|
|
33
|
-
"@graview/
|
|
34
|
-
"@graview/
|
|
35
|
-
"@graview/tools": "0.1.
|
|
36
|
-
"@graview/
|
|
32
|
+
"@graview/core": "0.1.64",
|
|
33
|
+
"@graview/guest": "0.1.64",
|
|
34
|
+
"@graview/ship": "0.1.64",
|
|
35
|
+
"@graview/tools": "0.1.64",
|
|
36
|
+
"@graview/skills": "0.1.64"
|
|
37
37
|
},
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=22"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as a,l as b,m as c,n as d,o as e,p as f,q as g,r as h,s as i}from"./chunk.N6EJXXQK.js";import"./chunk.BJUUSIQY.js";import"./chunk.PZQNR4KZ.js";import"./chunk.W4BKYSZX.js";import"./chunk.T6WHGKWR.js";import"./chunk.XOZU4OFA.js";import"./chunk.Y2YYH3JN.js";import"./chunk.5STU3KYG.js";import"./chunk.ZN3PUM2I.js";import"./chunk.NUYA4BWI.js";import"./chunk.OKZT2QBM.js";import"./chunk.ACTXR2MI.js";import"./chunk.AI34V6WV.js";import"./chunk.G4ULQK64.js";import"./chunk.M7RESZB6.js";import"./chunk.SDO3U72B.js";import"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{i as GhostTray,h as InlineAiMenu,g as askAgain,c as askInline,a as askOf,b as drawPanel,d as heldSuggestion,e as suggestOnce,f as takeOffer};
|