From 77d10b266038b6d0e8e203010339c5770959384d Mon Sep 17 00:00:00 2001 From: H0rn0chse <47824204+H0rn0chse@users.noreply.github.com> Date: Sat, 26 Feb 2022 19:35:18 +0000 Subject: [PATCH] [CI] Updating dist files --- dist/bundle.js | 2 +- dist/bundle.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/bundle.js b/dist/bundle.js index 7ef98af..7639de2 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -1,6 +1,6 @@ /* @h0rn0chse/dark-mode-toggle - dist/bundle.js - version 2.1.0 - built at 2022-02-26 + version 2.1.1 - built at 2022-02-26 @license MIT */ (function () { diff --git a/dist/bundle.min.js b/dist/bundle.min.js index 29a1b62..a74be23 100644 --- a/dist/bundle.min.js +++ b/dist/bundle.min.js @@ -1,6 +1,6 @@ /* @h0rn0chse/dark-mode-toggle - dist/bundle.min.js - version 2.1.0 - built at 2022-02-26 + version 2.1.1 - built at 2022-02-26 @license MIT */ !function(){"use strict";class t{constructor(t=""){this.description=t,this.eventHandler=new Map}on(t,i,e){if(!this.has(t,i,e)){const a={eventName:t,callback:i,scope:e},s={once:!1,eventName:t};this.eventHandler.set(a,s)}}_getKey(t){return Array.from(this.eventHandler.keys()).find((i=>t.eventName===i.eventName&&t.callback===i.callback&&t.scope===i.scope))}once(t,i,e){if(!this.has(t,i,e)){const a={eventName:t,callback:i,scope:e},s={once:!0,eventName:t};this.eventHandler.set(a,s)}}has(t,i,e){const a={eventName:t,callback:i,scope:e};return!!this._getKey(a)}off(t,i,e){const a={eventName:t,callback:i,scope:e},s=this._getKey(a);this.eventHandler.delete(s)}emit(t,...i){this.eventHandler.forEach(((e,a,s)=>{if(e.eventName!==t)return;const n=a.scope?a.callback.bind(a.scope):a.callback;e.once&&s.delete(a);try{n(...i)}catch(t){console.error(t)}}))}}const i=new class extends t{constructor(){super("ThemeBus"),this.themes={light:document.querySelector("#light"),dark:document.querySelector("#dark")},this.initialized=!1}init(){if(this.initialized)return;this.initialized=!0;const t=localStorage.getItem("theme"),i=this._initWatcher();this._initThemes(t||i)}_getInverseTheme(t){switch(t){case"light":return this.themes.dark;case"dark":return this.themes.light}}_initWatcher(){const t=globalThis.matchMedia("(prefers-color-scheme: dark)");t.addEventListener("change",(i=>{const e=t.matches;this.setTheme(e?"dark":"light")}));return t.matches?"dark":"light"}_initThemes(t){this.currentTheme=t;this._getInverseTheme(t).remove()}setTheme(t){if(this.currentTheme===t)return;const i=this._getInverseTheme(t),e=this.themes[t].cloneNode();e.addEventListener("load",(e=>{i.remove(),this.emit("themeLoaded",{theme:t})}),{once:!0}),document.head.appendChild(e),this.themes[t]=e,this.currentTheme=t,localStorage.setItem("theme",t),this.emit("themeChanged",{theme:t})}getTheme(){return this.currentTheme}};class e extends t{constructor(t,i){super("ToggleBus"),this.button=t,this.player=i,this.player.loop=!1,this.player.addEventListener("complete",(t=>{this.onComplete(t)})),this.dir=1,this.isPlaying=!1}onComplete(t){this.isPlaying=!1,this.originalFrom=null,this.originalTo=null,this.emit("animationComplete",{})}setFrame(t){this.player.goToAndStop(t,!0),this.isPlaying=!1,this.fromFrame=null,this.toFrame=null}play(t,i){if(this.isPlaying){const e=Math.round(this.player.currentFrame);1===this.dir?(this.dir=-1,t=e+this.fromFrame,i=this.originalFrom||this.fromFrame,this.player.setDirection(this.dir),this.player.playSegments([t,i],!0)):(this.dir=1,t=this.fromFrame-e,this.player.setDirection(this.dir),this.player.playSegments([t,i],!0))}else this.dir=1,this.player.setDirection(this.dir),this.player.playSegments([t,i],!0),this.originalFrom=t,this.originalTo=i;this.isPlaying=!0,this.fromFrame=t,this.toFrame=i}}var a={v:"5.3.4",fr:24,ip:0,op:96,w:500,h:500,nm:"Toggle",ddd:0,assets:[],layers:[{ddd:0,ind:1,ty:4,nm:"Shutting Star",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[250,250,0],ix:2},a:{a:0,k:[0,0,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[-11.168,-2.743],[-25,-28]],o:[[28.5,7],[28.361,31.764]],v:[[-126,-24.5],[-27,37.5]],c:!1},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"tm",s:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},n:["0p833_0p833_0p167_0p167"],t:32,s:[0],e:[100]},{t:40}],ix:1},e:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},n:["0p833_0p833_0p167_0p167"],t:30,s:[0],e:[100]},{t:37}],ix:2},o:{a:0,k:0,ix:3},m:1,ix:2,nm:"Trim Paths 1",mn:"ADBE Vector Filter - Trim",hd:!1},{ty:"st",c:{a:0,k:[.933333333333,.992156862745,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:1,ix:5},lc:2,lj:2,nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:30,op:41,st:30,bm:0},{ddd:0,ind:2,ty:4,nm:"Moon",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:1,k:[{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:0,s:[-175.595],e:[0]},{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:24,s:[0],e:[0]},{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:48,s:[0],e:[-175.595]},{t:72}],ix:10},p:{s:!0,x:{a:1,k:[{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:0,s:[170],e:[330]},{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:24,s:[330],e:[330]},{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:48,s:[330],e:[170]},{t:72}],ix:3},y:{a:0,k:250,ix:4}},a:{a:0,k:[60.25,60.25,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[4.981,1.834],[0,7.828],[11.632,0],[2.39,-.941],[-1.477,0],[0,-11.632],[6.338,-3.63],[0,-5.618],[4.49,-2.06],[0,6.513]],o:[[6.338,-3.63],[0,-11.632],[-2.724,0],[1.391,-.289],[11.632,0],[0,7.828],[4.981,1.834],[0,5.263],[6.24,-.973],[0,-5.619]],v:[[3.775,7.124],[14.388,-11.16],[-6.674,-32.221],[-14.388,-30.757],[-10.079,-31.2],[10.983,-10.137],[.37,8.146],[8.911,20.374],[1.297,32.221],[12.317,19.353]],c:!0},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{ind:1,ty:"sh",ix:2,ks:{a:0,k:{i:[[1.534,0],[0,5.888],[-1.927,1.929],[0,-4.354],[-5.888,0],[-1.93,1.933]],o:[[-5.887,0],[0,-2.941],[-3.74,1.656],[0,5.887],[2.946,0],[-1.319,.584]],v:[[-57.252,37.674],[-67.912,27.014],[-64.794,19.481],[-71.147,29.228],[-60.487,39.888],[-52.944,36.76]],c:!0},ix:2},nm:"Path 2",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"fl",c:{a:1,k:[{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:0,s:[1,.940106153488,.53420650959,1],e:[.783999992819,.944999964097,.969000004787,1]},{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:24,s:[.783999992819,.944999964097,.969000004787,1],e:[.783999992819,.944999964097,.969000004787,1]},{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:48,s:[.783999992819,.944999964097,.969000004787,1],e:[1,.940106153488,.53420650959,1]},{t:72}],ix:4},o:{a:0,k:100,ix:5},r:1,nm:"Fill 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[86.845,53.361],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shadow",np:3,cix:2,ix:1,mn:"ADBE Vector Group",hd:!1},{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[4.981,1.834],[0,7.828],[11.632,0],[0,-11.632],[-10.302,-1.374],[0,-3.827],[-7.202,0],[0,7.202]],o:[[6.338,-3.63],[0,-11.632],[-11.632,0],[0,10.679],[-2.624,2.386],[0,7.202],[7.203,0],[0,-5.619]],v:[[10.449,7.038],[21.061,-11.246],[0,-32.307],[-21.061,-11.246],[-2.81,9.623],[-7.092,19.266],[5.949,32.307],[18.991,19.266]],c:!0},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{ind:1,ty:"sh",ix:2,ks:{a:0,k:{i:[[0,-5.888],[5.887,0],[0,5.887],[-5.888,0]],o:[[0,5.887],[-5.888,0],[0,-5.888],[5.887,0]],v:[[-43.153,29.141],[-53.813,39.801],[-64.473,29.141],[-53.813,18.481]],c:!0},ix:2},nm:"Path 2",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"fl",c:{a:1,k:[{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:0,s:[1,.940106153488,.53420650959,1],e:[.862999949736,.957000014361,.969000004787,1]},{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:24,s:[.862999949736,.957000014361,.969000004787,1],e:[.862999949736,.957000014361,.969000004787,1]},{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:48,s:[.862999949736,.957000014361,.969000004787,1],e:[1,.940106153488,.53420650959,1]},{t:72}],ix:4},o:{a:0,k:100,ix:5},r:1,nm:"Fill 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[80.171,53.448],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Crater",np:3,cix:2,ix:2,mn:"ADBE Vector Group",hd:!1},{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,-33.137],[33.137,0],[0,33.137],[-33.137,0]],o:[[0,33.137],[-33.137,0],[0,-33.137],[33.137,0]],v:[[60,0],[0,60],[-60,0],[0,-60]],c:!0},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"fl",c:{a:1,k:[{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:0,s:[1,.940106153488,.53420650959,1],e:[.933000033509,.991999966491,1,1]},{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:24,s:[.933000033509,.991999966491,1,1],e:[.933000033509,.991999966491,1,1]},{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:48,s:[.933000033509,.991999966491,1,1],e:[1,.940106153488,.53420650959,1]},{t:72}],ix:4},o:{a:0,k:100,ix:5},r:1,nm:"Fill 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[60.25,60.25],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Moon",np:2,cix:2,ix:3,mn:"ADBE Vector Group",hd:!1}],ip:0,op:1224,st:0,bm:0},{ddd:0,ind:3,ty:4,nm:"Stars",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},n:["0p833_0p833_0p167_0p167"],t:11,s:[0],e:[100]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},n:["0p833_0p833_0p167_0p167"],t:13,s:[100],e:[100]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},n:["0p833_0p833_0p167_0p167"],t:59,s:[100],e:[0]},{t:61}],ix:11},r:{a:0,k:0,ix:10},p:{s:!0,x:{a:1,k:[{i:{x:[.101],y:[.954]},o:{x:[.9],y:[0]},n:["0p101_0p954_0p9_0"],t:0,s:[304.75],e:[190.55]},{i:{x:[.438],y:[.439]},o:{x:[.397],y:[.396]},n:["0p438_0p439_0p397_0p396"],t:24,s:[190.55],e:[184.75]},{i:{x:[.1],y:[1]},o:{x:[.899],y:[-.043]},n:["0p1_1_0p899_-0p043"],t:48,s:[184.75],e:[304.75]},{t:72}],ix:3},y:{a:0,k:212.75,ix:4}},a:{a:0,k:[0,0,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,shapes:[{ty:"gr",it:[{d:1,ty:"el",s:{a:0,k:[10,10],ix:2},p:{a:0,k:[0,0],ix:3},nm:"Ellipse Path 1",mn:"ADBE Vector Shape - Ellipse",hd:!1},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:32,ix:5},lc:1,lj:1,ml:4,ml2:{a:0,k:4,ix:8},nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:!0},{ty:"fl",c:{a:0,k:[.933333333333,.992156862745,1,1],ix:4},o:{a:0,k:100,ix:5},r:1,nm:"Fill 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[-32.5,65],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Star 03",np:3,cix:2,ix:1,mn:"ADBE Vector Group",hd:!1},{ty:"gr",it:[{d:1,ty:"el",s:{a:0,k:[6,6],ix:2},p:{a:0,k:[0,0],ix:3},nm:"Ellipse Path 1",mn:"ADBE Vector Shape - Ellipse",hd:!1},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:32,ix:5},lc:1,lj:1,ml:4,ml2:{a:0,k:4,ix:8},nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:!0},{ty:"fl",c:{a:0,k:[.933333333333,.992156862745,1,1],ix:4},o:{a:0,k:100,ix:5},r:1,nm:"Fill 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[47.5,45],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Star 02",np:3,cix:2,ix:2,mn:"ADBE Vector Group",hd:!1},{ty:"gr",it:[{d:1,ty:"el",s:{a:0,k:[8,8],ix:2},p:{a:0,k:[0,0],ix:3},nm:"Ellipse Path 1",mn:"ADBE Vector Shape - Ellipse",hd:!1},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:32,ix:5},lc:1,lj:1,ml:4,ml2:{a:0,k:4,ix:8},nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:!0},{ty:"fl",c:{a:0,k:[.933333333333,.992156862745,1,1],ix:4},o:{a:0,k:100,ix:5},r:1,nm:"Fill 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Star 01",np:3,cix:2,ix:3,mn:"ADBE Vector Group",hd:!1}],ip:0,op:96,st:0,bm:0},{ddd:0,ind:4,ty:4,nm:"Cloud 1",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},n:["0p833_0p833_0p167_0p167"],t:11,s:[100],e:[0]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},n:["0p833_0p833_0p167_0p167"],t:13,s:[0],e:[0]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},n:["0p833_0p833_0p167_0p167"],t:59,s:[0],e:[100]},{t:61}],ix:11},r:{a:0,k:0,ix:10},p:{s:!0,x:{a:1,k:[{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:0,s:[275.5],e:[184]},{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:24,s:[184],e:[184]},{i:{x:[.102],y:[.92]},o:{x:[.9],y:[0]},n:["0p102_0p92_0p9_0"],t:48,s:[184],e:[269.054]},{i:{x:[.731],y:[1]},o:{x:[.225],y:[.253]},n:["0p731_1_0p225_0p253"],t:72,s:[269.054],e:[275.5]},{t:95}],ix:3},y:{a:0,k:220,ix:4}},a:{a:0,k:[0,0,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[4.193,.263],[4.158,0],[0,0],[.688,-3.952],[0,0],[0,-4.43],[0,0],[-4.43,0],[0,0],[0,4.43],[0,0]],o:[[-.677,-3.965],[0,0],[-4.149,0],[0,0],[-4.43,0],[0,0],[0,4.43],[0,0],[4.43,0],[0,0],[0,-4.259]],v:[[11.887,-4.516],[3.601,-11.5],[3.601,-11.5],[-4.68,-4.542],[-11.38,-4.542],[-19.401,3.479],[-19.401,3.479],[-11.38,11.5],[11.38,11.5],[19.401,3.479],[19.401,3.479]],c:!0},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:32,ix:5},lc:1,lj:1,ml:4,ml2:{a:0,k:4,ix:8},nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:!0},{ty:"fl",c:{a:0,k:[1,1,1,1],ix:4},o:{a:0,k:100,ix:5},r:1,nm:"Fill 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:96,st:0,bm:0},{ddd:0,ind:5,ty:4,nm:"Cloud 2",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},n:["0p833_0p833_0p167_0p167"],t:11,s:[100],e:[0]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},n:["0p833_0p833_0p167_0p167"],t:13,s:[0],e:[0]},{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},n:["0p833_0p833_0p167_0p167"],t:59,s:[0],e:[100]},{t:61}],ix:11},r:{a:0,k:0,ix:10},p:{s:!0,x:{a:1,k:[{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:0,s:[330.5],e:[167.5]},{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:24,s:[167.5],e:[167.5]},{i:{x:[.101],y:[.95]},o:{x:[.9],y:[0]},n:["0p101_0p95_0p9_0"],t:48,s:[167.5],e:[324.054]},{i:{x:[.731],y:[1]},o:{x:[.218],y:[.284]},n:["0p731_1_0p218_0p284"],t:72,s:[324.054],e:[330.5]},{t:95}],ix:3},y:{a:0,k:265,ix:4}},a:{a:0,k:[0,0,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[6.375,.399],[6.322,0],[0,0],[1.046,-6.009],[0,0],[0,-6.736],[0,0],[-6.736,0],[0,0],[0,6.736],[0,0]],o:[[-1.03,-6.029],[0,0],[-6.308,0],[0,0],[-6.736,0],[0,0],[0,6.736],[0,0],[6.736,0],[0,0],[0,-6.476]],v:[[16.075,-1.367],[3.476,-11.986],[3.476,-11.986],[-9.116,-1.406],[-19.304,-1.406],[-31.5,10.79],[-31.5,10.79],[-19.304,22.986],[15.304,22.986],[27.5,10.79],[27.5,10.79]],c:!0},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:32,ix:5},lc:1,lj:1,ml:4,ml2:{a:0,k:4,ix:8},nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:!0},{ty:"fl",c:{a:0,k:[1,1,1,1],ix:4},o:{a:0,k:100,ix:5},r:1,nm:"Fill 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:96,st:0,bm:0},{ddd:0,ind:6,ty:4,nm:"Shadow",sr:1,ks:{o:{a:0,k:15,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[250,180,0],ix:2},a:{a:0,k:[0,-37.154,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[37.432,0],[0,0],[0,-37.432],[0,0],[-.021,-.694],[-36.733,0],[0,0],[-1.105,-36.465],[0,.699],[0,0]],o:[[0,0],[-37.432,0],[0,0],[0,.699],[1.105,-36.465],[0,0],[36.733,0],[.021,-.694],[0,0],[0,-37.432]],v:[[82.223,-37.154],[-82.223,-37.154],[-150,30.623],[-150,35.069],[-149.947,37.154],[-82.223,-28.538],[82.223,-28.538],[149.947,37.154],[150,35.069],[150,30.623]],c:!0},ix:2},nm:"Path 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[.933333333333,.992156862745,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:1,ix:5},lc:1,lj:1,ml:4,ml2:{a:0,k:4,ix:8},nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:!0},{ty:"fl",c:{a:0,k:[0,0,0,1],ix:4},o:{a:0,k:100,ix:5},r:1,nm:"Fill 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Shape 1",np:3,cix:2,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:96,st:0,bm:0},{ddd:0,ind:7,ty:4,nm:"Base",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[250,180,0],ix:2},a:{a:0,k:[0,-70,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,shapes:[{ty:"gr",it:[{ty:"rc",d:1,s:{a:0,k:[300,140],ix:2},p:{a:0,k:[0,0],ix:3},r:{a:0,k:320,ix:4},nm:"Rectangle Path 1",mn:"ADBE Vector Shape - Rect",hd:!1},{ty:"fl",c:{a:1,k:[{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:0,s:[.413832724094,.784281790257,1,1],e:[.0580506064,.077281616628,.256188720465,1]},{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:24,s:[.0580506064,.077281616628,.256188720465,1],e:[.0580506064,.077281616628,.256188720465,1]},{i:{x:[.1],y:[1]},o:{x:[.9],y:[0]},n:["0p1_1_0p9_0"],t:48,s:[.0580506064,.077281616628,.256188720465,1],e:[.413832724094,.784281790257,1,1]},{t:72}],ix:4},o:{a:0,k:100,ix:5},r:1,nm:"Fill 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Rectangle 1",np:2,cix:2,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:96,st:0,bm:0},{ddd:0,ind:8,ty:4,nm:"BG",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[250,250,0],ix:2},a:{a:0,k:[0,0,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,shapes:[{ty:"gr",it:[{ty:"rc",d:1,s:{a:0,k:[500,500],ix:2},p:{a:0,k:[0,0],ix:3},r:{a:0,k:0,ix:4},nm:"Rectangle Path 1",mn:"ADBE Vector Shape - Rect",hd:!1},{ty:"st",c:{a:0,k:[1,1,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:18.8,ix:5},lc:1,lj:1,ml:4,ml2:{a:0,k:4,ix:8},nm:"Stroke 1",mn:"ADBE Vector Graphic - Stroke",hd:!0},{ty:"tr",p:{a:0,k:[0,0],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Transform"}],nm:"Rectangle 1",np:3,cix:2,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:96,st:0,bm:0}],markers:[]};const{lottie:s}=globalThis,n=320/149.3333,r={width:320,useThemeHandler:!0,theme:void 0};class o extends t{constructor(t,n){super("ButtonBus"),this.options=Object.assign({},r,n),this.options.height&&(this.options.width=this._getOuterWidth()),this.options.useThemeHandler&&(i.init(),i.on("themeChanged",this.onThemeChanged,this)),this.outerContainer=document.createElement("div"),this.outerContainer.classList.add("toggleContainer","toggleButton"),this.outerContainer.addEventListener("click",(t=>{this._toggle()})),this.innerContainer=document.createElement("div"),this.outerContainer.appendChild(this.innerContainer),t.appendChild(this.outerContainer),this.player=s.loadAnimation({container:this.innerContainer,renderer:"svg",animationData:a,loop:!1,autoplay:!1}),this.player.addEventListener("DOMLoaded",(t=>{this._setWidth()})),this.player.setSpeed(2),this.wrapper=new e(this,this.player),this.wrapper.on("animationComplete",this.onAnimationComplete,this),this.animations={toDark:{start:2,end:50},toLight:{start:51,end:80}};const{useThemeHandler:o,theme:h}=this.options;switch(h||o&&i.getTheme()){case"light":this.player.goToAndStop(this.animations.toLight.end,!0),this.currentAnimation="toLight";break;default:this.player.goToAndStop(this.animations.toDark.end,!0),this.currentAnimation="toDark"}}_setWidth(){const t=this._getInnerWidth();this.innerContainer.style.width=`${t}px`,this.innerContainer.style.height=`${t}px`;const i=this.options.width,e=this.options.width/n;this.outerContainer.style.width=`${i}px`,this.outerContainer.style.height=`${e}px`}setWidth(t){if("number"!=typeof t)return new Error("The width is required to be a number!");this.options.width=t,this._setWidth()}setHeight(t){if("number"!=typeof t)return new Error("The height is required to be a number!");this.options.height=t,this.options.width=this._getOuterWidth(),this._setWidth()}setTheme(t,i=!1){if("dark"!==t&&"light"!==t)return new Error("The theme is required to be 'dark' or 'light'");this._getTheme()!==t&&this._toggle(i)}_getOuterWidth(){return this.options.height*n}_getInnerWidth(){return 1.6666666666666667*this.options.width}_getInverseAnimation(){return"toDark"===this.currentAnimation?"toLight":"toDark"}_getTheme(){return"toDark"===this.currentAnimation?"dark":"light"}_toggle(t){const e=this._getInverseAnimation(),a=this.animations[e];t?this.wrapper.setFrame(a.end):this.wrapper.play(a.start,a.end),this.currentAnimation=e;const s=this._getTheme();this.emit("click",{theme:s}),this.emit("animationStart",{theme:s}),this.options.useThemeHandler&&i.setTheme(s)}onAnimationComplete(){const t=this._getTheme();this.emit("animationComplete",{theme:t})}onThemeChanged(t){const i=this._getTheme();t.theme!==i&&this._toggle()}}const h=document.createElement("template");h.innerHTML="";class p extends HTMLElement{static get observedAttributes(){return["width","height","theme"]}connectedCallback(){this.attachShadow({mode:"open"});const t={width:this.getAttribute("width"),height:this.getAttribute("height"),theme:this.getAttribute("theme"),useThemeHandler:this.getAttribute("useThemeHandler")??!0};this.shadowRoot.appendChild(h.content.cloneNode(!0)),this.button=new o(this.shadowRoot,t),this.button.on("click",(t=>{this.setAttribute("theme",t.theme)}))}attributeChangedCallback(t,i,e){if(null!=e&&i!==e)switch(t){case"width":this.setWidth(parseInt(e,10));break;case"height":this.setHeight(parseInt(e,10));break;case"theme":this.setTheme(e);break;default:throw new Error(`The property ${t} is not supported`)}}setWidth(t){this.button?.setWidth(t),this.setAttribute("width",t),this.removeAttribute("height")}setHeight(t){this.button?.setHeight(t),this.setAttribute("height",t),this.removeAttribute("width")}setTheme(t,i){this.button?.setTheme(t,i),this.setAttribute("theme",t)}on(...t){this.button?.on(...t),i.initialized&&i.on(...t)}once(...t){this.button?.once(...t),i.initialized&&i.once(...t)}off(...t){this.button?.off(...t),i.initialized&&i.off(...t)}}window.customElements.define("dark-mode-toggle",p),globalThis.darkModeToggle={Button:o,ThemeHandler:i}}();