1import{g as I,a as j,b as z}from"./vendor-assets.js";import{b as E}from"./vendor-cdn.js";import{e as i}from"./vendor-dom.js";import"./vendor-asset.js";import"./vendor-device.js";import"./vendor-toast.js";import"./vendor-i18n.js";const U={railway:{name:"Railway",icon:"railway",gradient:"linear-gradient(135deg, #6e11b0 0%, #a824e8 100%)",textColor:"#ffffff",iconColor:"ffffff",defaultAction:"Deploy on Railway"},cloudflare:{name:"Cloudflare",icon:"cloudflare",gradient:"linear-gradient(135deg, #f38020 0%, #faad3f 100%)",textColor:"#ffffff",iconColor:"ffffff",defaultAction:"Deploy to Workers"},vercel:{name:"Vercel",icon:"vercel",gradient:"linear-gradient(135deg, #171717 0%, #2e2e2e 100%)",textColor:"#ffffff",iconColor:"ffffff",defaultAction:"Deploy to Vercel"},netlify:{name:"Netlify",icon:"netlify",gradient:"linear-gradient(135deg, #00ad9f 0%, #00c7b7 100%)",textColor:"#ffffff",iconColor:"ffffff",defaultAction:"Deploy to Netlify"},supabase:{name:"Supabase",icon:"supabase",gradient:"linear-gradient(135deg, #1c1c1c 0%, #2e2e2e 50%, #3ecf8e 100%)",textColor:"#ffffff",iconColor:"3ecf8e",defaultAction:"Connect Supabase"},claude:{name:"Claude",icon:"claude",gradient:"linear-gradient(135deg, #d97757 0%, #c45d3e 100%)",textColor:"#ffffff",iconColor:"ffffff",defaultAction:"Chat on Claude"},github:{name:"GitHub",icon:"github",gradient:"linear-gradient(135deg, #24292f 0%, #32383f 100%)",textColor:"#ffffff",iconColor:"ffffff",defaultAction:"Star on GitHub"},docker:{name:"Docker",icon:"docker",gradient:"linear-gradient(135deg, #1d63ed 0%, #2496ed 100%)",textColor:"#ffffff",iconColor:"ffffff",defaultAction:"Deploy with Docker"},huggingface:{name:"Hugging Face",icon:"huggingface",gradient:"linear-gradient(135deg, #ff9d00 0%, #ffd21e 100%)",textColor:"#1f2937",iconColor:"1f2937",defaultAction:"Run on Spaces"},ghost:{name:"Ghost",gradient:"linear-gradient(135deg, #15171a 0%, #2a2f36 100%)",textColor:"#ffffff",iconColor:"ffffff",defaultAction:"Publish on Ghost"},magicpages:{name:"Magic Pages",gradient:"linear-gradient(135deg, #442455 0%, #2a1435 100%)",textColor:"#ffffff",iconColor:"ffffff",defaultAction:"Host on Magic Pages"},synapsmedia:{name:"Synaps Media",gradient:"linear-gradient(135deg, #1355ff 0%, #083acc 100%)",textColor:"#ffffff",iconColor:"ffffff",defaultAction:"Explore Synaps Media"}};function B(A){let t=A.replace("#","").trim();if(t.length===3&&(t=t.split("").map(s=>s+s).join("")),!/^[0-9a-fA-F]{6}$/.test(t))return{gradient:`linear-gradient(135deg, ${A} 0%, ${A} 100%)`,isLight:!1};const e=parseInt(t,16),p=e>>16&255,n=e>>8&255,l=e&255,a=(p*299+n*587+l*114)/1e3>=150,f=a?-.15:.25,c=s=>Math.min(255,Math.max(0,Math.round(s))),h=c(p+(a?-p*.2:(255-p)*f)),r=c(n+(a?-n*.2:(255-n)*f)),$=c(l+(a?-l*.2:(255-l)*f)),d=`#${((1<<24)+(h<<16)+(r
1<<8)+$).toString(16).slice(1)}`;return{gradient:`linear-gradient(135deg, #${t} 0%, ${d} 100%)`,isLight:a}}class _ extends HTMLElement{static get observedAttributes(){return["brand","href","icon","label","detail","color","gradient","text-color","text_color","icon-color","icon_color","variant","target","rel","sponsored","show_arrow"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}render(){const t=(this.getAttribute("brand")||"").trim().toLowerCase(),e=U[t],p=this.getAttribute("href")||"#",n=(this.getAttribute("icon")||"").trim(),l=/^https?:\/\//i.test(n)||/^\//.test(n)||/^\.\.?\//.test(n),a=!l&&(n||e?.icon||t)?(n||e?.icon||t||"").trim().toLowerCase():"",f=this.getAttribute("detail")||"",c=this.getAttribute("gradient")||"",h=this.getAttribute("color")||"",r=this.getAttribute("text-color")||this.getAttribute("text_color")||"",$=this.getAttribute("icon-color")||this.getAttribute("icon_color")||"";let d="",s=!1;if(h&&!c){const o=B(h);d=o.gradient,s=o.isLight}const x=this.getAttribute("variant")||(e||c||d?"brand":"surface"),v=this.getAttribute("target")||"_blank",w=this.getAttribute("show_arrow")==="true",k=this.getAttribute("rel"),M=this.getAttribute("sponsored")==="true",L=this.getAttribute("nofollow")==="true"||this.getAttribute("no_follow")==="true";let y=k;if(!y){const o=["noopener","noreferrer"];M&&o.push("sponsored"),L&&o.push("nofollow"),y=o.join(" ")}let b=this.getAttribute("label")||"";b||(e?b=e.defaultAction||`Deploy on ${e.name}`:t?b=`Deploy on ${t.charAt(0).toUpperCase()+t.slice(1)}`:b=a?a.charAt(0).toUpperCase()+a.slice(1):"Action");let g="";$?g=$.replace("#","").trim():r?g=r.replace("#","").trim():d?g=s?"181716":"ffffff":h?g=h.replace("#","").trim():e&&(g=e.iconColor);const S=g?`/${encodeURIComponent(g)}`:"";let C="",u="";if(l?u=n:n||(t==="ghost"?u=I():t==="magicpages"||t==="magic-pages"?u=j():t==="synapsmedia"||t==="synaps"||t==="synaps-media"?u=z():e?.iconUrl&&(u=e.iconUrl)),u)C=` 2 <img src="${i(u)}" 3 alt="" 4 width="24" 5 height="24" 6 loading="lazy" 7 decoding="async" 8 class="size-6 shrink-0 object-contain aspect-square pointer-events-none" /> 9 `;else if(a==="demo")C=` 10 <svg viewBox="0 0 24 24" class="size-6 shrink-0 fill-none stroke-current stroke-2" aria-hidden="true"> 11 <path stroke-linecap="round" stroke-linejoin="round" d="M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z" /> 12 </svg> 13 `;else if(a){const o=`${E}/${encodeURIComponent(a)}${S}`;C=` 14 <img src="${i(o)}" 15 alt="" 16 width="24" 17 height="24" 18 loading="lazy" 19 decoding="async" 20 class="size-6 shrink-0 object-contain aspect-square pointer-events-none" /> 21 `}const D=f?`<span class="tf-btn-badge__divider opacity-40 mx-0.5" aria-hidden="true">/</span><span class="tf-btn-badge__action opacity-90 font-medium">${i(f)}</span>`:"",m=[];if(r&&m.push(`color: ${r.startsWith("#")?r:"#"+r} !important;`),x==="brand"){const o=c||d||e?.gradient;o&&m.push(`background: ${o} !important;`),r||(d?m.push(`color: ${s?"#181716":"#ffffff"} !important;`):e?.textColor&&m.push(`color: ${e.textColor} !important;`))}const P=m.length>0?`style="${m.join(" ")}"`:"",H=w?`<span class="tf-btn-badge__arrow inline-flex shrink-0 items-center opacity-75 group-hover:translate-x-0.5 group-hover:-translate-y-0.5 transition-transform ml-0.5" aria-hidden="true"> 22 <svg viewBox="0 0 16 16" class="size-3.5 fill-current"> 23 <path fill-rule="evenodd" d="M14 2.5a.5.5 0 0 0-.5-.5h-6a.5.5 0 0 0 0 1h4.793L2.146 13.146a.5.5 0 0 0 .708.708L13 3.707V8.5a.5.5 0 0 0 1 0v-6z"/> 24 </svg> 25 </span>`:"";this.innerHTML=` 26 <a href="${i(p)}" 27 target="${i(v)}" 28 rel="${i(y)}" 29 role="button" 30 data-no-smart="true" 31 data-smart="false" 32 data-smart-handled="true" 33 ${P} 34 class="tf-btn-badge tf-btn-badge--${a?i(a):"custom"} tf-btn-badge--variant-${i(x)}" 35 aria-label="${i(b)}${f?" - "+i(f):""}"> 36 ${C?`<span class="tf-btn-badge__icon shrink-0 inline-flex items-center justify-center leading-none" aria-hidden="true">${C}</span>`:""}
37 <span class="tf-btn-badge__content inline-flex items-center gap-1.5 leading-none"> 38 <span class="tf-btn-badge__label font-semibold">${i(b)}</span> 39 ${D} 40 </span> 41 ${H} 42 </a> 43 `}}typeof customElements<"u"&&!customElements.get("tana-action-button")&&customElements.define("tana-action-button",_);export{_ as TanaActionButton};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.