@popmelt.com/core 0.36.0 → 0.37.1

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 (222) hide show
  1. package/README.md +106 -23
  2. package/claude-plugin/.claude-plugin/plugin.json +1 -1
  3. package/claude-plugin/skills/popmelt-core/SKILL.md +6 -1
  4. package/codex-plugin/.codex-plugin/plugin.json +1 -1
  5. package/codex-plugin/skills/popmelt-core/SKILL.md +6 -1
  6. package/dist/ExploreAttachment-6AIMXC2K.mjs +1 -0
  7. package/dist/PagePreviewLayer-SIH7DDBF.mjs +1 -0
  8. package/dist/ParticipantRuntime-RTMEFDKF.mjs +1 -0
  9. package/dist/PhoneHostGate-RZRGWS2E.mjs +1 -0
  10. package/dist/PopmeltTasteConnectedPane-FAJXJEQQ.mjs +1 -0
  11. package/dist/PreviewRuntime-MW33PLMV.mjs +1 -0
  12. package/dist/{QueuedReplies-ESIFFRKS.mjs → QueuedReplies-4APDDNQX.mjs} +1 -1
  13. package/dist/SamplePlacementOverlay-2VLBRDPZ.mjs +1 -0
  14. package/dist/ShareProjectPane-OR2LS2A3.mjs +1 -0
  15. package/dist/SuppliedContext-SAQKEDWW.mjs +1 -0
  16. package/dist/ThreadErrorCard-OSHIWSHR.mjs +1 -0
  17. package/dist/ThreadPanel-CMC5Q6WM.mjs +1 -0
  18. package/dist/adapter-react-three-fiber.d.mts +20 -3
  19. package/dist/adapter-react-three-fiber.mjs +1 -1
  20. package/dist/adapter-three.d.mts +53 -2
  21. package/dist/adapter-three.mjs +45 -1
  22. package/dist/bridge-entry.mjs +1 -1
  23. package/dist/bridgeSSEStream-6OMAFDFW.mjs +1 -0
  24. package/dist/bridgeWebSocketStream-WIOGOPJW.mjs +1 -0
  25. package/dist/browser-runtime-5W2ZKUCZ.mjs +1 -0
  26. package/dist/browser.d.mts +4 -4
  27. package/dist/browser.mjs +1 -1
  28. package/dist/canvas-chat-note-O3USBECW.mjs +1 -0
  29. package/dist/checkFixture-DQPLFEUL.mjs +1 -0
  30. package/dist/{chunk-AH6LZOQC.mjs → chunk-3PSB5BST.mjs} +1 -1
  31. package/dist/chunk-3QYA5LGF.mjs +1 -0
  32. package/dist/chunk-3VOEPWRL.mjs +1 -0
  33. package/dist/chunk-4LVGVKSS.mjs +1 -0
  34. package/dist/chunk-5GEBVPTA.mjs +1 -0
  35. package/dist/chunk-5IZHN3A7.mjs +1 -0
  36. package/dist/chunk-6EO73WJN.mjs +1 -0
  37. package/dist/chunk-6XEEXK3U.mjs +1 -0
  38. package/dist/chunk-76WRZ2NH.mjs +1 -0
  39. package/dist/chunk-7EISKUU7.mjs +1 -0
  40. package/dist/chunk-7JWADHTH.mjs +1 -0
  41. package/dist/chunk-A4GARXVQ.mjs +1 -0
  42. package/dist/chunk-AAMUU2QA.mjs +1 -0
  43. package/dist/chunk-AGCS65LT.mjs +1 -0
  44. package/dist/{chunk-RR4SHK7O.mjs → chunk-AOTDTBQO.mjs} +1 -1
  45. package/dist/chunk-ATLUO4G7.mjs +1 -0
  46. package/dist/chunk-AYZUOBFI.mjs +1 -0
  47. package/dist/chunk-B22WBEQC.mjs +1 -0
  48. package/dist/chunk-B4DYUYX4.mjs +1 -0
  49. package/dist/{chunk-NDGM4DAP.mjs → chunk-BYASSHKJ.mjs} +1 -1
  50. package/dist/chunk-C2ZSNUXQ.mjs +1 -0
  51. package/dist/chunk-CCFTIBCJ.mjs +1 -0
  52. package/dist/chunk-CIKFUS7J.mjs +1 -0
  53. package/dist/chunk-CK3CDA3L.mjs +1 -0
  54. package/dist/chunk-CVVD2OMQ.mjs +1 -0
  55. package/dist/chunk-EBJ23A7F.mjs +1 -0
  56. package/dist/chunk-ECMLCGAM.mjs +1 -0
  57. package/dist/chunk-EFGQKWSZ.mjs +1 -0
  58. package/dist/chunk-EILBHZDX.mjs +1 -0
  59. package/dist/{chunk-DOCRI237.mjs → chunk-ELKVFX2O.mjs} +1 -1
  60. package/dist/{chunk-EXIUW3JX.mjs → chunk-EUFR7R5Q.mjs} +1 -1
  61. package/dist/chunk-EZVFCJEG.mjs +1 -0
  62. package/dist/chunk-F3VZQGPM.mjs +1 -0
  63. package/dist/chunk-FHCKFQBY.mjs +1 -0
  64. package/dist/chunk-FJWWBKCQ.mjs +1 -0
  65. package/dist/chunk-FON4QY7P.mjs +1 -0
  66. package/dist/chunk-GAUQZAW6.mjs +1 -0
  67. package/dist/chunk-GLF7Z5IR.mjs +1 -0
  68. package/dist/chunk-HAN6CUNB.mjs +1 -0
  69. package/dist/chunk-HAZXZ5TU.mjs +1 -0
  70. package/dist/chunk-HBFSPXIC.mjs +1 -0
  71. package/dist/chunk-HKHZBKAN.mjs +1 -0
  72. package/dist/chunk-HPU2UMVE.mjs +1 -0
  73. package/dist/{chunk-YHYFWNN6.mjs → chunk-IAXSC2ZN.mjs} +1 -1
  74. package/dist/chunk-IW7V7WNL.mjs +1 -0
  75. package/dist/chunk-JEGBAHYK.mjs +1 -0
  76. package/dist/chunk-JJK4LAN6.mjs +1 -0
  77. package/dist/chunk-JSNK6NX7.mjs +1 -0
  78. package/dist/chunk-KCDHP4N3.mjs +1 -0
  79. package/dist/chunk-KF73S7MG.mjs +1 -0
  80. package/dist/chunk-KXVXWEN4.mjs +1 -0
  81. package/dist/chunk-L6S66APQ.mjs +1 -0
  82. package/dist/chunk-LH7HKUCK.mjs +1 -0
  83. package/dist/chunk-LOUWY55X.mjs +1 -0
  84. package/dist/chunk-MPEVFQ43.mjs +1 -0
  85. package/dist/{chunk-57FM7XQV.mjs → chunk-NI77Y3WC.mjs} +1 -1
  86. package/dist/chunk-O2ZQFLNV.mjs +1 -0
  87. package/dist/chunk-OA63PYHZ.mjs +1 -0
  88. package/dist/chunk-OIKFQ2FV.mjs +1 -0
  89. package/dist/chunk-OREALBUO.mjs +1 -0
  90. package/dist/chunk-OVZ4CQGM.mjs +1 -0
  91. package/dist/chunk-PRPXMDZ7.mjs +1 -0
  92. package/dist/chunk-PWQB3FIW.mjs +1 -0
  93. package/dist/chunk-QE5XGXIA.mjs +30 -0
  94. package/dist/chunk-QV5G3XRE.mjs +1 -0
  95. package/dist/chunk-ROKRMYFR.mjs +1 -0
  96. package/dist/chunk-SBD7GQDN.mjs +1 -0
  97. package/dist/chunk-SKKHZBOJ.mjs +1 -0
  98. package/dist/chunk-SOGN7S54.mjs +1 -0
  99. package/dist/chunk-SOT33EQ4.mjs +1 -0
  100. package/dist/chunk-SUAHDXJZ.mjs +1 -0
  101. package/dist/chunk-TCGXG7UA.mjs +1 -0
  102. package/dist/chunk-TIAPJGX2.mjs +1 -0
  103. package/dist/chunk-TMSGNHXH.mjs +1 -0
  104. package/dist/chunk-UTP56NCY.mjs +1 -0
  105. package/dist/chunk-UX3DTCHL.mjs +1 -0
  106. package/dist/chunk-VVNZ5IEG.mjs +24 -0
  107. package/dist/chunk-W2QQVB2H.mjs +1 -0
  108. package/dist/chunk-WF3YGZPI.mjs +1 -0
  109. package/dist/chunk-WJHYEACV.mjs +1 -0
  110. package/dist/chunk-WP2SHSCG.mjs +1 -0
  111. package/dist/chunk-X6I6KQDG.mjs +1 -0
  112. package/dist/chunk-XJJDBMZI.mjs +1 -0
  113. package/dist/chunk-YMWXWXPV.mjs +1 -0
  114. package/dist/chunk-YYODLRV3.mjs +1 -0
  115. package/dist/cli.mjs +1 -1
  116. package/dist/codex-note-context-6QGJT2V3.mjs +1 -0
  117. package/dist/codex-project-3GJPU63O.mjs +1 -0
  118. package/dist/codex-session-registry-YNU6LEVH.mjs +1 -0
  119. package/dist/codex-store-mount-F6RBC77X.mjs +1 -0
  120. package/dist/{dev-server-DtX2_HCa.d.mts → dev-server-BRrhkH5t.d.mts} +11 -1
  121. package/dist/dev-server-KWVIMLLL.mjs +1 -0
  122. package/dist/focus-inspection-F25RXWZV.mjs +1 -0
  123. package/dist/guest-admission.d.mts +2 -0
  124. package/dist/guest-admission.mjs +1 -0
  125. package/dist/guest-live-canvas.d.mts +2 -0
  126. package/dist/guest-live-canvas.mjs +1 -0
  127. package/dist/index.d.mts +6 -6
  128. package/dist/index.mjs +1 -1
  129. package/dist/invitationLink-LUIIOAEZ.mjs +1 -0
  130. package/dist/inviteQr-HVHH45SN.mjs +1 -0
  131. package/dist/inviteQr-U77MLSEQ.mjs +1 -0
  132. package/dist/media.d.mts +3 -3
  133. package/dist/memory-store.d.mts +5 -1
  134. package/dist/page-interaction-TV3P6B3X.mjs +1 -0
  135. package/dist/page-planes-2ZepTpen.d.mts +817 -0
  136. package/dist/participantBootstrap-BuTrTQbo.d.mts +22 -0
  137. package/dist/{participantBootstrap-DFJlcKRI.d.mts → participantBootstrap-CSLsiQ-C.d.mts} +9 -3
  138. package/dist/peer-client-7X52EKMX.mjs +1 -0
  139. package/dist/plain-html-EF7MUNRZ.mjs +1 -0
  140. package/dist/plugin-astro.d.mts +5 -2
  141. package/dist/plugin-astro.mjs +1 -1
  142. package/dist/plugin-next.mjs +1 -1
  143. package/dist/plugin-nuxt.d.mts +4 -2
  144. package/dist/plugin-nuxt.mjs +1 -1
  145. package/dist/plugin-vite.d.mts +69 -9
  146. package/dist/plugin-vite.mjs +1 -1
  147. package/dist/qr-encoder.mjs +3 -0
  148. package/dist/server.d.mts +45 -20
  149. package/dist/server.mjs +1 -1
  150. package/dist/shared-page-GO76UP7I.mjs +1 -0
  151. package/dist/{subjects-DdavjSTL.d.mts → subjects-BQFCkehy.d.mts} +84 -1
  152. package/dist/taste-proposal-session-DBOUA54V.mjs +1 -0
  153. package/dist/toolbarFonts-GVPRHJGB.mjs +1 -0
  154. package/dist/{types-g9YCBx4Z.d.mts → types-CggBG-H6.d.mts} +1 -137
  155. package/dist/{video-adapter-DB6Hex1f.d.mts → video-adapter-C0kSwUir.d.mts} +2 -2
  156. package/dist/workspace-snapshot-6LN7U2NJ.mjs +1 -0
  157. package/package.json +45 -22
  158. package/samples/README.md +32 -0
  159. package/samples/build.d.mts +16 -0
  160. package/samples/build.mjs +138 -0
  161. package/dist/ExploreAttachment-H5WPEAZB.mjs +0 -1
  162. package/dist/PagePreviewLayer-WCYOBKAS.mjs +0 -1
  163. package/dist/ParticipantRuntime-HEC26AER.mjs +0 -1
  164. package/dist/PhoneHostGate-Q2AXVOSH.mjs +0 -1
  165. package/dist/PopmeltTasteConnectedPane-B7DHQKRQ.mjs +0 -1
  166. package/dist/PreviewRuntime-H2UOLP6T.mjs +0 -1
  167. package/dist/SuppliedContext-7ASO6GAW.mjs +0 -1
  168. package/dist/ThreadErrorCard-6R7W3RGZ.mjs +0 -1
  169. package/dist/ThreadPanel-3IS7GUYS.mjs +0 -1
  170. package/dist/bridgeSSEStream-K3UIMBTC.mjs +0 -1
  171. package/dist/bridgeWebSocketStream-2SUZUBE3.mjs +0 -1
  172. package/dist/browser-runtime-ILNTJLZ5.mjs +0 -1
  173. package/dist/canvas-chat-note-MGAEUYJO.mjs +0 -1
  174. package/dist/checkFixture-YE2ROOLL.mjs +0 -1
  175. package/dist/chunk-26P7UUHT.mjs +0 -1
  176. package/dist/chunk-2P2NUZW7.mjs +0 -1
  177. package/dist/chunk-3SEXH3AZ.mjs +0 -1
  178. package/dist/chunk-3XJEC6LS.mjs +0 -1
  179. package/dist/chunk-4LHTPRFY.mjs +0 -1
  180. package/dist/chunk-5D2ADU7H.mjs +0 -1
  181. package/dist/chunk-5K7SACPW.mjs +0 -1
  182. package/dist/chunk-67QNAAUC.mjs +0 -1
  183. package/dist/chunk-7CGKO4IU.mjs +0 -30
  184. package/dist/chunk-BACXPVHP.mjs +0 -1
  185. package/dist/chunk-DC47WNPG.mjs +0 -1
  186. package/dist/chunk-DJTGR3RO.mjs +0 -1
  187. package/dist/chunk-DLUNNAZC.mjs +0 -1
  188. package/dist/chunk-EX63NVDN.mjs +0 -1
  189. package/dist/chunk-FLTHWLRC.mjs +0 -1
  190. package/dist/chunk-G6RYESYI.mjs +0 -1
  191. package/dist/chunk-G7JR5Z3P.mjs +0 -1
  192. package/dist/chunk-GBVPRXA3.mjs +0 -1
  193. package/dist/chunk-HAE5LUJX.mjs +0 -1
  194. package/dist/chunk-HU2XWUJC.mjs +0 -1
  195. package/dist/chunk-HV7HRQ2S.mjs +0 -1
  196. package/dist/chunk-J4WDYITA.mjs +0 -1
  197. package/dist/chunk-L7QONR4K.mjs +0 -1
  198. package/dist/chunk-LVEMYZOA.mjs +0 -1
  199. package/dist/chunk-MSWXKP77.mjs +0 -1
  200. package/dist/chunk-NSCO633B.mjs +0 -1
  201. package/dist/chunk-NWE5PYKM.mjs +0 -1
  202. package/dist/chunk-O4HZP3RP.mjs +0 -1
  203. package/dist/chunk-OAHYSDJ4.mjs +0 -1
  204. package/dist/chunk-PNTM77NT.mjs +0 -1
  205. package/dist/chunk-RUTWU5W2.mjs +0 -1
  206. package/dist/chunk-TLREGQQB.mjs +0 -1
  207. package/dist/chunk-TUXBMJQZ.mjs +0 -1
  208. package/dist/chunk-V2I7PSJW.mjs +0 -1
  209. package/dist/chunk-WDAXARLI.mjs +0 -1
  210. package/dist/chunk-WHJEKDNP.mjs +0 -1
  211. package/dist/chunk-X2Q3H6X7.mjs +0 -1
  212. package/dist/chunk-XJQJQ5V5.mjs +0 -1
  213. package/dist/chunk-XT6PHPPG.mjs +0 -1
  214. package/dist/chunk-YD3PDEFX.mjs +0 -1
  215. package/dist/chunk-ZDXQ7WNW.mjs +0 -1
  216. package/dist/codex-note-context-YFURG7VL.mjs +0 -1
  217. package/dist/codex-project-3NSU5OWL.mjs +0 -1
  218. package/dist/codex-session-registry-ONODFWFD.mjs +0 -1
  219. package/dist/focus-inspection-SZJ5KP23.mjs +0 -1
  220. package/dist/peer-client-56EAHIGF.mjs +0 -1
  221. package/dist/taste-proposal-session-XU4N7RUV.mjs +0 -1
  222. package/dist/workspace-snapshot-RTTXNNUX.mjs +0 -1
@@ -1 +0,0 @@
1
- "use client";import{c as e,g as t}from"./chunk-XT6PHPPG.mjs";import{a as n}from"./chunk-V2I7PSJW.mjs";import{f as r,d as o,c as a,e as l,g as i}from"./chunk-WHJEKDNP.mjs";var s={isAnnotating:!1,activeTool:"inspector",activeColor:"oklch(0.628 0.258 29)",strokeWidth:3,annotations:[],undoStack:[],redoStack:[],selectedAnnotationIds:[],lastSelectedId:null,styleModifications:[],textModifications:[],domModifications:[],spacingTokenChanges:[],spacingTokenMods:[]};function f(e){return e.left+e.width}function u(e){return e.top+e.height}function d(e,t){if(0===e.length)return t;let n=Math.min(...e.map(e=>e.left)),r=Math.min(...e.map(e=>e.top));return{left:n,top:r,width:Math.max(...e.map(f))-n,height:Math.max(...e.map(u))-r}}function p(e){let t=[...e].sort((e,t)=>e.top-t.top||e.left-t.left),n=[];for(let e of t){let t=e.top+e.height/2,r=n.find(n=>{let r=n.top+n.height/2;return Math.abs(t-r)<=.4*Math.max(n.height,e.height)});if(!r){n.push({...e});continue}let o=Math.min(r.left,e.left),a=Math.min(r.top,e.top),l=Math.max(f(r),f(e)),i=Math.max(u(r),u(e));r.left=o,r.top=a,r.width=l-o,r.height=i-a}return n.sort((e,t)=>e.top-t.top||e.left-t.left)}function c(e){return!!e&&!!e.closest("#devtools-toolbar, #devtools-scrim, #devtools-text-input, [data-devtools], [data-popmelt-panel], [data-popmelt-shadow-host]")}function h(e,t,n){let r=e.caretPositionFromPoint?.(t,n);if(r?.offsetNode.nodeType===Node.TEXT_NODE)return{node:r.offsetNode,offset:r.offset};let o=e.caretRangeFromPoint?.(t,n);return o?.startContainer.nodeType===Node.TEXT_NODE?{node:o.startContainer,offset:o.startOffset}:null}function g(e,n,o,a=!1){return function(e,t){if(!e)return t();let n=e.style.pointerEvents;e.style.pointerEvents="none";try{return t()}finally{e.style.pointerEvents=n}}(o,()=>{let o=t(e,n);if(!o||c(o))return null;let s=o?.ownerDocument??document,f=l(e,n,s),u=h(s,f.x,f.y)?.node??null;if(u&&!o.contains(u)&&(u=null),!u){let e=o;e&&!c(e)&&(u=function(e,t,n){let r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:e=>e.textContent?.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),o=r.nextNode();for(;o;){let a=o,l=e.ownerDocument.createRange();l.selectNodeContents(a);let i=Array.from(l.getClientRects());if(l.detach?.(),i.some(e=>t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom))return a;o=r.nextNode()}return null}(e,f.x,f.y))}if(!u&&o?.closest("p")?.querySelector("[data-popmelt-empty-paragraph]"))return m(o.closest("p"));if(!u||!i(u.parentElement))return null;let d=u.parentElement;if(c(d))return null;for(;!a&&d.parentElement&&d!==s.body;){let e=r(d).getComputedStyle(d).display,t="inline-block"===e&&1===d.childNodes.length&&d.firstChild?.nodeType===Node.ELEMENT_NODE;if("inline"!==e&&"contents"!==e&&!t)break;let n=d.parentElement;if(c(n))break;if(Array.from(n.childNodes).some(e=>e.nodeType===Node.TEXT_NODE&&!!e.nodeValue?.trim())){d=n;continue}let o=r(n).getComputedStyle(n).display,a="inline-block"===o&&1===n.childNodes.length&&n.firstChild?.nodeType===Node.ELEMENT_NODE;if("inline"!==o&&"contents"!==o&&!a)break;d=n}let p=u.parentElement?.closest("p"),g=u.parentElement?.closest('button, input, textarea, select, [role="button"]');if(p&&(!g||!p.contains(g)))return m(p,u);let N=d.tagName.toLowerCase();if("script"===N||"style"===N||"textarea"===N||"input"===N)return null;let b=x(d).filter(e=>!a||e.textNode===u),T=b.map(e=>e.originalText).join("");if(!T.trim())return null;let E=y(d,u);if(!E)return null;let S=r(d).getComputedStyle(d),v=w(b,d,S,a),{textRect:C,boundaryRect:M,boundaryRects:R,flowRect:P,firstLineIndent:D}=v;if(C.width<=0||C.height<=0)return null;let k=parseFloat(S.fontSize)||12,A="nowrap"!==S.whiteSpace&&"pre"!==S.whiteSpace&&(a?R.length>1:function(e){let t=e.ownerDocument.createRange();t.selectNodeContents(e);let n=Array.from(t.getClientRects()).filter(e=>e.width>0&&e.height>0).length;return t.detach?.(),n>1}(u)||"inline"!==S.display);return{textNode:u,targetElement:d,textNodePath:E,segments:b,originalText:T,rect:C,boundaryRect:M,boundaryRects:R,flowRect:P,firstLineIndent:D,styles:S,fontSize:k,wrapsText:A,singleTextNode:a}})}function m(e,t){let n=x(e),o=n.find(e=>e.textNode===t)??n[0];if(!o)return null;let a=r(e).getComputedStyle(e),{textRect:l,...i}=w(n,e,a);return{...o,targetElement:e,segments:n,originalText:n.map(e=>e.originalText).join(""),styles:a,rect:l,...i,fontSize:parseFloat(a.fontSize)||12,wrapsText:"nowrap"!==a.whiteSpace&&"pre"!==a.whiteSpace}}function y(e,t){let n=[],r=t;for(;r&&r!==e;){let e=r.parentNode;if(!e)return null;n.unshift(Array.prototype.indexOf.call(e.childNodes,r)),r=e}return r===e?n:null}function x(e){let t=[],n=r=>{if(r.nodeType===Node.TEXT_NODE){let n=r,o=y(e,n);return void(o&&t.push({textNode:n,textNodePath:o,originalText:n.nodeValue??""}))}if(r.nodeType!==Node.ELEMENT_NODE&&r!==e)return;let o=r.tagName?.toLowerCase();"script"===o||"style"===o||r.childNodes.forEach(n)};return e.childNodes.forEach(n),t}function N(e){return{left:e.left,top:e.top,width:e.width,height:e.height}}function b(e){let t=e.getBoundingClientRect(),n=r(e).getComputedStyle(e),o=(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.paddingLeft)||0),l=(parseFloat(n.borderRightWidth)||0)+(parseFloat(n.paddingRight)||0),i=(parseFloat(n.borderTopWidth)||0)+(parseFloat(n.paddingTop)||0),s=(parseFloat(n.borderBottomWidth)||0)+(parseFloat(n.paddingBottom)||0);return a({left:t.left+o,top:t.top+i,width:Math.max(0,t.width-o-l),height:Math.max(0,t.height-i-s)},e.ownerDocument)}function w(e,t,n,r=!1){let l=N(o(t)),i=function(e){let t=[];for(let n of e){if(!n.textNode.isConnected||!n.originalText.trim())continue;let e=n.textNode.ownerDocument.createRange();e.selectNodeContents(n.textNode),t.push(...Array.from(e.getClientRects()).filter(e=>e.width>0&&e.height>0).map(e=>N(a(e,n.textNode.ownerDocument)))),e.detach?.()}return p(t)}(e),s=e[0]?.textNode?function(e,t){let n=e.ownerDocument.createRange();n.selectNodeContents(e);let r=a(n.getBoundingClientRect(),e.ownerDocument);if(n.detach?.(),r.width>0&&r.height>0)return{left:r.left,top:r.top,width:r.width,height:r.height};let l=o(t);return{left:l.left,top:l.top,width:l.width,height:l.height}}(e[0].textNode,t):l,f=i.length>0?i:[s];return function({display:e,singleTextNode:t=!1,fragmentRects:n,elementRect:r,parentContentRect:o}){let a=p(n),l=d(a,r);if(!("inline"===e&&a.length>1&&o&&o.width>0))return{textRect:l,boundaryRect:t?l:r,boundaryRects:t?a:[r],firstLineIndent:0};let i=a[0],s={left:o.left,top:i.top,width:o.width,height:Math.max(l.height,u(l)-i.top)},f=Math.max(0,Math.min(s.width,i.left-s.left));return{textRect:l,boundaryRect:d(a,r),boundaryRects:a,flowRect:s,firstLineIndent:f}}({display:n.display,singleTextNode:r,fragmentRects:f,elementRect:l,parentContentRect:t.parentElement?b(t.parentElement):void 0})}function T(e,t,n){if(t===n||0===e.length)return[];let r=0;for(;r<t.length&&r<n.length&&t[r]===n[r];)r+=1;let o=0;for(;o<t.length-r&&o<n.length-r&&t[t.length-1-o]===n[n.length-1-o];)o+=1;let a=r,l=t.length-o,i=n.slice(r,n.length-o),s=0,f=!1;return e.flatMap((t,n)=>{let r=s,o=r+t.originalText.length;s=o;let u=a===l;if(!(u&&(a>=r&&a<o||n===e.length-1&&a===o))&&!(!u&&o>a&&r<l))return[];let d=Math.max(0,Math.min(t.originalText.length,a-r)),p=Math.max(0,Math.min(t.originalText.length,l-r)),c=t.originalText.slice(0,d);return f||(c+=i,f=!0),c+=t.originalText.slice(p),c===t.originalText?[]:[{segment:t,modifiedText:c}]})}function E(e,t){return Math.abs(e.left-t.left)<.5&&Math.abs(e.top-t.top)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5}function S(e,t){return e&&t?E(e,t):e===t}function v(e,t){return e.length===t.length&&e.every((e,n)=>E(e,t[n]))}var C=new WeakMap;function M(e){let t=e.closest("p");return t?C.get(t):void 0}function R(e){let t=x(e);return{root:e,rows:[e],runs:t.map(e=>[e.textNode]),paths:t.map(e=>e.textNodePath),undo:[]}}function P(e){let t=C.get(e)??R(e),n=t.runs.map((e,n)=>({path:t.paths[n],parts:e.map(e=>e.data)}));return{group:t,layout:n}}function D(e,t,n){let r=t.splitText(n),o=r,a=t.parentElement;for(;;){let t=a,n=a.cloneNode(!1);for(n.removeAttribute("id"),n.removeAttribute("data-pm");o.nextSibling;)n.appendChild(o.nextSibling);if(n.insertBefore(o,n.firstChild),t.after(n),e.undo.push(()=>{for(;n.firstChild;)t.appendChild(n.firstChild);n.remove()}),"P"===a.tagName){n.dataset.popmeltParagraphContinuation="",e.rows.splice(e.rows.indexOf(t)+1,0,n),C.set(n,e);break}o=n,a=t.parentElement}return r}function k(e){let t=C.get(e);if(t&&t.root===e){for(let e of t.rows)e.querySelector("br[data-popmelt-empty-paragraph]")?.remove(),C.delete(e);for(let e of t.undo.reverse())e()}}function A(e,t){if("P"!==e.tagName)return;let n=C.get(e);if((!n||n.root===e)&&(n&&!n.runs.every((e,n)=>e.length===t[n]?.parts.length)&&(k(e),n=void 0),n??(n=R(e)),n.paths.length===t.length&&t.every((e,t)=>e.parts.length&&e.path.join(".")===n.paths[t].join(".")))){if(!C.has(e)){C.set(e,n);for(let e=0;e<t.length;e++){let r=n.runs[e],o=r[0],a=o.data;n.undo.push(()=>{o.data=a;for(let e of r.slice(1))e.remove()});let l=t[e].parts;for(let e=1;e<l.length;e++){let t=r[e-1];r.push(D(n,t,t.length))}}}n.runs.forEach((e,n)=>e.forEach((e,r)=>{let o=t[n].parts[r];e.data!==o&&(e.data=o)}));for(let e of n.rows){let t=e.querySelector("br[data-popmelt-empty-paragraph]");if(e.textContent||t||e.querySelector("br,img,svg,input"))e.textContent&&t&&t.remove();else{let t=e.ownerDocument.createElement("br");t.dataset.popmeltEmptyParagraph="",e.appendChild(t)}}return n}}var F=new WeakMap,O=new WeakMap;function L(e,t){if(n(t))for(let[n,r]of O.get(e)??[])r.value?t.style.setProperty(n,r.value,r.priority):t.style.removeProperty(n)}function I(e,t){F.set(e,new Set(t))}function W(e){F.delete(e)}function _(e,t){return n(e)&&(F.get(e)?.has(t)??!1)}function V(e){let t=e.sticker;return t?"padding"===t.family||"margin"===t.family?"all"===t.subproperty?10:"x"===t.subproperty||"y"===t.subproperty?20:30:"radius"===t.family||"border"===t.family?"all"===t.subproperty?10:20:10:0}function j(e){return e.changes.map((e,t)=>({change:e,index:t})).sort((e,t)=>V(e.change)-V(t.change)||e.index-t.index).map(({change:e})=>e)}function X(e,t,r){if(n(e)){let n=O.get(e);n||(n=new Map,O.set(e,n)),n.has(t)||n.set(t,{value:e.style.getPropertyValue(t),priority:e.style.getPropertyPriority(t)}),e.style.setProperty(t,r,"important")}}function q(e,t,r,o=!1){if(n(e)){let n=o?O.get(e)?.get(t):void 0;n?.value?e.style.setProperty(t,n.value,n.priority):e.style.removeProperty(t),O.get(e)?.delete(t)}}function B(t){let n=e(t.selector);if(!n&&t.durableSelector&&(n=e(t.durableSelector),n)){let e=t.selector.match(/\[data-pm="([^"]+)"\]/)?.[1];e&&n.setAttribute("data-pm",e)}return n}function z(e){for(let t of e){let e=B(t);if(e)for(let n of j(t))_(e,n.property)||X(e,n.property,n.modified)}}function J(t,n=!1){for(let r of t){let t=e(r.selector);if(t)for(let e of r.changes)_(t,e.property)||q(t,e.property,e.original,n)}}function H(t){let n=e(t.selector);if(!n&&t.durableSelector&&(n=e(t.durableSelector),n)){let e=t.selector.match(/\[data-pm="([^"]+)"\]/)?.[1];e&&n.setAttribute("data-pm",e)}return n}function G(e,t){let n=e;for(let e of t)n=n?.childNodes[e]??null;return n?.nodeType===Node.TEXT_NODE?n:null}function K(e){for(let t of e){if(t.captured)continue;let e=H(t);if(!e)continue;if(t.paragraphs&&"P"===e.tagName){let n=e;if(!M(n)&&JSON.stringify(P(n).layout)!==JSON.stringify(t.paragraphs.before))continue;A(n,t.paragraphs.after);continue}let n=G(e,t.textNodePath);n&&n.nodeValue===t.original&&n.nodeValue!==t.modified&&(n.nodeValue=t.modified)}}function Q(e){for(let t of[...e].reverse()){if(t.captured)continue;let e=H(t);if(!e)continue;if(t.paragraphs&&"P"===e.tagName){k(e),t.paragraphs.before.some(e=>e.parts.length>1)&&A(e,t.paragraphs.before);continue}let n=G(e,t.textNodePath);n&&n.nodeValue===t.modified&&n.nodeValue!==t.original&&(n.nodeValue=t.original)}}function U(e,t){let n=new Set(t);Q(e.filter(e=>!(n.has(e)||e.paragraphs&&t.some(t=>t.paragraphs&&t.selector===e.selector&&!t.captured)))),K(t)}function Y(t,n){if(!t)return null;let r=e(t);if(!r&&n&&(r=e(n),r)){let e=t.match(/\[data-pm="([^"]+)"\]/)?.[1];e&&r.setAttribute("data-pm",e)}return r}function Z(e){e.removeAttribute("data-pm"),e.querySelectorAll("[data-pm]").forEach(e=>e.removeAttribute("data-pm"))}function $(e,t){let n=t.match(/\[data-pm="([^"]+)"\]/)?.[1];n&&e.setAttribute("data-pm",n)}function ee(e,t,n){let r=Array.from(e.children).filter(e=>e!==t),o=Math.max(0,Math.min(n,r.length));e.insertBefore(t,r[o]??null)}function te(e){for(let t of e){let e=Y(t.targetParentSelector,t.targetParentDurableSelector);if(!e)continue;if("move"===t.operation){let n=Y(t.selector,t.durableSelector);if(!n||n===e||n.contains(e))continue;ee(e,n,t.targetIndex);continue}if(Y(t.selector,t.durableSelector))continue;let n=Y(t.sourceSelector,t.sourceDurableSelector);if(!n)continue;let r=n.cloneNode(!0);r instanceof Element&&(Z(r),$(r,t.selector),ee(e,r,t.targetIndex))}}function ne(e){for(let t of[...e].reverse()){if("copy"===t.operation){Y(t.selector,t.durableSelector)?.remove();continue}let e=Y(t.selector,t.durableSelector),n=Y(t.originalParentSelector,t.originalParentDurableSelector);!e||!n||e===n||e.contains(n)||ee(n,e,t.originalIndex??n.children.length)}}export{ne as A,s as a,d as b,p as c,c as d,h as e,g as f,m as g,w as h,T as i,E as j,S as k,v as l,M as m,P as n,A as o,L as p,I as q,W as r,X as s,B as t,z as u,J as v,K as w,Q as x,U as y,te as z};
@@ -1 +0,0 @@
1
- import{createHash as t}from"crypto";import{mkdir as e,readFile as r,readdir as o,stat as s,writeFile as n}from"fs/promises";import{tmpdir as i}from"os";import{join as a}from"path";function d(t,e,r){let o=new Map(t.candidates.map(t=>[t.storeId,t])),s=o.get(e);if(!s)return null;let n=[...new Set(r)].filter(t=>t!==e);return n.some(t=>!o.has(t))?null:{primary:s,mountedStores:n.map(t=>{let e=o.get(t);return{storeId:e.storeId,projectRoot:e.root,projectId:e.projectId}})}}function u(){return process.env.POPMELT_CODEX_SESSION_DIR||a(i(),"popmelt-core","codex-sessions")}function c(e){let r=t("sha256").update(e).digest("hex");return a(u(),`${r}.json`)}function p(t){if(!t||"object"!=typeof t||Array.isArray(t))return!1;let e=t;return"string"==typeof e.storeId&&!!e.storeId&&"string"==typeof e.projectRoot&&!!e.projectRoot&&"string"==typeof e.projectId&&!!e.projectId}function l(t){if(!t||"object"!=typeof t||Array.isArray(t))return!1;let e=t;return"string"==typeof e.root&&!!e.root&&"string"==typeof e.storeId&&!!e.storeId&&"string"==typeof e.projectId&&!!e.projectId&&"string"==typeof e.reason&&Array.isArray(e.reasons)&&e.reasons.every(t=>"string"==typeof t)&&"boolean"==typeof e.initialized}function f(t){if(!t||"object"!=typeof t||Array.isArray(t))return null;let e=t;return"orientation_required"===e.status?2===e.version&&"string"==typeof e.sessionId&&e.sessionId&&"string"==typeof e.cwd&&e.cwd&&Array.isArray(e.candidates)&&e.candidates.every(l)&&"string"==typeof e.updatedAt&&!Number.isNaN(Date.parse(e.updatedAt))?e:null:function(t){if("string"!=typeof t.sessionId||!t.sessionId||"string"!=typeof t.projectRoot||!t.projectRoot||"string"!=typeof t.projectId||!t.projectId||!Number.isInteger(t.bridgePort)||"string"!=typeof t.updatedAt||Number.isNaN(Date.parse(t.updatedAt)))return null;let e=Array.isArray(t.mountedStores)?t.mountedStores.filter(p):[],r="automatic"===t.orientation||"explicit"===t.orientation||"workspace_default"===t.orientation?t.orientation:"legacy";return{version:2,status:"active",sessionId:t.sessionId,storeId:"string"==typeof t.storeId&&t.storeId?t.storeId:`store-${t.projectId}`,projectRoot:t.projectRoot,projectId:t.projectId,bridgePort:t.bridgePort,mountedStores:e,orientation:r,updatedAt:t.updatedAt}}(e)}async function y(t){let r=u();await e(r,{recursive:!0,mode:448}),await n(c(t.sessionId),`${JSON.stringify(t,null,2)}\n`,{encoding:"utf8",mode:384})}async function I(t){await y(t)}async function m(t){await y(t)}async function g(t){try{let e=f(JSON.parse(await r(c(t),"utf8")));return e?.sessionId===t?e:null}catch{return null}}async function j(t){let e=await g(t);return"active"===e?.status?e:null}async function w(t){let e=await g(t);return"orientation_required"===e?.status?e:null}async function A(){let t=u(),e=(await o(t,{withFileTypes:!0}).catch(t=>{if("ENOENT"===t.code)return[];throw t})).filter(t=>t.isFile()&&/^[a-f0-9]{64}\.json$/.test(t.name));if(e.length>2048)throw new Error("Session registry exceeds discovery limit");return(await Promise.all(e.map(async e=>{let o=a(t,e.name);try{if((await s(o)).size>65536)return null;let t=f(JSON.parse(await r(o,"utf8")));return"active"===t?.status&&c(t.sessionId)===o?t:null}catch{return null}}))).filter(t=>null!==t)}export{d as a,I as b,m as c,g as d,j as e,w as f,A as g};
@@ -1 +0,0 @@
1
- "use client";import{a as t}from"./chunk-4LHTPRFY.mjs";var e=6;function n(t,e){if(!Number.isFinite(e.x)||!Number.isFinite(e.y))return[...t];let n=t[t.length-1];return n&&Math.hypot(e.x-n.x,e.y-n.y)<2?[...t]:[...t.length>=256?t.filter((t,e)=>e%2==0):t,{x:e.x,y:e.y}]}function o(t){return{left:Math.min(...t.map(t=>t.x)),top:Math.min(...t.map(t=>t.y)),right:Math.max(...t.map(t=>t.x)),bottom:Math.max(...t.map(t=>t.y))}}function l(t,e){let n=!1;for(let o=0,l=e.length-1;o<e.length;l=o++){let r=e[o],a=e[l];r.y>t.y!=a.y>t.y&&t.x<(a.x-r.x)*(t.y-r.y)/(a.y-r.y)+r.x&&(n=!n)}return n}function r(t,e,n,l=Date.now()){if(t.length<3)return null;let r=o(t);return r.right-r.left<8||r.bottom-r.top<8||0===a(t).length?null:{kind:"lasso",coordinateSpace:"document",points:t.map(t=>({x:t.x+e.x,y:t.y+e.y})),viewport:n,scroll:{...e},capturedAt:l}}function a(t){if(t.length<3)return[];let e=o(t),n=[];for(let o=0;o<8;o++)for(let r=0;r<8;r++){let a={x:e.left+(r+.5)*(e.right-e.left)/8,y:e.top+(o+.5)*(e.bottom-e.top)/8};l(a,t)&&n.push(a)}return n}function i(e,n,o,l=!0){n.length<3||(e.save(),e.beginPath(),n.forEach((t,n)=>0===n?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)),e.closePath(),e.fillStyle=o,e.globalAlpha*=.07,e.fill("evenodd"),e.restore(),l&&(e.save(),e.strokeStyle=o,e.lineWidth=1,e.setLineDash([...t]),e.stroke(),e.restore()))}export{e as a,n as b,o as c,r as d,a as e,i as f};