hermesbuttons 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,9 +5,9 @@ Drop-in **"Run on Hermes"** and **"Run on Hermes Skills"** buttons for any websi
5
5
  **Hermes button** (`<hermes-button>`) copies a full CLI invocation using `hermes -p "..."` so users can paste into a terminal. **Hermes skill button** (`<hermes-skill-button>`) guides skill installation and ties into Hermes Agent workflows with persistent memory.
6
6
 
7
7
  <p align="center">
8
- <img src="https://img.shields.io/npm/v/hermesbuttons?color=%237C3AED&label=npm" alt="npm version">
9
- <img src="https://img.shields.io/bundlephobia/minzip/hermesbuttons?color=%237C3AED" alt="bundle size">
10
- <img src="https://img.shields.io/npm/l/hermesbuttons?color=%237C3AED" alt="license">
8
+ <img src="https://img.shields.io/npm/v/hermesbuttons?color=%232B8CFF&label=npm" alt="npm version">
9
+ <img src="https://img.shields.io/bundlephobia/minzip/hermesbuttons?color=%232B8CFF" alt="bundle size">
10
+ <img src="https://img.shields.io/npm/l/hermesbuttons?color=%232B8CFF" alt="license">
11
11
  </p>
12
12
 
13
13
  ---
@@ -269,10 +269,10 @@ document.body.appendChild(btn);
269
269
 
270
270
  | Theme | Description |
271
271
  |-------|-------------|
272
- | `branded` | Violet primary (`#7C3AED`), white text **(default)** |
273
- | `branded-alt` | Teal primary (`#14B8A6`), white text — secondary accent |
274
- | `dark` | Dark surface, light text, violet accents |
275
- | `light` | Light surface, dark text, violet accents |
272
+ | `branded` | Electric blue primary (`#2B8CFF`), white text **(default)** — [Hermes Agent](https://hermes-agent.nousresearch.com/) marketing palette |
273
+ | `branded-alt` | Periwinkle (`#8FA3E8`), white text — pairs with `branded` |
274
+ | `dark` | Navy-wash dark surface, light text, blue accents |
275
+ | `light` | White / slate surfaces, blue accents |
276
276
  | `system` | Auto-switches between `light`/`dark` based on `prefers-color-scheme` |
277
277
 
278
278
  ## Sizes
@@ -30,7 +30,7 @@ var b=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
30
30
  <path d="M3 8.5l3.5 3.5L13 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
31
31
  </svg>`;var u=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon-sm">
32
32
  <path d="M4 4l8 8m0-8l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
33
- </svg>`;var d="#7C3AED",l="#6D28D9",E="#5B21B6",g="#14B8A6",p={branded:{bg:d,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1A1025",muted:"#7C7589",primary:d,primaryText:"#FFFFFF",codeBg:"#1A1025",codeText:"#F3EEFF"},"branded-alt":{bg:g,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#1A1025",muted:"#7C7589",primary:g,primaryText:"#FFFFFF",codeBg:"#1A1025",codeText:"#F3EEFF"},dark:{bg:"#1A1025",text:"#F3EEFF",border:"#2D2440",surface:"#231A35",surfaceText:"#F3EEFF",muted:"#9F95B0",primary:d,primaryText:"#FFFFFF",codeBg:"#0F0A18",codeText:"#F3EEFF"},light:{bg:"#FFFFFF",text:"#1A1025",border:"#E8E0F0",surface:"#FAF8FF",surfaceText:"#1A1025",muted:"#7C7589",primary:d,primaryText:"#FFFFFF",codeBg:"#1A1025",codeText:"#F3EEFF"}};function s(r){return r!=="system"?p[r]:typeof window>"u"?p.light:window.matchMedia("(prefers-color-scheme: dark)").matches?p.dark:p.light}function v(r){return`
33
+ </svg>`;var d="#2B8CFF",l="#1E7AEB",_="#186BD4",E="43, 140, 255",g="#8FA3E8",M="#7B91DC",A="#6B82CC",L="143, 163, 232",p={branded:{bg:d,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#0F172A",muted:"#64748B",primary:d,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"},"branded-alt":{bg:g,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#0F172A",muted:"#64748B",primary:g,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"},dark:{bg:"#141C2E",text:"#F1F5F9",border:"#2A3F5C",surface:"#1A2740",surfaceText:"#F1F5F9",muted:"#94A3B8",primary:d,primaryText:"#FFFFFF",codeBg:"#0A0E18",codeText:"#F1F5F9"},light:{bg:"#FFFFFF",text:"#0F172A",border:"#CBD5E1",surface:"#F8FAFC",surfaceText:"#0F172A",muted:"#64748B",primary:d,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"}};function s(r){return r!=="system"?p[r]:typeof window>"u"?p.light:window.matchMedia("(prefers-color-scheme: dark)").matches?p.dark:p.light}function v(r){return`
34
34
  --hb-bg: ${r.bg};
35
35
  --hb-text: ${r.text};
36
36
  --hb-border: ${r.border};
@@ -41,7 +41,7 @@ var b=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
41
41
  --hb-primary-text: ${r.primaryText};
42
42
  --hb-code-bg: ${r.codeBg};
43
43
  --hb-code-text: ${r.codeText};
44
- `}var M={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},_={sm:{height:"2rem",fontSize:"0.75rem",iconSize:"0.875rem",padding:"0 0.75rem",ccPadding:"0 0.5rem",gap:"0.375rem",radius:"0.375rem"},md:{height:"2.5rem",fontSize:"0.875rem",iconSize:"1.125rem",padding:"0 1rem",ccPadding:"0 0.75rem",gap:"0.5rem",radius:"0.5rem"},lg:{height:"3rem",fontSize:"1rem",iconSize:"1.375rem",padding:"0 1.25rem",ccPadding:"0 1rem",gap:"0.625rem",radius:"0.625rem"}};var F=`
44
+ `}var O={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},B={sm:{height:"2rem",fontSize:"0.75rem",iconSize:"0.875rem",padding:"0 0.75rem",ccPadding:"0 0.5rem",gap:"0.375rem",radius:"0.375rem"},md:{height:"2.5rem",fontSize:"0.875rem",iconSize:"1.125rem",padding:"0 1rem",ccPadding:"0 0.75rem",gap:"0.5rem",radius:"0.5rem"},lg:{height:"3rem",fontSize:"1rem",iconSize:"1.375rem",padding:"0 1.25rem",ccPadding:"0 1rem",gap:"0.625rem",radius:"0.625rem"}};var F=`
45
45
  :host {
46
46
  position: fixed;
47
47
  inset: 0;
@@ -394,5 +394,5 @@ var b=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
394
394
  <div class="hb-step-label">Paste and send in your Hermes session</div>
395
395
  </div>
396
396
  </div>
397
- `;return o}setupListeners(){this.shadowRoot&&(this.shadowRoot.addEventListener("click",e=>{let t=e.target.closest("[data-action]");if(!t)return;let o=t.dataset.action;if(o==="close")this.close();else if(o==="copy"){let i=t.dataset.command||"";this.copyToClipboard(i,t)}}),this.shadowRoot.addEventListener("keydown",e=>{e.key==="Escape"&&this.close()}))}setupSystemThemeWatch(){this._mqCleanup?.(),this._mqCleanup=null;let e=this._options.theme;if(!(e==="system"||e==="branded"||e==="branded-alt")||typeof window>"u")return;let o=window.matchMedia("(prefers-color-scheme: dark)"),i=()=>this.render();o.addEventListener("change",i),this._mqCleanup=()=>o.removeEventListener("change",i)}async copyToClipboard(e,t){try{await navigator.clipboard.writeText(e);let o=t.querySelector("span"),i=t;t.setAttribute("data-copied","true"),o&&(o.textContent="Copied!"),i.innerHTML=`${x}<span>Copied!</span>`,this._options.onCopy?.(e),setTimeout(()=>{t.setAttribute("data-copied","false"),i.innerHTML=`${n}<span>Copy</span>`},2e3)}catch{let o=document.createElement("textarea");o.value=e,o.style.position="fixed",o.style.opacity="0",document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o),this._options.onCopy?.(e)}}close(){let e=this.shadowRoot?.querySelector(".hb-dialog"),t=this.shadowRoot?.querySelector(".hb-backdrop");e&&(e.style.animation="hb-scale-in 0.15s ease-in reverse"),t&&(t.style.animation="hb-fade-in 0.15s ease-in reverse"),setTimeout(()=>{this._options.onClose?.(),this.remove()},140)}escapeHtml(e){let t=document.createElement("div");return t.textContent=e,t.innerHTML}escapeAttr(e){return e.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}};typeof customElements<"u"&&!customElements.get("hermes-popup-dialog")&&customElements.define("hermes-popup-dialog",c);function $(r){let a=document.createElement("hermes-popup-dialog");return a.options=r,document.body.appendChild(a),a}export{b as a,m as b,d as c,l as d,E as e,s as f,v as g,M as h,_ as i,$ as j};
398
- //# sourceMappingURL=chunk-3CPSZAJ2.mjs.map
397
+ `;return o}setupListeners(){this.shadowRoot&&(this.shadowRoot.addEventListener("click",e=>{let t=e.target.closest("[data-action]");if(!t)return;let o=t.dataset.action;if(o==="close")this.close();else if(o==="copy"){let i=t.dataset.command||"";this.copyToClipboard(i,t)}}),this.shadowRoot.addEventListener("keydown",e=>{e.key==="Escape"&&this.close()}))}setupSystemThemeWatch(){this._mqCleanup?.(),this._mqCleanup=null;let e=this._options.theme;if(!(e==="system"||e==="branded"||e==="branded-alt")||typeof window>"u")return;let o=window.matchMedia("(prefers-color-scheme: dark)"),i=()=>this.render();o.addEventListener("change",i),this._mqCleanup=()=>o.removeEventListener("change",i)}async copyToClipboard(e,t){try{await navigator.clipboard.writeText(e);let o=t.querySelector("span"),i=t;t.setAttribute("data-copied","true"),o&&(o.textContent="Copied!"),i.innerHTML=`${x}<span>Copied!</span>`,this._options.onCopy?.(e),setTimeout(()=>{t.setAttribute("data-copied","false"),i.innerHTML=`${n}<span>Copy</span>`},2e3)}catch{let o=document.createElement("textarea");o.value=e,o.style.position="fixed",o.style.opacity="0",document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o),this._options.onCopy?.(e)}}close(){let e=this.shadowRoot?.querySelector(".hb-dialog"),t=this.shadowRoot?.querySelector(".hb-backdrop");e&&(e.style.animation="hb-scale-in 0.15s ease-in reverse"),t&&(t.style.animation="hb-fade-in 0.15s ease-in reverse"),setTimeout(()=>{this._options.onClose?.(),this.remove()},140)}escapeHtml(e){let t=document.createElement("div");return t.textContent=e,t.innerHTML}escapeAttr(e){return e.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}};typeof customElements<"u"&&!customElements.get("hermes-popup-dialog")&&customElements.define("hermes-popup-dialog",c);function $(r){let a=document.createElement("hermes-popup-dialog");return a.options=r,document.body.appendChild(a),a}export{b as a,m as b,d as c,l as d,_ as e,E as f,g,M as h,A as i,L as j,s as k,v as l,O as m,B as n,$ as o};
398
+ //# sourceMappingURL=chunk-7JMZRFCQ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/icons.ts","../src/themes.ts","../src/popup-dialog.ts"],"sourcesContent":["export const HERMES_ICON = `<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"hb-icon\">\n <!-- Wing helmet -->\n <path d=\"M12 2C8.5 2 6 4.5 6 7c0 1.5.5 2.8 1.5 3.8L6 14h12l-1.5-3.2C17.5 9.8 18 8.5 18 7c0-2.5-2.5-5-6-5z\" fill=\"currentColor\" opacity=\"0.2\"/>\n <path d=\"M12 2C8.5 2 6 4.5 6 7c0 1.5.5 2.8 1.5 3.8L6 14h12l-1.5-3.2C17.5 9.8 18 8.5 18 7c0-2.5-2.5-5-6-5z\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\" stroke-linejoin=\"round\"/>\n <!-- Wings -->\n <path d=\"M6 6.5C4.5 5 2 5 2 7s1.5 3 3 3\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n <path d=\"M18 6.5C19.5 5 22 5 22 7s-1.5 3-3 3\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n <!-- Caduceus staff -->\n <line x1=\"12\" y1=\"14\" x2=\"12\" y2=\"22\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\"/>\n <!-- Snakes -->\n <path d=\"M9.5 16c1.5 1 3.5 1 5 0\" stroke=\"currentColor\" stroke-width=\"1.3\" stroke-linecap=\"round\" fill=\"none\"/>\n <path d=\"M9.5 19c1.5 1 3.5 1 5 0\" stroke=\"currentColor\" stroke-width=\"1.3\" stroke-linecap=\"round\" fill=\"none\"/>\n <!-- Eye -->\n <circle cx=\"12\" cy=\"7.5\" r=\"1.5\" fill=\"currentColor\"/>\n</svg>`;\n\nexport const HERMES_SKILL_ICON = `<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"hb-icon\">\n <!-- Brain/memory symbol -->\n <path d=\"M12 3C8 3 5 6 5 9c0 2 1 3.5 2 4.5V16a2 2 0 002 2h6a2 2 0 002-2v-2.5c1-1 2-2.5 2-4.5 0-3-3-6-7-6z\" fill=\"currentColor\" opacity=\"0.15\"/>\n <path d=\"M12 3C8 3 5 6 5 9c0 2 1 3.5 2 4.5V16a2 2 0 002 2h6a2 2 0 002-2v-2.5c1-1 2-2.5 2-4.5 0-3-3-6-7-6z\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\" stroke-linejoin=\"round\"/>\n <!-- Neural connections -->\n <path d=\"M9 9.5c0-1 .5-2 1.5-2.5M15 9.5c0-1-.5-2-1.5-2.5M10.5 11c.5.5 1.5 1 3 0\" stroke=\"currentColor\" stroke-width=\"1.2\" stroke-linecap=\"round\" fill=\"none\"/>\n <!-- Growing roots -->\n <path d=\"M9 18v2M12 18v3M15 18v2\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n <!-- Sparkle -->\n <circle cx=\"8\" cy=\"6\" r=\"0.8\" fill=\"currentColor\"/>\n <circle cx=\"16\" cy=\"6\" r=\"0.8\" fill=\"currentColor\"/>\n</svg>`;\n\nexport const COPY_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"hb-icon-sm\">\n <rect x=\"5\" y=\"5\" width=\"8\" height=\"8\" rx=\"1.5\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\"/>\n <path d=\"M3 10V3.5A1.5 1.5 0 014.5 2H10\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n</svg>`;\n\nexport const CHECK_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"hb-icon-sm\">\n <path d=\"M3 8.5l3.5 3.5L13 4\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>`;\n\nexport const DOWNLOAD_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"hb-icon-sm\">\n <path d=\"M8 2v8m0 0l-3-3m3 3l3-3\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M3 12v1.5a1 1 0 001 1h8a1 1 0 001-1V12\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n</svg>`;\n\nexport const CLOSE_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"hb-icon-sm\">\n <path d=\"M4 4l8 8m0-8l-8 8\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n</svg>`;\n\nexport const TERMINAL_ICON = `<svg viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"hb-icon-sm\">\n <rect x=\"1\" y=\"2\" width=\"14\" height=\"12\" rx=\"2\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\"/>\n <path d=\"M4 6l3 2.5L4 11\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M9 11h3\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/>\n</svg>`;\n","import type { ThemeTokens, Theme } from './types';\n\n/** Electric blue aligned with [Hermes Agent](https://hermes-agent.nousresearch.com/) marketing */\nexport const BRAND_COLOR = '#2B8CFF';\nexport const BRAND_COLOR_HOVER = '#1E7AEB';\nexport const BRAND_COLOR_ACTIVE = '#186BD4';\n/** Comma-separated RGB for `rgba(..., α)` in component styles */\nexport const BRAND_RGB = '43, 140, 255';\n\n/** Periwinkle secondary (Hermes hero title tone) */\nexport const ALT_BRAND_COLOR = '#8FA3E8';\nexport const ALT_BRAND_COLOR_HOVER = '#7B91DC';\nexport const ALT_BRAND_COLOR_ACTIVE = '#6B82CC';\nexport const ALT_BRAND_RGB = '143, 163, 232';\n\nexport const themes: Record<Exclude<Theme, 'system'>, ThemeTokens> = {\n branded: {\n bg: BRAND_COLOR,\n text: '#FFFFFF',\n border: 'transparent',\n surface: '#FFFFFF',\n surfaceText: '#0F172A',\n muted: '#64748B',\n primary: BRAND_COLOR,\n primaryText: '#FFFFFF',\n codeBg: '#0F172A',\n codeText: '#F1F5F9',\n },\n 'branded-alt': {\n bg: ALT_BRAND_COLOR,\n text: '#FFFFFF',\n border: 'transparent',\n surface: '#FFFFFF',\n surfaceText: '#0F172A',\n muted: '#64748B',\n primary: ALT_BRAND_COLOR,\n primaryText: '#FFFFFF',\n codeBg: '#0F172A',\n codeText: '#F1F5F9',\n },\n dark: {\n bg: '#141C2E',\n text: '#F1F5F9',\n border: '#2A3F5C',\n surface: '#1A2740',\n surfaceText: '#F1F5F9',\n muted: '#94A3B8',\n primary: BRAND_COLOR,\n primaryText: '#FFFFFF',\n codeBg: '#0A0E18',\n codeText: '#F1F5F9',\n },\n light: {\n bg: '#FFFFFF',\n text: '#0F172A',\n border: '#CBD5E1',\n surface: '#F8FAFC',\n surfaceText: '#0F172A',\n muted: '#64748B',\n primary: BRAND_COLOR,\n primaryText: '#FFFFFF',\n codeBg: '#0F172A',\n codeText: '#F1F5F9',\n },\n};\n\nexport function resolveTheme(theme: Theme): ThemeTokens {\n if (theme !== 'system') return themes[theme];\n if (typeof window === 'undefined') return themes.light;\n return window.matchMedia('(prefers-color-scheme: dark)').matches\n ? themes.dark\n : themes.light;\n}\n\nexport function themeToCSS(tokens: ThemeTokens): string {\n return `\n --hb-bg: ${tokens.bg};\n --hb-text: ${tokens.text};\n --hb-border: ${tokens.border};\n --hb-surface: ${tokens.surface};\n --hb-surface-text: ${tokens.surfaceText};\n --hb-muted: ${tokens.muted};\n --hb-primary: ${tokens.primary};\n --hb-primary-text: ${tokens.primaryText};\n --hb-code-bg: ${tokens.codeBg};\n --hb-code-text: ${tokens.codeText};\n `;\n}\n\nexport const SHAPE_MAP = {\n rounded: { sm: '0.375rem', md: '0.5rem', lg: '0.625rem' },\n pill: { sm: '999px', md: '999px', lg: '999px' },\n square: { sm: '0', md: '0', lg: '0' },\n} as const;\n\nexport const SIZE_MAP = {\n sm: { height: '2rem', fontSize: '0.75rem', iconSize: '0.875rem', padding: '0 0.75rem', ccPadding: '0 0.5rem', gap: '0.375rem', radius: '0.375rem' },\n md: { height: '2.5rem', fontSize: '0.875rem', iconSize: '1.125rem', padding: '0 1rem', ccPadding: '0 0.75rem', gap: '0.5rem', radius: '0.5rem' },\n lg: { height: '3rem', fontSize: '1rem', iconSize: '1.375rem', padding: '0 1.25rem', ccPadding: '0 1rem', gap: '0.625rem', radius: '0.625rem' },\n};\n","import type { PopupOptions, ThemeTokens } from './types';\nimport { HERMES_ICON, HERMES_SKILL_ICON, COPY_ICON, CHECK_ICON, CLOSE_ICON } from './icons';\nimport { resolveTheme, themeToCSS, BRAND_COLOR_HOVER } from './themes';\n\nconst POPUP_STYLES = `\n :host {\n position: fixed;\n inset: 0;\n z-index: 999999;\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n }\n\n * { box-sizing: border-box; margin: 0; padding: 0; }\n\n .hb-backdrop {\n position: absolute;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(4px);\n -webkit-backdrop-filter: blur(4px);\n animation: hb-fade-in 0.15s ease-out;\n }\n\n .hb-dialog {\n position: relative;\n width: 90%;\n max-width: 460px;\n background: var(--hb-surface);\n color: var(--hb-surface-text);\n border-radius: 16px;\n box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--hb-border);\n overflow: hidden;\n animation: hb-scale-in 0.2s ease-out;\n }\n\n .hb-dialog-header {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 20px 24px 16px;\n border-bottom: 1px solid var(--hb-border);\n }\n\n .hb-dialog-header-icon {\n width: 36px;\n height: 36px;\n color: var(--hb-primary);\n flex-shrink: 0;\n }\n\n .hb-dialog-header-text {\n flex: 1;\n min-width: 0;\n }\n\n .hb-dialog-title {\n font-size: 16px;\n font-weight: 600;\n line-height: 1.3;\n color: var(--hb-surface-text);\n }\n\n .hb-dialog-description {\n font-size: 13px;\n color: var(--hb-muted);\n margin-top: 2px;\n line-height: 1.4;\n }\n\n .hb-dialog-close {\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n background: transparent;\n color: var(--hb-muted);\n cursor: pointer;\n border-radius: 8px;\n flex-shrink: 0;\n transition: background 0.15s, color 0.15s;\n }\n\n .hb-dialog-close:hover {\n background: var(--hb-border);\n color: var(--hb-surface-text);\n }\n\n .hb-dialog-close svg { width: 14px; height: 14px; }\n\n .hb-dialog-body { padding: 20px 24px; }\n\n .hb-step {\n display: flex;\n gap: 12px;\n margin-bottom: 16px;\n }\n\n .hb-step:last-child { margin-bottom: 0; }\n\n .hb-step-num {\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background: var(--hb-primary);\n color: var(--hb-primary-text);\n font-size: 12px;\n font-weight: 600;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n margin-top: 1px;\n }\n\n .hb-step-content {\n flex: 1;\n min-width: 0;\n }\n\n .hb-step-label {\n font-size: 13px;\n font-weight: 500;\n color: var(--hb-surface-text);\n margin-bottom: 8px;\n line-height: 1.4;\n }\n\n .hb-code-block {\n display: flex;\n align-items: center;\n background: var(--hb-code-bg);\n color: var(--hb-code-text);\n border-radius: 10px;\n padding: 2px 2px 2px 14px;\n font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, 'Liberation Mono', Menlo, monospace;\n font-size: 13px;\n line-height: 1.5;\n gap: 8px;\n overflow: hidden;\n }\n\n .hb-code-text {\n flex: 1;\n overflow-x: auto;\n white-space: nowrap;\n padding: 10px 0;\n scrollbar-width: none;\n }\n\n .hb-code-text::-webkit-scrollbar { display: none; }\n\n .hb-code-prefix {\n color: var(--hb-muted);\n user-select: none;\n margin-right: 6px;\n }\n\n .hb-copy-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n height: 36px;\n min-width: 36px;\n padding: 0 12px;\n border: none;\n background: var(--hb-primary);\n color: var(--hb-primary-text);\n cursor: pointer;\n border-radius: 8px;\n font-family: inherit;\n font-size: 12px;\n font-weight: 500;\n flex-shrink: 0;\n transition: background 0.15s, transform 0.1s;\n white-space: nowrap;\n }\n\n .hb-copy-btn:hover { background: ${BRAND_COLOR_HOVER}; }\n .hb-copy-btn:active { transform: scale(0.96); }\n .hb-copy-btn svg { width: 14px; height: 14px; }\n\n .hb-copy-btn[data-copied=\"true\"] {\n background: #16a34a;\n }\n\n .hb-dialog-footer {\n padding: 16px 24px 20px;\n display: flex;\n flex-direction: column;\n gap: 10px;\n }\n\n .hb-action-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n width: 100%;\n height: 44px;\n border: none;\n background: var(--hb-primary);\n color: var(--hb-primary-text);\n cursor: pointer;\n border-radius: 10px;\n font-family: inherit;\n font-size: 14px;\n font-weight: 600;\n transition: background 0.15s, transform 0.1s;\n }\n\n .hb-action-btn:hover { background: ${BRAND_COLOR_HOVER}; }\n .hb-action-btn:active { transform: scale(0.98); }\n .hb-action-btn svg { width: 16px; height: 16px; }\n\n .hb-hint {\n font-size: 12px;\n color: var(--hb-muted);\n text-align: center;\n line-height: 1.4;\n }\n\n .hb-hint kbd {\n display: inline-block;\n padding: 1px 5px;\n font-family: inherit;\n font-size: 11px;\n background: var(--hb-border);\n border-radius: 4px;\n border: 1px solid var(--hb-border);\n }\n\n @keyframes hb-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n\n @keyframes hb-scale-in {\n from { opacity: 0; transform: scale(0.95) translateY(8px); }\n to { opacity: 1; transform: scale(1) translateY(0); }\n }\n\n @media (max-width: 480px) {\n .hb-dialog {\n width: 96%;\n max-width: none;\n border-radius: 14px;\n max-height: 90dvh;\n overflow-y: auto;\n overscroll-behavior: contain;\n }\n\n .hb-dialog-header { padding: 16px 16px 12px; gap: 10px; }\n .hb-dialog-header-icon { width: 28px; height: 28px; }\n .hb-dialog-body { padding: 16px; }\n .hb-dialog-footer { padding: 12px 16px 16px; }\n\n .hb-step { gap: 10px; margin-bottom: 14px; }\n .hb-step-num { width: 22px; height: 22px; font-size: 11px; }\n .hb-step-label { font-size: 12px; margin-bottom: 6px; }\n\n .hb-code-block { font-size: 12px; padding: 2px 2px 2px 10px; border-radius: 8px; }\n .hb-copy-btn { height: 32px; padding: 0 10px; font-size: 11px; border-radius: 6px; }\n .hb-action-btn { height: 40px; font-size: 13px; border-radius: 8px; }\n .hb-hint { font-size: 11px; }\n }\n\n @media (max-width: 360px) {\n .hb-dialog { width: 100%; border-radius: 12px 12px 0 0; align-self: flex-end; }\n .hb-copy-btn span { display: none; }\n .hb-copy-btn { min-width: 32px; padding: 0 8px; }\n }\n\n @supports (padding: env(safe-area-inset-bottom)) {\n .hb-dialog-footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }\n }\n`;\n\nexport class HermesPopupDialog extends HTMLElement {\n private _options!: PopupOptions;\n private _mqCleanup: (() => void) | null = null;\n\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n\n set options(opts: PopupOptions) {\n this._options = opts;\n this.render();\n }\n\n get options() {\n return this._options;\n }\n\n disconnectedCallback() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n }\n\n private resolvePopupTokens(): ThemeTokens {\n const { theme } = this._options;\n\n if (theme === 'dark' || theme === 'light') return resolveTheme(theme);\n\n const prefersDark = typeof window !== 'undefined'\n && window.matchMedia('(prefers-color-scheme: dark)').matches;\n\n if (theme === 'system') {\n return prefersDark ? resolveTheme('dark') : resolveTheme('light');\n }\n\n const base = prefersDark ? resolveTheme('dark') : resolveTheme('light');\n const brand = resolveTheme(theme);\n return {\n ...base,\n primary: brand.primary,\n primaryText: brand.primaryText,\n };\n }\n\n private render() {\n if (!this.shadowRoot || !this._options) return;\n\n const { variant, title, description, command, fullCommand, skillUrl } = this._options;\n const tokens = this.resolvePopupTokens();\n const icon = variant === 'hermes' ? HERMES_ICON : HERMES_SKILL_ICON;\n\n const isHermesTerminal = variant === 'hermes';\n const displayCommand = fullCommand || command;\n\n this.shadowRoot.innerHTML = `\n <style>${POPUP_STYLES}</style>\n <div style=\"${themeToCSS(tokens)}\">\n <div class=\"hb-backdrop\" data-action=\"close\"></div>\n <div class=\"hb-dialog\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"hb-dialog-title\">\n <div class=\"hb-dialog-header\">\n <div class=\"hb-dialog-header-icon\">${icon}</div>\n <div class=\"hb-dialog-header-text\">\n <div class=\"hb-dialog-title\" id=\"hb-dialog-title\">${title}</div>\n ${description ? `<div class=\"hb-dialog-description\">${description}</div>` : ''}\n </div>\n <button class=\"hb-dialog-close\" data-action=\"close\" aria-label=\"Close\">${CLOSE_ICON}</button>\n </div>\n <div class=\"hb-dialog-body\">\n ${isHermesTerminal ? this.renderHermesTerminalBody(displayCommand) : this.renderHermesSkillBody(command, skillUrl)}\n </div>\n <div class=\"hb-dialog-footer\">\n ${isHermesTerminal ? `\n <div class=\"hb-hint\">Press <kbd>⌘</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your terminal to run</div>\n ` : `\n <div class=\"hb-hint\">Press <kbd>⌘</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your Hermes session to run</div>\n `}\n </div>\n </div>\n </div>\n `;\n\n this.setupListeners();\n this.setupSystemThemeWatch();\n }\n\n private renderHermesTerminalBody(command: string): string {\n return `\n <div class=\"hb-step\">\n <div class=\"hb-step-num\">1</div>\n <div class=\"hb-step-content\">\n <div class=\"hb-step-label\">Copy this command to your clipboard</div>\n <div class=\"hb-code-block\">\n <div class=\"hb-code-text\"><span class=\"hb-code-prefix\">$</span>${this.escapeHtml(command)}</div>\n <button class=\"hb-copy-btn\" data-action=\"copy\" data-command=\"${this.escapeAttr(command)}\">${COPY_ICON}<span>Copy</span></button>\n </div>\n </div>\n </div>\n <div class=\"hb-step\">\n <div class=\"hb-step-num\">2</div>\n <div class=\"hb-step-content\">\n <div class=\"hb-step-label\">Paste and run in your terminal</div>\n </div>\n </div>\n `;\n }\n\n private renderHermesSkillBody(command: string, skillUrl?: string): string {\n let steps = '';\n\n if (skillUrl) {\n const fullPrompt = `Install the skill from ${skillUrl} and run ${command}`;\n steps += `\n <div class=\"hb-step\">\n <div class=\"hb-step-num\">1</div>\n <div class=\"hb-step-content\">\n <div class=\"hb-step-label\">Copy this prompt to your clipboard</div>\n <div class=\"hb-code-block\">\n <div class=\"hb-code-text\">${this.escapeHtml(fullPrompt)}</div>\n <button class=\"hb-copy-btn\" data-action=\"copy\" data-command=\"${this.escapeAttr(fullPrompt)}\">${COPY_ICON}<span>Copy</span></button>\n </div>\n </div>\n </div>\n <div class=\"hb-step\">\n <div class=\"hb-step-num\">2</div>\n <div class=\"hb-step-content\">\n <div class=\"hb-step-label\">Paste into a Hermes session — the agent will fetch the skill and set it up for you</div>\n </div>\n </div>\n `;\n } else {\n steps += `\n <div class=\"hb-step\">\n <div class=\"hb-step-num\">1</div>\n <div class=\"hb-step-content\">\n <div class=\"hb-step-label\">Copy this command to your clipboard</div>\n <div class=\"hb-code-block\">\n <div class=\"hb-code-text\">${this.escapeHtml(command)}</div>\n <button class=\"hb-copy-btn\" data-action=\"copy\" data-command=\"${this.escapeAttr(command)}\">${COPY_ICON}<span>Copy</span></button>\n </div>\n </div>\n </div>\n <div class=\"hb-step\">\n <div class=\"hb-step-num\">2</div>\n <div class=\"hb-step-content\">\n <div class=\"hb-step-label\">Paste and send in your Hermes session</div>\n </div>\n </div>\n `;\n }\n\n return steps;\n }\n\n private setupListeners() {\n if (!this.shadowRoot) return;\n\n this.shadowRoot.addEventListener('click', (e) => {\n const target = (e.target as HTMLElement).closest('[data-action]') as HTMLElement | null;\n if (!target) return;\n\n const action = target.dataset.action;\n\n if (action === 'close') {\n this.close();\n } else if (action === 'copy') {\n const cmd = target.dataset.command || '';\n this.copyToClipboard(cmd, target);\n }\n });\n\n this.shadowRoot.addEventListener('keydown', (e) => {\n if ((e as KeyboardEvent).key === 'Escape') this.close();\n });\n }\n\n private setupSystemThemeWatch() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n\n const theme = this._options.theme;\n const needsWatch = theme === 'system' || theme === 'branded' || theme === 'branded-alt';\n if (!needsWatch || typeof window === 'undefined') return;\n\n const mq = window.matchMedia('(prefers-color-scheme: dark)');\n const handler = () => this.render();\n mq.addEventListener('change', handler);\n this._mqCleanup = () => mq.removeEventListener('change', handler);\n }\n\n private async copyToClipboard(command: string, button: HTMLElement) {\n try {\n await navigator.clipboard.writeText(command);\n const label = button.querySelector('span');\n const iconContainer = button;\n\n button.setAttribute('data-copied', 'true');\n if (label) label.textContent = 'Copied!';\n iconContainer.innerHTML = `${CHECK_ICON}<span>Copied!</span>`;\n\n this._options.onCopy?.(command);\n\n setTimeout(() => {\n button.setAttribute('data-copied', 'false');\n iconContainer.innerHTML = `${COPY_ICON}<span>Copy</span>`;\n }, 2000);\n } catch {\n const textarea = document.createElement('textarea');\n textarea.value = command;\n textarea.style.position = 'fixed';\n textarea.style.opacity = '0';\n document.body.appendChild(textarea);\n textarea.select();\n document.execCommand('copy');\n document.body.removeChild(textarea);\n\n this._options.onCopy?.(command);\n }\n }\n\n close() {\n const dialog = this.shadowRoot?.querySelector('.hb-dialog') as HTMLElement;\n const backdrop = this.shadowRoot?.querySelector('.hb-backdrop') as HTMLElement;\n\n if (dialog) {\n dialog.style.animation = 'hb-scale-in 0.15s ease-in reverse';\n }\n if (backdrop) {\n backdrop.style.animation = 'hb-fade-in 0.15s ease-in reverse';\n }\n\n setTimeout(() => {\n this._options.onClose?.();\n this.remove();\n }, 140);\n }\n\n private escapeHtml(str: string): string {\n const div = document.createElement('div');\n div.textContent = str;\n return div.innerHTML;\n }\n\n private escapeAttr(str: string): string {\n return str.replace(/\"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n }\n}\n\nif (typeof customElements !== 'undefined' && !customElements.get('hermes-popup-dialog')) {\n customElements.define('hermes-popup-dialog', HermesPopupDialog);\n}\n\nexport function showPopup(options: PopupOptions): HermesPopupDialog {\n const popup = document.createElement('hermes-popup-dialog') as HermesPopupDialog;\n popup.options = options;\n document.body.appendChild(popup);\n return popup;\n}\n"],"mappings":"AAAO,IAAMA,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAgBdC,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAapBC,EAAY;AAAA;AAAA;AAAA,QAKZC,EAAa;AAAA;QASnB,IAAMC,EAAa;AAAA;QCxCnB,IAAMC,EAAc,UACdC,EAAoB,UACpBC,EAAqB,UAErBC,EAAY,eAGZC,EAAkB,UAClBC,EAAwB,UACxBC,EAA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,CAAC,eAAe,IAAI,qBAAqB,GACpF,eAAe,OAAO,sBAAuBpC,CAAiB,EAGzD,SAASsC,EAAUC,EAA0C,CAClE,IAAMC,EAAQ,SAAS,cAAc,qBAAqB,EAC1D,OAAAA,EAAM,QAAUD,EAChB,SAAS,KAAK,YAAYC,CAAK,EACxBA,CACT","names":["HERMES_ICON","HERMES_SKILL_ICON","COPY_ICON","CHECK_ICON","CLOSE_ICON","BRAND_COLOR","BRAND_COLOR_HOVER","BRAND_COLOR_ACTIVE","BRAND_RGB","ALT_BRAND_COLOR","ALT_BRAND_COLOR_HOVER","ALT_BRAND_COLOR_ACTIVE","ALT_BRAND_RGB","themes","resolveTheme","theme","themeToCSS","tokens","SHAPE_MAP","SIZE_MAP","POPUP_STYLES","BRAND_COLOR_HOVER","HermesPopupDialog","opts","theme","resolveTheme","prefersDark","base","brand","variant","title","description","command","fullCommand","skillUrl","tokens","icon","HERMES_ICON","HERMES_SKILL_ICON","isHermesTerminal","displayCommand","themeToCSS","CLOSE_ICON","COPY_ICON","steps","fullPrompt","target","action","cmd","mq","handler","button","label","iconContainer","CHECK_ICON","textarea","dialog","backdrop","str","div","showPopup","options","popup"]}
@@ -1,4 +1,4 @@
1
- import{a as u,c as r,d as g,e as v,f,g as k,h as x,i as w,j as y}from"./chunk-3CPSZAJ2.mjs";var C=`
1
+ import{a as f,c as i,d as k,e as x,f as r,g as p,h as _,i as A,j as d,k as $,l as C,m as w,n as y,o as E}from"./chunk-7JMZRFCQ.mjs";var O=`
2
2
  :host {
3
3
  display: inline-block;
4
4
  vertical-align: middle;
@@ -43,19 +43,19 @@ import{a as u,c as r,d as g,e as v,f,g as k,h as x,i as w,j as y}from"./chunk-3C
43
43
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
44
44
  }
45
45
  :host([data-variant="filled"][data-theme="branded"]) .hb-btn:hover {
46
- background: ${g};
47
- box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
46
+ background: ${k};
47
+ box-shadow: 0 2px 8px rgba(${r}, 0.35);
48
48
  }
49
49
  :host([data-variant="filled"][data-theme="branded"]) .hb-btn:active {
50
- background: ${v};
50
+ background: ${x};
51
51
  transform: scale(0.98);
52
52
  }
53
53
  :host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:hover {
54
- background: #0D9488;
55
- box-shadow: 0 2px 8px rgba(20, 184, 166, 0.35);
54
+ background: ${_};
55
+ box-shadow: 0 2px 8px rgba(${d}, 0.35);
56
56
  }
57
57
  :host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:active {
58
- background: #0F766E;
58
+ background: ${A};
59
59
  transform: scale(0.98);
60
60
  }
61
61
 
@@ -63,12 +63,12 @@ import{a as u,c as r,d as g,e as v,f,g as k,h as x,i as w,j as y}from"./chunk-3C
63
63
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
64
64
  }
65
65
  :host([data-variant="filled"][data-theme="dark"]) .hb-btn:hover {
66
- background: #292524;
67
- border-color: #57534E;
66
+ background: #1E2A42;
67
+ border-color: #475569;
68
68
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
69
69
  }
70
70
  :host([data-variant="filled"][data-theme="dark"]) .hb-btn:active {
71
- background: #1C1917;
71
+ background: #141C2E;
72
72
  transform: scale(0.98);
73
73
  }
74
74
 
@@ -76,11 +76,11 @@ import{a as u,c as r,d as g,e as v,f,g as k,h as x,i as w,j as y}from"./chunk-3C
76
76
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
77
77
  }
78
78
  :host([data-variant="filled"][data-theme="light"]) .hb-btn:hover {
79
- border-color: #D6D3D1;
79
+ border-color: #94A3B8;
80
80
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
81
81
  }
82
82
  :host([data-variant="filled"][data-theme="light"]) .hb-btn:active {
83
- background: #FAFAF9;
83
+ background: #F8FAFC;
84
84
  transform: scale(0.98);
85
85
  }
86
86
 
@@ -88,57 +88,57 @@ import{a as u,c as r,d as g,e as v,f,g as k,h as x,i as w,j as y}from"./chunk-3C
88
88
 
89
89
  :host([data-variant="outline"][data-theme="branded"]) .hb-btn {
90
90
  background: transparent;
91
- border-color: ${r};
92
- color: ${r};
91
+ border-color: ${i};
92
+ color: ${i};
93
93
  }
94
94
  :host([data-variant="outline"][data-theme="branded"]) .hb-btn:hover {
95
- background: rgba(124, 58, 237, 0.08);
96
- box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
95
+ background: rgba(${r}, 0.08);
96
+ box-shadow: 0 2px 8px rgba(${r}, 0.15);
97
97
  }
98
98
  :host([data-variant="outline"][data-theme="branded"]) .hb-btn:active {
99
- background: rgba(124, 58, 237, 0.14);
99
+ background: rgba(${r}, 0.14);
100
100
  transform: scale(0.98);
101
101
  }
102
102
 
103
103
  :host([data-variant="outline"][data-theme="branded-alt"]) .hb-btn {
104
104
  background: transparent;
105
- border-color: #14B8A6;
106
- color: #14B8A6;
105
+ border-color: ${p};
106
+ color: ${p};
107
107
  }
108
108
  :host([data-variant="outline"][data-theme="branded-alt"]) .hb-btn:hover {
109
- background: rgba(20, 184, 166, 0.08);
110
- box-shadow: 0 2px 8px rgba(20, 184, 166, 0.15);
109
+ background: rgba(${d}, 0.08);
110
+ box-shadow: 0 2px 8px rgba(${d}, 0.15);
111
111
  }
112
112
  :host([data-variant="outline"][data-theme="branded-alt"]) .hb-btn:active {
113
- background: rgba(20, 184, 166, 0.14);
113
+ background: rgba(${d}, 0.14);
114
114
  transform: scale(0.98);
115
115
  }
116
116
 
117
117
  :host([data-variant="outline"][data-theme="dark"]) .hb-btn {
118
118
  background: transparent;
119
- border-color: #57534E;
120
- color: #F5F0EB;
119
+ border-color: #475569;
120
+ color: #F1F5F9;
121
121
  }
122
122
  :host([data-variant="outline"][data-theme="dark"]) .hb-btn:hover {
123
- border-color: ${r};
124
- background: rgba(124, 58, 237, 0.08);
123
+ border-color: ${i};
124
+ background: rgba(${r}, 0.08);
125
125
  }
126
126
  :host([data-variant="outline"][data-theme="dark"]) .hb-btn:active {
127
- background: rgba(124, 58, 237, 0.14);
127
+ background: rgba(${r}, 0.14);
128
128
  transform: scale(0.98);
129
129
  }
130
130
 
131
131
  :host([data-variant="outline"][data-theme="light"]) .hb-btn {
132
132
  background: transparent;
133
- border-color: #D6D3D1;
134
- color: #1C1917;
133
+ border-color: #CBD5E1;
134
+ color: #0F172A;
135
135
  }
136
136
  :host([data-variant="outline"][data-theme="light"]) .hb-btn:hover {
137
- border-color: ${r};
138
- background: rgba(124, 58, 237, 0.05);
137
+ border-color: ${i};
138
+ background: rgba(${r}, 0.05);
139
139
  }
140
140
  :host([data-variant="outline"][data-theme="light"]) .hb-btn:active {
141
- background: rgba(124, 58, 237, 0.1);
141
+ background: rgba(${r}, 0.1);
142
142
  transform: scale(0.98);
143
143
  }
144
144
 
@@ -150,29 +150,29 @@ import{a as u,c as r,d as g,e as v,f,g as k,h as x,i as w,j as y}from"./chunk-3C
150
150
  }
151
151
 
152
152
  :host([data-variant="ghost"][data-theme="branded"]) .hb-btn {
153
- color: ${r};
153
+ color: ${i};
154
154
  }
155
155
  :host([data-variant="ghost"][data-theme="branded"]) .hb-btn:hover {
156
- background: rgba(124, 58, 237, 0.1);
156
+ background: rgba(${r}, 0.1);
157
157
  }
158
158
  :host([data-variant="ghost"][data-theme="branded"]) .hb-btn:active {
159
- background: rgba(124, 58, 237, 0.16);
159
+ background: rgba(${r}, 0.16);
160
160
  transform: scale(0.98);
161
161
  }
162
162
 
163
163
  :host([data-variant="ghost"][data-theme="branded-alt"]) .hb-btn {
164
- color: #14B8A6;
164
+ color: ${p};
165
165
  }
166
166
  :host([data-variant="ghost"][data-theme="branded-alt"]) .hb-btn:hover {
167
- background: rgba(20, 184, 166, 0.1);
167
+ background: rgba(${d}, 0.1);
168
168
  }
169
169
  :host([data-variant="ghost"][data-theme="branded-alt"]) .hb-btn:active {
170
- background: rgba(20, 184, 166, 0.16);
170
+ background: rgba(${d}, 0.16);
171
171
  transform: scale(0.98);
172
172
  }
173
173
 
174
174
  :host([data-variant="ghost"][data-theme="dark"]) .hb-btn {
175
- color: #F5F0EB;
175
+ color: #F1F5F9;
176
176
  }
177
177
  :host([data-variant="ghost"][data-theme="dark"]) .hb-btn:hover {
178
178
  background: rgba(255, 255, 255, 0.06);
@@ -183,7 +183,7 @@ import{a as u,c as r,d as g,e as v,f,g as k,h as x,i as w,j as y}from"./chunk-3C
183
183
  }
184
184
 
185
185
  :host([data-variant="ghost"][data-theme="light"]) .hb-btn {
186
- color: #1C1917;
186
+ color: #0F172A;
187
187
  }
188
188
  :host([data-variant="ghost"][data-theme="light"]) .hb-btn:hover {
189
189
  background: rgba(0, 0, 0, 0.04);
@@ -196,7 +196,7 @@ import{a as u,c as r,d as g,e as v,f,g as k,h as x,i as w,j as y}from"./chunk-3C
196
196
  /* \u2500\u2500\u2500 FOCUS \u2500\u2500\u2500 */
197
197
 
198
198
  .hb-btn:focus-visible {
199
- outline: 2px solid var(--hb-focus-color, ${r});
199
+ outline: 2px solid var(--hb-focus-color, ${i});
200
200
  outline-offset: 2px;
201
201
  }
202
202
 
@@ -219,15 +219,15 @@ import{a as u,c as r,d as g,e as v,f,g as k,h as x,i as w,j as y}from"./chunk-3C
219
219
  --hb-icon-accent: rgba(255,255,255,0.2);
220
220
  }
221
221
  :host([data-variant="filled"][data-theme="dark"]) .hb-btn-icon {
222
- color: var(--hb-accent-color, ${r});
222
+ color: var(--hb-accent-color, ${i});
223
223
  }
224
224
  :host([data-variant="filled"][data-theme="light"]) .hb-btn-icon {
225
- color: var(--hb-accent-color, ${r});
225
+ color: var(--hb-accent-color, ${i});
226
226
  }
227
227
 
228
228
  :host([data-variant="outline"]) .hb-btn-icon,
229
229
  :host([data-variant="ghost"]) .hb-btn-icon {
230
- color: var(--hb-accent-color, ${r});
230
+ color: var(--hb-accent-color, ${i});
231
231
  }
232
232
 
233
233
  /* \u2500\u2500\u2500 LABEL \u2500\u2500\u2500 */
@@ -235,29 +235,29 @@ import{a as u,c as r,d as g,e as v,f,g as k,h as x,i as w,j as y}from"./chunk-3C
235
235
  .hb-btn-label {
236
236
  letter-spacing: -0.01em;
237
237
  }
238
- `,l=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:!0,promptFlag:!0};this._mqCleanup=null;this._rendered=!1;this.attachShadow({mode:"open"})}connectedCallback(){this.syncFromAttributes(),this.render(),this.updateLightDOM()}disconnectedCallback(){this._mqCleanup?.(),this._mqCleanup=null}attributeChangedCallback(){this._rendered&&(this.syncFromAttributes(),this.render(),this.updateLightDOM())}set options(e){this._options={...this._options,...e},this.render(),this.updateLightDOM()}get options(){return this._options}syncFromAttributes(){let e=this.getAttribute("command"),a=this.getAttribute("theme"),t=this.getAttribute("size"),o=this.getAttribute("variant"),n=this.getAttribute("shape"),s=this.getAttribute("popup"),i=this.getAttribute("prompt-flag"),d=this.getAttribute("popup-title"),b=this.getAttribute("popup-description");e!==null&&(this._options.command=e),a&&(this._options.theme=a),t&&(this._options.size=t),o&&(this._options.variant=o),n&&(this._options.shape=n),s!==null&&(this._options.popup=s!=="false"),i!==null&&(this._options.promptFlag=i!=="false"),d!==null&&(this._options.popupTitle=d),b!==null&&(this._options.popupDescription=b)}updateLightDOM(){let{command:e}=this._options,a=this.getFullCommand();this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Hermes: ${e}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let t=this.querySelector("a[data-hb-crawl]");t||(t=document.createElement("a"),t.setAttribute("data-hb-crawl",""),t.setAttribute("aria-hidden","true"),t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(t)),t.href=`https://hermes.ai/run?command=${encodeURIComponent(a)}`,t.textContent=`Run on Hermes: ${e}`,t.setAttribute("data-platform","hermes"),t.setAttribute("data-command",e),t.setAttribute("data-full-command",a)}getResolvedTheme(){return this._options.theme||"branded"}getFullCommand(){let{command:e,promptFlag:a}=this._options;return a===!1?e:`hermes -p "${e}"`}render(){if(!this.shadowRoot)return;let e=this.getResolvedTheme(),a=e==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,t=this._options.variant||"filled",o=f(e),n=this._options.size||"md",s=this._options.shape||"rounded",i=w[n],d=x[s][n];this.setAttribute("data-theme",a),this.setAttribute("data-variant",t);let b=t!=="filled"?"transparent":o.bg,_=t==="ghost"?"transparent":t==="outline"?o.primary:o.border,A=t!=="filled"?o.primary:o.text;this.shadowRoot.innerHTML=`
239
- <style>${C}</style>
238
+ `,m=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:!0,promptFlag:!0};this._mqCleanup=null;this._rendered=!1;this.attachShadow({mode:"open"})}connectedCallback(){this.syncFromAttributes(),this.render(),this.updateLightDOM()}disconnectedCallback(){this._mqCleanup?.(),this._mqCleanup=null}attributeChangedCallback(){this._rendered&&(this.syncFromAttributes(),this.render(),this.updateLightDOM())}set options(e){this._options={...this._options,...e},this.render(),this.updateLightDOM()}get options(){return this._options}syncFromAttributes(){let e=this.getAttribute("command"),a=this.getAttribute("theme"),t=this.getAttribute("size"),o=this.getAttribute("variant"),n=this.getAttribute("shape"),h=this.getAttribute("popup"),s=this.getAttribute("prompt-flag"),l=this.getAttribute("popup-title"),c=this.getAttribute("popup-description");e!==null&&(this._options.command=e),a&&(this._options.theme=a),t&&(this._options.size=t),o&&(this._options.variant=o),n&&(this._options.shape=n),h!==null&&(this._options.popup=h!=="false"),s!==null&&(this._options.promptFlag=s!=="false"),l!==null&&(this._options.popupTitle=l),c!==null&&(this._options.popupDescription=c)}updateLightDOM(){let{command:e}=this._options,a=this.getFullCommand();this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Hermes: ${e}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let t=this.querySelector("a[data-hb-crawl]");t||(t=document.createElement("a"),t.setAttribute("data-hb-crawl",""),t.setAttribute("aria-hidden","true"),t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(t)),t.href=`https://hermes.ai/run?command=${encodeURIComponent(a)}`,t.textContent=`Run on Hermes: ${e}`,t.setAttribute("data-platform","hermes"),t.setAttribute("data-command",e),t.setAttribute("data-full-command",a)}getResolvedTheme(){return this._options.theme||"branded"}getFullCommand(){let{command:e,promptFlag:a}=this._options;return a===!1?e:`hermes -p "${e}"`}render(){if(!this.shadowRoot)return;let e=this.getResolvedTheme(),a=e==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,t=this._options.variant||"filled",o=$(e),n=this._options.size||"md",h=this._options.shape||"rounded",s=y[n],l=w[h][n];this.setAttribute("data-theme",a),this.setAttribute("data-variant",t);let c=t!=="filled"?"transparent":o.bg,R=t==="ghost"?"transparent":t==="outline"?o.primary:o.border,T=t!=="filled"?o.primary:o.text;this.shadowRoot.innerHTML=`
239
+ <style>${O}</style>
240
240
  <button
241
241
  class="hb-btn"
242
242
  type="button"
243
243
  style="
244
- ${k(o)}
245
- --hb-bg: ${b};
246
- --hb-border: ${_};
247
- --hb-text: ${A};
244
+ ${C(o)}
245
+ --hb-bg: ${c};
246
+ --hb-border: ${R};
247
+ --hb-text: ${T};
248
248
  --hb-accent-color: ${o.primary};
249
249
  --hb-focus-color: ${o.primary};
250
- --hb-height: ${i.height};
251
- --hb-font-size: ${i.fontSize};
252
- --hb-icon-size: ${i.iconSize};
253
- --hb-padding: ${i.ccPadding};
254
- --hb-gap: ${i.gap};
255
- --hb-radius: ${d};
250
+ --hb-height: ${s.height};
251
+ --hb-font-size: ${s.fontSize};
252
+ --hb-icon-size: ${s.iconSize};
253
+ --hb-padding: ${s.ccPadding};
254
+ --hb-gap: ${s.gap};
255
+ --hb-radius: ${l};
256
256
  "
257
257
  aria-label="Run on Hermes: ${this._options.command.replace(/"/g,"&quot;")}"
258
258
  >
259
- <span class="hb-btn-icon" aria-hidden="true">${u}</span>
259
+ <span class="hb-btn-icon" aria-hidden="true">${f}</span>
260
260
  <span class="hb-btn-label">Run on Hermes</span>
261
261
  </button>
262
- `;let m=this.shadowRoot.querySelector(".hb-btn");m.addEventListener("click",()=>this.handleClick()),m.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:e,command:a,popupTitle:t,popupDescription:o}=this._options,n=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("hb-open",{bubbles:!0,composed:!0,detail:{command:a,fullCommand:n}})),e===!1){navigator.clipboard.writeText(n).then(()=>{this._options.onCopy?.(n),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:n}}))});return}y({variant:"hermes",theme:this.getResolvedTheme(),title:t||"Run on Hermes",description:o||"Execute this command in your terminal to get started with Hermes Agent.",command:a,fullCommand:n,onCopy:s=>{this._options.onCopy?.(s),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:s}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("hb-close",{bubbles:!0,composed:!0}))}})}setupSystemThemeWatch(){if(this._mqCleanup?.(),this._mqCleanup=null,this.getResolvedTheme()!=="system"||typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>this.render();e.addEventListener("change",a),this._mqCleanup=()=>e.removeEventListener("change",a)}};l.observedAttributes=["command","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];function E(h="hermes-button"){typeof customElements>"u"||customElements.get(h)||customElements.define(h,l)}E();function O(h){let c=document.createElement("hermes-button");return c.options=h,c}export{l as HermesButton,O as createHermesButton,E as registerHermesButton};
263
- //# sourceMappingURL=hermes-button-OWZRXNSO.mjs.map
262
+ `;let v=this.shadowRoot.querySelector(".hb-btn");v.addEventListener("click",()=>this.handleClick()),v.addEventListener("keydown",g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:e,command:a,popupTitle:t,popupDescription:o}=this._options,n=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("hb-open",{bubbles:!0,composed:!0,detail:{command:a,fullCommand:n}})),e===!1){navigator.clipboard.writeText(n).then(()=>{this._options.onCopy?.(n),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:n}}))});return}E({variant:"hermes",theme:this.getResolvedTheme(),title:t||"Run on Hermes",description:o||"Execute this command in your terminal to get started with Hermes Agent.",command:a,fullCommand:n,onCopy:h=>{this._options.onCopy?.(h),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:h}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("hb-close",{bubbles:!0,composed:!0}))}})}setupSystemThemeWatch(){if(this._mqCleanup?.(),this._mqCleanup=null,this.getResolvedTheme()!=="system"||typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>this.render();e.addEventListener("change",a),this._mqCleanup=()=>e.removeEventListener("change",a)}};m.observedAttributes=["command","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];function F(b="hermes-button"){typeof customElements>"u"||customElements.get(b)||customElements.define(b,m)}F();function H(b){let u=document.createElement("hermes-button");return u.options=b,u}export{m as HermesButton,H as createHermesButton,F as registerHermesButton};
263
+ //# sourceMappingURL=hermes-button-LIZ6A5MH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hermes-button.ts"],"sourcesContent":["import type { HermesButtonOptions, Theme, Size, Variant, Shape } from './types';\nimport { HERMES_ICON } from './icons';\nimport {\n resolveTheme,\n themeToCSS,\n SIZE_MAP,\n SHAPE_MAP,\n BRAND_COLOR,\n BRAND_COLOR_HOVER,\n BRAND_COLOR_ACTIVE,\n BRAND_RGB,\n ALT_BRAND_COLOR,\n ALT_BRAND_COLOR_HOVER,\n ALT_BRAND_COLOR_ACTIVE,\n ALT_BRAND_RGB,\n} from './themes';\nimport { showPopup } from './popup-dialog';\n\nconst BUTTON_STYLES = `\n :host {\n display: inline-block;\n vertical-align: middle;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n -webkit-tap-highlight-color: transparent;\n }\n\n * { box-sizing: border-box; margin: 0; padding: 0; }\n\n .hb-btn {\n display: inline-flex;\n align-items: center;\n gap: var(--hb-gap);\n height: var(--hb-height);\n min-height: 44px;\n padding: var(--hb-padding);\n border: 1.5px solid var(--hb-border);\n background: var(--hb-bg);\n color: var(--hb-text);\n font-family: inherit;\n font-size: var(--hb-font-size);\n font-weight: 600;\n line-height: 1;\n border-radius: var(--hb-radius);\n cursor: pointer;\n user-select: none;\n white-space: nowrap;\n touch-action: manipulation;\n transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, color 0.15s ease;\n text-decoration: none;\n -webkit-font-smoothing: antialiased;\n }\n\n @media (pointer: fine) {\n .hb-btn { min-height: unset; }\n }\n\n /* ─── FILLED ─── */\n\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .hb-btn,\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .hb-btn {\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .hb-btn:hover {\n background: ${BRAND_COLOR_HOVER};\n box-shadow: 0 2px 8px rgba(${BRAND_RGB}, 0.35);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .hb-btn:active {\n background: ${BRAND_COLOR_ACTIVE};\n transform: scale(0.98);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .hb-btn:hover {\n background: ${ALT_BRAND_COLOR_HOVER};\n box-shadow: 0 2px 8px rgba(${ALT_BRAND_RGB}, 0.35);\n }\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .hb-btn:active {\n background: ${ALT_BRAND_COLOR_ACTIVE};\n transform: scale(0.98);\n }\n\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .hb-btn {\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .hb-btn:hover {\n background: #1E2A42;\n border-color: #475569;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .hb-btn:active {\n background: #141C2E;\n transform: scale(0.98);\n }\n\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .hb-btn {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .hb-btn:hover {\n border-color: #94A3B8;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .hb-btn:active {\n background: #F8FAFC;\n transform: scale(0.98);\n }\n\n /* ─── OUTLINE ─── */\n\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .hb-btn {\n background: transparent;\n border-color: ${BRAND_COLOR};\n color: ${BRAND_COLOR};\n }\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .hb-btn:hover {\n background: rgba(${BRAND_RGB}, 0.08);\n box-shadow: 0 2px 8px rgba(${BRAND_RGB}, 0.15);\n }\n :host([data-variant=\"outline\"][data-theme=\"branded\"]) .hb-btn:active {\n background: rgba(${BRAND_RGB}, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .hb-btn {\n background: transparent;\n border-color: ${ALT_BRAND_COLOR};\n color: ${ALT_BRAND_COLOR};\n }\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .hb-btn:hover {\n background: rgba(${ALT_BRAND_RGB}, 0.08);\n box-shadow: 0 2px 8px rgba(${ALT_BRAND_RGB}, 0.15);\n }\n :host([data-variant=\"outline\"][data-theme=\"branded-alt\"]) .hb-btn:active {\n background: rgba(${ALT_BRAND_RGB}, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .hb-btn {\n background: transparent;\n border-color: #475569;\n color: #F1F5F9;\n }\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .hb-btn:hover {\n border-color: ${BRAND_COLOR};\n background: rgba(${BRAND_RGB}, 0.08);\n }\n :host([data-variant=\"outline\"][data-theme=\"dark\"]) .hb-btn:active {\n background: rgba(${BRAND_RGB}, 0.14);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .hb-btn {\n background: transparent;\n border-color: #CBD5E1;\n color: #0F172A;\n }\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .hb-btn:hover {\n border-color: ${BRAND_COLOR};\n background: rgba(${BRAND_RGB}, 0.05);\n }\n :host([data-variant=\"outline\"][data-theme=\"light\"]) .hb-btn:active {\n background: rgba(${BRAND_RGB}, 0.1);\n transform: scale(0.98);\n }\n\n /* ─── GHOST ─── */\n\n :host([data-variant=\"ghost\"]) .hb-btn {\n background: transparent;\n border-color: transparent;\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .hb-btn {\n color: ${BRAND_COLOR};\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .hb-btn:hover {\n background: rgba(${BRAND_RGB}, 0.1);\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded\"]) .hb-btn:active {\n background: rgba(${BRAND_RGB}, 0.16);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .hb-btn {\n color: ${ALT_BRAND_COLOR};\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .hb-btn:hover {\n background: rgba(${ALT_BRAND_RGB}, 0.1);\n }\n :host([data-variant=\"ghost\"][data-theme=\"branded-alt\"]) .hb-btn:active {\n background: rgba(${ALT_BRAND_RGB}, 0.16);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .hb-btn {\n color: #F1F5F9;\n }\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .hb-btn:hover {\n background: rgba(255, 255, 255, 0.06);\n }\n :host([data-variant=\"ghost\"][data-theme=\"dark\"]) .hb-btn:active {\n background: rgba(255, 255, 255, 0.1);\n transform: scale(0.98);\n }\n\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .hb-btn {\n color: #0F172A;\n }\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .hb-btn:hover {\n background: rgba(0, 0, 0, 0.04);\n }\n :host([data-variant=\"ghost\"][data-theme=\"light\"]) .hb-btn:active {\n background: rgba(0, 0, 0, 0.08);\n transform: scale(0.98);\n }\n\n /* ─── FOCUS ─── */\n\n .hb-btn:focus-visible {\n outline: 2px solid var(--hb-focus-color, ${BRAND_COLOR});\n outline-offset: 2px;\n }\n\n /* ─── ICON ─── */\n\n .hb-btn-icon {\n width: var(--hb-icon-size);\n height: var(--hb-icon-size);\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .hb-btn-icon svg { width: 100%; height: 100%; }\n\n :host([data-variant=\"filled\"][data-theme=\"branded\"]) .hb-btn-icon,\n :host([data-variant=\"filled\"][data-theme=\"branded-alt\"]) .hb-btn-icon {\n color: #FFFFFF;\n --hb-icon-accent: rgba(255,255,255,0.2);\n }\n :host([data-variant=\"filled\"][data-theme=\"dark\"]) .hb-btn-icon {\n color: var(--hb-accent-color, ${BRAND_COLOR});\n }\n :host([data-variant=\"filled\"][data-theme=\"light\"]) .hb-btn-icon {\n color: var(--hb-accent-color, ${BRAND_COLOR});\n }\n\n :host([data-variant=\"outline\"]) .hb-btn-icon,\n :host([data-variant=\"ghost\"]) .hb-btn-icon {\n color: var(--hb-accent-color, ${BRAND_COLOR});\n }\n\n /* ─── LABEL ─── */\n\n .hb-btn-label {\n letter-spacing: -0.01em;\n }\n`;\n\nexport class HermesButton extends HTMLElement {\n static observedAttributes = ['command', 'theme', 'size', 'variant', 'shape', 'popup', 'prompt-flag', 'popup-title', 'popup-description'];\n\n private _options: HermesButtonOptions = {\n command: '',\n theme: 'branded',\n size: 'md',\n variant: 'filled',\n popup: true,\n promptFlag: true,\n };\n\n private _mqCleanup: (() => void) | null = null;\n private _rendered = false;\n\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n\n connectedCallback() {\n this.syncFromAttributes();\n this.render();\n this.updateLightDOM();\n }\n\n disconnectedCallback() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n }\n\n attributeChangedCallback() {\n if (!this._rendered) return;\n this.syncFromAttributes();\n this.render();\n this.updateLightDOM();\n }\n\n set options(opts: Partial<HermesButtonOptions>) {\n this._options = { ...this._options, ...opts };\n this.render();\n this.updateLightDOM();\n }\n\n get options() {\n return this._options;\n }\n\n private syncFromAttributes() {\n const command = this.getAttribute('command');\n const theme = this.getAttribute('theme') as Theme | null;\n const size = this.getAttribute('size') as Size | null;\n const variant = this.getAttribute('variant') as Variant | null;\n const shape = this.getAttribute('shape') as Shape | null;\n const popup = this.getAttribute('popup');\n const promptFlag = this.getAttribute('prompt-flag');\n const popupTitle = this.getAttribute('popup-title');\n const popupDescription = this.getAttribute('popup-description');\n\n if (command !== null) this._options.command = command;\n if (theme) this._options.theme = theme;\n if (size) this._options.size = size;\n if (variant) this._options.variant = variant;\n if (shape) this._options.shape = shape;\n if (popup !== null) this._options.popup = popup !== 'false';\n if (promptFlag !== null) this._options.promptFlag = promptFlag !== 'false';\n if (popupTitle !== null) this._options.popupTitle = popupTitle;\n if (popupDescription !== null) this._options.popupDescription = popupDescription;\n }\n\n private updateLightDOM() {\n const { command } = this._options;\n const fullCommand = this.getFullCommand();\n\n this.setAttribute('role', 'button');\n this.setAttribute('tabindex', '0');\n this.setAttribute('aria-label', `Run on Hermes: ${command}`);\n if (this._options.popup !== false) {\n this.setAttribute('aria-haspopup', 'dialog');\n } else {\n this.removeAttribute('aria-haspopup');\n }\n\n let link = this.querySelector('a[data-hb-crawl]') as HTMLAnchorElement | null;\n if (!link) {\n link = document.createElement('a');\n link.setAttribute('data-hb-crawl', '');\n link.setAttribute('aria-hidden', 'true');\n link.style.cssText = 'position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;';\n this.appendChild(link);\n }\n link.href = `https://hermes.ai/run?command=${encodeURIComponent(fullCommand)}`;\n link.textContent = `Run on Hermes: ${command}`;\n link.setAttribute('data-platform', 'hermes');\n link.setAttribute('data-command', command);\n link.setAttribute('data-full-command', fullCommand);\n }\n\n private getResolvedTheme(): Theme {\n return this._options.theme || 'branded';\n }\n\n private getFullCommand(): string {\n const { command, promptFlag } = this._options;\n if (promptFlag === false) return command;\n return `hermes -p \"${command}\"`;\n }\n\n private render() {\n if (!this.shadowRoot) return;\n\n const theme = this.getResolvedTheme();\n const resolvedTheme = theme === 'system' ? (\n typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n ) : theme;\n const variant = this._options.variant || 'filled';\n\n const tokens = resolveTheme(theme);\n const size = this._options.size || 'md';\n const shape = this._options.shape || 'rounded';\n const sizeTokens = SIZE_MAP[size];\n const radius = SHAPE_MAP[shape][size];\n\n this.setAttribute('data-theme', resolvedTheme);\n this.setAttribute('data-variant', variant);\n\n const bgOverride = variant !== 'filled' ? 'transparent' : tokens.bg;\n const borderOverride = variant === 'ghost' ? 'transparent' :\n variant === 'outline' ? tokens.primary : tokens.border;\n const textOverride = variant !== 'filled' ? tokens.primary : tokens.text;\n\n this.shadowRoot.innerHTML = `\n <style>${BUTTON_STYLES}</style>\n <button\n class=\"hb-btn\"\n type=\"button\"\n style=\"\n ${themeToCSS(tokens)}\n --hb-bg: ${bgOverride};\n --hb-border: ${borderOverride};\n --hb-text: ${textOverride};\n --hb-accent-color: ${tokens.primary};\n --hb-focus-color: ${tokens.primary};\n --hb-height: ${sizeTokens.height};\n --hb-font-size: ${sizeTokens.fontSize};\n --hb-icon-size: ${sizeTokens.iconSize};\n --hb-padding: ${sizeTokens.ccPadding};\n --hb-gap: ${sizeTokens.gap};\n --hb-radius: ${radius};\n \"\n aria-label=\"Run on Hermes: ${this._options.command.replace(/\"/g, '&quot;')}\"\n >\n <span class=\"hb-btn-icon\" aria-hidden=\"true\">${HERMES_ICON}</span>\n <span class=\"hb-btn-label\">Run on Hermes</span>\n </button>\n `;\n\n const btn = this.shadowRoot.querySelector('.hb-btn')!;\n btn.addEventListener('click', () => this.handleClick());\n btn.addEventListener('keydown', (e) => {\n if ((e as KeyboardEvent).key === 'Enter' || (e as KeyboardEvent).key === ' ') {\n e.preventDefault();\n this.handleClick();\n }\n });\n this._rendered = true;\n this.setupSystemThemeWatch();\n }\n\n private handleClick() {\n const { popup, command, popupTitle, popupDescription } = this._options;\n const fullCommand = this.getFullCommand();\n\n this.dispatchEvent(new CustomEvent('hb-open', {\n bubbles: true,\n composed: true,\n detail: { command, fullCommand },\n }));\n\n if (popup === false) {\n navigator.clipboard.writeText(fullCommand).then(() => {\n this._options.onCopy?.(fullCommand);\n this.dispatchEvent(new CustomEvent('hb-copy', {\n bubbles: true,\n composed: true,\n detail: { command: fullCommand },\n }));\n });\n return;\n }\n\n showPopup({\n variant: 'hermes',\n theme: this.getResolvedTheme(),\n title: popupTitle || 'Run on Hermes',\n description: popupDescription || 'Execute this command in your terminal to get started with Hermes Agent.',\n command,\n fullCommand,\n onCopy: (cmd: string) => {\n this._options.onCopy?.(cmd);\n this.dispatchEvent(new CustomEvent('hb-copy', {\n bubbles: true,\n composed: true,\n detail: { command: cmd },\n }));\n },\n onClose: () => {\n this.dispatchEvent(new CustomEvent('hb-close', {\n bubbles: true,\n composed: true,\n }));\n },\n });\n }\n\n private setupSystemThemeWatch() {\n this._mqCleanup?.();\n this._mqCleanup = null;\n\n if (this.getResolvedTheme() !== 'system' || typeof window === 'undefined') return;\n\n const mq = window.matchMedia('(prefers-color-scheme: dark)');\n const handler = () => this.render();\n mq.addEventListener('change', handler);\n this._mqCleanup = () => mq.removeEventListener('change', handler);\n }\n}\n\nexport function registerHermesButton(tagName = 'hermes-button') {\n if (typeof customElements === 'undefined') return;\n if (!customElements.get(tagName)) {\n customElements.define(tagName, HermesButton);\n }\n}\n\nregisterHermesButton();\n\nexport function createHermesButton(options: HermesButtonOptions): HermesButton {\n const el = document.createElement('hermes-button') as HermesButton;\n el.options = options;\n return el;\n}\n"],"mappings":"oIAkBA,IAAMA,EAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBA6CJC,CAAiB;AAAA,iCACFC,CAAS;AAAA;AAAA;AAAA,kBAGxBC,CAAkB;AAAA;AAAA;AAAA;AAAA,kBAIlBC,CAAqB;AAAA,iCACNC,CAAa;AAAA;AAAA;AAAA,kBAG5BC,CAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAiCpBC,CAAW;AAAA,aAClBA,CAAW;AAAA;AAAA;AAAA,uBAGDL,CAAS;AAAA,iCACCA,CAAS;AAAA;AAAA;AAAA,uBAGnBA,CAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAMZM,CAAe;AAAA,aACtBA,CAAe;AAA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B","ALT_BRAND_COLOR_ACTIVE","BRAND_COLOR","ALT_BRAND_COLOR","HermesButton","opts","command","theme","size","variant","shape","popup","promptFlag","popupTitle","popupDescription","fullCommand","link","resolvedTheme","tokens","resolveTheme","sizeTokens","SIZE_MAP","radius","SHAPE_MAP","bgOverride","borderOverride","textOverride","themeToCSS","HERMES_ICON","btn","e","showPopup","cmd","mq","handler","registerHermesButton","tagName","createHermesButton","options","el"]}