@visulima/dev-toolbar 1.0.0-alpha.4 → 1.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/LICENSE.md +109 -2
  3. package/dist/apps/a11y/a11y-app.d.ts +0 -1
  4. package/dist/apps/a11y/a11y-tooltip.d.ts +0 -1
  5. package/dist/apps/a11y/index.js +21 -2
  6. package/dist/apps/assets/assets-app.d.ts +4 -0
  7. package/dist/apps/assets/index.d.ts +3 -0
  8. package/dist/apps/assets/index.js +16 -0
  9. package/dist/apps/inspector/index.js +17 -1
  10. package/dist/apps/inspector/inspector-app.d.ts +4 -2
  11. package/dist/apps/module-graph/index.js +20 -1
  12. package/dist/apps/module-graph/module-graph-app.d.ts +0 -1
  13. package/dist/apps/performance/index.js +17 -1
  14. package/dist/apps/performance/performance-app.d.ts +0 -1
  15. package/dist/apps/performance/performance-tooltip.d.ts +0 -1
  16. package/dist/apps/seo/index.js +17 -1
  17. package/dist/apps/seo/seo-app.d.ts +0 -1
  18. package/dist/apps/settings/index.js +17 -1
  19. package/dist/apps/tailwind/index.js +2 -2
  20. package/dist/apps/tailwind/tailwind-app.d.ts +0 -1
  21. package/dist/apps/timeline/index.js +18 -1
  22. package/dist/apps/timeline/timeline-app.d.ts +0 -1
  23. package/dist/apps/vite-config/index.js +16 -1
  24. package/dist/apps/vite-config/vite-config-app.d.ts +0 -1
  25. package/dist/client/overlay.js +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/packem_chunks/inject-source.js +9 -1
  28. package/dist/packem_shared/Alert-D2CvX4fw.js +1 -0
  29. package/dist/packem_shared/Badge-BEgU04nl.js +1 -0
  30. package/dist/packem_shared/Button-Bkx66Co7.js +1 -0
  31. package/dist/packem_shared/Card-CJa4vHVc.js +1 -0
  32. package/dist/packem_shared/Icon-B6UHkC0o.js +1 -0
  33. package/dist/packem_shared/Input-Cs6aduTi.js +1 -0
  34. package/dist/packem_shared/Label-CgCFOMDc.js +1 -0
  35. package/dist/packem_shared/Popover-DzH5lAc9.js +1 -0
  36. package/dist/packem_shared/Progress-DN6zn-0l.js +1 -0
  37. package/dist/packem_shared/Separator-D38mKeZv.js +1 -0
  38. package/dist/packem_shared/Skeleton-Dv-tcA1P.js +1 -0
  39. package/dist/packem_shared/Switch-C3NTpeoR.js +1 -0
  40. package/dist/packem_shared/Tabs-SuFWbB6d.js +1 -0
  41. package/dist/packem_shared/Textarea-Yfg3dLZi.js +1 -0
  42. package/dist/packem_shared/Tooltip-BHmzUaxu.js +1 -0
  43. package/dist/packem_shared/clsx-wGlvpUfw.js +1 -0
  44. package/dist/packem_shared/createServerRPCContext-CJXa8ezf.js +1 -0
  45. package/dist/packem_shared/sharedToolbarStylesheet-JFwZE8kq.js +2 -0
  46. package/dist/packem_shared/use-frame-state-CxrlPUM5.js +1 -0
  47. package/dist/packem_shared/use-theme-zpm4zmqP.js +1 -0
  48. package/dist/rpc/functions/assets.d.ts +16 -0
  49. package/dist/rpc/functions/vite-config.d.ts +76 -2
  50. package/dist/toolbar/components/app-button.d.ts +0 -1
  51. package/dist/toolbar/components/first-visit-hint.d.ts +0 -1
  52. package/dist/toolbar/components/toolbar-bar.d.ts +2 -7
  53. package/dist/toolbar/components/toolbar-container.d.ts +1 -7
  54. package/dist/toolbar/hooks/use-frame-state.d.ts +11 -1
  55. package/dist/toolbar/index.d.ts +0 -1
  56. package/dist/toolbar/index.js +3 -3
  57. package/dist/types/rpc.d.ts +8 -1
  58. package/dist/ui/components/alert.d.ts +0 -1
  59. package/dist/ui/components/badge.d.ts +0 -1
  60. package/dist/ui/components/button.d.ts +0 -1
  61. package/dist/ui/components/card.d.ts +0 -1
  62. package/dist/ui/components/icon.d.ts +0 -1
  63. package/dist/ui/components/input.d.ts +0 -1
  64. package/dist/ui/components/label.d.ts +0 -1
  65. package/dist/ui/components/progress.d.ts +0 -1
  66. package/dist/ui/components/separator.d.ts +0 -1
  67. package/dist/ui/components/skeleton.d.ts +0 -1
  68. package/dist/ui/components/switch.d.ts +0 -1
  69. package/dist/ui/components/tabs.d.ts +0 -1
  70. package/dist/ui/components/textarea.d.ts +0 -1
  71. package/dist/ui/index.d.ts +0 -1
  72. package/dist/ui/index.js +1 -1
  73. package/dist/vite-plugin.d.ts +5 -1
  74. package/dist/vite-plugin.js +2 -2
  75. package/package.json +12 -11
  76. package/dist/apps/more/index.d.ts +0 -3
  77. package/dist/apps/more/index.js +0 -2
  78. package/dist/apps/more/more-app.d.ts +0 -5
  79. package/dist/packem_shared/Alert-H-x1JuZ0.js +0 -1
  80. package/dist/packem_shared/Badge-C30mDKKG.js +0 -1
  81. package/dist/packem_shared/Button-DODNCTPZ.js +0 -1
  82. package/dist/packem_shared/Card-DdI7Wn3t.js +0 -1
  83. package/dist/packem_shared/Icon-DWFLZkwW.js +0 -1
  84. package/dist/packem_shared/Input-GfbOwAkK.js +0 -1
  85. package/dist/packem_shared/Label-Bzi47aUf.js +0 -1
  86. package/dist/packem_shared/Popover-CLt7YhUF.js +0 -1
  87. package/dist/packem_shared/Progress-vGfFpxRn.js +0 -1
  88. package/dist/packem_shared/Separator-DQGeJPQg.js +0 -1
  89. package/dist/packem_shared/Skeleton-BYXau6jM.js +0 -1
  90. package/dist/packem_shared/Switch-BeC78S_T.js +0 -1
  91. package/dist/packem_shared/Tabs-CXERaeAp.js +0 -1
  92. package/dist/packem_shared/Textarea-DvbSX13V.js +0 -1
  93. package/dist/packem_shared/Tooltip-tlBN-NdK.js +0 -1
  94. package/dist/packem_shared/cn-DWLJYh3h.js +0 -1
  95. package/dist/packem_shared/createServerRPCContext-CEm1Ymkn.js +0 -1
  96. package/dist/packem_shared/sharedToolbarStylesheet-DOV-Jwcm.js +0 -2
  97. package/dist/packem_shared/use-theme-BOw3dPpY.js +0 -1
  98. package/dist/utils/cn.d.ts +0 -8
@@ -1 +1,17 @@
1
- var C=Object.defineProperty;var w=(i,t)=>C(i,"name",{value:t,configurable:!0});import S from"lucide-static/icons/search.svg?raw";import{addHookName as u}from"preact/devtools";import{useState as h,useRef as D,useEffect as I}from"preact/hooks";import b from"../../packem_shared/cn-DWLJYh3h.js";import{jsxs as r,jsx as e,Fragment as _}from"preact/jsx-runtime";import k from"../../packem_shared/Button-DODNCTPZ.js";import T from"../../packem_shared/Badge-C30mDKKG.js";var j=Object.defineProperty,s=w((i,t)=>j(i,"name",{value:t,configurable:!0}),"c");const A=s(()=>{const i=s(c=>document.querySelector(`meta[name="${c}"]`)?.content??"","getMeta"),t=s(c=>document.querySelector(`meta[property="og:${c}"]`)?.content??"","getOg"),l=s(c=>document.querySelector(`meta[name="twitter:${c}"]`)?.content??document.querySelector(`meta[property="twitter:${c}"]`)?.content??"","getTwitter"),n=s(c=>document.querySelector(`meta[property="article:${c}"]`)?.content??"","getArticle");return{articleAuthor:n("author"),articleModifiedTime:n("modified_time"),articlePublishedTime:n("published_time"),articleSection:n("section"),canonical:document.querySelector('link[rel="canonical"]')?.href??"",description:i("description"),ogDescription:t("description"),ogImage:t("image"),ogImageAlt:t("image:alt"),ogLocale:t("locale"),ogSiteName:t("site_name"),ogTitle:t("title"),ogType:t("type"),ogUrl:t("url"),title:document.title??"",twitterCard:l("card"),twitterCreator:l("creator"),twitterDescription:l("description"),twitterImage:l("image"),twitterImageAlt:l("image:alt"),twitterSite:l("site"),twitterTitle:l("title")}},"readMetaTags"),v=[{description:"Page title shown in browser tabs and search engine results",key:"title",label:"title",priority:"required",snippet:"<title>Your Page Title</title>"},{description:"Title shown when your page is shared on social media",key:"ogTitle",label:"og:title",priority:"required",snippet:'<meta property="og:title" content="Your Page Title" />'},{description:"Description shown when sharing on social media (max 200 chars)",key:"ogDescription",label:"og:description",priority:"required",snippet:'<meta property="og:description" content="Your page description" />'},{description:"Image shown when sharing (recommended: 1200 × 630 px)",key:"ogImage",label:"og:image",priority:"required",snippet:'<meta property="og:image" content="https://yoursite.com/og-image.jpg" />'},{description:"Twitter card format — controls how link previews appear on X / Twitter",key:"twitterCard",label:"twitter:card",priority:"required",snippet:'<meta name="twitter:card" content="summary_large_image" />'},{description:"Meta description used by search engines (max 160 chars)",key:"description",label:"description",priority:"recommended",snippet:'<meta name="description" content="Your page description" />'},{description:"Canonical URL to prevent duplicate content issues with search engines",key:"canonical",label:"canonical",priority:"recommended",snippet:'<link rel="canonical" href="https://yoursite.com/page" />'},{description:"Canonical page URL for Open Graph — should match the canonical link tag",key:"ogUrl",label:"og:url",priority:"recommended",snippet:'<meta property="og:url" content="https://yoursite.com/page" />'},{description:"Type of content: website, article, product, video.movie, etc.",key:"ogType",label:"og:type",priority:"recommended",snippet:'<meta property="og:type" content="website" />'},{description:"Your website name — shown for consistent branding on social platforms",key:"ogSiteName",label:"og:site_name",priority:"recommended",snippet:'<meta property="og:site_name" content="Your Site Name" />'},{description:"Language and territory of page content (e.g. en_US, de_DE, fr_FR)",key:"ogLocale",label:"og:locale",priority:"recommended",snippet:'<meta property="og:locale" content="en_US" />'},{description:"Alt text for the OG image — important for accessibility on social platforms",key:"ogImageAlt",label:"og:image:alt",priority:"recommended",snippet:'<meta property="og:image:alt" content="Description of the shared image" />'},{description:"Override title specifically for X / Twitter cards (falls back to og:title)",key:"twitterTitle",label:"twitter:title",priority:"recommended",snippet:'<meta name="twitter:title" content="Your Page Title" />'},{description:"Override description for X / Twitter cards (falls back to og:description)",key:"twitterDescription",label:"twitter:description",priority:"recommended",snippet:'<meta name="twitter:description" content="Your page description" />'},{description:"Override image for X / Twitter cards (falls back to og:image)",key:"twitterImage",label:"twitter:image",priority:"recommended",snippet:'<meta name="twitter:image" content="https://yoursite.com/twitter-card.jpg" />'},{description:"X / Twitter handle of the website owner (e.g. @yourhandle)",key:"twitterSite",label:"twitter:site",priority:"recommended",snippet:'<meta name="twitter:site" content="@yourhandle" />'}],U=[{accentClass:"border-blue-500/30",descKey:"ogDescription",id:"facebook",imageKey:"ogImage",name:"Facebook",requiredKeys:["ogTitle","ogDescription","ogImage"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-foreground/20",descKey:"twitterDescription",id:"twitter",imageKey:"twitterImage",name:"X / Twitter",requiredKeys:["twitterTitle","twitterDescription","twitterImage","twitterCard"],titleKey:"twitterTitle",urlKey:"ogUrl"},{accentClass:"border-blue-600/30",descKey:"ogDescription",id:"linkedin",imageKey:"ogImage",name:"LinkedIn",requiredKeys:["ogTitle","ogDescription","ogImage"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-indigo-500/30",descKey:"ogDescription",id:"discord",imageKey:"ogImage",name:"Discord",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-green-500/30",descKey:"ogDescription",id:"slack",imageKey:"ogImage",name:"Slack",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-purple-500/30",descKey:"ogDescription",id:"mastodon",imageKey:"ogImage",name:"Mastodon",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-sky-500/30",descKey:"ogDescription",id:"bluesky",imageKey:"ogImage",name:"Bluesky",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"}],M=s(({meta:i,platform:t})=>{const l=i[t.titleKey]||i.title||"No title",n=i[t.descKey]||i.description||"",c=i[t.imageKey]||"",m=i[t.urlKey]||i.canonical||"",d=t.requiredKeys.filter(p=>!i[p]);return r("div",{class:b("border bg-card overflow-hidden",t.accentClass),children:[r("div",{class:"flex items-center justify-between gap-2 px-3 py-2 border-b border-border/50 bg-foreground/2",children:[e("span",{class:"text-[0.65rem] font-bold uppercase tracking-wider text-muted-foreground",children:t.name}),d.length>0&&r("span",{class:"text-[0.6rem] px-1.5 py-0.5 bg-warning/10 text-warning border border-warning/20 font-medium",children:["Missing: ",d.join(", ")]})]}),r("div",{class:"p-3",children:[e("div",{class:"w-full aspect-[1200/630] bg-foreground/6 border border-border/50 mb-2.5 overflow-hidden relative",children:c?e("img",{alt:"OG image preview",class:"w-full h-full object-cover",loading:"lazy",src:c}):e("div",{class:"absolute inset-0 flex items-center justify-center",children:e("span",{class:"text-[0.65rem] text-muted-foreground/40 uppercase tracking-wider",children:"No image"})})}),m&&e("div",{class:"text-[0.6rem] text-muted-foreground/60 uppercase tracking-wider truncate mb-1",children:m}),e("div",{class:"text-[0.8rem] font-semibold text-foreground line-clamp-1",children:l}),n&&e("div",{class:"text-[0.7rem] text-muted-foreground line-clamp-2 mt-0.5",children:n})]})]})},"SocialPreview"),a=s(({label:i,required:t=!1,value:l})=>r("div",{class:"flex items-start gap-3 py-2 border-b border-border/30 last:border-0",children:[e("div",{class:"w-44 shrink-0",children:e("span",{class:"text-[0.7rem] font-mono text-muted-foreground",children:i})}),e("div",{class:"flex-1 min-w-0",children:l?e("span",{class:"text-[0.75rem] text-foreground break-all",children:l}):e("span",{class:b("text-[0.7rem]",t?"text-warning":"text-muted-foreground/40"),children:t?"⚠ Missing":"—"})})]}),"MetaRow"),g=s(({children:i})=>r("p",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-muted-foreground/60 mb-2",children:[e("span",{class:"text-primary/50",children:"// "}),i]}),"SectionHeading"),O=s(({text:i})=>{const[t,l]=u(h(!1),"copied"),n=u(D(void 0),"timerRef"),c=s(()=>{navigator.clipboard.writeText(i).then(()=>{l(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(l,2e3,!1)}).catch(()=>{})},"handleCopy");return e(k,{class:b("text-[0.6rem] font-mono shrink-0",t?"border-success/40 text-success bg-success/8":""),onClick:c,size:"sm",variant:"outline",children:t?"Copied!":"Copy"})},"CopyButton"),x=s(({def:i})=>r("div",{class:"border border-border/60 bg-card p-3 space-y-2",children:[r("div",{class:"flex items-start justify-between gap-3",children:[e("code",{class:"text-[0.7rem] font-mono font-bold text-foreground",children:i.label}),e(T,{class:"text-[0.58rem] uppercase tracking-wide shrink-0",variant:i.priority==="required"?"destructive":"warning",children:i.priority})]}),e("p",{class:"text-[0.7rem] text-muted-foreground leading-relaxed",children:i.description}),r("div",{class:"flex items-center gap-2",children:[e("code",{class:"flex-1 min-w-0 text-[0.65rem] font-mono text-muted-foreground bg-foreground/4 border border-border/40 px-2 py-1 overflow-x-auto whitespace-nowrap block",children:i.snippet}),e(O,{text:i.snippet})]})]}),"MissingTagCard"),P=s(i=>{const[t,l]=u(h(void 0),"meta"),[n,c]=u(h("preview"),"activeTab"),m=s(()=>{l(A())},"refresh");if(I(()=>{m()},[]),!t)return r("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 select-none",children:[e("div",{"aria-hidden":"true",class:"flex gap-1.5 items-center",children:[0,160,320].map(o=>e("span",{class:"size-1.5 bg-primary/50 rounded-full animate-pulse",style:{animationDelay:`${o}ms`}},o))}),e("span",{class:"text-[0.75rem] text-muted-foreground",children:"Reading meta tags…"})]});const d=v.filter(o=>o.priority==="required"&&!t[o.key]),p=v.filter(o=>o.priority==="recommended"&&!t[o.key]),y=d.length+p.length,K=t.ogType==="article"||!!(t.articleAuthor||t.articlePublishedTime||t.articleModifiedTime||t.articleSection);return r("div",{class:"flex flex-col h-full",children:[r("div",{class:"flex items-center justify-between gap-3 px-4 py-2.5 border-b border-border shrink-0",children:[e("div",{class:"flex items-center gap-0",children:["preview","tags","missing"].map(o=>{const q=o==="preview"?"Social Previews":o==="tags"?"Meta Tags":"Missing",f=o==="missing"&&y>0?y:void 0;return r("button",{class:b("flex items-center gap-1.5 px-3 py-1.5 text-[0.75rem] font-medium border-0 cursor-pointer transition-colors capitalize",n===o?"text-foreground border-b-2 border-primary bg-transparent":"text-muted-foreground bg-transparent hover:text-foreground"),onClick:s(()=>c(o),"onClick"),type:"button",children:[q,f!==void 0&&e(T,{class:"text-[0.58rem] min-w-[1.1rem] text-center",variant:d.length>0?"destructive":"warning",children:f})]},o)})}),e(k,{onClick:m,size:"sm",variant:"outline",children:"Refresh"})]}),r("div",{class:"flex-1 overflow-auto",children:[n==="preview"&&e("div",{class:"p-4 grid grid-cols-2 gap-4",children:U.map(o=>e(M,{meta:t,platform:o},o.id))}),n==="tags"&&r("div",{class:"p-5 space-y-5",children:[r("div",{children:[e(g,{children:"Basic"}),e("div",{class:"border border-border bg-card",children:r("div",{class:"px-4",children:[e(a,{label:"title",required:!0,value:t.title}),e(a,{label:"description",required:!0,value:t.description}),e(a,{label:"canonical",value:t.canonical})]})})]}),r("div",{children:[e(g,{children:"Open Graph"}),e("div",{class:"border border-border bg-card",children:r("div",{class:"px-4",children:[e(a,{label:"og:title",required:!0,value:t.ogTitle}),e(a,{label:"og:description",required:!0,value:t.ogDescription}),e(a,{label:"og:image",required:!0,value:t.ogImage}),e(a,{label:"og:image:alt",value:t.ogImageAlt}),e(a,{label:"og:url",value:t.ogUrl}),e(a,{label:"og:type",value:t.ogType}),e(a,{label:"og:site_name",value:t.ogSiteName}),e(a,{label:"og:locale",value:t.ogLocale})]})})]}),K&&r("div",{children:[e(g,{children:"Article"}),e("div",{class:"border border-border bg-card",children:r("div",{class:"px-4",children:[e(a,{label:"article:author",value:t.articleAuthor}),e(a,{label:"article:published_time",value:t.articlePublishedTime}),e(a,{label:"article:modified_time",value:t.articleModifiedTime}),e(a,{label:"article:section",value:t.articleSection})]})})]}),r("div",{children:[e(g,{children:"X / Twitter"}),e("div",{class:"border border-border bg-card",children:r("div",{class:"px-4",children:[e(a,{label:"twitter:card",required:!0,value:t.twitterCard}),e(a,{label:"twitter:title",value:t.twitterTitle}),e(a,{label:"twitter:description",value:t.twitterDescription}),e(a,{label:"twitter:image",value:t.twitterImage}),e(a,{label:"twitter:image:alt",value:t.twitterImageAlt}),e(a,{label:"twitter:site",value:t.twitterSite}),e(a,{label:"twitter:creator",value:t.twitterCreator})]})})]})]}),n==="missing"&&e("div",{class:"p-5 space-y-5",children:y===0?r("div",{class:"flex flex-col items-center justify-center py-12 gap-3",children:[e("div",{class:"size-10 border border-success/30 bg-success/8 flex items-center justify-center text-success text-lg select-none",children:"✓"}),e("p",{class:"text-[0.8rem] font-medium text-foreground/70",children:"All recommended tags are present"}),e("p",{class:"text-[0.7rem] text-muted-foreground",children:"Your page has all required and recommended meta tags."})]}):r(_,{children:[d.length>0&&r("div",{children:[r("p",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-destructive/80 mb-2 flex items-center gap-1.5",children:[e("span",{children:"Required"}),e("span",{class:"bg-destructive/10 border border-destructive/25 text-destructive px-1 font-bold",children:d.length})]}),e("div",{class:"space-y-2",children:d.map(o=>e(x,{def:o},o.key))})]}),p.length>0&&r("div",{children:[r("p",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-warning/80 mb-2 flex items-center gap-1.5",children:[e("span",{children:"Recommended"}),e("span",{class:"bg-warning/10 border border-warning/25 text-warning px-1 font-bold",children:p.length})]}),e("div",{class:"space-y-2",children:p.map(o=>e(x,{def:o},o.key))})]})]})})]})]})},"SeoApp"),B={component:P,icon:S,id:"dev-toolbar:seo",name:"SEO"};export{B as default};
1
+ var J=Object.defineProperty;var j=(r,e)=>J(r,"name",{value:e,configurable:!0});import{addHookName as h}from"preact/devtools";import{clsx as b}from"../../packem_shared/clsx-wGlvpUfw.js";import{useState as v,useRef as Y,useEffect as X}from"preact/hooks";import{jsxs as i,jsx as t,Fragment as E}from"preact/jsx-runtime";import _ from"../../packem_shared/Button-Bkx66Co7.js";import K from"../../packem_shared/Badge-BEgU04nl.js";const F=`<!-- @license lucide-static v0.577.0 - ISC -->
2
+ <svg
3
+ class="lucide lucide-search"
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ width="24"
6
+ height="24"
7
+ viewBox="0 0 24 24"
8
+ fill="none"
9
+ stroke="currentColor"
10
+ stroke-width="2"
11
+ stroke-linecap="round"
12
+ stroke-linejoin="round"
13
+ >
14
+ <path d="m21 21-4.34-4.34" />
15
+ <circle cx="11" cy="11" r="8" />
16
+ </svg>
17
+ `;var V=Object.defineProperty,l=j((r,e)=>V(r,"name",{value:e,configurable:!0}),"l");const G=l(()=>{const r=l(s=>document.querySelector(`meta[name="${s}"]`)?.content??"","getMeta"),e=l(s=>document.querySelector(`meta[property="og:${s}"]`)?.content??"","getOg"),o=l(s=>document.querySelector(`meta[name="twitter:${s}"]`)?.content??document.querySelector(`meta[property="twitter:${s}"]`)?.content??"","getTwitter"),n=l(s=>document.querySelector(`meta[property="article:${s}"]`)?.content??"","getArticle");return{articleAuthor:n("author"),articleModifiedTime:n("modified_time"),articlePublishedTime:n("published_time"),articleSection:n("section"),canonical:document.querySelector('link[rel="canonical"]')?.href??"",description:r("description"),ogDescription:e("description"),ogImage:e("image"),ogImageAlt:e("image:alt"),ogLocale:e("locale"),ogSiteName:e("site_name"),ogTitle:e("title"),ogType:e("type"),ogUrl:e("url"),title:document.title??"",twitterCard:o("card"),twitterCreator:o("creator"),twitterDescription:o("description"),twitterImage:o("image"),twitterImageAlt:o("image:alt"),twitterSite:o("site"),twitterTitle:o("title")}},"readMetaTags"),W=/^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}(?::\d{2})?(?:[+-]\d{2}:\d{2}|Z)?)?$/,D=l(r=>typeof r=="string"&&W.test(r),"isISO8601"),a=l((r,e)=>r[e]!==void 0&&r[e]!==null&&r[e]!=="","has"),I=l(r=>Array.isArray(r)&&r.length>0,"isNonEmptyArray"),C=l(r=>{const e=[];if(!a(r,"headline")&&!a(r,"name")&&e.push({message:"headline (or name) is required",property:"headline",severity:"error"}),a(r,"author")){const o=r.author;typeof o=="object"&&!Array.isArray(o)&&!a(o,"name")&&e.push({message:"author.name is missing",property:"author.name",severity:"warning"})}else e.push({message:"author is required",property:"author",severity:"error"});return a(r,"datePublished")?D(r.datePublished)||e.push({message:"datePublished should be ISO 8601 format (e.g. 2024-01-15T09:00:00Z)",property:"datePublished",severity:"warning"}):e.push({message:"datePublished is required",property:"datePublished",severity:"error"}),a(r,"image")||e.push({message:"image is recommended for rich results",property:"image",severity:"warning"}),a(r,"description")||e.push({message:"description is recommended",property:"description",severity:"suggestion"}),e},"validateArticle"),H=l(r=>{const e=[];a(r,"name")||e.push({message:"name is required",property:"name",severity:"error"});const o=a(r,"offers"),n=a(r,"aggregateRating"),s=a(r,"review");if(!o&&!n&&!s&&e.push({message:"At least one of: offers, aggregateRating, or review is required for rich results",property:"offers",severity:"error"}),o){const c=Array.isArray(r.offers)?r.offers[0]:r.offers;c&&typeof c=="object"&&(!a(c,"price")&&!a(c,"priceSpecification")&&e.push({message:"offers.price is required",property:"offers.price",severity:"error"}),a(c,"priceCurrency")||e.push({message:"offers.priceCurrency is required (e.g. 'USD')",property:"offers.priceCurrency",severity:"error"}))}if(n){const c=r.aggregateRating;a(c,"ratingValue")||e.push({message:"aggregateRating.ratingValue is required",property:"aggregateRating.ratingValue",severity:"error"}),!a(c,"reviewCount")&&!a(c,"ratingCount")&&e.push({message:"aggregateRating.reviewCount (or ratingCount) is required",property:"aggregateRating.reviewCount",severity:"error"})}return a(r,"image")||e.push({message:"image is recommended for rich results",property:"image",severity:"suggestion"}),e},"validateProduct"),Q=l(r=>{const e=[],o=r.itemListElement;return I(o)?(o.length<2&&e.push({message:"itemListElement should have at least 2 items",property:"itemListElement",severity:"warning"}),o.forEach((n,s)=>{n.position!==s+1&&e.push({message:`itemListElement[${s}].position should be ${s+1}`,property:`itemListElement[${s}].position`,severity:"warning"}),n.name||n.item?.name||e.push({message:`itemListElement[${s}].name is required`,property:`itemListElement[${s}].name`,severity:"error"})}),e):(e.push({message:"itemListElement array is required",property:"itemListElement",severity:"error"}),e)},"validateBreadcrumbList"),Z=l(r=>{const e=[],o=r.mainEntity;return I(o)?(o.forEach((n,s)=>{a(n,"name")||e.push({message:`mainEntity[${s}].name (question text) is required`,property:`mainEntity[${s}].name`,severity:"error"});const c=n.acceptedAnswer;(!c||!a(c,"text"))&&e.push({message:`mainEntity[${s}].acceptedAnswer.text is required`,property:`mainEntity[${s}].acceptedAnswer.text`,severity:"error"})}),e):(e.push({message:"mainEntity array with at least one Question is required",property:"mainEntity",severity:"error"}),e)},"validateFaqPage"),O=l(r=>{const e=[];a(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),a(r,"startDate")?D(r.startDate)||e.push({message:"startDate should be ISO 8601 format",property:"startDate",severity:"warning"}):e.push({message:"startDate is required",property:"startDate",severity:"error"});const o=r.location;return o?a(o,"name")||e.push({message:"location.name is required",property:"location.name",severity:"error"}):e.push({message:"location is required",property:"location",severity:"error"}),a(r,"description")||e.push({message:"description is recommended",property:"description",severity:"suggestion"}),e},"validateEvent"),P=l(r=>{const e=[];return a(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),a(r,"url")||e.push({message:"url is recommended",property:"url",severity:"warning"}),a(r,"logo")||e.push({message:"logo is recommended for Knowledge Panel eligibility",property:"logo",severity:"suggestion"}),e},"validateOrganization"),ee=l(r=>{const e=[];return a(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),a(r,"url")||e.push({message:"url is recommended",property:"url",severity:"suggestion"}),e},"validatePerson"),re=l(r=>{const e=[];return a(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),a(r,"image")||e.push({message:"image is required for rich results",property:"image",severity:"error"}),!a(r,"recipeIngredient")&&!a(r,"ingredients")&&e.push({message:"recipeIngredient is recommended",property:"recipeIngredient",severity:"suggestion"}),a(r,"recipeInstructions")||e.push({message:"recipeInstructions is recommended",property:"recipeInstructions",severity:"suggestion"}),a(r,"author")||e.push({message:"author is recommended",property:"author",severity:"suggestion"}),e},"validateRecipe"),L=l(r=>{const e=[];return a(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),a(r,"url")||e.push({message:"url is recommended",property:"url",severity:"warning"}),e},"validateWebSiteOrPage"),te=l(r=>{const e=[];return a(r,"name")||e.push({message:"name is required",property:"name",severity:"error"}),a(r,"description")||e.push({message:"description is required",property:"description",severity:"error"}),a(r,"thumbnailUrl")||e.push({message:"thumbnailUrl is required for rich results",property:"thumbnailUrl",severity:"error"}),a(r,"uploadDate")?D(r.uploadDate)||e.push({message:"uploadDate should be ISO 8601 format",property:"uploadDate",severity:"warning"}):e.push({message:"uploadDate is required",property:"uploadDate",severity:"error"}),e},"validateVideoObject"),M={Article:C,BlogPosting:C,BreadcrumbList:Q,Event:O,EventSeries:O,FAQPage:Z,LocalBusiness:P,NewsArticle:C,Organization:P,Person:ee,Product:H,Recipe:re,VideoObject:te,WebPage:L,WebSite:L},ie=new Set(Object.keys(M)),se=l(r=>{const e=[],o=String(r["@context"]??""),n=String(r["@type"]??"");if(o?o.includes("schema.org")||e.push({message:"@context should reference schema.org",property:"@context",severity:"warning"}):e.push({message:"@context is missing — should be 'https://schema.org'",property:"@context",severity:"error"}),!n)return e.push({message:"@type is required",property:"@type",severity:"error"}),e;ie.has(n)||e.push({message:`@type '${n}' is not validated — no known rules for this type`,property:"@type",severity:"suggestion"});const s=M[n];return s&&e.push(...s(r)),e},"validateJsonLd"),oe=l(r=>r.some(e=>e.severity==="error")?"error":r.some(e=>e.severity==="warning")?"warning":r.some(e=>e.severity==="suggestion")?"suggestion":"ok","deriveStatus"),R=l((r,e,o,n)=>{const s=se(r),c=String(r["@type"]??"Unknown");return{context:String(r["@context"]??""),graphIndex:o,index:e,messages:s,parsed:r,raw:n??JSON.stringify(r,void 0,2),status:oe(s),type:c}},"processJsonLdNode"),ne=/^\/\/<!\[CDATA\[/,ae=/\/\/\]\]>$/,le=/^<!\[CDATA\[/,ce=/\]\]>$/,de=l(()=>{const r=document.querySelectorAll('script[type="application/ld+json"]'),e=[];return r.forEach((o,n)=>{let s=(o.textContent??"").trim();s=s.replace(ne,"").replace(ae,""),s=s.replace(le,"").replace(ce,"");try{const c=JSON.parse(s);if(I(c["@graph"])){const y=String(c["@context"]??"");c["@graph"].forEach((g,m)=>{const u={"@context":g["@context"]??y,...g};e.push(R(u,n,m,void 0))})}else e.push(R(c,n,void 0,s))}catch{e.push({context:"",index:n,messages:[{message:"Could not parse JSON content",property:"",severity:"error"}],parsed:{},raw:s,status:"error",type:"Invalid JSON"})}}),e},"readJsonLdSchemas"),U=[{description:"Page title shown in browser tabs and search engine results",key:"title",label:"title",priority:"required",snippet:"<title>Your Page Title</title>"},{description:"Title shown when your page is shared on social media",key:"ogTitle",label:"og:title",priority:"required",snippet:'<meta property="og:title" content="Your Page Title" />'},{description:"Description shown when sharing on social media (max 200 chars)",key:"ogDescription",label:"og:description",priority:"required",snippet:'<meta property="og:description" content="Your page description" />'},{description:"Image shown when sharing (recommended: 1200 × 630 px)",key:"ogImage",label:"og:image",priority:"required",snippet:'<meta property="og:image" content="https://yoursite.com/og-image.jpg" />'},{description:"Twitter card format — controls how link previews appear on X / Twitter",key:"twitterCard",label:"twitter:card",priority:"required",snippet:'<meta name="twitter:card" content="summary_large_image" />'},{description:"Meta description used by search engines (max 160 chars)",key:"description",label:"description",priority:"recommended",snippet:'<meta name="description" content="Your page description" />'},{description:"Canonical URL to prevent duplicate content issues with search engines",key:"canonical",label:"canonical",priority:"recommended",snippet:'<link rel="canonical" href="https://yoursite.com/page" />'},{description:"Canonical page URL for Open Graph — should match the canonical link tag",key:"ogUrl",label:"og:url",priority:"recommended",snippet:'<meta property="og:url" content="https://yoursite.com/page" />'},{description:"Type of content: website, article, product, video.movie, etc.",key:"ogType",label:"og:type",priority:"recommended",snippet:'<meta property="og:type" content="website" />'},{description:"Your website name — shown for consistent branding on social platforms",key:"ogSiteName",label:"og:site_name",priority:"recommended",snippet:'<meta property="og:site_name" content="Your Site Name" />'},{description:"Language and territory of page content (e.g. en_US, de_DE, fr_FR)",key:"ogLocale",label:"og:locale",priority:"recommended",snippet:'<meta property="og:locale" content="en_US" />'},{description:"Alt text for the OG image — important for accessibility on social platforms",key:"ogImageAlt",label:"og:image:alt",priority:"recommended",snippet:'<meta property="og:image:alt" content="Description of the shared image" />'},{description:"Override title specifically for X / Twitter cards (falls back to og:title)",key:"twitterTitle",label:"twitter:title",priority:"recommended",snippet:'<meta name="twitter:title" content="Your Page Title" />'},{description:"Override description for X / Twitter cards (falls back to og:description)",key:"twitterDescription",label:"twitter:description",priority:"recommended",snippet:'<meta name="twitter:description" content="Your page description" />'},{description:"Override image for X / Twitter cards (falls back to og:image)",key:"twitterImage",label:"twitter:image",priority:"recommended",snippet:'<meta name="twitter:image" content="https://yoursite.com/twitter-card.jpg" />'},{description:"X / Twitter handle of the website owner (e.g. @yourhandle)",key:"twitterSite",label:"twitter:site",priority:"recommended",snippet:'<meta name="twitter:site" content="@yourhandle" />'}],pe=[{accentClass:"border-blue-500/30",descKey:"ogDescription",id:"facebook",imageKey:"ogImage",name:"Facebook",requiredKeys:["ogTitle","ogDescription","ogImage"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-foreground/20",descKey:"twitterDescription",id:"twitter",imageKey:"twitterImage",name:"X / Twitter",requiredKeys:["twitterTitle","twitterDescription","twitterImage","twitterCard"],titleKey:"twitterTitle",urlKey:"ogUrl"},{accentClass:"border-blue-600/30",descKey:"ogDescription",id:"linkedin",imageKey:"ogImage",name:"LinkedIn",requiredKeys:["ogTitle","ogDescription","ogImage"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-indigo-500/30",descKey:"ogDescription",id:"discord",imageKey:"ogImage",name:"Discord",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-green-500/30",descKey:"ogDescription",id:"slack",imageKey:"ogImage",name:"Slack",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-purple-500/30",descKey:"ogDescription",id:"mastodon",imageKey:"ogImage",name:"Mastodon",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-sky-500/30",descKey:"ogDescription",id:"bluesky",imageKey:"ogImage",name:"Bluesky",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"}],ge=l(({meta:r,platform:e})=>{const o=r[e.titleKey]||r.title||"No title",n=r[e.descKey]||r.description||"",s=r[e.imageKey]||"",c=r[e.urlKey]||r.canonical||"",y=e.requiredKeys.filter(g=>!r[g]);return i("div",{class:b("border bg-card overflow-hidden",e.accentClass),children:[i("div",{class:"flex items-center justify-between gap-2 px-3 py-2 border-b border-border/50 bg-foreground/2",children:[t("span",{class:"text-[0.65rem] font-bold uppercase tracking-wider text-muted-foreground",children:e.name}),y.length>0&&i("span",{class:"text-[0.6rem] px-1.5 py-0.5 bg-warning/10 text-warning border border-warning/20 font-medium",children:["Missing: ",y.join(", ")]})]}),i("div",{class:"p-3",children:[t("div",{class:"w-full aspect-[1200/630] bg-foreground/6 border border-border/50 mb-2.5 overflow-hidden relative",children:s?t("img",{alt:"OG image preview",class:"w-full h-full object-cover",loading:"lazy",src:s}):t("div",{class:"absolute inset-0 flex items-center justify-center",children:t("span",{class:"text-[0.65rem] text-muted-foreground/40 uppercase tracking-wider",children:"No image"})})}),c&&t("div",{class:"text-[0.6rem] text-muted-foreground/60 uppercase tracking-wider truncate mb-1",children:c}),t("div",{class:"text-[0.8rem] font-semibold text-foreground line-clamp-1",children:o}),n&&t("div",{class:"text-[0.7rem] text-muted-foreground line-clamp-2 mt-0.5",children:n})]})]})},"SocialPreview"),p=l(({label:r,required:e=!1,value:o})=>i("div",{class:"flex items-start gap-3 py-2 border-b border-border/30 last:border-0",children:[t("div",{class:"w-44 shrink-0",children:t("span",{class:"text-[0.7rem] font-mono text-muted-foreground",children:r})}),t("div",{class:"flex-1 min-w-0",children:o?t("span",{class:"text-[0.75rem] text-foreground break-all",children:o}):t("span",{class:b("text-[0.7rem]",e?"text-warning":"text-muted-foreground/40"),children:e?"⚠ Missing":"—"})})]}),"MetaRow"),k=l(({children:r})=>i("p",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-muted-foreground/60 mb-2",children:[t("span",{class:"text-primary/50",children:"// "}),r]}),"SectionHeading"),z=l(({text:r})=>{const[e,o]=h(v(!1),"copied"),n=h(Y(void 0),"timerRef"),s=l(()=>{navigator.clipboard.writeText(r).then(()=>{o(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(o,2e3,!1)}).catch(()=>{})},"handleCopy");return t(_,{class:b("text-[0.6rem] font-mono shrink-0",e?"border-success/40 text-success bg-success/8":""),onClick:s,size:"sm",variant:"outline",children:e?"Copied!":"Copy"})},"CopyButton"),N=l(({def:r})=>i("div",{class:"border border-border/60 bg-card p-3 space-y-2",children:[i("div",{class:"flex items-start justify-between gap-3",children:[t("code",{class:"text-[0.7rem] font-mono font-bold text-foreground",children:r.label}),t(K,{class:"text-[0.58rem] uppercase tracking-wide shrink-0",variant:r.priority==="required"?"destructive":"warning",children:r.priority})]}),t("p",{class:"text-[0.7rem] text-muted-foreground leading-relaxed",children:r.description}),i("div",{class:"flex items-center gap-2",children:[t("code",{class:"flex-1 min-w-0 text-[0.65rem] font-mono text-muted-foreground bg-foreground/4 border border-border/40 px-2 py-1 overflow-x-auto whitespace-nowrap block",children:r.snippet}),t(z,{text:r.snippet})]})]}),"MissingTagCard"),$={error:{color:"text-destructive",icon:"✖",label:"Error"},ok:{color:"text-success",icon:"✔",label:"OK"},suggestion:{color:"text-primary",icon:"ℹ",label:"Info"},warning:{color:"text-warning",icon:"⚠",label:"Warning"}},me={error:"destructive",ok:"success",suggestion:"outline",warning:"warning"},ue=l(({schema:r})=>{const[e,o]=h(v(!1),"open"),[n,s]=h(v(!1),"showRaw"),c=$[r.status],y=r.graphIndex===void 0?`Script ${r.index+1}`:`Script ${r.index+1} @graph[${r.graphIndex}]`;return i("div",{class:"border border-border bg-card overflow-hidden",children:[i("button",{class:"w-full flex items-center justify-between gap-3 px-4 py-3 bg-transparent border-0 cursor-pointer text-left hover:bg-foreground/3 transition-colors",onClick:l(()=>o(g=>!g),"onClick"),type:"button",children:[i("div",{class:"flex items-center gap-2 min-w-0",children:[t("span",{class:b("text-base shrink-0 leading-none",c.color),children:c.icon}),t("span",{class:"text-[0.7rem] text-muted-foreground font-mono shrink-0",children:y}),t("code",{class:"text-[0.75rem] font-mono font-semibold text-foreground truncate",children:r.type})]}),i("div",{class:"flex items-center gap-2 shrink-0",children:[t(K,{variant:me[r.status],children:c.label}),t("span",{class:b("text-muted-foreground text-[0.65rem] transition-transform duration-150",e?"rotate-90":""),children:"▶"})]})]}),e&&i("div",{class:"border-t border-border",children:[r.messages.length>0?t("div",{class:"px-4 py-3 space-y-1.5",children:r.messages.map((g,m)=>{const u=$[g.severity];return i("div",{class:"flex items-start gap-2 text-[0.72rem]",children:[t("span",{class:b("shrink-0 leading-none mt-px",u.color),children:u.icon}),i("div",{class:"min-w-0",children:[g.property&&i("code",{class:"text-[0.65rem] font-mono text-muted-foreground mr-1.5",children:[g.property,":"]}),t("span",{class:"text-foreground/80",children:g.message})]})]},m)})}):i("div",{class:"px-4 py-3 flex items-center gap-2 text-[0.72rem] text-success",children:[t("span",{children:"✔"}),t("span",{children:"No issues found"})]}),i("div",{class:"border-t border-border/50 px-4 py-2 flex items-center justify-between",children:[i("button",{class:"text-[0.65rem] text-muted-foreground hover:text-foreground transition-colors bg-transparent border-0 cursor-pointer p-0",onClick:l(()=>s(g=>!g),"onClick"),type:"button",children:[n?"Hide":"Show"," raw JSON"]}),t(z,{text:r.raw})]}),n&&t("pre",{class:"text-[0.65rem] font-mono leading-relaxed bg-foreground/3 border-t border-border/50 px-4 py-3 overflow-x-auto max-h-60 text-muted-foreground whitespace-pre-wrap break-all m-0",children:r.raw})]})]})},"SchemaCard"),ye=l(r=>{const[e,o]=h(v(void 0),"meta"),[n,s]=h(v([]),"schemas"),[c,y]=h(v("preview"),"activeTab"),g=l(()=>{o(G()),s(de())},"refresh");if(X(()=>{g()},[]),!e)return i("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 select-none",children:[t("div",{"aria-hidden":"true",class:"flex gap-1.5 items-center",children:[0,160,320].map(d=>t("span",{class:"size-1.5 bg-primary/50 rounded-full animate-pulse",style:{animationDelay:`${d}ms`}},d))}),t("span",{class:"text-[0.75rem] text-muted-foreground",children:"Reading meta tags…"})]});const m=U.filter(d=>d.priority==="required"&&!e[d.key]),u=U.filter(d=>d.priority==="recommended"&&!e[d.key]),q=m.length+u.length,f=n.filter(d=>d.status==="error").length,A=n.filter(d=>d.status==="warning").length;let x;f>0?x=f:A>0&&(x=A);const B=e.ogType==="article"||!!(e.articleAuthor||e.articlePublishedTime||e.articleModifiedTime||e.articleSection);return i("div",{class:"flex flex-col h-full",children:[i("div",{class:"flex items-center justify-between gap-3 px-4 py-2.5 border-b border-border shrink-0",children:[t("div",{class:"flex items-center gap-0",children:["preview","tags","missing","jsonld"].map(d=>{const T={jsonld:"Structured Data",missing:"Missing",preview:"Social Previews",tags:"Meta Tags"}[d];let w;d==="missing"&&q>0?w=q:d==="jsonld"&&x!==void 0&&(w=x);let S;return d==="missing"?S=m.length>0?"destructive":"warning":S=f>0?"destructive":"warning",i("button",{class:b("flex items-center gap-1.5 px-3 py-1.5 text-[0.75rem] font-medium border-0 cursor-pointer transition-colors capitalize",c===d?"text-foreground border-b-2 border-primary bg-transparent":"text-muted-foreground bg-transparent hover:text-foreground"),onClick:l(()=>y(d),"onClick"),type:"button",children:[T,w!==void 0&&t(K,{class:"text-[0.58rem] min-w-[1.1rem] text-center",variant:S,children:w})]},d)})}),t(_,{onClick:g,size:"sm",variant:"outline",children:"Refresh"})]}),i("div",{class:"flex-1 overflow-auto",children:[c==="preview"&&t("div",{class:"p-4 grid grid-cols-2 gap-4",children:pe.map(d=>t(ge,{meta:e,platform:d},d.id))}),c==="tags"&&i("div",{class:"p-5 space-y-5",children:[i("div",{children:[t(k,{children:"Basic"}),t("div",{class:"border border-border bg-card",children:i("div",{class:"px-4",children:[t(p,{label:"title",required:!0,value:e.title}),t(p,{label:"description",required:!0,value:e.description}),t(p,{label:"canonical",value:e.canonical})]})})]}),i("div",{children:[t(k,{children:"Open Graph"}),t("div",{class:"border border-border bg-card",children:i("div",{class:"px-4",children:[t(p,{label:"og:title",required:!0,value:e.ogTitle}),t(p,{label:"og:description",required:!0,value:e.ogDescription}),t(p,{label:"og:image",required:!0,value:e.ogImage}),t(p,{label:"og:image:alt",value:e.ogImageAlt}),t(p,{label:"og:url",value:e.ogUrl}),t(p,{label:"og:type",value:e.ogType}),t(p,{label:"og:site_name",value:e.ogSiteName}),t(p,{label:"og:locale",value:e.ogLocale})]})})]}),B&&i("div",{children:[t(k,{children:"Article"}),t("div",{class:"border border-border bg-card",children:i("div",{class:"px-4",children:[t(p,{label:"article:author",value:e.articleAuthor}),t(p,{label:"article:published_time",value:e.articlePublishedTime}),t(p,{label:"article:modified_time",value:e.articleModifiedTime}),t(p,{label:"article:section",value:e.articleSection})]})})]}),i("div",{children:[t(k,{children:"X / Twitter"}),t("div",{class:"border border-border bg-card",children:i("div",{class:"px-4",children:[t(p,{label:"twitter:card",required:!0,value:e.twitterCard}),t(p,{label:"twitter:title",value:e.twitterTitle}),t(p,{label:"twitter:description",value:e.twitterDescription}),t(p,{label:"twitter:image",value:e.twitterImage}),t(p,{label:"twitter:image:alt",value:e.twitterImageAlt}),t(p,{label:"twitter:site",value:e.twitterSite}),t(p,{label:"twitter:creator",value:e.twitterCreator})]})})]})]}),c==="jsonld"&&t("div",{class:"p-5 space-y-3",children:n.length===0?i("div",{class:"flex flex-col items-center justify-center py-12 gap-3",children:[t("div",{class:"size-10 border border-border flex items-center justify-center text-muted-foreground/40 text-lg select-none",children:"{}"}),t("p",{class:"text-[0.8rem] font-medium text-foreground/70",children:"No structured data found"}),i("p",{class:"text-[0.7rem] text-muted-foreground text-center max-w-xs leading-relaxed",children:["Add a ",t("code",{class:"font-mono bg-foreground/6 px-1",children:'<script type="application/ld+json">'})," block to help search engines understand your content."]})]}):i(E,{children:[i("div",{class:"flex items-center justify-between mb-1",children:[i("p",{class:"text-[0.65rem] font-bold uppercase tracking-[0.1em] text-muted-foreground",children:[n.length," schema",n.length===1?"":"s"," detected"]}),f>0&&i("span",{class:"text-[0.65rem] text-destructive font-medium",children:[f," error",f===1?"":"s"]})]}),n.map((d,T)=>t(ue,{schema:d},T))]})}),c==="missing"&&t("div",{class:"p-5 space-y-5",children:q===0?i("div",{class:"flex flex-col items-center justify-center py-12 gap-3",children:[t("div",{class:"size-10 border border-success/30 bg-success/8 flex items-center justify-center text-success text-lg select-none",children:"✓"}),t("p",{class:"text-[0.8rem] font-medium text-foreground/70",children:"All recommended tags are present"}),t("p",{class:"text-[0.7rem] text-muted-foreground",children:"Your page has all required and recommended meta tags."})]}):i(E,{children:[m.length>0&&i("div",{children:[i("p",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-destructive/80 mb-2 flex items-center gap-1.5",children:[t("span",{children:"Required"}),t("span",{class:"bg-destructive/10 border border-destructive/25 text-destructive px-1 font-bold",children:m.length})]}),t("div",{class:"space-y-2",children:m.map(d=>t(N,{def:d},d.key))})]}),u.length>0&&i("div",{children:[i("p",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-warning/80 mb-2 flex items-center gap-1.5",children:[t("span",{children:"Recommended"}),t("span",{class:"bg-warning/10 border border-warning/25 text-warning px-1 font-bold",children:u.length})]}),t("div",{class:"space-y-2",children:u.map(d=>t(N,{def:d},d.key))})]})]})})]})]})},"SeoApp"),qe={component:ye,icon:F,id:"dev-toolbar:seo",name:"SEO"};export{qe as default};
@@ -1,4 +1,3 @@
1
- /** @jsxImportSource preact */
2
1
  import type { ComponentChildren } from "preact";
3
2
  import type { AppComponentProps } from "../../types/app.d.ts";
4
3
  declare const SeoApp: (_props: AppComponentProps) => ComponentChildren;
@@ -1 +1,17 @@
1
- var x=Object.defineProperty;var v=(o,n)=>x(o,"name",{value:n,configurable:!0});import C from"lucide-static/icons/settings.svg?raw";import{addHookName as k}from"preact/devtools";import w from"lucide-static/icons/monitor.svg?data-uri&encoding=css";import S from"lucide-static/icons/moon.svg?data-uri&encoding=css";import T from"lucide-static/icons/sun.svg?data-uri&encoding=css";import{useState as D,useRef as K,useEffect as P}from"preact/hooks";import{h as z,_ as R,r as c}from"../../packem_shared/use-theme-BOw3dPpY.js";import b from"../../packem_shared/Icon-DWFLZkwW.js";import g from"../../packem_shared/cn-DWLJYh3h.js";import{jsxs as l,jsx as e}from"preact/jsx-runtime";import h from"../../packem_shared/Button-DODNCTPZ.js";var A=Object.defineProperty,i=v((o,n)=>A(o,"name",{value:n,configurable:!0}),"o");const d=i(({control:o,description:n,label:t})=>l("div",{class:"flex items-center justify-between gap-6 py-3.5",children:[l("div",{class:"min-w-0",children:[e("div",{class:"text-[0.8125rem] font-medium text-foreground leading-none mb-0.5",children:t}),n&&e("div",{class:"text-[0.725rem] text-muted-foreground leading-snug mt-1",children:n})]}),e("div",{class:"shrink-0",children:o})]}),"SettingRow"),p=i(({children:o,title:n})=>l("section",{children:[l("h3",{class:"text-[0.65rem] font-bold uppercase tracking-[0.1em] text-muted-foreground mb-2 px-1 flex items-center gap-1.5",children:[e("span",{"aria-hidden":"true",class:"text-primary/50",children:"//"}),n]}),e("div",{class:"rounded-none border border-border bg-card divide-y divide-border overflow-hidden border-l-2 border-l-primary/20",children:e("div",{class:"px-4",children:o})})]}),"Section"),f=i(({checked:o,onChange:n})=>e("button",{"aria-checked":o,class:g("relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-none border-2 border-transparent","transition-colors duration-200 ease-in-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",o?"bg-primary":"bg-foreground/15"),onClick:i(()=>n(!o),"onClick"),role:"switch",type:"button",children:e("span",{class:g("pointer-events-none inline-block h-4 w-4 shadow-sm","transition-all duration-200 ease-in-out",o?"translate-x-4 bg-primary-foreground":"translate-x-0 bg-white")})}),"Toggle"),O=i(({onChange:o,value:n})=>{const t=[{icon:e(b,{size:13,src:T}),label:"Light",value:"light"},{icon:e(b,{size:13,src:S}),label:"Dark",value:"dark"},{icon:e(b,{size:13,src:w}),label:"System",value:"system"}];return e("div",{class:"flex items-center gap-0.5 bg-foreground/6 p-0.5",children:t.map(a=>l("button",{"aria-pressed":n===a.value,class:g("flex items-center gap-1.5 px-2.5 py-1.5 text-[0.75rem] font-medium","transition-all duration-150 cursor-pointer border-0",n===a.value?"bg-background text-foreground shadow-sm":"bg-transparent text-muted-foreground hover:text-foreground"),onClick:i(()=>o(a.value),"onClick"),type:"button",children:[a.icon,a.label]},a.value))})},"ThemeControl"),j=[{label:"Never",value:-1},{label:"Always",value:0},{label:"2s",value:2e3},{label:"5s",value:5e3},{label:"10s",value:1e4},{label:"30s",value:3e4}],N=i(({onChange:o,value:n})=>e("select",{class:g("bg-foreground/6 border border-border","text-[0.775rem] font-medium text-foreground","px-2.5 py-1.5 cursor-pointer","focus:outline-none focus:ring-1 focus:ring-ring","transition-colors duration-150"),onChange:i(t=>o(Number(t.target.value)),"onChange"),value:String(n),children:j.map(t=>e("option",{value:String(t.value),children:t.label},t.value))}),"HideDelayControl"),E=i(o=>o.split("+"),"formatBinding"),M=i(({part:o})=>e("span",{class:"inline-flex items-center px-1.5 py-0.5 text-[0.65rem] font-mono font-medium bg-foreground/8 border border-border text-foreground",children:o}),"KeyBadge"),y=i(({onChange:o,value:n})=>{const[t,a]=k(D(!1),"capturing"),m=k(K(null),"buttonRef");return P(()=>{if(!t)return;const r=i(s=>{if(s.preventDefault(),s.stopPropagation(),["Alt","Control","Meta","Shift"].includes(s.key))return;const u=[];s.altKey&&u.push("Alt"),s.ctrlKey&&u.push("Control"),s.metaKey&&u.push("Meta"),s.shiftKey&&u.push("Shift"),u.push(s.key),o(u.join("+")),a(!1)},"handleKeyDown");return globalThis.addEventListener("keydown",r,!0),()=>globalThis.removeEventListener("keydown",r,!0)},[t,o]),l("div",{class:"flex items-center gap-2",children:[e("div",{class:"flex items-center gap-0.5",children:E(n).map((r,s)=>l("span",{class:"flex items-center gap-0.5",children:[s>0&&e("span",{class:"text-muted-foreground/40 text-[0.6rem] mx-0.5",children:"+"}),e(M,{part:r})]},s))}),e(h,{class:g("text-[0.7rem]",t?"border-primary text-primary bg-primary/8 animate-pulse":""),onClick:i(()=>a(r=>!r),"onClick"),ref:m,size:"sm",variant:"outline",children:t?"Press keys…":"Record"}),e(h,{class:"text-[0.7rem]",onClick:i(()=>{a(!1)},"onClick"),size:"sm",title:"Cancel",variant:"ghost",children:"✕"})]})},"KeyCapture"),L=i(o=>{const{state:n,updateState:t}=z(),{setTheme:a,theme:m}=R();return l("div",{class:"p-5 space-y-5 max-w-2xl",children:[l(p,{title:"Appearance",children:[e(d,{control:e(O,{onChange:a,value:m}),description:"Color scheme for the DevTools panel.",label:"Theme"}),e(d,{control:e(f,{checked:n.reduceMotion,onChange:i(r=>t({reduceMotion:r}),"onChange")}),description:"Disable animations and transitions throughout the toolbar.",label:"Reduce motion"})]}),l(p,{title:"Toolbar",children:[e(d,{control:e(N,{onChange:i(r=>t({minimizePanelInactive:r}),"onChange"),value:n.minimizePanelInactive}),description:"Collapse the toolbar pill after a period of inactivity. Set 'Never' to always keep it visible.",label:"Auto-hide when inactive"}),e(d,{control:e(f,{checked:n.preferShowFloatingPanel,onChange:i(r=>t({preferShowFloatingPanel:r}),"onChange")}),description:"Keep the toolbar pill visible even when the DevTools panel is not open.",label:"Show toolbar when panel is closed"})]}),e(p,{title:"Panel",children:e(d,{control:e(f,{checked:n.closeOnOutsideClick,onChange:i(r=>t({closeOnOutsideClick:r}),"onChange")}),description:"Close the DevTools panel when clicking outside of it.",label:"Close on outside click"})}),l(p,{title:"Keyboard Shortcuts",children:[e(d,{control:l("div",{class:"flex items-center gap-2",children:[e(y,{onChange:i(r=>t({keybindings:{...n.keybindings??c,toggle:r}}),"onChange"),value:n.keybindings?.toggle??c.toggle}),n.keybindings?.toggle!==c.toggle&&e(h,{class:"h-auto p-0 text-[0.65rem]",onClick:i(()=>t({keybindings:{...n.keybindings??c,toggle:c.toggle}}),"onClick"),variant:"link",children:"Reset"})]}),description:"Open or close the DevTools panel.",label:"Toggle toolbar"}),e(d,{control:l("div",{class:"flex items-center gap-2",children:[e(y,{onChange:i(r=>t({keybindings:{...n.keybindings??c,close:r}}),"onChange"),value:n.keybindings?.close??c.close}),n.keybindings?.close!==c.close&&e(h,{class:"h-auto p-0 text-[0.65rem]",onClick:i(()=>t({keybindings:{...n.keybindings??c,close:c.close}}),"onClick"),variant:"link",children:"Reset"})]}),description:"Dismiss the active app or close the panel.",label:"Close panel"})]})]})},"SettingsApp"),W={component:L,defaultOpen:!0,icon:C,id:"dev-toolbar:settings",name:"Settings"};export{W as default};
1
+ var k=Object.defineProperty;var f=(o,n)=>k(o,"name",{value:n,configurable:!0});import{addHookName as C}from"preact/devtools";import{clsx as h}from"../../packem_shared/clsx-wGlvpUfw.js";import{useState as D,useRef as y,useEffect as w}from"preact/hooks";import{h as E,r as c}from"../../packem_shared/use-frame-state-CxrlPUM5.js";import{_ as F}from"../../packem_shared/use-theme-zpm4zmqP.js";import v from"../../packem_shared/Icon-B6UHkC0o.js";import{jsxs as r,jsx as e}from"preact/jsx-runtime";import p from"../../packem_shared/Button-Bkx66Co7.js";const S=`<!-- @license lucide-static v0.577.0 - ISC -->
2
+ <svg
3
+ class="lucide lucide-settings"
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ width="24"
6
+ height="24"
7
+ viewBox="0 0 24 24"
8
+ fill="none"
9
+ stroke="currentColor"
10
+ stroke-width="2"
11
+ stroke-linecap="round"
12
+ stroke-linejoin="round"
13
+ >
14
+ <path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" />
15
+ <circle cx="12" cy="12" r="3" />
16
+ </svg>
17
+ `,A="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-monitor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Crect%20width%3D%2220%22%20height%3D%2214%22%20x%3D%222%22%20y%3D%223%22%20rx%3D%222%22%20%2F%3E%20%3Cline%20x1%3D%228%22%20x2%3D%2216%22%20y1%3D%2221%22%20y2%3D%2221%22%20%2F%3E%20%3Cline%20x1%3D%2212%22%20x2%3D%2212%22%20y1%3D%2217%22%20y2%3D%2221%22%20%2F%3E%20%3C%2Fsvg%3E",T="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-moon%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M20.985%2012.486a9%209%200%201%201-9.473-9.472c.405-.022.617.46.402.803a6%206%200%200%200%208.268%208.268c.344-.215.825-.004.803.401%22%20%2F%3E%20%3C%2Fsvg%3E",M="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-sun%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%224%22%20%2F%3E%20%3Cpath%20d%3D%22M12%202v2%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2020v2%22%20%2F%3E%20%3Cpath%20d%3D%22m4.93%204.93%201.41%201.41%22%20%2F%3E%20%3Cpath%20d%3D%22m17.66%2017.66%201.41%201.41%22%20%2F%3E%20%3Cpath%20d%3D%22M2%2012h2%22%20%2F%3E%20%3Cpath%20d%3D%22M20%2012h2%22%20%2F%3E%20%3Cpath%20d%3D%22m6.34%2017.66-1.41%201.41%22%20%2F%3E%20%3Cpath%20d%3D%22m19.07%204.93-1.41%201.41%22%20%2F%3E%20%3C%2Fsvg%3E";var P=Object.defineProperty,t=f((o,n)=>P(o,"name",{value:n,configurable:!0}),"l");const d=t(({control:o,description:n,label:l})=>r("div",{class:"flex items-center justify-between gap-6 py-3.5",children:[r("div",{class:"min-w-0",children:[e("div",{class:"text-[0.8125rem] font-medium text-foreground leading-none mb-0.5",children:l}),n&&e("div",{class:"text-[0.725rem] text-muted-foreground leading-snug mt-1",children:n})]}),e("div",{class:"shrink-0",children:o})]}),"SettingRow"),g=t(({children:o,title:n})=>r("section",{children:[r("h3",{class:"text-[0.65rem] font-bold uppercase tracking-[0.1em] text-muted-foreground mb-2 px-1 flex items-center gap-1.5",children:[e("span",{"aria-hidden":"true",class:"text-primary/50",children:"//"}),n]}),e("div",{class:"rounded-none border border-border bg-card divide-y divide-border overflow-hidden border-l-2 border-l-primary/20",children:e("div",{class:"px-4",children:o})})]}),"Section"),b=t(({checked:o,onChange:n})=>e("button",{"aria-checked":o,class:h("relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-none border-2 border-transparent","transition-colors duration-200 ease-in-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",o?"bg-primary":"bg-foreground/15"),onClick:t(()=>n(!o),"onClick"),role:"switch",type:"button",children:e("span",{class:h("pointer-events-none inline-block h-4 w-4 shadow-sm","transition-all duration-200 ease-in-out",o?"translate-x-4 bg-primary-foreground":"translate-x-0 bg-white")})}),"Toggle"),O=t(({onChange:o,value:n})=>{const l=[{icon:e(v,{size:13,src:M}),label:"Light",value:"light"},{icon:e(v,{size:13,src:T}),label:"Dark",value:"dark"},{icon:e(v,{size:13,src:A}),label:"System",value:"system"}];return e("div",{class:"flex items-center gap-0.5 bg-foreground/6 p-0.5",children:l.map(a=>r("button",{"aria-pressed":n===a.value,class:h("flex items-center gap-1.5 px-2.5 py-1.5 text-[0.75rem] font-medium","transition-all duration-150 cursor-pointer border-0",n===a.value?"bg-background text-foreground shadow-sm":"bg-transparent text-muted-foreground hover:text-foreground"),onClick:t(()=>o(a.value),"onClick"),type:"button",children:[a.icon,a.label]},a.value))})},"ThemeControl"),R=[{label:"Never",value:-1},{label:"Always",value:0},{label:"2s",value:2e3},{label:"5s",value:5e3},{label:"10s",value:1e4},{label:"30s",value:3e4}],j=t(({onChange:o,value:n})=>e("select",{class:h("bg-foreground/6 border border-border","text-[0.775rem] font-medium text-foreground","px-2.5 py-1.5 cursor-pointer","focus:outline-none focus:ring-1 focus:ring-ring","transition-colors duration-150"),onChange:t(l=>o(Number(l.target.value)),"onChange"),value:String(n),children:R.map(l=>e("option",{value:String(l.value),children:l.label},l.value))}),"HideDelayControl"),K=[{label:"Auto-detected",value:""},{label:"AppCode",value:"appcode"},{label:"Android Studio",value:"android-studio"},{label:"Atom",value:"atom"},{label:"Atom Beta",value:"atom-beta"},{label:"Brackets",value:"brackets"},{label:"CLion",value:"clion"},{label:"Visual Studio Code",value:"code"},{label:"Visual Studio Code Insiders",value:"code-insiders"},{label:"VSCodium",value:"codium"},{label:"Cursor",value:"cursor"},{label:"GNU Emacs",value:"emacs"},{label:"GNU Emacs for Mac OS X",value:"emacsforosx"},{label:"IntelliJ IDEA",value:"intellij"},{label:"GNU nano",value:"nano"},{label:"NeoVim",value:"neovim"},{label:"Notepad++",value:"notepad++"},{label:"PhpStorm",value:"phpstorm"},{label:"PyCharm",value:"pycharm"},{label:"Rider",value:"rider"},{label:"RubyMine",value:"rubymine"},{label:"SublimeText",value:"sublime"},{label:"TextMate",value:"textmate"},{label:"Vim",value:"vim"},{label:"Visual Studio",value:"visualstudio"},{label:"WebStorm",value:"webstorm"},{label:"Xcode",value:"xcode"},{label:"Zed",value:"zed"}],N=t(({onChange:o,value:n})=>e("select",{class:h("bg-foreground/6 border border-border","text-[0.775rem] font-medium text-foreground","px-2.5 py-1.5 cursor-pointer","focus:outline-none focus:ring-1 focus:ring-ring","transition-colors duration-150"),onChange:t(l=>o(l.target.value),"onChange"),value:n,children:K.map(l=>e("option",{value:l.value,children:l.label},l.value))}),"EditorControl"),z=t(o=>o.split("+"),"formatBinding"),B=t(({part:o})=>e("span",{class:"inline-flex items-center px-1.5 py-0.5 text-[0.65rem] font-mono font-medium bg-foreground/8 border border-border text-foreground",children:o}),"KeyBadge"),x=t(({onChange:o,value:n})=>{const[l,a]=C(D(!1),"capturing"),m=C(y(null),"buttonRef");return w(()=>{if(!l)return;const i=t(s=>{if(s.preventDefault(),s.stopPropagation(),["Alt","Control","Meta","Shift"].includes(s.key))return;const u=[];s.altKey&&u.push("Alt"),s.ctrlKey&&u.push("Control"),s.metaKey&&u.push("Meta"),s.shiftKey&&u.push("Shift"),u.push(s.key),o(u.join("+")),a(!1)},"handleKeyDown");return globalThis.addEventListener("keydown",i,!0),()=>globalThis.removeEventListener("keydown",i,!0)},[l,o]),r("div",{class:"flex items-center gap-2",children:[e("div",{class:"flex items-center gap-0.5",children:z(n).map((i,s)=>r("span",{class:"flex items-center gap-0.5",children:[s>0&&e("span",{class:"text-muted-foreground/40 text-[0.6rem] mx-0.5",children:"+"}),e(B,{part:i})]},s))}),e(p,{class:h("text-[0.7rem]",l?"border-primary text-primary bg-primary/8 animate-pulse":""),onClick:t(()=>a(i=>!i),"onClick"),ref:m,size:"sm",variant:"outline",children:l?"Press keys…":"Record"}),e(p,{class:"text-[0.7rem]",onClick:t(()=>{a(!1)},"onClick"),size:"sm",title:"Cancel",variant:"ghost",children:"✕"})]})},"KeyCapture"),I=t(o=>{const{state:n,updateState:l}=E(),{setTheme:a,theme:m}=F();return r("div",{class:"p-5 space-y-5 max-w-2xl",children:[r(g,{title:"Appearance",children:[e(d,{control:e(O,{onChange:a,value:m}),description:"Color scheme for the DevTools panel.",label:"Theme"}),e(d,{control:e(b,{checked:n.reduceMotion,onChange:t(i=>l({reduceMotion:i}),"onChange")}),description:"Disable animations and transitions throughout the toolbar.",label:"Reduce motion"})]}),r(g,{title:"Toolbar",children:[e(d,{control:e(j,{onChange:t(i=>l({minimizePanelInactive:i}),"onChange"),value:n.minimizePanelInactive}),description:"Collapse the toolbar pill after a period of inactivity. Set 'Never' to always keep it visible.",label:"Auto-hide when inactive"}),e(d,{control:e(b,{checked:n.preferShowFloatingPanel,onChange:t(i=>l({preferShowFloatingPanel:i}),"onChange")}),description:"Keep the toolbar pill visible even when the DevTools panel is not open.",label:"Show toolbar when panel is closed"})]}),e(g,{title:"Panel",children:e(d,{control:e(b,{checked:n.closeOnOutsideClick,onChange:t(i=>l({closeOnOutsideClick:i}),"onChange")}),description:"Close the DevTools panel when clicking outside of it.",label:"Close on outside click"})}),e(g,{title:"Editor",children:e(d,{control:e(N,{onChange:t(i=>l({editor:i}),"onChange"),value:n.editor}),description:"Editor to open when clicking 'Open in editor'. Select Auto-detected to use the running IDE or EDITOR environment variable.",label:"Preferred editor"})}),r(g,{title:"Keyboard Shortcuts",children:[e(d,{control:r("div",{class:"flex items-center gap-2",children:[e(x,{onChange:t(i=>l({keybindings:{...n.keybindings??c,toggle:i}}),"onChange"),value:n.keybindings?.toggle??c.toggle}),n.keybindings?.toggle!==c.toggle&&e(p,{class:"h-auto p-0 text-[0.65rem]",onClick:t(()=>l({keybindings:{...n.keybindings??c,toggle:c.toggle}}),"onClick"),variant:"link",children:"Reset"})]}),description:"Open or close the DevTools panel.",label:"Toggle toolbar"}),e(d,{control:r("div",{class:"flex items-center gap-2",children:[e(x,{onChange:t(i=>l({keybindings:{...n.keybindings??c,close:i}}),"onChange"),value:n.keybindings?.close??c.close}),n.keybindings?.close!==c.close&&e(p,{class:"h-auto p-0 text-[0.65rem]",onClick:t(()=>l({keybindings:{...n.keybindings??c,close:c.close}}),"onClick"),variant:"link",children:"Reset"})]}),description:"Dismiss the active app or close the panel.",label:"Close panel"})]})]})},"SettingsApp"),Z={component:I,defaultOpen:!0,icon:S,id:"dev-toolbar:settings",name:"Settings"};export{Z as default};
@@ -1,7 +1,7 @@
1
- var Y=Object.defineProperty;var q=(r,n)=>Y(r,"name",{value:n,configurable:!0});import{addHookName as b}from"preact/devtools";import{useState as C,useRef as G,useMemo as J,useEffect as Z}from"preact/hooks";import S from"../../packem_shared/cn-DWLJYh3h.js";import{jsxs as s,jsx as e,Fragment as ee}from"preact/jsx-runtime";var te=Object.defineProperty,p=q((r,n)=>te(r,"name",{value:n,configurable:!0}),"p$1");const re=/^\w+-\d+$/,K=/-\d+$/,N=/-(\d+)$/,oe=/^--/,ne=p(r=>r.split(",").some(n=>{const o=n.trim();return o===":root"||o==="html"}),"isRootSelector"),se=p((r,n)=>{for(let o=0;o<r.length;o+=1){const l=r[o];if(l.startsWith("--")&&!l.startsWith("--tw-")&&!l.startsWith("--brand-")){const a=r.getPropertyValue(l).trim();a&&n.set(l,a)}}},"collectRootStyleVariables"),Q=p((r,n)=>{for(const o of r)o instanceof CSSStyleRule?ne(o.selectorText)&&se(o.style,n):"cssRules"in o&&o.cssRules instanceof CSSRuleList&&Q(o.cssRules,n)},"collectVariablesFromRules"),le=p(()=>{const r=new Map;for(const n of document.styleSheets)try{Q(n.cssRules,r)}catch{}return r},"scanRootVariables"),g=p(r=>r.endsWith("rem")?Number.parseFloat(r)*16:r.endsWith("px")?Number.parseFloat(r):r.endsWith("em")?Number.parseFloat(r)*16:0,"parseToPx"),ce=p(r=>{const n=[],o=[],l=[],a=[],m=[],h=[];for(const[d,i]of r)d.startsWith("--color-")?n.push({cssVar:d,name:d.slice(8),value:i}):d.startsWith("--spacing-")?o.push({cssVar:d,name:d.slice(10),numericPx:g(i),value:i}):d.startsWith("--text-")&&!d.includes("--line-height")&&!d.endsWith("--font-weight")?l.push({cssVar:d,name:d.slice(7),sizePx:g(i),value:i}):d.startsWith("--font-")?a.push({cssVar:d,name:d.slice(7),value:i}):d.startsWith("--radius-")?m.push({cssVar:d,name:d.slice(9),value:i}):(d.startsWith("--shadow-")||d.startsWith("--drop-shadow-"))&&h.push({cssVar:d,name:d.slice(2),value:i});const u=o.toSorted((d,i)=>d.numericPx-i.numericPx),v=l.toSorted((d,i)=>d.sizePx-i.sizePx);return{colors:n,fontFamilies:a,fontSizes:v,radii:m,shadows:h,spacing:u}},"extractTokens"),F=p(r=>re.test(r),"isNumericScale"),ie=p(r=>{const n=[],o=new Map;for(const l of r)if(F(l.name)){const a=l.name.replace(K,""),m=o.get(a)??[];m.push(l),o.set(a,m)}else n.push(l);for(const[l,a]of o)o.set(l,a.toSorted((m,h)=>{const u=Number.parseInt(m.name.match(N)?.[1]??"0",10),v=Number.parseInt(h.name.match(N)?.[1]??"0",10);return u-v}));return{scales:o,semantic:n}},"groupColors"),O=p(()=>{const[r,n]=b(C(!1),"copied"),o=b(G(null),"timer");return{copied:r,copy:p(l=>{navigator.clipboard.writeText(l).catch(()=>{}),n(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(n,1500,!1)},"copy")}},"useCopy"),W=p(({count:r,title:n})=>s("div",{class:"flex items-center gap-2 px-3 py-1.5 bg-foreground/3 border-b border-border/40",children:[s("span",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-muted-foreground/70",children:[e("span",{class:"text-primary/50",children:"// "}),n]}),r!==void 0&&r>0&&e("span",{class:"ml-auto text-[0.58rem] font-mono text-muted-foreground/50",children:r})]}),"SectionTitle"),ae=p(({token:r})=>{const{copied:n,copy:o}=O();return s("button",{class:"group flex items-center gap-2.5 w-full text-left hover:bg-foreground/4 px-3 py-1.5 transition-colors cursor-pointer bg-transparent border-0",onClick:p(()=>o(r.cssVar),"onClick"),title:`Click to copy ${r.cssVar}`,type:"button",children:[e("span",{class:"shrink-0 size-5 border border-black/10 dark:border-white/10",style:{background:`var(${r.cssVar})`}}),s("span",{class:"flex-1 min-w-0",children:[e("span",{class:"block text-[0.68rem] font-mono text-foreground truncate",children:r.name}),e("span",{class:"block text-[0.6rem] font-mono text-muted-foreground/60 truncate",children:r.value})]}),e("span",{class:S("text-[0.6rem] font-mono shrink-0 transition-opacity",n?"text-primary opacity-100":"text-muted-foreground/40 opacity-0 group-hover:opacity-100"),children:n?"copied!":"copy"})]})},"ColorItem"),de=p(({name:r,tokens:n})=>{const{copied:o,copy:l}=O();return s("div",{class:"px-3 py-2",children:[s("div",{class:"flex items-center gap-2 mb-1.5",children:[e("span",{class:"text-[0.65rem] font-mono text-muted-foreground/70 w-16 shrink-0",children:r}),e("div",{class:"flex flex-1 gap-px overflow-hidden",children:n.map(a=>e("button",{class:"flex-1 h-5 border-0 cursor-pointer transition-transform hover:scale-110 hover:z-10",onClick:p(()=>l(a.cssVar),"onClick"),style:{background:`var(${a.cssVar})`,minWidth:0},title:`${a.name}
1
+ var Y=Object.defineProperty;var q=(r,n)=>Y(r,"name",{value:n,configurable:!0});import{addHookName as b}from"preact/devtools";import{clsx as S}from"../../packem_shared/clsx-wGlvpUfw.js";import{useState as C,useRef as G,useMemo as J,useEffect as Z}from"preact/hooks";import{jsxs as s,jsx as e,Fragment as ee}from"preact/jsx-runtime";var te=Object.defineProperty,p=q((r,n)=>te(r,"name",{value:n,configurable:!0}),"p$1");const re=/^\w+-\d+$/,K=/-\d+$/,N=/-(\d+)$/,oe=/^--/,ne=p(r=>r.split(",").some(n=>{const o=n.trim();return o===":root"||o==="html"}),"isRootSelector"),se=p((r,n)=>{for(let o=0;o<r.length;o+=1){const l=r[o];if(l.startsWith("--")&&!l.startsWith("--tw-")&&!l.startsWith("--brand-")){const a=r.getPropertyValue(l).trim();a&&n.set(l,a)}}},"collectRootStyleVariables"),Q=p((r,n)=>{for(const o of r)o instanceof CSSStyleRule?ne(o.selectorText)&&se(o.style,n):"cssRules"in o&&o.cssRules instanceof CSSRuleList&&Q(o.cssRules,n)},"collectVariablesFromRules"),le=p(()=>{const r=new Map;for(const n of document.styleSheets)try{Q(n.cssRules,r)}catch{}return r},"scanRootVariables"),g=p(r=>r.endsWith("rem")?Number.parseFloat(r)*16:r.endsWith("px")?Number.parseFloat(r):r.endsWith("em")?Number.parseFloat(r)*16:0,"parseToPx"),ce=p(r=>{const n=[],o=[],l=[],a=[],m=[],h=[];for(const[d,i]of r)d.startsWith("--color-")?n.push({cssVar:d,name:d.slice(8),value:i}):d.startsWith("--spacing-")?o.push({cssVar:d,name:d.slice(10),numericPx:g(i),value:i}):d.startsWith("--text-")&&!d.includes("--line-height")&&!d.endsWith("--font-weight")?l.push({cssVar:d,name:d.slice(7),sizePx:g(i),value:i}):d.startsWith("--font-")?a.push({cssVar:d,name:d.slice(7),value:i}):d.startsWith("--radius-")?m.push({cssVar:d,name:d.slice(9),value:i}):(d.startsWith("--shadow-")||d.startsWith("--drop-shadow-"))&&h.push({cssVar:d,name:d.slice(2),value:i});const u=o.toSorted((d,i)=>d.numericPx-i.numericPx),v=l.toSorted((d,i)=>d.sizePx-i.sizePx);return{colors:n,fontFamilies:a,fontSizes:v,radii:m,shadows:h,spacing:u}},"extractTokens"),$=p(r=>re.test(r),"isNumericScale"),ie=p(r=>{const n=[],o=new Map;for(const l of r)if($(l.name)){const a=l.name.replace(K,""),m=o.get(a)??[];m.push(l),o.set(a,m)}else n.push(l);for(const[l,a]of o)o.set(l,a.toSorted((m,h)=>{const u=Number.parseInt(m.name.match(N)?.[1]??"0",10),v=Number.parseInt(h.name.match(N)?.[1]??"0",10);return u-v}));return{scales:o,semantic:n}},"groupColors"),O=p(()=>{const[r,n]=b(C(!1),"copied"),o=b(G(null),"timer");return{copied:r,copy:p(l=>{navigator.clipboard.writeText(l).catch(()=>{}),n(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(n,1500,!1)},"copy")}},"useCopy"),W=p(({count:r,title:n})=>s("div",{class:"flex items-center gap-2 px-3 py-1.5 bg-foreground/3 border-b border-border/40",children:[s("span",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-muted-foreground/70",children:[e("span",{class:"text-primary/50",children:"// "}),n]}),r!==void 0&&r>0&&e("span",{class:"ml-auto text-[0.58rem] font-mono text-muted-foreground/50",children:r})]}),"SectionTitle"),ae=p(({token:r})=>{const{copied:n,copy:o}=O();return s("button",{class:"group flex items-center gap-2.5 w-full text-left hover:bg-foreground/4 px-3 py-1.5 transition-colors cursor-pointer bg-transparent border-0",onClick:p(()=>o(r.cssVar),"onClick"),title:`Click to copy ${r.cssVar}`,type:"button",children:[e("span",{class:"shrink-0 size-5 border border-black/10 dark:border-white/10",style:{background:`var(${r.cssVar})`}}),s("span",{class:"flex-1 min-w-0",children:[e("span",{class:"block text-[0.68rem] font-mono text-foreground truncate",children:r.name}),e("span",{class:"block text-[0.6rem] font-mono text-muted-foreground/60 truncate",children:r.value})]}),e("span",{class:S("text-[0.6rem] font-mono shrink-0 transition-opacity",n?"text-primary opacity-100":"text-muted-foreground/40 opacity-0 group-hover:opacity-100"),children:n?"copied!":"copy"})]})},"ColorItem"),de=p(({name:r,tokens:n})=>{const{copied:o,copy:l}=O();return s("div",{class:"px-3 py-2",children:[s("div",{class:"flex items-center gap-2 mb-1.5",children:[e("span",{class:"text-[0.65rem] font-mono text-muted-foreground/70 w-16 shrink-0",children:r}),e("div",{class:"flex flex-1 gap-px overflow-hidden",children:n.map(a=>e("button",{class:"flex-1 h-5 border-0 cursor-pointer transition-transform hover:scale-110 hover:z-10",onClick:p(()=>l(a.cssVar),"onClick"),style:{background:`var(${a.cssVar})`,minWidth:0},title:`${a.name}
2
2
  ${a.value}
3
3
  Click to copy ${a.cssVar}`,type:"button"},a.cssVar))})]}),o&&e("span",{class:"text-[0.6rem] font-mono text-primary/70 pl-[72px]",children:"copied!"})]})},"ColorScaleRow"),pe=p(({colors:r})=>{const{scales:n,semantic:o}=b(J(()=>ie(r),[r]),"scales");return r.length===0?s("div",{class:"flex flex-col items-center justify-center py-16 gap-3 text-center px-6",children:[e("span",{class:"text-3xl text-muted-foreground/20",children:"◫"}),e("p",{class:"text-[0.75rem] text-muted-foreground/60",children:"No color tokens found"}),s("p",{class:"text-[0.65rem] text-muted-foreground/40 leading-relaxed",children:["Color tokens are read from ",e("code",{class:"font-mono",children:"--color-*"})," CSS variables on ",e("code",{class:"font-mono",children:":root"})]})]}):s("div",{children:[o.length>0&&s("div",{class:"border-b border-border/40",children:[e(W,{count:o.length,title:"Semantic"}),e("div",{class:"py-1",children:o.map(l=>e(ae,{token:l},l.cssVar))})]}),n.size>0&&s("div",{children:[e(W,{count:n.size,title:"Palette"}),e("div",{class:"py-1 divide-y divide-border/20",children:Array.from(n.entries(),([l,a])=>e(de,{name:l,tokens:a},l))})]})]})},"ColorsTab"),me=p(({spacing:r})=>{const n=b(J(()=>Math.max(...r.map(o=>o.numericPx),1),[r]),"maxPx");return r.length===0?s("div",{class:"flex flex-col items-center justify-center py-16 gap-3 text-center px-6",children:[e("span",{class:"text-3xl text-muted-foreground/20",children:"↔"}),e("p",{class:"text-[0.75rem] text-muted-foreground/60",children:"No spacing tokens found"}),s("p",{class:"text-[0.65rem] text-muted-foreground/40 leading-relaxed",children:["Spacing tokens are read from ",e("code",{class:"font-mono",children:"--spacing-*"})," CSS variables"]})]}):e("div",{class:"p-3 space-y-1",children:r.map(o=>{const l=n>0?Math.max(o.numericPx/n*100,2):2;return s("div",{class:"flex items-center gap-2.5",children:[e("span",{class:"text-[0.62rem] font-mono text-muted-foreground/70 w-8 shrink-0 text-right",children:o.name}),e("div",{class:"flex-1 flex items-center gap-1.5",children:e("div",{class:"flex-1 h-3.5 bg-foreground/5 border border-border/30 overflow-hidden",children:e("div",{class:"h-full bg-primary/30 border-r border-primary/40",style:{width:`${l}%`}})})}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 w-14 text-right shrink-0",children:o.value})]},o.cssVar)})})},"SpacingTab"),ue=p(({fontFamilies:r,fontSizes:n})=>n.length===0&&r.length===0?s("div",{class:"flex flex-col items-center justify-center py-16 gap-3 text-center px-6",children:[e("span",{class:"text-3xl text-muted-foreground/20",children:"Aa"}),e("p",{class:"text-[0.75rem] text-muted-foreground/60",children:"No typography tokens found"}),s("p",{class:"text-[0.65rem] text-muted-foreground/40 leading-relaxed",children:["Font size tokens are read from ",e("code",{class:"font-mono",children:"--text-*"})," and font family tokens from ",e("code",{class:"font-mono",children:"--font-*"})]})]}):s("div",{children:[n.length>0&&s("div",{class:"border-b border-border/40",children:[e(W,{count:n.length,title:"Font Sizes"}),e("div",{class:"p-3 space-y-1.5",children:n.map(o=>{const l=Math.min(o.sizePx||14,48);return s("div",{class:"flex items-center gap-3",children:[e("span",{class:"text-[0.6rem] font-mono text-muted-foreground/60 w-10 shrink-0 text-right",children:o.name}),e("span",{class:"text-foreground leading-none truncate flex-1",style:{fontSize:`${l}px`},children:"Ag"}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 shrink-0",children:o.value})]},o.cssVar)})})]}),r.length>0&&s("div",{children:[e(W,{count:r.length,title:"Font Families"}),e("div",{class:"p-3 space-y-2",children:r.map(o=>s("div",{class:"space-y-0.5",children:[e("div",{class:"flex items-center justify-between gap-2",children:e("code",{class:"text-[0.68rem] font-mono text-foreground",children:o.name})}),e("p",{class:"text-[0.75rem] text-foreground/70 truncate",style:{fontFamily:`var(${o.cssVar})`},children:"The quick brown fox"}),e("code",{class:"block text-[0.58rem] font-mono text-muted-foreground/50 truncate",children:o.value})]},o.cssVar))})]})]}),"TypographyTab"),fe=p(({radii:r,shadows:n})=>r.length===0&&n.length===0?s("div",{class:"flex flex-col items-center justify-center py-16 gap-3 text-center px-6",children:[e("span",{class:"text-3xl text-muted-foreground/20",children:"◻"}),e("p",{class:"text-[0.75rem] text-muted-foreground/60",children:"No effect tokens found"}),s("p",{class:"text-[0.65rem] text-muted-foreground/40 leading-relaxed",children:["Radius tokens from ",e("code",{class:"font-mono",children:"--radius-*"})," and shadow tokens from ",e("code",{class:"font-mono",children:"--shadow-*"})]})]}):s("div",{children:[r.length>0&&s("div",{class:"border-b border-border/40",children:[e(W,{count:r.length,title:"Border Radius"}),e("div",{class:"p-3 flex flex-wrap gap-3",children:r.map(o=>s("div",{class:"flex flex-col items-center gap-1.5",children:[e("div",{class:"size-10 border-2 border-primary/40 bg-primary/8",style:{borderRadius:`var(${o.cssVar})`}}),e("code",{class:"text-[0.6rem] font-mono text-muted-foreground/70",children:o.name}),e("code",{class:"text-[0.58rem] font-mono text-muted-foreground/50",children:o.value})]},o.cssVar))})]}),n.length>0&&s("div",{children:[e(W,{count:n.length,title:"Shadows"}),e("div",{class:"p-3 space-y-3",children:n.map(o=>s("div",{class:"space-y-1.5",children:[e("div",{class:"flex items-center justify-between gap-2",children:e("code",{class:"text-[0.68rem] font-mono text-foreground",children:o.name})}),e("div",{class:"h-10 bg-card border border-border/40",style:{boxShadow:`var(${o.cssVar})`}}),e("code",{class:"block text-[0.58rem] font-mono text-muted-foreground/50 truncate",children:o.value})]},o.cssVar))})]})]}),"EffectsTab"),he=p(({name:r,tokens:n})=>{const{copied:o,copy:l}=O();return s("div",{class:"px-3 py-2",children:[s("div",{class:"flex items-center gap-2 mb-1",children:[e("span",{class:"text-[0.65rem] font-mono text-muted-foreground/70 w-16 shrink-0",children:r}),e("div",{class:"flex flex-1 gap-px overflow-hidden",children:n.map(([a,m])=>e("button",{class:"flex-1 h-5 border-0 cursor-pointer transition-transform hover:scale-110 hover:z-10",onClick:p(()=>l(a),"onClick"),style:{background:m},title:`${a}
4
4
  ${m}
5
- Click to copy`,type:"button"},a))})]}),o&&e("span",{class:"text-[0.6rem] font-mono text-primary/70 pl-[72px]",children:"copied!"})]})},"ConfigColorScaleRow"),H=p(({cssVar:r,isCustom:n,value:o})=>{const{copied:l,copy:a}=O(),m=r.slice(8);return s("button",{class:"group flex items-center gap-2.5 w-full text-left hover:bg-foreground/4 px-3 py-1.5 transition-colors cursor-pointer bg-transparent border-0",onClick:p(()=>a(r),"onClick"),title:`Click to copy ${r}`,type:"button",children:[e("span",{class:"shrink-0 size-5 border border-black/10",style:{background:o}}),s("span",{class:"flex-1 min-w-0",children:[s("span",{class:"flex items-center gap-1.5",children:[e("span",{class:"text-[0.68rem] font-mono text-foreground truncate",children:m}),n&&e("span",{class:"text-[0.55rem] font-bold uppercase tracking-wide text-primary/70 bg-primary/10 px-1",children:"custom"})]}),e("span",{class:"block text-[0.6rem] font-mono text-muted-foreground/60 truncate",children:o})]}),e("span",{class:S("text-[0.6rem] font-mono shrink-0 transition-opacity",l?"text-primary opacity-100":"text-muted-foreground/40 opacity-0 group-hover:opacity-100"),children:l?"copied!":"copy"})]})},"ConfigSemanticColorItem"),x=p(({children:r,count:n,defaultOpen:o=!0,title:l})=>{const[a,m]=b(C(o),"open");return s("div",{class:"border-b border-border/40",children:[s("button",{class:"w-full flex items-center gap-2 px-3 py-1.5 bg-foreground/3 hover:bg-foreground/5 transition-colors cursor-pointer border-0 text-left",onClick:p(()=>m(h=>!h),"onClick"),type:"button",children:[s("span",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-muted-foreground/70 flex-1",children:[e("span",{class:"text-primary/50",children:"// "}),l]}),e("span",{class:"text-[0.58rem] font-mono text-muted-foreground/50",children:n}),e("span",{class:S("text-muted-foreground/40 text-[0.6rem] transition-transform duration-150 ml-1",a&&"rotate-90"),children:"▶"})]}),a&&r]})},"ConfigSection"),z=p(({cssVar:r,isCustom:n,value:o})=>{const{copied:l,copy:a}=O(),m=r.replace(oe,"");return s("button",{class:"group flex items-center gap-2.5 w-full text-left hover:bg-foreground/4 px-3 py-1.5 transition-colors cursor-pointer bg-transparent border-0",onClick:p(()=>a(r),"onClick"),type:"button",children:[e("span",{class:"flex-1 min-w-0",children:s("span",{class:"flex items-center gap-1.5",children:[e("code",{class:"text-[0.68rem] font-mono text-foreground truncate",children:m}),n&&e("span",{class:"text-[0.55rem] font-bold uppercase tracking-wide text-primary/70 bg-primary/10 px-1 shrink-0",children:"custom"})]})}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 truncate max-w-[160px] shrink-0",children:o}),e("span",{class:S("text-[0.6rem] font-mono shrink-0 transition-opacity w-8 text-right",l?"text-primary opacity-100":"text-muted-foreground/40 opacity-0 group-hover:opacity-100"),children:l?"✓":"copy"})]})},"ConfigTokenRow"),xe=p(({configData:r,error:n,loading:o,onRetry:l})=>{const[a,m]=b(C(""),"colorSearch");if(o)return s("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 select-none",children:[e("div",{"aria-hidden":"true",class:"flex gap-1.5 items-center",children:[0,160,320].map(t=>e("span",{class:"size-1.5 bg-primary/50 rounded-full animate-pulse",style:{animationDelay:`${t}ms`}},t))}),e("span",{class:"text-[0.75rem] text-muted-foreground",children:"Loading Tailwind config…"})]});if(n||!r)return s("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 text-center",children:[e("p",{class:"text-[0.8rem] text-destructive",children:n??"No config available"}),e("button",{class:"px-3 py-1.5 text-[0.75rem] border border-border text-muted-foreground hover:text-foreground cursor-pointer bg-transparent",onClick:l,type:"button",children:"Retry"})]});const{cssFiles:h,customTheme:u,defaultTheme:v,version:d}=r,i={...v,...u},j=Object.entries(i).filter(([t])=>t.startsWith("--color-")),w=j.filter(([t])=>!F(t.slice(8))),R=j.filter(([t])=>F(t.slice(8))),y=new Map;for(const[t,c]of R){const k=t.slice(8).replace(K,""),T=y.get(k)??[];T.push([t,c]),y.set(k,T)}for(const[t,c]of y)y.set(t,c.toSorted((k,T)=>{const _=Number.parseInt(k[0].match(N)?.[1]??"0",10),U=Number.parseInt(T[0].match(N)?.[1]??"0",10);return _-U}));const f=a?[...y.entries()].filter(([t])=>t.toLowerCase().includes(a.toLowerCase())):[...y.entries()],V=Object.entries(i).filter(([t])=>t.startsWith("--spacing-")).toSorted(([,t],[,c])=>g(t)-g(c)),P=Object.entries(i).filter(([t])=>t.startsWith("--font-")),M=Object.entries(i).filter(([t])=>t.startsWith("--text-")&&!t.includes("--line-height")&&!t.endsWith("--font-weight")).toSorted(([,t],[,c])=>g(t)-g(c)),I=Object.entries(i).filter(([t])=>t.startsWith("--breakpoint-")).toSorted(([,t],[,c])=>g(t)-g(c)),D=Object.entries(i).filter(([t])=>t.startsWith("--radius-")),A=Object.entries(i).filter(([t])=>t.startsWith("--shadow-")||t.startsWith("--drop-shadow-")),B=Object.entries(i).filter(([t])=>t.startsWith("--blur-")),E=Object.entries(i).filter(([t])=>t.startsWith("--animate-")),X=["--color-","--spacing-","--font-","--text-","--breakpoint-","--radius-","--shadow-","--drop-shadow-","--blur-","--animate-","--tw-","--brand-"],L=Object.entries(i).filter(([t])=>!X.some(c=>t.startsWith(c)));let $=1;for(const[,t]of V)$=Math.max($,g(t));return s("div",{children:[s("div",{class:"flex items-center gap-2 px-3 py-2 border-b border-border/40 bg-foreground/2 shrink-0",children:[e("span",{class:S("text-[0.6rem] font-bold uppercase tracking-wide px-1.5 py-0.5 shrink-0",d==="v4"&&"bg-cyan-500/10 text-cyan-600 dark:text-cyan-400 border border-cyan-500/20",d==="v3"&&"bg-primary/10 text-primary border border-primary/20",d==="unknown"&&"bg-foreground/8 text-muted-foreground border border-border"),children:d==="unknown"?"Tailwind":`Tailwind ${d}`}),h.length>0&&s("code",{class:"text-[0.62rem] font-mono text-muted-foreground/70 truncate flex-1",children:[h[0],h.length>1&&s("span",{class:"text-muted-foreground/40",children:[" +",h.length-1]})]}),s("span",{class:"text-[0.6rem] font-mono text-muted-foreground/50 shrink-0",children:[Object.keys(i).length," tokens"]})]}),Object.keys(u).length>0&&e(x,{count:Object.keys(u).length,title:"Custom Overrides",children:e("div",{class:"py-1",children:Object.entries(u).map(([t,c])=>t.startsWith("--color-")&&!F(t.slice(8))?e(H,{cssVar:t,isCustom:!0,value:c},t):e(z,{cssVar:t,isCustom:!0,value:c},t))})}),w.length>0&&e(x,{count:w.length,title:"Semantic Colors",children:e("div",{class:"py-1",children:w.map(([t,c])=>e(H,{cssVar:t,isCustom:t in u,value:c},t))})}),y.size>0&&s(x,{count:y.size,defaultOpen:!1,title:"Color Palette",children:[e("div",{class:"px-3 pt-2 pb-1 border-b border-border/20",children:e("input",{class:"w-full bg-foreground/4 border border-border/40 px-2 py-1 text-[0.68rem] font-mono text-foreground placeholder:text-muted-foreground/40 outline-none focus:border-primary/40",onInput:p(t=>m(t.target.value),"onInput"),placeholder:"Filter scales…",type:"text",value:a})}),s("div",{class:"py-1 divide-y divide-border/20",children:[f.map(([t,c])=>e(he,{name:t,tokens:c},t)),f.length===0&&e("p",{class:"text-center text-[0.7rem] text-muted-foreground/50 py-4",children:"No colors match"})]})]}),V.length>0&&e(x,{count:V.length,defaultOpen:!1,title:"Spacing",children:e("div",{class:"p-3 space-y-1",children:V.map(([t,c])=>{const k=g(c),T=$>0?Math.max(k/$*100,1):1;return s("div",{class:"flex items-center gap-2.5",children:[e("span",{class:"text-[0.62rem] font-mono text-muted-foreground/70 w-10 shrink-0 text-right",children:t.slice(10)}),e("div",{class:"flex-1 h-3 bg-foreground/5 border border-border/30 overflow-hidden",children:e("div",{class:"h-full bg-primary/30 border-r border-primary/40",style:{width:`${T}%`}})}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 w-14 text-right shrink-0",children:c})]},t)})})}),I.length>0&&e(x,{count:I.length,defaultOpen:!1,title:"Breakpoints",children:e("div",{class:"p-3 space-y-1.5",children:I.map(([t,c])=>e(z,{cssVar:t,isCustom:t in u,value:c},t))})}),P.length>0&&e(x,{count:P.length,defaultOpen:!1,title:"Font Families",children:e("div",{class:"p-3 space-y-2",children:P.map(([t,c])=>s("div",{class:"space-y-0.5",children:[e("code",{class:"text-[0.68rem] font-mono text-foreground",children:t.slice(7)}),e("p",{class:"text-[0.75rem] text-foreground/70 truncate",style:{fontFamily:c.startsWith("--theme(")?"inherit":c},children:"The quick brown fox"}),e("code",{class:"block text-[0.58rem] font-mono text-muted-foreground/50 truncate",children:c})]},t))})}),M.length>0&&e(x,{count:M.length,defaultOpen:!1,title:"Font Sizes",children:e("div",{class:"p-3 space-y-1.5",children:M.map(([t,c])=>{const k=Math.min(g(c)||14,48);return s("div",{class:"flex items-center gap-3",children:[e("span",{class:"text-[0.6rem] font-mono text-muted-foreground/60 w-12 shrink-0 text-right",children:t.slice(7)}),e("span",{class:"text-foreground leading-none truncate flex-1",style:{fontSize:`${k}px`},children:"Ag"}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 shrink-0",children:c})]},t)})})}),D.length>0&&e(x,{count:D.length,defaultOpen:!1,title:"Border Radius",children:e("div",{class:"p-3 flex flex-wrap gap-3",children:D.map(([t,c])=>s("div",{class:"flex flex-col items-center gap-1.5",children:[e("div",{class:"size-10 border-2 border-primary/40 bg-primary/8",style:{borderRadius:c.startsWith("--theme(")?"4px":c}}),e("code",{class:"text-[0.6rem] font-mono text-muted-foreground/70",children:t.slice(9)}),e("code",{class:"text-[0.58rem] font-mono text-muted-foreground/50",children:c})]},t))})}),A.length>0&&e(x,{count:A.length,defaultOpen:!1,title:"Shadows",children:e("div",{class:"p-3 space-y-3",children:A.map(([t,c])=>s("div",{class:"space-y-1",children:[e("code",{class:"text-[0.68rem] font-mono text-foreground",children:t.slice(2)}),!c.startsWith("--theme(")&&e("div",{class:"h-8 bg-card border border-border/40",style:{boxShadow:c}}),e("code",{class:"block text-[0.58rem] font-mono text-muted-foreground/50 truncate",children:c})]},t))})}),B.length>0&&e(x,{count:B.length,defaultOpen:!1,title:"Blur",children:e("div",{class:"py-1",children:B.map(([t,c])=>e(z,{cssVar:t,isCustom:t in u,value:c},t))})}),E.length>0&&e(x,{count:E.length,defaultOpen:!1,title:"Animations",children:e("div",{class:"py-1",children:E.map(([t,c])=>e(z,{cssVar:t,isCustom:t in u,value:c},t))})}),L.length>0&&e(x,{count:L.length,defaultOpen:!1,title:"Other",children:e("div",{class:"py-1",children:L.map(([t,c])=>e(z,{cssVar:t,isCustom:t in u,value:c},t))})})]})},"ConfigTab"),ge=p(()=>s("div",{class:"flex flex-col items-center justify-center h-full gap-4 py-16 px-8 text-center select-none",children:[e("div",{class:"size-12 border border-primary/20 bg-primary/5 flex items-center justify-center text-primary/30 text-2xl",children:"◻"}),s("div",{class:"space-y-1.5",children:[e("p",{class:"text-[0.8rem] font-medium text-foreground/70",children:"No design tokens detected"}),s("p",{class:"text-[0.7rem] text-muted-foreground leading-relaxed max-w-[240px]",children:["This app reads CSS custom properties from your page's ",e("code",{class:"font-mono text-[0.65rem]",children:":root"})," selector. Make sure your app uses Tailwind CSS v4 or defines custom properties."]})]})]}),"EmptyState"),be=p(({helpers:r})=>{const[n,o]=b(C("colors"),"tab"),[l,a]=b(C(void 0),"configData"),[m,h]=b(C(!1),"configLoading"),[u,v]=b(C(void 0),"configError"),d=b(G(void 0),"tokensRef");if(!d.current){const f=le();d.current=ce(f)}const i=d.current,j=p(()=>{h(!0),v(void 0),r.rpc.getTailwindConfig().then(f=>(a(f),h(!1),f)).catch(f=>{v(f.message??"Failed to load Tailwind config"),h(!1)})},"loadConfig");Z(()=>{n==="config"&&!l&&!m&&!u&&j()},[n]);const w=i.colors.length+i.spacing.length+i.fontSizes.length+i.radii.length,R={colors:i.colors.length,config:l?Object.keys(l.defaultTheme).length+Object.keys(l.customTheme).length:0,effects:i.radii.length+i.shadows.length,spacing:i.spacing.length,type:i.fontSizes.length+i.fontFamilies.length},y=[{id:"colors",label:"Colors"},{id:"spacing",label:"Spacing"},{id:"type",label:"Type"},{id:"effects",label:"Effects"},{id:"config",label:"Config"}];return s("div",{class:"flex flex-col h-full",children:[s("div",{class:"flex items-center justify-between gap-3 px-4 py-3 border-b border-border shrink-0",children:[e("span",{class:"text-[0.75rem] font-medium text-foreground",children:"Design Tokens"}),w>0&&s("span",{class:"text-[0.65rem] font-mono text-muted-foreground/60 bg-foreground/5 px-2 py-0.5 border border-border/40",children:[w," page tokens"]})]}),w===0&&n!=="config"?e(ge,{}):s(ee,{children:[e("div",{class:"flex border-b border-border shrink-0 overflow-x-auto",children:y.map(({id:f,label:V})=>s("button",{class:S("flex-shrink-0 px-3 py-2 text-[0.68rem] font-medium transition-colors cursor-pointer border-0 border-b-2 -mb-px",n===f?"text-primary border-primary bg-primary/4":"text-muted-foreground hover:text-foreground border-transparent bg-transparent"),onClick:p(()=>o(f),"onClick"),type:"button",children:[V,R[f]>0&&e("span",{class:S("ml-1.5 text-[0.58rem] font-mono",n===f?"text-primary/70":"text-muted-foreground/50"),children:R[f]})]},f))}),s("div",{class:"flex-1 overflow-auto devtools-content-scroll",children:[n==="colors"&&e(pe,{colors:i.colors}),n==="spacing"&&e(me,{spacing:i.spacing}),n==="type"&&e(ue,{fontFamilies:i.fontFamilies,fontSizes:i.fontSizes}),n==="effects"&&e(fe,{radii:i.radii,shadows:i.shadows}),n==="config"&&e(xe,{configData:l,error:u,loading:m,onRetry:j})]})]})]})},"TailwindApp"),ye=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 54 33">
5
+ Click to copy`,type:"button"},a))})]}),o&&e("span",{class:"text-[0.6rem] font-mono text-primary/70 pl-[72px]",children:"copied!"})]})},"ConfigColorScaleRow"),H=p(({cssVar:r,isCustom:n,value:o})=>{const{copied:l,copy:a}=O(),m=r.slice(8);return s("button",{class:"group flex items-center gap-2.5 w-full text-left hover:bg-foreground/4 px-3 py-1.5 transition-colors cursor-pointer bg-transparent border-0",onClick:p(()=>a(r),"onClick"),title:`Click to copy ${r}`,type:"button",children:[e("span",{class:"shrink-0 size-5 border border-black/10",style:{background:o}}),s("span",{class:"flex-1 min-w-0",children:[s("span",{class:"flex items-center gap-1.5",children:[e("span",{class:"text-[0.68rem] font-mono text-foreground truncate",children:m}),n&&e("span",{class:"text-[0.55rem] font-bold uppercase tracking-wide text-primary/70 bg-primary/10 px-1",children:"custom"})]}),e("span",{class:"block text-[0.6rem] font-mono text-muted-foreground/60 truncate",children:o})]}),e("span",{class:S("text-[0.6rem] font-mono shrink-0 transition-opacity",l?"text-primary opacity-100":"text-muted-foreground/40 opacity-0 group-hover:opacity-100"),children:l?"copied!":"copy"})]})},"ConfigSemanticColorItem"),x=p(({children:r,count:n,defaultOpen:o=!0,title:l})=>{const[a,m]=b(C(o),"open");return s("div",{class:"border-b border-border/40",children:[s("button",{class:"w-full flex items-center gap-2 px-3 py-1.5 bg-foreground/3 hover:bg-foreground/5 transition-colors cursor-pointer border-0 text-left",onClick:p(()=>m(h=>!h),"onClick"),type:"button",children:[s("span",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-muted-foreground/70 flex-1",children:[e("span",{class:"text-primary/50",children:"// "}),l]}),e("span",{class:"text-[0.58rem] font-mono text-muted-foreground/50",children:n}),e("span",{class:S("text-muted-foreground/40 text-[0.6rem] transition-transform duration-150 ml-1",a&&"rotate-90"),children:"▶"})]}),a&&r]})},"ConfigSection"),z=p(({cssVar:r,isCustom:n,value:o})=>{const{copied:l,copy:a}=O(),m=r.replace(oe,"");return s("button",{class:"group flex items-center gap-2.5 w-full text-left hover:bg-foreground/4 px-3 py-1.5 transition-colors cursor-pointer bg-transparent border-0",onClick:p(()=>a(r),"onClick"),type:"button",children:[e("span",{class:"flex-1 min-w-0",children:s("span",{class:"flex items-center gap-1.5",children:[e("code",{class:"text-[0.68rem] font-mono text-foreground truncate",children:m}),n&&e("span",{class:"text-[0.55rem] font-bold uppercase tracking-wide text-primary/70 bg-primary/10 px-1 shrink-0",children:"custom"})]})}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 truncate max-w-[160px] shrink-0",children:o}),e("span",{class:S("text-[0.6rem] font-mono shrink-0 transition-opacity w-8 text-right",l?"text-primary opacity-100":"text-muted-foreground/40 opacity-0 group-hover:opacity-100"),children:l?"✓":"copy"})]})},"ConfigTokenRow"),xe=p(({configData:r,error:n,loading:o,onRetry:l})=>{const[a,m]=b(C(""),"colorSearch");if(o)return s("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 select-none",children:[e("div",{"aria-hidden":"true",class:"flex gap-1.5 items-center",children:[0,160,320].map(t=>e("span",{class:"size-1.5 bg-primary/50 rounded-full animate-pulse",style:{animationDelay:`${t}ms`}},t))}),e("span",{class:"text-[0.75rem] text-muted-foreground",children:"Loading Tailwind config…"})]});if(n||!r)return s("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 text-center",children:[e("p",{class:"text-[0.8rem] text-destructive",children:n??"No config available"}),e("button",{class:"px-3 py-1.5 text-[0.75rem] border border-border text-muted-foreground hover:text-foreground cursor-pointer bg-transparent",onClick:l,type:"button",children:"Retry"})]});const{cssFiles:h,customTheme:u,defaultTheme:v,version:d}=r,i={...v,...u},j=Object.entries(i).filter(([t])=>t.startsWith("--color-")),w=j.filter(([t])=>!$(t.slice(8))),R=j.filter(([t])=>$(t.slice(8))),y=new Map;for(const[t,c]of R){const k=t.slice(8).replace(K,""),T=y.get(k)??[];T.push([t,c]),y.set(k,T)}for(const[t,c]of y)y.set(t,c.toSorted((k,T)=>{const _=Number.parseInt(k[0].match(N)?.[1]??"0",10),U=Number.parseInt(T[0].match(N)?.[1]??"0",10);return _-U}));const f=a?[...y.entries()].filter(([t])=>t.toLowerCase().includes(a.toLowerCase())):[...y.entries()],V=Object.entries(i).filter(([t])=>t.startsWith("--spacing-")).toSorted(([,t],[,c])=>g(t)-g(c)),P=Object.entries(i).filter(([t])=>t.startsWith("--font-")),M=Object.entries(i).filter(([t])=>t.startsWith("--text-")&&!t.includes("--line-height")&&!t.endsWith("--font-weight")).toSorted(([,t],[,c])=>g(t)-g(c)),I=Object.entries(i).filter(([t])=>t.startsWith("--breakpoint-")).toSorted(([,t],[,c])=>g(t)-g(c)),D=Object.entries(i).filter(([t])=>t.startsWith("--radius-")),A=Object.entries(i).filter(([t])=>t.startsWith("--shadow-")||t.startsWith("--drop-shadow-")),B=Object.entries(i).filter(([t])=>t.startsWith("--blur-")),E=Object.entries(i).filter(([t])=>t.startsWith("--animate-")),X=["--color-","--spacing-","--font-","--text-","--breakpoint-","--radius-","--shadow-","--drop-shadow-","--blur-","--animate-","--tw-","--brand-"],L=Object.entries(i).filter(([t])=>!X.some(c=>t.startsWith(c)));let F=1;for(const[,t]of V)F=Math.max(F,g(t));return s("div",{children:[s("div",{class:"flex items-center gap-2 px-3 py-2 border-b border-border/40 bg-foreground/2 shrink-0",children:[e("span",{class:S("text-[0.6rem] font-bold uppercase tracking-wide px-1.5 py-0.5 shrink-0",d==="v4"&&"bg-cyan-500/10 text-cyan-600 dark:text-cyan-400 border border-cyan-500/20",d==="v3"&&"bg-primary/10 text-primary border border-primary/20",d==="unknown"&&"bg-foreground/8 text-muted-foreground border border-border"),children:d==="unknown"?"Tailwind":`Tailwind ${d}`}),h.length>0&&s("code",{class:"text-[0.62rem] font-mono text-muted-foreground/70 truncate flex-1",children:[h[0],h.length>1&&s("span",{class:"text-muted-foreground/40",children:[" +",h.length-1]})]}),s("span",{class:"text-[0.6rem] font-mono text-muted-foreground/50 shrink-0",children:[Object.keys(i).length," tokens"]})]}),Object.keys(u).length>0&&e(x,{count:Object.keys(u).length,title:"Custom Overrides",children:e("div",{class:"py-1",children:Object.entries(u).map(([t,c])=>t.startsWith("--color-")&&!$(t.slice(8))?e(H,{cssVar:t,isCustom:!0,value:c},t):e(z,{cssVar:t,isCustom:!0,value:c},t))})}),w.length>0&&e(x,{count:w.length,title:"Semantic Colors",children:e("div",{class:"py-1",children:w.map(([t,c])=>e(H,{cssVar:t,isCustom:t in u,value:c},t))})}),y.size>0&&s(x,{count:y.size,defaultOpen:!1,title:"Color Palette",children:[e("div",{class:"px-3 pt-2 pb-1 border-b border-border/20",children:e("input",{class:"w-full bg-foreground/4 border border-border/40 px-2 py-1 text-[0.68rem] font-mono text-foreground placeholder:text-muted-foreground/40 outline-none focus:border-primary/40",onInput:p(t=>m(t.target.value),"onInput"),placeholder:"Filter scales…",type:"text",value:a})}),s("div",{class:"py-1 divide-y divide-border/20",children:[f.map(([t,c])=>e(he,{name:t,tokens:c},t)),f.length===0&&e("p",{class:"text-center text-[0.7rem] text-muted-foreground/50 py-4",children:"No colors match"})]})]}),V.length>0&&e(x,{count:V.length,defaultOpen:!1,title:"Spacing",children:e("div",{class:"p-3 space-y-1",children:V.map(([t,c])=>{const k=g(c),T=F>0?Math.max(k/F*100,1):1;return s("div",{class:"flex items-center gap-2.5",children:[e("span",{class:"text-[0.62rem] font-mono text-muted-foreground/70 w-10 shrink-0 text-right",children:t.slice(10)}),e("div",{class:"flex-1 h-3 bg-foreground/5 border border-border/30 overflow-hidden",children:e("div",{class:"h-full bg-primary/30 border-r border-primary/40",style:{width:`${T}%`}})}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 w-14 text-right shrink-0",children:c})]},t)})})}),I.length>0&&e(x,{count:I.length,defaultOpen:!1,title:"Breakpoints",children:e("div",{class:"p-3 space-y-1.5",children:I.map(([t,c])=>e(z,{cssVar:t,isCustom:t in u,value:c},t))})}),P.length>0&&e(x,{count:P.length,defaultOpen:!1,title:"Font Families",children:e("div",{class:"p-3 space-y-2",children:P.map(([t,c])=>s("div",{class:"space-y-0.5",children:[e("code",{class:"text-[0.68rem] font-mono text-foreground",children:t.slice(7)}),e("p",{class:"text-[0.75rem] text-foreground/70 truncate",style:{fontFamily:c.startsWith("--theme(")?"inherit":c},children:"The quick brown fox"}),e("code",{class:"block text-[0.58rem] font-mono text-muted-foreground/50 truncate",children:c})]},t))})}),M.length>0&&e(x,{count:M.length,defaultOpen:!1,title:"Font Sizes",children:e("div",{class:"p-3 space-y-1.5",children:M.map(([t,c])=>{const k=Math.min(g(c)||14,48);return s("div",{class:"flex items-center gap-3",children:[e("span",{class:"text-[0.6rem] font-mono text-muted-foreground/60 w-12 shrink-0 text-right",children:t.slice(7)}),e("span",{class:"text-foreground leading-none truncate flex-1",style:{fontSize:`${k}px`},children:"Ag"}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 shrink-0",children:c})]},t)})})}),D.length>0&&e(x,{count:D.length,defaultOpen:!1,title:"Border Radius",children:e("div",{class:"p-3 flex flex-wrap gap-3",children:D.map(([t,c])=>s("div",{class:"flex flex-col items-center gap-1.5",children:[e("div",{class:"size-10 border-2 border-primary/40 bg-primary/8",style:{borderRadius:c.startsWith("--theme(")?"4px":c}}),e("code",{class:"text-[0.6rem] font-mono text-muted-foreground/70",children:t.slice(9)}),e("code",{class:"text-[0.58rem] font-mono text-muted-foreground/50",children:c})]},t))})}),A.length>0&&e(x,{count:A.length,defaultOpen:!1,title:"Shadows",children:e("div",{class:"p-3 space-y-3",children:A.map(([t,c])=>s("div",{class:"space-y-1",children:[e("code",{class:"text-[0.68rem] font-mono text-foreground",children:t.slice(2)}),!c.startsWith("--theme(")&&e("div",{class:"h-8 bg-card border border-border/40",style:{boxShadow:c}}),e("code",{class:"block text-[0.58rem] font-mono text-muted-foreground/50 truncate",children:c})]},t))})}),B.length>0&&e(x,{count:B.length,defaultOpen:!1,title:"Blur",children:e("div",{class:"py-1",children:B.map(([t,c])=>e(z,{cssVar:t,isCustom:t in u,value:c},t))})}),E.length>0&&e(x,{count:E.length,defaultOpen:!1,title:"Animations",children:e("div",{class:"py-1",children:E.map(([t,c])=>e(z,{cssVar:t,isCustom:t in u,value:c},t))})}),L.length>0&&e(x,{count:L.length,defaultOpen:!1,title:"Other",children:e("div",{class:"py-1",children:L.map(([t,c])=>e(z,{cssVar:t,isCustom:t in u,value:c},t))})})]})},"ConfigTab"),ge=p(()=>s("div",{class:"flex flex-col items-center justify-center h-full gap-4 py-16 px-8 text-center select-none",children:[e("div",{class:"size-12 border border-primary/20 bg-primary/5 flex items-center justify-center text-primary/30 text-2xl",children:"◻"}),s("div",{class:"space-y-1.5",children:[e("p",{class:"text-[0.8rem] font-medium text-foreground/70",children:"No design tokens detected"}),s("p",{class:"text-[0.7rem] text-muted-foreground leading-relaxed max-w-[240px]",children:["This app reads CSS custom properties from your page's ",e("code",{class:"font-mono text-[0.65rem]",children:":root"})," selector. Make sure your app uses Tailwind CSS v4 or defines custom properties."]})]})]}),"EmptyState"),be=p(({helpers:r})=>{const[n,o]=b(C("colors"),"tab"),[l,a]=b(C(void 0),"configData"),[m,h]=b(C(!1),"configLoading"),[u,v]=b(C(void 0),"configError"),d=b(G(void 0),"tokensRef");if(!d.current){const f=le();d.current=ce(f)}const i=d.current,j=p(()=>{h(!0),v(void 0),r.rpc.getTailwindConfig().then(f=>(a(f),h(!1),f)).catch(f=>{v(f.message??"Failed to load Tailwind config"),h(!1)})},"loadConfig");Z(()=>{n==="config"&&!l&&!m&&!u&&j()},[n]);const w=i.colors.length+i.spacing.length+i.fontSizes.length+i.radii.length,R={colors:i.colors.length,config:l?Object.keys(l.defaultTheme).length+Object.keys(l.customTheme).length:0,effects:i.radii.length+i.shadows.length,spacing:i.spacing.length,type:i.fontSizes.length+i.fontFamilies.length},y=[{id:"colors",label:"Colors"},{id:"spacing",label:"Spacing"},{id:"type",label:"Type"},{id:"effects",label:"Effects"},{id:"config",label:"Config"}];return s("div",{class:"flex flex-col h-full",children:[s("div",{class:"flex items-center justify-between gap-3 px-4 py-3 border-b border-border shrink-0",children:[e("span",{class:"text-[0.75rem] font-medium text-foreground",children:"Design Tokens"}),w>0&&s("span",{class:"text-[0.65rem] font-mono text-muted-foreground/60 bg-foreground/5 px-2 py-0.5 border border-border/40",children:[w," page tokens"]})]}),w===0&&n!=="config"?e(ge,{}):s(ee,{children:[e("div",{class:"flex border-b border-border shrink-0 overflow-x-auto",children:y.map(({id:f,label:V})=>s("button",{class:S("flex-shrink-0 px-3 py-2 text-[0.68rem] font-medium transition-colors cursor-pointer border-0 border-b-2 -mb-px",n===f?"text-primary border-primary bg-primary/4":"text-muted-foreground hover:text-foreground border-transparent bg-transparent"),onClick:p(()=>o(f),"onClick"),type:"button",children:[V,R[f]>0&&e("span",{class:S("ml-1.5 text-[0.58rem] font-mono",n===f?"text-primary/70":"text-muted-foreground/50"),children:R[f]})]},f))}),s("div",{class:"flex-1 overflow-auto devtools-content-scroll",children:[n==="colors"&&e(pe,{colors:i.colors}),n==="spacing"&&e(me,{spacing:i.spacing}),n==="type"&&e(ue,{fontFamilies:i.fontFamilies,fontSizes:i.fontSizes}),n==="effects"&&e(fe,{radii:i.radii,shadows:i.shadows}),n==="config"&&e(xe,{configData:l,error:u,loading:m,onRetry:j})]})]})]})},"TailwindApp"),ye=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 54 33">
6
6
  <path fill-rule="evenodd" clip-rule="evenodd" d="M27 0c-7.2 0-11.7 3.6-13.5 10.8 2.7-3.6 5.85-4.95 9.45-4.05 2.054.513 3.522 2.004 5.147 3.653C30.744 13.09 33.808 16.2 40.5 16.2c7.2 0 11.7-3.6 13.5-10.8-2.7 3.6-5.85 4.95-9.45 4.05-2.054-.513-3.522-2.004-5.147-3.653C36.756 3.11 33.692 0 27 0zM13.5 16.2C6.3 16.2 1.8 19.8 0 27c2.7-3.6 5.85-4.95 9.45-4.05 2.054.514 3.522 2.004 5.147 3.653C17.244 29.29 20.308 32.4 27 32.4c7.2 0 11.7-3.6 13.5-10.8-2.7 3.6-5.85 4.95-9.45 4.05-2.054-.513-3.522-2.004-5.147-3.653C23.256 19.31 20.192 16.2 13.5 16.2z" fill="#06B6D4"/>
7
7
  </svg>`,Ve={component:be,icon:ye,id:"dev-toolbar:tailwind",name:"Design Tokens"};export{Ve as default};
@@ -1,4 +1,3 @@
1
- /** @jsxImportSource preact */
2
1
  import type { ComponentChildren } from "preact";
3
2
  import type { AppComponentProps } from "../../types/app.d.ts";
4
3
  declare const TailwindApp: ({ helpers }: AppComponentProps) => ComponentChildren;
@@ -1 +1,18 @@
1
- var M=Object.defineProperty;var x=(e,t)=>M(e,"name",{value:t,configurable:!0});import L from"lucide-static/icons/gantt-chart.svg?raw";import{m as y,D as z}from"../../packem_shared/store-DaUtLjf3.js";import{addHookName as b}from"preact/devtools";import{useState as w,useRef as A,useEffect as I}from"preact/hooks";import C from"../../packem_shared/cn-DWLJYh3h.js";import{jsx as i,jsxs as l}from"preact/jsx-runtime";import N from"../../packem_shared/Badge-C30mDKKG.js";import $ from"../../packem_shared/Button-DODNCTPZ.js";var O=Object.defineProperty,T=x((e,t)=>O(e,"name",{value:t,configurable:!0}),"d");const D="__visulima_timeline_capture__",f=T(e=>`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`,"generateId"),P=T(e=>e.startsWith("/@")||e.includes("/__vite")||e.includes("__visulima-dev-toolbar")||e.startsWith("data:")||e.startsWith("blob:"),"isViteInternalUrl"),F=T(()=>{if(globalThis[D])return;globalThis[D]=!0;const e=y();if(import.meta.hot&&(import.meta.hot.on("vite:beforeUpdate",t=>{const n=t,o=n.updates?.map(p=>p.path).join(", ")??"";e.addEvent("hmr",{data:{updates:n.updates},id:f("hmr"),level:"info",subtitle:o||void 0,time:Date.now(),title:"HMR Update"})}),import.meta.hot.on("vite:beforeFullReload",t=>{const n=t;e.addEvent("hmr",{id:f("hmr-reload"),level:"warning",subtitle:n.path??void 0,time:Date.now(),title:"Full Reload"})}),import.meta.hot.on("vite:error",t=>{const n=t,{err:o}=n;e.addEvent("errors",{data:o?{loc:o.loc,message:o.message,plugin:o.plugin,stack:o.stack}:void 0,id:f("vite-err"),level:"error",subtitle:o?.message??"Unknown error",time:Date.now(),title:"Vite Error"})})),globalThis.window!==void 0&&typeof globalThis.fetch=="function"){const t=globalThis.fetch.bind(globalThis);globalThis.fetch=async(...n)=>{const o=n[0],p=n[1],v=o instanceof URL?o.href:o.url,s=typeof o=="string"?o:v,c=(p?.method??(o instanceof Request?o.method:"GET")).toUpperCase();if(P(s))return t(...n);const u=Date.now();try{const a=await t(...n),h=Date.now()-u;return e.addEvent("network",{data:{method:c,status:a.status,statusText:a.statusText,url:s},duration:h,id:f("net"),level:a.ok?"info":"warning",subtitle:`${a.status} ${a.statusText}`,time:u,title:`${c} ${s}`}),a}catch(a){const h=Date.now()-u,g=a instanceof Error?a.message:"Network error";throw e.addEvent("network",{data:{error:g,method:c,url:s},duration:h,id:f("net-err"),level:"error",subtitle:g,time:u,title:`${c} ${s}`}),a}}}globalThis.window!==void 0&&(globalThis.addEventListener("error",t=>{t.filename?.includes("visulima-dev-toolbar")||e.addEvent("errors",{data:{colno:t.colno,filename:t.filename,lineno:t.lineno,message:t.message},id:f("err"),level:"error",subtitle:t.filename?`${t.filename}:${t.lineno}:${t.colno}`:void 0,time:Date.now(),title:t.message||"JavaScript Error"})}),globalThis.addEventListener("unhandledrejection",t=>{const{reason:n}=t,o=n instanceof Error?n.message:String(n??"Unhandled promise rejection");e.addEvent("errors",{data:{reason:String(n)},id:f("rej"),level:"error",subtitle:o,time:Date.now(),title:"Unhandled Promise Rejection"})}))},"startTimelineCapture");var G=Object.defineProperty,d=x((e,t)=>G(e,"name",{value:t,configurable:!0}),"i");const H=500,k="all",j=d(e=>new Date(e).toLocaleTimeString("en-US",{fractionalSecondDigits:3,hour:"2-digit",hour12:!1,minute:"2-digit",second:"2-digit"}),"formatTime"),W={error:"destructive",info:"info",warning:"warning"},S=d(({level:e})=>{if(e)return i(N,{class:"text-[0.6rem] uppercase tracking-wider",variant:W[e]??"info",children:e})},"LevelBadge"),q=d(({event:e,onClose:t})=>l("div",{class:"border-l border-border bg-background h-full flex flex-col min-w-0 w-80 shrink-0",children:[l("div",{class:"flex items-center justify-between gap-2 px-4 py-3 border-b border-border shrink-0",children:[i("span",{class:"text-[0.75rem] font-semibold text-foreground truncate",children:e.title}),i($,{"aria-label":"Close detail",class:"h-5 w-5 shrink-0",onClick:t,size:"icon",variant:"ghost",children:"✕"})]}),l("div",{class:"flex-1 overflow-auto p-4 space-y-3",children:[l("div",{class:"space-y-1",children:[i("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Time"}),i("div",{class:"text-[0.8rem] font-mono text-foreground",children:j(e.time)})]}),e.subtitle&&l("div",{class:"space-y-1",children:[i("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Subtitle"}),i("div",{class:"text-[0.8rem] text-foreground",children:e.subtitle})]}),e.duration!==void 0&&l("div",{class:"space-y-1",children:[i("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Duration"}),l("div",{class:"text-[0.8rem] font-mono text-foreground",children:[e.duration,"ms"]})]}),e.level&&l("div",{class:"space-y-1",children:[i("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Level"}),i(S,{level:e.level})]}),e.data&&Object.keys(e.data).length>0&&l("div",{class:"space-y-1",children:[i("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Data"}),i("pre",{class:"text-[0.7rem] font-mono text-foreground/80 bg-foreground/4 p-3 overflow-auto border border-border/50 whitespace-pre-wrap break-all",children:JSON.stringify(e.data,void 0,2)})]})]})]}),"EventDetail"),B=d(e=>{const[t,n]=b(w(k),"activeTab"),[o,p]=b(w([]),"groups"),[v,s]=b(w(void 0),"selectedEvent"),c=b(A(void 0),"intervalRef"),u=d(()=>{const r=y();p(r.getGroups().map(m=>({...m,events:[...m.events]})))},"refresh");I(()=>(u(),c.current=setInterval(u,H),()=>{c.current!==void 0&&clearInterval(c.current)}),[]);const a=new Map(z.map(r=>[r.id,r.color])),h=[{color:void 0,id:k,label:"All"},...o.map(r=>({color:a.get(r.id)??r.color,id:r.id,label:r.label}))],g=t===k?o.flatMap(r=>r.events).toSorted((r,m)=>r.time-m.time):o.find(r=>r.id===t)?.events??[],_=d(()=>{y().clearAll(),s(void 0),u()},"clearAll");return l("div",{class:"flex flex-col h-full",children:[l("div",{class:"flex items-center justify-between gap-2 px-4 py-2 border-b border-border shrink-0",children:[i("div",{class:"flex items-center gap-0 overflow-x-auto",children:h.map(r=>l("button",{class:C("px-3 py-1.5 text-[0.75rem] font-medium whitespace-nowrap border-0 cursor-pointer transition-colors duration-150",t===r.id?"text-foreground border-b-2 border-primary bg-transparent":"text-muted-foreground bg-transparent hover:text-foreground"),onClick:d(()=>{n(r.id),s(void 0)},"onClick"),type:"button",children:[r.color&&i("span",{class:"inline-block size-2 rounded-full mr-1.5 align-middle",style:{backgroundColor:r.color}}),r.label]},r.id))}),i($,{onClick:_,size:"sm",title:"Clear all events",variant:"outline",children:"Clear"})]}),l("div",{class:"flex flex-1 min-h-0 overflow-hidden",children:[i("div",{class:"flex-1 overflow-auto",children:g.length===0?l("div",{class:"flex flex-col items-center justify-center h-full gap-4 p-8 text-center select-none",children:[i("div",{class:"size-12 border border-border/50 bg-foreground/2 flex items-center justify-center",children:i("svg",{"aria-hidden":"true",class:"size-5 text-muted-foreground/40",fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",children:i("path",{d:"M12 6v6h4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z","stroke-linecap":"round","stroke-linejoin":"round"})})}),l("div",{class:"space-y-1",children:[i("p",{class:"text-[0.8rem] font-medium text-foreground/60",children:"No events recorded yet"}),i("p",{class:"text-[0.7rem] text-muted-foreground",children:"Events appear here as your app runs"}),i("p",{class:"text-[0.65rem] text-muted-foreground/50 mt-2 max-w-[240px] leading-relaxed",children:"HMR updates, network requests, and custom events are captured automatically"})]})]}):i("div",{class:"divide-y divide-border/50",children:g.map(r=>{const m=o.find(U=>U.events.some(R=>R.id===r.id)),E=a.get(m?.id??"")??m?.color;return l("button",{class:C("w-full flex items-start gap-3 px-4 py-3 text-left border-0 bg-transparent cursor-pointer","hover:bg-foreground/4 transition-colors duration-100",v?.id===r.id&&"bg-primary/6"),onClick:d(()=>s(v?.id===r.id?void 0:r),"onClick"),type:"button",children:[E&&i("span",{class:"mt-1 size-1.5 rounded-full shrink-0",style:{backgroundColor:E}}),l("div",{class:"flex-1 min-w-0",children:[l("div",{class:"flex items-center gap-2 flex-wrap",children:[i("span",{class:"text-[0.8rem] font-medium text-foreground truncate",children:r.title}),i(S,{level:r.level})]}),r.subtitle&&i("div",{class:"text-[0.725rem] text-muted-foreground truncate mt-0.5",children:r.subtitle})]}),i("span",{class:"text-[0.65rem] font-mono text-muted-foreground/70 shrink-0 mt-0.5",children:j(r.time)})]},r.id)})})}),v&&i(q,{event:v,onClose:d(()=>s(void 0),"onClose")})]})]})},"TimelineApp");F();const re={component:B,icon:L,id:"dev-toolbar:timeline",name:"Timeline"};export{re as default};
1
+ var R=Object.defineProperty;var x=(e,t)=>R(e,"name",{value:t,configurable:!0});import{m as y,D as L}from"../../packem_shared/store-DaUtLjf3.js";import{addHookName as b}from"preact/devtools";import{clsx as C}from"../../packem_shared/clsx-wGlvpUfw.js";import{useState as w,useRef as z,useEffect as I}from"preact/hooks";import{jsx as i,jsxs as l}from"preact/jsx-runtime";import A from"../../packem_shared/Badge-BEgU04nl.js";import D from"../../packem_shared/Button-Bkx66Co7.js";var N=Object.defineProperty,T=x((e,t)=>N(e,"name",{value:t,configurable:!0}),"d");const j="__visulima_timeline_capture__",f=T(e=>`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`,"generateId"),O=T(e=>e.startsWith("/@")||e.includes("/__vite")||e.includes("__visulima-dev-toolbar")||e.startsWith("data:")||e.startsWith("blob:"),"isViteInternalUrl"),P=T(()=>{if(globalThis[j])return;globalThis[j]=!0;const e=y();if(import.meta.hot&&(import.meta.hot.on("vite:beforeUpdate",t=>{const n=t,o=n.updates?.map(h=>h.path).join(", ")??"";e.addEvent("hmr",{data:{updates:n.updates},id:f("hmr"),level:"info",subtitle:o||void 0,time:Date.now(),title:"HMR Update"})}),import.meta.hot.on("vite:beforeFullReload",t=>{const n=t;e.addEvent("hmr",{id:f("hmr-reload"),level:"warning",subtitle:n.path??void 0,time:Date.now(),title:"Full Reload"})}),import.meta.hot.on("vite:error",t=>{const n=t,{err:o}=n;e.addEvent("errors",{data:o?{loc:o.loc,message:o.message,plugin:o.plugin,stack:o.stack}:void 0,id:f("vite-err"),level:"error",subtitle:o?.message??"Unknown error",time:Date.now(),title:"Vite Error"})})),globalThis.window!==void 0&&typeof globalThis.fetch=="function"){const t=globalThis.fetch.bind(globalThis);globalThis.fetch=async(...n)=>{const o=n[0],h=n[1],v=o instanceof URL?o.href:o.url,s=typeof o=="string"?o:v,c=(h?.method??(o instanceof Request?o.method:"GET")).toUpperCase();if(O(s))return t(...n);const u=Date.now();try{const a=await t(...n),p=Date.now()-u;return e.addEvent("network",{data:{method:c,status:a.status,statusText:a.statusText,url:s},duration:p,id:f("net"),level:a.ok?"info":"warning",subtitle:`${a.status} ${a.statusText}`,time:u,title:`${c} ${s}`}),a}catch(a){const p=Date.now()-u,g=a instanceof Error?a.message:"Network error";throw e.addEvent("network",{data:{error:g,method:c,url:s},duration:p,id:f("net-err"),level:"error",subtitle:g,time:u,title:`${c} ${s}`}),a}}}globalThis.window!==void 0&&(globalThis.addEventListener("error",t=>{t.filename?.includes("visulima-dev-toolbar")||e.addEvent("errors",{data:{colno:t.colno,filename:t.filename,lineno:t.lineno,message:t.message},id:f("err"),level:"error",subtitle:t.filename?`${t.filename}:${t.lineno}:${t.colno}`:void 0,time:Date.now(),title:t.message||"JavaScript Error"})}),globalThis.addEventListener("unhandledrejection",t=>{const{reason:n}=t,o=n instanceof Error?n.message:String(n??"Unhandled promise rejection");e.addEvent("errors",{data:{reason:String(n)},id:f("rej"),level:"error",subtitle:o,time:Date.now(),title:"Unhandled Promise Rejection"})}))},"startTimelineCapture"),B=`<!-- @license lucide-static v0.577.0 - ISC -->
2
+ <svg
3
+ class="lucide lucide-gantt-chart"
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ width="24"
6
+ height="24"
7
+ viewBox="0 0 24 24"
8
+ fill="none"
9
+ stroke="currentColor"
10
+ stroke-width="2"
11
+ stroke-linecap="round"
12
+ stroke-linejoin="round"
13
+ >
14
+ <path d="M6 5h12" />
15
+ <path d="M4 12h10" />
16
+ <path d="M12 19h8" />
17
+ </svg>
18
+ `;var F=Object.defineProperty,d=x((e,t)=>F(e,"name",{value:t,configurable:!0}),"i");const G=500,k="all",S=d(e=>new Date(e).toLocaleTimeString("en-US",{fractionalSecondDigits:3,hour:"2-digit",hour12:!1,minute:"2-digit",second:"2-digit"}),"formatTime"),H={error:"destructive",info:"info",warning:"warning"},$=d(({level:e})=>{if(e)return i(A,{class:"text-[0.6rem] uppercase tracking-wider",variant:H[e]??"info",children:e})},"LevelBadge"),W=d(({event:e,onClose:t})=>l("div",{class:"border-l border-border bg-background h-full flex flex-col min-w-0 w-80 shrink-0",children:[l("div",{class:"flex items-center justify-between gap-2 px-4 py-3 border-b border-border shrink-0",children:[i("span",{class:"text-[0.75rem] font-semibold text-foreground truncate",children:e.title}),i(D,{"aria-label":"Close detail",class:"h-5 w-5 shrink-0",onClick:t,size:"icon",variant:"ghost",children:"✕"})]}),l("div",{class:"flex-1 overflow-auto p-4 space-y-3",children:[l("div",{class:"space-y-1",children:[i("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Time"}),i("div",{class:"text-[0.8rem] font-mono text-foreground",children:S(e.time)})]}),e.subtitle&&l("div",{class:"space-y-1",children:[i("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Subtitle"}),i("div",{class:"text-[0.8rem] text-foreground",children:e.subtitle})]}),e.duration!==void 0&&l("div",{class:"space-y-1",children:[i("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Duration"}),l("div",{class:"text-[0.8rem] font-mono text-foreground",children:[e.duration,"ms"]})]}),e.level&&l("div",{class:"space-y-1",children:[i("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Level"}),i($,{level:e.level})]}),e.data&&Object.keys(e.data).length>0&&l("div",{class:"space-y-1",children:[i("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Data"}),i("pre",{class:"text-[0.7rem] font-mono text-foreground/80 bg-foreground/4 p-3 overflow-auto border border-border/50 whitespace-pre-wrap break-all",children:JSON.stringify(e.data,void 0,2)})]})]})]}),"EventDetail"),q=d(e=>{const[t,n]=b(w(k),"activeTab"),[o,h]=b(w([]),"groups"),[v,s]=b(w(void 0),"selectedEvent"),c=b(z(void 0),"intervalRef"),u=d(()=>{const r=y();h(r.getGroups().map(m=>({...m,events:[...m.events]})))},"refresh");I(()=>(u(),c.current=setInterval(u,G),()=>{c.current!==void 0&&clearInterval(c.current)}),[]);const a=new Map(L.map(r=>[r.id,r.color])),p=[{color:void 0,id:k,label:"All"},...o.map(r=>({color:a.get(r.id)??r.color,id:r.id,label:r.label}))],g=t===k?o.flatMap(r=>r.events).toSorted((r,m)=>r.time-m.time):o.find(r=>r.id===t)?.events??[],M=d(()=>{y().clearAll(),s(void 0),u()},"clearAll");return l("div",{class:"flex flex-col h-full",children:[l("div",{class:"flex items-center justify-between gap-2 px-4 py-2 border-b border-border shrink-0",children:[i("div",{class:"flex items-center gap-0 overflow-x-auto",children:p.map(r=>l("button",{class:C("px-3 py-1.5 text-[0.75rem] font-medium whitespace-nowrap border-0 cursor-pointer transition-colors duration-150",t===r.id?"text-foreground border-b-2 border-primary bg-transparent":"text-muted-foreground bg-transparent hover:text-foreground"),onClick:d(()=>{n(r.id),s(void 0)},"onClick"),type:"button",children:[r.color&&i("span",{class:"inline-block size-2 rounded-full mr-1.5 align-middle",style:{backgroundColor:r.color}}),r.label]},r.id))}),i(D,{onClick:M,size:"sm",title:"Clear all events",variant:"outline",children:"Clear"})]}),l("div",{class:"flex flex-1 min-h-0 overflow-hidden",children:[i("div",{class:"flex-1 overflow-auto",children:g.length===0?l("div",{class:"flex flex-col items-center justify-center h-full gap-4 p-8 text-center select-none",children:[i("div",{class:"size-12 border border-border/50 bg-foreground/2 flex items-center justify-center",children:i("svg",{"aria-hidden":"true",class:"size-5 text-muted-foreground/40",fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",children:i("path",{d:"M12 6v6h4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z","stroke-linecap":"round","stroke-linejoin":"round"})})}),l("div",{class:"space-y-1",children:[i("p",{class:"text-[0.8rem] font-medium text-foreground/60",children:"No events recorded yet"}),i("p",{class:"text-[0.7rem] text-muted-foreground",children:"Events appear here as your app runs"}),i("p",{class:"text-[0.65rem] text-muted-foreground/50 mt-2 max-w-[240px] leading-relaxed",children:"HMR updates, network requests, and custom events are captured automatically"})]})]}):i("div",{class:"divide-y divide-border/50",children:g.map(r=>{const m=o.find(_=>_.events.some(U=>U.id===r.id)),E=a.get(m?.id??"")??m?.color;return l("button",{class:C("w-full flex items-start gap-3 px-4 py-3 text-left border-0 bg-transparent cursor-pointer","hover:bg-foreground/4 transition-colors duration-100",v?.id===r.id&&"bg-primary/6"),onClick:d(()=>s(v?.id===r.id?void 0:r),"onClick"),type:"button",children:[E&&i("span",{class:"mt-1 size-1.5 rounded-full shrink-0",style:{backgroundColor:E}}),l("div",{class:"flex-1 min-w-0",children:[l("div",{class:"flex items-center gap-2 flex-wrap",children:[i("span",{class:"text-[0.8rem] font-medium text-foreground truncate",children:r.title}),i($,{level:r.level})]}),r.subtitle&&i("div",{class:"text-[0.725rem] text-muted-foreground truncate mt-0.5",children:r.subtitle})]}),i("span",{class:"text-[0.65rem] font-mono text-muted-foreground/70 shrink-0 mt-0.5",children:S(r.time)})]},r.id)})})}),v&&i(W,{event:v,onClose:d(()=>s(void 0),"onClose")})]})]})},"TimelineApp");P();const te={component:q,icon:B,id:"dev-toolbar:timeline",name:"Timeline"};export{te as default};
@@ -1,4 +1,3 @@
1
- /** @jsxImportSource preact */
2
1
  import type { ComponentChildren } from "preact";
3
2
  import type { AppComponentProps } from "../../types/app.d.ts";
4
3
  declare const TimelineApp: (_props: AppComponentProps) => ComponentChildren;
@@ -1 +1,16 @@
1
- var h=Object.defineProperty;var b=(t,e)=>h(t,"name",{value:e,configurable:!0});import v from"lucide-static/icons/zap.svg?raw";import{addHookName as d}from"preact/devtools";import{useState as c,useEffect as y}from"preact/hooks";import x from"../../packem_shared/cn-DWLJYh3h.js";import{jsx as r,jsxs as o}from"preact/jsx-runtime";import g from"../../packem_shared/Button-DODNCTPZ.js";import C from"../../packem_shared/Badge-C30mDKKG.js";var k=Object.defineProperty,l=b((t,e)=>k(t,"name",{value:e,configurable:!0}),"i");const w=l(({text:t})=>{const[e,n]=d(c(!1),"copied"),i=l(()=>{navigator.clipboard.writeText(t).then(()=>{n(!0),setTimeout(n,1500,!1)}).catch(()=>{})},"copy");return r(g,{class:x(e?"border-primary/40 text-primary bg-primary/8":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/30","text-[0.65rem]"),onClick:i,size:"sm",title:"Copy to clipboard",variant:"outline",children:e?"Copied!":"Copy"})},"CopyButton"),m=l(({data:t,defaultOpen:e=!0,title:n})=>{const[i,f]=d(c(e),"open"),p=JSON.stringify(t,void 0,2);return o("section",{class:"border border-border",children:[o("button",{class:"w-full flex items-center justify-between gap-2 px-4 py-3 bg-foreground/3 hover:bg-foreground/6 transition-colors cursor-pointer border-0 text-left",onClick:l(()=>f(s=>!s),"onClick"),type:"button",children:[r("span",{class:"text-[0.75rem] font-semibold text-foreground uppercase tracking-wide",children:n}),o("div",{class:"flex items-center gap-2",children:[r(w,{text:p}),r("span",{class:x("text-muted-foreground text-[0.7rem] transition-transform duration-200",i&&"rotate-90"),children:"▶"})]})]}),i&&r("pre",{class:"text-[0.7rem] font-mono text-foreground/80 bg-transparent p-4 overflow-auto whitespace-pre-wrap break-all border-t border-border",children:p})]})},"Section"),j=l(({helpers:t})=>{const[e,n]=d(c(void 0),"config"),[i,f]=d(c(void 0),"error"),[p,s]=d(c(!0),"loading"),u=l(()=>{s(!0),f(void 0),t.rpc.getViteConfig().then(a=>{n(a),s(!1)}).catch(a=>{f(a.message??"Failed to load Vite config"),s(!1)})},"load");return y(()=>{u()},[]),p?o("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 select-none",children:[r("div",{"aria-hidden":"true",class:"flex gap-1.5 items-center",children:[0,160,320].map(a=>r("span",{class:"size-1.5 bg-primary/50 rounded-full animate-pulse",style:{animationDelay:`${a}ms`}},a))}),r("span",{class:"text-[0.75rem] text-muted-foreground",children:"Loading Vite config…"})]}):i||!e?o("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 text-center",children:[r("p",{class:"text-[0.8rem] text-destructive",children:i??"No config available"}),r(g,{onClick:u,size:"sm",variant:"outline",children:"Retry"})]}):o("div",{class:"p-5 space-y-4",children:[o("div",{class:"flex items-center gap-2 flex-wrap",children:[e.mode&&r(C,{class:"uppercase tracking-wider",variant:"default",children:e.mode}),e.root&&r("code",{class:"text-[0.7rem] font-mono text-muted-foreground bg-foreground/5 px-2 py-1 border border-border/50",children:e.root}),e.base&&e.base!=="/"&&o("code",{class:"text-[0.7rem] font-mono text-muted-foreground bg-foreground/5 px-2 py-1 border border-border/50",children:["base: ",e.base]}),r(g,{class:"ml-auto",onClick:u,size:"sm",variant:"outline",children:"Refresh"})]}),e.server&&r(m,{data:e.server,defaultOpen:!0,title:"Server"}),e.build&&r(m,{data:e.build,defaultOpen:!1,title:"Build"}),e.resolve&&r(m,{data:e.resolve,defaultOpen:!1,title:"Resolve / Alias"})]})},"ViteConfigApp"),T={component:j,icon:v,id:"dev-toolbar:vite-config",name:"Vite Config"};export{T as default};
1
+ var O=Object.defineProperty;var F=(t,e)=>O(t,"name",{value:e,configurable:!0});import{addHookName as p}from"preact/devtools";import{clsx as m}from"../../packem_shared/clsx-wGlvpUfw.js";import{useState as x,useRef as $,useEffect as P}from"preact/hooks";import k from"../../packem_shared/Icon-B6UHkC0o.js";import{jsxs as l,jsx as r}from"preact/jsx-runtime";import R from"../../packem_shared/Button-Bkx66Co7.js";import L from"../../packem_shared/Input-Cs6aduTi.js";import{Tooltip as B,TooltipTrigger as M,TooltipContent as I}from"../../packem_shared/Tooltip-BHmzUaxu.js";import D from"../../packem_shared/Badge-BEgU04nl.js";import{Tabs as N,TabsList as H,TabsTrigger as J,TabsContent as v}from"../../packem_shared/Tabs-SuFWbB6d.js";const K=`<!-- @license lucide-static v0.577.0 - ISC -->
2
+ <svg
3
+ class="lucide lucide-zap"
4
+ xmlns="http://www.w3.org/2000/svg"
5
+ width="24"
6
+ height="24"
7
+ viewBox="0 0 24 24"
8
+ fill="none"
9
+ stroke="currentColor"
10
+ stroke-width="2"
11
+ stroke-linecap="round"
12
+ stroke-linejoin="round"
13
+ >
14
+ <path d="M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z" />
15
+ </svg>
16
+ `,A="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-eye%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M2.062%2012.348a1%201%200%200%201%200-.696%2010.75%2010.75%200%200%201%2019.876%200%201%201%200%200%201%200%20.696%2010.75%2010.75%200%200%201-19.876%200%22%20%2F%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22%20%2F%3E%20%3C%2Fsvg%3E",T="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-eye-off%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M10.733%205.076a10.744%2010.744%200%200%201%2011.205%206.575%201%201%200%200%201%200%20.696%2010.747%2010.747%200%200%201-1.444%202.49%22%20%2F%3E%20%3Cpath%20d%3D%22M14.084%2014.158a3%203%200%200%201-4.242-4.242%22%20%2F%3E%20%3Cpath%20d%3D%22M17.479%2017.499a10.75%2010.75%200%200%201-15.417-5.151%201%201%200%200%201%200-.696%2010.75%2010.75%200%200%201%204.446-5.143%22%20%2F%3E%20%3Cpath%20d%3D%22m2%202%2020%2020%22%20%2F%3E%20%3C%2Fsvg%3E",W="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-search%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22m21%2021-4.34-4.34%22%20%2F%3E%20%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%228%22%20%2F%3E%20%3C%2Fsvg%3E";var q=Object.defineProperty,a=F((t,e)=>q(t,"name",{value:e,configurable:!0}),"s");const d=a(({children:t,title:e})=>l("section",{class:"space-y-1.5",children:[e&&l("h3",{class:"text-xxs font-bold uppercase tracking-widest text-muted-foreground px-1 flex items-center gap-1.5",children:[r("span",{"aria-hidden":"true",class:"text-primary opacity-50",children:"//"}),e]}),r("div",{class:"rounded-none border border-border bg-card divide-y divide-border overflow-hidden border-l-2 border-l-primary/20",children:t})]}),"Section"),C=a(({text:t})=>{const[e,n]=p(x(!1),"copied"),s=a(()=>{navigator.clipboard.writeText(t).then(()=>{n(!0),setTimeout(n,1500,!1)}).catch(()=>{})},"copy");return r("button",{class:m("inline-flex items-center px-1.5 py-0.5 text-xxs font-mono border transition-colors duration-150 cursor-pointer",e?"border-primary text-primary bg-card":"border-border text-muted-foreground hover:text-foreground hover:border-foreground bg-transparent"),onClick:s,title:"Copy to clipboard",type:"button",children:e?"copied":"copy"})},"CopyButton"),G=a(({value:t})=>l("span",{class:"inline-flex items-center gap-1.5",children:[r("span",{"aria-hidden":"true",class:m("inline-block size-1.5 rounded-full",t?"bg-success":"bg-border")}),r("span",{class:m("text-xs font-mono font-medium",t?"text-success":"text-muted-foreground"),children:t?"true":"false"})]}),"BoolValue"),U=a(({items:t})=>t.length===0?r("span",{class:"text-muted-foreground text-xs italic opacity-50",children:"empty"}):r("div",{class:"flex flex-wrap gap-1",children:t.map(e=>r("span",{class:"inline-flex items-center px-1.5 py-0.5 text-xxs font-mono font-medium bg-secondary border border-border text-secondary-foreground",children:e},e))}),"TagList"),z=a(({path:t})=>{const e=t.replaceAll("\\","/").split("/").filter(Boolean),n=e.length>3?`…/${e.slice(-3).join("/")}`:t;return r("code",{class:"text-xs font-mono text-foreground break-all leading-relaxed",title:t,children:n})},"ShortPath"),V=/^\/|^[A-Z]:\\/i,Z=a(({value:t})=>{if(t==null)return r("span",{class:"text-muted-foreground text-xs opacity-40",children:"—"});if(typeof t=="boolean")return r(G,{value:t});if(Array.isArray(t))return r(U,{items:t.map(String)});if(typeof t=="object"){const n=JSON.stringify(t,void 0,2);return l("div",{class:"flex items-start gap-2",children:[r("pre",{class:"text-xs font-mono text-foreground bg-secondary border border-border px-2 py-1 overflow-auto max-h-24 flex-1 leading-relaxed",children:n}),r(C,{text:n})]})}const e=String(t);return V.test(e)&&e.length>40?r(z,{path:e}):r("code",{class:"text-xs font-mono text-foreground break-all leading-relaxed",children:e})},"ValueCell"),o=a(({label:t,value:e})=>{if(e!=null)return l("div",{class:"grid grid-cols-2 gap-4 px-4 py-1.5 hover:bg-secondary transition-colors duration-100",children:[r("span",{class:"text-xs text-muted-foreground font-mono select-none self-center",children:t}),r("div",{class:"text-xs min-w-0 self-center",children:r(Z,{value:e})})]})},"KVRow"),Q=a(()=>l("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 select-none",children:[r("div",{"aria-hidden":"true",class:"flex gap-1.5 items-center",children:[0,160,320].map(t=>r("span",{class:"size-1.5 bg-primary rounded-full animate-pulse opacity-50",style:{animationDelay:`${t}ms`}},t))}),r("span",{class:"text-xs text-muted-foreground",children:"Loading Vite config…"})]}),"LoadingState"),X=a(({error:t,onRetry:e})=>l("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 text-center",children:[r("p",{class:"text-sm text-destructive",children:t}),r(R,{onClick:e,size:"sm",variant:"outline",children:"Retry"})]}),"ErrorState"),Y={post:"bg-blue-500/15 text-blue-400 border-blue-500/30",pre:"bg-amber-500/15 text-amber-400 border-amber-500/30"},_=a(({index:t,plugin:e})=>l("div",{class:"flex items-center gap-3 px-4 py-1.5 hover:bg-secondary transition-colors duration-100",children:[r("span",{class:"text-xxs text-muted-foreground font-mono tabular-nums w-5 shrink-0 text-right select-none opacity-40",children:t+1}),r("span",{class:"text-xs font-mono text-foreground flex-1 truncate",children:e.name}),e.enforce?r("span",{class:m("text-xxs font-mono font-bold px-1.5 py-0.5 border uppercase tracking-wide",Y[e.enforce]),children:e.enforce}):r("span",{class:"text-xxs font-mono text-muted-foreground px-1.5 py-0.5 bg-secondary border border-border",children:"normal"})]}),"PluginRow"),ee=a(({plugins:t})=>{const[e,n]=p(x(""),"query"),s=p($(null),"inputRef"),c=e?t.filter(i=>i.name.toLowerCase().includes(e.toLowerCase())):t;return l(d,{children:[l("div",{class:"flex items-center gap-2 px-4 py-1.5 bg-secondary border-b border-border",children:[r("span",{class:"text-xxs font-bold uppercase tracking-widest text-muted-foreground w-6 shrink-0",children:"#"}),l("div",{class:"flex-1 flex items-center gap-2",children:[r(k,{class:"text-muted-foreground shrink-0",size:11,src:W}),r(L,{class:"h-5 text-xs bg-transparent border-0 border-b border-border rounded-none px-0 py-0 focus-visible:ring-0 focus-visible:border-foreground placeholder:text-muted-foreground",onInput:a(i=>n(i.target.value),"onInput"),placeholder:`filter ${t.length} plugins…`,ref:s,type:"search",value:e})]}),r("span",{class:"text-xxs font-bold uppercase tracking-widest text-muted-foreground w-14 text-right",children:"Enforce"})]}),c.length===0?l("div",{class:"px-4 py-6 text-center text-xs text-muted-foreground",children:['No plugins match "',e,'"']}):c.map(i=>r(_,{index:t.indexOf(i),plugin:i},i.name)),e&&c.length>0&&r("div",{class:"px-4 py-1.5 bg-secondary border-t border-border text-right",children:l("span",{class:"text-xxs text-muted-foreground",children:[c.length," of ",t.length]})})]})},"PluginList"),E="text-xxs font-bold uppercase tracking-widest text-muted-foreground",S=a(({col1:t,col2:e,extra:n})=>l("div",{class:"grid grid-cols-2 gap-4 px-4 py-1.5 bg-secondary border-b border-border",children:[r("span",{class:E,children:t}),l("div",{class:"flex items-center justify-between gap-2",children:[r("span",{class:E,children:e}),n]})]}),"GridHead"),re=a(({alias:t})=>{if(!t)return;let e=[];if(Array.isArray(t)?e=t.filter(n=>n?.find!==void 0):typeof t=="object"&&t!==null&&(e=Object.entries(t).map(([n,s])=>({find:n,replacement:s}))),e.length!==0)return l(d,{title:"Alias",children:[r(S,{col1:"Find",col2:"Replacement"}),e.map(({find:n,replacement:s})=>l("div",{class:"grid grid-cols-2 gap-4 px-4 py-1.5 border-t border-border hover:bg-secondary transition-colors duration-100",children:[r("code",{class:"text-xs font-mono text-primary break-all leading-relaxed self-center",children:n}),r("div",{class:"self-center",children:V.test(s)&&s.length>40?r(z,{path:s}):r("code",{class:"text-xs font-mono text-foreground break-all leading-relaxed",children:s})})]},n??s))]})},"AliasTable"),te=new Set(["BASE_URL","DEV","MODE","PROD","SSR"]),le=36,oe=a(({forceVisible:t,tag:e,value:n})=>{const[s,c]=p(x(!1),"localRevealed"),i=t||s,f=i&&n.length>le,b=i?r("code",{class:"text-xs font-mono text-foreground truncate block",children:n}):r("span",{class:"text-xs font-mono text-muted-foreground tracking-widest select-none",children:"••••••••"});return l("div",{class:"flex items-center gap-2 w-full min-w-0",children:[r("span",{class:"flex-1 min-w-0 overflow-hidden",children:f?l(B,{children:[r(M,{class:"w-full block cursor-default",children:b}),r(I,{side:"top",children:r("code",{class:"text-xs font-mono break-all max-w-xs block",children:n})})]}):b}),e,r("button",{"aria-label":i?"Hide value":"Reveal value",class:"shrink-0 text-muted-foreground hover:text-foreground transition-colors duration-150 cursor-pointer p-0.5",onClick:a(()=>c(g=>!g),"onClick"),title:i?"Hide value":"Reveal value",type:"button",children:r(k,{size:11,src:i?T:A})}),r(C,{text:n})]})},"SecretValue"),ne=a(({entries:t})=>{const[e,n]=p(x(!1),"revealAll");return l(d,{title:"Environment Variables",children:[r(S,{col1:"Key",col2:"Value",extra:l("button",{class:"inline-flex items-center gap-1 text-xxs font-mono text-muted-foreground hover:text-foreground transition-colors duration-150 cursor-pointer",onClick:a(()=>n(s=>!s),"onClick"),type:"button",children:[r(k,{size:10,src:e?T:A}),e?"hide all":"reveal all"]})}),t.map(([s,c])=>{const i=te.has(s);return l("div",{class:"grid grid-cols-2 gap-4 px-4 py-1.5 border-t border-border hover:bg-secondary transition-colors duration-100",children:[r("code",{class:"text-xs font-mono text-primary truncate self-center",children:s}),r("div",{class:"self-center min-w-0",children:r(oe,{forceVisible:e,tag:r("span",{class:"text-xxs font-mono text-muted-foreground px-1 py-0.5 bg-secondary border border-border uppercase tracking-wide shrink-0 mr-5",children:i?"built-in":"user"}),value:c})})]},s)})]})},"EnvVariableTable"),se=a(({entries:t})=>{if(t.length!==0)return l(d,{title:"Define Constants",children:[r(S,{col1:"Identifier",col2:"Replacement"}),t.map(([e,n])=>l("div",{class:"grid grid-cols-2 gap-4 px-4 py-1.5 border-t border-border hover:bg-secondary transition-colors duration-100",children:[r("code",{class:"text-xs font-mono text-amber-400 break-all leading-relaxed self-center",children:e}),l("div",{class:"flex items-center gap-2 self-center min-w-0",children:[r("code",{class:"text-xs font-mono text-foreground break-all leading-relaxed flex-1",children:JSON.stringify(n)}),r(C,{text:`${e}=${JSON.stringify(n)}`})]})]},e))]})},"DefineTable"),ae=a(({helpers:t})=>{const[e,n]=p(x(void 0),"config"),[s,c]=p(x(void 0),"error"),[i,f]=p(x(!0),"loading"),b=a(()=>{f(!0),c(void 0),t.rpc.getViteConfig().then(u=>{n(u),f(!1)}).catch(u=>{c(u.message??"Failed to load Vite config"),f(!1)})},"load");if(P(()=>{b()},[]),i)return r(Q,{});if(s||!e)return r(X,{error:s??"No config available",onRetry:b});const g=e.plugins?.length??0,y=Object.keys(e.env??{}).length,j=Object.keys(e.define??{}).length;let w=0;return Array.isArray(e.resolve?.alias)?w=e.resolve.alias.length:typeof e.resolve?.alias=="object"&&e.resolve.alias!==null&&(w=Object.keys(e.resolve.alias).length),l("div",{class:"flex flex-col h-full",children:[l("div",{class:"flex items-center gap-2 px-4 py-2.5 border-b border-border shrink-0 flex-wrap",children:[e.mode&&r(D,{class:"uppercase tracking-wider text-xxs",variant:e.mode==="production"?"destructive":"default",children:e.mode}),e.server?.https&&r(D,{class:"uppercase tracking-wider text-xxs",variant:"success",children:"HTTPS"}),e.ssr&&r(D,{class:"uppercase tracking-wider text-xxs",variant:"secondary",children:"SSR"}),l("code",{class:"text-xs font-mono text-muted-foreground bg-secondary px-1.5 py-0.5 border border-border truncate max-w-xs",title:e.root,children:["…/",e.root.replaceAll("\\","/").split("/").slice(-2).join("/")]}),e.base&&e.base!=="/"&&l("code",{class:"text-xs font-mono text-muted-foreground bg-secondary px-1.5 py-0.5 border border-border",children:["base: ",e.base]}),r(R,{class:"ml-auto shrink-0 text-xs",onClick:b,size:"sm",variant:"outline",children:"Refresh"})]}),r("div",{class:"grid grid-cols-4 divide-x divide-border border-b border-border shrink-0",children:[{label:"plugins",value:g},{label:"env vars",value:y},{label:"defines",value:j},{label:"aliases",value:w}].map(({label:u,value:h})=>l("div",{class:"flex flex-col items-center py-2 gap-0.5",children:[r("span",{class:"text-sm font-semibold tabular-nums leading-none text-foreground",children:h}),r("span",{class:"text-xxs uppercase tracking-wider text-muted-foreground font-medium",children:u})]},u))}),l(N,{class:"flex flex-col flex-1 min-h-0",defaultValue:"server",children:[r("div",{class:"shrink-0 border-b border-border bg-muted",children:r(H,{class:"w-full rounded-none h-auto p-0 bg-transparent justify-start gap-0 overflow-x-auto",children:[{label:"Server",value:"server"},{label:`Plugins (${g})`,value:"plugins"},{label:"Build",value:"build"},{label:"Resolve",value:"resolve"},{label:`Env & Define (${y+j})`,value:"env"}].map(({label:u,value:h})=>r(J,{class:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:shadow-none px-4 py-2 text-xs font-medium shrink-0 text-muted-foreground hover:text-foreground transition-colors cursor-pointer",value:h,children:u},h))})}),l(v,{class:"flex-1 overflow-auto p-4 space-y-4 mt-0",value:"server",children:[l(d,{children:[r(o,{label:"host",value:e.server?.host??!1}),r(o,{label:"port",value:e.server?.port}),r(o,{label:"strictPort",value:e.server?.strictPort}),r(o,{label:"https",value:e.server?.https}),r(o,{label:"open",value:e.server?.open}),r(o,{label:"cors",value:e.server?.cors}),r(o,{label:"origin",value:e.server?.origin}),r(o,{label:"middlewareMode",value:e.server?.middlewareMode})]}),l(d,{title:"HMR",children:[r(o,{label:"enabled",value:e.server?.hmrEnabled??!0}),e.server?.hmrPort!==void 0&&r(o,{label:"port",value:e.server.hmrPort})]}),e.server?.proxy&&e.server.proxy.length>0&&r(d,{title:"Proxy Routes",children:e.server.proxy.map(u=>r("div",{class:"flex items-center gap-3 px-4 py-1.5 hover:bg-secondary transition-colors duration-100",children:r("code",{class:"text-xs font-mono text-primary",children:u})},u))})]}),r(v,{class:"flex-1 overflow-auto p-4 mt-0",value:"plugins",children:g===0?r("p",{class:"text-sm text-muted-foreground text-center py-8",children:"No plugins registered"}):r(ee,{plugins:e.plugins??[]})}),l(v,{class:"flex-1 overflow-auto p-4 space-y-4 mt-0",value:"build",children:[l(d,{children:[r(o,{label:"outDir",value:e.build?.outDir}),r(o,{label:"target",value:e.build?.target}),r(o,{label:"minify",value:e.build?.minify}),r(o,{label:"sourcemap",value:e.build?.sourcemap}),r(o,{label:"cssCodeSplit",value:e.build?.cssCodeSplit}),r(o,{label:"assetsDir",value:e.build?.assetsDir}),r(o,{label:"assetsInlineLimit",value:e.build?.assetsInlineLimit}),r(o,{label:"chunkSizeWarningLimit",value:e.build?.chunkSizeWarningLimit}),r(o,{label:"emptyOutDir",value:e.build?.emptyOutDir}),r(o,{label:"reportCompressedSize",value:e.build?.reportCompressedSize})]}),e.esbuild&&l(d,{title:"esbuild Transform",children:[r(o,{label:"jsx",value:e.esbuild.jsx}),r(o,{label:"jsxFactory",value:e.esbuild.jsxFactory}),r(o,{label:"jsxFragment",value:e.esbuild.jsxFragment}),r(o,{label:"jsxImportSource",value:e.esbuild.jsxImportSource}),r(o,{label:"target",value:e.esbuild.target})]}),l(d,{title:"CSS",children:[r(o,{label:"devSourcemap",value:e.css?.devSourcemap}),r(o,{label:"preprocessors",value:e.css?.preprocessors})]}),(e.optimizeDeps?.include?.length??0)>0||(e.optimizeDeps?.exclude?.length??0)>0?l(d,{title:"Optimize Deps",children:[r(o,{label:"include",value:e.optimizeDeps?.include}),r(o,{label:"exclude",value:e.optimizeDeps?.exclude})]}):void 0,e.ssr&&l(d,{title:"SSR",children:[r(o,{label:"target",value:e.ssr.target}),r(o,{label:"external",value:e.ssr.external}),r(o,{label:"noExternal",value:e.ssr.noExternal})]})]}),l(v,{class:"flex-1 overflow-auto p-4 space-y-4 mt-0",value:"resolve",children:[l(d,{children:[r(o,{label:"extensions",value:e.resolve?.extensions}),r(o,{label:"conditions",value:e.resolve?.conditions}),r(o,{label:"mainFields",value:e.resolve?.mainFields}),r(o,{label:"dedupe",value:e.resolve?.dedupe}),r(o,{label:"preserveSymlinks",value:e.resolve?.preserveSymlinks})]}),r(re,{alias:e.resolve?.alias}),l(d,{title:"Paths",children:[r(o,{label:"root",value:e.root}),r(o,{label:"publicDir",value:e.publicDir}),r(o,{label:"cacheDir",value:e.cacheDir}),r(o,{label:"envDir",value:e.envDir}),r(o,{label:"envPrefix",value:e.envPrefix})]})]}),l(v,{class:"flex-1 overflow-auto p-4 space-y-4 mt-0",value:"env",children:[y>0?r(ne,{entries:Object.entries(e.env??{})}):r("div",{class:"rounded-none border border-border bg-card border-l-2 border-l-primary/20 px-4 py-3",children:r("p",{class:"text-xs text-muted-foreground",children:"No environment variables exposed to the client."})}),r(se,{entries:Object.entries(e.define??{})})]})]})]})},"ViteConfigApp"),me={component:ae,icon:K,id:"dev-toolbar:vite-config",name:"Vite Config"};export{me as default};
@@ -1,4 +1,3 @@
1
- /** @jsxImportSource preact */
2
1
  import type { ComponentChildren } from "preact";
3
2
  import type { AppComponentProps } from "../../types/app.d.ts";
4
3
  declare const ViteConfigApp: ({ helpers }: AppComponentProps) => ComponentChildren;
@@ -1 +1 @@
1
- var T=Object.defineProperty;var n=(o,t)=>T(o,"name",{value:t,configurable:!0});import i from"virtual:visulima-dev-toolbar-options";var f=Object.defineProperty,r=n((o,t)=>f(o,"name",{value:t,configurable:!0}),"t");globalThis.__VISULIMA_DEV_TOOLBAR_OPTIONS__=i;const A=r(()=>{if(!i.requireUrlFlag)return!0;const o=i.urlFlagName??"devtools";return new URLSearchParams(globalThis.window?.location.search).get(o)==="true"},"isUrlFlagPresent"),L=r(o=>Promise.all([o.settings?import("virtual:visulima-dev-toolbar-path:apps/settings/index.js"):void 0,o.timeline?import("virtual:visulima-dev-toolbar-path:apps/timeline/index.js"):void 0,o.viteConfig?import("virtual:visulima-dev-toolbar-path:apps/vite-config/index.js"):void 0,o.moduleGraph?import("virtual:visulima-dev-toolbar-path:apps/module-graph/index.js"):void 0,o.seo?import("virtual:visulima-dev-toolbar-path:apps/seo/index.js"):void 0,o.performance?import("virtual:visulima-dev-toolbar-path:apps/performance/index.js"):void 0,o.a11y?import("virtual:visulima-dev-toolbar-path:apps/a11y/index.js"):void 0,o.inspector?import("virtual:visulima-dev-toolbar-path:apps/inspector/index.js"):void 0,o.tailwind?import("virtual:visulima-dev-toolbar-path:apps/tailwind/index.js"):void 0,import("virtual:visulima-dev-toolbar-path:apps/more/index.js")]),"loadAppModules"),b=r((o,t)=>{const[e,d,s,p,c,m,_,u,I,v]=t;if(!o.registerApp)return;const g=[d,s,p,c,m,_,u,I];for(const l of g)l&&o.registerApp(l.default,!0);e&&o.registerApp(e.default,!0),o.registerApp(v.default,!0)},"registerApps"),a=r(async()=>{if(globalThis.window===void 0||!A()||globalThis.__VISULIMA_DEVTOOLS_INITIALIZED__)return;globalThis.__VISULIMA_DEVTOOLS_INITIALIZED__=!0;let o;try{await import("virtual:visulima-dev-toolbar-path:toolbar/index.js");const{apps:t}=i,e=await L(t);o=document.createElement("dev-toolbar"),document.body.append(o),b(o,e),o.init&&o.init(),console.log("[dev-toolbar] Initialized successfully")}catch(t){o?.isConnected&&o.remove(),globalThis.__VISULIMA_DEVTOOLS_INITIALIZED__=!1,console.error("[dev-toolbar] Failed to initialize:",t)}},"initToolbar");typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a):a().catch(()=>{}));import.meta.hot&&import.meta.hot.on("dev-toolbar:init",()=>{const o=document.querySelector("dev-toolbar");o&&o.remove(),globalThis.__VISULIMA_DEVTOOLS_INITIALIZED__=!1,a().catch(()=>{})});
1
+ var g=Object.defineProperty;var s=(o,t)=>g(o,"name",{value:t,configurable:!0});import e from"virtual:visulima-dev-toolbar-options";var A=Object.defineProperty,r=s((o,t)=>A(o,"name",{value:t,configurable:!0}),"i");globalThis.__VISULIMA_DEV_TOOLBAR_OPTIONS__=e;const T=r(()=>{if(!e.requireUrlFlag)return!0;const o=e.urlFlagName??"devtools";return new URLSearchParams(globalThis.window?.location.search).get(o)==="true"},"isUrlFlagPresent"),L=r(o=>Promise.all([o.settings?import("virtual:visulima-dev-toolbar-path:apps/settings/index.js"):void 0,o.timeline?import("virtual:visulima-dev-toolbar-path:apps/timeline/index.js"):void 0,o.viteConfig?import("virtual:visulima-dev-toolbar-path:apps/vite-config/index.js"):void 0,o.moduleGraph?import("virtual:visulima-dev-toolbar-path:apps/module-graph/index.js"):void 0,o.seo?import("virtual:visulima-dev-toolbar-path:apps/seo/index.js"):void 0,o.performance?import("virtual:visulima-dev-toolbar-path:apps/performance/index.js"):void 0,o.a11y?import("virtual:visulima-dev-toolbar-path:apps/a11y/index.js"):void 0,o.inspector?import("virtual:visulima-dev-toolbar-path:apps/inspector/index.js"):void 0,o.tailwind?import("virtual:visulima-dev-toolbar-path:apps/tailwind/index.js"):void 0,o.assets?import("virtual:visulima-dev-toolbar-path:apps/assets/index.js"):void 0]),"loadAppModules"),b=r((o,t)=>{const[i,a,d,p,c,m,_,u,I,v]=t;if(!o.registerApp)return;const f=[a,d,p,c,m,_,u,I,v];for(const n of f)n&&o.registerApp(n.default,!0);i&&o.registerApp(i.default,!0)},"registerApps"),l=r(async()=>{if(globalThis.window===void 0||!T()||globalThis.__VISULIMA_DEVTOOLS_INITIALIZED__)return;globalThis.__VISULIMA_DEVTOOLS_INITIALIZED__=!0;let o;try{await import("virtual:visulima-dev-toolbar-path:toolbar/index.js");const{apps:t}=e,i=await L(t);if(o=document.createElement("dev-toolbar"),document.body.append(o),b(o,i),e.customApps)for(const a of e.customApps)o.registerApp(a,!1);o.init&&o.init(),console.log("[dev-toolbar] Initialized successfully")}catch(t){o?.isConnected&&o.remove(),globalThis.__VISULIMA_DEVTOOLS_INITIALIZED__=!1,console.error("[dev-toolbar] Failed to initialize:",t)}},"initToolbar");typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",l):l().catch(()=>{}));import.meta.hot&&import.meta.hot.on("dev-toolbar:init",()=>{const o=document.querySelector("dev-toolbar");o&&o.remove(),globalThis.__VISULIMA_DEVTOOLS_INITIALIZED__=!1,l().catch(()=>{})});
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{createClientRPCContext as t}from"./packem_shared/createClientRPCContext-DgRxrllw.js";import{createServerRPCContext as a}from"./packem_shared/createServerRPCContext-CEm1Ymkn.js";import{DevToolbar as m}from"./toolbar/index.js";import{loadSettings as x,saveSettings as f,updateSettings as n}from"./packem_shared/loadSettings-hvjR4fcS.js";import{createDevToolbarHook as s}from"./packem_shared/createDevToolbarHook-4bZZiHPI.js";import{getGlobalHook as C,setupGlobalHook as S}from"./packem_shared/setupGlobalHook-CCf9Logv.js";import{m as v}from"./packem_shared/store-DaUtLjf3.js";export{m as DevToolbar,t as createClientRPCContext,s as createDevToolbarHook,a as createServerRPCContext,C as getGlobalHook,v as getTimelineStore,x as loadSettings,f as saveSettings,S as setupGlobalHook,n as updateSettings};
1
+ import{createClientRPCContext as t}from"./packem_shared/createClientRPCContext-DgRxrllw.js";import{createServerRPCContext as a}from"./packem_shared/createServerRPCContext-CJXa8ezf.js";import{DevToolbar as m}from"./toolbar/index.js";import{loadSettings as x,saveSettings as f,updateSettings as n}from"./packem_shared/loadSettings-hvjR4fcS.js";import{createDevToolbarHook as s}from"./packem_shared/createDevToolbarHook-4bZZiHPI.js";import{getGlobalHook as C,setupGlobalHook as S}from"./packem_shared/setupGlobalHook-CCf9Logv.js";import{m as v}from"./packem_shared/store-DaUtLjf3.js";export{m as DevToolbar,t as createClientRPCContext,s as createDevToolbarHook,a as createServerRPCContext,C as getGlobalHook,v as getTimelineStore,x as loadSettings,f as saveSettings,S as setupGlobalHook,n as updateSettings};