graview 0.1.38 → 0.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/preview/chunk.23WYWIAJ.js +1 -0
- package/dist/preview/{chunk.5XJEGXDO.js → chunk.2BJRS3YJ.js} +1 -1
- package/dist/preview/{chunk.ROGYDMES.js → chunk.2GGDOFTF.js} +1 -1
- package/dist/preview/chunk.2HF54MYG.js +1 -0
- package/dist/preview/{chunk.OE4QOBJF.js → chunk.2IX3CZNP.js} +1 -1
- package/dist/preview/chunk.2NSTEREJ.js +1 -0
- package/dist/preview/chunk.2RCNSHXK.js +1 -0
- package/dist/preview/chunk.37ASLBGE.js +1 -0
- package/dist/preview/{chunk.33GN2NUT.js → chunk.3ZNQ5YKX.js} +1 -1
- package/dist/preview/{chunk.EUGWV3S6.js → chunk.4BBJ62ZO.js} +1 -1
- package/dist/preview/chunk.4ECICQ2S.js +1 -0
- package/dist/preview/{chunk.B5ILKGEF.js → chunk.4PNFX3TX.js} +1 -1
- package/dist/preview/{chunk.WG5NIR23.js → chunk.546WEHEX.js} +1 -1
- package/dist/preview/chunk.57OPL5WD.js +1 -0
- package/dist/preview/{chunk.36SQJMEE.js → chunk.5JPRFXYQ.js} +1 -1
- package/dist/preview/chunk.5OJJ2TKZ.js +9 -0
- package/dist/preview/chunk.5R4E5C76.js +1 -0
- package/dist/preview/{chunk.7H5KVW2F.js → chunk.5XNVN4HE.js} +1 -1
- package/dist/preview/chunk.5ZMENPY4.js +5 -0
- package/dist/preview/{chunk.YPY5BOEI.js → chunk.67USHK26.js} +1 -1
- package/dist/preview/chunk.6CFP5UYP.js +1 -0
- package/dist/preview/{chunk.74RMHUCX.js → chunk.6DHHUBSC.js} +1 -1
- package/dist/preview/chunk.6HBEYRJU.js +1 -0
- package/dist/preview/chunk.6L7IDF3J.js +1 -0
- package/dist/preview/{chunk.ZRQI5VJF.js → chunk.6XU2CXRZ.js} +1 -1
- package/dist/preview/{chunk.2VIGF4FO.js → chunk.7EFNLMKU.js} +1 -1
- package/dist/preview/chunk.7WSXVXP3.js +1 -0
- package/dist/preview/chunk.ALDLAQ7V.js +1 -0
- package/dist/preview/chunk.AYHCQWSU.js +1 -0
- package/dist/preview/{chunk.QYRPELLU.js → chunk.B2IRADR2.js} +1 -1
- package/dist/preview/{chunk.V2NBJDAX.js → chunk.B7TB6YRZ.js} +1 -1
- package/dist/preview/chunk.BCHHBGM6.js +1 -0
- package/dist/preview/{chunk.LHO7L3CS.js → chunk.BEC5ZH2L.js} +1 -1
- package/dist/preview/chunk.BL4S3I2N.js +1 -0
- package/dist/preview/chunk.BS3FX4PX.js +1 -0
- package/dist/preview/chunk.BTSXYZ6Z.js +25 -0
- package/dist/preview/chunk.BYKR7NEE.js +1 -0
- package/dist/preview/chunk.BZSU4HH2.js +1 -0
- package/dist/preview/chunk.C2OAKTZX.js +1 -0
- package/dist/preview/chunk.C4CFYTCW.js +1 -0
- package/dist/preview/{chunk.6ONRWFA6.js → chunk.C6X7CKU6.js} +1 -1
- package/dist/preview/chunk.CAMQ7MYJ.js +1 -0
- package/dist/preview/{chunk.NPX7SPXM.js → chunk.CC47O2DW.js} +1 -1
- package/dist/preview/{chunk.ZLXPIEUC.js → chunk.CF7DHTKL.js} +2 -2
- package/dist/preview/{chunk.SGB6IMWN.js → chunk.CMN6VVK2.js} +1 -1
- package/dist/preview/chunk.CTK2P4JV.js +3 -0
- package/dist/preview/chunk.DAA7IDQ4.js +1 -0
- package/dist/preview/{chunk.6UCRL4OF.js → chunk.DYNBWIPF.js} +1 -1
- package/dist/preview/chunk.E3HXXUKY.js +1 -0
- package/dist/preview/{chunk.GZ3IXNA4.js → chunk.EBHKKOPO.js} +1 -1
- package/dist/preview/chunk.EDC4EMIX.js +1 -0
- package/dist/preview/chunk.EM4Y4YAD.js +2 -0
- package/dist/preview/{chunk.IEDXW36H.js → chunk.EWWJMS6G.js} +1 -1
- package/dist/preview/chunk.F5UVEF2R.js +1 -0
- package/dist/preview/{chunk.TKSGC6XH.js → chunk.FCXBCKED.js} +1 -1
- package/dist/preview/chunk.FGDHEVH4.js +1 -0
- package/dist/preview/{chunk.IM7LXLIB.js → chunk.FILCNVGH.js} +1 -1
- package/dist/preview/chunk.FJBQ4UP3.js +32 -0
- package/dist/preview/{chunk.RZVZG2BQ.js → chunk.FMN5XDLE.js} +1 -1
- package/dist/preview/chunk.G23VFYGF.js +88 -0
- package/dist/preview/chunk.G46WGK5E.js +1 -0
- package/dist/preview/chunk.GAFYE37S.js +3 -0
- package/dist/preview/{chunk.VNBR4DHD.js → chunk.GP2F7TIN.js} +1 -1
- package/dist/preview/chunk.GXKECZ4S.js +19 -0
- package/dist/preview/{chunk.3D5T3XIE.js → chunk.H5CZZZLX.js} +1 -1
- package/dist/preview/{chunk.V5ZT5NSJ.js → chunk.HA3PPIEQ.js} +1 -1
- package/dist/preview/chunk.HFDYFPMJ.js +1 -0
- package/dist/preview/chunk.HFYUAK5Z.js +6 -0
- package/dist/preview/chunk.HGS32FT2.js +1 -0
- package/dist/preview/chunk.HHUCPVG5.js +1 -0
- package/dist/preview/{chunk.LF7PU77M.js → chunk.I7CU2E3C.js} +1 -1
- package/dist/preview/{chunk.MCVY6RRS.js → chunk.IAZRY42B.js} +1 -1
- package/dist/preview/{chunk.5MSO3KRO.js → chunk.ITEF3U2E.js} +1 -1
- package/dist/preview/{chunk.AZCFXPEL.js → chunk.IXYBIDAN.js} +1 -1
- package/dist/preview/{chunk.FTJBW25J.js → chunk.J3M2MZHG.js} +1 -1
- package/dist/preview/{chunk.MVNUWK5Y.js → chunk.JBTU2PJ4.js} +1 -1
- package/dist/preview/chunk.JCR3ECUM.js +1 -0
- package/dist/preview/{chunk.JWJQ2VXS.js → chunk.JEZTPXEB.js} +1 -1
- package/dist/preview/chunk.KIJCOW25.js +1 -0
- package/dist/preview/{chunk.2EJAIT33.js → chunk.KJNUZYXS.js} +1 -1
- package/dist/preview/chunk.L7DQKPJV.js +117 -0
- package/dist/preview/{chunk.RVJYEOFN.js → chunk.LCYMYLOP.js} +1 -1
- package/dist/preview/chunk.LP2DJ5ZB.js +6 -0
- package/dist/preview/chunk.LP3QUPCE.js +1 -0
- package/dist/preview/chunk.M5QFUGGG.js +1 -0
- package/dist/preview/chunk.N2SV3KX7.js +1 -0
- package/dist/preview/chunk.N7N5OFPL.js +1 -0
- package/dist/preview/{chunk.WERYQENC.js → chunk.NG3YMQ36.js} +1 -1
- package/dist/preview/{chunk.MWZK3HVG.js → chunk.NSNGPQGT.js} +1 -1
- package/dist/preview/chunk.OJKS3UQS.js +1 -0
- package/dist/preview/{chunk.KNJZ2YNJ.js → chunk.OM5CDW2S.js} +1 -1
- package/dist/preview/{chunk.QT4XGC5Z.js → chunk.ORXFUK6F.js} +2 -2
- package/dist/preview/chunk.OXTUXWMU.js +1 -0
- package/dist/preview/chunk.OYMM2UWE.js +1 -0
- package/dist/preview/chunk.P3JYH6HO.js +1 -0
- package/dist/preview/{chunk.FMVWXSQ7.js → chunk.P4WYBSYA.js} +1 -1
- package/dist/preview/chunk.P5325GYR.js +1 -0
- package/dist/preview/chunk.PMER4LVT.js +1 -0
- package/dist/preview/chunk.PONWLTTB.js +1 -0
- package/dist/preview/chunk.PXQVXBNG.js +1 -0
- package/dist/preview/chunk.QCF6Z2AZ.js +1 -0
- package/dist/preview/chunk.QEXXLWEU.js +6 -0
- package/dist/preview/chunk.QMFUPTR4.js +1 -0
- package/dist/preview/{chunk.BUVAMSOZ.js → chunk.RM7NVN7B.js} +2 -2
- package/dist/preview/{chunk.YUJG5SN5.js → chunk.ROINZMNO.js} +1 -1
- package/dist/preview/chunk.ROKRQRID.js +35 -0
- package/dist/preview/chunk.RWB4235L.js +1 -0
- package/dist/preview/chunk.RXSHFG6S.js +1 -0
- package/dist/preview/chunk.SDO3U72B.js +1 -0
- package/dist/preview/chunk.SHNYYBNW.js +1 -0
- package/dist/preview/{chunk.L73VUBXN.js → chunk.SK33IHL2.js} +2 -2
- package/dist/preview/chunk.STBJV6HJ.js +1 -0
- package/dist/preview/chunk.TCUB6IDY.js +1 -0
- package/dist/preview/chunk.TJCTTJWE.js +1 -0
- package/dist/preview/{chunk.SZWX56WR.js → chunk.TU4KG22J.js} +2 -2
- package/dist/preview/chunk.U4E5GQTK.js +1 -0
- package/dist/preview/{chunk.Z3ZKYSPN.js → chunk.U7QMA4H7.js} +1 -1
- package/dist/preview/{chunk.UXIFQIHA.js → chunk.UB3O3QJQ.js} +1 -1
- package/dist/preview/{chunk.6XJP7F3I.js → chunk.UCZR33MK.js} +1 -1
- package/dist/preview/chunk.UGCNMAPC.js +1 -0
- package/dist/preview/{chunk.VKHKYK5L.js → chunk.UIUHGA6W.js} +1 -1
- package/dist/preview/chunk.VC4JPG7O.js +1 -0
- package/dist/preview/{chunk.DL637Q3W.js → chunk.W4OX4BMP.js} +1 -1
- package/dist/preview/chunk.WJQY4E45.js +1 -0
- package/dist/preview/{chunk.XHWL7QBF.js → chunk.WQPNGBR7.js} +1 -1
- package/dist/preview/chunk.WTZOOAIW.js +1 -0
- package/dist/preview/{chunk.FUJM7GDV.js → chunk.WXYUWBKX.js} +1 -1
- package/dist/preview/chunk.XBOZTQQA.js +1 -0
- package/dist/preview/{chunk.TOWYHWPB.js → chunk.XLI44BBI.js} +1 -1
- package/dist/preview/chunk.XLZ2QRRS.js +1 -0
- package/dist/preview/chunk.XQTMO5PW.js +1 -0
- package/dist/preview/chunk.YWVOACSX.js +5 -0
- package/dist/preview/{chunk.67WL7BGF.js → chunk.YXGI7H4Y.js} +1 -1
- package/dist/preview/{chunk.GR5Q4HTW.js → chunk.Z7JRBKA7.js} +1 -1
- package/dist/preview/chunk.ZR5KVYWZ.js +21 -0
- package/dist/preview/{chunk.6IHXTT6Z.js → chunk.ZTMDU3OH.js} +1 -1
- package/dist/preview/index.html +45 -43
- package/dist/preview/page.js +7 -7
- package/package.json +6 -6
- package/dist/preview/chunk.2HFRVWWM.js +0 -1
- package/dist/preview/chunk.3FW4QNGV.js +0 -1
- package/dist/preview/chunk.3RT2GUZ5.js +0 -1
- package/dist/preview/chunk.3ZRHHB7X.js +0 -1
- package/dist/preview/chunk.4DEUD66C.js +0 -6
- package/dist/preview/chunk.4EQSP7I3.js +0 -1
- package/dist/preview/chunk.4Y6BCHV2.js +0 -1
- package/dist/preview/chunk.5VBBQ6Z3.js +0 -1
- package/dist/preview/chunk.6CKBIY7L.js +0 -1
- package/dist/preview/chunk.7RSZMIAL.js +0 -1
- package/dist/preview/chunk.AFY35RJP.js +0 -1
- package/dist/preview/chunk.BRHRAVU2.js +0 -3
- package/dist/preview/chunk.DFVVS6C5.js +0 -1
- package/dist/preview/chunk.DQJAEU4V.js +0 -1
- package/dist/preview/chunk.ESSQAMPM.js +0 -1
- package/dist/preview/chunk.EV553KRT.js +0 -1
- package/dist/preview/chunk.EZP4FHDX.js +0 -35
- package/dist/preview/chunk.F6PIK2J2.js +0 -1
- package/dist/preview/chunk.FYIQZMVF.js +0 -1
- package/dist/preview/chunk.HUSFMFXH.js +0 -1
- package/dist/preview/chunk.HVTGPEVW.js +0 -1
- package/dist/preview/chunk.I3SQJ2L2.js +0 -1
- package/dist/preview/chunk.IU6ISXXC.js +0 -1
- package/dist/preview/chunk.K5KEECHL.js +0 -88
- package/dist/preview/chunk.L34FY7QQ.js +0 -1
- package/dist/preview/chunk.L7JKEEMM.js +0 -1
- package/dist/preview/chunk.LAW5PQEM.js +0 -1
- package/dist/preview/chunk.LDD3QX7G.js +0 -1
- package/dist/preview/chunk.LU5LSXSW.js +0 -1
- package/dist/preview/chunk.MQ7FNHXG.js +0 -25
- package/dist/preview/chunk.NH5TDAB2.js +0 -1
- package/dist/preview/chunk.NORRCKGN.js +0 -1
- package/dist/preview/chunk.NQQHOSOK.js +0 -1
- package/dist/preview/chunk.NWWMUOZM.js +0 -1
- package/dist/preview/chunk.OEF3GPRM.js +0 -1
- package/dist/preview/chunk.OS3L4ZOF.js +0 -2
- package/dist/preview/chunk.OTL3Z345.js +0 -1
- package/dist/preview/chunk.P3UPCI23.js +0 -1
- package/dist/preview/chunk.PGKIEDYV.js +0 -9
- package/dist/preview/chunk.PKUWET2F.js +0 -1
- package/dist/preview/chunk.POHEWJKZ.js +0 -1
- package/dist/preview/chunk.PUBG2L6F.js +0 -117
- package/dist/preview/chunk.QTTBZJ6W.js +0 -1
- package/dist/preview/chunk.RJDZOF2L.js +0 -1
- package/dist/preview/chunk.SGLJTSTD.js +0 -1
- package/dist/preview/chunk.SITFEJES.js +0 -1
- package/dist/preview/chunk.UF3L6FJO.js +0 -1
- package/dist/preview/chunk.VSYHU5MA.js +0 -1
- package/dist/preview/chunk.VTWFVPKD.js +0 -19
- package/dist/preview/chunk.VV4BPOIK.js +0 -1
- package/dist/preview/chunk.W2HCJQVK.js +0 -32
- package/dist/preview/chunk.WLPTY4BF.js +0 -5
- package/dist/preview/chunk.XM3NPZLP.js +0 -1
- package/dist/preview/chunk.YAXZNQY6.js +0 -1
- package/dist/preview/chunk.YG423NEB.js +0 -1
- package/dist/preview/chunk.YVR3ZMTV.js +0 -1
- package/dist/preview/chunk.YXH3IWNR.js +0 -1
- package/dist/preview/chunk.ZYCNEOAQ.js +0 -1
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import{a as qe,c as Be}from"./chunk.AZCFXPEL.js";import{b as Ve}from"./chunk.W2HCJQVK.js";import{a as Ie,b as Ke,c as Fe,d as j}from"./chunk.4DEUD66C.js";import"./chunk.LHO7L3CS.js";import{j as Me,k as Le}from"./chunk.L73VUBXN.js";import"./chunk.YG423NEB.js";import"./chunk.VNBR4DHD.js";import"./chunk.Z3ZKYSPN.js";import{e as Ee}from"./chunk.6ONRWFA6.js";import"./chunk.HJCQ6I3S.js";import"./chunk.GZ3IXNA4.js";import{e as ne}from"./chunk.FMVWXSQ7.js";import"./chunk.IM7LXLIB.js";import{a as xe}from"./chunk.7RSZMIAL.js";import"./chunk.ROGYDMES.js";import"./chunk.6IHXTT6Z.js";import"./chunk.YXH3IWNR.js";import"./chunk.OEF3GPRM.js";import"./chunk.BRHRAVU2.js";import{m as Pe}from"./chunk.VTWFVPKD.js";import{a as Te,b as Oe}from"./chunk.ZRQI5VJF.js";import{h as $e}from"./chunk.33GN2NUT.js";import{e as Re,f as De}from"./chunk.2VIGF4FO.js";import{a as Se,b as Ne,j as Ae}from"./chunk.67WL7BGF.js";import"./chunk.G4JJXA63.js";import"./chunk.5MSO3KRO.js";import"./chunk.QYRPELLU.js";import"./chunk.FTJBW25J.js";import"./chunk.UT6642FC.js";import"./chunk.MCVY6RRS.js";import"./chunk.RZVZG2BQ.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.XHWL7QBF.js";import"./chunk.6UCRL4OF.js";import"./chunk.V2NBJDAX.js";import"./chunk.WVUJXDXZ.js";import"./chunk.2EJAIT33.js";import{a as ye}from"./chunk.EUGWV3S6.js";import"./chunk.6XJP7F3I.js";import"./chunk.NPX7SPXM.js";import"./chunk.OE4QOBJF.js";import"./chunk.74RMHUCX.js";import"./chunk.GZHZLJBF.js";import{r as ke}from"./chunk.I3SQJ2L2.js";import"./chunk.OJGHDWI6.js";import"./chunk.FUJM7GDV.js";import{g as be}from"./chunk.MWZK3HVG.js";import{d as te}from"./chunk.3D5T3XIE.js";import{c as me}from"./chunk.GR5Q4HTW.js";import{C as Ce,r as J}from"./chunk.QT4XGC5Z.js";import{$ as V,H as tt,S as we,U as ve,ba as X,k as ge,ka as he,m as ue,n as fe,s as U,ta as ee,ua as Y}from"./chunk.MQ7FNHXG.js";import{H as se,N as de,T as D,Ta as Z,ba as G,ea as le,ga as pe,ia as ce}from"./chunk.WLPTY4BF.js";import{b as Q}from"./chunk.AJZBJBMO.js";var f=Q(tt(),1);var nt=300,it=14,z=50,at=3,ot=2;function _e(e,n,o){let p=e.tryDefinition(n)?.fields?.shape;return(p?.[o]===void 0?void 0:ye(p[o]))?.type}var rt=(e,n)=>Object.keys(e.tryDefinition(n)?.fields?.shape??{}),st=e=>e==="date"||e==="datetime",Ge=/^(due|dueOn|dueAt|dueDate|deadline|by)$/i,dt=/^(date|on|day|when|at|start|starts|startsOn|startsAt|begins|from|sown|scheduled|scheduledFor|planned|plannedFor)$/i,lt=/^(done|finished|complete|completed|closed)$/i;function ae(e,n){let o=e.tryDefinition(n),p=rt(e,n),a=p.filter(u=>st(_e(e,n,u)));if(a.length===0)return;let i=o?.fieldRoles??{},s=u=>i[u]!==void 0&&a.includes(i[u])?i[u]:void 0,c=s("start")??s("when")??a.find(u=>Ge.test(u))??a.find(u=>dt.test(u));if(!c)return;let S=s("end")??a.find(u=>u!==c&&/^(end|ends|until|to|finish|finished|harvested|through)$/i.test(u)),g=p.find(u=>lt.test(u)&&_e(e,n,u)==="boolean");return{field:c,due:Ge.test(c),...S?{end:S}:{},...g?{done:g}:{}}}function ie(e,n){return Math.round((Date.parse(`${n.slice(0,10)}T00:00:00Z`)-Date.parse(`${e.slice(0,10)}T00:00:00Z`))/864e5)}var q=e=>typeof e=="string"&&/^\d{4}-\d{2}-\d{2}/.test(e)?e.slice(0,10):void 0;function je(e,n,o,p){let a=ne(e,n);if(a&&o.length>0&&o.length<=nt)return{shape:"board",field:a.field};let i=ae(e,n);if(i&&!i.due){let s=r=>{let y=q(r[i.field]),h=q(Z(r,i.field,p));return y&&h?ie(y,h):0},c=o.map(r=>({from:q(Z(r,i.field,p)),to:i.end&&q(r[i.end])?L(q(r[i.end]),s(r)):void 0})).filter(r=>r.from!==void 0).map(r=>({from:r.from,to:r.to&&r.to>r.from?r.to:r.from})),S=`${p.slice(0,7)}-01`,g=L(`${L(S,31).slice(0,7)}-01`,-1),u=c.filter(r=>r.from<=g&&r.to>=S),w=c.map(r=>ie(r.from,r.to)).sort((r,y)=>r-y),l=w[Math.floor(w.length/2)]??0;if(u.length>0&&l<=it){let r=L(p,-((new Date(`${p}T00:00:00Z`).getUTCDay()+6)%7)),y=L(r,6),h=u.every(m=>m.from>=r&&m.to<=y);return{shape:"calendar",start:i.field,...i.end?{end:i.end}:{},...i.done?{done:i.done}:{},range:h?"week":"month"}}}return{shape:"table"}}function ze(e,n){let o=ae(e,n);return o?{by:o.field,direction:o.due?"asc":"desc"}:void 0}function He(e,n,o={}){switch(n.shape){case"board":return{lens:"columns",kind:e,column:n.field};case"calendar":return{lens:"calendar",kind:e,start:n.start,...n.end?{end:n.end}:{},...n.done?{done:n.done}:{},range:n.range};case"table":return{lens:"blocks",kind:e,as:"row",...o.group?.by?{group:o.group.by}:{},...o.sort?{sort:{by:o.sort.by,...o.sort.direction==="desc"?{direction:"desc"}:{}}}:{}}}}var pt=60;function We(e,n,o,p){let a=e.tryDefinition(n),i=o.slice(0,pt),s=new Map;i.forEach(w=>{let l=G(a,w);te(w,a,{glance:!0,said:[l]}).forEach((r,y)=>{if(r.long||r.files||r.app)return;let h=s.get(r.key);h?h.count++:s.set(r.key,{label:r.label,count:1,at:y})})});let c=Math.max(1,Math.ceil(i.length/3)),S=[...s.entries()].filter(([,w])=>w.count>=c).sort((w,l)=>w[1].at-l[1].at).slice(0,at).map(([w,l])=>({about:"field",key:w,label:l.label})),g=new Map;for(let w of i){let l=new Set;for(let[r,y]of[["out",p.outEdges(w.id)],["in",p.inEdges(w.id)]])for(let h of y){let m=p.getNode(r==="out"?h.to:h.from);if(!m||m.id===w.id)continue;let b=`${h.kind}|${r}`;if(l.has(b))continue;l.add(b);let A=g.get(b);A?A.count++:g.set(b,{edge:h.kind,direction:r,far:m.kind,count:1})}}let u=[...g.entries()].sort((w,l)=>l[1].count-w[1].count).slice(0,ot).map(([w,l])=>{let r=me(e,l.direction==="out"?n:l.far,l.edge,l.direction);return{about:"edge",key:w,label:r.charAt(0).toUpperCase()+r.slice(1),edge:l.edge,direction:l.direction}});return[...S,...u]}function Ze(e,n,o,p){if(o.about==="field"){let s=e.tryDefinition(n.kind);return{text:te(n,s,{excerpt:!0}).find(S=>S.key===o.key)?.value??""}}let i=(o.direction==="out"?p.outEdges(n.id):p.inEdges(n.id)).filter(s=>s.kind===o.edge).map(s=>p.getNode(o.direction==="out"?s.to:s.from)).filter(s=>s!==void 0).map(s=>G(e.tryDefinition(s.kind),s));return i.length===0?{text:""}:i.length===1?{text:i[0]}:{text:`${i[0]} +${i.length-1}`,title:i.join(", ")}}function Ue(e,n,o=()=>{}){let p=new Map;for(let a of e){let i=a.nodeIds.filter(c=>n.has(c));if(i.length===0&&!(a.subjectId!==void 0&&n.has(a.subjectId)))continue;let s=p.get(a.invariant)??{invariant:a.invariant,label:o(a.invariant)||a.label||a.message,violations:[],records:new Set};s.violations.push(a);for(let c of i)s.records.add(c);a.subjectId!==void 0&&n.has(a.subjectId)&&s.records.add(a.subjectId),p.set(a.invariant,s)}return[...p.values()].sort((a,i)=>i.violations.length-a.violations.length).map(a=>({invariant:a.invariant,label:a.label,violations:a.violations,records:[...a.records]}))}var Ye=6;function Je(e,n,o,p){let a=ae(e,n);if(!a)return;let i=ne(e,n),s=g=>{if(a.done!==void 0&&g[a.done]===!0)return!0;if(!i)return!1;let u=i.values.indexOf(String(g[i.field]));return u>=0&&i.tiers[u]==="done"},c=0,S=0;for(let g of o){let u=q(Z(g,a.field,p));if(!u||s(g))continue;let w=ie(p,u);a.due&&w<0?c++:w>=0&&w<=Ye&&S++}if(!(c===0&&S===0))return{field:a.field,due:a.due,overdue:c,soon:S}}function L(e,n){return new Date(Date.parse(`${e.slice(0,10)}T00:00:00Z`)+n*864e5).toISOString().slice(0,10)}function oe(e,n,o){return n==="overdue"?[{key:e.field,value:`before:${o}`}]:[{key:e.field,value:`after:${L(o,-1)}`},{key:e.field,value:`before:${L(o,Ye+1)}`}]}function Qe(e,n,o,p){let a=new Set,i=new Set;for(let s of e)if(!(s.at<=o))for(let c of s.primitives)c.op==="add-node"&&c.node?.kind===n?a.add(c.node.id):c.op==="patch-node"&&c.id!==void 0&&p(c.id)===n&&i.add(c.id);for(let s of a)i.delete(s);return{added:[...a].filter(s=>p(s)===n).length,changed:[...i].filter(s=>p(s)===n).length}}var t=Q(we(),1),Xe="as",ct=(e,n)=>`graview:kind-seen:${e}:${n}`;function gt(e){try{return localStorage.getItem(e)}catch{return null}}function ut(e,n){try{localStorage.setItem(e,n)}catch{}}var ft=(e,n)=>({...ge(fe(e,!1),n),relation:null});function Jt({kind:e,members:n,flagged:o=[],label:p,retired:a=0}){let{store:i,brand:s,principal:c,views:S,view:g}=V(),{go:u}=Y(),w=X(),l=i.schema,r=l.tryDefinition(e),y=p??pe(l,e),h=i.today()??se(),m=n,b=(0,f.useId)(),A=(0,f.useMemo)(()=>je(l,e,m,h),[l,e,m,h]),x=g.within?.[Xe]==="table"?{shape:"table"}:A,k=Te(g),C=x.shape==="table"&&!k.sort?ze(l,e):void 0,v=C?{...k,sort:C}:k,R=(0,f.useMemo)(()=>new Set(o),[o]),T=(0,f.useMemo)(()=>$e(m,v,{schema:l,graph:i.graph,flagged:R,today:h}),[m,v,l,i,R,h,w]),I=(0,f.useMemo)(()=>De(l,Re(l,e)),[l,e]),M=S.arrangement?.()?.lists?.[e]?.filters,K=$=>u(Oe(g,$)),B=(0,f.useMemo)(()=>({name:s?.name??"app",schema:l,...i.policy?{policy:i.policy}:{}}),[s,l,i]),H=JSON.stringify(He(e,x,v)),P=(0,f.useMemo)(()=>{let $=Ae(JSON.parse(H),{app:B,sight:Ne(B,c)});return Se($)?void 0:$},[H,B,c]),W=x.shape!=="table"&&P!==void 0;return(0,t.jsxs)("section",{"aria-labelledby":b,className:"graview-kind-stop","data-testid":"kind-stop","data-graview-kind-stop":e,"data-graview-shape":x.shape,children:[(0,t.jsx)("style",{children:St}),(0,t.jsx)(wt,{kind:e,plural:y,count:m.length,headingId:b,description:r?.description}),(0,t.jsx)(ht,{kind:e,plural:y,members:m,today:h,arrangement:v,onArrange:K}),(m.length>1||a>0)&&!W?(0,t.jsx)(Pe,{schema:l,graph:i.graph,kind:e,arrangement:v,onChange:K,offers:I,...M?{filters:M}:{},kept:{shown:T.nodes.length,of:m.length},testId:"kind-arrange",chips:{nodes:m,flagged:R,today:h},...a>0?{past:{count:a,widen:()=>u(Ee(g,!0))}}:{}}):null,m.length>0?(0,t.jsx)(yt,{derived:A,shape:x,draft:P}):null,(0,t.jsx)("div",{className:"graview-kind-stop-body","data-testid":"kind-stop-body",children:m.length===0?(0,t.jsx)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-empty",children:"Nothing here yet."}):W?(0,t.jsx)(kt,{draft:P,nodes:m}):T.nodes.length===0?(0,t.jsxs)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-none-kept",children:["None of the ",D(m.length)," ",y.toLowerCase()," ",v.query?`says \u201C${v.query}\u201D`:"is kept by these filters","."," ",(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link",onClick:()=>K({}),children:"Show them all"})]}):(0,t.jsx)(xt,{kind:e,nodes:T.nodes,groups:T.grouped?T.groups.map($=>({key:$.key,label:$.label,nodes:$.nodes})):void 0,flagged:R,plural:y,arrangement:v})})]})}function wt({kind:e,plural:n,count:o,headingId:p,description:a}){let{store:i,setSelection:s,setMenuAt:c}=V(),S=(0,f.useMemo)(()=>({about:[U(e)]}),[e]),{affordances:g}=Me(S),{apply:u,preview:w}=Le(),l=(0,f.useMemo)(()=>{let x=k=>i.allMutations().find(C=>C.name===k.mutation)?.creates?.includes(e)??!1;return g.find(k=>!k.destructive&&!k.setsAside&&x(k))},[g,i,e]),[r,y]=(0,f.useState)(!1),[h,m]=(0,f.useState)(null),b=(0,f.useRef)(null),A=(0,f.useRef)(null);(0,f.useEffect)(()=>{let x=A.current;!x||x.closest('[data-testid="kind-stop"]')?.contains(document.activeElement)||x.focus({preventScroll:!0})},[e]);let O=(x,k)=>{try{w(x,k),u(x,k),m(null),y(!1),requestAnimationFrame(()=>b.current?.focus())}catch(C){return m(be(i.schema,i.allMutations(),C)),[]}};return(0,t.jsxs)("header",{className:"graview-kind-stop-head",children:[(0,t.jsxs)("div",{className:"graview-kind-stop-title",children:[(0,t.jsx)("h2",{id:p,ref:A,tabIndex:-1,"data-testid":"kind-stop-title",children:n}),(0,t.jsxs)("p",{"data-testid":"kind-stop-count",children:[le(i.schema,e,o),a?` \xB7 ${a}`:""]})]}),(0,t.jsxs)("div",{className:"graview-kind-stop-acts",children:[l?(0,t.jsx)("button",{ref:b,type:"button",className:"graview-kind-stop-primary","data-testid":"kind-stop-primary","data-affordance":l.id,"aria-expanded":l.open.length>0?r:void 0,onClick:()=>{m(null),l.open.length===0?O(l):y(x=>!x)},children:l.label}):null,(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-quiet","data-testid":"kind-stop-acts","aria-haspopup":"menu","aria-label":`What can be done with the ${n.toLowerCase()}`,onClick:x=>{let k=x.currentTarget.getBoundingClientRect();s([U(e)]),c({x:Math.round(k.left),y:Math.round(k.bottom+4),on:U(e)})},children:"Acts\u2026"})]}),r&&l?(0,t.jsx)("div",{className:"graview-kind-stop-ask","data-testid":"kind-stop-ask","aria-label":l.label,role:"group",children:(0,t.jsx)(xe,{affordance:l,onApply:x=>O(l,x),onCancel:()=>{y(!1),b.current?.focus()}})}):null,h?(0,t.jsx)("p",{role:"alert",className:"graview-kind-stop-failed","data-testid":"kind-stop-failed",children:h}):null]})}var vt=J.part((e,n)=>(0,t.jsx)(e.ProblemRows,{...n}),{what:"The problems",as:"li"});function ht({kind:e,plural:n,members:o,today:p,arrangement:a,onArrange:i}){let{store:s,brand:c,setSelection:S}=V(),g=s.schema,u=ee(),w=(0,f.useMemo)(()=>new Set(o.map(v=>v.id)),[o]),l=(0,f.useMemo)(()=>Ue(u,w,v=>s.allInvariants().find(R=>R.name===v)?.label),[u,w,s]),r=(0,f.useMemo)(()=>Je(g,e,o,p),[g,e,o,p]),y=ct(Ce(c,g),e),[h]=(0,f.useState)(()=>gt(y));(0,f.useEffect)(()=>()=>ut(y,new Date().toISOString()),[y]);let m=X(),b=(0,f.useMemo)(()=>h?Qe(s.log.all(),e,h,v=>s.graph.getNode(v)?.kind):null,[h,s,e,m]),[A,O]=(0,f.useState)(null),x=v=>i({...a,filter:[...(a.filter??[]).filter(R=>!v?.some(T=>T.key===R.key)),...v??[]]}),k=l.reduce((v,R)=>v+R.violations.length,0),C=[];if(r&&(r.overdue>0||r.soon>0)){let v=r.field;C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-dates",children:[r.overdue>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact","data-tone":"warn",onClick:()=>x(oe(r,"overdue",p)),"aria-label":`${D(r.overdue)} overdue \u2014 show only these`,children:[D(r.overdue)," overdue"]}):null,r.soon>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact",onClick:()=>x(oe(r,"soon",p)),"aria-label":`${D(r.soon)} in the next 7 days \u2014 show only these`,children:[D(r.soon)," ",r.due?"due":""," in the next 7 days"]}):null,(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" by ",ce(g.tryDefinition(e),v).toLowerCase()]})]},"dates"))}if(l.length>0&&C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-problems","data-graview-problems":k,children:[(0,t.jsxs)("span",{className:"graview-kind-stop-warn",children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0 "}),k===1?"1 problem":`${D(k)} problems`]}),(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" in ",n.toLowerCase(),":"]}),(0,t.jsx)("ul",{className:"graview-kind-stop-rules",children:l.map(v=>(0,t.jsx)(mt,{group:v,open:A===v.invariant,onToggle:()=>O(R=>R===v.invariant?null:v.invariant),onPick:R=>S([R])},v.invariant))}),(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-only-problems",onClick:()=>x([{key:"is",value:"flagged"}]),children:["Show only the ",n.toLowerCase()," with a problem"]})]},"problems")),b&&(b.added>0||b.changed>0)){let v=[b.added>0?`${D(b.added)} added`:"",b.changed>0?`${D(b.changed)} changed`:""].filter(Boolean);C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-since",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["Since you last looked (",de(h.slice(0,10)),"):"]})," ",v.join(", ")]},"since"))}return C.length===0?null:(0,t.jsx)("ul",{className:"graview-kind-stop-going-on","aria-label":`What is going on in the ${n.toLowerCase()}`,"data-testid":"kind-stop-going-on",children:C})}function mt({group:e,open:n,onToggle:o,onPick:p}){let a=(0,f.useId)();return(0,t.jsxs)("li",{"data-graview-rule":e.invariant,children:[(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-rule","aria-expanded":n,"aria-controls":a,onClick:o,onPointerEnter:J.prefetch,onFocus:J.prefetch,children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"graview-kind-stop-chevron","data-open":n||void 0,children:"\u203A"}),e.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(e.violations.length)]})]}),n?(0,t.jsx)("ol",{id:a,className:"graview-kind-stop-problem-rows","data-testid":"kind-stop-problem-rows",children:(0,t.jsx)(f.Suspense,{fallback:null,children:(0,t.jsx)(vt,{violations:e.violations,pick:i=>{let s=i.subjectId??e.records[0]??i.nodeIds[0];s!==void 0&&p(s)}})})}):null]})}var bt={board:"Board",calendar:"Calendar",table:"Table"};function yt({derived:e,shape:n,draft:o}){let{view:p}=V(),{go:a}=Y(),{keep:i}=qe(Be()),[s,c]=(0,f.useState)(!1),S=e.shape==="table"?[]:[e.shape,"table"];return(0,t.jsxs)("div",{className:"graview-kind-stop-shape","data-testid":"kind-stop-shape",children:[S.length>0?(0,t.jsx)("span",{role:"group","aria-label":"Show as",className:"graview-kind-stop-switch",children:S.map(g=>(0,t.jsx)("button",{type:"button","aria-pressed":n.shape===g,"data-testid":`kind-stop-as-${g}`,onClick:()=>a(ue(p,Xe,g===e.shape?null:g)),children:bt[g]},g))}):null,(0,t.jsx)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-derived",children:o?`${o.said.replace(/\.$/,"")}, derived from the declaration`:"Derived from the declaration"}),o?(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-keep",disabled:s,title:`Keep \u201C${o.title}\u201D as a lens: a place of its own`,onClick:()=>{c(!0),i(o).finally(()=>c(!1))},children:"Keep as a lens"}):null]})}function kt({draft:e,nodes:n}){let o=Ve(e.drawn);return(0,t.jsx)("div",{className:"graview-kind-stop-lens","data-graview-draft":e.lens.name,children:(0,t.jsx)(ve,{mode:"scene",children:(0,t.jsx)(ke,{kind:e.kind,view:e.title,children:(0,t.jsx)(o,{nodes:n,label:e.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})})}function xt({kind:e,nodes:n,groups:o,flagged:p,plural:a,arrangement:i}){let{store:s,views:c,view:S,selection:g,setSelection:u,setMenuAt:w,principal:l}=V(),{go:r}=Y(),y=s.schema,h=s.graph,m=(0,f.useMemo)(()=>(o?o.flatMap(d=>d.nodes):n).map(d=>d.id),[n,o]),b=Ie(m),A=(0,f.useMemo)(()=>s.permittedMutations(l).some(d=>{let N=d.subject?.kinds;return N!==void 0&&(N==="*"||N.includes(e))}),[s,l,e]),O=(0,f.useRef)(null),x=d=>{b.choose(d),requestAnimationFrame(()=>{let N=b.list.current;((d[0]===void 0?null:N?.querySelector(`[data-graview-choose-box="${CSS.escape(d[0])}"]`))??N)?.focus({preventScroll:!0})})},k=b.chosen.length,C=c.lookup(e,{cardinality:"one",fidelity:"glyph"}),v=C!==void 0&&!he(C)?C:void 0,R=d=>g.includes(d),T=ee(),I=(0,f.useMemo)(()=>We(y,e,n,h),[y,e,n,h]),[M,K]=(0,f.useState)(z);(0,f.useEffect)(()=>K(z),[i.query,i.filter?.length,i.sort?.by,i.group?.by]);let B=y.tryDefinition(e),H=d=>T.filter(N=>N.nodeIds.includes(d)||N.subjectId===d).map(N=>N.message),P=i.sort?.by,W=`${a}${i.sort?`, in order of ${I.find(d=>d.key===P)?.label.toLowerCase()??P}`:""}`,$=M,et=d=>{let N=G(B,d),F=p.has(d.id)?H(d.id):[];return(0,t.jsxs)("tr",{"data-graview-pick":d.id,tabIndex:-1,"data-graview-record":d.id,"data-flagged":F.length>0||void 0,...A?{"data-graview-choose":d.id}:{},children:[A?(0,t.jsx)("td",{className:"graview-choose-at",children:(0,t.jsx)("input",{...b.boxProps(d.id,N),onPointerEnter:j,onFocus:j})}):null,(0,t.jsxs)("th",{scope:"row",className:"graview-kind-stop-name",children:[v?(0,t.jsx)("div",{"data-graview-pick":d.id,className:"graview-kind-stop-own-row",children:(0,t.jsx)(v,{node:d,cardinality:"one",fidelity:"glyph",mode:"scene",selected:R(d.id),...F.length>0?{flagged:[d.id]}:{}})}):(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-go",title:`Go to ${N}`,onClick:()=>r(ft(S,d.id)),children:N}),F.length>0?(0,t.jsxs)("span",{className:"graview-kind-stop-flag",title:F.join(" \xB7 "),children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0"}),(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:`Problem: ${F.join(". ")}`})]}):null]}),I.map(_=>{let E=Ze(y,d,_,h);return(0,t.jsx)("td",{"data-label":_.label,"data-short":E.text.length>0&&E.text.length<=14||void 0,"data-empty":E.text?void 0:"",...E.title?{title:E.title}:{},children:E.text?(0,t.jsx)("span",{children:E.text}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{"aria-hidden":"true",children:"\u2014"}),(0,t.jsx)("i",{className:"graview-kind-stop-hidden",children:"none"})]})},_.key)}),(0,t.jsx)("td",{className:"graview-kind-stop-row-acts",children:(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-acts","aria-haspopup":"menu","aria-label":`What can be done with ${N}`,onClick:_=>{let E=_.currentTarget.getBoundingClientRect();u([d.id]),w({x:Math.round(E.left),y:Math.round(E.bottom+4),on:d.id})},children:(0,t.jsx)("span",{"aria-hidden":"true",children:"\u22EF"})})})]},d.id)},re=d=>{let N=d.slice(0,Math.max(0,$));return $-=N.length,N.map(et)};return(0,t.jsxs)("div",{className:"graview-kind-stop-table-at",...A?{...b.listProps,ref:d=>{O.current=d,b.list.current=d},tabIndex:-1,role:"group","aria-label":k>0?`${a}, ${k} chosen`:a,"data-graview-choosable":""}:{},children:[A?(0,t.jsx)("style",{children:Ke}):null,(0,t.jsxs)("table",{className:"graview-kind-stop-table","data-testid":"kind-stop-table",children:[(0,t.jsx)("caption",{className:"graview-kind-stop-hidden",children:W}),(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[A?(0,t.jsx)("td",{className:"graview-choose-at graview-choose-all",children:(0,t.jsx)("input",{type:"checkbox",className:"graview-choose-box","data-testid":"kind-stop-choose-all","aria-label":`Choose all ${D(n.length)} ${a.toLowerCase()}`,checked:k>0&&k===n.length,ref:d=>{d&&(d.indeterminate=k>0&&k<n.length)},onPointerEnter:j,onFocus:j,onChange:()=>k===n.length?b.clear():b.choose(m)})}):null,(0,t.jsx)("th",{scope:"col","aria-sort":P==="label"?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:"Name"}),I.map(d=>(0,t.jsx)("th",{scope:"col","aria-sort":d.about==="field"&&d.key===P?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:d.label},d.key)),(0,t.jsx)("th",{scope:"col",children:(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:"Acts"})})]})}),o?o.map(d=>$<=0?null:(0,t.jsxs)("tbody",{"data-graview-group":d.key,children:[(0,t.jsx)("tr",{className:"graview-kind-stop-group",children:(0,t.jsxs)("th",{scope:"rowgroup",colSpan:I.length+(A?3:2),children:[d.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(d.nodes.length)]})]})}),re(d.nodes)]},d.key||"-")):(0,t.jsx)("tbody",{children:re(n)})]}),A?(0,t.jsx)(Fe,{store:s,chosen:b.chosen,principal:l,anchor:()=>O.current?.closest('[data-testid="kind-stop"]')??null,of:m.length,onChooseAll:()=>b.choose(m),onClear:b.clear,onActed:x}):null,n.length>M?(0,t.jsxs)("p",{className:"graview-kind-stop-more",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-shown",children:[D(M)," of ",D(n.length)," shown"]})," ",(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-more",onClick:()=>K(d=>d+z),children:["Show ",D(Math.min(z,n.length-M))," more"]})]}):null]})}var St=`
|
|
2
|
-
.graview-kind-stop{container-type:inline-size;box-sizing:border-box;height:100%;min-height:0;display:flex;flex-direction:column;gap:10px;padding:16px 18px 12px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius,12px);background:var(--graview-panel);color:var(--graview-ink);box-shadow:var(--graview-lift-low);overflow:auto;overscroll-behavior:contain}
|
|
3
|
-
[data-graview-map-panel] .graview-kind-stop{height:auto;padding:4px 6px 12px;border:0;box-shadow:none;background:none;overflow:visible}
|
|
4
|
-
.graview-kind-stop :focus-visible{outline:2px solid var(--graview-accent);outline-offset:2px}
|
|
5
|
-
.graview-kind-stop button{font:inherit;cursor:pointer}
|
|
6
|
-
.graview-kind-stop :is(.graview-kind-stop-link,.graview-kind-stop-rule,.graview-kind-stop-name button,.graview-kind-stop-row-acts button,.graview-kind-stop-fact,.graview-kind-stop-switch button){box-shadow:none}
|
|
7
|
-
.graview-kind-stop-head{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px 16px}
|
|
8
|
-
.graview-kind-stop-title{flex:1 1 16rem;min-width:0}
|
|
9
|
-
.graview-kind-stop-title h2{margin:0;outline-offset:2px;font-size:var(--graview-text-heading);line-height:1.3;overflow-wrap:anywhere}
|
|
10
|
-
.graview-kind-stop-title p{margin:2px 0 0;font-size:.875rem;color:var(--graview-ink-muted);overflow-wrap:anywhere}
|
|
11
|
-
.graview-kind-stop-acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
|
|
12
|
-
.graview-kind-stop-primary,.graview-kind-stop-quiet{min-height:32px;padding:0 14px;border-radius:8px;font-size:.875rem}
|
|
13
|
-
.graview-kind-stop-primary{border:1px solid var(--graview-accent);background:var(--graview-accent);color:var(--graview-accent-ink);font-weight:600}
|
|
14
|
-
.graview-kind-stop-quiet{border:1px solid var(--graview-edge);background:transparent;color:var(--graview-ink)}
|
|
15
|
-
.graview-kind-stop-ask{flex:1 1 100%;min-width:0;padding:10px 12px;border:1px solid var(--graview-edge);border-radius:10px}
|
|
16
|
-
.graview-kind-stop-failed{flex:1 1 100%;margin:0;font-size:var(--graview-text-small);color:var(--graview-warn)}
|
|
17
|
-
.graview-kind-stop-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
|
|
18
|
-
.graview-kind-stop-going-on{list-style:none;margin:0;padding:0;display:grid;gap:6px;font-size:.875rem}
|
|
19
|
-
.graview-kind-stop-going-on>li{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;min-width:0}
|
|
20
|
-
.graview-kind-stop-fact{min-height:28px;padding:0 10px;border:1px solid var(--graview-edge);border-radius:999px;background:transparent;color:var(--graview-ink)}
|
|
21
|
-
.graview-kind-stop-fact[data-tone=warn],.graview-kind-stop-warn{color:var(--graview-warn);font-weight:600}
|
|
22
|
-
.graview-kind-stop-quiet-text{color:var(--graview-ink-muted)}
|
|
23
|
-
.graview-kind-stop-rules{list-style:none;margin:0;padding:0;flex:1 1 100%;display:grid;gap:2px}
|
|
24
|
-
.graview-kind-stop-rule{display:inline-flex;align-items:center;gap:6px;min-height:28px;max-width:100%;padding:0 6px;border:1px solid transparent;border-radius:7px;background:none;color:var(--graview-ink);text-align:left;overflow-wrap:anywhere}
|
|
25
|
-
.graview-kind-stop-rule:hover{border-color:var(--graview-edge)}
|
|
26
|
-
.graview-kind-stop-chevron{display:inline-block;width:.8em}
|
|
27
|
-
.graview-kind-stop-chevron[data-open]{transform:rotate(90deg)}
|
|
28
|
-
.graview-kind-stop-problem-rows{list-style:none;margin:2px 0 6px 18px;padding:0;max-width:44rem}
|
|
29
|
-
.graview-kind-stop-link{min-height:28px;padding:0 4px;border:0;background:none;color:var(--graview-accent);text-decoration:underline;text-underline-offset:2px}
|
|
30
|
-
.graview-kind-stop-link:disabled{opacity:.6;cursor:default}
|
|
31
|
-
.graview-kind-stop-shape{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;font-size:var(--graview-text-small)}
|
|
32
|
-
.graview-kind-stop-switch{display:inline-flex;border:1px solid var(--graview-edge);border-radius:8px;overflow:hidden}
|
|
33
|
-
.graview-kind-stop-switch button{min-height:28px;padding:0 12px;border:0;background:transparent;color:var(--graview-ink-muted)}
|
|
34
|
-
.graview-kind-stop-switch button+button{border-left:1px solid var(--graview-edge)}
|
|
35
|
-
.graview-kind-stop-switch button[aria-pressed=true]{background:color-mix(in srgb,var(--graview-accent) 16%,transparent);color:var(--graview-ink);font-weight:600}
|
|
36
|
-
.graview-kind-stop-body{flex:1 0 auto;min-width:0}
|
|
37
|
-
.graview-kind-stop-empty{margin:24px 0;color:var(--graview-ink-muted)}
|
|
38
|
-
.graview-kind-stop-lens{min-width:0}
|
|
39
|
-
|
|
40
|
-
.graview-kind-stop-table-at{min-width:0}
|
|
41
|
-
.graview-kind-stop-table{width:100%;border-collapse:collapse;font-size:.875rem}
|
|
42
|
-
.graview-kind-stop-table th,.graview-kind-stop-table td{padding:7px 8px;text-align:left;vertical-align:top;border-top:1px solid var(--graview-edge);overflow-wrap:break-word}
|
|
43
|
-
.graview-kind-stop-table td{color:var(--graview-ink)}
|
|
44
|
-
.graview-kind-stop-table td>span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
|
|
45
|
-
.graview-kind-stop-table td[data-short]{white-space:nowrap;font-variant-numeric:tabular-nums}
|
|
46
|
-
.graview-kind-stop-table thead th{border-top:0;font-size:var(--graview-text-small);font-weight:600;letter-spacing:.04em;color:var(--graview-ink-muted)}
|
|
47
|
-
.graview-kind-stop-name{font-weight:500;min-width:8rem;max-width:22rem}
|
|
48
|
-
.graview-kind-stop-name button{display:inline-block;min-width:24px;min-height:24px;padding:0;border:0;background:none;color:var(--graview-ink);font-weight:500;text-align:left;text-decoration:underline;text-decoration-color:var(--graview-edge);text-underline-offset:3px}
|
|
49
|
-
.graview-kind-stop-name button:hover{text-decoration-color:currentColor}
|
|
50
|
-
.graview-kind-stop-own-row{display:inline-block;max-width:100%;cursor:pointer}
|
|
51
|
-
.graview-kind-stop-flag{margin-left:6px;color:var(--graview-warn)}
|
|
52
|
-
.graview-kind-stop-group th{padding-top:12px;font-weight:600;color:var(--graview-ink)}
|
|
53
|
-
.graview-kind-stop-row-acts{width:1%;white-space:nowrap;text-align:right}
|
|
54
|
-
.graview-kind-stop-row-acts button{min-width:32px;min-height:28px;border:1px solid var(--graview-edge-bright,var(--graview-edge));border-radius:7px;background:none;color:var(--graview-ink);font-size:1.125rem;font-weight:700;line-height:1}
|
|
55
|
-
.graview-kind-stop-row-acts button:hover{background:color-mix(in srgb,var(--graview-ink) 8%,transparent)}
|
|
56
|
-
.graview-kind-stop-table td[data-empty] b{font-weight:400;color:var(--graview-ink-faint)}
|
|
57
|
-
.graview-kind-stop-table tr[data-graview-pick]{cursor:default}
|
|
58
|
-
.graview-kind-stop-more{margin:10px 0 0;font-size:.875rem}
|
|
59
|
-
.graview-kind-stop-table-at[data-graview-choosable]{outline:none}
|
|
60
|
-
[data-graview-choosable]:hover .graview-choose-all .graview-choose-box{opacity:1}
|
|
61
|
-
.graview-kind-stop-table .graview-choose-at{width:1%;padding-right:0;vertical-align:middle}
|
|
62
|
-
@container (max-width: 559px){
|
|
63
|
-
.graview-kind-stop{padding:12px}
|
|
64
|
-
.graview-kind-stop-acts{flex:1 1 100%}
|
|
65
|
-
.graview-kind-stop-primary{flex:1 1 auto}
|
|
66
|
-
.graview-kind-stop-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
|
|
67
|
-
.graview-kind-stop-table,.graview-kind-stop-table tbody,.graview-kind-stop-table tr{display:block}
|
|
68
|
-
.graview-kind-stop-table tr{position:relative;padding:8px 40px 8px 0;border-top:1px solid var(--graview-edge)}
|
|
69
|
-
.graview-kind-stop-table th,.graview-kind-stop-table td{display:block;padding:1px 0;border:0}
|
|
70
|
-
.graview-kind-stop-table td>span{display:inline}
|
|
71
|
-
.graview-kind-stop-table td[data-short]{white-space:normal}
|
|
72
|
-
.graview-kind-stop-table td[data-label]::before{content:attr(data-label) " \xB7 ";color:var(--graview-ink-muted)}
|
|
73
|
-
.graview-kind-stop-row-acts{position:absolute;top:6px;right:0;width:auto}
|
|
74
|
-
.graview-kind-stop-table [data-graview-choose]{padding-left:34px}
|
|
75
|
-
.graview-kind-stop-table td.graview-choose-at{position:absolute;left:0;top:8px;width:auto;padding:0}
|
|
76
|
-
.graview-kind-stop-table thead .graview-choose-at{position:static}
|
|
77
|
-
}
|
|
78
|
-
@media (pointer: coarse){
|
|
79
|
-
.graview-kind-stop-table-at:not([data-graview-choosing]) .graview-choose-at{display:none}
|
|
80
|
-
.graview-kind-stop-table-at:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
|
|
81
|
-
}
|
|
82
|
-
@media (pointer: coarse){
|
|
83
|
-
.graview-kind-stop-primary,.graview-kind-stop-quiet,.graview-kind-stop-fact,.graview-kind-stop-rule,.graview-kind-stop-link,.graview-kind-stop-switch button,.graview-kind-stop-row-acts button{min-height:44px}
|
|
84
|
-
.graview-kind-stop-row-acts button{min-width:44px}
|
|
85
|
-
.graview-kind-stop-name button{min-height:44px}
|
|
86
|
-
}
|
|
87
|
-
@media (prefers-reduced-motion: reduce){.graview-kind-stop *{transition:none!important;animation:none!important}}
|
|
88
|
-
`;export{Jt as KindStop};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as l,K as p,R as k,S as y,c}from"./chunk.WG5NIR23.js";import"./chunk.3ZRHHB7X.js";import"./chunk.UGFDSE37.js";import{b as m}from"./chunk.ZYCNEOAQ.js";import"./chunk.4DEUD66C.js";import"./chunk.LHO7L3CS.js";import"./chunk.YG423NEB.js";import"./chunk.VNBR4DHD.js";import"./chunk.Z3ZKYSPN.js";import"./chunk.6ONRWFA6.js";import"./chunk.AFY35RJP.js";import"./chunk.POHEWJKZ.js";import"./chunk.ROGYDMES.js";import"./chunk.6IHXTT6Z.js";import"./chunk.YXH3IWNR.js";import"./chunk.OEF3GPRM.js";import"./chunk.BRHRAVU2.js";import"./chunk.VTWFVPKD.js";import"./chunk.ZRQI5VJF.js";import"./chunk.33GN2NUT.js";import"./chunk.2VIGF4FO.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.2EJAIT33.js";import"./chunk.EUGWV3S6.js";import"./chunk.6XJP7F3I.js";import"./chunk.NPX7SPXM.js";import"./chunk.OE4QOBJF.js";import"./chunk.74RMHUCX.js";import"./chunk.GZHZLJBF.js";import"./chunk.I3SQJ2L2.js";import"./chunk.OJGHDWI6.js";import"./chunk.FUJM7GDV.js";import"./chunk.MWZK3HVG.js";import"./chunk.3D5T3XIE.js";import"./chunk.GR5Q4HTW.js";import"./chunk.QT4XGC5Z.js";import{H as S,I as s,J as d,S as f,aa as g}from"./chunk.MQ7FNHXG.js";import"./chunk.WLPTY4BF.js";import{b as n}from"./chunk.AJZBJBMO.js";var u=n(S(),1);var t=n(f(),1);function D({context:a}){let r=l(),h=g(),[w]=(0,u.useState)(()=>s(null)),o=d(h?.seatTalk??w),P=()=>{(window.history.state?.idx??0)>0?r(-1):r("/")};return(0,t.jsxs)(k,{context:a,"data-testid":"draft-page",children:[(0,t.jsx)(y,{context:a,...o.draft?{"data-testid":"draft-title"}:{},children:o.draft?o.draft.title:"Nothing drawn"}),o.draft?(0,t.jsx)(m,{page:!0,go:e=>r(e.address),onPick:e=>{let i=a.store.graph.getNode(e);i&&r(c(a.store.schema,i.kind,e))},onDiscard:P}):(0,t.jsxs)("p",{style:{margin:0,color:"var(--graview-ink-muted)"},children:["Ask for a way of seeing \u2014 \u201Ca board of tasks by status\u201D \u2014 and it is drawn here."," ",(0,t.jsx)(p,{to:"/",style:{color:"var(--graview-accent)"},children:"Home \u2192"})]})]})}export{D as DraftPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as O,b}from"./chunk.SGB6IMWN.js";import"./chunk.NPX7SPXM.js";import"./chunk.OE4QOBJF.js";import"./chunk.74RMHUCX.js";import"./chunk.QT4XGC5Z.js";import{$ as S,H as z,S as M}from"./chunk.MQ7FNHXG.js";import{Ac as A}from"./chunk.WLPTY4BF.js";import{b as v}from"./chunk.AJZBJBMO.js";var o=v(z(),1);var t=v(M(),1);function G(i){for(let d of i)for(let[r,s]of Object.entries(d))if(s===!1)return`${r} == true`;return""}var w={margin:0,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"};function j({ask:i,close:d}){let{store:r,principal:s,subscriptions:h,app:f}=S(),c=(0,o.useRef)(null),p=(0,o.useId)(),[n,u]=(0,o.useState)(0),[l,y]=(0,o.useState)(!0),[m,P]=(0,o.useState)(()=>{let e=i.choices.find(g=>g.on==="reaches");if(!e)return"";let a=e.record!==void 0?r.graph.getNode(e.record):void 0;return G(a?[a]:r.graph.nodesOfKind(e.kind).slice(0,5))}),[C,x]=(0,o.useState)(null),[W,k]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=c.current;e&&!e.open&&e.showModal()},[]);let T=()=>{let e=i.returnTo;d(),requestAnimationFrame(()=>{e?.isConnected?e.focus():document.querySelector("[data-graview-page-title], main h1, [data-testid='activity-button']")?.focus()})},N=e=>e.on==="reaches"?{...e,condition:m}:e,E=e=>b(r,{when:N(e),alsoMine:!l}),L=async()=>{let e=N(i.choices[n]),a=O(r,e);if(a){x(a);return}k(!0);try{await h.add({who:A(s),app:f?.name??"app",when:e,...l?{}:{alsoMine:!0}}),T()}catch(g){k(!1),x(g instanceof Error?g.message:String(g))}};return(0,t.jsx)("dialog",{ref:c,"aria-labelledby":p,"data-testid":"notify-sheet",onClose:T,onClick:e=>{e.target===e.currentTarget&&e.currentTarget.close()},style:{width:"min(92vw, 420px)",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,t.jsxs)("form",{method:"dialog",onSubmit:e=>{e.preventDefault(),L()},style:{display:"grid",gap:12,padding:18},children:[(0,t.jsx)("h2",{id:p,style:{margin:0,fontSize:"1.0625rem"},children:"Notify me"}),(0,t.jsxs)("fieldset",{style:{margin:0,padding:0,border:0,display:"grid",gap:6},children:[(0,t.jsx)("legend",{style:{...w,marginBottom:6},children:"Tell me"}),i.choices.map((e,a)=>(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"baseline",cursor:"pointer"},children:[(0,t.jsx)("input",{type:"radio",name:`${p}-when`,checked:n===a,onChange:()=>u(a),"data-notify-choice":e.on}),(0,t.jsx)("span",{children:e.on==="reaches"?`When ${e.record!==void 0?"it":"one"} reaches a condition`:E(e)})]},a))]}),i.choices[n]?.on==="reaches"?(0,t.jsxs)("label",{style:{display:"grid",gap:4},children:[(0,t.jsx)("span",{style:w,children:"The condition, in the app's own words (done == true, amount > 100)"}),(0,t.jsx)("input",{value:m,onChange:e=>P(e.target.value),"data-testid":"notify-condition",autoComplete:"off",spellCheck:!1})]}):null,(0,t.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,t.jsx)("input",{type:"checkbox",checked:l,onChange:e=>y(e.target.checked),"data-testid":"notify-others-only"}),"Only when someone else does it"]}),(0,t.jsxs)("p",{style:w,"data-testid":"notify-said",children:[E(i.choices[n]),"."]}),C?(0,t.jsx)("p",{role:"alert",style:{margin:0,color:"var(--graview-danger, var(--graview-ink))"},children:C}):null,(0,t.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,t.jsx)("button",{type:"button",onClick:()=>c.current?.close(),children:"Cancel"}),(0,t.jsx)("button",{type:"submit",autoFocus:!0,disabled:W,"data-testid":"notify-keep",style:{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"},children:"Notify me"})]})]})})}function B({style:i}){let{store:d,principal:r,subscriptions:s,app:h}=S(),f=(r.onBehalfOf??r).id,[c,p]=(0,o.useState)([]);return(0,o.useEffect)(()=>{if(f===void 0)return;let n=!0,u=()=>void Promise.resolve(s.list(f)).then(y=>n&&p(y.filter(m=>m.app===(h?.name??"app"))),()=>n&&p([]));u();let l=s.onChange?.(u);return()=>{n=!1,l?.()}},[s,f,h]),c.length===0?null:(0,t.jsxs)("section",{"aria-label":"What you are told of","data-testid":"notified",style:{display:"grid",gap:6,...i},children:[(0,t.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"You are told"}),(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:4},children:c.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"baseline",justifyContent:"space-between"},"data-subscription":n.id,children:[(0,t.jsx)("span",{style:{fontSize:"0.8125rem"},children:b(d,n)}),(0,t.jsx)("button",{type:"button","data-testid":"notify-stop","aria-label":`Stop: ${b(d,n)}`,onClick:u=>{let l=u.currentTarget.closest("li"),y=(l?.nextElementSibling??l?.previousElementSibling)?.querySelector("button");Promise.resolve(s.remove(n.id)).then(()=>(y??document.querySelector("[data-testid='activity-button']"))?.focus())},style:{padding:"1px 8px",fontSize:"0.8125rem"},children:"Stop"})]},n.id))})]})}export{B as NotifiedList,j as NotifySheet};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.QT4XGC5Z.js";import{H as K,P as E,Q as j,S as C,aa as W}from"./chunk.MQ7FNHXG.js";import{Q as R,Ua as T,qc as P}from"./chunk.WLPTY4BF.js";import{b as x}from"./chunk.AJZBJBMO.js";function N(a,t){return a.kind==="agent"?"agent":a.kind!=="human"?"app":a.onBehalfOf!==void 0?"person":a.id===void 0||t?.id===void 0||a.id===t.id?"you":"person"}var Y=a=>a.ops.filter(t=>t.withheld!==!0);function z(a,t={}){let r=a.batches().map(e=>{let s=e.ops[0],l=e.ops.at(-1),c=Y(e).length===0;return{seq:l.seq+1,from:s.seq,at:l.at,batch:e.id,maker:c?"person":N(e.author,t.me),author:c?void 0:e.author,said:e.intent,declaration:!1,withheld:c}}),i=[...a.log.epochs().filter(e=>e.change!==void 0).map(e=>({seq:e.seq,sentence:e.change,...e.at?{at:e.at}:{}})),...t.declarations??[]];for(let e of i){if(e.seq<a.log.horizon||e.seq>a.log.length)continue;let s=r.findIndex(l=>l.seq===e.seq);if(s>=0&&!r[s].withheld){r[s]={...r[s],declaration:!0,said:e.sentence};continue}r.push({seq:e.seq,from:e.seq,at:e.at,batch:void 0,maker:e.author?N(e.author,t.me):"app",author:e.author,said:e.sentence,declaration:!0,withheld:!1})}return r.sort((e,s)=>e.seq-s.seq||+(e.batch!==void 0)-+(s.batch!==void 0))}function I(a,t){let r=a.log.all(),i=new Map(r.map(e=>[e.id,e.seq]));return a.batches().filter(e=>!e.undone&&e.ops[0].seq>=t).filter(e=>!e.ops.every(s=>s.undoes!==void 0&&(i.get(s.undoes)??-1)>=t)).map(e=>e.id)}function B(a,t){return a.withheld?"Someone":a.maker==="you"?"you":a.author?T(a.author,t):"the app"}var d=x(K(),1);var o=x(C(),1),_={kind:"human"},G=[1,2,4,8],U=900,q={you:"You",person:"A person",agent:"An agent",app:"The app"},H={you:"var(--graview-accent)",person:"var(--graview-ink-muted)",agent:"var(--graview-activity, var(--graview-good))",app:"var(--graview-edge-bright)"};function X(a,t){return[...new Set([t,...a.map(r=>r.seq)])].sort((r,i)=>r-i)}function J(a,t){let r=0;for(let i=0;i<a.length;i++)a[i]<=t&&(r=i);return r}function Q(a,t,r){let i=I(a,t);if(i.length===0)return null;let e=a.canUndo(i);if(!e.ok)return null;let s=new Set(a.permittedMutations(r).map(l=>l.name));return e.ops.every(l=>l.mutation!==null&&s.has(l.mutation.name))?i:null}function oe({face:a}){let t=E(),r=W(),i=r?.principal??_,e=j(t.live,i),s=e.log.length,l=(0,d.useMemo)(()=>z(e,{me:i,...t.host?.declarations?{declarations:t.host.declarations}:{}}),[e,i,t.host,s]),c=(0,d.useMemo)(()=>X(l,e.log.horizon),[l,e]),f=t.past?.seq??s,h=J(c,f),y=c.length-1,k=[...l].reverse().find(n=>n.seq<=f&&n.seq>(c[h-1]??-1))??[...l].reverse().find(n=>n.seq<=f),[g,v]=(0,d.useState)(!1),[w,L]=(0,d.useState)(1),[A,$]=(0,d.useState)(null);(0,d.useEffect)(()=>{if(!g)return;if(h>=y){v(!1);return}let n=setTimeout(()=>t.show(c[h+1]),U/w);return()=>clearTimeout(n)},[g,h,y,w,c,t]);let D=(0,d.useMemo)(()=>t.past?Q(e,f,i):null,[t.past,e,f,i,s]),M=n=>B(n,{graph:e.graph,schema:e.schema,...r?.seats?{seats:r.seats}:{},...r?.people?{people:r.people}:{}}),u=t.past?t.past.at?R(t.past.at,r?.locale):"the start":null,S=k?`${M(k)==="you"?"You":M(k)}: ${k.said}`:"Nothing had happened yet",O=(0,d.useRef)(null);(0,d.useLayoutEffect)(()=>{let n=O.current,m=n?.parentElement;if(a!=="scene"||!n||!m)return;let p=()=>m.style.setProperty("--graview-sheet",`${Math.ceil(n.getBoundingClientRect().height)+24}px`);p();let b=typeof ResizeObserver>"u"?null:new ResizeObserver(p);return b?.observe(n),()=>{b?.disconnect(),m.style.removeProperty("--graview-sheet")}},[a]);let V=a==="scene"?{position:"absolute",left:"50%",bottom:12,transform:"translateX(-50%)",width:"min(720px, calc(100% - 32px))",zIndex:P("rail")}:{position:"sticky",top:0,zIndex:P("rail"),margin:"0 auto 12px",maxWidth:960,width:"100%"};return(0,o.jsxs)("section",{ref:O,"aria-label":"Timeline","data-testid":"timeline","data-graview-past":t.past?String(t.past.seq):"now","data-graview-offstage":"",style:{...V,boxSizing:"border-box",display:"grid",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",color:"var(--graview-ink)",fontSize:"0.8125rem"},children:[(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 12px"},children:[(0,o.jsx)("strong",{"data-testid":"as-of",role:"status",style:{fontWeight:600},children:u?`As of ${u}`:"Now"}),(0,o.jsx)("span",{"data-testid":"timeline-caption",style:{color:"var(--graview-ink-muted)",minWidth:0,overflowWrap:"anywhere"},children:S}),u?(0,o.jsx)("span",{style:{color:"var(--graview-ink-faint)"},"data-testid":"past-read-only",children:"Nothing changes while you look back."}):null]}),(0,o.jsx)("div",{style:{position:"relative",height:22},"aria-hidden":"true",children:c.slice(1).map((n,m)=>{let p=[...l].reverse().find(F=>F.seq===n),b=y===0?0:(m+1)/y*100;return(0,o.jsx)("span",{"data-graview-tick":n,"data-maker":p.maker,...p.declaration?{"data-declaration":""}:{},title:`${q[p.maker]}: ${p.said}`,style:{position:"absolute",left:`calc(${b}% - 1px)`,bottom:0,width:p.declaration?4:2,height:p.declaration?22:12,borderRadius:2,background:p.declaration?"var(--graview-ink)":H[p.maker],opacity:n<=f?1:.45}},`${n}:${p.batch??"declaration"}`)})}),(0,o.jsx)("input",{type:"range","data-testid":"scrubber","aria-label":"Moment",min:0,max:y,step:1,value:h,"aria-valuetext":u?`As of ${u}. ${S}`:`Now. ${S}`,onChange:n=>{v(!1),t.show(c[Number(n.currentTarget.value)]??s)},style:{width:"100%",margin:0,accentColor:"var(--graview-accent)"}}),(0,o.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,o.jsx)("button",{type:"button","data-testid":"play","aria-pressed":g,onClick:()=>{!g&&h>=y&&t.show(c[0]),v(!g)},style:{minHeight:28,minWidth:64},children:g?"Pause":"Play"}),(0,o.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:6,color:"var(--graview-ink-muted)"},children:["Speed",(0,o.jsx)("select",{"data-testid":"speed",value:w,onChange:n=>L(Number(n.currentTarget.value)),style:{minHeight:28},children:G.map(n=>(0,o.jsxs)("option",{value:n,children:[n,"\xD7"]},n))})]}),(0,o.jsx)("span",{"aria-hidden":"true",style:{display:"inline-flex",gap:10,color:"var(--graview-ink-faint)",flexWrap:"wrap"},children:Object.keys(q).filter(n=>l.some(m=>m.maker===n)).map(n=>(0,o.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[(0,o.jsx)("span",{style:{width:8,height:8,borderRadius:2,background:H[n]}}),q[n]]},n))}),(0,o.jsxs)("span",{style:{marginLeft:"auto",display:"inline-flex",gap:8},children:[D?(0,o.jsx)("button",{type:"button","data-testid":"restore-here",title:"Take back every change since, as one change you can undo",onClick:()=>{$(null);try{e.undo([...D],{author:i,intent:u?`Restore to ${u}`:"Restore"}),t.show(null)}catch(n){$(n instanceof Error?n.message:String(n))}},style:{minHeight:28},children:"Restore to here"}):null,(0,o.jsx)("button",{type:"button","data-testid":"back-to-now",onClick:()=>t.show(null),style:{minHeight:28},children:"Back to now"})]})]}),A?(0,o.jsx)("span",{role:"alert","data-testid":"restore-refused",style:{color:"var(--graview-warn)"},children:A}):null]})}export{oe as Timeline};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as C,e as L,n as H,o as R,p as k}from"./chunk.BUVAMSOZ.js";import"./chunk.FTJBW25J.js";import"./chunk.UT6642FC.js";import"./chunk.MCVY6RRS.js";import"./chunk.RZVZG2BQ.js";import{a as S}from"./chunk.VKHKYK5L.js";import"./chunk.TI4OSTQV.js";import"./chunk.EUGWV3S6.js";import"./chunk.MWZK3HVG.js";import"./chunk.3D5T3XIE.js";import"./chunk.GR5Q4HTW.js";import"./chunk.QT4XGC5Z.js";import{H as T,S as b,ya as E}from"./chunk.MQ7FNHXG.js";import{qc as x}from"./chunk.WLPTY4BF.js";import{b as g}from"./chunk.AJZBJBMO.js";var t=g(T(),1);var c=g(b(),1);function N(n){if(!n||n.interaction.outcome==="failed")return null;let s=n.offers[0],o=s?n.interaction.offered.find(i=>i.id===s.id)?.confidence:void 0;return s&&o!==void 0&&o>=.6?{offer:s,confidence:o}:null}function j({rest:n,hold:s,leave:o}){let i=S(),u=(0,t.useMemo)(()=>C(n.target,e=>i.store.graph.has(e)),[n.target,i.store]),l=u.on==="record"&&L(i.ai)!==void 0,m=l?H(i,u):void 0,p=JSON.stringify(u),[y,I]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(!l||m!==void 0)return;let e=!0;return R(i,u).then(r=>{e&&I({key:p,result:r})}),()=>{e=!1}},[p,l]);let w=m??(y?.key===p?y.result:void 0),f=l?N(w):null,v=f?.offer.id??null,h=(0,t.useRef)(null);if((0,t.useEffect)(()=>{if(v===null)return;let e=r=>{r.target instanceof Node&&h.current?.contains(r.target)||o(!0)};return document.addEventListener("pointerdown",e,{capture:!0,passive:!0}),document.addEventListener("contextmenu",e,{capture:!0,passive:!0}),addEventListener("scroll",e,{capture:!0,passive:!0}),addEventListener("resize",e,{passive:!0}),()=>{document.removeEventListener("pointerdown",e,{capture:!0}),document.removeEventListener("contextmenu",e,{capture:!0}),removeEventListener("scroll",e,{capture:!0}),removeEventListener("resize",e)}},[v,o]),(0,t.useLayoutEffect)(()=>{let e=h.current;if(!e)return;if(typeof e.showPopover=="function"&&!E(e))try{e.showPopover()}catch{}let r=n.element.getBoundingClientRect(),d=e.getBoundingClientRect(),O=r.top-d.height-4>=4?r.top-d.height-4:Math.min(innerHeight-d.height-4,r.top+4),A=Math.max(4,Math.min(innerWidth-d.width-4,r.right-d.width));e.style.top=`${Math.round(O)}px`,e.style.left=`${Math.round(A)}px`},[v,n.element]),!f)return null;let{offer:a,confidence:P}=f,M=a.type==="panel"?"a panel":a.type==="place"?"go there":a.type==="record"?"open it":"suggested";return(0,c.jsxs)("button",{ref:h,type:"button",popover:"manual","data-testid":"hover-chip","data-ai-offer":a.id,"data-ai-offer-type":a.type,"data-graview-overlay":"","data-graview-popover":"","aria-label":`Suggested by AI: ${a.label}`,title:`Suggested by AI, ${Math.round(P*100)}% sure`,onPointerEnter:s,onPointerLeave:()=>o(),onClick:()=>{n.element.closest("[tabindex], a[href], button")?.focus({preventScroll:!0}),o(!0),k(i,w,a)},style:$,children:[(0,c.jsxs)("span",{"aria-hidden":"true",style:{color:"var(--graview-accent)"},children:["\u2726"," "]}),a.label,(0,c.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",M]})]})}var $={position:"fixed",inset:"auto",top:0,left:0,margin:0,zIndex:x("toast"),boxSizing:"border-box",width:"max-content",maxWidth:"min(320px, calc(100vw - 8px))",height:"auto",minHeight:24,padding:"2px 10px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",borderRadius:999,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",boxShadow:"var(--graview-lift-high)",font:"inherit",fontSize:"0.75rem",cursor:"pointer"};export{j as HoverChip};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk.YPY5BOEI.js";import"./chunk.VKHKYK5L.js";import"./chunk.QT4XGC5Z.js";import"./chunk.MQ7FNHXG.js";import"./chunk.WLPTY4BF.js";import"./chunk.AJZBJBMO.js";export{a as ActivityFilter,b as InteractionRow};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{Bc as Dn,Da as In,Dc as Nn,Gc as jn,Ha as ft,I as Vn,Ja as Cn,Ua as _n,Vc as Gn,Wb as Ln,id as Wn,nd as Fe,od as pt,qc as Hn}from"./chunk.WLPTY4BF.js";import{a as We,b as C}from"./chunk.AJZBJBMO.js";var ao=We(w=>{"use strict";var bt=Symbol.for("react.transitional.element"),Ar=Symbol.for("react.portal"),kr=Symbol.for("react.fragment"),Pr=Symbol.for("react.strict_mode"),Rr=Symbol.for("react.profiler"),Tr=Symbol.for("react.consumer"),Mr=Symbol.for("react.context"),Or=Symbol.for("react.forward_ref"),Vr=Symbol.for("react.suspense"),Ir=Symbol.for("react.memo"),to=Symbol.for("react.lazy"),Cr=Symbol.for("react.activity"),Xn=Symbol.iterator;function _r(e){return e===null||typeof e!="object"?null:(e=Xn&&e[Xn]||e["@@iterator"],typeof e=="function"?e:null)}var no={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},oo=Object.assign,ro={};function ge(e,t,n){this.props=e,this.context=t,this.refs=ro,this.updater=n||no}ge.prototype.isReactComponent={};ge.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ge.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function io(){}io.prototype=ge.prototype;function xt(e,t,n){this.props=e,this.context=t,this.refs=ro,this.updater=n||no}var Et=xt.prototype=new io;Et.constructor=xt;oo(Et,ge.prototype);Et.isPureReactComponent=!0;var Jn=Array.isArray;function vt(){}var O={H:null,A:null,T:null,S:null},so=Object.prototype.hasOwnProperty;function At(e,t,n){var o=n.ref;return{$$typeof:bt,type:e,key:t,ref:o!==void 0?o:null,props:n}}function Lr(e,t){return At(e.type,t,e.props)}function kt(e){return typeof e=="object"&&e!==null&&e.$$typeof===bt}function Hr(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Qn=/\/+/g;function wt(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Hr(""+e.key):t.toString(36)}function Dr(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(vt,vt):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function me(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"bigint":case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case bt:case Ar:s=!0;break;case to:return s=e._init,me(s(e._payload),t,n,o,r)}}if(s)return r=r(e),s=o===""?"."+wt(e,0):o,Jn(r)?(n="",s!=null&&(n=s.replace(Qn,"$&/")+"/"),me(r,t,n,"",function(u){return u})):r!=null&&(kt(r)&&(r=Lr(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Qn,"$&/")+"/")+s)),t.push(r)),1;s=0;var d=o===""?".":o+":";if(Jn(e))for(var a=0;a<e.length;a++)o=e[a],i=d+wt(o,a),s+=me(o,t,n,i,r);else if(a=_r(e),typeof a=="function")for(e=a.call(e),a=0;!(o=e.next()).done;)o=o.value,i=d+wt(o,a++),s+=me(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return me(Dr(e),t,n,o,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return s}function Xe(e,t,n){if(e==null)return e;var o=[],r=0;return me(e,o,"","",function(i){return t.call(n,i,r++)}),o}function Nr(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var eo=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},jr={map:Xe,forEach:function(e,t,n){Xe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Xe(e,function(){t++}),t},toArray:function(e){return Xe(e,function(t){return t})||[]},only:function(e){if(!kt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};w.Activity=Cr;w.Children=jr;w.Component=ge;w.Fragment=kr;w.Profiler=Rr;w.PureComponent=xt;w.StrictMode=Pr;w.Suspense=Vr;w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O;w.__COMPILER_RUNTIME={__proto__:null,c:function(e){return O.H.useMemoCache(e)}};w.cache=function(e){return function(){return e.apply(null,arguments)}};w.cacheSignal=function(){return null};w.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=oo({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!so.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(o[i]=t[i]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var s=Array(i),d=0;d<i;d++)s[d]=arguments[d+2];o.children=s}return At(e.type,r,o)};w.createContext=function(e){return e={$$typeof:Mr,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Tr,_context:e},e};w.createElement=function(e,t,n){var o,r={},i=null;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)so.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(r[o]=t[o]);var s=arguments.length-2;if(s===1)r.children=n;else if(1<s){for(var d=Array(s),a=0;a<s;a++)d[a]=arguments[a+2];r.children=d}if(e&&e.defaultProps)for(o in s=e.defaultProps,s)r[o]===void 0&&(r[o]=s[o]);return At(e,i,r)};w.createRef=function(){return{current:null}};w.forwardRef=function(e){return{$$typeof:Or,render:e}};w.isValidElement=kt;w.lazy=function(e){return{$$typeof:to,_payload:{_status:-1,_result:e},_init:Nr}};w.memo=function(e,t){return{$$typeof:Ir,type:e,compare:t===void 0?null:t}};w.startTransition=function(e){var t=O.T,n={};O.T=n;try{var o=e(),r=O.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(vt,eo)}catch(i){eo(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),O.T=t}};w.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()};w.use=function(e){return O.H.use(e)};w.useActionState=function(e,t,n){return O.H.useActionState(e,t,n)};w.useCallback=function(e,t){return O.H.useCallback(e,t)};w.useContext=function(e){return O.H.useContext(e)};w.useDebugValue=function(){};w.useDeferredValue=function(e,t){return O.H.useDeferredValue(e,t)};w.useEffect=function(e,t){return O.H.useEffect(e,t)};w.useEffectEvent=function(e){return O.H.useEffectEvent(e)};w.useId=function(){return O.H.useId()};w.useImperativeHandle=function(e,t,n){return O.H.useImperativeHandle(e,t,n)};w.useInsertionEffect=function(e,t){return O.H.useInsertionEffect(e,t)};w.useLayoutEffect=function(e,t){return O.H.useLayoutEffect(e,t)};w.useMemo=function(e,t){return O.H.useMemo(e,t)};w.useOptimistic=function(e,t){return O.H.useOptimistic(e,t)};w.useReducer=function(e,t,n){return O.H.useReducer(e,t,n)};w.useRef=function(e){return O.H.useRef(e)};w.useState=function(e){return O.H.useState(e)};w.useSyncExternalStore=function(e,t,n){return O.H.useSyncExternalStore(e,t,n)};w.useTransition=function(){return O.H.useTransition()};w.version="19.2.8"});var N=We((gs,lo)=>{"use strict";lo.exports=ao()});var So=We(et=>{"use strict";var Zr=Symbol.for("react.transitional.element"),Xr=Symbol.for("react.fragment");function ho(e,t,n){var o=null;if(n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:Zr,type:e,key:o,ref:t!==void 0?t:null,props:n}}et.Fragment=Xr;et.jsx=ho;et.jsxs=ho});var Ce=We((As,wo)=>{"use strict";wo.exports=So()});function Ke(e){let t,n=!1,o,r,i=0;return()=>{if(n)return Promise.resolve(t);if(o)return o;let s=i>0&&r!==void 0?gr(r):e();i+=1;let d=s.then(a=>(t=a,n=!0,o=void 0,a),a=>{throw o=void 0,r??=hr(a),a});return o=d,d}}var Fn=0;function gr(e){return Fn+=1,import(`${e}${e.includes("?")?"&":"?"}retry=${Fn}`)}function hr(e,t=import.meta.url){let n=e instanceof Error?e.message:typeof e=="string"?e:"",o=/^(?:Failed to fetch|error loading) dynamically imported module: ([a-z]+:\/\/[^\s"'<>]+)/.exec(n)?.[1]?.replace(/[.,;:)\]]+$/,""),r=i=>i.split("/",3).join("/");return o&&r(o)===r(t)?o:void 0}var fe={focusId:null,relation:null,expanded:[],pins:{}},Be=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function te(e){let t=new URLSearchParams;e.focusId&&t.set("focus",e.focusId),e.relation&&t.set("relation",e.relation),e.overview&&t.set("overview","1"),e.zoom&&t.set("zoom","1"),e.past&&t.set("past","1"),e.shown&&e.shown.length>0&&t.set("show",[...e.shown].sort().join(",")),e.selection!==void 0&&e.selection.length>0&&t.set("sel",[...e.selection].sort().join(",")),e.expanded.length>0&&t.set("expand",[...e.expanded].sort().join(","));for(let o of Object.keys(e.pins).sort()){let r=e.pins[o];t.set(`pin.${o}`,`${$e(r.x)},${$e(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${$e(e.pan.x)},${$e(e.pan.y)}`);for(let o of Object.keys(e.within??{}).sort()){let r=e.within[o];r.length>0&&t.set(`in.${o}`,r)}e.q&&e.q.trim().length>0&&t.set("q",e.q);let n=t.toString();return n?`#${n}`:"#"}function Sr(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function qe(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[h,p]of n){if(!h.startsWith("pin."))continue;let[g,b]=p.split(","),A=g===void 0?null:Be(g),m=b===void 0?null:Be(b);A===null||m===null||(o[h.slice(4)]={x:A,y:m})}let r=Object.create(null);for(let[h,p]of n)!h.startsWith("in.")||p.length===0||(r[h.slice(3)]=p);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let s=n.get("pan")?.split(",")??[],d=s[0]===void 0?null:Be(s[0]),a=s[1]===void 0?null:Be(s[1]),u=(n.get("sel")??"").split(",").filter(h=>h.length>0).sort(),f=n.get("overview")==="1";return{...u.length>0?{selection:u}:{},...f?{overview:!0}:{},...n.get("zoom")==="1"?{zoom:!0}:{},...n.get("past")==="1"?{past:!0}:{},...n.get("show")?{shown:[...new Set(n.get("show").split(",").filter(Boolean))].sort()}:{},...d!==null&&a!==null?{pan:{x:d,y:a}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:Sr(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(h=>h.length>0&&(f||!h.startsWith("kind:"))).sort(),pins:o}}function Qi(e){let t=qe(e);return te(t)==="#"?{...t,overview:!0}:t}function es(e){let t=te(e);return t==="#overview=1"?"":t}function $e(e){return Math.round(e*100)/100}function Bn(e,t){return te(e)===te(t)}var Kn="edge:";function $n(e){if(!e.startsWith(Kn))return null;let t=e.slice(Kn.length).split(":");if(t.length!==3)return null;let[n,o,r]=t;if(!n||!o||!r)return null;try{return{kind:decodeURIComponent(n),from:decodeURIComponent(o),to:decodeURIComponent(r)}}catch{return null}}function yt(e){let{pan:t,...n}=e;return{...n,pins:{}}}function $(e,t){if(t===e.focusId)return{...e,focusId:t};let n=yt(e);return{...n.within?.q!==void 0?se(n,"q",null):n,focusId:t}}function qn(e,t){return{...e,relation:t}}function se(e,t,n){let o={...e.within??{}};if(n===null?delete o[t]:o[t]=n,Object.keys(o).length===0){let{within:r,...i}=e;return i}return{...e,within:o}}function pe(e,t){if(t!==e.overview&&(e=yt(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function ze(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function Ve(e,t){if(t!==(e.zoom===!0)&&(e=yt(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function Ue(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var Ze="aggregate:",Ye="kind:";function mt(e){return`${Ye}${e}`}function ye(e){return e.startsWith(Ye)?e.slice(Ye.length):null}var os="kinds:beyond";function wr(e){let t=ye(e);return t?[t]:ae(e)}function ne(...e){return`${Ze}${[...e].sort().join("+")}`}function zn(e){return e.startsWith(Ze)}function ae(e){return!zn(e)||e.includes("|")?[]:e.slice(Ze.length).split("+").filter(Boolean)}function Un(e,t,n={}){let o=ye(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return Ue(e,t);let r=o!==null?ne(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return Ve(e,!1);if(o!==null&&n.carry){let i=pe({...$(e,r),relation:null},!1);return se(Ve(i,!0),"q",n.carry)}return Ve({...$(e,r),relation:null},!0)}function vr(e,t,n){return se(pe($(e,ne(t)),!1),"view",n)}function rs(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Yn="aggregate:";function gt(e){return e.startsWith(Yn)&&e.includes("|")}var ht=e=>e?.off===!0,br=e=>e!==void 0&&!ht(e)&&(e.fast!==void 0||e.thinking!==void 0||e.answer!==void 0||e.decide!==void 0||e.complete!==void 0||e.turn!==void 0),Zn=e=>e!==void 0&&!ht(e)&&(e.fast!==void 0||e.decide!==void 0),xr=e=>e?.suggestOnOpen!==!1&&Zn(e),Er=e=>e?.hoverChips===!0&&Zn(e);var St={};var uo=C(N(),1),Gr={turns:[],outcomes:new Map,busy:!1,pending:null,draft:null,draftNote:null},co=e=>`graview:seat:${e}`;function Wr(e){if(!e)return{};try{let t=sessionStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return{...Array.isArray(n.turns)?{turns:n.turns}:{},...Array.isArray(n.outcomes)?{outcomes:new Map(n.outcomes)}:{},...n.draft?.drawn?{draft:n.draft}:{}}}catch{return{}}}function Fr(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],draft:t.draft}))}catch{}}function Pt(e){let t=e===null?null:co(e),n={...Gr,...Wr(t)},o=new Set,r=(i,s=!0)=>{n=i,s&&Fr(t,n);for(let d of[...o])d()};return{get:()=>n,subscribe(i){return o.add(i),()=>void o.delete(i)},setTurns:i=>r({...n,turns:i(n.turns)}),settle:(i,s)=>r({...n,outcomes:new Map(n.outcomes).set(i,s)}),setBusy:i=>r({...n,busy:i},!1),ask:i=>r({...n,pending:i.trim()||null}),takePending(){let i=n.pending;return i!==null&&r({...n,pending:null},!1),i},setDraft:(i,s=null)=>r({...n,draft:i,draftNote:s})}}function Kr(e){return(0,uo.useSyncExternalStore)(e.subscribe,e.get,e.get)}var po=C(N(),1),Br={entries:[],ghost:null,loaded:!1};function fo(e,t){let n=new Map(e.map(o=>[o.id,o]));for(let o of t)n.set(o.id,{...n.get(o.id),...o});return[...n.values()].sort((o,r)=>o.at<r.at?1:o.at>r.at?-1:0)}function Rt(e){let t=Br,n=new Set,o=r=>{t=r;for(let i of[...n])i()};return{get:()=>t,subscribe:r=>(n.add(r),()=>n.delete(r)),record:r=>{o({...t,entries:fo(t.entries,[r])}),Promise.resolve(e()?.keep?.(r)).catch(i=>{console.warn("The host did not keep an AI interaction:",i)})},setGhost:r=>o({...t,ghost:r}),load:()=>{if(t.loaded)return;o({...t,loaded:!0});let r=e()?.load;r&&Promise.resolve(r()).then(i=>o({...t,entries:fo(t.entries,i)})).catch(i=>{console.warn("The host's AI interactions could not be read:",i)})}}}function $r(e){return(0,po.useSyncExternalStore)(e.subscribe,e.get,e.get)}function yo(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}var Je=C(N(),1),Qe=(0,Je.createContext)(void 0),qr=()=>(0,Je.useContext)(Qe);var k=C(N(),1),Ie=(0,k.createContext)(null);function go(){return(0,k.useContext)(Ie)}function zr(e,t){let n=go(),o=(0,k.useMemo)(()=>n?n.live.seenBy(t):e,[n,e,t]),r=(0,k.useRef)(0),i=(0,k.useCallback)(s=>o.subscribe(()=>{r.current+=1,s()}),[o]);return(0,k.useSyncExternalStore)(i,()=>r.current,()=>0),o}var Ur=Ke(()=>(__graviewPreload(import.meta.url,["./chunk.TI4OSTQV.js","./chunk.AJZBJBMO.js"]),import("./chunk.J2CR4RRH.js"))),mo,Yr=400;function Tt(e,t,n){let o=(0,k.useContext)(Ie),r=o!==null&&o.owns(e,t),[i,s]=(0,k.useState)(null),[d,a]=(0,k.useState)(mo);(0,k.useEffect)(()=>{if(d||r||i===null)return;let E=!0;return Ur().then(R=>{mo=R,E&&a(R)},()=>{}),()=>{E=!1}},[d,r,i]);let[u,f]=(0,k.useState)(0),h=(0,k.useMemo)(()=>r||i===null||i>=e.log.length||!d?void 0:d.askDeclaration(n,i),[r,e,i,n,d,u]),p=h&&"waiting"in h?h.waiting:void 0,[g,b]=(0,k.useState)(void 0);(0,k.useEffect)(()=>{if(!p)return;let E=!0,R=setTimeout(()=>E&&b(p),Yr);return p.then(()=>E&&f(I=>I+1)),()=>{E=!1,clearTimeout(R)}},[p]);let A=p!==void 0&&g!==p,m=(0,k.useMemo)(()=>{if(r||i===null||i>=e.log.length||!d||A)return null;try{let E=d.pastAt(e,i,n);return{seq:i,at:E.past?.at,store:E}}catch{return null}},[r,e,i,n,d,A,u]),v=(0,k.useRef)(null),y=A?v.current:m;(0,k.useEffect)(()=>{v.current=y},[y]);let x=(0,k.useCallback)(E=>s(E===null?null:E>=e.log.length?Number.POSITIVE_INFINITY:E),[e]),P=(0,k.useCallback)((E,R)=>[e,y?.store].some(I=>I!==void 0&&(I===E||I.seenBy(R)===E)),[e,y]),D=i!==null,L=(0,k.useMemo)(()=>({past:y,open:D,show:x,live:e,host:n,owns:P}),[y,D,x,e,n,P]);return r?o:L}var vo=e=>`graview:setting:${e}`;function bo(){return localStorage}function xo(e,t){try{let n=(t??bo()).getItem(vo(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function Eo(e,t,n){try{(n??bo()).setItem(vo(e.name),t)}catch{}}function Ao(e,t){if(typeof document>"u")return;let n=document.documentElement;if(e.honored==="root-font-size"){n.style.fontSize=t===e.initial?"":t;return}let o=`graview${e.name.replace(/-([a-z0-9])/g,(r,i)=>i.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}`;t===e.initial?delete n.dataset[o]:n.dataset[o]=t}var _=C(N(),1);function Mt(e){return Fe(e)}var Jr=12,Qr=4;function ei(e,t,n){let o=Mt(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var tt=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-Jr);function ko(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=Qr)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?mt([...o][0]):n[0]}function Ot(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[s,d]of e)d.mode!=="asking"&&d.mode!=="docked"&&t.at-d.since>=t.holdMs&&o.set(s,{...d,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=ei(e,t.author,t.at),i=s=>o.set(r.participant,{...r,...s,since:t.at});switch(t.type){case"read":{let s=ko(t.ids,n);return i({at:s,mode:"reading",trail:tt(r.trail,s)}),o}case"about-to-write":case"write":{let s=ko(t.ids,n);return i({at:s,mode:"writing",trail:tt(r.trail,s),say:void 0,confidence:void 0}),o}case"refused":return i({at:t.where,mode:"refused",say:t.say,confidence:void 0,trail:tt(r.trail,t.where)}),o;case"asking":return i({at:t.where??r.at,mode:"asking",say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},trail:tt(r.trail,t.where)}),o;case"said":return i({say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},...t.caption?{caption:t.caption}:{}}),o;case"over":return i({over:t.over}),o;case"home":return i({at:null,mode:"docked",trail:[],say:void 0,confidence:void 0,over:null}),o;default:return o}}var Po="graview:session";function Ro(e){let t=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);try{let n=e??sessionStorage,o=n.getItem(Po);if(o)return o;let r=t();return n.setItem(Po,r),r}catch{return t()}}var Vt={name:"share-where",title:"Where you are",description:"Whether the others here see which stop you are on.",honored:"root-attribute",options:[{value:"shared",label:"Shown"},{value:"private",label:"Hidden"}],initial:"shared"},It={name:"share-over",title:"What you point at",description:"Whether the others see the thing under your pointer, outlined in your color.",honored:"root-attribute",options:[{value:"private",label:"Kept to yourself"},{value:"shared",label:"Outlined for others"}],initial:"private"},To=[Vt,It],ni=800;function Mo(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:s,seatWho:d,settingValues:a,setView:u,ttlMs:f=1e4,people:h,seats:p}=e,[g,b]=(0,_.useState)(()=>new Map),[A,m]=(0,_.useState)(null),[v,y]=(0,_.useState)(null),[x,P]=(0,_.useState)(null),D=typeof r.id=="string"&&r.id.length>0,L=D&&(a[Vt.name]??Vt.initial)==="shared",E=L&&(a[It.name]??It.initial)==="shared",R=Mt({kind:r.kind,...r.id?{id:r.id}:{},session:i}),I=D?_n(r,{graph:n.graph,schema:n.schema,...p?{seats:p}:{},...h?{people:h}:{}}):"",G=d?s.get(`agent:${d}:${i}`):void 0,W=(0,_.useMemo)(()=>!t||!L?null:{participant:R,kind:r.kind,name:I,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:Ln(r.id??"nobody"),stop:x??te(o),...E?{over:A}:{},...G?{robot:{at:G.at,mode:G.mode}}:{},at:new Date().toISOString()},[t,L,E,R,I,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,x,A,G?.at,G?.mode]);(0,_.useEffect)(()=>{if(!t||!W)return;t.here(W);let V=setInterval(()=>t.here({...W,at:new Date().toISOString()}),ni);return()=>clearInterval(V)},[t,W]),(0,_.useEffect)(()=>t?t.onWho(K=>b(pt(new Map,K,Date.now(),f))):void 0,[t,f]);let Z=g.size>0;(0,_.useEffect)(()=>{if(!Z)return;let V=setInterval(()=>{b(K=>{let Q=pt(K,[],Date.now(),f);return Q.size===K.size?K:Q})},Math.max(250,Math.min(1e3,f/4)));return()=>clearInterval(V)},[Z,f]),(0,_.useEffect)(()=>{if(!t||typeof window>"u")return;let V=()=>t.leave();return window.addEventListener("pagehide",V),()=>window.removeEventListener("pagehide",V)},[t]),(0,_.useEffect)(()=>{if(!E||typeof document>"u")return;let V=null,K=Q=>{let Ee=yo(Q.target);Ee!==V&&(V=Ee,m(Ee))};return document.addEventListener("pointermove",K,{passive:!0}),()=>document.removeEventListener("pointermove",K)},[E]);let X=(0,_.useRef)(null),q=v?g.get(v)??null:null,de=(0,_.useCallback)(V=>{X.current=null,y(V)},[]);return(0,_.useEffect)(()=>{if(v){if(!q){y(null);return}q.stop!==X.current?.stop&&(X.current={stop:q.stop,at:Date.now()},u(qe(q.stop)))}},[v,q,u]),(0,_.useEffect)(()=>{let V=X.current;!v||V===null||Date.now()-V.at<400||Bn(o,qe(V.stop))||y(null)},[o,v]),(0,_.useEffect)(()=>{if(!v||typeof document>"u")return;let V=K=>{K.key==="Escape"&&y(null)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[v]),(0,_.useMemo)(()=>({who:g,sharing:W?{participant:R,name:I}:null,following:q,follow:de,sayWhere:P}),[g,W,R,I,q,de])}var U=C(N(),1);function Oo(e){return Fe(e.author)}function oi(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function Vo(e,t,n,o,r){let i=new Map;for(let[a,u]of e)o-u.at<r&&i.set(a,u);let s=new Set(n.flatMap(a=>a.nodeIds)),d=(a,u,f)=>{let h=i.get(a),p=h?.participants.includes(Oo(u))?h.participants:[...h?.participants??[],Oo(u)];i.set(a,{at:o,manner:oi(p,u.author.kind),intent:u.intent,wrote:(h?.wrote??!1)||(f.wrote??!1),read:(h?.read??!1)||(f.read??!1),broke:(h?.broke??!1)||s.has(a),participants:p})};for(let a of t){for(let u of a.writes)d(u,a,{wrote:!0});for(let u of a.reads)a.writes.includes(u)||d(u,a,{read:!0})}for(let a of n)for(let u of a.nodeIds){let f=i.get(u);i.set(u,{at:o,manner:f?.manner??"rule",intent:f?.intent??a.message,wrote:f?.wrote??!1,read:f?.read??!1,broke:!0,participants:f?.participants??["rule::"]})}return i}var ri=2600;function Io(e,t=ri){let[n,o]=(0,U.useState)(()=>new Map),r=(0,U.useRef)(n);r.current=n;let i=(0,U.useRef)(null),s=(0,U.useCallback)(a=>{r.current=a,o(a),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,U.useEffect)(()=>{let a=e.violations(),u=e.subscribe((f,h)=>{let p=e.violations(),g=jn(e.allInvariants(),a,p).introduces;a=p,s(Vo(r.current,h,g.map(b=>({nodeIds:b.nodeIds,message:b.message})),Date.now(),t))});return()=>{u(),i.current&&clearTimeout(i.current)}},[e,t,s]);let d=(0,U.useCallback)(a=>{a.reads.length!==0&&s(Vo(r.current,[ii(a)],[],Date.now(),t))},[t,s]);return{activity:n,noteAttention:d}}function ii(e){return{id:`attention:${e.intent}`,seq:-1,batch:"attention",author:e.author,intent:e.intent,mutation:null,primitives:[],inverse:[],reads:e.reads,writes:[],at:new Date().toISOString()}}var l=C(N(),1);function Co(){let e=null,t=new Set,n=new Set,o=r=>{for(let i of n)i(r)};return{subscribe(r){return t.add(r),t.size===1&&o(!0),()=>{t.delete(r),t.size===0&&(e=null,o(!1))}},snapshot:()=>e,set(r){if(!(e===r||e&&r&&e.x===r.x&&e.y===r.y)){e=r;for(let i of t)i()}},get listeners(){return t.size},onActive(r){return n.add(r),()=>void n.delete(r)}}}var nt=C(N(),1),si=e=>e.definitions.some(t=>In(t).size>0);function _o(e,t,n){let[o,r]=(0,nt.useState)(void 0),i=(n.roles??[]).join("\0");return(0,nt.useEffect)(()=>{if(!t||!si(e.schema)){r(void 0);return}let s=!0,d=!1,a=e.graph,u=()=>{d||(d=!0,queueMicrotask(()=>{d=!1,s&&e.reread()}))},f=Cn(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{}},u);return ft(a,f.read),r(f),e.reread(),()=>{s=!1,ft(a,void 0)}},[e,t,n.kind,n.id,i]),o}function Lo(){let e=!1,t=new Set;return{moving:()=>e,set(n){if(n!==e){e=n;for(let o of t)o()}},subscribe(n){return t.add(n),()=>t.delete(n)}}}var le=C(Ce(),1),ai="graview:place-menu",_e=(0,l.createContext)(null),jo=(0,l.createContext)("scene");function li({mode:e,children:t}){return(0,le.jsx)(jo.Provider,{value:e,children:t})}function di(){return(0,l.useContext)(jo)}var Go={kind:"human"},ui=[],ci=[],fi=[],Ct=[];function Wo(e,t){let n=(0,l.useId)();(0,l.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??Go,r=()=>Nn(e,o,n);r();let i,s=e.subscribe(()=>{clearTimeout(i),i=setTimeout(r,250)});return()=>{clearTimeout(i),s(),globalThis.__graviewWatch?.unseen?.({words:[],from:n,gone:!0})}},[e,t,n])}var pi={off:!0};function yi({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,seats:s=ui,onSeat:d,people:a=ci,memory:u,presenceTtlMs:f,app:h,settings:p=h?.settings??fi,presence:g,brand:b,locale:A,timeZone:m,onKeepLens:v,providers:y,ai:x,files:P,resolveApp:D,history:L,linkedRecords:E,menuSections:R,keptViews:I,subscriptions:G,signIn:W,view:Z,onViewChange:X,children:q}){let de=(0,l.useContext)(_e),V=R??de?.menuSections,K=W??de?.signIn,Q=I??de?.keptViews,[Ee,or]=(0,l.useState)(null),ue=Ee??i??s[0]?.principal??Go,He=Tt(e,ue,L),Yt=He.past&&He.live===e?He.past.store:e,H=(0,l.useMemo)(()=>Yt.seenBy(ue),[Yt,ue]);Wo(e,ue);let[re]=(0,l.useState)(()=>Ro(u)),[Zt,rr]=(0,l.useState)(!1),Xt=(0,l.useCallback)(()=>rr(!0),[]),ie=(0,l.useMemo)(()=>g?[...p,...To]:p,[p,g]),[at]=(0,l.useState)(()=>n??Dt(t,e.schema)),[ir,Jt]=(0,l.useState)(()=>ze(at??fe,r??at?.selection??[])),Ae=(0,l.useRef)(at??fe).current,[Qt,sr]=(0,l.useState)(null),[en,ar]=(0,l.useState)(null),J=(0,l.useContext)(_e),[tn]=(0,l.useState)(()=>J?.seatTalk??Pt(b?.name??e.schema.kinds.join(","))),lt=x??J?.ai??St,De=(0,l.useMemo)(()=>lt.off?pi:lt,[lt]),nn=(0,l.useRef)(De.interactions);nn.current=De.interactions;let[on]=(0,l.useState)(()=>J?.aiDesk??Rt(()=>nn.current)),[lr]=(0,l.useState)(()=>J?.subscriptions??Dn()),rn=G??J?.subscriptions??lr,dt=v??J?.onKeepLens,Ne=h??J?.app,je=A??J?.locale,dr=b?.locale??Ne?.brand?.locale,Ge=m??J?.timeZone;Vn({reader:je,app:dr,readerTimeZone:Ge,appTimeZone:b?.timeZone??Ne?.brand?.timeZone});let sn=(0,l.useRef)(null),an=(0,l.useCallback)(c=>{sn.current=c},[]),ln=(0,l.useCallback)(c=>sn.current?.whereIs(c)??null,[]),[dn]=(0,l.useState)(()=>Co()),[un]=(0,l.useState)(()=>Lo()),[ut,ur]=(0,l.useState)(null),[ke,cn]=(0,l.useState)(()=>new Map),Pe=(0,l.useRef)(ke);Pe.current=ke;let Re=(0,l.useRef)(null),ct=(0,l.useCallback)(c=>H.graph.getNode(c)?.kind,[H]),ee=(0,l.useCallback)(c=>{let S=Ot(Pe.current,c,ct);Pe.current=S,cn(S),Re.current&&clearTimeout(Re.current),[...S.values()].some(M=>M.mode!=="docked"&&M.mode!=="asking")&&(Re.current=setTimeout(()=>{let M=Ot(Pe.current,{type:"rest",at:Date.now(),holdMs:Ht},ct);Pe.current=M,cn(M)},Ht+20))},[ct]),fn=(0,l.useCallback)(c=>ee({...c,at:c.at??Date.now()}),[ee]),pn=(0,l.useCallback)(c=>{ur(c),c&&ee({type:"home",author:{kind:"agent",id:c,session:re},at:Date.now()})},[ee,re]);(0,l.useEffect)(()=>H.subscribe((c,S)=>{for(let T of S)T.author.kind==="agent"&&ee({type:"write",author:T.author,ids:T.writes,at:Date.now()})}),[H,ee]),(0,l.useEffect)(()=>()=>{Re.current&&clearTimeout(Re.current)},[]);let z=(0,l.useMemo)(()=>({...ue,session:re}),[ue,re]),yn=_o(H,E,z),mn=(0,l.useCallback)(c=>{or(c),d?.(c)},[d]),[Te,cr]=(0,l.useState)(()=>Object.fromEntries(ie.map(c=>[c.name,xo(c,u)])));(0,l.useEffect)(()=>{for(let c of ie)Ao(c,Te[c.name]??c.initial)},[ie,Te]);let gn=(0,l.useCallback)((c,S)=>{let T=ie.find(M=>M.name===c);!T||!T.options.some(M=>M.value===S)||(Eo(T,S,u),cr(M=>({...M,[c]:S})))},[ie,u]),[hn,fr]=(0,l.useState)(null),{activity:Sn,noteAttention:wn}=Io(H),vn=(0,l.useCallback)(c=>{wn(c),ee({type:"read",author:c.author,ids:c.reads,at:Date.now()})},[wn,ee]),ce=(0,l.useCallback)(c=>{if(ye(c)!==null||ae(c).length>0||gt(c))return!0;let S=$n(c);return S?H.graph.allEdges().some(T=>T.kind===S.kind&&T.from===S.from&&T.to===S.to):H.graph.getNode(c)!==void 0},[H]),bn=(0,l.useCallback)(c=>{let S=c.selection??Ct,T=S.filter(ce),M=T.length===S.length?c:ze(c,T);return M.focusId!==null&&!ce(M.focusId)&&(M=$(M,null)),M},[ce]),Me=(0,l.useCallback)(c=>{let S=bn(c),T=No(H,z,S.shown);if(S.focusId!==null&&T.size>0){let M=ae(S.focusId),On=H.graph.getNode(S.focusId);(M.length>0?M.every(mr=>T.has(mr)):On?T.has(On.kind):!1)&&(S={...S,focusId:null})}if(!S.overview&&S.focusId===null){let M=Ae.focusId!==null&&!ce(Ae.focusId)?Dt(t,e.schema)??{...fe,overview:!0}:Ae;M.focusId!==null&&ce(M.focusId)?S={...S,focusId:M.focusId}:M.overview===!0&&(S={...S,overview:!0})}return S},[bn,ce,H,Ae,z,t,e.schema]),B=Me(Z??ir),xn=(0,l.useMemo)(()=>No(H,z,B.shown),[H,z,B.shown]),En=(0,l.useMemo)(()=>[...H.modules.administered.entries()].map(([c,S])=>{let T=H.mayAdminister(c,z);return{name:c,...S.description?{description:S.description}:{},kinds:S.kinds??[],canShow:T,shown:T&&(B.shown??[]).includes(c)}}),[H,z,B.shown]),Oe=(0,l.useCallback)(c=>{let S=T=>Me(typeof c=="function"?c(T):c);if(Z!==void 0){X?.(S(Z));return}X&&X(S(B)),Jt(T=>S(T))},[B,X,Z,Me]);(0,l.useEffect)(()=>{Z===void 0&&Jt(c=>{let S=Me(c);return S===c?c:S})},[B,Z,Me]);let An=B.selection??Ct,kn=(0,l.useCallback)(c=>{Oe(S=>ze(S,typeof c=="function"?c(S.selection??Ct):c))},[Oe]),{who:Pn,following:Rn,follow:Tn,sayWhere:pr,sharing:Mn}=Mo({channel:g,store:H,view:B,principal:z,session:re,robots:ke,seatWho:ut,settingValues:Te,setView:Oe,seats:s,people:a,...f!==void 0?{ttlMs:f}:{}}),yr=(0,l.useMemo)(()=>({store:H,scheme:o,views:t,view:B,setView:Oe,homeView:Ae,selection:An,setSelection:kn,menuAt:Qt,setMenuAt:sr,whereIs:ln,pointer:dn,motion:un,registerScene:an,robots:ke,noteSeat:fn,seatWho:ut,registerSeatWho:pn,actsDoor:en,registerActsDoor:ar,seatTalk:tn,aiDesk:on,...u?{memory:u}:{},who:Pn,following:Rn,follow:Tn,sayWhere:pr,sharing:Mn,session:re,ai:De,resolveApp:D,linkedRecords:E,menuSections:V,...Q?{keptViews:Q}:{},subscriptions:rn,signIn:K,linkedReads:yn,movedByHand:Zt,noteMoved:Xt,emphasis:hn,setEmphasis:fr,activity:Sn,noteAttention:vn,principal:z,seats:s,people:a,takeSeat:mn,settings:ie,settingValues:Te,chooseSetting:gn,hiddenKinds:xn,administered:En,...y?{providers:y}:{},...b?{brand:b}:{},...dt?{onKeepLens:dt}:{},app:Ne,...je?{locale:je}:{},...Ge?{timeZone:Ge}:{}}),[H,o,t,B,Oe,An,kn,Qt,ln,dn,un,an,ke,fn,ut,pn,en,tn,on,u,Pn,Rn,Tn,Mn,re,De,D,E,V,Q,rn,K,yn,Zt,Xt,hn,Sn,vn,z,s,a,mn,ie,Te,gn,xn,En,y,b,dt,Ne,je,Ge]);return(0,le.jsx)(_e.Provider,{value:yr,children:(0,le.jsx)(Ie.Provider,{value:He,children:(0,le.jsx)(wi,{children:P?(0,le.jsx)(Qe.Provider,{value:P,children:q}):q})})})}var Fo=(0,l.createContext)(null),_t,Lt=new Set,mi=e=>(Lt.add(e),()=>void Lt.delete(e)),Ho=()=>_t;function gi(e){if(!_t){_t=e;for(let t of[...Lt])t()}}var hi=300;function Si(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,hi)),r===t?e(n,o):[]}}function wi({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:s,ai:d}=oe(),a=ot(),u=n.q,f=n.focusId,h=!!(u&&u.trim().length>0),p=(0,l.useSyncExternalStore)(mi,Ho,Ho),g=(0,l.useMemo)(()=>h&&p?{flagged:new Set(t.violations().flatMap(x=>x.nodeIds)),touched:p.touchWeights(t.log.all())}:null,[t,a,h,p]),b=f?t.graph.getNode(f)?.kind??ye(f)??(ae(f).length===1?ae(f)[0]:void 0):void 0,A=(0,l.useMemo)(()=>d.near&&Si(d.near),[d.near]),m=(0,l.useMemo)(()=>!u||!g||!p?null:p.search(t,u,{...b?{inKind:b}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(x=>!i.has(x)),from:[...s,...f&&t.graph.has(f)?[f]:[]],flagged:g.flagged,touched:g.touched,limit:200,rank:A}),[t,u,r,o,i,s,f,b,g,A]),[v,y]=(0,l.useState)();return(0,l.useEffect)(()=>void m?.later?.then(x=>y([m,x])),[m]),(0,le.jsx)(Fo.Provider,{value:v?.[0]===m?v[1]:m,children:e})}var Do=new WeakMap;function ea(e){let t=Do.get(e);return t||Do.set(e,t=new Set(e.matched)),t}function vi(){return(0,l.useContext)(Fo)}function oe(){let e=(0,l.useContext)(_e);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function Nt(){return(0,l.useContext)(_e)??null}function ot(){let{store:e}=oe(),t=(0,l.useRef)(null),n=(0,l.useRef)(null),o=(0,l.useCallback)(()=>(n.current!==e&&(n.current=e,t.current=null),t.current??=e.graph.allNodes(),t.current),[e]),r=(0,l.useCallback)(i=>e.subscribe(()=>{t.current=null,i()}),[e]);return(0,l.useSyncExternalStore)(r,o,o)}function bi(e){let{store:t}=oe(),n=(0,l.useCallback)(r=>t.subscribe(r),[t]),o=(0,l.useCallback)(()=>e===null?void 0:t.graph.getNode(e),[t,e]);return(0,l.useSyncExternalStore)(n,o,o)}function No(e,t,n){let o=new Set(e.modules.disabledKinds);for(let r of e.kindsKeptFrom(t))o.add(r);for(let[r,i]of e.modules.administered)if(!(e.mayAdminister(r,t)&&(n??[]).includes(r)))for(let s of i.kinds??[])o.add(s);return o}var Ht=2600;var Ko=new WeakSet,xi=e=>Ko.has(e),Ei=e=>void Ko.add(e);function Dt(e,t){let n=Wn(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...fe,focusId:ne(n.place.kind),within:{view:n.place.as}}:{...fe,focusId:ne(n.kind)}}var Bo=C(N(),1),Ai=(0,Bo.createContext)(!1);var rt=Symbol.for("graview.default-view");function $o(e){return Object.defineProperty(e,rt,{value:!0,enumerable:!1}),e}function qo(e){return typeof e=="function"&&e[rt]===!0}var jt=Symbol.for("graview.replaces-page");function zo(e){return typeof e=="function"&&e[jt]===!0}function Pi(e){return Gn(e)}function Ri(e,t){if(t===e)return e;for(let r of t.registrations())e.register(r.kind,r,r.view,r);let n=t.arrangement?.();n&&e.arrange?.(n);let o=t.homeView?.();return o&&e.home?.(o),e}var F=C(N(),1),Y=C(Ce(),1),Gt=new Set,Uo=!1;function Wt(){for(let e of[...Gt])e()}function Ti(){Uo||typeof window>"u"||(Uo=!0,window.addEventListener("online",Wt))}function Ft(e){let t,n=!1,o=!1,r,i=0,s=new Set,d=()=>{i+=1;for(let p of[...s])p()},a=p=>(s.add(p),()=>void s.delete(p)),u=()=>i,f=()=>void h().catch(()=>{});function h(){if(n)return Promise.resolve(t);if(r)return r;let p=e().then(g=>(t=g,n=!0,o=!1,r=void 0,Gt.delete(f),d(),g),g=>{throw r=void 0,o=!0,Gt.add(f),Ti(),d(),g});return p.catch(()=>{}),r=p,p}return{load:h,prefetch:f,get current(){return t},get failed(){return o},part(p,g={}){let b=g.what??"This part";function A(y){(0,F.useSyncExternalStore)(a,u,u);let x=(0,F.useRef)(null),P=(0,F.useRef)(null),D=(0,F.useRef)(!1);return(0,F.useEffect)(()=>{o&&r===void 0&&f()},[]),n&&typeof document<"u"&&x.current!==null&&document.activeElement===x.current&&(D.current=!0),(0,F.useLayoutEffect)(()=>{if(!(!n||!D.current)){D.current=!1;for(let L=P.current?.nextElementSibling??null;L!==null;L=L.nextElementSibling){let E=L.matches(Yo)?L:L.querySelector(Yo);if(E instanceof HTMLElement){E.focus();return}}}}),n?(0,Y.jsxs)(Y.Fragment,{children:[D.current?(0,Y.jsx)("span",{ref:P,hidden:!0}):null,p(t,y)]}):g.quiet?null:(0,Y.jsx)(Mi,{what:b,button:x,...g.as?{as:g.as}:{}})}let m=(0,F.lazy)(()=>h().then(()=>({default:A}),()=>({default:A})));function v(y){let[x]=(0,F.useState)(()=>n||o);return(0,F.createElement)(x?A:m,y)}return v}}}var Yo="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function Mi({what:e,button:t,as:n="p"}){let r=typeof navigator<"u"&&navigator.onLine===!1?`${e} will load when you're back online.`:`${e} didn't load.`;return(0,Y.jsxs)(n,{"data-testid":"lazy-part-missing",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,Y.jsx)("span",{role:"status",children:r})," ",(0,Y.jsx)("button",{ref:t,type:"button","data-testid":"lazy-part-retry",onClick:Wt,style:{font:"inherit",fontWeight:600,color:"var(--graview-ink)",background:"none",border:"1px solid var(--graview-edge)",borderRadius:6,padding:"2px 10px"},children:"Try again"})]})}var Se=C(N(),1);function Oi(){let{selection:e,setSelection:t}=oe();return(0,Se.useMemo)(()=>({selection:e,set:n=>t(n),clear:()=>t([]),toggle:n=>t(o=>o.includes(n)?o.filter(r=>r!==n):[...o,n]),isSelected:n=>e.includes(n)}),[e,t])}function Vi(){let{store:e}=oe(),t=ot();return(0,Se.useMemo)(()=>Ii(e),[e,t])}var Zo=new WeakMap;function Ii(e){let t=Zo.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),Zo.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function Ci(){let{view:e,setView:t}=oe();return(0,Se.useMemo)(()=>({view:e,url:te(e),focus:n=>t(o=>$(o,n)),show:n=>t(o=>qn(o,n)),toggle:n=>t(o=>Ue(o,n)),go:n=>t(n)}),[e,t])}var he={at:0,depth:0,listeners:new Set,tell(){for(let e of this.listeners)e()}};typeof window<"u"&&window.addEventListener("popstate",e=>{let t=e.state;he.at=typeof t?.graview=="number"?t.graview:0,he.at>he.depth&&(he.depth=he.at),he.tell()});var j=C(N(),1),Bt={profile:{trigger:"profile-button",pane:"profile",opens:"press",focus:"into",drawn:["shell","embed"]},problems:{trigger:"standing",pane:"problems",opens:"press",focus:"into",drawn:["shell","embed"]},places:{trigger:"app-places-open",pane:"app-places",opens:"press",focus:"into",drawn:["embed"]},here:{trigger:"here-open",pane:"here-list",opens:"press",focus:"into",drawn:["shell","embed","pages"]},suggested:{trigger:"suggested-button",pane:"suggested",opens:"press",focus:"into",drawn:["shell","embed","pages"]},activity:{trigger:"activity-button",pane:"activity",opens:"press",focus:"into",drawn:["shell","embed","pages"]},find:{trigger:"find-box",pane:"find-strip",opens:"typing",focus:"stays",drawn:["shell"]},districts:{trigger:"beyond-more",pane:"beyond-list",opens:"press",focus:"into",drawn:["shell","embed"]},acts:{trigger:null,pane:"context-menu",opens:"context-menu",focus:"into",drawn:["shell","embed","pages"]},arrange:{trigger:"arrange-add",pane:"arrange-list",opens:"press",focus:"into",drawn:["pages"]},"studio-ask":{trigger:"studio-agent",pane:"studio-agent-panel",opens:"press",focus:"into",drawn:["studio"]}},_i={position:"fixed",inset:"auto",margin:0,zIndex:Hn("popover"),boxSizing:"border-box"},it=6,we=8,Li=e=>typeof e.showPopover=="function";function st(e){try{return e.matches(":popover-open")}catch{return!1}}function Hi(e){if(typeof e=="function"){let o=e();return o?{left:o.x,right:o.x,top:o.y,bottom:o.y}:null}let t=e.current;if(!t||!t.isConnected)return null;let n=t.getBoundingClientRect();return{left:n.left,right:n.right,top:n.top,bottom:n.bottom}}function $t(e,t,n={}){let o=Hi(t);if(!o)return;let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},i=e.dataset.graviewDesignedHeight??=e.style.maxHeight;e.style.maxHeight=i;let s=e.getBoundingClientRect(),d=r.height-o.bottom-it-we,a=o.top-it-we,u=s.height<=d||d>=a,f=Math.max(96,Math.floor(u?d:a)),h=Math.min(s.height,f);s.height>f&&(e.style.maxHeight=i?`min(${i}, ${f}px)`:`${f}px`);let p=s.width,g=n.align==="start"?o.left:o.right-p,b=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();b&&p<=b.right-b.left&&(g<b.left?g=o.left+p<=b.right?o.left:b.left:g+p>b.right&&(g=o.right-p>=b.left?o.right-p:b.right-p));let A=p>=r.width-2*we?Math.max(0,(r.width-p)/2):Math.max(we,Math.min(g,r.width-we-p)),m=u?o.bottom+it:Math.max(we,o.top-it-h);e.style.left=`${Math.round(A)}px`,e.style.top=`${Math.round(m)}px`}function Xo(e,t,n,o={}){let r=o.align??"end";(0,j.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(Li(i)&&!st(i))try{i.showPopover(),Ni()}catch{}let s=0,d=u=>{u?.target instanceof Node&&i.contains(u.target)||(cancelAnimationFrame(s),s=requestAnimationFrame(()=>$t(i,n,{align:r})))};$t(i,n,{align:r}),addEventListener("resize",d),addEventListener("scroll",d,!0);let a=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>d());return a?.observe(i),()=>{if(cancelAnimationFrame(s),removeEventListener("resize",d),removeEventListener("scroll",d,!0),a?.disconnect(),i.isConnected&&st(i))try{i.hidePopover()}catch{}}},[t,e,r])}var qt=new Set;function Di(e){return qt.add(e),()=>qt.delete(e)}function Ni(){for(let e of qt)if(!(!e.isConnected||!st(e)))try{e.hidePopover(),e.showPopover()}catch{}}var ve=null,ji='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function Gi(e){for(let t of e.querySelectorAll(ji))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var Kt=()=>{let e=document.activeElement;return e===null||e===document.body};function Wi(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[s,d]=(0,j.useState)(!1),a=t.open??s,u=(0,j.useRef)(null),f=(0,j.useRef)(null),h=(0,j.useCallback)(y=>{u.current=y},[]),p=(0,j.useCallback)(y=>{f.current=y},[]),g=`graview-popover-${(0,j.useId)().replace(/:/g,"")}`,b=(0,j.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});b.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let A=(0,j.useCallback)(y=>{b.current.controlled||d(y),b.current.onOpenChange?.(y)},[]),m=(0,j.useCallback)(()=>{(document.querySelector(`[aria-controls="${g}"]`)??u.current??b.current.returnTo?.()??null)?.focus({preventScroll:!0})},[g]),v=(0,j.useCallback)(y=>{let x=f.current,P=typeof document>"u"?null:document.activeElement,D=P===null||P===document.body||x!==null&&x.contains(P);A(!1),!(!y||!D)&&(m(),requestAnimationFrame(()=>{Kt()&&m()}))},[A,m]);return Xo(f,i&&a,n??u,t.align?{align:t.align}:{}),(0,j.useEffect)(()=>{if(!i||!a)return;let y={name:e,close:()=>v(!1)};if(ve&&ve.close!==y.close&&ve.close(),ve=y,Bt[e].focus==="into"){let R=f.current;R&&!R.contains(document.activeElement)&&Gi(R).focus({preventScroll:!0})}let x=R=>{R.key==="Escape"&&v(!0)},P=R=>{let I=R.target;if(!(I instanceof Node))return;let G=f.current;if(G?.contains(I)||u.current?.contains(I))return;let W=I instanceof Element?I.closest('[role="dialog"], [role="alertdialog"]'):null;W&&!(G&&W.contains(G))||(v(!1),Bt[e].focus==="into"&&requestAnimationFrame(()=>{(Kt()||G!==null&&G.contains(document.activeElement))&&m()}))},D=null,L=null,E=R=>{let I=R.target;if(!(I instanceof Element))return;let G=f.current,W=I.closest('[role="dialog"], [role="alertdialog"]');!W||G&&(G.contains(W)||W.contains(G))||(D=W,v(!1))};return document.addEventListener("keydown",x),document.addEventListener("pointerdown",P,!0),document.addEventListener("focusin",E),()=>{document.removeEventListener("keydown",x),document.removeEventListener("pointerdown",P,!0),document.removeEventListener("focusin",E);let R=D;R&&typeof MutationObserver<"u"&&(L?.disconnect(),L=new MutationObserver(()=>{R.isConnected||(L?.disconnect(),requestAnimationFrame(()=>{(Kt()||document.activeElement.closest("[hidden]")!==null)&&m()}))}),L.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>L?.disconnect(),10*6e4)),ve?.close===y.close&&(ve=null)}},[i,a,e,v,m]),{open:a,setOpen:y=>y?A(!0):v(!0),toggle:()=>a?v(!0):A(!0),trigger:{ref:h,"aria-expanded":a,"aria-controls":g,"data-graview-popover-trigger":e},pane:{ref:p,id:g,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var be=C(N(),1);var Jo=(0,be.createContext)(null);function Fi(){let e=(0,be.useContext)(Jo),t=Nt(),n=(o,r,i)=>t?.setView(s=>se(se(pe($(s,ne(o)),!1),"view",r),"filter",i?.filter??null));return(0,be.useMemo)(()=>e??{record:o=>{t&&(t.setView(r=>$(pe(r,!1),o)),t.setSelection([o]))},place:(o,r)=>{let i=t?.views.places().find(s=>s.as===o);i&&n(i.kind,i.as,r)},list:(o,r)=>n(o,null,r)},[e,t])}var xe=C(N(),1);var Ki=Ft(Ke(()=>(__graviewPreload(import.meta.url,["./chunk.MQ7FNHXG.js","./chunk.WLPTY4BF.js","./chunk.AJZBJBMO.js"]),import("./chunk.YAXZNQY6.js"))));function Bi(e,t,n){let o,r=!1,i=()=>{let{hidden:d,removed:a}=t.current();o||r||d.length+a.length===0||(o=()=>{},Ki.load().then(u=>{r||(o=u.watchTidied(e,t,n))},String))};i();let s=t.onChange?.(i);return()=>{r=!0,s?.(),o?.()}}function $i(e,t){let[n,o]=(0,xe.useState)();return(0,xe.useEffect)(()=>t?Bi(e,t,r=>o([e,r])):void 0,[e,t]),n?.[0]===e?n[1]:e}var Qo=C(N(),1),qi=(0,Qo.createContext)(!1);var er=C(N(),1),zi=(0,er.createContext)(null);var tr=C(N(),1),zt='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',Ut=e=>e instanceof HTMLElement&&(e.matches(zt)||e.hasAttribute("tabindex")),Le=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function Ui(e,t){let n=a=>a.replace(/["\\]/g,"\\$&"),o=t.getAttribute("data-testid"),r=t.getAttribute("data-graview-pick"),i=t.getAttribute("aria-label"),s=o?`[data-testid="${n(o)}"]`:r?`[data-graview-pick="${n(r)}"]`:i?`${t.tagName.toLowerCase()}[aria-label="${n(i)}"]`:null;if(!s)return null;let d=e.querySelector(s);return d&&Ut(d)&&Le(d)?d:null}var Yi=e=>e.isConnected&&Ut(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&Le(e);function nr(e,t){let n=t?Ui(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&Le(o))return o;for(let r of e.querySelectorAll(zt))if(Le(r))return r;return Ut(e)&&Le(e)?e:null}function Zi(e){(0,tr.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=m=>{let v=m.target;if(v instanceof Element){n=[];for(let y=v;y&&y!==t.parentElement;y=y.parentElement)n.push(y)}},r=!1,i=!1,s=t.ownerDocument,d=()=>!i&&s.defaultView!==null,a=(m,v)=>void setTimeout(()=>d()&&v(),m),u=m=>void requestAnimationFrame(()=>d()&&m()),f=m=>{if(r=!1,i)return;let v=s.activeElement;if(!(!(v===null||v===s.body||v===s.documentElement)||n.length===0)){if(Yi(n[0])){m&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let x of n.slice(1)){if(!x.isConnected)continue;let P=nr(x,n[0]);if(P){P.focus({preventScroll:!0}),n=[];return}}}},h=(m,v=Date.now()+2500)=>{a(100,()=>{f(m);let y=s.activeElement;(y===null||y===s.body||y===s.documentElement)&&n.length>0&&Date.now()<v&&h(m,v)})},p=()=>{r||n.length===0||(r=!0,a(60,()=>u(()=>{f(!1),h(!1)})))},g=m=>{if(!(m instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(m.key))){if(!(m instanceof KeyboardEvent)){let v=m.target instanceof Element?m.target.closest(zt):null,y=s.activeElement,x=y===null||y===s.body||y===s.documentElement;if(v&&x&&t.contains(v)){n=[];for(let P=v;P&&P!==t.parentElement;P=P.parentElement)n.push(P);a(150,()=>u(()=>{f(!1),h(!1)}));return}}!(m instanceof KeyboardEvent)&&!(m.target instanceof Node&&n[0]?.contains(m.target))||a(150,()=>u(()=>{f(!0),h(!0)}))}},b=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&p()}),A=m=>{m.relatedTarget===null&&p()};return t.addEventListener("focusin",o),t.addEventListener("focusout",A),t.addEventListener("click",g),t.addEventListener("keydown",g),b.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",A),t.removeEventListener("click",g),t.removeEventListener("keydown",g),b.disconnect()}},[e])}export{Ke as a,fe as b,te as c,qe as d,Qi as e,es as f,Bn as g,Kn as h,$n as i,yt as j,$ as k,qn as l,se as m,pe as n,ze as o,Ve as p,Ue as q,Ze as r,mt as s,ye as t,os as u,wr as v,ne as w,zn as x,ae as y,Un as z,vr as A,rs as B,Yn as C,gt as D,br as E,xr as F,Er as G,N as H,Pt as I,Kr as J,$r as K,yo as L,Qe as M,qr as N,Ie as O,go as P,zr as Q,Tt as R,Ce as S,ai as T,li as U,di as V,Wo as W,yi as X,gi as Y,ea as Z,vi as _,oe as $,Nt as aa,ot as ba,bi as ca,xi as da,Ei as ea,Dt as fa,Jo as ga,Fi as ha,Ai as ia,$o as ja,qo as ka,zo as la,Pi as ma,Ri as na,Ft as oa,$i as pa,qi as qa,zi as ra,Oi as sa,Vi as ta,Ci as ua,he as va,Zi as wa,_i as xa,st as ya,Xo as za,Di as Aa,Wi as Ba};
|
|
2
|
-
/*! Bundled license information:
|
|
3
|
-
|
|
4
|
-
react/cjs/react.production.js:
|
|
5
|
-
(**
|
|
6
|
-
* @license React
|
|
7
|
-
* react.production.js
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the MIT license found in the
|
|
12
|
-
* LICENSE file in the root directory of this source tree.
|
|
13
|
-
*)
|
|
14
|
-
|
|
15
|
-
react/cjs/react-jsx-runtime.production.js:
|
|
16
|
-
(**
|
|
17
|
-
* @license React
|
|
18
|
-
* react-jsx-runtime.production.js
|
|
19
|
-
*
|
|
20
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the MIT license found in the
|
|
23
|
-
* LICENSE file in the root directory of this source tree.
|
|
24
|
-
*)
|
|
25
|
-
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.QT4XGC5Z.js";import{H as W,S as x}from"./chunk.MQ7FNHXG.js";import"./chunk.WLPTY4BF.js";import{b as D}from"./chunk.AJZBJBMO.js";var g=D(W(),1);var o=D(x(),1),v=864e5,l=t=>Date.UTC(+t.slice(0,4),+t.slice(5,7)-1,+t.slice(8,10)),I=t=>new Date(t).toISOString().slice(0,10),s=(t,i)=>I(l(t)+i*v),m=(t,i)=>{let a=new Date(l(t)),u=a.getUTCMonth()+i,d=Date.UTC(a.getUTCFullYear(),u,1),w=new Date(Date.UTC(a.getUTCFullYear(),u+1,0)).getUTCDate();return I(d+(Math.min(a.getUTCDate(),w)-1)*v)};function p(t,i,a){try{return new Intl.DateTimeFormat(t??"en-US",{...i,timeZone:"UTC"}).format(a)}catch{return new Intl.DateTimeFormat("en-US",{...i,timeZone:"UTC"}).format(a)}}function F(t){try{let i=new Intl.Locale(t??"en-US"),a=i.getWeekInfo?.().firstDay??i.weekInfo?.firstDay;if(a!==void 0)return a%7}catch{return 0}return/^en-US|^en$|-(US|CA|JP|BR|IL|MX|PH)$/.test(t??"en-US")?0:1}function L({id:t,label:i,selected:a,today:u,locale:d,onPick:w,onClose:T}){let[r,f]=(0,g.useState)(a??u),U=(0,g.useRef)(null),y=F(d),b=`${r.slice(0,7)}-01`,M=(new Date(l(b)).getUTCDay()-y+7)%7,P=s(b,-M),A=Array.from({length:6},(e,n)=>Array.from({length:7},(S,c)=>s(P,n*7+c))),$=p(d,{month:"long",year:"numeric"},l(b)),h=(0,g.useRef)(!0);(0,g.useEffect)(()=>{h.current&&U.current?.querySelector(`[data-day="${r}"]`)?.focus(),h.current=!1},[r]);let E=e=>{let n={ArrowLeft:()=>s(r,-1),ArrowRight:()=>s(r,1),ArrowUp:()=>s(r,-7),ArrowDown:()=>s(r,7),PageUp:()=>m(r,e.shiftKey?-12:-1),PageDown:()=>m(r,e.shiftKey?12:1),Home:()=>s(r,-((new Date(l(r)).getUTCDay()-y+7)%7)),End:()=>s(r,6-(new Date(l(r)).getUTCDay()-y+7)%7)};n[e.key]?(e.preventDefault(),h.current=!0,f(n[e.key]())):e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},R=Array.from({length:7},(e,n)=>l("1970-01-04")+(y+n)%7*v),C={minWidth:32,minHeight:32,padding:"0 8px",borderRadius:6};return(0,o.jsxs)("div",{id:t,role:"group","aria-label":`Pick a date for ${i}`,"data-graview-part":"when-month",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},style:{flexBasis:"100%",width:"min(100%, 20rem)",boxSizing:"border-box",padding:8,border:"1px solid var(--graview-edge)",borderRadius:8,background:"var(--graview-panel)",color:"var(--graview-ink)"},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,marginBottom:6},children:[(0,o.jsx)("button",{type:"button","aria-label":"Previous month",onClick:()=>f(m(r,-1)),style:C,children:"\u2039"}),(0,o.jsx)("span",{id:`${t}-title`,"aria-live":"polite",style:{fontWeight:600,fontSize:"0.875rem"},children:$}),(0,o.jsx)("button",{type:"button","aria-label":"Next month",onClick:()=>f(m(r,1)),style:C,children:"\u203A"})]}),(0,o.jsxs)("table",{ref:U,role:"grid","aria-labelledby":`${t}-title`,onKeyDown:E,style:{width:"100%",borderCollapse:"collapse",tableLayout:"fixed",fontSize:"0.8125rem"},children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:R.map(e=>(0,o.jsx)("th",{scope:"col",abbr:p(d,{weekday:"long"},e),style:{fontWeight:500,color:"var(--graview-ink-faint)",padding:"2px 0"},children:p(d,{weekday:"narrow"},e)},e))})}),(0,o.jsx)("tbody",{children:A.map(e=>(0,o.jsx)("tr",{children:e.map(n=>{let S=n.slice(0,7)===b.slice(0,7),c=n===a,k=n===u;return(0,o.jsx)("td",{role:"gridcell","aria-selected":c||void 0,style:{padding:1,textAlign:"center"},children:(0,o.jsx)("button",{type:"button","data-day":n,tabIndex:n===r?0:-1,"aria-label":`${p(d,{weekday:"long",year:"numeric",month:"long",day:"numeric"},l(n))}${k?", today":""}${c?", selected":""}`,...k?{"aria-current":"date"}:{},onClick:()=>w(n),onFocus:()=>n!==r&&f(n),style:{width:"100%",minHeight:36,padding:0,borderRadius:6,border:k?"1px solid var(--graview-accent)":"1px solid transparent",background:c?"var(--graview-accent)":"transparent",color:c?"var(--graview-accent-ink)":S?"var(--graview-ink)":"var(--graview-ink-faint)",fontWeight:c?600:400},children:Number(n.slice(8,10))})},n)})},e[0]))})]})]})}export{L as WhenMonth};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as v,b as m,c as h}from"./chunk.MB7LKKUD.js";import"./chunk.QT4XGC5Z.js";import{Aa as b,H as N,S as u,ya as p}from"./chunk.MQ7FNHXG.js";import{qc as f}from"./chunk.WLPTY4BF.js";import{b as c}from"./chunk.AJZBJBMO.js";var l=c(N(),1);var o=c(u(),1);function z({notices:r,anchor:n,board:a}){return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(w,{notices:r.filter(i=>i.kind==="banner"),at:"top",anchor:n,board:a}),(0,o.jsx)(w,{notices:r.filter(i=>i.kind==="toast"),at:"foot",anchor:n,board:a})]})}var y={info:"var(--graview-accent)",good:"var(--graview-good)",warn:"var(--graview-warn)",bad:"var(--graview-bad)"};function w({notices:r,at:n,anchor:a,board:i}){let s=(0,l.useRef)(null),t=r.length>0;return(0,l.useLayoutEffect)(()=>{let e=s.current;if(!t||!e)return;if(typeof e.showPopover=="function"&&!p(e))try{e.showPopover()}catch{}let d=()=>(n==="top"?h:m)(e,a());d(),n==="foot"&&i.hold?.(()=>e.matches(":hover, :focus-within"));let S=b(e);addEventListener("resize",d),addEventListener("scroll",d,!0),n==="foot"&&addEventListener(v,d);let g=typeof ResizeObserver=="function"?new ResizeObserver(d):null;return g?.observe(e),()=>{if(S(),g?.disconnect(),removeEventListener("resize",d),removeEventListener("scroll",d,!0),removeEventListener(v,d),e.isConnected&&p(e))try{e.hidePopover()}catch{}}},[t,n,a,i]),t?(0,o.jsx)("div",{ref:s,popover:"manual",role:"region","aria-label":n==="top"?"Notices":"Messages","data-testid":n==="top"?"notices-banners":"notices-toasts","data-graview-offstage":"",style:{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:f("toast"),width:"max-content",height:"auto",maxWidth:"min(560px, calc(100vw - 32px))",display:"grid",gap:8,color:"var(--graview-ink)"},children:r.map(e=>(0,o.jsx)(T,{notice:e,board:i},e.id))}):null}function T({notice:r,board:n}){let a=r.tone??"info",i=[...r.action?[r.action]:[],...r.actions??[]],s=()=>n.dismiss(r.id);return(0,o.jsxs)("div",{"data-testid":"notice","data-kind":r.kind,"data-tone":a,style:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px 12px",padding:r.kind==="banner"?"8px 10px 8px 14px":"10px 12px 10px 14px",borderRadius:"var(--graview-radius, 12px)",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:`3px solid ${y[a]}`,background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,o.jsx)("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:999,flex:"0 0 auto",background:y[a]}}),(0,o.jsx)("span",{style:{flex:"1 1 16rem",minWidth:0},children:r.sentence}),i.length>0?(0,o.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:6},children:i.map((t,e)=>t.href!==void 0?(0,o.jsx)("a",{href:t.href,...t.target?{target:t.target,rel:"noopener"}:{},"data-testid":"notice-action",onClick:()=>{t.onSelect?.(),s()},style:{...x,...e===0?k:{}},children:t.label},t.label):(0,o.jsx)("button",{type:"button","data-testid":"notice-action",onClick:()=>{s(),t.onSelect?.()},style:{...x,...e===0?k:{}},children:t.label},t.label))}):null,(0,o.jsx)("button",{type:"button","data-testid":"notice-dismiss","aria-label":`Dismiss: ${r.sentence}`,title:"Dismiss",onClick:s,style:E,children:"\xD7"})]})}var x={display:"inline-flex",alignItems:"center",minHeight:28,padding:"2px 12px",borderRadius:9,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",font:"inherit",fontWeight:500,textDecoration:"none",cursor:"pointer"},k={background:"var(--graview-accent)",borderColor:"var(--graview-accent)",color:"var(--graview-accent-ink)"},E={minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",fontSize:"1rem",cursor:"pointer"};export{z as NoticeStacks};
|
|
@@ -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.BUVAMSOZ.js";import"./chunk.FTJBW25J.js";import"./chunk.UT6642FC.js";import"./chunk.MCVY6RRS.js";import"./chunk.RZVZG2BQ.js";import"./chunk.VKHKYK5L.js";import"./chunk.TI4OSTQV.js";import"./chunk.EUGWV3S6.js";import"./chunk.MWZK3HVG.js";import"./chunk.3D5T3XIE.js";import"./chunk.GR5Q4HTW.js";import"./chunk.QT4XGC5Z.js";import"./chunk.MQ7FNHXG.js";import"./chunk.WLPTY4BF.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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.WVUJXDXZ.js";import{a as k,b as q,c as he}from"./chunk.2EJAIT33.js";import"./chunk.EUGWV3S6.js";import"./chunk.6XJP7F3I.js";import"./chunk.NPX7SPXM.js";import"./chunk.OE4QOBJF.js";import"./chunk.74RMHUCX.js";import"./chunk.GZHZLJBF.js";import{n as pe}from"./chunk.I3SQJ2L2.js";import"./chunk.OJGHDWI6.js";import"./chunk.FUJM7GDV.js";import"./chunk.MWZK3HVG.js";import"./chunk.3D5T3XIE.js";import"./chunk.GR5Q4HTW.js";import"./chunk.QT4XGC5Z.js";import{$ as ce,H as He,N as S,P as de,S as ue,ca as ge}from"./chunk.MQ7FNHXG.js";import{ia as re,la as w,na as oe,oa as E,pa as x,pc as se,qa as le,ra as Y}from"./chunk.WLPTY4BF.js";import{b as U}from"./chunk.AJZBJBMO.js";var h=U(He(),1);async function me(e,n){let i=await createImageBitmap(e);try{let r=Math.min(1,n/Math.max(i.width,i.height)),a=document.createElement("canvas");a.width=Math.max(1,Math.round(i.width*r)),a.height=Math.max(1,Math.round(i.height*r));let l=a.getContext("2d");if(l===null)throw new Error("This browser will not give us a canvas to resize with.");return l.drawImage(i,0,0,a.width,a.height),a}finally{i.close()}}var t=U(ue(),1),Le=2048,Ve=.85;function _(e){return e<1e3?`${e} bytes`:e<1e6?`${Math.round(e/1e3)} KB`:`${(e/1e6).toFixed(e<1e7?1:0)} MB`}function z(e){if(e.type==="application/pdf")return"PDF";let n=/\.([a-z0-9]{2,5})$/i.exec(e.name??"")?.[1];return n?n.toUpperCase():(e.type.split("/")[1]??e.type).replace(/^x-|^vnd\./,"").split(/[.+-]/)[0].toUpperCase()}function we(e){let n=[...new Set(e.map(i=>i==="image/*"?"pictures":i==="video/*"?"videos":i==="*/*"||i==="*"?"any file":`${z({type:i})} files`))];return n.length<=1?n[0]??"no files":`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`}function ke(e,n){if(e.length===0)return!0;let i=`${n.split("/")[0]}/*`;return e.some(r=>r==="*"||r==="*/*"||r===n||r===i)}var ye=/^image\/hei[cf]$|\.hei[cf]$/i,fe=e=>ye.test(e.type)||ye.test(e.name),Ie={mov:"video/quicktime",mp4:"video/mp4",m4v:"video/mp4",webm:"video/webm",ogv:"video/ogg"},De=e=>Ie[/\.([a-z0-9]{2,4})$/i.exec(e)?.[1]?.toLowerCase()??""];async function Be(e,n,i){let r=e.name||(i.camera?"photo.jpg":"file"),a=e.type||(fe({type:"",name:r})?"image/heic":De(r)??"application/octet-stream"),l=fe({type:a,name:r}),u=a.startsWith("image/")||l;if(i.image&&!u)return{refused:`\u201C${r}\u201D isn\u2019t a picture.`};if(i.video)return a.startsWith("video/")?K({blob:e,name:r,type:a},n):{refused:`\u201C${r}\u201D isn\u2019t a video.`};if(l||u&&/^image\/(jpeg|webp)$/.test(a)&&(i.camera||e.size>n.maxBytes||e.size>15e5))try{let c=await me(e,Le),b=await new Promise(p=>c.toBlob(p,"image/jpeg",Ve));if(b)return K({blob:b,name:l?r.replace(/\.hei[cf]$/i,"")+".jpg":r,type:"image/jpeg",width:c.width,height:c.height},n)}catch{if(l&&!ke(n.kinds,a))return{refused:`\u201C${r}\u201D is a HEIC photo, which this browser can\u2019t turn into a JPEG and this host doesn\u2019t take. Save it as a JPEG and try again.`}}let y={};if(u&&!l)try{let c=await createImageBitmap(e);y={width:c.width,height:c.height},c.close()}catch{}return K({blob:e,name:r,type:a,...y},n)}function K(e,n){return ke(n.kinds,e.type)?e.blob.size>n.maxBytes?{refused:`\u201C${e.name}\u201D is ${_(e.blob.size)}; this host takes files up to ${_(n.maxBytes)}.`}:e:{refused:`\u201C${e.name}\u201D is a ${z(e)} file; this host takes ${we(n.kinds)}.`}}async function je(e,n,i,r=!1){let a;try{a=await n.upload(e.blob,e.name)}catch(u){let s=u instanceof Error&&u.message.trim()?u.message.trim():"the host refused it";return{refused:`\u201C${e.name}\u201D wasn\u2019t kept: ${s}`}}return oe(a)?i&&!E(a)?{refused:`\u201C${e.name}\u201D isn\u2019t a picture.`}:r&&!x(a)?{refused:`The host kept \u201C${e.name}\u201D as ${z(a)}, not as a video.`}:{...a,...a.width===void 0&&e.width?{width:e.width}:{},...a.height===void 0&&e.height?{height:e.height}:{}}:{refused:`The host\u2019s answer for \u201C${e.name}\u201D isn\u2019t a file a record can keep.`}}var F="var(--graview-radius, 8px)",P={color:"var(--graview-ink-muted)",fontSize:"0.8125rem"};function Z(e){let n=S(),i=de()?.past!=null,[r,a]=(0,h.useState)(!1),l=n?.kept?_e(n,e.href):!0,[,u]=(0,h.useState)(0);return(0,h.useEffect)(()=>{if(typeof l!="object")return;let s=!0;return l.then(()=>s&&u(y=>y+1)),()=>void(s=!1)},[l]),[l===!1||i&&r,()=>a(!0)]}var J=new WeakMap;function _e(e,n){let i=J.get(e)?.get(n);if(i!==void 0)return i;let r;try{r=e.kept(n)}catch{return!0}if(typeof r=="boolean")return r;let a=J.get(e)??new Map;J.set(e,a);let l=Promise.resolve(r).then(u=>u!==!1,()=>!0);return a.set(n,l),l.then(u=>a.set(n,u)),l}function ee({file:e,style:n}){return(0,t.jsx)("span",{role:"img","aria-label":`${k(e)}, removed later`,"data-graview-removed-later":e.href,style:{display:"grid",placeItems:"center",textAlign:"center",padding:4,boxSizing:"border-box",fontSize:"0.6875rem",lineHeight:1.2,color:"var(--graview-ink-muted)",border:"1px dashed var(--graview-edge-bright)",borderRadius:F,...n},children:"removed later"})}function Q({file:e,size:n=56,style:i}){let r=S(),[a,l]=Z(e);return a?(0,t.jsx)(ee,{file:e,style:{width:n,height:n,flex:"none",...i}}):x(e)?(0,t.jsx)(Oe,{file:e,size:n,...i?{style:i}:{},onError:l}):(0,t.jsx)("img",{onError:l,src:w(r,e.href),alt:k(e),width:n,height:n,loading:"lazy",decoding:"async","data-graview-thumb":e.href,style:{width:n,height:n,objectFit:"cover",borderRadius:F,display:"block",flex:"none",background:"var(--graview-edge)",...i}})}function Fe(e){let[n,i]=(0,h.useState)({}),r=e.duration??n.duration;return[{...r!==void 0?{duration:r}:{},width:e.width??n.width,height:e.height??n.height},u=>{let s=u.currentTarget;i({...Number.isFinite(s.duration)&&s.duration>0?{duration:s.duration}:{},...s.videoWidth>0&&s.videoHeight>0?{width:s.videoWidth,height:s.videoHeight}:{}})}]}var ze=320,$e=(e,n)=>`${k(e)}, ${le({...n!==void 0?{duration:n}:{}})}`,Ne=(0,t.jsx)("span",{"data-graview-play-glyph":"","aria-hidden":"true",style:{position:"absolute",inset:0,display:"grid",placeItems:"center",pointerEvents:"none"},children:(0,t.jsxs)("svg",{viewBox:"0 0 24 24",width:"40%",height:"40%",style:{maxWidth:40,maxHeight:40,filter:"drop-shadow(0 1px 2px rgb(0 0 0 / 0.5))"},children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"11",fill:"rgb(0 0 0 / 0.55)"}),(0,t.jsx)("path",{d:"M9.5 7.5v9l7-4.5z",fill:"#fff"})]})});function Oe({file:e,size:n,style:i,onError:r}){let a=S(),[l,u]=Fe(e),s={width:n,height:n,objectFit:"cover",display:"block",borderRadius:F,background:"var(--graview-edge)"};return(0,t.jsxs)("span",{role:"img","aria-label":$e(e,l.duration),"data-graview-thumb":e.href,"data-graview-video-thumb":"",style:{position:"relative",display:"block",width:n,height:n,flex:"none",...i},children:[e.poster?(0,t.jsx)("img",{src:w(a,e.poster),alt:"",width:n,height:n,loading:"lazy",decoding:"async",onError:r,style:s}):(0,t.jsx)("video",{src:w(a,e.href),preload:"metadata",muted:!0,playsInline:!0,"aria-hidden":"true",tabIndex:-1,width:n,height:n,onLoadedMetadata:u,onError:r,style:s}),Ne,l.duration!==void 0?(0,t.jsx)("span",{"data-graview-video-clock":"","aria-hidden":"true",style:{position:"absolute",right:3,bottom:3,padding:"0 4px",borderRadius:4,background:"rgb(0 0 0 / 0.65)",color:"#fff",fontSize:"0.6875rem",lineHeight:"16px",fontVariantNumeric:"tabular-nums"},children:q(l.duration)}):null]})}function Ae({file:e}){let n=S(),[i,r]=Z(e),[a,l]=Fe(e);if(i)return(0,t.jsx)(ee,{file:e,style:{width:"100%",aspectRatio:"16 / 9"}});let u=a.width!==void 0&&a.height!==void 0;return(0,t.jsxs)("figure",{"data-graview-video-figure":e.href,style:{margin:0,display:"grid",gap:4,minWidth:0},children:[(0,t.jsx)("video",{"data-graview-video":e.href,src:w(n,e.href),...e.poster?{poster:w(n,e.poster)}:{},controls:!0,preload:"metadata",playsInline:!0,...u?{width:a.width,height:a.height}:{},"aria-label":$e(e,a.duration),onLoadedMetadata:l,onError:r,style:{display:"block",width:"100%",maxWidth:u?Math.max(a.width,ze):"100%",height:"auto",maxHeight:"80vh",aspectRatio:u?`${a.width} / ${a.height}`:"16 / 9",borderRadius:F,background:"#000"},children:e.captions?(0,t.jsx)("track",{kind:"captions",src:w(n,e.captions),srcLang:"en",label:"Captions",default:!0}):null}),(0,t.jsx)("figcaption",{"data-graview-video-said":"",style:P,children:[e.caption??e.name,...a.duration!==void 0?[q(a.duration)]:[]].join(" \xB7 ")})]})}function Ge({file:e,onOpen:n}){let i=S(),[r,a]=Z(e);return r?(0,t.jsx)(ee,{file:e,style:{width:"100%",aspectRatio:"1"}}):(0,t.jsx)("button",{type:"button","aria-label":`Open ${k(e)} full size`,onClick:l=>n(l.currentTarget),style:{padding:0,border:0,background:"none",cursor:"zoom-in",display:"block",width:"100%",borderRadius:F},children:(0,t.jsx)("img",{src:w(i,e.href),alt:k(e),loading:"lazy",decoding:"async",onError:a,style:{width:"100%",aspectRatio:"1",objectFit:"cover",borderRadius:F,display:"block",background:"var(--graview-edge)"}})})}function X({files:e,label:n}){let i=S(),r=d=>w(i,d.href),a=e.filter(E),l=e.filter(x),u=e.filter(d=>!E(d)&&!x(d)),[s,y]=(0,h.useState)(null),c=(0,h.useRef)(null),b=(0,h.useRef)(null);(0,h.useEffect)(()=>{let d=c.current;s!==null&&d&&!d.open&&d.showModal?.()},[s]);let p=s===null?void 0:a[s];return(0,t.jsxs)("div",{style:{display:"grid",gap:10,minWidth:0},children:[a.length>0?(0,t.jsx)("ul",{"data-graview-gallery":"","aria-label":n,style:{listStyle:"none",margin:0,padding:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(96px, 1fr))",gap:8},children:a.map((d,T)=>(0,t.jsx)("li",{style:{minWidth:0},children:(0,t.jsx)(Ge,{file:d,onOpen:R=>{b.current=R,y(T)}})},d.href))}):null,l.length>0?(0,t.jsx)("ul",{"data-graview-videos":"","aria-label":n,style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:12},children:l.map(d=>(0,t.jsx)("li",{style:{minWidth:0},children:(0,t.jsx)(Ae,{file:d})},d.href))}):null,u.length>0?(0,t.jsx)("ul",{"data-graview-documents":"",style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:10},children:u.map(d=>(0,t.jsxs)("li",{"data-graview-document":d.type,style:{display:"grid",gap:6,minWidth:0},children:[d.type==="application/pdf"?(0,t.jsx)("object",{data:r(d),type:"application/pdf","aria-label":k(d),style:{width:"100%",height:420,border:"1px solid var(--graview-edge)",borderRadius:F},children:(0,t.jsxs)("p",{style:{margin:0,padding:12},children:["This browser shows no PDF here: ",(0,t.jsxs)("a",{href:r(d),download:d.name,children:["download ",d.name]}),"."]})}):null,(0,t.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",gap:"2px 10px",alignItems:"baseline",minWidth:0,overflowWrap:"anywhere"},children:[(0,t.jsx)("a",{href:r(d),download:d.name,...d.type==="application/pdf"?{target:"_blank",rel:"noopener"}:{},children:d.name}),(0,t.jsxs)("span",{style:P,children:[z(d)," \xB7 ",_(d.bytes)]})]}),d.caption?(0,t.jsx)("span",{style:P,children:d.caption}):null]},d.href))}):null,p?(0,t.jsx)("dialog",{ref:c,"data-graview-full":p.href,"aria-label":k(p),onClose:()=>{y(null),b.current?.focus()},onClick:d=>{d.target===d.currentTarget&&d.currentTarget.close()},style:{padding:0,border:0,borderRadius:F,maxWidth:"min(96vw, 1600px)",maxHeight:"94vh",background:"var(--graview-panel)",color:"var(--graview-ink)"},children:(0,t.jsxs)("figure",{style:{margin:0,display:"grid",gap:8,padding:10},children:[(0,t.jsx)("img",{src:r(p),alt:k(p),style:{maxWidth:"100%",maxHeight:"80vh",objectFit:"contain",display:"block",margin:"0 auto"}}),(0,t.jsxs)("figcaption",{style:{display:"flex",gap:12,alignItems:"center",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:p.caption??p.name}),(0,t.jsx)("form",{method:"dialog",style:{margin:0},children:(0,t.jsx)("button",{type:"submit",autoFocus:!0,children:"Close"})})]})]})}):null]})}function xe({value:e,onChange:n,several:i,image:r,video:a=!1,label:l,thumbs:u=!0}){let s=S(),y=(0,h.useId)(),c=(0,h.useRef)(null),b=(0,h.useRef)(null),[p,d]=(0,h.useState)(null),[T,R]=(0,h.useState)(null),[te,H]=(0,h.useState)([]),[N,O]=(0,h.useState)(!1),W=r?"image/":a?"video/":void 0,C=s?W?s.kinds.filter(o=>o.startsWith(W)||o==="*"||o==="*/*"):s.kinds:[],Ce=s?s.kinds.length===0||C.length>0:!1,Pe=!a&&(s?s.kinds.length===0||(r?C:s.kinds).some(o=>o.startsWith("image/")||o.startsWith("*")):!1),L=!!s&&(!W||Ce),V=r?"picture":a?"video":"file",ne=i?`${V}s`:`a ${V}`,ae=W?C.length>0?C.join(","):`${W}*`:s?.kinds.join(",")||void 0,Re=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches,A=(0,h.useRef)(e);A.current=e;let ie=(0,h.useRef)(null),I=(0,h.useRef)(null);(0,h.useEffect)(()=>{let o=I.current;if(!o||o.from===e)return;I.current=null;let g=ie.current?.children,f=g?.[Math.min(o.at,g.length-1)];((o.what==="move"?f?.querySelector("[data-graview-file-move]"):null)??f?.querySelector("[data-graview-file-remove]")??c.current?.parentElement?.querySelector("[data-graview-file-choose]"))?.focus()});let D=async(o,g)=>{if(!s||o.length===0)return;let f=i?o:o.slice(0,1),m=[],$=[];f.length<o.length&&$.push(`${l} holds one ${V}, so ${o.slice(1).map(v=>`\u201C${v.name||"the photo"}\u201D`).join(", ")} ${o.length>2?"were":"was"} left out.`),H([]),R(null);for(let v of f){d(`Sending ${v.name||"the photo"}\u2026`);let G=await Be(v,s,{image:r,video:a,camera:g==="camera"});if("refused"in G){$.push(G.refused);continue}let M=await je(G,s,r,a);"refused"in M?$.push(M.refused):[...i?A.current:[],...m].some(Te=>Te.href===M.href)?$.push(`\u201C${M.name}\u201D is already here.`):m.push(M)}if(d(null),H($),m.length!==0)try{n(i?[...A.current,...m]:m.slice(-1)),R(`Added ${m.map(v=>v.name).join(", ")}.`)}catch(v){H([...$,v instanceof Error?v.message:String(v)])}},B=(o,g,f)=>{try{I.current=f?{...f,from:e}:null,n(o),R(g)}catch(m){I.current=null,H([m instanceof Error?m.message:String(m)])}},j=o=>o?Array.from(o):[],We=o=>{let g=j(o.clipboardData?.files);!L||g.length===0||(o.preventDefault(),D(g,"pasted"))},Me=o=>{O(!1),L&&(o.preventDefault(),D(j(o.dataTransfer?.files),"dropped"))};return(0,t.jsxs)("div",{role:"group","aria-labelledby":`${y}-label`,"data-graview-file-editor":"","data-graview-dropping":N?"":void 0,onPaste:We,onDragOver:o=>{L&&(o.preventDefault(),O(!0))},onDragLeave:()=>O(!1),onDrop:Me,style:{display:"grid",gap:8,minWidth:0,padding:N?6:0,outline:N?"2px dashed var(--graview-accent)":"none",borderRadius:F},children:[(0,t.jsx)("span",{id:`${y}-label`,style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"},children:l}),e.length>0&&(i||e.length>1)?(0,t.jsx)("ul",{ref:ie,style:{listStyle:"none",margin:0,padding:0,display:"grid",gap:6},children:e.map((o,g)=>(0,t.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",minWidth:0},children:[u&&(E(o)||x(o))?(0,t.jsx)(Q,{file:o,size:40}):null,(0,t.jsx)("span",{style:{flex:"1 1 8rem",minWidth:0,overflowWrap:"anywhere"},children:o.name}),(0,t.jsx)(ve,{file:o,onCaption:f=>B(e.map((m,$)=>$===g?be(m,f):m),f?`${o.name} now says \u201C${f}\u201D.`:`${o.name} says its name again.`)}),i&&g>0?(0,t.jsx)("button",{type:"button","data-graview-file-move":"","aria-label":`Move ${o.name} earlier`,onClick:()=>B(e.map((f,m)=>m===g-1?o:m===g?e[g-1]:f),`Moved ${o.name} earlier.`,{at:g-1,what:"move"}),children:"\u2191"}):null,i?(0,t.jsx)("button",{type:"button","data-graview-file-remove":"","aria-label":`Remove ${o.name}`,onClick:()=>B(e.filter((f,m)=>m!==g),`Removed ${o.name}.`,{at:g,what:"remove"}),children:"Remove"}):null]},`${g}:${o.href}`))}):e.length===1?(0,t.jsx)(ve,{file:e[0],onCaption:o=>B([be(e[0],o)],o?`${e[0].name} now says \u201C${o}\u201D.`:`${e[0].name} says its name again.`)}):null,L?(0,t.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center"},children:[(0,t.jsx)("input",{ref:c,type:"file",hidden:!0,multiple:i,...ae?{accept:ae}:{},"data-graview-file-input":"","aria-label":`Choose ${ne}`,onChange:o=>{let g=j(o.currentTarget.files);o.currentTarget.value="",D(g,"picked")}}),(0,t.jsx)("button",{type:"button",disabled:p!==null,onClick:()=>c.current?.click(),"data-graview-file-choose":"",children:e.length>0&&!i?`Replace the ${V}`:`Choose ${ne}`}),Pe?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:b,type:"file",hidden:!0,accept:"image/*",capture:"environment","data-graview-photo-input":"","aria-label":"Take a photo",onChange:o=>{let g=j(o.currentTarget.files);o.currentTarget.value="",D(g,"camera")}}),Re?(0,t.jsx)("button",{type:"button",disabled:p!==null,onClick:()=>b.current?.click(),children:"Take a photo"}):null]}):null,(0,t.jsxs)("span",{style:P,"data-graview-file-takes":"",children:["or drop or paste ",i?"them":"it"," here \xB7 ",s.kinds.length>0?we(C.length>0?C:s.kinds):"any file",", up to ",_(s.maxBytes)]})]}):(0,t.jsx)("p",{style:{...P,margin:0},"data-graview-file-none":"",children:s?`This host doesn\u2019t take ${a?"videos":"pictures"}, so none can be added here.`:"This host doesn\u2019t take files, so none can be added here."}),(0,t.jsx)("p",{"aria-live":"polite",style:{...P,margin:0,minHeight:p||T?void 0:0},"data-graview-file-status":"",children:p??T??""}),te.length>0?(0,t.jsx)("div",{role:"alert","data-graview-file-refused":"",style:{color:"var(--graview-warn)",fontSize:"0.875rem",display:"grid",gap:2},children:te.map((o,g)=>(0,t.jsx)("p",{style:{margin:0},children:o},g))}):null]})}var be=(e,n)=>{let{caption:i,...r}=e;return n?{...r,caption:n}:r};function ve({file:e,onCaption:n}){let[i,r]=(0,h.useState)(e.caption??"");(0,h.useEffect)(()=>r(e.caption??""),[e.caption]);let a=()=>{let l=i.trim().slice(0,500);l!==(e.caption??"")&&n(l)};return(0,t.jsx)("input",{type:"text",value:i,placeholder:E(e)||x(e)?"What it shows":"What it is","aria-label":`What ${e.name} ${E(e)||x(e)?"shows":"is"}`,"data-graview-file-caption":e.href,onChange:l=>r(l.target.value),onBlur:a,onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),a())},style:{flex:"1 1 10rem",minWidth:0,font:"inherit",fontSize:"0.875rem",minHeight:24}})}function Se({field:e,label:n,labelStyle:i,valueStyle:r,style:a,children:l}){return(0,t.jsxs)("div",{"data-graview-files":e,style:{display:"grid",gap:6,minWidth:0,gridColumn:"1 / -1",...a},children:[(0,t.jsx)("dt",{style:i,children:n}),(0,t.jsx)("dd",{style:{margin:0,minWidth:0,display:"grid",gap:10,...r},children:l})]})}function Ee(e){let{nodeId:n,field:i,label:r,files:a}=e,{fields:l,commit:u}=pe(n),s=l.find(p=>p.field===i&&p.takesValue),y=s?.shape,c=y?.type==="several"?y.of:y,b=y?.type==="several";return a.length===0&&c?.type!=="file"?null:(0,t.jsxs)(Se,{...e,children:[(0,t.jsx)(X,{files:a,label:r}),s&&c?.type==="file"?(0,t.jsx)(xe,{value:a,thumbs:!1,several:b,image:c.image===!0,video:c.video===!0,label:r,onChange:p=>{let d=b?p:p[p.length-1];d!==void 0&&u(s,d)}}):null]})}function et(e){switch(e.as){case"field":return e.read?e.files.length>0?(0,t.jsx)(Se,{...e,children:(0,t.jsx)(X,{files:e.files,label:e.label})}):null:(0,t.jsx)(Ee,{...e});case"unfilled":return(0,t.jsx)(Ue,{...e});case"thumb":return(0,t.jsx)(Q,{...e});case"block":return e.files.length>0?(0,t.jsx)("span",{className:"graview-spec-image","data-graview-field":e.field,"data-graview-image":e.view,style:{display:"block",minWidth:0,...e.view==="gallery"?{position:"relative",zIndex:se.raised}:{}},children:e.view==="thumb"?(0,t.jsx)(Q,{file:e.files[0],size:72}):(0,t.jsx)(X,{files:e.files,label:e.label})}):null;case"control":{let n=(0,t.jsx)(xe,{value:Y(e.value),several:e.several,image:e.image,video:e.video===!0,label:e.label,onChange:i=>e.onChange(e.several?i:i[i.length-1])});return e.title===void 0?n:(0,t.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":e.several?"files":"file",children:[(0,t.jsx)("legend",{"data-graview-part":"label",children:e.title}),n]})}}}function Ue({nodeId:e,skip:n,labels:i,labelStyle:r,style:a}){let{store:l}=ce(),u=ge(e),s=u?l.schema.tryDefinition(u.kind):void 0,y=he(s).filter(c=>!n.includes(c)&&!(s?.display?.hide??[]).includes(c)&&Y(u?.[c]).length===0);return y.length===0?null:(0,t.jsx)("dl",{style:{margin:0,display:"grid",gap:14,minWidth:0},children:y.map(c=>(0,t.jsx)(Ee,{nodeId:e,field:c,label:i?.[c]??re(s,c),files:[],...r?{labelStyle:r}:{},...a?{style:a}:{}},c))})}export{xe as FilesEditor,Le as SEND_EDGE,et as drawFiles,we as kindsWords,Be as prepare,je as send,_ as sizeWords,ke as takes,z as typeWords};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{H as k,S as n,a as t,oa as o}from"./chunk.MQ7FNHXG.js";import{b as p}from"./chunk.AJZBJBMO.js";var f=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.2EJAIT33.js","./chunk.EUGWV3S6.js","./chunk.6XJP7F3I.js","./chunk.NPX7SPXM.js","./chunk.OE4QOBJF.js","./chunk.74RMHUCX.js","./chunk.GZHZLJBF.js","./chunk.I3SQJ2L2.js","./chunk.OJGHDWI6.js","./chunk.FUJM7GDV.js","./chunk.MWZK3HVG.js","./chunk.3D5T3XIE.js","./chunk.GR5Q4HTW.js","./chunk.QT4XGC5Z.js","./chunk.MQ7FNHXG.js","./chunk.WLPTY4BF.js","./chunk.AJZBJBMO.js"]),import("./chunk.NWWMUOZM.js")))),y=f.part((e,r)=>e.drawFiles(r),{quiet:!0});var d=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.I3SQJ2L2.js","./chunk.OJGHDWI6.js","./chunk.FUJM7GDV.js","./chunk.MWZK3HVG.js","./chunk.3D5T3XIE.js","./chunk.GR5Q4HTW.js","./chunk.QT4XGC5Z.js","./chunk.MQ7FNHXG.js","./chunk.WLPTY4BF.js","./chunk.AJZBJBMO.js"]),import("./chunk.HVTGPEVW.js")))),I=d.part((e,r)=>e.drawLinkedRecord(r),{quiet:!0}),w=d.part((e,r)=>e.drawLinkedPicker(r),{what:"Picking a linked record"});var s=p(n(),1),m=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.I3SQJ2L2.js","./chunk.OJGHDWI6.js","./chunk.FUJM7GDV.js","./chunk.MWZK3HVG.js","./chunk.3D5T3XIE.js","./chunk.GR5Q4HTW.js","./chunk.QT4XGC5Z.js","./chunk.MQ7FNHXG.js","./chunk.WLPTY4BF.js","./chunk.AJZBJBMO.js"]),import("./chunk.SITFEJES.js")))),E=m.part((e,r)=>(0,s.jsx)(e.RepeatPicker,{...r}),{quiet:!0}),W=m.part((e,r)=>(0,s.jsx)(e.RepeatEditor,{...r}),{quiet:!0});var a=p(k(),1),i=p(n(),1),c=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.MWZK3HVG.js","./chunk.3D5T3XIE.js","./chunk.GR5Q4HTW.js","./chunk.QT4XGC5Z.js","./chunk.MQ7FNHXG.js","./chunk.WLPTY4BF.js","./chunk.AJZBJBMO.js"]),import("./chunk.DFVVS6C5.js")))),l=c.part((e,r)=>(0,i.jsx)(e.WhenInput,{...r}),{quiet:!0});function M(e){return(0,i.jsx)(a.Suspense,{fallback:(0,i.jsx)("span",{"data-graview-when-arriving":"",style:{display:"inline-block",minHeight:24}}),children:(0,i.jsx)(l,{...e})})}var N=()=>c.load().then(()=>{},()=>{});export{y as a,I as b,w as c,E as d,W as e,M as f,N as g};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as J,b as We}from"./chunk.5A4AOFOA.js";import"./chunk.KSXB4LDF.js";import"./chunk.DL637Q3W.js";import{i as $e,j as Re,k as Le}from"./chunk.L73VUBXN.js";import"./chunk.6ONRWFA6.js";import"./chunk.HJCQ6I3S.js";import"./chunk.GZ3IXNA4.js";import"./chunk.FMVWXSQ7.js";import"./chunk.TKSGC6XH.js";import"./chunk.IM7LXLIB.js";import"./chunk.IEDXW36H.js";import{a as Pe,b as k}from"./chunk.7RSZMIAL.js";import"./chunk.6IHXTT6Z.js";import"./chunk.OEF3GPRM.js";import"./chunk.33GN2NUT.js";import"./chunk.2VIGF4FO.js";import"./chunk.5MSO3KRO.js";import"./chunk.QYRPELLU.js";import"./chunk.FTJBW25J.js";import{b as ze,c as Ee}from"./chunk.UT6642FC.js";import"./chunk.MCVY6RRS.js";import"./chunk.RZVZG2BQ.js";import"./chunk.TI4OSTQV.js";import"./chunk.V2NBJDAX.js";import"./chunk.2EJAIT33.js";import"./chunk.EUGWV3S6.js";import"./chunk.6XJP7F3I.js";import"./chunk.NPX7SPXM.js";import"./chunk.OE4QOBJF.js";import"./chunk.74RMHUCX.js";import{u as Ie}from"./chunk.I3SQJ2L2.js";import"./chunk.OJGHDWI6.js";import"./chunk.FUJM7GDV.js";import{g as Ce}from"./chunk.MWZK3HVG.js";import"./chunk.3D5T3XIE.js";import{c as Me}from"./chunk.GR5Q4HTW.js";import{m as He}from"./chunk.QT4XGC5Z.js";import{$ as N,Ba as Te,H as tt,S as Se,i as xe,sa as Q,v as ke,xa as Ae}from"./chunk.MQ7FNHXG.js";import{Ub as ye,Vb as we,ja as K,ka as W,qc as be,tb as ve}from"./chunk.WLPTY4BF.js";import{b as G}from"./chunk.AJZBJBMO.js";var o=G(tt(),1);var t=G(Se(),1);function mt(d,r,a){let p=r.on??r.about[r.about.length-1];$e(d,r.about,{...a,pins:J(),...p===void 0?{}:{focus:p}})}function ft({placement:d="float",chosen:r=!0}={}){let{menuAt:a}=N();return d==="menu"&&a===null?r?(0,t.jsx)(nt,{}):null:(0,t.jsx)(it,{placement:d})}function nt(){let{store:d,setMenuAt:r,view:a}=N(),{selection:p}=Q(),h=(0,o.useRef)(null),[H,v]=(0,o.useState)(null);(0,o.useLayoutEffect)(()=>{let b=h.current?.offsetParent??h.current?.parentElement;if(!b)return;let m=Math.round(b.getBoundingClientRect().width);m!==H&&v(m)});let y=p.length===1&&!a.overview?d.graph.getNode(p[0]):void 0;return!y||H===null||H>=De?(0,t.jsx)("span",{ref:h,hidden:!0}):(0,t.jsx)("button",{type:"button",ref:h,"data-testid":"chosen-acts","aria-label":`What can be done with ${k(d,y.id)}`,"aria-haspopup":"menu",onClick:b=>{let m=b.currentTarget.getBoundingClientRect();r({x:Math.round(m.right),y:Math.round(m.bottom+4),on:y.id})},style:{position:"absolute",right:"calc(14px + var(--graview-dock, 0px))",top:98,zIndex:"var(--graview-layer-overview, 10)",minHeight:30,padding:"0 12px",borderRadius:8,fontSize:"0.8125rem",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)"},children:"Acts\u2026"})}var De=564;function it({placement:d}){let{store:r,menuAt:a,setMenuAt:p,view:h,signIn:H}=N(),v=(0,o.useRef)(null),y=(0,o.useRef)(null),b=(0,o.useRef)(null),m=(0,o.useRef)(null);a?.returnTo&&(m.current=a.returnTo);let Oe=e=>{let i=e.closest("[data-graview-asking]")?.getAttribute("data-graview-asking"),n=e.getAttribute("data-pin-for"),g=i??e.getAttribute("data-affordance")??(n===null?null:`pin:${n}`)??e.getAttribute("data-menu-item");y.current=g===null?null:{key:g,element:e}};(0,o.useEffect)(()=>{let e=v.current,i=y.current;if(i===null||document.activeElement!==document.body||i.element.isConnected)return;let n=i.key;if(!e){y.current=null;let I=m.current;m.current=null,(I?.isConnected?I:b.current)?.focus();return}((n.startsWith("pin:")?e.querySelector(`[data-pin-for="${CSS.escape(n.slice(4))}"]`):null)??e.querySelector(`[data-affordance="${CSS.escape(n)}"]:not([disabled])`)??e).focus()});let[Fe,qe]=(0,o.useState)(null);(0,o.useLayoutEffect)(()=>{let e=v.current?.offsetParent??v.current?.parentElement;if(e instanceof HTMLElement&&(b.current=e),!e)return;let i=e.getBoundingClientRect();qe(n=>n&&n.left===i.left&&n.top===i.top&&n.width===i.width&&n.height===i.height?n:{left:i.left,top:i.top,width:i.width,height:i.height})});let{selection:Be,set:je,clear:_e}=Q(),s=a?.about??Be,[D,Ue]=(0,o.useState)(()=>J()),O=a?.on??s[s.length-1],F=a?.about,Ve=(0,o.useMemo)(()=>({pins:D,...O===void 0?{}:{focus:O},...F?{about:F}:{}}),[D,O,F]),Ye=(0,o.useMemo)(()=>new Set(r.allMutations().filter(e=>e.pinned).map(e=>e.name)),[r]),{affordances:c,withheld:X,observations:Z}=Re(Ve),M=we(X,H),f=M?rt:X,Ge=a===null?null:{face:a.face??"scene",on:a.on,about:s,field:a.field,place:a.place,href:a.href,act:a.act,element:a.returnTo},ee=Ie(Ge),te=Z.some(e=>e.id.startsWith("schema:waits:")),{apply:Ke,preview:Qe}=Le(),[C,z]=(0,o.useState)(null),[Je,ne]=(0,o.useState)(!1),[ie,re]=(0,o.useState)(!1),[P,$]=(0,o.useState)(""),[ae,q]=(0,o.useState)(null),B=(0,o.useRef)([]),j=(e,i)=>{try{return Qe(e,i),Ke(e,i),q(null),p(null),B.current=[],!0}catch(n){return q(Ce(r.schema,r.allMutations(),n)),B.current=n instanceof ve?n.issues.map(g=>String(g.path[0]??"")).filter(Boolean):[],!1}},R=[...new Set(s.flatMap(e=>{let i=r.graph.getNode(e);return i?[i.kind]:[]}))],x=R.length>0?R:[...new Set(s.flatMap(e=>ke(e)))],u=s.length===1?xe(s[0]):null,_=u?{from:r.graph.getNode(u.from),to:r.graph.getNode(u.to)}:null,oe=u?Ee(r,u):void 0,le=oe?.provisional?oe:void 0,se=u?(()=>{let e=r.schema.tryDefinition(r.graph.getNode(u.from)?.kind??"")?.edges?.[u.kind],i=r.graph.getNode(u.to);return e?.inverse&&i?`From ${k(r,i.id)}: ${e.inverse}`:null})():null;(0,o.useEffect)(()=>{z(null),ne(!1),re(!1),q(null),$("")},[s,a?.about]);let l=a!==null,Xe=d==="menu"&&!l,S=(0,o.useRef)(a);S.current=a;let de=Te("acts",{open:l&&d==="menu",onOpenChange:e=>{e||p(null)},at:()=>S.current?{x:S.current.x,y:S.current.y}:null,returnTo:()=>{let e=S.current?.returnTo;if(e?.isConnected)return e;let i=S.current?.on;return i?document.querySelector(`[data-graview-view="${CSS.escape(i)}"]`):null},align:"start"}),ue=(Fe?.width??Number.POSITIVE_INFINITY)<De;if((0,o.useLayoutEffect)(()=>{let e=v.current?.offsetParent;if(!e||!ue||l)return;let i=v.current?.getBoundingClientRect().height??0,n=`${Math.round(i)+20}px`;if(e.style.paddingBottom===n)return;let g=e.style.paddingBottom;return e.style.paddingBottom=n,()=>{e.style.paddingBottom=g}}),s.length===0&&!l)return null;let pe=a?.title!==void 0||s.length>0&&!(s.length===1&&s[0]===h.focusId),ce=Math.max(1,Math.min(9,c.length)),A=[...c.filter(e=>e.provider==="invariant"&&!e.destructive),...c.filter(e=>e.pinned&&e.provider!=="invariant"&&!e.destructive),...c.filter(e=>!e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...c.filter(e=>e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...c.filter(e=>e.destructive)],ge=A.length>ce&&!l,he=P.trim().toLowerCase(),w=ge&&he.length>0?A.filter(e=>`${e.label} ${e.why}`.toLowerCase().includes(he)):null,U=w??(Je||l?A:A.slice(0,ce)),me=w?0:A.length-U.length,L=[];for(let e of U){let i=!l&&e.provider==="invariant",n=!l&&!i&&e.pinned!==void 0&&!e.destructive,g=!l&&!i&&!n&&e.ties===!0&&!e.destructive,I=i?e.why:n?"pinned":g?"its ties":null,et=i?"violation":n||g?"ties":null,Y=L[L.length-1];Y&&Y.heading===I?Y.items.push(e):L.push({heading:I,tone:et,items:[e]})}let V=c.find(e=>e.id===C),E=s.length===1?k(r,s[0]):null,fe=e=>{if(!E)return e;let i=e.startsWith(`"${E}"`)?e.slice(E.length+2):e.startsWith(E)?e.slice(E.length):null;if(i===null)return e;let n=i.trimStart();return n.length===0?e:n[0].toUpperCase()+n.slice(1)},Ze=new Set(l?[]:U.filter(e=>e.provider==="invariant").map(e=>e.why)),T=Z.filter(e=>!Ze.has(e.text)).map(e=>({...e,text:fe(e.text)}));return Xe?null:(0,t.jsxs)("section",{...l?de.pane:{},ref:e=>{v.current=e,l&&de.pane.ref(e)},"aria-label":"Inspector","data-graview-offstage":"","data-testid":l?"context-menu":"inspector-strip",tabIndex:-1,onFocus:e=>Oe(e.target),onBlur:e=>{e.relatedTarget!==null&&(y.current=null)},onMouseDown:e=>e.stopPropagation(),style:{...l?Ae:{position:"absolute",zIndex:be("rail")},boxSizing:"border-box",display:"flex",flexDirection:"column",gap:7,padding:"9px 12px",borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",...l?{width:300,maxHeight:"min(52cqh, 420px)",overflow:"auto"}:ue?{left:10,right:10,width:"auto",bottom:10,maxHeight:"min(42cqh, 300px)",overflow:"auto"}:{left:14,top:h.overview?"min(296px, 38cqh)":44,width:236,maxHeight:h.overview?"calc(100cqh - min(296px, 38cqh) - 20px)":"calc(68cqh - 94px)",overflow:"auto"}},children:[(0,t.jsx)("h2",{style:{...He,margin:0},children:"Inspector"}),(0,t.jsxs)("div",{style:{display:pe||!l?"flex":"none",alignItems:"baseline",flexWrap:"wrap",gap:"2px 8px",minWidth:0,paddingRight:l?0:24},children:[pe?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("strong",{style:{fontSize:"0.9375rem",whiteSpace:"nowrap"},children:a?.title??(s.length===1?k(r,s[0]):`${s.length} selected`)}),R.length>0||u?(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:u?"relation":R.map(e=>W(r.schema.tryDefinition(e),e)).join(" \xB7 ")}):null,s.length===1&&!u&&a?.face!=="pages"?(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:h.expanded.includes(s[0])?"\xB7 double-click closes":"\xB7 double-click opens"}):null]}):null,(0,t.jsx)("span",{style:{flex:"1 1 auto"}})]}),l?null:(0,t.jsx)("button",{type:"button",onClick:()=>{p(null),_e()},"aria-label":"Clear selection",title:"Clear selection",style:{position:"absolute",top:6,right:6,flex:"0 0 auto",width:24,height:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.875rem",lineHeight:1,borderRadius:7},children:"\xD7"}),u&&_?(0,t.jsxs)("div",{style:{display:"grid",gap:6},children:[se?(0,t.jsx)("p",{"data-testid":"edge-said",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:se}):null,le?(0,t.jsx)("p",{"data-testid":"edge-provisional",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:ze(le)}):null,(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[["from",_.from],["to",_.to]].map(([e,i],n)=>(0,t.jsxs)(o.Fragment,{children:[n===1?(0,t.jsx)("span",{"aria-hidden":"true",style:{color:"var(--graview-ink-faint)"},children:"\u2192"}):null,i?(0,t.jsx)("button",{type:"button","data-testid":`edge-${e}`,onClick:()=>je([i.id]),title:`Select ${k(r,i.id)}`,style:{fontSize:"0.8125rem",padding:"3px 9px",borderRadius:6},children:k(r,i.id)}):(0,t.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:"gone"})]},e))})]}):null,!u&&s.length===1&&ye(r,s[0])?(0,t.jsx)("p",{"data-testid":"left-alone",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:"Left alone: nothing automated changes it."}):null,T.length>0?(0,t.jsx)("div",{"data-testid":"observations",title:T.map(e=>e.text).join(`
|
|
2
|
-
`),style:{display:"grid",gap:3},children:T.slice(0,2).map(e=>(0,t.jsxs)("p",{style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:[e.text,e===T[1]&&T.length>2?(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" +",T.length-2]}):null]},e.id))}):null,l?ee.start.map(e=>(0,t.jsx)(Ne,{section:e,close:()=>p(null)},e.id)):null,ae?(0,t.jsx)("p",{"data-testid":"refused",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-warn)"},children:ae}):null,ge?(0,t.jsx)("input",{"data-testid":"action-filter",value:P,onChange:e=>$(e.target.value),placeholder:`Filter ${A.length} actions\u2026`,"aria-label":"Filter actions",onKeyDown:e=>{if(e.key==="Escape"){e.stopPropagation(),P.length>0?$(""):e.currentTarget.blur();return}if(e.key==="Enter"&&w?.length===1){let i=w[0];if(i.destructive)return;i.open.length>0?z(i.id):j(i)&&$("")}},style:{font:"inherit",fontSize:"0.875rem",padding:"5px 9px",borderRadius:8,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):null,w!==null&&w.length===0?(0,t.jsxs)("p",{"data-testid":"no-matches",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:["Nothing offered here matches \u201C",P.trim(),"\u201D."]}):null,M&&c.length===0||c.length===0&&!te&&s.length===0?null:c.length===0&&!te?(0,t.jsx)("p",{"data-testid":"no-affordances",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:f.length>0?`Nothing you may do with ${u?"this relation":x.length===1?K(W(r.schema.tryDefinition(x[0]),x[0])):"this mix of kinds"} \u2014 ${f.length} action${f.length===1?"":"s"} withheld.`:u?`Nothing can be done with this line yet \u2014 nothing this app declares makes or breaks \u201C${Me(r.schema,r.graph.getNode(u.from)?.kind??"",u.kind,"out")}\u201D.`:`Nothing can be done with ${x.length===1?K(W(r.schema.tryDefinition(x[0]),x[0])):"this mix of kinds"} yet \u2014 nothing this app declares acts on ${x.length===1?"it":"them"}.`}):(0,t.jsxs)("ol",{"data-testid":"affordances",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[L.map((e,i)=>(0,t.jsxs)(o.Fragment,{children:[e.heading?(0,t.jsxs)("li",{"data-graview-heading":e.tone,style:{fontSize:"0.75rem",lineHeight:1.4,color:e.tone==="violation"?"var(--graview-warn)":"var(--graview-ink-faint)",...e.tone!=="violation"?{letterSpacing:"0.12em",textTransform:"uppercase",fontSize:"0.75rem"}:{},padding:"2px 2px 1px",marginTop:i>0?6:0},children:[e.tone==="violation"?"\u26A0 ":"",e.tone==="violation"?fe(e.heading):e.heading]}):i>0?(0,t.jsx)("li",{"aria-hidden":"true",style:{borderTop:"1px solid var(--graview-edge)",margin:"6px 0 3px"}}):null,e.items.map(n=>(0,t.jsxs)("li",{style:{display:"flex",gap:2,alignItems:"stretch"},children:[(0,t.jsxs)("button",{type:"button","data-affordance":n.id,"data-rank":n.rank,"data-graview-destructive":n.destructive||void 0,"aria-pressed":C===n.id,title:n.why,style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:C===n.id?"var(--graview-accent)":l?"transparent":"var(--graview-edge)",background:l?"none":"var(--graview-panel)",boxShadow:"none",...n.destructive?{color:"var(--graview-warn)"}:{},...C===n.id?{color:"var(--graview-accent)"}:{}},onClick:()=>{if(n.open.length>0){z(C===n.id?null:n.id);return}j(n)},children:[n.label,n.open.length>0?(0,t.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:" \u2026"}):null,w?.length===1&&w[0]?.id===n.id&&!n.destructive?(0,t.jsx)("span",{"aria-hidden":"true",title:"Enter runs it",style:{float:"right",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:"\u21B5"}):null]}),(0,t.jsx)("button",{type:"button","data-testid":"pin-toggle","data-pin-for":n.mutation,"aria-pressed":n.pinned!==void 0,"aria-label":n.pinned!==void 0?`Unpin ${n.label}`:`Pin ${n.label}`,title:n.pinned==="declared"?"Pinned by the app \u2014 unpin it for yourself":n.pinned==="user"?"Unpin":"Pin to the top",onClick:()=>Ue(We(D,n.mutation,Ye.has(n.mutation))),style:{flex:"0 0 auto",width:24,minHeight:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.75rem",border:"1px solid transparent",background:"none",boxShadow:"none",borderRadius:7,color:n.pinned==="user"?"var(--graview-accent)":n.pinned==="declared"?"var(--graview-ink-muted)":"var(--graview-ink-faint)"},children:n.pinned!==void 0?"\u2605":"\u2606"})]},n.id))]},`${e.heading??"plain"}-${i}`)),me>0?(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button",onClick:()=>ne(!0),title:`Show all ${c.length} actions`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",me," more"]})}):null]}),M?(0,t.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>{p(null),M.run()},style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left"},children:M.label}):null,f.length>0?(0,t.jsxs)("ul",{"data-testid":"withheld",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[f.slice(0,l||ie?f.length:3).map(e=>(0,t.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,t.jsx)("button",{type:"button",disabled:!0,"data-affordance":e.id,"data-rank":e.rank,"data-withheld":e.refusal.wouldNeed.join(",")||"nobody",style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8,borderStyle:"dashed",width:"100%",textAlign:"left",background:"none"},children:(0,t.jsx)("s",{children:e.label})}),(0,t.jsx)("span",{"data-testid":"withheld-why",style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-ink-muted)",padding:"0 10px"},children:e.refusal.message})]},e.id)),!l&&!ie&&f.length>3?(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-testid":"withheld-more",onClick:()=>re(!0),title:`Show all ${f.length} actions this seat may not take`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",f.length-3," more withheld"]})}):null]}):null,l?ee.end.map(e=>(0,t.jsx)(Ne,{section:e,close:()=>p(null)},e.id)):null,V?(0,t.jsx)(Pe,{affordance:V,onApply:e=>{if(j(V,e))z(null);else return B.current},onCancel:()=>z(null)}):null]})}var rt=[];function Ne({section:d,close:r}){return(0,t.jsxs)("div",{"data-menu-section":d.id,...d.heading?{role:"group","aria-label":d.heading}:{},style:{display:"grid",gap:2,borderTop:"1px solid var(--graview-edge)",paddingTop:5},children:[d.heading?(0,t.jsx)("p",{"aria-hidden":"true",style:{margin:0,padding:"2px 2px 1px",fontSize:"0.75rem",lineHeight:1.4,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:d.heading}):null,d.items&&d.items.length>0?(0,t.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:2},children:d.items.map(a=>(0,t.jsx)("li",{children:(0,t.jsxs)("button",{type:"button","data-menu-item":a.id,onClick:()=>{r(),a.run()},style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:"transparent",background:"none",boxShadow:"none"},children:[a.label,a.hint?(0,t.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",a.hint]}):null]})},a.id))}):null,d.render?.(r)]})}export{ft as InspectorPane,mt as prepareActs};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as J,C as Q,E as X,I as Y,K as ee,N as ne,a as I,i as Z,l as z,p as D,s as W,t as _,x as j,y as U}from"./chunk.QT4XGC5Z.js";import{$ as T,H as se,S as N,ba as $,na as G,pa as K,wa as q}from"./chunk.MQ7FNHXG.js";import{Ic as V,Xb as M,ec as P,gc as O}from"./chunk.WLPTY4BF.js";import{b as A}from"./chunk.AJZBJBMO.js";var o=A(se(),1);function ce(e){let t=[e?.typography?.body,e?.typography?.display,e?.typography?.mono],n=[];for(let a of t){let r=a?.split(",")[0]?.trim().replace(/^["']|["']$/g,"");!r||O(r)||r.toLowerCase()!==M.toLowerCase()&&(n.includes(r)||n.push(r))}return n}function te(e){let t=ce(e);return t.length===0?null:`https://fonts.googleapis.com/css2?${t.map(a=>`family=${encodeURIComponent(a).replace(/%20/g,"+")}:wght@400;500;600;700`).join("&")}&display=swap`}var l=A(N(),1);function Se({rootRef:e,firstLook:t,app:n}){let a=(0,o.useCallback)(()=>e.current,[e]);return t?(0,l.jsx)(ne,{firstLook:t,root:a,app:n}):null}function ve(e,t){let{app:n}=e,a=(0,o.useMemo)(()=>{let r=Y(t(n.schema,n.viewSpecs),n),i=e.views?G(r,e.views(n.schema,r)):r;return ee(i,n.schema,Q(e.brand??n.brand,n.schema)),i},[e.views,n.schema,n.viewSpecs,n.lenses,n.pages,n.home]);return K(a,e.keptViews)}function de(e,t){return new V({schema:e.schema,mutations:e.mutations??[],invariants:e.invariants??[],...t?{snapshot:t}:{},...e.policy?{policy:e.policy}:{},...e.intelligence?{intelligence:e.intelligence}:{},...e.brand?.timeZone?{timeZone:e.brand.timeZone}:{}})}function re(e){if(typeof document>"u")return e==="dark"?"dark":"light";let t=document.documentElement.dataset.theme;return t==="dark"||t==="light"?t:e==="dark"||e==="light"?e:typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function le(e,t){let[n,a]=(0,o.useState)(()=>re(t));return(0,o.useEffect)(()=>{if(!e||typeof document>"u")return;let r=()=>a(re(t));r();let i=new MutationObserver(r);i.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});let d=typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):null;return d?.addEventListener?.("change",r),()=>{i.disconnect(),d?.removeEventListener?.("change",r)}},[e,t]),n}var x=e=>e?e.getBoundingClientRect().height:0;function we(e,t,n){let a=(0,o.useRef)(n);a.current=n;let r=n!==void 0;(0,o.useLayoutEffect)(()=>{let i=e.current;if(!i||!r)return;let d=()=>{let u=[...i.children],b=u.find(S=>S.hasAttribute("data-graview-app-bar")),y=u.find(S=>S.hasAttribute("data-embed-content")),h=y?.querySelector("[data-embed-measure]")??null,c=u.find(S=>S.hasAttribute("data-graview-place-line"));return{strip:b,line:c,content:y,measure:h}},s=-1,f=()=>{let{strip:u,line:b,content:y,measure:h}=d(),c=Math.ceil(x(u)+x(b)+x(h||y));c!==s&&(s=c,a.current?.(c))};if(f(),typeof ResizeObserver>"u")return;let m=new ResizeObserver(f),E=()=>{m.disconnect();let{strip:u,line:b,content:y,measure:h}=d();for(let c of[i,u,b,y,h])c&&m.observe(c)};E();let g=new MutationObserver(()=>{E(),f()});return g.observe(i,{childList:!0}),()=>{m.disconnect(),g.disconnect()}},[e,t,r])}var Ee=480,ue=0;function Re(e){let{app:t,seed:n,scheme:a="auto",brand:r=t.brand,fonts:i=!0,height:d="100%",label:s}=e,f=(0,o.useRef)(null);q(f);let m=d==="viewport"?"100dvh":d,E=z(typeof m=="string"&&/vh\b/.test(m)),g=(0,o.useMemo)(()=>`graview-embed-${++ue}`,[]),u=(0,o.useMemo)(()=>e.store??e.remote?.store??de(t,n),[e.store,e.remote,t,n]),b=e.presence??e.remote?.presence,y=e.hostContext?.theme,h=le(a==="auto"&&y===void 0,r?.scheme),c=a==="auto"?y??h:a,S=(0,o.useMemo)(()=>I(c,r,{scope:`.${g}`}),[c,r,g]);Z(e.favicon?P(r):void 0),(0,o.useEffect)(()=>{if(!i||typeof document>"u")return;let w=te(r);if(!w||document.querySelector(`link[href="${w}"]`))return;let p=document.createElement("link");p.rel="stylesheet",p.href=w,document.head.appendChild(p)},[r,i]);let L=(0,o.useRef)(void 0);(0,o.useLayoutEffect)(()=>{let w=f.current,p=L.current;if(L.current=s,!w||!s)return;let ie=v=>{let R=v.getAttribute("aria-label")??"",k=p&&p!==s?R.startsWith(`${p} \xB7 `)?R.slice(p.length+3):R===p?"":R:R;k===s&&(v.getAttribute("role")==="region"||v.tagName==="SECTION"&&!v.hasAttribute("role"))&&v.setAttribute("role","group");let B=k.startsWith(`${s} \xB7 `)||k===s?k:k?`${s} \xB7 ${k}`:s;B!==R&&v.setAttribute("aria-label",B)},H=()=>w.querySelectorAll("aside, nav, main, header, footer, section[aria-label]:not([role]), [role=region], [role=complementary], [role=navigation], [role=search]").forEach(v=>{v.hasAttribute("data-graview-named-by-lens")||ie(v)});H();let C=new MutationObserver(H);return C.observe(w,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["aria-label"]}),()=>C.disconnect()},[s]);let ae=E?`${m}`.replace(/([\d.]+)[sdl]?vh\b/g,(w,p)=>`${+p*E/100}px`):m;return{rootRef:f,scope:g,css:S,scheme:c,store:u,presence:b,brand:r,auto:d==="auto",height:ae}}function ke({rootRef:e,board:t}){let n=(0,o.useCallback)(()=>e.current?.querySelector("[data-embed-content]")??e.current,[e]);return(0,l.jsx)(D,{board:t,anchor:n})}function xe(e,t,n){return{brand:n,locale:e.locale,timeZone:e.timeZone,principal:e.principal,seats:e.seats,presence:t,people:e.people,memory:e.memory,presenceTtlMs:e.presenceTtlMs,onKeepLens:e.onKeepLens,ai:e.ai,files:e.files,resolveApp:e.resolveApp,history:e.history,linkedRecords:e.linkedRecords,subscriptions:e.subscriptions,keptViews:e.keptViews,signIn:e.signIn,menuSections:e.menuSections,app:e.app}}function Ae({name:e,heading:t,faces:n,at:a,without:r,home:i,reach:d,standing:s,hostActions:f,keeping:m,onFind:E,switch:g}){let{brand:u,store:b,principal:y,views:h}=T();$();let c=r?.has("places")?[]:W({store:b,principal:y,views:h}),S=J();return(0,l.jsx)(j,{brand:u,name:e,description:u?.subtitle,heading:t,faces:n,home:i,places:c,current:a===null?null:_(c,a),reach:d,onFind:E,...g?{switch:g}:{},...n?{scenePlaces:S}:{},tools:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(X,{clean:s}),(0,l.jsx)(U,{...f?{hostActions:f}:{},...m?{keeping:m}:{}})]})})}var Fe=e=>e===!1?2:Math.min(e+1,6);function Le(e){let[t,n]=(0,o.useState)(e),a=(0,o.useRef)(void 0),r=(0,o.useRef)(void 0),i=(0,o.useMemo)(()=>({go:a,at:n,pending:r}),[]),d=(0,o.useCallback)(s=>{if(a.current){a.current(s);return}r.current=s,n(s)},[]);return{at:t,setAt:n,steering:i,steer:d}}function me(e){let t=typeof e=="object"&&e!==null?e.name:void 0;return{name:typeof t=="string"&&t.length>0?t:typeof e=="object"?"Error":typeof e}}var F=()=>typeof performance<"u"?performance.now():Date.now();function He(e,t){let n=(0,o.useRef)({onError:e,face:t});return n.current={onError:e,face:t},(0,o.useCallback)((a,r)=>n.current.onError?.(me(a),{module:r.module,face:n.current.face}),[])}function Ce(e,t){let n=(0,o.useRef)(null);n.current===null&&(n.current=F());let a=(0,o.useRef)({onReady:e,face:t});a.current={onReady:e,face:t};let r=(0,o.useRef)(!1);return(0,o.useCallback)(i=>{r.current||(r.current=!0,a.current.onReady?.({ms:Math.max(0,F()-(n.current??F())),face:i}))},[])}var oe=class extends o.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(t,n){console.error(`[graview] ${this.props.module} threw while rendering`,t,n.componentStack),this.props.report(t,{module:this.props.module})}render(){return this.state.failed?(0,l.jsxs)("div",{role:"alert","data-graview-face-error":this.props.module,...this.props.content?{"data-embed-content":""}:{},style:this.props.content?{flex:"1 1 auto",display:"grid",alignContent:"center",justifyItems:"center",gap:8,padding:24,background:"var(--graview-ground)",color:"var(--graview-ink)",fontSize:"0.9375rem"}:{display:"inline-flex",alignItems:"center",gap:6,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:[(0,l.jsx)("span",{children:this.props.content?"This part of the app could not draw.":"Could not draw."}),(0,l.jsx)("button",{type:"button",onClick:()=>this.setState({failed:!1}),style:{padding:"3px 11px",fontSize:"0.8125rem"},children:"Try again"})]}):this.props.children}};export{Se as a,ve as b,de as c,we as d,Ee as e,Re as f,ke as g,xe as h,Ae as i,Fe as j,Le as k,He as l,Ce as m,oe as n};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as r,b as m,d as k,e as h}from"./chunk.UGFDSE37.js";import"./chunk.QT4XGC5Z.js";import"./chunk.MQ7FNHXG.js";import"./chunk.WLPTY4BF.js";import"./chunk.AJZBJBMO.js";var o="way-back",b='[data-testid="notices-toasts"]';function g(t){let a=document.activeElement;a!==null&&a!==document.body&&!a.closest(b)||(t??document).querySelector('[data-graview-app-bar] [data-testid="app-home"]')?.focus({preventScroll:!0})}function w(t,a,i,d,y){if(t.past)return i?.dismiss(o),()=>{};let c=y?.closest("[data-graview-embed]"),s,f=e=>{if(e!==void 0&&r(t,a)?.batch!==e)return!1;try{let n=k(t,a);return n&&i?.notify({kind:"toast",id:o,sentence:`Took back \u201C${n.intent}\u201D`}),n!==void 0}catch(n){return i?.notify({kind:"toast",id:o,tone:"warn",sentence:n instanceof Error?n.message:String(n)}),!0}},u=()=>{let e=m(t,a,d);if(d=t.batches().length,e){let n=s=e.batch;i?.notify({kind:"toast",id:o,sentence:e.intent,timeout:1e4,action:{label:"Take back",onSelect:()=>(g(c),f(n))}})}else s&&r(t,a)?.batch!==s&&(s=void 0,i?.dismiss(o))},l=e=>{h(e)&&(!c||c.contains(e.target))&&f()&&e.preventDefault()};u();let p=t.subscribe(u);return document.addEventListener("keydown",l),(e=!1)=>{p(),document.removeEventListener("keydown",l),e&&s&&i?.dismiss(o)}}export{w as sceneWay};
|