@popmelt.com/core 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/claude-plugin/.claude-plugin/plugin.json +1 -1
- package/claude-plugin/skills/popmelt-core/SKILL.md +6 -0
- package/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/codex-plugin/skills/popmelt-core/SKILL.md +6 -0
- package/dist/ParticipantRuntime-AKVKVNO2.mjs +139 -0
- package/dist/{PopmeltTasteConnectedPane-A7QLXPE4.mjs → PopmeltTasteConnectedPane-L5ULGACH.mjs} +12 -12
- package/dist/QueuedReplies-ZYUDSTS2.mjs +46 -0
- package/dist/ThreadErrorCard-Q5GQ4EIF.mjs +2 -0
- package/dist/bridge-entry.mjs +1 -1
- package/dist/browser-runtime-PPQ2GUER.mjs +2 -0
- package/dist/browser.mjs +1 -1
- package/dist/canvas-chat-note-7HSL7MH6.mjs +2 -0
- package/dist/{chunk-XZ6MNKUQ.mjs → chunk-2BVRVVHJ.mjs} +23 -23
- package/dist/chunk-2RRYBN2J.mjs +17 -0
- package/dist/chunk-4BEN6VQ7.mjs +2 -0
- package/dist/chunk-4V7SK3M6.mjs +3 -0
- package/dist/chunk-AR4MHLWP.mjs +342 -0
- package/dist/chunk-CPOYMGYY.mjs +2 -0
- package/dist/{chunk-MBBS4FJH.mjs → chunk-ENGMQINZ.mjs} +1 -1
- package/dist/{chunk-5VILWL5E.mjs → chunk-HTHUSDZT.mjs} +1 -1
- package/dist/chunk-MZNY6VXR.mjs +2 -0
- package/dist/{chunk-GIJABDSK.mjs → chunk-N4F7DGFN.mjs} +1 -1
- package/dist/chunk-O6HC437G.mjs +307 -0
- package/dist/chunk-OFHBVUTT.mjs +315 -0
- package/dist/chunk-YYWUENSJ.mjs +2 -0
- package/dist/cli.mjs +34 -340
- package/dist/codex-note-context-ZLQU57WU.mjs +2 -0
- package/dist/codex-project-P3J62GZR.mjs +2 -0
- package/dist/codex-session-registry-25DAA2KO.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/memory-store.d.mts +1 -1
- package/dist/peer-client-DGX6OHMK.mjs +2 -0
- package/dist/plugin-astro.mjs +1 -1
- package/dist/plugin-nuxt.mjs +1 -1
- package/dist/plugin-vite.mjs +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/server.mjs +5 -5
- package/dist/{types-BethD1Ix.d.mts → types-C8tjyhiF.d.mts} +19 -0
- package/package.json +22 -32
- package/dist/ParticipantRuntime-ITMSYN4F.mjs +0 -139
- package/dist/ThreadErrorCard-MHFJXR4W.mjs +0 -2
- package/dist/browser-runtime-4IAKTM6S.mjs +0 -2
- package/dist/chunk-BZFM6VPZ.mjs +0 -303
- package/dist/chunk-MFNS5MBM.mjs +0 -2
- package/dist/chunk-QRVEMJ4U.mjs +0 -367
- package/dist/chunk-VLFWNZFS.mjs +0 -17
- /package/dist/{chunk-J4YWKBXJ.mjs → chunk-ZQTLCQPC.mjs} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{b as P,c as B}from"./chunk-6VXFTT5U.mjs";var b=new Set;function D(e,t){let r=new URL(e).origin;t==="websocket"?b.add(r):b.delete(r)}function C(e){return b.has(new URL(e).origin)?new j(e,!0):P(e)?new j(e):new EventSource(e)}var j=class{constructor(e,t=!1){this.readyState=0,this.onerror=null,this.controller=new AbortController,this.listeners=new Map,this.fail=()=>{this.controller.signal.aborted||(this.readyState=2,this.controller.abort(),this.emit("error",""),this.onerror?.call(this,new Event("error")))},typeof document<"u"&&document.addEventListener("resume",this.fail,{signal:this.controller.signal}),this.read(e,t)}addEventListener(e,t){let r=this.listeners.get(e)??new Set;r.add(t),this.listeners.set(e,r)}close(){this.readyState=2,this.controller.abort(),this.listeners.clear()}emit(e,t){let r=new MessageEvent(e,{data:t});for(let n of this.listeners.get(e)??[])n(r)}async read(e,t){try{if(t){let{readBridgeWebSocket:n}=await import("./bridgeWebSocketStream-H3DCP4T3.mjs");await n(e,this.controller.signal,(a,c)=>{a==="connected"&&(this.readyState=1),this.emit(a,c)});return}let{readBridgeSSE:r}=await import("./bridgeSSEStream-NEYI73TC.mjs");await r(e,this.controller.signal,()=>{this.readyState=1},(n,a)=>this.emit(n,a))}catch{this.fail()}}},w="http://localhost:1111",$=new Map;function k(){return typeof window<"u"?window.__POPMELT_PROJECT_ID__??null:null}function U(e={}){let t=k();if(!t)return e;let r=new Headers(e.headers);return r.set("X-Popmelt-Project-Id",t),{...e,headers:r}}function I(e,t={}){return fetch(e,B(e,U(t)))}async function M(e,t,r){let n=new URLSearchParams({annotationId:t,kind:r.kind,name:r.name}),a=await u(`${e}/draft-attachments?${n}`,{method:"POST",headers:{"Content-Type":r.blob.type},body:r.blob},15e3);if(!a.ok)throw new Error((await a.json().catch(()=>null))?.error||`Bridge returned ${a.status}`);return(await a.json()).attachment}async function R(e,t){t.length!==0&&await u(`${e}/draft-attachments/claim`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:t})},5e3)}async function A(e,t){await u(`${e}/draft-attachments/${encodeURIComponent(t)}`,{method:"DELETE"},5e3)}async function L(e,t){if(($.get(e)??0)>Date.now())return null;try{let r=await u(`${e}/capture/native`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pageUrl:t.url,clip:t.clip,scale:t.scale})},2500);if(!r.ok)return $.set(e,Date.now()+(r.status===404||r.status===501?6e4:1e4)),null;let n=await r.blob();return n.size>0?n:null}catch{return $.set(e,Date.now()+1e4),null}}function u(e,t={},r=15e3){let n=new AbortController;t.signal&&t.signal.addEventListener("abort",()=>n.abort());let a=setTimeout(()=>n.abort(),r);return I(e,{...t,signal:n.signal}).finally(()=>clearTimeout(a))}async function x(e=w){try{let t=await u(`${e}/ui-preferences`,{},5e3);return t.ok?await t.json():null}catch{return null}}async function J(e,t){try{let r=await u(`${e}/ui-preferences`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({theme:t})},5e3);return r.ok?await r.json():null}catch{return null}}function N(e,t){t?.reasoningEffort&&e.append("reasoningEffort",t.reasoningEffort),t?.serviceTier&&e.append("serviceTier",t.serviceTier)}async function _(e=w,t){try{let r=t?`?refresh=${encodeURIComponent(t)}`:"",n=await u(`${e}/capabilities${r}`,{},t?35e3:5e3);return n.ok?await n.json():null}catch{return null}}async function v(e,t){let r=new AbortController,n=setTimeout(()=>r.abort(),t);try{let a=await I(`${e}/status`,{signal:r.signal});if(!a.ok)return null;let c=await a.json();return D(e,c.eventTransport),c}catch{return null}finally{r.abort(),clearTimeout(n)}}async function m(e=w){return v(e,2e3)}async function S(e){return v(`http://localhost:${e}`,500)}async function q(e){return m(e)}async function T(e,t){if(e&&e!=="http://localhost:1111")try{let i=new URL(e),o=await q(e);if(!o&&!t)return null;if(!(!o&&t)&&!(o&&t&&o.projectId!==t)){if(o?.projectId&&!t)return null;if(o)return{url:e,port:parseInt(i.port,10)||1111,projectId:o.projectId}}}catch{if(!t)return null}let r=typeof window<"u"?window.location.origin:null,n=await S(1111);if(n){if(t&&n.projectId===t)return{url:"http://localhost:1111",port:1111,projectId:n.projectId};if(n.devOrigin&&r&&n.devOrigin===r&&(t||!n.projectId))return{url:"http://localhost:1111",port:1111,projectId:n.projectId}}let a=Array.from({length:8},(i,o)=>{let h=1112+o;return S(h).then(y=>y?{status:y,port:h}:null)}),c=(await Promise.all(a)).filter(i=>i!==null),s=[];n&&s.push({port:1111,devOrigin:n.devOrigin,projectId:n.projectId});for(let i of c)s.push({port:i.port,devOrigin:i.status.devOrigin,projectId:i.status.projectId});if(t){let i=s.find(o=>o.projectId===t);if(i)return{url:`http://localhost:${i.port}`,port:i.port,projectId:i.projectId}}if(r){let i=s.find(o=>o.devOrigin===r&&(t||!o.projectId));if(i)return{url:`http://localhost:${i.port}`,port:i.port,projectId:i.projectId}}return s.length===1&&!s[0].projectId?{url:`http://localhost:${s[0].port}`,port:s[0].port,projectId:s[0].projectId}:null}async function F(e=w,t,r=-1,n={}){try{let a=await u(`${e}/jobs/${t}/events?afterSeq=${r}`,{},5e3);if(a.status===404||a.status===410)return null;if(!a.ok){if(n.retryUnavailable&&(a.status===429||a.status>=500))throw new Error("Bridge history is temporarily unavailable");return null}return await a.json()}catch(a){if(n.retryUnavailable)throw a;return null}}async function G(e,t,r=w,n,a,c,s,i,o,h,y,l,p){let f=O({screenshots:e,feedbackJson:t,color:n,provider:a,model:c,pastedImages:s,sourceId:i,agentSettings:o,continuationThreadId:h,continuationSelectorAliases:y,continuationTargetBindingId:l}),d=await u(`${r}/send`,{method:"POST",body:f,...p?{headers:{"X-Popmelt-Peer-Grant":p}}:{}},3e4);if(!d.ok){let g=await d.text();throw new Error(`Bridge returned ${d.status}: ${g}`)}return d.json()}function O({screenshots:e,feedbackJson:t,color:r,provider:n,model:a,pastedImages:c,sourceId:s,agentSettings:i,continuationThreadId:o,continuationSelectorAliases:h,continuationTargetBindingId:y}){let l=new FormData;if(e instanceof Map){let p=!0;for(let[f,d]of e){let g=encodeURIComponent(f);l.append(`screenshot-${g}`,d,`screenshot-${g}.webp`),p&&(l.append("screenshot",d,"screenshot.webp"),p=!1)}p&&l.append("screenshot",new Blob([],{type:"image/webp"}),"screenshot.webp")}else l.append("screenshot",e,"screenshot.webp");if(l.append("feedback",t),r&&l.append("color",r),n&&l.append("provider",n),a&&l.append("model",a),N(l,i),s&&l.append("sourceId",s),o&&l.append("continuationThreadId",o),y&&l.append("continuationTargetBindingId",y),h?.length&&l.append("continuationSelectorAliases",JSON.stringify(h)),c)for(let[p,f]of c)for(let d=0;d<f.length;d++)l.append(`image-${p}-${d}`,f[d],`image-${p}-${d}.webp`);return l}async function H(e=w){let t=()=>({head:{sequence:0,updatedAt:new Date(0).toISOString()},counts:{total:0,emerging:0,testing:0,grounded:0,challenged:0,retired:0,needsGrounding:0},explanations:[]});try{let r=await u(`${e}/memory/imprint-view`,{},5e3);return r.ok?r.json():t()}catch{return t()}}function X(e){return new Promise(t=>setTimeout(t,e))}async function E(e=w,t,r=15e3){let n=Date.now();try{let o=await u(`${e}/restart`,{method:"POST"},5e3);if(!o.ok){let h=await o.text().catch(()=>"");return{ok:!1,error:h?`Bridge restart returned ${o.status}: ${h}`:`Bridge restart returned ${o.status}`,elapsedMs:Date.now()-n}}}catch(o){return{ok:!1,error:o instanceof Error?o.message:"Bridge restart request failed",elapsedMs:Date.now()-n}}let a=null,c=e,s=k();for(;Date.now()-n<r;){if(await X(350),a=await m(c),!a?.ok&&s){let o=await T(e,s);o?.url&&(c=o.url,a=await m(c))}if(a?.ok&&!(s&&a.projectId!==s)&&!(t&&a.version!==t))return{ok:!0,status:a,elapsedMs:Date.now()-n,bridgeUrl:c}}let i=t?` with version ${t}`:"";return a?.ok&&t&&a.version!==t?{ok:!1,error:`Bridge is running version ${a.version??"unknown"}, but this page expects ${t}. Refresh the page to load the current package. If the mismatch remains, rebuild or update the package used by the bridge, then restart it.`,status:a,elapsedMs:Date.now()-n}:{ok:!1,error:`Bridge did not come back${i} within ${Math.round(r/1e3)}s`,status:a,elapsedMs:Date.now()-n}}async function z(e=w){return(await E(e)).ok}async function W(e,t,r=w,n,a,c,s,i,o,h){let y=`${r}/reply`,l;if(s&&s.length>0){let f=new FormData,d=new Blob([new Uint8Array([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,6,0,0,0,31,21,196,137,0,0,0,10,73,68,65,84,120,156,98,0,0,0,2,0,1,229,39,222,252,0,0,0,0,73,69,78,68,174,66,96,130])],{type:"image/png"});f.append("screenshot",d,"screenshot.png"),f.append("feedback",JSON.stringify({threadId:e,reply:t,color:n,provider:a,model:c,sourceId:i,...o,...h}));for(let g=0;g<s.length;g++)f.append(`image-reply-${g}`,s[g],`reply-image-${g}.webp`);l={method:"POST",body:f}}else l={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({threadId:e,reply:t,color:n,provider:a,model:c,sourceId:i,...o,...h})};let p=await u(y,l,3e4);if(!p.ok){let f=await p.text();throw new Error(`Bridge returned ${p.status}: ${f}`)}return p.json()}async function K(e,t=w){let r=await u(`${t}/thread/${encodeURIComponent(e)}/archive`,{method:"POST"},15e3);if(!r.ok&&r.status!==404){let n=await r.text();throw new Error(`Bridge returned ${r.status}: ${n}`)}return r.json()}async function Q(e,t=w){let r=await u(`${t}/thread/${encodeURIComponent(e)}/restore`,{method:"POST"},15e3);if(!r.ok)throw new Error(`Thread restore failed: ${r.status}`)}async function V(e=w){let t=await u(`${e}/workspace/clear`,{method:"POST"},5e3);if(!t.ok){let r=await t.text();throw new Error(`Bridge returned ${t.status}: ${r}`)}return t.json()}export{C as a,I as b,M as c,R as d,A as e,L as f,x as g,J as h,_ as i,m as j,T as k,F as l,G as m,O as n,H as o,E as p,z as q,W as r,K as s,Q as t,V as u};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as Mn}from"./chunk-MP7S5ALD.mjs";import{j as vt,a as V,f as Sn,i as He,g as Tn,h as bt}from"./chunk-XOGBFVWI.mjs";import{u as We,z as je,x as Ye}from"./chunk-VLFWNZFS.mjs";import{a as In,b as kn}from"./chunk-LVEMYZOA.mjs";import{a as Mt,d as ke,v as En,h as Cn,i as St,c as Ee,f as Ce,b as Tt,e as An,g as Rn}from"./chunk-HGW2U6PD.mjs";import{Clock as It,OctagonAlert as Nn,MessageCircleQuestionMark as Ln,TriangleAlert as Dn,Reply as On,Eye as $n,SendHorizontal as Ae,CornerDownLeft as _n}from"lucide-react";import{createContext as qe,useContext as ye,useState as re,useEffect as G,useLayoutEffect as kt,useId as Fn,useRef as le,useMemo as Pn,useCallback as zn,useReducer as Bn,useSyncExternalStore as Hn}from"react";import{jsxs as R,jsx as x,Fragment as W}from"react/jsx-runtime";var Re=new Set,Ne;function Ue(e){if(Re.add(e),!Ne){let t=new Map,o=new Map,i="",n=!0,r=!0,a=!1,l=!0,d=0,u=()=>{let h=new Set,c=new Map,f=y=>{if(h.add(y),!t.has(y)){let m=new MutationObserver(k=>{let w=k.filter(v=>!(v.target.nodeType===1?v.target:v.target.parentElement)?.closest("[data-devtools]"));w.length&&(n=!0),w.some(v=>v.type==="childList")&&(r=!0)});m.observe(y,{subtree:!0,childList:!0,characterData:!0,attributes:!0});let g=()=>{n=!0};y.addEventListener("scroll",g,!0),y.addEventListener("load",g,!0),t.set(y,()=>{m.disconnect(),y.removeEventListener("scroll",g,!0),y.removeEventListener("load",g,!0)})}for(let m of y.querySelectorAll("*")){if(m.shadowRoot&&!m.closest("[data-devtools]")&&f(m.shadowRoot),m.localName!=="iframe"||m.closest("[data-devtools],[data-popmelt-peer-surface]"))continue;let g=Tt(m);c.set(m,g),g&&f(g)}};f(document);for(let[y,m]of t)h.has(y)||(m(),t.delete(y));o=c,r=!1,n=!0},p=()=>{if(!l)return;(r||[...o].some(([f,y])=>Tt(f)!==y))&&u();let h=[];for(let[f,y]of o){let m=f.getBoundingClientRect();h.push(y?.URL,m.x,m.y,m.width,m.height,y?.defaultView?.scrollX,y?.defaultView?.scrollY)}let c=JSON.stringify(h);if((n||c!==i)&&(n=!1,i=c,a))for(let f of Re)f();a=!0,l&&(d=requestAnimationFrame(p))};p(),Ne=()=>{l=!1,cancelAnimationFrame(d);for(let h of t.values())h()}}return()=>{Re.delete(e),Re.size||(Ne?.(),Ne=void 0)}}var Le=qe(!0);function Xe(e,t){let o=e.match(/^oklch\(([^)]+)\)$/i);if(o)return`oklch(${o[1]} / ${t})`;let i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(i){let n=parseInt(i[1],16),r=parseInt(i[2],16),a=parseInt(i[3],16);return`rgba(${n}, ${r}, ${a}, ${t})`}return`color-mix(in srgb, ${e} ${Math.round(t*100)}%, transparent)`}function Et(e,t){let o=Tn(e),i=t.toLowerCase(),n=-1;for(let r=o.length-1;r>=0;r--){let a=o[r].name;if(a===t){let l=bt(o[r].fiber)??e;return{name:t,path:o.map(d=>d.name),depthIndex:r,rootElement:l}}if(n===-1){let l=a.toLowerCase();(l.length>=4&&i.includes(l)||i.length>=4&&l.includes(i))&&(n=r)}}if(n>=0){let r=bt(o[n].fiber)??e;return{name:t,path:o.map(a=>a.name),depthIndex:n,rootElement:r}}return null}function Wn(e){let t=De(),o=[],i=new Set,n=t.currentNode;for(;n=t.nextNode();){let r=Et(n,e);r&&!i.has(r.rootElement)&&(i.add(r.rootElement),o.push(r))}return o}function jn(e){let t=new Map;if(e.size===0)return t;let o=new Set(e),i=De(),n=new Set,r=i.currentNode;for(;(r=i.nextNode())&&o.size>0;)for(let a of o){let l=Et(r,a);if(!l||n.has(l.rootElement))continue;n.add(l.rootElement);let d=l.rootElement.getBoundingClientRect();t.set(a,d.top+window.scrollY),o.delete(a);break}for(let a of o)t.set(a,1/0);return t}function De(){return document.createTreeWalker(document.body,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return e.closest("#devtools-toolbar, #devtools-canvas, #devtools-scrim, [data-popmelt-panel]")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}})}function q(e,t){return e.style.getPropertyValue(t)!==""}function Yn(e,t=30){if(e<=0)return[];let o=[],i=De(),n=.5,r=i.currentNode;for(;(r=i.nextNode())&&o.length<t;){let a=r,l=a.getBoundingClientRect();if(l.bottom<-50||l.top>window.innerHeight+50||l.right<-50||l.left>window.innerWidth+50||l.width<1||l.height<1)continue;let d=getComputedStyle(a);!q(a,"padding-top")&&Math.abs((parseFloat(d.paddingTop)||0)-e)<n&&o.push({element:a,property:"padding-top"}),!q(a,"padding-bottom")&&Math.abs((parseFloat(d.paddingBottom)||0)-e)<n&&o.length<t&&o.push({element:a,property:"padding-bottom"}),!q(a,"padding-left")&&Math.abs((parseFloat(d.paddingLeft)||0)-e)<n&&o.length<t&&o.push({element:a,property:"padding-left"}),!q(a,"padding-right")&&Math.abs((parseFloat(d.paddingRight)||0)-e)<n&&o.length<t&&o.push({element:a,property:"padding-right"}),!q(a,"margin-top")&&Math.abs((parseFloat(d.marginTop)||0)-e)<n&&o.length<t&&o.push({element:a,property:"margin-top"}),!q(a,"margin-bottom")&&Math.abs((parseFloat(d.marginBottom)||0)-e)<n&&o.length<t&&o.push({element:a,property:"margin-bottom"}),!q(a,"margin-left")&&Math.abs((parseFloat(d.marginLeft)||0)-e)<n&&o.length<t&&o.push({element:a,property:"margin-left"}),!q(a,"margin-right")&&Math.abs((parseFloat(d.marginRight)||0)-e)<n&&o.length<t&&o.push({element:a,property:"margin-right"});let u=d.display;if((u.includes("flex")||u.includes("grid"))&&o.length<t){let p=q(a,"gap"),h=parseFloat(d.gap)||0,c=parseFloat(d.rowGap)||0,f=parseFloat(d.columnGap)||0;!p&&Math.abs(h-e)<n?o.push({element:a,property:"gap"}):!q(a,"row-gap")&&Math.abs(c-e)<n?o.push({element:a,property:"row-gap"}):!q(a,"column-gap")&&Math.abs(f-e)<n&&o.push({element:a,property:"column-gap"})}}return o}function qn(e){return typeof e=="string"?{value:e}:e}var Ct={gap:["gap","row-gap","column-gap"],padding:["padding-top","padding-bottom","padding-left","padding-right"],margin:["margin-top","margin-bottom","margin-left","margin-right"]};function At(e,t){let o=Ct[t];return o?o.includes(e):!1}function Un(e,t){let o=e.split(/\s+/);for(let i of o){if(i===t)return!0;let n=i.lastIndexOf(":");if(n>=0&&i.slice(n+1)===t)return!0}return!1}function Xn(e){let t=e.lastIndexOf(":"),o=t>=0?e.slice(t+1):e,i=o.indexOf("-");if(i<0)return null;let n=o.slice(0,i),r={gap:"gap","gap-x":"column-gap","gap-y":"row-gap",p:"padding",pt:"padding-top",pb:"padding-bottom",pl:"padding-left",pr:"padding-right",px:"padding-left",py:"padding-top",m:"margin",mt:"margin-top",mb:"margin-bottom",ml:"margin-left",mr:"margin-right",mx:"margin-left",my:"margin-top"},a=o.slice(0,o.indexOf("-",i+1)>0?o.indexOf("-",i+1):i);return r[a]??r[n]??null}function Kn(e,t=30){let o=parseFloat(e.value);if(isNaN(o)||o<=0)return[];if(e.bindings&&e.bindings.length>0){let n=[],r=De(),a=r.currentNode;for(;(a=r.nextNode())&&n.length<t;){let l=a,d=l.getBoundingClientRect();if(d.bottom<-50||d.top>window.innerHeight+50||d.right<-50||d.left>window.innerWidth+50||d.width<1||d.height<1)continue;let u=l.className;if(typeof u=="string")for(let p of e.bindings){if(!Un(u,p))continue;let h=Xn(p);if(h&&!(e.property&&!At(h,e.property))){n.push({element:l,property:h});break}}}return n}let i=Yn(o,t*2);return e.property?i.filter(n=>At(n.property,e.property)).slice(0,t):i.slice(0,t)}function Vn(e,t){let o=new Set,i=we(t);for(let n of e){let r=Rt[n.property];if(!r)continue;let a=n.element.className;if(typeof a=="string")for(let l of r){let d=`${l}-${i}`;for(let u of a.split(/\s+/)){let p=u.lastIndexOf(":"),h=p>=0?u.slice(p+1):u;if(h===d){o.add(h);break}}}}return[...o]}function Gn(e){let t=new Set;for(let o of e)for(let[i,n]of Object.entries(Ct))if(n.includes(o.property)){t.add(i);break}if(t.size===1)return[...t][0]}function Jn(e,t,o){if(t===o)return e;let i=we(t),n=we(o);return e.map(r=>{let a=r.lastIndexOf("-");if(a<0)return r;let l=r.slice(0,a),d=r.slice(a+1);return d===i||d===`[${t}px]`?`${l}-${n}`:r})}var Qn={0:"0",1:"px",2:"0.5",4:"1",6:"1.5",8:"2",12:"3",16:"4",20:"5",24:"6",28:"7",32:"8",40:"10",48:"12",64:"16",80:"20",96:"24"};function we(e){return Qn[e]??`[${e}px]`}var Rt={"padding-top":["pt","py","p"],"padding-bottom":["pb","py","p"],"padding-left":["pl","px","p"],"padding-right":["pr","px","p"],"margin-top":["mt","my","m"],"margin-bottom":["mb","my","m"],"margin-left":["ml","mx","m"],"margin-right":["mr","mx","m"],gap:["gap"],"row-gap":["gap-y","gap"],"column-gap":["gap-x","gap"]};function Zn(e,t,o,i){let n=Rt[t];if(!n)return null;let r=we(o);for(let a of n){let l=new RegExp("(?:^|\\s)((?:[\\w-]+:)*"+a+"-(?:"+eo(r)+"|\\["+o+"px\\]))(?:\\s|$)"),d=e.match(l);if(d?.[1]){let u=we(i),p=d[1].lastIndexOf(":"),h=p>=0?d[1].slice(0,p+1):"";return{matched:d[1],suggested:`${h}${a}-${u}`}}}return null}function eo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function to(e,t,o){let i=new Set,n=[];for(let r of e){let a=V(r.element),l=`${a}::${r.property}`;if(i.has(l))continue;i.add(l);let d=Sn(r.element),u=r.element.className||"",p=Zn(u,r.property,t,o);n.push({selector:a,reactComponent:d?.name,className:u,property:r.property,matchedClass:p?.matched,suggestedClass:p?.suggested})}return n}function no(e){let t=window.getComputedStyle(e).display;return t==="flex"||t==="inline-flex"||t==="grid"||t==="inline-grid"}function oo(e){let t=window.getComputedStyle(e);return{row:parseFloat(t.rowGap)||0,column:parseFloat(t.columnGap)||0}}function io(e){let t=[];for(let o of e){let i=t.find(n=>n.axis!==o.axis?!1:o.axis==="row"?Math.abs(n.y-o.y)<2&&Math.abs(n.h-o.h)<2:Math.abs(n.x-o.x)<2&&Math.abs(n.w-o.w)<2);if(i)if(o.axis==="row"){let n=Math.min(i.x,o.x),r=Math.max(i.x+i.w,o.x+o.w);i.x=n,i.w=r-n}else{let n=Math.min(i.y,o.y),r=Math.max(i.y+i.h,o.y+o.h);i.y=n,i.h=r-n}else t.push({...o})}return t}function ao(e){let t=Array.from(e.children).filter(l=>{if(!(l instanceof HTMLElement))return!1;let d=window.getComputedStyle(l);return d.display!=="none"&&d.position!=="absolute"&&d.position!=="fixed"});if(t.length<2)return[];let o=[],i=e.getBoundingClientRect(),n=window.getComputedStyle(e).flexDirection,r=n==="column"||n==="column-reverse",a=6;for(let l=0;l<t.length-1;l++){let d=t[l].getBoundingClientRect(),u=t[l+1].getBoundingClientRect();if(u.left>d.right+.5&&o.push({axis:"column",x:d.right,y:i.top,w:u.left-d.right,h:i.height}),u.top>d.bottom+.5&&o.push({axis:"row",x:i.left,y:d.bottom,w:i.width,h:u.top-d.bottom}),!(u.left>d.right+.5)&&!(u.top>d.bottom+.5))if(r){let p=(d.bottom+u.top)/2;o.push({axis:"row",x:i.left,y:p-a/2,w:i.width,h:a})}else{let p=(d.right+u.left)/2;o.push({axis:"column",x:p-a/2,y:i.top,w:a,h:i.height})}}return io(o)}function ro(e,t){let o=window.getComputedStyle(e),i=o.display;if(i!=="flex"&&i!=="inline-flex")return!1;let n=o.justifyContent;if(n!=="space-between"&&n!=="space-around"&&n!=="space-evenly"&&n!=="stretch")return!1;let r=o.flexDirection;return!(t!==(r==="column"||r==="column-reverse"?"row":"column")||parseFloat(t==="row"?o.rowGap:o.columnGap)>0)}function lo(e){let t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function so(e){let t=window.getComputedStyle(e);return{top:parseFloat(t.marginTop)||0,right:parseFloat(t.marginRight)||0,bottom:parseFloat(t.marginBottom)||0,left:parseFloat(t.marginLeft)||0}}function Nt(e){let t=window.getComputedStyle(e);return{topLeft:t.borderTopLeftRadius,topRight:t.borderTopRightRadius,bottomRight:t.borderBottomRightRadius,bottomLeft:t.borderBottomLeftRadius}}function Lt(e){let t=window.getComputedStyle(e);return{"top-left":parseFloat(t.borderTopLeftRadius)||0,"top-right":parseFloat(t.borderTopRightRadius)||0,"bottom-right":parseFloat(t.borderBottomRightRadius)||0,"bottom-left":parseFloat(t.borderBottomLeftRadius)||0}}function uo(e){for(let t of e.childNodes)if(t.nodeType===Node.TEXT_NODE&&(t.textContent||"").trim().length>0)return!0;return!1}function po(e){let t=document.createRange(),o=!1;for(let p of e.childNodes)p.nodeType===Node.TEXT_NODE&&(p.textContent||"").trim().length>0&&(o||(t.setStart(p,0),o=!0),t.setEnd(p,p.textContent?.length??0));if(!o)return null;let i=t.getBoundingClientRect(),n=window.getComputedStyle(e),r=parseFloat(n.fontSize)||16,a=parseFloat(n.lineHeight);isNaN(a)&&(a=r*1.2);let l=Math.max(1,t.getClientRects().length),d=Math.max(i.height,l*a),u=(d-i.height)/2;return new DOMRect(i.x,i.y-u,i.width,d)}function co(e){let t=window.getComputedStyle(e),o=parseFloat(t.fontSize)||16,i=parseFloat(t.lineHeight);return isNaN(i)&&(i=o*1.2),{fontSize:o,lineHeight:i}}function fo(e){let t=e.startsWith("top-");return{top:t?4:12,right:4,bottom:t?12:4,left:4}}function ho({hasCommentEntry:e,stagedChangeCount:t}){return e&&t===0?2:6}function go({annotationNumber:e,stickerCount:t,interactionEpisodeStepCount:o,hasStatus:i,hasSend:n,controlGap:r}){let a=16+Math.max(1,e===void 0?0:String(e).length)*7.2,l=t*28-Math.max(0,t-1)*2,d=o>0?32+String(o).length*7.2:0,u=28,p=t>0?l+(d>0?d-2:0)+(n?u-2:0):0,h=[t>0?p:0,t===0?d:0,t===0&&n?u:0,i?u:0].filter(c=>c>0);return a+h.reduce((c,f)=>c+f,0)+h.length*r}function mo(e,t,o){let i=e.horizontalAlignment==="right"?e.left-t:e.left;return{left:i,top:e.top,right:i+t,bottom:e.top+o}}function yo(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function wo(e,t,o){let i=Math.max(0,e.left+t-o);return Math.max(0,t-e.right)<i?"right":"left"}function Dt(e,t,o,i,n=0,r=Number.POSITIVE_INFINITY){if(e.height>=i)return{anchor:"top-left",horizontalAlignment:"left",left:e.left+8,top:e.top+8};let a=wo(e,n,r);return e.top>=t+o?{anchor:a==="right"?"top-right":"top-left",horizontalAlignment:a,left:a==="right"?e.right:e.left,top:e.top-t-o}:{anchor:a==="right"?"bottom-right":"bottom-left",horizontalAlignment:a,left:a==="right"?e.right:e.left,top:e.bottom+o}}function Ke(e){return e.left+e.width}function Oe(e){return e.top+e.height}function Ve(e,t){if(e.length===0)return t;let o=Math.min(...e.map(a=>a.left)),i=Math.min(...e.map(a=>a.top)),n=Math.max(...e.map(Ke)),r=Math.max(...e.map(Oe));return{left:o,top:i,width:n-o,height:r-i}}function Ge(e){let t=[...e].sort((i,n)=>i.top-n.top||i.left-n.left),o=[];for(let i of t){let n=i.top+i.height/2,r=o.find(p=>{let h=p.top+p.height/2;return Math.abs(n-h)<=Math.max(p.height,i.height)*.4});if(!r){o.push({...i});continue}let a=Math.min(r.left,i.left),l=Math.min(r.top,i.top),d=Math.max(Ke(r),Ke(i)),u=Math.max(Oe(r),Oe(i));r.left=a,r.top=l,r.width=d-a,r.height=u-l}return o.sort((i,n)=>i.top-n.top||i.left-n.left)}function xo({display:e,fragmentRects:t,elementRect:o,parentContentRect:i}){let n=Ge(t),r=Ve(n,o);if(!(e==="inline"&&n.length>1&&i&&i.width>0))return{textRect:r,boundaryRect:o,boundaryRects:[o],firstLineIndent:0};let a=n[0],l={left:i.left,top:a.top,width:i.width,height:Math.max(r.height,Oe(r)-a.top)},d=Math.max(0,Math.min(l.width,a.left-l.left));return{textRect:r,boundaryRect:Ve(n,o),boundaryRects:n,flowRect:l,firstLineIndent:d}}var Je=new WeakMap;function vo(e){let t={listeners:new Set,rafId:null,schedule:()=>{t.rafId===null&&(t.rafId=e.requestAnimationFrame(()=>{t.rafId=null;for(let o of t.listeners)o()}))}};return Je.set(e,t),e.addEventListener("scroll",t.schedule,{passive:!0,capture:!0}),e.addEventListener("resize",t.schedule),t}function Ot(e,t=window){let o=Je.get(t)??vo(t);return o.listeners.add(e),()=>{o.listeners.delete(e)&&(o.listeners.size>0||(t.removeEventListener("scroll",o.schedule,!0),t.removeEventListener("resize",o.schedule),o.rafId!==null&&t.cancelAnimationFrame(o.rafId),Je.delete(t)))}}var de={topLeft:"0px",topRight:"0px",bottomRight:"0px",bottomLeft:"0px"};function $t(e,t){return e.radii.topLeft!==t.radii.topLeft||e.radii.topRight!==t.radii.topRight||e.radii.bottomRight!==t.radii.bottomRight||e.radii.bottomLeft!==t.radii.bottomLeft||e.outline!==t.outline||e.fragments.length!==t.fragments.length?!1:e.fragments.every((o,i)=>{let n=t.fragments[i];return!!n&&o.left===n.left&&o.top===n.top&&o.width===n.width&&o.height===n.height})}function _t(e){if(!e.isConnected||!Cn(e.ownerDocument))return{fragments:[],radii:de};let t=St(ke(e),e.ownerDocument);if(Mt(e.ownerDocument)&&(!t.width||!t.height))return{fragments:[],radii:de};if(e.getAttribute("data-popmelt-subject-projection")==="true")return{fragments:[{left:t.left,top:t.top,width:t.width,height:t.height}],radii:de,outline:e.getAttribute("data-popmelt-subject-outline")??void 0};let o=Array.from(e.getClientRects()).map(i=>St(Ee(i,e.ownerDocument),e.ownerDocument)).filter(i=>i.width>0&&i.height>0).map(i=>({left:i.left,top:i.top,width:i.width,height:i.height}));return{fragments:Ge(o.length>0?o:[{left:t.left,top:t.top,width:t.width,height:t.height}]),radii:Nt(e)}}function Ft({element:e,projectedRect:t,isSelected:o=!1,elementInfo:i,color:n="#3b82f6",annotationNumber:r,changeCount:a,hideTooltip:l=!1,hideOutline:d=!1,hideFill:u=!1,fillOpacity:p=.05,subjectRegistry:h,railGap:c=2,railHeight:f=22,railWidth:y=0,renderRail:m,refreshKey:g,outlineZIndex:k=9996,onActivate:w,onRemove:v}){let S=ye(Le),[b,C]=re({fragments:[],radii:de});G(()=>{if(!S)return;if(!e){C({fragments:[],radii:de});return}let P=null,H=()=>{let ee=_t(e);C(Te=>$t(Te,ee)?Te:ee)},E=()=>{P===null&&(P=requestAnimationFrame(()=>{P=null,H()}))};H();let ce=e.getAttribute("data-popmelt-subject-projection")==="true"&&!!h,fe=ce?h.subscribeFrame(H):void 0,he=ce||typeof ResizeObserver>"u"?null:new ResizeObserver(E);he?.observe(e);let B=ce?null:new MutationObserver(E);B?.observe(e,{attributes:!0,attributeFilter:["style","class"]});let ae=Ot(H,e.ownerDocument.defaultView??window),ge=Mt(e.ownerDocument)?Ue(H):void 0;return()=>{ae(),ge?.(),fe?.(),he?.disconnect(),B?.disconnect(),P!==null&&cancelAnimationFrame(P)}},[S,e,h]),kt(()=>{if(!S||!e||g===void 0)return;let P=_t(e);C(H=>$t(H,P)?H:P)},[S,e,g]);let{fragments:N,radii:z}=t?{fragments:[t],radii:de}:b;if(N.length===0||!e&&!t)return null;let A=Ve(N,N[0]),I=e?.tagName.toLowerCase()??"",K=e?.id?`#${e.id}`:"",oe=e&&e.classList.length>0?"."+Array.from(e.classList).slice(0,2).join("."):"",ie=i?.reactComponent,be=e?.getAttribute("data-popmelt-subject-adapter"),Me=e?.getAttribute("data-popmelt-subject-label"),Pe=be&&Me?`<${Me}>`:ie?`<${ie}> ${I}${K}${oe}`:`${I}${K}${oe}`,Z=Dt({left:A.left,right:A.left+A.width,top:A.top,bottom:A.top+A.height,height:A.height},f,c,window.innerHeight,y,window.innerWidth),Se={zIndex:9997,display:"flex",alignItems:"center",gap:6,backgroundColor:n,color:"#fff",fontSize:12,fontFamily:We,lineHeight:"14px",padding:"4px 8px",borderRadius:8,pointerEvents:"none",whiteSpace:"nowrap",maxWidth:400,position:"fixed",top:Z.top,left:Z.left},ze=!l&&R("div",{ref:P=>{e&&In(e,P)},"data-devtools":"tooltip",style:Se,children:[r!==void 0&&R("span",{children:[r,"."]}),x("span",{style:{overflow:"hidden",textOverflow:"ellipsis",flex:1,minWidth:0},children:Pe}),a!==void 0&&a>0&&R("span",{style:{opacity:.8},children:["(",a," ",a===1?"change":"changes",")"]})]});return R(W,{children:[!d&&N.map((P,H)=>x("div",{"data-devtools":"highlight",onContextMenu:v?E=>{E.preventDefault(),E.stopPropagation(),v()}:void 0,role:w?"button":void 0,tabIndex:w?0:void 0,"aria-label":w?"Open annotation thread":void 0,onPointerDown:w?E=>{E.preventDefault(),E.stopPropagation()}:void 0,onClick:w?E=>{E.preventDefault(),E.stopPropagation(),w()}:void 0,onKeyDown:w?E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),E.stopPropagation(),w())}:void 0,style:{position:"fixed",top:P.top,left:P.left,width:P.width,height:P.height,pointerEvents:w||v?"auto":"none",cursor:w?"pointer":void 0,zIndex:k,overflow:"visible"},children:x("div",{style:b.outline?{position:"absolute",inset:0,pointerEvents:"none"}:{position:"absolute",inset:0,boxSizing:"border-box",backgroundColor:u?"transparent":Xe(n,p),borderColor:n,borderStyle:o?"solid":"dashed",borderWidth:1,borderTopLeftRadius:z.topLeft,borderTopRightRadius:z.topRight,borderBottomRightRadius:z.bottomRight,borderBottomLeftRadius:z.bottomLeft,pointerEvents:"none"},children:b.outline?x("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%",style:{display:"block",overflow:"visible"},"aria-hidden":"true",children:x("polygon",{points:b.outline,fill:u?"transparent":Xe(n,p),stroke:n,strokeWidth:1,strokeDasharray:o?void 0:"4 3",vectorEffect:"non-scaling-stroke"})}):null})},`${P.left}:${P.top}:${H}`)),m?m(Z,A):ze]})}function Pt(e){return e==="bottom-left"?[2,8,8,8]:e==="bottom-right"?[8,2,8,8]:e==="top-right"?[8,8,2,8]:[8,8,8,2]}function bo(e){return Pt(e).map(t=>`${t}px`).join(" ")}var xe=1.1666666666666667,zt=2048;function Qe(e){return e.length>zt?`${e.slice(0,zt)}\u2026`:e}function Mo(e,t,o){let i=Qe(t);if(!i||e.measureText(i).width<=o)return[i];let n=i.split(/\s+/),r=[],a="";for(let l of n){let d=a?`${a} ${l}`:l;a&&e.measureText(d).width>o?(r.push(a),a=l):a=d}return a&&r.push(a),r.length>0?r:[i]}function So(e,t,o){return t.flatMap(i=>Mo(e,i,o))}var ne=We,Ze=400,Bt=16,et=60,To=12,tt=16;function Ht(e){let t=window.innerWidth-e-Bt;return Math.max(et,Math.min(Ze,t))}function nt(e,t,o){let i=Qe(t);if(i===t&&e.measureText(i).width<=o)return i;let n="\u2026",r=0,a=i.endsWith(n)?i.length-1:i.length;for(;r<a;){let l=Math.ceil((r+a)/2);e.measureText(i.slice(0,l)+n).width<=o?r=l:a=l-1}return r>0?i.slice(0,r)+n:n}function Io(e,t,o){if(e===void 0||t===void 0||o.avoidLeft===void 0&&o.avoidRight===void 0)return!0;let i=typeof window<"u"?window.innerWidth:9999,n=o.avoidLeft??0,r=o.avoidRight??i;return e+t>n&&e<r}function Wt(e,t,o,i,n){let r=typeof window<"u"?window.innerHeight:9999,a=0,l=r;o&&Io(i,n,o)&&(a=o.avoidTop??a,l=o.avoidBottom??l);let d=Math.max(a,l-t);return Math.max(a,Math.min(e,d))}function jt(e,t=12,o,i){let n=t*xe+8,r=e.y-4,a=e.x-8,l=Wt(r,n,o,a,i);return l===r?e:{...e,y:l+4}}function ko(e,t,o,i,n=12,r,a,l,d="#dddddd",u,p=!1){if(!o)return;let h=n*xe,c=o.replace(/\n/g," "),f=r!==void 0?r+". "+c:c;e.font=`${n}px ${ne}`,e.textBaseline="middle";let y=a!==void 0?Math.min(Ze,Math.max(et,window.innerWidth-a-Bt)):Ze,m=p?tt:0,g=nt(e,f,Math.max(et,y-m)),k=e.measureText(g).width,w=m+k,v=jt(t,n,l,w+16);e.fillStyle=i;let S=v.x-8,b=v.y-4,C=w+16,N=h+8;e.beginPath(),e.roundRect(S,b,C,N,Pt(u)),e.fill();let z=v.y+h/2;if(p){let A=v.x,I=z-To/2;e.strokeStyle=d,e.lineWidth=1.5,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.moveTo(A+7.5,I+4),e.lineTo(A+10.5,I+6.5),e.lineTo(A+7.5,I+9),e.moveTo(A+1.5,I+1.5),e.lineTo(A+1.5,I+4.5),e.quadraticCurveTo(A+1.5,I+6.5,A+3.5,I+6.5),e.lineTo(A+10.5,I+6.5),e.stroke()}e.fillStyle=d,e.fillText(g,v.x+m,z)}function Eo(e,t,o){let i=e.filter(n=>!n.captured&&n.selector===t&&(!n.pathname||n.pathname===o));return i.length?{type:"MODIFY_TEXT_CONTENTS",payload:i.map(n=>({...n,modified:n.original}))}:null}function Yt(e,t){return e.type!=="text"?!1:(e.groupId?t.filter(o=>o.groupId===e.groupId):[e]).every(o=>(o.status??"pending")==="pending"&&!o.threadId)}var qt=qe(0),ot=`
|
|
2
|
+
import{a as Mn}from"./chunk-MP7S5ALD.mjs";import{j as vt,a as V,f as Sn,i as He,g as Tn,h as bt}from"./chunk-XOGBFVWI.mjs";import{b as We,g as je,e as Ye}from"./chunk-2RRYBN2J.mjs";import{a as In,b as kn}from"./chunk-LVEMYZOA.mjs";import{a as Mt,d as ke,v as En,h as Cn,i as St,c as Ee,f as Ce,b as Tt,e as An,g as Rn}from"./chunk-HGW2U6PD.mjs";import{Clock as It,OctagonAlert as Nn,MessageCircleQuestionMark as Ln,TriangleAlert as Dn,Reply as On,Eye as $n,SendHorizontal as Ae,CornerDownLeft as _n}from"lucide-react";import{createContext as qe,useContext as ye,useState as re,useEffect as G,useLayoutEffect as kt,useId as Fn,useRef as le,useMemo as Pn,useCallback as zn,useReducer as Bn,useSyncExternalStore as Hn}from"react";import{jsxs as R,jsx as x,Fragment as W}from"react/jsx-runtime";var Re=new Set,Ne;function Ue(e){if(Re.add(e),!Ne){let t=new Map,o=new Map,i="",n=!0,r=!0,a=!1,l=!0,d=0,u=()=>{let h=new Set,c=new Map,f=y=>{if(h.add(y),!t.has(y)){let m=new MutationObserver(k=>{let w=k.filter(v=>!(v.target.nodeType===1?v.target:v.target.parentElement)?.closest("[data-devtools]"));w.length&&(n=!0),w.some(v=>v.type==="childList")&&(r=!0)});m.observe(y,{subtree:!0,childList:!0,characterData:!0,attributes:!0});let g=()=>{n=!0};y.addEventListener("scroll",g,!0),y.addEventListener("load",g,!0),t.set(y,()=>{m.disconnect(),y.removeEventListener("scroll",g,!0),y.removeEventListener("load",g,!0)})}for(let m of y.querySelectorAll("*")){if(m.shadowRoot&&!m.closest("[data-devtools]")&&f(m.shadowRoot),m.localName!=="iframe"||m.closest("[data-devtools],[data-popmelt-peer-surface]"))continue;let g=Tt(m);c.set(m,g),g&&f(g)}};f(document);for(let[y,m]of t)h.has(y)||(m(),t.delete(y));o=c,r=!1,n=!0},p=()=>{if(!l)return;(r||[...o].some(([f,y])=>Tt(f)!==y))&&u();let h=[];for(let[f,y]of o){let m=f.getBoundingClientRect();h.push(y?.URL,m.x,m.y,m.width,m.height,y?.defaultView?.scrollX,y?.defaultView?.scrollY)}let c=JSON.stringify(h);if((n||c!==i)&&(n=!1,i=c,a))for(let f of Re)f();a=!0,l&&(d=requestAnimationFrame(p))};p(),Ne=()=>{l=!1,cancelAnimationFrame(d);for(let h of t.values())h()}}return()=>{Re.delete(e),Re.size||(Ne?.(),Ne=void 0)}}var Le=qe(!0);function Xe(e,t){let o=e.match(/^oklch\(([^)]+)\)$/i);if(o)return`oklch(${o[1]} / ${t})`;let i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(i){let n=parseInt(i[1],16),r=parseInt(i[2],16),a=parseInt(i[3],16);return`rgba(${n}, ${r}, ${a}, ${t})`}return`color-mix(in srgb, ${e} ${Math.round(t*100)}%, transparent)`}function Et(e,t){let o=Tn(e),i=t.toLowerCase(),n=-1;for(let r=o.length-1;r>=0;r--){let a=o[r].name;if(a===t){let l=bt(o[r].fiber)??e;return{name:t,path:o.map(d=>d.name),depthIndex:r,rootElement:l}}if(n===-1){let l=a.toLowerCase();(l.length>=4&&i.includes(l)||i.length>=4&&l.includes(i))&&(n=r)}}if(n>=0){let r=bt(o[n].fiber)??e;return{name:t,path:o.map(a=>a.name),depthIndex:n,rootElement:r}}return null}function Wn(e){let t=De(),o=[],i=new Set,n=t.currentNode;for(;n=t.nextNode();){let r=Et(n,e);r&&!i.has(r.rootElement)&&(i.add(r.rootElement),o.push(r))}return o}function jn(e){let t=new Map;if(e.size===0)return t;let o=new Set(e),i=De(),n=new Set,r=i.currentNode;for(;(r=i.nextNode())&&o.size>0;)for(let a of o){let l=Et(r,a);if(!l||n.has(l.rootElement))continue;n.add(l.rootElement);let d=l.rootElement.getBoundingClientRect();t.set(a,d.top+window.scrollY),o.delete(a);break}for(let a of o)t.set(a,1/0);return t}function De(){return document.createTreeWalker(document.body,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return e.closest("#devtools-toolbar, #devtools-canvas, #devtools-scrim, [data-popmelt-panel]")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}})}function q(e,t){return e.style.getPropertyValue(t)!==""}function Yn(e,t=30){if(e<=0)return[];let o=[],i=De(),n=.5,r=i.currentNode;for(;(r=i.nextNode())&&o.length<t;){let a=r,l=a.getBoundingClientRect();if(l.bottom<-50||l.top>window.innerHeight+50||l.right<-50||l.left>window.innerWidth+50||l.width<1||l.height<1)continue;let d=getComputedStyle(a);!q(a,"padding-top")&&Math.abs((parseFloat(d.paddingTop)||0)-e)<n&&o.push({element:a,property:"padding-top"}),!q(a,"padding-bottom")&&Math.abs((parseFloat(d.paddingBottom)||0)-e)<n&&o.length<t&&o.push({element:a,property:"padding-bottom"}),!q(a,"padding-left")&&Math.abs((parseFloat(d.paddingLeft)||0)-e)<n&&o.length<t&&o.push({element:a,property:"padding-left"}),!q(a,"padding-right")&&Math.abs((parseFloat(d.paddingRight)||0)-e)<n&&o.length<t&&o.push({element:a,property:"padding-right"}),!q(a,"margin-top")&&Math.abs((parseFloat(d.marginTop)||0)-e)<n&&o.length<t&&o.push({element:a,property:"margin-top"}),!q(a,"margin-bottom")&&Math.abs((parseFloat(d.marginBottom)||0)-e)<n&&o.length<t&&o.push({element:a,property:"margin-bottom"}),!q(a,"margin-left")&&Math.abs((parseFloat(d.marginLeft)||0)-e)<n&&o.length<t&&o.push({element:a,property:"margin-left"}),!q(a,"margin-right")&&Math.abs((parseFloat(d.marginRight)||0)-e)<n&&o.length<t&&o.push({element:a,property:"margin-right"});let u=d.display;if((u.includes("flex")||u.includes("grid"))&&o.length<t){let p=q(a,"gap"),h=parseFloat(d.gap)||0,c=parseFloat(d.rowGap)||0,f=parseFloat(d.columnGap)||0;!p&&Math.abs(h-e)<n?o.push({element:a,property:"gap"}):!q(a,"row-gap")&&Math.abs(c-e)<n?o.push({element:a,property:"row-gap"}):!q(a,"column-gap")&&Math.abs(f-e)<n&&o.push({element:a,property:"column-gap"})}}return o}function qn(e){return typeof e=="string"?{value:e}:e}var Ct={gap:["gap","row-gap","column-gap"],padding:["padding-top","padding-bottom","padding-left","padding-right"],margin:["margin-top","margin-bottom","margin-left","margin-right"]};function At(e,t){let o=Ct[t];return o?o.includes(e):!1}function Un(e,t){let o=e.split(/\s+/);for(let i of o){if(i===t)return!0;let n=i.lastIndexOf(":");if(n>=0&&i.slice(n+1)===t)return!0}return!1}function Xn(e){let t=e.lastIndexOf(":"),o=t>=0?e.slice(t+1):e,i=o.indexOf("-");if(i<0)return null;let n=o.slice(0,i),r={gap:"gap","gap-x":"column-gap","gap-y":"row-gap",p:"padding",pt:"padding-top",pb:"padding-bottom",pl:"padding-left",pr:"padding-right",px:"padding-left",py:"padding-top",m:"margin",mt:"margin-top",mb:"margin-bottom",ml:"margin-left",mr:"margin-right",mx:"margin-left",my:"margin-top"},a=o.slice(0,o.indexOf("-",i+1)>0?o.indexOf("-",i+1):i);return r[a]??r[n]??null}function Kn(e,t=30){let o=parseFloat(e.value);if(isNaN(o)||o<=0)return[];if(e.bindings&&e.bindings.length>0){let n=[],r=De(),a=r.currentNode;for(;(a=r.nextNode())&&n.length<t;){let l=a,d=l.getBoundingClientRect();if(d.bottom<-50||d.top>window.innerHeight+50||d.right<-50||d.left>window.innerWidth+50||d.width<1||d.height<1)continue;let u=l.className;if(typeof u=="string")for(let p of e.bindings){if(!Un(u,p))continue;let h=Xn(p);if(h&&!(e.property&&!At(h,e.property))){n.push({element:l,property:h});break}}}return n}let i=Yn(o,t*2);return e.property?i.filter(n=>At(n.property,e.property)).slice(0,t):i.slice(0,t)}function Vn(e,t){let o=new Set,i=we(t);for(let n of e){let r=Rt[n.property];if(!r)continue;let a=n.element.className;if(typeof a=="string")for(let l of r){let d=`${l}-${i}`;for(let u of a.split(/\s+/)){let p=u.lastIndexOf(":"),h=p>=0?u.slice(p+1):u;if(h===d){o.add(h);break}}}}return[...o]}function Gn(e){let t=new Set;for(let o of e)for(let[i,n]of Object.entries(Ct))if(n.includes(o.property)){t.add(i);break}if(t.size===1)return[...t][0]}function Jn(e,t,o){if(t===o)return e;let i=we(t),n=we(o);return e.map(r=>{let a=r.lastIndexOf("-");if(a<0)return r;let l=r.slice(0,a),d=r.slice(a+1);return d===i||d===`[${t}px]`?`${l}-${n}`:r})}var Qn={0:"0",1:"px",2:"0.5",4:"1",6:"1.5",8:"2",12:"3",16:"4",20:"5",24:"6",28:"7",32:"8",40:"10",48:"12",64:"16",80:"20",96:"24"};function we(e){return Qn[e]??`[${e}px]`}var Rt={"padding-top":["pt","py","p"],"padding-bottom":["pb","py","p"],"padding-left":["pl","px","p"],"padding-right":["pr","px","p"],"margin-top":["mt","my","m"],"margin-bottom":["mb","my","m"],"margin-left":["ml","mx","m"],"margin-right":["mr","mx","m"],gap:["gap"],"row-gap":["gap-y","gap"],"column-gap":["gap-x","gap"]};function Zn(e,t,o,i){let n=Rt[t];if(!n)return null;let r=we(o);for(let a of n){let l=new RegExp("(?:^|\\s)((?:[\\w-]+:)*"+a+"-(?:"+eo(r)+"|\\["+o+"px\\]))(?:\\s|$)"),d=e.match(l);if(d?.[1]){let u=we(i),p=d[1].lastIndexOf(":"),h=p>=0?d[1].slice(0,p+1):"";return{matched:d[1],suggested:`${h}${a}-${u}`}}}return null}function eo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function to(e,t,o){let i=new Set,n=[];for(let r of e){let a=V(r.element),l=`${a}::${r.property}`;if(i.has(l))continue;i.add(l);let d=Sn(r.element),u=r.element.className||"",p=Zn(u,r.property,t,o);n.push({selector:a,reactComponent:d?.name,className:u,property:r.property,matchedClass:p?.matched,suggestedClass:p?.suggested})}return n}function no(e){let t=window.getComputedStyle(e).display;return t==="flex"||t==="inline-flex"||t==="grid"||t==="inline-grid"}function oo(e){let t=window.getComputedStyle(e);return{row:parseFloat(t.rowGap)||0,column:parseFloat(t.columnGap)||0}}function io(e){let t=[];for(let o of e){let i=t.find(n=>n.axis!==o.axis?!1:o.axis==="row"?Math.abs(n.y-o.y)<2&&Math.abs(n.h-o.h)<2:Math.abs(n.x-o.x)<2&&Math.abs(n.w-o.w)<2);if(i)if(o.axis==="row"){let n=Math.min(i.x,o.x),r=Math.max(i.x+i.w,o.x+o.w);i.x=n,i.w=r-n}else{let n=Math.min(i.y,o.y),r=Math.max(i.y+i.h,o.y+o.h);i.y=n,i.h=r-n}else t.push({...o})}return t}function ao(e){let t=Array.from(e.children).filter(l=>{if(!(l instanceof HTMLElement))return!1;let d=window.getComputedStyle(l);return d.display!=="none"&&d.position!=="absolute"&&d.position!=="fixed"});if(t.length<2)return[];let o=[],i=e.getBoundingClientRect(),n=window.getComputedStyle(e).flexDirection,r=n==="column"||n==="column-reverse",a=6;for(let l=0;l<t.length-1;l++){let d=t[l].getBoundingClientRect(),u=t[l+1].getBoundingClientRect();if(u.left>d.right+.5&&o.push({axis:"column",x:d.right,y:i.top,w:u.left-d.right,h:i.height}),u.top>d.bottom+.5&&o.push({axis:"row",x:i.left,y:d.bottom,w:i.width,h:u.top-d.bottom}),!(u.left>d.right+.5)&&!(u.top>d.bottom+.5))if(r){let p=(d.bottom+u.top)/2;o.push({axis:"row",x:i.left,y:p-a/2,w:i.width,h:a})}else{let p=(d.right+u.left)/2;o.push({axis:"column",x:p-a/2,y:i.top,w:a,h:i.height})}}return io(o)}function ro(e,t){let o=window.getComputedStyle(e),i=o.display;if(i!=="flex"&&i!=="inline-flex")return!1;let n=o.justifyContent;if(n!=="space-between"&&n!=="space-around"&&n!=="space-evenly"&&n!=="stretch")return!1;let r=o.flexDirection;return!(t!==(r==="column"||r==="column-reverse"?"row":"column")||parseFloat(t==="row"?o.rowGap:o.columnGap)>0)}function lo(e){let t=window.getComputedStyle(e);return{top:parseFloat(t.paddingTop)||0,right:parseFloat(t.paddingRight)||0,bottom:parseFloat(t.paddingBottom)||0,left:parseFloat(t.paddingLeft)||0}}function so(e){let t=window.getComputedStyle(e);return{top:parseFloat(t.marginTop)||0,right:parseFloat(t.marginRight)||0,bottom:parseFloat(t.marginBottom)||0,left:parseFloat(t.marginLeft)||0}}function Nt(e){let t=window.getComputedStyle(e);return{topLeft:t.borderTopLeftRadius,topRight:t.borderTopRightRadius,bottomRight:t.borderBottomRightRadius,bottomLeft:t.borderBottomLeftRadius}}function Lt(e){let t=window.getComputedStyle(e);return{"top-left":parseFloat(t.borderTopLeftRadius)||0,"top-right":parseFloat(t.borderTopRightRadius)||0,"bottom-right":parseFloat(t.borderBottomRightRadius)||0,"bottom-left":parseFloat(t.borderBottomLeftRadius)||0}}function uo(e){for(let t of e.childNodes)if(t.nodeType===Node.TEXT_NODE&&(t.textContent||"").trim().length>0)return!0;return!1}function po(e){let t=document.createRange(),o=!1;for(let p of e.childNodes)p.nodeType===Node.TEXT_NODE&&(p.textContent||"").trim().length>0&&(o||(t.setStart(p,0),o=!0),t.setEnd(p,p.textContent?.length??0));if(!o)return null;let i=t.getBoundingClientRect(),n=window.getComputedStyle(e),r=parseFloat(n.fontSize)||16,a=parseFloat(n.lineHeight);isNaN(a)&&(a=r*1.2);let l=Math.max(1,t.getClientRects().length),d=Math.max(i.height,l*a),u=(d-i.height)/2;return new DOMRect(i.x,i.y-u,i.width,d)}function co(e){let t=window.getComputedStyle(e),o=parseFloat(t.fontSize)||16,i=parseFloat(t.lineHeight);return isNaN(i)&&(i=o*1.2),{fontSize:o,lineHeight:i}}function fo(e){let t=e.startsWith("top-");return{top:t?4:12,right:4,bottom:t?12:4,left:4}}function ho({hasCommentEntry:e,stagedChangeCount:t}){return e&&t===0?2:6}function go({annotationNumber:e,stickerCount:t,interactionEpisodeStepCount:o,hasStatus:i,hasSend:n,controlGap:r}){let a=16+Math.max(1,e===void 0?0:String(e).length)*7.2,l=t*28-Math.max(0,t-1)*2,d=o>0?32+String(o).length*7.2:0,u=28,p=t>0?l+(d>0?d-2:0)+(n?u-2:0):0,h=[t>0?p:0,t===0?d:0,t===0&&n?u:0,i?u:0].filter(c=>c>0);return a+h.reduce((c,f)=>c+f,0)+h.length*r}function mo(e,t,o){let i=e.horizontalAlignment==="right"?e.left-t:e.left;return{left:i,top:e.top,right:i+t,bottom:e.top+o}}function yo(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function wo(e,t,o){let i=Math.max(0,e.left+t-o);return Math.max(0,t-e.right)<i?"right":"left"}function Dt(e,t,o,i,n=0,r=Number.POSITIVE_INFINITY){if(e.height>=i)return{anchor:"top-left",horizontalAlignment:"left",left:e.left+8,top:e.top+8};let a=wo(e,n,r);return e.top>=t+o?{anchor:a==="right"?"top-right":"top-left",horizontalAlignment:a,left:a==="right"?e.right:e.left,top:e.top-t-o}:{anchor:a==="right"?"bottom-right":"bottom-left",horizontalAlignment:a,left:a==="right"?e.right:e.left,top:e.bottom+o}}function Ke(e){return e.left+e.width}function Oe(e){return e.top+e.height}function Ve(e,t){if(e.length===0)return t;let o=Math.min(...e.map(a=>a.left)),i=Math.min(...e.map(a=>a.top)),n=Math.max(...e.map(Ke)),r=Math.max(...e.map(Oe));return{left:o,top:i,width:n-o,height:r-i}}function Ge(e){let t=[...e].sort((i,n)=>i.top-n.top||i.left-n.left),o=[];for(let i of t){let n=i.top+i.height/2,r=o.find(p=>{let h=p.top+p.height/2;return Math.abs(n-h)<=Math.max(p.height,i.height)*.4});if(!r){o.push({...i});continue}let a=Math.min(r.left,i.left),l=Math.min(r.top,i.top),d=Math.max(Ke(r),Ke(i)),u=Math.max(Oe(r),Oe(i));r.left=a,r.top=l,r.width=d-a,r.height=u-l}return o.sort((i,n)=>i.top-n.top||i.left-n.left)}function xo({display:e,fragmentRects:t,elementRect:o,parentContentRect:i}){let n=Ge(t),r=Ve(n,o);if(!(e==="inline"&&n.length>1&&i&&i.width>0))return{textRect:r,boundaryRect:o,boundaryRects:[o],firstLineIndent:0};let a=n[0],l={left:i.left,top:a.top,width:i.width,height:Math.max(r.height,Oe(r)-a.top)},d=Math.max(0,Math.min(l.width,a.left-l.left));return{textRect:r,boundaryRect:Ve(n,o),boundaryRects:n,flowRect:l,firstLineIndent:d}}var Je=new WeakMap;function vo(e){let t={listeners:new Set,rafId:null,schedule:()=>{t.rafId===null&&(t.rafId=e.requestAnimationFrame(()=>{t.rafId=null;for(let o of t.listeners)o()}))}};return Je.set(e,t),e.addEventListener("scroll",t.schedule,{passive:!0,capture:!0}),e.addEventListener("resize",t.schedule),t}function Ot(e,t=window){let o=Je.get(t)??vo(t);return o.listeners.add(e),()=>{o.listeners.delete(e)&&(o.listeners.size>0||(t.removeEventListener("scroll",o.schedule,!0),t.removeEventListener("resize",o.schedule),o.rafId!==null&&t.cancelAnimationFrame(o.rafId),Je.delete(t)))}}var de={topLeft:"0px",topRight:"0px",bottomRight:"0px",bottomLeft:"0px"};function $t(e,t){return e.radii.topLeft!==t.radii.topLeft||e.radii.topRight!==t.radii.topRight||e.radii.bottomRight!==t.radii.bottomRight||e.radii.bottomLeft!==t.radii.bottomLeft||e.outline!==t.outline||e.fragments.length!==t.fragments.length?!1:e.fragments.every((o,i)=>{let n=t.fragments[i];return!!n&&o.left===n.left&&o.top===n.top&&o.width===n.width&&o.height===n.height})}function _t(e){if(!e.isConnected||!Cn(e.ownerDocument))return{fragments:[],radii:de};let t=St(ke(e),e.ownerDocument);if(Mt(e.ownerDocument)&&(!t.width||!t.height))return{fragments:[],radii:de};if(e.getAttribute("data-popmelt-subject-projection")==="true")return{fragments:[{left:t.left,top:t.top,width:t.width,height:t.height}],radii:de,outline:e.getAttribute("data-popmelt-subject-outline")??void 0};let o=Array.from(e.getClientRects()).map(i=>St(Ee(i,e.ownerDocument),e.ownerDocument)).filter(i=>i.width>0&&i.height>0).map(i=>({left:i.left,top:i.top,width:i.width,height:i.height}));return{fragments:Ge(o.length>0?o:[{left:t.left,top:t.top,width:t.width,height:t.height}]),radii:Nt(e)}}function Ft({element:e,projectedRect:t,isSelected:o=!1,elementInfo:i,color:n="#3b82f6",annotationNumber:r,changeCount:a,hideTooltip:l=!1,hideOutline:d=!1,hideFill:u=!1,fillOpacity:p=.05,subjectRegistry:h,railGap:c=2,railHeight:f=22,railWidth:y=0,renderRail:m,refreshKey:g,outlineZIndex:k=9996,onActivate:w,onRemove:v}){let S=ye(Le),[b,C]=re({fragments:[],radii:de});G(()=>{if(!S)return;if(!e){C({fragments:[],radii:de});return}let P=null,H=()=>{let ee=_t(e);C(Te=>$t(Te,ee)?Te:ee)},E=()=>{P===null&&(P=requestAnimationFrame(()=>{P=null,H()}))};H();let ce=e.getAttribute("data-popmelt-subject-projection")==="true"&&!!h,fe=ce?h.subscribeFrame(H):void 0,he=ce||typeof ResizeObserver>"u"?null:new ResizeObserver(E);he?.observe(e);let B=ce?null:new MutationObserver(E);B?.observe(e,{attributes:!0,attributeFilter:["style","class"]});let ae=Ot(H,e.ownerDocument.defaultView??window),ge=Mt(e.ownerDocument)?Ue(H):void 0;return()=>{ae(),ge?.(),fe?.(),he?.disconnect(),B?.disconnect(),P!==null&&cancelAnimationFrame(P)}},[S,e,h]),kt(()=>{if(!S||!e||g===void 0)return;let P=_t(e);C(H=>$t(H,P)?H:P)},[S,e,g]);let{fragments:N,radii:z}=t?{fragments:[t],radii:de}:b;if(N.length===0||!e&&!t)return null;let A=Ve(N,N[0]),I=e?.tagName.toLowerCase()??"",K=e?.id?`#${e.id}`:"",oe=e&&e.classList.length>0?"."+Array.from(e.classList).slice(0,2).join("."):"",ie=i?.reactComponent,be=e?.getAttribute("data-popmelt-subject-adapter"),Me=e?.getAttribute("data-popmelt-subject-label"),Pe=be&&Me?`<${Me}>`:ie?`<${ie}> ${I}${K}${oe}`:`${I}${K}${oe}`,Z=Dt({left:A.left,right:A.left+A.width,top:A.top,bottom:A.top+A.height,height:A.height},f,c,window.innerHeight,y,window.innerWidth),Se={zIndex:9997,display:"flex",alignItems:"center",gap:6,backgroundColor:n,color:"#fff",fontSize:12,fontFamily:We,lineHeight:"14px",padding:"4px 8px",borderRadius:8,pointerEvents:"none",whiteSpace:"nowrap",maxWidth:400,position:"fixed",top:Z.top,left:Z.left},ze=!l&&R("div",{ref:P=>{e&&In(e,P)},"data-devtools":"tooltip",style:Se,children:[r!==void 0&&R("span",{children:[r,"."]}),x("span",{style:{overflow:"hidden",textOverflow:"ellipsis",flex:1,minWidth:0},children:Pe}),a!==void 0&&a>0&&R("span",{style:{opacity:.8},children:["(",a," ",a===1?"change":"changes",")"]})]});return R(W,{children:[!d&&N.map((P,H)=>x("div",{"data-devtools":"highlight",onContextMenu:v?E=>{E.preventDefault(),E.stopPropagation(),v()}:void 0,role:w?"button":void 0,tabIndex:w?0:void 0,"aria-label":w?"Open annotation thread":void 0,onPointerDown:w?E=>{E.preventDefault(),E.stopPropagation()}:void 0,onClick:w?E=>{E.preventDefault(),E.stopPropagation(),w()}:void 0,onKeyDown:w?E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),E.stopPropagation(),w())}:void 0,style:{position:"fixed",top:P.top,left:P.left,width:P.width,height:P.height,pointerEvents:w||v?"auto":"none",cursor:w?"pointer":void 0,zIndex:k,overflow:"visible"},children:x("div",{style:b.outline?{position:"absolute",inset:0,pointerEvents:"none"}:{position:"absolute",inset:0,boxSizing:"border-box",backgroundColor:u?"transparent":Xe(n,p),borderColor:n,borderStyle:o?"solid":"dashed",borderWidth:1,borderTopLeftRadius:z.topLeft,borderTopRightRadius:z.topRight,borderBottomRightRadius:z.bottomRight,borderBottomLeftRadius:z.bottomLeft,pointerEvents:"none"},children:b.outline?x("svg",{viewBox:"0 0 1 1",preserveAspectRatio:"none",width:"100%",height:"100%",style:{display:"block",overflow:"visible"},"aria-hidden":"true",children:x("polygon",{points:b.outline,fill:u?"transparent":Xe(n,p),stroke:n,strokeWidth:1,strokeDasharray:o?void 0:"4 3",vectorEffect:"non-scaling-stroke"})}):null})},`${P.left}:${P.top}:${H}`)),m?m(Z,A):ze]})}function Pt(e){return e==="bottom-left"?[2,8,8,8]:e==="bottom-right"?[8,2,8,8]:e==="top-right"?[8,8,2,8]:[8,8,8,2]}function bo(e){return Pt(e).map(t=>`${t}px`).join(" ")}var xe=1.1666666666666667,zt=2048;function Qe(e){return e.length>zt?`${e.slice(0,zt)}\u2026`:e}function Mo(e,t,o){let i=Qe(t);if(!i||e.measureText(i).width<=o)return[i];let n=i.split(/\s+/),r=[],a="";for(let l of n){let d=a?`${a} ${l}`:l;a&&e.measureText(d).width>o?(r.push(a),a=l):a=d}return a&&r.push(a),r.length>0?r:[i]}function So(e,t,o){return t.flatMap(i=>Mo(e,i,o))}var ne=We,Ze=400,Bt=16,et=60,To=12,tt=16;function Ht(e){let t=window.innerWidth-e-Bt;return Math.max(et,Math.min(Ze,t))}function nt(e,t,o){let i=Qe(t);if(i===t&&e.measureText(i).width<=o)return i;let n="\u2026",r=0,a=i.endsWith(n)?i.length-1:i.length;for(;r<a;){let l=Math.ceil((r+a)/2);e.measureText(i.slice(0,l)+n).width<=o?r=l:a=l-1}return r>0?i.slice(0,r)+n:n}function Io(e,t,o){if(e===void 0||t===void 0||o.avoidLeft===void 0&&o.avoidRight===void 0)return!0;let i=typeof window<"u"?window.innerWidth:9999,n=o.avoidLeft??0,r=o.avoidRight??i;return e+t>n&&e<r}function Wt(e,t,o,i,n){let r=typeof window<"u"?window.innerHeight:9999,a=0,l=r;o&&Io(i,n,o)&&(a=o.avoidTop??a,l=o.avoidBottom??l);let d=Math.max(a,l-t);return Math.max(a,Math.min(e,d))}function jt(e,t=12,o,i){let n=t*xe+8,r=e.y-4,a=e.x-8,l=Wt(r,n,o,a,i);return l===r?e:{...e,y:l+4}}function ko(e,t,o,i,n=12,r,a,l,d="#dddddd",u,p=!1){if(!o)return;let h=n*xe,c=o.replace(/\n/g," "),f=r!==void 0?r+". "+c:c;e.font=`${n}px ${ne}`,e.textBaseline="middle";let y=a!==void 0?Math.min(Ze,Math.max(et,window.innerWidth-a-Bt)):Ze,m=p?tt:0,g=nt(e,f,Math.max(et,y-m)),k=e.measureText(g).width,w=m+k,v=jt(t,n,l,w+16);e.fillStyle=i;let S=v.x-8,b=v.y-4,C=w+16,N=h+8;e.beginPath(),e.roundRect(S,b,C,N,Pt(u)),e.fill();let z=v.y+h/2;if(p){let A=v.x,I=z-To/2;e.strokeStyle=d,e.lineWidth=1.5,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.moveTo(A+7.5,I+4),e.lineTo(A+10.5,I+6.5),e.lineTo(A+7.5,I+9),e.moveTo(A+1.5,I+1.5),e.lineTo(A+1.5,I+4.5),e.quadraticCurveTo(A+1.5,I+6.5,A+3.5,I+6.5),e.lineTo(A+10.5,I+6.5),e.stroke()}e.fillStyle=d,e.fillText(g,v.x+m,z)}function Eo(e,t,o){let i=e.filter(n=>!n.captured&&n.selector===t&&(!n.pathname||n.pathname===o));return i.length?{type:"MODIFY_TEXT_CONTENTS",payload:i.map(n=>({...n,modified:n.original}))}:null}function Yt(e,t){return e.type!=="text"?!1:(e.groupId?t.filter(o=>o.groupId===e.groupId):[e]).every(o=>(o.status??"pending")==="pending"&&!o.threadId)}var qt=qe(0),ot=`
|
|
3
3
|
0%, 100% { translate: 0 0; }
|
|
4
4
|
20% { translate: -4px 0; }
|
|
5
5
|
45% { translate: 4px 0; }
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{A as p}from"./chunk-
|
|
2
|
+
import{A as p}from"./chunk-ENGMQINZ.mjs";import{j as m}from"./chunk-XOGBFVWI.mjs";var o=!1,f=()=>o;function E(c){o=!0;let t=null,r=!1,a=e=>{let n=e.composedPath()[0];return n instanceof Element&&(n.id==="devtools-canvas"||!p(n)&&!n.closest("[data-taste-editor], [data-taste-navigation]"))},i=e=>{e.preventDefault(),e.stopImmediatePropagation()},l=e=>{t=null,!(e.button!==0||!a(e))&&(t={x:e.clientX,y:e.clientY},r=!1,i(e))},d=e=>{t&&Math.hypot(e.clientX-t.x,e.clientY-t.y)>5&&(r=!0)},u=e=>{t&&i(e)},s=e=>{if(!a(e)||e.button!==0){t=null;return}i(e);let n=!!(t&&!r);if(t=null,!n)return;let w=m(e.clientX,e.clientY);w&&c(w)},v=()=>{t=null};return window.addEventListener("pointerdown",l,!0),window.addEventListener("pointermove",d,!0),window.addEventListener("pointerup",u,!0),window.addEventListener("pointercancel",v,!0),window.addEventListener("click",s,!0),()=>{o=!1,window.removeEventListener("pointerdown",l,!0),window.removeEventListener("pointermove",d,!0),window.removeEventListener("pointerup",u,!0),window.removeEventListener("pointercancel",v,!0),window.removeEventListener("click",s,!0)}}export{f as a,E as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{a as d,e}from"./chunk-2RRYBN2J.mjs";var p={gap:16,padding:12,radius:20,width:360,viewportGutter:32,identitySize:24},s={gap:6,padding:"4px 8px",radius:8,iconSize:12},a={gap:3,padding:"2px 6px",radius:8,iconSize:12},n={gap:3,padding:"3px 9px 3px 6px",radius:8,iconSize:10},o=n,t={size:21,padding:3,radius:8,iconSize:15},g={padding:"0 4px",height:18,radius:6},r={fontFamily:d,fontSize:12,fontWeight:500,lineHeight:1.3};function u(i){return{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:a.gap,padding:a.padding,borderRadius:a.radius,border:0,flexShrink:0,background:e[i].control,color:e[i].primary,...r,whiteSpace:"nowrap",cursor:"pointer",transition:"box-shadow 120ms ease"}}export{p as a,s as b,a as c,n as d,o as e,t as f,g,r as h,u as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o,b as d,c as l,d as s}from"./chunk-
|
|
1
|
+
import{a as o,b as d,c as l,d as s}from"./chunk-ZQTLCQPC.mjs";function g(r){let p=r?.basePath??"/popmelt",e={port:null,projectId:null},n="virtual:popmelt/bridge",i=`\0${n}`;return{name:"popmelt",resolveId(t){if(t===n)return i},load(t){if(t===i)return`export const bridgeUrl = ${JSON.stringify(e.port===null?null:`http://localhost:${e.port}`)}; export const projectId = ${JSON.stringify(e.projectId)};`},async configureServer(t){e=await o(r,t,5173),await d(e,t),t.middlewares.use(l(p,()=>e))},transformIndexHtml(){if(e.port!==null)return[{tag:"script",attrs:{type:"text/javascript"},children:s(e),injectTo:"head-prepend"}]}}}export{g as a};
|