import{S as j,i as D,s as F,h as x,n as A,d as k,G as W,u as K,a3 as L,t as I,b as T,r as C,l as N,e as h,v as E,c as l,H as O,T as z,J as Q}from"./index-BRw4aYKO.js";function H(u,t,e){const d=u.slice();return d[15]=t[e],d}function J(u,t){let e,d=t[15]+"",s,o,r;return{key:u,first:null,c(){e=h("option"),s=Q(d),e.__value=o=t[15],z(e,e.__value),l(e,"aria-selected",r=t[6]===t[15]),this.first=e},m(a,m){T(a,e,m),C(e,s)},p(a,m){t=a,m&16&&d!==(d=t[15]+"")&&O(s,d),m&16&&o!==(o=t[15])&&(e.__value=o,z(e,e.__value)),m&80&&r!==(r=t[6]===t[15])&&l(e,"aria-selected",r)},d(a){a&&k(e)}}}function M(u){let t,e,d,s,o,r,a,m,_,q,g,i,n,c,y,B,S,f,p,P,w,G,Y;return{c(){t=h("div"),e=h("label"),e.textContent="BackGround",d=E(),s=h("input"),o=E(),r=h("div"),a=h("label"),a.textContent="Text",m=E(),_=h("input"),q=E(),g=h("div"),i=h("label"),i.textContent="Node",n=E(),c=h("input"),y=E(),B=h("div"),S=h("label"),S.textContent="Edge",f=E(),p=h("input"),P=E(),w=h("button"),w.textContent="Close",l(e,"for","customBgColor"),l(e,"class","svelte-qqxyez"),l(s,"type","color"),l(s,"id","customBgColor"),l(s,"class","svelte-qqxyez"),l(a,"for","customTextColor"),l(a,"class","svelte-qqxyez"),l(_,"type","color"),l(_,"id","customTextColor"),l(_,"class","svelte-qqxyez"),l(i,"for","customNodeColor"),l(i,"class","svelte-qqxyez"),l(c,"type","color"),l(c,"id","customNodeColor"),l(c,"class","svelte-qqxyez"),l(S,"for","customEdgeColor"),l(S,"class","svelte-qqxyez"),l(p,"type","color"),l(p,"id","customEdgeColor"),l(p,"class","svelte-qqxyez"),l(w,"class","svelte-qqxyez")},m(v,b){T(v,t,b),C(t,e),C(t,d),C(t,s),z(s,u[0]),T(v,o,b),T(v,r,b),C(r,a),C(r,m),C(r,_),z(_,u[1]),T(v,q,b),T(v,g,b),C(g,i),C(g,n),C(g,c),z(c,u[2]),T(v,y,b),T(v,B,b),C(B,S),C(B,f),C(B,p),z(p,u[3]),T(v,P,b),T(v,w,b),G||(Y=[N(s,"input",u[10]),N(_,"input",u[11]),N(c,"input",u[12]),N(p,"input",u[13]),N(w,"click",u[14])],G=!0)},p(v,b){b&1&&z(s,v[0]),b&2&&z(_,v[1]),b&4&&z(c,v[2]),b&8&&z(p,v[3])},d(v){v&&(k(t),k(o),k(r),k(q),k(g),k(y),k(B),k(P),k(w)),G=!1,W(Y)}}}function R(u){let t,e,d,s,o=[],r=new Map,a,m,_,q=x(u[4]);const g=n=>n[15];for(let n=0;n<q.length;n+=1){let c=H(u,q,n),y=g(c);r.set(y,o[n]=J(y,c))}let i=u[7]&&M(u);return{c(){t=h("div"),e=h("label"),e.textContent="Select Theme:",d=E(),s=h("select");for(let n=0;n<o.length;n+=1)o[n].c();a=E(),i&&i.c(),l(e,"for","themeSelector"),l(e,"class","visually-hidden svelte-qqxyez"),l(e,"aria-hidden","true"),l(s,"id","themeSelector"),l(s,"aria-live","polite"),l(s,"aria-label","Select Theme"),l(s,"class","svelte-qqxyez"),l(t,"class","contrast-wrapper svelte-qqxyez"),I(t,"NE",u[5]==="NE")},m(n,c){T(n,t,c),C(t,e),C(t,d),C(t,s);for(let y=0;y<o.length;y+=1)o[y]&&o[y].m(s,null);C(t,a),i&&i.m(t,null),m||(_=[N(s,"change",u[8]),N(t,"input",u[9])],m=!0)},p(n,[c]){c&80&&(q=x(n[4]),o=K(o,c,g,1,n,q,r,s,L,J,null,H)),n[7]?i?i.p(n,c):(i=M(n),i.c(),i.m(t,null)):i&&(i.d(1),i=null),c&32&&I(t,"NE",n[5]==="NE")},i:A,o:A,d(n){n&&k(t);for(let c=0;c<o.length;c+=1)o[c].d();i&&i.d(),m=!1,W(_)}}}function U(u,t,e){let{contrastThemes:d=["Change Theme","Black/White","Yellow/Black","Black/Yellow","Black/Green","Blue/Yellow","Yellow/Blue","Grayscale","Black/Pink","Custom"]}=t,{corner:s="NE"}=t,{bgColor:o=null}=t,{textColor:r=null}=t,{nodeColor:a=null}=t,{edgeColor:m=null}=t,_=d[0],q=!1;function g(f){const p=f.target.value;p==="Custom"?e(7,q=!0):(e(7,q=!1),e(0,o=null),e(1,r=null),e(2,a=null),e(3,m=null),e(6,_=p),document.documentElement.setAttribute("svelvet-theme",p),i()),localStorage.setItem("currentTheme",_)}function i(){document.documentElement.style.setProperty("--default-background-color",o),document.documentElement.style.setProperty("--default-text-color",r),document.documentElement.style.setProperty("--default-node-color",a),document.documentElement.style.setProperty("--default-edge-color",m)}function n(){o=this.value,e(0,o)}function c(){r=this.value,e(1,r)}function y(){a=this.value,e(2,a)}function B(){m=this.value,e(3,m)}const S=()=>{e(7,q=!1),e(6,_=d[0]),document.documentElement.setAttribute("svelvet-theme",_);let f=document.getElementById("themeSelector");f&&(f.value=_)};return u.$$set=f=>{"contrastThemes"in f&&e(4,d=f.contrastThemes),"corner"in f&&e(5,s=f.corner),"bgColor"in f&&e(0,o=f.bgColor),"textColor"in f&&e(1,r=f.textColor),"nodeColor"in f&&e(2,a=f.nodeColor),"edgeColor"in f&&e(3,m=f.edgeColor)},[o,r,a,m,d,s,_,q,g,i,n,c,y,B,S]}class X extends j{constructor(t){super(),D(this,t,U,R,F,{contrastThemes:4,corner:5,bgColor:0,textColor:1,nodeColor:2,edgeColor:3})}}export{X as default};
