import{s as j,e as b,a as P,t as E,c as w,b as v,g as z,d as k,f as _,m as q,r as g,o as i,i as T,h,j as S,n as L,H as A,X as B,Y as D,I as N}from"./scheduler.VqJF7Vna.js";import{S as V,i as R}from"./index.Ddm4CqKS.js";import"./ProgressBar.svelte_svelte_type_style_lang.BWJb3fM2.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 t=()=>{l.dispatchEvent(new CustomEvent("copyComplete"))},o=()=>{if(typeof e=="object"){if("element"in e){const n=document.querySelector(`[data-clipboard="${e.element}"]`);if(!n)throw new Error(`Missing HTMLElement with an attribute of [data-clipboard="${e.element}"]`);C(n.innerHTML,"text/html").then(t);return}if("input"in e){const n=document.querySelector(`[data-clipboard="${e.input}"]`);if(!n)throw new Error(`Missing HTMLInputElement with an attribute of [data-clipboard="${e.input}"]`);C(n.value).then(t);return}}C(e).then(t)};return l.addEventListener("click",o),{update(n){e=n},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(t=>{t(navigator.clipboard.writeText(String(l)))})}function M(l){let e,t;return{c(){e=b("pre"),t=E(l[1]),this.h()},l(o){e=w(o,"PRE",{code_wall_context:!0,class:!0,style:!0});var n=v(e);t=k(n,l[1]),n.forEach(_),this.h()},h(){g(e,"code_wall_context",""),g(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,n){T(o,e,n),h(e,t)},p(o,n){n&2&&S(t,o[1])},d(o){o&&_(e)}}}function H(l){let e,t,o,n,d,p,s;return{c(){e=b("div"),t=b("button"),o=E(l[3]),this.h()},l(u){e=w(u,"DIV",{style:!0});var a=v(e);t=w(a,"BUTTON",{class:!0,type:!0});var r=v(t);o=k(r,l[3]),r.forEach(_),a.forEach(_),this.h()},h(){t.disabled=n=l[3]==="Cloned",g(t,"class","btn variant-filled"),g(t,"type","button"),i(e,"text-align","right"),i(e,"padding","0.25cm")},m(u,a){T(u,e,a),h(e,t),h(t,o),p||(s=[A(t,"click",l[4]),B(d=U.call(null,t,l[0]))],p=!0)},p(u,a){a&8&&S(o,u[3]),a&8&&n!==(n=u[3]==="Cloned")&&(t.disabled=n),d&&D(d.update)&&a&1&&d.update.call(null,u[0])},d(u){u&&_(e),p=!1,N(s)}}}function O(l){let e,t,o,n,d,p,s,u="@",a,r=l[1].length>=1&&M(l),c=l[2]==="yes"&&H(l);return{c(){e=b("div"),t=b("div"),r&&r.c(),o=P(),n=b("pre"),d=b("span"),p=E(l[0]),s=b("span"),s.textContent=u,a=P(),c&&c.c(),this.h()},l(f){e=w(f,"DIV",{class:!0});var m=v(e);t=w(m,"DIV",{style:!0});var x=v(t);r&&r.l(x),o=z(x),n=w(x,"PRE",{code_wall:!0,style:!0});var y=v(n);d=w(y,"SPAN",{code_wall_text:!0});var I=v(d);p=k(I,l[0]),I.forEach(_),s=w(y,"SPAN",{style:!0,"data-svelte-h":!0}),q(s)!=="svelte-1ftf7l6"&&(s.textContent=u),y.forEach(_),x.forEach(_),a=z(m),c&&c.l(m),m.forEach(_),this.h()},h(){g(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"),g(n,"code_wall",""),i(n,"grid-column","2"),i(n,"box-sizing","border-box"),i(n,"height","100%"),i(n,"font-size","1em"),i(n,"text-align","left"),i(n,"white-space","break-spaces"),i(n,"word-wrap","break-word"),i(n,"width","100%"),i(n,"padding","0.5cm"),i(n,"border-radius","4px"),i(n,"color","inherit"),i(n,"background","inherit"),i(t,"display","grid"),i(t,"grid-template-columns","repeat(auto-fill, minmax(200px, 1fr))"),i(t,"grid-template-columns","min-content auto"),i(t,"grid-template-columns","min-content repeat(auto-fill, minmax(200px, 1fr))"),i(t,"gap","5px"),g(e,"class","card")},m(f,m){T(f,e,m),h(e,t),r&&r.m(t,null),h(t,o),h(t,n),h(n,d),h(d,p),h(n,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(t,o)):r&&(r.d(1),r=null),m&1&&S(p,f[0]),f[2]==="yes"?c?c.p(f,m):(c=H(f),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i:L,o:L,d(f){f&&_(e),r&&r.d(),c&&c.d()}}}function W(l,e,t){let{text:o=""}=e,{context:n=""}=e,{can_clone:d="no"}=e,p="Clone",s;const u=async()=>{clearTimeout(s),t(3,p="Cloned"),await new Promise(a=>{s=setTimeout(()=>{a()},1e3)}),t(3,p="Clone")};return l.$$set=a=>{"text"in a&&t(0,o=a.text),"context"in a&&t(1,n=a.context),"can_clone"in a&&t(2,d=a.can_clone)},[o,n,d,p,u]}class G extends V{constructor(e){super(),R(this,e,W,O,j,{text:0,context:1,can_clone:2})}}export{G as T,U as c};
//# sourceMappingURL=Trinket.C6F5VLiC.js.map
