hermesbuttons 1.1.0 → 1.1.2

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.
@@ -1,4 +1,4 @@
1
- "use strict";var HermesButtons=(()=>{var z=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var G=(o,n)=>{for(var t in n)z(o,t,{get:n[t],enumerable:!0})},Y=(o,n,t,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of W(n))!K.call(o,e)&&e!==t&&z(o,e,{get:()=>n[e],enumerable:!(a=j(n,e))||a.enumerable});return o};var Z=o=>Y(z({},"__esModule",{value:!0}),o);var et={};G(et,{ALT_BRAND_COLOR:()=>m,BRAND_COLOR:()=>i,HERMES_ICON:()=>f,HERMES_SKILL_ICON:()=>x,HermesButton:()=>C,HermesPopupDialog:()=>T,HermesSkillButton:()=>_,createHermesButton:()=>q,createHermesSkillButton:()=>V,discoverButtons:()=>D,generateStructuredData:()=>N,injectStructuredData:()=>U,register:()=>tt,registerHermesButton:()=>E,registerHermesSkillButton:()=>S,resolveTheme:()=>c,showPopup:()=>w,themes:()=>k});var f=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon">
1
+ "use strict";var HermesButtons=(()=>{var P=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var J=Object.prototype.hasOwnProperty;var Z=(a,n)=>{for(var t in n)P(a,t,{get:n[t],enumerable:!0})},X=(a,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of Y(n))!J.call(a,e)&&e!==t&&P(a,e,{get:()=>n[e],enumerable:!(o=K(n,e))||o.enumerable});return a};var Q=a=>X(P({},"__esModule",{value:!0}),a);var it={};Z(it,{ALT_BRAND_COLOR:()=>m,BRAND_COLOR:()=>i,HERMES_ICON:()=>x,HERMES_SKILL_ICON:()=>k,HermesButton:()=>A,HermesPopupDialog:()=>T,HermesSkillButton:()=>_,createHermesButton:()=>j,createHermesSkillButton:()=>W,discoverButtons:()=>D,generateStructuredData:()=>I,injectStructuredData:()=>G,register:()=>nt,registerHermesButton:()=>R,registerHermesSkillButton:()=>S,resolveTheme:()=>p,showPopup:()=>C,themes:()=>y});var N="agentpreferences";function q(){return typeof document<"u"}function tt(){if(!q())return null;let a=document.cookie.split(";").map(t=>t.trim()).find(t=>t.startsWith(`${N}=`));if(!a)return null;let n=a.slice(N.length+1);if(!n)return null;try{let t=decodeURIComponent(n),o=JSON.parse(t);return!o||typeof o!="object"||!Array.isArray(o.order)?null:{order:o.order.filter(r=>typeof r=="string"&&r.length>0)}}catch{return null}}function et(a){if(!q())return;let n=a.order.slice(0,24),t=JSON.stringify({order:n}),o=new Date;o.setFullYear(o.getFullYear()+1),document.cookie=`${N}=${encodeURIComponent(t)}; Path=/; SameSite=Lax; Expires=${o.toUTCString()}`}function f(a){if(!a||typeof a!="string")return;let t=tt()?.order.filter(o=>o!==a)??[];et({order:[a,...t]})}var x=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon">
2
2
  <!-- Wing helmet -->
3
3
  <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"/>
4
4
  <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"/>
@@ -12,7 +12,7 @@
12
12
  <path d="M9.5 19c1.5 1 3.5 1 5 0" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" fill="none"/>
13
13
  <!-- Eye -->
14
14
  <circle cx="12" cy="7.5" r="1.5" fill="currentColor"/>
15
- </svg>`,x=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon">
15
+ </svg>`,k=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon">
16
16
  <!-- Brain/memory symbol -->
17
17
  <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"/>
18
18
  <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"/>
@@ -26,22 +26,22 @@
26
26
  </svg>`,$=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon-sm">
27
27
  <rect x="5" y="5" width="8" height="8" rx="1.5" stroke="currentColor" stroke-width="1.5" fill="none"/>
28
28
  <path d="M3 10V3.5A1.5 1.5 0 014.5 2H10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
29
- </svg>`,P=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon-sm">
29
+ </svg>`,U=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon-sm">
30
30
  <path d="M3 8.5l3.5 3.5L13 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
31
- </svg>`;var I=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon-sm">
31
+ </svg>`;var V=`<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 i="#2B8CFF",v="#1E7AEB",R="#186BD4",s="43, 140, 255",m="#8FA3E8",O="#7B91DC",L="#6B82CC",p="143, 163, 232",k={branded:{bg:i,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#0F172A",muted:"#64748B",primary:i,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"},"branded-alt":{bg:m,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#0F172A",muted:"#64748B",primary:m,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"},dark:{bg:"#141C2E",text:"#F1F5F9",border:"#2A3F5C",surface:"#1A2740",surfaceText:"#F1F5F9",muted:"#94A3B8",primary:i,primaryText:"#FFFFFF",codeBg:"#0A0E18",codeText:"#F1F5F9"},light:{bg:"#FFFFFF",text:"#0F172A",border:"#CBD5E1",surface:"#F8FAFC",surfaceText:"#0F172A",muted:"#64748B",primary:i,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"}};function c(o){return o!=="system"?k[o]:typeof window>"u"?k.light:window.matchMedia("(prefers-color-scheme: dark)").matches?k.dark:k.light}function y(o){return`
34
- --hb-bg: ${o.bg};
35
- --hb-text: ${o.text};
36
- --hb-border: ${o.border};
37
- --hb-surface: ${o.surface};
38
- --hb-surface-text: ${o.surfaceText};
39
- --hb-muted: ${o.muted};
40
- --hb-primary: ${o.primary};
41
- --hb-primary-text: ${o.primaryText};
42
- --hb-code-bg: ${o.codeBg};
43
- --hb-code-text: ${o.codeText};
44
- `}var B={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},H={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 J=`
33
+ </svg>`;var i="#2B8CFF",v="#1E7AEB",O="#186BD4",s="43, 140, 255",m="#8FA3E8",L="#7B91DC",B="#6B82CC",c="143, 163, 232",y={branded:{bg:i,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#0F172A",muted:"#64748B",primary:i,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"},"branded-alt":{bg:m,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#0F172A",muted:"#64748B",primary:m,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"},dark:{bg:"#141C2E",text:"#F1F5F9",border:"#2A3F5C",surface:"#1A2740",surfaceText:"#F1F5F9",muted:"#94A3B8",primary:i,primaryText:"#FFFFFF",codeBg:"#0A0E18",codeText:"#F1F5F9"},light:{bg:"#FFFFFF",text:"#0F172A",border:"#CBD5E1",surface:"#F8FAFC",surfaceText:"#0F172A",muted:"#64748B",primary:i,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"}};function p(a){return a!=="system"?y[a]:typeof window>"u"?y.light:window.matchMedia("(prefers-color-scheme: dark)").matches?y.dark:y.light}function w(a){return`
34
+ --hb-bg: ${a.bg};
35
+ --hb-text: ${a.text};
36
+ --hb-border: ${a.border};
37
+ --hb-surface: ${a.surface};
38
+ --hb-surface-text: ${a.surfaceText};
39
+ --hb-muted: ${a.muted};
40
+ --hb-primary: ${a.primary};
41
+ --hb-primary-text: ${a.primaryText};
42
+ --hb-code-bg: ${a.codeBg};
43
+ --hb-code-text: ${a.codeText};
44
+ `}var H={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},M={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 ot=`
45
45
  :host {
46
46
  position: fixed;
47
47
  inset: 0;
@@ -318,21 +318,21 @@
318
318
  @supports (padding: env(safe-area-inset-bottom)) {
319
319
  .hb-dialog-footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
320
320
  }
321
- `,T=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this.attachShadow({mode:"open"})}set options(t){this._options=t,this.render()}get options(){return this._options}disconnectedCallback(){this._mqCleanup?.(),this._mqCleanup=null}resolvePopupTokens(){let{theme:t}=this._options;if(t==="dark"||t==="light")return c(t);let a=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(t==="system")return a?c("dark"):c("light");let e=a?c("dark"):c("light"),r=c(t);return{...e,primary:r.primary,primaryText:r.primaryText}}render(){if(!this.shadowRoot||!this._options)return;let{variant:t,title:a,description:e,command:r,fullCommand:d,skillUrl:l}=this._options,h=this.resolvePopupTokens(),u=t==="hermes"?f:x,b=t==="hermes",A=d||r;this.shadowRoot.innerHTML=`
322
- <style>${J}</style>
323
- <div style="${y(h)}">
321
+ `,T=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this.attachShadow({mode:"open"})}set options(t){this._options=t,this.render()}get options(){return this._options}disconnectedCallback(){this._mqCleanup?.(),this._mqCleanup=null}resolvePopupTokens(){let{theme:t}=this._options;if(t==="dark"||t==="light")return p(t);let o=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(t==="system")return o?p("dark"):p("light");let e=o?p("dark"):p("light"),r=p(t);return{...e,primary:r.primary,primaryText:r.primaryText}}render(){if(!this.shadowRoot||!this._options)return;let{variant:t,title:o,description:e,command:r,fullCommand:d,skillUrl:l}=this._options,h=this.resolvePopupTokens(),u=t==="hermes"?x:k,b=t==="hermes",E=d||r;this.shadowRoot.innerHTML=`
322
+ <style>${ot}</style>
323
+ <div style="${w(h)}">
324
324
  <div class="hb-backdrop" data-action="close"></div>
325
325
  <div class="hb-dialog" role="dialog" aria-modal="true" aria-labelledby="hb-dialog-title">
326
326
  <div class="hb-dialog-header">
327
327
  <div class="hb-dialog-header-icon">${u}</div>
328
328
  <div class="hb-dialog-header-text">
329
- <div class="hb-dialog-title" id="hb-dialog-title">${a}</div>
329
+ <div class="hb-dialog-title" id="hb-dialog-title">${o}</div>
330
330
  ${e?`<div class="hb-dialog-description">${e}</div>`:""}
331
331
  </div>
332
- <button class="hb-dialog-close" data-action="close" aria-label="Close">${I}</button>
332
+ <button class="hb-dialog-close" data-action="close" aria-label="Close">${V}</button>
333
333
  </div>
334
334
  <div class="hb-dialog-body">
335
- ${b?this.renderHermesTerminalBody(A):this.renderHermesSkillBody(r,l)}
335
+ ${b?this.renderHermesTerminalBody(E):this.renderHermesSkillBody(r,l)}
336
336
  </div>
337
337
  <div class="hb-dialog-footer">
338
338
  ${b?`
@@ -360,7 +360,7 @@
360
360
  <div class="hb-step-label">Paste and run in your terminal</div>
361
361
  </div>
362
362
  </div>
363
- `}renderHermesSkillBody(t,a){let e="";if(a){let r=`Install the skill from ${a} and run ${t}`;e+=`
363
+ `}renderHermesSkillBody(t,o){let e="";if(o){let r=`Install the skill from ${o} and run ${t}`;e+=`
364
364
  <div class="hb-step">
365
365
  <div class="hb-step-num">1</div>
366
366
  <div class="hb-step-content">
@@ -394,7 +394,7 @@
394
394
  <div class="hb-step-label">Paste and send in your Hermes session</div>
395
395
  </div>
396
396
  </div>
397
- `;return e}setupListeners(){this.shadowRoot&&(this.shadowRoot.addEventListener("click",t=>{let a=t.target.closest("[data-action]");if(!a)return;let e=a.dataset.action;if(e==="close")this.close();else if(e==="copy"){let r=a.dataset.command||"";this.copyToClipboard(r,a)}}),this.shadowRoot.addEventListener("keydown",t=>{t.key==="Escape"&&this.close()}))}setupSystemThemeWatch(){this._mqCleanup?.(),this._mqCleanup=null;let t=this._options.theme;if(!(t==="system"||t==="branded"||t==="branded-alt")||typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>this.render();e.addEventListener("change",r),this._mqCleanup=()=>e.removeEventListener("change",r)}async copyToClipboard(t,a){try{await navigator.clipboard.writeText(t);let e=a.querySelector("span"),r=a;a.setAttribute("data-copied","true"),e&&(e.textContent="Copied!"),r.innerHTML=`${P}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{a.setAttribute("data-copied","false"),r.innerHTML=`${$}<span>Copy</span>`},2e3)}catch{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),this._options.onCopy?.(t)}}close(){let t=this.shadowRoot?.querySelector(".hb-dialog"),a=this.shadowRoot?.querySelector(".hb-backdrop");t&&(t.style.animation="hb-scale-in 0.15s ease-in reverse"),a&&(a.style.animation="hb-fade-in 0.15s ease-in reverse"),setTimeout(()=>{this._options.onClose?.(),this.remove()},140)}escapeHtml(t){let a=document.createElement("div");return a.textContent=t,a.innerHTML}escapeAttr(t){return t.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",T);function w(o){let n=document.createElement("hermes-popup-dialog");return n.options=o,document.body.appendChild(n),n}var Q=`
397
+ `;return e}setupListeners(){this.shadowRoot&&(this.shadowRoot.addEventListener("click",t=>{let o=t.target.closest("[data-action]");if(!o)return;let e=o.dataset.action;if(e==="close")this.close();else if(e==="copy"){let r=o.dataset.command||"";this.copyToClipboard(r,o)}}),this.shadowRoot.addEventListener("keydown",t=>{t.key==="Escape"&&this.close()}))}setupSystemThemeWatch(){this._mqCleanup?.(),this._mqCleanup=null;let t=this._options.theme;if(!(t==="system"||t==="branded"||t==="branded-alt")||typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>this.render();e.addEventListener("change",r),this._mqCleanup=()=>e.removeEventListener("change",r)}async copyToClipboard(t,o){try{await navigator.clipboard.writeText(t);let e=o.querySelector("span"),r=o;o.setAttribute("data-copied","true"),e&&(e.textContent="Copied!"),r.innerHTML=`${U}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{o.setAttribute("data-copied","false"),r.innerHTML=`${$}<span>Copy</span>`},2e3)}catch{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),this._options.onCopy?.(t)}}close(){let t=this.shadowRoot?.querySelector(".hb-dialog"),o=this.shadowRoot?.querySelector(".hb-backdrop");t&&(t.style.animation="hb-scale-in 0.15s ease-in reverse"),o&&(o.style.animation="hb-fade-in 0.15s ease-in reverse"),setTimeout(()=>{this._options.onClose?.(),this.remove()},140)}escapeHtml(t){let o=document.createElement("div");return o.textContent=t,o.innerHTML}escapeAttr(t){return t.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",T);function C(a){let n=document.createElement("hermes-popup-dialog");return n.options=a,document.body.appendChild(n),n}var at=`
398
398
  :host {
399
399
  display: inline-block;
400
400
  vertical-align: middle;
@@ -443,15 +443,15 @@
443
443
  box-shadow: 0 2px 8px rgba(${s}, 0.35);
444
444
  }
445
445
  :host([data-variant="filled"][data-theme="branded"]) .hb-btn:active {
446
- background: ${R};
446
+ background: ${O};
447
447
  transform: scale(0.98);
448
448
  }
449
449
  :host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:hover {
450
- background: ${O};
451
- box-shadow: 0 2px 8px rgba(${p}, 0.35);
450
+ background: ${L};
451
+ box-shadow: 0 2px 8px rgba(${c}, 0.35);
452
452
  }
453
453
  :host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:active {
454
- background: ${L};
454
+ background: ${B};
455
455
  transform: scale(0.98);
456
456
  }
457
457
 
@@ -502,11 +502,11 @@
502
502
  color: ${m};
503
503
  }
504
504
  :host([data-variant="outline"][data-theme="branded-alt"]) .hb-btn:hover {
505
- background: rgba(${p}, 0.08);
506
- box-shadow: 0 2px 8px rgba(${p}, 0.15);
505
+ background: rgba(${c}, 0.08);
506
+ box-shadow: 0 2px 8px rgba(${c}, 0.15);
507
507
  }
508
508
  :host([data-variant="outline"][data-theme="branded-alt"]) .hb-btn:active {
509
- background: rgba(${p}, 0.14);
509
+ background: rgba(${c}, 0.14);
510
510
  transform: scale(0.98);
511
511
  }
512
512
 
@@ -560,10 +560,10 @@
560
560
  color: ${m};
561
561
  }
562
562
  :host([data-variant="ghost"][data-theme="branded-alt"]) .hb-btn:hover {
563
- background: rgba(${p}, 0.1);
563
+ background: rgba(${c}, 0.1);
564
564
  }
565
565
  :host([data-variant="ghost"][data-theme="branded-alt"]) .hb-btn:active {
566
- background: rgba(${p}, 0.16);
566
+ background: rgba(${c}, 0.16);
567
567
  transform: scale(0.98);
568
568
  }
569
569
 
@@ -631,16 +631,16 @@
631
631
  .hb-btn-label {
632
632
  letter-spacing: -0.01em;
633
633
  }
634
- `,C=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(t){this._options={...this._options,...t},this.render(),this.updateLightDOM()}get options(){return this._options}syncFromAttributes(){let t=this.getAttribute("command"),a=this.getAttribute("theme"),e=this.getAttribute("size"),r=this.getAttribute("variant"),d=this.getAttribute("shape"),l=this.getAttribute("popup"),h=this.getAttribute("prompt-flag"),u=this.getAttribute("popup-title"),b=this.getAttribute("popup-description");t!==null&&(this._options.command=t),a&&(this._options.theme=a),e&&(this._options.size=e),r&&(this._options.variant=r),d&&(this._options.shape=d),l!==null&&(this._options.popup=l!=="false"),h!==null&&(this._options.promptFlag=h!=="false"),u!==null&&(this._options.popupTitle=u),b!==null&&(this._options.popupDescription=b)}updateLightDOM(){let{command:t}=this._options,a=this.getFullCommand();this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Hermes: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-hb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-hb-crawl",""),e.setAttribute("aria-hidden","true"),e.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(e)),e.href=`https://hermes.ai/run?command=${encodeURIComponent(a)}`,e.textContent=`Run on Hermes: ${t}`,e.setAttribute("data-platform","hermes"),e.setAttribute("data-command",t),e.setAttribute("data-full-command",a)}getResolvedTheme(){return this._options.theme||"branded"}getFullCommand(){let{command:t,promptFlag:a}=this._options;return a===!1?t:`hermes -p "${t}"`}render(){if(!this.shadowRoot)return;let t=this.getResolvedTheme(),a=t==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,e=this._options.variant||"filled",r=c(t),d=this._options.size||"md",l=this._options.shape||"rounded",h=H[d],u=B[l][d];this.setAttribute("data-theme",a),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,A=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,M=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=`
635
- <style>${Q}</style>
634
+ `,A=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(t){this._options={...this._options,...t},this.render(),this.updateLightDOM()}get options(){return this._options}syncFromAttributes(){let t=this.getAttribute("command"),o=this.getAttribute("theme"),e=this.getAttribute("size"),r=this.getAttribute("variant"),d=this.getAttribute("shape"),l=this.getAttribute("popup"),h=this.getAttribute("prompt-flag"),u=this.getAttribute("popup-title"),b=this.getAttribute("popup-description");t!==null&&(this._options.command=t),o&&(this._options.theme=o),e&&(this._options.size=e),r&&(this._options.variant=r),d&&(this._options.shape=d),l!==null&&(this._options.popup=l!=="false"),h!==null&&(this._options.promptFlag=h!=="false"),u!==null&&(this._options.popupTitle=u),b!==null&&(this._options.popupDescription=b)}updateLightDOM(){let{command:t}=this._options,o=this.getFullCommand();this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Hermes: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-hb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-hb-crawl",""),e.setAttribute("aria-hidden","true"),e.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(e)),e.href=`https://hermes.ai/run?command=${encodeURIComponent(o)}`,e.textContent=`Run on Hermes: ${t}`,e.setAttribute("data-platform","hermes"),e.setAttribute("data-command",t),e.setAttribute("data-full-command",o)}getResolvedTheme(){return this._options.theme||"branded"}getFullCommand(){let{command:t,promptFlag:o}=this._options;return o===!1?t:`hermes -p "${t}"`}render(){if(!this.shadowRoot)return;let t=this.getResolvedTheme(),o=t==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,e=this._options.variant||"filled",r=p(t),d=this._options.size||"md",l=this._options.shape||"rounded",h=M[d],u=H[l][d];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,E=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,z=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=`
635
+ <style>${at}</style>
636
636
  <button
637
637
  class="hb-btn"
638
638
  type="button"
639
639
  style="
640
- ${y(r)}
640
+ ${w(r)}
641
641
  --hb-bg: ${b};
642
- --hb-border: ${A};
643
- --hb-text: ${M};
642
+ --hb-border: ${E};
643
+ --hb-text: ${z};
644
644
  --hb-accent-color: ${r.primary};
645
645
  --hb-focus-color: ${r.primary};
646
646
  --hb-height: ${h.height};
@@ -652,10 +652,10 @@
652
652
  "
653
653
  aria-label="Run on Hermes: ${this._options.command.replace(/"/g,"&quot;")}"
654
654
  >
655
- <span class="hb-btn-icon" aria-hidden="true">${f}</span>
655
+ <span class="hb-btn-icon" aria-hidden="true">${x}</span>
656
656
  <span class="hb-btn-label">Run on Hermes</span>
657
657
  </button>
658
- `;let F=this.shadowRoot.querySelector(".hb-btn");F.addEventListener("click",()=>this.handleClick()),F.addEventListener("keydown",g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:a,popupTitle:e,popupDescription:r}=this._options,d=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("hb-open",{bubbles:!0,composed:!0,detail:{command:a,fullCommand:d}})),t===!1){navigator.clipboard.writeText(d).then(()=>{this._options.onCopy?.(d),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:d}}))});return}w({variant:"hermes",theme:this.getResolvedTheme(),title:e||"Run on Hermes",description:r||"Execute this command in your terminal to get started with Hermes Agent.",command:a,fullCommand:d,onCopy:l=>{this._options.onCopy?.(l),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:l}}))},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 t=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>this.render();t.addEventListener("change",a),this._mqCleanup=()=>t.removeEventListener("change",a)}};C.observedAttributes=["command","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];function E(o="hermes-button"){typeof customElements>"u"||customElements.get(o)||customElements.define(o,C)}E();function q(o){let n=document.createElement("hermes-button");return n.options=o,n}var X=`
658
+ `;let F=this.shadowRoot.querySelector(".hb-btn");F.addEventListener("click",()=>this.handleClick()),F.addEventListener("keydown",g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,popupTitle:e,popupDescription:r}=this._options,d=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("hb-open",{bubbles:!0,composed:!0,detail:{command:o,fullCommand:d}})),t===!1){navigator.clipboard.writeText(d).then(()=>{this._options.onCopy?.(d),f("hermes"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:d}}))});return}C({variant:"hermes",theme:this.getResolvedTheme(),title:e||"Run on Hermes",description:r||"Execute this command in your terminal to get started with Hermes Agent.",command:o,fullCommand:d,onCopy:l=>{this._options.onCopy?.(l),f("hermes"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:l}}))},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 t=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>this.render();t.addEventListener("change",o),this._mqCleanup=()=>t.removeEventListener("change",o)}};A.observedAttributes=["command","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];function R(a="hermes-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,A)}R();function j(a){let n=document.createElement("hermes-button");return n.options=a,n}var rt=`
659
659
  :host {
660
660
  display: inline-block;
661
661
  vertical-align: middle;
@@ -704,15 +704,15 @@
704
704
  box-shadow: 0 2px 8px rgba(${s}, 0.35);
705
705
  }
706
706
  :host([data-variant="filled"][data-theme="branded"]) .hb-btn:active {
707
- background: ${R};
707
+ background: ${O};
708
708
  transform: scale(0.98);
709
709
  }
710
710
  :host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:hover {
711
- background: ${O};
712
- box-shadow: 0 2px 8px rgba(${p}, 0.35);
711
+ background: ${L};
712
+ box-shadow: 0 2px 8px rgba(${c}, 0.35);
713
713
  }
714
714
  :host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:active {
715
- background: ${L};
715
+ background: ${B};
716
716
  transform: scale(0.98);
717
717
  }
718
718
 
@@ -763,11 +763,11 @@
763
763
  color: ${m};
764
764
  }
765
765
  :host([data-variant="outline"][data-theme="branded-alt"]) .hb-btn:hover {
766
- background: rgba(${p}, 0.08);
767
- box-shadow: 0 2px 8px rgba(${p}, 0.15);
766
+ background: rgba(${c}, 0.08);
767
+ box-shadow: 0 2px 8px rgba(${c}, 0.15);
768
768
  }
769
769
  :host([data-variant="outline"][data-theme="branded-alt"]) .hb-btn:active {
770
- background: rgba(${p}, 0.14);
770
+ background: rgba(${c}, 0.14);
771
771
  transform: scale(0.98);
772
772
  }
773
773
 
@@ -821,10 +821,10 @@
821
821
  color: ${m};
822
822
  }
823
823
  :host([data-variant="ghost"][data-theme="branded-alt"]) .hb-btn:hover {
824
- background: rgba(${p}, 0.1);
824
+ background: rgba(${c}, 0.1);
825
825
  }
826
826
  :host([data-variant="ghost"][data-theme="branded-alt"]) .hb-btn:active {
827
- background: rgba(${p}, 0.16);
827
+ background: rgba(${c}, 0.16);
828
828
  transform: scale(0.98);
829
829
  }
830
830
 
@@ -892,16 +892,16 @@
892
892
  .hb-btn-label {
893
893
  letter-spacing: -0.01em;
894
894
  }
895
- `,_=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:!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(t){this._options={...this._options,...t},this.render(),this.updateLightDOM()}get options(){return this._options}syncFromAttributes(){let t=this.getAttribute("command"),a=this.getAttribute("skill-url"),e=this.getAttribute("theme"),r=this.getAttribute("size"),d=this.getAttribute("variant"),l=this.getAttribute("shape"),h=this.getAttribute("popup"),u=this.getAttribute("popup-title"),b=this.getAttribute("popup-description");t!==null&&(this._options.command=t),a!==null&&(this._options.skillUrl=a),e&&(this._options.theme=e),r&&(this._options.size=r),d&&(this._options.variant=d),l&&(this._options.shape=l),h!==null&&(this._options.popup=h!=="false"),u!==null&&(this._options.popupTitle=u),b!==null&&(this._options.popupDescription=b)}updateLightDOM(){let{command:t,skillUrl:a}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Hermes Skills: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-hb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-hb-crawl",""),e.setAttribute("aria-hidden","true"),e.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(e)),e.textContent=`Run on Hermes Skills: ${t}`,e.setAttribute("data-platform","hermes-skill"),e.setAttribute("data-command",t),a?(e.href=a,e.setAttribute("data-skill-url",a)):(e.href=`https://hermes.ai/skills?command=${encodeURIComponent(t)}`,e.removeAttribute("data-skill-url"))}getResolvedTheme(){return this._options.theme||"branded"}render(){if(!this.shadowRoot)return;let t=this.getResolvedTheme(),a=t==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,e=this._options.variant||"filled",r=c(t),d=this._options.size||"md",l=this._options.shape||"rounded",h=H[d],u=B[l][d];this.setAttribute("data-theme",a),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,A=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,M=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=`
896
- <style>${X}</style>
895
+ `,_=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:!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(t){this._options={...this._options,...t},this.render(),this.updateLightDOM()}get options(){return this._options}syncFromAttributes(){let t=this.getAttribute("command"),o=this.getAttribute("skill-url"),e=this.getAttribute("theme"),r=this.getAttribute("size"),d=this.getAttribute("variant"),l=this.getAttribute("shape"),h=this.getAttribute("popup"),u=this.getAttribute("popup-title"),b=this.getAttribute("popup-description");t!==null&&(this._options.command=t),o!==null&&(this._options.skillUrl=o),e&&(this._options.theme=e),r&&(this._options.size=r),d&&(this._options.variant=d),l&&(this._options.shape=l),h!==null&&(this._options.popup=h!=="false"),u!==null&&(this._options.popupTitle=u),b!==null&&(this._options.popupDescription=b)}updateLightDOM(){let{command:t,skillUrl:o}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Hermes Skills: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-hb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-hb-crawl",""),e.setAttribute("aria-hidden","true"),e.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(e)),e.textContent=`Run on Hermes Skills: ${t}`,e.setAttribute("data-platform","hermes-skill"),e.setAttribute("data-command",t),o?(e.href=o,e.setAttribute("data-skill-url",o)):(e.href=`https://hermes.ai/skills?command=${encodeURIComponent(t)}`,e.removeAttribute("data-skill-url"))}getResolvedTheme(){return this._options.theme||"branded"}render(){if(!this.shadowRoot)return;let t=this.getResolvedTheme(),o=t==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,e=this._options.variant||"filled",r=p(t),d=this._options.size||"md",l=this._options.shape||"rounded",h=M[d],u=H[l][d];this.setAttribute("data-theme",o),this.setAttribute("data-variant",e);let b=e!=="filled"?"transparent":r.bg,E=e==="ghost"?"transparent":e==="outline"?r.primary:r.border,z=e!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=`
896
+ <style>${rt}</style>
897
897
  <button
898
898
  class="hb-btn"
899
899
  type="button"
900
900
  style="
901
- ${y(r)}
901
+ ${w(r)}
902
902
  --hb-bg: ${b};
903
- --hb-border: ${A};
904
- --hb-text: ${M};
903
+ --hb-border: ${E};
904
+ --hb-text: ${z};
905
905
  --hb-accent-color: ${r.primary};
906
906
  --hb-focus-color: ${r.primary};
907
907
  --hb-height: ${h.height};
@@ -913,8 +913,8 @@
913
913
  "
914
914
  aria-label="Run on Hermes Skills: ${this._options.command.replace(/"/g,"&quot;")}"
915
915
  >
916
- <span class="hb-btn-icon" aria-hidden="true">${x}</span>
916
+ <span class="hb-btn-icon" aria-hidden="true">${k}</span>
917
917
  <span class="hb-btn-label">Run on Hermes Skills</span>
918
918
  </button>
919
- `;let F=this.shadowRoot.querySelector(".hb-btn");F.addEventListener("click",()=>this.handleClick()),F.addEventListener("keydown",g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:a,skillUrl:e,popupTitle:r,popupDescription:d}=this._options;if(this.dispatchEvent(new CustomEvent("hb-open",{bubbles:!0,composed:!0,detail:{command:a}})),t===!1){navigator.clipboard.writeText(a).then(()=>{this._options.onCopy?.(a),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:a}}))});return}w({variant:"hermes-skill",theme:this.getResolvedTheme(),title:r||"Run on Hermes Skills",description:d||"Copy and paste into a Hermes session to get started.",command:a,skillUrl:e,onCopy:l=>{this._options.onCopy?.(l),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:l}}))},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 t=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>this.render();t.addEventListener("change",a),this._mqCleanup=()=>t.removeEventListener("change",a)}};_.observedAttributes=["command","skill-url","theme","size","variant","shape","popup","popup-title","popup-description"];function S(o="hermes-skill-button"){typeof customElements>"u"||customElements.get(o)||customElements.define(o,_)}S();function V(o){let n=document.createElement("hermes-skill-button");return n.options=o,n}function D(){if(typeof document>"u")return[];let o=[];return document.querySelectorAll("hermes-button").forEach(n=>{let t=n.getAttribute("command")||"",r=n.getAttribute("prompt-flag")!=="false"?`hermes -p "${t}"`:t;o.push({platform:"hermes",command:t,fullCommand:r})}),document.querySelectorAll("hermes-skill-button").forEach(n=>{let t=n.getAttribute("command")||"",a=n.getAttribute("skill-url")||void 0;o.push({platform:"hermes-skill",command:t,...a&&{skillUrl:a}})}),o}function N(){let o=D();return o.length===0?{}:{"@context":"https://schema.org","@type":"WebPage",potentialAction:o.map(t=>{if(t.platform==="hermes")return{"@type":"Action",name:`Run on Hermes: ${t.command}`,description:t.command,target:{"@type":"EntryPoint",urlTemplate:`https://hermes.ai/run?command=${encodeURIComponent(t.fullCommand||t.command)}`,actionPlatform:"https://hermes.ai/run"},object:{"@type":"SoftwareSourceCode",runtimePlatform:"Hermes Agent",text:t.fullCommand||t.command}};let a={"@type":"EntryPoint",actionPlatform:"https://hermes.ai/skills"};t.skillUrl?a.urlTemplate=t.skillUrl:a.urlTemplate=`https://hermes.ai/skills?command=${encodeURIComponent(t.command)}`;let e={"@type":"Action",name:`Run on Hermes Skills: ${t.command}`,description:t.command,target:a};return t.skillUrl&&(e.object={"@type":"SoftwareApplication",name:t.command,downloadUrl:t.skillUrl,applicationCategory:"AI Skill",operatingSystem:"Hermes Agent"}),e})}}function U(){if(typeof document>"u")return;let o=document.querySelector("script[data-hermesbuttons-jsonld]");o&&o.remove();let n=N();if(!n||!("potentialAction"in n))return;let t=document.createElement("script");t.type="application/ld+json",t.setAttribute("data-hermesbuttons-jsonld",""),t.textContent=JSON.stringify(n,null,2),document.head.appendChild(t)}function tt(){E(),S()}return Z(et);})();
919
+ `;let F=this.shadowRoot.querySelector(".hb-btn");F.addEventListener("click",()=>this.handleClick()),F.addEventListener("keydown",g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:o,skillUrl:e,popupTitle:r,popupDescription:d}=this._options;if(this.dispatchEvent(new CustomEvent("hb-open",{bubbles:!0,composed:!0,detail:{command:o}})),t===!1){navigator.clipboard.writeText(o).then(()=>{this._options.onCopy?.(o),f("hermes-skill"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:o}}))});return}C({variant:"hermes-skill",theme:this.getResolvedTheme(),title:r||"Run on Hermes Skills",description:d||"Copy and paste into a Hermes session to get started.",command:o,skillUrl:e,onCopy:l=>{this._options.onCopy?.(l),f("hermes-skill"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:l}}))},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 t=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>this.render();t.addEventListener("change",o),this._mqCleanup=()=>t.removeEventListener("change",o)}};_.observedAttributes=["command","skill-url","theme","size","variant","shape","popup","popup-title","popup-description"];function S(a="hermes-skill-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,_)}S();function W(a){let n=document.createElement("hermes-skill-button");return n.options=a,n}function D(){if(typeof document>"u")return[];let a=[];return document.querySelectorAll("hermes-button").forEach(n=>{let t=n.getAttribute("command")||"",r=n.getAttribute("prompt-flag")!=="false"?`hermes -p "${t}"`:t;a.push({platform:"hermes",command:t,fullCommand:r})}),document.querySelectorAll("hermes-skill-button").forEach(n=>{let t=n.getAttribute("command")||"",o=n.getAttribute("skill-url")||void 0;a.push({platform:"hermes-skill",command:t,...o&&{skillUrl:o}})}),a}function I(){let a=D();return a.length===0?{}:{"@context":"https://schema.org","@type":"WebPage",potentialAction:a.map(t=>{if(t.platform==="hermes")return{"@type":"Action",name:`Run on Hermes: ${t.command}`,description:t.command,target:{"@type":"EntryPoint",urlTemplate:`https://hermes.ai/run?command=${encodeURIComponent(t.fullCommand||t.command)}`,actionPlatform:"https://hermes.ai/run"},object:{"@type":"SoftwareSourceCode",runtimePlatform:"Hermes Agent",text:t.fullCommand||t.command}};let o={"@type":"EntryPoint",actionPlatform:"https://hermes.ai/skills"};t.skillUrl?o.urlTemplate=t.skillUrl:o.urlTemplate=`https://hermes.ai/skills?command=${encodeURIComponent(t.command)}`;let e={"@type":"Action",name:`Run on Hermes Skills: ${t.command}`,description:t.command,target:o};return t.skillUrl&&(e.object={"@type":"SoftwareApplication",name:t.command,downloadUrl:t.skillUrl,applicationCategory:"AI Skill",operatingSystem:"Hermes Agent"}),e})}}function G(){if(typeof document>"u")return;let a=document.querySelector("script[data-hermesbuttons-jsonld]");a&&a.remove();let n=I();if(!n||!("potentialAction"in n))return;let t=document.createElement("script");t.type="application/ld+json",t.setAttribute("data-hermesbuttons-jsonld",""),t.textContent=JSON.stringify(n,null,2),document.head.appendChild(t)}function nt(){R(),S()}return Q(it);})();
920
920
  //# sourceMappingURL=index.global.js.map