import{r as t,h as s}from"./p-dfbe004d.js";import{_ as e}from"./p-8415f806.js";import"./p-fd56940f.js";import"./p-9a7a47e8.js";const a=class{constructor(s){t(this,s),this.licenses=[],this.activations=[]}renderStatus(t){return"active"===t?s("sc-tag",{type:"success"},e("Active","surecart")):"revoked"===t?s("sc-tag",{type:"danger"},e("Revoked","surecart")):s("sc-tag",{type:"info"},"inactive"===t?e("Inactive","surecart"):t)}async copyKey(t){try{await navigator.clipboard.writeText(t),this.copied=!0,setTimeout((()=>{this.copied=!1}),2e3)}catch(t){console.error(t),alert(e("Error copying to clipboard","surecart"))}}render(){return s("sc-dashboard-module",{class:"purchase",part:"base"},s("span",{slot:"heading"},s("slot",{name:"heading"},this.heading||e("License Keys","surecart"))),s("sc-card",{"no-padding":!0},s("sc-table",null,s("sc-table-cell",{slot:"head"},e("Key","surecart")),s("sc-table-cell",{slot:"head",style:{width:"100px"}},e("Status","surecart")),s("sc-table-cell",{slot:"head",style:{width:"100px"}},e("Activations","surecart")),this.licenses.map((({key:t,status:a,activations:l,activation_limit:c})=>{var r;return s("sc-table-row",{style:{"--columns":"3"}},s("sc-table-cell",null,s("sc-input",{value:t,readonly:!0},s("sc-button",{type:"default",size:"small",slot:"suffix",onClick:()=>this.copyKey(t)},e(this.copied?"Copied!":"Copy","surecart")))),s("sc-table-cell",null,this.renderStatus(a)),s("sc-table-cell",null,null===(r=null==l?void 0:l.pagination)||void 0===r?void 0:r.count," / ",c||s("span",null,"∞")))})))))}};a.style=":host{display:block}";export{a as sc_licenses_list}