Files
DeviceManager/_app/immutable/nodes/2.D7oj51mw.js
2024-07-09 14:44:55 +00:00

297 lines
106 KiB
JavaScript

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/PwaStatus.DCC9dwtH.js","../chunks/scheduler.CXEVs2ap.js","../chunks/index.CTdcniaS.js","../chunks/preload-helper.Dch09mLN.js","../chunks/index.Lgv2TFSy.js","../assets/PwaStatus.BfcjJEup.css","../chunks/pwa-setup.Cm4sYrbX.js"])))=>i.map(i=>d[i]);
import{a as $r,h as Yr,g as qr}from"../chunks/share-url.D1X9O966.js";import{_ as Lt}from"../chunks/preload-helper.Dch09mLN.js";import{a9 as Ke,s as Re,e as L,t as W,a as S,c as w,b as M,d as z,f as E,g as F,l as x,m as C,i as B,h,U as ke,q as J,j as q,n as ge,r as Ve,k as X,y as Ce,D as Pe,aa as ft,B as jr,R as Dt,S as Pt,a7 as Fe,u as Ot,v as Mt,w as Rt,x as Nt,C as yr,z as $t,I as Yt,W as Xr,p as Oe,L as Ut,ah as er,K as Kr,ai as Jr,a8 as Zr,A as Qr}from"../chunks/scheduler.CXEVs2ap.js";import{S as Ne,i as Se,a as j,g as it,t as K,c as lt,j as ue,e as Ge,f as He,m as $e,h as Ye,b as xr,d as en}from"../chunks/index.CTdcniaS.js";import{s as Be,p as Cr,i as Vt,e as _t,f as tr,g as rr,b as nr,h as Lr,u as wr,j as tn,t as mt,k as rn}from"../chunks/connection.wgaIHNYB.js";import{s as Me,b as ar,f as tt,e as nn,d as an}from"../chunks/index.C1YOBj0U.js";import{c as on,t as sn}from"../chunks/share.DiRP5OJi.js";import{p as or}from"../chunks/popup.Ba_9DalD.js";import{L as Je,l as wt,a as Ar,b as ln,d as Dr,s as Pr}from"../chunks/i18n-svelte.D0STxjoQ.js";import{b as We,c as qt,C as St,s as jt,l as Xt,a as Ue,d as cn,r as un,t as fn,o as hn,h as dn}from"../chunks/Action.tNSJ0eLt.js";import{b as sr}from"../chunks/keymap-codes.DVdCLxHW.js";import{e as Wt}from"../chunks/each.CypvCfon.js";import{p as pn}from"../chunks/stores.BQ5dFziA.js";import{A as mn,b as _n}from"../chunks/ActionString.Chtx0xAR.js";import{v as ir,b as gn,a as bn,g as kn}from"../chunks/entry.CU4Ldo_h.js";const Tn=async({url:t,data:e,fetch:r})=>{const n=new URLSearchParams(t.search).get("import");return{...e,importFile:n?await $r(n,r):void 0}},To=Object.freeze(Object.defineProperty({__proto__:null,load:Tn},Symbol.toStringTag,{value:"Module"}));/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/function ye(t){return t<0?-1:t===0?0:1}function gt(t,e,r){return(1-r)*t+r*e}function En(t,e,r){return r<t?t:r>e?e:r}function At(t,e,r){return r<t?t:r>e?e:r}function Kt(t){return t=t%360,t<0&&(t=t+360),t}function vn(t,e){return Kt(e-t)<=180?1:-1}function In(t,e){return 180-Math.abs(Math.abs(t-e)-180)}function zt(t,e){const r=t[0]*e[0][0]+t[1]*e[0][1]+t[2]*e[0][2],n=t[0]*e[1][0]+t[1]*e[1][1]+t[2]*e[1][2],a=t[0]*e[2][0]+t[1]*e[2][1]+t[2]*e[2][2];return[r,n,a]}/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/const yn=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],Cn=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],Ln=[95.047,100,108.883];function Jt(t,e,r){return(255<<24|(t&255)<<16|(e&255)<<8|r&255)>>>0}function lr(t){const e=st(t[0]),r=st(t[1]),n=st(t[2]);return Jt(e,r,n)}function Or(t){return t>>16&255}function Mr(t){return t>>8&255}function Rr(t){return t&255}function wn(t,e,r){const n=Cn,a=n[0][0]*t+n[0][1]*e+n[0][2]*r,o=n[1][0]*t+n[1][1]*e+n[1][2]*r,s=n[2][0]*t+n[2][1]*e+n[2][2]*r,i=st(a),l=st(o),u=st(s);return Jt(i,l,u)}function An(t){const e=ut(Or(t)),r=ut(Mr(t)),n=ut(Rr(t));return zt([e,r,n],yn)}function Dn(t){const e=rt(t),r=st(e);return Jt(r,r,r)}function Gt(t){const e=An(t)[1];return 116*Nr(e/100)-16}function rt(t){return 100*On((t+16)/116)}function Ht(t){return Nr(t/100)*116-16}function ut(t){const e=t/255;return e<=.040449936?e/12.92*100:Math.pow((e+.055)/1.055,2.4)*100}function st(t){const e=t/100;let r=0;return e<=.0031308?r=e*12.92:r=1.055*Math.pow(e,1/2.4)-.055,En(0,255,Math.round(r*255))}function Pn(){return Ln}function Nr(t){const e=.008856451679035631,r=24389/27;return t>e?Math.pow(t,1/3):(r*t+16)/116}function On(t){const e=.008856451679035631,r=24389/27,n=t*t*t;return n>e?n:(116*t-16)/r}/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class ze{static make(e=Pn(),r=200/Math.PI*rt(50)/100,n=50,a=2,o=!1){const s=e,i=s[0]*.401288+s[1]*.650173+s[2]*-.051461,l=s[0]*-.250268+s[1]*1.204414+s[2]*.045854,u=s[0]*-.002079+s[1]*.048952+s[2]*.953127,c=.8+a/10,f=c>=.9?gt(.59,.69,(c-.9)*10):gt(.525,.59,(c-.8)*10);let g=o?1:c*(1-1/3.6*Math.exp((-r-42)/92));g=g>1?1:g<0?0:g;const d=c,k=[g*(100/i)+1-g,g*(100/l)+1-g,g*(100/u)+1-g],p=1/(5*r+1),m=p*p*p*p,A=1-m,_=m*r+.1*A*A*Math.cbrt(5*r),I=rt(n)/e[1],b=1.48+Math.sqrt(I),T=.725/Math.pow(I,.2),P=T,R=[Math.pow(_*k[0]*i/100,.42),Math.pow(_*k[1]*l/100,.42),Math.pow(_*k[2]*u/100,.42)],D=[400*R[0]/(R[0]+27.13),400*R[1]/(R[1]+27.13),400*R[2]/(R[2]+27.13)],y=(2*D[0]+D[1]+.05*D[2])*T;return new ze(I,y,T,P,f,d,k,_,Math.pow(_,.25),b)}constructor(e,r,n,a,o,s,i,l,u,c){this.n=e,this.aw=r,this.nbb=n,this.ncb=a,this.c=o,this.nc=s,this.rgbD=i,this.fl=l,this.fLRoot=u,this.z=c}}ze.DEFAULT=ze.make();/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class he{constructor(e,r,n,a,o,s,i,l,u){this.hue=e,this.chroma=r,this.j=n,this.q=a,this.m=o,this.s=s,this.jstar=i,this.astar=l,this.bstar=u}distance(e){const r=this.jstar-e.jstar,n=this.astar-e.astar,a=this.bstar-e.bstar,o=Math.sqrt(r*r+n*n+a*a);return 1.41*Math.pow(o,.63)}static fromInt(e){return he.fromIntInViewingConditions(e,ze.DEFAULT)}static fromIntInViewingConditions(e,r){const n=(e&16711680)>>16,a=(e&65280)>>8,o=e&255,s=ut(n),i=ut(a),l=ut(o),u=.41233895*s+.35762064*i+.18051042*l,c=.2126*s+.7152*i+.0722*l,f=.01932141*s+.11916382*i+.95034478*l,g=.401288*u+.650173*c-.051461*f,d=-.250268*u+1.204414*c+.045854*f,k=-.002079*u+.048952*c+.953127*f,p=r.rgbD[0]*g,m=r.rgbD[1]*d,A=r.rgbD[2]*k,_=Math.pow(r.fl*Math.abs(p)/100,.42),I=Math.pow(r.fl*Math.abs(m)/100,.42),b=Math.pow(r.fl*Math.abs(A)/100,.42),T=ye(p)*400*_/(_+27.13),P=ye(m)*400*I/(I+27.13),R=ye(A)*400*b/(b+27.13),D=(11*T+-12*P+R)/11,y=(T+P-2*R)/9,O=(20*T+20*P+21*R)/20,Y=(40*T+20*P+R)/20,H=Math.atan2(y,D)*180/Math.PI,ne=H<0?H+360:H>=360?H-360:H,Q=ne*Math.PI/180,ie=Y*r.nbb,ee=100*Math.pow(ie/r.aw,r.c*r.z),le=4/r.c*Math.sqrt(ee/100)*(r.aw+4)*r.fLRoot,Te=ne<20.14?ne+360:ne,se=.25*(Math.cos(Te*Math.PI/180+2)+3.8),De=5e4/13*se*r.nc*r.ncb*Math.sqrt(D*D+y*y)/(O+.305),pe=Math.pow(De,.9)*Math.pow(1.64-Math.pow(.29,r.n),.73),Ee=pe*Math.sqrt(ee/100),Z=Ee*r.fLRoot,nt=50*Math.sqrt(pe*r.c/(r.aw+4)),ve=(1+100*.007)*ee/(1+.007*ee),te=1/.0228*Math.log(1+.0228*Z),Ze=te*Math.cos(Q),ce=te*Math.sin(Q);return new he(ne,Ee,ee,le,Z,nt,ve,Ze,ce)}static fromJch(e,r,n){return he.fromJchInViewingConditions(e,r,n,ze.DEFAULT)}static fromJchInViewingConditions(e,r,n,a){const o=4/a.c*Math.sqrt(e/100)*(a.aw+4)*a.fLRoot,s=r*a.fLRoot,i=r/Math.sqrt(e/100),l=50*Math.sqrt(i*a.c/(a.aw+4)),u=n*Math.PI/180,c=(1+100*.007)*e/(1+.007*e),f=1/.0228*Math.log(1+.0228*s),g=f*Math.cos(u),d=f*Math.sin(u);return new he(n,r,e,o,s,l,c,g,d)}static fromUcs(e,r,n){return he.fromUcsInViewingConditions(e,r,n,ze.DEFAULT)}static fromUcsInViewingConditions(e,r,n,a){const o=r,s=n,i=Math.sqrt(o*o+s*s),u=(Math.exp(i*.0228)-1)/.0228/a.fLRoot;let c=Math.atan2(s,o)*(180/Math.PI);c<0&&(c+=360);const f=e/(1-(e-100)*.007);return he.fromJchInViewingConditions(f,u,c,a)}toInt(){return this.viewed(ze.DEFAULT)}viewed(e){const r=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),n=Math.pow(r/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),a=this.hue*Math.PI/180,o=.25*(Math.cos(a+2)+3.8),s=e.aw*Math.pow(this.j/100,1/e.c/e.z),i=o*(5e4/13)*e.nc*e.ncb,l=s/e.nbb,u=Math.sin(a),c=Math.cos(a),f=23*(l+.305)*n/(23*i+11*n*c+108*n*u),g=f*c,d=f*u,k=(460*l+451*g+288*d)/1403,p=(460*l-891*g-261*d)/1403,m=(460*l-220*g-6300*d)/1403,A=Math.max(0,27.13*Math.abs(k)/(400-Math.abs(k))),_=ye(k)*(100/e.fl)*Math.pow(A,1/.42),I=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),b=ye(p)*(100/e.fl)*Math.pow(I,1/.42),T=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),P=ye(m)*(100/e.fl)*Math.pow(T,1/.42),R=_/e.rgbD[0],D=b/e.rgbD[1],y=P/e.rgbD[2],O=1.86206786*R-1.01125463*D+.14918677*y,Y=.38752654*R+.62144744*D-.00897398*y,U=-.0158415*R-.03412294*D+1.04996444*y;return wn(O,Y,U)}static fromXyzInViewingConditions(e,r,n,a){const o=.401288*e+.650173*r-.051461*n,s=-.250268*e+1.204414*r+.045854*n,i=-.002079*e+.048952*r+.953127*n,l=a.rgbD[0]*o,u=a.rgbD[1]*s,c=a.rgbD[2]*i,f=Math.pow(a.fl*Math.abs(l)/100,.42),g=Math.pow(a.fl*Math.abs(u)/100,.42),d=Math.pow(a.fl*Math.abs(c)/100,.42),k=ye(l)*400*f/(f+27.13),p=ye(u)*400*g/(g+27.13),m=ye(c)*400*d/(d+27.13),A=(11*k+-12*p+m)/11,_=(k+p-2*m)/9,I=(20*k+20*p+21*m)/20,b=(40*k+20*p+m)/20,P=Math.atan2(_,A)*180/Math.PI,R=P<0?P+360:P>=360?P-360:P,D=R*Math.PI/180,y=b*a.nbb,O=100*Math.pow(y/a.aw,a.c*a.z),Y=4/a.c*Math.sqrt(O/100)*(a.aw+4)*a.fLRoot,U=R<20.14?R+360:R,H=1/4*(Math.cos(U*Math.PI/180+2)+3.8),Q=5e4/13*H*a.nc*a.ncb*Math.sqrt(A*A+_*_)/(I+.305),ie=Math.pow(Q,.9)*Math.pow(1.64-Math.pow(.29,a.n),.73),ee=ie*Math.sqrt(O/100),le=ee*a.fLRoot,Te=50*Math.sqrt(ie*a.c/(a.aw+4)),se=(1+100*.007)*O/(1+.007*O),we=Math.log(1+.0228*le)/.0228,De=we*Math.cos(D),pe=we*Math.sin(D);return new he(R,ee,O,Y,le,Te,se,De,pe)}xyzInViewingConditions(e){const r=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),n=Math.pow(r/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),a=this.hue*Math.PI/180,o=.25*(Math.cos(a+2)+3.8),s=e.aw*Math.pow(this.j/100,1/e.c/e.z),i=o*(5e4/13)*e.nc*e.ncb,l=s/e.nbb,u=Math.sin(a),c=Math.cos(a),f=23*(l+.305)*n/(23*i+11*n*c+108*n*u),g=f*c,d=f*u,k=(460*l+451*g+288*d)/1403,p=(460*l-891*g-261*d)/1403,m=(460*l-220*g-6300*d)/1403,A=Math.max(0,27.13*Math.abs(k)/(400-Math.abs(k))),_=ye(k)*(100/e.fl)*Math.pow(A,1/.42),I=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),b=ye(p)*(100/e.fl)*Math.pow(I,1/.42),T=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),P=ye(m)*(100/e.fl)*Math.pow(T,1/.42),R=_/e.rgbD[0],D=b/e.rgbD[1],y=P/e.rgbD[2],O=1.86206786*R-1.01125463*D+.14918677*y,Y=.38752654*R+.62144744*D-.00897398*y,U=-.0158415*R-.03412294*D+1.04996444*y;return[O,Y,U]}}/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class V{static sanitizeRadians(e){return(e+Math.PI*8)%(Math.PI*2)}static trueDelinearized(e){const r=e/100;let n=0;return r<=.0031308?n=r*12.92:n=1.055*Math.pow(r,1/2.4)-.055,n*255}static chromaticAdaptation(e){const r=Math.pow(Math.abs(e),.42);return ye(e)*400*r/(r+27.13)}static hueOf(e){const r=zt(e,V.SCALED_DISCOUNT_FROM_LINRGB),n=V.chromaticAdaptation(r[0]),a=V.chromaticAdaptation(r[1]),o=V.chromaticAdaptation(r[2]),s=(11*n+-12*a+o)/11,i=(n+a-2*o)/9;return Math.atan2(i,s)}static areInCyclicOrder(e,r,n){const a=V.sanitizeRadians(r-e),o=V.sanitizeRadians(n-e);return a<o}static intercept(e,r,n){return(r-e)/(n-e)}static lerpPoint(e,r,n){return[e[0]+(n[0]-e[0])*r,e[1]+(n[1]-e[1])*r,e[2]+(n[2]-e[2])*r]}static setCoordinate(e,r,n,a){const o=V.intercept(e[a],r,n[a]);return V.lerpPoint(e,o,n)}static isBounded(e){return 0<=e&&e<=100}static nthVertex(e,r){const n=V.Y_FROM_LINRGB[0],a=V.Y_FROM_LINRGB[1],o=V.Y_FROM_LINRGB[2],s=r%4<=1?0:100,i=r%2===0?0:100;if(r<4){const l=s,u=i,c=(e-l*a-u*o)/n;return V.isBounded(c)?[c,l,u]:[-1,-1,-1]}else if(r<8){const l=s,u=i,c=(e-u*n-l*o)/a;return V.isBounded(c)?[u,c,l]:[-1,-1,-1]}else{const l=s,u=i,c=(e-l*n-u*a)/o;return V.isBounded(c)?[l,u,c]:[-1,-1,-1]}}static bisectToSegment(e,r){let n=[-1,-1,-1],a=n,o=0,s=0,i=!1,l=!0;for(let u=0;u<12;u++){const c=V.nthVertex(e,u);if(c[0]<0)continue;const f=V.hueOf(c);if(!i){n=c,a=c,o=f,s=f,i=!0;continue}(l||V.areInCyclicOrder(o,f,s))&&(l=!1,V.areInCyclicOrder(o,r,f)?(a=c,s=f):(n=c,o=f))}return[n,a]}static midpoint(e,r){return[(e[0]+r[0])/2,(e[1]+r[1])/2,(e[2]+r[2])/2]}static criticalPlaneBelow(e){return Math.floor(e-.5)}static criticalPlaneAbove(e){return Math.ceil(e-.5)}static bisectToLimit(e,r){const n=V.bisectToSegment(e,r);let a=n[0],o=V.hueOf(a),s=n[1];for(let i=0;i<3;i++)if(a[i]!==s[i]){let l=-1,u=255;a[i]<s[i]?(l=V.criticalPlaneBelow(V.trueDelinearized(a[i])),u=V.criticalPlaneAbove(V.trueDelinearized(s[i]))):(l=V.criticalPlaneAbove(V.trueDelinearized(a[i])),u=V.criticalPlaneBelow(V.trueDelinearized(s[i])));for(let c=0;c<8&&!(Math.abs(u-l)<=1);c++){const f=Math.floor((l+u)/2),g=V.CRITICAL_PLANES[f],d=V.setCoordinate(a,g,s,i),k=V.hueOf(d);V.areInCyclicOrder(o,r,k)?(s=d,u=f):(a=d,o=k,l=f)}}return V.midpoint(a,s)}static inverseChromaticAdaptation(e){const r=Math.abs(e),n=Math.max(0,27.13*r/(400-r));return ye(e)*Math.pow(n,1/.42)}static findResultByJ(e,r,n){let a=Math.sqrt(n)*11;const o=ze.DEFAULT,s=1/Math.pow(1.64-Math.pow(.29,o.n),.73),l=.25*(Math.cos(e+2)+3.8)*(5e4/13)*o.nc*o.ncb,u=Math.sin(e),c=Math.cos(e);for(let f=0;f<5;f++){const g=a/100,d=r===0||a===0?0:r/Math.sqrt(g),k=Math.pow(d*s,1/.9),m=o.aw*Math.pow(g,1/o.c/o.z)/o.nbb,A=23*(m+.305)*k/(23*l+11*k*c+108*k*u),_=A*c,I=A*u,b=(460*m+451*_+288*I)/1403,T=(460*m-891*_-261*I)/1403,P=(460*m-220*_-6300*I)/1403,R=V.inverseChromaticAdaptation(b),D=V.inverseChromaticAdaptation(T),y=V.inverseChromaticAdaptation(P),O=zt([R,D,y],V.LINRGB_FROM_SCALED_DISCOUNT);if(O[0]<0||O[1]<0||O[2]<0)return 0;const Y=V.Y_FROM_LINRGB[0],U=V.Y_FROM_LINRGB[1],H=V.Y_FROM_LINRGB[2],ne=Y*O[0]+U*O[1]+H*O[2];if(ne<=0)return 0;if(f===4||Math.abs(ne-n)<.002)return O[0]>100.01||O[1]>100.01||O[2]>100.01?0:lr(O);a=a-(ne-n)*a/(2*ne)}return 0}static solveToInt(e,r,n){if(r<1e-4||n<1e-4||n>99.9999)return Dn(n);e=Kt(e);const a=e/180*Math.PI,o=rt(n),s=V.findResultByJ(a,r,o);if(s!==0)return s;const i=V.bisectToLimit(o,a);return lr(i)}static solveToCam(e,r,n){return he.fromInt(V.solveToInt(e,r,n))}}V.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]];V.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]];V.Y_FROM_LINRGB=[.2126,.7152,.0722];V.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.942497089126609,1.0022825574869039,1.0642236851973577,1.1283421258858297,1.1946592148522128,1.2631959812511864,1.3339731595349034,1.407011200216447,1.4823302800086415,1.5599503113873272,1.6398909516233677,1.7221716113234105,1.8068114625156377,1.8938294463134073,1.9832442801866852,2.075074464868551,2.1693382909216234,2.2660538449872063,2.36523901573795,2.4669114995532007,2.5710888059345764,2.6777882626779785,2.7870270208169257,2.898822059350997,3.0131901897720907,3.1301480604002863,3.2497121605402226,3.3718988244681087,3.4967242352587946,3.624204428461639,3.754355295633311,3.887192587735158,4.022731918402185,4.160988767090289,4.301978482107941,4.445716283538092,4.592217266055746,4.741496401646282,4.893568542229298,5.048448422192488,5.20615066083972,5.3666897647573375,5.5300801301023865,5.696336044816294,5.865471690767354,6.037501145825082,6.212438385869475,6.390297286737924,6.571091626112461,6.7548350853498045,6.941541251256611,7.131223617812143,7.323895587840543,7.5195704746346665,7.7182615035334345,7.919981813454504,8.124744458384042,8.332562408825165,8.543448553206703,8.757415699253682,8.974476575321063,9.194643831691977,9.417930041841839,9.644347703669503,9.873909240696694,10.106627003236781,10.342513269534024,10.58158024687427,10.8238400726681,11.069304815507364,11.317986476196008,11.569896988756009,11.825048221409341,12.083451977536606,12.345119996613247,12.610063955123938,12.878295467455942,13.149826086772048,13.42466730586372,13.702830557985108,13.984327217668513,14.269168601521828,14.55736596900856,14.848930523210871,15.143873411576273,15.44220572664832,15.743938506781891,16.04908273684337,16.35764934889634,16.66964922287304,16.985093187232053,17.30399201960269,17.62635644741625,17.95219714852476,18.281524751807332,18.614349837764564,18.95068293910138,19.290534541298456,19.633915083172692,19.98083495742689,20.331304511189067,20.685334046541502,21.042933821039977,21.404114048223256,21.76888489811322,22.137256497705877,22.50923893145328,22.884842241736916,23.264076429332462,23.6469514538663,24.033477234264016,24.42366364919083,24.817520537484558,25.21505769858089,25.61628489293138,26.021211842414342,26.429848230738664,26.842203703840827,27.258287870275353,27.678110301598522,28.10168053274597,28.529008062403893,28.96010235337422,29.39497283293396,29.83362889318845,30.276079891419332,30.722335150426627,31.172403958865512,31.62629557157785,32.08401920991837,32.54558406207592,33.010999283389665,33.4802739966603,33.953417292456834,34.430438229418264,34.911345834551085,35.39614910352207,35.88485700094671,36.37747846067349,36.87402238606382,37.37449765026789,37.87891309649659,38.38727753828926,38.89959975977785,39.41588851594697,39.93615253289054,40.460400508064545,40.98864111053629,41.520882981230194,42.05713473317016,42.597404951718396,43.141702194811224,43.6900349931913,44.24241185063697,44.798841244188324,45.35933162437017,45.92389141541209,46.49252901546552,47.065252796817916,47.64207110610409,48.22299226451468,48.808024568002054,49.3971762874833,49.9904556690408,50.587870934119984,51.189430279724725,51.79514187861014,52.40501387947288,53.0190544071392,53.637271562750364,54.259673423945976,54.88626804504493,55.517063457223934,56.15206766869424,56.79128866487574,57.43473440856916,58.08241284012621,58.734331877617365,59.39049941699807,60.05092333227251,60.715611475655585,61.38457167773311,62.057811747619894,62.7353394731159,63.417162620860914,64.10328893648692,64.79372614476921,65.48848194977529,66.18756403501224,66.89098006357258,67.59873767827808,68.31084450182222,69.02730813691093,69.74813616640164,70.47333615344107,71.20291564160104,71.93688215501312,72.67524319850172,73.41800625771542,74.16517879925733,74.9167682708136,75.67278210128072,76.43322770089146,77.1981124613393,77.96744375590167,78.74122893956174,79.51947534912904,80.30219030335869,81.08938110306934,81.88105503125999,82.67721935322541,83.4778813166706,84.28304815182372,85.09272707154808,85.90692527145302,86.72564993000343,87.54890820862819,88.3767072518277,89.2090541872801,90.04595612594655,90.88742016217518,91.73345337380438,92.58406282226491,93.43925555268066,94.29903859396902,95.16341895893969,96.03240364439274,96.9059996312159,97.78421388448044,98.6670533535366,99.55452497210776];/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class de{static from(e,r,n){return new de(V.solveToInt(e,r,n))}static fromInt(e){return new de(e)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(e){this.setInternalState(V.solveToInt(e,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(e){this.setInternalState(V.solveToInt(this.internalHue,e,this.internalTone))}get tone(){return this.internalTone}set tone(e){this.setInternalState(V.solveToInt(this.internalHue,this.internalChroma,e))}constructor(e){this.argb=e;const r=he.fromInt(e);this.internalHue=r.hue,this.internalChroma=r.chroma,this.internalTone=Gt(e),this.argb=e}setInternalState(e){const r=he.fromInt(e);this.internalHue=r.hue,this.internalChroma=r.chroma,this.internalTone=Gt(e),this.argb=e}inViewingConditions(e){const n=he.fromInt(this.toInt()).xyzInViewingConditions(e),a=he.fromXyzInViewingConditions(n[0],n[1],n[2],ze.make());return de.from(a.hue,a.chroma,Ht(n[1]))}}/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class Zt{static harmonize(e,r){const n=de.fromInt(e),a=de.fromInt(r),o=In(n.hue,a.hue),s=Math.min(o*.5,15),i=Kt(n.hue+s*vn(n.hue,a.hue));return de.from(i,n.chroma,n.tone).toInt()}static hctHue(e,r,n){const a=Zt.cam16Ucs(e,r,n),o=he.fromInt(a),s=he.fromInt(e);return de.from(o.hue,s.chroma,Gt(e)).toInt()}static cam16Ucs(e,r,n){const a=he.fromInt(e),o=he.fromInt(r),s=a.jstar,i=a.astar,l=a.bstar,u=o.jstar,c=o.astar,f=o.bstar,g=s+(u-s)*n,d=i+(c-i)*n,k=l+(f-l)*n;return he.fromUcs(g,d,k).toInt()}}/**
* @license
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class fe{static ratioOfTones(e,r){return e=At(0,100,e),r=At(0,100,r),fe.ratioOfYs(rt(e),rt(r))}static ratioOfYs(e,r){const n=e>r?e:r,a=n===r?e:r;return(n+5)/(a+5)}static lighter(e,r){if(e<0||e>100)return-1;const n=rt(e),a=r*(n+5)-5,o=fe.ratioOfYs(a,n),s=Math.abs(o-r);if(o<r&&s>.04)return-1;const i=Ht(a)+.4;return i<0||i>100?-1:i}static darker(e,r){if(e<0||e>100)return-1;const n=rt(e),a=(n+5)/r-5,o=fe.ratioOfYs(n,a),s=Math.abs(o-r);if(o<r&&s>.04)return-1;const i=Ht(a)-.4;return i<0||i>100?-1:i}static lighterUnsafe(e,r){const n=fe.lighter(e,r);return n<0?100:n}static darkerUnsafe(e,r){const n=fe.darker(e,r);return n<0?0:n}}/**
* @license
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class Qt{static isDisliked(e){const r=Math.round(e.hue)>=90&&Math.round(e.hue)<=111,n=Math.round(e.chroma)>16,a=Math.round(e.tone)<65;return r&&n&&a}static fixIfDisliked(e){return Qt.isDisliked(e)?de.from(e.hue,e.chroma,70):e}}/**
* @license
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class N{static fromPalette(e){return new N(e.name??"",e.palette,e.tone,e.isBackground??!1,e.background,e.secondBackground,e.contrastCurve,e.toneDeltaPair)}constructor(e,r,n,a,o,s,i,l){if(this.name=e,this.palette=r,this.tone=n,this.isBackground=a,this.background=o,this.secondBackground=s,this.contrastCurve=i,this.toneDeltaPair=l,this.hctCache=new Map,!o&&s)throw new Error(`Color ${e} has secondBackgrounddefined, but background is not defined.`);if(!o&&i)throw new Error(`Color ${e} has contrastCurvedefined, but background is not defined.`);if(o&&!i)throw new Error(`Color ${e} has backgrounddefined, but contrastCurve is not defined.`)}getArgb(e){return this.getHct(e).toInt()}getHct(e){const r=this.hctCache.get(e);if(r!=null)return r;const n=this.getTone(e),a=this.palette(e).getHct(n);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(e,a),a}getTone(e){const r=e.contrastLevel<0;if(this.toneDeltaPair){const n=this.toneDeltaPair(e),a=n.roleA,o=n.roleB,s=n.delta,i=n.polarity,l=n.stayTogether,c=this.background(e).getTone(e),f=i==="nearer"||i==="lighter"&&!e.isDark||i==="darker"&&e.isDark,g=f?a:o,d=f?o:a,k=this.name===g.name,p=e.isDark?1:-1,m=g.contrastCurve.get(e.contrastLevel),A=d.contrastCurve.get(e.contrastLevel),_=g.tone(e);let I=fe.ratioOfTones(c,_)>=m?_:N.foregroundTone(c,m);const b=d.tone(e);let T=fe.ratioOfTones(c,b)>=A?b:N.foregroundTone(c,A);return r&&(I=N.foregroundTone(c,m),T=N.foregroundTone(c,A)),(T-I)*p>=s||(T=At(0,100,I+s*p),(T-I)*p>=s||(I=At(0,100,T-s*p))),50<=I&&I<60?p>0?(I=60,T=Math.max(T,I+s*p)):(I=49,T=Math.min(T,I+s*p)):50<=T&&T<60&&(l?p>0?(I=60,T=Math.max(T,I+s*p)):(I=49,T=Math.min(T,I+s*p)):p>0?T=60:T=49),k?I:T}else{let n=this.tone(e);if(this.background==null)return n;const a=this.background(e).getTone(e),o=this.contrastCurve.get(e.contrastLevel);if(fe.ratioOfTones(a,n)>=o||(n=N.foregroundTone(a,o)),r&&(n=N.foregroundTone(a,o)),this.isBackground&&50<=n&&n<60&&(fe.ratioOfTones(49,a)>=o?n=49:n=60),this.secondBackground){const[s,i]=[this.background,this.secondBackground],[l,u]=[s(e).getTone(e),i(e).getTone(e)],[c,f]=[Math.max(l,u),Math.min(l,u)];if(fe.ratioOfTones(c,n)>=o&&fe.ratioOfTones(f,n)>=o)return n;const g=fe.lighter(c,o),d=fe.darker(f,o),k=[];return g!==-1&&k.push(g),d!==-1&&k.push(d),N.tonePrefersLightForeground(l)||N.tonePrefersLightForeground(u)?g<0?100:g:k.length===1?k[0]:d<0?0:d}return n}}static foregroundTone(e,r){const n=fe.lighterUnsafe(e,r),a=fe.darkerUnsafe(e,r),o=fe.ratioOfTones(n,e),s=fe.ratioOfTones(a,e);if(N.tonePrefersLightForeground(e)){const l=Math.abs(o-s)<.1&&o<r&&s<r;return o>=r||o>=s||l?n:a}else return s>=r||s>=o?a:n}static tonePrefersLightForeground(e){return Math.round(e)<60}static toneAllowsLightForeground(e){return Math.round(e)<=49}static enableLightForeground(e){return N.tonePrefersLightForeground(e)&&!N.toneAllowsLightForeground(e)?49:e}}/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class be{static fromInt(e){const r=de.fromInt(e);return be.fromHct(r)}static fromHct(e){return new be(e.hue,e.chroma,e)}static fromHueAndChroma(e,r){const n=new Mn(e,r).create();return new be(e,r,n)}constructor(e,r,n){this.hue=e,this.chroma=r,this.keyColor=n,this.cache=new Map}tone(e){let r=this.cache.get(e);return r===void 0&&(r=de.from(this.hue,this.chroma,e).toInt(),this.cache.set(e,r)),r}getHct(e){return de.fromInt(this.tone(e))}}class Mn{constructor(e,r){this.hue=e,this.requestedChroma=r,this.chromaCache=new Map,this.maxChromaValue=200}create(){let a=0,o=100;for(;a<o;){const s=Math.floor((a+o)/2),i=this.maxChroma(s)<this.maxChroma(s+1);if(this.maxChroma(s)>=this.requestedChroma-.01)if(Math.abs(a-50)<Math.abs(o-50))o=s;else{if(a===s)return de.from(this.hue,this.requestedChroma,a);a=s}else i?a=s+1:o=s}return de.from(this.hue,this.requestedChroma,a)}maxChroma(e){if(this.chromaCache.has(e))return this.chromaCache.get(e);const r=de.from(this.hue,this.maxChromaValue,e).chroma;return this.chromaCache.set(e,r),r}}/**
* @license
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class G{constructor(e,r,n,a){this.low=e,this.normal=r,this.medium=n,this.high=a}get(e){return e<=-1?this.low:e<0?gt(this.low,this.normal,(e- -1)/1):e<.5?gt(this.normal,this.medium,(e-0)/.5):e<1?gt(this.medium,this.high,(e-.5)/.5):this.high}}/**
* @license
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class Le{constructor(e,r,n,a,o){this.roleA=e,this.roleB=r,this.delta=n,this.polarity=a,this.stayTogether=o}}/**
* @license
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var bt;(function(t){t[t.MONOCHROME=0]="MONOCHROME",t[t.NEUTRAL=1]="NEUTRAL",t[t.TONAL_SPOT=2]="TONAL_SPOT",t[t.VIBRANT=3]="VIBRANT",t[t.EXPRESSIVE=4]="EXPRESSIVE",t[t.FIDELITY=5]="FIDELITY",t[t.CONTENT=6]="CONTENT",t[t.RAINBOW=7]="RAINBOW",t[t.FRUIT_SALAD=8]="FRUIT_SALAD"})(bt||(bt={}));/**
* @license
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/function ht(t){return t.variant===bt.FIDELITY||t.variant===bt.CONTENT}function ae(t){return t.variant===bt.MONOCHROME}function Rn(t,e,r,n){let a=r,o=de.from(t,e,r);if(o.chroma<e){let s=o.chroma;for(;o.chroma<e;){a+=n?-1:1;const i=de.from(t,e,a);if(s>i.chroma||Math.abs(i.chroma-e)<.4)break;const l=Math.abs(i.chroma-e),u=Math.abs(o.chroma-e);l<u&&(o=i),s=Math.max(s,i.chroma)}}return a}class v{static highestSurface(e){return e.isDark?v.surfaceBright:v.surfaceDim}}v.contentAccentToneDelta=15;v.primaryPaletteKeyColor=N.fromPalette({name:"primary_palette_key_color",palette:t=>t.primaryPalette,tone:t=>t.primaryPalette.keyColor.tone});v.secondaryPaletteKeyColor=N.fromPalette({name:"secondary_palette_key_color",palette:t=>t.secondaryPalette,tone:t=>t.secondaryPalette.keyColor.tone});v.tertiaryPaletteKeyColor=N.fromPalette({name:"tertiary_palette_key_color",palette:t=>t.tertiaryPalette,tone:t=>t.tertiaryPalette.keyColor.tone});v.neutralPaletteKeyColor=N.fromPalette({name:"neutral_palette_key_color",palette:t=>t.neutralPalette,tone:t=>t.neutralPalette.keyColor.tone});v.neutralVariantPaletteKeyColor=N.fromPalette({name:"neutral_variant_palette_key_color",palette:t=>t.neutralVariantPalette,tone:t=>t.neutralVariantPalette.keyColor.tone});v.background=N.fromPalette({name:"background",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0});v.onBackground=N.fromPalette({name:"on_background",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>v.background,contrastCurve:new G(3,3,4.5,7)});v.surface=N.fromPalette({name:"surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0});v.surfaceDim=N.fromPalette({name:"surface_dim",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:new G(87,87,80,75).get(t.contrastLevel),isBackground:!0});v.surfaceBright=N.fromPalette({name:"surface_bright",palette:t=>t.neutralPalette,tone:t=>t.isDark?new G(24,24,29,34).get(t.contrastLevel):98,isBackground:!0});v.surfaceContainerLowest=N.fromPalette({name:"surface_container_lowest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new G(4,4,2,0).get(t.contrastLevel):100,isBackground:!0});v.surfaceContainerLow=N.fromPalette({name:"surface_container_low",palette:t=>t.neutralPalette,tone:t=>t.isDark?new G(10,10,11,12).get(t.contrastLevel):new G(96,96,96,95).get(t.contrastLevel),isBackground:!0});v.surfaceContainer=N.fromPalette({name:"surface_container",palette:t=>t.neutralPalette,tone:t=>t.isDark?new G(12,12,16,20).get(t.contrastLevel):new G(94,94,92,90).get(t.contrastLevel),isBackground:!0});v.surfaceContainerHigh=N.fromPalette({name:"surface_container_high",palette:t=>t.neutralPalette,tone:t=>t.isDark?new G(17,17,21,25).get(t.contrastLevel):new G(92,92,88,85).get(t.contrastLevel),isBackground:!0});v.surfaceContainerHighest=N.fromPalette({name:"surface_container_highest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new G(22,22,26,30).get(t.contrastLevel):new G(90,90,84,80).get(t.contrastLevel),isBackground:!0});v.onSurface=N.fromPalette({name:"on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>v.highestSurface(t),contrastCurve:new G(4.5,7,11,21)});v.surfaceVariant=N.fromPalette({name:"surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:90,isBackground:!0});v.onSurfaceVariant=N.fromPalette({name:"on_surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?80:30,background:t=>v.highestSurface(t),contrastCurve:new G(3,4.5,7,11)});v.inverseSurface=N.fromPalette({name:"inverse_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:20});v.inverseOnSurface=N.fromPalette({name:"inverse_on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?20:95,background:t=>v.inverseSurface,contrastCurve:new G(4.5,7,11,21)});v.outline=N.fromPalette({name:"outline",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?60:50,background:t=>v.highestSurface(t),contrastCurve:new G(1.5,3,4.5,7)});v.outlineVariant=N.fromPalette({name:"outline_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:80,background:t=>v.highestSurface(t),contrastCurve:new G(1,1,3,4.5)});v.shadow=N.fromPalette({name:"shadow",palette:t=>t.neutralPalette,tone:t=>0});v.scrim=N.fromPalette({name:"scrim",palette:t=>t.neutralPalette,tone:t=>0});v.surfaceTint=N.fromPalette({name:"surface_tint",palette:t=>t.primaryPalette,tone:t=>t.isDark?80:40,isBackground:!0});v.primary=N.fromPalette({name:"primary",palette:t=>t.primaryPalette,tone:t=>ae(t)?t.isDark?100:0:t.isDark?80:40,isBackground:!0,background:t=>v.highestSurface(t),contrastCurve:new G(3,4.5,7,7),toneDeltaPair:t=>new Le(v.primaryContainer,v.primary,10,"nearer",!1)});v.onPrimary=N.fromPalette({name:"on_primary",palette:t=>t.primaryPalette,tone:t=>ae(t)?t.isDark?10:90:t.isDark?20:100,background:t=>v.primary,contrastCurve:new G(4.5,7,11,21)});v.primaryContainer=N.fromPalette({name:"primary_container",palette:t=>t.primaryPalette,tone:t=>ht(t)?t.sourceColorHct.tone:ae(t)?t.isDark?85:25:t.isDark?30:90,isBackground:!0,background:t=>v.highestSurface(t),contrastCurve:new G(1,1,3,4.5),toneDeltaPair:t=>new Le(v.primaryContainer,v.primary,10,"nearer",!1)});v.onPrimaryContainer=N.fromPalette({name:"on_primary_container",palette:t=>t.primaryPalette,tone:t=>ht(t)?N.foregroundTone(v.primaryContainer.tone(t),4.5):ae(t)?t.isDark?0:100:t.isDark?90:30,background:t=>v.primaryContainer,contrastCurve:new G(3,4.5,7,11)});v.inversePrimary=N.fromPalette({name:"inverse_primary",palette:t=>t.primaryPalette,tone:t=>t.isDark?40:80,background:t=>v.inverseSurface,contrastCurve:new G(3,4.5,7,7)});v.secondary=N.fromPalette({name:"secondary",palette:t=>t.secondaryPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>v.highestSurface(t),contrastCurve:new G(3,4.5,7,7),toneDeltaPair:t=>new Le(v.secondaryContainer,v.secondary,10,"nearer",!1)});v.onSecondary=N.fromPalette({name:"on_secondary",palette:t=>t.secondaryPalette,tone:t=>ae(t)?t.isDark?10:100:t.isDark?20:100,background:t=>v.secondary,contrastCurve:new G(4.5,7,11,21)});v.secondaryContainer=N.fromPalette({name:"secondary_container",palette:t=>t.secondaryPalette,tone:t=>{const e=t.isDark?30:90;return ae(t)?t.isDark?30:85:ht(t)?Rn(t.secondaryPalette.hue,t.secondaryPalette.chroma,e,!t.isDark):e},isBackground:!0,background:t=>v.highestSurface(t),contrastCurve:new G(1,1,3,4.5),toneDeltaPair:t=>new Le(v.secondaryContainer,v.secondary,10,"nearer",!1)});v.onSecondaryContainer=N.fromPalette({name:"on_secondary_container",palette:t=>t.secondaryPalette,tone:t=>ae(t)?t.isDark?90:10:ht(t)?N.foregroundTone(v.secondaryContainer.tone(t),4.5):t.isDark?90:30,background:t=>v.secondaryContainer,contrastCurve:new G(3,4.5,7,11)});v.tertiary=N.fromPalette({name:"tertiary",palette:t=>t.tertiaryPalette,tone:t=>ae(t)?t.isDark?90:25:t.isDark?80:40,isBackground:!0,background:t=>v.highestSurface(t),contrastCurve:new G(3,4.5,7,7),toneDeltaPair:t=>new Le(v.tertiaryContainer,v.tertiary,10,"nearer",!1)});v.onTertiary=N.fromPalette({name:"on_tertiary",palette:t=>t.tertiaryPalette,tone:t=>ae(t)?t.isDark?10:90:t.isDark?20:100,background:t=>v.tertiary,contrastCurve:new G(4.5,7,11,21)});v.tertiaryContainer=N.fromPalette({name:"tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>{if(ae(t))return t.isDark?60:49;if(!ht(t))return t.isDark?30:90;const e=t.tertiaryPalette.getHct(t.sourceColorHct.tone);return Qt.fixIfDisliked(e).tone},isBackground:!0,background:t=>v.highestSurface(t),contrastCurve:new G(1,1,3,4.5),toneDeltaPair:t=>new Le(v.tertiaryContainer,v.tertiary,10,"nearer",!1)});v.onTertiaryContainer=N.fromPalette({name:"on_tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>ae(t)?t.isDark?0:100:ht(t)?N.foregroundTone(v.tertiaryContainer.tone(t),4.5):t.isDark?90:30,background:t=>v.tertiaryContainer,contrastCurve:new G(3,4.5,7,11)});v.error=N.fromPalette({name:"error",palette:t=>t.errorPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>v.highestSurface(t),contrastCurve:new G(3,4.5,7,7),toneDeltaPair:t=>new Le(v.errorContainer,v.error,10,"nearer",!1)});v.onError=N.fromPalette({name:"on_error",palette:t=>t.errorPalette,tone:t=>t.isDark?20:100,background:t=>v.error,contrastCurve:new G(4.5,7,11,21)});v.errorContainer=N.fromPalette({name:"error_container",palette:t=>t.errorPalette,tone:t=>t.isDark?30:90,isBackground:!0,background:t=>v.highestSurface(t),contrastCurve:new G(1,1,3,4.5),toneDeltaPair:t=>new Le(v.errorContainer,v.error,10,"nearer",!1)});v.onErrorContainer=N.fromPalette({name:"on_error_container",palette:t=>t.errorPalette,tone:t=>ae(t)?t.isDark?90:10:t.isDark?90:30,background:t=>v.errorContainer,contrastCurve:new G(3,4.5,7,11)});v.primaryFixed=N.fromPalette({name:"primary_fixed",palette:t=>t.primaryPalette,tone:t=>ae(t)?40:90,isBackground:!0,background:t=>v.highestSurface(t),contrastCurve:new G(1,1,3,4.5),toneDeltaPair:t=>new Le(v.primaryFixed,v.primaryFixedDim,10,"lighter",!0)});v.primaryFixedDim=N.fromPalette({name:"primary_fixed_dim",palette:t=>t.primaryPalette,tone:t=>ae(t)?30:80,isBackground:!0,background:t=>v.highestSurface(t),contrastCurve:new G(1,1,3,4.5),toneDeltaPair:t=>new Le(v.primaryFixed,v.primaryFixedDim,10,"lighter",!0)});v.onPrimaryFixed=N.fromPalette({name:"on_primary_fixed",palette:t=>t.primaryPalette,tone:t=>ae(t)?100:10,background:t=>v.primaryFixedDim,secondBackground:t=>v.primaryFixed,contrastCurve:new G(4.5,7,11,21)});v.onPrimaryFixedVariant=N.fromPalette({name:"on_primary_fixed_variant",palette:t=>t.primaryPalette,tone:t=>ae(t)?90:30,background:t=>v.primaryFixedDim,secondBackground:t=>v.primaryFixed,contrastCurve:new G(3,4.5,7,11)});v.secondaryFixed=N.fromPalette({name:"secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>ae(t)?80:90,isBackground:!0,background:t=>v.highestSurface(t),contrastCurve:new G(1,1,3,4.5),toneDeltaPair:t=>new Le(v.secondaryFixed,v.secondaryFixedDim,10,"lighter",!0)});v.secondaryFixedDim=N.fromPalette({name:"secondary_fixed_dim",palette:t=>t.secondaryPalette,tone:t=>ae(t)?70:80,isBackground:!0,background:t=>v.highestSurface(t),contrastCurve:new G(1,1,3,4.5),toneDeltaPair:t=>new Le(v.secondaryFixed,v.secondaryFixedDim,10,"lighter",!0)});v.onSecondaryFixed=N.fromPalette({name:"on_secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>10,background:t=>v.secondaryFixedDim,secondBackground:t=>v.secondaryFixed,contrastCurve:new G(4.5,7,11,21)});v.onSecondaryFixedVariant=N.fromPalette({name:"on_secondary_fixed_variant",palette:t=>t.secondaryPalette,tone:t=>ae(t)?25:30,background:t=>v.secondaryFixedDim,secondBackground:t=>v.secondaryFixed,contrastCurve:new G(3,4.5,7,11)});v.tertiaryFixed=N.fromPalette({name:"tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>ae(t)?40:90,isBackground:!0,background:t=>v.highestSurface(t),contrastCurve:new G(1,1,3,4.5),toneDeltaPair:t=>new Le(v.tertiaryFixed,v.tertiaryFixedDim,10,"lighter",!0)});v.tertiaryFixedDim=N.fromPalette({name:"tertiary_fixed_dim",palette:t=>t.tertiaryPalette,tone:t=>ae(t)?30:80,isBackground:!0,background:t=>v.highestSurface(t),contrastCurve:new G(1,1,3,4.5),toneDeltaPair:t=>new Le(v.tertiaryFixed,v.tertiaryFixedDim,10,"lighter",!0)});v.onTertiaryFixed=N.fromPalette({name:"on_tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>ae(t)?100:10,background:t=>v.tertiaryFixedDim,secondBackground:t=>v.tertiaryFixed,contrastCurve:new G(4.5,7,11,21)});v.onTertiaryFixedVariant=N.fromPalette({name:"on_tertiary_fixed_variant",palette:t=>t.tertiaryPalette,tone:t=>ae(t)?90:30,background:t=>v.tertiaryFixedDim,secondBackground:t=>v.tertiaryFixed,contrastCurve:new G(3,4.5,7,11)});/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class _e{static of(e){return new _e(e,!1)}static contentOf(e){return new _e(e,!0)}static fromColors(e){return _e.createPaletteFromColors(!1,e)}static contentFromColors(e){return _e.createPaletteFromColors(!0,e)}static createPaletteFromColors(e,r){const n=new _e(r.primary,e);if(r.secondary){const a=new _e(r.secondary,e);n.a2=a.a1}if(r.tertiary){const a=new _e(r.tertiary,e);n.a3=a.a1}if(r.error){const a=new _e(r.error,e);n.error=a.a1}if(r.neutral){const a=new _e(r.neutral,e);n.n1=a.n1}if(r.neutralVariant){const a=new _e(r.neutralVariant,e);n.n2=a.n2}return n}constructor(e,r){const n=de.fromInt(e),a=n.hue,o=n.chroma;r?(this.a1=be.fromHueAndChroma(a,o),this.a2=be.fromHueAndChroma(a,o/3),this.a3=be.fromHueAndChroma(a+60,o/2),this.n1=be.fromHueAndChroma(a,Math.min(o/12,4)),this.n2=be.fromHueAndChroma(a,Math.min(o/6,8))):(this.a1=be.fromHueAndChroma(a,Math.max(48,o)),this.a2=be.fromHueAndChroma(a,16),this.a3=be.fromHueAndChroma(a+60,24),this.n1=be.fromHueAndChroma(a,4),this.n2=be.fromHueAndChroma(a,8)),this.error=be.fromHueAndChroma(25,84)}}/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/class Xe{get primary(){return this.props.primary}get onPrimary(){return this.props.onPrimary}get primaryContainer(){return this.props.primaryContainer}get onPrimaryContainer(){return this.props.onPrimaryContainer}get secondary(){return this.props.secondary}get onSecondary(){return this.props.onSecondary}get secondaryContainer(){return this.props.secondaryContainer}get onSecondaryContainer(){return this.props.onSecondaryContainer}get tertiary(){return this.props.tertiary}get onTertiary(){return this.props.onTertiary}get tertiaryContainer(){return this.props.tertiaryContainer}get onTertiaryContainer(){return this.props.onTertiaryContainer}get error(){return this.props.error}get onError(){return this.props.onError}get errorContainer(){return this.props.errorContainer}get onErrorContainer(){return this.props.onErrorContainer}get background(){return this.props.background}get onBackground(){return this.props.onBackground}get surface(){return this.props.surface}get onSurface(){return this.props.onSurface}get surfaceVariant(){return this.props.surfaceVariant}get onSurfaceVariant(){return this.props.onSurfaceVariant}get outline(){return this.props.outline}get outlineVariant(){return this.props.outlineVariant}get shadow(){return this.props.shadow}get scrim(){return this.props.scrim}get inverseSurface(){return this.props.inverseSurface}get inverseOnSurface(){return this.props.inverseOnSurface}get inversePrimary(){return this.props.inversePrimary}static light(e){return Xe.lightFromCorePalette(_e.of(e))}static dark(e){return Xe.darkFromCorePalette(_e.of(e))}static lightContent(e){return Xe.lightFromCorePalette(_e.contentOf(e))}static darkContent(e){return Xe.darkFromCorePalette(_e.contentOf(e))}static lightFromCorePalette(e){return new Xe({primary:e.a1.tone(40),onPrimary:e.a1.tone(100),primaryContainer:e.a1.tone(90),onPrimaryContainer:e.a1.tone(10),secondary:e.a2.tone(40),onSecondary:e.a2.tone(100),secondaryContainer:e.a2.tone(90),onSecondaryContainer:e.a2.tone(10),tertiary:e.a3.tone(40),onTertiary:e.a3.tone(100),tertiaryContainer:e.a3.tone(90),onTertiaryContainer:e.a3.tone(10),error:e.error.tone(40),onError:e.error.tone(100),errorContainer:e.error.tone(90),onErrorContainer:e.error.tone(10),background:e.n1.tone(99),onBackground:e.n1.tone(10),surface:e.n1.tone(99),onSurface:e.n1.tone(10),surfaceVariant:e.n2.tone(90),onSurfaceVariant:e.n2.tone(30),outline:e.n2.tone(50),outlineVariant:e.n2.tone(80),shadow:e.n1.tone(0),scrim:e.n1.tone(0),inverseSurface:e.n1.tone(20),inverseOnSurface:e.n1.tone(95),inversePrimary:e.a1.tone(80)})}static darkFromCorePalette(e){return new Xe({primary:e.a1.tone(80),onPrimary:e.a1.tone(20),primaryContainer:e.a1.tone(30),onPrimaryContainer:e.a1.tone(90),secondary:e.a2.tone(80),onSecondary:e.a2.tone(20),secondaryContainer:e.a2.tone(30),onSecondaryContainer:e.a2.tone(90),tertiary:e.a3.tone(80),onTertiary:e.a3.tone(20),tertiaryContainer:e.a3.tone(30),onTertiaryContainer:e.a3.tone(90),error:e.error.tone(80),onError:e.error.tone(20),errorContainer:e.error.tone(30),onErrorContainer:e.error.tone(80),background:e.n1.tone(10),onBackground:e.n1.tone(90),surface:e.n1.tone(10),onSurface:e.n1.tone(90),surfaceVariant:e.n2.tone(30),onSurfaceVariant:e.n2.tone(80),outline:e.n2.tone(60),outlineVariant:e.n2.tone(30),shadow:e.n1.tone(0),scrim:e.n1.tone(0),inverseSurface:e.n1.tone(90),inverseOnSurface:e.n1.tone(20),inversePrimary:e.a1.tone(40)})}constructor(e){this.props=e}toJSON(){return{...this.props}}}/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/function Sr(t){const e=Or(t),r=Mr(t),n=Rr(t),a=[e.toString(16),r.toString(16),n.toString(16)];for(const[o,s]of a.entries())s.length===1&&(a[o]="0"+s);return"#"+a.join("")}function Nn(t){t=t.replace("#","");const e=t.length===3,r=t.length===6,n=t.length===8;if(!e&&!r&&!n)throw new Error("unexpected hex "+t);let a=0,o=0,s=0;return e?(a=je(t.slice(0,1).repeat(2)),o=je(t.slice(1,2).repeat(2)),s=je(t.slice(2,3).repeat(2))):r?(a=je(t.slice(0,2)),o=je(t.slice(2,4)),s=je(t.slice(4,6))):n&&(a=je(t.slice(2,4)),o=je(t.slice(4,6)),s=je(t.slice(6,8))),(255<<24|(a&255)<<16|(o&255)<<8|s&255)>>>0}function je(t){return parseInt(t,16)}/**
* @license
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/function Sn(t,e=[]){const r=_e.of(t);return{source:t,schemes:{light:Xe.light(t),dark:Xe.dark(t)},palettes:{primary:r.a1,secondary:r.a2,tertiary:r.a3,neutral:r.n1,neutralVariant:r.n2,error:r.error},customColors:e.map(n=>Fn(t,n))}}function Fn(t,e){let r=e.value;const n=r,a=t;e.blend&&(r=Zt.harmonize(n,a));const s=_e.of(r).a1;return{color:e,value:r,light:{color:s.tone(40),onColor:s.tone(100),colorContainer:s.tone(90),onColorContainer:s.tone(10)},dark:{color:s.tone(80),onColor:s.tone(20),colorContainer:s.tone(30),onColorContainer:s.tone(90)}}}function Bn(t,e){const r=e?.target||document.body,a=e?.dark??!1?t.schemes.dark:t.schemes.light;if(Bt(r,a),e?.brightnessSuffix&&(Bt(r,t.schemes.dark,"-dark"),Bt(r,t.schemes.light,"-light")),e?.paletteTones){const o=e?.paletteTones??[];for(const[s,i]of Object.entries(t.palettes)){const l=s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();for(const u of o){const c=`--md-ref-palette-${l}-${l}${u}`,f=Sr(i.tone(u));r.style.setProperty(c,f)}}}}function Bt(t,e,r=""){for(const[n,a]of Object.entries(e.toJSON())){const o=n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),s=Sr(a);t.style.setProperty(`--md-sys-color-${o}${r}`,s)}}function Un(t,e="one"){const r={charaVersion:1,type:"layout",device:e,layout:[[],[],[]]};for(const n of t.trim().split(`
`)){const[a,o,s]=n.substring(1).split(",").map(Number);r.layout[Number(a)-1][Number(o)]=Number(s)}return r}function Vn(t){return/^(A[123],\d+,\d+\n?)+$/.test(t)}const Wn=new Map([[" ","SPACE"]]);function zn(t){return{charaVersion:1,type:"chords",chords:t.trim().split(`
`).map(e=>{const[r,n]=e.split(/,(?=[^,]*$)/,2);return[r.split("+").map(a=>sr.get(a.trim())?.code??0).sort((a,o)=>a-o),n.trim().split("").map(a=>sr.get(Wn.get(a)??a)?.code??0)]})}}function Gn(t){return/^([^+]+( *\+ *[^+]+)* *, *[^+, ]+ *(\n|(?=$)))+$/.test(t)}function yt(t){const e=URL.createObjectURL(new Blob([JSON.stringify(t)],{type:"application/json"})),r=document.createElement("a");r.setAttribute("download",`${t.type}-${Ke(Be)?.device}-${new Date().toISOString()}.json`),r.href=e,r.setAttribute("target","_blank"),r.click(),URL.revokeObjectURL(e)}function Fr(){yt({charaVersion:1,type:"backup",history:[[Ur(),Br(),Vr()]]})}function Br(){return{charaVersion:1,type:"layout",device:Ke(Be)?.device,layout:Ke(Xt).map(t=>t.map(e=>e.action))}}function Ur(){return{charaVersion:1,type:"chords",chords:Ke(qt).map(t=>[t.actions,t.phrase])}}function Vr(){return{charaVersion:1,type:"settings",settings:Ke(jt).map(t=>t.value)}}async function Hn(t){const e=t.target.files[0];if(!e)return;const r=await e.text();e.name.endsWith(".json")?Ct(JSON.parse(r)):Vn(r)?Ct(Un(r)):Gn(r)&&Ct(zn(r))}function Ct(t){if(t.charaVersion!==1)throw new Error("Incompatible backup");switch(t.type){case"backup":{const e=t.history[0];if(!e)return;let r=e[1].device;r==="TWO"&&(r="ONE");let n=Ke(Be)?.device;if(n==="TWO"&&(n="ONE"),r!==n)throw alert("Backup is incompatible with this device"),new Error("Backup is incompatible with this device");We.update(a=>(a.push(...cr(e[0]),...fr(e[1]),...ur(e[2])),a));break}case"chords":{We.update(e=>(e.push(...cr(t)),e));break}case"layout":{We.update(e=>(e.push(...fr(t)),e));break}case"settings":{We.update(e=>(e.push(...ur(t)),e));break}default:throw new Error(`Unknown backup type "${t.type}"`)}}function cr(t){const e=[],r=new Set(Ke(qt).map(({phrase:n,actions:a})=>JSON.stringify([a,n])));for(const[n,a]of t.chords)r.has(JSON.stringify([n,a]))||e.push({type:St.Chord,actions:n,phrase:a,id:n});return e}function ur(t){const e=[];for(const[r,n]of t.settings.entries()){const a=Ke(jt)[r];a!==void 0&&a.value!==n&&e.push({type:St.Setting,id:r,setting:n})}return e}function fr(t){const e=[];for(const[r,n]of t.layout.entries())for(const[a,o]of n.entries())Ke(Xt)[r]?.[a]?.action!==o&&e.push({type:St.Layout,layer:r,id:a,action:o});return e}function $n(t){let e,r,n,a,o=t[0].backup.TITLE()+"",s,i,l,u,c=t[0].backup.DISCLAIMER()+"",f,g,d,k,p=t[0].backup.INDIVIDUAL()+"",m,A,_,I,b="piano",T,P=t[0].configure.chords.TITLE()+"",R,D,y,O,Y="keyboard",U,H=t[0].configure.layout.TITLE()+"",ne,Q,ie,ee,le="settings",Te,se=t[0].configure.settings.TITLE()+"",we,De,pe,Ee,Z,nt="download",ve=t[0].backup.DOWNLOAD()+"",te,Ze,ce,$,re,Ie="settings_backup_restore",Qe=t[0].backup.RESTORE()+"",qe,xe,Ae;return{c(){e=L("section"),r=L("h2"),n=L("label"),a=L("input"),s=W(o),i=S(),l=L("p"),u=L("i"),f=W(c),g=S(),d=L("fieldset"),k=L("legend"),m=W(p),A=S(),_=L("button"),I=L("span"),I.textContent=b,T=S(),R=W(P),D=S(),y=L("button"),O=L("span"),O.textContent=Y,U=S(),ne=W(H),Q=S(),ie=L("button"),ee=L("span"),ee.textContent=le,Te=S(),we=W(se),De=S(),pe=L("div"),Ee=L("button"),Z=L("span"),Z.textContent=nt,te=W(ve),Ze=S(),ce=L("label"),$=L("input"),re=L("span"),re.textContent=Ie,qe=W(Qe),this.h()},l(me){e=w(me,"SECTION",{class:!0});var oe=M(e);r=w(oe,"H2",{class:!0});var dt=M(r);n=w(dt,"LABEL",{class:!0});var at=M(n);a=w(at,"INPUT",{type:!0,class:!0}),s=z(at,o),at.forEach(E),dt.forEach(E),i=F(oe),l=w(oe,"P",{class:!0});var pt=M(l);u=w(pt,"I",{});var ct=M(u);f=z(ct,c),ct.forEach(E),pt.forEach(E),g=F(oe),d=w(oe,"FIELDSET",{class:!0});var et=M(d);k=w(et,"LEGEND",{});var xt=M(k);m=z(xt,p),xt.forEach(E),A=F(et),_=w(et,"BUTTON",{});var kt=M(_);I=w(kt,"SPAN",{class:!0,"data-svelte-h":!0}),x(I)!=="svelte-wkbair"&&(I.textContent=b),T=F(kt),R=z(kt,P),kt.forEach(E),D=F(et),y=w(et,"BUTTON",{});var Tt=M(y);O=w(Tt,"SPAN",{class:!0,"data-svelte-h":!0}),x(O)!=="svelte-1sytia5"&&(O.textContent=Y),U=F(Tt),ne=z(Tt,H),Tt.forEach(E),Q=F(et),ie=w(et,"BUTTON",{});var Et=M(ie);ee=w(Et,"SPAN",{class:!0,"data-svelte-h":!0}),x(ee)!=="svelte-k4cu01"&&(ee.textContent=le),Te=F(Et),we=z(Et,se),Et.forEach(E),et.forEach(E),De=F(oe),pe=w(oe,"DIV",{class:!0});var vt=M(pe);Ee=w(vt,"BUTTON",{class:!0});var Ft=M(Ee);Z=w(Ft,"SPAN",{class:!0,"data-svelte-h":!0}),x(Z)!=="svelte-cgubnm"&&(Z.textContent=nt),te=z(Ft,ve),Ft.forEach(E),Ze=F(vt),ce=w(vt,"LABEL",{class:!0});var It=M(ce);$=w(It,"INPUT",{type:!0,class:!0}),re=w(It,"SPAN",{class:!0,"data-svelte-h":!0}),x(re)!=="svelte-591ihr"&&(re.textContent=Ie),qe=z(It,Qe),It.forEach(E),vt.forEach(E),oe.forEach(E),this.h()},h(){C(a,"type","checkbox"),C(a,"class","svelte-1kun7u7"),C(n,"class","svelte-1kun7u7"),C(r,"class","svelte-1kun7u7"),C(l,"class","disclaimer svelte-1kun7u7"),C(I,"class","icon"),C(O,"class","icon"),C(ee,"class","icon"),C(d,"class","svelte-1kun7u7"),C(Z,"class","icon"),C(Ee,"class","primary"),C($,"type","file"),C($,"class","svelte-1kun7u7"),C(re,"class","icon"),C(ce,"class","button"),C(pe,"class","save svelte-1kun7u7"),C(e,"class","svelte-1kun7u7")},m(me,oe){B(me,e,oe),h(e,r),h(r,n),h(n,a),h(n,s),h(e,i),h(e,l),h(l,u),h(u,f),h(e,g),h(e,d),h(d,k),h(k,m),h(d,A),h(d,_),h(_,I),h(_,T),h(_,R),h(d,D),h(d,y),h(y,O),h(y,U),h(y,ne),h(d,Q),h(d,ie),h(ie,ee),h(ie,Te),h(ie,we),h(e,De),h(e,pe),h(pe,Ee),h(Ee,Z),h(Ee,te),h(pe,Ze),h(pe,ce),h(ce,$),h(ce,re),h(ce,qe),xe||(Ae=[ke(Cr.call(null,a,"backup")),J(_,"click",t[1]),J(y,"click",t[2]),J(ie,"click",t[3]),J(Ee,"click",Fr),J($,"input",Hn)],xe=!0)},p(me,[oe]){oe&1&&o!==(o=me[0].backup.TITLE()+"")&&q(s,o),oe&1&&c!==(c=me[0].backup.DISCLAIMER()+"")&&q(f,c),oe&1&&p!==(p=me[0].backup.INDIVIDUAL()+"")&&q(m,p),oe&1&&P!==(P=me[0].configure.chords.TITLE()+"")&&q(R,P),oe&1&&H!==(H=me[0].configure.layout.TITLE()+"")&&q(ne,H),oe&1&&se!==(se=me[0].configure.settings.TITLE()+"")&&q(we,se),oe&1&&ve!==(ve=me[0].backup.DOWNLOAD()+"")&&q(te,ve),oe&1&&Qe!==(Qe=me[0].backup.RESTORE()+"")&&q(qe,Qe)},i:ge,o:ge,d(me){me&&E(e),xe=!1,Ve(Ae)}}}function Yn(t,e,r){let n;return X(t,Je,i=>r(0,n=i)),[n,()=>yt(Ur()),()=>yt(Br()),()=>yt(Vr())]}class qn extends Ne{constructor(e){super(),Se(this,e,Yn,$n,Re,{})}}function hr(t){let e,r=t[0].company+"",n,a,o=t[0].device+"",s,i,l=t[0].chipset+"",u,c,f,g,d=t[0].version+"",k,p,m,A=t[0].version.toString()!=="1.1.4",_,I,b=A&&dr();return{c(){e=L("p"),n=W(r),a=S(),s=W(o),i=S(),u=W(l),c=S(),f=L("br"),g=W(`
Version `),k=W(d),m=S(),b&&b.c(),_=Ce(),this.h()},l(T){e=w(T,"P",{class:!0});var P=M(e);n=z(P,r),a=F(P),s=z(P,o),i=F(P),u=z(P,l),c=F(P),f=w(P,"BR",{}),g=z(P,`
Version `),k=z(P,d),P.forEach(E),m=F(T),b&&b.l(T),_=Ce(),this.h()},h(){C(e,"class","svelte-13dypst")},m(T,P){B(T,e,P),h(e,n),h(e,a),h(e,s),h(e,i),h(e,u),h(e,c),h(e,f),h(e,g),h(e,k),B(T,m,P),b&&b.m(T,P),B(T,_,P),I=!0},p(T,P){(!I||P&1)&&r!==(r=T[0].company+"")&&q(n,r),(!I||P&1)&&o!==(o=T[0].device+"")&&q(s,o),(!I||P&1)&&l!==(l=T[0].chipset+"")&&q(u,l),(!I||P&1)&&d!==(d=T[0].version+"")&&q(k,d),P&1&&(A=T[0].version.toString()!=="1.1.4"),A?b||(b=dr(),b.c(),b.m(_.parentNode,_)):b&&(b.d(1),b=null)},i(T){I||(T&&Pe(()=>{I&&(p||(p=ue(e,Me,{},!0)),p.run(1))}),I=!0)},o(T){T&&(p||(p=ue(e,Me,{},!1)),p.run(0)),I=!1},d(T){T&&(E(e),E(m),E(_)),T&&p&&p.end(),b&&b.d(T)}}}function dr(t){let e,r="Firmware Update Instructions";return{c(){e=L("a"),e.textContent=r,this.h()},l(n){e=w(n,"A",{href:!0,"data-svelte-h":!0}),x(e)!=="svelte-rccl8o"&&(e.textContent=r),this.h()},h(){C(e,"href","https://docs.charachorder.com/CharaChorder%20One.html#updating-the-firmware")},m(n,a){B(n,e,a)},d(n){n&&E(e)}}}function jn(t){let e=navigator.userAgent.includes("Linux")&&!t[0],r,n,a,o,s,i,l,u,c,f,g,d,k,p,m,A,_,I=e&&pr(t),b=t[1]&&mr(t);function T(y,O){return y[0]?Kn:Xn}let P=T(t),R=P(t),D=t[3]&&_r(t);return{c(){I&&I.c(),r=S(),b&&b.c(),n=S(),a=L("div"),R.c(),o=S(),s=L("div"),i=L("a"),l=W("terminal"),c=S(),f=L("button"),g=W("settings_power"),p=S(),D&&D.c(),m=Ce(),this.h()},l(y){I&&I.l(y),r=F(y),b&&b.l(y),n=F(y),a=w(y,"DIV",{class:!0});var O=M(a);R.l(O),o=F(O),s=w(O,"DIV",{class:!0,style:!0});var Y=M(s);i=w(Y,"A",{href:!0,title:!0,class:!0});var U=M(i);l=z(U,"terminal"),U.forEach(E),c=F(Y),f=w(Y,"BUTTON",{class:!0,title:!0});var H=M(f);g=z(H,"settings_power"),H.forEach(E),Y.forEach(E),O.forEach(E),p=F(y),D&&D.l(y),m=Ce(),this.h()},h(){C(i,"href","/terminal"),C(i,"title",u=t[4].deviceManager.TERMINAL()),C(i,"class","icon"),ft(i,"disabled",t[0]===void 0),C(f,"class","icon svelte-13dypst"),C(f,"title",d=t[4].deviceManager.bootMenu.TITLE()),f.disabled=k=t[0]===void 0,C(s,"class","row svelte-13dypst"),jr(s,"justify-content","flex-end"),C(a,"class","row svelte-13dypst")},m(y,O){I&&I.m(y,O),B(y,r,O),b&&b.m(y,O),B(y,n,O),B(y,a,O),R.m(a,null),h(a,o),h(a,s),h(s,i),h(i,l),h(s,c),h(s,f),h(f,g),B(y,p,O),D&&D.m(y,O),B(y,m,O),A||(_=[J(i,"click",t[9]),J(f,"click",t[10])],A=!0)},p(y,O){O&1&&(e=navigator.userAgent.includes("Linux")&&!y[0]),e?I?I.p(y,O):(I=pr(y),I.c(),I.m(r.parentNode,r)):I&&(I.d(1),I=null),y[1]?b?(b.p(y,O),O&2&&j(b,1)):(b=mr(y),b.c(),j(b,1),b.m(n.parentNode,n)):b&&(it(),K(b,1,1,()=>{b=null}),lt()),P===(P=T(y))&&R?R.p(y,O):(R.d(1),R=P(y),R&&(R.c(),R.m(a,o))),O&16&&u!==(u=y[4].deviceManager.TERMINAL())&&C(i,"title",u),O&1&&ft(i,"disabled",y[0]===void 0),O&16&&d!==(d=y[4].deviceManager.bootMenu.TITLE())&&C(f,"title",d),O&1&&k!==(k=y[0]===void 0)&&(f.disabled=k),y[3]?D?(D.p(y,O),O&8&&j(D,1)):(D=_r(y),D.c(),j(D,1),D.m(m.parentNode,m)):D&&(it(),K(D,1,1,()=>{D=null}),lt())},d(y){y&&(E(r),E(n),E(a),E(p),E(m)),I&&I.d(y),b&&b.d(y),R.d(),D&&D.d(y),A=!1,Ve(_)}}}function pr(t){let e,r,n,a=t[4].deviceManager.LINUX_PERMISSIONS()+"",o,s,i='In most cases you can simply follow the <a target="_blank" href="https://docs.arduino.cc/software/ide-v1/tutorials/Linux#please-read" class="svelte-13dypst">Arduino Guide</a> on serial port permissions.',l,u,c="Special systems:",f,g,d='<li><a target="_blank" href="https://wiki.archlinux.org/title/Arduino#Accessing_serial" class="svelte-13dypst">Arch and Arch-based like Manjaro or EndeavourOS</a></li> <li><a target="_blank" href="https://gist.github.com/CMCDragonkai/d00201ec143c9f749fc49533034e5009?permalink_comment_id=4670311#gistcomment-4670311" class="svelte-13dypst">NixOS</a></li> <li><a target="_blank" href="https://wiki.gentoo.org/wiki/Arduino#Grant_access_to_non-root_users" class="svelte-13dypst">Gentoo</a></li>';return{c(){e=L("div"),r=L("p"),n=new Dt(!1),o=S(),s=L("p"),s.innerHTML=i,l=S(),u=L("p"),u.textContent=c,f=S(),g=L("ul"),g.innerHTML=d,this.h()},l(k){e=w(k,"DIV",{class:!0});var p=M(e);r=w(p,"P",{class:!0});var m=M(r);n=Pt(m,!1),m.forEach(E),o=F(p),s=w(p,"P",{class:!0,"data-svelte-h":!0}),x(s)!=="svelte-g8l98g"&&(s.innerHTML=i),l=F(p),u=w(p,"P",{class:!0,"data-svelte-h":!0}),x(u)!=="svelte-ky2hev"&&(u.textContent=c),f=F(p),g=w(p,"UL",{"data-svelte-h":!0}),x(g)!=="svelte-64u384"&&(g.innerHTML=d),p.forEach(E),this.h()},h(){n.a=null,C(r,"class","svelte-13dypst"),C(s,"class","svelte-13dypst"),C(u,"class","svelte-13dypst"),C(e,"class","linux-info svelte-13dypst")},m(k,p){B(k,e,p),h(e,r),n.m(a,r),h(e,o),h(e,s),h(e,l),h(e,u),h(e,f),h(e,g)},p(k,p){p&16&&a!==(a=k[4].deviceManager.LINUX_PERMISSIONS()+"")&&n.p(a)},d(k){k&&E(e)}}}function mr(t){let e,r,n=t[4].deviceManager.bootMenu.POWER_WARNING()+"",a,o,s;return{c(){e=L("p"),r=L("b"),a=W(n),this.h()},l(i){e=w(i,"P",{class:!0});var l=M(e);r=w(l,"B",{});var u=M(r);a=z(u,n),u.forEach(E),l.forEach(E),this.h()},h(){C(e,"class","svelte-13dypst")},m(i,l){B(i,e,l),h(e,r),h(r,a),s=!0},p(i,l){(!s||l&16)&&n!==(n=i[4].deviceManager.bootMenu.POWER_WARNING()+"")&&q(a,n)},i(i){s||(i&&Pe(()=>{s&&(o||(o=ue(e,Me,{},!0)),o.run(1))}),s=!0)},o(i){i&&(o||(o=ue(e,Me,{},!1)),o.run(0)),s=!1},d(i){i&&E(e),i&&o&&o.end()}}}function Xn(t){let e,r,n="usb",a=t[4].deviceManager.CONNECT()+"",o,s,i;return{c(){e=L("button"),r=L("span"),r.textContent=n,o=W(a),this.h()},l(l){e=w(l,"BUTTON",{class:!0});var u=M(e);r=w(u,"SPAN",{class:!0,"data-svelte-h":!0}),x(r)!=="svelte-1d6v1js"&&(r.textContent=n),o=z(u,a),u.forEach(E),this.h()},h(){C(r,"class","icon"),C(e,"class","error svelte-13dypst")},m(l,u){B(l,e,u),h(e,r),h(e,o),s||(i=J(e,"click",t[7]),s=!0)},p(l,u){u&16&&a!==(a=l[4].deviceManager.CONNECT()+"")&&q(o,a)},d(l){l&&E(e),s=!1,i()}}}function Kn(t){let e,r,n="usb_off",a=t[4].deviceManager.DISCONNECT()+"",o,s,i;return{c(){e=L("button"),r=L("span"),r.textContent=n,o=W(a),this.h()},l(l){e=w(l,"BUTTON",{class:!0});var u=M(e);r=w(u,"SPAN",{class:!0,"data-svelte-h":!0}),x(r)!=="svelte-1anw57m"&&(r.textContent=n),o=z(u,a),u.forEach(E),this.h()},h(){C(r,"class","icon"),C(e,"class","secondary svelte-13dypst")},m(l,u){B(l,e,u),h(e,r),h(e,o),s||(i=J(e,"click",t[8]),s=!0)},p(l,u){u&16&&a!==(a=l[4].deviceManager.DISCONNECT()+"")&&q(o,a)},d(l){l&&E(e),s=!1,i()}}}function _r(t){let e,r,n,a,o,s=t[4].deviceManager.bootMenu.TITLE()+"",i,l,u,c,f="restart_alt",g=t[4].deviceManager.bootMenu.REBOOT()+"",d,k,p,m,A="rule_settings",_=t[4].deviceManager.bootMenu.BOOTLOADER()+"",I,b,T,P,R;return{c(){e=L("div"),n=S(),a=L("dialog"),o=L("h3"),i=W(s),l=S(),u=L("button"),c=L("span"),c.textContent=f,d=W(g),k=S(),p=L("button"),m=L("span"),m.textContent=A,I=W(_),this.h()},l(D){e=w(D,"DIV",{class:!0,role:!0,tabindex:!0}),M(e).forEach(E),n=F(D),a=w(D,"DIALOG",{class:!0});var y=M(a);o=w(y,"H3",{class:!0});var O=M(o);i=z(O,s),O.forEach(E),l=F(y),u=w(y,"BUTTON",{class:!0});var Y=M(u);c=w(Y,"SPAN",{class:!0,"data-svelte-h":!0}),x(c)!=="svelte-1xms7vh"&&(c.textContent=f),d=z(Y,g),Y.forEach(E),k=F(y),p=w(y,"BUTTON",{class:!0});var U=M(p);m=w(U,"SPAN",{class:!0,"data-svelte-h":!0}),x(m)!=="svelte-i8386g"&&(m.textContent=A),I=z(U,_),U.forEach(E),y.forEach(E),this.h()},h(){C(e,"class","backdrop svelte-13dypst"),C(e,"role","button"),C(e,"tabindex","-1"),C(o,"class","svelte-13dypst"),C(c,"class","icon"),C(u,"class","svelte-13dypst"),C(m,"class","icon"),C(p,"class","svelte-13dypst"),a.open=!0,C(a,"class","svelte-13dypst")},m(D,y){B(D,e,y),B(D,n,y),B(D,a,y),h(a,o),h(o,i),h(a,l),h(a,u),h(u,c),h(u,d),h(a,k),h(a,p),h(p,m),h(p,I),T=!0,P||(R=[J(e,"click",t[11]),J(e,"keypress",t[12]),J(u,"click",t[5]),J(p,"click",t[6])],P=!0)},p(D,y){(!T||y&16)&&s!==(s=D[4].deviceManager.bootMenu.TITLE()+"")&&q(i,s),(!T||y&16)&&g!==(g=D[4].deviceManager.bootMenu.REBOOT()+"")&&q(d,g),(!T||y&16)&&_!==(_=D[4].deviceManager.bootMenu.BOOTLOADER()+"")&&q(I,_)},i(D){T||(D&&Pe(()=>{T&&(r||(r=ue(e,ar,{duration:250},!0)),r.run(1))}),D&&Pe(()=>{T&&(b||(b=ue(a,Me,{duration:250},!0)),b.run(1))}),T=!0)},o(D){D&&(r||(r=ue(e,ar,{duration:250},!1)),r.run(0)),D&&(b||(b=ue(a,Me,{duration:250},!1)),b.run(0)),T=!1},d(D){D&&(E(e),E(n),E(a)),D&&r&&r.end(),D&&b&&b.end(),P=!1,Ve(R)}}}function Jn(t){let e,r,n,a=t[4].deviceManager.TITLE()+"",o,s,i,l=t[4].deviceManager.AUTO_CONNECT()+"",u,c,f,g,d,k,p=t[0]&&hr(t),m=jn(t);return{c(){e=L("section"),r=L("div"),n=L("h2"),o=W(a),s=S(),i=L("label"),u=W(l),c=L("input"),f=S(),p&&p.c(),g=S(),m&&m.c(),this.h()},l(A){e=w(A,"SECTION",{class:!0});var _=M(e);r=w(_,"DIV",{class:!0});var I=M(r);n=w(I,"H2",{class:!0});var b=M(n);o=z(b,a),b.forEach(E),s=F(I),i=w(I,"LABEL",{});var T=M(i);u=z(T,l),c=w(T,"INPUT",{type:!0}),T.forEach(E),I.forEach(E),f=F(_),p&&p.l(_),g=F(_),m&&m.l(_),_.forEach(E),this.h()},h(){C(n,"class","svelte-13dypst"),C(c,"type","checkbox"),C(r,"class","row svelte-13dypst"),C(e,"class","svelte-13dypst")},m(A,_){B(A,e,_),h(e,r),h(r,n),h(n,o),h(r,s),h(r,i),h(i,u),h(i,c),h(e,f),p&&p.m(e,null),h(e,g),m&&m.m(e,null),d||(k=ke(Cr.call(null,c,"autoConnect")),d=!0)},p(A,[_]){_&16&&a!==(a=A[4].deviceManager.TITLE()+"")&&q(o,a),_&16&&l!==(l=A[4].deviceManager.AUTO_CONNECT()+"")&&q(u,l),A[0]?p?(p.p(A,_),_&1&&j(p,1)):(p=hr(A),p.c(),j(p,1),p.m(e,g)):p&&(it(),K(p,1,1,()=>{p=null}),lt()),m.p(A,_)},i(A){j(p)},o(A){K(p)},d(A){A&&E(e),p&&p.d(),m&&m.d(),d=!1,k()}}}function Zn(t,e,r){let n,a;X(t,Be,m=>r(0,n=m)),X(t,Je,m=>r(4,a=m));function o(){n?.reboot(),Fe(Be,n=void 0,n),r(3,c=!1),setTimeout(()=>{Vt()},1e3)}function s(){Fr(),n?.bootloader(),Fe(Be,n=void 0,n),r(1,l=!0),r(3,c=!1)}async function i(){try{await Vt(!0)}catch(m){console.error(m),alert("Connection failed. Is your device maybe pre-CCOS? Refer to the doc link in the bottom left for more information on your device.")}}let l=!1,u=!1,c=!1;const f=()=>{n?.forget(),Fe(Be,n=void 0,n)},g=()=>r(2,u=!u),d=()=>r(3,c=!c),k=()=>r(3,c=!c),p=m=>{m.key==="Enter"&&r(3,c=!c)};return t.$$.update=()=>{t.$$.dirty&1&&n&&r(1,l=!1)},[n,l,u,c,a,o,s,i,f,g,d,k,p]}class Qn extends Ne{constructor(e){super(),Se(this,e,Zn,Jn,Re,{})}}function gr(t,e,r){const n=t.slice();return n[5]=e[r].href,n[6]=e[r].title,n[7]=e[r].icon,n}function br(t){let e,r,n=t[7]+"",a,o,s=t[6]+"",i,l,u;return{c(){e=L("a"),r=L("span"),a=W(n),o=S(),i=W(s),l=S(),this.h()},l(c){e=w(c,"A",{href:!0,class:!0});var f=M(e);r=w(f,"SPAN",{class:!0});var g=M(r);a=z(g,n),g.forEach(E),o=F(f),i=z(f,s),l=F(f),f.forEach(E),this.h()},h(){C(r,"class","icon"),C(e,"href",u=t[5]),C(e,"class","svelte-1hx2o0l"),ft(e,"active",t[1].url.pathname.startsWith(t[5]))},m(c,f){B(c,e,f),h(e,r),h(r,a),h(e,o),h(e,i),h(e,l)},p(c,f){f&1&&n!==(n=c[7]+"")&&q(a,n),f&1&&s!==(s=c[6]+"")&&q(i,s),f&1&&u!==(u=c[5])&&C(e,"href",u),f&3&&ft(e,"active",c[1].url.pathname.startsWith(c[5]))},d(c){c&&E(e)}}}function xn(t){let e,r,n,a=Wt(t[0]),o=[];for(let l=0;l<a.length;l+=1)o[l]=br(gr(t,a,l));const s=t[4].default,i=Ot(s,t,t[3],null);return{c(){e=L("nav");for(let l=0;l<o.length;l+=1)o[l].c();r=S(),i&&i.c(),this.h()},l(l){e=w(l,"NAV",{class:!0});var u=M(e);for(let c=0;c<o.length;c+=1)o[c].l(u);u.forEach(E),r=F(l),i&&i.l(l),this.h()},h(){C(e,"class","svelte-1hx2o0l")},m(l,u){B(l,e,u);for(let c=0;c<o.length;c+=1)o[c]&&o[c].m(e,null);B(l,r,u),i&&i.m(l,u),n=!0},p(l,[u]){if(u&3){a=Wt(l[0]);let c;for(c=0;c<a.length;c+=1){const f=gr(l,a,c);o[c]?o[c].p(f,u):(o[c]=br(f),o[c].c(),o[c].m(e,null))}for(;c<o.length;c+=1)o[c].d(1);o.length=a.length}i&&i.p&&(!n||u&8)&&Mt(i,s,l,l[3],n?Nt(s,l[3],u,null):Rt(l[3]),null)},i(l){n||(j(i,l),n=!0)},o(l){K(i,l),n=!1},d(l){l&&(E(e),E(r)),yr(o,l),i&&i.d(l)}}}function ea(t,e,r){let n,a,o;X(t,Je,l=>r(2,a=l)),X(t,pn,l=>r(1,o=l));let{$$slots:s={},$$scope:i}=e;return t.$$set=l=>{"$$scope"in l&&r(3,i=l.$$scope)},t.$$.update=()=>{t.$$.dirty&4&&r(0,n=[{href:"/config/chords/",title:a.configure.chords.TITLE(),icon:"piano"},{href:"/config/layout/",title:a.configure.layout.TITLE(),icon:"keyboard"},{href:"/config/settings/",title:a.configure.settings.TITLE(),icon:"settings"}])},[n,o,a,i,s]}class ta extends Ne{constructor(e){super(),Se(this,e,ea,xn,Re,{})}}function ra(t){let e,r;const n=t[2].default,a=Ot(n,t,t[1],null);return{c(){e=L("dialog"),a&&a.c(),this.h()},l(o){e=w(o,"DIALOG",{class:!0});var s=M(e);a&&a.l(s),s.forEach(E),this.h()},h(){C(e,"class","svelte-1v51nso")},m(o,s){B(o,e,s),a&&a.m(e,null),t[3](e),r=!0},p(o,[s]){a&&a.p&&(!r||s&2)&&Mt(a,n,o,o[1],r?Nt(n,o[1],s,null):Rt(o[1]),null)},i(o){r||(j(a,o),r=!0)},o(o){K(a,o),r=!1},d(o){o&&E(e),a&&a.d(o),t[3](null)}}}function na(t,e,r){let{$$slots:n={},$$scope:a}=e;$t(()=>{o.showModal()});let o;function s(i){Yt[i?"unshift":"push"](()=>{o=i,r(0,o)})}return t.$$set=i=>{"$$scope"in i&&r(1,a=i.$$scope)},[o,a,n,s]}class aa extends Ne{constructor(e){super(),Se(this,e,na,ra,Re,{})}}function kr(t){let e,r;return{c(){e=L("p"),r=new Dt(!1),this.h()},l(n){e=w(n,"P",{});var a=M(e);r=Pt(a,!1),a.forEach(E),this.h()},h(){r.a=null},m(n,a){B(n,e,a),r.m(t[1],e)},p(n,a){a&2&&r.p(n[1])},d(n){n&&E(e)}}}function oa(t){let e,r,n,a,o,s,i,l,u,c,f,g,d,k,p,m,A=t[1]&&kr(t);return s=new mn({props:{actions:t[4]}}),{c(){e=L("h1"),r=new Dt(!1),n=S(),A&&A.c(),a=S(),o=L("p"),Ge(s.$$.fragment),i=S(),l=L("div"),u=L("button"),c=W(t[2]),f=S(),g=L("button"),d=W(t[3]),this.h()},l(_){e=w(_,"H1",{class:!0});var I=M(e);r=Pt(I,!1),I.forEach(E),n=F(_),A&&A.l(_),a=F(_),o=w(_,"P",{});var b=M(o);He(s.$$.fragment,b),b.forEach(E),i=F(_),l=w(_,"DIV",{class:!0});var T=M(l);u=w(T,"BUTTON",{});var P=M(u);c=z(P,t[2]),P.forEach(E),f=F(T),g=w(T,"BUTTON",{class:!0});var R=M(g);d=z(R,t[3]),R.forEach(E),T.forEach(E),this.h()},h(){r.a=null,C(e,"class","svelte-8y6zrd"),C(g,"class","primary"),C(l,"class","buttons svelte-8y6zrd")},m(_,I){B(_,e,I),r.m(t[0],e),B(_,n,I),A&&A.m(_,I),B(_,a,I),B(_,o,I),$e(s,o,null),B(_,i,I),B(_,l,I),h(l,u),h(u,c),h(l,f),h(l,g),h(g,d),k=!0,p||(m=[J(u,"click",t[6]),J(g,"click",t[7])],p=!0)},p(_,I){(!k||I&1)&&r.p(_[0]),_[1]?A?A.p(_,I):(A=kr(_),A.c(),A.m(a.parentNode,a)):A&&(A.d(1),A=null);const b={};I&16&&(b.actions=_[4]),s.$set(b),(!k||I&4)&&q(c,_[2]),(!k||I&8)&&q(d,_[3])},i(_){k||(j(s.$$.fragment,_),k=!0)},o(_){K(s.$$.fragment,_),k=!1},d(_){_&&(E(e),E(n),E(a),E(o),E(i),E(l)),A&&A.d(_),Ye(s),p=!1,Ve(m)}}}function sa(t){let e,r;return e=new aa({props:{$$slots:{default:[oa]},$$scope:{ctx:t}}}),{c(){Ge(e.$$.fragment)},l(n){He(e.$$.fragment,n)},m(n,a){$e(e,n,a),r=!0},p(n,[a]){const o={};a&287&&(o.$$scope={dirty:a,ctx:n}),e.$set(o)},i(n){r||(j(e.$$.fragment,n),r=!0)},o(n){K(e.$$.fragment,n),r=!1},d(n){Ye(e,n)}}}function ia(t,e,r){let{title:n}=e,{message:a}=e,{abortTitle:o}=e,{confirmTitle:s}=e,{actions:i=[]}=e;const l=Xr(),u=()=>l("abort"),c=()=>l("confirm");return t.$$set=f=>{"title"in f&&r(0,n=f.title),"message"in f&&r(1,a=f.message),"abortTitle"in f&&r(2,o=f.abortTitle),"confirmTitle"in f&&r(3,s=f.confirmTitle),"actions"in f&&r(4,i=f.actions)},[n,a,o,s,i,l,u,c]}class la extends Ne{constructor(e){super(),Se(this,e,ia,sa,Re,{title:0,message:1,abortTitle:2,confirmTitle:3,actions:4})}}async function ca(t,e,r,n,a){const o=new la({target:document.body,props:{title:t,message:e,confirmTitle:r,abortTitle:n,actions:a}});let s;const i=new Promise(u=>{s=u});o.$on("abort",()=>s(!1)),o.$on("confirm",()=>s(!0));const l=await i;return o.$destroy(),l}function Tr(t){let e,r,n="save",a=t[2].saveActions.SAVE()+"",o,s,i,l,u,c;return{c(){e=L("button"),r=L("span"),r.textContent=n,o=W(a),this.h()},l(f){e=w(f,"BUTTON",{class:!0});var g=M(e);r=w(g,"SPAN",{class:!0,"data-svelte-h":!0}),x(r)!=="svelte-1tcm1gh"&&(r.textContent=n),o=z(g,a),g.forEach(E),this.h()},h(){C(r,"class","icon"),C(e,"class","click-me svelte-1gi54bb")},m(f,g){B(f,e,g),h(e,r),h(e,o),l=!0,u||(c=[ke(s=Ue.call(null,e,{title:t[2].saveActions.SAVE(),shortcut:"ctrl+shift+s"})),J(e,"click",t[5])],u=!0)},p(f,g){(!l||g&4)&&a!==(a=f[2].saveActions.SAVE()+"")&&q(o,a),s&&Oe(s.update)&&g&4&&s.update.call(null,{title:f[2].saveActions.SAVE(),shortcut:"ctrl+shift+s"})},i(f){l||(f&&Pe(()=>{l&&(i||(i=ue(e,tt,{x:10},!0)),i.run(1))}),l=!0)},o(f){f&&(i||(i=ue(e,tt,{x:10},!1)),i.run(0)),l=!1},d(f){f&&E(e),f&&i&&i.end(),u=!1,Ve(c)}}}function ua(t){let e,r,n,a,o,s,i,l,u,c,f,g,d,k=t[1].length!==0&&Tr(t);return{c(){e=L("button"),r=W("undo"),o=S(),s=L("button"),i=W("redo"),c=S(),k&&k.c(),f=Ce(),this.h()},l(p){e=w(p,"BUTTON",{class:!0});var m=M(e);r=z(m,"undo"),m.forEach(E),o=F(p),s=w(p,"BUTTON",{class:!0});var A=M(s);i=z(A,"redo"),A.forEach(E),c=F(p),k&&k.l(p),f=Ce(),this.h()},h(){C(e,"class","icon"),e.disabled=n=t[1].length===0,C(s,"class","icon"),s.disabled=l=t[0].length===0},m(p,m){B(p,e,m),h(e,r),B(p,o,m),B(p,s,m),h(s,i),B(p,c,m),k&&k.m(p,m),B(p,f,m),g||(d=[ke(a=Ue.call(null,e,{title:t[2].saveActions.UNDO(),shortcut:"ctrl+z"})),J(e,"click",t[3]),ke(u=Ue.call(null,s,{title:t[2].saveActions.REDO(),shortcut:"ctrl+y"})),J(s,"click",t[4])],g=!0)},p(p,[m]){m&2&&n!==(n=p[1].length===0)&&(e.disabled=n),a&&Oe(a.update)&&m&4&&a.update.call(null,{title:p[2].saveActions.UNDO(),shortcut:"ctrl+z"}),m&1&&l!==(l=p[0].length===0)&&(s.disabled=l),u&&Oe(u.update)&&m&4&&u.update.call(null,{title:p[2].saveActions.REDO(),shortcut:"ctrl+y"}),p[1].length!==0?k?(k.p(p,m),m&2&&j(k,1)):(k=Tr(p),k.c(),j(k,1),k.m(f.parentNode,f)):k&&(it(),K(k,1,1,()=>{k=null}),lt())},i(p){j(k)},o(p){K(k)},d(p){p&&(E(e),E(o),E(s),E(c),E(f)),k&&k.d(p),g=!1,Ve(d)}}}function fa(t,e,r){let n,a,o,s,i,l,u,c,f,g,d;X(t,_t,_=>r(6,n=_)),X(t,We,_=>r(1,a=_)),X(t,jt,_=>r(7,o=_)),X(t,tr,_=>r(8,s=_)),X(t,qt,_=>r(9,i=_)),X(t,rr,_=>r(10,l=_)),X(t,Xt,_=>r(11,u=_)),X(t,nr,_=>r(12,c=_)),X(t,cn,_=>r(13,f=_)),X(t,Je,_=>r(2,g=_)),X(t,Be,_=>r(14,d=_));function k(_){_.shiftKey?We.set([]):(r(0,m=[a.pop(),...m]),We.update(I=>I))}function p(){const _=m.shift();_&&We.update(I=>(I.push(_),I))}let m=[];async function A(){try{const _=d;if(!_)return;Fe(_t,n="uploading",n);for(const[T,{actions:P,phrase:R,deleted:D}]of f.chords)if(D)await _.deleteChord({actions:P});else{if(T!==JSON.stringify(P)){if(await _.getChordPhrase(P)!==void 0&&!await ca(g.configure.chords.conflict.TITLE(),g.configure.chords.conflict.DESCRIPTION(),g.configure.chords.conflict.CONFIRM(),g.configure.chords.conflict.ABORT(),P.slice(0,P.lastIndexOf(0)))){We.update(O=>O.filter(Y=>!(Y.type===St.Chord&&JSON.stringify(Y.id)===T)));continue}await _.deleteChord({actions:JSON.parse(T)})}await _.setChord({actions:P,phrase:R})}for(const[T,P]of f.layout.entries())for(const[R,D]of P)await _.setLayoutKey(T+1,R,D);for(const[T,P]of f.settings)await _.setSetting(T,P);const I=1e3,b=performance.now();await new Promise(T=>{function P(){const R=performance.now()-b;Lr.set({max:I,current:R}),R>=I?T():requestAnimationFrame(P)}requestAnimationFrame(P)}),await _.commit(),Fe(nr,c=u.map(T=>T.map(({action:P})=>P)),c),Fe(rr,l=i.filter(({deleted:T})=>!T).map(({actions:T,phrase:P})=>({actions:T,phrase:P})),l),Fe(tr,s=o.map(({value:T})=>T),s),Fe(We,a=[],a)}catch(_){alert(_),console.error(_)}finally{Fe(_t,n="done",n)}}return[m,a,g,k,p,A]}class ha extends Ne{constructor(e){super(),Se(this,e,fa,ua,Re,{})}}var da={VITE_HOMEPAGE_URL:"https://github.com/CharaChorder/DeviceManager",VITE_DOCS_URL:"https://docs.charachorder.com",VITE_BUGS_URL:"https://github.com/CharaChorder/DeviceManager/issues",VITE_LEARN_URL:"https://www.iq-eq.io/",VITE_LATEST_FIRMWARE:"1.1.4",VITE_STORE_URL:"https://www.charachorder.com/",BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function pa(t){t[8]=t[9].default}function Er(t){let e,r="share",n,a,o,s,i="print",l,u,c,f,g,d,k,p;return{c(){e=L("button"),e.textContent=r,o=S(),s=L("button"),s.textContent=i,c=S(),f=L("div"),this.h()},l(m){e=w(m,"BUTTON",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-1nq5gu0"&&(e.textContent=r),o=F(m),s=w(m,"BUTTON",{class:!0,"data-svelte-h":!0}),x(s)!=="svelte-1qgv405"&&(s.textContent=i),c=F(m),f=w(m,"DIV",{class:!0}),M(f).forEach(E),this.h()},h(){C(e,"class","icon svelte-f5owx0"),C(s,"class","icon svelte-f5owx0"),C(f,"class","separator svelte-f5owx0")},m(m,A){B(m,e,A),B(m,o,A),B(m,s,A),B(m,c,A),B(m,f,A),d=!0,k||(p=[ke(n=Ue.call(null,e,{title:t[3].share.TITLE()})),J(e,"click",sn),ke(l=Ue.call(null,s,{title:t[3].print.TITLE()})),J(s,"click",t[6])],k=!0)},p(m,A){n&&Oe(n.update)&&A&8&&n.update.call(null,{title:m[3].share.TITLE()}),l&&Oe(l.update)&&A&8&&l.update.call(null,{title:m[3].print.TITLE()})},i(m){d||(m&&Pe(()=>{d&&(a||(a=ue(e,tt,{x:-8},!0)),a.run(1))}),m&&Pe(()=>{d&&(u||(u=ue(s,tt,{x:-8},!0)),u.run(1))}),m&&Pe(()=>{d&&(g||(g=ue(f,Me,{},!0)),g.run(1))}),d=!0)},o(m){m&&(a||(a=ue(e,tt,{x:-8},!1)),a.run(0)),m&&(u||(u=ue(s,tt,{x:-8},!1)),u.run(0)),m&&(g||(g=ue(f,Me,{},!1)),g.run(0)),d=!1},d(m){m&&(E(e),E(o),E(s),E(c),E(f)),m&&a&&a.end(),m&&u&&u.end(),m&&g&&g.end(),k=!1,Ve(p)}}}function ma(t){let e,r,n={ctx:t,current:null,token:null,hasCatch:!1,pending:ba,then:ga,catch:_a,value:9,blocks:[,,,]};return Yr(Lt(()=>import("../chunks/PwaStatus.DCC9dwtH.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),n),{c(){e=Ce(),n.block.c()},l(a){e=Ce(),n.block.l(a)},m(a,o){B(a,e,o),n.block.m(a,n.anchor=o),n.mount=()=>e.parentNode,n.anchor=e,r=!0},p(a,o){t=a},i(a){r||(j(n.block),r=!0)},o(a){for(let o=0;o<3;o+=1){const s=n.blocks[o];K(s)}r=!1},d(a){a&&E(e),n.block.d(a),n.token=null,n=null}}}function _a(t){return{c:ge,l:ge,m:ge,i:ge,o:ge,d:ge}}function ga(t){pa(t);let e,r;return e=new t[8]({}),{c(){Ge(e.$$.fragment)},l(n){He(e.$$.fragment,n)},m(n,a){$e(e,n,a),r=!0},i(n){r||(j(e.$$.fragment,n),r=!0)},o(n){K(e.$$.fragment,n),r=!1},d(n){Ye(e,n)}}}function ba(t){return{c:ge,l:ge,m:ge,i:ge,o:ge,d:ge}}function ka(t){let e;return{c(){e=W("history_toggle_off")},l(r){e=z(r,"history_toggle_off")},m(r,n){B(r,e,n)},d(r){r&&E(e)}}}function Ta(t){let e;return{c(){e=W("history")},l(r){e=z(r,"history")},m(r,n){B(r,e,n)},d(r){r&&E(e)}}}function Ea(t){let e,r,n,a,o,s,i,l,u,c,f,g,d,k,p="cable",m,A,_,I;n=new ha({}),o=new ta({});let b=t[2]&&Er(t),T=da.TAURI_FAMILY===void 0&&ma(t);function P(y,O){return y[1].backup?Ta:ka}let R=P(t),D=R(t);return{c(){e=L("nav"),r=L("div"),Ge(n.$$.fragment),a=S(),Ge(o.$$.fragment),s=S(),i=L("div"),b&&b.c(),l=S(),T&&T.c(),u=S(),c=L("button"),D.c(),d=S(),k=L("button"),k.textContent=p,this.h()},l(y){e=w(y,"NAV",{class:!0});var O=M(e);r=w(O,"DIV",{class:!0});var Y=M(r);He(n.$$.fragment,Y),Y.forEach(E),a=F(O),He(o.$$.fragment,O),s=F(O),i=w(O,"DIV",{class:!0});var U=M(i);b&&b.l(U),l=F(U),T&&T.l(U),u=F(U),c=w(U,"BUTTON",{class:!0});var H=M(c);D.l(H),H.forEach(E),d=F(U),k=w(U,"BUTTON",{class:!0,"data-svelte-h":!0}),x(k)!=="svelte-1rfuuvo"&&(k.textContent=p),U.forEach(E),O.forEach(E),this.h()},h(){C(r,"class","actions svelte-f5owx0"),C(c,"class",f="icon "+t[4]+" svelte-f5owx0"),C(k,"class","icon connect svelte-f5owx0"),ft(k,"error",t[5]===void 0),C(i,"class","actions svelte-f5owx0"),C(e,"class","svelte-f5owx0")},m(y,O){B(y,e,O),h(e,r),$e(n,r,null),h(e,a),$e(o,e,null),h(e,s),h(e,i),b&&b.m(i,null),h(i,l),T&&T.m(i,null),h(i,u),h(i,c),D.m(c,null),h(i,d),h(i,k),t[7](k),A=!0,_||(I=[ke(g=Ue.call(null,c,{title:t[3].backup.TITLE()})),ke(or.call(null,c,qn)),ke(m=Ue.call(null,k,{title:t[3].deviceManager.TITLE()})),ke(or.call(null,k,Qn))],_=!0)},p(y,[O]){y[2]?b?(b.p(y,O),O&4&&j(b,1)):(b=Er(y),b.c(),j(b,1),b.m(i,l)):b&&(it(),K(b,1,1,()=>{b=null}),lt()),R!==(R=P(y))&&(D.d(1),D=R(y),D&&(D.c(),D.m(c,null))),(!A||O&16&&f!==(f="icon "+y[4]+" svelte-f5owx0"))&&C(c,"class",f),g&&Oe(g.update)&&O&8&&g.update.call(null,{title:y[3].backup.TITLE()}),m&&Oe(m.update)&&O&8&&m.update.call(null,{title:y[3].deviceManager.TITLE()}),(!A||O&32)&&ft(k,"error",y[5]===void 0)},i(y){A||(j(n.$$.fragment,y),j(o.$$.fragment,y),j(b),j(T),A=!0)},o(y){K(n.$$.fragment,y),K(o.$$.fragment,y),K(b),K(T),A=!1},d(y){y&&E(e),Ye(n),Ye(o),b&&b.d(),T&&T.d(),D.d(),t[7](null),_=!1,Ve(I)}}}function va(t,e,r){let n,a,o,s,i;X(t,wr,f=>r(1,n=f)),X(t,on,f=>r(2,a=f)),X(t,Je,f=>r(3,o=f)),X(t,_t,f=>r(4,s=f)),X(t,Be,f=>r(5,i=f)),$t(async()=>{n.autoConnect||l.click()});let l;const u=()=>print();function c(f){Yt[f?"unshift":"push"](()=>{l=f,r(0,l)})}return[l,n,a,o,s,i,u,c]}class Ia extends Ne{constructor(e){super(),Se(this,e,va,Ea,Re,{})}}function ya(t){let e,r,n=t[0].browserWarning.TITLE()+"",a,o,s,i=t[0].browserWarning.INFO_SERIAL_PREFIX()+"",l,u,c=t[0].browserWarning.INFO_SERIAL_INFIX()+"",f,g=t[0].browserWarning.INFO_SERIAL_SUFFIX()+"",d,k,p=t[0].browserWarning.INFO_BROWSER_PREFIX()+"",m,A,_,I=t[0].browserWarning.INFO_BROWSER_INFIX()+"",b,T=t[0].browserWarning.INFO_BROWSER_SUFFIX()+"",P,R,D,y,O=t[0].browserWarning.DOWNLOAD_APP()+"",Y;return{c(){e=L("dialog"),r=L("h1"),a=W(n),o=S(),s=L("p"),l=W(i),u=L("a"),f=W(c),d=W(g),k=S(),m=W(p),A=S(),_=L("a"),b=W(I),P=W(T),R=S(),D=L("div"),y=L("p"),Y=W(O),this.h()},l(U){e=w(U,"DIALOG",{class:!0});var H=M(e);r=w(H,"H1",{class:!0});var ne=M(r);a=z(ne,n),ne.forEach(E),o=F(H),s=w(H,"P",{class:!0});var Q=M(s);l=z(Q,i),u=w(Q,"A",{class:!0,target:!0,href:!0});var ie=M(u);f=z(ie,c),ie.forEach(E),d=z(Q,g),k=F(Q),m=z(Q,p),A=F(Q),_=w(Q,"A",{href:!0,target:!0,class:!0});var ee=M(_);b=z(ee,I),ee.forEach(E),P=z(Q,T),Q.forEach(E),R=F(H),D=w(H,"DIV",{class:!0});var le=M(D);y=w(le,"P",{class:!0});var Te=M(y);Y=z(Te,O),Te.forEach(E),le.forEach(E),H.forEach(E),this.h()},h(){C(r,"class","svelte-12tn439"),C(u,"class","normal svelte-12tn439"),C(u,"target","_blank"),C(u,"href","https://developer.mozilla.org/en-US/docs/Web/API/Web_Serial_API#browser_compatibility"),C(_,"href","https://github.com/brave/brave-browser/issues/13902"),C(_,"target","_blank"),C(_,"class","svelte-12tn439"),C(s,"class","svelte-12tn439"),C(y,"class","svelte-12tn439"),C(D,"class","svelte-12tn439"),e.open=!0,C(e,"class","svelte-12tn439")},m(U,H){B(U,e,H),h(e,r),h(r,a),h(e,o),h(e,s),h(s,l),h(s,u),h(u,f),h(s,d),h(s,k),h(s,m),h(s,A),h(s,_),h(_,b),h(s,P),h(e,R),h(e,D),h(D,y),h(y,Y)},p(U,[H]){H&1&&n!==(n=U[0].browserWarning.TITLE()+"")&&q(a,n),H&1&&i!==(i=U[0].browserWarning.INFO_SERIAL_PREFIX()+"")&&q(l,i),H&1&&c!==(c=U[0].browserWarning.INFO_SERIAL_INFIX()+"")&&q(f,c),H&1&&g!==(g=U[0].browserWarning.INFO_SERIAL_SUFFIX()+"")&&q(d,g),H&1&&p!==(p=U[0].browserWarning.INFO_BROWSER_PREFIX()+"")&&q(m,p),H&1&&I!==(I=U[0].browserWarning.INFO_BROWSER_INFIX()+"")&&q(b,I),H&1&&T!==(T=U[0].browserWarning.INFO_BROWSER_SUFFIX()+"")&&q(P,T),H&1&&O!==(O=U[0].browserWarning.DOWNLOAD_APP()+"")&&q(Y,O)},i:ge,o:ge,d(U){U&&E(e)}}}function Ca(t,e,r){let n;return X(t,Je,a=>r(0,n=a)),[n]}class La extends Ne{constructor(e){super(),Se(this,e,Ca,ya,Re,{})}}const Wr=t=>({}),zr={TITLE:"CharaChorder Gerätemanager",DESCRIPTION:"Gerätemanager und Konfigurationstool für CharaChorder Geräte.",saveActions:{UNDO:"Rückgängig (<kbd class='icon'>shift</kbd> halten um alle Änderungen rückgängig zu machen)",REDO:"Wiederholen",SAVE:"Speichern"},update:{TITLE:"Gerät aktualisieren"},sync:{TITLE_READ:"Neueste Änderungen werden abgerufen",TITLE_WRITE:"Änderungen werden gespeichert",RELOAD:"Neu laden"},backup:{TITLE:"Lokale Kopie",INDIVIDUAL:"Einzeldateien",DISCLAIMER:"Das Backup in diesem Browser gespeichert und bleibt nur auf diesem Computer.",DOWNLOAD:"Alles herunterladen",RESTORE:"Wiederherstellen"},modal:{CLOSE:"Schließen"},actionSearch:{PLACEHOLDER:"Nach Aktionen suchen",CURRENT_ACTION:"Aktuelle Aktion",NEXT_ACTION:"Aktion nach dem nächsten Speichern",DELETE:"Entfernen",filter:{ALL:"Alle"},LIVE_LAYOUT_INFO:"Diese Aktion wurde auf Basis des Systemtastaturlayouts ermittelt.",SHIFT_WARNING:"Diese Aktion hält <kbd class='icon'>shift</kbd>",ALT_CODE_WARNING:"Dieses Alt-Code Makro funktioniert nur unter Windows"},share:{TITLE:"Teilen",URL_COPIED:"Teilbare URL kopiert!",EXTRA_DOWNLOAD:"Als Datei herunterladen"},print:{TITLE:"Drucken"},profile:{TITLE:"Profil",LANGUAGE:"Sprache",theme:{TITLE:"Darstellung",COLOR_SCHEME:"Farbschema",DARK_MODE:"Dunkel",LIGHT_MODE:"Hell"}},deviceManager:{TITLE:"Gerät",AUTO_CONNECT:"Automatisch Verbinden",CONNECT:"Verbinden",DISCONNECT:"Entfernen",TERMINAL:"Konsole",APPLY_SETTINGS:"Änderungen auf das Gerät brennen",NO_DEVICE:"Kein Gerät verbunden",LINUX_PERMISSIONS:"Auf den meisten Linux-basierten Systemen müssen zuerst Berechtigungen angepasst werden. Flatpak und Snap Anwendungen benötigen zusätzliche Berechtigungen oder funktionieren möglicherweise gar nicht.",bootMenu:{TITLE:"Bootmenü",REBOOT:"Neustarten",BOOTLOADER:"Bootloader",POWER_WARNING:"Um vom Bootloader aus neu zu starten muss das Gerät neu verbunden werden."}},browserWarning:{TITLE:"Warnung",INFO_SERIAL_PREFIX:"Der aktuell genutzte Browser wird aufgrund der speziellen Voraussetzung für Kommunikation über die ",INFO_SERIAL_INFIX:"serielle Schnittstelle",INFO_SERIAL_SUFFIX:" nicht unterstützt.",INFO_BROWSER_PREFIX:"Auch wenn alle Chromium-basieren Desktop Browser diese Voraussetzung grundsätzlich erfüllen, haben einige Browser ",INFO_BROWSER_INFIX:"wie zum Beispiel Brave",INFO_BROWSER_SUFFIX:" sich bewusst dazu entschieden die API zu deaktivieren.",DOWNLOAD_APP:"Chrome oder Edge werden offiziell unterstützt, andere Browser könnten aber auch funktionieren."},changes:{TITLE:"Änderungen importieren",ALL_CHANGES:"Alle Änderungen",layout:{TITLE:"{0} veränderte Belegung{{:|en}}",LAYER:"{changes} Belegung{{changes:|en}} in Ebene {layer} ändern"},settings:{TITLE:"{0} Einstellung{{|en}} anpassen"},chords:{TITLE:"{0} Akkorde",NEW_CHORDS:"{0} neue Akkord{{|e}} hinzufügen",CHANGED_CHORDS:"{0} Akkord{{|e}} ersetzen",DELETED_CHORDS:"{0} Akkord{{|e}} zum löschen markieren"}},configure:{chords:{TITLE:"Akkorde",HOLD_KEYS:"Akkord halten",NEW_CHORD:"Neuer Akkord",DUPLICATE:"Akkord existiert bereits",search:{PLACEHOLDER:"{0} Akkord{{|e}} durchsuchen",NO_RESULTS:"Keine Ergebnisse"},conflict:{TITLE:"Akkordkonflikt",DESCRIPTION:"Der Akkord würde einen bereits existierenden Akkord überschreiben. Wirklich fortfahren?",CONFIRM:"Überschreiben",ABORT:"Überspringen"},VOCABULARY:"Vokabelliste",TRY_TYPING:"Versuche hier zu tippen"},layout:{TITLE:"Layout"},settings:{TITLE:"Einstellungen"}},plugin:{editor:{RUN:"Ausführen"}}},wa=Object.freeze(Object.defineProperty({__proto__:null,default:zr},Symbol.toStringTag,{value:"Module"})),Gr={TITLE:"CharaChorder Device Manager",DESCRIPTION:"The device manager and configuration tool for CharaChorder devices.",saveActions:{UNDO:"Undo (hold <kbd class='icon'>shift</kbd> to undo all changes)",REDO:"Redo",SAVE:"Save"},update:{TITLE:"Update your device"},backup:{TITLE:"Local backup",INDIVIDUAL:"Individual backups",DISCLAIMER:"A backup is made and stored in this browser, and always remains only on your computer.",DOWNLOAD:"Download Everything",RESTORE:"Restore"},sync:{TITLE_READ:"Reading latest changes",TITLE_WRITE:"Saving changes to device",RELOAD:"Reload"},modal:{CLOSE:"Close"},actionSearch:{PLACEHOLDER:"Search for actions",CURRENT_ACTION:"Current action",NEXT_ACTION:"Action after next save",DELETE:"Remove",filter:{ALL:"All"},LIVE_LAYOUT_INFO:"This output was determined using on your system layout.",SHIFT_WARNING:"This action holds <kbd class='icon'>shift</kbd>",ALT_CODE_WARNING:"This alt-code macro only works on Windows"},share:{TITLE:"Share",URL_COPIED:"Sharable URL copied!",EXTRA_DOWNLOAD:"Download as file"},print:{TITLE:"Print"},profile:{TITLE:"Profile",LANGUAGE:"Language",theme:{TITLE:"Theme",COLOR_SCHEME:"Color scheme",DARK_MODE:"Dark",LIGHT_MODE:"Light"}},deviceManager:{TITLE:"Device",AUTO_CONNECT:"Auto-connect",CONNECT:"Connect",DISCONNECT:"Disconnect",TERMINAL:"Terminal",APPLY_SETTINGS:"Flash changes to device",NO_DEVICE:"No device connected",LINUX_PERMISSIONS:"Most Linux based systems need adjusted permissions in order to connect your device. Flatpak or Snap versions in particular might need additional permissions or may not work at all.",bootMenu:{TITLE:"Boot Menu",REBOOT:"Reboot",BOOTLOADER:"Bootloader",POWER_WARNING:"To reboot from bootloader you need to physically reconnect your device."}},browserWarning:{TITLE:"Warning",INFO_SERIAL_PREFIX:"Your current browser is not supported due to this site's unique requirement for ",INFO_SERIAL_INFIX:"serial connections",INFO_SERIAL_SUFFIX:".",INFO_BROWSER_PREFIX:"Though all chromium-based desktop browsers fulfill this requirement, some derivations such as Brave ",INFO_BROWSER_INFIX:"have been known to disable the API intentionally",INFO_BROWSER_SUFFIX:".",DOWNLOAD_APP:"Chrome or Edge are officially supported, but other browsers might work as well."},changes:{TITLE:"Import changes",ALL_CHANGES:"All changes",layout:{TITLE:"{0} layout change{{|s}}",LAYER:"Update {changes} key{{changes:|s}} in layer {layer}"},settings:{TITLE:"Update {0} setting{{|s}}"},chords:{TITLE:"{0} chords",NEW_CHORDS:"Add {0} new chord{{|s}}",CHANGED_CHORDS:"Replace {0} chord{{|s}}",DELETED_CHORDS:"Mark {0} chord{{|s}} for deletion"}},configure:{chords:{TITLE:"Chords",HOLD_KEYS:"Hold chord",NEW_CHORD:"New chord",DUPLICATE:"Chord already exists",search:{PLACEHOLDER:"Search {0} chord{{|s}}",NO_RESULTS:"No results"},conflict:{TITLE:"Chord conflict",DESCRIPTION:"Your chord conflicts with an existing chord. Are you sure you want to overwrite this chord?",CONFIRM:"Overwrite",ABORT:"Skip"},VOCABULARY:"Vocabulary",TRY_TYPING:"Try typing here"},layout:{TITLE:"Layout"},settings:{TITLE:"Settings"}},plugin:{editor:{RUN:"Run"}}},Aa=Object.freeze(Object.defineProperty({__proto__:null,default:Gr},Symbol.toStringTag,{value:"Module"})),Da={de:zr,en:Gr},Pa=t=>{wt[t]||(wt[t]=Da[t],Oa(t))},Oa=t=>void(Ar[t]=Wr()),Ma={de:()=>Lt(()=>Promise.resolve().then(()=>wa),void 0,import.meta.url),en:()=>Lt(()=>Promise.resolve().then(()=>Aa),void 0,import.meta.url)},Ra=(t,e)=>wt[t]={...wt[t],...e},Na=async t=>(await Ma[t]()).default,Sa=async t=>{Ra(t,await Na(t)),Fa(t)},Fa=t=>void(Ar[t]=Wr());function Ba(t){let e,r,n="refresh",a=t[2].sync.RELOAD()+"",o,s,i,l,u;return{c(){e=L("button"),r=L("span"),r.textContent=n,o=W(a),this.h()},l(c){e=w(c,"BUTTON",{});var f=M(e);r=w(f,"SPAN",{class:!0,"data-svelte-h":!0}),x(r)!=="svelte-av4h6d"&&(r.textContent=n),o=z(f,a),f.forEach(E),this.h()},h(){C(r,"class","icon")},m(c,f){B(c,e,f),h(e,r),h(e,o),i=!0,l||(u=J(e,"click",tn),l=!0)},p(c,f){(!i||f&4)&&a!==(a=c[2].sync.RELOAD()+"")&&q(o,a)},i(c){i||(c&&Pe(()=>{i&&(s||(s=ue(e,Me,{},!0)),s.run(1))}),i=!0)},o(c){c&&(s||(s=ue(e,Me,{},!1)),s.run(0)),i=!1},d(c){c&&E(e),c&&s&&s.end(),l=!1,u()}}}function Ua(t){let e,r,n,a,o,s,i;function l(f,g){return f[0]==="downloading"?Wa:Va}let u=l(t),c=u(t);return{c(){e=L("div"),r=L("progress"),o=S(),c.c(),this.h()},l(f){e=w(f,"DIV",{class:!0});var g=M(e);r=w(g,"PROGRESS",{max:!0,class:!0}),M(r).forEach(E),o=F(g),c.l(g),g.forEach(E),this.h()},h(){C(r,"max",n=t[1]?.max??1),r.value=a=t[1]?.current??1,C(r,"class","svelte-13x5g69"),C(e,"class","svelte-13x5g69")},m(f,g){B(f,e,g),h(e,r),h(e,o),c.m(e,null),i=!0},p(f,g){(!i||g&2&&n!==(n=f[1]?.max??1))&&C(r,"max",n),(!i||g&2&&a!==(a=f[1]?.current??1))&&(r.value=a),u===(u=l(f))&&c?c.p(f,g):(c.d(1),c=u(f),c&&(c.c(),c.m(e,null)))},i(f){i||(f&&Pe(()=>{i&&(s||(s=ue(e,Me,{},!0)),s.run(1))}),i=!0)},o(f){f&&(s||(s=ue(e,Me,{},!1)),s.run(0)),i=!1},d(f){f&&E(e),c.d(),f&&s&&s.end()}}}function Va(t){let e,r=t[2].sync.TITLE_WRITE()+"",n;return{c(){e=L("div"),n=W(r),this.h()},l(a){e=w(a,"DIV",{class:!0});var o=M(e);n=z(o,r),o.forEach(E),this.h()},h(){C(e,"class","svelte-13x5g69")},m(a,o){B(a,e,o),h(e,n)},p(a,o){o&4&&r!==(r=a[2].sync.TITLE_WRITE()+"")&&q(n,r)},d(a){a&&E(e)}}}function Wa(t){let e,r=t[2].sync.TITLE_READ()+"",n;return{c(){e=L("div"),n=W(r),this.h()},l(a){e=w(a,"DIV",{class:!0});var o=M(e);n=z(o,r),o.forEach(E),this.h()},h(){C(e,"class","svelte-13x5g69")},m(a,o){B(a,e,o),h(e,n)},p(a,o){o&4&&r!==(r=a[2].sync.TITLE_READ()+"")&&q(n,r)},d(a){a&&E(e)}}}function za(t){let e,r,n;const a=[Ua,Ba],o=[];function s(i,l){return i[0]!=="done"?0:i[3]?1:-1}return~(r=s(t))&&(n=o[r]=a[r](t)),{c(){e=L("div"),n&&n.c(),this.h()},l(i){e=w(i,"DIV",{class:!0});var l=M(e);n&&n.l(l),l.forEach(E),this.h()},h(){C(e,"class","container svelte-13x5g69")},m(i,l){B(i,e,l),~r&&o[r].m(e,null)},p(i,[l]){let u=r;r=s(i),r===u?~r&&o[r].p(i,l):(n&&(it(),K(o[u],1,1,()=>{o[u]=null}),lt()),~r?(n=o[r],n?n.p(i,l):(n=o[r]=a[r](i),n.c()),j(n,1),n.m(e,null)):n=null)},i(i){j(n)},o(i){K(n)},d(i){i&&E(e),~r&&o[r].d()}}}function Ga(t,e,r){let n,a,o,s;return X(t,_t,i=>r(0,n=i)),X(t,Lr,i=>r(1,a=i)),X(t,Je,i=>r(2,o=i)),X(t,Be,i=>r(3,s=i)),[n,a,o,s]}class Ha extends Ne{constructor(e){super(),Se(this,e,Ga,za,Re,{})}}function $a(t,e,r){const n=t.slice();return n[10]=e[r],n}function vr(t){let e,r,n="warning",a=t[4].deviceManager.NO_DEVICE()+"",o;return{c(){e=L("div"),r=L("span"),r.textContent=n,o=W(a),this.h()},l(s){e=w(s,"DIV",{class:!0});var i=M(e);r=w(i,"SPAN",{class:!0,"data-svelte-h":!0}),x(r)!=="svelte-1psh2ju"&&(r.textContent=n),o=z(i,a),i.forEach(E),this.h()},h(){C(r,"class","icon svelte-1sboptw"),C(e,"class","warning svelte-1sboptw")},m(s,i){B(s,e,i),h(e,r),h(e,o)},p(s,i){i&16&&a!==(a=s[4].deviceManager.NO_DEVICE()+"")&&q(o,a)},d(s){s&&E(e)}}}function Ya(t){let e,r="light_mode",n,a,o;return{c(){e=L("button"),e.textContent=r,this.h()},l(s){e=w(s,"BUTTON",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-17ot18a"&&(e.textContent=r),this.h()},h(){C(e,"class","icon svelte-1sboptw")},m(s,i){B(s,e,i),a||(o=[ke(n=Ue.call(null,e,{title:t[4].profile.theme.LIGHT_MODE()})),J(e,"click",t[5])],a=!0)},p(s,i){n&&Oe(n.update)&&i&16&&n.update.call(null,{title:s[4].profile.theme.LIGHT_MODE()})},d(s){s&&E(e),a=!1,Ve(o)}}}function qa(t){let e,r="dark_mode",n,a,o;return{c(){e=L("button"),e.textContent=r,this.h()},l(s){e=w(s,"BUTTON",{class:!0,"data-svelte-h":!0}),x(e)!=="svelte-cv8wki"&&(e.textContent=r),this.h()},h(){C(e,"class","icon svelte-1sboptw")},m(s,i){B(s,e,i),a||(o=[ke(n=Ue.call(null,e,{title:t[4].profile.theme.DARK_MODE()})),J(e,"click",t[5])],a=!0)},p(s,i){n&&Oe(n.update)&&i&16&&n.update.call(null,{title:s[4].profile.theme.DARK_MODE()})},d(s){s&&E(e),a=!1,Ve(o)}}}function ja(t){let e,r;return{c(){e=L("option"),r=W(t[10]),this.h()},l(n){e=w(n,"OPTION",{});var a=M(e);r=z(a,t[10]),a.forEach(E),this.h()},h(){e.__value=t[10],Ut(e,e.__value)},m(n,a){B(n,e,a),h(e,r)},p:ge,d(n){n&&E(e)}}}function Xa(t){let e,r,n,a,o,s="commit",i,l,u,c,f='<a href="https://github.com/CharaChorder/DeviceManager/issues" rel="noreferrer" target="_blank" class="svelte-1sboptw"><span class="icon svelte-1sboptw">bug_report</span> Issues</a>',g,d,k='<a href="https://docs.charachorder.com" rel="noreferrer" target="_blank" class="svelte-1sboptw"><span class="icon svelte-1sboptw">description</span> Docs</a>',p,m,A,_,I,b,T,P='<a href="https://www.charachorder.com/" rel="noreferrer" target="_blank" class="svelte-1sboptw"><span class="icon svelte-1sboptw">shopping_bag</span> Store</a>',R,D,y='<a href="https://www.iq-eq.io/" rel="noreferrer" target="_blank" class="svelte-1sboptw"><span class="icon svelte-1sboptw">school</span> Train</a>',O,Y,U,H,ne,Q,ie,ee,le,Te,se,we,De,pe,Ee,Z=!t[3]&&vr(t);_=new Ha({});function nt($,re){if($[2].mode==="light")return qa;if($[2].mode==="dark")return Ya}let ve=nt(t),te=ve&&ve(t),Ze=Wt(ln),ce=[];for(let $=0;$<Ze.length;$+=1)ce[$]=ja($a(t,Ze,$));return{c(){e=L("footer"),r=L("ul"),n=L("li"),a=L("a"),o=L("span"),o.textContent=s,i=W(" v"),l=W(ir),u=S(),c=L("li"),c.innerHTML=f,g=S(),d=L("li"),d.innerHTML=k,p=S(),m=L("div"),Z&&Z.c(),A=S(),Ge(_.$$.fragment),I=S(),b=L("ul"),T=L("li"),T.innerHTML=P,R=S(),D=L("li"),D.innerHTML=y,O=S(),Y=L("li"),U=L("input"),ne=S(),Q=L("li"),te&&te.c(),ie=S(),ee=L("li"),le=L("button"),Te=W(`translate
`),se=L("select");for(let $=0;$<ce.length;$+=1)ce[$].c();this.h()},l($){e=w($,"FOOTER",{class:!0});var re=M(e);r=w(re,"UL",{class:!0});var Ie=M(r);n=w(Ie,"LI",{});var Qe=M(n);a=w(Qe,"A",{href:!0,rel:!0,target:!0,class:!0});var qe=M(a);o=w(qe,"SPAN",{class:!0,"data-svelte-h":!0}),x(o)!=="svelte-12xlk8t"&&(o.textContent=s),i=z(qe," v"),l=z(qe,ir),qe.forEach(E),Qe.forEach(E),u=F(Ie),c=w(Ie,"LI",{"data-svelte-h":!0}),x(c)!=="svelte-15tp0o3"&&(c.innerHTML=f),g=F(Ie),d=w(Ie,"LI",{"data-svelte-h":!0}),x(d)!=="svelte-h8ml9l"&&(d.innerHTML=k),Ie.forEach(E),p=F(re),m=w(re,"DIV",{});var xe=M(m);Z&&Z.l(xe),A=F(xe),He(_.$$.fragment,xe),xe.forEach(E),I=F(re),b=w(re,"UL",{class:!0});var Ae=M(b);T=w(Ae,"LI",{"data-svelte-h":!0}),x(T)!=="svelte-f5v87i"&&(T.innerHTML=P),R=F(Ae),D=w(Ae,"LI",{"data-svelte-h":!0}),x(D)!=="svelte-1y78xq5"&&(D.innerHTML=y),O=F(Ae),Y=w(Ae,"LI",{class:!0});var me=M(Y);U=w(me,"INPUT",{type:!0,class:!0}),me.forEach(E),ne=F(Ae),Q=w(Ae,"LI",{class:!0});var oe=M(Q);te&&te.l(oe),oe.forEach(E),ie=F(Ae),ee=w(Ae,"LI",{});var dt=M(ee);le=w(dt,"BUTTON",{class:!0});var at=M(le);Te=z(at,`translate
`),se=w(at,"SELECT",{class:!0});var pt=M(se);for(let ct=0;ct<ce.length;ct+=1)ce[ct].l(pt);pt.forEach(E),at.forEach(E),dt.forEach(E),Ae.forEach(E),re.forEach(E),this.h()},h(){C(o,"class","icon svelte-1sboptw"),C(a,"href","https://github.com/CharaChorder/DeviceManager"),C(a,"rel","noreferrer"),C(a,"target","_blank"),C(a,"class","svelte-1sboptw"),C(r,"class","svelte-1sboptw"),C(U,"type","color"),C(U,"class","svelte-1sboptw"),C(Y,"class","hide-forced-colors svelte-1sboptw"),C(Q,"class","hide-forced-colors svelte-1sboptw"),C(se,"class","svelte-1sboptw"),t[0]===void 0&&Pe(()=>t[7].call(se)),C(le,"class","icon svelte-1sboptw"),C(b,"class","svelte-1sboptw"),C(e,"class","svelte-1sboptw")},m($,re){B($,e,re),h(e,r),h(r,n),h(n,a),h(a,o),h(a,i),h(a,l),h(r,u),h(r,c),h(r,g),h(r,d),h(e,p),h(e,m),Z&&Z.m(m,null),h(m,A),$e(_,m,null),h(e,I),h(e,b),h(b,T),h(b,R),h(b,D),h(b,O),h(b,Y),h(Y,U),Ut(U,t[2].color),h(b,ne),h(b,Q),te&&te.m(Q,null),h(b,ie),h(b,ee),h(ee,le),h(le,Te),h(le,se);for(let Ie=0;Ie<ce.length;Ie+=1)ce[Ie]&&ce[Ie].m(se,null);er(se,t[0],!0),t[8](se),De=!0,pe||(Ee=[ke(H=Ue.call(null,U,{title:t[4].profile.theme.COLOR_SCHEME()})),J(U,"input",t[6]),J(se,"change",t[7]),ke(we=Ue.call(null,le,{title:t[4].profile.LANGUAGE()})),J(le,"click",t[9])],pe=!0)},p($,[re]){$[3]?Z&&(Z.d(1),Z=null):Z?Z.p($,re):(Z=vr($),Z.c(),Z.m(m,A)),H&&Oe(H.update)&&re&16&&H.update.call(null,{title:$[4].profile.theme.COLOR_SCHEME()}),re&4&&Ut(U,$[2].color),ve===(ve=nt($))&&te?te.p($,re):(te&&te.d(1),te=ve&&ve($),te&&(te.c(),te.m(Q,null))),re&1&&er(se,$[0]),we&&Oe(we.update)&&re&16&&we.update.call(null,{title:$[4].profile.LANGUAGE()})},i($){De||(j(_.$$.fragment,$),De=!0)},o($){K(_.$$.fragment,$),De=!1},d($){$&&E(e),Z&&Z.d(),Ye(_),te&&te.d(),yr(ce,$),t[8](null),pe=!1,Ve(Ee)}}}function Ka(t,e,r){let n,a,o;X(t,mt,d=>r(2,n=d)),X(t,Be,d=>r(3,a=d)),X(t,Je,d=>r(4,o=d));let s=localStorage.getItem("locale")||Dr();function i(){const d=n.mode==="light"?"dark":"light";document.startViewTransition?document.startViewTransition(async()=>{Fe(mt,n.mode=d,n),await Kr()}):Fe(mt,n.mode=d,n)}let l;function u(){n.color=this.value,mt.set(n)}function c(){s=Jr(this),r(0,s)}function f(d){Yt[d?"unshift":"push"](()=>{l=d,r(1,l)})}const g=()=>l.click();return t.$$.update=()=>{t.$$.dirty&1&&(async()=>(localStorage.setItem("locale",s),await Sa(s),Pr(s)))()},[s,l,n,a,o,i,u,c,f,g]}class Ja extends Ne{constructor(e){super(),Se(this,e,Ka,Xa,Re,{})}}function Ir(t){let e,r,n,a,o,s;const i=t[5].default,l=Ot(i,t,t[4],null);return{c(){e=L("main"),l&&l.c()},l(u){e=w(u,"MAIN",{});var c=M(e);l&&l.l(c),c.forEach(E)},m(u,c){B(u,e,c),l&&l.m(e,null),a=!0,o||(s=J(e,"outroend",function(){Oe(t[2])&&t[2].apply(this,arguments)}),o=!0)},p(u,c){t=u,l&&l.p&&(!a||c&16)&&Mt(l,i,t,t[4],a?Nt(i,t[4],c,null):Rt(t[4]),null)},i(u){a||(j(l,u),u&&Pe(()=>{a&&(n&&n.end(1),r=xr(e,tt,{x:t[0]*24,duration:150,easing:nn}),r.start())}),a=!0)},o(u){K(l,u),r&&r.invalidate(),u&&(n=en(e,tt,{x:t[1]*24,duration:150,easing:an})),a=!1},d(u){u&&E(e),l&&l.d(u),u&&n&&n.end(),o=!1,s()}}}function Za(t){let e,r,n=!t[3]&&Ir(t);return{c(){n&&n.c(),e=Ce()},l(a){n&&n.l(a),e=Ce()},m(a,o){n&&n.m(a,o),B(a,e,o),r=!0},p(a,[o]){a[3]?n&&(it(),K(n,1,1,()=>{n=null}),lt()):n?(n.p(a,o),o&8&&j(n,1)):(n=Ir(a),n.c(),j(n,1),n.m(e.parentNode,e))},i(a){r||(j(n),r=!0)},o(a){K(n),r=!1},d(a){a&&E(e),n&&n.d(a)}}}function Qa(t,e,r){let{$$slots:n={},$$scope:a}=e,o=0,s=0,i,l,u=!1;const c=["/config/chords/","/config/layout/","/config/settings/"];return gn(f=>{const g=f.from?.url.pathname,d=f.to?.url.pathname;if(g!==d){if(r(3,u=!0),!(g&&d&&c.includes(g)&&c.includes(d)))r(0,o=0),r(1,s=0);else{const k=c.indexOf(g),p=c.indexOf(d);r(0,o=k>p?-1:1),r(1,s=k>p?1:-1)}l=new Promise(k=>{r(2,i=k)})}}),bn(async()=>{await l,r(3,u=!1)}),t.$$set=f=>{"$$scope"in f&&r(4,a=f.$$scope)},[o,s,i,u,a,n]}class xa extends Ne{constructor(e){super(),Se(this,e,Qa,Za,Re,{})}}var Hr={VITE_HOMEPAGE_URL:"https://github.com/CharaChorder/DeviceManager",VITE_DOCS_URL:"https://docs.charachorder.com",VITE_BUGS_URL:"https://github.com/CharaChorder/DeviceManager/issues",VITE_LEARN_URL:"https://www.iq-eq.io/",VITE_LATEST_FIRMWARE:"1.1.4",VITE_STORE_URL:"https://www.charachorder.com/",BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{document:ot}=qr;function eo(t){let e;const r=t[4].default,n=Ot(r,t,t[5],null);return{c(){n&&n.c()},l(a){n&&n.l(a)},m(a,o){n&&n.m(a,o),e=!0},p(a,o){n&&n.p&&(!e||o&32)&&Mt(n,r,a,a[5],e?Nt(r,a[5],o,null):Rt(a[5]),null)},i(a){e||(j(n,a),e=!0)},o(a){K(n,a),e=!1},d(a){n&&n.d(a)}}}function to(t){let e,r;return e=new La({}),{c(){Ge(e.$$.fragment)},l(n){He(e.$$.fragment,n)},m(n,a){$e(e,n,a),r=!0},i(n){r||(j(e.$$.fragment,n),r=!0)},o(n){K(e.$$.fragment,n),r=!1},d(n){Ye(e,n)}}}function ro(t){let e,r,n,a,o,s,i,l,u,c,f,g,d,k,p,m,A,_;ot.title=n=t[2].TITLE(),u=new Ia({}),f=new xa({props:{$$slots:{default:[eo]},$$scope:{ctx:t}}}),d=new Ja({});let I=Hr.TAURI_FAMILY===void 0&&_n&&!("serial"in navigator)&&to();return{c(){e=new Dt(!1),r=Ce(),a=L("meta"),s=L("meta"),l=S(),Ge(u.$$.fragment),c=S(),Ge(f.$$.fragment),g=S(),Ge(d.$$.fragment),k=S(),I&&I.c(),p=Ce(),this.h()},l(b){const T=Zr("svelte-1o8823w",ot.head);e=Pt(T,!1),r=Ce(),a=w(T,"META",{name:!0,content:!0}),s=w(T,"META",{name:!0,content:!0}),T.forEach(E),l=F(b),He(u.$$.fragment,b),c=F(b),He(f.$$.fragment,b),g=F(b),He(d.$$.fragment,b),k=F(b),I&&I.l(b),p=Ce(),this.h()},h(){e.a=r,C(a,"name","description"),C(a,"content",o=t[2].DESCRIPTION()),C(s,"name","theme-color"),C(s,"content",i=t[0].themeColor)},m(b,T){e.m(t[1],ot.head),h(ot.head,r),h(ot.head,a),h(ot.head,s),B(b,l,T),$e(u,b,T),B(b,c,T),$e(f,b,T),B(b,g,T),$e(d,b,T),B(b,k,T),I&&I.m(b,T),B(b,p,T),m=!0,A||(_=J(window,"keydown",t[3]),A=!0)},p(b,[T]){(!m||T&2)&&e.p(b[1]),(!m||T&4)&&n!==(n=b[2].TITLE())&&(ot.title=n),(!m||T&4&&o!==(o=b[2].DESCRIPTION()))&&C(a,"content",o),(!m||T&1&&i!==(i=b[0].themeColor))&&C(s,"content",i);const P={};T&32&&(P.$$scope={dirty:T,ctx:b}),f.$set(P)},i(b){m||(j(u.$$.fragment,b),j(f.$$.fragment,b),j(d.$$.fragment,b),j(I),m=!0)},o(b){K(u.$$.fragment,b),K(f.$$.fragment,b),K(d.$$.fragment,b),K(I),m=!1},d(b){b&&(e.d(),E(l),E(c),E(g),E(k),E(p)),E(r),E(a),E(s),Ye(u,b),Ye(f,b),Ye(d,b),I&&I.d(b),A=!1,_()}}}function no(t,e,r){let n,a,o;X(t,hn,d=>r(7,n=d)),X(t,wr,d=>r(8,a=d)),X(t,Je,d=>r(2,o=d));let{$$slots:s={},$$scope:i}=e;const l=localStorage.getItem("locale")||Dr();Pa(l),Pr(l);let u;u=un(),fn.setDefaultProps({animation:"shift-away",theme:"surface-variant",allowHTML:!0,duration:250,maxWidth:"none",arrow:!0});let{data:c}=e;$t(async()=>{if(mt.subscribe(d=>{const k=Sn(Nn(d.color)),p=d.mode==="dark";Bn(k,{target:document.body,dark:p})}),Hr.TAURI_FAMILY===void 0){const{initPwa:d}=await Lt(async()=>{const{initPwa:k}=await import("../chunks/pwa-setup.Cm4sYrbX.js");return{initPwa:k}},__vite__mapDeps([6,3]),import.meta.url);r(1,f=await d())}if(a.autoConnect&&await rn()&&await Vt(),c.importFile){Ct(c.importFile);const d=new URL(location.href);d.searchParams.delete("import"),await kn(d.href,{replaceState:!0})}}),Qr(()=>{u?.()});let f="";function g(d){let k=n.get(d.code);if(!k&&d.code==="Escape"&&(k="esc"),!k&&d.code==="ArrowLeft"&&(k="left"),!k&&d.code==="ArrowRight"&&(k="right"),!k&&d.code==="ArrowUp"&&(k="up"),!k&&d.code==="ArrowDown"&&(k="down"),!k)return;const p=[d.ctrlKey?"ctrl":void 0,d.shiftKey?"shift":void 0,d.altKey?"alt":void 0,k].filter(A=>!!A).join("+"),m=dn.get(p);m&&(d.preventDefault(),m.click())}return t.$$set=d=>{"data"in d&&r(0,c=d.data),"$$scope"in d&&r(5,i=d.$$scope)},[c,f,o,g,s,i]}class Eo extends Ne{constructor(e){super(),Se(this,e,no,ro,Re,{data:0})}}export{Eo as component,To as universal};
//# sourceMappingURL=2.D7oj51mw.js.map