@plitzi/plitzi-sdk 0.38.8 → 0.38.9
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/CHANGELOG.md +74 -0
- package/dist/plitzi-sdk-devtools-DmTtYHDq.js +385 -0
- package/dist/plitzi-sdk-devtools-DmTtYHDq.js.gz +0 -0
- package/dist/plitzi-sdk.css +1 -1
- package/dist/plitzi-sdk.css.gz +0 -0
- package/dist/plitzi-sdk.js +119 -119
- package/dist/plitzi-sdk.js.gz +0 -0
- package/package.json +12 -12
- package/dist/plitzi-sdk-devtools-8TF3uHjh.js +0 -385
- package/dist/plitzi-sdk-devtools-8TF3uHjh.js.gz +0 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import{A as e,B as t,C as a,ComponentContext as r,D as n,E as i,F as l,I as s,L as o,M as d,N as c,O as m,P as p,R as u,S as h,T as f,V as x,_ as g,a as v,b,c as y,d as k,f as N,g as z,h as w,i as S,j as C,k as $,l as j,m as T,n as I,o as L,p as R,r as E,s as V,t as A,u as M,v as D,w as O,x as F,y as J,z as B}from"@plitzi/plitzi-sdk";import P,{Fragment as q,createContext as W,forwardRef as U,memo as H,use as K,useCallback as Q,useContext as _,useEffect as X,useMemo as Z,useReducer as G,useRef as Y,useState as ee,useSyncExternalStore as te}from"react";import{Fragment as ae,jsx as re,jsxs as ne}from"react/jsx-runtime";var ie={entries:[],index:-1,canUndo:!1,canRedo:!1},le=()=>{},se=()=>le,oe=()=>ie,de=/* @__PURE__ */new WeakSet;var ce=e=>{let t="number";return/^"/.test(e)?t=/:$/.test(e)?"text-red-700":"text-green-700":/true|false/.test(e)?t="text-blue-700":/null/.test(e)&&(t=""),`<span class="${t}">${e}</span>`},me=/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g,pe=e=>e?.replace(me,ce)??e,ue=e=>(e=>(e=>null!==e&&"nodeType"in e&&"number"==typeof e.nodeType)(e)&&e.nodeType===Node.ELEMENT_NODE)(e)?e:null,he=(e,t=!1)=>{let{field:a,value:r}=e;return t?{[a]:{$not:{$regex:r,$options:"i"}}}:{[a]:{$regex:r,$options:"i"}}},fe=(e,t=!1)=>{let{field:a,value:r}=e;return t?{[a]:{$not:{$regex:`^${r}`,$options:"i"}}}:{[a]:{$regex:`^${r}`,$options:"i"}}},xe=(e,t=!1)=>{let{field:a,value:r}=e;return t?{[a]:{$not:{$regex:`${r}$`,$options:"i"}}}:{[a]:{$regex:`${r}$`,$options:"i"}}},ge=(e,t=!1)=>{let{field:a}=e;return t?{[a]:{$ne:""}}:{[a]:""}},ve=(e,t=!1)=>{let{field:a,value:r}=e,n=[];return"string"==typeof r&&r.includes(",")?n=r.split(",").map(e=>e.trim()):("string"==typeof r||"number"==typeof r)&&(n=[r]),t?{[a]:{$nin:n}}:{[a]:{$in:n}}};function be(e,t=!1,a={}){if(!e)return{};let{combinator:r,rules:n,enabled:i}=e;if(!Array.isArray(n)||!1===i)return{};let l=n.filter(e=>!1!==e.enabled).map(e=>"rules"in e?be(e,t,a):((e,t)=>{if(!e)return{};let{isBinding:a}=e;a&&(e=((e,t)=>{let{isBinding:a}=e;return a?{...e,value:C(t,e.value,e.value)}:e})(e,t));let{operator:r}=e;switch(r){case"=":case"!=":case"<":case">":case"<=":case">=":return(e=>{let{field:t,operator:a,value:r}=e;switch(a){case"=":return{[t]:r};case"!=":return{[t]:{$ne:r}};case"<":return"string"==typeof r&&f(r)?{[t]:{$lt:parseFloat(r)}}:{[t]:{$lt:r}};case">":return"string"==typeof r&&f(r)?{[t]:{$gt:parseFloat(r)}}:{[t]:{$gt:r}};case"<=":return"string"==typeof r&&f(r)?{[t]:{$lte:parseFloat(r)}}:{[t]:{$lte:r}};case">=":return"string"==typeof r&&f(r)?{[t]:{$gte:parseFloat(r)}}:{[t]:{$gte:r}};default:return{}}})(e);case"contains":return he(e);case"doesNotContain":return he(e,!0);case"beginsWith":return fe(e);case"doesNotBeginWith":return fe(e,!0);case"endsWith":return xe(e);case"doesNotEndWith":return xe(e,!0);case"empty":return ge(e);case"notEmpty":return ge(e,!0);case"in":return ve(e);case"notIn":return ve(e,!0);case"between":return(e=>{let{field:t,value:a}=e,r=[];return"string"==typeof a&&a.includes(",")&&(r=a.split(",").map(e=>e.trim())),r.length<2?{[t]:!1}:$(r[0])&&$(r[1])?{[t]:{$gte:new Date(r[0]),$lte:new Date(r[1])}}:{[t]:{$gte:r[0],$lte:r[1]}}})(e);default:return{}}})(e,a));return t?l:l.length?1===l.length?l[0]:{[`$${r}`]:l}:{}}var ye=(e,t=!1)=>{let{field:a,value:r}=e;return`${a}${t?" not":""} like '%${r}%'`},ke=(e,t=!1)=>{let{field:a,value:r}=e;return`${a}${t?" not":""} like '${r}%'`},Ne=(e,t=!1)=>{let{field:a,value:r}=e;return`${a}${t?" not":""} like '%${r}'`},ze=(e,t=!1)=>{let{field:a}=e;return`${a} is${t?" not":""} NULL`},we=(e,t=!1)=>{let{field:a,value:r}=e,n=[];return"string"==typeof r&&r.includes(",")?n=r.split(","):("string"==typeof r||"number"==typeof r)&&(n=[r.toString()]),0!==n.length&&`${a}${t?" not":""} in (${n.map(e=>`'${e.trim()}'`).join(", ")})`},Se=(e,t=!1)=>{let{field:a,value:r}=e,n=[];return"string"==typeof r&&(n=r.split(",").map(e=>e.trim())),!(n.length<2)&&($(n[0])&&$(n[1])?`${a}${t?" not":""} between DATE '${n[0]}' and '${n[1]}'`:`${a}${t?" not":""} between '${n[0]}' and '${n[1]}'`)};function Ce(e,t=!0,a={}){if(!e)return"";let{combinator:r,rules:n,enabled:i}=e;if(!Array.isArray(n)||!1===i)return"";let l=n.filter(e=>!1!==e.enabled).map(e=>"rules"in e?`(${t?Ce(e,t,a).toString():Ce(e,t,a)})`:((e,t)=>{if(!e)return{};let{isBinding:a}=e;a&&(e=((e,t)=>e.isBinding?{...e,value:C(t,e.value,e.value)}:e)(e,t));let{operator:r}=e;switch(r){case"=":case"!=":case"<":case">":case"<=":case">=":return(e=>{let{field:t,value:a,operator:r}=e;return"boolean"==typeof a?`${t} ${r} ${a?"TRUE":"FALSE"}`:"string"!=typeof a||f(a)?"number"==typeof a||f(a)?`${t} ${r} ${a}`:$(a)?`${t} ${r} DATE '${a.toString()}'`:`${t} ${r} '${JSON.stringify(a)}'`:`${t} ${r} '${a}'`})(e);case"contains":return ye(e);case"doesNotContain":return!ye(e,!0);case"beginsWith":return ke(e);case"doesNotBeginWith":return ke(e,!0);case"endsWith":return Ne(e);case"doesNotEndWith":return Ne(e,!0);case"empty":return ze(e);case"notEmpty":return ze(e,!0);case"in":return we(e);case"notIn":return we(e,!0);case"between":return Se(e);case"notBetween":return Se(e,!0);default:return!1}})(e,a));return t?l:l.join(` ${r} `)}var $e={desktop:{columns:12,gutter:24,margin:32,maxWidth:1200},tablet:{columns:8,gutter:20,margin:24},mobile:{columns:4,gutter:16,margin:16}},je="rgba(91, 61, 245, 0.07)",Te="rgba(91, 61, 245, 0.32)",Ie=(e,t)=>`${String(e*t)}px`,Le=({className:e,onOpen:t})=>{let{logs:a}=K(F),{errors:r,warnings:n}=Z(()=>a.reduce((e,{logType:t})=>({errors:"danger"===t?e.errors+1:e.errors,warnings:"warning"===t?e.warnings+1:e.warnings}),{errors:0,warnings:0}),[a]),i=Q(()=>{r>0?t("danger"):n>0?t("warning"):t()},[r,n,t]);/* @__PURE__ */
|
|
2
|
+
return re("div",{className:x("absolute bottom-3 left-3 z-[1000000]",e),[b]:"",children:/* @__PURE__ */ne("button",{className:x("flex cursor-pointer items-center gap-2 rounded border border-zinc-200 bg-white px-2 py-1.5 text-[12px]/[16px]","font-bold text-zinc-600 shadow-md transition-colors select-none hover:bg-zinc-50","dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-300 dark:hover:bg-zinc-800"),title:"Plitzi dev tools",onClick:i,children:["Plitzi",r>0&&/* @__PURE__ */ne("span",{className:"flex items-center gap-1 text-red-600 dark:text-red-400",children:[/* @__PURE__ */re("i",{className:"fa-regular fa-circle-xmark text-[11px]"}),r]}),n>0&&/* @__PURE__ */ne("span",{className:"flex items-center gap-1 text-amber-600 dark:text-amber-400",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-triangle-exclamation text-[11px]"}),n]}),0===r&&0===n&&/* @__PURE__ */re("i",{className:"fa-solid fa-terminal text-[11px] text-zinc-400"})]})})},Re={overflow:[],names:[],targets:[],contrast:[],images:[],headings:[]},Ee=["overflow","names","targets","contrast","images","headings"],Ve={inspect:!1,grid:!1,xray:!1,xrayFilter:"all",tabOrder:!1,viewport:!1,paused:!1,slowMotion:!1,reducedMotion:!1,vision:"none",checks:{overflow:!1,names:!1,targets:!1,contrast:!1,images:!1,headings:!1}},Ae="plitzi-reduced-motion",Me="data-plitzi-qa-page",De="data-plitzi-qa-finding",Oe=["data","visibility","flows","motion","flag"],Fe="data-plitzi-qa-xray",Je={data:{label:"Bound to data",description:"A value of it — a text, a style, a state — is read from a binding",colour:"#0ea5e9"},visibility:{label:"Shown on a condition",description:"Whether it shows is bound, or it starts hidden",colour:"#f59e0b"},flows:{label:"Runs a flow",description:"Something done to it starts an interaction",colour:"#ec4899"},motion:{label:"Moves",description:"It arrives, or keeps moving, by its declared motion",colour:"#10b981"},flag:{label:"Behind a flag",description:"It exists only while a feature flag says so",colour:"#8b5cf6"}},Be={data:0,visibility:0,flows:0,motion:0,flag:0},Pe=e=>"visibility"===e,qe=W({settings:Ve,setSetting:()=>{},setCheck:()=>{},findings:Re,setFindings:()=>{},xrayCounts:Be,setXrayCounts:()=>{},round:0,rescan:()=>{},pageRef:{current:null},pinned:void 0,setPinned:()=>{}});qe.displayName="QaContext";var We,Ue=({children:e,pageRef:t,collapsed:a})=>{let[r,n]=A("plitzi-sdk-dev-tools-qa",Ve),[i,l]=ee(Re),[s,o]=ee(Be),[d,c]=ee(0),[m,p]=ee(),u=Z(()=>({...Ve,...r,checks:{...Ve.checks,...r.checks}}),[r]),h=Q((e,t)=>n(a=>({...a,[e]:t})),[n]),f=Q((e,t)=>n(a=>({...a,checks:{...Ve.checks,...a.checks,[e]:t}})),[n]),x=Q(()=>c(e=>e+1),[]);X(()=>{a&&(n(e=>({...e,inspect:!1,checks:Ve.checks})),p(void 0))},[a,n]);let g=Z(()=>({settings:u,setSetting:h,setCheck:f,findings:i,setFindings:l,xrayCounts:s,setXrayCounts:o,round:d,rescan:x,pageRef:t,pinned:m,setPinned:p}),[u,h,f,i,s,d,x,t,m]);/* @__PURE__ */
|
|
3
|
+
return re(qe,{value:g,children:e})},He='a[href], button, [role="button"], [role="link"], [role="tab"], input:not([type="hidden"]), select, textarea',Ke=e=>e.getClientRects().length>0,Qe=e=>(e.textContent??"").replace(/\s+/g," ").trim(),_e=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?\s*\)$/i,Xe=e=>void 0===e?1:e.endsWith("%")?parseFloat(e)/100:parseFloat(e),Ze=e=>{let t=(()=>{if(void 0===We)try{let e=document.createElement("canvas");e.width=1,e.height=1,We=e.getContext("2d",{willReadFrequently:!0})}catch{We=null}return We})();if(!t)return(e=>{let t=e.trim(),a=_e.exec(t);if(a)return[Number(a[1]),Number(a[2]),Number(a[3]),Xe(a.at(4))];let r=/^#([\da-f]{3}|[\da-f]{6})$/i.exec(t)?.[1];if(!r)return"transparent"===t?[0,0,0,0]:void 0;let n=3===r.length?r.replace(/./g,e=>e+e):r,[i,l,s]=[0,2,4].map(e=>parseInt(n.slice(e,e+2),16));return[i,l,s,1]})(e);t.clearRect(0,0,1,1),t.fillStyle="#000",t.fillStyle=e,t.fillRect(0,0,1,1);let[a,r,n,i]=t.getImageData(0,0,1,1).data;return[a,r,n,i/255]},Ge=(e,t)=>{let a=e[3]+t[3]*(1-e[3]);if(0===a)return[0,0,0,0];let r=r=>(e[r]*e[3]+t[r]*t[3]*(1-e[3]))/a;return[r(0),r(1),r(2),a]},Ye=([e,t,a])=>{let[r,n,i]=[e,t,a].map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return.2126*r+.7152*n+.0722*i},et=(e,t)=>{let[a,r]=[Ye(e),Ye(t)].sort((e,t)=>t-e);return(a+.05)/(r+.05)},tt=([e,t,a,r])=>{let n=`#${[e,t,a].map(e=>Math.round(e).toString(16).padStart(2,"0")).join("")}`;return r<1?`${n} · ${String(Math.round(100*r))}%`:n},at=()=>{let e=/* @__PURE__ */new Map,t=/* @__PURE__ */new Map,a=t=>(e.has(t)||e.set(t,Ze(t)),e.get(t)),r=e=>{if(t.has(e))return t.get(e);let n,i=e.ownerDocument.defaultView?.getComputedStyle(e);if(i&&(!i.backgroundImage||"none"===i.backgroundImage)){let t=a(i.backgroundColor),l=e.parentElement,s=l?r(l):(e=>{let t=e.ownerDocument.documentElement;return e.ownerDocument.defaultView?.getComputedStyle(t).colorScheme.includes("dark")?[18,18,18,1]:[255,255,255,1]})(e);t&&t[3]>=1?n=t:s&&(n=t&&t[3]>0?Ge(t,s):s)}return t.set(e,n),n};return{colour:a,backdrop:r}},rt=(e,t)=>e>=24||e>=18.66&&t>=700,nt=e=>{let t=/^h([1-6])$/i.exec(e.tagName)?.[1];return t?Number(t):Number(e.getAttribute("aria-level"))||2},it=(e,t)=>{let a=e.ownerDocument.defaultView;for(let r=e.parentElement;r&&r!==t;r=r.parentElement){let e=a?.getComputedStyle(r).overflowX;if(e&&"visible"!==e)return!0}return!1},lt={overflow:{label:"Sticks out sideways",description:"Whatever reaches past the page’s sides — what makes a phone scroll sideways",colour:"#f97316",run:e=>{let t=e.getBoundingClientRect(),a=[];for(let r of e.querySelectorAll("*")){if(a.some(e=>e.element.contains(r))||!Ke(r))continue;let{left:n,right:i,width:l}=r.getBoundingClientRect(),s=Math.max(t.left-n,i-t.right);l>0&&s>1&&!it(r,e)&&a.push({check:"overflow",element:r,note:`${String(Math.round(s))} px past the page`})}return a}},names:{label:"No accessible name",description:"Buttons, links and fields with no words for a screen reader or an agent; pictures with no alt",colour:"#e11d48",run:e=>[...[...e.querySelectorAll(He)].filter(e=>Ke(e)&&!(e=>{let t=e.getAttribute("aria-labelledby");if(t){let a=t.split(/\s+/).map(t=>e.ownerDocument.getElementById(t)).map(e=>e?Qe(e):"").join(" ").trim();if(a)return a}let a=e.getAttribute("aria-label")?.trim();if(a)return a;if("labels"in e&&e.labels instanceof NodeList){let t=[...e.labels].map(Qe).join(" ").trim();if(t)return t}let r=[...e.querySelectorAll("img[alt]")].map(e=>e.getAttribute("alt")??"").join(" ");return`${Qe(e)} ${r}`.trim()||(e.getAttribute("title")?.trim()??e.getAttribute("placeholder")?.trim()??"")})(e)).map(e=>({check:"names",element:e,note:`a ${e.tagName.toLowerCase()} with no name`})),...[...e.querySelectorAll("img:not([alt])")].filter(Ke).map(e=>({check:"names",element:e,note:"a picture with no alt"}))]},targets:{label:"Small touch targets",description:"Under 24 × 24 px with another control within reach (WCAG 2.2)",colour:"#d97706",run:e=>{let t=e.ownerDocument.defaultView,a=[...e.querySelectorAll(He)].filter(e=>Ke(e)&&"inline"!==t?.getComputedStyle(e).display),r=a.map(e=>e.getBoundingClientRect());return a.flatMap((e,t)=>{let n=r[t];if(n.width>=24&&n.height>=24)return[];let i=n.left+n.width/2,l=n.top+n.height/2;return r.some((r,n)=>n!==t&&!e.contains(a[n])&&((e,t,a)=>Math.hypot(Math.max(a.left-e,0,e-a.right),Math.max(a.top-t,0,t-a.bottom)))(i,l,r)<12)?[{check:"targets",element:e,note:`${String(Math.round(n.width))} × ${String(Math.round(n.height))} px, crowded`}]:[]})}},contrast:{label:"Low contrast",description:"Text under 4.5:1 against what is behind it, 3:1 when large (WCAG AA)",colour:"#db2777",run:e=>{let t=e.ownerDocument.defaultView;if(!t)return[];let a=at();return[...e.querySelectorAll("*")].flatMap(e=>{if(!(e=>[...e.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE).map(Qe).join(" ").trim())(e)||!Ke(e))return[];let r=t.getComputedStyle(e);if("hidden"===r.visibility||0===Number(r.opacity))return[];let n=a.colour(r.color),i=a.backdrop(e);if(!n||!i)return[];let l=et(Ge(n,i),i),s=rt(parseFloat(r.fontSize),Number(r.fontWeight)||400)?3:4.5;return l>=s?[]:[{check:"contrast",element:e,note:`${l.toFixed(2)}:1, needs ${String(s)}:1`}]})}},images:{label:"Image sizes",description:"Pictures stretched past their pixels, or files several times bigger than they are shown",colour:"#0891b2",run:e=>{let t=e.ownerDocument.defaultView?.devicePixelRatio??1;return[...e.querySelectorAll("img")].flatMap(e=>{if(!e.complete||0===e.naturalWidth||!Ke(e))return[];let a=e.getBoundingClientRect().width*t;return 0===a?[]:1.25*e.naturalWidth<a?[{check:"images",element:e,note:`${String(e.naturalWidth)} px file drawn at ${String(Math.round(a))} px — soft`}]:e.naturalWidth>2.5*a&&e.naturalWidth>=800?[{check:"images",element:e,note:`${String(e.naturalWidth)} px file for ${String(Math.round(a))} px`}]:[]})}},headings:{label:"Heading outline",description:"No h1, a second one, or a level skipped on the way down",colour:"#7c3aed",run:e=>{let t=[...e.querySelectorAll('h1, h2, h3, h4, h5, h6, [role="heading"]')].filter(Ke);if(0===t.length)return[];let a=[],r=t.filter(e=>1===nt(e));return 0===r.length&&a.push({check:"headings",element:t[0],note:"the page has no h1"}),r.slice(1).forEach(e=>a.push({check:"headings",element:e,note:"another h1"})),t.forEach((e,r)=>{let n=nt(e),i=0===r?1:nt(t[r-1]);n>i+1&&a.push({check:"headings",element:e,note:`h${String(n)} right after h${String(i)}`})}),a}}},st=({box:e})=>{let t=(({columns:e,gutter:t,margin:a,maxWidth:r},n=1)=>{let i=`calc(100% - ${Ie(2*a,n)})`,l=`calc((100% - ${Ie(t*(e-1),n)}) / ${String(e)})`;return{width:void 0===r?i:`min(${Ie(r,n)}, ${i})`,backgroundImage:`repeating-linear-gradient(to right, ${je} 0px, ${je} ${l}, transparent ${l}, transparent calc(${l} + ${Ie(t,n)}))`,boxShadow:`inset 1px 0 ${Te}, inset -1px 0 ${Te}`}})($e[g(e.viewportWidth)]);/* @__PURE__ */
|
|
4
|
+
return re("div",{"aria-hidden":"true",className:"pointer-events-none fixed top-0 bottom-0 z-[999998]",style:{left:e.left,width:e.width},children:/* @__PURE__ */re("div",{className:"absolute top-0 bottom-0 left-1/2 -translate-x-1/2",style:{width:t.width,backgroundImage:t.backgroundImage,boxShadow:t.boxShadow}})})},ot=e=>parseFloat(e)||0,dt=(e,t,a,r,n)=>({borderStyle:"solid",borderColor:e,borderWidth:`${String(t)}px ${String(a)}px ${String(r)}px ${String(n)}px`}),ct=({element:e})=>{let t=e.ownerDocument.defaultView;if(!t)return null;let a=t.getComputedStyle(e),r=e.getBoundingClientRect(),n=[a.marginTop,a.marginRight,a.marginBottom,a.marginLeft].map(ot),i=[a.borderTopWidth,a.borderRightWidth,a.borderBottomWidth,a.borderLeftWidth].map(ot),l=[a.paddingTop,a.paddingRight,a.paddingBottom,a.paddingLeft].map(ot),[s,o,d,c]=n.map(e=>Math.max(e,0)),[m,p,u,h]=i,[f,x,g,v]=l;/* @__PURE__ */
|
|
5
|
+
return ne(ae,{children:[/* @__PURE__ */re("div",{className:"pointer-events-none fixed z-[999997] box-border",style:{left:r.left-c,top:r.top-s,width:r.width+c+o,height:r.height+s+d,...dt("rgba(249, 115, 22, 0.32)",s,o,d,c)}}),/* @__PURE__ */re("div",{className:"pointer-events-none fixed z-[999997] box-border",style:{left:r.left+h,top:r.top+m,width:Math.max(r.width-h-p,0),height:Math.max(r.height-m-u,0),backgroundColor:"rgba(59, 130, 246, 0.24)",backgroundClip:"padding-box",...dt("rgba(34, 197, 94, 0.32)",f,x,g,v)}})]})},mt=(e,t,a,r)=>({x1:e,y1:t,x2:a,y2:r,length:Math.round(Math.hypot(a-e,r-t))}),pt=(e,t)=>(e+t)/2,ut=({from:e,to:t})=>{let a=((e,t)=>{let a=e.left>=t.left&&e.right<=t.right&&e.top>=t.top&&e.bottom<=t.bottom,r=t.left>=e.left&&t.right<=e.right&&t.top>=e.top&&t.bottom<=e.bottom;if(a||r){let[r,n]=a?[e,t]:[t,e],i=pt(r.left,r.right),l=pt(r.top,r.bottom);return[mt(i,n.top,i,r.top),mt(r.right,l,n.right,l),mt(i,r.bottom,i,n.bottom),mt(n.left,l,r.left,l)].filter(e=>e.length>0)}let n=[],i=pt(Math.max(e.top,t.top),Math.min(e.bottom,t.bottom)),l=pt(Math.max(e.left,t.left),Math.min(e.right,t.right)),s=e.bottom>t.top&&t.bottom>e.top?i:pt(e.top,e.bottom),o=e.right>t.left&&t.right>e.left?l:pt(e.left,e.right);return t.left>=e.right?n.push(mt(e.right,s,t.left,s)):e.left>=t.right&&n.push(mt(t.right,s,e.left,s)),t.top>=e.bottom?n.push(mt(o,e.bottom,o,t.top)):e.top>=t.bottom&&n.push(mt(o,t.bottom,o,e.top)),n})(e.getBoundingClientRect(),t.getBoundingClientRect());/* @__PURE__ */
|
|
6
|
+
return re("svg",{className:"pointer-events-none fixed inset-0 z-[999998] h-full w-full overflow-visible","aria-hidden":"true",children:a.map(({x1:e,y1:t,x2:a,y2:r,length:n})=>/* @__PURE__ */ne("g",{children:[
|
|
7
|
+
/* @__PURE__ */re("line",{x1:e,y1:t,x2:a,y2:r,stroke:"#f43f5e",strokeWidth:1}),
|
|
8
|
+
/* @__PURE__ */re("rect",{x:(e+a)/2-16,y:(t+r)/2-9,width:32,height:18,rx:4,fill:"#f43f5e"}),
|
|
9
|
+
/* @__PURE__ */re("text",{x:(e+a)/2,y:(t+r)/2+4,textAnchor:"middle",fill:"#ffffff",fontSize:11,fontFamily:"ui-monospace, monospace",children:n})]},`${String(e)}-${String(t)}-${String(a)}-${String(r)}`))})},ht=({ratio:e,needs:t})=>/* @__PURE__ */ne("span",{className:x("rounded px-1 font-semibold",{"bg-emerald-500/20 text-emerald-300":e>=t,"bg-rose-500/25 text-rose-300":e<t}),title:`AA needs ${String(t)}:1 for this size`,children:[e.toFixed(2),":1"]}),ft=({colour:e})=>/* @__PURE__ */ne("span",{className:"inline-flex items-center gap-1",children:[/* @__PURE__ */re("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm ring-1 ring-white/30",style:{backgroundColor:e.split(" ")[0]}}),e]}),xt=["top","right","bottom","left"],gt=(e,t)=>{let[a,r,n,i]=xt.map(a=>e.getPropertyValue(`${t}-${a}`)||"0px");return a===r&&r===n&&n===i?a:a===n&&r===i?`${a} ${r}`:`${a} ${r} ${n} ${i}`},vt=e=>!e.startsWith("plitzi-component")&&!e.startsWith("plitzi__")&&!e.startsWith("devtools-"),bt=e=>e.split(",")[0]?.replace(/["']/g,"").trim()??e,yt=e=>{let t=e.ownerDocument.defaultView;if(!t)return;let a=t.getComputedStyle(e),r=e.getBoundingClientRect(),n=e.getAttribute("data-type"),i=e.getAttribute("data-plitzi-el"),l=e.tagName.toLowerCase(),s=Ze(a.color),o=Ze(a.backgroundColor),d=(e=>at().backdrop(e))(e),c=parseFloat(a.fontSize),m=Number(a.fontWeight)||400,p=s&&d?{ratio:et(Ge(s,d),d),needs:rt(c,m)?3:4.5}:void 0;return{name:n&&i?`${n} · ${i}`:l,tag:l,width:Math.round(r.width),height:Math.round(r.height),display:a.display,position:a.position,padding:gt(a,"padding"),margin:gt(a,"margin"),border:`${a.borderTopWidth} ${a.borderTopStyle}`,radius:a.borderTopLeftRadius,gap:"normal"===a.gap?"":a.gap,font:`${bt(a.fontFamily)} ${a.fontSize} · ${a.fontWeight}`,lineHeight:a.lineHeight,letterSpacing:a.letterSpacing,colour:s?tt(s):a.color,background:o&&o[3]>0?tt(o):void 0,contrast:p,opacity:a.opacity,zIndex:a.zIndex,classes:[...e.classList].filter(vt)}},kt=({element:e})=>{let t=Z(()=>yt(e),[e]);if(!t)return null;let a=e.getBoundingClientRect(),r=a.top<120;/* @__PURE__ */
|
|
10
|
+
return ne("div",{className:"pointer-events-none fixed z-[999999] flex max-w-[360px] flex-col gap-1 rounded-lg bg-zinc-900/95 px-2.5 py-2 font-mono text-[11px] leading-snug text-zinc-100 shadow-xl ring-1 ring-white/10",style:{left:Math.max(8,a.left),...r?{top:a.bottom+8}:{bottom:window.innerHeight-a.top+8}},children:[
|
|
11
|
+
/* @__PURE__ */ne("span",{className:"flex items-center gap-2",children:[/* @__PURE__ */re("span",{className:"truncate font-semibold text-violet-300",children:t.name}),/* @__PURE__ */ne("span",{className:"text-zinc-400",children:[t.width," × ",t.height]})]}),
|
|
12
|
+
/* @__PURE__ */ne("span",{className:"text-zinc-300",children:[t.font," / ",t.lineHeight]}),
|
|
13
|
+
/* @__PURE__ */ne("span",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[
|
|
14
|
+
/* @__PURE__ */re(ft,{colour:t.colour}),t.background&&/* @__PURE__ */re(ft,{colour:t.background}),t.contrast&&/* @__PURE__ */re(ht,{ratio:t.contrast.ratio,needs:t.contrast.needs})]}),
|
|
15
|
+
/* @__PURE__ */ne("span",{className:"text-zinc-400",children:["padding ",t.padding," · margin ",t.margin,t.gap&&` · gap ${t.gap}`]})]})},Nt=()=>{let{pageRef:e,pinned:t,setPinned:a,setSetting:r}=K(qe),[n,i]=ee(),[l,s]=ee(!1),[,o]=ee(0);X(()=>{let t=e.current;if(!t)return;let n=e=>e instanceof Element&&t.contains(e),l=0,d=()=>{cancelAnimationFrame(l),l=requestAnimationFrame(()=>o(e=>e+1))},c=e=>{s(e.altKey),i(n(e.target)?e.target:void 0)},m=e=>{n(e.target)&&(e.preventDefault(),e.stopPropagation(),a(e.target))},p=e=>{s(e.altKey),"keydown"===e.type&&"Escape"===e.key&&r("inspect",!1)};return document.addEventListener("pointermove",c,!0),document.addEventListener("click",m,!0),document.addEventListener("keydown",p,!0),document.addEventListener("keyup",p,!0),document.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{cancelAnimationFrame(l),document.removeEventListener("pointermove",c,!0),document.removeEventListener("click",m,!0),document.removeEventListener("keydown",p,!0),document.removeEventListener("keyup",p,!0),document.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[e,a,r]);let d=t?.isConnected?t:void 0,c=d?.getBoundingClientRect();/* @__PURE__ */
|
|
16
|
+
return ne(ae,{children:[c&&/* @__PURE__ */re("div",{className:"pointer-events-none fixed z-[999998] box-border outline-2 outline-violet-500",style:{left:c.left,top:c.top,width:c.width,height:c.height}}),n&&n!==d&&/* @__PURE__ */re(ct,{element:n}),d&&n&&n!==d&&l&&/* @__PURE__ */re(ut,{from:d,to:n}),n&&!l&&/* @__PURE__ */re(kt,{element:n})]})},zt=()=>{let{pageRef:e}=K(qe),[t,a]=ee([]),[,r]=ee(0);return X(()=>{let t=e.current;if(!t)return;let n,i=0,l=()=>{clearTimeout(n),n=setTimeout(()=>a((e=>{let t=[...e.querySelectorAll(`${He}, [tabindex]`)].filter(e=>Number(e.getAttribute("tabindex")??0)>=0&&Ke(e)&&!e.matches(":disabled")),a=e=>Number(e.getAttribute("tabindex")??0);return[...t.filter(e=>a(e)>0).sort((e,t)=>a(e)-a(t)),...t.filter(e=>0===a(e))]})(t)),200)},s=()=>{cancelAnimationFrame(i),i=requestAnimationFrame(()=>r(e=>e+1))};l();let o=new MutationObserver(l);return o.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["tabindex","disabled"]}),document.addEventListener("scroll",s,!0),window.addEventListener("resize",l),()=>{clearTimeout(n),cancelAnimationFrame(i),o.disconnect(),document.removeEventListener("scroll",s,!0),window.removeEventListener("resize",l)}},[e]),/* @__PURE__ */re(ae,{children:t.map((e,t)=>{let a=e.getBoundingClientRect();return a.bottom<0||a.top>window.innerHeight?null:/* @__PURE__ */re("span",{className:"pointer-events-none fixed z-[999998] flex h-[18px] min-w-[18px] -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full bg-sky-600 px-1 font-mono text-[10px] font-semibold text-white shadow ring-2 ring-white/80",style:{left:a.left,top:a.top},children:t+1},t)})})},wt=({box:e})=>{let t=Math.round(e.width)<e.viewportWidth;/* @__PURE__ */
|
|
17
|
+
return ne("div",{className:"pointer-events-none fixed top-2 z-[999999] -translate-x-1/2 rounded-full bg-zinc-900/90 px-3 py-1 font-mono text-[11px] whitespace-nowrap text-white shadow-lg ring-1 ring-white/10",style:{left:e.left+e.width/2},children:[e.viewportWidth," × ",e.viewportHeight," ·"," ",
|
|
18
|
+
/* @__PURE__ */re("span",{className:"text-violet-300",children:g(e.viewportWidth)}),t&&/* @__PURE__ */ne("span",{className:"text-zinc-400",children:[" · page ",Math.round(e.width)]})]})},St=e=>Oe.some(t=>t===e),Ct=({filter:e})=>{let{pageRef:t}=K(qe),[a,r]=ee([]);return X(()=>{let a=t.current;if(!a)return;let n=0,i=()=>{cancelAnimationFrame(n),n=requestAnimationFrame(()=>r(((e,t)=>{let a=[],r=/* @__PURE__ */new Set;for(let n of e.querySelectorAll(`[${Fe}]`)){if(a.length>=150)break;let e=(n.getAttribute("data-plitzi-qa-xray")??"").split(" ").filter(St);if("all"!==t&&!e.includes(t))continue;let i=n.getBoundingClientRect();if(0===i.width||i.bottom<0||i.top>window.innerHeight)continue;let l=e=>`${String(Math.round(i.left))}:${String(Math.round(e))}`,s=i.top>=16?i.top-16+1:Math.max(i.top,0);for(let t=0;t<3&&r.has(l(s));t+=1)s+=16;r.has(l(s))||(r.add(l(s)),a.push({id:n.getAttribute("data-plitzi-el")??"",marks:e,left:i.left,top:s}))}return a})(a,e)))};i();let l=new MutationObserver(i);return l.observe(a,{subtree:!0,attributes:!0,attributeFilter:[Fe]}),document.addEventListener("scroll",i,!0),window.addEventListener("resize",i),()=>{cancelAnimationFrame(n),l.disconnect(),document.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)}},[t,e]),/* @__PURE__ */re(ae,{children:a.map(({id:e,marks:t,left:a,top:r})=>/* @__PURE__ */ne("span",{className:"pointer-events-none fixed z-[999998] flex h-[15px] max-w-56 items-center gap-1 rounded-sm bg-zinc-900/85 px-1 font-mono text-[10px] leading-none text-white shadow-sm",style:{left:a,top:r},children:[t.map(e=>/* @__PURE__ */re("span",{title:Je[e].label,className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:Je[e].colour}},e)),/* @__PURE__ */re("span",{className:"truncate",children:e})]},`${e}-${String(a)}-${String(r)}`))})},$t=`[${Me}]`,jt=':is([data-type="heading"], [data-type="text"], [data-type="paragraph"], [data-type="button"], [data-type="link"])',Tt=`\n${$t} [data-plitzi-el] { outline: 1px dashed rgba(124, 92, 255, 0.5); outline-offset: -1px; }\n${$t} [data-plitzi-el]:hover { outline: 1.5px solid #7c5cff; outline-offset: -1.5px; }\n${$t} ${jt}[data-plitzi-el]:hover { position: relative; }\n${$t} ${jt}[data-plitzi-el]:hover::after {\n content: attr(data-type) ' · ' attr(data-plitzi-el);\n position: absolute;\n left: -1px;\n bottom: 100%;\n z-index: 2147483000;\n padding: 1px 6px;\n border-radius: 4px 4px 0 0;\n background-color: #7c5cff;\n color: #ffffff;\n font: 500 10px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;\n letter-spacing: 0;\n text-transform: none;\n white-space: nowrap;\n pointer-events: none;\n}`,It=e=>[Tt,...Oe.filter(t=>"all"===e||e===t).reverse().map(e=>`${$t} [${Fe}~="${e}"] { outline: 1.5px solid ${Je[e].colour}; outline-offset: -1.5px; }`)].join("\n"),Lt=`${$t}, ${$t} * { cursor: crosshair !important; }`,Rt=`${$t} *, ${$t} ::before, ${$t} ::after { animation-play-state: paused !important; }`,Et=e=>e.map(e=>`${$t} [${De}~="${e}"] { outline: 2px solid ${lt[e].colour} !important; outline-offset: 1px !important; box-shadow: 0 0 0 4px color-mix(in srgb, ${lt[e].colour} 22%, transparent) !important; }`).join("\n"),Vt=e=>`plitzi-qa-${e}`,At={none:"none",grayscale:"grayscale(1)",protanopia:`url(#${Vt("protanopia")})`,deuteranopia:`url(#${Vt("deuteranopia")})`,tritanopia:`url(#${Vt("tritanopia")})`,blurred:"blur(2px)"},Mt={protanopia:"0.567 0.433 0 0 0 0.558 0.442 0 0 0 0 0.242 0.758 0 0 0 0 0 1 0",deuteranopia:"0.625 0.375 0 0 0 0.7 0.3 0 0 0 0 0.3 0.7 0 0 0 0 0 1 0",tritanopia:"0.95 0.05 0 0 0 0 0.433 0.567 0 0 0 0.475 0.525 0 0 0 0 0 1 0"},Dt=e=>{let t=typeof window>"u"?0:window.innerWidth,a=typeof window>"u"?0:window.innerHeight,r=e?.getBoundingClientRect();return{left:r?.left??0,width:r?.width??t,viewportWidth:t,viewportHeight:a}},Ot=(e,t)=>(e=>[{flat:e.flat},...Object.values(e.components).map(e=>({flat:e.flat,componentId:e.id}))])(e).find(e=>Object.hasOwn(e.flat,t)),Ft=(e,t)=>Object.hasOwn(e.components,t)?e.components[t]:void 0,Jt="http://www.w3.org/2000/svg",Bt=()=>{let{settings:e,pageRef:t,round:a,setFindings:r,setXrayCounts:n}=K(qe),[[i,l,s]]=d(["navigation.currentPageId","schema.flat","schema.components"]),o=(e=>{let[t,a]=ee(()=>Dt(e.current));return X(()=>{let t=e.current,r=()=>a(Dt(t));r(),window.addEventListener("resize",r);let n=t?new ResizeObserver(r):void 0;return t&&n?.observe(t),()=>{window.removeEventListener("resize",r),n?.disconnect()}},[e]),t})(t),c=(e=>e.inspect||e.grid||e.xray||e.tabOrder||e.viewport||e.paused||e.slowMotion||e.reducedMotion||"none"!==e.vision||Object.values(e.checks).some(Boolean))(e),m=Z(()=>(e=>{let t=Ee.filter(t=>e.checks[t]);return[e.inspect?Lt:"",e.xray?It(e.xrayFilter):"",e.paused?Rt:"","none"===e.vision?"":`${$t} { filter: ${At[e.vision]}; }`,Et(t)].filter(Boolean).join("\n")})(e),[e]),p=Z(()=>Ee.filter(t=>e.checks[t]).join(" "),[e.checks]);return X(()=>{let e=t.current;if(e&&c)return e.setAttribute(Me,""),()=>e.removeAttribute(Me)},[c,t]),X(()=>{if(!m)return;let e=document.createElement("style");return e.setAttribute("data-plitzi-qa",""),e.textContent=m,document.head.append(e),()=>e.remove()},[m]),X(()=>{if(e.reducedMotion)return document.documentElement.classList.add(Ae),()=>document.documentElement.classList.remove(Ae)},[e.reducedMotion]),X(()=>{let t=e.vision;if("protanopia"!==t&&"deuteranopia"!==t&&"tritanopia"!==t)return;let a=document.createElementNS(Jt,"svg");a.setAttribute("aria-hidden","true"),a.setAttribute("style","position: absolute; width: 0; height: 0");let r=document.createElementNS(Jt,"filter");r.setAttribute("id",Vt(t));let n=document.createElementNS(Jt,"feColorMatrix");return n.setAttribute("type","matrix"),n.setAttribute("values",Mt[t]),r.append(n),a.append(r),document.body.append(a),()=>a.remove()},[e.vision]),X(()=>{let a=t.current;if(!a||!e.xray)return void n(Be);let r,i=()=>{let e={...Be};a.querySelectorAll("[data-plitzi-el]").forEach(t=>{let a=t.getAttribute("data-plitzi-el")??"",r=Ot({flat:l,components:s},a)?.flat[a]?.definition,n=r?(e=>{let t=Object.entries(e.bindings??{}).flatMap(([e,t])=>t.filter(e=>!1!==e.enabled).map(t=>({category:e,to:t.to}))),a=t.some(({category:e,to:t})=>"initialState"===e&&Pe(t)),r={data:t.some(({category:e,to:t})=>!("initialState"===e&&Pe(t))),visibility:a||!1===e.initialState?.visibility,flows:Object.values(e.interactions??{}).some(e=>e.enabled),motion:void 0!==e.motion?.enter||void 0!==e.motion?.loop,flag:void 0!==e.flag};return Oe.filter(e=>r[e])})(r):[];n.forEach(t=>{e[t]+=1}),0===n.length?t.removeAttribute(Fe):t.getAttribute("data-plitzi-qa-xray")!==n.join(" ")&&t.setAttribute("data-plitzi-qa-xray",n.join(" "))}),n(e)};i();let o=new MutationObserver(()=>{clearTimeout(r),r=setTimeout(i,200)});return o.observe(a,{childList:!0,subtree:!0}),()=>{clearTimeout(r),o.disconnect(),a.querySelectorAll(`[${Fe}]`).forEach(e=>e.removeAttribute(Fe))}},[e.xray,t,l,s,i,n]),X(()=>{let a=t.current;if(!a||!e.slowMotion)return;let r=e=>a.getAnimations({subtree:!0}).forEach(t=>{t.playbackRate=e}),n=()=>r(.25);return n(),a.addEventListener("animationstart",n),a.addEventListener("transitionrun",n),()=>{a.removeEventListener("animationstart",n),a.removeEventListener("transitionrun",n),r(1)}},[e.slowMotion,t]),X(()=>{let e=t.current,a=Ee.filter(e=>p.split(" ").includes(e));if(!e||0===a.length)return void r(Re);let n,i,l=[],s=()=>{l.forEach(e=>e.removeAttribute(De));let t={...Re};for(let r of a)t[r]=lt[r].run(e);let n=/* @__PURE__ */new Map;a.forEach(e=>t[e].forEach(({element:t})=>n.set(t,[...n.get(t)??[],e]))),n.forEach((e,t)=>t.setAttribute(De,e.join(" "))),l=[...n.keys()],r(t)},o=()=>{"function"==typeof requestIdleCallback?i=requestIdleCallback(s,{timeout:1e3}):s()},d=()=>{clearTimeout(n),void 0!==i&&"function"==typeof cancelIdleCallback&&cancelIdleCallback(i),n=setTimeout(o,250)};return d(),window.addEventListener("resize",d),()=>{clearTimeout(n),void 0!==i&&"function"==typeof cancelIdleCallback&&cancelIdleCallback(i),window.removeEventListener("resize",d),l.forEach(e=>e.removeAttribute(De))}},[p,t,a,i,r]),/* @__PURE__ */ne(ae,{children:[e.grid&&/* @__PURE__ */re(st,{box:o}),e.xray&&"none"!==e.xrayFilter&&/* @__PURE__ */re(Ct,{filter:e.xrayFilter}),e.tabOrder&&/* @__PURE__ */re(zt,{}),e.inspect&&/* @__PURE__ */re(Nt,{}),e.viewport&&/* @__PURE__ */re(wt,{box:o})]})},Pt=[{id:"all",label:"All",icon:"fa-solid fa-list"},{id:"live",label:"Running",icon:"fa-solid fa-circle-notch"},{id:"failed",label:"Failed",icon:"fa-solid fa-circle-exclamation"}],qt=({filter:e,query:t,liveCount:a,runCount:r,onFilterChange:n,onQueryChange:i,onClear:l})=>{let s=Q(e=>()=>n(e),[n]),o=Q(e=>i(e.target.value),[i]);/* @__PURE__ */
|
|
19
|
+
return ne("div",{className:"flex shrink-0 items-center gap-2 border-b border-zinc-200 bg-zinc-50 px-2 py-1.5 dark:border-zinc-800 dark:bg-zinc-900",children:[
|
|
20
|
+
/* @__PURE__ */re("div",{className:"flex items-stretch gap-1",children:Pt.map(t=>{let r=e===t.id;/* @__PURE__ */
|
|
21
|
+
return ne("button",{onClick:s(t.id),"aria-pressed":r,className:x("flex h-6 items-center gap-1 rounded px-2 text-xs font-medium transition-colors",{"bg-violet-500 text-white":r,"text-zinc-600 hover:bg-zinc-200 dark:text-zinc-400 dark:hover:bg-zinc-700":!r}),children:[
|
|
22
|
+
/* @__PURE__ */re("i",{className:x(t.icon,"live"===t.id&&a>0&&"fa-spin")}),t.label,"live"===t.id&&a>0&&/* @__PURE__ */re("span",{className:"tabular-nums",children:a})]},t.id)})}),
|
|
23
|
+
/* @__PURE__ */re("input",{type:"search",value:t,onChange:o,placeholder:"Filter by action, step or run id",className:"h-6 min-w-0 grow rounded border border-zinc-200 bg-white px-2 text-xs text-zinc-700 placeholder:text-zinc-400 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-200"}),
|
|
24
|
+
/* @__PURE__ */ne("span",{className:"shrink-0 text-[10px] text-zinc-400 tabular-nums dark:text-zinc-500",children:[r," runs"]}),
|
|
25
|
+
/* @__PURE__ */ne("button",{onClick:l,className:"flex h-6 shrink-0 items-center gap-1 rounded px-2 text-xs font-medium text-zinc-600 hover:bg-zinc-200 dark:text-zinc-300 dark:hover:bg-zinc-700",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-trash"}),"Clear"]})]})},Wt=({children:e})=>{let[t,a]=A("plitzi-sdk.dev-tools.actions.detail-width",280),r=Q(e=>{Number.isFinite(e)&&a(e)},[a]);/* @__PURE__ */
|
|
26
|
+
return re(M,{className:"shrink-0 border-l border-zinc-200 dark:border-zinc-800",resizeHandles:["w"],axis:"x",autoGrow:!1,width:t,minConstraintsX:200,maxConstraintsX:520,onChange:r,children:/* @__PURE__ */re("aside",{className:"flex h-full w-full flex-col gap-1.5 overflow-auto bg-zinc-50 px-3 py-2 text-[10px] dark:bg-zinc-900/50",children:e})})},Ut=e=>void 0===e.endedAt,Ht=e=>void 0===e.endedAt?void 0:e.endedAt-e.startedAt,Kt=e=>e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(2)}s`,Qt=e=>new Date(e).toLocaleTimeString(),_t={running:"info",streaming:"info",accepted:"info",completed:"success",failed:"danger",aborted:"warning",skipped:"custom"},Xt=e=>_t[e]??"custom",Zt={success:"success",failed:"danger",skipped:"custom",disabled:"custom"},Gt=e=>Zt[e],Yt={success:"fa-solid fa-check",failed:"fa-solid fa-xmark",skipped:"fa-solid fa-forward",disabled:"fa-solid fa-ban"},ea={success:"bg-emerald-500/70",failed:"bg-red-500/80",skipped:"bg-zinc-400/40",disabled:"bg-zinc-400/30"},ta={await:"await",detached:"detached",stream:"stream",render:"render"},aa={await:"fa-solid fa-right-left",detached:"fa-solid fa-paper-plane",stream:"fa-solid fa-wave-square",render:"fa-solid fa-server"},ra=e=>`${e} ${1===e?"step":"steps"}`,na=e=>e?.find(e=>"failed"===e.status),ia={},la=/*#__PURE__*/W(ia),sa=(e,t)=>L({},e,t),oa=/*#__PURE__*/W(()=>{});function da(){return _(oa)}oa.displayName="JVR.DispatchShowTools";var ca=e=>{var t=e.initial,a=e.dispatch,r=e.children;/*#__PURE__*/
|
|
27
|
+
return re(la.Provider,{value:t,children:/*#__PURE__*/re(oa.Provider,{value:a,children:r})})};ca.displayName="JVR.ShowTools";var ma={},pa=/*#__PURE__*/W(ma),ua=(e,t)=>L({},e,t),ha=()=>_(pa),fa=/*#__PURE__*/W(()=>{});fa.displayName="JVR.DispatchExpands";var xa=e=>{var t=e.initial,a=e.dispatch,r=e.children;/*#__PURE__*/
|
|
28
|
+
return re(pa.Provider,{value:t,children:/*#__PURE__*/re(fa.Provider,{value:a,children:r})})};xa.displayName="JVR.Expands";var ga={Str:{as:"span","data-type":"string",style:{color:"var(--w-rjv-type-string-color, #cb4b16)"},className:"w-rjv-type",children:"string"},Url:{as:"a",style:{color:"var(--w-rjv-type-url-color, #0969da)"},"data-type":"url",className:"w-rjv-type",children:"url"},Undefined:{style:{color:"var(--w-rjv-type-undefined-color, #586e75)"},as:"span","data-type":"undefined",className:"w-rjv-type",children:"undefined"},Null:{style:{color:"var(--w-rjv-type-null-color, #d33682)"},as:"span","data-type":"null",className:"w-rjv-type",children:"null"},Map:{style:{color:"var(--w-rjv-type-map-color, #268bd2)",marginRight:3},as:"span","data-type":"map",className:"w-rjv-type",children:"Map"},Nan:{style:{color:"var(--w-rjv-type-nan-color, #859900)"},as:"span","data-type":"nan",className:"w-rjv-type",children:"NaN"},Bigint:{style:{color:"var(--w-rjv-type-bigint-color, #268bd2)"},as:"span","data-type":"bigint",className:"w-rjv-type",children:"bigint"},Int:{style:{color:"var(--w-rjv-type-int-color, #268bd2)"},as:"span","data-type":"int",className:"w-rjv-type",children:"int"},Set:{style:{color:"var(--w-rjv-type-set-color, #268bd2)",marginRight:3},as:"span","data-type":"set",className:"w-rjv-type",children:"Set"},Float:{style:{color:"var(--w-rjv-type-float-color, #859900)"},as:"span","data-type":"float",className:"w-rjv-type",children:"float"},True:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},False:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},Date:{style:{color:"var(--w-rjv-type-date-color, #268bd2)"},as:"span","data-type":"date",className:"w-rjv-type",children:"date"}},va=/*#__PURE__*/W(ga),ba=(e,t)=>L({},e,t),ya=()=>_(va),ka=/*#__PURE__*/W(()=>{});function Na(e){var t=e.initial,a=e.dispatch,r=e.children;/*#__PURE__*/
|
|
29
|
+
return re(va.Provider,{value:t,children:/*#__PURE__*/re(ka.Provider,{value:a,children:r})})}ka.displayName="JVR.DispatchTypes",Na.displayName="JVR.Types";var za=["style"];function wa(e){var t=e.style,a=V(e,za),r=L({cursor:"pointer",height:"1em",width:"1em",userSelect:"none",display:"inline-flex"},t);/*#__PURE__*/
|
|
30
|
+
return re("svg",L({viewBox:"0 0 24 24",fill:"var(--w-rjv-arrow-color, currentColor)",style:r},a,{children:/*#__PURE__*/re("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})}))}wa.displayName="JVR.TriangleArrow";var Sa={Arrow:{as:"span",className:"w-rjv-arrow",style:{transform:"rotate(0deg)",transition:"all 0.3s"},children:/*#__PURE__*/re(wa,{})},Colon:{as:"span",style:{color:"var(--w-rjv-colon-color, var(--w-rjv-color))",marginLeft:0,marginRight:2},className:"w-rjv-colon",children:":"},Quote:{as:"span",style:{color:"var(--w-rjv-quotes-color, #236a7c)"},className:"w-rjv-quotes",children:'"'},ValueQuote:{as:"span",style:{color:"var(--w-rjv-quotes-string-color, #cb4b16)"},className:"w-rjv-quotes",children:'"'},BracketsLeft:{as:"span",style:{color:"var(--w-rjv-brackets-color, #236a7c)"},className:"w-rjv-brackets-start",children:"["},BracketsRight:{as:"span",style:{color:"var(--w-rjv-brackets-color, #236a7c)"},className:"w-rjv-brackets-end",children:"]"},BraceLeft:{as:"span",style:{color:"var(--w-rjv-curlybraces-color, #236a7c)"},className:"w-rjv-curlybraces-start",children:"{"},BraceRight:{as:"span",style:{color:"var(--w-rjv-curlybraces-color, #236a7c)"},className:"w-rjv-curlybraces-end",children:"}"}},Ca=/*#__PURE__*/W(Sa),$a=(e,t)=>L({},e,t),ja=()=>_(Ca),Ta=/*#__PURE__*/W(()=>{});Ta.displayName="JVR.DispatchSymbols";var Ia=e=>{var t=e.initial,a=e.dispatch,r=e.children;/*#__PURE__*/
|
|
31
|
+
return re(Ca.Provider,{value:t,children:/*#__PURE__*/re(Ta.Provider,{value:a,children:r})})};Ia.displayName="JVR.Symbols";var La={Copied:{className:"w-rjv-copied",style:{height:"1em",width:"1em",cursor:"pointer",verticalAlign:"middle",marginLeft:5}},CountInfo:{as:"span",className:"w-rjv-object-size",style:{color:"var(--w-rjv-info-color, #0000004d)",paddingLeft:8,fontStyle:"italic"}},CountInfoExtra:{as:"span",className:"w-rjv-object-extra",style:{paddingLeft:8}},Ellipsis:{as:"span",style:{cursor:"pointer",color:"var(--w-rjv-ellipsis-color, #cb4b16)",userSelect:"none"},className:"w-rjv-ellipsis",children:"..."},Row:{as:"div",className:"w-rjv-line"},KeyName:{as:"span",className:"w-rjv-object-key"}},Ra=/*#__PURE__*/W(La),Ea=(e,t)=>L({},e,t),Va=()=>_(Ra),Aa=/*#__PURE__*/W(()=>{});Aa.displayName="JVR.DispatchSection";var Ma=e=>{var t=e.initial,a=e.dispatch,r=e.children;/*#__PURE__*/
|
|
32
|
+
return re(Ra.Provider,{value:t,children:/*#__PURE__*/re(Aa.Provider,{value:a,children:r})})};Ma.displayName="JVR.Section";var Da={objectSortKeys:!1,indentWidth:15},Oa=/*#__PURE__*/W(Da);Oa.displayName="JVR.Context";var Fa=/*#__PURE__*/W(()=>{});function Ja(e,t){return L({},e,t)}Fa.displayName="JVR.DispatchContext";var Ba=()=>_(Oa),Pa=e=>{var t=e.children,a=e.initialState,r=e.initialTypes,n=G(Ja,Object.assign({},Da,a)),i=n[0],l=n[1],s=G(sa,ia),o=s[0],d=s[1],c=G(ua,ma),m=c[0],p=c[1],u=G(ba,ga),h=u[0],f=u[1],x=G($a,Sa),g=x[0],v=x[1],b=G(Ea,La),y=b[0],k=b[1];return X(()=>l(L({},a)),[a]),/*#__PURE__*/re(Oa.Provider,{value:i,children:/*#__PURE__*/re(Fa.Provider,{value:l,children:/*#__PURE__*/re(ca,{initial:o,dispatch:d,children:/*#__PURE__*/re(xa,{initial:m,dispatch:p,children:/*#__PURE__*/re(Na,{initial:L({},h,r),dispatch:f,children:/*#__PURE__*/re(Ia,{initial:g,dispatch:v,children:/*#__PURE__*/re(Ma,{initial:y,dispatch:k,children:t})})})})})})})};Pa.displayName="JVR.Provider";var qa=["isNumber","value","parentValue","keyName","keys"],Wa=["as","render"],Ua=["as","render"],Ha=["as","render"],Ka=["as","style","render"],Qa=["as","render"],_a=["as","render"],Xa=["as","render"],Za=["as","render"],Ga=e=>{var t=ja().Quote,a=void 0===t?{}:t,r=e.isNumber,n=e.value,i=e.parentValue,l=e.keyName,s=e.keys,o=V(e,qa);if(r)return null;var d=a.as,c=a.render,m=V(a,Wa),p=d||"span",u=L({},o,m);return"string"==typeof u.children&&(u.children=u.children.trim()||void 0),c&&"function"==typeof c&&c(u,{value:n,parentValue:i,keyName:l,keys:s||(l?[l]:[])})||/*#__PURE__*/re(p,L({},u))};Ga.displayName="JVR.Quote";var Ya=e=>{var t=ja().ValueQuote,a=void 0===t?{}:t,r=L({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e)),n=a.as,i=a.render,l=V(a,Ua),s=n||"span",o=L({},r,l);return i&&"function"==typeof i&&i(o,{})||/*#__PURE__*/re(s,L({},o))};Ya.displayName="JVR.ValueQuote";var er=e=>{var t=e.value,a=e.parentValue,r=e.keyName,n=e.keys,i=ja().Colon,l=void 0===i?{}:i,s=l.as,o=l.render,d=V(l,Ha),c=s||"span";return o&&"function"==typeof o&&o(d,{value:t,parentValue:a,keyName:r,keys:n||(r?[r]:[])})||/*#__PURE__*/re(c,L({},d))};er.displayName="JVR.Colon";var tr=e=>{var t=ja().Arrow,a=void 0===t?{}:t,r=ha(),n=e.expandKey,i=e.style,l=e.value,s=e.parentValue,o=e.keyName,d=e.keys,c=!!r[n],m=a.as,p=a.style,u=a.render,h=V(a,Ka),f=m||"span",x=u&&"function"==typeof u,g=L({},h,{"data-expanded":c,style:L({},p,i)});return x&&u(g,{value:l,parentValue:s,keyName:o,keys:d||(o?[o]:[])})||/*#__PURE__*/re(f,L({},h,{style:L({},p,i)}))};tr.displayName="JVR.Arrow";var ar=e=>{var t=e.isBrackets,a=e.value,r=e.parentValue,n=e.keyName,i=e.keys,l=ja(),s=l.BracketsLeft,o=void 0===s?{}:s,d=l.BraceLeft,c=void 0===d?{}:d,m={value:a,parentValue:r,keyName:n,keys:i||(n?[n]:[])};if(t){var p=o.as,u=o.render,h=V(o,Qa),f=p||"span";return u&&"function"==typeof u&&u(h,m)||/*#__PURE__*/re(f,L({},h))}var x=c.as,g=c.render,v=V(c,_a),b=x||"span";return g&&"function"==typeof g&&g(v,m)||/*#__PURE__*/re(b,L({},v))};ar.displayName="JVR.BracketsOpen";var rr=e=>{var t=e.isBrackets,a=e.isVisiable,r=e.value,n=e.parentValue,i=e.keyName,l={value:r,parentValue:n,keyName:i,keys:e.keys||(i?[i]:[])};if(!a)return null;var s=ja(),o=s.BracketsRight,d=void 0===o?{}:o,c=s.BraceRight,m=void 0===c?{}:c;if(t){var p=d.as,u=d.render,h=V(d,Xa),f=p||"span";return u&&"function"==typeof u&&u(h,l)||/*#__PURE__*/re(f,L({},h))}var x=m.as,g=m.render,v=V(m,Za),b=x||"span";return g&&"function"==typeof g&&g(v,l)||/*#__PURE__*/re(b,L({},v))};rr.displayName="JVR.BracketsClose";var nr=e=>{var t,a=e.keyName,r=e.value,n=e.expandKey,i=e.parentValue,l=e.level,s=e.keys,o=void 0===s?[]:s,d=ha(),c=Ba(),m=c.collapsed,p=c.shouldExpandNodeInitially,u="boolean"==typeof m?m:"number"==typeof m&&l>m,h=null!=(t=d[n])?t:!p&&u,f=p&&p(!h,{value:r,keys:o,level:l,keyName:a,parentValue:i});if(p&&!1===m){if(void 0===d[n]&&!f)return null}else if(void 0===d[n]&&f)return null;var x=Object.keys(r).length;if(h||0===x)return null;var g={keyName:a,value:r,keys:o,parentValue:i},v=Array.isArray(r),b=r instanceof Set;/*#__PURE__*/
|
|
33
|
+
return re("div",{style:{paddingLeft:4},children:/*#__PURE__*/re(rr,L({isBrackets:v||b},g,{isVisiable:!0}))})};nr.displayName="JVR.NestedClose";var ir=["as","render"],lr=["as","render"],sr=["as","render"],or=["as","render"],dr=["as","render"],cr=["as","render"],mr=["as","render"],pr=["as","render"],ur=["as","render"],hr=["as","render"],fr=["as","render"],xr=["as","render"],gr=["as","render"],vr=e=>{if(void 0===e)return"0n";if("string"==typeof e)try{e=BigInt(e)}catch(ys){return"0n"}return e?e.toString()+"n":"0n"},br=e=>{var t=e.value,a=e.keyName,r=ya(),n=r.Set,i=void 0===n?{}:n,l=r.displayDataTypes;if(!(t instanceof Set&&l))return null;var s=i.as,o=i.render,d=V(i,ir);return o&&"function"==typeof o&&o(d,{type:"type",value:t,keyName:a})||/*#__PURE__*/re(s||"span",L({},d))};br.displayName="JVR.SetComp";var yr=e=>{var t=e.value,a=e.keyName,r=ya(),n=r.Map,i=void 0===n?{}:n,l=r.displayDataTypes;if(!(t instanceof Map&&l))return null;var s=i.as,o=i.render,d=V(i,lr);return o&&"function"==typeof o&&o(d,{type:"type",value:t,keyName:a})||/*#__PURE__*/re(s||"span",L({},d))};yr.displayName="JVR.MapComp";var kr={opacity:.75,paddingRight:4},Nr=e=>{var t=e.children,a=void 0===t?"":t,r=e.keyName,n=e.keys,i=ya(),l=i.Str,s=void 0===l?{}:l,o=i.displayDataTypes,d=Ba(),c=d.shortenTextAfterLength,m=void 0===c?30:c,p=d.stringEllipsis,u=void 0===p?"...":p,h=s.as,f=s.render,x=V(s,sr),g=a,v=ee(m&&g.length>m),b=v[0],y=v[1];X(()=>y(m&&g.length>m),[m]);var k=h||"span",N=L({},kr,s.style||{});m>0&&(x.style=L({},x.style,{cursor:g.length<=m?"initial":"pointer"}),g.length>m&&(x.onClick=()=>{y(!b)}));var z=b?""+g.slice(0,m)+u:g,w=f&&"function"==typeof f,S=w&&f(L({},x,{style:N}),{type:"type",value:a,keyName:r,keys:n}),C=b?"w-rjv-value w-rjv-value-short":"w-rjv-value",$=w&&f(L({},x,{children:z,className:C}),{type:"value",value:a,keyName:r,keys:n});/*#__PURE__*/
|
|
34
|
+
return ne(q,{children:[o&&(S||/*#__PURE__*/re(k,L({},x,{style:N}))),$||/*#__PURE__*/ne(q,{children:[
|
|
35
|
+
/*#__PURE__*/re(Ya,{}),
|
|
36
|
+
/*#__PURE__*/re(k,L({},x,{className:C,children:z})),
|
|
37
|
+
/*#__PURE__*/re(Ya,{})]})]})};Nr.displayName="JVR.TypeString";var zr=e=>{var t=e.children,a=e.keyName,r=e.keys,n=ya(),i=n.True,l=void 0===i?{}:i,s=n.displayDataTypes,o=l.as,d=l.render,c=V(l,or),m=o||"span",p=L({},kr,l.style||{}),u=d&&"function"==typeof d,h=u&&d(L({},c,{style:p}),{type:"type",value:t,keyName:a,keys:r}),f=u&&d(L({},c,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
38
|
+
return ne(q,{children:[s&&(h||/*#__PURE__*/re(m,L({},c,{style:p}))),f||/*#__PURE__*/re(m,L({},c,{className:"w-rjv-value",children:null==t?void 0:t.toString()}))]})};zr.displayName="JVR.TypeTrue";var wr=e=>{var t=e.children,a=e.keyName,r=e.keys,n=ya(),i=n.False,l=void 0===i?{}:i,s=n.displayDataTypes,o=l.as,d=l.render,c=V(l,dr),m=o||"span",p=L({},kr,l.style||{}),u=d&&"function"==typeof d,h=u&&d(L({},c,{style:p}),{type:"type",value:t,keyName:a,keys:r}),f=u&&d(L({},c,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
39
|
+
return ne(q,{children:[s&&(h||/*#__PURE__*/re(m,L({},c,{style:p}))),f||/*#__PURE__*/re(m,L({},c,{className:"w-rjv-value",children:null==t?void 0:t.toString()}))]})};wr.displayName="JVR.TypeFalse";var Sr=e=>{var t=e.children,a=e.keyName,r=e.keys,n=ya(),i=n.Float,l=void 0===i?{}:i,s=n.displayDataTypes,o=l.as,d=l.render,c=V(l,cr),m=o||"span",p=L({},kr,l.style||{}),u=d&&"function"==typeof d,h=u&&d(L({},c,{style:p}),{type:"type",value:t,keyName:a,keys:r}),f=u&&d(L({},c,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
40
|
+
return ne(q,{children:[s&&(h||/*#__PURE__*/re(m,L({},c,{style:p}))),f||/*#__PURE__*/re(m,L({},c,{className:"w-rjv-value",children:null==t?void 0:t.toString()}))]})};Sr.displayName="JVR.TypeFloat";var Cr=e=>{var t=e.children,a=e.keyName,r=e.keys,n=ya(),i=n.Int,l=void 0===i?{}:i,s=n.displayDataTypes,o=l.as,d=l.render,c=V(l,mr),m=o||"span",p=L({},kr,l.style||{}),u=d&&"function"==typeof d,h=u&&d(L({},c,{style:p}),{type:"type",value:t,keyName:a,keys:r}),f=u&&d(L({},c,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
41
|
+
return ne(q,{children:[s&&(h||/*#__PURE__*/re(m,L({},c,{style:p}))),f||/*#__PURE__*/re(m,L({},c,{className:"w-rjv-value",children:null==t?void 0:t.toString()}))]})};Cr.displayName="JVR.TypeInt";var $r=e=>{var t=e.children,a=e.keyName,r=e.keys,n=ya(),i=n.Bigint,l=void 0===i?{}:i,s=n.displayDataTypes,o=l.as,d=l.render,c=V(l,pr),m=o||"span",p=L({},kr,l.style||{}),u=d&&"function"==typeof d,h=u&&d(L({},c,{style:p}),{type:"type",value:t,keyName:a,keys:r}),f=u&&d(L({},c,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
42
|
+
return ne(q,{children:[s&&(h||/*#__PURE__*/re(m,L({},c,{style:p}))),f||/*#__PURE__*/re(m,L({},c,{className:"w-rjv-value",children:vr(null==t?void 0:t.toString())}))]})};$r.displayName="JVR.TypeFloat";var jr=e=>{var t=e.children,a=e.keyName,r=e.keys,n=ya(),i=n.Url,l=void 0===i?{}:i,s=n.displayDataTypes,o=l.as,d=l.render,c=V(l,ur),m=o||"span",p=L({},kr,l.style),u=d&&"function"==typeof d,h=u&&d(L({},c,{style:p}),{type:"type",value:t,keyName:a,keys:r}),f=u&&d(L({},c,{children:null==t?void 0:t.href,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
43
|
+
return ne(q,{children:[s&&(h||/*#__PURE__*/re(m,L({},c,{style:p}))),f||/*#__PURE__*/ne("a",L({href:null==t?void 0:t.href,target:"_blank"},c,{className:"w-rjv-value",children:[
|
|
44
|
+
/*#__PURE__*/re(Ya,{}),null==t?void 0:t.href,
|
|
45
|
+
/*#__PURE__*/re(Ya,{})]}))]})};jr.displayName="JVR.TypeUrl";var Tr=e=>{var t=e.children,a=e.keyName,r=e.keys,n=ya(),i=n.Date,l=void 0===i?{}:i,s=n.displayDataTypes,o=l.as,d=l.render,c=V(l,hr),m=o||"span",p=L({},kr,l.style||{}),u=d&&"function"==typeof d,h=u&&d(L({},c,{style:p}),{type:"type",value:t,keyName:a,keys:r}),f=t instanceof Date?t.toLocaleString():t,x=u&&d(L({},c,{children:f,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
46
|
+
return ne(q,{children:[s&&(h||/*#__PURE__*/re(m,L({},c,{style:p}))),x||/*#__PURE__*/re(m,L({},c,{className:"w-rjv-value",children:f}))]})};Tr.displayName="JVR.TypeDate";var Ir=e=>{var t=e.children,a=e.keyName,r=e.keys,n=ya(),i=n.Undefined,l=void 0===i?{}:i,s=n.displayDataTypes,o=l.as,d=l.render,c=V(l,fr),m=o||"span",p=L({},kr,l.style||{}),u=d&&"function"==typeof d,h=u&&d(L({},c,{style:p}),{type:"type",value:t,keyName:a,keys:r}),f=u&&d(L({},c,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
47
|
+
return ne(q,{children:[s&&(h||/*#__PURE__*/re(m,L({},c,{style:p}))),f||/*#__PURE__*/re(m,L({},c,{className:"w-rjv-value",children:"undefined"}))]})};Ir.displayName="JVR.TypeUndefined";var Lr=e=>{var t=e.children,a=e.keyName,r=e.keys,n=ya(),i=n.Null,l=void 0===i?{}:i,s=n.displayDataTypes,o=l.as,d=l.render,c=V(l,xr),m=o||"span",p=L({},kr,l.style||{}),u=d&&"function"==typeof d,h=u&&d(L({},c,{style:p}),{type:"type",value:t,keyName:a,keys:r}),f=u&&d(L({},c,{children:t,className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
48
|
+
return ne(q,{children:[s&&(h||/*#__PURE__*/re(m,L({},c,{style:p}))),f||/*#__PURE__*/re(m,L({},c,{className:"w-rjv-value",children:"null"}))]})};Lr.displayName="JVR.TypeNull";var Rr=e=>{var t=e.children,a=e.keyName,r=e.keys,n=ya(),i=n.Nan,l=void 0===i?{}:i,s=n.displayDataTypes,o=l.as,d=l.render,c=V(l,gr),m=o||"span",p=L({},kr,l.style||{}),u=d&&"function"==typeof d,h=u&&d(L({},c,{style:p}),{type:"type",value:t,keyName:a,keys:r}),f=u&&d(L({},c,{children:null==t?void 0:t.toString(),className:"w-rjv-value"}),{type:"value",value:t,keyName:a,keys:r});/*#__PURE__*/
|
|
49
|
+
return ne(q,{children:[s&&(h||/*#__PURE__*/re(m,L({},c,{style:p}))),f||/*#__PURE__*/re(m,L({},c,{className:"w-rjv-value",children:"NaN"}))]})};Rr.displayName="JVR.TypeNan";var Er=e=>{var t=e.value,a={keyName:e.keyName,keys:e.keys};return t instanceof URL?/*#__PURE__*/re(jr,L({},a,{children:t})):"string"==typeof t?/*#__PURE__*/re(Nr,L({},a,{children:t})):!0===t?/*#__PURE__*/re(zr,L({},a,{children:t})):!1===t?/*#__PURE__*/re(wr,L({},a,{children:t})):null===t?/*#__PURE__*/re(Lr,L({},a,{children:t})):void 0===t?/*#__PURE__*/re(Ir,L({},a,{children:t})):t instanceof Date?/*#__PURE__*/re(Tr,L({},a,{children:t})):"number"==typeof t&&isNaN(t)?/*#__PURE__*/re(Rr,L({},a,{children:t})):"number"==typeof t&&(e=>Number(e)===e&&e%1!=0||isNaN(e))(t)?/*#__PURE__*/re(Sr,L({},a,{children:t})):"bigint"==typeof t?/*#__PURE__*/re($r,L({},a,{children:t})):"number"==typeof t?/*#__PURE__*/re(Cr,L({},a,{children:t})):null};function Vr(e,t,a){var r=_(Ta),n=[e.className,t.className].filter(Boolean).join(" "),i=L({},e,t,{className:n,style:L({},e.style,t.style),children:t.children||e.children});X(()=>r({[a]:i}),[t])}function Ar(e,t,a){var r=_(ka),n=[e.className,t.className].filter(Boolean).join(" "),i=L({},e,t,{className:n,style:L({},e.style,t.style),children:t.children||e.children});X(()=>r({[a]:i}),[t])}function Mr(e,t,a){var r=_(Aa),n=[e.className,t.className].filter(Boolean).join(" "),i=L({},e,t,{className:n,style:L({},e.style,t.style),children:t.children||e.children});X(()=>r({[a]:i}),[t])}Er.displayName="JVR.Value";var Dr=["as","render"],Or=e=>{var t=Va().KeyName;return Mr(void 0===t?{}:t,e,"KeyName"),null};Or.displayName="JVR.KeyName";var Fr=e=>{var t=e.children,a=e.value,r=e.parentValue,n=e.keyName,i=e.keys,l={color:"number"==typeof t?"var(--w-rjv-key-number, #268bd2)":"var(--w-rjv-key-string, #002b36)"},s=Va().KeyName,o=void 0===s?{}:s,d=o.as,c=o.render,m=V(o,Dr);m.style=L({},m.style,l);var p=d||"span";return c&&"function"==typeof c&&c(L({},m,{children:t}),{value:a,parentValue:r,keyName:n,keys:i||(n?[n]:[])})||/*#__PURE__*/re(p,L({},m,{children:t}))};Fr.displayName="JVR.KeyNameComp";var Jr=["children","value","parentValue","keyName","keys"],Br=["as","render","children"],Pr=e=>{var t=Va().Row;return Mr(void 0===t?{}:t,e,"Row"),null};Pr.displayName="JVR.Row";var qr=e=>{var t=e.children,a=e.value,r=e.parentValue,n=e.keyName,i=e.keys,l=V(e,Jr),s=Va().Row,o=void 0===s?{}:s,d=o.as,c=o.render;o.children;var m=V(o,Br),p=d||"div";return c&&"function"==typeof c&&c(L({},l,m,{children:t}),{value:a,keyName:n,parentValue:r,keys:i})||/*#__PURE__*/re(p,L({},l,m,{children:t}))};qr.displayName="JVR.RowComp";var Wr=["keyName","value","parentValue","expandKey","keys","beforeCopy"],Ur=["as","render"],Hr=e=>{var t=e.keyName,a=e.value,r=e.parentValue,n=e.expandKey,i=e.keys,l=e.beforeCopy,s=V(e,Wr),o=Ba(),d=o.onCopied,c=o.enableClipboard,m=o.beforeCopy,p=_(la)[n],u=ee(!1),h=u[0],f=u[1],x=Va().Copied,g=void 0===x?{}:x,v=null==g?void 0:g.beforeCopy;if(!1===c||!p)return null;var b={style:{display:"inline-flex"},fill:h?"var(--w-rjv-copied-success-color, #28a745)":"var(--w-rjv-copied-color, currentColor)",onClick:e=>{e.stopPropagation();var s="";s="number"==typeof a&&a===1/0?"Infinity":"number"==typeof a&&isNaN(a)?"NaN":"bigint"==typeof a?vr(a):a instanceof Date?a.toLocaleString():JSON.stringify(a,(e,t)=>"bigint"==typeof t?vr(t):t,2);var o=l||v||m;o&&"function"==typeof o&&(s=o(s,t,a,r,n,i)),d&&d(s,a),f(!0),(navigator.clipboard||{writeText:e=>new Promise((t,a)=>{var r=document.createElement("textarea");r.style.position="absolute",r.style.opacity="0",r.style.left="-99999999px",r.value=e,document.body.appendChild(r),r.select(),document.execCommand("copy")?t():a(),r.remove()})}).writeText(s).then(()=>{var e=setTimeout(()=>{f(!1),clearTimeout(e)},3e3)}).catch(e=>{})}};g.as;var y=g.render,k=V(g,Ur),N=L({},k,s,b,{style:L({},k.style,s.style,b.style)});return y&&"function"==typeof y&&y(L({},N,{"data-copied":h}),{value:a,keyName:t,keys:i,parentValue:r})||/*#__PURE__*/re("svg",L({viewBox:"0 0 32 36"},N,h?{children:/*#__PURE__*/re("path",{d:"M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"})}:{children:/*#__PURE__*/re("path",{d:"M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"})}))};function Kr(){var e=Y(null);return null===e.current&&(e.current="custom-id-"+Math.random().toString(36).substr(2,9)),e.current}Hr.displayName="JVR.Copied";var Qr=e=>{var t,a=e.keyName,r=e.value,n=e.expandKey,i=void 0===n?"":n,l=e.level,s=e.keys,o=void 0===s?[]:s,d=e.parentValue,c=ha(),m=Ba(),p=m.objectSortKeys,u=m.indentWidth,h=m.collapsed,f=m.shouldExpandNodeInitially,x="boolean"==typeof h?h:"number"==typeof h&&l>h,g=null!=(t=c[i])?t:!f&&x,v=f&&f(!g,{value:r,keys:o,level:l,keyName:a,parentValue:d});if(f&&!1===h){if(void 0===c[i]&&!v)return null}else if(void 0===c[i]&&v)return null;if(g)return null;var b=Array.isArray(r)?Object.entries(r).map(e=>[Number(e[0]),e[1]]):Object.entries(r);return p&&(b=!0===p?b.sort((e,t)=>{var a=e[0],r=t[0];return"string"==typeof a&&"string"==typeof r?a.localeCompare(r):0}):b.sort((e,t)=>{var a=e[0],r=e[1],n=t[0],i=t[1];return"string"==typeof a&&"string"==typeof n?p(a,n,r,i):0})),/*#__PURE__*/re("div",{className:"w-rjv-wrap",style:{borderLeft:"var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)",paddingLeft:u,marginLeft:6},children:b.map((e,t)=>{var a=e[0],n=e[1];/*#__PURE__*/
|
|
50
|
+
return re(Xr,{parentValue:r,keyName:a,keys:[...o,a],value:n,level:l},t)})})};Qr.displayName="JVR.KeyValues";var _r=e=>{var t=e.keyName,a=e.parentValue,r=e.keys,n=e.value,i=Ba().highlightUpdates,l="number"==typeof t,s=Y(null);!function(e){var t=e.value,a=e.highlightUpdates,r=e.highlightContainer,n=function(e){var t=Y();return X(()=>{t.current=e}),t.current}(t),i=Z(()=>!(!a||void 0===n)&&(typeof t!=typeof n||("number"==typeof t?!(isNaN(t)&&isNaN(n)||t===n):Array.isArray(t)!==Array.isArray(n)||"object"!=typeof t&&"function"!=typeof t&&(t!==n||void 0))),[a,t]);X(()=>{r&&r.current&&i&&"animate"in r.current&&r.current.animate([{backgroundColor:"var(--w-rjv-update-color, #ebcb8b)"},{backgroundColor:""}],{duration:1e3,easing:"ease-in"})},[i,t,r])}({value:n,highlightUpdates:i,highlightContainer:s});var o={keyName:t,value:n,keys:r,parentValue:a};/*#__PURE__*/
|
|
51
|
+
return ne(q,{children:[/*#__PURE__*/ne("span",{ref:s,children:[
|
|
52
|
+
/*#__PURE__*/re(Ga,L({isNumber:l,"data-placement":"left"},o)),
|
|
53
|
+
/*#__PURE__*/re(Fr,L({},o,{children:t})),
|
|
54
|
+
/*#__PURE__*/re(Ga,L({isNumber:l,"data-placement":"right"},o))]}),/*#__PURE__*/re(er,L({},o))]})};_r.displayName="JVR.KayName";var Xr=e=>{var t=e.keyName,a=e.value,r=e.parentValue,n=e.level,i=void 0===n?0:n,l=e.keys,s=void 0===l?[]:l,o=da(),d=Kr(),c=Array.isArray(a),m=a instanceof Set,p=a instanceof Map,u=a instanceof Date,h=a instanceof URL;if(a&&"object"==typeof a&&!c&&!m&&!p&&!u&&!h||c||m||p){var f=m?Array.from(a):p?Object.fromEntries(a):a;/*#__PURE__*/
|
|
55
|
+
return re(mn,{keyName:t,value:f,parentValue:r,initialValue:a,keys:s,level:i+1})}/*#__PURE__*/
|
|
56
|
+
return ne(qr,L({className:"w-rjv-line",value:a,keyName:t,keys:s,parentValue:r},{onMouseEnter:()=>o({[d]:!0}),onMouseLeave:()=>o({[d]:!1})},{children:[
|
|
57
|
+
/*#__PURE__*/re(_r,{keyName:t,value:a,keys:s,parentValue:r}),
|
|
58
|
+
/*#__PURE__*/re(Er,{keyName:t,value:a,keys:s}),
|
|
59
|
+
/*#__PURE__*/re(Hr,{keyName:t,value:a,keys:s,parentValue:r,expandKey:d})]}))};Xr.displayName="JVR.KeyValuesItem";var Zr=["value","keyName"],Gr=["as","render"],Yr=e=>{var t=Va().CountInfoExtra;return Mr(void 0===t?{}:t,e,"CountInfoExtra"),null};Yr.displayName="JVR.CountInfoExtra";var en=e=>{var t=e.value,a=void 0===t?{}:t,r=e.keyName,n=V(e,Zr),i=Va().CountInfoExtra,l=void 0===i?{}:i,s=l.as,o=l.render,d=V(l,Gr);if(!o&&!d.children)return null;var c=s||"span",m=o&&"function"==typeof o,p=L({},d,n);return m&&o(p,{value:a,keyName:r})||/*#__PURE__*/re(c,L({},p))};en.displayName="JVR.CountInfoExtraComps";var tn=["value","keyName"],an=["as","render"],rn=e=>{var t=Va().CountInfo;return Mr(void 0===t?{}:t,e,"CountInfo"),null};rn.displayName="JVR.CountInfo";var nn=e=>{var t=e.value,a=void 0===t?{}:t,r=e.keyName,n=V(e,tn),i=Ba().displayObjectSize,l=Va().CountInfo,s=void 0===l?{}:l;if(!i)return null;var o=s.as,d=s.render,c=V(s,an),m=o||"span";c.style=L({},c.style,e.style);var p=Object.keys(a).length;c.children||(c.children=p+" item"+(1===p?"":"s"));var u=L({},c,n);return d&&"function"==typeof d&&d(L({},u,{"data-length":p}),{value:a,keyName:r})||/*#__PURE__*/re(m,L({},u))};nn.displayName="JVR.CountInfoComp";var ln=["as","render"],sn=e=>{var t=Va().Ellipsis;return Mr(void 0===t?{}:t,e,"Ellipsis"),null};sn.displayName="JVR.Ellipsis";var on=e=>{var t=e.isExpanded,a=e.value,r=e.keyName,n=Va().Ellipsis,i=void 0===n?{}:n,l=i.as,s=i.render,o=V(i,ln),d=l||"span";return s&&"function"==typeof s&&s(L({},o,{"data-expanded":t}),{value:a,keyName:r})||(!t||"object"==typeof a&&0==Object.keys(a).length?null:/*#__PURE__*/re(d,L({},o)))};on.displayName="JVR.EllipsisComp";var dn=e=>{var t,a=e.keyName,r=e.expandKey,n=e.keys,i=void 0===n?[]:n,l=e.initialValue,s=e.value,o=e.parentValue,d=e.level,c=ha(),m=_(fa),p=Ba(),u=p.onExpand,h=p.collapsed,f=p.shouldExpandNodeInitially,x="boolean"==typeof h?h:"number"==typeof h&&d>h,g=null!=(t=c[r])?t:!f&&x,v=f&&f(!g,{value:s,keys:i,level:d,keyName:a,parentValue:o});void 0===c[r]&&f&&(g=!v);var b={transform:"rotate("+(g?"-90":"0")+"deg)",transition:"all 0.3s"},y=Object.keys(s).length,k="object"==typeof s,N=Array.isArray(s),z=s instanceof Set,w=0!==y&&(N||z||k),S={style:{display:"inline-flex",alignItems:"center"}};w&&(S.onClick=()=>{var e={expand:!g,value:s,keyid:r,keyName:a};u&&u(e),m({[r]:e.expand})});var C={keyName:a,value:s,keys:i,parentValue:o};/*#__PURE__*/
|
|
60
|
+
return ne("span",L({},S,{children:[w&&/*#__PURE__*/re(tr,L({style:b,expandKey:r},C)),(a||"number"==typeof a)&&/*#__PURE__*/re(_r,L({},C)),
|
|
61
|
+
/*#__PURE__*/re(br,{value:l,keyName:a}),
|
|
62
|
+
/*#__PURE__*/re(yr,{value:l,keyName:a}),
|
|
63
|
+
/*#__PURE__*/re(ar,L({isBrackets:N||z},C)),
|
|
64
|
+
/*#__PURE__*/re(on,{keyName:a,value:s,isExpanded:g}),
|
|
65
|
+
/*#__PURE__*/re(rr,L({isVisiable:g||!w,isBrackets:N||z},C)),
|
|
66
|
+
/*#__PURE__*/re(nn,{value:s,keyName:a}),
|
|
67
|
+
/*#__PURE__*/re(en,{value:s,keyName:a}),
|
|
68
|
+
/*#__PURE__*/re(Hr,{keyName:a,value:s,expandKey:r,parentValue:o,keys:i})]}))};dn.displayName="JVR.NestedOpen";var cn=["className","children","parentValue","keyid","level","value","initialValue","keys","keyName"],mn=/*#__PURE__*/U((e,t)=>{var a=e.className,r=void 0===a?"":a;e.children;var n=e.parentValue;e.keyid;var i=e.level,l=void 0===i?1:i,s=e.value,o=e.initialValue,d=e.keys,c=e.keyName,m=V(e,cn),p=da(),u=Kr(),h=[r,"w-rjv-inner"].filter(Boolean).join(" ");/*#__PURE__*/
|
|
69
|
+
return ne("div",L({className:h,ref:t},m,{onMouseEnter:()=>p({[u]:!0}),onMouseLeave:()=>p({[u]:!1})},{children:[
|
|
70
|
+
/*#__PURE__*/re(dn,{expandKey:u,value:s,level:l,keys:d,parentValue:n,keyName:c,initialValue:o}),
|
|
71
|
+
/*#__PURE__*/re(Qr,{expandKey:u,value:s,level:l,keys:d,parentValue:n,keyName:c}),
|
|
72
|
+
/*#__PURE__*/re(nr,{expandKey:u,value:s,level:l,keys:d,parentValue:n,keyName:c})]}))});mn.displayName="JVR.Container";var pn=e=>{var t=ja().BraceLeft;return Vr(void 0===t?{}:t,e,"BraceLeft"),null};pn.displayName="JVR.BraceLeft";var un=e=>{var t=ja().BraceRight;return Vr(void 0===t?{}:t,e,"BraceRight"),null};un.displayName="JVR.BraceRight";var hn=e=>{var t=ja().BracketsLeft;return Vr(void 0===t?{}:t,e,"BracketsLeft"),null};hn.displayName="JVR.BracketsLeft";var fn=e=>{var t=ja().BracketsRight;return Vr(void 0===t?{}:t,e,"BracketsRight"),null};fn.displayName="JVR.BracketsRight";var xn=e=>{var t=ja().Arrow;return Vr(void 0===t?{}:t,e,"Arrow"),null};xn.displayName="JVR.Arrow";var gn=e=>{var t=ja().Colon;return Vr(void 0===t?{}:t,e,"Colon"),null};gn.displayName="JVR.Colon";var vn=e=>{var t=ja().Quote;return Vr(void 0===t?{}:t,e,"Quote"),null};vn.displayName="JVR.Quote";var bn=e=>{var t=ja().ValueQuote;return Vr(void 0===t?{}:t,e,"ValueQuote"),null};bn.displayName="JVR.ValueQuote";var yn=e=>{var t=ya().Bigint;return Ar(void 0===t?{}:t,e,"Bigint"),null};yn.displayName="JVR.Bigint";var kn=e=>{var t=ya().Date;return Ar(void 0===t?{}:t,e,"Date"),null};kn.displayName="JVR.Date";var Nn=e=>{var t=ya().False;return Ar(void 0===t?{}:t,e,"False"),null};Nn.displayName="JVR.False";var zn=e=>{var t=ya().Float;return Ar(void 0===t?{}:t,e,"Float"),null};zn.displayName="JVR.Float";var wn=e=>{var t=ya().Int;return Ar(void 0===t?{}:t,e,"Int"),null};wn.displayName="JVR.Int";var Sn=e=>{var t=ya().Map;return Ar(void 0===t?{}:t,e,"Map"),null};Sn.displayName="JVR.Map";var Cn=e=>{var t=ya().Nan;return Ar(void 0===t?{}:t,e,"Nan"),null};Cn.displayName="JVR.Nan";var $n=e=>{var t=ya().Null;return Ar(void 0===t?{}:t,e,"Null"),null};$n.displayName="JVR.Null";var jn=e=>{var t=ya().Set;return Ar(void 0===t?{}:t,e,"Set"),null};jn.displayName="JVR.Set";var Tn=e=>{var t=ya().Str;return Ar(void 0===t?{}:t,e,"Str"),null};Tn.displayName="JVR.StringText";var In=e=>{var t=ya().True;return Ar(void 0===t?{}:t,e,"True"),null};In.displayName="JVR.True";var Ln=e=>{var t=ya().Undefined;return Ar(void 0===t?{}:t,e,"Undefined"),null};Ln.displayName="JVR.Undefined";var Rn=e=>{var t=ya().Url;return Ar(void 0===t?{}:t,e,"Url"),null};Rn.displayName="JVR.Url";var En=e=>{var t=Va().Copied;return Mr(void 0===t?{}:t,e,"Copied"),null};En.displayName="JVR.Copied";var Vn=["className","style","value","children","collapsed","shouldExpandNodeInitially","indentWidth","displayObjectSize","shortenTextAfterLength","stringEllipsis","highlightUpdates","enableClipboard","displayDataTypes","objectSortKeys","onExpand","onCopied","beforeCopy"],An=/*#__PURE__*/U((e,t)=>{var a=e.className,r=void 0===a?"":a,n=e.style,i=e.value,l=e.children,s=e.collapsed,o=void 0!==s&&s,d=e.shouldExpandNodeInitially,c=e.indentWidth,m=void 0===c?15:c,p=e.displayObjectSize,u=void 0===p||p,h=e.shortenTextAfterLength,f=void 0===h?30:h,x=e.stringEllipsis,g=e.highlightUpdates,v=void 0===g||g,b=e.enableClipboard,y=void 0===b||b,k=e.displayDataTypes,N=void 0===k||k,z=e.objectSortKeys,w=void 0!==z&&z,S=e.onExpand,C=e.onCopied,$=e.beforeCopy,j=V(e,Vn),T=L({lineHeight:1.4,fontFamily:"var(--w-rjv-font-family, Menlo, monospace)",color:"var(--w-rjv-color, #002b36)",backgroundColor:"var(--w-rjv-background-color, #00000000)",fontSize:13},n),I=["w-json-view-container","w-rjv",r].filter(Boolean).join(" ");/*#__PURE__*/
|
|
73
|
+
return ne(Pa,{initialState:{value:i,objectSortKeys:w,indentWidth:m,shouldExpandNodeInitially:!1===o?d:void 0,displayObjectSize:u,collapsed:o,enableClipboard:y,shortenTextAfterLength:f,stringEllipsis:x,highlightUpdates:v,onCopied:C,onExpand:S,beforeCopy:$},initialTypes:{displayDataTypes:N},children:[/*#__PURE__*/re(mn,L({value:i},j,{ref:t,className:I,style:T})),l]})});An.Bigint=yn,An.Date=kn,An.False=Nn,An.Float=zn,An.Int=wn,An.Map=Sn,An.Nan=Cn,An.Null=$n,An.Set=jn,An.String=Tn,An.True=In,An.Undefined=Ln,An.Url=Rn,An.ValueQuote=bn,An.Arrow=xn,An.Colon=gn,An.Quote=vn,An.Ellipsis=sn,An.BraceLeft=pn,An.BraceRight=un,An.BracketsLeft=hn,An.BracketsRight=fn,An.Copied=En,An.CountInfo=rn,An.CountInfoExtra=Yr,An.KeyName=Or,An.Row=Pr,An.displayName="JVR.JsonView";var Mn,Dn={"--w-rjv-font-family":"monospace","--w-rjv-color":"#9cdcfe","--w-rjv-key-string":"#9cdcfe","--w-rjv-background-color":"#1e1e1e","--w-rjv-line-color":"#36334280","--w-rjv-arrow-color":"#838383","--w-rjv-edit-color":"var(--w-rjv-color)","--w-rjv-info-color":"#9c9c9c7a","--w-rjv-update-color":"#9cdcfe","--w-rjv-copied-color":"#9cdcfe","--w-rjv-copied-success-color":"#28a745","--w-rjv-curlybraces-color":"#d4d4d4","--w-rjv-colon-color":"#d4d4d4","--w-rjv-brackets-color":"#d4d4d4","--w-rjv-quotes-color":"var(--w-rjv-key-string)","--w-rjv-quotes-string-color":"var(--w-rjv-type-string-color)","--w-rjv-type-string-color":"#ce9178","--w-rjv-type-int-color":"#b5cea8","--w-rjv-type-float-color":"#b5cea8","--w-rjv-type-bigint-color":"#b5cea8","--w-rjv-type-boolean-color":"#569cd6","--w-rjv-type-date-color":"#b5cea8","--w-rjv-type-url-color":"#3b89cf","--w-rjv-type-null-color":"#569cd6","--w-rjv-type-nan-color":"#859900","--w-rjv-type-undefined-color":"#569cd6"},On={...Dn,width:"100%",overflow:"auto",padding:"6px",fontSize:"11px"},Fn=({value:e})=>{let{resolvedTheme:t}=w();return"object"==typeof e&&e?/* @__PURE__ */re(An,{value:e,style:"dark"===t?On:void 0,enableClipboard:!1,displayDataTypes:!1,collapsed:2}):/* @__PURE__ */re("pre",{className:"overflow-auto p-1.5 font-mono text-[11px] break-words whitespace-pre-wrap text-zinc-600 dark:text-zinc-300",children:JSON.stringify(e)})},Jn=({className:e,logType:t="info",iconClassName:a,title:r,children:n})=>{let i="danger"===t?"fa-regular fa-circle-xmark":"warning"===t?"fa-solid fa-triangle-exclamation":"info"===t?"fa-solid fa-circle-info":"success"===t?"fa-solid fa-check":"fa-solid fa-circle";/* @__PURE__ */
|
|
74
|
+
return ne("div",{className:x("flex items-center gap-1",e),title:r,children:[/* @__PURE__ */re("i",{className:x(a??i,{"text-red-500 dark:text-red-400":"danger"===t,"text-amber-500 dark:text-amber-400":"warning"===t,"text-violet-500 dark:text-violet-400":"info"===t,"text-emerald-500 dark:text-emerald-400":"success"===t,"text-zinc-500 dark:text-zinc-400":!["danger","warning","info","success"].includes(t)},"text-xs")}),n]})},Bn=({bar:e,selected:t,onSelect:a})=>{let{step:r,offset:n,width:i}=e,l=Q(()=>a(r.id),[a,r.id]);/* @__PURE__ */
|
|
75
|
+
return ne("button",{type:"button",onClick:l,"aria-pressed":t,className:x("flex w-full flex-col gap-1 rounded px-1.5 py-1 text-left transition-colors",{"bg-violet-500/10":t,"hover:bg-zinc-100 dark:hover:bg-zinc-800":!t}),children:[
|
|
76
|
+
/* @__PURE__ */ne("div",{className:"flex items-center gap-1.5 text-[11px]",children:[
|
|
77
|
+
/* @__PURE__ */re(Jn,{logType:Gt(r.status),iconClassName:Yt[r.status]}),
|
|
78
|
+
/* @__PURE__ */re("span",{className:"truncate font-medium text-zinc-700 dark:text-zinc-200",children:r.title}),
|
|
79
|
+
/* @__PURE__ */re("span",{className:"truncate font-mono text-[10px] text-zinc-400 dark:text-zinc-500",children:r.action}),
|
|
80
|
+
/* @__PURE__ */re("span",{className:"ml-auto shrink-0 text-zinc-400 tabular-nums dark:text-zinc-500",children:Kt(r.endTime-r.startTime)})]}),
|
|
81
|
+
/* @__PURE__ */re("div",{className:"h-1 w-full rounded-full bg-zinc-100 dark:bg-zinc-800",children:/* @__PURE__ */re("div",{className:x("h-1 rounded-full",ea[r.status]),style:{marginLeft:100*n+"%",width:100*i+"%"}})}),void 0!==r.error&&/* @__PURE__ */re("span",{className:"text-[10px] break-words text-red-600 dark:text-red-400",children:r.error})]})},Pn=({steps:e,selectedStepId:t,onSelectStep:a})=>{let r=Z(()=>(e=>{if(0===e.length)return[];let t=Math.min(...e.map(e=>e.startTime)),a=Math.max(...e.map(e=>e.endTime))-t;return e.map(e=>a<=0?{step:e,offset:0,width:1}:{step:e,offset:(e.startTime-t)/a,width:Math.max((e.endTime-e.startTime)/a,.02)})})(e),[e]),n=r.filter(e=>"flow"===e.step.phase),i=r.filter(e=>"undo"===e.step.phase);/* @__PURE__ */
|
|
82
|
+
return ne("div",{className:"flex flex-col gap-0.5",children:[n.map(e=>/* @__PURE__ */re(Bn,{bar:e,selected:e.step.id===t,onSelect:a},e.step.id)),i.length>0&&/* @__PURE__ */ne("div",{className:"mt-2 flex items-center gap-1.5 px-1.5 text-[10px] font-medium tracking-wide text-amber-600 uppercase dark:text-amber-400",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-rotate-left"}),"Compensation"]}),i.map(e=>/* @__PURE__ */re(Bn,{bar:e,selected:e.step.id===t,onSelect:a},e.step.id))]})},qn={info:"bg-violet-500/15 text-violet-600 dark:text-violet-400",success:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",danger:"bg-red-500/15 text-red-600 dark:text-red-400",warning:"bg-amber-500/15 text-amber-600 dark:text-amber-400",custom:"bg-zinc-500/15 text-zinc-500 dark:text-zinc-400"},Wn=({run:e,selectedStepId:t,onSelectStep:a})=>{let r=na(e.steps),n=Ht(e),i=Z(()=>void 0===t?void 0:((e,t)=>e?.find(e=>(e=>{let{node:t}=e;if("object"!=typeof t||!t||!("id"in t))return;let{id:a}=t;return"string"==typeof a?a:void 0})(e)===t)?.result)(e.trace,t),[e.trace,t]);/* @__PURE__ */
|
|
83
|
+
return ne(ae,{children:[
|
|
84
|
+
/* @__PURE__ */ne("div",{className:"flex items-center gap-1.5",children:[/* @__PURE__ */re("span",{className:"truncate text-xs font-medium text-zinc-700 dark:text-zinc-100",children:e.actionId||"(no action named)"}),/* @__PURE__ */re("span",{className:x("shrink-0 rounded px-1 py-0.5 text-[9px]",qn[Xt(e.status)]),children:e.reason??e.status})]}),void 0!==e.error&&/* @__PURE__ */ne("div",{className:"mt-1 flex flex-col gap-1 rounded border border-red-200 bg-red-50 px-2 py-1.5 dark:border-red-500/30 dark:bg-red-500/10",children:[/* @__PURE__ */ne("span",{className:"font-medium text-red-600 dark:text-red-400",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-circle-exclamation mr-1"}),void 0===r?"The run failed":`Failed at “${r.title}”`]}),/* @__PURE__ */re("span",{className:"break-words text-red-700 dark:text-red-300",children:e.error})]}),
|
|
85
|
+
/* @__PURE__ */re("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Flow"}),void 0===e.steps&&/* @__PURE__ */re("span",{className:"text-zinc-400 italic dark:text-zinc-500",children:Ut(e)?"The flow is still running. Its steps arrive with the answer.":"The server did not send the steps for this run: the action is behind a session, or this page is not authorized to debug it."}),void 0!==e.steps&&/* @__PURE__ */re(Pn,{steps:e.steps,selectedStepId:t,onSelectStep:a}),void 0!==t&&void 0===i&&/* @__PURE__ */re("span",{className:"text-zinc-400 italic dark:text-zinc-500",children:"This page was sent what the flow DID, not what each step read or answered. Open the action in the builder, or run the deployment in dev mode, to inspect a step."}),void 0!==i&&/* @__PURE__ */re("div",{className:"overflow-auto rounded border border-zinc-200 dark:border-zinc-700",children:/* @__PURE__ */re(Fn,{value:i})}),
|
|
86
|
+
/* @__PURE__ */re("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Run"}),
|
|
87
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Mode"}),/* @__PURE__ */re("span",{className:"text-zinc-700 dark:text-zinc-200",children:ta[e.mode]})]}),
|
|
88
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Started"}),/* @__PURE__ */re("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:Qt(e.startedAt)})]}),
|
|
89
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Took"}),/* @__PURE__ */re("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:void 0===n?"still running":Kt(n)})]}),void 0!==e.elementId&&/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Element"}),/* @__PURE__ */re("span",{className:"truncate font-mono text-zinc-600 dark:text-zinc-300",children:e.elementId})]}),void 0!==e.runId&&/* @__PURE__ */ne("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Run id"}),/* @__PURE__ */re("span",{className:"font-mono break-all text-zinc-600 dark:text-zinc-300",children:e.runId})]}),void 0!==e.input&&/* @__PURE__ */ne(ae,{children:[/* @__PURE__ */re("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Input"}),/* @__PURE__ */re("div",{className:"overflow-auto rounded border border-zinc-200 dark:border-zinc-700",children:/* @__PURE__ */re(Fn,{value:e.input})})]}),void 0!==e.output&&/* @__PURE__ */ne(ae,{children:[/* @__PURE__ */re("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Output"}),/* @__PURE__ */re("div",{className:"overflow-auto rounded border border-zinc-200 dark:border-zinc-700",children:/* @__PURE__ */re(Fn,{value:e.output})})]}),e.progress.length>0&&/* @__PURE__ */ne(ae,{children:[/* @__PURE__ */ne("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:["Progress (",e.progress.length,")"]}),/* @__PURE__ */re("div",{className:"overflow-auto rounded border border-zinc-200 dark:border-zinc-700",children:/* @__PURE__ */re(Fn,{value:e.progress})})]})]})},Un={running:"fa-solid fa-circle-notch fa-spin",streaming:"fa-solid fa-circle-notch fa-spin",accepted:"fa-solid fa-paper-plane",completed:"fa-solid fa-check",failed:"fa-solid fa-xmark",aborted:"fa-solid fa-hand",skipped:"fa-solid fa-forward"},Hn={info:"border-l-violet-400",success:"border-l-emerald-400",danger:"border-l-red-400",warning:"border-l-amber-400",custom:"border-l-zinc-300 dark:border-l-zinc-600"},Kn=({run:e,selected:t,onSelect:r,onCancel:n})=>{let i=Q(()=>r(e.id),[r,e.id]),l=Q(()=>n(e.id),[n,e.id]),s=na(e.steps),o=Ht(e);/* @__PURE__ */
|
|
90
|
+
return ne("div",{className:x("flex items-center gap-2 border-b border-l-2 px-2",Hn[Xt(e.status)],{"border-b-zinc-100 bg-violet-500/5 dark:border-b-zinc-800":t,"border-b-zinc-100 hover:bg-zinc-50 dark:border-b-zinc-800 dark:hover:bg-zinc-800/60":!t}),children:[/* @__PURE__ */ne("button",{type:"button",className:"flex grow flex-col gap-0.5 py-1.5 text-left",onClick:i,children:[/* @__PURE__ */ne("div",{className:"flex items-center gap-1.5 text-[11px]",children:[
|
|
91
|
+
/* @__PURE__ */re(Jn,{logType:Xt(e.status),iconClassName:Un[e.status]}),
|
|
92
|
+
/* @__PURE__ */re("span",{className:"truncate font-medium text-zinc-700 dark:text-zinc-100",children:e.actionId||"(no action named)"}),
|
|
93
|
+
/* @__PURE__ */ne("span",{className:"flex shrink-0 items-center gap-1 rounded-sm bg-zinc-100 px-1 text-[9px] text-zinc-500 uppercase dark:bg-zinc-800 dark:text-zinc-400",title:"render"===e.mode?"Run by the server while it built this page":void 0,children:[/* @__PURE__ */re("i",{className:aa[e.mode]}),ta[e.mode]]}),
|
|
94
|
+
/* @__PURE__ */re("span",{className:"ml-auto shrink-0 text-zinc-400 tabular-nums dark:text-zinc-500",children:void 0===o?"…":Kt(o)})]}),/* @__PURE__ */ne("div",{className:"flex items-center gap-1.5 text-[10px] text-zinc-400 dark:text-zinc-500",children:[
|
|
95
|
+
/* @__PURE__ */re("span",{className:"shrink-0 tabular-nums",children:Qt(e.startedAt)}),void 0!==e.steps&&/* @__PURE__ */re("span",{className:"shrink-0",children:ra(e.steps.length)}),void 0!==e.elementId&&/* @__PURE__ */re("span",{className:"truncate font-mono",children:e.elementId}),void 0!==s&&/* @__PURE__ */ne("span",{className:"truncate text-red-500 dark:text-red-400",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-circle-exclamation mr-1"}),s.title]}),void 0===s&&void 0!==e.reason&&/* @__PURE__ */re("span",{className:"truncate text-amber-600 dark:text-amber-400",children:e.reason})]})]}),Ut(e)&&!0===e.cancellable&&/* @__PURE__ */re(a,{size:"xs",intent:"secondary",onClick:l,children:"Cancel"})]})},Qn=({runs:e,total:t,selectedRunId:a,onSelect:r,onCancel:n})=>/* @__PURE__ */ne("div",{className:"flex min-w-0 grow flex-col overflow-auto",children:[0===t&&/* @__PURE__ */re("div",{className:"p-3 text-[11px] text-zinc-500 dark:text-zinc-400",children:"No server action has run on this page yet. A run appears the moment one is SENT — including the ones that never come back — and the server adds the ones it ran to build the page."}),t>0&&0===e.length&&/* @__PURE__ */re("div",{className:"p-3 text-[11px] text-zinc-500 dark:text-zinc-400",children:"No run matches this filter."}),e.map(e=>/* @__PURE__ */re(Kn,{run:e,selected:e.id===a,onSelect:r,onCancel:n},e.id))]}),_n=()=>{let{runs:e,clear:t}=l(),[a]=d("actions.endpoint"),[r,n]=A("plitzi-sdk.dev-tools.actions.filter","all"),[i,o]=ee(""),[c,m]=ee(),[p,u]=ee(),h=Z(()=>((e,t,a)=>e.filter(e=>!("live"===t&&!Ut(e)||"failed"===t&&!(e=>"failed"===e.status||"aborted"===e.status)(e))&&((e,t)=>{let a=t.trim().toLowerCase();return""===a||[e.actionId,e.runId,e.elementId,e.status,e.reason,e.error,...(e.steps??[]).map(e=>`${e.title} ${e.action} ${e.error??""}`)].some(e=>"string"==typeof e&&e.toLowerCase().includes(a))})(e,a)))(e,r,i),[e,r,i]),f=Z(()=>e.filter(Ut).length,[e]),x=Z(()=>e.find(e=>e.id===c),[e,c]),g=Q(e=>{m(t=>t===e?void 0:e),u(void 0)},[]),v=Q(e=>{u(t=>t===e?void 0:e)},[]),b=Q(e=>s(e),[]),y=Q(()=>{t(),m(void 0),u(void 0)},[t]);/* @__PURE__ */
|
|
96
|
+
return ne("div",{className:"flex h-full w-full flex-col",children:[
|
|
97
|
+
/* @__PURE__ */re(qt,{filter:r,query:i,liveCount:f,runCount:e.length,onFilterChange:n,onQueryChange:o,onClear:y}),void 0===a&&/* @__PURE__ */re("div",{className:"shrink-0 border-b border-amber-200 bg-amber-50 px-2 py-1 text-[10px] text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-400",children:"This page is served without a Plitzi server: every action step is inert"}),
|
|
98
|
+
/* @__PURE__ */ne("div",{className:"flex min-h-0 grow",children:[/* @__PURE__ */re(Qn,{runs:h,total:e.length,selectedRunId:c,onSelect:g,onCancel:b}),void 0!==x&&/* @__PURE__ */re(Wt,{children:/* @__PURE__ */re(Wn,{run:x,selectedStepId:p,onSelectStep:v})})]})]})},Xn=({row:e,isOpen:t,value:a,onToggle:r,onExpire:n,onForget:i})=>{let l=Q(()=>r(e.key),[r,e.key]),s=Q(()=>n(e.uid,e.path),[n,e.uid,e.path]),o=Q(()=>i(e.uid,e.path),[i,e.uid,e.path]);/* @__PURE__ */
|
|
99
|
+
return ne("li",{className:"border-b border-zinc-100 last:border-0 dark:border-zinc-800",children:[
|
|
100
|
+
/* @__PURE__ */ne("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[
|
|
101
|
+
/* @__PURE__ */ne("button",{className:"flex min-w-0 grow cursor-pointer items-center gap-2 text-left",onClick:l,"aria-expanded":t,children:[
|
|
102
|
+
/* @__PURE__ */re("i",{className:x("fa-solid w-2 shrink-0 text-[9px] text-zinc-400 dark:text-zinc-500",t?"fa-chevron-down":"fa-chevron-right")}),
|
|
103
|
+
/* @__PURE__ */re("span",{className:"shrink-0 rounded-sm bg-zinc-100 px-1 text-[9px] text-zinc-500 uppercase dark:bg-zinc-800 dark:text-zinc-400",children:e.storeLabel}),
|
|
104
|
+
/* @__PURE__ */re("span",{className:"min-w-0 grow truncate font-mono text-[11px] text-zinc-700 dark:text-zinc-100",children:e.label}),e.tags.map(e=>/* @__PURE__ */re("span",{className:"shrink-0 rounded bg-violet-500/15 px-1.5 text-[10px] text-violet-600 dark:text-violet-400",children:e},e))]}),
|
|
105
|
+
/* @__PURE__ */re("span",{className:x("w-24 shrink-0 rounded px-1.5 py-0.5 text-center text-[11px] font-medium tabular-nums",e.isStale?"bg-amber-500/15 text-amber-600 dark:text-amber-400":"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400"),children:e.status}),!1===e.inUse?/* @__PURE__ */re("button",{className:"w-14 shrink-0 cursor-pointer rounded px-1.5 text-[11px] text-violet-600 hover:bg-violet-500/15 dark:text-violet-400",onClick:o,children:"Forget"}):/* @__PURE__ */re("button",{className:"w-14 shrink-0 cursor-pointer rounded px-1.5 text-[11px] text-violet-600 hover:bg-violet-500/15 dark:text-violet-400",onClick:s,children:"Expire"})]}),
|
|
106
|
+
/* @__PURE__ */ne("div",{className:"flex items-center gap-2 px-2 pb-1.5 pl-6",children:[/* @__PURE__ */re("span",{className:"h-1 min-w-0 grow overflow-hidden rounded-full bg-zinc-200 dark:bg-zinc-800",children:/* @__PURE__ */re("span",{className:x("block h-full rounded-full",e.isStale?"bg-amber-500/60":"bg-emerald-500/80"),style:{width:`${Math.round(100*e.progress)}%`}})}),/* @__PURE__ */ne("span",{className:"shrink-0 text-[10px] text-zinc-500 tabular-nums dark:text-zinc-400",children:["written ",e.age," · ttl ",e.ttl,!1===e.inUse&&" · nothing renders it"+(e.kept?` · ${e.kept}`:"")]})]}),t&&/* @__PURE__ */ne("div",{className:"max-h-56 overflow-auto border-t border-zinc-100 bg-zinc-50 px-2 py-1 dark:border-zinc-800 dark:bg-zinc-800/40",children:[/* @__PURE__ */re("div",{className:"pb-1 font-mono text-[10px] text-zinc-500 dark:text-zinc-400",children:e.path}),/* @__PURE__ */re(Fn,{value:a})]})]})},Zn=v.store,Gn=(e,t)=>{if(e===Zn&&t.startsWith("entries."))return v.store.getState().entries[t.slice(8)]},Yn=(e,t)=>{let a=Gn(e.entry.store,t);if(!a)return;let r=v.usage(a.key);return{label:a.url,tags:a.tags,usage:r&&{inUse:r.observers>0||r.holds>0,collectAt:r.collectAt}}},ei=[],ti=e=>{let t=Y(ei),a=Y(/* @__PURE__ */new WeakMap),r=Q(t=>{let a=e.map(({store:e})=>e.watchFreshness(t));return()=>a.forEach(e=>e())},[e]),n=Q(()=>{let r=e.map(e=>{let t=e.store.getFreshnessRecords(),r=a.current.get(t);return r||(r=(e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e.ttl>0)))(t),a.current.set(t,r)),{entry:e,records:r}}).filter(e=>Object.keys(e.records).length>0);return((e,t)=>e.length===t.length&&e.every((e,a)=>e.entry===t[a].entry&&e.records===t[a].records))(t.current,r)||(t.current=r.length>0?r:ei),t.current},[e]);return te(r,n,n)},ai=(e,t=0)=>{let[a,r]=ee(()=>Date.now());return X(()=>{if(!e)return;let t=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(t)},[e]),Math.max(a,t)},ri=e=>{let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let a=Math.floor(t/60);return a<60?`${a}m ${t%60}s`:`${Math.floor(a/60)}h ${a%60}m`},ni=(e,t)=>{let{store:a,name:r,scopeId:n}=e;return r?a.scopePath?`${r} · ${a.scopePath}`:r:a.scopePath?a.scopePath:a.id?a.id:void 0===n?"root":((e,t)=>{if(!t)return;let a=Object.keys(e.getState()).filter(e=>!t.has(e));return a.length>0?`{ ${a.slice(0,4).join(", ")} }`:void 0})(a,t)??"scope"},ii=e=>{let t=e.find(e=>void 0===e.scopeId);return t?new Set(Object.keys(t.store.getState())):void 0},li=(e,t,a)=>e.filter(e=>e.scopeId===t||void 0===e.scopeId&&t===a),si=(e,t)=>t&&e.some(e=>e.uid===t)?t:(e.find(e=>void 0===e.scopeId)??e.at(0))?.uid,oi=/* @__PURE__ */new Set,di=e=>(oi.add(e),()=>{oi.delete(e)}),ci=()=>Mn,mi=()=>te(di,ci,ci),pi=()=>te(o,u,u),ui=()=>{let e=pi(),{instanceIds:t,selectedId:a}=E(),r=mi();return{options:Z(()=>((e,t,a)=>{let r=ii(e);return t.map(t=>({label:t,options:li(e,t,a).map(e=>({label:ni(e,r),value:e.uid}))}))})(e,t,a),[e,t,a]),value:Z(()=>si(e,r),[e,r]),onSelect:Q(t=>{let a=e.find(e=>e.uid===t);a?.scopeId&&I(a.scopeId),(e=>{Mn!==e&&(Mn=e,(()=>{for(let e of oi)e()})())})(t)},[e])}},hi=()=>{let e=pi(),t=mi(),a=Z(()=>si(e,t),[e,t]);return Z(()=>e.find(e=>e.uid===a),[e,a])},fi=()=>{let e=(()=>{let e=pi(),{selectedId:t}=E();return Z(()=>li(e,t,t),[e,t])})(),t=ti(e),a=Z(()=>t.reduce((e,t)=>e+Object.keys(t.records).length,0),[t]),r=ai(a>0),n=Z(()=>ii(e),[e]),i=Q(e=>ni(e.entry,n),[n]),l=Z(()=>((e,t,a,r)=>{let n=a;for(let i of e)for(let e of Object.values(i.records))n=Math.max(n,e.updatedAt);return e.flatMap(e=>{let a=t(e);return Object.entries(e.records).map(([t,i])=>((e,t,a,{updatedAt:r,expiresAt:n,ttl:i},l,s)=>{let o=l>=n,d=Number.isFinite(n),c="no expiry";return o?c="stale":d&&(c=`${ri(n-l)} left`),{key:`${e.entry.uid}:${a}`,uid:e.entry.uid,storeLabel:t,path:a,label:s?.label??a,tags:s?.tags??[],isStale:o,age:`${ri(l-r)} ago`,status:c,ttl:Number.isFinite(i)?ri(i):"∞",inUse:s?.usage?.inUse,kept:s?.usage?.collectAt?`forgotten in ${ri(s.usage.collectAt-l)}`:void 0,progress:o?0:Math.min(1,Number.isFinite(i)?(n-l)/i:1)}})(e,a,t,i,n,r?.(e,t)))}).sort((e,t)=>Number(e.isStale)-Number(t.isStale)||e.storeLabel.localeCompare(t.storeLabel)||e.label.localeCompare(t.label))})(t,i,r,Yn),[t,i,r]),[s,o]=ee(""),[d,c]=ee(!1),[m,p]=ee(void 0),u=Z(()=>{let e=s.trim().toLowerCase();return l.filter(t=>!(d&&!t.isStale)&&(!e||t.label.toLowerCase().includes(e)||t.storeLabel.toLowerCase().includes(e)||t.tags.some(t=>t.toLowerCase().includes(e))))},[l,s,d]),h=Z(()=>{let e=u.find(e=>e.key===m);if(e)return t.find(t=>t.entry.uid===e.uid)?.entry.store.getPath(e.path)},[u,m,t]),f=Q(e=>p(t=>t===e?void 0:e),[]),g=Q(()=>c(e=>!e),[]),b=Q((e,a)=>{t.find(t=>t.entry.uid===e)?.entry.store.expire(a)},[t]),y=Q((e,a)=>{let r=t.find(t=>t.entry.uid===e)?.entry;r&&!((e,t)=>{let a=Gn(e,t);return!!a&&v.remove(a.key)})(r.store,a)&&r.store.setState(a,void 0,{unmount:!0})},[t]),k=Q(()=>t.forEach(e=>e.entry.store.expire()),[t]);/* @__PURE__ */
|
|
107
|
+
return ne("div",{className:"flex h-full w-full flex-col text-[11px]",children:[/* @__PURE__ */ne("div",{className:"flex shrink-0 items-center gap-2 border-b border-zinc-200 px-2 py-1 dark:border-zinc-800",children:[
|
|
108
|
+
/* @__PURE__ */re("span",{className:"font-medium text-zinc-600 dark:text-zinc-300",children:"Cached"}),
|
|
109
|
+
/* @__PURE__ */re("span",{className:"text-zinc-500 tabular-nums dark:text-zinc-400",children:a}),
|
|
110
|
+
/* @__PURE__ */re("input",{className:"min-w-0 grow rounded border border-zinc-200 bg-white px-1.5 py-0.5 text-zinc-700 outline-none placeholder:text-zinc-400 focus:border-violet-400 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-100 dark:placeholder:text-zinc-500",value:s,placeholder:"Filter by URL, store or tag",onChange:e=>o(e.target.value)}),
|
|
111
|
+
/* @__PURE__ */re("button",{className:x("shrink-0 cursor-pointer rounded px-1.5 py-0.5 font-medium transition-colors",d?"bg-amber-500/15 text-amber-600 dark:text-amber-400":"text-zinc-500 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800"),onClick:g,children:"Stale only"}),
|
|
112
|
+
/* @__PURE__ */re("button",{className:"shrink-0 cursor-pointer rounded px-1.5 py-0.5 text-violet-600 hover:bg-violet-500/15 dark:text-violet-400",onClick:k,children:"Expire all"})]}),0===u.length?/* @__PURE__ */ne("div",{className:"flex grow flex-col items-center justify-center gap-2 px-6 text-center text-zinc-500 dark:text-zinc-400",children:[
|
|
113
|
+
/* @__PURE__ */re("i",{className:"fa-solid fa-database text-3xl opacity-20"}),
|
|
114
|
+
/* @__PURE__ */re("span",{children:0===a?"Nothing on this page is cached":"Nothing matches the filter"}),0===a&&/* @__PURE__ */re("span",{className:"max-w-80 text-[10px]",children:"A path appears here once something writes it with a time to live — a provider does that when its author turns its cache on."})]}):/* @__PURE__ */re("ul",{className:"grow overflow-auto",children:u.map(e=>/* @__PURE__ */re(Xn,{row:e,isOpen:e.key===m,value:e.key===m?h:void 0,onToggle:f,onExpire:b,onForget:y},e.key))})]})},xi=({name:e,children:t})=>/* @__PURE__ */ne("div",{className:"flex gap-4 border-zinc-200 py-1 dark:border-zinc-700 [&:not(:first-child)]:border-t",children:[/* @__PURE__ */re("div",{className:"grow basis-0 text-zinc-500 dark:text-zinc-400",children:e}),/* @__PURE__ */re("div",{className:"grow basis-0 truncate text-zinc-800 dark:text-zinc-200",children:t})]}),gi=({id:e,onSelect:t})=>{let[a]=d("schema.flat"),r=Object.hasOwn(a,e)?a[e].definition.label:e,n=Q(()=>t?.(e),[t,e]);/* @__PURE__ */
|
|
115
|
+
return re("span",{className:"cursor-pointer text-violet-600 hover:underline dark:text-violet-400",onClick:n,children:r})},vi=/* @__PURE__ */new Set(["rootId","parentId"]),bi=(e,t,a)=>"object"==typeof t&&t?a&&"styleSelectors"===e?Object.values(t).join(", "):JSON.stringify(t):"boolean"==typeof t?t?"True":"False":"string"==typeof t||"number"==typeof t?String(t):"",yi=({attribute:e,value:t,isDefinition:a=!1,onSelectElement:r})=>a&&"items"===e&&Array.isArray(t)?/* @__PURE__ */re("div",{className:"flex flex-col",children:t.filter(e=>"string"==typeof e).map(e=>/* @__PURE__ */re(gi,{id:e,onSelect:r},e))}):a&&vi.has(e)&&"string"==typeof t?/* @__PURE__ */re(gi,{id:t,onSelect:r}):/* @__PURE__ */re(ae,{children:bi(e,t,a)}),ki=({attributes:e={}})=>/* @__PURE__ */re("div",{className:"w-full text-sm",children:Object.entries(e).map(([e,t])=>/* @__PURE__ */re(xi,{name:e,children:/* @__PURE__ */re(yi,{attribute:e,value:t})},e))}),Ni=({definition:e,onSelectElement:t})=>/* @__PURE__ */re("div",{className:"w-full text-sm",children:Object.entries(e??{}).map(([e,a])=>/* @__PURE__ */re(xi,{name:e,children:/* @__PURE__ */re(yi,{isDefinition:!0,attribute:e,value:a,onSelectElement:t})},e))}),zi=({visible:e,box:t})=>`${e?"Yes":"No"}${t?` · ${String(t.width)}×${String(t.height)} at ${String(t.x)}, ${String(t.y)}`:""}`,wi=({category:e,to:t,source:a,template:r})=>`${"attributes"===e?"":`${e} · `}${t} ← ${a}${r?` · ${r}`:""}`,Si=({id:e})=>{let t=_(p);ai(!0);let a=t&&typeof document<"u"?S(t.getState(),e,document):void 0;/* @__PURE__ */
|
|
116
|
+
return ne("div",a?{className:"w-full text-sm",children:[
|
|
117
|
+
/* @__PURE__ */re(xi,{name:"Type",children:a.type}),a.inComponent&&/* @__PURE__ */re(xi,{name:"In component",children:a.inComponent}),a.instanceOf&&/* @__PURE__ */re(xi,{name:"Places component",children:a.instanceOf}),
|
|
118
|
+
/* @__PURE__ */re(xi,{name:"Copies on the page",children:a.copies}),
|
|
119
|
+
/* @__PURE__ */re(xi,{name:"On screen",children:zi(a)}),void 0!==a.state&&/* @__PURE__ */re(xi,{name:"Own state",children:JSON.stringify(a.state)}),(a.bindings??[]).map(e=>/* @__PURE__ */re(xi,{name:"Reads",children:wi(e)},`${e.category}-${e.to}`))]}:{className:"text-sm text-zinc-400 dark:text-zinc-500",children:["Neither the document nor the page has “",e,"”."]})},Ci=[{label:"Runtime"},{label:"Definition"},{label:"Attributes"}],$i=({id:e,onSelectElement:t})=>{let[[a,r]]=d(["schema.flat","schema.components"]),n=Z(()=>Ot({flat:a,components:r},e)?.flat[e],[a,r,e]);/* @__PURE__ */
|
|
120
|
+
return ne(j,{className:"w-full grow gap-4 overflow-hidden p-4",children:[
|
|
121
|
+
/* @__PURE__ */re(j.Tabs,{items:Ci}),
|
|
122
|
+
/* @__PURE__ */re(j.TabContent,{className:"flex-col overflow-y-auto",children:/* @__PURE__ */re(Si,{id:e})}),
|
|
123
|
+
/* @__PURE__ */re(j.TabContent,{className:"flex-col overflow-y-auto",children:/* @__PURE__ */re(Ni,{definition:n?.definition,onSelectElement:t})}),
|
|
124
|
+
/* @__PURE__ */re(j.TabContent,{className:"overflow-y-auto",children:/* @__PURE__ */re(ki,{attributes:n?.attributes})})]})},ji=e=>"string"==typeof e?e:"",Ti=(e,t)=>{let a=[],r=/* @__PURE__ */new Set,n=(t,i)=>{let l=Object.hasOwn(e,t)?e[t]:void 0;if(!l||r.has(t))return;r.add(t);let s=(e=>"reference"===e.definition.type&&"component"===e.attributes.referenceType&&!0)(l)?ji(l.attributes.referenceId):"";a.push({id:t,label:l.definition.label||t,type:l.definition.type,depth:i,hidden:!1===l.definition.initialState?.visibility,...s?{instanceOf:s}:{}});for(let e of l.definition.items??[])n(e,i+1)};return n(t,0),a},Ii=(e,t)=>{let a=t.trim().toLowerCase();if(!a)return[...e];let r=/* @__PURE__ */new Set;return e.forEach((t,n)=>{if(![t.label,t.id,t.type].some(e=>e.toLowerCase().includes(a)))return;r.add(n);let i=t.depth;for(let a=n-1;a>=0&&i>0;a--)e[a].depth<i&&(r.add(a),i=e[a].depth)}),e.filter((e,t)=>r.has(t))},Li=({row:e,isSelected:t,onSelect:a,onHover:r})=>{let n=Q(()=>a(e.id),[a,e.id]),i=Q(()=>r(e.id),[r,e.id]),l=Q(()=>r(void 0),[r]);/* @__PURE__ */
|
|
125
|
+
return ne("div",{className:x("flex w-full cursor-pointer items-center gap-2 border-l-2 py-1 pr-2 transition-colors",t?"border-l-violet-500 bg-violet-50 text-violet-700 dark:bg-violet-500/15 dark:text-violet-300":"border-l-transparent text-zinc-600 hover:bg-zinc-100 hover:text-zinc-900 dark:text-zinc-300 dark:hover:bg-zinc-800 dark:hover:text-zinc-100"),style:{paddingLeft:8+12*e.depth},onClick:n,onMouseEnter:i,onMouseLeave:l,children:[
|
|
126
|
+
/* @__PURE__ */re("span",{className:"truncate",title:e.id,children:e.label}),
|
|
127
|
+
/* @__PURE__ */re("span",{className:"shrink-0 font-mono text-[10px] text-zinc-400 dark:text-zinc-500",children:e.type}),e.instanceOf&&/* @__PURE__ */ne("span",{className:"shrink-0 rounded bg-violet-100 px-1 text-[10px] text-violet-700 dark:bg-violet-500/20 dark:text-violet-300",children:["◇ ",e.instanceOf]}),
|
|
128
|
+
/* @__PURE__ */re("span",{className:"grow"}),e.hidden&&/* @__PURE__ */re("i",{className:"fa-solid fa-eye-slash shrink-0 text-[10px] text-zinc-300 dark:text-zinc-600",title:"Starts hidden"})]})},Ri={layout:"fa-solid fa-table-columns",page:"fa-regular fa-file",component:"fa-solid fa-cube"},Ei={layout:"Layout",page:"Page",component:"Component"},Vi=({section:e,rows:t,more:a,selected:r,onSelect:n,onHover:i})=>/* @__PURE__ */ne("div",{className:"flex flex-col",children:[
|
|
129
|
+
/* @__PURE__ */ne("div",{className:"sticky top-0 flex items-center gap-2 border-b border-zinc-200 bg-zinc-50 px-2 py-1 text-[10px] font-semibold tracking-wider text-zinc-500 uppercase dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-400",children:[
|
|
130
|
+
/* @__PURE__ */re("i",{className:Ri[e.kind]}),
|
|
131
|
+
/* @__PURE__ */re("span",{children:Ei[e.kind]}),
|
|
132
|
+
/* @__PURE__ */re("span",{className:"truncate font-normal tracking-normal normal-case",children:e.title})]}),t.map(e=>/* @__PURE__ */re(Li,{row:e,isSelected:r===e.id,onSelect:n,onHover:i},e.id)),a>0&&/* @__PURE__ */ne("div",{className:"p-2 text-center text-[11px] text-zinc-400 dark:text-zinc-600",children:[a," more — narrow the search to reach them"]})]}),Ai=({sections:e,filter:t,selected:a,onFilter:r,onSelect:n,onHover:i})=>{let l=Z(()=>e.map(e=>({section:e,rows:Ii(e.rows,t)})).filter(({rows:e})=>e.length>0),[e,t]);/* @__PURE__ */
|
|
133
|
+
return ne("div",{className:"flex h-full w-[320px] shrink-0 flex-col gap-2 border-r border-zinc-200 dark:border-zinc-700",children:[/* @__PURE__ */re("div",{className:"px-2 pt-2",children:/* @__PURE__ */re(h,{value:t,onChange:r,placeholder:"Search by name, id or type...",size:"sm"})}),/* @__PURE__ */ne("div",{className:"flex flex-col overflow-y-auto text-xs",children:[0===l.length&&/* @__PURE__ */re("div",{className:"p-4 text-center text-zinc-400 dark:text-zinc-600",children:"No elements"}),l.map(({section:e,rows:t})=>/* @__PURE__ */re(Vi,{section:e,rows:t.slice(0,200),more:Math.max(t.length-200,0),selected:a,onSelect:n,onHover:i},`${e.kind}-${e.id}`))]})]})},Mi=e=>{X(()=>{if(typeof document>"u"||!e)return;let t=document.querySelectorAll(`[data-id="${e}"]`);return t.forEach(e=>e.classList.add("devtools-element-hovered")),()=>t.forEach(e=>e.classList.remove("devtools-element-hovered"))},[e])},Di=({className:e,elementSelected:t,onSelectElement:a})=>{let[[r,n,i]]=d(["schema.flat","schema.components","navigation.currentPageId"]),[l,s]=ee(""),[o,c]=ee(),m=Z(()=>((e,t)=>{let a=Object.hasOwn(e.flat,t)?e.flat[t]:void 0;if(!a)return[];let r=[...z(t=>Object.hasOwn(e.flat,t)?e.flat[t]:void 0,ji(a.attributes.layout),ji(a.attributes.layoutContainer)).toReversed().map(({layout:t})=>({kind:"layout",id:t,title:e.flat[t].definition.label||t,rows:Ti(e.flat,t)})),{kind:"page",id:t,title:ji(a.attributes.name)||a.definition.label||t,rows:Ti(e.flat,t)}],n=/* @__PURE__ */new Set;for(let i=0;i<r.length;i++)for(let t of r[i].rows){let a=t.instanceOf?Ft(e,t.instanceOf):void 0;a&&!n.has(a.id)&&(n.add(a.id),r.push({kind:"component",id:a.id,title:a.label??a.id,rows:Ti(a.flat,a.rootId)}))}return r})({flat:r,components:n},i),[r,n,i]);return Mi(o),/* @__PURE__ */ne("div",{className:x("flex h-full w-full",e),children:[/* @__PURE__ */re(Ai,{sections:m,filter:l,selected:t,onFilter:s,onSelect:a,onHover:c}),t&&/* @__PURE__ */re($i,{id:t,onSelectElement:a})]})},Oi={space:"default",server:"server",sdk:"sdk",qa:"forced"},Fi=({resolution:e})=>{if(!e)return null;let{layer:t,rule:a}=e,r="space"===t&&void 0!==a?`rule ${a+1}`:Oi[t];/* @__PURE__ */
|
|
134
|
+
return re("span",{className:x("rounded px-1.5 py-0.5 text-[10px] font-medium tracking-wider uppercase",{"bg-zinc-100 text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400":"space"===t,"bg-sky-100 text-sky-700 dark:bg-sky-950 dark:text-sky-300":"server"===t||"sdk"===t,"bg-amber-100 text-amber-700 dark:bg-amber-950 dark:text-amber-300":"qa"===t}),title:"Which layer decided this flag",children:r})},Ji=({name:e,flag:t,resolution:a,forced:r,onForce:n})=>{let i=a?.value??!1,l=Q(()=>n(e,!0),[e,n]),s=Q(()=>n(e,!1),[e,n]),o=Q(()=>n(e,void 0),[e,n]);/* @__PURE__ */
|
|
135
|
+
return ne("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-2 border-b border-zinc-100 px-3 py-1.5 transition-colors hover:bg-zinc-50 dark:border-zinc-800 dark:hover:bg-zinc-800/60",children:[/* @__PURE__ */ne("div",{className:"flex min-w-0 flex-col gap-0.5",children:[/* @__PURE__ */ne("div",{className:"flex min-w-0 items-center gap-2",children:[
|
|
136
|
+
/* @__PURE__ */re("span",{className:x("h-2 w-2 shrink-0 rounded-full",{"bg-emerald-500":i,"bg-zinc-300 dark:bg-zinc-600":!i})}),
|
|
137
|
+
/* @__PURE__ */re("span",{className:"truncate font-mono font-medium text-zinc-800 dark:text-zinc-200",title:e,children:e}),
|
|
138
|
+
/* @__PURE__ */re(Fi,{resolution:a})]}),t.description&&/* @__PURE__ */re("span",{className:"truncate text-[11px] text-zinc-400 dark:text-zinc-500",title:t.description,children:t.description})]}),/* @__PURE__ */ne("div",{className:"flex items-center gap-1",children:[
|
|
139
|
+
/* @__PURE__ */re("button",{type:"button",className:x("rounded px-1.5 py-0.5 text-[10px] font-medium",{"bg-emerald-600 text-white":!0===r,"text-zinc-500 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800":!0!==r}),title:"Force this flag on for this browser",onClick:l,children:"On"}),
|
|
140
|
+
/* @__PURE__ */re("button",{type:"button",className:x("rounded px-1.5 py-0.5 text-[10px] font-medium",{"bg-zinc-700 text-white dark:bg-zinc-300 dark:text-zinc-900":!1===r,"text-zinc-500 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800":!1!==r}),title:"Force this flag off for this browser",onClick:s,children:"Off"}),void 0!==r&&/* @__PURE__ */re("button",{type:"button",className:"rounded px-1.5 py-0.5 text-[10px] text-zinc-400 hover:bg-zinc-100 dark:text-zinc-500 dark:hover:bg-zinc-800",title:"Stop forcing it: the space and its embedding decide again",onClick:o,children:/* @__PURE__ */re("i",{className:"fa-solid fa-rotate-left"})})]})]})},Bi={},Pi=()=>{let[[e,t]]=d(["schema.flags","flags.resolved"]),[a=Bi,r]=d("flags.overrides.qa"),n=Object.keys(e??{}),i=Q((e,t)=>{let n=D(a,e,t);r(n),J(window.location.host,n)},[a,r]),l=Q(()=>{r({}),J(window.location.host,{})},[r]);return e&&0!==n.length?/* @__PURE__ */ne("div",{className:"flex w-full flex-col gap-1.5 overflow-y-auto p-3",children:[/* @__PURE__ */ne("div",{className:"flex items-center justify-between gap-2 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:[/* @__PURE__ */ne("span",{className:"flex items-center gap-2",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-flag"}),"Feature Flags"]}),Object.keys(a).length>0&&/* @__PURE__ */re("button",{type:"button",className:"rounded px-1.5 py-0.5 font-medium normal-case hover:bg-zinc-100 dark:hover:bg-zinc-800",onClick:l,children:"Stop forcing all"})]}),/* @__PURE__ */re("div",{className:"w-full overflow-hidden rounded border border-zinc-200 dark:border-zinc-700",children:n.map(r=>/* @__PURE__ */re(Ji,{name:r,flag:e[r],resolution:t?.[r],forced:a[r],onForce:i},r))})]}):/* @__PURE__ */re("div",{className:"py-4 text-center text-xs text-zinc-400 italic dark:text-zinc-600",children:"This space declares no feature flags"})},qi=e=>new Date(e).toLocaleTimeString(void 0,{hour12:!1})+"."+String(e%1e3).padStart(3,"0"),Wi=e=>{if(void 0===e)return"";if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return String(e);let t,a=Array.isArray(e)?"[…]":"{…}";try{t=JSON.stringify(e)||a}catch{t=a}return t.length>120?t.slice(0,120)+"…":t},Ui=({index:e,path:t,value:a,timestamp:r,isSelected:n,isFuture:i,onSelect:l})=>{let s=Y(null),o=Q(()=>l(e),[l,e]);return X(()=>{n&&s.current?.scrollIntoView({block:"nearest"})},[n]),/* @__PURE__ */ne("button",{ref:s,onClick:o,className:x("flex w-full flex-col gap-0.5 border-b border-zinc-100 px-3 py-1.5 text-left font-mono text-xs dark:border-zinc-800",{"bg-violet-600 text-white dark:bg-violet-600":n,"text-zinc-600 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-800/60":!n,"opacity-50":i}),children:[/* @__PURE__ */ne("div",{className:"flex w-full items-center gap-2",children:[/* @__PURE__ */re("span",{className:"grow truncate",children:t??/* @__PURE__ */re("span",{className:"italic opacity-70",children:0===e?"initial state":"replace"})}),/* @__PURE__ */re("span",{className:"shrink-0 text-[10px] opacity-70",children:qi(r)})]}),void 0!==a&&/* @__PURE__ */re("span",{className:"w-full truncate text-[10px] opacity-70",children:Wi(a)})]})},Hi=({index:e,total:t,canUndo:a,canRedo:r,filter:n,onUndo:i,onRedo:l,onClear:s,onFilterChange:o})=>/* @__PURE__ */ne("div",{className:"flex shrink-0 flex-col gap-1.5 border-b border-zinc-200 bg-zinc-50 px-2 py-1.5 dark:border-zinc-800 dark:bg-zinc-900",children:[/* @__PURE__ */ne("div",{className:"flex items-center gap-1",children:[
|
|
141
|
+
/* @__PURE__ */ne("button",{onClick:i,disabled:!a,className:"flex h-6 items-center gap-1 rounded px-2 text-xs font-medium text-zinc-600 enabled:hover:bg-zinc-200 disabled:opacity-40 dark:text-zinc-300 dark:enabled:hover:bg-zinc-700",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-rotate-left"}),"Undo"]}),
|
|
142
|
+
/* @__PURE__ */ne("button",{onClick:l,disabled:!r,className:"flex h-6 items-center gap-1 rounded px-2 text-xs font-medium text-zinc-600 enabled:hover:bg-zinc-200 disabled:opacity-40 dark:text-zinc-300 dark:enabled:hover:bg-zinc-700",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-rotate-right"}),"Redo"]}),
|
|
143
|
+
/* @__PURE__ */ne("div",{className:"ml-auto flex items-center gap-2",children:[/* @__PURE__ */ne("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:[e+1," / ",t]}),/* @__PURE__ */ne("button",{onClick:s,className:"flex h-6 items-center gap-1 rounded px-2 text-xs font-medium text-zinc-600 hover:bg-zinc-200 dark:text-zinc-300 dark:hover:bg-zinc-700",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-trash"}),"Clear"]})]})]}),/* @__PURE__ */re(h,{value:n,onChange:o,placeholder:"Filter by path...",size:"sm"})]}),Ki=()=>{let{entries:e,index:a,canUndo:r,canRedo:n,undo:i,redo:l,travelTo:s,clear:o}=function(){let e=c(void 0,"useStoreHistory"),a=t(e);X(()=>{a||(e=>{B||de.has(e)||(de.add(e),console.warn("[nexus] useStoreHistory: this store has no history. Add `historyMiddleware()` to its middlewares to record an action log — until then the hook returns an empty, no-op view."))})(e)},[a,e]);let r=a?.getSnapshot??oe;return{...te(a?.subscribe??se,r,r),undo:a?.undo??le,redo:a?.redo??le,travelTo:a?.travelTo??le,clear:a?.clear??le}}(),[d,m]=ee(""),p=Z(()=>e.map((e,t)=>({entry:e,originalIndex:t})).filter(({entry:e})=>((e,t)=>!t||(e.path??"").toLowerCase().includes(t.toLowerCase()))(e,d)).reverse(),[e,d]),u=Q(e=>{if("ArrowUp"!==e.key&&"ArrowDown"!==e.key)return;e.preventDefault();let t,r=p.findIndex(e=>e.originalIndex===a);t=-1===r?"ArrowDown"===e.key?0:p.length-1:"ArrowUp"===e.key?r-1:r+1,!(t<0||t>=p.length)&&s(p[t].originalIndex)},[p,a,s]);/* @__PURE__ */
|
|
144
|
+
return ne("div",{className:"flex h-full w-full flex-col",children:[/* @__PURE__ */re(Hi,{index:a,total:e.length,canUndo:r,canRedo:n,filter:d,onUndo:i,onRedo:l,onClear:o,onFilterChange:m}),/* @__PURE__ */ne("div",{tabIndex:0,onKeyDown:u,className:"flex flex-1 flex-col overflow-y-auto outline-none",children:[0===p.length&&/* @__PURE__ */ne("div",{className:"flex grow flex-col items-center justify-center gap-2 text-zinc-400 dark:text-zinc-500",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-clock-rotate-left text-3xl opacity-20"}),/* @__PURE__ */re("span",{className:"text-xs",children:d?"No entries match the filter":"No history yet"})]}),p.map(({entry:e,originalIndex:t})=>/* @__PURE__ */re(Ui,{index:t,path:e.path,value:e.value,timestamp:e.timestamp,isSelected:t===a,isFuture:t>a,onSelect:s},t))]})]})},Qi=({className:e="",time:t,message:a,params:r})=>{let{actionId:n,mode:i,runId:l,status:s,reason:o,error:d}=r,c=!!(o??d);/* @__PURE__ */
|
|
145
|
+
return ne("div",{className:x("flex flex-col border-b border-gray-100 px-2 py-1 dark:border-zinc-800",e),children:[
|
|
146
|
+
/* @__PURE__ */ne("div",{className:"flex items-center gap-2",children:[t&&/* @__PURE__ */re("span",{className:"text-gray-400",children:t}),
|
|
147
|
+
/* @__PURE__ */re("span",{className:"grow",children:a??n}),i&&/* @__PURE__ */re("span",{className:"rounded-sm bg-gray-100 px-1 text-[10px] uppercase dark:bg-zinc-800",children:i}),
|
|
148
|
+
/* @__PURE__ */re("span",{className:x(c?"text-red-600 dark:text-red-400":"text-gray-500 dark:text-zinc-400"),children:o??s??""})]}),l&&/* @__PURE__ */ne("span",{className:"font-mono text-[10px] text-gray-400",children:["run ",l]}),d&&/* @__PURE__ */re("span",{className:"break-words text-red-600 dark:text-red-400",children:d})]})},_i=({title:e,action:t,duration:a,status:r,level:n,id:i,isSelected:l,onClick:s})=>{let o=Q(()=>s(i),[i,s]);/* @__PURE__ */
|
|
149
|
+
return ne("div",{className:x("flex cursor-pointer items-center gap-2 border-l-2 px-2 py-1 transition-colors",1===n?"pl-5":"pl-2",{"border-l-violet-500 bg-violet-50 text-violet-700 dark:border-l-violet-500 dark:bg-violet-500/15 dark:text-violet-300":l,"border-l-transparent text-zinc-500 hover:bg-zinc-100 hover:text-zinc-800 dark:border-l-transparent dark:text-zinc-400 dark:hover:bg-zinc-800 dark:hover:text-zinc-200":!l}),onClick:o,children:[/* @__PURE__ */re("div",{className:x("h-2 w-2 shrink-0 rounded-full",{"bg-emerald-500":"success"===r,"bg-amber-500":"skipped"===r,"bg-zinc-300 dark:bg-zinc-600":"disabled"===r,"bg-zinc-400 dark:bg-zinc-500":"failed"===r}),title:r}),/* @__PURE__ */ne("div",{className:"flex min-w-0 grow justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"truncate",children:e}),/* @__PURE__ */ne("div",{className:"flex shrink-0 items-center gap-1.5 text-zinc-400 dark:text-zinc-600",children:[/* @__PURE__ */re("span",{className:"font-mono",children:a}),t&&/* @__PURE__ */re("span",{className:"rounded bg-zinc-100 px-1 font-mono text-[10px] text-zinc-500 dark:bg-zinc-800 dark:text-zinc-500",children:t})]})]})]})},Xi=({className:e,nodeId:t,nodes:a,selected:r,onSelect:n})=>{let l=Z(()=>{let e=C(a,t),r=[];for(;e;){let{node:n,startTime:l,endTime:s}=e,o=`${i(l,s)}ms`,d=n.id===t?0:1;r.push({id:n.id,action:n.action,title:n.title,status:e.status,level:d,duration:o}),e=C(a,n.afterNode)}return r},[t,a]),s=Q(e=>n?.(e),[n]);/* @__PURE__ */
|
|
150
|
+
return ne("div",{className:x("flex flex-col gap-1.5",e),children:[/* @__PURE__ */ne("div",{className:"flex items-center gap-1.5 px-2 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-code-merge"}),"Execution Tree"]}),/* @__PURE__ */re("div",{className:"flex flex-col",children:l.map((e,t)=>/* @__PURE__ */re(_i,{id:e.id,action:e.action,title:e.title,duration:e.duration,status:e.status,level:e.level,isSelected:e.id===r,onClick:s},t))})]})},Zi=({duration:e,status:t,type:a,action:r})=>/* @__PURE__ */ne("div",{className:"grid grid-cols-2 gap-x-3 gap-y-0.5 rounded bg-zinc-50 p-2 dark:bg-zinc-800/60",children:[
|
|
151
|
+
/* @__PURE__ */ne("div",{className:"flex gap-1.5",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Duration"}),/* @__PURE__ */re("span",{className:"font-mono text-zinc-700 dark:text-zinc-300",children:e})]}),
|
|
152
|
+
/* @__PURE__ */ne("div",{className:"flex gap-1.5",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Type"}),/* @__PURE__ */re("span",{className:"text-zinc-700 dark:text-zinc-300",children:a})]}),
|
|
153
|
+
/* @__PURE__ */ne("div",{className:"flex gap-1.5",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Status"}),/* @__PURE__ */re("span",{className:"text-zinc-700 dark:text-zinc-300",children:t})]}),
|
|
154
|
+
/* @__PURE__ */ne("div",{className:"flex gap-1.5",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Action"}),/* @__PURE__ */re("span",{className:"text-zinc-700 dark:text-zinc-300",children:r})]})]}),Gi=({when:e,whenParams:t})=>{let a=Z(()=>e&&0!==Object.keys(e).length?pe(JSON.stringify(O(e,t),null,2)):"",[t,e]);return a?/* @__PURE__ */ne("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */re("span",{className:"text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:"Params"}),/* @__PURE__ */re("pre",{className:"overflow-auto rounded bg-zinc-50 p-2 font-mono text-xs leading-5 dark:bg-zinc-800",dangerouslySetInnerHTML:{__html:a}})]}):null},Yi=({when:e})=>{let t=Z(()=>e&&function(e,t="sql",a=!1,r={}){return"mongodb"===t?be(e,a,r):Ce(e,a,r)}(e)||null,[e]);return t?/* @__PURE__ */ne("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */re("span",{className:"text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:"Condition"}),/* @__PURE__ */re("span",{className:"break-all text-zinc-700 dark:text-zinc-300",children:t})]}):null},el=({whenParams:e,name:t="Node Title",startTime:a=0,endTime:r=0,status:n="notStarted",when:l,type:s,action:o})=>{let d=Z(()=>`${i(a,r)}ms`,[a,r]);/* @__PURE__ */
|
|
155
|
+
return ne("div",{className:"flex w-full flex-col gap-2 p-2 text-zinc-700 dark:text-zinc-300",children:[
|
|
156
|
+
/* @__PURE__ */re("div",{className:"truncate font-semibold text-zinc-800 dark:text-zinc-200",children:t}),
|
|
157
|
+
/* @__PURE__ */re(Zi,{duration:d,status:n,type:s,action:o}),
|
|
158
|
+
/* @__PURE__ */re(Yi,{when:l}),
|
|
159
|
+
/* @__PURE__ */re(Gi,{when:l,whenParams:e})]})},tl=({className:e,node:t,nodes:a})=>{let[r,n]=ee(t.id),i=Z(()=>C(a,`${r}`),[r,a]),l=Q(e=>n(e),[]);/* @__PURE__ */
|
|
160
|
+
return ne("div",{className:x("flex",e),children:[
|
|
161
|
+
/* @__PURE__ */re(Xi,{className:"grow basis-0",nodeId:t.id,nodes:a,selected:r,onSelect:l}),
|
|
162
|
+
/* @__PURE__ */re("div",{className:"mx-1 w-px shrink-0 bg-zinc-200 dark:bg-zinc-800"}),r&&/* @__PURE__ */re("div",{className:"flex min-w-0 grow basis-0",children:/* @__PURE__ */re(el,{whenParams:i.whenParams,status:i.status,name:i.node.title,startTime:i.startTime,endTime:i.endTime,when:i.node.when,type:i.node.type,action:i.node.action})})]})},al=({triggerName:e,startTime:t,endTime:a,duration:r,elementId:i,hostElementId:l})=>{let[s]=d("schema.flat"),o=Z(()=>i?C(s,i):void 0,[i,s]),c=Z(()=>n(t,"HH:mm:ss.SSS"),[t]),m=Z(()=>n(a,"HH:mm:ss.SSS"),[a]),p=Z(()=>{if(typeof document<"u")return document.querySelector(`[data-id="${i}"]`)},[i]),u=Q(()=>{p?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[p]),[h,f]=ee(!1);Mi(h?i:void 0);let x=Q(()=>f(!0),[]),g=Q(()=>f(!1),[]);/* @__PURE__ */
|
|
163
|
+
return ne("div",{className:"flex justify-around gap-3",children:[
|
|
164
|
+
/* @__PURE__ */ne("div",{className:"flex min-w-0 grow basis-0 flex-col",children:[/* @__PURE__ */ne("div",{className:"mb-1 flex items-center gap-1.5 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:[/* @__PURE__ */re("i",{className:"fa-regular fa-clock"}),"Times"]}),/* @__PURE__ */ne("div",{className:"flex flex-col gap-0.5 font-mono text-zinc-700 dark:text-zinc-300",children:[
|
|
165
|
+
/* @__PURE__ */ne("div",{className:"flex gap-1",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Start"}),c]}),
|
|
166
|
+
/* @__PURE__ */ne("div",{className:"flex gap-1",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"End"}),m]}),
|
|
167
|
+
/* @__PURE__ */ne("div",{className:"flex gap-1",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Duration"}),r]})]})]}),
|
|
168
|
+
/* @__PURE__ */re("div",{className:"w-px shrink-0 bg-zinc-200 dark:bg-zinc-800"}),
|
|
169
|
+
/* @__PURE__ */ne("div",{className:"flex min-w-0 grow basis-0 flex-col",children:[/* @__PURE__ */ne("div",{className:"mb-1 flex items-center gap-1.5 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-circle-info"}),"Details"]}),/* @__PURE__ */ne("div",{className:"flex flex-col gap-0.5 text-zinc-700 dark:text-zinc-300",children:[
|
|
170
|
+
/* @__PURE__ */ne("div",{className:"flex gap-1",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Type"}),/* @__PURE__ */re("span",{children:"Interaction"})]}),
|
|
171
|
+
/* @__PURE__ */ne("div",{className:"flex min-w-0 gap-1",children:[/* @__PURE__ */re("span",{className:"shrink-0 text-zinc-400 dark:text-zinc-500",children:"Trigger"}),/* @__PURE__ */re("span",{className:"truncate",children:e})]}),l&&/* @__PURE__ */ne("div",{className:"flex min-w-0 gap-1",children:[/* @__PURE__ */re("span",{className:"shrink-0 text-zinc-400 dark:text-zinc-500",children:"Fired on"}),/* @__PURE__ */re("span",{className:"truncate font-mono",children:l})]}),
|
|
172
|
+
/* @__PURE__ */ne("div",{className:"flex min-w-0 gap-1",children:[/* @__PURE__ */re("span",{className:"shrink-0 text-zinc-400 dark:text-zinc-500",children:"Element"}),/* @__PURE__ */ne("span",{className:"cursor-pointer truncate text-violet-600 hover:text-violet-500 dark:text-violet-400 dark:hover:text-violet-300",onClick:u,onMouseEnter:x,onMouseLeave:g,children:[o?.definition.label,i&&/* @__PURE__ */ne("span",{className:"ml-1 font-mono text-[10px] text-zinc-400 dark:text-zinc-500",children:["[",i,"]"]})]})]})]})]})]})},rl=({node:e,nodes:t,startTime:a,endTime:r,duration:n,elementId:i,hostElementId:l})=>/* @__PURE__ */ne("div",{className:"mx-2 my-1.5 flex flex-col gap-2 overflow-hidden rounded border border-zinc-200 text-xs dark:border-zinc-800",children:[/* @__PURE__ */re("div",{className:"bg-zinc-50 px-3 py-2 dark:bg-zinc-800/60",children:/* @__PURE__ */re(al,{triggerName:e.title,startTime:a,endTime:r,duration:n,elementId:i,hostElementId:l})}),/* @__PURE__ */re("div",{className:"border-t border-zinc-200 dark:border-zinc-800",children:/* @__PURE__ */re(tl,{node:e,nodes:t,className:"gap-0"})})]}),nl={danger:"fa-regular fa-circle-xmark",warning:"fa-solid fa-triangle-exclamation",info:"fa-solid fa-circle-info",success:"fa-solid fa-check"},il={danger:"Error",warning:"Warning",info:"Info",success:"Success"},ll=({className:e,logType:t="info",iconClassName:a,children:r})=>/* @__PURE__ */ne("div",{className:x("flex items-center gap-1 rounded px-1.5 py-0.5 font-medium",{"bg-red-50 text-red-600 dark:bg-red-500/15 dark:text-red-400":"danger"===t,"bg-amber-50 text-amber-700 dark:bg-amber-500/15 dark:text-amber-400":"warning"===t,"bg-violet-50 text-violet-700 dark:bg-violet-500/15 dark:text-violet-400":"info"===t,"bg-emerald-50 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-400":"success"===t,"bg-zinc-100 text-zinc-600 dark:bg-zinc-700 dark:text-zinc-300":!["danger","warning","info","success"].includes(t)},e),children:[/* @__PURE__ */re("i",{className:x(a??nl[t],"text-[10px]")}),r??il[t]]}),sl=({status:e,message:t,time:a})=>/* @__PURE__ */ne("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[
|
|
173
|
+
/* @__PURE__ */re("span",{className:"shrink-0 font-mono text-zinc-400 tabular-nums dark:text-zinc-500",children:a}),"completed"===e&&/* @__PURE__ */re(ll,{logType:"success",children:"Completed"}),"failed"===e&&/* @__PURE__ */re(ll,{logType:"danger",children:"Failed"}),"skipped"===e&&/* @__PURE__ */re(ll,{logType:"custom",iconClassName:"fa-solid fa-forward-step",children:"Skipped"}),
|
|
174
|
+
/* @__PURE__ */re("div",{className:"grow basis-0 truncate text-zinc-700 dark:text-zinc-300",children:t})]}),ol=/* @__PURE__ */re("i",{className:"fa-solid fa-angle-right text-[10px]"}),dl=/* @__PURE__ */re("i",{className:"fa-solid fa-angle-down text-[10px]"}),cl=e=>"string"==typeof e?e:JSON.stringify(e),ml=({label:e,children:t})=>/* @__PURE__ */ne("div",{className:"flex gap-2",children:[/* @__PURE__ */re("span",{className:"w-24 shrink-0 text-zinc-400 dark:text-zinc-500",children:e}),/* @__PURE__ */re("span",{className:"min-w-0 grow break-words text-zinc-700 dark:text-zinc-300",children:t})]}),pl=({time:e,message:t,params:a})=>{let{node:r,error:n,available:i,param:l,value:s}=a;/* @__PURE__ */
|
|
175
|
+
return ne(k,{className:"last:border-b-none w-full border-b border-l-2 border-b-zinc-200 border-l-amber-500 px-2 py-1 transition-colors hover:bg-zinc-50 dark:border-b-zinc-700 dark:hover:bg-zinc-800/50",collapsed:!0,children:[/* @__PURE__ */re(k.Header,{title:/* @__PURE__ */ne("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[/* @__PURE__ */re("span",{className:"shrink-0 font-mono text-zinc-400 tabular-nums dark:text-zinc-500",children:e}),/* @__PURE__ */re("div",{className:"grow basis-0 truncate text-zinc-700 dark:text-zinc-300",children:t})]}),placement:"left",className:{headerTitle:"overflow-hidden",header:"hover:bg-transparent dark:hover:bg-transparent"},iconCollapsed:ol,iconExpanded:dl}),/* @__PURE__ */re(k.Content,{children:/* @__PURE__ */ne("div",{className:"mx-2 my-1.5 flex flex-col gap-1 rounded border border-zinc-200 px-3 py-2 text-xs dark:border-zinc-800",children:[r?.title&&/* @__PURE__ */re(ml,{label:"Step",children:r.title}),r?.action&&/* @__PURE__ */re(ml,{label:"Action",children:r.action}),r?.elementId&&/* @__PURE__ */re(ml,{label:"Element",children:r.elementId}),l&&/* @__PURE__ */re(ml,{label:"Param",children:l}),void 0!==s&&/* @__PURE__ */re(ml,{label:"Value",children:cl(s)}),n&&/* @__PURE__ */re(ml,{label:"Error",children:n}),i&&/* @__PURE__ */re(ml,{label:"Registered",children:i.length>0?i.join(", "):"nothing on that element"})]})})]})},ul=/* @__PURE__ */re("i",{className:"fa-solid fa-angle-right text-[10px]"}),hl=/* @__PURE__ */re("i",{className:"fa-solid fa-angle-down text-[10px]"}),fl=({time:e,message:t,params:{elementId:a,hostElementId:r,status:n,node:l,nodes:s,startTime:o=0,endTime:d=0}})=>{let c=Z(()=>`${i(o,d)}ms`,[o,d]),{failed:m,skipped:p,disabled:u}=Z(()=>{let e=Object.values(s).map(({status:e})=>e);return{failed:e.filter(e=>"failed"===e).length,skipped:e.filter(e=>"skipped"===e).length,disabled:e.filter(e=>"disabled"===e).length}},[s]);/* @__PURE__ */
|
|
176
|
+
return ne(k,{className:x("last:border-b-none w-full border-b border-l-2 border-b-zinc-200 px-2 py-1 transition-colors hover:bg-zinc-50 dark:border-b-zinc-700 dark:hover:bg-zinc-800/50",{"border-l-emerald-500":"completed"===n,"border-l-red-500":"failed"===n,"border-l-zinc-300 dark:border-l-zinc-600":"skipped"===n}),collapsed:!0,children:[/* @__PURE__ */re(k.Header,{title:/* @__PURE__ */re(sl,{status:n,message:t,time:e}),placement:"left",className:{headerTitle:"overflow-hidden"},iconCollapsed:ul,iconExpanded:hl,children:/* @__PURE__ */ne("div",{className:"flex gap-3 text-zinc-400 dark:text-zinc-500",children:[!!m&&/* @__PURE__ */re(Jn,{logType:"danger",title:"Failed",children:m}),"skipped"!==n&&!!p&&/* @__PURE__ */re(Jn,{logType:"warning",title:"Skipped",children:p}),"skipped"!==n&&!!u&&/* @__PURE__ */re(Jn,{logType:"custom",iconClassName:"fa-solid fa-ban",title:"Disabled",children:u}),c]})}),/* @__PURE__ */re(k.Content,{children:/* @__PURE__ */re(rl,{elementId:a,hostElementId:r,node:l,nodes:s,startTime:o,endTime:d,duration:c})})]})},xl=({time:e,message:t,params:a})=>(e=>void 0!==e.nodes)(a)?/* @__PURE__ */re(fl,{time:e,message:t,params:a}):/* @__PURE__ */re(pl,{time:e,message:t,params:a}),gl=({elementId:e,startTime:t,endTime:a,duration:r})=>{let[i]=d("schema.flat"),l=Z(()=>e?C(i,e):void 0,[e,i]);/* @__PURE__ */
|
|
177
|
+
return ne("div",{className:"m-2 flex justify-around gap-4",children:[
|
|
178
|
+
/* @__PURE__ */ne("div",{className:"flex min-w-0 grow basis-0 flex-col gap-2",children:[/* @__PURE__ */ne("div",{className:"flex items-center gap-1 font-bold",children:[/* @__PURE__ */re("i",{className:"fa-regular fa-clock"}),"Times"]}),/* @__PURE__ */ne("div",{className:"flex flex-col",children:[
|
|
179
|
+
/* @__PURE__ */ne("div",{className:"flex gap-1",children:[/* @__PURE__ */re("span",{children:"Started:"}),"string"==typeof t?t:n(t)]}),
|
|
180
|
+
/* @__PURE__ */ne("div",{className:"flex gap-1",children:[/* @__PURE__ */re("span",{children:"End:"}),"string"==typeof a?a:n(a)]}),
|
|
181
|
+
/* @__PURE__ */ne("div",{className:"flex gap-1",children:[/* @__PURE__ */re("span",{children:"Duration:"}),r]})]})]}),
|
|
182
|
+
/* @__PURE__ */re("div",{className:"border-r border-gray-300"}),
|
|
183
|
+
/* @__PURE__ */ne("div",{className:"flex min-w-0 grow basis-0 flex-col gap-2",children:[/* @__PURE__ */ne("div",{className:"flex items-center gap-1",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-circle-info"}),"Details"]}),/* @__PURE__ */ne("div",{className:"flex flex-col",children:[
|
|
184
|
+
/* @__PURE__ */ne("div",{className:"flex gap-1",children:[/* @__PURE__ */re("span",{children:"Type:"}),/* @__PURE__ */re("span",{children:"Navigation"})]}),
|
|
185
|
+
/* @__PURE__ */ne("div",{className:"flex gap-1",children:[/* @__PURE__ */re("span",{children:"Trigger:"}),/* @__PURE__ */re("span",{className:"truncate",children:"-"})]}),l&&/* @__PURE__ */ne("div",{className:"flex gap-1",children:[/* @__PURE__ */re("span",{children:"Element:"}),/* @__PURE__ */ne("span",{className:"cursor-pointer truncate text-blue-500",children:[l.definition.label," [",e,"]"]})]})]})]})]})},vl=({status:e,message:t,time:a})=>{let{logType:r,statusMessage:i}=Z(()=>"normal"===e?{logType:"success",statusMessage:"Success"}:"redirect"===e?{logType:"warning",statusMessage:"Redirected"}:"notFound"===e?{logType:"warning",statusMessage:"Not Found"}:"accessDenied"===e?{logType:"danger",statusMessage:"Access Denied"}:{logType:"custom",statusMessage:""},[e]);/* @__PURE__ */
|
|
186
|
+
return ne("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[
|
|
187
|
+
/* @__PURE__ */re("span",{className:"shrink-0 font-mono text-zinc-400 tabular-nums dark:text-zinc-500",children:"string"==typeof a?a:n(a)}),
|
|
188
|
+
/* @__PURE__ */re(ll,{logType:r,children:i}),
|
|
189
|
+
/* @__PURE__ */re("div",{className:"grow basis-0 truncate text-zinc-700 dark:text-zinc-300",children:t})]})},bl=/* @__PURE__ */re("i",{className:"fa-solid fa-angle-right text-[10px]"}),yl=/* @__PURE__ */re("i",{className:"fa-solid fa-angle-down text-[10px]"}),kl=({time:e,message:t,params:a})=>/* @__PURE__ */ne(k,{className:x("last:border-b-none w-full border-b border-l-2 border-b-zinc-200 px-2 py-1 transition-colors hover:bg-zinc-50 dark:border-b-zinc-700 dark:hover:bg-zinc-800/50",{"border-l-emerald-500":"normal"===a?.status,"border-l-red-500":"accessDenied"===a?.status,"border-l-amber-500":"normal"!==a?.status&&"accessDenied"===a?.status}),collapsed:!0,children:[/* @__PURE__ */re(k.Header,{title:/* @__PURE__ */re(vl,{status:a?.status,message:t,time:e}),placement:"left",className:{headerTitle:"overflow-hidden"},iconCollapsed:bl,iconExpanded:yl,children:/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"0ms"})}),/* @__PURE__ */re(k.Content,{children:/* @__PURE__ */re(gl,{elementId:a?.elementId,startTime:e,endTime:e,duration:"0ms"})})]}),Nl=/* @__PURE__ */re("i",{className:"fa-solid fa-angle-right text-[10px]"}),zl=/* @__PURE__ */re("i",{className:"fa-solid fa-angle-down text-[10px]"}),wl=({time:e,message:t,params:{event:a,issues:r,payload:n}})=>/* @__PURE__ */ne(k,{className:"last:border-b-none w-full border-b border-l-2 border-b-zinc-200 border-l-red-500 px-2 py-1 transition-colors hover:bg-zinc-50 dark:border-b-zinc-700 dark:hover:bg-zinc-800/50",collapsed:!0,children:[/* @__PURE__ */re(k.Header,{title:/* @__PURE__ */ne("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[
|
|
190
|
+
/* @__PURE__ */re("span",{className:"shrink-0 font-mono text-zinc-400 tabular-nums dark:text-zinc-500",children:e}),
|
|
191
|
+
/* @__PURE__ */re(ll,{logType:"danger",children:"Invalid"}),
|
|
192
|
+
/* @__PURE__ */re("div",{className:"grow basis-0 truncate text-zinc-700 dark:text-zinc-300",children:t})]}),placement:"left",className:{headerTitle:"overflow-hidden"},iconCollapsed:Nl,iconExpanded:zl,children:/* @__PURE__ */re("span",{className:"font-mono text-zinc-400 dark:text-zinc-500",children:a})}),/* @__PURE__ */re(k.Content,{children:/* @__PURE__ */ne("div",{className:"flex flex-col gap-1 py-1 pl-4",children:[r.map(e=>/* @__PURE__ */ne("div",{className:"flex gap-2",children:[/* @__PURE__ */re("span",{className:"font-mono text-red-600 dark:text-red-400",children:e.path||"(root)"}),/* @__PURE__ */re("span",{className:"text-zinc-600 dark:text-zinc-300",children:e.message})]},`${e.path}-${e.message}`)),void 0!==n&&/* @__PURE__ */re("pre",{className:"mt-1 overflow-x-auto rounded bg-zinc-50 p-2 text-[11px] text-zinc-600 dark:bg-zinc-800/60 dark:text-zinc-300",children:JSON.stringify(n,null,2)})]})})]}),Sl=/* @__PURE__ */re("i",{className:"fa-solid fa-angle-right text-[10px]"}),Cl=/* @__PURE__ */re("i",{className:"fa-solid fa-angle-down text-[10px]"}),$l={status:"Status",received:"In",published:"Out",refused:"Refused"},jl=e=>{switch(e.event){case"received":return e.message;case"published":return{data:e.data,delivered:e.delivered};case"status":return{topics:e.topics,transport:e.transport};case"refused":return{reason:e.reason}}},Tl=({logType:e,time:t,message:a,params:r})=>/* @__PURE__ */ne(k,{className:"last:border-b-none w-full border-b border-l-2 border-b-zinc-200 border-l-sky-500 px-2 py-1 transition-colors hover:bg-zinc-50 dark:border-b-zinc-700 dark:hover:bg-zinc-800/50",collapsed:!0,children:[/* @__PURE__ */re(k.Header,{title:/* @__PURE__ */ne("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[
|
|
193
|
+
/* @__PURE__ */re("span",{className:"shrink-0 font-mono text-zinc-400 tabular-nums dark:text-zinc-500",children:t}),
|
|
194
|
+
/* @__PURE__ */re(ll,{logType:e,children:$l[r.event]}),
|
|
195
|
+
/* @__PURE__ */re("div",{className:"grow basis-0 truncate text-zinc-700 dark:text-zinc-300",children:a})]}),placement:"left",className:{headerTitle:"overflow-hidden"},iconCollapsed:Sl,iconExpanded:Cl,children:/* @__PURE__ */re("span",{className:"font-mono text-zinc-400 dark:text-zinc-500",children:"realtime"})}),/* @__PURE__ */re(k.Content,{children:/* @__PURE__ */re("pre",{className:"mt-1 overflow-x-auto rounded bg-zinc-50 p-2 text-[11px] text-zinc-600 dark:bg-zinc-800/60 dark:text-zinc-300",children:JSON.stringify(jl(r),null,2)})})]}),Il=e=>{if(null==e)return"";if("function"==typeof e)return"Function";try{return JSON.stringify(e,null,2)}catch{return String(e)}},Ll=({path:e,prev:t,next:a,contextLines:r=10})=>{let n=Y(null),[i,l]=ee(0),s=Z(()=>((e,t)=>{let a=Il(e).split("\n"),r=Il(t).split("\n"),n=a.length,i=r.length,l=Array.from({length:n+1},()=>Array(i+1).fill(0));for(let c=1;c<=n;c++)for(let e=1;e<=i;e++)l[c][e]=a[c-1]===r[e-1]?l[c-1][e-1]+1:Math.max(l[c-1][e],l[c][e-1]);let s=[],o=n,d=i;for(;o>0||d>0;)o>0&&d>0&&a[o-1]===r[d-1]?(s.unshift({type:"same",text:a[o-1]}),o--,d--):d>0&&(0===o||l[o][d-1]>=l[o-1][d])?(s.unshift({type:"added",text:r[d-1]}),d--):(s.unshift({type:"removed",text:a[o-1]}),o--);return s})(t,a),[t,a]),o=Z(()=>(e=>{let t=[],a=-1;for(let r=0;r<e.length;r++)"same"===e[r].type?-1!==a&&(t.push({start:a,end:r-1}),a=-1):-1===a&&(a=r);return-1!==a&&t.push({start:a,end:e.length-1}),t})(s),[s]),d=Z(()=>((e,t,a)=>{if(0===t.length)return e.map((e,t)=>({kind:"line",line:e,diffIndex:t,hunkIndex:null}));let r=[],n=-1;return t.forEach((i,l)=>{let s=Math.max(0,i.start-a),o=Math.min(e.length-1,i.end+a);s>n+1&&r.push({kind:"separator",hunkIndex:l,total:t.length});for(let t=Math.max(s,n+1);t<=o;t++){let a=t>=i.start&&t<=i.end;r.push({kind:"line",line:e[t],diffIndex:t,hunkIndex:a?l:null})}n=o}),r})(s,o,r),[s,o,r]),c=o.length>0,m=0===i,p=i===o.length-1,u=Q(e=>{(n.current?.querySelector(`[data-hunk="${e}"]`))?.scrollIntoView({block:"center"})},[]),h=Q(e=>{let t=i+e;t<0||t>=o.length||(l(t),u(t))},[i,o.length,u]);X(()=>{c&&(l(0),u(0))},[s]);let f=Q(()=>h(-1),[h]),g=Q(()=>h(1),[h]);/* @__PURE__ */
|
|
196
|
+
return ne("div",{className:"mx-2 my-1.5 flex flex-col gap-2 rounded border border-zinc-200 bg-zinc-50 font-mono dark:border-zinc-700 dark:bg-zinc-800/50",children:[/* @__PURE__ */ne("div",{className:"flex items-center justify-between border-b border-zinc-200 px-2 py-1 dark:border-zinc-700",children:[/* @__PURE__ */ne("div",{className:"flex min-w-0 items-center gap-1.5",children:[/* @__PURE__ */re("span",{className:"shrink-0 text-zinc-500 dark:text-zinc-400",children:"path"}),/* @__PURE__ */re("span",{className:"truncate text-zinc-400 dark:text-zinc-500",children:e??"(full state)"})]}),/* @__PURE__ */ne("div",{className:"flex shrink-0 items-center gap-2",children:[c&&/* @__PURE__ */ne("span",{className:"text-zinc-400 tabular-nums dark:text-zinc-600",children:[i+1,"/",o.length]}),
|
|
197
|
+
/* @__PURE__ */re("button",{className:x("rounded bg-zinc-200 px-2 py-0.5 text-xs text-zinc-600 transition-colors hover:bg-zinc-300 dark:bg-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-600",{"cursor-not-allowed opacity-30 dark:cursor-not-allowed dark:opacity-30":!c||m}),disabled:!c||m,onClick:f,children:"↑ Prev"}),
|
|
198
|
+
/* @__PURE__ */re("button",{className:x("rounded bg-zinc-200 px-2 py-0.5 text-xs text-zinc-600 transition-colors hover:bg-zinc-300 dark:bg-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-600",{"cursor-not-allowed opacity-30 dark:cursor-not-allowed dark:opacity-30":!c||p}),disabled:!c||p,onClick:g,children:"↓ Next"})]})]}),/* @__PURE__ */ne("pre",{ref:n,className:"max-h-64 overflow-auto bg-zinc-50 text-xs leading-5 dark:bg-zinc-800",children:[!c&&/* @__PURE__ */re("div",{className:"px-3 py-2 text-zinc-400 italic dark:text-zinc-600",children:"No changes"}),d.map((e,t)=>{if("separator"===e.kind){let a=e.hunkIndex===i;/* @__PURE__ */
|
|
199
|
+
return ne("div",{"data-hunk":e.hunkIndex,className:x("px-3",{"bg-violet-50 text-violet-600 dark:bg-violet-900/40 dark:text-violet-400":a,"text-zinc-400 dark:text-zinc-700":!a}),children:["@@ hunk ",e.hunkIndex+1,"/",e.total," @@"]},`sep-${t}`)}let{line:a,diffIndex:r,hunkIndex:n}=e,l=n===i;return"removed"===a.type?/* @__PURE__ */ne("div",{"data-hunk":n??void 0,className:x("px-3",{"bg-red-100 text-red-700 dark:bg-red-500/20 dark:text-red-300":l,"bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400":!l}),children:["- ",a.text]},r):"added"===a.type?/* @__PURE__ */ne("div",{"data-hunk":n??void 0,className:x("px-3",{"bg-emerald-100 text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-300":l,"bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400":!l}),children:["+ ",a.text]},r):/* @__PURE__ */ne("div",{className:"px-3 text-zinc-400 dark:text-zinc-600",children:[" ",a.text]},r)})]})]})},Rl=({storeName:e,path:t,message:a,time:r})=>/* @__PURE__ */ne("div",{className:"flex w-full items-center gap-2 overflow-hidden",children:[
|
|
200
|
+
/* @__PURE__ */re("span",{className:"shrink-0 font-mono text-zinc-400 tabular-nums dark:text-zinc-500",children:"string"==typeof r?r:n(r)}),
|
|
201
|
+
/* @__PURE__ */re(ll,{logType:"info",children:"Store"}),e&&/* @__PURE__ */re("span",{className:"shrink-0 font-semibold text-zinc-700 dark:text-zinc-200",children:e}),
|
|
202
|
+
/* @__PURE__ */re("span",{className:"truncate font-mono text-zinc-400 dark:text-zinc-500",children:t??a??"(full state)"})]}),El=/* @__PURE__ */re("i",{className:"fa-solid fa-angle-right text-[10px]"}),Vl=/* @__PURE__ */re("i",{className:"fa-solid fa-angle-down text-[10px]"}),Al=({time:e,message:t,params:a})=>/* @__PURE__ */ne(k,{className:"last:border-b-none w-full border-b border-l-2 border-b-zinc-200 border-l-violet-500 px-2 py-1 transition-colors hover:bg-zinc-50 dark:border-b-zinc-700 dark:hover:bg-zinc-800/50",collapsed:!0,children:[/* @__PURE__ */re(k.Header,{title:/* @__PURE__ */re(Rl,{storeName:a?.storeName,path:a?.path,message:t,time:e}),placement:"left",className:{headerTitle:"overflow-hidden",header:"hover:bg-transparent dark:hover:bg-transparent"},iconCollapsed:El,iconExpanded:Vl}),/* @__PURE__ */re(k.Content,{children:/* @__PURE__ */re(Ll,{path:a?.path,prev:a?.prev,next:a?.next})})]}),Ml=H(({log:e})=>{let{message:t,time:a}=e;switch(e.category){case"interactions":/* @__PURE__ */return re(xl,{message:t,params:e.params,time:a});case"navigation":/* @__PURE__ */return re(kl,{message:t,params:e.params,time:a});case"store":/* @__PURE__ */return re(Al,{message:t,params:e.params,time:a});case"network":/* @__PURE__ */return re(wl,{message:t,params:e.params,time:a});case"actions":/* @__PURE__ */return re(Qi,{message:t,params:e.params,time:a});case"realtime":/* @__PURE__ */return re(Tl,{logType:e.logType,message:t,params:e.params,time:a});case"eventBridge":return null}}),Dl=({className:e,amount:t,suffix:a="All",selected:r,logType:n,onClick:i})=>{let l=Q(()=>i?.(n),[i,n]);/* @__PURE__ */
|
|
203
|
+
return ne("div",{className:x("flex cursor-pointer items-center gap-2 px-2 py-1.5 transition-colors",r?"bg-zinc-200 dark:bg-zinc-700":"hover:bg-zinc-100 dark:hover:bg-zinc-800",e),onClick:l,children:[
|
|
204
|
+
/* @__PURE__ */re("i",{className:x("text-xs",{"fa-regular fa-circle-xmark text-red-500 dark:text-red-400":"danger"===n,"fa-solid fa-triangle-exclamation text-amber-500 dark:text-amber-400":"warning"===n,"fa-solid fa-circle-info text-violet-500 dark:text-violet-400":"info"===n,"fa-solid fa-check text-emerald-500 dark:text-emerald-400":"success"===n,"fa-solid fa-list text-zinc-500 dark:text-zinc-400":!n||!["danger","warning","info","success"].includes(n)})}),
|
|
205
|
+
/* @__PURE__ */re("span",{className:"font-medium text-zinc-700 tabular-nums dark:text-zinc-200",children:t}),
|
|
206
|
+
/* @__PURE__ */re("span",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:a})]})},Ol=({className:e,orientation:t="horizontal",items:a,logTypeSelected:r,onClick:n})=>{let i=Z(()=>a.reduce((e,t)=>{let{logType:a}=t;return e[a]||(e[a]=0),{...e,[a]:++e[a]}},{}),[a]),l=Q(e=>n?.(e),[n]);/* @__PURE__ */
|
|
207
|
+
return ne("div",{className:x("flex shrink-0 border-zinc-200 select-none dark:border-zinc-700","horizontal"===t?"flex-col border-r":"border-b",e),children:[
|
|
208
|
+
/* @__PURE__ */re(Dl,{onClick:l,amount:a.length,selected:!r}),
|
|
209
|
+
/* @__PURE__ */re(Dl,{onClick:l,amount:i.danger??0,suffix:"Errors",logType:"danger",selected:"danger"===r}),
|
|
210
|
+
/* @__PURE__ */re(Dl,{onClick:l,amount:i.warning??0,suffix:"Warnings",logType:"warning",selected:"warning"===r}),
|
|
211
|
+
/* @__PURE__ */re(Dl,{onClick:l,amount:i.info??0,suffix:"Info",logType:"info",selected:"info"===r})]})},Fl=({items:e=[],autoScrollOffset:t=40,orientation:a="horizontal",logTypeFilter:r,onClear:n})=>{let[i,l]=ee(r),s=Y(null),o=Y(!0);X(()=>{let e=s.current;e&&o.current&&(e.scrollTop=0)},[e]);let d=Q(()=>{let e=s.current;e&&(o.current=e.scrollTop<=t)},[t]),c=Q(e=>{l(e)},[]);/* @__PURE__ */
|
|
212
|
+
return ne("div",{className:"flex h-full w-full flex-col",children:[/* @__PURE__ */ne("div",{className:"flex shrink-0 items-center justify-between border-b border-zinc-200 bg-zinc-50 px-2 py-1 dark:border-zinc-700 dark:bg-zinc-800",children:[/* @__PURE__ */ne("span",{className:"font-mono text-zinc-400 dark:text-zinc-500",children:[e.length," ",1===e.length?"entry":"entries"]}),/* @__PURE__ */ne("button",{className:"rounded px-2 py-0.5 text-xs text-zinc-500 transition-colors hover:bg-zinc-200 hover:text-zinc-800 dark:text-zinc-400 dark:hover:bg-zinc-700 dark:hover:text-zinc-200",onClick:n,children:[/* @__PURE__ */re("i",{className:"fa-solid fa-trash-can mr-1"}),"Clear"]})]}),/* @__PURE__ */ne("div",{className:x("flex h-full w-full overflow-hidden",{"grow basis-0 flex-col":"vertical"===a}),children:[/* @__PURE__ */re(Ol,{className:x({"h-full":"horizontal"===a}),logTypeSelected:i,items:e,orientation:a,onClick:c}),/* @__PURE__ */re("div",{ref:s,onScroll:d,className:"flex grow basis-0 flex-col overflow-y-auto",children:0===e.length?/* @__PURE__ */ne("div",{className:"flex grow flex-col items-center justify-center gap-2 text-zinc-400 dark:text-zinc-500",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-terminal text-3xl opacity-20"}),/* @__PURE__ */re("span",{children:"No logs yet"})]}):e.map((e,t)=>({item:e,key:t})).filter(({item:e})=>!i||e.logType===i).reverse().map(({item:e,key:t})=>/* @__PURE__ */re(Ml,{log:e},t))})]})]})},Jl={"local-custom":{label:"Shipped with this space",hint:"A file this deployment hands the server, compiled and rendered with everything else."},remote:{label:"Installed",hint:"A published bundle, described by the manifest it was published with."}},Bl=({entry:e})=>{let{type:t,origin:a,version:r,author:n,settings:i}=e,l=Z(()=>i&&0!==Object.keys(i).length?pe(JSON.stringify(i,null,2)):null,[i]);/* @__PURE__ */
|
|
213
|
+
return ne("div",{className:"flex h-full grow basis-0 flex-col overflow-y-auto p-4",children:[/* @__PURE__ */ne("div",{className:"mb-4 border-b border-zinc-200 pb-3 dark:border-zinc-700",children:[/* @__PURE__ */re("div",{className:"text-base font-semibold text-zinc-800 dark:text-zinc-200",children:t}),/* @__PURE__ */re("div",{className:"text-xs text-zinc-400 dark:text-zinc-500",children:Jl[a].label})]}),/* @__PURE__ */ne("div",{className:"flex flex-col gap-3",children:[
|
|
214
|
+
/* @__PURE__ */ne("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */re("span",{className:"text-xs font-medium tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:"Where it comes from"}),/* @__PURE__ */re("span",{className:"text-xs text-zinc-800 dark:text-zinc-200",children:Jl[a].hint})]}),
|
|
215
|
+
/* @__PURE__ */ne("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */re("span",{className:"text-xs font-medium tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:"Version"}),/* @__PURE__ */re("span",{className:"font-mono text-xs text-zinc-800 dark:text-zinc-200",children:r??"—"})]}),
|
|
216
|
+
/* @__PURE__ */ne("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */re("span",{className:"text-xs font-medium tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:"Author"}),/* @__PURE__ */re("span",{className:"text-xs text-zinc-800 dark:text-zinc-200",children:n??"—"})]}),
|
|
217
|
+
/* @__PURE__ */ne("div",{className:"flex flex-col gap-1",children:[/* @__PURE__ */re("span",{className:"text-xs font-medium tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:"Settings"}),l?/* @__PURE__ */re("pre",{className:"overflow-auto rounded bg-zinc-50 p-2 font-mono text-xs leading-5 dark:bg-zinc-800",dangerouslySetInnerHTML:{__html:l}}):/* @__PURE__ */re("span",{className:"text-xs text-zinc-400 italic dark:text-zinc-500",children:"No settings"})]})]})]})},Pl=({name:e,label:t,id:a,isSelected:r,className:n,onSelect:i})=>{let l=Q(()=>i?.(a),[i,a]);/* @__PURE__ */
|
|
218
|
+
return re("div",{className:x("flex w-full cursor-pointer items-center gap-2 border-l-2 px-2 py-1.5 transition-colors",{"border-l-violet-500 bg-violet-50 text-violet-700 dark:border-l-violet-500 dark:bg-violet-500/15 dark:text-violet-300":r,"border-l-transparent text-zinc-600 hover:bg-zinc-100 hover:text-zinc-900 dark:border-l-transparent dark:text-zinc-300 dark:hover:bg-zinc-800 dark:hover:text-zinc-100":!r},n),onClick:l,children:/* @__PURE__ */re("div",{className:"truncate",title:e,children:t??e})})},ql=({items:e=[],className:t,value:a,onSelect:r})=>{let[n,i]=ee(""),l=Z(()=>e.filter(e=>(e.name??"").toLowerCase().includes(n.toLowerCase())),[e,n]),s=Z(()=>"string"==typeof a?e.find(e=>e.id===a):a,[a,e]),o=Q(e=>i(e),[]),d=Q(t=>r?.(e.find(e=>e.id===t)),[e,r]);/* @__PURE__ */
|
|
219
|
+
return ne("div",{className:x("flex h-full flex-col gap-2 border-r border-zinc-200 dark:border-zinc-700",t),children:[/* @__PURE__ */re("div",{className:"px-2 pt-2",children:/* @__PURE__ */re(h,{value:n,onChange:o,placeholder:"Search...",size:"sm"})}),/* @__PURE__ */ne("div",{className:"flex flex-col overflow-y-auto text-xs text-zinc-700 dark:text-zinc-300",children:[!l.length&&/* @__PURE__ */re("div",{className:"p-4 text-center text-zinc-400 dark:text-zinc-600",children:"No items"}),l.length>0&&l.map((e,t)=>/* @__PURE__ */re(Pl,{label:e.label,name:e.name,isSelected:s?.id===e.id,id:e.id,onSelect:d},t))]})]})},Wl={"local-custom":"Shipped with this space",remote:"Installed"},Ul=({className:e})=>{let{plugins:t}=K(y),{components:a}=K(r),n=Z(()=>{let e=/* @__PURE__ */new Map;return Object.entries(a.current).forEach(([t,a])=>{let{origin:r}=a;("local-custom"===r||"remote"===r)&&e.set(t,{type:t,origin:r,version:a.version})}),Object.entries(t).forEach(([t,a])=>{let r=e.get(t),{manifest:n}=a;e.set(t,{type:t,origin:r?.origin??"remote",version:n.version||r?.version,author:n.author,settings:a.settings})}),[...e.values()].map(e=>({...e,id:e.type,name:e.type,label:/* @__PURE__ */ne("div",{className:"flex flex-col gap-0.5",children:[/* @__PURE__ */re("span",{className:"capitalize",children:e.type}),/* @__PURE__ */re("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:e.version??Wl[e.origin]})]})}))},[t,a.current]),[i,l]=ee(),s=Q(e=>l(e),[]);/* @__PURE__ */
|
|
220
|
+
return ne("div",{className:x("flex h-full w-full",e),children:[/* @__PURE__ */re(ql,{className:"w-[240px]",items:n,value:i,onSelect:s}),i?/* @__PURE__ */re(Bl,{entry:i}):/* @__PURE__ */ne("div",{className:"flex grow flex-col items-center justify-center gap-2 text-zinc-400 dark:text-zinc-600",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-puzzle-piece text-2xl opacity-30"}),/* @__PURE__ */re("span",{children:"Select a plugin"})]})]})},Hl=()=>{let{settings:e,setCheck:t}=K(qe),a=Ee.every(t=>e.checks[t]),r=a?"None":"Run all",n=Q(()=>Ee.forEach(e=>t(e,!a)),[t,a]);/* @__PURE__ */
|
|
221
|
+
return re("button",{type:"button",className:"rounded px-1.5 py-0.5 font-medium normal-case hover:bg-zinc-100 dark:hover:bg-zinc-800",onClick:n,children:r})},Kl="devtools-element-hovered",Ql=({finding:{element:e,note:t}})=>{let a=e.getAttribute("data-plitzi-el"),r=Q(()=>{e.scrollIntoView({block:"center",behavior:"smooth"}),e.classList.add(Kl),setTimeout(()=>e.classList.remove(Kl),1600)},[e]);/* @__PURE__ */
|
|
222
|
+
return ne("button",{type:"button",className:"flex w-full cursor-pointer items-center gap-2 px-3 py-1 pl-6 text-left hover:bg-zinc-50 dark:hover:bg-zinc-800/60",onClick:r,children:[
|
|
223
|
+
/* @__PURE__ */re("span",{className:"shrink-0 font-mono text-zinc-500 dark:text-zinc-400",children:e.tagName.toLowerCase()}),a&&/* @__PURE__ */re("span",{className:"truncate font-mono text-violet-600 dark:text-violet-400",children:a}),
|
|
224
|
+
/* @__PURE__ */re("span",{className:"ml-auto shrink-0 text-[11px] text-zinc-500 dark:text-zinc-400",children:t})]})},_l=({check:e})=>{let{settings:t,setCheck:a,findings:r}=K(qe),{label:n,description:i,colour:l}=lt[e],s=t.checks[e],o=r[e],d=s?{backgroundColor:l}:{boxShadow:`inset 0 0 0 1.5px ${l}`},c=Q(()=>a(e,!s),[a,e,s]);/* @__PURE__ */
|
|
225
|
+
return ne("div",{className:"border-b border-zinc-100 last:border-b-0 dark:border-zinc-800",children:[/* @__PURE__ */ne("button",{type:"button",role:"switch","aria-checked":s,title:i,className:"flex w-full cursor-pointer items-center gap-2 px-2.5 py-1.5 text-left hover:bg-zinc-50 dark:hover:bg-zinc-800/60",onClick:c,children:[
|
|
226
|
+
/* @__PURE__ */re("span",{className:"h-2.5 w-2.5 shrink-0 rounded-full",style:d}),
|
|
227
|
+
/* @__PURE__ */re("span",{className:"min-w-0 truncate font-medium text-zinc-800 dark:text-zinc-200",children:n}),s&&/* @__PURE__ */re("span",{className:x("ml-auto rounded-full px-1.5 text-[10px] font-semibold",{"bg-emerald-100 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-400":0===o.length,"bg-rose-100 text-rose-700 dark:bg-rose-500/15 dark:text-rose-400":o.length>0}),children:o.length})]}),s&&o.length>0&&/* @__PURE__ */re("div",{className:"max-h-40 overflow-y-auto pb-1",children:o.slice(0,40).map((t,a)=>/* @__PURE__ */re(Ql,{finding:t},`${e}-${String(a)}`))})]})},Xl=()=>{let{rescan:e}=K(qe),t=Q(()=>e(),[e]);/* @__PURE__ */
|
|
228
|
+
return re("button",{type:"button",className:"rounded px-1.5 py-0.5 font-medium normal-case hover:bg-zinc-100 dark:hover:bg-zinc-800",onClick:t,children:"Look again"})},Zl=()=>/* @__PURE__ */ne("section",{className:"flex min-w-0 flex-col gap-1.5",children:[/* @__PURE__ */ne("div",{className:"flex items-center justify-between gap-2 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:[/* @__PURE__ */ne("span",{className:"flex items-center gap-2",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-list-check"}),"Checks"]}),/* @__PURE__ */ne("span",{className:"flex items-center gap-1",children:[/* @__PURE__ */re(Xl,{}),/* @__PURE__ */re(Hl,{})]})]}),/* @__PURE__ */re("div",{className:"overflow-hidden rounded border border-zinc-200 dark:border-zinc-700",children:Ee.map(e=>/* @__PURE__ */re(_l,{check:e},e))})]}),Gl=({name:e,children:t})=>/* @__PURE__ */ne("div",{className:"grid grid-cols-[88px_minmax(0,1fr)] items-baseline gap-2 py-0.5",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:e}),/* @__PURE__ */re("span",{className:"min-w-0 truncate font-mono text-zinc-800 dark:text-zinc-200",children:t})]}),Yl=({rule:{selector:e,declarations:t,media:a}})=>{let[r,n]=ee(!1),i=r?"Copied":"Copy",l=Q(()=>{navigator.clipboard.writeText(`${e} { ${t} }`).then(()=>{n(!0),setTimeout(()=>n(!1),1200)})},[e,t]);/* @__PURE__ */
|
|
229
|
+
return ne("div",{className:"group border-b border-zinc-100 px-2.5 py-1.5 last:border-b-0 dark:border-zinc-800",children:[/* @__PURE__ */ne("div",{className:"flex items-center gap-2",children:[
|
|
230
|
+
/* @__PURE__ */re("span",{className:"min-w-0 truncate font-mono text-violet-700 dark:text-violet-300",title:e,children:e}),a&&/* @__PURE__ */ne("span",{className:"shrink-0 font-mono text-[10px] text-amber-600 dark:text-amber-400",children:["@media ",a]}),
|
|
231
|
+
/* @__PURE__ */re("button",{type:"button",className:"ml-auto shrink-0 rounded px-1 text-[10px] text-zinc-400 opacity-0 group-hover:opacity-100 hover:bg-zinc-100 hover:text-zinc-700 dark:hover:bg-zinc-800 dark:hover:text-zinc-200",onClick:l,children:i})]}),/* @__PURE__ */re("div",{className:"mt-0.5 font-mono text-[11px] leading-relaxed break-words text-zinc-600 dark:text-zinc-400",children:t})]})},es=/^(\*|:root|:host|html|body|::?before|::?after|::backdrop|::?marker)$/,ts=e=>e.split(",").every(e=>es.test(e.trim())),as=e=>e.includes("[data-plitzi-qa")||e.includes("devtools-element-"),rs=e=>[...e].every(e=>e.startsWith("--tw-")),ns=(e,t)=>t?e.includes("&")?e.replaceAll("&",`:is(${t})`):`:is(${t}) ${e}`:e,is=(e,t)=>{try{return e.matches(t)}catch{return!1}},ls=(e,t,a,r,n)=>{let i=e.ownerDocument.defaultView;for(let l of t){if(a.length>=60)return;if(l instanceof CSSStyleRule){let t=ns(l.selectorText,r);l.style.length>0&&!ts(l.selectorText)&&!as(l.selectorText)&&!rs(l.style)&&is(e,t)&&a.push({selector:l.selectorText,declarations:l.style.cssText,...n?{media:n}:{}}),l.cssRules.length>0&&ls(e,l.cssRules,a,t,n)}else l instanceof CSSMediaRule?("function"!=typeof i?.matchMedia||i.matchMedia(l.media.mediaText).matches)&&ls(e,l.cssRules,a,r,l.media.mediaText):l instanceof CSSGroupingRule&&ls(e,l.cssRules,a,r,n)}},ss=({element:e})=>{let{setPinned:t}=K(qe),a=Z(()=>yt(e),[e]),r=Z(()=>(e=>{let t=[];for(let a of e.ownerDocument.styleSheets)try{ls(e,a.cssRules,t,void 0,void 0)}catch{}return t})(e),[e]),n=Q(()=>e.scrollIntoView({block:"center",behavior:"smooth"}),[e]),i=Q(()=>t(void 0),[t]);return a?/* @__PURE__ */ne("div",{className:"flex min-w-0 flex-col gap-2",children:[
|
|
232
|
+
/* @__PURE__ */ne("div",{className:"flex items-center gap-2",children:[
|
|
233
|
+
/* @__PURE__ */re("span",{className:"min-w-0 truncate font-mono font-semibold text-violet-700 dark:text-violet-300",children:a.name}),
|
|
234
|
+
/* @__PURE__ */ne("span",{className:"shrink-0 font-mono text-zinc-400",children:[a.width," × ",a.height]}),
|
|
235
|
+
/* @__PURE__ */re("button",{type:"button",className:"ml-auto shrink-0 rounded px-1.5 py-0.5 hover:bg-zinc-100 dark:hover:bg-zinc-800",title:"Scroll the page to it",onClick:n,children:/* @__PURE__ */re("i",{className:"fa-solid fa-crosshairs"})}),
|
|
236
|
+
/* @__PURE__ */re("button",{type:"button",className:"shrink-0 rounded px-1.5 py-0.5 hover:bg-zinc-100 dark:hover:bg-zinc-800",title:"Let it go",onClick:i,children:/* @__PURE__ */re("i",{className:"fa-solid fa-xmark"})})]}),
|
|
237
|
+
/* @__PURE__ */ne("div",{className:"grid grid-cols-1 gap-x-4 rounded border border-zinc-200 px-2.5 py-1.5 @lg:grid-cols-2 dark:border-zinc-700",children:[
|
|
238
|
+
/* @__PURE__ */ne(Gl,{name:"display",children:[a.display," · ",a.position]}),
|
|
239
|
+
/* @__PURE__ */re(Gl,{name:"font",children:a.font}),
|
|
240
|
+
/* @__PURE__ */re(Gl,{name:"padding",children:a.padding}),
|
|
241
|
+
/* @__PURE__ */ne(Gl,{name:"line / track",children:[a.lineHeight," · ",a.letterSpacing]}),
|
|
242
|
+
/* @__PURE__ */re(Gl,{name:"margin",children:a.margin}),
|
|
243
|
+
/* @__PURE__ */re(Gl,{name:"colour",children:/* @__PURE__ */re(ft,{colour:a.colour})}),
|
|
244
|
+
/* @__PURE__ */ne(Gl,{name:"border",children:[a.border," · r ",a.radius]}),
|
|
245
|
+
/* @__PURE__ */re(Gl,{name:"background",children:a.background&&/* @__PURE__ */re(ft,{colour:a.background})}),
|
|
246
|
+
/* @__PURE__ */ne(Gl,{name:"gap · z",children:[a.gap||"—"," · ",a.zIndex]}),
|
|
247
|
+
/* @__PURE__ */re(Gl,{name:"contrast",children:a.contrast&&/* @__PURE__ */re(ht,{ratio:a.contrast.ratio,needs:a.contrast.needs})})]}),a.classes.length>0&&/* @__PURE__ */re("div",{className:"flex flex-wrap gap-1",children:a.classes.map(e=>/* @__PURE__ */ne("span",{className:"rounded bg-zinc-100 px-1.5 py-0.5 font-mono text-[11px] dark:bg-zinc-800",children:[".",e]},e))}),
|
|
248
|
+
/* @__PURE__ */ne("div",{className:"flex flex-col",children:[/* @__PURE__ */ne("span",{className:"mb-1 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:["CSS that reaches it · ",r.length]}),/* @__PURE__ */re("div",{className:"overflow-hidden rounded border border-zinc-200 dark:border-zinc-700",children:r.map((e,t)=>/* @__PURE__ */re(Yl,{rule:e},`${e.selector}-${String(t)}`))})]})]}):null},os=()=>/* @__PURE__ */ne("div",{className:"flex flex-col gap-1.5 rounded border border-dashed border-zinc-200 p-3 text-zinc-500 dark:border-zinc-700 dark:text-zinc-400",children:[/* @__PURE__ */re("span",{className:"font-medium text-zinc-700 dark:text-zinc-200",children:"Nothing inspected yet"}),/* @__PURE__ */ne("span",{children:["Turn on ",
|
|
249
|
+
/* @__PURE__ */re("b",{children:"Inspect"})," and point at anything on the page: its box, type, colours and contrast show by the pointer. Click it to keep it here, with the CSS that reaches it. With one kept, hold ",
|
|
250
|
+
/* @__PURE__ */re("b",{children:"Alt"})," over another to measure the distance between them."]})]}),ds=()=>{let{pinned:e,round:t}=K(qe),a=e?.isConnected?e:void 0;/* @__PURE__ */
|
|
251
|
+
return ne("section",{className:"flex min-w-0 flex-col gap-1.5",children:[
|
|
252
|
+
/* @__PURE__ */ne("div",{className:"flex items-center gap-2 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-magnifying-glass"}),"Inspector"]}),a&&/* @__PURE__ */re(ss,{element:a},t),!a&&/* @__PURE__ */re(os,{})]})},cs=()=>/* @__PURE__ */re("span",{className:"h-4 w-px shrink-0 bg-zinc-200 dark:bg-zinc-700"}),ms=()=>{let{pageRef:e}=K(qe),t=Q(()=>{e.current?.getAnimations({subtree:!0}).filter(N).forEach(e=>{e.cancel(),e.play()})},[e]);/* @__PURE__ */
|
|
253
|
+
return ne("button",{type:"button",title:"Play the page's arrivals and loops again from the start",className:"flex h-6 shrink-0 cursor-pointer items-center gap-1.5 rounded-md border border-zinc-200 px-2 font-medium whitespace-nowrap text-zinc-600 transition-colors hover:bg-zinc-100 dark:border-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-800",onClick:t,children:[/* @__PURE__ */re("i",{className:"fa-solid fa-rotate-left text-[10px]"}),"Replay"]})},ps=({setting:e,label:t,icon:a,title:r,primary:n=!1})=>{let{settings:i,setSetting:l}=K(qe),s=i[e],o=Q(()=>l(e,!s),[l,e,s]);/* @__PURE__ */
|
|
254
|
+
return ne("button",{type:"button","aria-pressed":s,title:r,className:x("flex h-6 shrink-0 cursor-pointer items-center gap-1.5 rounded-md border px-2 font-medium whitespace-nowrap transition-colors",{"border-violet-500 bg-violet-500 text-white":s&&n,"border-violet-400/60 bg-violet-500/10 text-violet-700 dark:text-violet-300":s&&!n,"border-violet-300 text-violet-700 hover:bg-violet-500/10 dark:border-violet-500/50 dark:text-violet-300":!s&&n,"border-zinc-200 text-zinc-600 hover:bg-zinc-100 dark:border-zinc-700 dark:text-zinc-300 dark:hover:bg-zinc-800":!s&&!n}),onClick:o,children:[/* @__PURE__ */re("i",{className:x(a,"text-[10px]")}),t]})},us=[{mode:"none",label:"Vision: as it is"},{mode:"grayscale",label:"No colour"},{mode:"protanopia",label:"Protanopia (red)"},{mode:"deuteranopia",label:"Deuteranopia (green)"},{mode:"tritanopia",label:"Tritanopia (blue)"},{mode:"blurred",label:"Low vision (blur)"}],hs=()=>{let{settings:e,setSetting:t}=K(qe),a=Q(e=>{(e=>us.some(({mode:t})=>t===e))(e.target.value)&&t("vision",e.target.value)},[t]);/* @__PURE__ */
|
|
255
|
+
return re("select",{value:e.vision,title:"See the page without one kind of colour, or out of focus",onChange:a,className:x("h-6 shrink-0 rounded-md border bg-white py-0 pr-6 pl-2 text-[11px] leading-[22px] dark:bg-zinc-900",{"border-violet-400/60 text-violet-700 dark:text-violet-300":"none"!==e.vision,"border-zinc-200 text-zinc-600 dark:border-zinc-700 dark:text-zinc-300":"none"===e.vision}),children:us.map(({mode:e,label:t})=>/* @__PURE__ */re("option",{value:e,children:t},e))})},fs=()=>/* @__PURE__ */ne("div",{className:"flex shrink-0 flex-wrap items-center gap-1.5 border-b border-zinc-200 px-3 py-2 dark:border-zinc-700",children:[
|
|
256
|
+
/* @__PURE__ */re(ps,{setting:"inspect",label:"Inspect",icon:"fa-solid fa-arrow-pointer",title:"Point at an element for its box and style; click to keep it here; hold Alt over another to measure. Esc stops.",primary:!0}),
|
|
257
|
+
/* @__PURE__ */re(cs,{}),
|
|
258
|
+
/* @__PURE__ */re(ps,{setting:"grid",label:"Grid",icon:"fa-solid fa-table-columns",title:"The page's 12, 8 or 4 columns"}),
|
|
259
|
+
/* @__PURE__ */re(ps,{setting:"xray",label:"X-ray",icon:"fa-solid fa-x-ray",title:"Every element's box, its type and id when pointed at — and what is bound to data, shown on a condition, runs a flow, moves or sits behind a flag, named on the page"}),
|
|
260
|
+
/* @__PURE__ */re(ps,{setting:"tabOrder",label:"Tab order",icon:"fa-solid fa-arrow-right-to-bracket",title:"The order the Tab key walks the controls in"}),
|
|
261
|
+
/* @__PURE__ */re(ps,{setting:"viewport",label:"Viewport",icon:"fa-solid fa-ruler-horizontal",title:"The window's size and the breakpoint showing"}),
|
|
262
|
+
/* @__PURE__ */re(cs,{}),
|
|
263
|
+
/* @__PURE__ */re(ps,{setting:"paused",label:"Pause",icon:"fa-solid fa-pause",title:"Hold every animation where it is"}),
|
|
264
|
+
/* @__PURE__ */re(ps,{setting:"slowMotion",label:"Slow",icon:"fa-solid fa-gauge-simple",title:"Every animation at a quarter of its speed"}),
|
|
265
|
+
/* @__PURE__ */re(ms,{}),
|
|
266
|
+
/* @__PURE__ */re(ps,{setting:"reducedMotion",label:"Reduced motion",icon:"fa-solid fa-person-walking",title:"The page as a visitor who asked for less motion gets it"}),
|
|
267
|
+
/* @__PURE__ */re(hs,{})]}),xs=()=>{let{settings:e,setSetting:t}=K(qe),a="none"===e.xrayFilter,r=Q(()=>t("xrayFilter",a?"all":"none"),[t,a]);/* @__PURE__ */
|
|
268
|
+
return ne("button",{type:"button","aria-pressed":a,title:"Every element's box, its type and id when pointed at — and no wiring. Click again to mark it all.",className:x("flex w-full cursor-pointer items-center gap-2 border-b border-zinc-100 px-2.5 py-1.5 text-left dark:border-zinc-800",{"bg-violet-500/10":a,"hover:bg-zinc-50 dark:hover:bg-zinc-800/60":!a}),onClick:r,children:[/* @__PURE__ */re("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm border border-dashed border-violet-500"}),/* @__PURE__ */re("span",{className:"min-w-0 truncate font-medium text-zinc-800 dark:text-zinc-200",children:"Boxes only"})]})},gs=({mark:e})=>{let{settings:t,setSetting:a,xrayCounts:r}=K(qe),{label:n,description:i,colour:l}=Je[e],s=t.xrayFilter===e,o=Q(()=>a("xrayFilter",s?"all":e),[a,s,e]);/* @__PURE__ */
|
|
269
|
+
return ne("button",{type:"button","aria-pressed":s,title:`${i}. Click to show only these; again for all.`,className:x("flex w-full cursor-pointer items-center gap-2 border-b border-zinc-100 px-2.5 py-1.5 text-left last:border-b-0 dark:border-zinc-800",{"bg-violet-500/10":s,"hover:bg-zinc-50 dark:hover:bg-zinc-800/60":!s,"opacity-50":"all"!==t.xrayFilter&&!s}),onClick:o,children:[
|
|
270
|
+
/* @__PURE__ */re("span",{className:"h-2.5 w-2.5 shrink-0 rounded-full",style:{backgroundColor:l}}),
|
|
271
|
+
/* @__PURE__ */re("span",{className:"min-w-0 truncate font-medium text-zinc-800 dark:text-zinc-200",children:n}),
|
|
272
|
+
/* @__PURE__ */re("span",{className:"ml-auto rounded-full bg-zinc-100 px-1.5 text-[10px] font-semibold text-zinc-600 tabular-nums dark:bg-zinc-800 dark:text-zinc-300",children:r[e]})]})},vs=()=>/* @__PURE__ */ne("section",{className:"flex min-w-0 flex-col gap-1.5",children:[/* @__PURE__ */ne("div",{className:"flex items-center gap-2 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-x-ray"}),"X-ray"]}),/* @__PURE__ */ne("div",{className:"overflow-hidden rounded border border-zinc-200 dark:border-zinc-700",children:[/* @__PURE__ */re(xs,{}),Oe.map(e=>/* @__PURE__ */re(gs,{mark:e},e))]})]}),bs=()=>{let{settings:e}=K(qe);/* @__PURE__ */
|
|
273
|
+
return ne("div",{className:"@container flex h-full min-h-0 w-full flex-col",children:[/* @__PURE__ */re(fs,{}),/* @__PURE__ */ne("div",{className:"grid min-h-0 grow grid-cols-1 content-start gap-3 overflow-y-auto p-3 @3xl:grid-cols-[minmax(0,0.85fr)_minmax(0,1.15fr)]",children:[/* @__PURE__ */ne("div",{className:"flex min-w-0 flex-col gap-3",children:[e.xray&&/* @__PURE__ */re(vs,{}),/* @__PURE__ */re(Zl,{})]}),/* @__PURE__ */re(ds,{})]})]})},ys="\0fn:",ks=e=>{if("object"!=typeof e||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},Ns=e=>{if("function"==typeof e)return`${ys}ƒ ${e.name||"anonymous"}()`;if((e=>Array.isArray(e))(e)){let t=e.map(Ns);return t.every((t,a)=>t===e[a])?e:t}if(!ks(e))return e;let t={},a=!1;for(let[r,n]of Object.entries(e))t[r]=Ns(n),a||=t[r]!==n;return a?t:e},zs=({record:{expiresAt:e},now:t})=>{let a=t>=e,r=Number.isFinite(e)?`${ri(e-t)} left`:"no expiry";/* @__PURE__ */
|
|
274
|
+
return re("span",{className:x("ml-1 rounded px-1 align-middle text-[10px] font-medium",a?"bg-amber-500/15 text-amber-700 dark:text-amber-300":"bg-emerald-500/15 text-emerald-700 dark:text-emerald-300"),children:a?"stale":r})},ws=(e,{type:t,value:a})=>{if("value"!==t||"string"!=typeof a)return null;let r=(e=>e.startsWith(ys)?e.slice(4):"")(a);return r?/* @__PURE__ */re("span",{className:"w-rjv-value text-violet-400 italic",children:r}):null},Ss={},Cs={...Dn,width:"100%",height:"100%",overflow:"auto",padding:"8px",fontSize:"14px"},$s=e=>x("cursor-pointer rounded px-2 py-0.5 font-medium transition-colors",e?"bg-violet-500/15 text-violet-600 dark:text-violet-300":"text-zinc-500 hover:bg-zinc-200/70 hover:text-zinc-800 dark:text-zinc-400 dark:hover:bg-zinc-700/50 dark:hover:text-zinc-100"),js={},Ts=[],Is=({elementSelected:e})=>{let{resolvedTheme:t}=w(),{getData:a}=K(F),r=hi(),n=hi()?.store,[i,l]=A("plitzi-sdk.dev-tools.store.view","own"),s=((e,t)=>{let a=Q(t=>e?e.subscribe(t):()=>{},[e]),r=Q(()=>e?t?e.getState():e.getOwnState():Ss,[e,t]);return te(a,r,r)})(e?void 0:n,"merged"===i),o=Q(()=>l("own"),[l]),d=Q(()=>l("merged"),[l]),c=e?a?.(`getElementDataSource-${e}`):s,p=Z(()=>(e=>{if(!e)return;let t=Ns(e);return ks(t)?t:e})(c),[c]),u=Z(()=>r?[r]:Ts,[r]),h=ti(u)[0]?.records??js,f=Z(()=>Object.values(h).reduce((e,t)=>Math.max(e,t.updatedAt),0),[h]),x=ai(Object.keys(h).length>0,f),g=Z(()=>((e,t)=>(a,{keys:r})=>{let n=e[(r??[]).join(".")];if(!n)return null;let{className:i,style:l,children:s}=a;/* @__PURE__ */
|
|
275
|
+
return ne(ae,{children:[/* @__PURE__ */re("span",{className:i,style:l,children:s}),/* @__PURE__ */re(zs,{record:n,now:t})]})})(h,x),[h,x]);/* @__PURE__ */
|
|
276
|
+
return ne("div",{className:"flex h-full w-full flex-col",children:[!e&&/* @__PURE__ */ne("div",{className:"flex shrink-0 items-center gap-1 border-b border-zinc-200 px-2 py-1 text-[11px] dark:border-zinc-800",children:[
|
|
277
|
+
/* @__PURE__ */re("span",{className:"mr-1 text-zinc-400 dark:text-zinc-500",children:"View"}),
|
|
278
|
+
/* @__PURE__ */re("button",{className:$s("own"===i),onClick:o,title:"Only this scope's own layer",children:"Own"}),
|
|
279
|
+
/* @__PURE__ */re("button",{className:$s("merged"===i),onClick:d,title:"Own layer merged over the parent scope chain",children:"Merged"})]}),/* @__PURE__ */ne(An,{value:p??m,style:"dark"===t?Cs:void 0,enableClipboard:!1,indentWidth:15,collapsed:2,displayObjectSize:!1,displayDataTypes:!1,children:[/* @__PURE__ */re(An.String,{render:ws}),/* @__PURE__ */re(An.KeyName,{render:g})]})]})},Ls=(e,t,a)=>{if(0===e.commitId)return"ssr";let r=(e=>{let t=0,a=0;for(let r of e.elements)"mount"===r.phase?t+=1:a+=1;return t>0&&0===a?"mount":a>0&&0===t?"update":"mixed"})(e);return"mount"===r?t&&a?"hydration":"mount":r},Rs={ssr:"SSR render (server)",hydration:"Hydration (SSR)",mount:"Mount",mixed:"Mount + update",update:"Update"},Es={ssr:"S",hydration:"H",mount:"M",mixed:"±",update:"·"},Vs=[{origin:"ssr",label:"SSR"},{origin:"hydration",label:"Hydration"},{origin:"mount",label:"Mount"},{origin:"mixed",label:"Mount+update"},{origin:"update",label:"Update"}],As=e=>e<.1?"<0.1ms":`${e.toFixed(1)}ms`,Ms=e=>`${Math.round(100*e)}%`,Ds=e=>e>=50?"bg-red-500":e>=16?"bg-amber-500":e>=8?"bg-emerald-500":"bg-sky-500",Os=[{color:"bg-sky-500",label:"<8ms"},{color:"bg-emerald-500",label:"8–16ms"},{color:"bg-amber-500",label:"16–50ms"},{color:"bg-red-500",label:"≥50ms"}],Fs="bg-zinc-300 dark:bg-zinc-700",Js={backgroundImage:"repeating-linear-gradient(45deg, rgba(113,113,122,0.22) 0, rgba(113,113,122,0.22) 2px, transparent 2px, transparent 5px)"},Bs=e=>"rendered"===e.state?Ds(e.selfDuration):"bubbled"===e.state?Fs:"bg-transparent",Ps=e=>"bubbled"===e.state?"text-zinc-600 dark:text-zinc-300":"hatched"===e.state?"text-zinc-400 dark:text-zinc-600":"bg-amber-500"===Ds(e.selfDuration)?"text-stone-900":"text-white",qs=(e,t)=>{let a=t?.[e];if(!a)return e;let{label:r,type:n}=a.definition;return r||n||e},Ws=(e,t)=>t?.[e]?.definition.type??"unknown",Us=(e,t)=>{let a=C(t?.[e],"definition.initialState.visibility",!0);return!1!==a&&"false"!==a},Hs=(e,t)=>"self"===t?e.selfDuration:e.actualDuration,Ks=.01,Qs=1e-6,_s=(e,t,a)=>{let r=e.lifetime.get(t);return!r||r.mountedAt<=a&&a<r.unmountedAt},Xs=e=>{let t=/* @__PURE__ */new Map,a=/* @__PURE__ */new Map,r=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map;for(let l of Object.keys(e)){let{parentId:i,baseDuration:s,elementId:o,mountedAt:d,unmountedAt:c}=e[l];t.set(l,i),a.set(l,s),r.set(l,o),(void 0!==d||void 0!==c)&&n.set(l,{mountedAt:d??0,unmountedAt:c??1/0})}let i=/* @__PURE__ */new Map;for(let[l,s]of t)if(void 0!==s&&t.has(s)){let e=i.get(s);e?e.push(l):i.set(s,[l])}return{parent:t,base:a,children:i,elementOf:r,lifetime:n}},Zs=(e,t)=>{let{parent:a}=t,r=new Map(e.elements.map(e=>[e.id,e])),n=/* @__PURE__ */new Map;for(let l of e.elements)n.set(l.id,l.actualDuration);for(let l of e.elements){let e=a.get(l.id);for(;void 0!==e&&!r.has(e);)e=a.get(e);void 0!==e&&n.set(e,(n.get(e)??0)-l.actualDuration)}for(let[l,s]of n)s<0&&n.set(l,0);let i=/* @__PURE__ */new Set;for(let l of r.keys()){let e=l,t=a.get(l);for(;void 0!==t&&a.has(t);)e=t,t=a.get(t);i.add(e)}return{rendered:r,self:n,roots:[...i]}},Gs=(e,t,a,r=Xs(t))=>{let{children:n,base:i,elementOf:l}=r,{rendered:s,self:o,roots:d}=Zs(e,r),c=e=>{let t=i.get(e)??0;if(t>0)return t;let a=s.get(e)?.actualDuration??0;return a>0?a:Ks},m=[],p=[],u=0,h=0,f=0,x=[],g=d.map(c),v=g.reduce((e,t)=>e+t,0)||1,b=0;for(d.forEach((e,t)=>{let a=(g[t]||Ks)/v;x.push({id:e,parentId:void 0,x:b,width:a,depth:0,ancestorRendered:!1}),b+=a}),x.reverse();x.length>0;){let t=x.pop();if(void 0===t)break;let{id:d,parentId:g,x:v,width:b,depth:y,ancestorRendered:k}=t,N=s.get(d),z=o.get(d)??0,w=N?z>Qs?"rendered":"bubbled":"hatched",S="rendered"===w&&!k;"rendered"===w&&(h+=z,f+=1),S&&p.push(d),u=Math.max(u,y);let C=l.get(d)??N?.elementId??d;m.push({id:d,elementId:C,name:qs(C,a),type:Ws(C,a),state:w,visible:Us(C,a),trigger:S,phase:N?.phase,actualDuration:N?.actualDuration??0,baseDuration:i.get(d)??N?.baseDuration??0,selfDuration:z,depth:y,parentId:g,changedProps:N?.changedProps,x:v,width:b});let $=(n.get(d)??[]).filter(t=>s.has(t)||_s(r,t,e.commitId));if(0===$.length)continue;let j=$.map(c),T=j.reduce((e,t)=>e+t,0),I=Math.max(c(d),T)||1,L=v,R=[];$.forEach((e,t)=>{let a=(j[t]||Ks)/I*b;R.push({id:e,parentId:d,x:L,width:a,depth:y+1,ancestorRendered:k||"rendered"===w}),L+=a});for(let e=R.length-1;e>=0;--e)x.push(R[e])}return{nodes:m,maxDepth:u,totalSelf:h,renderedCount:f,triggers:p}},Ys=(e,t,a)=>{let r=Xs(t),n=/* @__PURE__ */new Map;for(let i of e){let{self:e}=Zs(i,r);for(let t of i.elements){let a=e.get(t.id)??0;if(a<=Qs)continue;let i=r.elementOf.get(t.id)??t.elementId,l=n.get(i)??{renders:0,mounts:0,totalSelf:0,maxSelf:0,lastSelf:0};l.renders+=1,l.mounts+=+("mount"===t.phase),l.totalSelf+=a,l.maxSelf=Math.max(l.maxSelf,a),l.lastSelf=a,n.set(i,l)}}return[...n.entries()].map(([e,t])=>({id:e,name:qs(e,a),type:Ws(e,a),renders:t.renders,mounts:t.mounts,totalSelf:t.totalSelf,maxSelf:t.maxSelf,avgSelf:t.totalSelf/t.renders,lastSelf:t.lastSelf}))},eo=({commits:e,selectedIndex:t,hydrated:a,onSelect:r})=>{let n=Y(null),i=Z(()=>Math.max(1,...e.map(e=>e.duration)),[e]),l=Z(()=>e.find(e=>0!==e.commitId)?.commitId,[e]);X(()=>{n.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[t]);let s=Q(e=>()=>r(e),[r]),o=Q(a=>{if("ArrowLeft"!==a.key&&"ArrowRight"!==a.key)return;a.preventDefault(),a.stopPropagation();let n=t+("ArrowLeft"===a.key?-1:1);n>=0&&n<e.length&&r(e[n].commitId)},[e,t,r]);/* @__PURE__ */
|
|
280
|
+
return ne("div",{className:"flex shrink-0 flex-col border-b border-zinc-200 bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-900",children:[/* @__PURE__ */re("div",{role:"listbox","aria-label":"Commits, total render time","aria-orientation":"horizontal",tabIndex:0,onKeyDown:o,className:"flex h-20 items-end gap-1 overflow-x-auto px-2 pt-2 outline-none focus-visible:ring-1 focus-visible:ring-violet-400",children:e.map((e,r)=>{let o=r===t,d=0===e.commitId,c=d?100:Math.max(6,Math.round(e.duration/i*100)),m=Ls(e,a,e.commitId===l),p=e.causes.slice(0,6).map(e=>e.path).join(", "),u=e.causes.length>6?" +"+(e.causes.length-6):"",h=e.causes.length>0?`\nCaused by ${p}${u}`:"";/* @__PURE__ */
|
|
281
|
+
return ne("button",{ref:o?n:void 0,role:"option","aria-selected":o,onClick:s(e.commitId),title:d?`Commit #${e.commitId} · ${Rs[m]} · no client timing · ${e.elementCount} elements`:`Commit #${e.commitId} · ${Rs[m]} · ${As(e.duration)} total · ${e.elementCount} elements${h}`,className:"flex h-full shrink-0 flex-col items-center justify-end gap-0.5 px-0.5",children:[/* @__PURE__ */re("div",{style:{height:`${c}%`},className:x("w-3.5 rounded-sm transition-all",d?"bg-violet-400/40":Ds(e.duration),{"border border-dashed border-violet-400/70":d,"opacity-100 ring-2 ring-violet-400":o,"opacity-40 hover:opacity-80":!o})}),/* @__PURE__ */re("span",{className:x("text-[8px] leading-none font-semibold",{"text-violet-600 dark:text-violet-300":"ssr"===m||"hydration"===m,"text-zinc-500 dark:text-zinc-400":"mount"===m||"mixed"===m,"text-transparent":"update"===m}),children:Es[m]})]},e.commitId)})}),/* @__PURE__ */re("div",{className:"flex items-center gap-x-3 gap-y-0.5 overflow-x-auto px-2 pb-1 text-[9px] text-zinc-400 dark:text-zinc-500",children:Vs.map(e=>/* @__PURE__ */ne("span",{className:"flex shrink-0 items-center gap-1",children:[/* @__PURE__ */re("span",{className:"font-semibold text-zinc-500 dark:text-zinc-300",children:Es[e.origin]}),e.label]},e.origin))})]})},to=({commit:e,model:t,active:a,onSelectElement:r})=>{let n=t.nodes.filter(e=>e.trigger);if(0===n.length&&0===e.causes.length)return null;let i=n.slice(0,6),l=n.length-i.length,s=e.causes.slice(0,6),o=e.causes.length-s.length;/* @__PURE__ */
|
|
282
|
+
return ne(ae,{children:[n.length>0&&/* @__PURE__ */ne("span",{className:"flex flex-wrap items-center gap-1",children:[
|
|
283
|
+
/* @__PURE__ */re("span",{className:"mr-0.5 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Triggered by"}),i.map(e=>/* @__PURE__ */ne("button",{onClick:()=>r(e.id===a?.id?void 0:e.id),title:`${e.name} (${e.type}) — root-cause re-render of this commit`,className:x("flex items-center gap-1 rounded px-1 py-0.5 text-violet-600 dark:text-violet-300",e.id===a?.id?"bg-violet-500/25":"bg-violet-500/10 hover:bg-violet-500/20"),children:[/* @__PURE__ */re("i",{className:"fa-solid fa-bolt text-[8px]"}),/* @__PURE__ */re("span",{className:"max-w-32 truncate",children:e.name})]},e.id)),l>0&&/* @__PURE__ */ne("span",{className:"text-zinc-400 dark:text-zinc-500",children:["+",l]})]}),e.causes.length>0&&/* @__PURE__ */ne("span",{className:"flex flex-wrap items-center gap-1",children:[
|
|
284
|
+
/* @__PURE__ */re("span",{className:"mr-0.5 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Store write"}),s.map(e=>/* @__PURE__ */ne("span",{title:e.preview?`${e.path}\n${e.preview}`:e.path,className:"max-w-56 truncate rounded bg-zinc-500/10 px-1 py-0.5 font-mono text-[9px] text-zinc-600 dark:text-zinc-300",children:[e.path,e.preview&&/* @__PURE__ */re("span",{className:"ml-1 text-zinc-400 dark:text-zinc-500",children:e.preview})]},e.path)),o>0&&/* @__PURE__ */ne("span",{className:"text-zinc-400 dark:text-zinc-500",children:["+",o]})]})]})},ao=({node:e,commit:t,model:a})=>/* @__PURE__ */ne(ae,{children:[
|
|
285
|
+
/* @__PURE__ */ne("div",{className:"flex items-center gap-1.5",children:[
|
|
286
|
+
/* @__PURE__ */re("span",{className:x("h-2.5 w-2.5 shrink-0 rounded-sm",Bs(e)),style:"hatched"===e.state?Js:void 0}),
|
|
287
|
+
/* @__PURE__ */re("span",{className:"truncate text-xs font-medium text-zinc-700 dark:text-zinc-100",children:e.name}),!e.visible&&/* @__PURE__ */re("i",{className:"fa-solid fa-eye-slash shrink-0 text-amber-500",title:"Hidden via visibility"})]}),
|
|
288
|
+
/* @__PURE__ */re("span",{className:"truncate text-zinc-400 dark:text-zinc-500",children:e.type}),!e.visible&&/* @__PURE__ */re("span",{className:"w-fit rounded bg-amber-500/15 px-1 py-0.5 text-[9px] text-amber-600 dark:text-amber-400",children:"hidden (visibility)"}),
|
|
289
|
+
/* @__PURE__ */ne("span",{className:x("w-fit rounded px-1 py-0.5 text-[9px]",{"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"rendered"===e.state,"bg-zinc-500/15 text-zinc-500 dark:text-zinc-400":"rendered"!==e.state}),children:["rendered"===e.state&&`rendered · ${e.phase??"update"}`,"bubbled"===e.state&&"a descendant rendered","hatched"===e.state&&"did not render"]}),e.trigger&&/* @__PURE__ */ne("span",{className:"w-fit rounded bg-violet-500/15 px-1 py-0.5 text-[9px] text-violet-600 dark:text-violet-400",title:"A root cause of this commit — no ancestor re-rendered",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-bolt mr-1"}),"trigger"]}),
|
|
290
|
+
/* @__PURE__ */re("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Durations"}),
|
|
291
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Self"}),/* @__PURE__ */re("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:As(e.selfDuration)})]}),
|
|
292
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Total (subtree)"}),/* @__PURE__ */re("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:As(e.actualDuration)})]}),
|
|
293
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Base"}),/* @__PURE__ */re("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:As(e.baseDuration)})]}),
|
|
294
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"% of commit"}),/* @__PURE__ */re("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:Ms(e.actualDuration/t.duration)})]}),"rendered"===e.state&&/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"% of work"}),/* @__PURE__ */re("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:Ms(a.totalSelf>0?e.selfDuration/a.totalSelf:0)})]}),
|
|
295
|
+
/* @__PURE__ */ne("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:["Commit #",t.commitId]}),
|
|
296
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Committed at"}),/* @__PURE__ */ne("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:[(t.timestamp/1e3).toFixed(1),"s"]})]}),
|
|
297
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Total"}),/* @__PURE__ */re("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:As(t.duration)})]}),
|
|
298
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Rendered"}),/* @__PURE__ */ne("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:[a.renderedCount," of ",t.elementCount]})]}),
|
|
299
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Triggers"}),/* @__PURE__ */re("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:a.triggers.length})]}),"rendered"===e.state&&/* @__PURE__ */ne(ae,{children:[
|
|
300
|
+
/* @__PURE__ */re("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Why it rendered"}),"mount"===e.phase&&/* @__PURE__ */re("span",{className:"text-zinc-400 italic dark:text-zinc-500",children:"first mount"}),"mount"!==e.phase&&void 0===e.changedProps&&/* @__PURE__ */ne("span",{className:"w-fit rounded bg-sky-500/15 px-1 py-0.5 text-[9px] text-sky-600 dark:text-sky-400",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-microchip mr-1"}),"internal React — own state or a hook (props & store inputs unchanged)"]}),"mount"!==e.phase&&0===e.changedProps?.length&&e.trigger&&/* @__PURE__ */ne("span",{className:"w-fit rounded bg-sky-500/15 px-1 py-0.5 text-[9px] text-sky-600 dark:text-sky-400",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-microchip mr-1"}),"internal — a hook or consumed context changed, not props or store"]}),"mount"!==e.phase&&0===e.changedProps?.length&&!e.trigger&&/* @__PURE__ */ne("span",{className:"w-fit rounded bg-amber-500/15 px-1 py-0.5 text-[9px] text-amber-600 dark:text-amber-400",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-triangle-exclamation mr-1"}),"no input changed — re-rendered by an ancestor"]}),e.changedProps?.map(e=>/* @__PURE__ */ne("div",{className:"flex flex-col gap-0.5 border-l border-zinc-200 pl-1.5 dark:border-zinc-700",children:[/* @__PURE__ */ne("span",{className:"flex flex-wrap items-center gap-1",children:[/* @__PURE__ */re("span",{className:"font-mono text-[9px] font-medium break-all text-zinc-600 dark:text-zinc-300",children:e.key}),e.ref&&/* @__PURE__ */re("span",{className:"shrink-0 rounded bg-amber-500/15 px-1 text-[8px] text-amber-600 dark:text-amber-400",title:"Reference changed but the content is shallow-equal — a new object/array, likely a missing memo",children:"new ref"})]}),/* @__PURE__ */ne("div",{className:"flex flex-col gap-0.5 font-mono text-[9px] leading-snug",children:[/* @__PURE__ */ne("span",{className:"break-all text-zinc-400 dark:text-zinc-500",children:[/* @__PURE__ */re("span",{className:"text-rose-400/70 select-none dark:text-rose-400/60",children:"− "}),e.prev]}),/* @__PURE__ */ne("span",{className:"break-all text-zinc-600 dark:text-zinc-300",children:[/* @__PURE__ */re("span",{className:"text-emerald-500/80 select-none",children:"+ "}),e.next]})]})]},e.key))]})]}),ro=()=>/* @__PURE__ */ne("div",{className:"flex shrink-0 items-center gap-2 overflow-x-auto border-t border-zinc-200 px-2 py-1 text-[9px] text-zinc-400 dark:border-zinc-800 dark:text-zinc-500",children:[
|
|
301
|
+
/* @__PURE__ */re("span",{className:"font-medium",children:"Render budget"}),Os.map(e=>/* @__PURE__ */ne("span",{className:"flex shrink-0 items-center gap-1",children:[/* @__PURE__ */re("span",{className:x("h-2 w-2 rounded-sm",e.color)}),e.label]},e.label)),
|
|
302
|
+
/* @__PURE__ */ne("span",{className:"flex shrink-0 items-center gap-1",children:[/* @__PURE__ */re("span",{className:x("h-2 w-2 rounded-sm",Fs)}),"subtree only"]}),
|
|
303
|
+
/* @__PURE__ */ne("span",{className:"flex shrink-0 items-center gap-1",children:[/* @__PURE__ */re("span",{className:"h-2 w-2 rounded-sm border border-zinc-400/60 bg-zinc-200 dark:bg-zinc-800",style:{backgroundImage:"repeating-linear-gradient(45deg, rgba(113,113,122,0.4) 0, rgba(113,113,122,0.4) 1px, transparent 1px, transparent 3px)"}}),"no render"]}),
|
|
304
|
+
/* @__PURE__ */ne("span",{className:"flex shrink-0 items-center gap-1",children:[/* @__PURE__ */re("span",{className:"h-2 w-2 rounded-sm bg-violet-600"}),"selected"]}),
|
|
305
|
+
/* @__PURE__ */re("span",{className:"ml-auto shrink-0",children:"60fps ≈ 16ms · 50ms long task"})]}),no=({children:e})=>{let[t,a]=A("plitzi-sdk.dev-tools.tracing.sidebar-width",224),r=Q(e=>{Number.isFinite(e)&&a(e)},[a]);/* @__PURE__ */
|
|
306
|
+
return re(M,{className:"shrink-0 border-l border-zinc-200 dark:border-zinc-800",resizeHandles:["w"],axis:"x",autoGrow:!1,width:t,minConstraintsX:180,maxConstraintsX:480,onChange:r,children:/* @__PURE__ */re("aside",{className:"flex h-full w-full flex-col gap-1.5 overflow-auto bg-zinc-50 px-3 py-2 text-[10px] dark:bg-zinc-900/50",children:e})})},io=()=>/* @__PURE__ */ne("div",{className:"flex h-full flex-col items-center justify-center gap-2 px-2 text-center text-zinc-400 dark:text-zinc-500",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-arrow-pointer text-xl opacity-30"}),/* @__PURE__ */re("span",{className:"text-[10px] leading-relaxed",children:"Select an element to inspect its timing and why it rendered"})]}),lo=({open:e,onToggle:t,className:a})=>/* @__PURE__ */re("button",{onClick:t,title:e?"Hide detail panel":"Show detail panel","aria-pressed":e,className:x("flex h-4 w-4 items-center justify-center rounded text-[10px]",e?"bg-violet-500/15 text-violet-600 dark:text-violet-300":"text-zinc-400 hover:bg-zinc-500/10 hover:text-zinc-600 dark:text-zinc-500 dark:hover:text-zinc-300",a),children:/* @__PURE__ */re("i",{className:"fa-solid fa-circle-info"})}),so=({node:e,left:t,width:a,top:r,selected:n,onClick:i})=>{let l={left:`${t}%`,width:`${a}%`,top:r,height:18,..."hatched"!==e.state||n?void 0:Js},s=n?"bg-violet-600":"hatched"===e.state?"bg-zinc-200 dark:bg-zinc-800":Bs(e);/* @__PURE__ */
|
|
307
|
+
return ne("button",{type:"button",onClick:()=>i(e),title:`${e.name} (${e.type})${e.visible?"":" · hidden"}\n${As(e.selfDuration)} self · ${As(e.actualDuration)} total · ${Ms(e.baseDuration>0?e.width:0)} width`,style:l,className:x("absolute flex cursor-pointer items-center gap-1 overflow-hidden rounded-[1px] border border-zinc-50 px-1 text-left text-[11px] leading-none whitespace-nowrap dark:border-zinc-900",s,n?"z-10 text-white":x(Ps(e),"hover:brightness-110")),children:[e.trigger&&/* @__PURE__ */re("i",{className:"fa-solid fa-bolt shrink-0 text-[8px] text-violet-200"}),!e.visible&&/* @__PURE__ */re("i",{className:"fa-solid fa-eye-slash shrink-0 text-[8px] opacity-80"}),
|
|
308
|
+
/* @__PURE__ */re("span",{className:"truncate",children:e.name})]})},oo=1e-6,co=({commit:e,model:t,active:a,origin:r,sidebarOpen:n,onSelectElement:i,onToggleSidebar:l})=>{let s=Z(()=>{let e=/* @__PURE__ */new Map;for(let a of t.nodes)e.set(a.id,a);return e},[t]),o=a,d=o?o.x:0,c=o?o.width:1,m=o?o.depth:0,p=Z(()=>{if(!o)return[];let e=[],t=o.parentId;for(;void 0!==t;){let a=s.get(t);if(!a)break;e.push(a),t=a.parentId}return e.reverse()},[o,s]),u=Z(()=>t.nodes.filter(e=>e.depth>=m&&e.x>=d-oo&&e.x+e.width<=d+c+oo),[t,d,c,m]),h=Z(()=>u.filter(e=>e.width/c>=3e-4||e.id===a?.id),[u,c,a]),f=u.length-h.length,x=Z(()=>h.reduce((e,t)=>Math.max(e,t.depth),m),[h,m]),g=Q(e=>i(e.id===a?.id?void 0:e.id),[a,i]);/* @__PURE__ */
|
|
309
|
+
return ne("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[
|
|
310
|
+
/* @__PURE__ */ne("div",{className:"flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b border-zinc-200 px-2 py-1 text-[10px] text-zinc-500 dark:border-zinc-800 dark:text-zinc-400",children:[
|
|
311
|
+
/* @__PURE__ */ne("span",{className:"font-medium text-zinc-700 dark:text-zinc-200",children:["Commit #",e.commitId]}),"update"!==r&&/* @__PURE__ */re("span",{className:"rounded bg-violet-100 px-1 text-[9px] font-medium text-violet-700 uppercase dark:bg-violet-500/20 dark:text-violet-300",children:Rs[r]}),
|
|
312
|
+
/* @__PURE__ */re("span",{className:"opacity-60",children:"click a frame to zoom · click the focused frame to zoom out"}),f>0&&/* @__PURE__ */ne("span",{className:"opacity-60",title:"Frames too narrow to draw at this zoom level — zoom in to see them",children:["· ",f," too narrow to draw"]}),
|
|
313
|
+
/* @__PURE__ */re(to,{commit:e,model:t,active:a,onSelectElement:i}),
|
|
314
|
+
/* @__PURE__ */re(lo,{className:"ml-auto",open:n,onToggle:l})]}),
|
|
315
|
+
/* @__PURE__ */ne("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[/* @__PURE__ */re("div",{className:"min-h-0 flex-1 overflow-auto p-1",children:/* @__PURE__ */ne("div",{className:"relative w-full",style:{height:18*(x+1)},children:[p.map(e=>/* @__PURE__ */re(so,{node:e,left:0,width:100,top:18*e.depth,selected:e.id===a?.id,onClick:g},e.id)),h.map(e=>/* @__PURE__ */re(so,{node:e,left:(e.x-d)/c*100,width:e.width/c*100,top:18*e.depth,selected:e.id===a?.id,onClick:g},e.id))]})}),n&&/* @__PURE__ */re(no,{children:a?/* @__PURE__ */re(ao,{node:a,commit:e,model:t}):/* @__PURE__ */re(io,{})})]}),
|
|
316
|
+
/* @__PURE__ */re(ro,{})]})},mo=({row:e,flat:t,sessionSelf:a})=>{let r=Us(e.id,t);/* @__PURE__ */
|
|
317
|
+
return ne("aside",{className:"flex w-52 shrink-0 flex-col gap-1.5 overflow-auto border-l border-zinc-200 bg-zinc-50 px-3 py-2 text-[10px] dark:border-zinc-800 dark:bg-zinc-900/50",children:[
|
|
318
|
+
/* @__PURE__ */ne("div",{className:"flex items-center gap-1.5",children:[
|
|
319
|
+
/* @__PURE__ */re("span",{className:x("h-2.5 w-2.5 shrink-0 rounded-sm",Ds(e.maxSelf))}),
|
|
320
|
+
/* @__PURE__ */re("span",{className:"truncate text-xs font-medium text-zinc-700 dark:text-zinc-100",children:e.name}),!r&&/* @__PURE__ */re("i",{className:"fa-solid fa-eye-slash shrink-0 text-amber-500",title:"Hidden via visibility"})]}),
|
|
321
|
+
/* @__PURE__ */re("span",{className:"truncate text-zinc-400 dark:text-zinc-500",children:e.type}),!r&&/* @__PURE__ */re("span",{className:"w-fit rounded bg-amber-500/15 px-1 py-0.5 text-[9px] text-amber-600 dark:text-amber-400",children:"hidden (visibility)"}),
|
|
322
|
+
/* @__PURE__ */re("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Renders (session)"}),
|
|
323
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Total"}),/* @__PURE__ */ne("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:[e.renders,"×"]})]}),
|
|
324
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Mounts"}),/* @__PURE__ */re("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:e.mounts})]}),
|
|
325
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Updates"}),/* @__PURE__ */re("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:e.renders-e.mounts})]}),
|
|
326
|
+
/* @__PURE__ */re("div",{className:"mt-1 font-medium tracking-wide text-zinc-400 uppercase dark:text-zinc-500",children:"Self time"}),
|
|
327
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Total"}),/* @__PURE__ */re("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:As(e.totalSelf)})]}),
|
|
328
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Average"}),/* @__PURE__ */re("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:As(e.avgSelf)})]}),
|
|
329
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Max"}),/* @__PURE__ */re("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:As(e.maxSelf)})]}),
|
|
330
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"Last"}),/* @__PURE__ */re("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:As(e.lastSelf)})]}),
|
|
331
|
+
/* @__PURE__ */ne("div",{className:"flex justify-between gap-2",children:[/* @__PURE__ */re("span",{className:"text-zinc-400 dark:text-zinc-500",children:"% of session"}),/* @__PURE__ */re("span",{className:"text-zinc-700 tabular-nums dark:text-zinc-200",children:Ms(a>0?e.totalSelf/a:0)})]})]})},po=[{id:"total",label:"Total"},{id:"renders",label:"Renders"},{id:"avg",label:"Avg"},{id:"max",label:"Max"}],uo=(e,t)=>"renders"===t?e.renders:"avg"===t?e.avgSelf:"max"===t?e.maxSelf:e.totalSelf,ho=({commits:e,tree:t,flat:a,selectedId:r,onSelectElement:n})=>{let[i,l]=A("plitzi-sdk.dev-tools.tracing.sort","total"),s=Y(null),o=Z(()=>Ys(e,t,a).sort((e,t)=>uo(t,i)-uo(e,i)),[e,t,a,i]),d=Z(()=>o.reduce((e,t)=>Math.max(e,uo(t,i)),0)||1,[o,i]),c=Z(()=>o.reduce((e,t)=>e+t.totalSelf,0),[o]),m=Z(()=>o.find(e=>e.id===r),[o,r]),p=Z(()=>o.findIndex(e=>e.id===r),[o,r]);X(()=>s.current?.scrollIntoView({block:"nearest"}),[r]);let u=Q(e=>()=>l(e),[l]),h=Q(e=>{if("ArrowUp"!==e.key&&"ArrowDown"!==e.key||0===o.length)return;e.preventDefault();let t=-1===p?0:p,a=Math.max(0,Math.min(o.length-1,t+("ArrowUp"===e.key?-1:1)));n(o[a].id)},[o,p,n]);/* @__PURE__ */
|
|
332
|
+
return ne("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[
|
|
333
|
+
/* @__PURE__ */ne("div",{className:"flex shrink-0 items-center gap-2 border-b border-zinc-200 px-2 py-1.5 text-[10px] text-zinc-500 dark:border-zinc-800 dark:text-zinc-400",children:[
|
|
334
|
+
/* @__PURE__ */re("span",{className:"font-medium text-zinc-700 dark:text-zinc-200",children:"Session hotspots"}),
|
|
335
|
+
/* @__PURE__ */ne("span",{children:["· ",o.length," elements · ",e.length," commits"]}),
|
|
336
|
+
/* @__PURE__ */ne("div",{className:"ml-auto flex items-center gap-1",children:[/* @__PURE__ */re("span",{children:"sort"}),po.map(e=>/* @__PURE__ */re("button",{onClick:u(e.id),"aria-pressed":i===e.id,className:x("rounded px-1.5 py-0.5 text-[10px] font-medium",{"bg-violet-500 text-white":i===e.id,"text-zinc-600 hover:bg-zinc-200 dark:text-zinc-400 dark:hover:bg-zinc-700":i!==e.id}),children:e.label},e.id))]})]}),
|
|
337
|
+
/* @__PURE__ */ne("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[/* @__PURE__ */ne("div",{role:"listbox","aria-label":"Session hotspots",tabIndex:0,onKeyDown:h,className:"min-h-0 flex-1 overflow-auto outline-none focus-visible:ring-1 focus-visible:ring-violet-400",children:[0===o.length&&/* @__PURE__ */re("div",{className:"px-2 py-3 text-center text-[10px] text-zinc-400 dark:text-zinc-500",children:"No renders recorded yet"}),o.map(e=>{let t=e.id===r,a=uo(e,i),l="renders"===i?e.renders/d:a/d;/* @__PURE__ */
|
|
338
|
+
return ne("button",{ref:t?s:void 0,role:"option","aria-selected":t,onClick:()=>n(t?void 0:e.id),title:`${e.name} (${e.type})\n${e.renders} renders (${e.mounts} mount)\ntotal ${As(e.totalSelf)} · avg ${As(e.avgSelf)} · max ${As(e.maxSelf)} · last ${As(e.lastSelf)}`,className:x("flex w-full items-center gap-2 px-2 py-0.5 text-left",{"bg-violet-500/10":t,"hover:bg-zinc-50 dark:hover:bg-zinc-800/50":!t}),children:[
|
|
339
|
+
/* @__PURE__ */ne("span",{className:"flex w-40 shrink-0 flex-col",children:[/* @__PURE__ */re("span",{className:"truncate text-zinc-700 dark:text-zinc-200",children:e.name}),/* @__PURE__ */re("span",{className:"truncate text-[9px] text-zinc-400 dark:text-zinc-500",children:e.type})]}),
|
|
340
|
+
/* @__PURE__ */ne("span",{className:"w-12 shrink-0 text-right text-[10px] text-zinc-400 tabular-nums dark:text-zinc-500",title:"Times this element rendered itself",children:[e.renders,"×"]}),
|
|
341
|
+
/* @__PURE__ */re("div",{className:"h-2 flex-1 overflow-hidden rounded-sm bg-zinc-100 dark:bg-zinc-800",children:/* @__PURE__ */re("div",{style:{width:`${Math.max(2,Math.round(100*l))}%`},className:x("h-full rounded-sm",Ds(e.maxSelf))})}),
|
|
342
|
+
/* @__PURE__ */re("span",{className:"w-14 shrink-0 text-right text-zinc-500 tabular-nums dark:text-zinc-400",children:"renders"===i?`${e.renders}×`:As(a)})]},e.id)})]}),m&&/* @__PURE__ */re(mo,{row:m,flat:a,sessionSelf:c})]}),
|
|
343
|
+
/* @__PURE__ */re(ro,{})]})},fo=[{id:"self",label:"Self",title:"Own render work — the real per-element cost"},{id:"total",label:"Total",title:"Subtree-inclusive time (cascades up the tree)"}],xo=({metric:e,onChange:t,className:a})=>{let r=Q(e=>()=>t(e),[t]);/* @__PURE__ */
|
|
344
|
+
return re("div",{className:x("flex items-center overflow-hidden rounded border border-zinc-200 dark:border-zinc-700",a),children:fo.map(t=>/* @__PURE__ */re("button",{title:t.title,"aria-pressed":e===t.id,onClick:r(t.id),className:x("px-1.5 py-0.5 text-[10px] font-medium",{"bg-violet-500 text-white":e===t.id,"text-zinc-500 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-700":e!==t.id}),children:t.label},t.id))})},go=({commit:e,model:t,active:a,origin:r,sidebarOpen:n,onSelectElement:i,onToggleSidebar:l})=>{let[s,o]=A("plitzi-sdk.dev-tools.tracing.metric","self"),d=Y(null),c=Z(()=>t.nodes.filter(e=>"rendered"===e.state).sort((e,t)=>Hs(t,s)-Hs(e,s)),[t,s]),m=Z(()=>c.reduce((e,t)=>Math.max(e,Hs(t,s)),0)||1,[c,s]),p=Z(()=>c.findIndex(e=>e.id===a?.id),[c,a]);X(()=>d.current?.scrollIntoView({block:"nearest"}),[a]);let u=Q(e=>{if("ArrowUp"!==e.key&&"ArrowDown"!==e.key||0===c.length)return;e.preventDefault();let t=-1===p?0:p,a=Math.max(0,Math.min(c.length-1,t+("ArrowUp"===e.key?-1:1)));i(c[a].id)},[c,p,i]);/* @__PURE__ */
|
|
345
|
+
return ne("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[
|
|
346
|
+
/* @__PURE__ */ne("div",{className:"flex shrink-0 flex-wrap items-center gap-x-2 gap-y-1 border-b border-zinc-200 px-2 py-1.5 text-[10px] text-zinc-500 dark:border-zinc-800 dark:text-zinc-400",children:[
|
|
347
|
+
/* @__PURE__ */ne("span",{className:"font-medium text-zinc-700 dark:text-zinc-200",children:["Commit #",e.commitId]}),"update"!==r&&/* @__PURE__ */re("span",{className:"rounded bg-violet-100 px-1 text-[9px] font-medium text-violet-700 uppercase dark:bg-violet-500/20 dark:text-violet-300",children:Rs[r]}),
|
|
348
|
+
/* @__PURE__ */ne("span",{children:[As(e.duration)," total"]}),
|
|
349
|
+
/* @__PURE__ */ne("span",{title:"Elements that re-rendered, of all in this commit's subtree",children:["· ",t.renderedCount," of ",e.elementCount," rendered"]}),
|
|
350
|
+
/* @__PURE__ */re(to,{commit:e,model:t,active:a,onSelectElement:i}),
|
|
351
|
+
/* @__PURE__ */re(xo,{className:"ml-auto",metric:s,onChange:o}),
|
|
352
|
+
/* @__PURE__ */re(lo,{open:n,onToggle:l})]}),
|
|
353
|
+
/* @__PURE__ */ne("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[/* @__PURE__ */ne("div",{role:"listbox","aria-label":"Rendered elements, ranked",tabIndex:0,onKeyDown:u,className:"min-h-0 flex-1 overflow-auto outline-none focus-visible:ring-1 focus-visible:ring-violet-400",children:[0===c.length&&/* @__PURE__ */re("div",{className:"px-2 py-3 text-center text-[10px] text-zinc-400 dark:text-zinc-500",children:"No element re-rendered in this commit"}),c.map(e=>{let r=Hs(e,s),n=e.id===a?.id,l=t.totalSelf>0?e.selfDuration/t.totalSelf:0,o="mount"!==e.phase,c=o&&(void 0===e.changedProps||0===e.changedProps.length&&e.trigger),p=o&&0===e.changedProps?.length&&!e.trigger,u=!!e.changedProps?.length&&e.changedProps.every(e=>e.ref),h=e.changedProps?.map(e=>e.key).join(", "),f=h||(c?"internal state / hook":e.type);/* @__PURE__ */
|
|
354
|
+
return ne("button",{ref:n?d:void 0,role:"option","aria-selected":n,onClick:()=>i(e.id===a?.id?void 0:e.id),title:`${e.name} (${e.type})\n${As(e.selfDuration)} self · ${As(e.actualDuration)} total · ${As(e.baseDuration)} base\nphase: ${e.phase??"update"} · ${Ms(l)} of render work${p?"\nno input changed — re-rendered by an ancestor":c?"\nno input changed — internal state/hook/context":u?`\nreference-only change (missing memo): ${h}`:h?`\nchanged: ${h}`:""}`,className:x("flex w-full items-center gap-2 px-2 py-0.5 text-left",{"bg-violet-500/10":n,"hover:bg-zinc-50 dark:hover:bg-zinc-800/50":!n}),children:[
|
|
355
|
+
/* @__PURE__ */ne("span",{className:"flex w-40 shrink-0 flex-col",children:[/* @__PURE__ */ne("span",{className:"flex items-center gap-1 text-zinc-700 dark:text-zinc-200",children:[e.trigger&&/* @__PURE__ */re("i",{className:"fa-solid fa-bolt shrink-0 text-[9px] text-violet-500",title:"Trigger — a root cause of this commit"}),(p||u)&&/* @__PURE__ */re("i",{className:"fa-solid fa-triangle-exclamation shrink-0 text-[9px] text-amber-500",title:p?"Re-rendered without any input change — possible unnecessary re-render":"Only reference-changed props (shallow-equal content) — likely a missing memo"}),!e.visible&&/* @__PURE__ */re("i",{className:"fa-solid fa-eye-slash shrink-0 text-[9px] text-amber-500",title:"Hidden (visibility)"}),
|
|
356
|
+
/* @__PURE__ */re("span",{className:"truncate",children:e.name})]}),/* @__PURE__ */re("span",{className:"truncate text-[9px] text-zinc-400 dark:text-zinc-500",children:f})]}),
|
|
357
|
+
/* @__PURE__ */re("span",{className:x("rounded px-1 text-[9px] uppercase",{"bg-sky-500/15 text-sky-600 dark:text-sky-400":"mount"===e.phase,"bg-amber-500/15 text-amber-600 dark:text-amber-400":"mount"!==e.phase}),children:"mount"===e.phase?"mount":"update"}),
|
|
358
|
+
/* @__PURE__ */re("div",{className:"h-2 flex-1 overflow-hidden rounded-sm bg-zinc-100 dark:bg-zinc-800",children:/* @__PURE__ */re("div",{style:{width:`${Math.max(2,Math.round(r/m*100))}%`},className:x("h-full rounded-sm",Ds(r))})}),
|
|
359
|
+
/* @__PURE__ */re("span",{className:"w-10 shrink-0 text-right text-[10px] text-zinc-400 tabular-nums dark:text-zinc-500",title:"Share of this commit's total render work",children:Ms(l)}),
|
|
360
|
+
/* @__PURE__ */re("span",{className:"w-12 shrink-0 text-right text-zinc-500 tabular-nums dark:text-zinc-400",children:As(r)})]},e.id)})]}),n&&/* @__PURE__ */re(no,{children:a?/* @__PURE__ */re(ao,{node:a,commit:e,model:t}):/* @__PURE__ */re(io,{})})]}),
|
|
361
|
+
/* @__PURE__ */re(ro,{})]})},vo=[{id:"ranked",label:"Ranked",icon:"fa-solid fa-ranking-star"},{id:"flamegraph",label:"Flamegraph",icon:"fa-solid fa-fire"},{id:"hotspots",label:"Hotspots",icon:"fa-solid fa-temperature-three-quarters"}],bo=({view:e,persist:t,commitCount:a,onClear:r,onViewChange:n,onPersistChange:i})=>{let l=Q(e=>()=>n(e),[n]),s=Q(()=>i(!t),[t,i]);/* @__PURE__ */
|
|
362
|
+
return ne("div",{className:"flex shrink-0 items-center gap-2 border-b border-zinc-200 bg-zinc-50 px-2 py-1.5 dark:border-zinc-800 dark:bg-zinc-900",children:[/* @__PURE__ */re("div",{className:"flex items-stretch gap-1",children:vo.map(t=>{let a=e===t.id;/* @__PURE__ */
|
|
363
|
+
return ne("button",{onClick:l(t.id),"aria-pressed":a,className:x("flex h-6 items-center gap-1 rounded px-2 text-xs font-medium transition-colors",{"bg-violet-500 text-white":a,"text-zinc-600 hover:bg-zinc-200 dark:text-zinc-400 dark:hover:bg-zinc-700":!a}),children:[/* @__PURE__ */re("i",{className:t.icon}),t.label]},t.id)})}),/* @__PURE__ */ne("div",{className:"ml-auto flex items-center gap-2",children:[
|
|
364
|
+
/* @__PURE__ */ne("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:[a," commits"]}),
|
|
365
|
+
/* @__PURE__ */ne("button",{onClick:s,"aria-pressed":t,title:"Keep the recorded commits when navigating to another page",className:x("flex h-6 items-center gap-1 rounded px-2 text-xs font-medium transition-colors",{"bg-violet-500 text-white":t,"text-zinc-600 hover:bg-zinc-200 dark:text-zinc-300 dark:hover:bg-zinc-700":!t}),children:[/* @__PURE__ */re("i",{className:"fa-solid fa-thumbtack"}),"Persist"]}),
|
|
366
|
+
/* @__PURE__ */ne("button",{onClick:r,className:"flex h-6 items-center gap-1 rounded px-2 text-xs font-medium text-zinc-600 hover:bg-zinc-200 dark:text-zinc-300 dark:hover:bg-zinc-700",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-trash"}),"Clear"]})]})]})},yo=()=>{let{enabled:e,hydrated:t,commits:a,tree:r,clear:n}=(()=>{let e=te(T.subscribe,T.getState,T.getState);return X(()=>(R.start(),R.stop),[]),{...e,clear:R.clear}})(),[[i,l]]=d(["schema.flat","navigation.currentPageId"]),[s,o]=A("plitzi-sdk.dev-tools.tracing.view","ranked"),[c,m]=A("plitzi-sdk.dev-tools.tracing.persist",!1),[p,u]=A("plitzi-sdk.dev-tools.tracing.sidebar-open",!1),[h,f]=ee(),[x,g]=ee(),v=Y(l);X(()=>{v.current!==l&&(v.current=l,c||(n(),f(void 0),g(void 0)))},[l,c,n]);let b=Z(()=>{if(t&&0!==a.length)return{commitId:0,timestamp:a[0].timestamp,duration:0,elementCount:Object.keys(r).length,elements:[],causes:[]}},[t,a,r]),y=Z(()=>b?[b,...a]:a,[b,a]),k=a[0]?.commitId,N=Z(()=>{if(0===y.length)return-1;let e=y.findIndex(e=>e.commitId===h);return-1===e?y.length-1:e},[y,h]),z=-1===N?void 0:y[N],w=0===z?.commitId,S=Z(()=>z&&!w?Gs(z,r,i):void 0,[z,w,r,i]),C=Z(()=>S?.nodes.find(e=>e.id===x)??S?.nodes.find(e=>e.elementId===x),[S,x]);Mi(C?.elementId??x);let $=Z(()=>z?Ls(z,t,z.commitId===k):"update",[z,t,k]),j=Q(e=>{f(e),g(void 0)},[]),I=Q(e=>{g(e),e&&u(!0)},[u]),L=Q(()=>u(e=>!e),[u]),E=Q(e=>{let t=N+e;t>=0&&t<y.length&&(f(y[t].commitId),g(void 0))},[y,N]),V=Q(e=>{("ArrowLeft"===e.key||"ArrowRight"===e.key)&&(e.preventDefault(),E("ArrowLeft"===e.key?-1:1))},[E]);/* @__PURE__ */
|
|
367
|
+
return ne("div",e?z?{className:"flex h-full min-h-0 w-full flex-col",onKeyDown:V,children:[
|
|
368
|
+
/* @__PURE__ */re(bo,{view:s,persist:c,commitCount:a.length,onClear:n,onViewChange:o,onPersistChange:m}),"hotspots"!==s&&/* @__PURE__ */re(eo,{commits:y,selectedIndex:N,hydrated:t,onSelect:j}),"hotspots"!==s&&w&&/* @__PURE__ */ne("div",{className:"flex grow flex-col items-center justify-center gap-3 px-6 text-center text-zinc-500 dark:text-zinc-400",children:[
|
|
369
|
+
/* @__PURE__ */re("i",{className:"fa-solid fa-server text-3xl opacity-30"}),
|
|
370
|
+
/* @__PURE__ */re("span",{className:"text-sm font-medium text-zinc-600 dark:text-zinc-300",children:"Server render (SSR)"}),
|
|
371
|
+
/* @__PURE__ */ne("span",{className:"max-w-md text-xs leading-relaxed",children:["This page was rendered on the server first. React's Profiler doesn't run during server rendering, so there's no per-element timing for it — this commit marks that baseline. Commit #",k," ","is the client ",
|
|
372
|
+
/* @__PURE__ */re("span",{className:"font-medium text-violet-600 dark:text-violet-400",children:"hydration"})," of this tree."]}),
|
|
373
|
+
/* @__PURE__ */ne("span",{className:"text-[11px] opacity-70",children:[z.elementCount," elements in the rendered tree"]})]}),"ranked"===s&&S&&/* @__PURE__ */re(go,{commit:z,model:S,active:C,origin:$,sidebarOpen:p,onSelectElement:I,onToggleSidebar:L}),"flamegraph"===s&&S&&/* @__PURE__ */re(co,{commit:z,model:S,active:C,origin:$,sidebarOpen:p,onSelectElement:I,onToggleSidebar:L}),"hotspots"===s&&/* @__PURE__ */re(ho,{commits:a,tree:r,flat:i,selectedId:x,onSelectElement:I})]}:{className:"flex h-full min-h-0 w-full flex-col",children:[/* @__PURE__ */re(bo,{view:s,persist:c,commitCount:a.length,onClear:n,onViewChange:o,onPersistChange:m}),/* @__PURE__ */ne("div",{className:"flex grow flex-col items-center justify-center gap-2 text-zinc-400 dark:text-zinc-500",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-chart-column text-3xl opacity-20"}),/* @__PURE__ */re("span",{className:"text-xs",children:"No commits recorded yet — interact with the page"})]})]}:{className:"flex h-full w-full flex-col items-center justify-center gap-2 text-zinc-400 dark:text-zinc-500",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-gauge-high text-3xl opacity-20"}),/* @__PURE__ */re("span",{className:"text-xs",children:"Enable debugMode to record render tracing"})]})},ko=({className:e,type:t,preffix:a,value:r})=>/* @__PURE__ */ne("div",{className:x("flex items-center gap-1.5",e),children:[a&&/* @__PURE__ */re("span",{className:"shrink-0 text-[10px] font-medium tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:a}),"color"===t&&/* @__PURE__ */re("div",{className:"h-3.5 w-3.5 shrink-0 rounded-sm border border-zinc-300 dark:border-zinc-600",title:r,style:{backgroundColor:r}}),
|
|
374
|
+
/* @__PURE__ */re("span",{className:x("truncate font-mono",{"text-zinc-700 dark:text-zinc-300":"color"===t,"text-violet-700 dark:text-violet-300":"color"!==t}),title:r,children:r??"—"})]}),No=({name:e,type:t,value:a=""})=>/* @__PURE__ */ne("div",{className:"grid grid-cols-[1fr_1.5fr] items-center border-b border-zinc-100 px-3 py-1.5 transition-colors hover:bg-zinc-50 dark:border-zinc-800 dark:hover:bg-zinc-800/60",children:[/* @__PURE__ */ne("div",{className:"flex min-w-0 flex-col gap-0.5 pr-2",children:[/* @__PURE__ */re("span",{className:"truncate font-medium text-zinc-800 dark:text-zinc-200",title:e,children:e}),/* @__PURE__ */re("span",{className:"text-[10px] tracking-wider text-zinc-400 uppercase dark:text-zinc-600",children:t})]}),/* @__PURE__ */ne("div",{className:"flex min-w-0 flex-col gap-0.5",children:[("string"==typeof a||"number"==typeof a)&&/* @__PURE__ */re(ko,{type:t,value:a}),"object"==typeof a&&Object.keys(a).map((e,r)=>/* @__PURE__ */re(ko,{type:t,preffix:`${e}:`,value:a[e]},r))]})]}),zo=({variables:e,variablesParsed:t})=>e&&0!==e.length?/* @__PURE__ */ne("div",{className:"w-full overflow-hidden rounded border border-zinc-200 dark:border-zinc-700",children:[/* @__PURE__ */ne("div",{className:"grid grid-cols-[1fr_1.5fr] border-b border-zinc-200 bg-zinc-50 px-3 py-1 text-zinc-400 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-500",children:[/* @__PURE__ */re("span",{className:"text-[10px] font-semibold tracking-wider uppercase",children:"Name"}),/* @__PURE__ */re("span",{className:"text-[10px] font-semibold tracking-wider uppercase",children:"Value"})]}),e.map((e,a)=>/* @__PURE__ */re(No,{name:e.name,type:e.type,value:t?.[e.name]},a))]}):/* @__PURE__ */re("div",{className:"py-4 text-center text-xs text-zinc-400 italic dark:text-zinc-600",children:"No variables defined"}),wo=({variables:e})=>{let t=Z(()=>Object.entries(e??{}).reduce((e,[t,a])=>(Object.keys(a).forEach(r=>{e.push({name:r,type:"color"===t?"color":"text",value:a[r]})}),e),[]),[e]);return 0===t.length?/* @__PURE__ */re("div",{className:"py-4 text-center text-xs text-zinc-400 italic dark:text-zinc-600",children:"No style variables defined"}):/* @__PURE__ */ne("div",{className:"w-full overflow-hidden rounded border border-zinc-200 dark:border-zinc-700",children:[/* @__PURE__ */ne("div",{className:"grid grid-cols-[1fr_1.5fr] border-b border-zinc-200 bg-zinc-50 px-3 py-1 text-zinc-400 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-500",children:[/* @__PURE__ */re("span",{className:"text-[10px] font-semibold tracking-wider uppercase",children:"Name"}),/* @__PURE__ */re("span",{className:"text-[10px] font-semibold tracking-wider uppercase",children:"Value"})]}),t.map((e,t)=>/* @__PURE__ */re(No,{name:e.name,type:e.type,value:e.value},t))]})},So=()=>{let[[e,t,a]]=d(["schema.variables","style.variables","runtime.sources.variables"]);/* @__PURE__ */
|
|
375
|
+
return ne("div",{className:"flex w-full flex-col gap-4 overflow-y-auto p-3",children:[/* @__PURE__ */ne("section",{className:"flex flex-col gap-1.5",children:[/* @__PURE__ */ne("div",{className:"flex items-center gap-2 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-code"}),"Schema Variables"]}),/* @__PURE__ */re(zo,{variables:e,variablesParsed:a})]}),/* @__PURE__ */ne("section",{className:"flex flex-col gap-1.5",children:[/* @__PURE__ */ne("div",{className:"flex items-center gap-2 text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",children:[/* @__PURE__ */re("i",{className:"fa-solid fa-palette"}),"Style Variables"]}),/* @__PURE__ */re(wo,{variables:t})]})]})},Co=({className:e,tabSelected:t,orientation:a,logTypeFilter:r,elementSelected:n,onSelectElement:i,qa:l=!1})=>{let{logs:s,clearLogs:o}=K(F);/* @__PURE__ */
|
|
376
|
+
return re("div",{className:x("flex h-full w-full grow overflow-auto bg-white dark:bg-zinc-900",e),children:/* @__PURE__ */ne("div",{className:"flex w-full flex-col",children:["logs"===t&&/* @__PURE__ */re(Fl,{items:s,orientation:a,logTypeFilter:r,onClear:o}),"store"===t&&/* @__PURE__ */re(Is,{elementSelected:n}),"cache"===t&&/* @__PURE__ */re(fi,{}),"history"===t&&/* @__PURE__ */re(Ki,{}),"variables"===t&&/* @__PURE__ */re(So,{}),"flags"===t&&/* @__PURE__ */re(Pi,{}),"elements"===t&&/* @__PURE__ */re(Di,{elementSelected:n,onSelectElement:i}),"plugins"===t&&/* @__PURE__ */re(Ul,{}),"tracing"===t&&/* @__PURE__ */re(yo,{}),"actions"===t&&/* @__PURE__ */re(_n,{}),l&&"qa"===t&&/* @__PURE__ */re(bs,{})]})})},$o=({className:e,iconClassName:t,title:a,isSelected:r=!1,onClick:n})=>/* @__PURE__ */re("button",{className:x("flex h-6 w-6 cursor-pointer items-center justify-center rounded transition-colors",{"bg-violet-500/10 text-violet-600 dark:bg-violet-500/20 dark:text-violet-400":r,"text-zinc-500 hover:bg-zinc-200 hover:text-zinc-900 dark:text-zinc-400 dark:hover:bg-zinc-700 dark:hover:text-zinc-100":!r},e),title:a,onClick:n,children:/* @__PURE__ */re("i",{className:x("text-xs",t)})}),jo={system:"light",light:"dark",dark:"system"},To={system:"fa-solid fa-desktop",light:"fa-solid fa-sun",dark:"fa-solid fa-moon"},Io={system:"System",light:"Light",dark:"Dark"},Lo=()=>{let{theme:e,setTheme:t}=w(),a=Q(()=>t(jo[e]),[e,t]);/* @__PURE__ */
|
|
377
|
+
return re($o,{iconClassName:To[e],title:`Theme: ${Io[e]} — click for ${Io[jo[e]]}`,onClick:a})},Ro=[{id:"logs",label:"Logs",icon:"fa-solid fa-terminal"},{id:"store",label:"Store",icon:"fa-solid fa-database"},{id:"cache",label:"Cache",icon:"fa-solid fa-hourglass-half"},{id:"history",label:"History",icon:"fa-solid fa-clock-rotate-left"},{id:"elements",label:"Elements",icon:"fa-solid fa-layer-group"},{id:"variables",label:"Variables",icon:"fa-solid fa-code"},{id:"flags",label:"Flags",icon:"fa-solid fa-flag"},{id:"plugins",label:"Plugins",icon:"fa-solid fa-puzzle-piece"},{id:"tracing",label:"Tracing",icon:"fa-solid fa-gauge-high"},{id:"actions",label:"Actions",icon:"fa-solid fa-bolt"},{id:"qa",label:"QA",icon:"fa-solid fa-ruler-combined"}],Eo=({tabSelected:e,orientation:t="vertical",onChangeOrientation:a,onCollapse:r,onTabSelect:n,qa:i=!1})=>{let l=i?Ro:Ro.filter(e=>"qa"!==e.id),{options:s,value:o,onSelect:d}=ui(),c=Q(()=>{a?.("horizontal"===t?"vertical":"horizontal")},[t,a]),m=Q(e=>()=>n?.(e),[n]),p=Q(e=>d(e.target.value),[d]);/* @__PURE__ */
|
|
378
|
+
return ne("div",{className:"flex shrink-0 items-stretch justify-between border-b border-zinc-200 bg-zinc-100 select-none dark:border-zinc-700 dark:bg-zinc-800",children:[/* @__PURE__ */re("div",{className:"flex items-stretch overflow-x-auto",children:l.map(t=>{let a=e===t.id;/* @__PURE__ */
|
|
379
|
+
return ne("button",{onClick:m(t.id),className:x("flex cursor-pointer items-center gap-1.5 border-b-2 px-3 py-2 font-medium transition-colors",{"border-violet-500 text-violet-600 dark:text-violet-400":a,"border-transparent text-zinc-500 hover:bg-zinc-200/70 hover:text-zinc-800 dark:text-zinc-400 dark:hover:bg-zinc-700/50 dark:hover:text-zinc-100":!a}),children:[/* @__PURE__ */re("i",{className:x(t.icon,"text-[10px]")}),t.label]},t.id)})}),/* @__PURE__ */ne("div",{className:"flex shrink-0 items-center gap-1 border-l border-zinc-200 px-2 dark:border-zinc-700",children:[s.length>0&&/* @__PURE__ */re("select",{value:o??"",onChange:p,title:"Instance / StoreProvider driving the panel",className:"max-w-52 rounded border border-zinc-300 bg-white px-1 py-0.5 text-[11px] text-zinc-700 dark:border-zinc-600 dark:bg-zinc-900 dark:text-zinc-200",children:s.map(e=>/* @__PURE__ */re("optgroup",{label:e.label,children:e.options.map(e=>/* @__PURE__ */re("option",{value:e.value,children:e.label},e.value))},e.label))}),
|
|
380
|
+
/* @__PURE__ */re(Lo,{}),
|
|
381
|
+
/* @__PURE__ */re($o,{iconClassName:x("fa-solid fa-table-columns",{"rotate-90":"vertical"===t}),title:"horizontal"===t?"Switch to side panel":"Switch to bottom panel",onClick:c}),
|
|
382
|
+
/* @__PURE__ */re($o,{iconClassName:"fa-solid fa-xmark",title:"Collapse to the indicator",onClick:r})]})]})},Vo=({className:t,elementSelected:a,currentPageId:r,onSelectElement:n})=>{let[i,l]=ee(!1),s=Q(e=>{let{id:t}=e?.dataset??{};n(t)},[n]),o=Z(()=>e(s,100),[s]),d=Q(e=>{ue(e.target)?.closest(".plitzi-sdk")&&o(ue(e.target)?.closest("[data-id]")??void 0)},[o]),c=Q(e=>{ue(e.target)?.closest(".plitzi-sdk")&&(e.stopPropagation(),e.preventDefault(),l(!1))},[]),m=Q(e=>{e.stopPropagation(),e.preventDefault(),l(!0)},[l]),p=Q(()=>{l(!1),n(r)},[r,n]),u=Q(()=>{l(!1),n("")},[n]);return Mi(a),X(()=>{if(!i||typeof document>"u")return;let e=document.getElementsByClassName("plitzi-sdk")[0];return e?(e.addEventListener("click",c),e.addEventListener("mousemove",d),()=>{e.removeEventListener("click",c),e.removeEventListener("mousemove",d)}):void 0},[c,d,i]),/* @__PURE__ */ne("div",{className:x("flex shrink-0 items-center justify-between gap-2 border-b border-zinc-200 bg-zinc-50 px-2 py-1 dark:border-zinc-700 dark:bg-zinc-800",t),children:[/* @__PURE__ */ne("div",{className:"flex gap-1",children:[/* @__PURE__ */re($o,{iconClassName:"fa-regular fa-hand-pointer",title:"Select an element in the page to inspect it",onClick:m,isSelected:i}),/* @__PURE__ */re($o,{iconClassName:"fa-regular fa-file",title:"Current Page",onClick:p,isSelected:a===r})]}),/* @__PURE__ */re($o,{iconClassName:"fa-solid fa-ban",onClick:u,title:"Clear",isSelected:!!a})]})},Ao=({className:e,orientation:t="vertical",tabSelected:a,logTypeFilter:r,onCollapse:n,onTabSelect:i,onChangeOrientation:l,qa:s=!1})=>{let[o,c]=A("plitzi-sdk.dev-tools.size",{width:500,height:200}),[m]=d("navigation.currentPageId"),[p,u]=ee(),h=Z(()=>"vertical"===t?["w"]:["n"],[t]),f=Y(typeof document<"u"?document.querySelector(".plitzi-sdk"):null),g=Q(e=>u(e),[u]),v=Q((e,t)=>c(a=>({width:Number.isFinite(e)?e:a.width,height:Number.isFinite(t)?t:a.height})),[c]);/* @__PURE__ */
|
|
383
|
+
return re(M,{className:x("component__container-resizable-sidebar relative z-[1000000] text-xs",e,{"h-full":"vertical"===t}),minConstraintsX:"vertical"===t?500:1/0,maxConstraintsX:"vertical"===t?1e3:1/0,minConstraintsY:"vertical"===t?1/0:34,maxConstraintsY:"vertical"===t?1/0:600,width:"vertical"===t?o.width:1/0,height:"vertical"===t?1/0:o.height,resizeHandles:h,parentRef:f,autoGrow:!1,onChange:v,children:/* @__PURE__ */ne("div",{className:"flex h-full w-full flex-col bg-white text-zinc-800 dark:bg-zinc-900 dark:text-zinc-200",[b]:"",children:[
|
|
384
|
+
/* @__PURE__ */re(Eo,{orientation:t,onChangeOrientation:l,onCollapse:n,onTabSelect:i,tabSelected:a,qa:s}),["store","elements"].includes(a)&&/* @__PURE__ */re(Vo,{elementSelected:p,onSelectElement:g,currentPageId:m}),
|
|
385
|
+
/* @__PURE__ */re(Co,{orientation:t,tabSelected:a,logTypeFilter:r,elementSelected:p,onSelectElement:g,qa:s})]})})},Mo=({className:e,collapsed:t,orientation:a,tabSelected:r,logTypeFilter:n,onOpen:i,onCollapse:l,onTabSelect:s,onChangeOrientation:o,pageRef:d,qa:c})=>{let m=/* @__PURE__ */ne(ae,{children:[t&&/* @__PURE__ */re(Le,{className:e,onOpen:i}),!t&&/* @__PURE__ */re(Ao,{className:e,orientation:a,tabSelected:r,logTypeFilter:n,qa:c,onCollapse:l,onTabSelect:s,onChangeOrientation:o})]});return c?/* @__PURE__ */ne(Ue,{pageRef:d,collapsed:t,children:[/* @__PURE__ */re(Bt,{}),m]}):m};export{Mo as default};
|