import{s as j,n as P,d as _,p as E,i as k,k as h,a as v,b as i,c as b,h as g,f as I,q as T,g as A,e as w,j as L,t as S,z as B,l as D,F as H,R as N}from"./Cl1o3nVP.js";import{S as R,i as V}from"./nb9JOxVX.js";import"./De2JwdUD.js";function U(l,e){if(!window.isSecureContext)return console.error("Clipboard action failed: app not running in secure context, see: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard"),{};const n=()=>{l.dispatchEvent(new CustomEvent("copyComplete"))},o=()=>{if(typeof e=="object"){if("element"in e){const t=document.querySelector(`[data-clipboard="${e.element}"]`);if(!t)throw new Error(`Missing HTMLElement with an attribute of [data-clipboard="${e.element}"]`);C(t.innerHTML,"text/html").then(n);return}if("input"in e){const t=document.querySelector(`[data-clipboard="${e.input}"]`);if(!t)throw new Error(`Missing HTMLInputElement with an attribute of [data-clipboard="${e.input}"]`);C(t.value).then(n);return}}C(e).then(n)};return l.addEventListener("click",o),{update(t){e=t},destroy(){l.removeEventListener("click",o)}}}async function C(l,e="text/plain"){navigator.clipboard.write?await navigator.clipboard.write([new ClipboardItem({[e]:new Blob([l],{type:e}),"text/plain":new Blob([l],{type:"text/plain"})})]):await new Promise(n=>{n(navigator.clipboard.writeText(String(l)))})}function M(l){let e,n;return{c(){e=w("pre"),n=S(l[1]),this.h()},l(o){e=b(o,"PRE",{code_wall_context:!0,class:!0,style:!0});var t=g(e);n=T(t,l[1]),t.forEach(_),this.h()},h(){v(e,"code_wall_context",""),v(e,"class","card"),i(e,"grid-column","1"),i(e,"box-sizing","border-box"),i(e,"height","100%"),i(e,"font-size","1em"),i(e,"text-align","left"),i(e,"white-space","break-spaces"),i(e,"word-wrap","break-word"),i(e,"padding","0.5cm"),i(e,"border-radius","4px"),i(e,"color","inherit"),i(e,"display","flex"),i(e,"align-items","center"),i(e,"justify-content","center"),i(e,"text-align","center")},m(o,t){k(o,e,t),h(e,n)},p(o,t){t&2&&E(n,o[1])},d(o){o&&_(e)}}}function q(l){let e,n,o,t,d,p,s;return{c(){e=w("div"),n=w("button"),o=S(l[3]),this.h()},l(u){e=b(u,"DIV",{style:!0});var a=g(e);n=b(a,"BUTTON",{class:!0,type:!0});var r=g(n);o=T(r,l[3]),r.forEach(_),a.forEach(_),this.h()},h(){n.disabled=t=l[3]==="Cloned",v(n,"class","btn variant-filled"),v(n,"type","button"),i(e,"text-align","right"),i(e,"padding","0.25cm")},m(u,a){k(u,e,a),h(e,n),h(n,o),p||(s=[D(n,"click",l[4]),H(d=U.call(null,n,l[0]))],p=!0)},p(u,a){a&8&&E(o,u[3]),a&8&&t!==(t=u[3]==="Cloned")&&(n.disabled=t),d&&N(d.update)&&a&1&&d.update.call(null,u[0])},d(u){u&&_(e),p=!1,B(s)}}}function F(l){let e,n,o,t,d,p,s,u="@",a,r=l[1].length>=1&&M(l),c=l[2]==="yes"&&q(l);return{c(){e=w("div"),n=w("div"),r&&r.c(),o=L(),t=w("pre"),d=w("span"),p=S(l[0]),s=w("span"),s.textContent=u,a=L(),c&&c.c(),this.h()},l(f){e=b(f,"DIV",{class:!0});var m=g(e);n=b(m,"DIV",{style:!0});var x=g(n);r&&r.l(x),o=I(x),t=b(x,"PRE",{code_wall:!0,style:!0});var y=g(t);d=b(y,"SPAN",{code_wall_text:!0});var z=g(d);p=T(z,l[0]),z.forEach(_),s=b(y,"SPAN",{style:!0,"data-svelte-h":!0}),A(s)!=="svelte-1ftf7l6"&&(s.textContent=u),y.forEach(_),x.forEach(_),a=I(m),c&&c.l(m),m.forEach(_),this.h()},h(){v(d,"code_wall_text",""),i(s,"opacity","0"),i(s,"user-select","none"),i(s,"-webkit-user-select","none"),i(s,"-moz-user-select","none"),i(s,"-ms-user-select","none"),v(t,"code_wall",""),i(t,"grid-column","2"),i(t,"box-sizing","border-box"),i(t,"height","100%"),i(t,"font-size","1em"),i(t,"text-align","left"),i(t,"white-space","break-spaces"),i(t,"word-wrap","break-word"),i(t,"width","100%"),i(t,"padding","0.5cm"),i(t,"border-radius","4px"),i(t,"color","inherit"),i(t,"background","inherit"),v(n,"style","display: grid; // grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); // grid-template-columns: min-content auto; grid-template-columns: min-content repeat(auto-fill, minmax(200px, 1fr)); gap: 5px; "),v(e,"class","card")},m(f,m){k(f,e,m),h(e,n),r&&r.m(n,null),h(n,o),h(n,t),h(t,d),h(d,p),h(t,s),h(e,a),c&&c.m(e,null)},p(f,[m]){f[1].length>=1?r?r.p(f,m):(r=M(f),r.c(),r.m(n,o)):r&&(r.d(1),r=null),m&1&&E(p,f[0]),f[2]==="yes"?c?c.p(f,m):(c=q(f),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i:P,o:P,d(f){f&&_(e),r&&r.d(),c&&c.d()}}}function O(l,e,n){let{text:o=""}=e,{context:t=""}=e,{can_clone:d="no"}=e,p="Clone",s;const u=async()=>{clearTimeout(s),n(3,p="Cloned"),await new Promise(a=>{s=setTimeout(()=>{a()},1e3)}),n(3,p="Clone")};return l.$$set=a=>{"text"in a&&n(0,o=a.text),"context"in a&&n(1,t=a.context),"can_clone"in a&&n(2,d=a.can_clone)},[o,t,d,p,u]}class K extends R{constructor(e){super(),V(this,e,O,F,j,{text:0,context:1,can_clone:2})}}export{K as T,U as c};
//# sourceMappingURL=B0MIrvOp.js.map
