graview 0.1.30 → 0.1.32

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.
Files changed (174) hide show
  1. package/dist/preview/chunk.2NIOHEMX.js +1 -0
  2. package/dist/preview/{chunk.XRJBLH4N.js → chunk.3AGY4QVS.js} +1 -1
  3. package/dist/preview/chunk.3HXN4BOY.js +1 -0
  4. package/dist/preview/{chunk.2CIBWZJG.js → chunk.3K6YSVHC.js} +1 -1
  5. package/dist/preview/{chunk.FWCOJDOD.js → chunk.3TVXGJTU.js} +1 -1
  6. package/dist/preview/{chunk.NDADLJE6.js → chunk.3TY5NFLY.js} +1 -1
  7. package/dist/preview/{chunk.UWGWXFWZ.js → chunk.47STJVRV.js} +1 -1
  8. package/dist/preview/{chunk.34ZMMURV.js → chunk.4HRAQNJO.js} +6 -6
  9. package/dist/preview/{chunk.QTMWHE5O.js → chunk.4HZ7QTXZ.js} +1 -1
  10. package/dist/preview/{chunk.3JGGBLRB.js → chunk.4MERAWS2.js} +1 -1
  11. package/dist/preview/chunk.52W7WYME.js +1 -0
  12. package/dist/preview/chunk.5A4AOFOA.js +1 -0
  13. package/dist/preview/chunk.5H4VXLZF.js +88 -0
  14. package/dist/preview/{chunk.XS7YFNDU.js → chunk.5T5XGILP.js} +1 -1
  15. package/dist/preview/chunk.5TVB6BUY.js +1 -0
  16. package/dist/preview/chunk.5UL7YDUD.js +1 -0
  17. package/dist/preview/chunk.63GXY2ME.js +1 -0
  18. package/dist/preview/chunk.6QWV5MVH.js +25 -0
  19. package/dist/preview/{chunk.PAVR5TK5.js → chunk.6UGEYZAC.js} +1 -1
  20. package/dist/preview/chunk.6YCBYL2Y.js +2 -0
  21. package/dist/preview/{chunk.ZYKAS4BT.js → chunk.7GKUVQVF.js} +1 -1
  22. package/dist/preview/{chunk.T3VPD7JQ.js → chunk.7T7NZZTC.js} +1 -1
  23. package/dist/preview/chunk.AKFKM4SW.js +3 -0
  24. package/dist/preview/chunk.AOSMJKLH.js +1 -0
  25. package/dist/preview/{chunk.D3IECJ2S.js → chunk.ASCLIM2P.js} +1 -1
  26. package/dist/preview/chunk.B2GLDIAS.js +1 -0
  27. package/dist/preview/chunk.BNV77BQZ.js +4 -0
  28. package/dist/preview/chunk.BOO6WVM4.js +117 -0
  29. package/dist/preview/chunk.BQ3JHEHV.js +1 -0
  30. package/dist/preview/chunk.CAVBSL27.js +1 -0
  31. package/dist/preview/{chunk.YLQB3KBA.js → chunk.CDP2XL66.js} +1 -1
  32. package/dist/preview/chunk.CIPS2OGR.js +1 -0
  33. package/dist/preview/chunk.CJJLJ3KW.js +2 -0
  34. package/dist/preview/chunk.CN3UEF5N.js +90 -0
  35. package/dist/preview/{chunk.6XMEU2Q2.js → chunk.COQKECUH.js} +1 -1
  36. package/dist/preview/{chunk.QTA4ROAK.js → chunk.CWHRDBOF.js} +1 -1
  37. package/dist/preview/chunk.CX3KL2C5.js +1 -0
  38. package/dist/preview/{chunk.AK3IHFCF.js → chunk.D75KC3LL.js} +1 -1
  39. package/dist/preview/chunk.DAZ2VSRD.js +1 -0
  40. package/dist/preview/{chunk.RIEHYQLK.js → chunk.DHIUSUCL.js} +50 -24
  41. package/dist/preview/{chunk.3ADPAGPY.js → chunk.DYSPCGXX.js} +1 -1
  42. package/dist/preview/chunk.E2YEOMPH.js +1 -0
  43. package/dist/preview/chunk.EBGAYL32.js +1 -0
  44. package/dist/preview/chunk.EF3XNU4O.js +1 -0
  45. package/dist/preview/chunk.EJPI3ST6.js +1 -0
  46. package/dist/preview/chunk.EKPRNDUV.js +1 -0
  47. package/dist/preview/chunk.ERIT3R6N.js +1 -0
  48. package/dist/preview/chunk.EYTBDMTW.js +1 -0
  49. package/dist/preview/chunk.F6EH7HI2.js +1 -0
  50. package/dist/preview/{chunk.3URFMWXZ.js → chunk.F6ZK7RMB.js} +2 -2
  51. package/dist/preview/chunk.FSTCX2AI.js +1 -0
  52. package/dist/preview/{chunk.HHPGWJDO.js → chunk.FWTIUYXH.js} +1 -1
  53. package/dist/preview/{chunk.6T2Q6NLO.js → chunk.G5NZVPJU.js} +1 -1
  54. package/dist/preview/{chunk.VG56IUIQ.js → chunk.GO4XBWJO.js} +1 -1
  55. package/dist/preview/chunk.GV2CQVKV.js +1 -0
  56. package/dist/preview/chunk.GYICGZMG.js +3 -0
  57. package/dist/preview/chunk.H7BST3XO.js +1 -0
  58. package/dist/preview/chunk.H7EPE74C.js +1 -0
  59. package/dist/preview/{chunk.26CZTUY4.js → chunk.HAIG6NVX.js} +1 -1
  60. package/dist/preview/{chunk.V7BDAGDE.js → chunk.HLTRQU4Y.js} +1 -1
  61. package/dist/preview/{chunk.VS7K3SCD.js → chunk.I6FPNX43.js} +1 -1
  62. package/dist/preview/chunk.IDVAR5HM.js +1 -0
  63. package/dist/preview/chunk.J25KOSNW.js +1 -0
  64. package/dist/preview/chunk.JDUJDAGA.js +1 -0
  65. package/dist/preview/{chunk.X37L5TN5.js → chunk.JFAOHHJJ.js} +1 -1
  66. package/dist/preview/chunk.JOOQUWLT.js +341 -0
  67. package/dist/preview/{chunk.4SJUTBDV.js → chunk.JQU5GEU3.js} +1 -1
  68. package/dist/preview/chunk.K5ME5GCG.js +1 -0
  69. package/dist/preview/chunk.K7PMDSOL.js +1 -0
  70. package/dist/preview/chunk.KSES5U5B.js +1 -0
  71. package/dist/preview/{chunk.DT7LHWU2.js → chunk.LLLZEGRK.js} +1 -1
  72. package/dist/preview/chunk.LR3VDXPI.js +1 -0
  73. package/dist/preview/{chunk.WYTIOLPP.js → chunk.LXBOVRFI.js} +1 -1
  74. package/dist/preview/{chunk.42YX6NOY.js → chunk.MAF7C3VM.js} +1 -1
  75. package/dist/preview/chunk.MNP4JI33.js +5 -0
  76. package/dist/preview/{chunk.O2LK2AO7.js → chunk.MWGGV7DE.js} +1 -1
  77. package/dist/preview/chunk.N6OX4NEQ.js +1 -0
  78. package/dist/preview/chunk.NM6MZYFN.js +47 -0
  79. package/dist/preview/chunk.NRAYZY3X.js +1 -0
  80. package/dist/preview/chunk.NTF7FVB2.js +1 -0
  81. package/dist/preview/{chunk.DZRTOURR.js → chunk.OC6IWRQ3.js} +1 -1
  82. package/dist/preview/chunk.OF34OZ4V.js +1 -0
  83. package/dist/preview/chunk.OJGHDWI6.js +1 -0
  84. package/dist/preview/chunk.OKRNJXTV.js +1 -0
  85. package/dist/preview/chunk.PBSMLINK.js +1 -0
  86. package/dist/preview/chunk.PHKSMUIA.js +1 -0
  87. package/dist/preview/{chunk.JN7DIFR3.js → chunk.PIP6Z563.js} +1 -1
  88. package/dist/preview/chunk.QGTSHKJL.js +1 -0
  89. package/dist/preview/chunk.QVVJRSRM.js +1 -0
  90. package/dist/preview/{chunk.L6OMEYL6.js → chunk.QYZNAUIR.js} +1 -1
  91. package/dist/preview/chunk.R6K6GF5R.js +1 -0
  92. package/dist/preview/{chunk.JTNWD2CN.js → chunk.RCKTBOY2.js} +1 -1
  93. package/dist/preview/{chunk.QNGWEV47.js → chunk.RIJUCHP4.js} +1 -1
  94. package/dist/preview/chunk.SHTJZ6UX.js +1 -0
  95. package/dist/preview/{chunk.PKK6FRZR.js → chunk.SYAEBGDC.js} +1 -1
  96. package/dist/preview/chunk.T5VG5A6V.js +1 -0
  97. package/dist/preview/{chunk.ERXSYPYL.js → chunk.TAQ764IQ.js} +1 -1
  98. package/dist/preview/chunk.TCNBCTWO.js +1 -0
  99. package/dist/preview/{chunk.HHI65WFZ.js → chunk.UATVTXZY.js} +1 -1
  100. package/dist/preview/{chunk.XSTXV6FP.js → chunk.UBFNZMUX.js} +2 -2
  101. package/dist/preview/{chunk.WAFDCOOG.js → chunk.UGFJKSHU.js} +1 -1
  102. package/dist/preview/chunk.UHUGOTUU.js +19 -0
  103. package/dist/preview/chunk.ULRW47RP.js +1 -0
  104. package/dist/preview/chunk.UNL2HIF2.js +1 -0
  105. package/dist/preview/chunk.UZGRRDHD.js +1 -0
  106. package/dist/preview/{chunk.BPWNWE7N.js → chunk.VG3O4LWB.js} +1 -1
  107. package/dist/preview/chunk.WAZ7OGBD.js +1 -0
  108. package/dist/preview/{chunk.3JNMSOFG.js → chunk.XANVHJQ4.js} +1 -1
  109. package/dist/preview/chunk.XKABS745.js +1 -0
  110. package/dist/preview/chunk.XMC7YDWT.js +1 -0
  111. package/dist/preview/chunk.XNJEFUF7.js +3 -0
  112. package/dist/preview/chunk.Y6ZNFQK3.js +6 -0
  113. package/dist/preview/{chunk.J2ITFGN3.js → chunk.YIR7PPF3.js} +1 -1
  114. package/dist/preview/index.html +51 -0
  115. package/dist/preview/page.js +6 -6
  116. package/package.json +6 -6
  117. package/dist/preview/chunk.2EXGG6BB.js +0 -1
  118. package/dist/preview/chunk.2NBYNZRD.js +0 -1
  119. package/dist/preview/chunk.2XAONC66.js +0 -1
  120. package/dist/preview/chunk.3R4W2P5X.js +0 -1
  121. package/dist/preview/chunk.3SKKIHU3.js +0 -4
  122. package/dist/preview/chunk.3VL5WECB.js +0 -1
  123. package/dist/preview/chunk.4ALKPNXM.js +0 -1
  124. package/dist/preview/chunk.4HP7UWA2.js +0 -1
  125. package/dist/preview/chunk.5U5J3ISK.js +0 -1
  126. package/dist/preview/chunk.6V2RG5JG.js +0 -5
  127. package/dist/preview/chunk.7BWT5L2L.js +0 -1
  128. package/dist/preview/chunk.C5CYZNSJ.js +0 -1
  129. package/dist/preview/chunk.CM6LOIQE.js +0 -88
  130. package/dist/preview/chunk.FDELO7NY.js +0 -116
  131. package/dist/preview/chunk.FGVKJWNS.js +0 -6
  132. package/dist/preview/chunk.GFF2FB2J.js +0 -25
  133. package/dist/preview/chunk.GLBHQFJ2.js +0 -1
  134. package/dist/preview/chunk.HSCTWAUV.js +0 -1
  135. package/dist/preview/chunk.INZUEWC5.js +0 -1
  136. package/dist/preview/chunk.JH6MU6TX.js +0 -2
  137. package/dist/preview/chunk.JISMMIMX.js +0 -1
  138. package/dist/preview/chunk.JPHNKWTY.js +0 -1
  139. package/dist/preview/chunk.K75FUIZI.js +0 -1
  140. package/dist/preview/chunk.K776HO42.js +0 -2
  141. package/dist/preview/chunk.KN3ULTGF.js +0 -1
  142. package/dist/preview/chunk.KOB6N3SL.js +0 -1
  143. package/dist/preview/chunk.KQT7WAQE.js +0 -1
  144. package/dist/preview/chunk.L4DECHXR.js +0 -327
  145. package/dist/preview/chunk.LQ7V6KEE.js +0 -1
  146. package/dist/preview/chunk.MD74YVRN.js +0 -3
  147. package/dist/preview/chunk.MGNP4LAM.js +0 -1
  148. package/dist/preview/chunk.NCTOBUCT.js +0 -1
  149. package/dist/preview/chunk.NO52VON3.js +0 -1
  150. package/dist/preview/chunk.OAF7TUMI.js +0 -1
  151. package/dist/preview/chunk.OQ4KFN6W.js +0 -1
  152. package/dist/preview/chunk.OQDETV4X.js +0 -1
  153. package/dist/preview/chunk.OXQMNIRO.js +0 -1
  154. package/dist/preview/chunk.OZNW5W4Z.js +0 -1
  155. package/dist/preview/chunk.QIAKO27D.js +0 -1
  156. package/dist/preview/chunk.R26DREVU.js +0 -1
  157. package/dist/preview/chunk.RI3PYG5T.js +0 -19
  158. package/dist/preview/chunk.RRVIXV7W.js +0 -1
  159. package/dist/preview/chunk.RYT5U3QM.js +0 -1
  160. package/dist/preview/chunk.SE5SKFQH.js +0 -1
  161. package/dist/preview/chunk.SOBC3CTN.js +0 -47
  162. package/dist/preview/chunk.SOD3PBJM.js +0 -1
  163. package/dist/preview/chunk.UDSEJKCY.js +0 -1
  164. package/dist/preview/chunk.UZWWDAGM.js +0 -14
  165. package/dist/preview/chunk.V5ZYUVMH.js +0 -1
  166. package/dist/preview/chunk.VOAZBHCG.js +0 -1
  167. package/dist/preview/chunk.VSZQXB4Q.js +0 -3
  168. package/dist/preview/chunk.W3S6UXNA.js +0 -1
  169. package/dist/preview/chunk.Y4UXEL6Y.js +0 -1
  170. package/dist/preview/chunk.YJUB4OD7.js +0 -1
  171. package/dist/preview/chunk.YNQDVGZM.js +0 -1
  172. package/dist/preview/chunk.YV2LJFGS.js +0 -1
  173. package/dist/preview/chunk.Z2YUYZT4.js +0 -1
  174. /package/dist/preview/{chunk.EYZ7MHBZ.js → chunk.GZHZLJBF.js} +0 -0
@@ -1,25 +0,0 @@
1
- import{Cc as kn,H as gn,Jb as vn,Ka as wn,Qc as Pn,Vc as Le,Wc as rt,dc as bn,oc as xn,rc as En,ta as hn,xa as ot,za as Sn}from"./chunk.6V2RG5JG.js";import{a as Ce,b as L}from"./chunk.AJZBJBMO.js";var $n=Ce(v=>{"use strict";var ut=Symbol.for("react.transitional.element"),er=Symbol.for("react.portal"),tr=Symbol.for("react.fragment"),nr=Symbol.for("react.strict_mode"),or=Symbol.for("react.profiler"),rr=Symbol.for("react.consumer"),ir=Symbol.for("react.context"),ar=Symbol.for("react.forward_ref"),sr=Symbol.for("react.suspense"),lr=Symbol.for("react.memo"),jn=Symbol.for("react.lazy"),dr=Symbol.for("react.activity"),In=Symbol.iterator;function ur(e){return e===null||typeof e!="object"?null:(e=In&&e[In]||e["@@iterator"],typeof e=="function"?e:null)}var Gn={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Wn=Object.assign,Fn={};function fe(e,t,n){this.props=e,this.context=t,this.refs=Fn,this.updater=n||Gn}fe.prototype.isReactComponent={};fe.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")};fe.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Kn(){}Kn.prototype=fe.prototype;function ct(e,t,n){this.props=e,this.context=t,this.refs=Fn,this.updater=n||Gn}var ft=ct.prototype=new Kn;ft.constructor=ct;Wn(ft,fe.prototype);ft.isPureReactComponent=!0;var Hn=Array.isArray;function dt(){}var A={H:null,A:null,T:null,S:null},Bn=Object.prototype.hasOwnProperty;function pt(e,t,n){var o=n.ref;return{$$typeof:ut,type:e,key:t,ref:o!==void 0?o:null,props:n}}function cr(e,t){return pt(e.type,t,e.props)}function yt(e){return typeof e=="object"&&e!==null&&e.$$typeof===ut}function fr(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Nn=/\/+/g;function lt(e,t){return typeof e=="object"&&e!==null&&e.key!=null?fr(""+e.key):t.toString(36)}function pr(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(dt,dt):(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 ce(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case ut:case er:a=!0;break;case jn:return a=e._init,ce(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+lt(e,0):o,Hn(r)?(n="",a!=null&&(n=a.replace(Nn,"$&/")+"/"),ce(r,t,n,"",function(u){return u})):r!=null&&(yt(r)&&(r=cr(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Nn,"$&/")+"/")+a)),t.push(r)),1;a=0;var d=o===""?".":o+":";if(Hn(e))for(var s=0;s<e.length;s++)o=e[s],i=d+lt(o,s),a+=ce(o,t,n,i,r);else if(s=ur(e),typeof s=="function")for(e=s.call(e),s=0;!(o=e.next()).done;)o=o.value,i=d+lt(o,s++),a+=ce(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return ce(pr(e),t,n,o,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function Fe(e,t,n){if(e==null)return e;var o=[],r=0;return ce(e,o,"","",function(i){return t.call(n,i,r++)}),o}function yr(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 Dn=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)},mr={map:Fe,forEach:function(e,t,n){Fe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Fe(e,function(){t++}),t},toArray:function(e){return Fe(e,function(t){return t})||[]},only:function(e){if(!yt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};v.Activity=dr;v.Children=mr;v.Component=fe;v.Fragment=tr;v.Profiler=or;v.PureComponent=ct;v.StrictMode=nr;v.Suspense=sr;v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A;v.__COMPILER_RUNTIME={__proto__:null,c:function(e){return A.H.useMemoCache(e)}};v.cache=function(e){return function(){return e.apply(null,arguments)}};v.cacheSignal=function(){return null};v.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=Wn({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!Bn.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(o[i]=t[i]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var a=Array(i),d=0;d<i;d++)a[d]=arguments[d+2];o.children=a}return pt(e.type,r,o)};v.createContext=function(e){return e={$$typeof:ir,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:rr,_context:e},e};v.createElement=function(e,t,n){var o,r={},i=null;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)Bn.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(r[o]=t[o]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var d=Array(a),s=0;s<a;s++)d[s]=arguments[s+2];r.children=d}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return pt(e,i,r)};v.createRef=function(){return{current:null}};v.forwardRef=function(e){return{$$typeof:ar,render:e}};v.isValidElement=yt;v.lazy=function(e){return{$$typeof:jn,_payload:{_status:-1,_result:e},_init:yr}};v.memo=function(e,t){return{$$typeof:lr,type:e,compare:t===void 0?null:t}};v.startTransition=function(e){var t=A.T,n={};A.T=n;try{var o=e(),r=A.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(dt,Dn)}catch(i){Dn(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),A.T=t}};v.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()};v.use=function(e){return A.H.use(e)};v.useActionState=function(e,t,n){return A.H.useActionState(e,t,n)};v.useCallback=function(e,t){return A.H.useCallback(e,t)};v.useContext=function(e){return A.H.useContext(e)};v.useDebugValue=function(){};v.useDeferredValue=function(e,t){return A.H.useDeferredValue(e,t)};v.useEffect=function(e,t){return A.H.useEffect(e,t)};v.useEffectEvent=function(e){return A.H.useEffectEvent(e)};v.useId=function(){return A.H.useId()};v.useImperativeHandle=function(e,t,n){return A.H.useImperativeHandle(e,t,n)};v.useInsertionEffect=function(e,t){return A.H.useInsertionEffect(e,t)};v.useLayoutEffect=function(e,t){return A.H.useLayoutEffect(e,t)};v.useMemo=function(e,t){return A.H.useMemo(e,t)};v.useOptimistic=function(e,t){return A.H.useOptimistic(e,t)};v.useReducer=function(e,t,n){return A.H.useReducer(e,t,n)};v.useRef=function(e){return A.H.useRef(e)};v.useState=function(e){return A.H.useState(e)};v.useSyncExternalStore=function(e,t,n){return A.H.useSyncExternalStore(e,t,n)};v.useTransition=function(){return A.H.useTransition()};v.version="19.2.8"});var j=Ce((Hi,zn)=>{"use strict";zn.exports=$n()});var Zn=Ce($e=>{"use strict";var kr=Symbol.for("react.transitional.element"),Pr=Symbol.for("react.fragment");function Jn(e,t,n){var o=null;if(n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:kr,type:e,key:o,ref:t!==void 0?t:null,props:n}}$e.Fragment=Pr;$e.jsx=Jn;$e.jsxs=Jn});var Te=Ce((Ki,Qn)=>{"use strict";Qn.exports=Zn()});function An(e){let t,n=!1,o,r,i=0;return()=>{if(n)return Promise.resolve(t);if(o)return o;let a=i>0&&r!==void 0?Yo(r):e();i+=1;let d=a.then(s=>(t=s,n=!0,o=void 0,s),s=>{throw o=void 0,r??=Xo(s),s});return o=d,d}}var Rn=0;function Yo(e){return Rn+=1,import(`${e}${e.includes("?")?"&":"?"}retry=${Rn}`)}function Xo(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 le={focusId:null,relation:null,expanded:[],pins:{}},Ie=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function Q(e){let t=new URLSearchParams;e.focusId&&t.set("focus",e.focusId),e.relation&&t.set("relation",e.relation),e.overview&&t.set("overview","1"),e.zoom&&t.set("zoom","1"),e.past&&t.set("past","1"),e.shown&&e.shown.length>0&&t.set("show",[...e.shown].sort().join(",")),e.selection!==void 0&&e.selection.length>0&&t.set("sel",[...e.selection].sort().join(",")),e.expanded.length>0&&t.set("expand",[...e.expanded].sort().join(","));for(let o of Object.keys(e.pins).sort()){let r=e.pins[o];t.set(`pin.${o}`,`${He(r.x)},${He(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${He(e.pan.x)},${He(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 Jo(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function Ne(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[S,p]of n){if(!S.startsWith("pin."))continue;let[g,y]=p.split(","),x=g===void 0?null:Ie(g),m=y===void 0?null:Ie(y);x===null||m===null||(o[S.slice(4)]={x,y:m})}let r=Object.create(null);for(let[S,p]of n)!S.startsWith("in.")||p.length===0||(r[S.slice(3)]=p);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],d=a[0]===void 0?null:Ie(a[0]),s=a[1]===void 0?null:Ie(a[1]),u=(n.get("sel")??"").split(",").filter(S=>S.length>0).sort(),f=n.get("overview")==="1";return{...u.length>0?{selection:u}:{},...f?{overview:!0}:{},...n.get("zoom")==="1"?{zoom:!0}:{},...n.get("past")==="1"?{past:!0}:{},...n.get("show")?{shown:[...new Set(n.get("show").split(",").filter(Boolean))].sort()}:{},...d!==null&&s!==null?{pan:{x:d,y:s}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:Jo(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(S=>S.length>0&&(f||!S.startsWith("kind:"))).sort(),pins:o}}function Pi(e){let t=Ne(e);return Q(t)==="#"?{...t,overview:!0}:t}function Ri(e){let t=Q(e);return t==="#overview=1"?"":t}function He(e){return Math.round(e*100)/100}function Mn(e,t){return Q(e)===Q(t)}var Tn="edge:";function On(e){if(!e.startsWith(Tn))return null;let t=e.slice(Tn.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 it(e){let{pan:t,...n}=e;return{...n,pins:{}}}function z(e,t){if(t===e.focusId)return{...e,focusId:t};let n=it(e);return{...n.within?.q!==void 0?oe(n,"q",null):n,focusId:t}}function Vn(e,t){return{...e,relation:t}}function oe(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 de(e,t){if(t!==e.overview&&(e=it(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function De(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function Re(e,t){if(t!==(e.zoom===!0)&&(e=it(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function je(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var We="aggregate:",Ge="kind:";function at(e){return`${Ge}${e}`}function ue(e){return e.startsWith(Ge)?e.slice(Ge.length):null}var Mi="kinds:beyond";function Zo(e){let t=ue(e);return t?[t]:re(e)}function ee(...e){return`${We}${[...e].sort().join("+")}`}function _n(e){return e.startsWith(We)}function re(e){return!_n(e)||e.includes("|")?[]:e.slice(We.length).split("+").filter(Boolean)}function Cn(e,t,n={}){let o=ue(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return je(e,t);let r=o!==null?ee(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return Re(e,!1);if(o!==null&&n.carry){let i=de({...z(e,r),relation:null},!1);return oe(Re(i,!0),"q",n.carry)}return Re({...z(e,r),relation:null},!0)}function Qo(e,t,n){return oe(de(z(e,ee(t)),!1),"view",n)}function Oi(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Ln="aggregate:";function st(e){return e.startsWith(Ln)&&e.includes("|")}var mt=L(j(),1),gr={turns:[],outcomes:new Map,busy:!1,open:!1,side:"left",pending:null,drawn:0,draft:null,draftNote:null},qn=e=>`graview:seat:${e}`;function hr(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)}:{},...typeof n.open=="boolean"?{open:n.open}:{},...n.side==="left"||n.side==="right"?{side:n.side}:{},...n.draft?.drawn?{draft:n.draft}:{}}}catch{return{}}}function Sr(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],open:t.open,side:t.side,draft:t.draft}))}catch{}}function gt(e){let t=e===null?null:qn(e),n={...gr,...hr(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&Sr(t,n);for(let d of[...o])d()};return{get:()=>n,subscribe(i){return o.add(i),()=>void o.delete(i)},setTurns:i=>r({...n,turns:i(n.turns)}),settle:(i,a)=>r({...n,outcomes:new Map(n.outcomes).set(i,a)}),setBusy:i=>r({...n,busy:i},!1),setOpen:i=>{n.open!==i&&r({...n,open:i})},setSide:i=>{n.side!==i&&r({...n,side:i})},ask:i=>r({...n,open:!0,pending:i.trim()||null}),takePending(){let i=n.pending;return i!==null&&r({...n,pending:null},!1),i},drawn(){return r({...n,drawn:n.drawn+1},!1),()=>r({...n,drawn:Math.max(0,n.drawn-1)},!1)},setDraft:(i,a=null)=>r({...n,draft:i,draftNote:a})}}function wr(e){let t=()=>e.get().drawn>0;return(0,mt.useSyncExternalStore)(e.subscribe,t,t)}function vr(e){return(0,mt.useSyncExternalStore)(e.subscribe,e.get,e.get)}function Un(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}var Ke=L(j(),1),Be=(0,Ke.createContext)(void 0),br=()=>(0,Ke.useContext)(Be);var V=L(j(),1),Ae=(0,V.createContext)(null);function Xn(){return(0,V.useContext)(Ae)}function xr(e,t){let n=Xn(),o=(0,V.useMemo)(()=>n?n.live.seenBy(t):e,[n,e,t]),r=(0,V.useRef)(0),i=(0,V.useCallback)(a=>o.subscribe(()=>{r.current+=1,a()}),[o]);return(0,V.useSyncExternalStore)(i,()=>r.current,()=>0),o}var Er=An(()=>import("./chunk.SHPXD6FC.js")),Yn;function ht(e,t,n){let o=(0,V.useContext)(Ae),r=o!==null&&o.owns(e,t),[i,a]=(0,V.useState)(null),[d,s]=(0,V.useState)(Yn);(0,V.useEffect)(()=>{if(d||r||i===null)return;let y=!0;return Er().then(x=>{Yn=x,y&&s(x)},()=>{}),()=>{y=!1}},[d,r,i]);let u=(0,V.useMemo)(()=>{if(r||i===null||i>=e.log.length||!d)return null;try{let y=d.pastAt(e,i,n);return{seq:i,at:y.past?.at,store:y}}catch{return null}},[r,e,i,n,d]),f=(0,V.useCallback)(y=>a(y===null?null:y>=e.log.length?Number.POSITIVE_INFINITY:y),[e]),S=(0,V.useCallback)((y,x)=>[e,u?.store].some(m=>m!==void 0&&(m===y||m.seenBy(x)===y)),[e,u]),p=i!==null,g=(0,V.useMemo)(()=>({past:u,open:p,show:f,live:e,host:n,owns:S}),[u,p,f,e,n,S]);return r?o:g}var St={};var Rr="I can answer about what's in this app. Open questions need AI, which isn't on here.",Ar="Answered with AI";var eo=e=>`graview:setting:${e}`;function to(){return localStorage}function no(e,t){try{let n=(t??to()).getItem(eo(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function oo(e,t,n){try{(n??to()).setItem(eo(e.name),t)}catch{}}function ro(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 _=L(j(),1);function wt(e){return Le(e)}var Tr=12,Mr=4;function Or(e,t,n){let o=wt(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var ze=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-Tr);function io(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=Mr)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?at([...o][0]):n[0]}function vt(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,d]of e)d.mode!=="asking"&&d.mode!=="docked"&&t.at-d.since>=t.holdMs&&o.set(a,{...d,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=Or(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=io(t.ids,n);return i({at:a,mode:"reading",trail:ze(r.trail,a)}),o}case"about-to-write":case"write":{let a=io(t.ids,n);return i({at:a,mode:"writing",trail:ze(r.trail,a),say:void 0,confidence:void 0}),o}case"refused":return i({at:t.where,mode:"refused",say:t.say,confidence:void 0,trail:ze(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:ze(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 ao="graview:session";function so(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(ao);if(o)return o;let r=t();return n.setItem(ao,r),r}catch{return t()}}var bt={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"},xt={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"},lo=[bt,xt],_r=800;function uo(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:d,settingValues:s,setView:u,ttlMs:f=1e4,people:S,seats:p}=e,[g,y]=(0,_.useState)(()=>new Map),[x,m]=(0,_.useState)(null),[b,w]=(0,_.useState)(null),[E,O]=(0,_.useState)(null),W=typeof r.id=="string"&&r.id.length>0,C=W&&(s[bt.name]??bt.initial)==="shared",K=C&&(s[xt.name]??xt.initial)==="shared",T=wt({kind:r.kind,...r.id?{id:r.id}:{},session:i}),I=W?wn(r,{graph:n.graph,schema:n.schema,...p?{seats:p}:{},...S?{people:S}:{}}):"",H=d?a.get(`agent:${d}:${i}`):void 0,D=(0,_.useMemo)(()=>!t||!C?null:{participant:T,kind:r.kind,name:I,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:vn(r.id??"nobody"),stop:E??Q(o),...K?{over:x}:{},...H?{robot:{at:H.at,mode:H.mode}}:{},at:new Date().toISOString()},[t,C,K,T,I,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,E,x,H?.at,H?.mode]);(0,_.useEffect)(()=>{if(!t||!D)return;t.here(D);let M=setInterval(()=>t.here({...D,at:new Date().toISOString()}),_r);return()=>clearInterval(M)},[t,D]),(0,_.useEffect)(()=>t?t.onWho(F=>y(rt(new Map,F,Date.now(),f))):void 0,[t,f]);let Se=g.size>0;(0,_.useEffect)(()=>{if(!Se)return;let M=setInterval(()=>{y(F=>{let P=rt(F,[],Date.now(),f);return P.size===F.size?F:P})},Math.max(250,Math.min(1e3,f/4)));return()=>clearInterval(M)},[Se,f]),(0,_.useEffect)(()=>{if(!t||typeof window>"u")return;let M=()=>t.leave();return window.addEventListener("pagehide",M),()=>window.removeEventListener("pagehide",M)},[t]),(0,_.useEffect)(()=>{if(!K||typeof document>"u")return;let M=null,F=P=>{let B=Un(P.target);B!==M&&(M=B,m(B))};return document.addEventListener("pointermove",F,{passive:!0}),()=>document.removeEventListener("pointermove",F)},[K]);let ae=(0,_.useRef)(null),X=b?g.get(b)??null:null,J=(0,_.useCallback)(M=>{ae.current=null,w(M)},[]);return(0,_.useEffect)(()=>{if(b){if(!X){w(null);return}X.stop!==ae.current?.stop&&(ae.current={stop:X.stop,at:Date.now()},u(Ne(X.stop)))}},[b,X,u]),(0,_.useEffect)(()=>{let M=ae.current;!b||M===null||Date.now()-M.at<400||Mn(o,Ne(M.stop))||w(null)},[o,b]),(0,_.useEffect)(()=>{if(!b||typeof document>"u")return;let M=F=>{F.key==="Escape"&&w(null)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[b]),(0,_.useMemo)(()=>({who:g,sharing:D?{participant:T,name:I}:null,following:X,follow:J,sayWhere:O}),[g,D,T,I,X,J])}var U=L(j(),1);function co(e){return Le(e.author)}function Cr(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function fo(e,t,n,o,r){let i=new Map;for(let[s,u]of e)o-u.at<r&&i.set(s,u);let a=new Set(n.flatMap(s=>s.nodeIds)),d=(s,u,f)=>{let S=i.get(s),p=S?.participants.includes(co(u))?S.participants:[...S?.participants??[],co(u)];i.set(s,{at:o,manner:Cr(p,u.author.kind),intent:u.intent,wrote:(S?.wrote??!1)||(f.wrote??!1),read:(S?.read??!1)||(f.read??!1),broke:(S?.broke??!1)||a.has(s),participants:p})};for(let s of t){for(let u of s.writes)d(u,s,{wrote:!0});for(let u of s.reads)s.writes.includes(u)||d(u,s,{read:!0})}for(let s of n)for(let u of s.nodeIds){let f=i.get(u);i.set(u,{at:o,manner:f?.manner??"rule",intent:f?.intent??s.message,wrote:f?.wrote??!1,read:f?.read??!1,broke:!0,participants:f?.participants??["rule::"]})}return i}var Lr=2600;function po(e,t=Lr){let[n,o]=(0,U.useState)(()=>new Map),r=(0,U.useRef)(n);r.current=n;let i=(0,U.useRef)(null),a=(0,U.useCallback)(s=>{r.current=s,o(s),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,U.useEffect)(()=>{let s=e.violations(),u=e.subscribe((f,S)=>{let p=e.violations(),g=En(e.allInvariants(),s,p).introduces;s=p,a(fo(r.current,S,g.map(y=>({nodeIds:y.nodeIds,message:y.message})),Date.now(),t))});return()=>{u(),i.current&&clearTimeout(i.current)}},[e,t,a]);let d=(0,U.useCallback)(s=>{s.reads.length!==0&&a(fo(r.current,[Ir(s)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:d}}function Ir(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=L(j(),1);function yo(){let e=null,t=new Set,n=new Set,o=r=>{for(let i of n)i(r)};return{subscribe(r){return t.add(r),t.size===1&&o(!0),()=>{t.delete(r),t.size===0&&(e=null,o(!1))}},snapshot:()=>e,set(r){if(!(e===r||e&&r&&e.x===r.x&&e.y===r.y)){e=r;for(let i of t)i()}},get listeners(){return t.size},onActive(r){return n.add(r),()=>void n.delete(r)}}}var qe=L(j(),1),Hr=e=>e.definitions.some(t=>hn(t).size>0);function mo(e,t,n){let[o,r]=(0,qe.useState)(void 0),i=(n.roles??[]).join("\0");return(0,qe.useEffect)(()=>{if(!t||!Hr(e.schema)){r(void 0);return}let a=!0,d=!1,s=e.graph,u=()=>{d||(d=!0,queueMicrotask(()=>{d=!1,a&&e.reread()}))},f=Sn(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{}},u);return ot(s,f.read),r(f),e.reread(),()=>{a=!1,ot(s,void 0)}},[e,t,n.kind,n.id,i]),o}function go(){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 ie=L(Te(),1),Me=(0,l.createContext)(null),vo=(0,l.createContext)("scene");function Nr({mode:e,children:t}){return(0,ie.jsx)(vo.Provider,{value:e,children:t})}function Dr(){return(0,l.useContext)(vo)}var bo={kind:"human"},jr=[],Gr=[],Wr=[],Et=[];function xo(e,t){let n=(0,l.useId)();(0,l.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??bo,r=()=>xn(e,o,n);r();let i,a=e.subscribe(()=>{clearTimeout(i),i=setTimeout(r,250)});return()=>{clearTimeout(i),a(),globalThis.__graviewWatch?.unseen?.({words:[],from:n,gone:!0})}},[e,t,n])}function Fr({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,seats:a=jr,onSeat:d,people:s=Gr,memory:u,presenceTtlMs:f,app:S,settings:p=S?.settings??Wr,presence:g,brand:y,locale:x,onKeepLens:m,providers:b,ai:w=St,files:E,resolveApp:O,history:W,linkedRecords:C,menuSections:K,view:T,onViewChange:I,children:H}){let D=(0,l.useContext)(Me),Se=K??D?.menuSections,[ae,X]=(0,l.useState)(null),J=ae??i??a[0]?.principal??bo,M=ht(e,J,W),F=M.past&&M.live===e?M.past.store:e,P=(0,l.useMemo)(()=>F.seenBy(J),[F,J]);xo(e,J);let[B]=(0,l.useState)(()=>so(u)),[Dt,Do]=(0,l.useState)(!1),jt=(0,l.useCallback)(()=>Do(!0),[]),ne=(0,l.useMemo)(()=>g?[...p,...lo]:p,[p,g]),[Ze]=(0,l.useState)(()=>n??At(t,e.schema)),[jo,Gt]=(0,l.useState)(()=>De(Ze??le,r??Ze?.selection??[])),we=(0,l.useRef)(Ze??le).current,[Wt,Go]=(0,l.useState)(null),[Ft,Wo]=(0,l.useState)(null),Ve=(0,l.useContext)(Me),[Kt]=(0,l.useState)(()=>Ve?.seatTalk??gt(y?.name??e.schema.kinds.join(","))),Qe=m??Ve?.onKeepLens,et=S??Ve?.app,_e=x??Ve?.locale,Fo=y?.locale??et?.brand?.locale;gn({reader:_e,app:Fo});let Bt=(0,l.useRef)(null),$t=(0,l.useCallback)(c=>{Bt.current=c},[]),zt=(0,l.useCallback)(c=>Bt.current?.whereIs(c)??null,[]),[qt]=(0,l.useState)(()=>yo()),[Ut]=(0,l.useState)(()=>go()),[tt,Ko]=(0,l.useState)(null),[ve,Yt]=(0,l.useState)(()=>new Map),be=(0,l.useRef)(ve);be.current=ve;let xe=(0,l.useRef)(null),nt=(0,l.useCallback)(c=>P.graph.getNode(c)?.kind,[P]),Z=(0,l.useCallback)(c=>{let h=vt(be.current,c,nt);be.current=h,Yt(h),xe.current&&clearTimeout(xe.current),[...h.values()].some(R=>R.mode!=="docked"&&R.mode!=="asking")&&(xe.current=setTimeout(()=>{let R=vt(be.current,{type:"rest",at:Date.now(),holdMs:Rt},nt);be.current=R,Yt(R)},Rt+20))},[nt]),Xt=(0,l.useCallback)(c=>Z({...c,at:c.at??Date.now()}),[Z]),Jt=(0,l.useCallback)(c=>{Ko(c),c&&Z({type:"home",author:{kind:"agent",id:c,session:B},at:Date.now()})},[Z,B]);(0,l.useEffect)(()=>P.subscribe((c,h)=>{for(let k of h)k.author.kind==="agent"&&Z({type:"write",author:k.author,ids:k.writes,at:Date.now()})}),[P,Z]),(0,l.useEffect)(()=>()=>{xe.current&&clearTimeout(xe.current)},[]);let q=(0,l.useMemo)(()=>({...J,session:B}),[J,B]),Zt=mo(P,C,q),Qt=(0,l.useCallback)(c=>{X(c),d?.(c)},[d]),[Ee,Bo]=(0,l.useState)(()=>Object.fromEntries(ne.map(c=>[c.name,no(c,u)])));(0,l.useEffect)(()=>{for(let c of ne)ro(c,Ee[c.name]??c.initial)},[ne,Ee]);let en=(0,l.useCallback)((c,h)=>{let k=ne.find(R=>R.name===c);!k||!k.options.some(R=>R.value===h)||(oo(k,h,u),Bo(R=>({...R,[c]:h})))},[ne,u]),[tn,$o]=(0,l.useState)(null),{activity:nn,noteAttention:on}=po(P),rn=(0,l.useCallback)(c=>{on(c),Z({type:"read",author:c.author,ids:c.reads,at:Date.now()})},[on,Z]),se=(0,l.useCallback)(c=>{if(ue(c)!==null||re(c).length>0||st(c))return!0;let h=On(c);return h?P.graph.allEdges().some(k=>k.kind===h.kind&&k.from===h.from&&k.to===h.to):P.graph.getNode(c)!==void 0},[P]),an=(0,l.useCallback)(c=>{let h=c.selection??Et,k=h.filter(se),R=k.length===h.length?c:De(c,k);return R.focusId!==null&&!se(R.focusId)&&(R=z(R,null)),R},[se]),ke=(0,l.useCallback)(c=>{let h=an(c),k=wo(P,q,h.shown);if(h.focusId!==null&&k.size>0){let R=re(h.focusId),mn=P.graph.getNode(h.focusId);(R.length>0?R.every(Uo=>k.has(Uo)):mn?k.has(mn.kind):!1)&&(h={...h,focusId:null})}if(!h.overview&&h.focusId===null){let R=we.focusId!==null&&!se(we.focusId)?At(t,e.schema)??{...le,overview:!0}:we;R.focusId!==null&&se(R.focusId)?h={...h,focusId:R.focusId}:R.overview===!0&&(h={...h,overview:!0})}return h},[an,se,P,we,q,t,e.schema]),$=ke(T??jo),sn=(0,l.useMemo)(()=>wo(P,q,$.shown),[P,q,$.shown]),ln=(0,l.useMemo)(()=>[...P.modules.administered.entries()].map(([c,h])=>{let k=P.mayAdminister(c,q);return{name:c,...h.description?{description:h.description}:{},kinds:h.kinds??[],canShow:k,shown:k&&($.shown??[]).includes(c)}}),[P,q,$.shown]),Pe=(0,l.useCallback)(c=>{let h=k=>ke(typeof c=="function"?c(k):c);if(T!==void 0){I?.(h(T));return}I&&I(h($)),Gt(k=>h(k))},[$,I,T,ke]);(0,l.useEffect)(()=>{T===void 0&&Gt(c=>{let h=ke(c);return h===c?c:h})},[$,T,ke]);let dn=$.selection??Et,un=(0,l.useCallback)(c=>{Pe(h=>De(h,typeof c=="function"?c(h.selection??Et):c))},[Pe]),{who:cn,following:fn,follow:pn,sayWhere:zo,sharing:yn}=uo({channel:g,store:P,view:$,principal:q,session:B,robots:ve,seatWho:tt,settingValues:Ee,setView:Pe,seats:a,people:s,...f!==void 0?{ttlMs:f}:{}}),qo=(0,l.useMemo)(()=>({store:P,scheme:o,views:t,view:$,setView:Pe,homeView:we,selection:dn,setSelection:un,menuAt:Wt,setMenuAt:Go,whereIs:zt,pointer:qt,motion:Ut,registerScene:$t,robots:ve,noteSeat:Xt,seatWho:tt,registerSeatWho:Jt,actsDoor:Ft,registerActsDoor:Wo,seatTalk:Kt,...u?{memory:u}:{},who:cn,following:fn,follow:pn,sayWhere:zo,sharing:yn,session:B,ai:w,resolveApp:O,linkedRecords:C,menuSections:Se,linkedReads:Zt,movedByHand:Dt,noteMoved:jt,emphasis:tn,setEmphasis:$o,activity:nn,noteAttention:rn,principal:q,seats:a,people:s,takeSeat:Qt,settings:ne,settingValues:Ee,chooseSetting:en,hiddenKinds:sn,administered:ln,...b?{providers:b}:{},...y?{brand:y}:{},...Qe?{onKeepLens:Qe}:{},app:et,..._e?{locale:_e}:{}}),[P,o,t,$,Pe,dn,un,Wt,zt,qt,Ut,$t,ve,Xt,tt,Jt,Ft,Kt,u,cn,fn,pn,yn,B,w,O,C,Se,Zt,Dt,jt,tn,nn,rn,q,a,s,Qt,ne,Ee,en,sn,ln,b,y,Qe,et,_e]);return(0,ie.jsx)(Me.Provider,{value:qo,children:(0,ie.jsx)(Ae.Provider,{value:M,children:(0,ie.jsx)(qr,{children:E?(0,ie.jsx)(Be.Provider,{value:E,children:H}):H})})})}var Eo=(0,l.createContext)(null),kt,Pt=new Set,Kr=e=>(Pt.add(e),()=>void Pt.delete(e)),ho=()=>kt;function Br(e){if(!kt){kt=e;for(let t of[...Pt])t()}}var $r=300;function zr(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,$r)),r===t?e(n,o):[]}}function qr({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:d}=te(),s=Ue(),u=n.q,f=n.focusId,S=!!(u&&u.trim().length>0),p=(0,l.useSyncExternalStore)(Kr,ho,ho),g=(0,l.useMemo)(()=>S&&p?{flagged:new Set(t.violations().flatMap(E=>E.nodeIds)),touched:p.touchWeights(t.log.all())}:null,[t,s,S,p]),y=f?t.graph.getNode(f)?.kind??ue(f)??(re(f).length===1?re(f)[0]:void 0):void 0,x=(0,l.useMemo)(()=>d.near&&zr(d.near),[d.near]),m=(0,l.useMemo)(()=>!u||!g||!p?null:p.search(t,u,{...y?{inKind:y}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(E=>!i.has(E)),from:[...a,...f&&t.graph.has(f)?[f]:[]],flagged:g.flagged,touched:g.touched,limit:200,rank:x}),[t,u,r,o,i,a,f,y,g,x]),[b,w]=(0,l.useState)();return(0,l.useEffect)(()=>void m?.later?.then(E=>w([m,E])),[m]),(0,ie.jsx)(Eo.Provider,{value:b?.[0]===m?b[1]:m,children:e})}var So=new WeakMap;function xa(e){let t=So.get(e);return t||So.set(e,t=new Set(e.matched)),t}function Ur(){return(0,l.useContext)(Eo)}function te(){let e=(0,l.useContext)(Me);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function Tt(){return(0,l.useContext)(Me)??null}function Ue(){let{store:e}=te(),t=(0,l.useRef)(null),n=(0,l.useRef)(null),o=(0,l.useCallback)(()=>(n.current!==e&&(n.current=e,t.current=null),t.current??=e.graph.allNodes(),t.current),[e]),r=(0,l.useCallback)(i=>e.subscribe(()=>{t.current=null,i()}),[e]);return(0,l.useSyncExternalStore)(r,o,o)}function Yr(e){let{store:t}=te(),n=(0,l.useCallback)(r=>t.subscribe(r),[t]),o=(0,l.useCallback)(()=>e===null?void 0:t.graph.getNode(e),[t,e]);return(0,l.useSyncExternalStore)(n,o,o)}function wo(e,t,n){let o=new Set(e.modules.disabledKinds);for(let r of e.kindsKeptFrom(t))o.add(r);for(let[r,i]of e.modules.administered)if(!(e.mayAdminister(r,t)&&(n??[]).includes(r)))for(let a of i.kinds??[])o.add(a);return o}var Rt=2600;var ko=new WeakSet,Xr=e=>ko.has(e),Jr=e=>void ko.add(e);function At(e,t){let n=Pn(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...le,focusId:ee(n.place.kind),within:{view:n.place.as}}:{...le,focusId:ee(n.kind)}}var Po=L(j(),1),Zr=(0,Po.createContext)(!1);var Ye=Symbol.for("graview.default-view");function Ro(e){return Object.defineProperty(e,Ye,{value:!0,enumerable:!1}),e}function Ao(e){return typeof e=="function"&&e[Ye]===!0}var Mt=Symbol.for("graview.replaces-page");function To(e){return typeof e=="function"&&e[Mt]===!0}function ei(e){return kn(e)}function ti(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 ye=L(j(),1);function ni(){let{selection:e,setSelection:t}=te();return(0,ye.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 oi(){let{store:e}=te(),t=Ue();return(0,ye.useMemo)(()=>ri(e),[e,t])}var Mo=new WeakMap;function ri(e){let t=Mo.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),Mo.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function ii(){let{view:e,setView:t}=te();return(0,ye.useMemo)(()=>({view:e,url:Q(e),focus:n=>t(o=>z(o,n)),show:n=>t(o=>Vn(o,n)),toggle:n=>t(o=>je(o,n)),go:n=>t(n)}),[e,t])}var pe={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;pe.at=typeof t?.graview=="number"?t.graview:0,pe.at>pe.depth&&(pe.depth=pe.at),pe.tell()});var N=L(j(),1),Vt={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"]}},ai={position:"fixed",inset:"auto",margin:0,zIndex:bn("popover"),boxSizing:"border-box"},Xe=6,me=8,si=e=>typeof e.showPopover=="function";function Je(e){try{return e.matches(":popover-open")}catch{return!1}}function li(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=li(t);if(!o)return;let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},i=e.dataset.graviewDesignedHeight??=e.style.maxHeight;e.style.maxHeight=i;let a=e.getBoundingClientRect(),d=r.height-o.bottom-Xe-me,s=o.top-Xe-me,u=a.height<=d||d>=s,f=Math.max(96,Math.floor(u?d:s)),S=Math.min(a.height,f);a.height>f&&(e.style.maxHeight=i?`min(${i}, ${f}px)`:`${f}px`);let p=a.width,g=n.align==="start"?o.left:o.right-p,y=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();y&&p<=y.right-y.left&&(g<y.left?g=o.left+p<=y.right?o.left:y.left:g+p>y.right&&(g=o.right-p>=y.left?o.right-p:y.right-p));let x=p>=r.width-2*me?Math.max(0,(r.width-p)/2):Math.max(me,Math.min(g,r.width-me-p)),m=u?o.bottom+Xe:Math.max(me,o.top-Xe-S);e.style.left=`${Math.round(x)}px`,e.style.top=`${Math.round(m)}px`}function Oo(e,t,n,o={}){let r=o.align??"end";(0,N.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(si(i)&&!Je(i))try{i.showPopover(),ui()}catch{}let a=0,d=u=>{u?.target instanceof Node&&i.contains(u.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>_t(i,n,{align:r})))};_t(i,n,{align:r}),addEventListener("resize",d),addEventListener("scroll",d,!0);let s=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>d());return s?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",d),removeEventListener("scroll",d,!0),s?.disconnect(),i.isConnected&&Je(i))try{i.hidePopover()}catch{}}},[t,e,r])}var Ct=new Set;function di(e){return Ct.add(e),()=>Ct.delete(e)}function ui(){for(let e of Ct)if(!(!e.isConnected||!Je(e)))try{e.hidePopover(),e.showPopover()}catch{}}var ge=null,ci='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function fi(e){for(let t of e.querySelectorAll(ci))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var Ot=()=>{let e=document.activeElement;return e===null||e===document.body};function pi(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,d]=(0,N.useState)(!1),s=t.open??a,u=(0,N.useRef)(null),f=(0,N.useRef)(null),S=(0,N.useCallback)(w=>{u.current=w},[]),p=(0,N.useCallback)(w=>{f.current=w},[]),g=`graview-popover-${(0,N.useId)().replace(/:/g,"")}`,y=(0,N.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});y.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let x=(0,N.useCallback)(w=>{y.current.controlled||d(w),y.current.onOpenChange?.(w)},[]),m=(0,N.useCallback)(()=>{(document.querySelector(`[aria-controls="${g}"]`)??u.current??y.current.returnTo?.()??null)?.focus({preventScroll:!0})},[g]),b=(0,N.useCallback)(w=>{let E=f.current,O=typeof document>"u"?null:document.activeElement,W=O===null||O===document.body||E!==null&&E.contains(O);x(!1),!(!w||!W)&&(m(),requestAnimationFrame(()=>{Ot()&&m()}))},[x,m]);return Oo(f,i&&s,n??u,t.align?{align:t.align}:{}),(0,N.useEffect)(()=>{if(!i||!s)return;let w={name:e,close:()=>b(!1)};if(ge&&ge.close!==w.close&&ge.close(),ge=w,Vt[e].focus==="into"){let T=f.current;T&&!T.contains(document.activeElement)&&fi(T).focus({preventScroll:!0})}let E=T=>{T.key==="Escape"&&b(!0)},O=T=>{let I=T.target;if(!(I instanceof Node))return;let H=f.current;if(H?.contains(I)||u.current?.contains(I))return;let D=I instanceof Element?I.closest('[role="dialog"], [role="alertdialog"]'):null;D&&!(H&&D.contains(H))||(b(!1),Vt[e].focus==="into"&&requestAnimationFrame(()=>{(Ot()||H!==null&&H.contains(document.activeElement))&&m()}))},W=null,C=null,K=T=>{let I=T.target;if(!(I instanceof Element))return;let H=f.current,D=I.closest('[role="dialog"], [role="alertdialog"]');!D||H&&(H.contains(D)||D.contains(H))||(W=D,b(!1))};return document.addEventListener("keydown",E),document.addEventListener("pointerdown",O,!0),document.addEventListener("focusin",K),()=>{document.removeEventListener("keydown",E),document.removeEventListener("pointerdown",O,!0),document.removeEventListener("focusin",K);let T=W;T&&typeof MutationObserver<"u"&&(C?.disconnect(),C=new MutationObserver(()=>{T.isConnected||(C?.disconnect(),requestAnimationFrame(()=>{(Ot()||document.activeElement.closest("[hidden]")!==null)&&m()}))}),C.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>C?.disconnect(),10*6e4)),ge?.close===w.close&&(ge=null)}},[i,s,e,b,m]),{open:s,setOpen:w=>w?x(!0):b(!0),toggle:()=>s?b(!0):x(!0),trigger:{ref:S,"aria-expanded":s,"aria-controls":g,"data-graview-popover-trigger":e},pane:{ref:p,id:g,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var G=L(j(),1),Y=L(Te(),1),Lt=new Set,Vo=!1;function It(){for(let e of[...Lt])e()}function yi(){Vo||typeof window>"u"||(Vo=!0,window.addEventListener("online",It))}function mi(e){let t,n=!1,o=!1,r,i=0,a=new Set,d=()=>{i+=1;for(let p of[...a])p()},s=p=>(a.add(p),()=>void a.delete(p)),u=()=>i,f=()=>void S().catch(()=>{});function S(){if(n)return Promise.resolve(t);if(r)return r;let p=e().then(g=>(t=g,n=!0,o=!1,r=void 0,Lt.delete(f),d(),g),g=>{throw r=void 0,o=!0,Lt.add(f),yi(),d(),g});return p.catch(()=>{}),r=p,p}return{load:S,prefetch:f,get current(){return t},get failed(){return o},part(p,g={}){let y=g.what??"This part";function x(w){(0,G.useSyncExternalStore)(s,u,u);let E=(0,G.useRef)(null),O=(0,G.useRef)(null),W=(0,G.useRef)(!1);return(0,G.useEffect)(()=>{o&&r===void 0&&f()},[]),n&&typeof document<"u"&&E.current!==null&&document.activeElement===E.current&&(W.current=!0),(0,G.useLayoutEffect)(()=>{if(!(!n||!W.current)){W.current=!1;for(let C=O.current?.nextElementSibling??null;C!==null;C=C.nextElementSibling){let K=C.matches(_o)?C:C.querySelector(_o);if(K instanceof HTMLElement){K.focus();return}}}}),n?(0,Y.jsxs)(Y.Fragment,{children:[W.current?(0,Y.jsx)("span",{ref:O,hidden:!0}):null,p(t,w)]}):g.quiet?null:(0,Y.jsx)(gi,{what:y,button:E,...g.as?{as:g.as}:{}})}let m=(0,G.lazy)(()=>S().then(()=>({default:x}),()=>({default:x})));function b(w){let[E]=(0,G.useState)(()=>n||o);return(0,G.createElement)(E?x:m,w)}return b}}}var _o="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function gi({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:It,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 he=L(j(),1);var Co=(0,he.createContext)(null);function hi(){let e=(0,he.useContext)(Co),t=Tt(),n=(o,r,i)=>t?.setView(a=>oe(oe(de(z(a,ee(o)),!1),"view",r),"filter",i?.filter??null));return(0,he.useMemo)(()=>e??{record:o=>{t&&(t.setView(r=>z(de(r,!1),o)),t.setSelection([o]))},place:(o,r)=>{let i=t?.views.places().find(a=>a.as===o);i&&n(i.kind,i.as,r)},list:(o,r)=>n(o,null,r)},[e,t])}var Lo=L(j(),1),Si=(0,Lo.createContext)(!1);var Io=L(j(),1),wi=(0,Io.createContext)(null);var Ho=L(j(),1),Ht='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',Nt=e=>e instanceof HTMLElement&&(e.matches(Ht)||e.hasAttribute("tabindex")),Oe=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function vi(e,t){let n=s=>s.replace(/["\\]/g,"\\$&"),o=t.getAttribute("data-testid"),r=t.getAttribute("data-graview-pick"),i=t.getAttribute("aria-label"),a=o?`[data-testid="${n(o)}"]`:r?`[data-graview-pick="${n(r)}"]`:i?`${t.tagName.toLowerCase()}[aria-label="${n(i)}"]`:null;if(!a)return null;let d=e.querySelector(a);return d&&Nt(d)&&Oe(d)?d:null}var bi=e=>e.isConnected&&Nt(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&Oe(e);function No(e,t){let n=t?vi(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&Oe(o))return o;for(let r of e.querySelectorAll(Ht))if(Oe(r))return r;return Nt(e)&&Oe(e)?e:null}function xi(e){(0,Ho.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=m=>{let b=m.target;if(b instanceof Element){n=[];for(let w=b;w&&w!==t.parentElement;w=w.parentElement)n.push(w)}},r=!1,i=!1,a=t.ownerDocument,d=()=>!i&&a.defaultView!==null,s=(m,b)=>void setTimeout(()=>d()&&b(),m),u=m=>void requestAnimationFrame(()=>d()&&m()),f=m=>{if(r=!1,i)return;let b=a.activeElement;if(!(!(b===null||b===a.body||b===a.documentElement)||n.length===0)){if(bi(n[0])){m&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let E of n.slice(1)){if(!E.isConnected)continue;let O=No(E,n[0]);if(O){O.focus({preventScroll:!0}),n=[];return}}}},S=(m,b=Date.now()+2500)=>{s(100,()=>{f(m);let w=a.activeElement;(w===null||w===a.body||w===a.documentElement)&&n.length>0&&Date.now()<b&&S(m,b)})},p=()=>{r||n.length===0||(r=!0,s(60,()=>u(()=>{f(!1),S(!1)})))},g=m=>{if(!(m instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(m.key))){if(!(m instanceof KeyboardEvent)){let b=m.target instanceof Element?m.target.closest(Ht):null,w=a.activeElement,E=w===null||w===a.body||w===a.documentElement;if(b&&E&&t.contains(b)){n=[];for(let O=b;O&&O!==t.parentElement;O=O.parentElement)n.push(O);s(150,()=>u(()=>{f(!1),S(!1)}));return}}!(m instanceof KeyboardEvent)&&!(m.target instanceof Node&&n[0]?.contains(m.target))||s(150,()=>u(()=>{f(!0),S(!0)}))}},y=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&p()}),x=m=>{m.relatedTarget===null&&p()};return t.addEventListener("focusin",o),t.addEventListener("focusout",x),t.addEventListener("click",g),t.addEventListener("keydown",g),y.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",x),t.removeEventListener("click",g),t.removeEventListener("keydown",g),y.disconnect()}},[e])}export{An as a,le as b,Q as c,Ne as d,Pi as e,Ri as f,Mn as g,Tn as h,On as i,it as j,z as k,Vn as l,oe as m,de as n,De as o,Re as p,je as q,We as r,at as s,ue as t,Mi as u,Zo as v,ee as w,_n as x,re as y,Cn as z,Qo as A,Oi as B,Ln as C,st as D,Rr as E,Ar as F,j as G,gt as H,wr as I,vr as J,Un as K,Be as L,br as M,Ae as N,Xn as O,xr as P,ht as Q,Te as R,Nr as S,Dr as T,xo as U,Fr as V,Br as W,xa as X,Ur as Y,te as Z,Tt as _,Ue as $,Yr as aa,Xr as ba,Jr as ca,At as da,Co as ea,hi as fa,Zr as ga,Ro as ha,Ao as ia,To as ja,ei as ka,ti as la,Si as ma,wi as na,ni as oa,oi as pa,ii as qa,pe as ra,xi as sa,ai as ta,Je as ua,Oo as va,di as wa,pi as xa,mi as ya};
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{G as m,O as r,R as a,a as o,ya as l}from"./chunk.GFF2FB2J.js";import{b as n}from"./chunk.AJZBJBMO.js";var p=n(m(),1),e=n(a(),1),c=l(o(()=>import("./chunk.JISMMIMX.js"))),f=c.part((i,t)=>(0,e.jsx)(i.Timeline,{...t}),{what:"The timeline"}),u=()=>c.prefetch();function T({face:i}){return r()?.open?(0,e.jsx)(p.Suspense,{fallback:null,children:(0,e.jsx)(f,{face:i})}):null}export{u as a,T as b};
@@ -1 +0,0 @@
1
- import{a as ne,b as ie,c as oe,d as re}from"./chunk.NO52VON3.js";import"./chunk.4ALKPNXM.js";import{a as te}from"./chunk.OQ4KFN6W.js";import"./chunk.YNQDVGZM.js";import"./chunk.3R4W2P5X.js";import{a as ee}from"./chunk.G4JJXA63.js";import"./chunk.C5CYZNSJ.js";import"./chunk.JPHNKWTY.js";import"./chunk.XRJBLH4N.js";import{j as X,k as J}from"./chunk.3SKKIHU3.js";import"./chunk.HJCQ6I3S.js";import"./chunk.O2LK2AO7.js";import"./chunk.26CZTUY4.js";import"./chunk.3JNMSOFG.js";import"./chunk.PKK6FRZR.js";import"./chunk.OAF7TUMI.js";import"./chunk.J2ITFGN3.js";import{a as q,d as B}from"./chunk.V5ZYUVMH.js";import"./chunk.6XMEU2Q2.js";import{a as Q}from"./chunk.QIAKO27D.js";import"./chunk.UT6642FC.js";import"./chunk.QTA4ROAK.js";import"./chunk.2CIBWZJG.js";import"./chunk.7BWT5L2L.js";import"./chunk.SE5SKFQH.js";import"./chunk.W3S6UXNA.js";import"./chunk.4SJUTBDV.js";import"./chunk.TI4OSTQV.js";import"./chunk.6T2Q6NLO.js";import"./chunk.OZNW5W4Z.js";import"./chunk.NDADLJE6.js";import"./chunk.AK3IHFCF.js";import"./chunk.HHPGWJDO.js";import"./chunk.42YX6NOY.js";import"./chunk.EYZ7MHBZ.js";import"./chunk.KQT7WAQE.js";import"./chunk.PAVR5TK5.js";import"./chunk.OQDETV4X.js";import{g as G}from"./chunk.3VL5WECB.js";import"./chunk.JH6MU6TX.js";import"./chunk.WAFDCOOG.js";import{g as Z}from"./chunk.L4DECHXR.js";import{G as ye,J as U,R as K,Z as C,k as F,n as _,o as Y,pa as V}from"./chunk.GFF2FB2J.js";import{W as j,Z as P,_ as T,ca as N,da as W,vc as z}from"./chunk.6V2RG5JG.js";import{b as O}from"./chunk.AJZBJBMO.js";var M=3;function ae(e,n){return n.id?e.graph.getNode(n.id):void 0}function le(e){return e?/^(?:kind|aggregate):([^:]+)$/.exec(e)?.[1]:void 0}function de(e,n){if(n)return e.find(t=>t.nodeIds.includes(n)||t.subjectId===n)}var me=e=>{let n=e.trim();if(!n)return n;let t=n.charAt(0).toUpperCase()+n.slice(1);return/[.!?…]$/.test(t)?t:`${t}.`};function ce({store:e,subject:n,violations:t,place:i}){let s=ae(e,n),o=de(t,s?.id??null);if(o)return me(o.message);if(s){let l=s.kind;return`${j(e.schema.tryDefinition(l),s)}, ${N(W(e.schema.tryDefinition(l),l))}.`}let c=i?.kind??le(n.id);if(c){let l=e.graph.nodesOfKind(c).length,g=i?.title??n.name,u=T(e.schema,c),f=P(e.schema,c,l);return g.toLowerCase()===u.toLowerCase()?`${l===1?"There is":"There are"} ${f} here.`:`${g}: ${f}.`}let a=e.schema.kinds.map(l=>({kind:l,count:e.graph.nodesOfKind(l).length})).filter(l=>l.count>0).sort((l,g)=>g.count-l.count).slice(0,3);if(a.length===0)return"Nothing here yet.";let r=a.map(l=>P(e.schema,l.kind,l.count));return`The whole thing: ${r.length===1?r[0]:`${r.slice(0,-1).join(", ")} and ${r[r.length-1]}`}.`}function ue(e){let{store:n,subject:t,violations:i}=e,s=ae(n,t),o=[];s&&de(i,s.id)?o.push({ask:`What's wrong with ${t.name}?`,why:"problem"}):i.length>0&&o.push({ask:"What needs attention?",why:"problem"});let c=s?s.kind:e.place?.kind??le(t.id),a=ke(e,c);if(a)o.push(a);else{let l=be(e,c);l&&o.push(l)}let r=we(e,c);return r&&o.push(r),o.length<M&&(s?o.push({ask:`Tell me about ${t.name}`,why:"about"}):o.push({ask:"What is here?",why:"here"})),o.slice(0,M)}function pe(e,n){return e.schema.tryDefinition(n)?.fields?.shape??{}}function Se(e){let n=e;for(let t=0;t<4&&n;t++){let i=n;if(Array.isArray(i.options)&&i.options.every(s=>typeof s=="string"))return i.options;n=typeof i.unwrap=="function"?i.unwrap():i._def?.innerType}}var se=/^\d{4}-\d{2}-\d{2}/,ve=["due","deadline","date","when"];function ke(e,n){let{store:t}=e,i=e.today;if(!i||!se.test(i))return;let s=new Date(`${i.slice(0,10)}T00:00:00Z`);s.setUTCDate(s.getUTCDate()+6);let o=s.toISOString().slice(0,10),c=[...new Set([...n?[n]:[],...t.schema.kinds])];for(let a of c){let r=ve.find(u=>u in pe(t,a));if(!r||!t.graph.nodesOfKind(a).some(u=>{let f=u[r],S=u.done;return typeof f=="string"&&se.test(f)&&f.slice(0,10)>=i.slice(0,10)&&f.slice(0,10)<=o&&S!==!0}))continue;let g=T(t.schema,a);return{ask:`${ee(g)} due this week`,why:"due"}}}function be(e,n){let t=e.place?.title,i=(e.places??[]).find(s=>s.kind!==null&&s.picture===!0&&s.title!==t&&s.kind!==n);return i?{ask:`Go to ${i.title}`,why:"go"}:void 0}function we(e,n){let{store:t}=e,i=[...t.schema.kinds].sort((o,c)=>t.graph.nodesOfKind(c).length-t.graph.nodesOfKind(o).length),s=[...new Set([...n?[n]:[],...i])];for(let o of s){if(t.graph.nodesOfKind(o).length<2)continue;let c=pe(t,o),a=Object.keys(c).find(g=>(Se(c[g])?.length??0)>=2);if(!a)continue;let r=T(t.schema,o).toLowerCase(),l=a.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").toLowerCase();return{ask:`Show ${r} as a board by ${l}`,why:"draw"}}}function ge(e,{store:n,subject:t}){let i=a=>t.id!==null&&(a.nodeIds.includes(t.id)||Object.values(a.args).includes(t.id)),s=e.filter(a=>a.provider==="invariant"&&i(a)),o=e.filter(a=>a.pinned==="user"&&!s.includes(a));return[...s,...o].sort((a,r)=>Number(a.destructive??!1)-Number(r.destructive??!1)).slice(0,M).map(a=>({affordance:a,label:xe(a,{store:n,subject:t})}))}var Ae=e=>/^[a-z0-9]+(?:[-_][a-z0-9]+)+$|^[a-z]+[A-Z][A-Za-z0-9]*$/.test(e);function xe(e,{store:n,subject:t}){let i=e.label,s=Ae(i)||i===e.mutation;if(s){let r=i.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").toLowerCase();i=r.charAt(0).toUpperCase()+r.slice(1)}let o=t.id?n.graph.getNode(t.id):void 0,c=o!==void 0&&e.nodeIds.length<=1&&(e.nodeIds[0]??o.id)===o.id;if(c&&/\bit\b/.test(i))return i.replace(/\bit\b/,t.name);let a=n.allMutations().find(r=>r.name===e.mutation);if(e.open.length===0&&a?.describe&&(s||c))try{let r=a.describe(e.args,n.graph);if(r.trim())return r.trim()}catch{}return i}var y=O(ye(),1);var p=O(K(),1);function Ye({phone:e,side:n,name:t,onClose:i,respond:s,onCall:o,onPick:c,onMove:a,place:r,onDraft:l}){let{seatTalk:g}=C(),u=U(g),f=Te(c),S=[...u.turns].reverse().find(h=>h.role==="seat"),m=e&&u.draft!==null,b=(0,y.useRef)(null),w=(0,y.useRef)(!0);return(0,y.useLayoutEffect)(()=>{let h=b.current;if(!h)return;let A=m?[...h.querySelectorAll("ol > li")].pop():void 0;if(A){let v=A.getBoundingClientRect().top-h.getBoundingClientRect().top+h.scrollTop;h.style.maxHeight=`min(${Math.ceil(h.scrollHeight-v)}px, ${fe})`}let k=w.current?he.get(g):void 0;w.current=!1,h.scrollTop=k&&k.turns===u.turns.length&&!u.busy?k.top:h.scrollHeight},[u.turns.length,u.busy,m]),(0,p.jsxs)("div",{"data-testid":"seat-panel",...m?{"data-graview-seat-yields":""}:{},style:{display:"grid",gridTemplateRows:"auto minmax(0, 1fr)",gap:4,minHeight:0},children:[(0,p.jsxs)("div",{"data-testid":"seat-top",...e?{onPointerDown:h=>Le(h,i)}:{},style:{display:"flex",alignItems:"center",justifyContent:e?"center":"flex-end",gap:2,position:"relative",minHeight:28,...e?{touchAction:"none"}:{}},children:[e?(0,p.jsx)("button",{type:"button","data-testid":"seat-grab","aria-label":`Close Ask ${t}`,title:"Close",onClick:i,style:{...E,width:64},children:(0,p.jsx)("span",{"aria-hidden":"true",style:{display:"block",width:36,height:4,margin:"0 auto",borderRadius:2,background:"var(--graview-edge-strong, var(--graview-ink-faint))"}})}):(0,p.jsx)("button",{type:"button","data-testid":"seat-side","aria-label":n==="left"?"Move to the right":"Move to the left",title:n==="left"?"Move to the right":"Move to the left",onClick:()=>g.setSide(n==="left"?"right":"left"),style:E,children:(0,p.jsx)("span",{"aria-hidden":"true",children:"\u21C4"})}),(0,p.jsx)("button",{type:"button","data-testid":"seat-close","aria-label":`Close Ask ${t}`,title:"Close",onClick:i,style:e?{...E,position:"absolute",top:0,right:0}:E,children:(0,p.jsx)("span",{"aria-hidden":"true",children:"\u2715"})})]}),(0,p.jsx)("div",{ref:b,"data-testid":"seat-body",onScroll:h=>void he.set(g,{top:h.currentTarget.scrollTop,turns:u.turns.length}),style:{minHeight:0,maxHeight:m?fe:e?"calc(70cqh - 96px)":"min(520px, calc(100cqh - 112px))",overflowY:"auto",overflowX:"hidden",padding:"0 4px"},children:(0,p.jsx)(ie,{shared:!0,composer:!1,testId:"seat",onPick:f,...a?{onMove:a}:{},...r?{place:r}:{},...l?{onDraft:l}:{},empty:(0,p.jsx)(Ce,{...r?{here:r}:{}}),...s?{respond:s}:{},...o?{onCall:o}:{}})}),(0,p.jsx)("p",{"aria-live":"polite","data-testid":"seat-said",style:Z,children:u.busy?"":S?.text??""})]})}function Te(e){let{setView:n}=C();return(0,y.useCallback)(t=>e?e(t):n(i=>Y(F(_(i,!1),t),[t])),[e,n])}function Ce({here:e}){let{store:n,views:t,view:i,seatTalk:s}=C(),o=ne({hover:!1}),c=q(n,V()),a=(0,y.useMemo)(()=>c.map(d=>d.line?{...d,message:B(d)}:d),[c]),r=o.id?n.graph.getNode(o.id):void 0,l=e??i.within?.view,g=o.because==="place"&&o.id===null?t.places().find(d=>d.title===o.name):l?t.places().find(d=>d.as===l):void 0,u=n.today(),f={store:n,subject:{id:o.id,name:o.name},violations:a,place:g?{title:g.title,kind:g.kind}:null,places:z(t.places()).map(d=>({title:d.title,kind:d.kind,picture:!0})),...u?{today:u}:{}},S=ce(f),m=ue(f),b=(0,y.useMemo)(()=>({pins:te(),...r?{focus:r.id,about:[r.id]}:{}}),[r?.id]),{affordances:w}=X(b),h=r?ge(w,{store:n,subject:{id:o.id,name:o.name}}):[],{apply:A,preview:k}=J(),[v,$]=(0,y.useState)(null),[D,R]=(0,y.useState)(null),H=(d,x)=>{try{return k(d,x),A(d,x),R(null),!0}catch(I){return R(G(n.schema,n.allMutations(),I)),!1}};return(0,p.jsxs)("div",{"data-testid":"seat-here",style:{display:"grid",gap:10,padding:"2px 2px 6px"},children:[(0,p.jsx)("p",{"data-testid":"seat-where",style:{margin:0,fontSize:"0.9375rem",lineHeight:1.45,color:"var(--graview-ink)"},children:S}),h.length>0?(0,p.jsx)("ul",{"aria-label":"What you can do",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:6},children:h.map(({affordance:d,label:x})=>(0,p.jsx)("li",{children:(0,p.jsx)("button",{type:"button","data-testid":"seat-act","data-affordance":d.id,"aria-pressed":v?.id===d.id,title:d.why,onClick:()=>d.open.length>0?$(I=>I?.id===d.id?null:d):void H(d),style:{...oe,minHeight:30,textAlign:"start",...d.destructive?{color:"var(--graview-warn)"}:{}},children:x})},d.id))}):null,v?(0,p.jsx)(Q,{affordance:v,onApply:d=>{H(v,d)&&$(null)},onCancel:()=>$(null)}):null,D?(0,p.jsx)("p",{"data-testid":"seat-refused",style:{margin:0,fontSize:"0.8125rem",color:"var(--graview-warn)"},children:D}):null,m.length>0?(0,p.jsx)("ul",{"aria-label":"Things to ask",style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:2,justifyItems:"start"},children:m.map(d=>(0,p.jsx)("li",{children:(0,p.jsx)("button",{type:"button","data-testid":"seat-suggestion","data-graview-why":d.why,onClick:()=>s.ask(d.ask),style:re,children:d.ask})},d.ask))}):null]})}var fe="min(5.5em, 22cqh)",he=new WeakMap,L={far:64,flick:.5,least:16,tap:6};function Le(e,n){if(e.button!==0)return;let t=e.currentTarget,i=t.closest('[data-testid="seat"]');if(!i)return;let s=e.pointerId,o=e.clientY,c={y:o,at:e.timeStamp},a=0,r=0;try{t.setPointerCapture(s)}catch{}let l=u=>{if(u.pointerId!==s)return;r=Math.max(0,u.clientY-o);let f=u.timeStamp-c.at;f>0&&(a=(u.clientY-c.y)/f),c={y:u.clientY,at:u.timeStamp},i.style.transition="none",i.style.transform=r>0?`translateY(${r}px)`:""},g=u=>{if(u.pointerId!==s)return;t.removeEventListener("pointermove",l),t.removeEventListener("pointerup",g),t.removeEventListener("pointercancel",g);let f=u.type==="pointerup"&&(r>=L.far||r>=L.least&&a>=L.flick);if(i.style.transition=f?"":"transform 160ms ease-out",i.style.transform="",r>L.tap){let S=m=>{m.preventDefault(),m.stopPropagation()};t.addEventListener("click",S,{capture:!0,once:!0}),setTimeout(()=>t.removeEventListener("click",S,{capture:!0}),0)}f&&n()};t.addEventListener("pointermove",l),t.addEventListener("pointerup",g),t.addEventListener("pointercancel",g)}var E={display:"inline-grid",placeItems:"center",width:28,height:28,padding:0,font:"inherit",fontSize:"0.875rem",lineHeight:1,color:"var(--graview-ink-muted)",background:"transparent",border:"1px solid transparent",borderRadius:6,boxShadow:"none",cursor:"pointer"};export{Ye as SeatPanel,Te as useSeatGo};
@@ -1 +0,0 @@
1
- import{a as b,b as c,c as d,d as e,e as f}from"./chunk.VOAZBHCG.js";import"./chunk.QTMWHE5O.js";import"./chunk.NDADLJE6.js";import"./chunk.HHPGWJDO.js";import"./chunk.42YX6NOY.js";import{hb as a}from"./chunk.6V2RG5JG.js";import"./chunk.AJZBJBMO.js";export{a as ActRefusal,e as compileDocumentWithoutCheck,d as effectsOf,f as inDocumentWords,c as kindShapes,b as readDocument};
@@ -1,2 +0,0 @@
1
- import{a as ee,b as E,d as oe,g as se,h as re,i as ie}from"./chunk.WAFDCOOG.js";import{Aa as T,D as I,E as w,Ea as Q,G as P,Ga as V,Ia as X,J as b,K,L as Y,O as v,Q as H,W as $,ba as U,da as B,ha as G,la as Z,pb as ne,qa as q,rb as te,sa as J}from"./chunk.6V2RG5JG.js";var ce=t=>`${t}${t%100>=11&&t%100<=13?"th":["th","st","nd","rd"][t%10]??"th"}`,fe={day:"day",week:"week",month:"month",year:"year"},R=t=>t.length<2?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`;function ye(t,e,n){let o=e.interval??1,i=fe[e.every],a=t.slice(0,10),c=o===1?`Every ${i}`:o===2?`Every other ${i}`:`Every ${o} ${i}s`,d;if(e.every==="week"){let f=(e.on?.length?e.on:[T[new Date(`${a}T00:00:00Z`).getUTCDay()]]).map(l=>H(T.indexOf(l),"long",n));d=o===1?`Every ${R(f)}`:o===2?`Every other ${R(f)}`:`${c} on ${R(f)}`}else if(e.every==="month"){let f=(e.on?.length?e.on:[+a.slice(8,10)]).map(l=>l===-1?"the last day":`the ${ce(Number(l))}`);d=`${c} on ${R(f)}`}else e.every==="year"?d=`${c} on ${v(a,n)}`:d=c;return w.test(t)&&(d+=` at ${Y(t,n)}`),e.until&&(d+=`, until ${b(e.until,n)}`),e.count&&(d+=`, ${e.count===1?"once":`${e.count} times`}`),d}function de(t,e,n={}){if(!V(e)||typeof t!="string")return;let o=n.today??P(),i=X(t,e,o),a=ye(t,e,n.locale),c=i.slice(0,4)===o.slice(0,4)?v(i.slice(0,10),n.locale):b(i.slice(0,10),n.locale);return i.slice(0,10)<o?`${a}, last ${c}`:`${a}, next ${c}`}function Pe(t,e){let n=new Map,o=new Map;for(let i of t){let a=$(e(i.kind),i).trim().toLowerCase();o.set(a,[...o.get(a)??[],i])}for(let i of o.values()){if(i.length<2)continue;let a=new Map;for(let c of i)a.set(c.kind,[...a.get(c.kind)??[],c]);for(let[c,d]of a){if(d.length===1){n.set(d[0].id,B(e(c),c));continue}let f=d.map(y=>new Map(pe(y,e(y.kind)).map(r=>[r.key,r.alone]))),l=[...new Set(f.flatMap(y=>[...y.keys()]))],p=y=>f.every(r=>!/\d/.test(r.get(y)??"")),A=[...l.filter(p),...l.filter(y=>!p(y))].find(y=>new Set(f.map(r=>r.get(y)??"")).size===d.length);d.forEach((y,r)=>{let s=A?f[r].get(A):void 0;n.set(y.id,s??y.id)})}}return n}function Ke(t,e){return t?.describe?t.describe(e):`${e.kind} ${$(t,e)}`}var ue=new Set(["id","kind","label"]);function ge(t,e){if(e.length===0)return!1;let n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`(^|[\\s\xB7,(/])${n}($|[\\s\xB7,)/])`).test(t)}function pe(t,e,n={}){let o=e?.display,i=new Set([...ue,...o?.hide??[]]);typeof t.label=="string"&&e?.label&&!$(e,t).includes(t.label)&&i.delete("label");let a=(n.said??[]).filter(r=>!!r),c=a.filter(r=>r.endsWith("\u2026")).map(r=>r.replace(/…$/,"").trim()).filter(r=>r.length>12),d=[],f=e?.fields?.shape,l=e?.fieldRoles,p=n.glance?o?.glance??[l?.who,l?.when].filter(r=>!!r):ae(o?.page),M=n.glance&&o?.glance!==void 0,y=[...new Set(M?p:[...p,...be(e),...Object.keys(t)])].filter(r=>Object.hasOwn(t,r)).map(r=>[r,t[r]]);for(let[r,s]of y){if(i.has(r)||s===void 0||s===null)continue;let u=o?.format?.[r],k=u?[]:G(s);if(k[0]&&n.glance)continue;let O=e?.fields?.shape?.[r],_=!u&&typeof s=="string"&&Z(O)?s:void 0,x=!u&&typeof s=="string"&&ee(O);if(_&&n.glance)continue;let S=u?void 0:J(O),m=S?{relation:S,refs:q(s,S)}:void 0;if(m&&(n.glance||m.refs.length===0)||!k[0]&&typeof s=="object"&&(!Array.isArray(s)||s.some(g=>typeof g=="object"&&g!==null))&&u===void 0)continue;let j=typeof s=="string"&&!u?de(s,t[`${r}Repeat`],{locale:n.locale}):void 0,F=k[0]?k.map(g=>g.caption?`${g.name} \u2014 ${g.caption}`:g.name).join(", "):Array.isArray(s)?s.join(", "):typeof s=="boolean"?s?"Yes":"No":String(s),N=u?void 0:se(e,r),L=ie(N,s),W=!u&&!N&&typeof s=="number"?ne(e?.fields?.shape?.[r]):void 0,z=m?m.refs.length>1?`${m.refs.length} linked records`:"linked record":u?u(s):W?te(s,W):re(N,s,n.locale)??(Array.isArray(s)||typeof s=="boolean"?F:typeof s=="string"&&j!==void 0?j:typeof s=="string"&&I.test(s)?b(s,n.locale):typeof s=="string"&&w.test(s)?K(s,n.locale):typeof s=="string"&&ke(e,r)?E(e,r,s):F),C=typeof s=="string"&&Ae(e,r,z),h=(n.glance||n.excerpt)&&!u&&(C||x)?oe(z,{markdown:x}):z;if(a.includes(h)||c.some(g=>h.startsWith(g))||n.glance&&(typeof s=="string"||typeof s=="number")&&a.some(g=>ge(g,h)))continue;let D=U(e,r),le=typeof s=="number"?`${D} ${h}`:typeof s=="boolean"&&!u?`${D}: ${h.toLowerCase()}`:h;if(d.push({key:r,label:D,value:h,stored:F,alone:le,long:C,...x?{markdown:!0}:{},...k[0]?{files:k}:{},..._?{app:_}:{},...m?{linked:m}:{},...L?{href:L}:{},...Q(f?.[`${r}Repeat`])?{repeats:!0}:{}}),n.limit!==void 0&&d.length>=n.limit)break}return me(d,e)}function me(t,e){let n=new Map;for(let o of t){let i=he(e,o.key);i&&n.set(o.key,new Set(i.map(a=>E(e,o.key,a).toLowerCase())))}return n.size<2?t:t.map(o=>{let i=n.get(o.key);return i!==void 0&&[...n].some(([c,d])=>c!==o.key&&[...i].some(f=>d.has(f)))?{...o,alone:`${o.label}: ${o.value.toLowerCase()}`}:o})}function he(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"&&n._zod.def.entries?Object.values(n._zod.def.entries).map(String):void 0}function ke(t,e){let n=t?.fields?.shape?.[e];for(let o=0;o<6&&n?._zod?.def?.innerType!==void 0;o++)n=n._zod.def.innerType;return n?._zod?.def?.type==="enum"}function be(t){let e=t?.fields?.shape;return[...Object.keys(e??{}),...Object.keys(t?.computed??{})]}function ae(t){return[...t?.fields??[],...(t?.groups??[]).flatMap(e=>e.fields)]}var we=500,$e=160;function Re(t){let e=t;for(let n=0;n<6&&e?._zod?.def?.innerType!==void 0;n++)e=e._zod.def.innerType;return e?._zod?.def?.type==="string"?e._zod.def:void 0}function Ae(t,e,n){return Re(t?.fields?.shape?.[e])?.checks?.some(i=>i._zod?.def?.check==="max_length"&&(i._zod.def.maximum??0)>we)?!0:typeof n=="string"&&(n.includes(`
2
- `)||n.length>$e)}function Ye(t,e){let n=t?.display?.page,o=n?.groups??[],i=new Map(e.map(l=>[l.key,l])),a=new Set(ae(n)),c=l=>l.flatMap(p=>i.has(p)?[i.get(p)]:[]),d=e.filter(l=>!a.has(l.key));return[{fields:[...c(n?.fields??[]),...o.length>0?[]:d]},...o.map(l=>({title:l.title,fields:c(l.fields)})),...o.length>0?[{title:"Details",fields:d}]:[]].filter(l=>l.fields.length>0)}export{ye as a,Pe as b,Ke as c,pe as d,Ye as e};
@@ -1 +0,0 @@
1
- import"./chunk.L4DECHXR.js";import{G as F,O,P as R,R as j,_ as E}from"./chunk.GFF2FB2J.js";import{K as M,Ka as T,dc as x}from"./chunk.6V2RG5JG.js";import{b as S}from"./chunk.AJZBJBMO.js";function W(n,t){return n.kind==="agent"?"agent":n.kind!=="human"?"app":n.onBehalfOf!==void 0?"person":n.id===void 0||t?.id===void 0||n.id===t.id?"you":"person"}var K=n=>n.ops.filter(t=>t.withheld!==!0);function C(n,t={}){let r=n.batches().map(e=>{let s=e.ops[0],l=e.ops.at(-1),d=K(e).length===0;return{seq:l.seq+1,from:s.seq,at:l.at,batch:e.id,maker:d?"person":W(e.author,t.me),author:d?void 0:e.author,said:e.intent,declaration:!1,withheld:d}}),i=[...n.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<n.log.horizon||e.seq>n.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?W(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 N(n,t){let r=n.log.all(),i=new Map(r.map(e=>[e.id,e.seq]));return n.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 I(n,t){return n.withheld?"Someone":n.maker==="you"?"you":n.author?T(n.author,t):"the app"}var c=S(F(),1);var o=S(j(),1),Y={kind:"human"},_=[1,2,4,8],G=900,P={you:"You",person:"A person",agent:"An agent",app:"The app"},z={you:"var(--graview-accent)",person:"var(--graview-ink-muted)",agent:"var(--graview-activity, var(--graview-good))",app:"var(--graview-edge-bright)"};function U(n,t){return[...new Set([t,...n.map(r=>r.seq)])].sort((r,i)=>r-i)}function X(n,t){let r=0;for(let i=0;i<n.length;i++)n[i]<=t&&(r=i);return r}function J(n,t,r){let i=N(n,t);if(i.length===0)return null;let e=n.canUndo(i);if(!e.ok)return null;let s=new Set(n.permittedMutations(r).map(l=>l.name));return e.ops.every(l=>l.mutation!==null&&s.has(l.mutation.name))?i:null}function re({face:n}){let t=O(),r=E(),i=r?.principal??Y,e=R(t.live,i),s=e.log.length,l=(0,c.useMemo)(()=>C(e,{me:i,...t.host?.declarations?{declarations:t.host.declarations}:{}}),[e,i,t.host,s]),d=(0,c.useMemo)(()=>U(l,e.log.horizon),[l,e]),m=t.past?.seq??s,h=X(d,m),f=d.length-1,g=[...l].reverse().find(a=>a.seq<=m&&a.seq>(d[h-1]??-1))??[...l].reverse().find(a=>a.seq<=m),[y,k]=(0,c.useState)(!1),[b,B]=(0,c.useState)(1),[q,A]=(0,c.useState)(null);(0,c.useEffect)(()=>{if(!y)return;if(h>=f){k(!1);return}let a=setTimeout(()=>t.show(d[h+1]),G/b);return()=>clearTimeout(a)},[y,h,f,b,d,t]);let $=(0,c.useMemo)(()=>t.past?J(e,m,i):null,[t.past,e,m,i,s]),D=a=>I(a,{graph:e.graph,schema:e.schema,...r?.seats?{seats:r.seats}:{},...r?.people?{people:r.people}:{}}),u=t.past?t.past.at?M(t.past.at,r?.locale):"the start":null,w=g?`${D(g)==="you"?"You":D(g)}: ${g.said}`:"Nothing had happened yet",H=n==="scene"?{position:"absolute",left:"50%",bottom:12,transform:"translateX(-50%)",width:"min(720px, calc(100% - 32px))",zIndex:x("rail")}:{position:"sticky",top:0,zIndex:x("rail"),margin:"0 auto 12px",maxWidth:960,width:"100%"};return(0,o.jsxs)("section",{"aria-label":"Timeline","data-testid":"timeline","data-graview-past":t.past?String(t.past.seq):"now","data-graview-offstage":"",style:{...H,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:w}),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:d.slice(1).map((a,v)=>{let p=[...l].reverse().find(V=>V.seq===a),L=f===0?0:(v+1)/f*100;return(0,o.jsx)("span",{"data-graview-tick":a,"data-maker":p.maker,...p.declaration?{"data-declaration":""}:{},title:`${P[p.maker]}: ${p.said}`,style:{position:"absolute",left:`calc(${L}% - 1px)`,bottom:0,width:p.declaration?4:2,height:p.declaration?22:12,borderRadius:2,background:p.declaration?"var(--graview-ink)":z[p.maker],opacity:a<=m?1:.45}},`${a}:${p.batch??"declaration"}`)})}),(0,o.jsx)("input",{type:"range","data-testid":"scrubber","aria-label":"Moment",min:0,max:f,step:1,value:h,"aria-valuetext":u?`As of ${u}. ${w}`:`Now. ${w}`,onChange:a=>{k(!1),t.show(d[Number(a.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":y,onClick:()=>{!y&&h>=f&&t.show(d[0]),k(!y)},style:{minHeight:28,minWidth:64},children:y?"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:b,onChange:a=>B(Number(a.currentTarget.value)),style:{minHeight:28},children:_.map(a=>(0,o.jsxs)("option",{value:a,children:[a,"\xD7"]},a))})]}),(0,o.jsx)("span",{"aria-hidden":"true",style:{display:"inline-flex",gap:10,color:"var(--graview-ink-faint)",flexWrap:"wrap"},children:Object.keys(P).filter(a=>l.some(v=>v.maker===a)).map(a=>(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:z[a]}}),P[a]]},a))}),(0,o.jsxs)("span",{style:{marginLeft:"auto",display:"inline-flex",gap:8},children:[$?(0,o.jsx)("button",{type:"button","data-testid":"restore-here",title:"Take back every change since, as one change you can undo",onClick:()=>{A(null);try{e.undo([...$],{author:i,intent:u?`Restore to ${u}`:"Restore"}),t.show(null)}catch(a){A(a instanceof Error?a.message:String(a))}},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"})]})]}),q?(0,o.jsx)("span",{role:"alert","data-testid":"restore-refused",style:{color:"var(--graview-warn)"},children:q}):null]})}export{re as Timeline};
@@ -1 +0,0 @@
1
- import{c as b,d as J}from"./chunk.3VL5WECB.js";import{a as O,f as q}from"./chunk.WAFDCOOG.js";import{$a as L,B as m,Da as j,Ea as A,Oa as v,_a as D,ab as N,fc as Z,gc as k,ia as R,la as x,sa as S,ub as M,yb as P,zb as w}from"./chunk.6V2RG5JG.js";var E=n=>n.safeParse?.(void 0).success??!1,T=n=>b(n).shape,F=n=>{let s=b(n);if(m(s)?.type!=="literal")return;let e=m(s)?.values;return e&&e.length===1&&typeof e[0]=="string"?e[0]:void 0};function g(n,s){let e=E(s),o=b(s),r=m(o)?.type,l=M(s);if(l)return{control:"node",name:n,optional:e,kinds:l};let y=S(s);if(y)return{control:"linked",name:n,optional:e,relation:y};if(A(s)){let a=j(n);return{control:"repeat",name:n,optional:e,...a?{of:a}:{}}}if(r==="boolean")return{control:"boolean",name:n,optional:e};let p=R(o);if(p)return{control:"file",name:n,optional:e,...p==="image"?{image:!0}:{}};if(r==="object"){let a=o.shape??{};return{control:"group",name:n,optional:e,fields:Object.entries(a).map(([c,d])=>g(c,d))}}if(r==="union"){let a=m(o)?.options??[],c=a.map(t=>T(t));if(c.every(t=>t!==void 0)){let t=Object.keys(c[0]??{}).find(f=>c.every(u=>F(u?.[f])!==void 0));if(t)return{control:"variant",name:n,optional:e,tag:t,options:a.map((f,u)=>({value:F(c[u]?.[t])??"",fields:Object.entries(c[u]??{}).filter(([h])=>h!==t).map(([h,z])=>g(h,z))}))}}let d=a.map(t=>F(t));return d.every(t=>t!==void 0)?{control:"choice",name:n,optional:e,options:d}:{control:"opaque",name:n,optional:e}}if(r==="array"){let a=m(o)?.element;return a!==void 0?{control:"list",name:n,optional:e,item:g(n,a)}:{control:"opaque",name:n,optional:e}}let i=J(s);return i.type==="text"?{control:"text",name:n,optional:e,...i.long?{long:!0}:{},...x(o)?{app:!0}:{},...O(o)?{markdown:!0}:{},...i.holds?{holds:i.holds}:{}}:i.type==="number"&&i.duration?{control:"text",name:n,optional:e,holds:"duration"}:i.type==="date"?{control:"date",name:n,optional:e,...i.time?{time:!0}:{}}:i.type==="number"?{control:"number",name:n,optional:e,...i.min===void 0?{}:{min:i.min},...i.max===void 0?{}:{max:i.max},...i.step===void 0?{}:{step:i.step},...i.amount?{amount:i.amount}:{}}:i.type==="choice"?{control:"choice",name:n,optional:e,options:i.options}:{control:"opaque",name:n,optional:e}}function B(n){let s=n.shape;return s?Object.entries(s).map(([e,o])=>g(e,o)):[]}function K(n,s){let e={...s};for(let o of n){let r=s[o.name];r===void 0&&!o.optional&&(o.control==="list"||o.control==="boolean")&&(e[o.name]=o.control==="list"?[]:!1),o.control==="text"&&o.holds&&typeof r=="string"&&(e[o.name]=r.trim()===""?void 0:o.holds==="duration"?q(r)??r:r.trim()),o.control==="group"&&r!==void 0&&typeof r=="object"&&r!==null&&(e[o.name]=K(o.fields,r))}return e}function C(n,s,e){let o=n.derived?.act==="edit"&&n.subject?e[n.subject.arg]:void 0,r=typeof o=="string"?s.getNode(o):void 0;return r?Object.fromEntries((n.writes??[]).filter(l=>r[l]!==void 0&&r[l]!==null).map(l=>[l,r[l]])):{}}function I(n,s){return Object.fromEntries(Object.entries(n).filter(([e,o])=>!Object.hasOwn(s,e)||JSON.stringify(o)!==JSON.stringify(s[e])))}function _(n,s,e,o){let r=Z.keptFrom?.(n,s),l=new Set;if(!r)return l;let y=Object.keys(e.input.shape??{});for(let c of e.creates??[]){let d=r({id:"\0new",kind:c});for(let t of y)d?.(t)&&l.add(t)}let p=o===void 0?void 0:n.graph.getNode(o),i=p&&n.schema.tryDefinition(p.kind),a=p&&r(p);if(i&&a)for(let c of w(e,i))a(c)&&y.includes(c)&&l.add(c);return l}function dn(n,s,e,o){let r=new Set,l=s?.sees??[];if(L(e)||!l.some(k))return r;let y=D(e),p=(d,t)=>{let f=l.filter(u=>u.kinds.includes(d)&&N(u,y));return f.some(k)?v.has(t)||f.some(u=>!k(u)||(u.fields===void 0||u.fields.includes(t))&&!u.hide?.includes(t)):!0},i=Object.keys(o.input.shape??{}),a=new Map,c=(d,t)=>a.set(d,a.get(d)===!0||t);for(let d of o.creates??[]){let t=Object.keys(n.tryDefinition(d)?.fields.shape??{});for(let f of i)t.includes(f)&&c(f,p(d,f))}for(let d of P(n,o)){let t=n.tryDefinition(d);if(t)for(let f of w(o,t))i.includes(f)&&c(f,p(d,f))}for(let[d,t]of a)t||r.add(d);return r}export{B as a,K as b,C as c,I as d,_ as e,dn as f};
@@ -1 +0,0 @@
1
- import{i as a,j as o}from"./chunk.YV2LJFGS.js";import"./chunk.QNGWEV47.js";import"./chunk.ERXSYPYL.js";import"./chunk.J2ITFGN3.js";import"./chunk.QTA4ROAK.js";import"./chunk.2CIBWZJG.js";import"./chunk.RRVIXV7W.js";import"./chunk.7BWT5L2L.js";import"./chunk.VSZQXB4Q.js";import"./chunk.UWGWXFWZ.js";import"./chunk.SE5SKFQH.js";import"./chunk.W3S6UXNA.js";import"./chunk.WVUJXDXZ.js";import"./chunk.OZNW5W4Z.js";import"./chunk.NDADLJE6.js";import"./chunk.AK3IHFCF.js";import"./chunk.HHPGWJDO.js";import"./chunk.42YX6NOY.js";import"./chunk.EYZ7MHBZ.js";import"./chunk.KQT7WAQE.js";import"./chunk.PAVR5TK5.js";import"./chunk.OQDETV4X.js";import"./chunk.3VL5WECB.js";import"./chunk.JH6MU6TX.js";import"./chunk.WAFDCOOG.js";import"./chunk.L4DECHXR.js";import{ka as n}from"./chunk.GFF2FB2J.js";import"./chunk.6V2RG5JG.js";import"./chunk.AJZBJBMO.js";var w=new WeakMap;function s(e,i){let t=w.get(e);t||w.set(e,t=new Map);let r=t.get(i);return r||t.set(i,r=a(o(e,n(e)),e,i)),r}export{s as frameworkViews};
@@ -1,2 +0,0 @@
1
- import{a as Pe,b as $e}from"./chunk.OQ4KFN6W.js";import"./chunk.YNQDVGZM.js";import"./chunk.3R4W2P5X.js";import"./chunk.C5CYZNSJ.js";import"./chunk.JPHNKWTY.js";import"./chunk.XRJBLH4N.js";import{j as Ee,k as He}from"./chunk.3SKKIHU3.js";import"./chunk.HJCQ6I3S.js";import"./chunk.O2LK2AO7.js";import"./chunk.26CZTUY4.js";import"./chunk.3JNMSOFG.js";import"./chunk.PKK6FRZR.js";import"./chunk.OAF7TUMI.js";import"./chunk.J2ITFGN3.js";import"./chunk.6XMEU2Q2.js";import{a as ze,b as x}from"./chunk.QIAKO27D.js";import{b as Te,c as Me}from"./chunk.UT6642FC.js";import"./chunk.2CIBWZJG.js";import"./chunk.7BWT5L2L.js";import"./chunk.SE5SKFQH.js";import"./chunk.W3S6UXNA.js";import"./chunk.4SJUTBDV.js";import"./chunk.TI4OSTQV.js";import"./chunk.6T2Q6NLO.js";import"./chunk.OZNW5W4Z.js";import"./chunk.NDADLJE6.js";import"./chunk.AK3IHFCF.js";import"./chunk.HHPGWJDO.js";import"./chunk.42YX6NOY.js";import{u as Ce}from"./chunk.KQT7WAQE.js";import"./chunk.PAVR5TK5.js";import"./chunk.OQDETV4X.js";import{g as Ae}from"./chunk.3VL5WECB.js";import"./chunk.JH6MU6TX.js";import{c as Se}from"./chunk.WAFDCOOG.js";import{g as ke}from"./chunk.L4DECHXR.js";import{G as Ge,R as we,Z as W,i as ve,oa as Q,ta as be,v as ye,xa as xe}from"./chunk.GFF2FB2J.js";import{Ib as me,ca as K,da as L,dc as fe,jb as he}from"./chunk.6V2RG5JG.js";import{b as Y}from"./chunk.AJZBJBMO.js";var a=Y(Ge(),1);var n=Y(we(),1);function dt({placement:d="float",chosen:o=!0}={}){let{menuAt:r}=W();return d==="menu"&&r===null?o?(0,n.jsx)(Je,{}):null:(0,n.jsx)(Xe,{placement:d})}function Je(){let{store:d,setMenuAt:o,view:r}=W(),{selection:f}=Q(),h=(0,a.useRef)(null),[p,k]=(0,a.useState)(null);(0,a.useLayoutEffect)(()=>{let v=h.current?.offsetParent??h.current?.parentElement;if(!v)return;let w=Math.round(v.getBoundingClientRect().width);w!==p&&k(w)});let S=f.length===1&&!r.overview?d.graph.getNode(f[0]):void 0;return!S||p===null||p>=Re?(0,n.jsx)("span",{ref:h,hidden:!0}):(0,n.jsx)("button",{type:"button",ref:h,"data-testid":"chosen-acts","aria-label":`What can be done with ${x(d,S.id)}`,"aria-haspopup":"menu",onClick:v=>{let w=v.currentTarget.getBoundingClientRect();o({x:Math.round(w.right),y:Math.round(w.bottom+4),on:S.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 Re=564;function Xe({placement:d}){let{store:o,menuAt:r,setMenuAt:f,view:h}=W(),p=(0,a.useRef)(null),k=(0,a.useRef)(null),S=(0,a.useRef)(null),v=(0,a.useRef)(null);r?.returnTo&&(v.current=r.returnTo);let w=e=>{let i=e.closest("[data-graview-asking]")?.getAttribute("data-graview-asking"),t=e.getAttribute("data-pin-for"),g=i??e.getAttribute("data-affordance")??(t===null?null:`pin:${t}`)??e.getAttribute("data-menu-item");k.current=g===null?null:{key:g,element:e}};(0,a.useEffect)(()=>{let e=p.current,i=k.current;if(i===null||document.activeElement!==document.body||i.element.isConnected)return;let t=i.key;if(!e){k.current=null;let H=v.current;v.current=null,(H?.isConnected?H:S.current)?.focus();return}((t.startsWith("pin:")?e.querySelector(`[data-pin-for="${CSS.escape(t.slice(4))}"]`):null)??e.querySelector(`[data-affordance="${CSS.escape(t)}"]:not([disabled])`)??e).focus()});let[Le,We]=(0,a.useState)(null);(0,a.useLayoutEffect)(()=>{let e=p.current?.offsetParent??p.current?.parentElement;if(e instanceof HTMLElement&&(S.current=e),!e)return;let i=e.getBoundingClientRect();We(t=>t&&t.left===i.left&&t.top===i.top&&t.width===i.width&&t.height===i.height?t:{left:i.left,top:i.top,width:i.width,height:i.height})});let{selection:Ne,set:De,clear:Oe}=Q(),s=r?.about??Ne,[N,Fe]=(0,a.useState)(()=>Pe()),D=r?.on??s[s.length-1],O=r?.about,qe=(0,a.useMemo)(()=>({pins:N,...D===void 0?{}:{focus:D},...O?{about:O}:{}}),[N,D,O]),Be=(0,a.useMemo)(()=>new Set(o.allMutations().filter(e=>e.pinned).map(e=>e.name)),[o]),{affordances:c,withheld:m,observations:G}=Ee(qe),je=r===null?null:{face:r.face??"scene",on:r.on,about:s,field:r.field,place:r.place,href:r.href,element:r.returnTo},J=Ce(je),X=G.some(e=>e.id.startsWith("schema:waits:")),{apply:Ue,preview:_e}=He(),[C,z]=(0,a.useState)(null),[Ve,Z]=(0,a.useState)(!1),[ee,te]=(0,a.useState)(!1),[P,$]=(0,a.useState)(""),[ne,F]=(0,a.useState)(null),q=(0,a.useRef)([]),B=(e,i)=>{try{return _e(e,i),Ue(e,i),F(null),f(null),q.current=[],!0}catch(t){return F(Ae(o.schema,o.allMutations(),t)),q.current=t instanceof he?t.issues.map(g=>String(g.path[0]??"")).filter(Boolean):[],!1}},I=[...new Set(s.flatMap(e=>{let i=o.graph.getNode(e);return i?[i.kind]:[]}))],b=I.length>0?I:[...new Set(s.flatMap(e=>ye(e)))],u=s.length===1?ve(s[0]):null,j=u?{from:o.graph.getNode(u.from),to:o.graph.getNode(u.to)}:null,ie=u?Me(o,u):void 0,re=ie?.provisional?ie:void 0,ae=u?(()=>{let e=o.schema.tryDefinition(o.graph.getNode(u.from)?.kind??"")?.edges?.[u.kind],i=o.graph.getNode(u.to);return e?.inverse&&i?`From ${x(o,i.id)}: ${e.inverse}`:null})():null;(0,a.useEffect)(()=>{z(null),Z(!1),te(!1),F(null),$("")},[s,r?.about]);let l=r!==null,Ye=d==="menu"&&!l,A=(0,a.useRef)(r);A.current=r;let oe=xe("acts",{open:l&&d==="menu",onOpenChange:e=>{e||f(null)},at:()=>A.current?{x:A.current.x,y:A.current.y}:null,returnTo:()=>{let e=A.current?.returnTo;if(e?.isConnected)return e;let i=A.current?.on;return i?document.querySelector(`[data-graview-view="${CSS.escape(i)}"]`):null},align:"start"}),le=(Le?.width??Number.POSITIVE_INFINITY)<Re;if((0,a.useLayoutEffect)(()=>{let e=p.current?.offsetParent;if(!e||!le||l)return;let i=p.current?.getBoundingClientRect().height??0,t=`${Math.round(i)+20}px`;if(e.style.paddingBottom===t)return;let g=e.style.paddingBottom;return e.style.paddingBottom=t,()=>{e.style.paddingBottom=g}}),s.length===0&&!l)return null;let se=r?.title!==void 0||s.length>0&&!(s.length===1&&s[0]===h.focusId),de=Math.max(1,Math.min(9,c.length)),T=[...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)],ue=T.length>de&&!l,pe=P.trim().toLowerCase(),y=ue&&pe.length>0?T.filter(e=>`${e.label} ${e.why}`.toLowerCase().includes(pe)):null,U=y??(Ve||l?T:T.slice(0,de)),ce=y?0:T.length-U.length,R=[];for(let e of U){let i=!l&&e.provider==="invariant",t=!l&&!i&&e.pinned!==void 0&&!e.destructive,g=!l&&!i&&!t&&e.ties===!0&&!e.destructive,H=i?e.why:t?"pinned":g?"its ties":null,Qe=i?"violation":t||g?"ties":null,V=R[R.length-1];V&&V.heading===H?V.items.push(e):R.push({heading:H,tone:Qe,items:[e]})}let _=c.find(e=>e.id===C),E=s.length===1?x(o,s[0]):null,ge=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 t=i.trimStart();return t.length===0?e:t[0].toUpperCase()+t.slice(1)},Ke=new Set(l?[]:U.filter(e=>e.provider==="invariant").map(e=>e.why)),M=G.filter(e=>!Ke.has(e.text)).map(e=>({...e,text:ge(e.text)}));return Ye?null:(0,n.jsxs)("section",{...l?oe.pane:{},ref:e=>{p.current=e,l&&oe.pane.ref(e)},"aria-label":"Inspector","data-graview-offstage":"","data-testid":l?"context-menu":"inspector-strip",tabIndex:-1,onFocus:e=>w(e.target),onBlur:e=>{e.relatedTarget!==null&&(k.current=null)},onMouseDown:e=>e.stopPropagation(),style:{...l?be:{position:"absolute",zIndex:fe("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"}:le?{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,n.jsx)("h2",{style:{...ke,margin:0},children:"Inspector"}),(0,n.jsxs)("div",{style:{display:se||!l?"flex":"none",alignItems:"baseline",flexWrap:"wrap",gap:"2px 8px",minWidth:0,paddingRight:l?0:24},children:[se?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("strong",{style:{fontSize:"0.9375rem",whiteSpace:"nowrap"},children:r?.title??(s.length===1?x(o,s[0]):`${s.length} selected`)}),I.length>0||u?(0,n.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:u?"relation":I.map(e=>L(o.schema.tryDefinition(e),e)).join(" \xB7 ")}):null,s.length===1&&!u&&r?.face!=="pages"?(0,n.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,n.jsx)("span",{style:{flex:"1 1 auto"}})]}),l?null:(0,n.jsx)("button",{type:"button",onClick:()=>{f(null),Oe()},"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&&j?(0,n.jsxs)("div",{style:{display:"grid",gap:6},children:[ae?(0,n.jsx)("p",{"data-testid":"edge-said",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:ae}):null,re?(0,n.jsx)("p",{"data-testid":"edge-provisional",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:Te(re)}):null,(0,n.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[["from",j.from],["to",j.to]].map(([e,i],t)=>(0,n.jsxs)(a.Fragment,{children:[t===1?(0,n.jsx)("span",{"aria-hidden":"true",style:{color:"var(--graview-ink-faint)"},children:"\u2192"}):null,i?(0,n.jsx)("button",{type:"button","data-testid":`edge-${e}`,onClick:()=>De([i.id]),title:`Select ${x(o,i.id)}`,style:{fontSize:"0.8125rem",padding:"3px 9px",borderRadius:6},children:x(o,i.id)}):(0,n.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:"gone"})]},e))})]}):null,!u&&s.length===1&&me(o,s[0])?(0,n.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,M.length>0?(0,n.jsx)("div",{"data-testid":"observations",title:M.map(e=>e.text).join(`
2
- `),style:{display:"grid",gap:3},children:M.slice(0,2).map(e=>(0,n.jsxs)("p",{style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:[e.text,e===M[1]&&M.length>2?(0,n.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" +",M.length-2]}):null]},e.id))}):null,l?J.start.map(e=>(0,n.jsx)(Ie,{section:e,close:()=>f(null)},e.id)):null,ne?(0,n.jsx)("p",{"data-testid":"refused",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-warn)"},children:ne}):null,ue?(0,n.jsx)("input",{"data-testid":"action-filter",value:P,onChange:e=>$(e.target.value),placeholder:`Filter ${T.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"&&y?.length===1){let i=y[0];if(i.destructive)return;i.open.length>0?z(i.id):B(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,y!==null&&y.length===0?(0,n.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,c.length===0&&!X&&s.length===0?null:c.length===0&&!X?(0,n.jsx)("p",{"data-testid":"no-affordances",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:m.length>0?`Nothing you may do with ${u?"this relation":b.length===1?K(L(o.schema.tryDefinition(b[0]),b[0])):"this mix of kinds"} \u2014 ${m.length} action${m.length===1?"":"s"} withheld.`:u?`Nothing can be done with this line yet \u2014 nothing this app declares makes or breaks \u201C${Se(o.schema,o.graph.getNode(u.from)?.kind??"",u.kind,"out")}\u201D.`:`Nothing can be done with ${b.length===1?K(L(o.schema.tryDefinition(b[0]),b[0])):"this mix of kinds"} yet \u2014 nothing this app declares acts on ${b.length===1?"it":"them"}.`}):(0,n.jsxs)("ol",{"data-testid":"affordances",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[R.map((e,i)=>(0,n.jsxs)(a.Fragment,{children:[e.heading?(0,n.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"?ge(e.heading):e.heading]}):i>0?(0,n.jsx)("li",{"aria-hidden":"true",style:{borderTop:"1px solid var(--graview-edge)",margin:"6px 0 3px"}}):null,e.items.map(t=>(0,n.jsxs)("li",{style:{display:"flex",gap:2,alignItems:"stretch"},children:[(0,n.jsxs)("button",{type:"button","data-affordance":t.id,"data-rank":t.rank,"data-graview-destructive":t.destructive||void 0,"aria-pressed":C===t.id,title:t.why,style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:C===t.id?"var(--graview-accent)":l?"transparent":"var(--graview-edge)",background:l?"none":"var(--graview-panel)",boxShadow:"none",...t.destructive?{color:"var(--graview-warn)"}:{},...C===t.id?{color:"var(--graview-accent)"}:{}},onClick:()=>{if(t.open.length>0){z(C===t.id?null:t.id);return}B(t)},children:[t.label,t.open.length>0?(0,n.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:" \u2026"}):null,y?.length===1&&y[0]?.id===t.id&&!t.destructive?(0,n.jsx)("span",{"aria-hidden":"true",title:"Enter runs it",style:{float:"right",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:"\u21B5"}):null]}),(0,n.jsx)("button",{type:"button","data-testid":"pin-toggle","data-pin-for":t.mutation,"aria-pressed":t.pinned!==void 0,"aria-label":t.pinned!==void 0?`Unpin ${t.label}`:`Pin ${t.label}`,title:t.pinned==="declared"?"Pinned by the app \u2014 unpin it for yourself":t.pinned==="user"?"Unpin":"Pin to the top",onClick:()=>Fe($e(N,t.mutation,Be.has(t.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:t.pinned==="user"?"var(--graview-accent)":t.pinned==="declared"?"var(--graview-ink-muted)":"var(--graview-ink-faint)"},children:t.pinned!==void 0?"\u2605":"\u2606"})]},t.id))]},`${e.heading??"plain"}-${i}`)),ce>0?(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button",onClick:()=>Z(!0),title:`Show all ${c.length} actions`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",ce," more"]})}):null]}),m.length>0?(0,n.jsxs)("ul",{"data-testid":"withheld",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[m.slice(0,l||ee?m.length:3).map(e=>(0,n.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,n.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,n.jsx)("s",{children:e.label})}),(0,n.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&&!ee&&m.length>3?(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button","data-testid":"withheld-more",onClick:()=>te(!0),title:`Show all ${m.length} actions this seat may not take`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",m.length-3," more withheld"]})}):null]}):null,l?J.end.map(e=>(0,n.jsx)(Ie,{section:e,close:()=>f(null)},e.id)):null,_?(0,n.jsx)(ze,{affordance:_,onApply:e=>{if(B(_,e))z(null);else return q.current},onCancel:()=>z(null)}):null]})}function Ie({section:d,close:o}){return(0,n.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,n.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,n.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:2},children:d.items.map(r=>(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button","data-menu-item":r.id,onClick:()=>{o(),r.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:[r.label,r.hint?(0,n.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",r.hint]}):null]})},r.id))}):null,d.render?.(o)]})}export{dt as InspectorPane};
@@ -1 +0,0 @@
1
- import{h as x}from"./chunk.L4DECHXR.js";import{G as k,R as p}from"./chunk.GFF2FB2J.js";import{Nc as m}from"./chunk.6V2RG5JG.js";import{b as n}from"./chunk.AJZBJBMO.js";var S=n(p(),1),v=x.part(e=>(0,S.jsx)(e.ActivityRail,{calls:[]}),{quiet:!0});var a=n(k(),1),o=n(p(),1);function Ar({context:e,stop:r,title:t,label:i,style:l,className:s,children:g,...d}){let c=m(e.views?.arrangement?.()),y=g??(0,o.jsxs)(o.Fragment,{children:["In ",c==="Scene"?"the scene":c.replace(/^The /,"the ")," ",(0,o.jsx)("span",{"aria-hidden":"true",children:"\u2197"})]}),f=i?{"aria-label":i}:{};if(e.overview){let h=e.overview;return(0,o.jsx)("a",{href:r,...d,...f,...t?{title:t}:{},style:l,...s?{className:s}:{},onClick:u=>{u.preventDefault(),h(r)},children:y})}return e.embedded?null:(0,o.jsx)("a",{href:`${e.sceneHref??"/"}${r}`,...d,...f,...t?{title:t}:{},style:l,...s?{className:s}:{},children:y})}function Lr(){return(0,o.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:e=>{e.preventDefault();let r=new URL(window.location.href);r.searchParams.set("fresh","1"),window.location.assign(r.toString())},style:{color:"inherit",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24},children:"Start fresh"})}function Pr(e){let r=(0,a.useRef)(0),t=(0,a.useCallback)(i=>e.subscribe(()=>{r.current+=1,i()}),[e]);return(0,a.useSyncExternalStore)(t,()=>r.current,()=>0)}export{v as a,Ar as b,Lr as c,Pr as d};
@@ -1 +0,0 @@
1
- import{a as T}from"./chunk.GLBHQFJ2.js";import{a as N,b as $}from"./chunk.6XMEU2Q2.js";import{b as f}from"./chunk.QIAKO27D.js";import{a as M}from"./chunk.UT6642FC.js";import{d as O}from"./chunk.2CIBWZJG.js";import{h as k}from"./chunk.3VL5WECB.js";import{g as E}from"./chunk.L4DECHXR.js";import{G,O as C,P as W,R as q,Z as v,fa as j,ta as B,xa as D}from"./chunk.GFF2FB2J.js";import{Ka as R,W as H,Y as z,eb as S}from"./chunk.6V2RG5JG.js";import{b as L}from"./chunk.AJZBJBMO.js";var m=L(G(),1);var e=L(q(),1),U=(a,n)=>({intent:n.intent,author:n.author.kind,...n.author.id?{authorId:n.author.id}:{},by:n.author,...n.ops[0]?.via?{via:n.ops[0].via}:{},...n.lineage?{basis:M(n.lineage)}:{},touched:[...new Set(n.ops.filter(i=>!S(i)).flatMap(i=>i.writes))],...V(a,n.ops.filter(i=>!S(i))),batch:n.id,seq:n.ops.at(-1).seq+1,...n.ops.every(S)?{withheld:!0}:{}});function P(a=4){let{store:n,principal:i}=v(),r=W(n,i),d=r.log.length;return(0,m.useMemo)(()=>N(r.batches(),l=>r.log.get(l)).reverse().slice(0,a).map(l=>{if("batch"in l)return U(r,l.batch);let o=[...l.digest.batches].reverse().map(g=>U(r,g));return{intent:$(l.digest,new Date().toISOString().slice(0,10)),author:l.digest.author.kind,...l.digest.author.id?{authorId:l.digest.author.id}:{},by:l.digest.author,touched:[...new Set(o.flatMap(g=>g.touched))],batch:"",seq:o[0]?.seq??0,digest:o}}),[r,d,a])}function V(a,n){let i={};for(let r of n)for(let d of r.primitives)d.op==="remove-node"&&d.node&&(i[d.node.id]=H(a.schema.tryDefinition(d.node.kind),d.node));return Object.keys(i).length>0?{removed:i}:{}}function Y({change:a}){let{store:n,principal:i,seats:r,people:d}=v();return(0,e.jsxs)("strong",{style:{fontWeight:600},children:[a.author==="human"&&a.by?.onBehalfOf===void 0&&(a.authorId===void 0||i.id===void 0||a.authorId===i.id)?"you":R(a.by??{kind:a.author,id:a.authorId},{graph:n.graph,schema:n.schema,seats:r,people:d}),k(a.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",k(a.via)]}):null]})}function _({change:a,goes:n}){let{store:i}=v(),[r,d]=(0,m.useState)(!1),l=a.digest??[];return(0,e.jsxs)("li",{"data-testid":"activity-digest",style:{display:"grid",gap:5,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)(Y,{change:a})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:a.intent})]}),(0,e.jsx)("button",{type:"button","data-testid":"digest-toggle","aria-expanded":r,onClick:()=>d(o=>!o),style:{marginLeft:"auto",flex:"0 0 auto",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"},children:r?"Hide":"Show each"})]}),r?(0,e.jsx)("ol",{"data-testid":"digest-changes",style:{margin:0,padding:"0 0 0 10px",listStyle:"none",display:"grid",gap:6,borderLeft:"1px solid var(--graview-edge)"},children:l.map(o=>(0,e.jsxs)("li",{"data-testid":"digest-change",style:{display:"grid",gap:3},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:o.intent}),o.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",o.basis]}):null]}),o.withheld?null:(0,e.jsx)(F,{batch:o.batch})]}),o.touched.length>0?(0,e.jsx)("div",{"data-touched":o.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:o.touched.slice(0,4).map(g=>(0,e.jsx)(A,{id:g,label:i.graph.has(g)?f(i,g):o.removed?.[g]??f(i,g),go:n(g)},g))}):null]},o.batch))}):null]})}function F({batch:a}){let{store:n,principal:i,noteSeat:r}=v(),d=W(n,i),l=C()?.open??!1,o=d.log.length,[g,p]=(0,m.useState)(null),u=(0,m.useMemo)(()=>d.canUndo(a),[d,a,o]);if(l||!u.ok&&u.ops.length===0)return null;let h=!u.ok,w=h?u.includeBatches:[];return(0,e.jsxs)("span",{style:{marginLeft:"auto",flex:"0 0 auto",display:"grid",justifyItems:"end",gap:2},children:[(0,e.jsx)("button",{type:"button","data-testid":"undo-turn",title:h?`${u.message} \u2014 undo those too`:"Take this back, keeping everything since",onClick:()=>{p(null);try{let y=d.log.all().find(b=>b.batch===a&&b.author.kind==="agent");d.undo(h?[a,...w]:a,{author:i}),y&&r({type:"home",author:y.author})}catch(y){p(y instanceof Error?y.message:String(y))}},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem",...h?{borderColor:"var(--graview-warn)",color:"var(--graview-warn)"}:{}},children:h?`undo +${w.length}`:"undo"}),g?(0,e.jsx)("span",{"data-testid":"undo-refused",role:"alert",style:{fontSize:"0.75rem",lineHeight:1.4,color:"var(--graview-warn)",maxWidth:260,textAlign:"right"},children:g}):null]})}function J({seq:a,intent:n}){let i=C();if(!i)return null;let r=i.past?.seq===a;return(0,e.jsx)("button",{type:"button","data-testid":"show-past","aria-label":`Show the app as it was after \u201C${n}\u201D`,title:"Show the app as it was here","aria-pressed":r,onPointerEnter:T,onFocus:T,onClick:()=>i.show(a),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minHeight:24,minWidth:24,padding:"1px 6px",fontSize:"0.75rem",flex:"0 0 auto"},children:(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[(0,e.jsx)("path",{d:"M2.5 8 a5.5 5.5 0 1 0 1.6-3.9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,e.jsx)("path",{d:"M2 2.5 V5.5 H5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,e.jsx)("path",{d:"M8 5 V8 L10 9.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})}function K(){let a=()=>{let n=new URL(window.location.href);return n.searchParams.set("fresh","1"),n.toString()};return(0,e.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:n=>{n.preventDefault(),window.location.assign(a())},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,fontSize:"0.8125rem",color:"var(--graview-ink-muted)",textDecoration:"underline",textDecorationColor:"var(--graview-edge-bright)",textUnderlineOffset:3},children:"Start fresh"})}function A({id:a,label:n,go:i}){return i?(0,e.jsx)("button",{type:"button","data-testid":"activity-record","data-record":a,title:`Go to ${n}`,onClick:()=>i(a),style:{all:"unset",display:"inline-flex",cursor:"pointer",borderRadius:7},className:"graview-activity-record",children:(0,e.jsx)(O,{label:n})}):(0,e.jsx)(O,{label:n})}function re({calls:a,seat:n,remembers:i=!1}){let r=P(),{store:d,principal:l,seats:o,people:g}=v(),p=W(d,l),u=a.some(t=>t.phase==="running"),h=D("activity"),w=h.open,y=j(),b=C(),x=t=>p.graph.has(t)?c=>{h.setOpen(!1),b?.past&&b.show(null),y.record(c)}:null;return n===void 0&&a.length===0&&r.length===0&&!i?null:(0,e.jsxs)("div",{style:{position:"relative"},children:[(0,e.jsxs)("button",{type:"button","data-testid":"activity-button",...h.trigger,onClick:h.toggle,title:u?"An agent is working":"What has happened",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:30,padding:"0 8px",borderRadius:8,border:"1px solid transparent",background:"transparent",boxShadow:"none",fontSize:"0.875rem",whiteSpace:"nowrap",color:u?"var(--graview-accent)":"var(--graview-ink-muted)"},children:[u?(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,background:"var(--graview-accent)"}}):null,r.length>0?r.length:"",(0,e.jsxs)("svg",{className:"graview-activity-mark",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",style:{display:"var(--graview-activity-mark, none)"},children:[(0,e.jsx)("circle",{cx:"8",cy:"8",r:"5.75",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),(0,e.jsx)("path",{d:"M8 4.75 V8 L10.25 9.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,e.jsx)("span",{className:"graview-activity-word",children:" Activity"})]}),!w&&n!==void 0?(0,e.jsx)("div",{hidden:!0,"data-testid":"agent-seat-seated",children:n}):null,w?(0,e.jsxs)("section",{...h.pane,"aria-label":"Activity","data-testid":"activity","data-graview-offstage":"",style:{...B,width:300,maxHeight:"min(52cqh, 460px)",overflow:"auto",display:"flex",flexDirection:"column",gap:9,padding:12,borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[(0,e.jsx)("h2",{style:{...E,margin:0},children:"Activity"}),n!==void 0?(0,e.jsxs)("div",{"data-testid":"agent-seat-row",style:{display:"grid",gap:5,paddingBottom:a.length>0||r.length>0?9:0,...a.length>0||r.length>0?{borderBottom:"1px solid var(--graview-edge)"}:{}},children:[(0,e.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"The agent's seat"}),n]}):null,a.length>0?(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:7},children:a.slice(0,6).map((t,c)=>(0,e.jsxs)("li",{style:{display:"grid",gap:2,fontSize:"0.8125rem",lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,flex:"0 0 auto",background:t.phase==="running"?"var(--graview-accent)":t.phase==="failed"?"var(--graview-warn)":"var(--graview-edge-bright)"}}),(0,e.jsxs)("span",{style:{color:"var(--graview-ink)"},children:[t.mutating?"changed":"read"," \xB7"," ",p.allMutations().find(s=>s.name===t.name)?.title??z(t.name)]})]}),!t.mutating&&t.reads&&t.reads.length>0?(0,e.jsxs)("div",{"data-testid":"activity-reads",style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:[[...new Set(t.reads)].slice(0,3).map(s=>(0,e.jsx)(A,{id:s,label:f(p,s),go:x(s)},s)),new Set(t.reads).size>3?(0,e.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["+",new Set(t.reads).size-3]}):null]}):Object.values(t.args).some(s=>typeof s=="string")?(0,e.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:Object.entries(t.args).filter(s=>typeof s[1]=="string").slice(0,3).map(([s,I])=>(0,e.jsx)(A,{id:I,label:f(p,I),go:x(I)},s))}):null,t.error?(0,e.jsx)("div",{style:{paddingLeft:12,color:"var(--graview-warn)"},children:t.error}):null]},`${t.at}:${c}`))}):null,r.length>0?(0,e.jsx)("ol",{"data-testid":"diff-log",style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6,fontSize:"0.8125rem"},children:r.map((t,c)=>t.digest?(0,e.jsx)(_,{change:t,goes:x},`digest:${t.digest[0]?.batch??c}`):t.withheld?(0,e.jsx)("li",{"data-testid":"withheld-change",style:{display:"grid",gap:3,lineHeight:1.45},children:(0,e.jsx)("span",{"data-touched":"",style:{color:"var(--graview-ink-muted)",fontStyle:"italic"},children:t.intent})},`change:${c}`):(0,e.jsxs)("li",{style:{display:"grid",gap:3,lineHeight:1.45},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,e.jsxs)("span",{style:{minWidth:0},children:[(0,e.jsxs)("strong",{style:{fontWeight:600},children:[t.author==="human"&&t.by?.onBehalfOf===void 0&&(t.authorId===void 0||l.id===void 0||t.authorId===l.id)?"you":R(t.by??{kind:t.author,id:t.authorId},{graph:p.graph,schema:p.schema,seats:o,people:g}),k(t.via)?(0,e.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",k(t.via)]}):null]})," ",(0,e.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:t.intent}),t.basis?(0,e.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",t.basis]}):null]}),t.batch?(0,e.jsx)(J,{seq:t.seq,intent:t.intent}):null,t.batch?(0,e.jsx)(F,{batch:t.batch}):null]}),(0,e.jsx)("div",{"data-touched":t.touched.join(" "),style:{display:"flex",flexWrap:"wrap",gap:4},children:t.touched.slice(0,4).map(s=>(0,e.jsx)(A,{id:s,label:p.graph.has(s)?f(p,s):t.removed?.[s]??f(p,s),go:x(s)},s))})]},`change:${c}`))}):null,i?(0,e.jsxs)("div",{"data-testid":"remembered",style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:10,paddingTop:8,borderTop:"1px solid var(--graview-edge)",fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:[(0,e.jsx)("span",{children:"Remembered in this browser"}),(0,e.jsx)(K,{})]}):null]}):null]})}export{re as a};
@@ -1 +0,0 @@
1
- import{e as H}from"./chunk.OQDETV4X.js";import{e as O}from"./chunk.3VL5WECB.js";import{$ as j,G as b,R as E,Z as g,_ as V,d as _,na as $,y as B}from"./chunk.GFF2FB2J.js";import{$b as W,B as T,_b as N,fc as K,vb as F,zb as D}from"./chunk.6V2RG5JG.js";import{b as m}from"./chunk.AJZBJBMO.js";function L(n,e){let t=n.graph.getNode(e);if(!t)return[];let o=t.kind,a=n.schema.tryDefinition(o);if(!a)return[];let s=n.seenFor,c=s?K.keptFrom?.(n,s)?.(t):void 0,i=new Map;for(let r of n.allMutations()){let d=r.subject;if(!d||!(d.kinds==="*"||d.kinds.includes(o)))continue;let l=r.input.shape??{};for(let u of D(r,a)){if(c?.(u))continue;let w=u in l,M=[];for(let y of Object.keys(l)){if(y===d.arg||y===u||Y(l[y]))continue;let v=F(r.input).find(S=>S.name===y);M.push({name:y,...v?{kinds:v.kinds}:{},...v?{candidates:v.kinds.includes("*")?n.graph.allNodes().map(S=>S.id):v.kinds.flatMap(S=>n.graph.nodesOfKind(S).map(X=>X.id))}:{},shape:O(r.input,y)})}let J={field:u,mutation:r.name,title:r.title??r.name,shape:w?O(r.input,u):{type:"unknown"},takesValue:w,alternatives:[],open:M,call:y=>({name:r.name,args:w?{[d.arg]:e,[u]:y}:{[d.arg]:e}})};i.set(u,[...i.get(u)??[],J])}}return[...i.values()].map(r=>{let d=[...r.filter(u=>u.takesValue),...r.filter(u=>!u.takesValue)],[f,...l]=d;return{...f,alternatives:l}})}function Y(n){let e=T(n)?.type;return e==="optional"||e==="default"||e==="nullable"}var R=m(b(),1);function he(n){let{store:e,principal:t}=g(),o=j(),a=(0,R.useMemo)(()=>n===null?[]:L(e,n),[e,n,o]),s=(0,R.useCallback)((c,i,r={})=>{let d=c.call(i);e.apply({name:d.name,args:{...d.args,...r}},{author:t})},[e,t]);return{fields:a,commit:s}}var z=m(b(),1);function Se(){let{brand:n}=g(),e=n?.kit;return(0,z.useMemo)(()=>N(e),[e])}function ke(n,e){let t=W(n,e),o={...t.color!==void 0?{color:t.color}:{},...t.pattern!==void 0?{pattern:t.pattern}:{},...t.width!==void 0?{width:t.width}:{},...t.cap!==void 0?{cap:t.cap}:{},...t.opacity!==void 0?{opacity:t.opacity}:{}};return{connector:t,style:H(e,{[e]:o})}}var I=m(b(),1);var h=m(E(),1);function Z(n){let e=n?.hint;return typeof e=="string"&&e.length>0?e:void 0}function ee(n){if(n instanceof Error&&n.message)return n.message;let e=String(n);return e==="[object Object]"?"The view threw without a message.":e}var G=class extends I.Component{static contextType=$;state={};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`[graview] the ${this.props.view??"view"} of ${this.props.kind} threw while rendering`,e,t.componentStack),this.context?.(e,{module:"@graview/react"})}render(){let{error:e}=this.state;if(!e)return this.props.children;let t=Z(e);return(0,h.jsxs)("div",{role:"alert","data-graview-view-error":this.props.kind,style:{display:"flex",flexDirection:"column",gap:"0.375rem",padding:"var(--graview-pad, 12px)",height:"100%",overflow:"auto",boxSizing:"border-box",borderRadius:"var(--graview-radius-sm, 6px)",background:"var(--graview-panel-warning, #fdf3ec)",color:"var(--graview-ink, #1a1a1a)",font:"var(--graview-font-body, 13px/1.45 system-ui)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,h.jsx)("strong",{style:{color:"var(--graview-warn, #b4462a)"},children:this.props.view?`${this.props.view} could not draw`:"This view could not draw"}),(0,h.jsx)("span",{style:{color:"var(--graview-ink-muted, #555)"},children:this.props.kind}),(0,h.jsx)("span",{children:ee(e)}),t?(0,h.jsx)("span",{style:{color:"var(--graview-ink-muted, #555)"},children:t}):null]})}};var x=m(b(),1);var U=m(E(),1),A=(0,x.createContext)([]);function Oe({sections:n,children:e}){let t=(0,x.useContext)(A),o=(0,x.useMemo)(()=>[...t,...n.filter(a=>!t.includes(a))],[t,n]);return(0,U.jsx)(A.Provider,{value:o,children:e})}function Ae(n){let e=(0,x.useContext)(A),t=V()?.menuSections,o=t?[...e,...t.filter(s=>!e.includes(s))]:e;if(n===null||o.length===0)return{start:[],end:[]};let a=o.flatMap(s=>{try{let c=s(n);return c&&((c.items?.length??0)>0||c.render)?[c]:[]}catch{return[]}});return{start:a.filter(s=>s.at==="start"),end:a.filter(s=>s.at!=="start")}}var q=m(b(),1);function Fe(){return g().activity}function De(n){let{noteAttention:e,noteSeat:t}=g();(0,q.useEffect)(()=>n.onCall(o=>{let a=n.author??{kind:"agent"},s=o.args?.said;o.phase==="ok"&&typeof s=="string"&&s.length>0&&t({type:"said",author:a,say:s}),!(o.phase!=="ok"||!o.reads||o.reads.length===0)&&e({reads:o.reads,author:a,intent:`read ${o.name}`})}),[n,e,t])}var C=(n,e)=>n.length*e*.58;var ne=156,te=2,k=ne-18,re=7.1,oe=16;function ie(n,e){let t=0,o=k;for(let a of n.split(" ")){let s=e(a),c=o+e(" ")+s;if(c<=k)o=c;else{let i=Math.ceil(s/k)||1;t+=i,o=s-(i-1)*k}}return t}var ae=16.25,Q=27,se=(n,e)=>{let t=Math.ceil(n.length*re/k);return e?Math.max(Q,Math.ceil(Math.max(t,ie(n,e))*ae)+6):Math.max(Q,t*oe+6)};function Ke(n,e,t){return n.length===0?0:10+n.reduce((o,a)=>o+se(a,t),0)+(n.length-1)*te}var de=27,ce=8,_e=4,ue=64,Be=n=>Math.max(1,Math.min(ce,n)),Ve=n=>n*de+ue;var p=m(b(),1);function Le(n,{units:e,target:t=0,legibleAt:o=260}){let[a,s]=(0,p.useState)(e);(0,p.useEffect)(()=>{let i=n.current;if(i===null||typeof ResizeObserver>"u")return;let r=new ResizeObserver(([d])=>{let f=d?.contentRect.width??0;f>0&&s(f)});return r.observe(i),()=>r.disconnect()},[n]);let c=a/e;return{scale:c,width:a,touchable:c*t>=24,legible:a>=o}}function ze(n="--graview-font-body",e="sans-serif"){let t=(0,p.useRef)(void 0),o=(0,p.useMemo)(()=>{if(typeof getComputedStyle!="function"||typeof document>"u")return e;let a=getComputedStyle(document.documentElement).getPropertyValue(n).trim();return a.length>0?a:e},[n,e]);return(0,p.useMemo)(()=>{t.current===void 0&&(t.current=typeof document>"u"?null:document.createElement("canvas").getContext("2d")??null);let a=t.current;return a===null?C:(s,c)=>{a.font=`${c}px ${o}`;let i=a.measureText(s).width;return i>0?i:C(s,c)}},[o])}var Ge=(0,p.createContext)(void 0);var P=3;function le(n){let e=_(n),t=e.focusId;if(!t)return null;if(e.within?.view){let[a]=B(t);if(a)return{at:`screen:${a}`,audience:!0}}return{at:t,audience:!1}}function qe(n,e,t){let o=[],a=new Map,s=new Map,c=0;for(let i of n){let r=le(i.stop),d=r?e(r.at):null;if(!r||!d){i.name&&o.push({kind:"edge",presence:i,point:{x:t-8,y:40+c++*28}});continue}if(!i.name){let M=s.get(r.at);s.set(r.at,{n:(M?.n??0)+1,box:d});continue}let f=a.get(r.at)??[];if(f.push(i),a.set(r.at,f),f.length>P)continue;let l=d,u=f.length-1,w=r.audience?{x:l.x+l.width*.5+(u-1)*26,y:l.y+Math.min(l.height,24)}:{x:l.x+l.width*.5-26-u*22,y:l.y+l.height-4};o.push({kind:"person",presence:i,point:w,at:r.at,index:u,of:f.length,audience:r.audience})}for(let[i,r]of a){if(r.length<=P)continue;let d=e(i);d&&o.push({kind:"count",at:i,point:{x:d.x+d.width*.5+2*26+18,y:d.y+d.height-4},n:r.length-P})}for(let[i,{n:r,box:d}]of s)o.push({kind:"count",at:i,point:{x:d.x+d.width*.5+40,y:d.y+d.height-4},n:r});for(let i of n)if(i.name){if(i.robot?.at&&i.robot.mode!=="docked"){let r=e(i.robot.at);r&&o.push({kind:"robot",presence:i,point:{x:r.x+r.width/2+22,y:r.y+r.height-4},mode:i.robot.mode})}if(i.over){let r=e(i.over);r&&o.push({kind:"over",presence:i,box:r})}}return o}export{Fe as a,De as b,C as c,ne as d,te as e,Q as f,Ke as g,de as h,_e as i,ue as j,Be as k,Ve as l,Le as m,ze as n,he as o,Se as p,ke as q,qe as r,G as s,Oe as t,Ae as u};